comee_core 0.3.49 → 0.3.51
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 +2 -1
- data/app/serializers/comee/core/purchase_order_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: 7eb8daaf5bd10966f39faab024fbac053cceea0b8975cc62f529340daba65bad
|
4
|
+
data.tar.gz: f82a270166be12621e18d5834aad45224bc2a1e0c7eb6464f668855e87792846
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cba8ba7756560f47bec8270a9e6b269ac4f106946589a8255d67be7e26e0f736fb1686c9d122c629c038950d254b840ffa7cfb45e11740ccdd29a36e028cc7f6
|
7
|
+
data.tar.gz: 99771a09d9f65b282a532c1691beb57d11d846c2c8c37e5fae5b6b7089db64b57e3b67721fb82c3eb1ed0d924499ec542afbb535884b51fd7f61c1eba15d7707
|
@@ -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,8 @@
|
|
1
1
|
module Comee
|
2
2
|
module Core
|
3
3
|
class PurchaseOrderItemSerializer < ActiveModel::Serializer
|
4
|
-
attributes :id, :serial_no, :quantity, :confirmed_quantity, :price, :
|
4
|
+
attributes :id, :serial_no, :purchase_order_id, :unit_id, :quantity, :confirmed_quantity, :price, :confirmed_price,
|
5
|
+
:total_price, :delivery_date, :confirmed_total_price, :confirmed_delivery_date, :status, :details, :remark
|
5
6
|
|
6
7
|
belongs_to :purchase_order
|
7
8
|
end
|
@@ -2,7 +2,7 @@ module Comee
|
|
2
2
|
module Core
|
3
3
|
class PurchaseOrderSerializer < ActiveModel::Serializer
|
4
4
|
attributes :id, :po_number, :supplier_id, :order_date, :status, :delivery_address, :delivery_date, :terms, :total_price,
|
5
|
-
:vat, :order_reference, :created_at, :updated_at
|
5
|
+
:vat, :order_reference, :created_at, :updated_at, :confirmed_total_price, :confirmed_vat
|
6
6
|
belongs_to :supplier
|
7
7
|
end
|
8
8
|
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.51
|
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
|