Hello guys working on a simple sales record application. I have a table (salestbl) with columns salesid, salesdate,salesamount,salesqty,salestype.Salestype could be either sold or returned now ,what i want to achieve is to deduct salesqty and amount if salestype = returnedif ($Salestype =returned) {//deduct salesqty and salesamount
}
It depend on your amount & qty field. (is your amount & qty is signed field, then you can enter minus to the amount & qty)
Else if you can only entered unsighed value, then you just need to * -1 to the amount & qty.if ($Salestype = returned) is not a valid syntax.
Single ‘=’ is to assign value to a variable.
Unless ‘returned’ is pre-defined, otherwise will create problem too.