Options

I added Previous Balance (LCY) to Customer table...

demi222demi222 Member Posts: 131
I added a field Previous Balance (LCY) to my Customer Table.

How can I get it to hold the previous balance when I post an invoice.

For example... if Balance (LCY) is 0 for customer demi222.
I make an invoice of a total of 100 euros. I post this invoice.
The Previous Balance (LCY) should be 0.
The Balance (LCY) should be 100.

Next time, if I make an invoice of 100 and post...
the previous balance (LCY) should be 100
and Balance(LCY) should be 200.

can anyone help me on this?
I don't know where it is updating the Customer table.

Comments

  • Options
    philippegirodphilippegirod Member Posts: 191
    Oupps..... What a strange need !

    To do that, you could probably use the OnInsert trigger of Cust. Ledger Entry Table (Table 21).
    Each time an entry is inserted in the table, the system will copy the previous balance of the customer (Table 18) to the "Previous Balance Field". Care, if there are many customer entries each day, it could be really bad for system performance.

    If you want the exact code I'm thinking of, ask, at the moment this is just an idea.

    Let's try....
    My candle burns by both ends, it will not last the night,
    But oh my foes and oh my friends, it gives a lovely light
  • Options
    demi222demi222 Member Posts: 131
    What I ended up doing is this:

    I take the Balance (LCY) and subtract it by the total of the Invoice, and that give me the Previous Balance!
    I also made it that if Balance (LCY) = the total of the invoice then the previous balance should be 0.

    Works ok!

    Thanks for your idea... but it was easier this way :wink:
Sign In or Register to comment.