c80_estate 0.1.0.36 → 0.1.0.37

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 435903a0873c24883172c8042bb12baf1af863f1
4
- data.tar.gz: fcf87d83628c514dfa64818ecdf15ecc6cff4646
3
+ metadata.gz: feb73e2ca07a154798c194522fcfe29c59e06581
4
+ data.tar.gz: fa2d0a72a40ff67bb6078c78bad41025e0c65c93
5
5
  SHA512:
6
- metadata.gz: 2922b5ac250f0d0bade3de2f30f1db73c87c5ba329fd315b72a74ba4efbd21868e16b74c12672f636269fccdf97ba35dd957cea6e257436292252933baac55e2
7
- data.tar.gz: 63a195068b68d986d0547e5b4f724dfb9d8eff24115a4040cfc96dfe160e4f978cdc16877a687b57147904e7ca17995c82b545c19c0fc4f69da2cb92ec8627c6
6
+ metadata.gz: 9e80cb776bd57f8dcb5f91e696eafc27d4bf005456b24f5cdebf0685dbe08458bf1b831b9d411547f5775f39c95a84897443345488ab1c23fa9a49f0b9c156e5
7
+ data.tar.gz: fb6efb30f933617458df8f1fbc24aa051b3c58c69819429bd800ec10c7332f46900fde47c554481aa36d45920fdb1ca9ea0a9b6819b890ea831350493af5ab3e
@@ -121,21 +121,21 @@ module C80Estate
121
121
  {
122
122
  title: 'Метраж',
123
123
  abbr: 'Объем площади',
124
- value: area.square_value.to_s(:rounded, precision: 2),
124
+ value: area.square_value_to_s,
125
125
  uom: 'м.кв.',
126
126
  css:''
127
127
  },
128
128
  {
129
129
  title: 'Цена',
130
130
  abbr: 'За метр квадратный в месяц',
131
- value: area.price_value.to_s(:rounded, precision: 2),
131
+ value: area.price_value_to_s,
132
132
  uom: 'руб',
133
133
  css:''
134
134
  },
135
135
  {
136
136
  title: 'Цена площади',
137
137
  abbr: 'Стоимость всей площади в месяц. Число PxS, где P - цена за м.кв. в месяц, S - метраж площади в м.кв.',
138
- value: area.power_price_value.to_s(:rounded, precision: 2),
138
+ value: area.power_price_value_to_s,
139
139
  uom: 'руб',
140
140
  css:''
141
141
  },
@@ -76,7 +76,9 @@ module C80Estate
76
76
  self.busy_areas.each do |area|
77
77
  area_prop_square = area.item_props.where(:prop_name_id => 9)
78
78
  if area_prop_square.present?
79
- sum += area_prop_square.first.value.to_f
79
+ if area_prop_square.count > 0
80
+ sum += area_prop_square.first.value.to_f
81
+ end
80
82
  end
81
83
  end
82
84
  sum
@@ -292,6 +294,33 @@ module C80Estate
292
294
 
293
295
  # --------
294
296
 
297
+ # выдать строку с площадью для показа, очень поможет вью
298
+ def square_value_to_s
299
+ s = 0
300
+ if self.square_value.present?
301
+ s = self.square_value
302
+ end
303
+ s.to_s(:rounded, precision: 2)
304
+ end
305
+
306
+ # выдать строку с ценой для показа, очень поможет вью
307
+ def price_value_to_s
308
+ s = 0
309
+ if self.price_value.present?
310
+ s = self.price_value
311
+ end
312
+ s.to_s(:rounded, precision: 2)
313
+ end
314
+
315
+ # выдать строку с ценой площади для показа, очень поможет вью
316
+ def power_price_value_to_s
317
+ s = 0
318
+ if self.power_price_value.present?
319
+ s = self.power_price_value
320
+ end
321
+ s.to_s(:rounded, precision: 2)
322
+ end
323
+
295
324
  def is_free?
296
325
  astatus_tag == 'free'
297
326
  end
@@ -1,3 +1,3 @@
1
1
  module C80Estate
2
- VERSION = '0.1.0.36'
2
+ VERSION = '0.1.0.37'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: c80_estate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.36
4
+ version: 0.1.0.37
5
5
  platform: ruby
6
6
  authors:
7
7
  - C80609A
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-08-15 00:00:00.000000000 Z
11
+ date: 2016-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler