-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #138 from Sysix/pursue-vouchers
Pursue vouchers
- Loading branch information
Showing
15 changed files
with
179 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Sysix\LexOffice\Clients\Traits; | ||
|
||
use Psr\Http\Message\ResponseInterface; | ||
use Sysix\LexOffice\Utils; | ||
|
||
trait PursueFinalizeTrait | ||
{ | ||
/** | ||
* @param mixed[] $data | ||
*/ | ||
public function pursue(string $precedingSalesVoucherId, array $data, bool $finalized = false): ResponseInterface | ||
{ | ||
$api = $this->api->newRequest('POST', $this->resource . '?precedingSalesVoucherId=' . rawurlencode($precedingSalesVoucherId) . ($finalized ? '&finalize=true' : '')); | ||
|
||
$api->setRequest($api->getRequest()->withBody(Utils::createStream($data))); | ||
|
||
return $api->getResponse(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Sysix\LexOffice\Clients\Traits; | ||
|
||
use Psr\Http\Message\ResponseInterface; | ||
use Sysix\LexOffice\Utils; | ||
|
||
trait PursueTrait | ||
{ | ||
/** | ||
* @param mixed[] $data | ||
*/ | ||
public function pursue(string $precedingSalesVoucherId, array $data): ResponseInterface | ||
{ | ||
$api = $this->api->newRequest('POST', $this->resource . '?precedingSalesVoucherId=' . rawurlencode($precedingSalesVoucherId)); | ||
|
||
$api->setRequest($api->getRequest()->withBody(Utils::createStream($data))); | ||
|
||
return $api->getResponse(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.