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