Hi EHW,
Looks like I have overlooked some items.
Adding sale or refund inv works fine.
However, converting (changing) sele inv to refund inv and refund inv to sale inv using DB/CR combo is not.
1. Entered sale then changed DC/CR combo to refund. Discount and Deliv Cost fields values is not converted to minus:
1. Entered refund then changed DC/CR combo to sale. Discount and Deliv Cost fields values is not converted to positive numbers:
I have tried to move your code under DBCR combo on change with else but didn't work:
procedure frmSalesInv_cbSaleInvDBCR_OnChange (Sender: string); // SALE or REFUND
begin
If (frmSalesInv.cbSaleInvDBCR.dbItemID = 2) and (frmSalesInv.edSalesInvDelivCost.Value > 0) then
begin
frmSalesInv.edSalesInvDelivCost.Value := 0 - frmSalesInv.edSalesInvDelivCost.Value;
CalculateTotal;
end else
begin
frmSalesInv.cbSaleInvDBCR.dbItemID := 1;
frmSalesInv.edSalesInvDelivCost.Value;
CalculateTotal;
end;
If (frmSalesInv.cbSaleInvDBCR.dbItemID = 2) and (frmSalesInv.edSalesInvDiscount.Value > 0) then
begin
frmSalesInv.edSalesInvDiscount.Value := 0 - frmSalesInv.edSalesInvDiscount.value;
CalculateTotal;
end else
frmSalesInv.cbSaleInvDBCR.dbItemID := 1;
frmSalesInv.edSalesInvDiscount.Value;
CalculateTotal;
end;
Adam
God... please help me become the person my dog thinks I am.