Add post\state\city field to invoice design

This commit is contained in:
Hillel Coren 2017-01-02 13:58:51 +02:00
parent 076a458567
commit c2171e5f4f
5 changed files with 18 additions and 3 deletions

View File

@ -96,6 +96,7 @@ trait PresentsInvoice
'client.address1', 'client.address1',
'client.address2', 'client.address2',
'client.city_state_postal', 'client.city_state_postal',
'client.postal_city_state',
'client.country', 'client.country',
'client.email', 'client.email',
'client.phone', 'client.phone',
@ -114,6 +115,7 @@ trait PresentsInvoice
'account.address1', 'account.address1',
'account.address2', 'account.address2',
'account.city_state_postal', 'account.city_state_postal',
'account.postal_city_state',
'account.country', 'account.country',
'account.custom_value1', 'account.custom_value1',
'account.custom_value2', 'account.custom_value2',
@ -196,6 +198,7 @@ trait PresentsInvoice
'id_number', 'id_number',
'vat_number', 'vat_number',
'city_state_postal', 'city_state_postal',
'postal_city_state',
'country', 'country',
'email', 'email',
'contact_name', 'contact_name',

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -743,6 +743,12 @@ NINJA.renderClientOrAccountField = function(invoice, field) {
cityStatePostal = formatAddress(client.city, client.state, client.postal_code, swap); cityStatePostal = formatAddress(client.city, client.state, client.postal_code, swap);
} }
return {text:cityStatePostal}; return {text:cityStatePostal};
} else if (field == 'client.postal_city_state') {
var postalCityState = '';
if (client.city || client.state || client.postal_code) {
postalCityState = formatAddress(client.city, client.state, client.postal_code, true);
}
return {text:postalCityState};
} else if (field == 'client.country') { } else if (field == 'client.country') {
return {text:client.country ? client.country.name : ''}; return {text:client.country ? client.country.name : ''};
} else if (field == 'client.email') { } else if (field == 'client.email') {
@ -779,6 +785,12 @@ NINJA.renderClientOrAccountField = function(invoice, field) {
cityStatePostal = formatAddress(account.city, account.state, account.postal_code, swap); cityStatePostal = formatAddress(account.city, account.state, account.postal_code, swap);
} }
return {text: cityStatePostal}; return {text: cityStatePostal};
} else if (field == 'account.postal_city_state') {
var postalCityState = '';
if (account.city || account.state || account.postal_code) {
postalCityState = formatAddress(account.city, account.state, account.postal_code, true);
}
return {text: postalCityState};
} else if (field == 'account.country') { } else if (field == 'account.country') {
return account.country ? {text: account.country.name} : false; return account.country ? {text: account.country.name} : false;
} else if (field == 'account.custom_value1') { } else if (field == 'account.custom_value1') {

View File

@ -2294,7 +2294,7 @@ $LANG = array(
'switch_to_primary' => 'Switch to your primary company (:name) to manage your plan.', 'switch_to_primary' => 'Switch to your primary company (:name) to manage your plan.',
'inclusive' => 'Inclusive', 'inclusive' => 'Inclusive',
'exclusive' => 'Exclusive', 'exclusive' => 'Exclusive',
'postal_city_state' => 'Postal/City/State',
); );
return $LANG; return $LANG;