wwt-certificate-tool 1.2.69 → 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 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.69</title>
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.69</span></h1>
331
+ <h1>金蝶凭证工具 <span class="ver">P1.2.70</span></h1>
332
332
  <div class="sub">纯前端离线版 · 双击即用 · 数据只存在本机,不上传任何服务器</div>
333
333
  </div>
334
334
  </div>
@@ -2709,7 +2709,7 @@ const S = window.__STATE__ = {
2709
2709
  };
2710
2710
 
2711
2711
  /* ---------------- 版本 & 框架自动更新(只更新程序本身,本地数据/规则不动) ---------------- */
2712
- const WWT_VER=(function(){const raw='P1.2.69';return raw.indexOf('__WVER__')>=0?'P1.2.10':raw;})();
2712
+ const WWT_VER=(function(){const raw='P1.2.70';return raw.indexOf('__WVER__')>=0?'P1.2.10':raw;})();
2713
2713
  const UPD_URL_KEY='wwt_fe_updurl';
2714
2714
  // 默认更新源:Gitee 上本项目的 version.json(API 接口,浏览器可直接跨域读)
2715
2715
  const DEFAULT_UPD_URL='https://gitee.com/api/v5/repos/wwtmrhu/certificate-generation/contents/dist/version.json';
@@ -4790,26 +4790,62 @@ function previewRule(ruleId){
4790
4790
  h+='<div style="color:#8b949e;padding:8px">本规则没生成任何凭证('+esc(r0.candidate_in_source?'无候选行':'源表是空的')+')。</div>';
4791
4791
  }else{
4792
4792
  // 【P1.2.48】凭证预览表格改为金蝶式「核算维度」单列
4793
+ // 【P1.2.70】增加「借/贷合计数」:多证时每证小计 + 整表合计 + 借贷平衡检验
4793
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);
4794
4834
  h+='<div class="tablewrap" style="max-height:340px"><table><thead><tr>'+
4795
4835
  '<th>凭证号</th><th>分录序号</th><th>业务日期</th><th>摘要</th><th>科目</th><th>借方</th><th>贷方</th>'+
4796
- '<th>核算维度</th></tr></thead><tbody>'+
4797
- pvRows.map(e=>{
4798
- const dim=formatDimensions(e);
4799
- if(dim.missingDims.length) previewMissingDims=previewMissingDims.concat(dim.missingDims);
4800
- const hasMissing=e['_缺失编码'] || dim.missingDims.length>0;
4801
- return '<tr'+(hasMissing?' class="bad"':'')+'>'+
4802
- '<td><b>'+esc(e['凭证号'])+'</b></td><td>'+esc(e['分录序号'])+'</td>'+
4803
- '<td>'+esc(e['业务日期']||'')+'</td><td>'+esc((e['摘要']||'').slice(0,40))+'</td>'+
4804
- '<td><b>'+esc(e['科目编码'])+'</b> '+esc(e['科目名称']||'')+'</td>'+
4805
- '<td class="num">'+(e['借方金额']?fmt(e['借方金额']):'')+'</td>'+
4806
- '<td class="num">'+(e['贷方金额']?fmt(e['贷方金额']):'')+'</td>'+
4807
- '<td>'+dim.html+'</td></tr>';
4808
- }).join('')+
4809
- '</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>';
4810
4843
  const previewMissingSet=previewMissingDims.filter((v,i,a)=>a.indexOf(v)===i);
4811
4844
  h+='<div style="margin-top:5px;color:#57606a;font-size:12px">共 <b>'+pvStats.vouchers+'</b> 张凭证,<b>'+
4812
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>')+
4813
4849
  (previewMissingSet.length?' · <b style="color:#a40e26">'+previewMissingSet.length+' 个维度缺编码('+
4814
4850
  previewMissingSet.join('、')+')</b>':' · 无编码缺失')+
4815
4851
  ')。预览不修改任何数据,关闭即丢。</div>';
package/dist/version.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
- "ver": "P1.2.69",
3
- "npm": "1.2.69",
4
- "url": "https://cdn.jsdelivr.net/npm/wwt-certificate-tool@1.2.69/dist/app.html",
5
- "url_unpkg": "https://unpkg.com/wwt-certificate-tool@1.2.69/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.69.html",
7
- "note": "㉒ 【P1.2.69】修复规则命中顶层条件但分支未覆盖(且无默认分录行)的行被静默吞掉:这些行不再计入「已命中/已覆盖」,也不占用 usedRows;auditRule 新增 branch_missed 统计,规则预览弹窗显式提示「命中条件但无分支/分录匹配 X 行」及金额,避免用户误以为「应处理子集全部命中」。"
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wwt-certificate-tool",
3
- "version": "1.2.69",
3
+ "version": "1.2.70",
4
4
  "description": "WWT 金蝶凭证工具 · 纯前端版(离线单文件 HTML,双击即用)",
5
5
  "keywords": [
6
6
  "WWT",