wwt-certificate-tool 1.2.57 → 1.2.59
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 +32 -10
- 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.59</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}
|
|
@@ -320,7 +320,7 @@ input[data-f="field"][list^="dlGe_"]::placeholder{color:#a8861f;font-style:itali
|
|
|
320
320
|
<div class="brand">
|
|
321
321
|
<span class="logo">WWT</span>
|
|
322
322
|
<div>
|
|
323
|
-
<h1>金蝶凭证工具 <span class="ver">P1.2.
|
|
323
|
+
<h1>金蝶凭证工具 <span class="ver">P1.2.59</span></h1>
|
|
324
324
|
<div class="sub">纯前端离线版 · 双击即用 · 数据只存在本机,不上传任何服务器</div>
|
|
325
325
|
</div>
|
|
326
326
|
</div>
|
|
@@ -1031,8 +1031,8 @@ window.WWT_ENGINE = (function () {
|
|
|
1031
1031
|
"收费类型", "单类", "出库单类", "单据类型", "结算方式"];
|
|
1032
1032
|
function isTotalRow(row) {
|
|
1033
1033
|
if (!row || typeof row !== "object") return false;
|
|
1034
|
-
// 先扫常见标识列;再扫行内所有字段,避免“合计”写在备注/摘要/类型等列而漏掉
|
|
1035
1034
|
const fields = TOTAL_LABEL_FIELDS.concat(Object.keys(row).filter(k => TOTAL_LABEL_FIELDS.indexOf(k) < 0));
|
|
1035
|
+
// 法一:任意字段含 合计/小计/总计/total/sum(含写在摘要/备注/类型等非标识列的情况)
|
|
1036
1036
|
for (const f of fields) {
|
|
1037
1037
|
const v = clean(row[f]);
|
|
1038
1038
|
if (!v) continue;
|
|
@@ -1041,6 +1041,20 @@ window.WWT_ENGINE = (function () {
|
|
|
1041
1041
|
if (lv.indexOf(kw.toLowerCase()) >= 0) return true;
|
|
1042
1042
|
}
|
|
1043
1043
|
}
|
|
1044
|
+
// 法二(兜底):合计行通常“标识列全空、只留汇总金额”。
|
|
1045
|
+
// 关键标识列不含日期,避免把带日期的合计行漏判为正常行。
|
|
1046
|
+
const ID_FIELDS = ["单位名称", "供应商名称", "客户名称", "往来单位", "往来单位名称",
|
|
1047
|
+
"单号", "入库单号", "出库单号", "工单号", "合同号", "厂牌", "存货名称", "物料名称",
|
|
1048
|
+
"商品名称", "名称", "项目", "项目名称", "部门", "结算方式"];
|
|
1049
|
+
let hasId = false;
|
|
1050
|
+
for (const f of ID_FIELDS) { if (clean(row[f])) { hasId = true; break; } }
|
|
1051
|
+
if (!hasId) {
|
|
1052
|
+
// 没有任何标识内容,再看是否有非零金额(有金额=疑似合计/小计行;纯空行无所谓)
|
|
1053
|
+
for (const f of fields) {
|
|
1054
|
+
const n = Number(clean(row[f]));
|
|
1055
|
+
if (isFinite(n) && n !== 0) return true;
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1044
1058
|
return false;
|
|
1045
1059
|
}
|
|
1046
1060
|
function ciGetObj(t, key) {
|
|
@@ -1613,7 +1627,10 @@ window.WWT_ENGINE = (function () {
|
|
|
1613
1627
|
ctx["来源"] = curSrc;
|
|
1614
1628
|
ctx["单据类型"] = danlei; ctx["单类"] = danlei;
|
|
1615
1629
|
ctx["对方"] = uniqJoin(items, partyFields, "/", curSrc);
|
|
1616
|
-
|
|
1630
|
+
// P1.2.59:{单位名称}/{供应商名称} 必须各自取对应字段,不能等价于 {对方},
|
|
1631
|
+
// 否则全部汇总按单位名称分组后,同一单位下多个供应商会被 / 拼接进摘要。
|
|
1632
|
+
ctx["单位名称"] = uniqJoin(items, ["单位名称"], "/", curSrc) || ctx["对方"];
|
|
1633
|
+
ctx["供应商名称"] = uniqJoin(items, ["供应商名称"], "/", curSrc) || ctx["对方"];
|
|
1617
1634
|
ctx["厂牌"] = uniqJoin(items, ["厂牌"], "/", curSrc);
|
|
1618
1635
|
ctx["收入板块"] = uniqJoin(items, ["收入板块"], "/", curSrc);
|
|
1619
1636
|
ctx["原单号"] = truncateBiz(orig, ",");
|
|
@@ -1811,7 +1828,7 @@ window.WWT_ENGINE = (function () {
|
|
|
1811
1828
|
}
|
|
1812
1829
|
|
|
1813
1830
|
for (const sub of subMap.values()) {
|
|
1814
|
-
const
|
|
1831
|
+
const subCtx = buildSummaryCtx(sub.items, rule, curSrc);
|
|
1815
1832
|
// 业务日期取组内最早
|
|
1816
1833
|
const meta = C.SOURCE_META[curSrc] || {};
|
|
1817
1834
|
let bizDate = "";
|
|
@@ -1843,9 +1860,10 @@ window.WWT_ENGINE = (function () {
|
|
|
1843
1860
|
const dimKey = Object.keys(dv).sort().map(d => [d, dv[d].name]);
|
|
1844
1861
|
const gkey = JSON.stringify([subj, dimKey, splitT]);
|
|
1845
1862
|
if (!groups.has(gkey)) {
|
|
1846
|
-
groups.set(gkey, { subj: subj, dv: dv, sgn: 0, vals: {}, first: it });
|
|
1863
|
+
groups.set(gkey, { subj: subj, dv: dv, sgn: 0, vals: {}, first: it, items: [] });
|
|
1847
1864
|
}
|
|
1848
1865
|
const g = groups.get(gkey);
|
|
1866
|
+
g.items.push(it);
|
|
1849
1867
|
g.sgn += sumAmtExpr(it.row, line.amountField);
|
|
1850
1868
|
lineSplitFs.forEach((f, fi) => {
|
|
1851
1869
|
const v = splitT[fi];
|
|
@@ -1858,6 +1876,8 @@ window.WWT_ENGINE = (function () {
|
|
|
1858
1876
|
const amt = Math.abs(signed);
|
|
1859
1877
|
if (amt <= 0) continue; // 净额 ≤ 0 跳过
|
|
1860
1878
|
eidx++;
|
|
1879
|
+
// P1.2.59 摘要上下文按最终分录小组构建,避免全组供应商拼接
|
|
1880
|
+
const sumCtx = buildSummaryCtx(g.items, rule, curSrc);
|
|
1861
1881
|
const splitVals = {};
|
|
1862
1882
|
for (const f in g.vals) splitVals[f] = truncateBiz(g.vals[f].join(","), ",");
|
|
1863
1883
|
const metaNo = meta.no || "原单号";
|
|
@@ -1900,7 +1920,7 @@ window.WWT_ENGINE = (function () {
|
|
|
1900
1920
|
const metaNo = meta.no || "原单号";
|
|
1901
1921
|
entries.push(makeEntry({
|
|
1902
1922
|
vno: curVno, eidx: eidx, acctDate: acctDate, bizDate: useBizDate,
|
|
1903
|
-
summary: fillSummary(line.summary || rule.name,
|
|
1923
|
+
summary: fillSummary(line.summary || rule.name, subCtx, {}, rule),
|
|
1904
1924
|
subj: subj, subjName: idx.subjectName(subj),
|
|
1905
1925
|
debit: side === "借" ? amt : 0, credit: side === "贷" ? amt : 0,
|
|
1906
1926
|
settleBiz: payRaw, settleCode: settleCode, settleName: settleName,
|
|
@@ -2173,7 +2193,6 @@ window.WWT_ENGINE = (function () {
|
|
|
2173
2193
|
subMap.get(k).items.push(it);
|
|
2174
2194
|
}
|
|
2175
2195
|
for (const sub of subMap.values()) {
|
|
2176
|
-
const sumCtx = buildSummaryCtx(sub.items, r, curSrc);
|
|
2177
2196
|
const meta = C.SOURCE_META[curSrc] || {};
|
|
2178
2197
|
let bizDate = "";
|
|
2179
2198
|
if (meta.datecol) {
|
|
@@ -2200,8 +2219,9 @@ window.WWT_ENGINE = (function () {
|
|
|
2200
2219
|
const splitT = lineSplitFs.map(f => clean(it.row[f]));
|
|
2201
2220
|
const dimKey = Object.keys(dv).sort().map(d => [d, dv[d].name]);
|
|
2202
2221
|
const gkey = JSON.stringify([subj, dimKey, splitT]);
|
|
2203
|
-
if (!groups.has(gkey)) groups.set(gkey, { subj: subj, dv: dv, sgn: 0, vals: {}, first: it });
|
|
2222
|
+
if (!groups.has(gkey)) groups.set(gkey, { subj: subj, dv: dv, sgn: 0, vals: {}, first: it, items: [] });
|
|
2204
2223
|
const g = groups.get(gkey);
|
|
2224
|
+
g.items.push(it);
|
|
2205
2225
|
g.sgn += sumAmtExpr(it.row, line.amountField);
|
|
2206
2226
|
lineSplitFs.forEach((f, fi) => {
|
|
2207
2227
|
const v = splitT[fi];
|
|
@@ -2213,6 +2233,8 @@ window.WWT_ENGINE = (function () {
|
|
|
2213
2233
|
const amt = Math.abs(signed);
|
|
2214
2234
|
if (amt <= 0) continue;
|
|
2215
2235
|
eidx++;
|
|
2236
|
+
// P1.2.59 摘要上下文按最终分录小组构建,避免全组供应商拼接
|
|
2237
|
+
const sumCtx = buildSummaryCtx(g.items, r, curSrc);
|
|
2216
2238
|
const splitVals = {};
|
|
2217
2239
|
for (const f in g.vals) splitVals[f] = truncateBiz(g.vals[f].join(","), ",");
|
|
2218
2240
|
const metaNo = meta.no || "原单号";
|
|
@@ -2565,7 +2587,7 @@ const S = window.__STATE__ = {
|
|
|
2565
2587
|
};
|
|
2566
2588
|
|
|
2567
2589
|
/* ---------------- 版本 & 框架自动更新(只更新程序本身,本地数据/规则不动) ---------------- */
|
|
2568
|
-
const WWT_VER=(function(){const raw='P1.2.
|
|
2590
|
+
const WWT_VER=(function(){const raw='P1.2.59';return raw.indexOf('__WVER__')>=0?'P1.2.10':raw;})();
|
|
2569
2591
|
const UPD_URL_KEY='wwt_fe_updurl';
|
|
2570
2592
|
// 默认更新源:Gitee 上本项目的 version.json(API 接口,浏览器可直接跨域读)
|
|
2571
2593
|
const DEFAULT_UPD_URL='https://gitee.com/api/v5/repos/wwtmrhu/certificate-generation/contents/dist/version.json';
|
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": "① 内置默认基础表/规则/映射:新安装或分享打开即自带当前这套标准配置。② 生成凭证后实际生成了凭证的规则自动变绿并显示「已生成」徽章,状态持久化。③ 新增「清空已生成」按钮。④ 凭证起始号放到「④ 生成凭证」页生成栏。⑤ 对碰检测跳过未结算单据,缺失清单增加「单号」与「付款方式/结算方式」列。⑥ 凭证审核表「核算维度」列移到「科目名称」后。⑦ 分录级拆分字段:每条分录可单独设置拆分字段,实现一张凭证内借方按单号拆、贷方汇总等混合拆分。⑧ 【P1.2.55】顶部工具栏增加「清空业务数据」按钮,只清本月业务数据表,保留基础数据、规则、映射和配置。⑨ 【P1.2.56】生成/审核自动跳过 Excel 底部的「合计/小计/总计」行,避免汇总金额被重复累加(如 人进价 145万
|
|
2
|
+
"ver": "P1.2.59",
|
|
3
|
+
"npm": "1.2.59",
|
|
4
|
+
"url": "https://cdn.jsdelivr.net/npm/wwt-certificate-tool@1.2.59/dist/app.html",
|
|
5
|
+
"url_unpkg": "https://unpkg.com/wwt-certificate-tool@1.2.59/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.59.html",
|
|
7
|
+
"note": "① 内置默认基础表/规则/映射:新安装或分享打开即自带当前这套标准配置。② 生成凭证后实际生成了凭证的规则自动变绿并显示「已生成」徽章,状态持久化。③ 新增「清空已生成」按钮。④ 凭证起始号放到「④ 生成凭证」页生成栏。⑤ 对碰检测跳过未结算单据,缺失清单增加「单号」与「付款方式/结算方式」列。⑥ 凭证审核表「核算维度」列移到「科目名称」后。⑦ 分录级拆分字段:每条分录可单独设置拆分字段,实现一张凭证内借方按单号拆、贷方汇总等混合拆分。⑧ 【P1.2.55】顶部工具栏增加「清空业务数据」按钮,只清本月业务数据表,保留基础数据、规则、映射和配置。⑨ 【P1.2.56】生成/审核自动跳过 Excel 底部的「合计/小计/总计」行,避免汇总金额被重复累加(如 人进价 145万 翻倍的翻倍问题);合计行在编辑器内仍可见、只是不参与凭证生成。⑩ 【P1.2.57】修复合计行识别:扫描行内所有字段,避免「合计」写在摘要/备注/行类型等非标识列时仍被误当作数据行累加。⑪ 【P1.2.58】合计行兜底识别:若某行「单位名称/供应商名称/单号等标识列全空 + 有非零金额」(即合计行无合计字样),也判定为合计行跳过,彻底杜绝金额翻倍。⑫ 【P1.2.59】修复全部汇总模式下摘要把全组供应商拼接的问题:{供应商名称}/{单位名称} 各自读取对应字段,且摘要上下文按最终分录小组构建,同一凭证内多个供应商不再互相串到摘要里。"
|
|
8
8
|
}
|