Support importing VAT number with client CSV

This commit is contained in:
Hillel Coren 2016-11-01 13:19:35 +02:00
parent 5d2e9568d7
commit e677569351
2 changed files with 7 additions and 0 deletions

View File

@ -89,6 +89,10 @@ class Client extends EntityModel
* @var string * @var string
*/ */
public static $fieldWebsite = 'website'; public static $fieldWebsite = 'website';
/**
* @var string
*/
public static $fieldVatNumber = 'vat_number';
/** /**
* @return array * @return array
@ -106,6 +110,7 @@ class Client extends EntityModel
Client::$fieldCountry, Client::$fieldCountry,
Client::$fieldNotes, Client::$fieldNotes,
Client::$fieldWebsite, Client::$fieldWebsite,
Client::$fieldVatNumber,
Contact::$fieldFirstName, Contact::$fieldFirstName,
Contact::$fieldLastName, Contact::$fieldLastName,
Contact::$fieldPhone, Contact::$fieldPhone,
@ -132,6 +137,7 @@ class Client extends EntityModel
'country' => 'country', 'country' => 'country',
'note' => 'notes', 'note' => 'notes',
'site|website' => 'website', 'site|website' => 'website',
'vat' => 'vat_number',
]; ];
} }

View File

@ -28,6 +28,7 @@ class ClientTransformer extends BaseTransformer
'postal_code' => $this->getString($data, 'postal_code'), 'postal_code' => $this->getString($data, 'postal_code'),
'private_notes' => $this->getString($data, 'notes'), 'private_notes' => $this->getString($data, 'notes'),
'website' => $this->getString($data, 'website'), 'website' => $this->getString($data, 'website'),
'vat_number' => $this->getString($data, 'vat_number'),
'contacts' => [ 'contacts' => [
[ [
'first_name' => $this->getString($data, 'first_name'), 'first_name' => $this->getString($data, 'first_name'),