Normal Topic Error Checker Error (Read 132 times)
cbislander
Full Member
***
Offline



Posts: 107
Joined: Mar 22nd, 2018
Error Checker Error
Jun 10th, 2024 at 6:05pm
Print Post Print Post  
I have an invoice database that has a variety of different Error Checkers. 

//CASH RECEIPTS CHECK

HST1 = @ROUND(HST,2)
CHARGE1 = @ROUND(CHARGE,2)
CASHREC1 = @ROUND(CASHREC,2)
vCASHRECEIPTS = CASHREC
vCR = @ROUND(CASHRECEIPTS,2)
vSales = Sub1
vHST = HST1
vPOA = POA0
vCharge = CHARGE
CRCMP = vSales + vHST + vPOA - vCharge
CRCMP1 = @ROUND(CRCMP,2)
WriteLn("CASH RECEIPTS : " + vCR)
WriteLn("CASH RECEIPTS CHK : " + CRCMP1)
IF CRCMP1 <> vCR AND TCD <> "COD" Then {
@MSGBOX("*******  ERROR ********","******* CASH RECEIPTS DO NOT MATCH *********"  + "CASH RECEIPTS = " + vCR + " <> " + "CR CHECK =" + CRCMP1 ,"*******  ERROR ********")
                             
                             @Play("BEEP")
                             Message = "ERROR"
                             ThrowFocus(Comment)}
//CASH RECEIPTS CHECK END

If the Cash Receipts value is different from the Cash Receipts Checker, it will beep.  The odd time it will say there's an Error but the amounts are the same.  I have attached a picture of the error when it happened today.  Any ideas?
  

CASH_RECEIPTS_ERROR.png ( 22 KB | 17 Downloads )
CASH_RECEIPTS_ERROR.png
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Error Checker Error
Reply #1 - Jun 10th, 2024 at 6:55pm
Print Post Print Post  
What is vCR declared as?
What type is CRCMP1 bound to?

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
cbislander
Full Member
***
Offline



Posts: 107
Joined: Mar 22nd, 2018
Re: Error Checker Error
Reply #2 - Jun 10th, 2024 at 7:32pm
Print Post Print Post  
Hi Ray,

Here are the items that are declared.

Var vTPRICEALL1 as Double
Var vDifference as Double
Var vMyTotal as Double
Var vcnt as Int
Var vLoop as Int
Var vsubttl as Double
Var HST1 as Double
Var charge1 as Double
Var cashrec1 as Double
Var cashrec as Double
Var vcashreceipts as Double
Var vcr as Double
Var vsales as Double
Var vhst as Double
Var vpoa as Double
Var vcharge as Double
Var crcmp as Double
Var crcmp1 as Double
  
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Error Checker Error
Reply #3 - Jun 12th, 2024 at 3:02pm
Print Post Print Post  
Try it as

Code
Select All
IF @Decimals(CRCMP1, 2) <> @Decimals(vCR, 2) AND TCD <> "COD" Then 

  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged