Jump to content

Carton Labels


This topic is 6985 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

I am trying to create a script to print box labels. I want the user to enter in how many boxes of "a" quantity, how many boxes at "b" and how many boxes at "c" quantity. For example; 3 boxes at 1000, 1 box at 950 and 1 box at 275. This would create single shipment of 5 boxes.

I need my script to create 5 box labels with the following information; "box 1 of 5, quantity 1000; box 2 of 5, quantity 1000; box 3 of 5, quantity 1000; box 4 of 5, quantity 950, box 5 of 5, quantity 275"

Any suggestions??

Link to comment
Share on other sites

Try creating a label generation file that gets created by a loop exiting when a counter reaches the total number of boxes. Then you need to run an inside loop with another counter in it. It should exit the loop when the counter reaches the total for each type of box. Maybe you can do something like this. All the syntax may not be right since I just typed it up, but something like this would probably work.

 

gCounterJ=0

gCounterK=0

gCounterT=1

gTotalBoxStyle=0



Set [ gTotalBoxStyle = cTotalBoxA ]





Loop

   Exit Loop If [ gCounterT = cTotalBoxesABC ]



   If [ gCounterJ = 1] 

      Set [ gTotalBoxStyle = cTotalBoxB ]

   ElseIf [ gCounterJ = 2]

      Set [ gTotalBoxStyle = cTotalBoxC ]

   End If



   gCounterK=0

     Loop

       Exit Loop If [ gCounterK = gTotalBoxStyle ]

       Go to Layout [GeneratedFile]

       New Record

       Set Field [GeneratedFile::BoxNum = gCounterT ]

       Set Field [GeneratedFile::Qty = Qty ]

       Set Field [ gCounterK = gCounterK +1 ]

       Set Field [ gCounterT = gCounterT +1 ]

       Go to Layout [Original]

     End Loop

Set Field [ gCounterJ = gCounterJ +1 ]

End Loop

 

Link to comment
Share on other sites

Actually I would probably do something simpler. A simple two table solution would look like:

Table1 - Shipments - here you would keep whatever information about the shipment you need, and key field with a one to many relationship to the second table.

In the second table, Cartons, keep whatever information you want per carton, including the item quantity as you require.

To enter data, simply use the first table with a portal to the second table, allowing the addition of records. You can use the "@@" symbol in the portal row to indicate the record number (which translates to your carton number).

To print your labels, simply go to the Carton table and make the shipment that you need the found set using a find on the key field. Then just print the labels using the "@@" symbol to extract the carton number. If you want to do something like Carton X of Y where Y is the total number of cartons in the shipment, simply save the number of records in the found set to a global, or from the Shipment table use Count(Shipments::Cartons) to find the number of related records and save it to a global.

This is the approach I use to print packing lists for my shipments.

Hope this helps

Link to comment
Share on other sites

This topic is 6985 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.