Skip to content

Commit

Permalink
[ENH] Added ZugferdDocumentBuilder::setDocumentPositionLineSummationE…
Browse files Browse the repository at this point in the history
…xt to satisfy the EXTENDED profile
  • Loading branch information
HorstOeko committed Dec 3, 2024
1 parent 75ae647 commit ea74726
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/ZugferdDocumentBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -3106,6 +3106,25 @@ public function setDocumentPositionLineSummation(float $lineTotalAmount): Zugfer
return $this;
}

/**
* Set information on item totals (with support for EXTENDED profile)
*
* @param float $lineTotalAmount __BT-131, From BASIC__ The total amount of the invoice item
* @param float $chargeTotalAmount __BT-X-327, From EXTENDED__ Total amount of item surcharges
* @param float $allowanceTotalAmount __BT-X-328, From EXTENDED__ Total amount of item discounts
* @param float $taxTotalAmount __BT-X-329, From EXTENDED__ Total amount of item taxes
* @param float $grandTotalAmount __BT-X-330, From EXTENDED__ Total gross amount of the item
* @param float $totalAllowanceChargeAmount __BT-X-98, From EXTENDED__ Total amount of item surcharges and discounts
* @return ZugferdDocumentBuilder
*/
public function setDocumentPositionLineSummationExt(float $lineTotalAmount, ?float $chargeTotalAmount = null, ?float $allowanceTotalAmount = null, ?float $taxTotalAmount = null, ?float $grandTotalAmount = null, ?float $totalAllowanceChargeAmount = null): ZugferdDocumentBuilder
{
$positionsettlement = $this->getObjectHelper()->tryCallAndReturn($this->currentPosition, "getSpecifiedLineTradeSettlement");
$summation = $this->getObjectHelper()->getTradeSettlementLineMonetarySummationType($lineTotalAmount, $chargeTotalAmount, $allowanceTotalAmount, $taxTotalAmount, $grandTotalAmount, $totalAllowanceChargeAmount);
$this->getObjectHelper()->tryCall($positionsettlement, "setSpecifiedTradeSettlementLineMonetarySummation", $summation);
return $this;
}

/**
* Add an AccountingAccount on position level
*
Expand Down

0 comments on commit ea74726

Please sign in to comment.