Jump to content
vk2cnn

Printing Daily Invoices

Recommended Posts

vk2cnn

I have been working on a script for batch printing of invoices created on a particular date.

I have the following script made up :-

 

Go to Layout ["Batch Print Invoices" (Invoice Data)]

Enter Find mode[Pause]

Perform Find[]

Go to Layout ["Prind/Send Invoices" (Invoice Data)]

Go to Related Record [show only related records;Match found set;From table: Invoice Data; using Layout: "Prind/Send Invoices" (Invoice Data); New window]

Enter Preview Mode[]

Close Window [Current Window]

Print[]

Enter Browser Mode[]

 

When I run the script, it goes to a screen where you enter a date created for the invoices to be printed out.

I have created two invoices with two items each.

It finds 4 items. When I brows through, I can see 4 invoices showing one item each. Two showing same invoice ID and the same compay Name.

When I then go to the preview mode, I can only see one invoice with 4 items showing with one invoice ID, a company name and the toal amount for the first 2 items

 

What I would like is to print two separate invoices showing two items with corresponding invoice ID and the company name each.

I can't figure out what is wrong with my script.

Can anyone please lead me to a right direction or correct the above script?

 

"techphan" replied to my previous post but it seems to have gone missing with my original post.

 

Thank you

Share this post


Link to post
Share on other sites
elmpine

It appears that your Invoice Data table consists of the lines normally in an invoice. (This would would explain the 4 records found).

 

I normally would print an invoice from an Invoice header table with the line information shown in a portal.

Using Set Sliding/ Printing you can place summary information at the bottom and have it print uder the lines as required.

 

 

Sample Script -

Using a global field for the required date: (gDate)

(excuse the incorrect use of brackets etc.)

 

Error Capture On

Go to Layout ["Print/Send Invoices" (Invoice Header)]

Enter Find mode

Set field InvoiceDate [gDate]

Perform Find[]

If Get(Foundcount) > 0

Page Setup

Print []

Else

Display Custom Message [No invoices found...]

End

Go To Layout [original Layout]

Enter Browse Mode[]

Error Capture Off

 

Hope this helps

 

elmpine

Share this post


Link to post
Share on other sites
vk2cnn

Hi elmpine,

 

Thank you for your reply.

Just one question about your script.

 

Error Capture On

Go to Layout ["Print/Send Invoices" (Invoice Header)]

Enter Find mode

Set field InvoiceDate [gDate]

Perform Find[]

If Get(Foundcount) > 0

Page Setup

Print []

Else

Display Custom Message [No invoices found...]

End

Go To Layout [original Layout]

Enter Browse Mode[]

Error Capture Off

 

Where it is highlighted in red ;-

 

Go to Layout ["Print/Send Invoices" (Invoice Header)]

Since I am a newbie, please understand my lack of knowledge. It may sounds stupid.

Where is (Invoice Header)? I can't select "Print/Send Invoices" (Invoice Header) from the layout.

Is this something that I need to create?

 

Thank you.

Share this post


Link to post
Share on other sites
Josh Ormond

I would actually print from the Invoice Line Items table.

 

Look at FileMaker's Invoices template.

 

Layout Parts:

 

  • Header part - place all your Invoice data fields. Since the records will be sorted, the header will reflect the current invoice.
  • Body - Line items for your invoice.
  • Sub-summary - Sorted by Invoice number, Page break after every 1 occurrence. This will hold your invoice totals.

 

Find the invoices you want to print, sort by the invoice number, preview it to make sure the invoices sorted correctly and the invoice looks correct.

Share this post


Link to post
Share on other sites
vk2cnn

Hi Josh,

 

Thank you for your reply.

Is there a Invoice Line Items Table within the invoice template for Filemaker Pro 12?

I don't seem to find such a table. There are two tables called " Invoices" and "Invoice Data"

Which one are you referring to as "Invoice Line Items Table" ?

 

Can you please put your ideas into a script so I can work on it?

 

Your help would very much be appreciated.

 

Thank you...

Share this post


Link to post
Share on other sites
elmpine

The table "Invoice Data" table would be the Invoice Line Items Table

 

elmpine

Share this post


Link to post
Share on other sites
Josh Ormond

It is really less about the script, that is the easier part. It's about your layout set up.

 

Get your layout part set up as I have explained above ( use that Invoice Print layout as a guide...just replace the Trailing Grand Summary with a Sub-summary part I described above). Then walk through the steps manually that gets you to a list of invoices to print. Then we can help you write the script.

Share this post


Link to post
Share on other sites
vk2cnn

Hi All,

 

I would like to thank Josh Ormond, elmpine and techphan for helping me to solve my problem.

I have spent quite sometime trying to solve this problem of mine. Without your help I would be pulling my hair out by now.

All the way along I thought it was the script causing my problem but it was the layout as mentioned by Josh.

I have solved my problem now and I am over the moon.

 

Thank you to all. Your help have been very much appreciated.

Share this post


Link to post
Share on other sites
vk2cnn

I have the following script set up and now prints all the invoices o.k but one problem.

The computer freezes when "New Record" button is pressed after printing daily invoices.

 

Here is the script :-

 

Go To Layout ["Print Batch Invoices" (Invoice Data)]

Enter Find Mode []

Perform Find []

Set Field [invoice Data::Invoice Date; Get (CurrentDate)]

Go To Related Record [show only related records; Match found set;...................]

Sort Records [Restore; No dialog]

Print []

Go to Layout ["Invoice Details" (Invoice)]

Enter Browse Mode []

 

The freeze could be due to the way my script is written. I am not sure.

If you know why my computer freezes after printing daily invoices and pressing "New Record" button, please let me know.

 

Thank you once again.

Share this post


Link to post
Share on other sites



  • WE NEED YOUR DONATION NOW

    WE have helped 100,000's of people for many years, now we need your help!!!! Your Donation is Needed to Keep Us Online! Covid 19 and isolation!!!! Without Your Help We Are Gone After 23  Years!



    3% of donation goal reached.
    Donate Sidebar by DevFuse
  • Images

×
×
  • Create New...

Important Information

Terms of Use