Skip to content

Commit

Permalink
added context.hasUpdatedShippingMethod
Browse files Browse the repository at this point in the history
  • Loading branch information
RafidMuhymin committed Dec 10, 2023
1 parent a4b80f9 commit 02cb1b7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ export type Context = Partial<{
DeliveryDate: string;
hasInvoicedSalesOrder: boolean;
hasSentInvoice: boolean;
hasUpdatedShippingMethod: boolean;
hasCreatedGoodsDelivery: boolean;
}>;
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,12 @@ export default async function sendInvoice(

context.hasSentInvoice = true;
}),
fetchExactAPI("PUT", `/salesorder/SalesOrders(guid'${orderID}')`, {
ShippingMethod: shippingMethodID,
}),
!context.hasUpdatedShippingMethod &&
fetchExactAPI("PUT", `/salesorder/SalesOrders(guid'${orderID}')`, {
ShippingMethod: shippingMethodID,
}).then(() => {
context.hasUpdatedShippingMethod = true;
}),
]);

console.log("Exact: Sales invoice sent successfully");
Expand Down

0 comments on commit 02cb1b7

Please sign in to comment.