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

Re: Display Invoices



Erik,

Thank you for writing.  Your insights are a great help, particularly with my project due date approaching.

>>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?)

Right.  We pull XML data from another system, and then want to construct sales invoices in LedgerSMB programmatically.

>>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)

Some may have multiple lines.

>>2. Do you use taxes? If so, you will probably have another line per tax %

Right now there aren't taxes.  But, laws may change requiring charging taxes online.

>>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)

Not using foreign currencies at this point, but good chance we will use them going forward.
I appreciate your taking a look at it; I didn't follow fx at all.

>> 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.

Yes, payment is a missing piece.  I'll take a look at the stored procedures.

Thanks.
Brian

Brian Wolf
Phone: 410.367.2958
Email: ..hidden..
Try out Activus Secure Payments™, our recurring payments application.
On 06/18/2013 04:59 PM, Erik Huelsmann wrote:
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

------------------------------------------------------------------------------
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