cats_core 1.5.8 → 1.5.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 02b7883db68e256449e949034e2b56a5c40387292ab61c7346a429f1d94a04f7
4
- data.tar.gz: 7d0230d0c98ca9c7b57ccd23bc410c7c5b0126eca37c3daca4707dd95e154a08
3
+ metadata.gz: 9b4bc4794cd5e6b77b2db5b95b9164ad5a6d3cd031a7ca32716586b4e89ff6d9
4
+ data.tar.gz: d26bae7c4c4a290c17aeec1c4bb059809ca0b5112f46991f9aaad660868dac0f
5
5
  SHA512:
6
- metadata.gz: 1e865e4a70b174511dd8de23aeab18e54cea7847583a206d6da5609e9487137de117b0ef3461e77f89706e88094c3f1a99249a88686ac191e61e93efb7c62a4b
7
- data.tar.gz: 9785438a4a1ce510068ebb3a693d89eb0d66297132b8b700968f3c32eec45317ed2cde89f771dfb4d63cacc03aad35eb21818d6774d236a3022c61569635e1af
6
+ metadata.gz: 0b60c83380471fb433a0a2a5174a676a23d633a622a8edefcb391b9555fc132a6fed25695a8bcd7fff771e4ac8c86318666a85b896f6e6eb8da2a244c0546936
7
+ data.tar.gz: 55d298f3113118d57864e4e67bdf5d9a8960061e2b1b24d7651b0ca8e63b2d8e619f52230c88181239ef9b4a010a7f1dc36dbe8650bcb2318ba8a736487d5faf
@@ -87,8 +87,8 @@ module Cats
87
87
  woreda: detail.beneficiary_round_plan_item.round_plan_item.woreda.name,
88
88
  fdp: detail.beneficiary_round_plan_item.round_plan_item.fdp.name,
89
89
  commodity_category: detail.round_ration.commodity_category.name,
90
- unit_id: detail.round_ration.unit_of_measure_id,
91
- unit: detail.round_ration.unit_of_measure.abbreviation,
90
+ unit_id: detail.unit_id,
91
+ unit: detail.unit.abbreviation,
92
92
  quantity: detail.quantity,
93
93
  source_id: nil,
94
94
  destination_id: detail.beneficiary_round_plan_item.round_plan_item.fdp.id,
@@ -19,9 +19,10 @@ module Cats
19
19
  round_rations.each do |ration|
20
20
  quantity = (no_of_days / ration.no_of_days * ration.quantity) * plan_item.beneficiaries *
21
21
  round_plan.rounds.count
22
+ quantity = quantity.truncate(2)
22
23
  unit = ration.unit
23
24
  if ration.unit.abbreviation.downcase != 'pc'
24
- quantity = UnitConversion.convert(unit, mt, quantity)
25
+ quantity = UnitConversion.convert(unit, mt, quantity).truncate(2)
25
26
  unit = mt
26
27
  end
27
28
 
@@ -1,5 +1,5 @@
1
1
  module Cats
2
2
  module Core
3
- VERSION = '1.5.8'.freeze
3
+ VERSION = '1.5.10'.freeze
4
4
  end
5
5
  end
@@ -1,7 +1,7 @@
1
1
  FactoryBot.define do
2
2
  factory :round_plan_item_detail, class: 'Cats::Core::RoundPlanItemDetail' do
3
3
  transient do
4
- mt { create(:unit_of_measure, abbreviation: 'mt', name: 'Metric Tonne') }
4
+ mt { Cats::Core::UnitOfMeasure.find_or_create_by(abbreviation: 'mt', name: 'Metric Tonne', unit_type: 'Weight') }
5
5
  end
6
6
  beneficiary_round_plan_item
7
7
  round_ration
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cats_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.8
4
+ version: 1.5.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henock L.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-02 00:00:00.000000000 Z
11
+ date: 2022-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_model_serializers