Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sum problems (no pun inttended)
Message
De
08/08/2003 16:08:22
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Sum problems (no pun inttended)
Divers
Thread ID:
00818421
Message ID:
00818421
Vues:
69
When running the code below the amount returned for paytest is double the amount just entered into the pytendered and not the actual total. But when I run the SUM command as is in the Command Window and ?print the result it is fine.

Public NQUAN,NNOW,LWAIT,CRAMOUNT,CTHIS,paytest,NTICK
paytest=0
LWAIT=.T.
CTHIS=This.Value
NTICK=INVOICE.NTICKET
SET CONSOLE OFF
Sum PAYRECEIVED.namount For PAYRECEIVED.NTICKET = NTICK To CRPAY
CRAMOUNT=INVOICE.YTOTALSALE-CRPAY
Do Case

Case CTHIS="RENTAL"
Thisform.COMMAND2.Click
LWAIT=.T.

Case CTHIS="CANCEL"
LWAIT=.T.
Delete All For SALES.NTICKET = Val(Sys(3004)) In SALES
Delete All For INVOICE.NTICKET = Val(Sys(3004)) In INVOICE

Case CTHIS ="CASH"
LWAIT=.T.
Append Blank In PAYRECEIVED
Replace PAYRECEIVED.namount With PYTENDERED In PAYRECEIVED
Replace PAYRECEIVED.NTICKET With NTICK In PAYRECEIVED
Replace PAYRECEIVED.ctype With "CASH" In PAYRECEIVED
SUM payreceived.namount FOR payreceived.nticket = ntick TO paytest
Do Case
Case paytest < INVOICE.YTOTALSALE
This.Parent.Tendered.SetFocus
Case paytest >= INVOICE.YTOTALSALE
This.Parent.COMPLETESALE
LWAIT=.F.
Endcase
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform