mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-25 07:45:47 +00:00
refactor(FE): Use expedition vendor id fallback in mapping
This commit is contained in:
@@ -235,6 +235,9 @@ const PurchaseOrderAcceptApprovalForm = ({
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (purchaseItems.length > 0 && initialValues?.items) {
|
if (purchaseItems.length > 0 && initialValues?.items) {
|
||||||
const updatedItems = initialValues.items.map((item) => {
|
const updatedItems = initialValues.items.map((item) => {
|
||||||
|
const expeditionVendorId =
|
||||||
|
item.expedition_vendor_id || item.expedition_vendor?.id || 0;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
purchase_item: null,
|
purchase_item: null,
|
||||||
purchase_item_id: item.id,
|
purchase_item_id: item.id,
|
||||||
@@ -250,7 +253,7 @@ const PurchaseOrderAcceptApprovalForm = ({
|
|||||||
label: item.expedition_vendor.name,
|
label: item.expedition_vendor.name,
|
||||||
}
|
}
|
||||||
: null,
|
: null,
|
||||||
expedition_vendor_id: item.expedition_vendor_id || 0,
|
expedition_vendor_id: expeditionVendorId,
|
||||||
received_qty: item.total_qty || '',
|
received_qty: item.total_qty || '',
|
||||||
transport_per_item: item.transport_per_item || '',
|
transport_per_item: item.transport_per_item || '',
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user