### Symptom

On the PDF output of a partial or final invoice with down payment settlement, the clearing overview of the invoice shows a small amount (for example, 1 cent) as Open Total Amount. Expected is an Open Total Amount of 0.

### Environment

SAP S/4HANA Cloud Public Edition

### Cause

In the down payment process, tax rounding differences with regards to the deducted down payments may occur in the partial and final invoices.

Even though the complete invoice amount is covered by available down payments, a small amount (for example, 1 cent) may appear as open for payment.

But, in Financial Accounting (FI), the postings for the down payment settlement can still appear correct.

A higher tax amount than a paid tax amount should never be settled.

### Resolution

Workaround, only in cases where:

- The rounding difference is caused by the fact that the down payment settlement position is statistical, thus not taken into account for the rounding difference compensation, and
- The down payment settlement is 100%, thus the net value is equal to zero.

To settle the entire down payment amount, you can calculate the rounding difference using scripting within your custom form.

With the calculated rounding difference you can calculate the correct total tax and gross amounts. But this is only a solution in case you settle the entire down payments.

Explanation in details:

Within the XML under node DownPaymentOverview you get the needed information to calculate the rounding difference.

In case the amount within node DownPaymentTaxAmount is smaller or equal the amount within node DownPayment SettlementTaxAmount, you can calculate the difference. This is equal to the rounding difference.

if (DownPaymentTaxAmount <= DownPaymentSettlementTaxAmount) {

roundingDifference = DownPaymentTaxAmount - DownPaymentSettlementTaxAmount;

}

The calculated rounding difference must be used to calculate the correct total amounts.

If (roundingDifference != 0) {

NewDownPaymentSettlementTaxAmount = DownPaymentSettlementTaxAmount + roundingDifference;

} else {

NewDownPaymentSettlementTaxAmount = DownPaymentSettlementTaxAmount;

}

If (roundingDifference != 0) {

NewDownPaymentSettlementGrossAmount = DownPaymentSettlementGrossAmount + roundingDifference;

} else {

NewDownPaymentSettlementGrossAmount = DownPaymentSettlementGrossAmount;

}

If (roundingDifference != 0) {

NewOpenTotalGrossAmount = OpenTotalGrossAmount - roundingDifference;

} else {

NewOpenTotalGrossAmount = OpenTotalGrossAmount;

}

### Keywords

SDBIL_CI_STANDARD_DE, XML, FDP_V3_BD_STANDARD, CL_FDP_V3_BD_STANDARD_DPC_EXT, SDBIL_CI_STANDARD_CH, FDP_V3_BD_STANDARD_LO_GLO_GEN, CL_FDP_V3_BD_STAND_LO__DPC_EXT, METHOD downpaymentoverv_get_entity, CALCULATE_DOWNPAYMENT_SUMS, EV_OPEN_TOTAL_GROSS_AMOUNT, <DownPaymentSettlementGrossAmount>, <OpenTotalGrossAmount> , KBA , SD-BIL-GF-OC , Output Control Billing , SD-BIL-GF-OC-2CL , Output Control Billing (Public Cloud) , SD-BIL-IV-DP , Down Payments , Problem