|
|
@@ -135,6 +135,9 @@ $controller = new class($document_type, $document_number) {
|
|
|
$document->supplier_id = $supplier->id ?? null;
|
|
|
$document->location_id = $location->id ?? null;
|
|
|
|
|
|
+ $billing_address_string = "";
|
|
|
+ $delivery_address_string = "";
|
|
|
+
|
|
|
if($location) {
|
|
|
$customer = $location->getCustomer();
|
|
|
|
|
|
@@ -198,11 +201,10 @@ $controller = new class($document_type, $document_number) {
|
|
|
}
|
|
|
|
|
|
if($document->hasCosts() && $location) {
|
|
|
- $address = $location->getAddress();
|
|
|
$document->currency = "GBP";
|
|
|
$document->tax_rate = "20.00";
|
|
|
- $document->billing_address = (string) $address;
|
|
|
- $document->delivery_address = (string) $address;
|
|
|
+ $document->billing_address = $billing_address_string;
|
|
|
+ $document->delivery_address = $delivery_address_string;
|
|
|
$document->commit();
|
|
|
}
|
|
|
|