taxtank-core 0.7.2 → 0.7.3

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.
@@ -5700,7 +5700,7 @@
5700
5700
  * Create a new transaction from current depreciation
5701
5701
  */
5702
5702
  Depreciation.prototype.toTransaction = function () {
5703
- return classTransformer.plainToClass(Transaction, this);
5703
+ return classTransformer.plainToClass(Transaction, Object.assign({}, this, { amount: this.getCurrentYearForecastAmount() }));
5704
5704
  };
5705
5705
  return Depreciation;
5706
5706
  }(Depreciation$1));
@@ -10693,8 +10693,16 @@
10693
10693
  fontWeight: 'bold',
10694
10694
  positionX: 14,
10695
10695
  positionY: 10,
10696
- fillColor: 255,
10697
- textColor: 0
10696
+ colorWhite: '#ffffff',
10697
+ colorBlack: '#000000',
10698
+ colorPrimary: '#00b7f0'
10699
+ },
10700
+ logo: {
10701
+ src: '/assets/img/icons/logo.png',
10702
+ width: 30,
10703
+ height: 7,
10704
+ positionX: 168,
10705
+ positionY: 6
10698
10706
  },
10699
10707
  // coords for file section title (group, table, e.t.c.)
10700
10708
  contentTitleCoords: {
@@ -10733,6 +10741,7 @@
10733
10741
  PdfService.prototype.generateFromTables = function (tables, title) {
10734
10742
  var pdf = new jsPDF__default["default"]();
10735
10743
  this.setDocumentTitle(pdf, title);
10744
+ this.setDocumentLogo(pdf);
10736
10745
  tables.forEach(function (table) {
10737
10746
  var _a;
10738
10747
  // Add table caption if not provided
@@ -10749,9 +10758,12 @@
10749
10758
  var options = {
10750
10759
  html: table,
10751
10760
  startY: lastTableCoords + captionHeight + PDF_CONFIG.contentTitleCoords.marginTop,
10761
+ headStyles: {
10762
+ fillColor: PDF_CONFIG.text.colorPrimary,
10763
+ },
10752
10764
  footStyles: {
10753
- fillColor: PDF_CONFIG.text.fillColor,
10754
- textColor: PDF_CONFIG.text.textColor
10765
+ fillColor: PDF_CONFIG.text.colorWhite,
10766
+ textColor: PDF_CONFIG.text.colorBlack
10755
10767
  },
10756
10768
  didParseCell: function (data) {
10757
10769
  // Align last column content to right
@@ -10769,6 +10781,11 @@
10769
10781
  .setFont(PDF_CONFIG.text.fontName, PDF_CONFIG.text.fontStyle, PDF_CONFIG.text.fontWeight)
10770
10782
  .text(title, PDF_CONFIG.text.positionX, PDF_CONFIG.text.positionY);
10771
10783
  };
10784
+ PdfService.prototype.setDocumentLogo = function (doc) {
10785
+ var logo = new Image();
10786
+ logo.src = PDF_CONFIG.logo.src;
10787
+ doc.addImage(logo, 'PNG', PDF_CONFIG.logo.positionX, PDF_CONFIG.logo.positionY, PDF_CONFIG.logo.width, PDF_CONFIG.logo.height);
10788
+ };
10772
10789
  /**
10773
10790
  * @Todo remove/refactor when all DataTable dependent methods will be cleared-up
10774
10791
  * Generate PDF file from provided data