常用成本增加银链家里18元由麦麦付款
This commit is contained in:
1 parent
294c430884
commit
5777036743
3 files changed
+45
-20
No files matched your search
@@ -9,6 +9,7 @@
|
||||
if(['快递','快递费','运费','京东快递','圆通快递'].includes(value))return 'shipping';
|
||||
if(['包装','包装盒','盒子'].includes(value)||/^盒子(\d+个 × 3元\/个)$/.test(value))return 'box';
|
||||
if(['钢绳','钢绳(店里)','钢绳(店里)'].includes(value))return 'braiding';
|
||||
if(['银链','银链(家里)','银链(家里)'].includes(value))return 'silverChain';
|
||||
return '';
|
||||
}
|
||||
function boxCount(value){
|
||||
@@ -21,16 +22,19 @@
|
||||
if(item.key==='shipping'&&item.note==='京东快递'&&Number(item.amount)===8&&item.payer==='owner')return 'jd';
|
||||
if(item.key==='shipping'&&item.note==='圆通快递'&&Number(item.amount)===6&&['owner','assistant','assistant2'].includes(item.payer))return 'yt';
|
||||
if(item.key==='braiding'&&item.note==='钢绳(店里)'&&Number(item.amount)===7&&item.payer==='owner')return 'steel';
|
||||
if(item.key==='other'&&item.note==='银链(家里)'&&Number(item.amount)===18&&item.payer==='owner')return 'silver';
|
||||
const match=item.key==='box'&&String(item.note).match(/^盒子(([^)]*)个 × 3元\/个)$/);
|
||||
if(match&&item.payer==='owner'){if(item.amount==='')return 'box';try{if(Number(item.amount)===boxCount(match[1])*3)return 'box';}catch{}}
|
||||
return '';
|
||||
}
|
||||
function checkboxFees({shipping='',box=false,quantity='1',steel=false}={},member='assistant'){
|
||||
function checkboxFees({shipping='',box=false,quantity='1',steel=false,silver=false}={},member='assistant'){
|
||||
const items=[],add=(key,note,amount,payer)=>items.push({key,note,amount:String(amount),payer,status:'estimated',edited:true});
|
||||
if(shipping==='jd')add('shipping','京东快递',8,'owner');
|
||||
else if(shipping==='yt')add('shipping','圆通快递',6,['owner','assistant','assistant2'].includes(member)?member:'assistant');
|
||||
if(box){const count=boxCount(quantity);add('box',`盒子(${count}个 × 3元/个)`,count*3,'owner');}
|
||||
if(steel)add('braiding','钢绳(店里)',7,'owner');
|
||||
// 沿用其他直接费用的兼容键,由名称区分家里银链。
|
||||
if(silver)add('other','银链(家里)',18,'owner');
|
||||
return items;
|
||||
}
|
||||
function sync(existing,lines,{addShipping=false,defaultPayer='assistant',shopDefaults={},checkboxCosts=false}={}){
|
||||
|
||||
Reference in new issue
Block a user