mirror of
https://github.com/internetee/registry.git
synced 2025-07-02 01:03:35 +02:00
Merge pull request #173 from internetee/master-fix-invoice-desc
Master fix invoice desc
This commit is contained in:
commit
fb9d58cc37
5 changed files with 22 additions and 15 deletions
|
@ -32,7 +32,7 @@ class BankLink
|
||||||
hash["VK_AMOUNT"] = number_with_precision(invoice.sum_cache, :precision => 2, :separator => ".")
|
hash["VK_AMOUNT"] = number_with_precision(invoice.sum_cache, :precision => 2, :separator => ".")
|
||||||
hash["VK_CURR"] = invoice.currency
|
hash["VK_CURR"] = invoice.currency
|
||||||
hash["VK_REF"] = ""
|
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_RETURN"] = controller.registrar_return_payment_with_url(type)
|
||||||
hash["VK_CANCEL"] = 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")
|
hash["VK_DATETIME"] = Time.now.strftime("%Y-%m-%dT%H:%M:%S%z")
|
||||||
|
|
|
@ -35,7 +35,7 @@ class Directo < ActiveRecord::Base
|
||||||
"ProductID" => Setting.directo_receipt_product_name,
|
"ProductID" => Setting.directo_receipt_product_name,
|
||||||
"Quantity" => 1,
|
"Quantity" => 1,
|
||||||
"UnitPriceWoVAT" => ActionController::Base.helpers.number_with_precision(invoice.sum_cache/(1+invoice.vat_prc), precision: 2, separator: "."),
|
"UnitPriceWoVAT" => ActionController::Base.helpers.number_with_precision(invoice.sum_cache/(1+invoice.vat_prc), precision: 2, separator: "."),
|
||||||
"ProductName" => invoice.description
|
"ProductName" => invoice.order
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
|
@ -107,15 +107,16 @@ class Invoice < ActiveRecord::Base
|
||||||
Country.new(buyer_country_code)
|
Country.new(buyer_country_code)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# order is used for directo/banklink description
|
||||||
|
def order
|
||||||
|
"Order nr. #{number}"
|
||||||
|
end
|
||||||
|
|
||||||
def pdf(html)
|
def pdf(html)
|
||||||
kit = PDFKit.new(html)
|
kit = PDFKit.new(html)
|
||||||
kit.to_pdf
|
kit.to_pdf
|
||||||
end
|
end
|
||||||
|
|
||||||
def description
|
|
||||||
"Order nr. #{number}"
|
|
||||||
end
|
|
||||||
|
|
||||||
def pdf_name
|
def pdf_name
|
||||||
"invoice-#{number}.pdf"
|
"invoice-#{number}.pdf"
|
||||||
end
|
end
|
||||||
|
|
|
@ -25,9 +25,12 @@
|
||||||
%dt= t(:payment_term)
|
%dt= t(:payment_term)
|
||||||
%dd= t(@invoice.payment_term)
|
%dd= t(@invoice.payment_term)
|
||||||
|
|
||||||
|
%dt= t(:"invoice no")
|
||||||
|
%dd= @invoice.number
|
||||||
|
|
||||||
|
- if @invoice.description.present?
|
||||||
%dt= t(:description)
|
%dt= t(:description)
|
||||||
- @invoice.description.prepend(' - ') if @invoice.description.present?
|
%dd=@invoice.description
|
||||||
%dd= "#{t('invoice_no', no: @invoice.number)}#{@invoice.description}"
|
|
||||||
|
|
||||||
%dt= t(:reference_no)
|
%dt= t(:reference_no)
|
||||||
%dd= @invoice.reference_no
|
%dd= @invoice.reference_no
|
||||||
|
|
|
@ -175,9 +175,12 @@
|
||||||
%dt= t(:payment_term)
|
%dt= t(:payment_term)
|
||||||
%dd= t(@invoice.payment_term)
|
%dd= t(@invoice.payment_term)
|
||||||
|
|
||||||
|
%dt= t(:"invoice no")
|
||||||
|
%dd= @invoice.number
|
||||||
|
|
||||||
|
- if @invoice.description.present?
|
||||||
%dt= t(:description)
|
%dt= t(:description)
|
||||||
- @invoice.description.prepend(' - ') if @invoice.description.present?
|
%dd=@invoice.description
|
||||||
%dd= "#{t('invoice_no', no: @invoice.number)}#{@invoice.description}"
|
|
||||||
|
|
||||||
%dt= t(:reference_no)
|
%dt= t(:reference_no)
|
||||||
%dd= @invoice.reference_no
|
%dd= @invoice.reference_no
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue