Skip to content

Commit

Permalink
Merge pull request #19 from iranl/extend-all-testing
Browse files Browse the repository at this point in the history
Upload
  • Loading branch information
iranl authored Jul 21, 2019
2 parents 6f1a37f + 479067f commit 40307e6
Show file tree
Hide file tree
Showing 8 changed files with 1,041 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/Activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@
$activityProjects->setValidTill($validTill); // DateTimeInterface|null An activity can be set to only be valid for certain dates. Users will then only be able to book hours to the activity during these dates.
$activityProjects->setValidTill(Util::parseDate('20191231')); // string|null

// The minimum amount of ActivityQuantities linked to a ActivityProjects object is 0, the maximum amount is 4
// The minimum amount of ActivityQuantities linked to an ActivityProjects object is 0, the maximum amount is 4
$activityQuantity = new \PhpTwinfield\ActivityQuantity;
$activityQuantity->setBillable(false); // bool|null Is the quantity line billable or not.
$activityQuantity->setBillableLocked(false); // bool|null
Expand Down
4 changes: 2 additions & 2 deletions examples/BankTransaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
*/

/* Read a BankTransaction based off the passed in bank day book code, transaction number and optionally the office.
* The used transaction type, in the example below BNK depends on the administration. It is possible that there are multiple bank day book codes in an administration.
* The used transaction type, in the example below BNK, depends on the administration. It is possible that there are multiple bank day book codes in an administration.
* See https://accounting.twinfield.com/UI/#/Settings/Company/TransactionTypes for available codes for (bank) day books in your office
*/

Expand Down Expand Up @@ -267,7 +267,7 @@
$bankTransactionLine2->setDim1($dim1); // object|null If line type = total the bank balance account. If line type = detail the customer or supplier balance account or profit and loss account.
$bankTransactionLine2->setDim1(\PhpTwinfield\GeneralLedger::fromCode('2500')); // string|null If line type = vat the VAT balance account. When an empty dim1 is entered, by default the general ledger account will be taken as entered at the VAT code in Twinfield.
$bankTransactionLine2->setID(2); // int|null Line ID.
$bankTransactionLine2->setValue(\Money\Money::EUR(-10000)); // Money|null If line type = total amount including VAT. If line type = detail amount without VAT. If line type = vat VAT amount.
$bankTransactionLine2->setValue(\Money\Money::EUR(-10000)); // Money|null If line type = total amount including VAT. If line type = detail amount without VAT. If line type = vat VAT amount.

//$bankTransactionLine2->setComment('Example Comments'); // string|null Comment set on the transaction line.
$currencyDate = \DateTime::createFromFormat('d-m-Y', '01-09-2019');
Expand Down
2 changes: 1 addition & 1 deletion examples/CashTransaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
*/

/* Read a CashTransaction based off the passed in cash day book code, transaction number and optionally the office.
* The used transaction type, in the example below KAS depends on the administration. It is possible that there are multiple cash day book codes in an administration.
* The used transaction type, in the example below KAS, depends on the administration. It is possible that there are multiple cash day book codes in an administration.
* See https://accounting.twinfield.com/UI/#/Settings/Company/TransactionTypes for available codes for (cash) day books in your office
*/

Expand Down
336 changes: 336 additions & 0 deletions examples/JournalTransaction.php

Large diffs are not rendered by default.

347 changes: 347 additions & 0 deletions examples/PurchaseTransaction.php

Large diffs are not rendered by default.

352 changes: 352 additions & 0 deletions examples/SalesTransaction.php

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/ApiConnectors/ActivityApiConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function get(string $code, Office $office): Activity
}

/**
* Sends a Activity instance to Twinfield to update or add.
* Sends an Activity instance to Twinfield to update or add.
*
* @param Activity $activity
* @return Activity
Expand Down
2 changes: 1 addition & 1 deletion src/Mappers/TransactionMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public static function map(string $transactionClassName, Response $response, Aut
}

if (Util::objectUses(RegimeField::class, $transaction)) {
$transaction->setRegime(self::getField($transactionElement, 'regime', $transaction));
$transaction->setRegime(self::parseEnumAttribute(\PhpTwinfield\Enums\Regime::class, self::getField($transactionElement, 'regime', $transaction)));
}

if (Util::objectUses(StatementNumberField::class, $transaction)) {
Expand Down

0 comments on commit 40307e6

Please sign in to comment.