0

I have invoices recovered by collection.

   $collection = $this->invoiceCollectionFactory->create()
        ->addAttributeToSelect('*')
 
        );

From this collection how can I get the including taxes price of an invoice ?

This is the code I currently have who must be fine for Exclude taxes. What datas should I had to add / remove to get InclusiveTaxes on the Invoice ?

$grandTotalExcl = $invoice->getData('base_shipping_amount') + $invoice->getData('base_subtotal')
                + $invoice->getData('base_discount_amount')
                + $invoice->getData('base_discount_tax_compensation_amount')
                + $invoice->getData('base_shipping_discount_tax_compensation_amnt');

Thanks

2 Answers 2

1

You need to check this field.

$invoice->getData('base_subtotal_incl_tax');

1

below code for getting invoice price including tax.

$grandTotalExcl = $invoice->getData('base_subtotal_incl_tax');

or

$grandTotalExcl = $invoice->getData('subtotal_incl_tax');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.