I have a sales invoice report where I need to specify total no of boxes sent to a customer. These boxes (despatch units)are a different size ie, 1, 6PK ,36PK etc.hence the formulars below to get the boxes per sales item and total boxes.The trouble is if the despatch units is a null value I get an error which pops up the Get_no_of_boxes formula saying the string is non numeric how can this be avoided.
Split units -split({stockm.despatch_units},"PK")[1] Splits the field {stockm.despatch_units} from 36PK, 72PK etc, to 36, 72.
Get_no_of_boxes-ToNumber ({@split units}) changes the split field created by the formula “Split units” to a numeric value.
Boxes - {opdetm.order_qty} / {@Get_no_of_boxes}divides order qty by the numeric field created to get total boxes .
Roundupboxes_Local NumberVar RoundUp := {@boxes};
If Int(RoundUp)/2 = RoundUp/2 then RoundUp else Truncate(Roundup) + 1; This rounds up to next highest integer.
Then I grand total Roundupboxes to get total boxes
Split units -split({stockm.despatch_units},"PK")[1] Splits the field {stockm.despatch_units} from 36PK, 72PK etc, to 36, 72.
Get_no_of_boxes-ToNumber ({@split units}) changes the split field created by the formula “Split units” to a numeric value.
Boxes - {opdetm.order_qty} / {@Get_no_of_boxes}divides order qty by the numeric field created to get total boxes .
Roundupboxes_Local NumberVar RoundUp := {@boxes};
If Int(RoundUp)/2 = RoundUp/2 then RoundUp else Truncate(Roundup) + 1; This rounds up to next highest integer.
Then I grand total Roundupboxes to get total boxes