Qty Per Box Follow

0
Avatar
Legacy Poster

Hi,

I've searched in this forum for a solution of my problem, but coud not find it...

 

I need to print on every label the amount of items in a box.

The total ordered items are available in the database field as well as the nr of items per box. So those two fields are input fields.

 

If the total amount is 130 and amount per box is 50 the I schould get 2 labels with qty of 50 and 1 label with 30.... How can i solve this?

 

best regards

Rob

3 comments

0
Avatar
Legacy Poster
Comment actions Permalink

I think I have to create 2 VB scripts:

1 script to calculate the total of labels (boxes): INT(itemqty/amount per box)

Other script to calculate the box qty current printed label...

 

If NumberSerializedLabels = Copies Then

    value = MOD(itemqty/amount per box)

Else

   value = amount per box

end if

 

Is this correct?

Rob

0
Avatar
Legacy Poster
Comment actions Permalink

Hi,

I cannot get the right solution. Can anybody help me?

Calculating the numer of labels is working fine (INT(itemqty/amount per box). Now I would like to print the amount per box on the label...

How can I see when i'm printing the last copy of the label??

 

It's driving me nuts!

0
Avatar
Legacy Poster
Comment actions Permalink

RobW,

 

Perhaps this is helpful?

 

File > Print > Serial Numbers (options) > Print Quantity Options window...

Data Source: Type Visual Basic Script

Script Type: Single-Line Expression

Expression:

IIF( Field("xlsData1$.ShipQty") MOD Field("xlsData2$.Box_Qty") > 0, (Field("xlsData1$.ShipQty") / Field("xlsData2$.Box_Qty")) +1, Field("xlsData1$.ShipQty") / Field("xlsData2$.Box_Qty"))

 

where ShipQty is total lot quantity and Box_Qty is max quantity per box.

 

I am having problems beyond this point.

I am using a serialized counter and single-line expressions track running total based on Box_Qty and ShipQty.

 

But I am unable to use a comparison of Ship_Qty vs. (serial-counter * Box_Qty) to calculate the remainder, for the last label.

The comparison fails to detect the shift from Less-Than-Ship_Qty to Greater-Than-Ship_Qty.

 

IIF( Field("xlsData2$.Box_Qty")*(Format.NamedSubStrings("Serialize").Value+1) < Field("xlsData1$.ShipQty") , Field("xlsData2$.Box_Qty"), (Field("xlsData1$.ShipQty")) - (Format.NamedSubStrings("Serialize").Value * Field("xlsData2$.Box_Qty") ) )

 

What am I missing/misunderstanding?

 

Thank you much!

-sols

Please sign in to leave a comment.