Strip insignificant zero for ledger records in consumption export [SCI-9646] (#6693)

* Strip insignificant zero for ledger records when stock precision is zero [SCI-9646]

* Stip insignicant zeros for all stock ledger records in consumption exports [SCI-9646]
This commit is contained in:
wandji 2023-11-23 17:35:51 +01:00 committed by GitHub
parent 6c11c6641b
commit 2009d01532
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -37,6 +37,8 @@ module RepositoryStockLedgerZipExport
end
class << self
include ActionView::Helpers::NumberHelper
private
def load_records(repository_row_ids)
@ -64,13 +66,13 @@ module RepositoryStockLedgerZipExport
consumption_type,
record.repository_row.name,
record.repository_row.code,
consumed_amount,
number_with_precision(consumed_amount, strip_insignificant_zeros: true),
consumed_amount_unit,
added_amount,
number_with_precision(added_amount, strip_insignificant_zeros: true),
added_amount_unit,
record.user.full_name,
I18n.l(record.created_at, format: :full),
record.balance,
number_with_precision(record.balance, strip_insignificant_zeros: true),
record.unit
]
breadcrumbs_data =