Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Memo field
Message
From
20/09/2005 22:23:54
Aaron K. Y. Chu
Health & Care Co. Ltd.
Hong Kong, Hong Kong
 
 
To
20/09/2005 15:54:09
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
01051285
Message ID:
01051526
Views:
5
Actually, my approach would be different... for memo field, it is quite difficult to get good statistic results, like input/output count of every inventory...

My approach is
1. A table to register every sale items
2. A table to register every receipt printed

e.g.
table_item
ID_log        AUTO_INC  PRIMARY
sale_receipt  NUM(8,0)
sale_datetime DateTime
sale_person   CHR(5)
item_ID       CHR(9)
item_QTY      NUM(6,0)
item_PRICE    NUM(9,2)
... and so on
Table_receipt
ID_log         AUTO_INC
sale_receipt   NUM(8,0)
sale_item      Memo
sale_total     Memo
sale_paid      Memo
The receipt is stored in this way:
cSale_item=''
SELECT * FROM table_item WHERE sale_receipt = nReceipt INTO CURSOR cTmp
SELECT cTmp
GO TOP
FOR x = 1 TO RECCOUNT('cTmp')
   cSale_item= IIF(!EMPTY(cSale_item),cSale_item + CHR(13),'')+ ;
   PADR(alltrim(item_ID)+ 'x'+ alltrim(str(item_qty)),29,'.')+' $'+str(item_price,9,2)
   SKIP IN cTmp
ENDFOR
USE IN cTmp

&&... You can prepare sale_total & sale_paid in this way

INSERT INTO table_receipt (sale_receipt,sale_item...) values (nSale_receipt,cSale_item...)
After that, you can preview the receipt by its sale_receipt in Preview windows; which in fact, more convenient to export to PDF file for record keeping.
Best regards,

Aaron Chu

********************************************************

Working with Visual FoxPro is a lot of FUN!

********************************************************
Previous
Reply
Map
View

Click here to load this message in the networking platform