@dascompany/product 4.1.1 → 4.1.2
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.
package/dist/SQL.json
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
},
|
|
20
20
|
"accountCart": {
|
|
21
21
|
"select": "SELECT * FROM clients.account_cart WHERE account_id = $account_id::BIGINT",
|
|
22
|
-
"insert": "INSERT INTO clients.account_cart(account_id, product_id, installation) VALUES ($account_id::BIGINT, $product_id::BIGINT, installation::BOOL)",
|
|
22
|
+
"insert": "INSERT INTO clients.account_cart(account_id, product_id, installation) VALUES ($account_id::BIGINT, $product_id::BIGINT, $installation::BOOL)",
|
|
23
23
|
"update": "UPDATE clients.account_cart SET installation = $installation WHERE account_id = $account_id::BIGINT AND product_id = $product_id::BIGINT AND installation = $installation::Bool",
|
|
24
24
|
"delete": "DELETE FROM clients.account_cart WHERE product_id = $product_id::BIGINT AND account_id = $account_id::BIGINT AND installation = $installation::BOOL"
|
|
25
25
|
},
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"files": {
|
|
99
99
|
"select": "SELECT * FROM files.files",
|
|
100
100
|
"selectId": "SELECT id FROM files.files ",
|
|
101
|
-
"selectForConnection": "SELECT id, name, catalog, type, sequence
|
|
101
|
+
"selectForConnection": "SELECT id, name, catalog, type, sequence FROM files.files JOIN files.file_connections ON file_id = id",
|
|
102
102
|
"insert": "INSERT INTO files.files( id, name, orginal_name, catalog, size_kb, type, alt, title, created_at ) VALUES ( $id::BIGINT, $name::TEXT, $orginal_name::TEXT, $catalog::TEXT, $size_kb::BIGINT, $type::TEXT, $alt::TEXT, $title::TEXT, now() )",
|
|
103
103
|
"update": "UPDATE files.files SET name = $name::TEXT, orginal_name = $orginal_name::TEXT, catalog = $catalog::TEXT, size_kb = $size_kb::BIGINT, type = $type::TEXT, alt = $alt::TEXT, title = $title::TEXT WHERE id = $id::BIGINT ",
|
|
104
104
|
"count": "SELECT COUNT(*) AS total_rows FROM files.files",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default class PriceConverter {
|
|
2
|
-
static netToGrossPrice(
|
|
3
|
-
static grossToNetPrice(
|
|
2
|
+
static netToGrossPrice(netPriceinPenny: number, vatPercentage?: number): number;
|
|
3
|
+
static grossToNetPrice(grossPriceinPenny: number, vatPercentage?: number): string;
|
|
4
4
|
static priceToPenny(price: number): number;
|
|
5
5
|
}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
export default class PriceConverter {
|
|
2
|
-
static netToGrossPrice(
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const grossPriceInPenny = netPriceInPenny + vatPriceInPenny;
|
|
2
|
+
static netToGrossPrice(netPriceinPenny, vatPercentage = 23) {
|
|
3
|
+
const vatPriceInPenny = Math.round((netPriceinPenny * vatPercentage) / 100);
|
|
4
|
+
const grossPriceInPenny = netPriceinPenny + vatPriceInPenny;
|
|
6
5
|
return grossPriceInPenny;
|
|
7
6
|
}
|
|
8
|
-
static grossToNetPrice(
|
|
9
|
-
const
|
|
10
|
-
const netPrice = ((grossPriceInPenny / (vatPercentage / 100 + 1)) / 100).toFixed(2);
|
|
7
|
+
static grossToNetPrice(grossPriceinPenny, vatPercentage = 23) {
|
|
8
|
+
const netPrice = ((grossPriceinPenny / (vatPercentage / 100 + 1)) / 100).toFixed(2);
|
|
11
9
|
return netPrice;
|
|
12
10
|
}
|
|
13
11
|
static priceToPenny(price) {
|