Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to add more line of DettagliPagamento #32

Open
mdeprezzo opened this issue Dec 2, 2023 · 0 comments
Open

Allow to add more line of DettagliPagamento #32

mdeprezzo opened this issue Dec 2, 2023 · 0 comments

Comments

@mdeprezzo
Copy link

mdeprezzo commented Dec 2, 2023

just add these controls?
Something like that:

    /**
     * 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);
    } 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant