comee_core 0.3.42 → 0.3.43
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/invoice.rb +3 -1
- data/app/models/comee/core/shipment_instruction_item.rb +11 -0
- data/app/serializers/comee/core/shipment_instruction_item_serializer.rb +1 -1
- data/db/migrate/20240805085256_add_details_to_shipment_instruction_item.rb +5 -0
- data/db/migrate/20240805093326_update_details_column_in_shipment_instruction_items.rb +14 -0
- data/lib/comee/core/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ff7350423a4f7d4bfbab481f69a78c1526754c515c6f58ccfd31f5e77b4eb60
|
4
|
+
data.tar.gz: 15b0575c52dcc8994efdba583b2455fa2375f1b87612e5fab71c765bdfe0f376
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85e67b19d45298a5da7fce3a0337516242fb073b05255836b313d9bacad96909b72582485b91f57d471de60e7756952cc025f22a95b77b599954215b185c08dc
|
7
|
+
data.tar.gz: a7b7c841130e5760d30b44ee997f4a275e1e28504cc84733b9c4fa228b2c905705e820fda9785c50ff67f99c88044026ecb68d9dcb5a61d93d66e91b1e858f15
|
@@ -75,7 +75,9 @@ module Comee
|
|
75
75
|
def calculate_total
|
76
76
|
items = InvoiceItem.where(invoice_id: id)
|
77
77
|
additionals = AdditionalItem.where(invoice_id: id)
|
78
|
-
(items.sum(:total_price) + additionals.sum(:total_price))
|
78
|
+
total = (items.sum(:total_price) + additionals.sum(:total_price))
|
79
|
+
total *= (pct_advanced / 100) if advance?
|
80
|
+
total.round(2)
|
79
81
|
end
|
80
82
|
|
81
83
|
def calculate_amount_paid
|
@@ -1,6 +1,8 @@
|
|
1
1
|
module Comee
|
2
2
|
module Core
|
3
3
|
class ShipmentInstructionItem < ApplicationRecord
|
4
|
+
before_save :set_details, if: proc { |item| item.details.empty? }
|
5
|
+
|
4
6
|
belongs_to :shipment_instruction
|
5
7
|
belongs_to :shipment_item
|
6
8
|
belongs_to :unit
|
@@ -9,6 +11,15 @@ module Comee
|
|
9
11
|
|
10
12
|
validates :pallet_no, presence: true
|
11
13
|
validates :length, :width, :height, :weight, :quantity, :price, presence: true, numericality: {greater_than: 0}
|
14
|
+
|
15
|
+
def set_details
|
16
|
+
self.details = {
|
17
|
+
customer_item_no: shipment_item.sales_order_item.customer_item_no,
|
18
|
+
customer_item_description: shipment_item.sales_order_item.customer_item_description,
|
19
|
+
customer_item_alias: shipment_item.sales_order_item.customer_item_alias,
|
20
|
+
use_alias: shipment_item.sales_order_item.use_alias
|
21
|
+
}
|
22
|
+
end
|
12
23
|
end
|
13
24
|
end
|
14
25
|
end
|
@@ -2,7 +2,7 @@ module Comee
|
|
2
2
|
module Core
|
3
3
|
class ShipmentInstructionItemSerializer < ActiveModel::Serializer
|
4
4
|
attributes :id, :delivery_note_no, :pallet_no, :goods_issue_date, :length, :width, :height, :weight, :quantity, :price,
|
5
|
-
:pod_id
|
5
|
+
:pod_id, :details
|
6
6
|
belongs_to :unit
|
7
7
|
belongs_to :shipment_item
|
8
8
|
belongs_to :pod
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class UpdateDetailsColumnInShipmentInstructionItems < ActiveRecord::Migration[7.1]
|
2
|
+
def up
|
3
|
+
Comee::Core::ShipmentInstructionItem.reset_column_information
|
4
|
+
Comee::Core::ShipmentInstructionItem.find_each do |item|
|
5
|
+
details = {
|
6
|
+
customer_item_no: item.shipment_item.sales_order_item.customer_item_no,
|
7
|
+
customer_item_description: item.shipment_item.sales_order_item.customer_item_description,
|
8
|
+
customer_item_alias: item.shipment_item.sales_order_item.customer_item_alias,
|
9
|
+
use_alias: item.shipment_item.sales_order_item.use_alias
|
10
|
+
}
|
11
|
+
item.update_column(:details, details)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
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.43
|
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-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_model_serializers
|
@@ -536,6 +536,8 @@ files:
|
|
536
536
|
- db/migrate/20240731081502_create_comee_core_credit_note_additional_items.rb
|
537
537
|
- db/migrate/20240803194006_change_reference_in_invoice_to_polymorphic.rb
|
538
538
|
- db/migrate/20240803231700_update_invoice_fields.rb
|
539
|
+
- db/migrate/20240805085256_add_details_to_shipment_instruction_item.rb
|
540
|
+
- db/migrate/20240805093326_update_details_column_in_shipment_instruction_items.rb
|
539
541
|
- lib/comee/core.rb
|
540
542
|
- lib/comee/core/engine.rb
|
541
543
|
- lib/comee/core/version.rb
|