Browse Source

Hide VAT number in proforma invoice PDFs

Alan Lam 3 năm trước cách đây
mục cha
commit
6ea2237018
1 tập tin đã thay đổi với 6 bổ sung và 2 xóa
  1. 6 2
      views/document_pdf.php

+ 6 - 2
views/document_pdf.php

@@ -15,15 +15,19 @@ $background_colour = "#000000";
 $type_name = $document->getDisplayType();
 $number_title = $type_name . " #";
 $delivery_note_number = null;
+$is_proforma = false;
+$is_commercial = false;
 
 if($document->isSaleOrder()) {
 	if($variant === "commercial") {
 		$background_colour = "#2e75b6";
 		$type_name = "Commercial Invoice";
+		$is_commercial = true;
 	}
 	else {
 		$background_colour = "#92d050";
 		$type_name = "Proforma Invoice";
+		$is_proforma = true;
 	}
 
 	$delivery_note = Document::queryOne([
@@ -136,7 +140,7 @@ $is_part_of_aru = $document->isPartOfAru();
 							Company Reg. No: <?=htmlspecialchars($company->company_number)?>
 							<?php
 						}
-						if($company->vat_number) {
+						if($company->vat_number && $is_commercial) {
 							?>
 							VAT No: <?=htmlspecialchars($company->vat_number)?>
 							<?php
@@ -230,7 +234,7 @@ $is_part_of_aru = $document->isPartOfAru();
 					if($document->isSaleOrder()) {
 						$render_card("Currency", $document->currency);
 
-						if($company) {
+						if($company && $is_commercial) {
 							$render_card("VAT No.", $company->vat_number);
 						}
 					}