Rename registrar "directo_handle" to "accounting_customer_code"

#343
This commit is contained in:
Artur Beljajev 2017-10-25 18:33:11 +03:00
parent bdb1090a40
commit ff9372baea
5 changed files with 11 additions and 5 deletions

View file

@ -29,7 +29,7 @@ class Directo < ActiveRecord::Base
"InvoiceDate" => invoice.created_at.strftime("%Y-%m-%dT%H:%M:%S"),
"PaymentTerm" => Setting.directo_receipt_payment_term,
"Currency" => invoice.currency,
"CustomerCode"=> invoice.buyer.try(:directo_handle)
"CustomerCode"=> invoice.buyer.accounting_customer_code
){
xml.line(
"ProductID" => Setting.directo_receipt_product_name,
@ -150,7 +150,7 @@ class Directo < ActiveRecord::Base
xml.invoice("Number" =>directo_next,
"InvoiceDate" =>invoices_until.strftime(date_format),
"PaymentTerm" =>Setting.directo_receipt_payment_term,
"CustomerCode"=>registrar.directo_handle,
"CustomerCode"=>registrar.accounting_customer_code,
"Language" =>"",
"Currency" =>registrar_activities.first.currency,
"SalesAgent" =>Setting.directo_sales_agent){

View file

@ -0,0 +1,5 @@
class RenameRegistrarDirectoHandleToAccountingCustomerCode < ActiveRecord::Migration
def change
rename_column :registrars, :directo_handle, :accounting_customer_code
end
end

View file

@ -2473,7 +2473,7 @@ CREATE TABLE registrars (
zip character varying,
code character varying,
website character varying,
directo_handle character varying,
accounting_customer_code character varying,
vat boolean,
legacy_id integer,
reference_no character varying,
@ -5053,3 +5053,5 @@ INSERT INTO schema_migrations (version) VALUES ('20171009082321');
INSERT INTO schema_migrations (version) VALUES ('20171025110933');
INSERT INTO schema_migrations (version) VALUES ('20171025113808');

View file

@ -1581,7 +1581,6 @@
<text text-anchor="start" x="1600.5" y="-2399.3" font-family="Times,serif" font-size="14.00">zip :string</text>
<text text-anchor="start" x="1600.5" y="-2384.3" font-family="Times,serif" font-size="14.00">code :string</text>
<text text-anchor="start" x="1600.5" y="-2369.3" font-family="Times,serif" font-size="14.00">url :string</text>
<text text-anchor="start" x="1600.5" y="-2354.3" font-family="Times,serif" font-size="14.00">directo_handle :string</text>
<text text-anchor="start" x="1600.5" y="-2339.3" font-family="Times,serif" font-size="14.00">vat :boolean</text>
<text text-anchor="start" x="1600.5" y="-2324.3" font-family="Times,serif" font-size="14.00">legacy_id :integer</text>
<text text-anchor="start" x="1600.5" y="-2309.3" font-family="Times,serif" font-size="14.00">reference_no :string</text>

Before

Width:  |  Height:  |  Size: 234 KiB

After

Width:  |  Height:  |  Size: 234 KiB

Before After
Before After

View file

@ -87,7 +87,7 @@ namespace :import do
street: x.street1.try(:strip),
zip: x.postalcode.try(:strip),
url: x.url.try(:strip),
directo_handle: x.directo_handle.try(:strip),
accounting_customer_code: x.directo_handle.try(:strip),
vat: x.vat,
legacy_id: x.id,
creator_str: user,