[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Display Invoices



Hi Brian,

On Tue, Jun 18, 2013 at 10:35 PM, Brian Wolf <..hidden..> wrote:
We want to generate invoices in LedgerSMB programmatically, not manually, since there are hundreds or even thousands weekly.

Yea. That was my understanding. However, my idea is (but that may be incorrect) that the invoices were created automatically, because they were already handled by another system. I've now come to understand that my previous assumption is incorrect, right? (In other words: you're completely handling invoices within LSMB, just not manually?)
Â
So far I've taken the approach of creating a row in the AR table, along with rows in the INVOICE table (and possibly creating a customer, too).

I think you're right; however, I can't find out how to confirm with certainty right now. Will come back to it. (Now that we're on the subject of coming back to it: I'll provide the URL for filing bug reports once SF is fixed -- it is having issues atm: I'm missing all my "data manipulation" menus atm)
Â
To post the invoices and have data in LedgerSMB referentially correct, it looks like I need to add two rows to the ACC_TRANS table.
Can you confirm that?

Yes and no: two is the bare minimum. How many you actually have depends on a number of factors:

1. Do your invoices all have a single line? If not, you will probably have multiple acc_trans lines: one for each invoice line plus one to post on the asset account (AR)
2. Do you use taxes? If so, you will probably have another line per tax %
3. Do you use foreign currencies? If so, you need a number of extra "fx" lines in acc_trans. although I'm not exactly sure how fx is supposed to work (I have hacked it, but I find it rather unintuitive, so I keep having to look it up again)
Â
Is there a better approach (eg, executing a store procedure)? Any other tables to affect?

Your approach is probably the only available approach on the side of the invoices. However, on the side of payments, you need to update the payments table as well. The best way to do that would be to use the Payment.sql:payment_bulk_post or Payment.sql:payment_post stored procedures. They do some complex FX calculations if required and keep the tables referentially in tact and update the required fields in multiple tables.


--
Bye,

Erik.

http://efficito.comÂ-- Hosted accounting and ERP.
Robust and Flexible. No vendor lock-in.
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Ledger-smb-users mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-users