fix : invoicePriceAndQtyFix

This commit is contained in:
zakaria.hachem
2025-11-13 16:16:25 +01:00
parent 815d2b927f
commit b8b21600e6

View File

@ -547,31 +547,31 @@ public class StockMoveMultiInvoiceServiceImpl implements StockMoveMultiInvoiceSe
Invoice refund = new RefundInvoice(invoice).generate(); Invoice refund = new RefundInvoice(invoice).generate();
if (refund.getInvoiceLineList() != null) { if (refund.getInvoiceLineList() != null) {
for (InvoiceLine invoiceLine : refund.getInvoiceLineList()) { for (InvoiceLine invoiceLine : refund.getInvoiceLineList()) {
invoiceLine.setPrice(invoiceLine.getPrice().negate()); invoiceLine.setPrice(invoiceLine.getPrice());
invoiceLine.setPriceDiscounted(invoiceLine.getPriceDiscounted().negate()); invoiceLine.setPriceDiscounted(invoiceLine.getPriceDiscounted());
invoiceLine.setInTaxPrice(invoiceLine.getInTaxPrice().negate()); invoiceLine.setInTaxPrice(invoiceLine.getInTaxPrice());
invoiceLine.setExTaxTotal(invoiceLine.getExTaxTotal().negate()); invoiceLine.setExTaxTotal(invoiceLine.getExTaxTotal());
invoiceLine.setInTaxTotal(invoiceLine.getInTaxTotal().negate()); invoiceLine.setInTaxTotal(invoiceLine.getInTaxTotal());
invoiceLine.setCompanyExTaxTotal(invoiceLine.getCompanyExTaxTotal().negate()); invoiceLine.setCompanyExTaxTotal(invoiceLine.getCompanyExTaxTotal());
invoiceLine.setCompanyInTaxTotal(invoiceLine.getCompanyInTaxTotal().negate()); invoiceLine.setCompanyInTaxTotal(invoiceLine.getCompanyInTaxTotal());
} }
} }
if (refund.getInvoiceLineTaxList() != null) { if (refund.getInvoiceLineTaxList() != null) {
for (InvoiceLineTax invoiceLineTax : refund.getInvoiceLineTaxList()) { for (InvoiceLineTax invoiceLineTax : refund.getInvoiceLineTaxList()) {
invoiceLineTax.setExTaxBase(invoiceLineTax.getExTaxBase().negate()); invoiceLineTax.setExTaxBase(invoiceLineTax.getExTaxBase());
invoiceLineTax.setTaxTotal(invoiceLineTax.getTaxTotal().negate()); invoiceLineTax.setTaxTotal(invoiceLineTax.getTaxTotal());
invoiceLineTax.setCompanyExTaxBase(invoiceLineTax.getCompanyExTaxBase().negate()); invoiceLineTax.setCompanyExTaxBase(invoiceLineTax.getCompanyExTaxBase());
invoiceLineTax.setInTaxTotal(invoiceLineTax.getInTaxTotal().negate()); invoiceLineTax.setInTaxTotal(invoiceLineTax.getInTaxTotal());
invoiceLineTax.setCompanyInTaxTotal(invoiceLineTax.getCompanyInTaxTotal().negate()); invoiceLineTax.setCompanyInTaxTotal(invoiceLineTax.getCompanyInTaxTotal());
} }
} }
refund.setExTaxTotal(refund.getExTaxTotal().negate()); refund.setExTaxTotal(refund.getExTaxTotal());
refund.setInTaxTotal(refund.getInTaxTotal().negate()); refund.setInTaxTotal(refund.getInTaxTotal());
refund.setCompanyExTaxTotal(refund.getCompanyExTaxTotal().negate()); refund.setCompanyExTaxTotal(refund.getCompanyExTaxTotal());
refund.setCompanyInTaxTotal(refund.getCompanyInTaxTotal().negate()); refund.setCompanyInTaxTotal(refund.getCompanyInTaxTotal());
refund.setTaxTotal(refund.getTaxTotal().negate()); refund.setTaxTotal(refund.getTaxTotal());
refund.setAmountRemaining(refund.getAmountRemaining().negate()); refund.setAmountRemaining(refund.getAmountRemaining());
refund.setCompanyTaxTotal(refund.getCompanyTaxTotal().negate()); refund.setCompanyTaxTotal(refund.getCompanyTaxTotal());
return invoiceRepository.save(refund); return invoiceRepository.save(refund);
} }