Jump to content
Sign in to follow this  
docasar

Print Unpaid Invoices from current Customer

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

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