swissqrbill
Advanced tools
Comparing version 1.3.0 to 1.3.1
# Change Log | ||
# [v1.3.1](https://github.com/rogerrrrrrrs/swissqrbill/compare/v1.3.0...v1.3.1) - 27.06.2020 | ||
* Fixed invalid QR Code field when the second decimal place in amount is a zero | ||
# [v1.3.0](https://github.com/rogerrrrrrrs/swissqrbill/compare/v1.2.0...v1.3.0) - 25.06.2020 | ||
@@ -8,7 +11,7 @@ * Tables | ||
- Table row height is now automatically calculated if not otherwise defined. | ||
- Added padding option to rows and cells. | ||
- Added padding property to rows and cells. | ||
* Events | ||
- Added new beforeEnd event that could be used to add page numbers. | ||
- Added new pageAdded event that could be used to add a header to the pages. | ||
* Renamed `debitor` option to `debtor`. | ||
* Renamed `debitor` property to `debtor`. | ||
* Improved documentation. | ||
@@ -15,0 +18,0 @@ * TypeScript declaration improvements. |
@@ -8,3 +8,3 @@ import PDFDocument from "pdfkit"; | ||
y?: number; | ||
padding?: number | [number, number, number, number]; | ||
padding?: number | [number, number?, number?, number?]; | ||
lineWidth?: number; | ||
@@ -19,3 +19,3 @@ font?: string; | ||
height?: number; | ||
padding?: number | [number, number, number, number]; | ||
padding?: number | [number, number?, number?, number?]; | ||
font?: string; | ||
@@ -28,3 +28,3 @@ fontSize?: number; | ||
width?: number; | ||
padding?: number | [number, number, number, number]; | ||
padding?: number | [number, number?, number?, number?]; | ||
fillColor?: string; | ||
@@ -31,0 +31,0 @@ strokeColor?: string; |
@@ -88,4 +88,15 @@ "use strict"; | ||
}; | ||
if (typeof padding === "object" && padding.length === 4) { | ||
paddings = { top: padding[0], right: padding[1], bottom: padding[2], left: padding[3] }; | ||
if (typeof padding === "object") { | ||
if (padding[0] !== undefined) { | ||
paddings.top = padding[0]; | ||
} | ||
if (padding[1] !== undefined) { | ||
paddings.right = padding[1]; | ||
} | ||
if (padding[2] !== undefined) { | ||
paddings.bottom = padding[2]; | ||
} | ||
if (padding[3] !== undefined) { | ||
paddings.left = padding[3]; | ||
} | ||
} | ||
@@ -92,0 +103,0 @@ else if (typeof padding === "number") { |
@@ -515,3 +515,3 @@ "use strict"; | ||
} | ||
if (this._data.amount.toString().length > 12) { | ||
if (this._data.amount.toFixed(2).toString().length > 12) { | ||
throw new Error("Amount must be a maximum of 12 digits."); | ||
@@ -707,3 +707,3 @@ } | ||
if (this._data.amount !== undefined) { | ||
qrString += this._data.amount + "\n"; | ||
qrString += this._data.amount.toFixed(2) + "\n"; | ||
} | ||
@@ -710,0 +710,0 @@ else { |
{ | ||
"name": "swissqrbill", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "Swiss QR Bill generation in node.js ", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
# SwissQRBill | ||
<a href="https://github.com/Rogerrrrrrrs/SwissQRBill/blob/master/LICENSE"> | ||
<img alt="MIT License" src="https://img.shields.io/npm/l/swissqrbill?color=brightgreen"> | ||
<img alt="MIT License" src="https://img.shields.io/npm/l/swissqrbill?color=brightgreen&style=flat-square"> | ||
</a> | ||
<a href="https://www.npmjs.com/package/swissqrbill"> | ||
<img alt="Version" src="https://img.shields.io/npm/v/swissqrbill?color=brightgreen"> | ||
<img alt="Version" src="https://img.shields.io/npm/v/swissqrbill?color=brightgreen&style=flat-square"> | ||
</a> | ||
<a href="https://github.com/Rogerrrrrrrs/SwissQRBill/issues"> | ||
<img alt="Issues" src="https://img.shields.io/github/issues-raw/rogerrrrrrrs/swissqrbill"> | ||
<img alt="Issues" src="https://img.shields.io/github/issues-raw/rogerrrrrrrs/swissqrbill?style=flat-square"> | ||
</a> | ||
<a href="https://www.npmjs.com/package/swissqrbill"> | ||
<img alt="Dependencies" src="https://img.shields.io/david/rogerrrrrrrs/swissqrbill"> | ||
<img alt="Dependencies" src="https://img.shields.io/david/rogerrrrrrrs/swissqrbill?style=flat-square"> | ||
</a> | ||
<a href="https://www.npmjs.com/package/swissqrbill"> | ||
<img alt="Downloads" src="https://img.shields.io/npm/dw/swissqrbill"> | ||
<img alt="Downloads" src="https://img.shields.io/npm/dw/swissqrbill?style=flat-square"> | ||
</a> | ||
<a href="https://github.com/Rogerrrrrrrs/SwissQRBill/actions?query=workflow%3ACI"> | ||
<img alt="CI" src="https://github.com/Rogerrrrrrrs/SwissQRBill/workflows/CI/badge.svg?branch=development"> | ||
<img alt="CI" src="https://img.shields.io/github/workflow/status/Rogerrrrrrrs/SwissQRBill/CI?style=flat-square"> | ||
</a> | ||
@@ -21,0 +20,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
119715
1597
97