wwt-certificate-tool 1.2.68 → 1.2.70
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app.html +121 -29
- package/dist/version.json +6 -6
- package/package.json +1 -1
package/dist/app.html
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8">
|
|
5
5
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
6
|
-
<title>WWT 金蝶凭证工具 · 纯前端版 P1.2.
|
|
6
|
+
<title>WWT 金蝶凭证工具 · 纯前端版 P1.2.70</title>
|
|
7
7
|
<style>*{box-sizing:border-box;margin:0;padding:0}
|
|
8
8
|
body{font-family:"Microsoft YaHei","PingFang SC",-apple-system,Segoe UI,sans-serif;font-size:13px;color:#1f2328;background:#f4f6f9;line-height:1.6}
|
|
9
9
|
h1{font-size:17px;font-weight:600}
|
|
@@ -328,7 +328,7 @@ input[data-f="field"][list^="dlGe_"]::placeholder{color:#a8861f;font-style:itali
|
|
|
328
328
|
<div class="brand">
|
|
329
329
|
<span class="logo">WWT</span>
|
|
330
330
|
<div>
|
|
331
|
-
<h1>金蝶凭证工具 <span class="ver">P1.2.
|
|
331
|
+
<h1>金蝶凭证工具 <span class="ver">P1.2.70</span></h1>
|
|
332
332
|
<div class="sub">纯前端离线版 · 双击即用 · 数据只存在本机,不上传任何服务器</div>
|
|
333
333
|
</div>
|
|
334
334
|
</div>
|
|
@@ -1816,7 +1816,7 @@ window.WWT_ENGINE = (function () {
|
|
|
1816
1816
|
if (!globalExcludedUsed[curSrc]) globalExcludedUsed[curSrc] = new Set();
|
|
1817
1817
|
|
|
1818
1818
|
// 命中行(同一行只归属第一条命中的规则)
|
|
1819
|
-
|
|
1819
|
+
let rowsIn = [];
|
|
1820
1820
|
for (let i = 0; i < rowsAll.length; i++) {
|
|
1821
1821
|
if (usedRows[curSrc].has(i)) continue;
|
|
1822
1822
|
const row = rowsAll[i];
|
|
@@ -1834,11 +1834,20 @@ window.WWT_ENGINE = (function () {
|
|
|
1834
1834
|
}
|
|
1835
1835
|
}
|
|
1836
1836
|
if (!rowsIn.length) { stats.skipped.push({ rule: rule.name, why: "无条件命中行" }); continue; }
|
|
1837
|
-
rowsIn.forEach(it => usedRows[curSrc].add(it._i));
|
|
1838
|
-
stats.rules++; stats.rows += rowsIn.length;
|
|
1839
1837
|
|
|
1840
1838
|
// 每行挂上生效 lines(分支优先)
|
|
1841
1839
|
for (const it of rowsIn) it._lines = resolveEffectiveLines(rule, it.row, curSrc, idx);
|
|
1840
|
+
// 【P1.2.69】命中顶层条件但无有效分录行(分支未覆盖且无默认 lines)的行,不占用 usedRows,
|
|
1841
|
+
// 留给后续规则 / 遗漏统计,避免" silently 被吞"。
|
|
1842
|
+
const noLinesRows = rowsIn.filter(it => !it._lines || !it._lines.length);
|
|
1843
|
+
if (noLinesRows.length) {
|
|
1844
|
+
stats.skipped.push({ rule: rule.name, why: "命中但无有效分录行 " + noLinesRows.length + " 行" });
|
|
1845
|
+
}
|
|
1846
|
+
const effectiveRowsIn = rowsIn.filter(it => it._lines && it._lines.length);
|
|
1847
|
+
if (!effectiveRowsIn.length) { stats.skipped.push({ rule: rule.name, why: "无有效分录行" }); continue; }
|
|
1848
|
+
effectiveRowsIn.forEach(it => usedRows[curSrc].add(it._i));
|
|
1849
|
+
stats.rules++; stats.rows += effectiveRowsIn.length;
|
|
1850
|
+
rowsIn = effectiveRowsIn; // 后续分桶统一用有效行
|
|
1842
1851
|
|
|
1843
1852
|
// Step A:分桶(决定几张凭证)
|
|
1844
1853
|
const genMode = opts.modeOverride || rule.genMode || "一对一";
|
|
@@ -2208,11 +2217,12 @@ window.WWT_ENGINE = (function () {
|
|
|
2208
2217
|
const out = [];
|
|
2209
2218
|
const missing = [];
|
|
2210
2219
|
const stats = { rules: 0, rows: 0, vouchers: 0, entries: 0, skipped: [], totalRows: 0 };
|
|
2220
|
+
const noLinesIdxs = new Set(); // 【P1.2.69】命中顶层条件但无有效分录行的索引
|
|
2211
2221
|
if (rowsAll.length) {
|
|
2212
2222
|
// 直接复用 generate 走一遍,但只跑这一条 rule;为不污染 vstart,每次都重算起始号
|
|
2213
2223
|
// 这里简单实现:复制 generate 主循环的核心分桶逻辑,但只跑一条 rule
|
|
2214
2224
|
const sel = new Set([r.id]);
|
|
2215
|
-
|
|
2225
|
+
let rowsIn = [];
|
|
2216
2226
|
for (let i = 0; i < rowsAll.length; i++) {
|
|
2217
2227
|
if (usedRows.has(i)) continue;
|
|
2218
2228
|
const row = rowsAll[i];
|
|
@@ -2232,6 +2242,19 @@ window.WWT_ENGINE = (function () {
|
|
|
2232
2242
|
rowsIn.forEach(it => usedRows.add(it._i));
|
|
2233
2243
|
stats.rules++; stats.rows += rowsIn.length;
|
|
2234
2244
|
for (const it of rowsIn) it._lines = resolveEffectiveLines(r, it.row, curSrc, idx);
|
|
2245
|
+
// 【P1.2.69】无有效分录行的,不算真正命中,从 usedRows 移除并单独记录
|
|
2246
|
+
for (const it of rowsIn) {
|
|
2247
|
+
if (!it._lines || !it._lines.length) {
|
|
2248
|
+
usedRows.delete(it._i);
|
|
2249
|
+
noLinesIdxs.add(it._i);
|
|
2250
|
+
}
|
|
2251
|
+
}
|
|
2252
|
+
const effectiveRowsIn = rowsIn.filter(it => it._lines && it._lines.length);
|
|
2253
|
+
if (effectiveRowsIn.length) {
|
|
2254
|
+
stats.rules = Math.max(1, stats.rules); // 保持规则计数
|
|
2255
|
+
stats.rows = effectiveRowsIn.length; // 修正为有效行数
|
|
2256
|
+
rowsIn = effectiveRowsIn; // 后续分桶用有效行
|
|
2257
|
+
}
|
|
2235
2258
|
|
|
2236
2259
|
const genMode = r.genMode;
|
|
2237
2260
|
const gb = r.genGroupBy || "";
|
|
@@ -2386,11 +2409,12 @@ window.WWT_ENGINE = (function () {
|
|
|
2386
2409
|
}
|
|
2387
2410
|
|
|
2388
2411
|
/* ---- by_source:本源覆盖情况 ----
|
|
2389
|
-
*
|
|
2412
|
+
* 拆四段:
|
|
2390
2413
|
* candidatesMissed = 应处理子集(满足全部 = 条件)但未生成凭证 = 真正的"遗漏"
|
|
2414
|
+
* branchMissed = 命中顶层条件但无有效分录行(分支未覆盖且无默认 lines)
|
|
2391
2415
|
* excludedRows = 源表里不满足本规则的全部 = 条件 → 按规则就不该处理,不算遗漏
|
|
2392
2416
|
* neverMatchedRows = candidatesMissed(兼容旧字段名) */
|
|
2393
|
-
const candidatesMissed = [], excludedRows = [];
|
|
2417
|
+
const candidatesMissed = [], branchMissed = [], excludedRows = [];
|
|
2394
2418
|
let ruleExcludedCount = 0, ruleExcludedAmount = 0;
|
|
2395
2419
|
let globalExcludedCount = 0, globalExcludedAmount = 0; // 【P1.2.35】
|
|
2396
2420
|
for (let i = 0; i < rowsAll.length; i++) {
|
|
@@ -2421,8 +2445,14 @@ window.WWT_ENGINE = (function () {
|
|
|
2421
2445
|
// 候选行 = 满足规则的全部 = 条件。重新判定一次而非靠 usedRows 倒推(兜底)
|
|
2422
2446
|
const cand = isCandidate(row);
|
|
2423
2447
|
if (cand) {
|
|
2424
|
-
|
|
2425
|
-
if (
|
|
2448
|
+
// 【P1.2.69】命中顶层条件但无有效分录行 → 单独归类为"分支未覆盖",而非普通遗漏
|
|
2449
|
+
if (noLinesIdxs.has(i)) {
|
|
2450
|
+
branchMissed.push(rec);
|
|
2451
|
+
if (branchMissed.length >= 200) break;
|
|
2452
|
+
} else {
|
|
2453
|
+
candidatesMissed.push(rec);
|
|
2454
|
+
if (candidatesMissed.length >= 200) break;
|
|
2455
|
+
}
|
|
2426
2456
|
} else {
|
|
2427
2457
|
excludedRows.push(rec);
|
|
2428
2458
|
if (excludedRows.length >= 200) break;
|
|
@@ -2431,6 +2461,8 @@ window.WWT_ENGINE = (function () {
|
|
|
2431
2461
|
// 漏算金额 = 应处理子集里漏命中的金额(非候选行的金额不算"遗漏",避免误报警报)
|
|
2432
2462
|
let unmatchedAmt = 0;
|
|
2433
2463
|
for (const r of candidatesMissed) unmatchedAmt += num(r.金额);
|
|
2464
|
+
let branchMissedAmt = 0;
|
|
2465
|
+
for (const r of branchMissed) branchMissedAmt += num(r.金额);
|
|
2434
2466
|
|
|
2435
2467
|
const audit = {
|
|
2436
2468
|
by_rule: [{
|
|
@@ -2447,6 +2479,8 @@ window.WWT_ENGINE = (function () {
|
|
|
2447
2479
|
matched_amount: round2(matchedAmount),
|
|
2448
2480
|
failed_amount: round2(failedAmount),
|
|
2449
2481
|
missed_amount: round2(unmatchedAmt),
|
|
2482
|
+
branch_missed: branchMissed.length,
|
|
2483
|
+
branch_missed_amount: round2(branchMissedAmt),
|
|
2450
2484
|
}],
|
|
2451
2485
|
by_source: [{
|
|
2452
2486
|
source: curSrc,
|
|
@@ -2466,6 +2500,11 @@ window.WWT_ENGINE = (function () {
|
|
|
2466
2500
|
// 兼容旧字段(仍叫 never_matched,但其内容仅含真正应处理子集漏命中的行)
|
|
2467
2501
|
never_matched: candidatesMissed.length,
|
|
2468
2502
|
unmatched_amount: round2(unmatchedAmt),
|
|
2503
|
+
// 【P1.2.69】命中条件但无有效分录行(分支未覆盖)
|
|
2504
|
+
branch_missed: branchMissed.length,
|
|
2505
|
+
branch_missed_amount: round2(branchMissedAmt),
|
|
2506
|
+
branch_missed_clipped: branchMissed.length >= 200,
|
|
2507
|
+
branch_missed_rows: branchMissed,
|
|
2469
2508
|
missing_code_count: missingCodeCount,
|
|
2470
2509
|
missing_code_amount: round2(failedAmount),
|
|
2471
2510
|
amount_col: amountCol,
|
|
@@ -2670,7 +2709,7 @@ const S = window.__STATE__ = {
|
|
|
2670
2709
|
};
|
|
2671
2710
|
|
|
2672
2711
|
/* ---------------- 版本 & 框架自动更新(只更新程序本身,本地数据/规则不动) ---------------- */
|
|
2673
|
-
const WWT_VER=(function(){const raw='P1.2.
|
|
2712
|
+
const WWT_VER=(function(){const raw='P1.2.70';return raw.indexOf('__WVER__')>=0?'P1.2.10':raw;})();
|
|
2674
2713
|
const UPD_URL_KEY='wwt_fe_updurl';
|
|
2675
2714
|
// 默认更新源:Gitee 上本项目的 version.json(API 接口,浏览器可直接跨域读)
|
|
2676
2715
|
const DEFAULT_UPD_URL='https://gitee.com/api/v5/repos/wwtmrhu/certificate-generation/contents/dist/version.json';
|
|
@@ -4657,10 +4696,11 @@ function previewRule(ruleId){
|
|
|
4657
4696
|
const r0Matched = r0.actually_matched || 0;
|
|
4658
4697
|
const r0Cand = r0.candidate_in_source || 0;
|
|
4659
4698
|
const candMissed = bs.candidate_missed || 0;
|
|
4699
|
+
const branchMissed = bs.branch_missed || 0;
|
|
4660
4700
|
const excluded = bs.excluded || 0;
|
|
4661
4701
|
const coverage = r0Cand ? Math.round(r0Matched / r0Cand * 1000) / 10 : 0;
|
|
4662
|
-
// ok:无遗漏 + 编码完整 + 真命中数 > 0
|
|
4663
|
-
const ok = r0Matched > 0 && candMissed === 0 && (r0.missing_code_count || 0) === 0;
|
|
4702
|
+
// ok:无遗漏 + 无分支未覆盖 + 编码完整 + 真命中数 > 0
|
|
4703
|
+
const ok = r0Matched > 0 && candMissed === 0 && branchMissed === 0 && (r0.missing_code_count || 0) === 0;
|
|
4664
4704
|
// warn:完全没命中(条件过严 / 数据缺映射)
|
|
4665
4705
|
const bannerCls = ok ? 'ok' : (r0Matched === 0 ? 'warn' : 'err');
|
|
4666
4706
|
|
|
@@ -4674,16 +4714,18 @@ function previewRule(ruleId){
|
|
|
4674
4714
|
((r.genMode==='匹配汇总' || (r.genMode==='全部汇总' && r.genGroupBy && r.genGroupBy!=='单位名称'))?'(按 '+esc(r.genGroupBy||'单位名称')+')':'')+' · '+linesTxt+'</span>'+
|
|
4675
4715
|
'<button class="mini" onclick="UI.closeModal()">✕ 关闭</button></div><div class="modalbd">';
|
|
4676
4716
|
|
|
4677
|
-
// 顶部 banner:先说"覆盖率 N% + 命中数 / 应处理子集",再分别说"应处理子集漏命中"
|
|
4717
|
+
// 顶部 banner:先说"覆盖率 N% + 命中数 / 应处理子集",再分别说"应处理子集漏命中" / "分支未覆盖" / "源表被规则排除"
|
|
4678
4718
|
h+='<div class="banner '+bannerCls+'">规则源表 <code>['+esc(r.source)+']</code> '+filterTxt+
|
|
4679
4719
|
' 源表共 <b>'+(r0.source_total||0)+'</b> 行 → 应处理的子集 <b>'+r0Cand+'</b> 行 → '+
|
|
4680
4720
|
'命中 <b>'+r0Matched+'</b> 行(应处理子集覆盖率 <b>'+coverage+'%</b>)'+
|
|
4681
4721
|
(candMissed?' <abbr title="满足本规则的全部 = 条件、应当命中却未生成凭证"><b style="color:#a40e26">应处理子集里漏了 '+candMissed+' 行</b></abbr>':'')+
|
|
4722
|
+
(branchMissed?' <abbr title="命中本规则顶层条件,但所有分支都不匹配且没有默认分录行,因此未生成凭证"><b style="color:#a40e26">分支未覆盖 '+branchMissed+' 行</b></abbr>':'')+
|
|
4682
4723
|
(r0.missing_code_count?' <b style="color:#a40e26">编码缺失 '+r0.missing_code_count+' 条</b>':'')+
|
|
4683
4724
|
(excluded?' <abbr title="源表里不满足本规则的全部 = 条件(付款方式≠对账S 等),按规则设计本就不该命中"><span style="color:#57606a">另有 '+excluded+' 行不满足条件</span></abbr>':'')+
|
|
4684
4725
|
'<div style="margin-top:5px;font-size:12px;color:#57606a">命中金额 '+fmt(r0.matched_amount||0)+' 元 · '+
|
|
4685
4726
|
'失败金额 '+fmt(r0.failed_amount||0)+' 元 · '+
|
|
4686
4727
|
(candMissed?'<b style="color:#a40e26">应处理子集漏算 '+fmt(r0.missed_amount||0)+' 元</b>':'漏算金额 '+fmt(r0.missed_amount||0)+' 元')+
|
|
4728
|
+
(branchMissed?' · <b style="color:#a40e26">分支未覆盖金额 '+fmt(r0.branch_missed_amount||0)+' 元</b>':'')+
|
|
4687
4729
|
(bs.amount_col?'(按 '+esc(bs.amount_col)+' 列汇总)':'')+'</div></div>';
|
|
4688
4730
|
|
|
4689
4731
|
// 段 1:应处理子集漏命中 = 真遗漏(必显示,便于排查)
|
|
@@ -4697,7 +4739,21 @@ function previewRule(ruleId){
|
|
|
4697
4739
|
'」在客户表里没记录;② 业务数值字段(如 实收金额)为空/为 0;③ 维度映射缺失导致 makeEntry 跳过。展开逐行查:</div>'+
|
|
4698
4740
|
unmatchedTableHtml(candRows, r.source)+
|
|
4699
4741
|
'</details>';
|
|
4700
|
-
}
|
|
4742
|
+
}
|
|
4743
|
+
|
|
4744
|
+
// 段 1.5:命中顶层条件但无有效分录行 = 分支未覆盖(或默认 lines 为空)
|
|
4745
|
+
const branchRows = bs.branch_missed_rows || [];
|
|
4746
|
+
if(branchRows.length){
|
|
4747
|
+
const cap = bs.branch_missed_clipped ? '(已截断,最多显示 200 行)' : '';
|
|
4748
|
+
h+='<details style="margin-top:8px" open><summary style="cursor:pointer;color:#a40e26;font-weight:600">▼ 命中条件但无分支/分录匹配 <b>'+
|
|
4749
|
+
branchRows.length+'</b> 行(未生成凭证) '+cap+'</summary>'+
|
|
4750
|
+
'<div style="margin-top:6px;color:#57606a;font-size:12px">这些行满足本规则的顶层条件,但所有分支条件都不命中,且规则没有设置默认分录行,因此没有生成凭证。' +
|
|
4751
|
+
'请检查分支条件是否遗漏了「分类码」= E类其它 / 空白 等取值,或给规则添加默认分录行。</div>'+
|
|
4752
|
+
unmatchedTableHtml(branchRows, r.source)+
|
|
4753
|
+
'</details>';
|
|
4754
|
+
}
|
|
4755
|
+
|
|
4756
|
+
if(!candRows.length && !branchRows.length && r0Matched > 0){
|
|
4701
4757
|
h+='<div class="banner ok" style="margin-top:8px">✅ 应处理子集全部命中,无遗漏</div>';
|
|
4702
4758
|
}
|
|
4703
4759
|
|
|
@@ -4734,26 +4790,62 @@ function previewRule(ruleId){
|
|
|
4734
4790
|
h+='<div style="color:#8b949e;padding:8px">本规则没生成任何凭证('+esc(r0.candidate_in_source?'无候选行':'源表是空的')+')。</div>';
|
|
4735
4791
|
}else{
|
|
4736
4792
|
// 【P1.2.48】凭证预览表格改为金蝶式「核算维度」单列
|
|
4793
|
+
// 【P1.2.70】增加「借/贷合计数」:多证时每证小计 + 整表合计 + 借贷平衡检验
|
|
4737
4794
|
let previewMissingDims=[];
|
|
4795
|
+
// 【P1.2.70】新增借/贷合计数(见下方整表合计 tfoot + 信息行)
|
|
4796
|
+
const _r2=x=>Math.round(x*100)/100;
|
|
4797
|
+
let totDeb=0, totCre=0, prevVno=null, subDeb=0, subCre=0;
|
|
4798
|
+
const showSub=(pvStats.vouchers||0)>1;
|
|
4799
|
+
const tbodyRows=[];
|
|
4800
|
+
for(let i=0;i<pvRows.length;i++){
|
|
4801
|
+
const e=pvRows[i];
|
|
4802
|
+
const dim=formatDimensions(e);
|
|
4803
|
+
if(dim.missingDims.length) previewMissingDims=previewMissingDims.concat(dim.missingDims);
|
|
4804
|
+
const hasMissing=e['_缺失编码'] || dim.missingDims.length>0;
|
|
4805
|
+
const d=E.num(e['借方金额']), c=E.num(e['贷方金额']);
|
|
4806
|
+
totDeb+=d; totCre+=c;
|
|
4807
|
+
if(showSub && prevVno!==null && e['凭证号']!==prevVno){
|
|
4808
|
+
const sd=subDeb, sc=subCre, sv=prevVno, sdiff=_r2(sd-sc);
|
|
4809
|
+
tbodyRows.push('<tr style="background:#f5f7fa;font-weight:600">'+
|
|
4810
|
+
'<td colspan="5" style="color:#57606a">└ 凭证 '+esc(sv)+' 小计</td>'+
|
|
4811
|
+
'<td class="num">'+fmt(sd)+'</td><td class="num">'+fmt(sc)+'</td>'+
|
|
4812
|
+
'<td'+(Math.abs(sdiff)<0.005?'':' style="color:#a40e26;font-weight:700"')+'>'+
|
|
4813
|
+
(Math.abs(sdiff)<0.005?'✅ 平衡':'⚠ 差额 '+fmt(sdiff))+'</td></tr>');
|
|
4814
|
+
subDeb=0; subCre=0;
|
|
4815
|
+
}
|
|
4816
|
+
prevVno=e['凭证号']; subDeb+=d; subCre+=c;
|
|
4817
|
+
tbodyRows.push('<tr'+(hasMissing?' class="bad"':'')+'>'+
|
|
4818
|
+
'<td><b>'+esc(e['凭证号'])+'</b></td><td>'+esc(e['分录序号'])+'</td>'+
|
|
4819
|
+
'<td>'+esc(e['业务日期']||'')+'</td><td>'+esc((e['摘要']||'').slice(0,40))+'</td>'+
|
|
4820
|
+
'<td><b>'+esc(e['科目编码'])+'</b> '+esc(e['科目名称']||'')+'</td>'+
|
|
4821
|
+
'<td class="num">'+(e['借方金额']?fmt(e['借方金额']):'')+'</td>'+
|
|
4822
|
+
'<td class="num">'+(e['贷方金额']?fmt(e['贷方金额']):'')+'</td>'+
|
|
4823
|
+
'<td>'+dim.html+'</td></tr>');
|
|
4824
|
+
}
|
|
4825
|
+
if(showSub && prevVno!==null){
|
|
4826
|
+
const sdiff=_r2(subDeb-subCre);
|
|
4827
|
+
tbodyRows.push('<tr style="background:#f5f7fa;font-weight:600">'+
|
|
4828
|
+
'<td colspan="5" style="color:#57606a">└ 凭证 '+esc(prevVno)+' 小计</td>'+
|
|
4829
|
+
'<td class="num">'+fmt(subDeb)+'</td><td class="num">'+fmt(subCre)+'</td>'+
|
|
4830
|
+
'<td'+(Math.abs(sdiff)<0.005?'':' style="color:#a40e26;font-weight:700"')+'>'+
|
|
4831
|
+
(Math.abs(sdiff)<0.005?'✅ 平衡':'⚠ 差额 '+fmt(sdiff))+'</td></tr>');
|
|
4832
|
+
}
|
|
4833
|
+
const gDiff=_r2(totDeb-totCre);
|
|
4738
4834
|
h+='<div class="tablewrap" style="max-height:340px"><table><thead><tr>'+
|
|
4739
4835
|
'<th>凭证号</th><th>分录序号</th><th>业务日期</th><th>摘要</th><th>科目</th><th>借方</th><th>贷方</th>'+
|
|
4740
|
-
'<th>核算维度</th></tr></thead><tbody>'+
|
|
4741
|
-
|
|
4742
|
-
|
|
4743
|
-
|
|
4744
|
-
|
|
4745
|
-
|
|
4746
|
-
|
|
4747
|
-
'<td>'+esc(e['业务日期']||'')+'</td><td>'+esc((e['摘要']||'').slice(0,40))+'</td>'+
|
|
4748
|
-
'<td><b>'+esc(e['科目编码'])+'</b> '+esc(e['科目名称']||'')+'</td>'+
|
|
4749
|
-
'<td class="num">'+(e['借方金额']?fmt(e['借方金额']):'')+'</td>'+
|
|
4750
|
-
'<td class="num">'+(e['贷方金额']?fmt(e['贷方金额']):'')+'</td>'+
|
|
4751
|
-
'<td>'+dim.html+'</td></tr>';
|
|
4752
|
-
}).join('')+
|
|
4753
|
-
'</tbody></table></div>';
|
|
4836
|
+
'<th>核算维度</th></tr></thead><tbody>'+tbodyRows.join('')+'</tbody>'+
|
|
4837
|
+
'<tfoot><tr style="background:#eef2f7;font-weight:700;border-top:2px solid #c9d2dc">'+
|
|
4838
|
+
'<td colspan="5">整表合计('+pvRows.length+' 条分录 / '+pvStats.vouchers+' 张凭证)</td>'+
|
|
4839
|
+
'<td class="num">'+fmt(totDeb)+'</td><td class="num">'+fmt(totCre)+'</td>'+
|
|
4840
|
+
'<td'+(Math.abs(gDiff)<0.005?' style="color:#0a7d28"':' style="color:#a40e26"')+'>'+
|
|
4841
|
+
(Math.abs(gDiff)<0.005?'✅ 借贷平衡':'⚠ 差额 '+fmt(gDiff))+'</td></tr></tfoot>'+
|
|
4842
|
+
'</table></div>';
|
|
4754
4843
|
const previewMissingSet=previewMissingDims.filter((v,i,a)=>a.indexOf(v)===i);
|
|
4755
4844
|
h+='<div style="margin-top:5px;color:#57606a;font-size:12px">共 <b>'+pvStats.vouchers+'</b> 张凭证,<b>'+
|
|
4756
4845
|
pvStats.entries+'</b> 条分录'+
|
|
4846
|
+
' · <b>借方合计 <span style="color:#0a7d28">'+fmt(totDeb)+'</span></b>'+
|
|
4847
|
+
' · <b>贷方合计 <span style="color:#0a7d28">'+fmt(totCre)+'</span></b>'+
|
|
4848
|
+
(Math.abs(gDiff)<0.005?' · <span style="color:#0a7d28">✅ 借贷平衡</span>':' · <b style="color:#a40e26">⚠ 差额 '+fmt(gDiff)+'</b>')+
|
|
4757
4849
|
(previewMissingSet.length?' · <b style="color:#a40e26">'+previewMissingSet.length+' 个维度缺编码('+
|
|
4758
4850
|
previewMissingSet.join('、')+')</b>':' · 无编码缺失')+
|
|
4759
4851
|
')。预览不修改任何数据,关闭即丢。</div>';
|
package/dist/version.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"ver": "P1.2.
|
|
3
|
-
"npm": "1.2.
|
|
4
|
-
"url": "https://cdn.jsdelivr.net/npm/wwt-certificate-tool@1.2.
|
|
5
|
-
"url_unpkg": "https://unpkg.com/wwt-certificate-tool@1.2.
|
|
6
|
-
"url_gh": "https://api.github.com/repos/huweipei745839/certificate-generation/contents/dist/WWT%E5%87%AD%E8%AF%81%E5%B7%A5%E5%85%B7_P1.2.
|
|
7
|
-
"note": "
|
|
2
|
+
"ver": "P1.2.70",
|
|
3
|
+
"npm": "1.2.70",
|
|
4
|
+
"url": "https://cdn.jsdelivr.net/npm/wwt-certificate-tool@1.2.70/dist/app.html",
|
|
5
|
+
"url_unpkg": "https://unpkg.com/wwt-certificate-tool@1.2.70/dist/app.html",
|
|
6
|
+
"url_gh": "https://api.github.com/repos/huweipei745839/certificate-generation/contents/dist/WWT%E5%87%AD%E8%AF%81%E5%B7%A5%E5%85%B7_P1.2.70.html",
|
|
7
|
+
"note": "㉓ 【P1.2.70】凭证预览(🧪 测试预览弹窗)新增「借/贷合计数」:多证时每证小计(借方小计/贷方小计 + 平衡检验),整表合计 footer 显示借方合计/贷方合计 + 借贷平衡标识;信息行同步显示借方合计、贷方合计与差额,无需滚动到底即可核对借贷是否平衡。"
|
|
8
8
|
}
|