Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. sponsors. rss.
 From: information austin
  Where is information austin?
 Toronto
 Canada
 information austin
 To: Pete Sass
  Where is Pete Sass?
 Marathon, Ontario
 Canada
 Pete Sass
 Tags
Subject: RE: App to print out invoices
Thread ID: 172214 Message ID: 172540 # Views: 25 # Ratings: 0
Version: Visual FoxPro 7 Category: Projects and Design
Date: Thursday, May 08, 2008 8:49:34 PM         
   


> >
> >
> > Thanks Pete for your reply. Barbara gave me the following suggestion and this is what my colleague expecting me to do.
> >
> > "What you want is called asynchronous processing. The way you do this is by loading the invoices to be printed into a table with a status that indicates they are pending. Then your second service periodcially checks this table to find items that are pending and processes the ones found."
> >
> > how do i go about doing that? Can you help me out with this one. I never worked with VFP before and I am really lost.
> >
> > Thanks again,
> > Newbie Database Developer
>
>
> Morning From Canada,
> I think what she is referring to is you prep your invoices
> in a seperate table... ie the header table and the details
> table so you can process and print the invoices.
> The on the invoice header table would be one logical field
> set to .F. as a default.
> You could then have a secondary process, or maybe even a timer
> event in your main application that may only printer 1-2 invoices
> at a time. Then wait 20-30 seconds and print 1-2 more. As each
> invoice is printed you flip the logical flag to .T. so you know
> the invoice has been printed.
> I think you can see what this will do.... the printing is
> staged with smaller pieces of the entire print job happening
> rather than the entire printing of all the invoices in one shot.
> Printing then all at once if there are several hundreds or
> thousands will bog down the workstation for sure.
> Does this explaination help...? And if I have misguided
> what you were referring to Barbara please accept my apologies.
> Pete "the IceMan", from the Great White North of Canada.

Thanks for all the replies so far. Your explanation helps.

If you look at the following code.....what it does is that issues the invoices first, changes the date and then prints them out.

*-- Change the status_id to issued

*-- start timing how long to issue an invoice
*!* MESSAGEBOX("Start Timing!")
*!* LOCAL timeTracker
*!* timeTracker = DATETIME()

glissuedbuttonflag = .t.

This.Parent.imgIssued.ZOrder(0)

*!* IF SEEK(thisform.oMasterObject.oObjectStore.invoice_no, "a_invoices", "INVOICE_NO")
SELECT ("a_invoices")
SET ORDER TO invoice_no IN a_invoices DESCENDING
LOCATE FOR ALLTRIM(invoice_no) == ALLTRIM(thisform.oMasterObject.oObjectStore.invoice_no)
SET ORDER TO invoice_no IN a_invoices ASCENDING
IF FOUND()

*****************
thisform.cntbmentrybuttons.cmdEdit.click
thisform.oMasterObject.oObjectStore.status_id = "002" &&- issued
thisform.cntbmentrybuttons.cmdSave.click
*****************
*!* SET REPROCESS TO 10 SECONDS
*!* IF FLOCK("a_invoices")
*!* replace a_invoices.status_id WITH "002"
&&- issued
*!* thisform.oMasterObject.oObjectStore.status_id = "002"
IF EMPTY(a_invoices.issuedate) OR ISNULL(a_invoices.issuedate)
replace a_invoices.issuedate WITH DATE()
thisform.oMasterObject.oObjectStore.issuedate = DATE()
ENDIF

thisform.cntbmprintbuttons.cmdPrint.click
thisform.cntinvoicingdata.orderPages.page1.cntshippinginfo.cboStatus.refresh()
thisform.cntinvoicingdata.orderpages.page1.cntshippinginfo.cntdate1.refresh()
thisform.cntinvoicingdata.label1.caption = "ISSUED"
*!* UNLOCK IN a_invoices
*!* ELSE
*!* WAIT WINDOW 'Unable to open Invoices Table; try again later!' NOWAIT
*!* ENDIF
ELSE
g_alert("Invoice is not found!")
RETURN .f.
ENDIF

this.Enabled = .f.
glissuedbuttonflag = .f.

thisform.Refreshform()

*-- determines how long it takes to issue an invoice
*!* timeTracker = DATETIME() - timeTracker
*!* timeTracker = "Time:" + STR(timeTracker) + " seconds."
*!* MESSAGEBOX(timeTracker)

I don't want invoices to get printed out here. All i want to do is save them. What are the changes in the code.. I guess i would need to take out the following line

thisform.cntbmprintbuttons.cmdPrint.click

because it starts printing, once the issue button is clicked and just save.....what needs to be added there.. ?

Thanks for the help :) & hope your doing good in the Town of Marathon

Newbie Database Developer



COMPLETE THREAD
App to print out invoices Posted by information austin @ 5/7/2008 10:00:54 PM
RE: App to print out invoices Posted by Pete Sass @ 5/7/2008 11:19:30 PM
RE: App to print out invoices Posted by information austin @ 5/8/2008 3:16:43 PM
RE: App to print out invoices Posted by Pete Sass @ 5/8/2008 5:02:34 PM
RE: App to print out invoices Posted by information austin @ 5/8/2008 8:49:34 PM
RE: App to print out invoices Posted by Eric den Doop @ 5/7/2008 11:36:20 PM
RE: App to print out invoices Posted by information austin @ 5/7/2008 11:39:21 PM
RE: App to print out invoices Posted by Eric den Doop @ 5/7/2008 11:40:25 PM
RE: App to print out invoices Posted by Marcia Akins @ 5/9/2008 5:46:44 PM
RE: App to print out invoices Posted by information austin @ 5/9/2008 5:56:34 PM