From 0e146739bc59ab4a174e0409b1b884c4c06d8b37 Mon Sep 17 00:00:00 2001 From: summer Date: Wed, 4 Nov 2026 00:12:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=AF=8F=E6=97=A5=E5=AF=B9=E8=B4=A6=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E6=94=B6=E8=B5=B7=E9=BA=A6=E9=BA=A6=E5=9E=AB=E4=BB=98?= =?UTF-8?q?=E6=98=8E=E7=BB=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 新账系统/public/app.css | 2 +- 新账系统/public/app.js | 2 +- 新账系统/test/report-receipts-ui.test.js | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/新账系统/public/app.css b/新账系统/public/app.css index 6ba7a3c..af4412c 100644 --- a/新账系统/public/app.css +++ b/新账系统/public/app.css @@ -65,7 +65,7 @@ input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer- .report-pool-material{margin-top:13px;padding:12px 14px;background:var(--soft);border:1px solid var(--border);border-radius:7px;font-size:12px;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}.report-pool-material-heading{display:flex;align-items:baseline;gap:7px 16px;flex-wrap:wrap}.report-pool-material-heading>strong{font-size:18px;font-weight:600;color:var(--green)}.report-pool-material ul{list-style:none;padding:0;margin:9px 0;display:grid;gap:6px}.report-pool-material li{display:flex;align-items:baseline;flex-wrap:wrap;gap:3px 14px;line-height:1.8}.report-pool-material li>span{color:var(--muted)}.report-pool-material li>strong{font-weight:500}.report-pool-material p{margin:7px 0 0;line-height:1.7}.report-pool-material p b{font-size:14px;font-weight:550;margin-left:7px}.report-pool-material .small{font-size:11px}.report-pool-material .report-owner-advance{font-weight:550;line-height:1.9}@media(max-width:650px){.report-pool-material{padding:10px 11px}.report-pool-material li{display:block}.report-pool-material li>strong{display:block}} -.report-owner-advances{margin-top:17px;padding-top:15px;border-top:1px solid var(--border);min-width:0}.report-owner-advances>h3{font-size:13px;font-weight:550;margin:0}.report-owner-advances>p.small{font-size:11px;line-height:1.7;margin:7px 0 0}.report-owner-advance-day{margin-top:12px;padding-top:11px;border-top:1px solid var(--border)}.report-owner-advance-day>header{display:flex;align-items:baseline;flex-wrap:wrap;gap:7px 22px;font-size:12px}.report-owner-advance-day h4{font-size:13px;font-weight:550;margin:0}.report-owner-advance-day header strong{font-size:18px;color:var(--green);margin-left:9px;font-variant-numeric:tabular-nums}.report-owner-advance-day>.report-owner-advance{font-size:12px;line-height:1.8;margin:8px 0}.report-owner-advance-day>.table-wrap{margin-top:10px}.report-owner-advance-table{font-size:12px;min-width:510px}.report-owner-advance-table th,.report-owner-advance-table td{padding:10px 9px;white-space:normal;overflow-wrap:anywhere}.report-owner-advance-table th:first-child{width:100px}.report-owner-advance-table th:nth-child(2){width:25%}.report-owner-advance-table th:last-child{width:155px;text-align:right}.report-owner-advance-table small{display:block;font-size:10px;line-height:1.7;margin-top:4px}.report-owner-advance-table .link-button{font-size:12px}.report-business-history>summary{font-size:12px;color:var(--muted);font-weight:500}.report-business-history>p.small{font-size:11px;line-height:1.7}@media(max-width:650px){.report-owner-advance-table{min-width:430px;font-size:11px}.report-owner-advance-table th,.report-owner-advance-table td{padding:8px 6px}.report-owner-advance-table th:first-child{width:86px}.report-owner-advance-table th:last-child{width:120px}} +.report-owner-advances{margin:17px 0 0;padding-top:15px;border-top:1px solid var(--border);min-width:0}.report-owner-advances>summary{font-size:13px;font-weight:550;margin:0}.report-owner-advances>p.small{font-size:11px;line-height:1.7;margin:7px 0 0}.report-owner-advance-day{margin-top:12px;padding-top:11px;border-top:1px solid var(--border)}.report-owner-advance-day>header{display:flex;align-items:baseline;flex-wrap:wrap;gap:7px 22px;font-size:12px}.report-owner-advance-day h4{font-size:13px;font-weight:550;margin:0}.report-owner-advance-day header strong{font-size:18px;color:var(--green);margin-left:9px;font-variant-numeric:tabular-nums}.report-owner-advance-day>.report-owner-advance{font-size:12px;line-height:1.8;margin:8px 0}.report-owner-advance-day>.table-wrap{margin-top:10px}.report-owner-advance-table{font-size:12px;min-width:510px}.report-owner-advance-table th,.report-owner-advance-table td{padding:10px 9px;white-space:normal;overflow-wrap:anywhere}.report-owner-advance-table th:first-child{width:100px}.report-owner-advance-table th:nth-child(2){width:25%}.report-owner-advance-table th:last-child{width:155px;text-align:right}.report-owner-advance-table small{display:block;font-size:10px;line-height:1.7;margin-top:4px}.report-owner-advance-table .link-button{font-size:12px}.report-business-history>summary{font-size:12px;color:var(--muted);font-weight:500}.report-business-history>p.small{font-size:11px;line-height:1.7}@media(max-width:650px){.report-owner-advance-table{min-width:430px;font-size:11px}.report-owner-advance-table th,.report-owner-advance-table td{padding:8px 6px}.report-owner-advance-table th:first-child{width:86px}.report-owner-advance-table th:last-child{width:120px}} .report-daily-profits{min-width:0;margin-bottom:20px}.report-daily-profits h2{font-size:16px;margin:0 0 8px}.report-daily-profits>p{font-size:11px;line-height:1.7}.report-daily-profits .table-wrap{margin-top:14px}.report-daily-profits table{font-size:13px;min-width:550px;font-variant-numeric:tabular-nums}.report-daily-profits th,.report-daily-profits td{padding:12px 10px;white-space:normal;overflow-wrap:anywhere}.report-daily-profits th.number{text-align:right}.report-daily-profits td:first-child{width:120px;white-space:nowrap}.report-daily-profits small{display:block;font-size:10px;line-height:1.6;margin-top:4px}.report-daily-profits tfoot td{font-weight:600;background:var(--soft);border-top:1px solid var(--border)}.report-daily-profits .report-daily-profit-note{margin:12px 0 0}@media(max-width:650px){.report-daily-profits{padding:17px 14px}.report-daily-profits table{min-width:500px;font-size:12px}.report-daily-profits th,.report-daily-profits td{padding:10px 7px}} diff --git a/新账系统/public/app.js b/新账系统/public/app.js index 2979e01..f6f389d 100644 --- a/新账系统/public/app.js +++ b/新账系统/public/app.js @@ -1441,7 +1441,7 @@ function reportOwnerAdvanceIdentity(item){ function reportOwnerAdvancesHTML(business){ const advances=business.ownerAdvances,single=advances.from===advances.date,label=business.member==='owner'?'麦麦付款明细':'麦麦垫付明细'; const days=advances.days.length?advances.days:single?[{date:advances.date,amount:0,knownAmount:0,missingCount:0,pendingCount:0,items:[]}]:[]; - return `

${single?'当日':'按日核对'}${label}

按所属订单开单日、售后记录日归集;仅列所选日期,不累计历史垫付。垫付与扣除代收、转账后的净往来分别核对。

${days.map(day=>`

${e(day.date)}

${day.missingCount?'已知':''}${business.member==='owner'?'付款':'垫付'}小计 ${e(reportOwnerAdvanceAmount(day.amount,day.knownAmount))}
${day.items.some(item=>item.poolMaterial)?`

${e(reportOwnerAdvanceFormula(business,day))}

`:''}${day.items.length?`
${day.items.map(item=>``).join('')}
日期客户/单号成本项目麦麦承担金额
${e(item.date)}${reportOwnerAdvanceIdentity(item)}${e(item.name)}${item.source?`${e(item.source)}`:''}${e(reportOwnerAdvanceItemAmount(item))}
`:'

当天没有已登记的'+(business.member==='owner'?'麦麦付款':'麦麦垫付')+'明细。

'}${day.pendingCount?'

待核对项目尚未入账,预估金额不计垫付小计。

':''}
`).join('')||'

所选月份暂无已登记的'+label+'。

'}
`; + return `
${single?'当日':'按日核对'}${label}

按所属订单开单日、售后记录日归集;仅列所选日期,不累计历史垫付。垫付与扣除代收、转账后的净往来分别核对。

${days.map(day=>`

${e(day.date)}

${day.missingCount?'已知':''}${business.member==='owner'?'付款':'垫付'}小计 ${e(reportOwnerAdvanceAmount(day.amount,day.knownAmount))}
${day.items.some(item=>item.poolMaterial)?`

${e(reportOwnerAdvanceFormula(business,day))}

`:''}${day.items.length?`
${day.items.map(item=>``).join('')}
日期客户/单号成本项目麦麦承担金额
${e(item.date)}${reportOwnerAdvanceIdentity(item)}${e(item.name)}${item.source?`${e(item.source)}`:''}${e(reportOwnerAdvanceItemAmount(item))}
`:'

当天没有已登记的'+(business.member==='owner'?'麦麦付款':'麦麦垫付')+'明细。

'}${day.pendingCount?'

待核对项目尚未入账,预估金额不计垫付小计。

':''}
`).join('')||'

所选月份暂无已登记的'+label+'。

'}
`; } function reportOwnerAdvancesText(business){ const advances=business.ownerAdvances,label=business.member==='owner'?'麦麦付款明细':'麦麦垫付明细'; diff --git a/新账系统/test/report-receipts-ui.test.js b/新账系统/test/report-receipts-ui.test.js index 3b6cc19..dbba808 100644 --- a/新账系统/test/report-receipts-ui.test.js +++ b/新账系统/test/report-receipts-ui.test.js @@ -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='';day.items[1].name='';day.items[1].source='付款备注'; const h=businessHarness(response);await h.run('renderReport()');const card=memberCard(h.content.innerHTML,'assistant'),html=table(card,D+' 麦麦垫付明细'); - assert.match(card,/
]*>

当日麦麦垫付明细<\/h3>/);assert.match(card,/垫付小计 ¥1,069\.33/);assert.match(html,/日期<\/th>客户/单号<\/th>成本项目<\/th>麦麦承担金额/);assert.match(html,/料池料费 · 麦麦垫付部分/);assert.match(html,/¥1,033\.33/);assert.doesNotMatch(html,/2\.000g|×/);assert.match(html,/<img src=x>/);assert.match(html,/<script>实际运费<\/script>/);assert.match(html,/<b>付款备注<\/b>/);assert.doesNotMatch(html,//); + assert.match(card,/
]*>当日麦麦垫付明细<\/summary>/);assert.doesNotMatch(card,/]*report-owner-advances[^>]*\sopen(?:\s|=|>)/);assert.match(card,/垫付小计 ¥1,069\.33/);assert.match(html,/日期<\/th>客户/单号<\/th>成本项目<\/th>麦麦承担金额/);assert.match(html,/料池料费 · 麦麦垫付部分/);assert.match(html,/¥1,033\.33/);assert.doesNotMatch(html,/2\.000g|×/);assert.match(html,/<img src=x>/);assert.match(html,/<script>实际运费<\/script>/);assert.match(html,/<b>付款备注<\/b>/);assert.doesNotMatch(html,//); assert.ok(card.indexOf('report-owner-advances')累计往来(含历史/);assert.doesNotMatch(card,/]*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>/);assert.match(card,/

2026-10-21<\/h4>垫付小计 ¥100\.00/);assert.match(card,/

2026-10-22<\/h4>垫付小计 ¥1,069\.33/);assert.doesNotMatch(card,/垫付小计 ¥1,169\.33|

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,/
]*>按日核对麦麦垫付明细<\/summary>/);assert.doesNotMatch(card,/]*report-owner-advances[^>]*\sopen(?:\s|=|>)/);assert.match(card,/

2026-10-21<\/h4>垫付小计 ¥100\.00/);assert.match(card,/

2026-10-22<\/h4>垫付小计 ¥1,069\.33/);assert.doesNotMatch(card,/垫付小计 ¥1,169\.33|

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/); });