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 onTable_receipt
ID_log AUTO_INC sale_receipt NUM(8,0) sale_item Memo sale_total Memo sale_paid MemoThe 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.