Erweiterungen

This commit is contained in:
2026-02-23 17:26:27 +01:00
parent 1c7652bb28
commit 0531c96cc8
17 changed files with 410 additions and 62 deletions

View File

@@ -449,6 +449,15 @@
ctx.lineTo(el.x + (el.width || 200), el.y);
ctx.stroke();
break;
case 'vline':
ctx.strokeStyle = el.color || '#333333';
ctx.lineWidth = el.strokeWidth || 1;
ctx.beginPath();
ctx.moveTo(el.x, el.y);
ctx.lineTo(el.x, el.y + (el.height || 200));
ctx.stroke();
break;
case 'image':
if (el.imageData) {
@@ -699,6 +708,11 @@
el.width = 200;
el.height = 2;
break;
case 'vline':
el.text = '';
el.width = 2;
el.height = 200;
break;
case 'image':
el.text = 'Bild';
el.width = 100;

View File

@@ -265,7 +265,9 @@ window.initProfileInvoiceGenerator = function() {
// Always use black text for static elements, otherwise use element color
ctx.fillStyle = el.isStatic ? '#000000' : (el.color || '#333333');
ctx.font = (el.fontStyle || '') + ' ' + fontSize + 'px Arial';
// Masterdata elements are never bold; other elements respect their fontStyle
var fontWeight = (el.isStatic && !el.isCustomer) ? '' : (el.fontStyle || '');
ctx.font = (fontWeight ? fontWeight + ' ' : '') + fontSize + 'px Arial';
ctx.textBaseline = 'top';
lines.forEach(function(line) {
@@ -1108,6 +1110,17 @@ window.initProfileInvoiceGenerator = function() {
};
};
window.updateProfileMasterdataValue = function(key, value) {
if (!window.masterdataValues) window.masterdataValues = {};
window.masterdataValues[key] = value;
elements.forEach(function(el) {
if (el.variable === key) {
el.text = value;
}
});
draw();
};
draw();
window.profileInvoiceState.initialized = true;
console.log('Profile canvas initialized with ' + elements.length + ' elements');