wwt-certificate-tool 1.2.53 → 1.2.55
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 +26 -11
- 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.55</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.55</span></h1>
|
|
324
324
|
<div class="sub">纯前端离线版 · 双击即用 · 数据只存在本机,不上传任何服务器</div>
|
|
325
325
|
</div>
|
|
326
326
|
</div>
|
|
@@ -332,6 +332,7 @@ input[data-f="field"][list^="dlGe_"]::placeholder{color:#a8861f;font-style:itali
|
|
|
332
332
|
<button class="btn ghost" onclick="UI.exportCfg()">📤 导出配置</button>
|
|
333
333
|
<button class="btn ghost" onclick="UI.importCfg()">📥 导入配置</button>
|
|
334
334
|
<button class="btn danger ghost" onclick="UI.clearAll()">⚠ 清空全部</button>
|
|
335
|
+
<button class="btn ghost" onclick="UI.clearBiz()" title="只清空本月业务数据表,保留基础数据、规则、映射和配置">🧹 清空业务数据</button>
|
|
335
336
|
<button class="btn ghost" onclick="UI.checkUpdate()">🔄 检查更新</button>
|
|
336
337
|
<button class="btn ghost" onclick="UI.setUpdateUrl()">⚙ 更新设置</button>
|
|
337
338
|
</div>
|
|
@@ -1611,6 +1612,14 @@ window.WWT_ENGINE = (function () {
|
|
|
1611
1612
|
return raw.split(/[+,,]/).map(s => s.trim()).filter(Boolean);
|
|
1612
1613
|
}
|
|
1613
1614
|
|
|
1615
|
+
// 【P1.2.54】分录级拆分字段:每条分录可单独指定 lineSplitBy;空表示跟随规则级 lineSplitBy
|
|
1616
|
+
function splitFieldsOfLine(line, rule) {
|
|
1617
|
+
const raw = clean(line && line.lineSplitBy);
|
|
1618
|
+
if (raw === "-") return []; // 显式写 "-" 表示本行强制不拆分(覆盖规则级)
|
|
1619
|
+
if (!raw) return splitFieldsOf(rule);
|
|
1620
|
+
return raw.split(/[+,,]/).map(s => s.trim()).filter(Boolean);
|
|
1621
|
+
}
|
|
1622
|
+
|
|
1614
1623
|
/* ---------------- 分支选取 ---------------- */
|
|
1615
1624
|
function resolveEffectiveLines(rule, row, curSrc, idx) {
|
|
1616
1625
|
const branches = rule.branches || [];
|
|
@@ -1767,14 +1776,14 @@ window.WWT_ENGINE = (function () {
|
|
|
1767
1776
|
|
|
1768
1777
|
// Step B:sub_bucket = group_key值 × 分支lines
|
|
1769
1778
|
// 【P1.2.40】全部汇总且按非单位名称字段拆证时,取消子桶按单位名称细分,实现真正的按该字段汇总
|
|
1770
|
-
// 【P1.2.
|
|
1779
|
+
// 【P1.2.54】sub_bucket 不再按拆分字段细分;拆分粒度下沉到每条分录行的 groups 阶段,
|
|
1780
|
+
// 这样同一张凭证内可以「借方按单号拆、贷方汇总」等混合拆分需求。
|
|
1771
1781
|
const groupKeyField = (genMode === "一对一" || splitFs.length > 0) ? null :
|
|
1772
1782
|
(genMode === "全部汇总" && gb && gb !== "单位名称") ? null : "单位名称";
|
|
1773
1783
|
const subMap = new Map();
|
|
1774
1784
|
for (const it of bucket) {
|
|
1775
1785
|
const gv = groupKeyField ? (clean(it.row[groupKeyField]) || "(空)") : "";
|
|
1776
|
-
const
|
|
1777
|
-
const k = JSON.stringify([gv, splitT, linesKey(it._lines)]);
|
|
1786
|
+
const k = JSON.stringify([gv, linesKey(it._lines)]);
|
|
1778
1787
|
if (!subMap.has(k)) subMap.set(k, { gv: gv, lines: it._lines, items: [], acct: {} });
|
|
1779
1788
|
subMap.get(k).items.push(it);
|
|
1780
1789
|
}
|
|
@@ -1803,10 +1812,12 @@ window.WWT_ENGINE = (function () {
|
|
|
1803
1812
|
const line = sub.lines[li];
|
|
1804
1813
|
if (isAutoDiff(line)) continue;
|
|
1805
1814
|
const groups = new Map();
|
|
1815
|
+
// 【P1.2.54】本行拆分字段优先于规则级;空表示跟随规则级(兼容旧规则)
|
|
1816
|
+
const lineSplitFs = splitFieldsOfLine(line, rule);
|
|
1806
1817
|
for (const it of sub.items) {
|
|
1807
1818
|
const dv = calcDimValues(line, it.row, curSrc, idx, sub);
|
|
1808
1819
|
const subj = leafSubject(line.subject, it.row, dv, curSrc, idx);
|
|
1809
|
-
const splitT =
|
|
1820
|
+
const splitT = lineSplitFs.map(f => clean(it.row[f]));
|
|
1810
1821
|
const dimKey = Object.keys(dv).sort().map(d => [d, dv[d].name]);
|
|
1811
1822
|
const gkey = JSON.stringify([subj, dimKey, splitT]);
|
|
1812
1823
|
if (!groups.has(gkey)) {
|
|
@@ -1814,7 +1825,7 @@ window.WWT_ENGINE = (function () {
|
|
|
1814
1825
|
}
|
|
1815
1826
|
const g = groups.get(gkey);
|
|
1816
1827
|
g.sgn += sumAmtExpr(it.row, line.amountField);
|
|
1817
|
-
|
|
1828
|
+
lineSplitFs.forEach((f, fi) => {
|
|
1818
1829
|
const v = splitT[fi];
|
|
1819
1830
|
if (v) { if (!g.vals[f]) g.vals[f] = []; if (g.vals[f].indexOf(v) < 0) g.vals[f].push(v); }
|
|
1820
1831
|
});
|
|
@@ -2157,16 +2168,18 @@ window.WWT_ENGINE = (function () {
|
|
|
2157
2168
|
const line = sub.lines[li];
|
|
2158
2169
|
if (isAutoDiff(line)) continue;
|
|
2159
2170
|
const groups = new Map();
|
|
2171
|
+
// 【P1.2.54】本行拆分字段优先于规则级;空表示跟随规则级(兼容旧规则)
|
|
2172
|
+
const lineSplitFs = splitFieldsOfLine(line, r);
|
|
2160
2173
|
for (const it of sub.items) {
|
|
2161
2174
|
const dv = calcDimValues(line, it.row, curSrc, idx, sub);
|
|
2162
2175
|
const subj = leafSubject(line.subject, it.row, dv, curSrc, idx);
|
|
2163
|
-
const splitT =
|
|
2176
|
+
const splitT = lineSplitFs.map(f => clean(it.row[f]));
|
|
2164
2177
|
const dimKey = Object.keys(dv).sort().map(d => [d, dv[d].name]);
|
|
2165
2178
|
const gkey = JSON.stringify([subj, dimKey, splitT]);
|
|
2166
2179
|
if (!groups.has(gkey)) groups.set(gkey, { subj: subj, dv: dv, sgn: 0, vals: {}, first: it });
|
|
2167
2180
|
const g = groups.get(gkey);
|
|
2168
2181
|
g.sgn += sumAmtExpr(it.row, line.amountField);
|
|
2169
|
-
|
|
2182
|
+
lineSplitFs.forEach((f, fi) => {
|
|
2170
2183
|
const v = splitT[fi];
|
|
2171
2184
|
if (v) { if (!g.vals[f]) g.vals[f] = []; if (g.vals[f].indexOf(v) < 0) g.vals[f].push(v); }
|
|
2172
2185
|
});
|
|
@@ -2528,7 +2541,7 @@ const S = window.__STATE__ = {
|
|
|
2528
2541
|
};
|
|
2529
2542
|
|
|
2530
2543
|
/* ---------------- 版本 & 框架自动更新(只更新程序本身,本地数据/规则不动) ---------------- */
|
|
2531
|
-
const WWT_VER=(function(){const raw='P1.2.
|
|
2544
|
+
const WWT_VER=(function(){const raw='P1.2.55';return raw.indexOf('__WVER__')>=0?'P1.2.10':raw;})();
|
|
2532
2545
|
const UPD_URL_KEY='wwt_fe_updurl';
|
|
2533
2546
|
// 默认更新源:Gitee 上本项目的 version.json(API 接口,浏览器可直接跨域读)
|
|
2534
2547
|
const DEFAULT_UPD_URL='https://gitee.com/api/v5/repos/wwtmrhu/certificate-generation/contents/dist/version.json';
|
|
@@ -4139,6 +4152,7 @@ function lineHTML(bi,li,l){
|
|
|
4139
4152
|
'<div class="row"><select class="w60" data-lf="side">'+sideOpts+'</select>'+
|
|
4140
4153
|
'<span class="w60">科目</span><input class="w140" data-lf="subject" value="'+esc(l.subject||'')+'" placeholder="如 1122 / 6002" list="dlSubjects" title="可下拉选会计科目表里的编码;也可手动输入">'+
|
|
4141
4154
|
'<span class="w60">金额</span><input class="w180" data-lf="amountField" value="'+esc(l.amountField||'')+'" placeholder="实收金额+折扣费 / -折扣费 / 金额*0.13 / 金额/数量" list="dlAmountFields" title="支持四则运算与括号:字段名/数字常量;可下拉选「__AUTO_DIFF__」自动补差额;例:实收金额+折扣费、-折扣费、金额*0.13">'+
|
|
4155
|
+
'<span class="w70" style="margin-left:8px">本行拆分</span><input class="w120" data-lf="lineSplitBy" value="'+esc(l.lineSplitBy||'')+'" placeholder="空=跟随规则" title="空=使用规则级拆分字段;填字段名=本行单独按该字段拆分;填 - = 本行强制不拆分">'+
|
|
4142
4156
|
'<button class="mini del" onclick="UI.delRow(this,\'linerow\')">删除分录</button></div>'+
|
|
4143
4157
|
'<div class="row"><span class="w60">摘要</span><input class="grow" data-lf="summary" value="'+esc(l.summary||'')+'" placeholder="{单位名称}{收入板块}对帐S{原单号}"></div>'+
|
|
4144
4158
|
'<div style="font-size:11.5px;color:#57606a;margin:3px 0">辅助核算维度:</div>'+
|
|
@@ -4195,6 +4209,7 @@ function collectLines(rows){
|
|
|
4195
4209
|
}).filter(a=>a.dim);
|
|
4196
4210
|
return {side:g('side').value,subject:g('subject').value.trim(),
|
|
4197
4211
|
amountField:g('amountField').value.trim(),summary:g('summary').value.trim(),
|
|
4212
|
+
lineSplitBy:g('lineSplitBy')?g('lineSplitBy').value.trim():'',
|
|
4198
4213
|
auxiliaries:auxs};
|
|
4199
4214
|
});
|
|
4200
4215
|
}
|
|
@@ -6110,7 +6125,7 @@ window.UI={
|
|
|
6110
6125
|
restoreUpgradeBackup:restoreUpgradeBackup, dismissUpgradeBackup:dismissUpgradeBackup,
|
|
6111
6126
|
showUpgradeHelp:showUpgradeHelp, checkPendingUpgradeBackup:checkPendingUpgradeBackup,
|
|
6112
6127
|
renderPersistHint:renderPersistHint,
|
|
6113
|
-
clearAll:clearAll, switchTab:switchTab,
|
|
6128
|
+
clearAll:clearAll, clearBiz:clearBiz, switchTab:switchTab,
|
|
6114
6129
|
};
|
|
6115
6130
|
|
|
6116
6131
|
if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',init);
|
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.55",
|
|
3
|
+
"npm": "1.2.55",
|
|
4
|
+
"url": "https://cdn.jsdelivr.net/npm/wwt-certificate-tool@1.2.55/dist/app.html",
|
|
5
|
+
"url_unpkg": "https://unpkg.com/wwt-certificate-tool@1.2.55/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.55.html",
|
|
7
|
+
"note": "① 内置默认基础表/规则/映射:新安装或分享打开即自带当前这套标准配置。② 生成凭证后实际生成了凭证的规则自动变绿并显示「已生成」徽章,状态持久化。③ 新增「清空已生成」按钮。④ 凭证起始号放到「④ 生成凭证」页生成栏。⑤ 对碰检测跳过未结算单据,缺失清单增加「单号」与「付款方式/结算方式」列。⑥ 凭证审核表「核算维度」列移到「科目名称」后。⑦ 分录级拆分字段:每条分录可单独设置拆分字段,实现一张凭证内借方按单号拆、贷方汇总等混合拆分。⑧ 【P1.2.55】顶部工具栏增加「清空业务数据」按钮,只清本月业务数据表,保留基础数据、规则、映射和配置。"
|
|
8
8
|
}
|