An error is reported when invoicing Import Costs in a Shipment - apportioned costs need to balance
Problem
Ticking the Invoiced check box for an Import Cost reports these error even though the Apportioned box is ticked.
Solution
Even though the Apportioned box is ticked, this error is only reported when none of the Shipment lines have the Include Cost Type ticked. This can only happen when the user has un-ticked (deliberately or by mistake) this box.
Apportioning of the costs can be done by the user in the application or by identifying the lines and updating via SQL.
User correction
Import Costs tab and un-tick the Apportioned tick box for the line that can't be invoiced and save
Shipment Lines tab and right mouse each line that costs are to apportioned and select View Import Costs
Tick the Include box for the Cost Type and save
Repeat for each line and save the change
Shipment Lines tab, tick Apportioned and save
Ticked invoiced and cost invoice will activate as expected
Advanced SQL skills are required
To correct using the following script you will advanced SQL Programming skills to perform the task
Edit the following script to update the relevant shipment.
UPDATE SH_ApportionedCostsAmounts set includeflag = '1'
FROM SH_Main INNER JOIN
SH_Lines ON dbo.SH_Main.ShipmentID = SH_Lines.ShipmentID INNER JOIN
SH_ApportionedCostsAmounts ON SH_Lines.ShipmentLineID = SH_ApportionedCostsAmounts.ShipmentLineID INNER JOIN
SH_Costs ON SH_ApportionedCostsAmounts.CostsID = SH_Costs.CostsID
WHERE (SH_Main.ShipmentNo LIKE '%12')