fix
This commit is contained in:
parent
5bf862bdbe
commit
2e3343dcb8
@ -563,7 +563,7 @@ useEffect(() => {
|
||||
junCost: product.forecast_cost_period_three?.toString() || '0',
|
||||
|
||||
// Variation reasons
|
||||
variationReason: product.variation_reason_master_id?.toString() || '',
|
||||
variationReason: product.variation_reason_master_id?.toString() || '0',
|
||||
otherVariationReason: product.other_variation_reason || '',
|
||||
zeroTargetReason: product.zero_target_reason_master_id?.toString() || '',
|
||||
otherZeroTargetReason: product.other_zero_target_reason || '',
|
||||
@ -699,7 +699,7 @@ const existingProduct = currentSubmission.products?.find(p =>
|
||||
return {
|
||||
id: existingProduct?.id || 0,
|
||||
product_id: selectedProduct?.product_id || product.product_id || null,
|
||||
unit_id: product.unit?.toString() || '', // Ensure unit_id is a string
|
||||
unit_id: product.unit?.toString() || '0', // Ensure unit_id is a string
|
||||
annual_installed_capacity: product.capacity || '0',
|
||||
previous_quantity_period_one: product.octQuantity || '0',
|
||||
previous_quantity_period_two: product.novQuantity || '0',
|
||||
@ -729,10 +729,10 @@ const existingProduct = currentSubmission.products?.find(p =>
|
||||
// Next quarter forecast (Q2) - December
|
||||
forecast_quantity: product.decQuantity || '0',
|
||||
forecast_cost: product.decCost || '0',
|
||||
variation_reason_master_id: product.variationReason || '',
|
||||
other_variation_reason: product.otherVariationReason || '',
|
||||
zero_target_reason_master_id: product.zeroTargetReason || '',
|
||||
other_zero_target_reason: product.otherZeroTargetReason || '',
|
||||
variation_reason_master_id: product.variationReason || '0',
|
||||
other_variation_reason: product.otherVariationReason || '0',
|
||||
zero_target_reason_master_id: product.zeroTargetReason || '0',
|
||||
other_zero_target_reason: product.otherZeroTargetReason || '0',
|
||||
remarks: product.remarks || remarks || '' // Use product.remarks if available, otherwise use the component's remarks state
|
||||
};
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user