rentwistle
Technical User
Two issues: 1) It tells me "a string is required here: at the end of the if statement (where the=0 is).
totext (Truncate (if {Product.AlternateUnitConversionFactor} = 0 then 0
else {OrderDetailLot.Quantity} / {Product.AlternateUnitConversionFactor}), 0)
+ "cs" + " " + "/" + {OrderDetailLot.LotNumber}&
If Right (cstr({OrderDetail.QtyOrdered},{Product.AlternateUnitConversionFactor}),2)=0
then "0"
else Right (cstr({OrderDetail.QtyOrdered},{Product.AlternateUnitConversionFactor}),2)*12
+ "p" + Space(3)+ "/" + {OrderDetailLot.LotNumber}
2) Original Question:
I have a question regarding how lot numbers transfer to the reports. I am having an issue where the formula does not read separate lots correctly. For example, I have an order for 721 pounds (12 pounds per case). It is split into two lots, one with 461 and one with 260. It should read 38 cases and 5 partials, and 21 cases and 8 partials. It currently reads 38 cases and 1 partial and 21 cases and 1 partial. Do you know why it would do that? I am assuming it has something to do with how the lots are read...
Current Crystal Formula:
totext (Truncate ({OrderDetailLot.Quantity}/{Product.AlternateUnitConversionFactor}),0)
& "cs" & Space(3) & "/" &
If Remainder ({OrderDetail.QtyOrdered},{Product.AlternateUnitConversionFactor})>0 then totext (Remainder({OrderDetail.QtyOrdered},{Product.AlternateUnitConversionFactor}),0)
& "p" & Space(3)& "/" & {OrderDetailLot.LotNumber} else {OrderDetailLot.LotNumber}
totext (Truncate (if {Product.AlternateUnitConversionFactor} = 0 then 0
else {OrderDetailLot.Quantity} / {Product.AlternateUnitConversionFactor}), 0)
+ "cs" + " " + "/" + {OrderDetailLot.LotNumber}&
If Right (cstr({OrderDetail.QtyOrdered},{Product.AlternateUnitConversionFactor}),2)=0
then "0"
else Right (cstr({OrderDetail.QtyOrdered},{Product.AlternateUnitConversionFactor}),2)*12
+ "p" + Space(3)+ "/" + {OrderDetailLot.LotNumber}
2) Original Question:
I have a question regarding how lot numbers transfer to the reports. I am having an issue where the formula does not read separate lots correctly. For example, I have an order for 721 pounds (12 pounds per case). It is split into two lots, one with 461 and one with 260. It should read 38 cases and 5 partials, and 21 cases and 8 partials. It currently reads 38 cases and 1 partial and 21 cases and 1 partial. Do you know why it would do that? I am assuming it has something to do with how the lots are read...
Current Crystal Formula:
totext (Truncate ({OrderDetailLot.Quantity}/{Product.AlternateUnitConversionFactor}),0)
& "cs" & Space(3) & "/" &
If Remainder ({OrderDetail.QtyOrdered},{Product.AlternateUnitConversionFactor})>0 then totext (Remainder({OrderDetail.QtyOrdered},{Product.AlternateUnitConversionFactor}),0)
& "p" & Space(3)& "/" & {OrderDetailLot.LotNumber} else {OrderDetailLot.LotNumber}