移入店铺配置,保留原账号与历史账务口径
This commit is contained in:
1 parent
8d68111479
commit
90bdc75150
22 files changed
+535
-62
No files matched your search
@@ -13,6 +13,7 @@ const yuan=value=>value==null?'':(value/100).toFixed(2);
|
||||
const sum=(rows,key)=>rows.reduce((total,row)=>total+(typeof key==='function'?key(row):row[key]??0),0);
|
||||
const same=(a,b)=>JSON.stringify(a)===JSON.stringify(b);
|
||||
const CreditCardFees=require('./public/credit-card-fees');
|
||||
const CreditCardRates=require('./credit-card-rates');
|
||||
const isCardFee=item=>item?.system==='credit_card'||String(item?.key||'').startsWith('card_fee:');
|
||||
const COST_FIELDS=['payer','costPayers','costFundings','cost','costParts','costMaterial','costLabor','materialAllocations','priceLockPool','returnedStockId','returnedStock'];
|
||||
const SALE_FIELDS=['name','code','unit','quantity','pocket','stockCount','sale','baseSale','charges','pricingMode','goldPrice','laborRate','laborMode','pieces','priceNote'];
|
||||
@@ -129,6 +130,7 @@ function replacePayments(ledger,order,date,total,account,previousAccount,actor,r
|
||||
// 成本、客户或商品名称更正不改变已核实且未变化的客户款。
|
||||
const sameAccount=CreditCardFees.normalizeAccount(account)===CreditCardFees.normalizeAccount(previousAccount);
|
||||
if(order.date===date&&order.netReceived===total&&sameAccount)return;
|
||||
CreditCardRates.capture(ledger,'order',order.id,order.credit_card_rate_permille);
|
||||
const corrected=new Set(order.corrections.filter(row=>row.type==='payment').map(row=>row.target));
|
||||
const active=order.payments.filter(row=>row.amount>0&&!row.price_lock_event_id&&!corrected.has(row.id));
|
||||
const cardFees=ledger.rawOrder(order.id).fee_items.filter(isCardFee);
|
||||
|
||||
Reference in new issue
Block a user