Jump to content

Print Unpaid Invoices from current Customer


docasar

This topic is 1967 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hello,

I hope someone can bring light to the dark where I am at the moment with what seemed to be a simple script...

So what I am trying to achieve is to print at once all open invoices from a current customer (in this case only 2 out of 3 invoices), so my script looks like this:

Tables:

ACT = Accounts

INV= Invoices

INL = Invoice Line

Relationships:

ACT (___ACT) = act_INV(__f_ACT) then I have from act_INV (___INV) = act_inv_INL (__f_INV)

From Accounts Layout I have a portal that shows all invoices related to that account, and there I have placed a button with the follwoing script:

Layout for the print: Print Unpaid invoice (based on act_inv_INL)

Script:

----------------

Set variable $id = ACT::___ACT

Set variable $status = "Open"

Go to layout (act_INV)

Enter Find Mode

Set field: act_INV:: __f_ACT with $id

Set field act_INV::status = $status

Perform find (this will give me 2 found records on layout act_INV)

Go to related record: act_inv_INL on layout Print Unpaid invoice and match all related records from found set.

Enter Preview

Print Setup

-------------

And I can not pass from here, it will put together all lineitems under the same invoice and show only one invoice total, even though it show all line items from the two invoices. I have tried different relationships but I cant figure out what I am doing wrong ...

Any lead would be really much appreciated,

Thanks a lot...

Link to comment
Share on other sites

If you want to print multiple invoices from a layout of line items, you need to have a sub-summary part by InvoiceID. Place any fields from the parent Invoices table, as well as any summary fields from the line items table,  in this part. Then, when you sort the line items records by the same InvoiceID, you will have the sub-summary part separating between the different invoices.

If you want, you can have the sub-summary part start a new page, so that each invoice is printed on a separate page. 

And, of course, you can have the sub-summary part leading or trailing - or both.

 

 

Edited by comment
Link to comment
Share on other sites

This topic is 1967 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.