mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-25 15:55:48 +00:00
fix(FE): Fix marketing type value logic in SalesOrderFormModal
This commit is contained in:
@@ -198,6 +198,13 @@ const SalesOrderFormModal = ({
|
|||||||
: 'KG' // termasuk "QTY" dan "KG"
|
: 'KG' // termasuk "QTY" dan "KG"
|
||||||
: undefined;
|
: undefined;
|
||||||
|
|
||||||
|
// Jika value dari data product ada week, kirim "AYAM_PULLET, jika tidak ada kirim "AYAM"
|
||||||
|
let marketingTypeValue =
|
||||||
|
product.marketing_type?.value?.toUpperCase() || '';
|
||||||
|
if (marketingTypeValue === 'AYAM,AYAM_PULLET') {
|
||||||
|
marketingTypeValue = product.week ? 'AYAM_PULLET' : 'AYAM';
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
vehicle_number: product.vehicle_number as string,
|
vehicle_number: product.vehicle_number as string,
|
||||||
kandang_id: product.kandang_id as number,
|
kandang_id: product.kandang_id as number,
|
||||||
@@ -207,8 +214,7 @@ const SalesOrderFormModal = ({
|
|||||||
qty: parseFloat(String(product.qty || 0)),
|
qty: parseFloat(String(product.qty || 0)),
|
||||||
avg_weight: parseFloat(String(product.avg_weight || 0)),
|
avg_weight: parseFloat(String(product.avg_weight || 0)),
|
||||||
total_price: parseFloat(String(product.total_price || 0)),
|
total_price: parseFloat(String(product.total_price || 0)),
|
||||||
marketing_type:
|
marketing_type: marketingTypeValue,
|
||||||
product.marketing_type?.value?.toUpperCase() || '',
|
|
||||||
convertion_unit: normalizedConvertionUnit,
|
convertion_unit: normalizedConvertionUnit,
|
||||||
weight_per_convertion:
|
weight_per_convertion:
|
||||||
product.weight_per_convertion ?? undefined,
|
product.weight_per_convertion ?? undefined,
|
||||||
|
|||||||
Reference in New Issue
Block a user