每日对账默认收起麦麦垫付明细

This commit is contained in:
summer committed 2026-11-04 00:12:34 +08:00
1 parent 518513e630
commit 0e146739bc
3 files changed
+5 -5

No files matched your search

+3 -3
View File
@@ -237,10 +237,10 @@ test('料费分项、克重、付款归属和其他成本必须守恒,缺失
for(const change of changes){const response=poolBusinessReport();change(response);const h=businessHarness(response);await h.run('renderReport()');assert.equal(h.run('currentReport'),null);assert.match(h.content.innerHTML,/所属订单成本、利润或待转资料未完整返回/);assert.doesNotMatch(h.content.innerHTML,/料池已用料费<\/span>/);}
});
test('麦麦逐笔垫付默认展开且客户可打开原单,多人池料子行只显示分摊金额,所有文字转义',async()=>{
test('麦麦逐笔垫付默认收起且客户可打开原单,多人池料子行只显示分摊金额,所有文字转义',async()=>{
const response=poolBusinessReport(),day=response.ownershipBusiness.assistant.ownerAdvances.days[0];day.items[0].customer='<img src=x>';day.items[1].name='<script>实际运费</script>';day.items[1].source='<b>付款备注</b>';
const h=businessHarness(response);await h.run('renderReport()');const card=memberCard(h.content.innerHTML,'assistant'),html=table(card,D+' 麦麦垫付明细');
assert.match(card,/<section class="report-owner-advances"[^>]*><h3>当日麦麦垫付明细<\/h3>/);assert.match(card,/垫付小计 <strong>¥1,069\.33/);assert.match(html,/<th>日期<\/th><th>客户/单号<\/th><th>成本项目<\/th><th class="number">麦麦承担金额/);assert.match(html,/料池料费 · 麦麦垫付部分/);assert.match(html,/¥1,033\.33/);assert.doesNotMatch(html,/2\.000g|×/);assert.match(html,/&lt;img src=x&gt;/);assert.match(html,/&lt;script&gt;实际运费&lt;\/script&gt;/);assert.match(html,/&lt;b&gt;付款备注&lt;\/b&gt;/);assert.doesNotMatch(html,/<img|<script|<b>/);
assert.match(card,/<details class="report-owner-advances"[^>]*><summary>当日麦麦垫付明细<\/summary>/);assert.doesNotMatch(card,/<details[^>]*report-owner-advances[^>]*\sopen(?:\s|=|>)/);assert.match(card,/垫付小计 <strong>¥1,069\.33/);assert.match(html,/<th>日期<\/th><th>客户/单号<\/th><th>成本项目<\/th><th class="number">麦麦承担金额/);assert.match(html,/料池料费 · 麦麦垫付部分/);assert.match(html,/¥1,033\.33/);assert.doesNotMatch(html,/2\.000g|×/);assert.match(html,/&lt;img src=x&gt;/);assert.match(html,/&lt;script&gt;实际运费&lt;\/script&gt;/);assert.match(html,/&lt;b&gt;付款备注&lt;\/b&gt;/);assert.doesNotMatch(html,/<img|<script|<b>/);
assert.ok(card.indexOf('report-owner-advances')<card.indexOf('report-business-history'));assert.match(card,/<details class="report-business-settlement report-business-history"><summary>累计往来(含历史/);assert.doesNotMatch(card,/<details[^>]*report-business-history[^>]* open/);
const button={dataset:{action:'open-order',id:'pool'},closest(){return null;}};for(const handler of h.handlers.click)await handler({target:{closest:()=>button}});assert.deepEqual(JSON.parse(JSON.stringify(h.calls.slice(1))),[{openOrder:'pool'}]);
const text=h.run('reportOwnershipReceiptsText(currentReport).join(String.fromCharCode(10))');assert.match(text,/2026-10-22 垫付小计:¥1,069\.33/);assert.match(text,/累计往来(含历史,截至 2026-10-22)/);
@@ -250,7 +250,7 @@ test('月份垫付明细只列实际记录日期及各日小计,不把月合
const response=poolBusinessReport(),from='2026-10-01',prior='2026-10-21',old=response.ownershipBusiness.assistant;
response.from=from;response.dailyProfits.from=from;for(const b of Object.values(response.ownershipBusiness)){b.from=from;b.ownerAdvances.from=from;b.settlement.from=from;}
response.ownershipBusiness.assistant=businessPerson(response.ownershipReceipts.assistant,D,from,{costByPayer:{owner:{totalCost:116933,knownTotalCost:116933},assistant:{totalCost:90300,knownTotalCost:90300}},poolMaterial:{...old.poolMaterial,otherCosts:{amount:13900,knownAmount:13900}},ownerAdvances:advances([advanceDay(prior,[advanceItem('yesterday','昨日实际配件',10000)]),...old.ownerAdvances.days],from,D),settlement:settlement([counterpart('owner',50000,96933)],D,from)});
const h=businessHarness(response);h.range(D,true);await h.run('renderReport()');const card=memberCard(h.content.innerHTML,'assistant');assert.match(card,/<h3>按日核对麦麦垫付明细<\/h3>/);assert.match(card,/<h4>2026-10-21<\/h4><span>垫付小计 <strong>¥100\.00/);assert.match(card,/<h4>2026-10-22<\/h4><span>垫付小计 <strong>¥1,069\.33/);assert.doesNotMatch(card,/垫付小计 <strong>¥1,169\.33|<h4>2026-10-01/);assert.equal((card.match(/class="report-owner-advance-day"/g)||[]).length,2);
const h=businessHarness(response);h.range(D,true);await h.run('renderReport()');const card=memberCard(h.content.innerHTML,'assistant');assert.match(card,/<details class="report-owner-advances"[^>]*><summary>按日核对麦麦垫付明细<\/summary>/);assert.doesNotMatch(card,/<details[^>]*report-owner-advances[^>]*\sopen(?:\s|=|>)/);assert.match(card,/<h4>2026-10-21<\/h4><span>垫付小计 <strong>¥100\.00/);assert.match(card,/<h4>2026-10-22<\/h4><span>垫付小计 <strong>¥1,069\.33/);assert.doesNotMatch(card,/垫付小计 <strong>¥1,169\.33|<h4>2026-10-01/);assert.equal((card.match(/class="report-owner-advance-day"/g)||[]).length,2);
const text=h.run('reportOwnershipReceiptsText(currentReport).join(String.fromCharCode(10))');assert.match(text,/2026-10-21 垫付小计:¥100\.00/);assert.match(text,/2026-10-22 垫付小计:¥1,069\.33/);assert.doesNotMatch(text,/垫付小计:¥1,169\.33/);
});