foxprox558
Programmer
If you will see the picture attached, you will see that I have decided to go with another method. I've decided to only show 14 orders on the screen. The text to the right of the checkboxes are labels, and they only display the total amount of the orders with the following code. Please help with this problem: if there is more than 1 order for a given customer number, the 2nd label just jitters between the 1st order amount and the 2nd order amount indefinintely. Also, when you push pay, it should mark the orders paid, which it does not.
**Code For The Select button (Gets customer orders)**
**End Pay Code **
**Code For The Select button (Gets customer orders)**
Code:
USE orders
PUBLIC nPrice1 as number
PUBLIC nPrice2 as number
PUBLIC nPrice3 as number
PUBLIC nPrice4 as number
PUBLIC nPrice5 as number
PUBLIC nPrice6 as number
PUBLIC nPrice7 as number
PUBLIC nPrice8 as number
PUBLIC nPrice9 as number
PUBLIC nPrice10 as number
PUBLIC nPrice11 as number
PUBLIC nPrice12 as number
PUBLIC nPrice13 as number
PUBLIC nPrice14 as number
PUBLIC nOrder1 as Number
PUBLIC nOrder2 as Number
PUBLIC nOrder3 as Number
PUBLIC nOrder4 as Number
PUBLIC nOrder5 as Number
PUBLIC nOrder6 as Number
PUBLIC nOrder7 as Number
PUBLIC nOrder8 as Number
PUBLIC nOrder9 as Number
PUBLIC nOrder10 as Number
PUBLIC nOrder11 as Number
PUBLIC nOrder12 as Number
PUBLIC nOrder13 as Number
PUBLIC nOrder14 as Number
nPrice1=0
nPrice2=0
nPrice3=0
nPrice4=0
nPrice5=0
nPrice6=0
nPrice7=0
nPrice8=0
nPrice9=0
nPrice10=0
nPrice11=0
nPrice12=0
nPrice13=0
nPrice14=0
LOCATE FOR VAL(thisform.combo1.value)==orders.custno
IF FOUND() AND orders.stat!="O"
SCAN
nPrice1=orders.total
nOrder1=orders.invoiceno
thisform.label2.Caption=TRANSFORM(orders.total)
ENDSCAN
ELSE
MESSAGEBOX("This Customer Has No Current Orders",0,"No Orders Available")
cancel
thisform.release
endif
LOCATE FOR VAL(thisform.combo1.value)==orders.custno
IF FOUND() AND orders.stat!="O"
DO WHILE orders.total!=nPrice1
SCAN
nPrice2=orders.total
nOrder2=orders.invoiceno
thisform.label3.Caption=TRANSFORM(orders.total)
ENDSCAN
ENDDO
ELSE
MESSAGEBOX("This Customer Has No Current Orders",0,"No Orders Available")
endif
LOCATE FOR VAL(thisform.combo1.value)==orders.custno
IF FOUND() AND orders.stat!="O"
DO WHILE orders.total!=nPrice1 AND orders.total!=nPrice2
SCAN
nPrice3=orders.total
nOrder3=orders.invoiceno
thisform.label4.Caption=TRANSFORM(orders.total)
ENDSCAN
ENDDO
ELSE
MESSAGEBOX("This Customer Has No Current Orders",0,"No Orders Available")
endif
LOCATE FOR VAL(thisform.combo1.value)==orders.custno
IF FOUND() AND orders.stat!="O"
DO WHILE orders.total!=nPrice1 AND orders.total!=nPrice2 AND orders.total!=nPrice3
SCAN
nPrice4=orders.total
nOrder4=orders.invoiceno
thisform.label5.Caption=TRANSFORM(orders.total)
ENDSCAN
ENDDO
ELSE
MESSAGEBOX("This Customer Has No Current Orders",0,"No Orders Available")
endif
LOCATE FOR VAL(thisform.combo1.value)==orders.custno
IF FOUND() AND orders.stat!="O"
DO WHILE orders.total!=nPrice1 AND orders.total!=nPrice2 AND orders.total!=nPrice3 AND orders.total!=nPrice4
SCAN
nPrice5=orders.total
nOrder5=orders.invoiceno
thisform.label6.Caption=TRANSFORM(orders.total)
ENDSCAN
ENDDO
ELSE
MESSAGEBOX("This Customer Has No Current Orders",0,"No Orders Available")
endif
LOCATE FOR VAL(thisform.combo1.value)==orders.custno
IF FOUND() AND orders.stat!="O"
DO WHILE orders.total!=nPrice1 AND orders.total!=nPrice2 AND orders.total!=nPrice3 AND orders.total!=nPrice4 AND orders.total!=nPrice5
SCAN
nPrice6=orders.total
nOrder6=orders.invoiceno
thisform.label7.Caption=TRANSFORM(orders.total)
ENDSCAN
ENDDO
ELSE
MESSAGEBOX("This Customer Has No Current Orders",0,"No Orders Available")
endif
LOCATE FOR VAL(thisform.combo1.value)=orders.custno
IF FOUND() AND orders.stat!="O"
DO WHILE orders.total!=nPrice1 AND orders.total!=nPrice2 AND orders.total!=nPrice3 AND orders.total!=nPrice4 AND orders.total!=nPrice5 AND orders.total!=nPrice6
SCAN
nPrice7=orders.total
nOrder7=orders.invoiceno
thisform.label8.Caption=TRANSFORM(orders.total)
ENDSCAN
ENDDO
ELSE
MESSAGEBOX("This Customer Has No Current Orders",0,"No Orders Available")
endif
LOCATE FOR VAL(thisform.combo1.value)==orders.custno
IF FOUND() AND orders.stat!="O"
DO WHILE orders.total!=nPrice1 AND orders.total!=nPrice2 AND orders.total!=nPrice3 AND orders.total!=nPrice4 AND orders.total!=nPrice5 AND orders.total!=nPrice6 AND orders.total!=nPrice7
SCAN
nPrice8=orders.total
nOrder8=orders.invoiceno
thisform.label9.Caption=TRANSFORM(orders.total)
ENDSCAN
ENDDO
ELSE
MESSAGEBOX("This Customer Has No Current Orders",0,"No Orders Available")
endif
LOCATE FOR VAL(thisform.combo1.value)==orders.custno
IF FOUND() AND orders.stat!="O"
DO WHILE orders.total!=nPrice1 AND orders.total!=nPrice2 AND orders.total!=nPrice3 AND orders.total!=nPrice4 AND orders.total!=nPrice5 AND orders.total!=nPrice6 AND orders.total!=nPrice7 AND orders.total!=nPrice8
SCAN
nPrice9=orders.total
nOrder9=orders.invoiceno
thisform.label10.Caption=TRANSFORM(orders.total)
ENDSCAN
ENDDO
endif
LOCATE FOR orders.custno==VAL(thisform.combo1.value)
IF FOUND() AND orders.stat!="O"
DO WHILE orders.total!=nPrice1 AND orders.total!=nPrice2 AND orders.total!=nPrice3 AND orders.total!=nPrice4 AND orders.total!=nPrice5 AND orders.total!=nPrice6 AND orders.total!=nPrice7 AND orders.total!=nPrice8 AND orders.total!=nPrice9
SCAN
nPrice10=orders.total
nOrder10=orders.invoiceno
thisform.label11.Caption=TRANSFORM(orders.total)
ENDSCAN
ENDDO
ELSE
MESSAGEBOX("This Customer Has No Current Orders",0,"No Orders Available")
endif
LOCATE FOR orders.custno==VAL(thisform.combo1.value)
IF FOUND() AND orders.stat!="O"
DO WHILE orders.total!=nPrice1 AND orders.total!=nPrice2 AND orders.total!=nPrice3 AND orders.total!=nPrice4 AND orders.total!=nPrice5 AND orders.total!=nPrice6 AND orders.total!=nPrice7 AND orders.total!=nPrice8 AND orders.total!=nPrice9 AND orders.total!=nPrice10
SCAN
nPrice11=orders.total
nOrder11=orders.invoiceno
thisform.label12.Caption=TRANSFORM(orders.total)
ENDSCAN
ENDDO
ELSE
MESSAGEBOX("This Customer Has No Current Orders",0,"No Orders Available")
endif
LOCATE FOR VAL(thisform.combo1.value)==orders.custno
IF FOUND() AND orders.stat!="O"
DO WHILE orders.total!=nPrice1 AND orders.total!=nPrice2 AND orders.total!=nPrice3 AND orders.total!=nPrice4 AND orders.total!=nPrice5 AND orders.total!=nPrice6 AND orders.total!=nPrice7 AND orders.total!=nPrice8 AND orders.total!=nPrice9 AND orders.total!=nPrice10 AND orders.total!=nPrice11
SCAN
nPrice12=orders.total
nOrder12=orders.invoiceno
thisform.label13.Caption=TRANSFORM(orders.total)
ENDSCAN
ENDDO
ELSE
MESSAGEBOX("This Customer Has No Current Orders",0,"No Orders Available")
endif
LOCATE FOR VAL(thisform.combo1.value)==orders.custno
IF FOUND() AND orders.stat!="O"
DO WHILE orders.total!=nPrice1 AND orders.total!=nPrice2 AND orders.total!=nPrice3 AND orders.total!=nPrice4 AND orders.total!=nPrice5 AND orders.total!=nPrice6 AND orders.total!=nPrice7 AND orders.total!=nPrice8 AND orders.total!=nPrice9 AND orders.total!=nPrice10 AND orders.total!=nPrice11 AND orders.total!=nPrice12
SCAN
nPrice13=orders.total
nOrder13=orders.invoiceno
thisform.label14.Caption=TRANSFORM(orders.total)
ENDSCAN
ENDDO
ELSE
MESSAGEBOX("This Customer Has No Current Orders",0,"No Orders Available")
endif
LOCATE FOR VAL(thisform.combo1.value)==orders.custno
IF FOUND() AND orders.stat!="O"
DO WHILE orders.total!=nPrice1 AND orders.total!=nPrice2 AND orders.total!=nPrice3 AND orders.total!=nPrice4 AND orders.total!=nPrice5 AND orders.total!=nPrice6 AND orders.total!=nPrice7 AND orders.total!=nPrice8 AND orders.total!=nPrice9 AND orders.total!=nPrice10 AND orders.total!=nPrice11 AND orders.total!=nPrice12 AND orders.total!=nPrice13
SCAN
nPrice14=orders.total
nOrer14=orders.invoiceno
thisform.label15.Caption=TRANSFORM(orders.total)
ENDSCAN
ENDDO
ELSE
MESSAGEBOX("This Customer Has No Current Orders",0,"No Orders Available")
endif
** End select code **
** Pay Button Code **
if thisform.credit.value=1
IF thisform.order1.value=1
USE
CLOSE TABLES
CLOSE DATABASES
CLOSE indexes
USE orders
LOCATE FOR nOrder1==orders.invoiceno
IF FOUND()
replace orders.stat WITH "O"
ENDIF
endif
IF thisform.order2.value=1
LOCATE FOR orders.invoiceno==nOrder2
IF FOUND()
replace orders.stat WITH "O"
ENDIF
endif
IF thisform.order3.value=1
LOCATE FOR orders.invoiceno==nOrder3
IF FOUND()
replace orders.stat WITH "O"
ENDIF
endif
IF thisform.order4.value=1
LOCATE FOR orders.invoiceno==nOrder4
IF FOUND()
replace orders.stat WITH "O"
ENDIF
endif
IF thisform.order5.value=1
LOCATE FOR orders.invoiceno==nOrder5
IF FOUND()
replace orders.stat WITH "O"
ENDIF
endif
IF thisform.order6.value=1
LOCATE FOR orders.invoiceno==nOrder6
IF FOUND()
replace orders.stat WITH "O"
ENDIF
endif
IF thisform.order7.value=1
LOCATE FOR orders.invoiceno==nOrder7
IF FOUND()
replace orders.stat WITH "O"
ENDIF
endif
IF thisform.order8.value=1
LOCATE FOR orders.invoiceno==nOrder8
IF FOUND()
replace orders.stat WITH "O"
ENDIF
endif
IF thisform.order9.value=1
LOCATE FOR orders.invoiceno==nOrder9
IF FOUND()
replace orders.stat WITH "O"
ENDIF
endif
IF thisform.order10.value=1
LOCATE FOR orders.invoiceno==nOrder10
IF FOUND()
replace orders.stat WITH "O"
ENDIF
endif
IF thisform.order11.value=1
LOCATE FOR orders.invoiceno==nOrder11
IF FOUND()
replace orders.stat WITH "O"
ENDIF
endif
IF thisform.order12.value=1
LOCATE FOR orders.invoiceno==nOrder12
IF FOUND()
replace orders.stat WITH "O"
ENDIF
endif
IF thisform.order13.value=1
LOCATE FOR orders.invoiceno==nOrder13
IF FOUND()
replace orders.stat WITH "O"
ENDIF
endif
IF thisform.order14.value=1
LOCATE FOR orders.invoiceno==nOrder14
IF FOUND()
replace orders.stat WITH "O"
ENDIF
endif
nCard=INPUTBOX("Enter Credit Card Number","Enter Card Info")
IF thisform.order1.value=1
LOCATE FOR orders.invoiceno=nOrder1
replace orders.payby WITH "Credit",;
orders.cardno WITH TRANSFORM(nCard),;
orders.amountpay WITH thisform.text2.value
ENDIF
IF thisform.order2.value=1
LOCATE FOR orders.invoiceno=nOrder2
replace orders.payby WITH "Credit",;
orders.cardno WITH TRANSFORM(nCard),;
orders.amountpay WITH thisform.text2.value
ENDIF
IF thisform.order3.value=1
LOCATE FOR orders.invoiceno=nOrder3
replace orders.payby WITH "Credit",;
orders.cardno WITH TRANSFORM(nCard),;
orders.amountpay WITH thisform.text2.value
ENDIF
IF thisform.order4.value=1
LOCATE FOR orders.invoiceno=nOrder4
replace orders.payby WITH "Credit",;
orders.cardno WITH TRANSFORM(nCard),;
orders.amountpay WITH thisform.text2.value
ENDIF
IF thisform.order5.value=1
LOCATE FOR orders.invoiceno=nOrder5
replace orders.payby WITH "Credit",;
orders.cardno WITH TRANSFORM(nCard),;
orders.amountpay WITH thisform.text2.value
ENDIF
IF thisform.order6.value=1
LOCATE FOR orders.invoiceno=nOrder6
replace orders.payby WITH "Credit",;
orders.cardno WITH TRANSFORM(nCard),;
orders.amountpay WITH thisform.text2.value
ENDIF
IF thisform.order7.value=1
LOCATE FOR orders.invoiceno=nOrder7
replace orders.payby WITH "Credit",;
orders.cardno WITH TRANSFORM(nCard),;
orders.amountpay WITH thisform.text2.value
ENDIF
IF thisform.order8.value=1
LOCATE FOR orders.invoiceno=nOrder8
replace orders.payby WITH "Credit",;
orders.cardno WITH TRANSFORM(nCard),;
orders.amountpay WITH thisform.text2.value
ENDIF
IF thisform.order9.value=1
LOCATE FOR orders.invoiceno=nOrder9
replace orders.payby WITH "Credit",;
orders.cardno WITH TRANSFORM(nCard),;
orders.amountpay WITH thisform.text2.value
ENDIF
IF thisform.order10.value=1
LOCATE FOR orders.invoiceno=nOrder10
replace orders.payby WITH "Credit",;
orders.cardno WITH TRANSFORM(nCard),;
orders.amountpay WITH thisform.text2.value
ENDIF
IF thisform.order11.value=1
LOCATE FOR orders.invoiceno=nOrder11
replace orders.payby WITH "Credit",;
orders.cardno WITH TRANSFORM(nCard),;
orders.amountpay WITH thisform.text2.value
ENDIF
IF thisform.order12.value=1
LOCATE FOR orders.invoiceno=nOrder12
replace orders.payby WITH "Credit",;
orders.cardno WITH TRANSFORM(nCard),;
orders.amountpay WITH thisform.text2.value
ENDIF
IF thisform.order13.value=1
LOCATE FOR orders.invoiceno=nOrder13
replace orders.payby WITH "Credit",;
orders.cardno WITH TRANSFORM(nCard),;
orders.amountpay WITH thisform.text2.value
ENDIF
IF thisform.order14.value=1
LOCATE FOR orders.invoiceno=nOrder14
replace orders.payby WITH "Credit",;
orders.cardno WITH TRANSFORM(nCard),;
orders.amountpay WITH thisform.text2.value
ENDIF
ENDif
**check**
if thisform.check.value=1
IF thisform.order1.value=1
LOCATE FOR orders.invoiceno=nOrder1
replace orders.stat WITH "O"
ENDIF
IF thisform.order2.value=1
LOCATE FOR orders.invoiceno=nOrder2
replace orders.stat WITH "O"
ENDIF
IF thisform.order3.value=1
LOCATE FOR orders.invoiceno=nOrder3
replace orders.stat WITH "O"
ENDIF
IF thisform.order4.value=1
LOCATE FOR orders.invoiceno=nOrder4
replace orders.stat WITH "O"
ENDIF
IF thisform.order5.value=1
LOCATE FOR orders.invoiceno=nOrder5
replace orders.stat WITH "O"
ENDIF
IF thisform.order6.value=1
LOCATE FOR orders.invoiceno=nOrder6
replace orders.stat WITH "O"
ENDIF
IF thisform.order7.value=1
LOCATE FOR orders.invoiceno=nOrder7
replace orders.stat WITH "O"
ENDIF
IF thisform.order8.value=1
LOCATE FOR orders.invoiceno=nOrder8
replace orders.stat WITH "O"
ENDIF
IF thisform.order9.value=1
LOCATE FOR orders.invoiceno=nOrder9
replace orders.stat WITH "O"
ENDIF
IF thisform.order10.value=1
LOCATE FOR orders.invoiceno=nOrder10
replace orders.stat WITH "O"
ENDIF
IF thisform.order11.value=1
LOCATE FOR orders.invoiceno=nOrder11
replace orders.stat WITH "O"
ENDIF
IF thisform.order12.value=1
LOCATE FOR orders.invoiceno=nOrder12
replace orders.stat WITH "O"
ENDIF
IF thisform.order13.value=1
LOCATE FOR orders.invoiceno=nOrder13
replace orders.stat WITH "O"
ENDIF
IF thisform.order14.value=1
LOCATE FOR orders.invoiceno=nOrder14
replace orders.stat WITH "O"
ENDIF
nChk=INPUTBOX("Enter Check Number.","Collect Check Information")
IF thisform.order1.value=1
LOCATE FOR orders.invoiceno=nOrder1
replace orders.payby WITH "Check",;
orders.checkno WITH TRANSFORM(nChk),;
orders.amountpay WITH thisform.text2.value
ENDIF
IF thisform.order2.value=1
LOCATE FOR orders.invoiceno=nOrder2
replace orders.payby WITH "Check",;
orders.checkno WITH TRANSFORM(nChk),;
orders.amountpay WITH thisform.text2.value
ENDIF
IF thisform.order3.value=1
LOCATE FOR orders.invoiceno=nOrder3
replace orders.payby WITH "Check",;
orders.checkno WITH TRANSFORM(nChk),;
orders.amountpay WITH thisform.text2.value
ENDIF
IF thisform.order4.value=1
LOCATE FOR orders.invoiceno=nOrder4
replace orders.payby WITH "Check",;
orders.checkno WITH TRANSFORM(nChk),;
orders.amountpay WITH thisform.text2.value
ENDIF
IF thisform.order5.value=1
LOCATE FOR orders.invoiceno=nOrder5
replace orders.payby WITH "Check",;
orders.checkno WITH TRANSFORM(nChk),;
orders.amountpay WITH thisform.text2.value
ENDIF
IF thisform.order6.value=1
LOCATE FOR orders.invoiceno=nOrder6
replace orders.payby WITH "Check",;
orders.checkno WITH TRANSFORM(nChk),;
orders.amountpay WITH thisform.text2.value
ENDIF
IF thisform.order7.value=1
LOCATE FOR orders.invoiceno=nOrder7
replace orders.payby WITH "Check",;
orders.checkno WITH TRANSFORM(nChk),;
orders.amountpay WITH thisform.text2.value
ENDIF
IF thisform.order8.value=1
LOCATE FOR orders.invoiceno=nOrder8
replace orders.payby WITH "Check",;
orders.checkno WITH TRANSFORM(nChk),;
orders.amountpay WITH thisform.text2.value
ENDIF
IF thisform.order9.value=1
LOCATE FOR orders.invoiceno=nOrder9
replace orders.payby WITH "Check",;
orders.checkno WITH TRANSFORM(nChk),;
orders.amountpay WITH thisform.text2.value
ENDIF
IF thisform.order10.value=1
LOCATE FOR orders.invoiceno=nOrder10
replace orders.payby WITH "Check",;
orders.checkno WITH TRANSFORM(nChk),;
orders.amountpay WITH thisform.text2.value
ENDIF
IF thisform.order11.value=1
LOCATE FOR orders.invoiceno=nOrder11
replace orders.payby WITH "Check",;
orders.checkno WITH TRANSFORM(nChk),;
orders.amountpay WITH thisform.text2.value
ENDIF
IF thisform.order12.value=1
LOCATE FOR orders.invoiceno=nOrder12
replace orders.payby WITH "Check",;
orders.checkno WITH TRANSFORM(nChk),;
orders.amountpay WITH thisform.text2.value
ENDIF
IF thisform.order13.value=1
LOCATE FOR orders.invoiceno=nOrder13
replace orders.payby WITH "Check",;
orders.checkno WITH TRANSFORM(nChk),;
orders.amountpay WITH thisform.text2.value
ENDIF
IF thisform.order14.value=1
LOCATE FOR orders.invoiceno=nOrder14
replace orders.payby WITH "Check",;
orders.checkno WITH TRANSFORM(nChk),;
orders.amountpay WITH thisform.text2.value
ENDIF
endif
**Cash**
if thisform.cash.value=1
IF thisform.order1.value=1
LOCATE FOR orders.invoiceno=nOrder1
replace orders.stat WITH "O"
ENDIF
IF thisform.order2.value=1
LOCATE FOR orders.invoiceno=nOrder2
replace orders.stat WITH "O"
ENDIF
IF thisform.order3.value=1
LOCATE FOR orders.invoiceno=nOrder3
replace orders.stat WITH "O"
ENDIF
IF thisform.order4.value=1
LOCATE FOR orders.invoiceno=nOrder4
replace orders.stat WITH "O"
ENDIF
IF thisform.order5.value=1
LOCATE FOR orders.invoiceno=nOrder5
replace orders.stat WITH "O"
ENDIF
IF thisform.order6.value=1
LOCATE FOR orders.invoiceno=nOrder6
replace orders.stat WITH "O"
ENDIF
IF thisform.order7.value=1
LOCATE FOR orders.invoiceno=nOrder7
replace orders.stat WITH "O"
ENDIF
IF thisform.order8.value=1
LOCATE FOR orders.invoiceno=nOrder8
replace orders.stat WITH "O"
ENDIF
IF thisform.order9.value=1
LOCATE FOR orders.invoiceno=nOrder9
replace orders.stat WITH "O"
ENDIF
IF thisform.order10.value=1
LOCATE FOR orders.invoiceno=nOrder10
replace orders.stat WITH "O"
ENDIF
IF thisform.order11.value=1
LOCATE FOR orders.invoiceno=nOrder11
replace orders.stat WITH "O"
ENDIF
IF thisform.order12.value=1
LOCATE FOR orders.invoiceno=nOrder12
replace orders.stat WITH "O"
ENDIF
IF thisform.order13.value=1
LOCATE FOR orders.invoiceno=nOrder13
replace orders.stat WITH "O"
ENDIF
IF thisform.order14.value=1
LOCATE FOR orders.invoiceno=nOrder14
replace orders.stat WITH "O"
ENDIF
nChg=INPUTBOX("Enter amount of cash receieved","Change Calculator")
MESSAGEBOX("Give Customer $"+(TRANSFORM(VAL(nChg)-thisform.text2.Value))+" Back.",0,"Change Calculator")
IF thisform.order1.value=1
LOCATE FOR orders.invoiceno=nOrder1
replace orders.payby WITH "Cash",;
orders.amountpay WITH thisform.text2.value
ENDIF
IF thisform.order2.value=1
LOCATE FOR orders.invoiceno=nOrder2
replace orders.payby WITH "Cash",;
orders.amountpay WITH thisform.text2.value
ENDIF
IF thisform.order3.value=1
LOCATE FOR orders.invoiceno=nOrder3
replace orders.payby WITH "Cash",;
orders.amountpay WITH thisform.text2.value
ENDIF
IF thisform.order4.value=1
LOCATE FOR orders.invoiceno=nOrder4
replace orders.payby WITH "Cash",;
orders.amountpay WITH thisform.text2.value
ENDIF
IF thisform.order5.value=1
LOCATE FOR orders.invoiceno=nOrder5
replace orders.payby WITH "Cash",;
orders.amountpay WITH thisform.text2.value
ENDIF
IF thisform.order6.value=1
LOCATE FOR orders.invoiceno=nOrder6
replace orders.payby WITH "Cash",;
orders.amountpay WITH thisform.text2.value
ENDIF
IF thisform.order7.value=1
LOCATE FOR orders.invoiceno=nOrder7
replace orders.payby WITH "Cash",;
orders.amountpay WITH thisform.text2.value
ENDIF
IF thisform.order8.value=1
LOCATE FOR orders.invoiceno=nOrder8
replace orders.payby WITH "Cash",;
orders.amountpay WITH thisform.text2.value
ENDIF
IF thisform.order9.value=1
LOCATE FOR orders.invoiceno=nOrder9
replace orders.payby WITH "Cash",;
orders.amountpay WITH thisform.text2.value
ENDIF
IF thisform.order10.value=1
LOCATE FOR orders.invoiceno=nOrder10
replace orders.payby WITH "Cash",;
orders.amountpay WITH thisform.text2.value
ENDIF
IF thisform.order11.value=1
LOCATE FOR orders.invoiceno=nOrder11
replace orders.payby WITH "Cash",;
orders.amountpay WITH thisform.text2.value
ENDIF
IF thisform.order12.value=1
LOCATE FOR orders.invoiceno=nOrder12
replace orders.payby WITH "Cash",;
orders.amountpay WITH thisform.text2.value
ENDIF
IF thisform.order13.value=1
LOCATE FOR orders.invoiceno=nOrder13
replace orders.payby WITH "Cash",;
orders.amountpay WITH thisform.text2.value
ENDIF
IF thisform.order14.value=1
LOCATE FOR orders.invoiceno=nOrder14
replace orders.payby WITH "Cash",;
orders.amountpay WITH thisform.text2.value
ENDIF
endif