Form Forms.Packing
- Unit name: Forms.Packing
- Form name: PackingForm
- Old form name: unit182 (form182)
Synopsis
Form to create multiple collis (boxes) from a single order.
Functionalities
Locate order.
- The form has an edit box to enter an order number. Pressing 'enter' executes search action.
- Button to execute search action
- A first grid shows the packing details for the order (view OUTDETAILSPACKING)
- A second grid shows the order article details (view OUTDETAILSPICKCOUNT)
- When the contents of the edit box change, all other actions are disabled, all datasets are closed, and the article edit box is disabled.
- A label displays a colli number (Initially empty)
- A button allows to execute a CreateColli action.
- An edit box+'search' button allows to enter an article number.
- A button allows to execute a SearchColli action.
- A button allows to execute action PrintColliPackingList
- An edit box button allows to enter an article number. When the enter key is hit, it executes the AddArticle action.
- A button to execute the AddArticle is next to it.
- A button allows to execute the ResetOrder action.
- A button allows to execute the FinishRow action.
- A button allows to execute the FinishOrder action.
- A button allows to execute the ConfirmOrder action.
- A button allows to execute the PrintAllPackingLists action.
Actions
Search
This action searches an order. 1. It is always active. 2. When executed, it searches the order as entered in the edit box: the existence of the order is checked by the AVIZ Key field. (name the searched AVIZ value OrderID) 3. If the order does not exist, a message is shown:
Order :OrderID does not exist.
CreateColli
'Create colli' allows to create a new colli. 1. It is active when an existing order is shown. 1. When clicked, it checks if a current colli is active and whether the last printed colli label/packing list are empty. If yes, it asks confirmation to print a packing list and label:
Do you want to print a packing list for colli :Colli first ?
SearchColli
An action 'Search colli' allows to search an existing colli: 1. Always active. 1. It asks the user for a COLLI number. 2. If the user entered a numerical value, it checks OutdetailsPackingColCounter for a colli using the entered number. 3. If the colli does not exist, a message is shown:
Colli :Colli does not exist.
AddArticle
Add an article to the current colli. 1. It is disabled as long as there is no valid order, colli number and article. 2. It searches the article based on the barcode (fields EANCODE, EANCODE1, EANCODE2, EANCODE3, EANCODE4) 3. Checks whether the article is in the order. If not, an error message is shown:
The article :ArticleCode does not belong to this order.
SELECT
sum(isnull(A.QTY,0)) as NeededQTY,
count(X.ID) as PickedQty
FROM
OutDetails A
INNER JOIN OutDetailsPacking X ON (X.AVIZNO=A.AVIZNO) and (X.ARTCODE=A.ARTCODE)
WHERE
(A.AvizNo=:OrderNo)
AND (A.ARTCODE=:ArticleCode)
GROUP BY
A.AVIZNO, A.ARTCODE
All pieces :NeededQty are already used.
Insert into OutDetailsPacking (Avizno, Artcode, ColNo, UserName, CreationDate)
:OrderNo,Articlecode,:ColliNumber,:CurrentUser,GetDate())
ResetOrder
Reset the collis for this order. 1. The action is only active when there is an active order. 2. When executed, the service call DeliveryControl.ClearOrderColliData call is executed with the current orderID. 3. The OUTDETAILSPACKING view is refreshed.
FinishRow
Finish the current row: create packing records for the current selected article. 1. Action is only active if there is an active colli and order, and a selected article and Qty<QtyP. 2. It adds enough articles to make Qty=QtyP.
Insert into OutDetailsPacking (Avizno, Artcode, ColNo, UserName, CreationDate)
:OrderNo,Articlecode,:ColliNumber,:CurrentUser,GetDate())
FinishOrder
Finish the complete order. 1. Only active if there is an order and a colli. 2. For all records in the list of articles, the same insert as for the FinishRow action is performed.. 3. Both grids are refreshed. 4. The article edit is cleared and focused.
ConfirmOrder
Finish the complete order. 1. Only active if there is an order, and there are records in outDetailsPacking. 2. When executed, calls service call DeliveryControl.ConfirmColliOrder with the current order id. 3. both views are refreshed.
PrintAllPackingLists
Print the packing list for each of the collis in the order. 1. Only active if there is an order and at least 1 colli ID. 2. The service call Delivery.PrepareColliPackingListData call must be executed (once for the whole order). 3. For all Colli IDs in the order, the ColliPackList for that colli ID is printed.
Tables/Views
- OUT (filter on AVIZ=:OrderID)
- OUTDETAILSPACKING (filter on AVIZ=:OrderID)
-
OutdetailsPackingColCounter (filter on COLNO)
-
OUTDETAILSPICKCOUNT is the result of the following query
SELECT A.Avizno, A.ARTCODE, Sum(isnull(A.QTYCF,0)) as QTY, Sum(isnull(CHECKEDQTY,0)) AS QTY_CF, Count(OutDetailsPacking.ID) as QTYP from OutDetails A INNER JOIN ARTICLE B ON (A.ARTCODE=B.NAME) LEFT JOIN OutDetailsPacking X ON (X.AVIZNO=A.AVIZNO) AND (X.ARTCODE=A.ARTCODE) WHERE (A.AvizNo=:OrderID) GROUP BY A.Avizno, A.ARTCODE HAVING Sum(isnull(QTYCF,0))>0 ORDER BY ARTCODE ASC
Needed Service Calls
DeliveryControl.CreateNewColli
Needed to allocate new colli.
DeliveryControl.ConfirmColliOrder
Confirm the complete colli.
DeliveryControl.ClearOrderColliData
Remove all colli data for the order.
Delivery.PrepareColliPackingListData
Prepare print data in the OurDetailsPacking data.
Reports
- ColliPackList Before printing this report, the service call Delivery.PrepareColliPackingListData call must be executed (once for the whole order).