fix_record_fee_print (#443)
Reviewed-on: daoyoucloud/tachycode#443 Reviewed-by: sealday <zhanglin@daoyoucloud.com> Co-authored-by: hello@lv <2256334253@qq.com> Co-committed-by: hello@lv <2256334253@qq.com>
This commit is contained in:
parent
5deae2d569
commit
e307b11006
@ -556,7 +556,7 @@ const PreviewDocument = ({
|
|||||||
style={detail.category === RecordCategory.purchase ? styles.tableCell2Last : styles.tableCellLast}
|
style={detail.category === RecordCategory.purchase ? styles.tableCell2Last : styles.tableCellLast}
|
||||||
>
|
>
|
||||||
{item.right_comment || ''}
|
{item.right_comment || ''}
|
||||||
{item.right_name && item.right_isExcluded ? '不计入合同' : item.left_comment || ''}
|
{item.right_name && item.right_isExcluded ? '不计入合同' : item.right_comment || ''}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
))}
|
))}
|
||||||
|
@ -141,32 +141,32 @@ export class RecordPdfService {
|
|||||||
isFee: true,
|
isFee: true,
|
||||||
isExcluded: item.is_excluded,
|
isExcluded: item.is_excluded,
|
||||||
name: item.custom_name || item.label,
|
name: item.custom_name || item.label,
|
||||||
count: item.count_source === SourcesType.staff ? item.fee_count : item.product_count,
|
count1: item.count_source === SourcesType.staff ? item.fee_count : item.product_count,
|
||||||
unit: item.unit,
|
unit: item.unit,
|
||||||
conversion_unit: item.unit,
|
|
||||||
comment: '',
|
comment: '',
|
||||||
product_id: item.product_id + '.' + (index + 1),
|
product_id: item.product_id + '.' + (index + 1),
|
||||||
category_id: item.product_category_id,
|
category_id: item.product_category_id,
|
||||||
};
|
};
|
||||||
if (item.conversion_logic_id === ConversionLogics.Keep) {
|
if (item.conversion_logic_id === ConversionLogics.Keep) {
|
||||||
data['total'] = data.count;
|
data['count'] = data.count1;
|
||||||
} else if (item.conversion_logic_id === ConversionLogics.Product) {
|
} else if (item.conversion_logic_id === ConversionLogics.Product) {
|
||||||
if (item.convertible) data['total'] = data.count * item.product_ratio;
|
if (item.convertible) data['count'] = data.count1 * item.product_ratio;
|
||||||
else data['total'] = data.count;
|
else data['count'] = data.count1;
|
||||||
} else if (item.conversion_logic_id === ConversionLogics.ProductWeight) {
|
} else if (item.conversion_logic_id === ConversionLogics.ProductWeight) {
|
||||||
data['total'] = data.count * item.product_weight;
|
data['count'] = data.count1 * item.product_weight;
|
||||||
} else if (item.conversion_logic_id === ConversionLogics.ActualWeight) {
|
} else if (item.conversion_logic_id === ConversionLogics.ActualWeight) {
|
||||||
data['total'] = item.actual_weight || item.record_weight;
|
data['count'] = item.actual_weight || item.record_weight;
|
||||||
} else {
|
} else {
|
||||||
if (item.weight_rules?.conversion_logic_id === ConversionLogics.Keep) {
|
if (item.weight_rules?.conversion_logic_id === ConversionLogics.Keep) {
|
||||||
data['total'] = data.count * item.weight_rules.weight;
|
data['count'] = data.count1 * item.weight_rules.weight;
|
||||||
} else if (item.weight_rules?.conversion_logic_id === ConversionLogics.Product) {
|
} else if (item.weight_rules?.conversion_logic_id === ConversionLogics.Product) {
|
||||||
data['total'] = data.count * item.weight_rules.weight * item.product_ratio;
|
data['count'] = data.count1 * item.weight_rules.weight * item.product_ratio;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 如果 printSetup === PrintSetup.DisplayAndPrice 要计算费用产生的价格
|
// 如果 printSetup === PrintSetup.DisplayAndPrice 要计算费用产生的价格
|
||||||
if (printSetup === PrintSetup.DisplayAndPrice) {
|
if (printSetup === PrintSetup.DisplayAndPrice) {
|
||||||
data['fee_price'] = data['total'] * item.unit_price;
|
data['total'] = data['count'] * item.unit_price;
|
||||||
|
data['conversion_unit'] = '元';
|
||||||
}
|
}
|
||||||
return data;
|
return data;
|
||||||
});
|
});
|
||||||
@ -193,7 +193,7 @@ export class RecordPdfService {
|
|||||||
const data = {
|
const data = {
|
||||||
isFee: true,
|
isFee: true,
|
||||||
name: item.custom_name || item.label,
|
name: item.custom_name || item.label,
|
||||||
unit: item.unit,
|
unit: '',
|
||||||
conversion_unit: item.unit,
|
conversion_unit: item.unit,
|
||||||
comment: '',
|
comment: '',
|
||||||
};
|
};
|
||||||
@ -244,7 +244,7 @@ export class RecordPdfService {
|
|||||||
const feeRule = fee_data.find((fee) => fee.fee_product_id === item.product_id);
|
const feeRule = fee_data.find((fee) => fee.fee_product_id === item.product_id);
|
||||||
if (feeRule) {
|
if (feeRule) {
|
||||||
data['total'] = feeRule.unit_price * item.count;
|
data['total'] = feeRule.unit_price * item.count;
|
||||||
data['unit'] = feeRule.unit || '';
|
data['unit'] = '';
|
||||||
}
|
}
|
||||||
return data;
|
return data;
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user