comee_core 0.3.53 → 0.3.55
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.
- checksums.yaml +4 -4
- data/app/models/comee/core/invoice.rb +1 -1
- data/app/models/comee/core/purchase_order.rb +4 -6
- data/lib/comee/core/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf0aa797a4e7b22548c47912a73de0ca9aa6d7b118b840f703d96c6cd26467df
|
4
|
+
data.tar.gz: 173e0daf0e4d21b78a9c4d8e251ef71be066278ddcce978fb30fbadd7de4dea2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '048126618a14aa1d29bfd69e48456948b772c645b5835ca81b20f89fdaa4d5401b1f2eb1d7098fff0372a5601a80b568ead0e60860e98425891b96fcc060fec8'
|
7
|
+
data.tar.gz: 35536ee2083b1e589b95ca88dc886bdbdef200034aefd4cea74325caa2ccd1343cbd18f05348e5fec858a84384598099c49cb42c5e9b02b513589041554cf88d
|
@@ -114,7 +114,7 @@ module Comee
|
|
114
114
|
|
115
115
|
def generate_invoice_no
|
116
116
|
year = Date.current.year.to_s
|
117
|
-
self.invoice_no = Util.generate_number("Invoice", "invoice_no", year, "-",
|
117
|
+
self.invoice_no = Util.generate_number("Invoice", "invoice_no", year, "-", 300000)
|
118
118
|
end
|
119
119
|
end
|
120
120
|
end
|
@@ -42,16 +42,14 @@ module Comee
|
|
42
42
|
|
43
43
|
def calculate_total
|
44
44
|
items = PurchaseOrderItem.where(purchase_order_id: id)
|
45
|
-
|
46
|
-
total = (total * (1 - discount / 100.0)).round(2) if discount&.positive?
|
47
|
-
total
|
45
|
+
items.sum(&:total_price).round(2)
|
46
|
+
# total = (total * (1 - discount / 100.0)).round(2) if discount&.positive?
|
48
47
|
end
|
49
48
|
|
50
49
|
def calculate_confirmed_total
|
51
50
|
items = PurchaseOrderItem.where(purchase_order_id: id)
|
52
|
-
|
53
|
-
confirmed_total = (confirmed_total * (1 - confirmed_discount / 100.0)).round(2) if confirmed_discount&.positive?
|
54
|
-
confirmed_total
|
51
|
+
items.sum(&:confirmed_total_price).round(2)
|
52
|
+
# confirmed_total = (confirmed_total * (1 - confirmed_discount / 100.0)).round(2) if confirmed_discount&.positive?
|
55
53
|
end
|
56
54
|
|
57
55
|
def self.ransackable_attributes(_auth_object = nil)
|
data/lib/comee/core/version.rb
CHANGED