diff --git a/app/models/bank_link.rb b/app/models/bank_link.rb index 29857951f..24c94a771 100644 --- a/app/models/bank_link.rb +++ b/app/models/bank_link.rb @@ -32,7 +32,7 @@ class BankLink hash["VK_AMOUNT"] = number_with_precision(invoice.sum_cache, :precision => 2, :separator => ".") hash["VK_CURR"] = invoice.currency hash["VK_REF"] = "" - hash["VK_MSG"] = invoice.description + hash["VK_MSG"] = invoice.order hash["VK_RETURN"] = controller.registrar_return_payment_with_url(type) hash["VK_CANCEL"] = controller.registrar_return_payment_with_url(type) hash["VK_DATETIME"] = Time.now.strftime("%Y-%m-%dT%H:%M:%S%z") @@ -155,4 +155,4 @@ class BankLink bank_public_key.verify(OpenSSL::Digest::SHA1.new, Base64.decode64(mac), data) end end -end \ No newline at end of file +end diff --git a/app/models/directo.rb b/app/models/directo.rb index 05d9da5aa..fc1ad270a 100644 --- a/app/models/directo.rb +++ b/app/models/directo.rb @@ -35,7 +35,7 @@ class Directo < ActiveRecord::Base "ProductID" => Setting.directo_receipt_product_name, "Quantity" => 1, "UnitPriceWoVAT" => ActionController::Base.helpers.number_with_precision(invoice.sum_cache/(1+invoice.vat_prc), precision: 2, separator: "."), - "ProductName" => invoice.description + "ProductName" => invoice.order ) } end diff --git a/app/models/invoice.rb b/app/models/invoice.rb index 425202a4c..ad478443d 100644 --- a/app/models/invoice.rb +++ b/app/models/invoice.rb @@ -106,16 +106,17 @@ class Invoice < ActiveRecord::Base def buyer_country Country.new(buyer_country_code) end - + +# order is used for directo/banklink description + def order + "Order nr. #{number}" + end + def pdf(html) kit = PDFKit.new(html) kit.to_pdf end - def description - "Order nr. #{number}" - end - def pdf_name "invoice-#{number}.pdf" end diff --git a/app/views/registrar/invoices/partials/_details.haml b/app/views/registrar/invoices/partials/_details.haml index a2677f170..54ea4764a 100644 --- a/app/views/registrar/invoices/partials/_details.haml +++ b/app/views/registrar/invoices/partials/_details.haml @@ -25,9 +25,12 @@ %dt= t(:payment_term) %dd= t(@invoice.payment_term) - %dt= t(:description) - - @invoice.description.prepend(' - ') if @invoice.description.present? - %dd= "#{t('invoice_no', no: @invoice.number)}#{@invoice.description}" + %dt= t(:"invoice no") + %dd= @invoice.number + + - if @invoice.description.present? + %dt= t(:description) + %dd=@invoice.description %dt= t(:reference_no) %dd= @invoice.reference_no diff --git a/app/views/registrar/invoices/pdf.haml b/app/views/registrar/invoices/pdf.haml index d90c24fec..3f3aabb6e 100644 --- a/app/views/registrar/invoices/pdf.haml +++ b/app/views/registrar/invoices/pdf.haml @@ -174,11 +174,14 @@ %dt= t(:payment_term) %dd= t(@invoice.payment_term) + + %dt= t(:"invoice no") + %dd= @invoice.number - %dt= t(:description) - - @invoice.description.prepend(' - ') if @invoice.description.present? - %dd= "#{t('invoice_no', no: @invoice.number)}#{@invoice.description}" - + - if @invoice.description.present? + %dt= t(:description) + %dd=@invoice.description + %dt= t(:reference_no) %dd= @invoice.reference_no