on 2015 Sep 15 3:10 PM
We have a custom program that allows our website to transmit orders through the DI API along with a shipping expense to the RDR3 table. We have noticed that these orders are not closing out when they are being taken to a delivery if there is a shipping expense created. The line level on the RDR1 table is being closed but the sales order document remains open and so does the line on the RDR3 table.
Below is the code that is generating the freight add amount. I am wondering if we are missing a column that should be updated or maybe the RDR3 line should be closed when it is added (we have no one reviewing these orders, so no changes would be made to the RDR3 table).
if(order.TotalShippingCharged != "")
{
oOrder.Expenses.ExpenseCode = 1;
oOrder.Expenses.LineTotal = Convert.ToDouble(order.TotalShippingCharged);
oOrder.Expenses.Add();
}
Request clarification before answering.
Hi Tim,
This happens when the oOrder.Expenses.LineTotal is zero.
You need to extend your code to first check that Convert.ToDouble(order.TotalShippingCharged) > 0
If not, do not add expense at all.
Regards,
Johan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I was looking for a way to insert freight value into a sales order, your question helped me to find the solution.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 22 | |
| 12 | |
| 5 | |
| 4 | |
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.