增加每日助理人数查询并调整登录及对账展示

This commit is contained in:
summer committed 2026-10-24 16:09:45 +08:00
1 parent 8a4d1df248
commit 8d9039aacf
9 files changed
+207 -43

No files matched your search

+6 -6
View File
@@ -42,13 +42,13 @@ function table(html,label){
assert.ok(found,'应显示 '+label);return found[1];
}
test('收款人总额在账户表上方,收款与退款各自逐笔合计,冲回保留符号与明确标签',async()=>{
test('收款人净额在账户表上方,收款与退款各自逐笔合计,冲回保留符号与明确标签',async()=>{
const h=harness();await h.run('renderReport()');const html=h.content.innerHTML;
assert.equal(h.run('currentReport.recipientReceipts.assistant.receipt'),13345);assert.equal(h.content.attributes['aria-busy'],'false');
for(const name of ['助理总收款','麦麦总收款'])assert.ok(html.indexOf(name)<html.indexOf('按收款账户核对'));
assert.match(html,/助理总收款<\/h2><div class="report-recipient-total">¥133\.45/);
assert.match(html,/麦麦总收款<\/h2><div class="report-recipient-total">¥600\.03/);
assert.match(html,/退款 ¥5\.00<\/span><span>净收款 ¥128\.45/);assert.match(html,/退款 ¥10\.00<\/span><span>净收款 ¥590\.03/);
for(const name of ['助理净收款','麦麦净收款'])assert.ok(html.indexOf(name)<html.indexOf('按收款账户核对'));
assert.match(html,/助理净收款<\/h2><div class="report-recipient-total">¥128\.45/);
assert.match(html,/麦麦净收款<\/h2><div class="report-recipient-total">¥590\.03/);
assert.match(html,/退款 ¥5\.00<\/span><span>总收款 ¥133\.45/);assert.match(html,/退款 ¥10\.00<\/span><span>总收款 ¥600\.03/);
const receipts=table(html,'助理收款逐笔明细'),refunds=table(html,'助理退款逐笔明细');
assert.equal((receipts.match(/<tr(?: class="[^"]*")?>/g)||[]).length,5);assert.match(receipts,/客户-a/);assert.match(receipts,/客户-b/);assert.match(receipts,/收款冲回/);assert.match(receipts,/¥-10\.00/);assert.match(receipts,/收款明细合计<\/td><td class="number">¥133\.45/);
assert.doesNotMatch(receipts,/客户-r<|客户-rr<|退款冲回/);assert.match(refunds,/退款冲回/);assert.match(refunds,/¥-0\.01/);assert.match(refunds,/退款明细合计<\/td><td class="number">¥5\.00/);
@@ -76,7 +76,7 @@ test('空日明确显示两人零收款和空明细,只有退款时仍显示
assert.equal((html.match(/class="report-recipient-total">¥0\.00/g)||[]).length,2);
assert.match(table(html,'助理收款逐笔明细'),/所选范围没有助理收款记录/);assert.match(table(html,'麦麦收款逐笔明细'),/所选范围没有麦麦收款记录/);assert.doesNotMatch(html,/aria-label="助理退款明细"/);
const response=report(D,D,true),refund=payment('only-refund','refund',100,'助理现金');response.recipientReceipts.assistant={recipient:'assistant',name:'助理',receipt:0,refund:100,net:-100,items:[refund]};response.receiptsByOrderDate={receipt:0,refund:100,net:-100};
h.context.__response=response;await h.run('renderReport()');assert.match(h.content.innerHTML,/退款 ¥1\.00<\/span><span>净收款 ¥-1\.00/);assert.match(table(h.content.innerHTML,'助理收款逐笔明细'),/所选范围没有助理收款记录/);assert.match(table(h.content.innerHTML,'助理退款逐笔明细'),/客户-only-refund/);
h.context.__response=response;await h.run('renderReport()');assert.match(h.content.innerHTML,/助理净收款<\/h2><div class="report-recipient-total">¥-1\.00/);assert.match(h.content.innerHTML,/退款 ¥1\.00<\/span><span>总收款 ¥0\.00/);assert.match(table(h.content.innerHTML,'助理收款逐笔明细'),/所选范围没有助理收款记录/);assert.match(table(h.content.innerHTML,'助理退款逐笔明细'),/客户-only-refund/);
});
test('切换日月立即清空旧明细,晚到响应和失败不恢复旧收款,下载只取当前完整报告',async()=>{