invoice_bar 0.0.9 → 0.0.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
  SHA1:
3
- metadata.gz: 9dea65ab2e2406d8e2bb7a8b005b908274b4f450
4
- data.tar.gz: b069a060ff973a4b6ca33b9ae375a7dbc091d7b5
3
+ metadata.gz: ca239e980dfd0d0e5fc9117a5afe2babeb7a389a
4
+ data.tar.gz: e4ca5ceb427c9172102cae464f406f87e2aab348
5
5
  SHA512:
6
- metadata.gz: 002d297f7d78605d5886ad21af99e379f5258cb8ba6e055231f05152289446b441e0de5a3fb3d8f91c8ec784e2839a934e56c4ead1d780b4a29272bcd010e9bb
7
- data.tar.gz: cb36bb9e3d598c72abcdeddb43501de918ff2ee30ae4cdab9c37f72705d2e9d414d0092ec4ab2f7153fd3a5e4515fb7571ecb9b08c10a5e842656a4154de8a8d
6
+ metadata.gz: aa12c27f18e8c1b9145842e039fa16a8c724c83a13acf2eeba45095aeb6f88d67c2ed7a40a8ac71bd93e204fb75dccee69d61ee7345ea70f962764125d93b737
7
+ data.tar.gz: 79d3990104653757d57ebbf8e8ff19b98801a3f1fe153ddf05b61c441f78931c0f46b5957d5f6b0ade0126c6c023e943befeb7d0ab8008516560f1a0c69b802b
@@ -3,6 +3,7 @@ require 'invoice_printer'
3
3
  module InvoiceBar
4
4
  class InvoicePDF
5
5
  include ActionView::Helpers::TranslationHelper
6
+ include InvoiceBar::InvoiceBarHelper
6
7
 
7
8
  def initialize(invoice)
8
9
  @invoice = invoice
@@ -39,7 +40,7 @@ module InvoiceBar
39
40
  purchaser_extra_address_line: @invoice.address_extra_address_line.to_s,
40
41
  issue_date: l(@invoice.issue_date, format: :invoice).to_s,
41
42
  due_date: l(@invoice.due_date, format: :invoice).to_s,
42
- total: @invoice.amount.to_s,
43
+ total: formatted_amount(@invoice.amount, @invoice.try(:account).try(:currency_symbol)),
43
44
  bank_account_number: @invoice.account_bank_account_number.to_s,
44
45
  account_iban: @invoice.account_iban.to_s,
45
46
  account_swift: @invoice.account_swift.to_s,
@@ -55,8 +56,8 @@ module InvoiceBar
55
56
  name: item.name.to_s,
56
57
  quantity: item.number.to_s,
57
58
  unit: item.unit.to_s,
58
- price: item.price.to_s,
59
- amount: item.amount.to_s
59
+ price: formatted_amount(item.price),
60
+ amount: formatted_amount(item.amount)
60
61
  )
61
62
  end
62
63
  printable_items
@@ -3,6 +3,7 @@ require 'invoice_printer'
3
3
  module InvoiceBar
4
4
  class ReceiptPDF
5
5
  include ActionView::Helpers::TranslationHelper
6
+ include InvoiceBar::InvoiceBarHelper
6
7
 
7
8
  def initialize(receipt)
8
9
  @receipt = receipt
@@ -38,7 +39,7 @@ module InvoiceBar
38
39
  purchaser_city_part: @receipt.address_city_part.to_s,
39
40
  purchaser_extra_address_line: @receipt.address_extra_address_line.to_s,
40
41
  issue_date: l(@receipt.issue_date, format: :invoice).to_s,
41
- total: @receipt.amount.to_s,
42
+ total: formatted_amount(@receipt.amount, @invoice.try(:account).try(:currency_symbol)),
42
43
  bank_account_number: @receipt.account_bank_account_number.to_s,
43
44
  account_iban: @receipt.account_iban.to_s,
44
45
  account_swift: @receipt.account_swift.to_s,
@@ -54,8 +55,8 @@ module InvoiceBar
54
55
  name: item.name.to_s,
55
56
  quantity: item.number.to_s,
56
57
  unit: item.unit.to_s,
57
- price: item.price.to_s,
58
- amount: item.amount.to_s
58
+ price: formatted_amount(item.price),
59
+ amount: formatted_amount(item.amount)
59
60
  )
60
61
  end
61
62
  printable_items
@@ -1,3 +1,3 @@
1
1
  module InvoiceBar
2
- VERSION = '0.0.9'
2
+ VERSION = '0.0.10'
3
3
  end