取消已用回收单时将关联用料转入公共料池
This commit is contained in:
1 parent
19b1b0263c
commit
dec01a3dca
18 files changed
+380
-56
No files matched your search
+4
-4
@@ -24,8 +24,8 @@ function lineType(line){
|
||||
|
||||
function orderRow(order){
|
||||
const draft=order.status==='draft',excluded=['returned','cancelled'].includes(order.status);
|
||||
const materialPoolIds=[...new Set(order.lines.filter(line=>line.costMaterial?.mode==='pool').map(line=>line.costMaterial.poolId))];
|
||||
const materialCostPending=!draft&&!excluded&&Boolean(order.materialCostPending||order.lines.some(line=>line.materialPool?.status==='pending'));
|
||||
const materialPoolIds=[...new Set(order.lines.flatMap(line=>[line.costMaterial?.mode==='pool'?line.costMaterial.poolId:null,line.priceLockPool?.poolId].filter(Boolean)))];
|
||||
const materialCostPending=!draft&&!excluded&&Boolean(order.materialCostPending||order.lines.some(line=>line.materialPool?.status==='pending'||line.materialPool?.amount===null||line.priceLockPool?.status==='pending'||line.priceLockPool?.amount===null));
|
||||
const costs=Calc.orderCosts(order);
|
||||
const costItems=draft?[]:costs.rows.filter(item=>!item.excluded&&item.kind!=='pending').map(item=>({...item,component:component(item)}));
|
||||
const pendingCostItems=draft?[]:costs.rows.filter(item=>item.kind==='pending').map(item=>({...item,component:'fee'}));
|
||||
@@ -45,10 +45,10 @@ function orderRow(order){
|
||||
};
|
||||
const unknown={
|
||||
sale:draft,
|
||||
material:draft||legacyUnallocated||materialItems.some(item=>item.amount==null),
|
||||
material:draft||legacyUnallocated||materialCostPending||materialItems.some(item=>item.amount==null),
|
||||
laborAndFees:draft||legacyUnallocated||laborAndFeeItems.some(item=>item.amount==null)||pendingCosts>0,
|
||||
unallocated:draft||unallocatedItems.some(item=>item.amount==null),
|
||||
totalCost:draft||missingCosts>0||pendingCosts>0,
|
||||
totalCost:draft||materialCostPending||missingCosts>0||pendingCosts>0,
|
||||
ownerCost:draft||[...missingItems,...pendingCostItems].some(item=>item.payer==='owner'),
|
||||
assistantCost:draft||[...missingItems,...pendingCostItems].some(item=>item.payer==='assistant'),
|
||||
assistant2Cost:draft||[...missingItems,...pendingCostItems].some(item=>item.payer==='assistant2')
|
||||
|
||||
Reference in new issue
Block a user