Switch to Execute Sever Event Function

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
apis
User
Posts: 124

Switch to Execute Sever Event Function

Post by apis »

I have Master Table "cashregister"
Fields (BillNo, Location, Address, Customer, TIN, BillTotal, PayMode, No, PaidAmount, Date, UserID FROM cashregister )

Maaster Detail Table " cashbills"
Fields (Item, Units, Qty, SaleDate, BillNo, Location, UserID, SPrice, Tax, id, CPrice, Class FROM cashbills)

function Row_Updating(&$rsold, &$rsnew)
$MyResult = ew_Execute("
INSERT INTO stock (Location, Class, ItemNo, Units, Qty)
VALUES(".$rsnew["Location"].", ".$rsnew["Class"].", ".$rsnew["Item"].", '".$rsnew["Units"]."', -(".$rsnew["Qty"]."))
ON DUPLICATE KEY UPDATE Qty = Qty - (".$rsnew["Qty"].")
");

I need to Execute the above function
Case 1:
When the Customer is Cash and PayMode is Cash and Paid Amount Greater or Equals to BillTotal
Case 2:
When the Customer is not Cash and PayMode is not Cash

Can anybody please help.
Thanks in advance


sangnandar
User
Posts: 980

Post by sangnandar »

Row_Updating()

apis wrote:
Case 1:
When the Customer is Cash and PayMode is Cash and Paid Amount Greater or Equals to
BillTotal

if ( $rsnew["Customer"] == "Cash" && $rsnew["PayMode "] == "Cash" && ... ) {
$MyResult = ... // Execute the condition
}

Case 2:
When the Customer is not Cash and PayMode is not Cash

if ( $rsnew["Customer"] != "Cash" && $rsnew["PayMode "] != "Cash" && ... ) {
$MyResult = ... // Execute the condition
}

return TRUE;


Post Reply