mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 13:32:00 +00:00
fix: make convertion unit support QTY when hitting update/create API
This commit is contained in:
@@ -195,7 +195,9 @@ const SalesOrderFormModal = ({
|
||||
product.marketing_type?.value?.toLowerCase() === 'telur'
|
||||
? convertionUnitValue === 'PETI'
|
||||
? 'PETI'
|
||||
: 'KG' // termasuk "QTY" dan "KG"
|
||||
: convertionUnitValue === 'QTY'
|
||||
? 'QTY'
|
||||
: 'KG'
|
||||
: undefined;
|
||||
|
||||
// Jika value dari data product ada week, kirim "AYAM_PULLET, jika tidak ada kirim "AYAM"
|
||||
@@ -205,10 +207,15 @@ const SalesOrderFormModal = ({
|
||||
marketingTypeValue = product.week ? 'AYAM_PULLET' : 'AYAM';
|
||||
}
|
||||
|
||||
const formattedUnitPrice =
|
||||
convertionUnitValue === 'QTY'
|
||||
? parseFloat(String(product.price_per_qty || 0))
|
||||
: parseFloat(String(product.unit_price || 0));
|
||||
|
||||
return {
|
||||
vehicle_number: product.vehicle_number as string,
|
||||
product_warehouse_id: product.product_warehouse_id as number,
|
||||
unit_price: parseFloat(String(product.unit_price || 0)),
|
||||
unit_price: formattedUnitPrice,
|
||||
total_weight: parseFloat(String(product.total_weight || 0)),
|
||||
qty: parseFloat(String(product.qty || 0)),
|
||||
avg_weight: parseFloat(String(product.avg_weight || 0)),
|
||||
|
||||
Reference in New Issue
Block a user