comee_core 0.3.48 → 0.3.50
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/comee/core/purchase_order.rb +13 -0
- data/app/models/comee/core/purchase_order_item.rb +2 -0
- data/app/serializers/comee/core/purchase_order_item_serializer.rb +1 -1
- data/db/migrate/20240815080137_add_confirmed_field_values_to_purchase_order.rb +6 -0
- data/lib/comee/core/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca617ef814088107f21ec7f2a8d541db9a58f2f8d60576aea6ef20370328a820
|
4
|
+
data.tar.gz: db91bf688f9d5a3479934a0839a3843e927a6b4a2b34e21ce11df5489478af37
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 60df1dd5ca85c8ae6b27e75d1aa5d3e30327b7366ad925a7c1443bc54e6e017064a88372d599e2d3b300c1cb17f10a8415c20dcbdb9823cb5e423792f2cda8c3
|
7
|
+
data.tar.gz: 8e696cdba2b0ead77fc9ecbb74c3bd1acf118b0221eee54cb047adbb4f272fbef6708857e8268c5dd5b83d1b501c3f5873bb8f3a5607f7efa90f24f69841a01c
|
@@ -23,6 +23,11 @@ module Comee
|
|
23
23
|
self.total_price = items.sum(&:total_price).round(2)
|
24
24
|
end
|
25
25
|
|
26
|
+
def calculate_confirmed_total_price
|
27
|
+
items = PurchaseOrderItem.where(purchase_order_id: id)
|
28
|
+
self.confirmed_total_price = items.sum(&:confirmed_total_price).round(2)
|
29
|
+
end
|
30
|
+
|
26
31
|
def calculate_vat
|
27
32
|
return unless supplier.tax_code == "Inland"
|
28
33
|
|
@@ -31,6 +36,14 @@ module Comee
|
|
31
36
|
self.vat = (total_price * 0.19).round(2)
|
32
37
|
end
|
33
38
|
|
39
|
+
def calculate_confirmed_vat
|
40
|
+
return unless supplier.tax_code == "Inland"
|
41
|
+
|
42
|
+
items = PurchaseOrderItem.where(purchase_order_id: id)
|
43
|
+
confirmed_total_price = items.sum(&:confirmed_total_price)
|
44
|
+
self.confirmed_vat = (confirmed_total_price * 0.19).round(2)
|
45
|
+
end
|
46
|
+
|
34
47
|
def self.ransackable_attributes(_auth_object = nil)
|
35
48
|
%w[
|
36
49
|
id
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Comee
|
2
2
|
module Core
|
3
3
|
class PurchaseOrderItemSerializer < ActiveModel::Serializer
|
4
|
-
attributes :id, :serial_no, :quantity, :confirmed_quantity, :price, :details
|
4
|
+
attributes :id, :serial_no, :quantity, :confirmed_quantity, :price, :details, :remark
|
5
5
|
|
6
6
|
belongs_to :purchase_order
|
7
7
|
end
|
data/lib/comee/core/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: comee_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.50
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henock L.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-08-
|
11
|
+
date: 2024-08-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_model_serializers
|
@@ -540,6 +540,7 @@ files:
|
|
540
540
|
- db/migrate/20240805093326_update_details_column_in_shipment_instruction_items.rb
|
541
541
|
- db/migrate/20240807050230_add_amount_credited_to_invoice.rb
|
542
542
|
- db/migrate/20240814125757_add_details_field_to_purchase_order_item.rb
|
543
|
+
- db/migrate/20240815080137_add_confirmed_field_values_to_purchase_order.rb
|
543
544
|
- lib/comee/core.rb
|
544
545
|
- lib/comee/core/engine.rb
|
545
546
|
- lib/comee/core/version.rb
|