Skip to content

Commit

Permalink
Merge pull request #42 from josemmo/develop
Browse files Browse the repository at this point in the history
v0.2.6
  • Loading branch information
josemmo authored Jun 24, 2023
2 parents d52f938 + db6e3ce commit a36c507
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/InvoiceLine.php
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ public function setBaseQuantity(float $baseQuantity): self {

/**
* Get total net amount (without VAT) before allowances/charges
* @return float|null Net amount before allowances/charges
* @return float|null Net amount before allowances/charges
*/
public function getNetAmountBeforeAllowancesCharges(): ?float {
if ($this->price === null) {
Expand All @@ -308,7 +308,7 @@ public function getNetAmountBeforeAllowancesCharges(): ?float {

/**
* Get allowances total amount
* @return float Allowances total amount
* @return float Allowances total amount
*/
public function getAllowancesAmount(): float {
$allowancesAmount = 0;
Expand All @@ -322,7 +322,7 @@ public function getAllowancesAmount(): float {

/**
* Get charges total amount
* @return float Charges total amount
* @return float Charges total amount
*/
public function getChargesAmount(): float {
$chargesAmount = 0;
Expand All @@ -337,7 +337,7 @@ public function getChargesAmount(): float {
/**
* Get total net amount (without VAT)
* NOTE: inclusive of line level allowances and charges
* @return float|null Net amount
* @return float|null Net amount
*/
public function getNetAmount(): ?float {
$netAmount = $this->getNetAmountBeforeAllowancesCharges();
Expand Down
4 changes: 2 additions & 2 deletions src/Writers/UblWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -740,8 +740,8 @@ private function addAllowanceOrCharge(

// Amount
$baseAmount = $atDocumentLevel ?
$totals->netAmount : // @phan-suppress-current-line PhanPossiblyUndeclaredProperty
$line->getNetAmount() ?? 0.0; // @phan-suppress-current-line PhanPossiblyNonClassMethodCall
$totals->netAmount : // @phan-suppress-current-line PhanPossiblyUndeclaredProperty
$line->getNetAmountBeforeAllowancesCharges() ?? 0.0; // @phan-suppress-current-line PhanPossiblyNonClassMethodCall
$this->addAmountNode(
$xml,
'cbc:Amount',
Expand Down
8 changes: 4 additions & 4 deletions tests/Integration/peppol-allowance.xml
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@
<cbc:AllowanceChargeReasonCode>CG</cbc:AllowanceChargeReasonCode>
<cbc:AllowanceChargeReason>Cleaning</cbc:AllowanceChargeReason>
<cbc:MultiplierFactorNumeric>1</cbc:MultiplierFactorNumeric>
<cbc:Amount currencyID="EUR">40.4</cbc:Amount>
<cbc:BaseAmount currencyID="EUR">4040</cbc:BaseAmount>
<cbc:Amount currencyID="EUR">41</cbc:Amount>
<cbc:BaseAmount currencyID="EUR">4100</cbc:BaseAmount>
</cac:AllowanceCharge>
<cac:Item>
<cbc:Description>Description of item</cbc:Description>
Expand Down Expand Up @@ -298,8 +298,8 @@
<cbc:AllowanceChargeReasonCode>CG</cbc:AllowanceChargeReasonCode>
<cbc:AllowanceChargeReason>Charge</cbc:AllowanceChargeReason>
<cbc:MultiplierFactorNumeric>1</cbc:MultiplierFactorNumeric>
<cbc:Amount currencyID="EUR">9.09</cbc:Amount>
<cbc:BaseAmount currencyID="EUR">909</cbc:BaseAmount>
<cbc:Amount currencyID="EUR">10</cbc:Amount>
<cbc:BaseAmount currencyID="EUR">1000</cbc:BaseAmount>
</cac:AllowanceCharge>
<cac:Item>
<cbc:Description>Description of item</cbc:Description>
Expand Down

0 comments on commit a36c507

Please sign in to comment.