A PHP package for managing italian e-invoice and notice XML formats. (Pacchetto PHP per gestire il formato XML di fatture e notifiche come richiesto dal SdI).
/**
* Add payment detail line item
*/
public function addPaymentDetailLineItem( int $n, int $bodyIndex = 1 )
{
if ($n < 1) {
return $this;
}
if ($bodyIndex < 1) {
throw new \Exception("Invalid body index '$bodyIndex'");
}
$body = $this->getBody($bodyIndex);
$line = $this->getElement('DatiPagamento', $body);
for ($i = 0; $i < $n; $i++) {
$this->addElement($line->cloneNode(true), $body);
}
return $this;
}
/**
* Get payment detail line item i
*/
public function getPaymentDetailLineItem( int $i, int $bodyIndex = 1 )
{
$body = $this->getBody($bodyIndex);
return $this->getElement("DatiPagamento[$i]", $body);
}
/**
* Set number of payment detail line items
*/
public function setPaymentDetailLineItemCount( int $n, int $bodyIndex = 1 )
{
return $this->addPaymentDetailLineItem($n - 1, $bodyIndex);
}
just add these controls? Something like that: