When choosing a payment for Vendor the amount does not get copied to the applied amount field

Description

Payment Allocation for a Supplier:

When choosing a payment the amount does not get copied to the applied amount field.

See attached screenshots. When choosing a payment for Patio Farm, a Customer and a Vendor, ticking the selection checkbox copies the amount to the applied amount field, but for Tree Farm, which is a Vendor it does not.

Seems as though it works for customers but not for vendors.

Environment

None

Activity

Show:
Neil G
October 1, 2014, 8:05 AM

When I fixed this issue on our 2.0.0 code base, I was not aware that the amount possibly does autocopy for customers but not for vendors.

Please bear that in mind, when reviewing the following fix:

In WAllocation ( see comment //2014/09/26 nTier Neil Gordon Copy payment amount to applied amount ):

/**

  • Table Model Listener.
    * - Recalculate Totals
    * @param e event
    */
    public void tableChanged(WTableModelEvent e)
    {
    //if ( 1==1 ) return;
    boolean isUpdate = (e.getType() == WTableModelEvent.CONTENTS_CHANGED);
    // Not a table update
    if (!isUpdate)
    {
    calculate();
    return;
    }


int row = e.getFirstRow();
int col = e.getColumn();

if (row < 0)
return;

boolean isInvoice = (e.getModel().equals(invoiceTable.getModel()));
boolean isAutoWriteOff = autoWriteOff.isSelected();

String msg = writeOff(row, col, isInvoice, paymentTable, invoiceTable, isAutoWriteOff);

//render row
ListModelTable model = isInvoice ? invoiceTable.getModel() : paymentTable.getModel();
model.updateComponent(row);

if(msg != null && msg.length() > 0)
FDialog.warn(form.getWindowNo(), "AllocationWriteOffWarn");

//2014/09/26 nTier Neil Gordon Copy payment amount to applied amount
if (!isInvoice) {
if (((Boolean)paymentTable.getValueAt(row, 0)).booleanValue())
{
if ( col == 0 ) {
//Payment (applied) column - See Allocation.setPaymentColumnClass
int iPayment = multiCurrency.isSelected() ? 7 : 5;
BigDecimal bd = (BigDecimal)paymentTable.getValueAt(row, iPayment - 1);
paymentTable.setValueAt(bd, row, iPayment );
}
}
}
calculate();
} // tableChanged

Neil G
October 2, 2014, 10:22 AM

Thank you, we appreciate the quick response.

Assignee

Carlos Ruiz

Reporter

Neil G

Labels

None

Tested By

None

Components

Affects versions

Priority

Minor
Configure