invoiceId = $invoiceId; $this->moduleName = getSalesEntityType($invoiceId); $this->db = PearDatabase::getInstance(); $this->setReferenceNumber($referenceNumber); $this->setSwissPaymentInformation($invoiceId); } /** * @return bool */ public function isUseRecipientName() { return $this->useRecipientName; } /** * @param bool $useRecipientName */ public function setUseRecipientName($useRecipientName) { $this->useRecipientName = $useRecipientName; } /** * @return bool */ public function isPopulateAmount() { return $this->populateAmount; } /** * @param bool $populateAmount */ public function setPopulateAmount($populateAmount) { $this->populateAmount = $populateAmount; } /** * return whole table of Swiss QR Code by ISO 20022 * * @param int $invoiceId * @param string $referenceNumber * @param bool $useRecipientName * @return text * @parma string $referenceType * @parma string $referenceNumber */ public static function getSwissQRBill($invoiceId, $referenceNumber, $useRecipientName = false) { if (self::$instance == null) { self::$instance = new PDFMaker_SwissQRBill_Helper($invoiceId, $referenceNumber); self::$instance->setUseRecipientName($useRecipientName); } //self::getQrBill(true); //displayQrCodeWhileExporting return self::getQrBill(); } public function setReferenceNumber($value) { $this->referenceNumber = $value; } public function getReferenceNumber() { return $this->referenceNumber; } /** * return whole table of Swiss QR Code by ISO 20022 * * @param $invoiceId * @param bool $useRecipientName * * @return text */ public static function getSwissNoAmountQRBill($invoiceId, $useRecipientName = false) { if (self::$instance == null) { self::$instance = new PDFMaker_SwissQRBill_Helper($invoiceId); self::$instance->setUseRecipientName($useRecipientName); self::$instance->setPopulateAmount(false); } //self::getQrBill(true); //displayQrCodeWhileExporting return self::getQrBill(); } /** * @param bool $display * * @return string */ private static function getQrBill($display = false) { if ($display) { echo '
| ';
$tableSections .= ' ';
$tableSections .= '
| ';
$tableSections .= ' ||||||||||
';
$section .= '
|
| ' . self::getTextForTable($sectionType, $this->translateText('QR Reference'), 'head', $customStyle) . ' |
| '; $section .= self::getTextForTable($sectionType, $this->paymentData['creditor']['reference_number'], 'text'); $section .= ' |
| ' . self::getTextForTable($sectionType, $this->translateText('QR Payable by'), 'head', $customStyle) . ' |
| '; $section .= self::getTextForTable($sectionType, $this->paymentData['debtor']['name']); $streetArray = []; if ($this->paymentData['debtor']['street']) { $streetArray[] = $this->paymentData['debtor']['street']; } if ($this->paymentData['debtor']['streetNumber']) { $streetArray[] = $this->paymentData['debtor']['streetNumber']; } $section .= self::getTextForTable($sectionType, self::concatArrayToString($streetArray), 'done'); $zipArray = []; if ($this->paymentData['debtor']['zip']) { $zipArray[] = $this->paymentData['debtor']['zip']; } if ($this->paymentData['debtor']['city']) { $zipArray[] = $this->paymentData['debtor']['city']; } $section .= self::getTextForTable($sectionType, self::concatArrayToString($zipArray), 'done'); $section .= ' |