|
@@ -169,12 +169,14 @@ $controller = new class($document_type, $document_number) {
|
|
|
$document->location_id = $location->id ?? null;
|
|
$document->location_id = $location->id ?? null;
|
|
|
|
|
|
|
|
if($location) {
|
|
if($location) {
|
|
|
|
|
+ $customer = $location->getCustomer();
|
|
|
$address = $location->getAddress();
|
|
$address = $location->getAddress();
|
|
|
$lines = array_merge([$location->name], $address->getLines());
|
|
$lines = array_merge([$location->name], $address->getLines());
|
|
|
$address_string = implode("\n", $lines);
|
|
$address_string = implode("\n", $lines);
|
|
|
|
|
|
|
|
$document->billing_address = $address_string;
|
|
$document->billing_address = $address_string;
|
|
|
$document->delivery_address = $address_string;
|
|
$document->delivery_address = $address_string;
|
|
|
|
|
+ $document->vat_number = $customer->vat_number;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
$document->type = $type;
|
|
$document->type = $type;
|
|
@@ -354,6 +356,7 @@ $controller = new class($document_type, $document_number) {
|
|
|
$document->delivery_company = $source_document->delivery_company;
|
|
$document->delivery_company = $source_document->delivery_company;
|
|
|
$document->tracking_number = $source_document->tracking_number;
|
|
$document->tracking_number = $source_document->tracking_number;
|
|
|
$document->notes = $source_document->notes;
|
|
$document->notes = $source_document->notes;
|
|
|
|
|
+ $document->vat_number = $source_document->vat_number;
|
|
|
$document->contact_name = $source_document->contact_name;
|
|
$document->contact_name = $source_document->contact_name;
|
|
|
$document->contact_phone = $source_document->contact_phone;
|
|
$document->contact_phone = $source_document->contact_phone;
|
|
|
$document->contact_email = $source_document->contact_email;
|
|
$document->contact_email = $source_document->contact_email;
|