Explorar o código

Fix invoice addresses

Alan Lam %!s(int64=7) %!d(string=hai) anos
pai
achega
f9515f37c3
Modificáronse 1 ficheiros con 8 adicións e 8 borrados
  1. 8 8
      controllers/project_invoice.php

+ 8 - 8
controllers/project_invoice.php

@@ -60,14 +60,14 @@ $reference =
 $download_filename = str_replace("/", "_", $reference) . " - " . $project->name . " - Invoice.pdf";
 
 // Initialise for PDF generation
-$bill_to_address_parts = explode("\n", ADDRESS);
-
-$bill_from_address_parts = [
-	"8 Market Street",
-	"Liskeard",
-	"Cornwall",
-	"PL14 3JJ",
-];
+$bill_to_address_parts = array_filter([
+	$customer->address_1,
+	$customer->address_2,
+	$customer->city,
+	implode(", ", array_filter([$customer->county, $customer->postal_code])),
+]);
+
+$bill_from_address_parts = explode("\n", ADDRESS);
 
 // A4 size: 210x297mm
 $mpdf = new Mpdf();