I have moved to harbour from xharbour but have found a problem with a valid firing twice - the problem does not occur with xharbour.
The last valid after selecting YES in the MsgYesNo - saves the invoice but the MsgYesNo re appears
Code: Select all
REDEFINE GET oInvc:subtotal ID EditSubTtl of oDlg UPDATE picture '999999.99' COLOR GETCOLOR valid(lfSetTotal(oInvc,nGstRate,oDlg),TRUE)
REDEFINE GET oInvc:invgst ID EditGST of oDlg UPDATE picture '999999.99' COLOR GETCOLOR valid(lfSetTotal(oInvc,nGstRate,oDlg),TRUE)
REDEFINE GET oInvc:invtot ID EditTot of oDlg UPDATE picture '999999.99' COLOR GETCOLOR ;
valid(if(lQuoted,if(oInvc:subtotal == 0,(oInvc:subtotal := oInvc:invtot - oInvc:invtot/nDivisor,oInvc:invgst := oInvc:invtot/nDivisor,oDlg:Update()),),),;
if(MsgYesNo('Save Invoice'),(SaveRec(oInvc,oDlg,oCode,oTmsht,oEmpRate,oEmp,oEmpCost,oJbStck,oSundry,oJb,oPoitms,lSuper,cPath),;
oBtn3:Enable(),oBtn4:Enable(),oBtn5:Enable(),oBtn6:Enable(),lNew := FALSE,oJbNo:Disable(),oDlg:aControls[2]:SetFocus()),),TRUE) // this valid fires twice
REDEFINE GET oInvc:invnotes MEMO ID EditDet of oDlg UPDATE COLOR GETCOLOR
Colin