Closed homebeaver closed 3 years ago
here some examples:
create
method // BG-27 0..n LINE ALLOWANCES:
BigDecimal tenPerCent = new BigDecimal(10);
line.addAllowance(new Amount(new BigDecimal(6.00)), new Amount(new BigDecimal(60.00)), tenPerCent);
// BG-28 0..n LINE CHARGES:
AllowancesAndCharges charge = line.createCharge(new Amount(new BigDecimal(6.00)), new Amount(new BigDecimal(60.00)), tenPerCent);
charge.setReasoncode("64"); // UNTDID 5189 code
charge.setReasonText("Special agreement");
line.addAllowanceCharge(charge);
...
line.setUnitPriceAllowance(new UnitPriceAmount(EUR, new BigDecimal(21.21)) // priceDiscount
,new UnitPriceAmount(EUR, new BigDecimal(310))); // grossPrice
...
// BG-20 0..n DOCUMENT LEVEL ALLOWANCE:
BigDecimal tenPerCent = new BigDecimal(10);
AllowancesAndCharges allowance = invoice.createAllowance(new Amount(new BigDecimal(31)), new Amount(new BigDecimal(310)), tenPerCent);
allowance.setReasoncode("64");
allowance.setReasonText("SPECIAL AGREEMENT");
allowance.setTaxType(TaxTypeCode.VAT);
allowance.setTaxCategoryCode(TaxCategoryCode.StandardRate);
allowance.setTaxPercentage(new BigDecimal(20));
invoice.addAllowanceCharge(allowance);
solved in 3.1.0
need an example.