feat: Implement mfr truncation fix and enhance invoice handling
Playwright Tests / test (push) Canceled after 0s

- Added a new SQL script to address the "String or binary data would be truncated" error in mfr sync by widening the Note fields in service objects and companies to NVARCHAR(MAX).
- Updated the table types and associated stored procedures to accommodate the changes, ensuring compatibility with existing data.
- Queued a re-sync for previously rejected rows due to truncation issues.
- Created application logins for fuchs_fds and fuchs_web with placeholder passwords for initial setup.
- Introduced functions for invoice backdating and invoice date retrieval to streamline invoice processing.
- Developed a password generation function with customizable parameters for length and character types.
- Added a random number generation function to support password creation.
This commit is contained in:
Stefan
2026-09-30 16:56:08 +02:00
parent 7357f60120
commit c741535aec
79 changed files with 2739 additions and 143 deletions
+19 -5
View File
@@ -394,6 +394,14 @@ $inv.d = {
l.rC('freeze');
let c = $$.dc('imagecollection pdfpreview'), vhr = Math.round(vh() * 0.88), total = response.total;
if (total > 10) { $$.dc('note warn', c).text($ict.tpe); }
/* Admin-only (fds_inv > 2, decided server-side): date the invoice to the last working day of
the previous month, offered only until an invoice has been created in the new month (ADR 0032). */
let bdChk = null;
if ((response.backdate || '') !== '') {
let bdRow = $('<label></label>').addClass('backdate').attr('title', $ict.bdTT).appendTo(c);
bdChk = $('<input type="checkbox" />').appendTo(bdRow);
$$.s(string($ict.bdLbl, [response.backdate.split('-').reverse().join('.')])).appendTo(bdRow);
}
$.each(response.img || [], (ii, img) => { $$.dc('pdfp', c).append($$.img(img).css('max-height', (vhr - rpx(6)).toString() + 'px')); });
for (let ic = (response.img || []).length + 1; ic <= total; ic++) { $$.dc('pdfp ph', c).append($$.dc('note', $ict.pna)); }
$ocms.dlg(c, {
@@ -403,7 +411,7 @@ $inv.d = {
$ocms.postXT({
url: $ocms.url('inv/dsave'), data: { token: t }, success: (sv) => {
$ocms.postXT({
url: $ocms.url('req/sconf'), data: { id: sv.invid }, success: (cresp) => {
url: $ocms.url('req/sconf'), data: { id: sv.invid, backdate: (bdChk && bdChk.is(':checked')) ? 1 : 0 }, success: (cresp) => {
ct.trigger('modal_close');
if (cresp.hasFile === true) { window.open($ocms.url('req/idoc') + '?id=' + sv.invid, '_blank'); }
$inv.d.close();
@@ -703,7 +711,7 @@ $inv.cInv2 = function (data) {
lihd.append($$.sc('dli').click(function () { $inv.disp(ix.Id, 'inv'); }));
}
lihd.append($$.sc('nme', ix.DocumentName || ix.Id));
$$.dc('lidt', ili).append([$$.dc('wda').append([$$.s(fdt(ix.DateCreated, 'dd.MM.yyyy'))]), $$.d().text($ict.iSt[ix.invstatus] || ix.invstatus)]);
$$.dc('lidt', ili).append([$$.dc('wda').append([$$.s(fdt(ix.InvoiceDate || ix.DateCreated, 'dd.MM.yyyy'))]), $$.d().text($ict.iSt[ix.invstatus] || ix.invstatus)]);
});
}
@@ -878,13 +886,16 @@ $inv.ccStInv = function (ev) { // Stornorechnung
rif.tbl.children('tbody').each($inv.bdysort);
rif.tbl.trigger('fds.inv'); /* trigger calculations */
}, error: (xhr) => {
alert($t.f1 + (xhr && xhr.status ? xhr.status : ''));
}, complete: () => {
o.c.trigger('modal_close');
}
});
}, error: () => {
}, error: (xhr) => {
if (o) { o.c.trigger('modal_close'); }
alert($t.f1 + (xhr && xhr.status ? xhr.status : ''));
}
});
};
@@ -1011,13 +1022,16 @@ $inv.cSt = function (data) {
rif.tbl.children('tbody').each($inv.bdysort);
rif.tbl.trigger('fds.inv'); /* trigger calculations */
}, error: (xhr) => {
alert($t.f1 + (xhr && xhr.status ? xhr.status : ''));
}, complete: () => {
o.c.trigger('modal_close');
}
});
}, error: () => {
}, error: (xhr) => {
if (o) { o.c.trigger('modal_close'); }
alert($t.f1 + (xhr && xhr.status ? xhr.status : ''));
}
});
};
@@ -1331,7 +1345,7 @@ $inv.rrw = function () {
} else if (rw.is('.itm.osum') === true) {
co = { invrqid: dta.InvRqId, id: 'osum' + rw.index(), typ: 'osum', p: '', q: null, t: oHtml(dta.tbl.tbl), tt: null, v: null, vt: dta.net_val, vs: dta.svcnet_val, vat: dta.vat, vv: dta.vat_val, vsv: dta.svcvat_val, det: false };
} else {
co = { invrqid: dta.InvRqId, id: dta.Id || '', typ: dta.Type || 'other', p: '', q: null, t: '', tt: null, v: null, vt: dta.net_val, vs: dta.svcnet_val, vat: dta.vat, vv: dta.vat_val, vsv: dta.svcvat_val, det: (dta.Note || '') !== '' && hn === false, SetItmId: dta.SetItmId || null, lvl: (dta.lvl || 0) };
co = { invrqid: dta.InvRqId, id: dta.Id || '', typ: dta.Type || 'other', p: '', q: null, t: '', tt: null, v: null, vt: dta.net_val, vs: dta.svcnet_val, vat: dta.vat, vv: dta.vat_val, vsv: dta.svcvat_val, det: (dta.Note || '') !== '' && hn === false, SetItmId: dta.SetItmId || null, lvl: (dta.lvl || 0), ref: dta.reference_InvId || null };
$$.dc('ibtn ico move', axf, { title: $rct.mR }); /* should be the last added */
/* dta.position is '' (not unset) for a Text/Title row once invSumUpdate has numbered the