taxtank-core 3.0.15 → 3.0.17
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.
|
@@ -2887,6 +2887,9 @@ __decorate([
|
|
|
2887
2887
|
__decorate([
|
|
2888
2888
|
Type(() => Number)
|
|
2889
2889
|
], DepreciationForecast.prototype, "closeBalance", void 0);
|
|
2890
|
+
__decorate([
|
|
2891
|
+
Type(() => Number)
|
|
2892
|
+
], DepreciationForecast.prototype, "openBalance", void 0);
|
|
2890
2893
|
|
|
2891
2894
|
/**
|
|
2892
2895
|
* Grouped chart accounts categories for fast work
|
|
@@ -24143,6 +24146,15 @@ const FILE_SETTINGS = {
|
|
|
24143
24146
|
}
|
|
24144
24147
|
};
|
|
24145
24148
|
|
|
24149
|
+
/**
|
|
24150
|
+
* autoTable renders cells from text only and ignores CSS, so the styles a cell should keep in the PDF
|
|
24151
|
+
* are taken from its classes. To support one more style just add an entry here.
|
|
24152
|
+
*/
|
|
24153
|
+
const PDF_CELL_STYLES = {
|
|
24154
|
+
'col-right': { halign: 'left' },
|
|
24155
|
+
'text-right': { halign: 'left' },
|
|
24156
|
+
};
|
|
24157
|
+
|
|
24146
24158
|
/**
|
|
24147
24159
|
* Service with base functionality to export tables (HTML table, data-table, e.t.c.) as PDF file
|
|
24148
24160
|
* The file is generated using the jsPDF library to set custom table styles
|
|
@@ -24163,6 +24175,12 @@ class PdfFromTableService {
|
|
|
24163
24175
|
},
|
|
24164
24176
|
startY: lastTableCoords,
|
|
24165
24177
|
didParseCell: (data) => {
|
|
24178
|
+
// remove whitespaces that surrounds an interpolated value in the markup from autoTable
|
|
24179
|
+
data.cell.text = data.cell.text.map((line) => line.trim());
|
|
24180
|
+
// autoTable ignores CSS, so cell styles are taken from its classes
|
|
24181
|
+
if (data.cell.raw instanceof HTMLElement) {
|
|
24182
|
+
data.cell.raw.classList.forEach((className) => Object.assign(data.cell.styles, PDF_CELL_STYLES[className]));
|
|
24183
|
+
}
|
|
24166
24184
|
// Align last column content to right
|
|
24167
24185
|
if (data.table.columns.length > 1 && (data.column.index === data.table.columns.length - 1)) {
|
|
24168
24186
|
data.cell.styles.halign = 'right';
|