From a650228ebb7311531955a3b7d1fc3fe0d4a653ef Mon Sep 17 00:00:00 2001 From: Samuel Szabo Date: Fri, 1 Dec 2017 09:54:07 +0100 Subject: [PATCH 1/2] PPL Zpl labels --- src/Exception/NotImplementedException.php | 13 + src/ILabel.php | 41 +++ src/Label.php | 333 +--------------------- src/Model/IPackage.php | 5 + src/Model/IPackageService.php | 6 + src/Model/Package.php | 24 ++ src/Model/PackageService.php | 14 + src/PdfLabel.php | 318 +++++++++++++++++++++ src/ZplLabel.php | 172 +++++++++++ test/PublicTest.php | 32 ++- 10 files changed, 630 insertions(+), 328 deletions(-) create mode 100644 src/Exception/NotImplementedException.php create mode 100644 src/ILabel.php create mode 100644 src/PdfLabel.php create mode 100644 src/ZplLabel.php diff --git a/src/Exception/NotImplementedException.php b/src/Exception/NotImplementedException.php new file mode 100644 index 0000000..ab9c6f1 --- /dev/null +++ b/src/Exception/NotImplementedException.php @@ -0,0 +1,13 @@ +. + * User: Martinus - Samuel Szabo + * Date: 24.11.2017 */ namespace Salamek\PplMyApi; - -use Salamek\PplMyApi\Enum\LabelDecomposition; -use Salamek\PplMyApi\Enum\LabelPosition; -use Salamek\PplMyApi\Enum\PackageService; -use Salamek\PplMyApi\Enum\Product; -use Salamek\PplMyApi\Exception\WrongDataException; -use Salamek\PplMyApi\Model\IPackage; -use Salamek\PplMyApi\Model\Package; - -class Label +/** + * Class Label + * + * @package Salamek\PplMyApi + * + * @deprecated Use PdfLabel class instead for PDF labels, or ZplLabel for ZPL labels + */ +class Label extends PdfLabel { - /** - * @param IPackage[] $packages - * @param int $decomposition - * @return string - * @throws \Exception - */ - public static function generateLabels(array $packages, $decomposition = LabelDecomposition::FULL) - { - if (!in_array($decomposition, LabelDecomposition::$list)) { - throw new WrongDataException(sprintf('unknown $decomposition only %s are allowed', implode(', ', LabelDecomposition::$list))); - } - - $packageNumbers = []; - - /** @var IPackage $package */ - foreach ($packages AS $package) { - $packageNumbers[] = $package->getPackageNumber(); - } - - $pdf = new \TCPDF('L', PDF_UNIT, 'A4', true, 'UTF-8', false); - $pdf->SetCreator(PDF_CREATOR); - $pdf->SetAuthor('Adam Schubert'); - $pdf->SetTitle(sprintf('Professional Parcel Logistic Label %s', implode(', ', $packageNumbers))); - $pdf->SetSubject(sprintf('Professional Parcel Logistic Label %s', implode(', ', $packageNumbers))); - $pdf->SetKeywords('Professional Parcel Logistic'); - $pdf->SetFont('freeserif'); - $pdf->setFontSubsetting(true); - $pdf->setPrintHeader(false); - $pdf->setPrintFooter(false); - - - $quarterPosition = LabelPosition::TOP_LEFT; - /** @var Package $package */ - foreach ($packages AS $package) { - switch ($decomposition) { - case LabelDecomposition::FULL: - $pdf->AddPage(); - $pdf = self::generateLabelFull($pdf, $package); - break; - - case LabelDecomposition::QUARTER: - if ($quarterPosition > LabelPosition::BOTTOM_RIGHT) { - $quarterPosition = LabelPosition::TOP_LEFT; - } - - if ($quarterPosition == LabelPosition::TOP_LEFT) { - $pdf->AddPage(); - } - - $pdf = self::generateLabelQuarter($pdf, $package, $quarterPosition); - $quarterPosition++; - break; - } - } - - return $pdf->Output(null, 'S'); - } - - /** - * @param \TCPDF $pdf - * @param IPackage $package - * @return \TCPDF - */ - public static function generateLabelFull(\TCPDF $pdf, IPackage $package) - { - $x = 17; - $pdf->Image(__DIR__ . '/../assets/logo.png', $x, 10, 66, '', 'PNG'); - - //Contact info - $contactInfoY = 45; - $pdf->SetFont($pdf->getFontFamily(), '', 20); - $pdf->Text($x, $contactInfoY, 'Modrá linka: 844 775 775'); - $pdf->Text($x, $contactInfoY + 10, 'E-mail: info@ppl.cz'); - $pdf->Text($x, $contactInfoY + 20, 'https://www.ppl.cz'); - - - //Barcode - $pdf->StartTransform(); - $x = 78; //65 - $y = 85; //110 - $pdf->Rotate(270, $x, $y); - $pdf->write1DBarcode($package->getPackageNumber(), 'I25+', $x, $y, 80, 60, 0.3, ['stretch' => true]); - - // Stop Transformation - $pdf->StopTransform(); - - //Barcode number - $pdf->StartTransform(); - - $x = 90; - $y = 84; - $pdf->Rotate(270, $x, $y); - $pdf->SetFont($pdf->getFontFamily(), '', 23); - $pdf->Text($x, $y, $package->getPackageNumber()); - // Stop Transformation - $pdf->StopTransform(); - - // PackagePosition of PackageCount - $pdf->SetFont($pdf->getFontFamily(), 'B', 27); - $pdf->MultiCell(40, 0, sprintf('%s/%s', $package->getPackagePosition(), $package->getPackageCount()), ['LTRB' => ['width' => 1]], 'C', 0, 0, 244, 175, true, 0, false, true, 0); - - // Dobirka - if (in_array($package->getPackageProductType(), Product::$cashOnDelivery)) { - $pdf->SetFont($pdf->getFontFamily(), 'B', 27); - $pdf->SetTextColor(255, 255, 255); - $pdf->SetFillColor(0, 0, 0); - $pdf->MultiCell(30, 0, 'DOB.:', ['LTRB' => ['width' => 0.7]], 'L', true, 0, 19, 175, true, 0, false, true, 0); - $pdf->MultiCell(60, 0, sprintf('%s %s', $package->getPaymentInfo()->getCashOnDeliveryPrice(), $package->getPaymentInfo()->getCashOnDeliveryCurrency()), ['LTRB' => ['width' => 0.7]], 'R', - true, 0, 45, 175, true, 0, false, true, 0); - $pdf->SetTextColor(0, 0, 0); - $pdf->SetFillColor(255, 255, 255); - } - - - //Prijemce - $pdf->SetFont($pdf->getFontFamily(), '', 25); - - $pdf->Text(110, 9, 'Příjemce:'); - - $x = 120; - $y = 25; - if ($package->getRecipient()->getName()) { - $pdf->Text($x, $y, $package->getRecipient()->getName()); - } - - $pdf->Text($x, $y + 10, $package->getRecipient()->getContact()); - $pdf->Text($x, $y + 20, $package->getRecipient()->getStreet()); - $pdf->Text($x, $y + 30, sprintf('%s, %s', $package->getRecipient()->getCity(), $package->getRecipient()->getCountry())); - - $pdf->SetFont($pdf->getFontFamily(), 'B', 55); - $pdf->Text($x, $y + 40, $package->getRecipient()->getZipCode()); - - $pdf->SetFont($pdf->getFontFamily(), '', 25); - $pdf->Text($x, $y + 63, sprintf('Tel.: %s', $package->getRecipient()->getPhone())); - - $pdf->MultiCell(173, 80, '', ['LTRB' => ['width' => 1]], 'L', 0, 0, 112, 21, true, 0, false, true, 0); - $pdf->SetFont($pdf->getFontFamily(), 'B', 60); - $pdf->SetTextColor(255, 255, 255); - $pdf->SetFillColor(0, 0, 0); - $pdf->MultiCell(60, 15, (in_array(PackageService::EVENING_DELIVERY, self::packageServicesToArray($package)) ? 'Večer' : 'Den'), ['LTRB' => ['width' => 1]], 'C', true, 0, 224, 73, true, 0, - false, true, 0); - $pdf->SetTextColor(0, 0, 0); - $pdf->SetFillColor(255, 255, 255); - - //Sender - $pdf->SetFont($pdf->getFontFamily(), '', 25); - $pdf->Text(112, 105, 'Odesílatel:'); - - $x = 120; - $y = 120; - $pdf->Text($x, $y, $package->getSender()->getName()); - - $pdf->Text($x, $y + 10, $package->getSender()->getName2()); - - $pdf->Text($x, $y + 20, $package->getSender()->getStreet()); - - $pdf->Text($x, $y + 30, sprintf('%s %s %s', $package->getSender()->getZipCode(), $package->getSender()->getCity(), $package->getSender()->getCountry())); - - $pdf->MultiCell(173, 48, '', ['LTRB' => ['width' => 1]], 'L', 0, 0, 112, 117, true, 0, false, true, 0); - - return $pdf; - } - - /** - * @param \TCPDF $pdf - * @param IPackage $package - * @param int $position - * @return \TCPDF - * @throws \Exception - */ - public static function generateLabelQuarter(\TCPDF $pdf, IPackage $package, $position = LabelPosition::TOP_LEFT) - { - if (!in_array($position, [1, 2, 3, 4])) { - throw new \Exception('Unknow position'); - } - - switch ($position) { - default: - case LabelPosition::TOP_LEFT: - $xPositionOffset = 0; - $yPositionOffset = 0; - break; - - case LabelPosition::TOP_RIGHT: - $xPositionOffset = 150; - $yPositionOffset = 0; - break; - - case LabelPosition::BOTTOM_LEFT: - $xPositionOffset = 0; - $yPositionOffset = 98; - break; - - case LabelPosition::BOTTOM_RIGHT: - $xPositionOffset = 150; - $yPositionOffset = 98; - break; - } - - //Logo - $pdf->Image(__DIR__ . '/../assets/logo.png', 3 + $xPositionOffset, 3 + $yPositionOffset, 34, '', 'PNG'); - - //Contact info - $pdf->SetFont($pdf->getFontFamily(), '', 9); - $pdf->Text(3 + $xPositionOffset, 20 + $yPositionOffset, 'Modrá linka: 844 775 775'); - $pdf->Text(3 + $xPositionOffset, 25 + $yPositionOffset, 'E-mail: info@ppl.cz'); - $pdf->Text(3 + $xPositionOffset, 30 + $yPositionOffset, 'https://www.ppl.cz'); - - - //Barcode - $pdf->StartTransform(); - $x = 34 + $xPositionOffset; - $y = 40 + $yPositionOffset; - $pdf->Rotate(270, $x, $y); - $pdf->write1DBarcode($package->getPackageNumber(), 'I25+', $x, $y, 40, 30, 0.3, ['stretch' => true]); - - // Stop Transformation - $pdf->StopTransform(); - - //Barcode number - $pdf->StartTransform(); - - $x = 40 + $xPositionOffset; - $y = 39 + $yPositionOffset; - $pdf->Rotate(270, $x, $y); - $pdf->SetFont($pdf->getFontFamily(), '', 13); - $pdf->Text($x, $y, $package->getPackageNumber()); - // Stop Transformation - $pdf->StopTransform(); - - // PackagePosition of PackageCount - $pdf->SetFont($pdf->getFontFamily(), 'B', 13); - $pdf->MultiCell(20, 0, sprintf('%s/%s', $package->getPackagePosition(), $package->getPackageCount()), ['LTRB' => ['width' => 0.7]], 'C', 0, 0, 116 + $xPositionOffset, 85 + $yPositionOffset, - true, 0, false, true, 0); - - // Dobirka - if (in_array($package->getPackageProductType(), Product::$cashOnDelivery)) { - $pdf->SetFont($pdf->getFontFamily(), 'B', 13); - $pdf->SetTextColor(255, 255, 255); - $pdf->SetFillColor(0, 0, 0); - $pdf->MultiCell(15, 0, 'DOB.:', ['LTRB' => ['width' => 0.7]], 'L', true, 0, 4 + $xPositionOffset, 85 + $yPositionOffset, true, 0, false, true, 0); - $pdf->MultiCell(28, 0, sprintf('%s %s', $package->getPaymentInfo()->getCashOnDeliveryPrice(), $package->getPaymentInfo()->getCashOnDeliveryCurrency()), ['LTRB' => ['width' => 0.7]], 'R', - true, 0, 19 + $xPositionOffset, 85 + $yPositionOffset, true, 0, false, true, 0); - $pdf->SetTextColor(0, 0, 0); - $pdf->SetFillColor(255, 255, 255); - } - - //Prijemce - $pdf->SetFont($pdf->getFontFamily(), '', 12); - $pdf->Text(50 + $xPositionOffset, 3 + $yPositionOffset, 'Příjemce:'); - - $x = 53 + $xPositionOffset; - $y = 10 + $yPositionOffset; - if ($package->getRecipient()->getName()) { - $pdf->Text($x, $y, $package->getRecipient()->getName()); - } - - $pdf->Text($x, $y + 5, $package->getRecipient()->getContact()); - $pdf->Text($x, $y + 10, $package->getRecipient()->getStreet()); - $pdf->Text($x, $y + 15, sprintf('%s, %s', $package->getRecipient()->getCity(), $package->getRecipient()->getCountry())); - - $pdf->SetFont($pdf->getFontFamily(), 'B', 27); - $pdf->Text($x, $y + 20, $package->getRecipient()->getZipCode()); - - $pdf->SetFont($pdf->getFontFamily(), '', 10); - $pdf->Text($x, $y + 33, sprintf('Tel.: %s', $package->getRecipient()->getPhone())); - - $pdf->MultiCell(85, 40, '', ['LTRB' => ['width' => 0.7]], 'L', 0, 0, 51 + $xPositionOffset, 9 + $yPositionOffset, true, 0, false, true, 0); - $pdf->SetFont($pdf->getFontFamily(), 'B', 30); - $pdf->SetTextColor(255, 255, 255); - $pdf->SetFillColor(0, 0, 0); - $pdf->MultiCell(30, 15, (in_array(PackageService::EVENING_DELIVERY, self::packageServicesToArray($package)) ? 'Večer' : 'Den'), ['LTRB' => ['width' => 0.7]], 'C', true, 0, - 106 + $xPositionOffset, 34 + $yPositionOffset, true, 0, false, true, 0); - $pdf->SetTextColor(0, 0, 0); - $pdf->SetFillColor(255, 255, 255); - - //Sender - $pdf->SetFont($pdf->getFontFamily(), '', 12); - $pdf->Text(50 + $xPositionOffset, 51 + $yPositionOffset, 'Odesílatel:'); - - $x = 53 + $xPositionOffset; - $y = 58 + $yPositionOffset; - $pdf->SetFont($pdf->getFontFamily(), '', 10); - $pdf->Text($x, $y, $package->getSender()->getName()); - - $pdf->SetFont($pdf->getFontFamily(), '', 10); - $pdf->Text($x, $y + 5, $package->getSender()->getName2()); - - $pdf->SetFont($pdf->getFontFamily(), '', 10); - $pdf->Text($x, $y + 10, $package->getSender()->getStreet()); - - $pdf->SetFont($pdf->getFontFamily(), '', 10); - $pdf->Text($x, $y + 15, sprintf('%s %s %s', $package->getSender()->getZipCode(), $package->getSender()->getCity(), $package->getSender()->getCountry())); - - $pdf->SetFont($pdf->getFontFamily(), 'B', 13); - $pdf->MultiCell(85, 23, '', ['LTRB' => ['width' => 0.7]], 'L', 0, 0, 51 + $xPositionOffset, 57 + $yPositionOffset, true, 0, false, true, 0); - - return $pdf; - } - - /** - * @param IPackage $package - * @return array - */ - private static function packageServicesToArray(IPackage $package) - { - $return = []; - foreach ($package->getPackageServices() AS $packageService) { - $return[] = $packageService->getSvcCode(); - } - return $return; - } } \ No newline at end of file diff --git a/src/Model/IPackage.php b/src/Model/IPackage.php index 211eba7..8b3f245 100644 --- a/src/Model/IPackage.php +++ b/src/Model/IPackage.php @@ -102,6 +102,11 @@ public function setPackagePosition($packagePosition); */ public function getPackageNumber(); + /** + * @return int + */ + public function getPackageNumberChecksum(); + /** * @return int */ diff --git a/src/Model/IPackageService.php b/src/Model/IPackageService.php index e59389a..26c006d 100644 --- a/src/Model/IPackageService.php +++ b/src/Model/IPackageService.php @@ -24,4 +24,10 @@ public function setSvcCode($svcCode); * @return string */ public function getSvcCode(); + + /** + * @param IPackage $package + * @return array + */ + public static function packageServicesToArray(IPackage $package); } \ No newline at end of file diff --git a/src/Model/Package.php b/src/Model/Package.php index 16eec6c..ff24798 100644 --- a/src/Model/Package.php +++ b/src/Model/Package.php @@ -323,6 +323,30 @@ public function getPackageNumber() return $this->packageNumber; } + /** + * @return string + */ + public function getPackageNumberChecksum() + { + $checksum = null; + $odd = 0; + $even = 0; + for ($i = 0; $i < strlen($this->packageNumber); $i++) { + $n = substr($this->packageNumber, $i, 1); + if (!($i % 2)) { + $odd += $n; + } else { + $even += $n; + } + } + $odd *= 3; + $odd += $even; + $checksum = 10 - substr($odd, -1); + if ($checksum == 10) $checksum = 0; + return $checksum; + + } + /** * @return int */ diff --git a/src/Model/PackageService.php b/src/Model/PackageService.php index 943c37e..d081dab 100644 --- a/src/Model/PackageService.php +++ b/src/Model/PackageService.php @@ -43,4 +43,18 @@ public function getSvcCode() { return $this->svcCode; } + + /** + * @param IPackage $package + * @return array + */ + public static function packageServicesToArray(IPackage $package) + { + $return = []; + foreach ($package->getPackageServices() AS $packageService) { + $return[] = $packageService->getSvcCode(); + } + + return $return; + } } \ No newline at end of file diff --git a/src/PdfLabel.php b/src/PdfLabel.php new file mode 100644 index 0000000..8779564 --- /dev/null +++ b/src/PdfLabel.php @@ -0,0 +1,318 @@ +. + */ + +namespace Salamek\PplMyApi; + + +use Salamek\PplMyApi\Enum\LabelDecomposition; +use Salamek\PplMyApi\Enum\LabelPosition; +use Salamek\PplMyApi\Enum\PackageService; +use Salamek\PplMyApi\Enum\Product; +use Salamek\PplMyApi\Exception\WrongDataException; +use Salamek\PplMyApi\Model\IPackage; +use Salamek\PplMyApi\Model\Package; + +class PdfLabel implements ILabel +{ + /** + * @param IPackage[] $packages + * @param int $decomposition + * @return string + * @throws \Exception + */ + public static function generateLabels(array $packages, $decomposition = LabelDecomposition::FULL) + { + if (!in_array($decomposition, LabelDecomposition::$list)) { + throw new WrongDataException(sprintf('unknown $decomposition only %s are allowed', implode(', ', LabelDecomposition::$list))); + } + + $packageNumbers = []; + + /** @var IPackage $package */ + foreach ($packages AS $package) { + $packageNumbers[] = $package->getPackageNumber(); + } + + $pdf = new \TCPDF('L', PDF_UNIT, 'A4', true, 'UTF-8', false); + $pdf->SetCreator(PDF_CREATOR); + $pdf->SetAuthor('Adam Schubert'); + $pdf->SetTitle(sprintf('Professional Parcel Logistic Label %s', implode(', ', $packageNumbers))); + $pdf->SetSubject(sprintf('Professional Parcel Logistic Label %s', implode(', ', $packageNumbers))); + $pdf->SetKeywords('Professional Parcel Logistic'); + $pdf->SetFont('freeserif'); + $pdf->setFontSubsetting(true); + $pdf->setPrintHeader(false); + $pdf->setPrintFooter(false); + + + $quarterPosition = LabelPosition::TOP_LEFT; + /** @var Package $package */ + foreach ($packages AS $package) { + switch ($decomposition) { + case LabelDecomposition::FULL: + $pdf->AddPage(); + $pdf = self::generateLabelFull($pdf, $package); + break; + + case LabelDecomposition::QUARTER: + if ($quarterPosition > LabelPosition::BOTTOM_RIGHT) { + $quarterPosition = LabelPosition::TOP_LEFT; + } + + if ($quarterPosition == LabelPosition::TOP_LEFT) { + $pdf->AddPage(); + } + + $pdf = self::generateLabelQuarter($pdf, $package, $quarterPosition); + $quarterPosition++; + break; + } + } + + return $pdf->Output(null, 'S'); + } + + /** + * @param \TCPDF $pdf + * @param IPackage $package + * @return \TCPDF + */ + public static function generateLabelFull(\TCPDF $pdf, IPackage $package) + { + $x = 17; + $pdf->Image(__DIR__ . '/../assets/logo.png', $x, 10, 66, '', 'PNG'); + + //Contact info + $contactInfoY = 45; + $pdf->SetFont($pdf->getFontFamily(), '', 20); + $pdf->Text($x, $contactInfoY, 'Modrá linka: 844 775 775'); + $pdf->Text($x, $contactInfoY + 10, 'E-mail: info@ppl.cz'); + $pdf->Text($x, $contactInfoY + 20, 'https://www.ppl.cz'); + + + //Barcode + $pdf->StartTransform(); + $x = 78; //65 + $y = 85; //110 + $pdf->Rotate(270, $x, $y); + $pdf->write1DBarcode($package->getPackageNumber(), 'I25+', $x, $y, 80, 60, 0.3, ['stretch' => true]); + + // Stop Transformation + $pdf->StopTransform(); + + //Barcode number + $pdf->StartTransform(); + + $x = 90; + $y = 84; + $pdf->Rotate(270, $x, $y); + $pdf->SetFont($pdf->getFontFamily(), '', 23); + $pdf->Text($x, $y, $package->getPackageNumber()); + // Stop Transformation + $pdf->StopTransform(); + + // PackagePosition of PackageCount + $pdf->SetFont($pdf->getFontFamily(), 'B', 27); + $pdf->MultiCell(40, 0, sprintf('%s/%s', $package->getPackagePosition(), $package->getPackageCount()), ['LTRB' => ['width' => 1]], 'C', 0, 0, 244, 175, true, 0, false, true, 0); + + // Dobirka + if (in_array($package->getPackageProductType(), Product::$cashOnDelivery)) { + $pdf->SetFont($pdf->getFontFamily(), 'B', 27); + $pdf->SetTextColor(255, 255, 255); + $pdf->SetFillColor(0, 0, 0); + $pdf->MultiCell(30, 0, 'DOB.:', ['LTRB' => ['width' => 0.7]], 'L', true, 0, 19, 175, true, 0, false, true, 0); + $pdf->MultiCell(60, 0, sprintf('%s %s', $package->getPaymentInfo()->getCashOnDeliveryPrice(), $package->getPaymentInfo()->getCashOnDeliveryCurrency()), ['LTRB' => ['width' => 0.7]], 'R', + true, 0, 45, 175, true, 0, false, true, 0); + $pdf->SetTextColor(0, 0, 0); + $pdf->SetFillColor(255, 255, 255); + } + + + //Prijemce + $pdf->SetFont($pdf->getFontFamily(), '', 25); + + $pdf->Text(110, 9, 'Příjemce:'); + + $x = 120; + $y = 25; + if ($package->getRecipient()->getName()) { + $pdf->Text($x, $y, $package->getRecipient()->getName()); + } + + $pdf->Text($x, $y + 10, $package->getRecipient()->getContact()); + $pdf->Text($x, $y + 20, $package->getRecipient()->getStreet()); + $pdf->Text($x, $y + 30, sprintf('%s, %s', $package->getRecipient()->getCity(), $package->getRecipient()->getCountry())); + + $pdf->SetFont($pdf->getFontFamily(), 'B', 55); + $pdf->Text($x, $y + 40, $package->getRecipient()->getZipCode()); + + $pdf->SetFont($pdf->getFontFamily(), '', 25); + $pdf->Text($x, $y + 63, sprintf('Tel.: %s', $package->getRecipient()->getPhone())); + + $pdf->MultiCell(173, 80, '', ['LTRB' => ['width' => 1]], 'L', 0, 0, 112, 21, true, 0, false, true, 0); + $pdf->SetFont($pdf->getFontFamily(), 'B', 60); + $pdf->SetTextColor(255, 255, 255); + $pdf->SetFillColor(0, 0, 0); + $pdf->MultiCell(60, 15, (in_array(PackageService::EVENING_DELIVERY, \Salamek\PplMyApi\Model\PackageService::packageServicesToArray($package)) ? 'Večer' : 'Den'), ['LTRB' => ['width' => 1]], 'C', true, 0, 224, 73, true, 0, + false, true, 0); + $pdf->SetTextColor(0, 0, 0); + $pdf->SetFillColor(255, 255, 255); + + //Sender + $pdf->SetFont($pdf->getFontFamily(), '', 25); + $pdf->Text(112, 105, 'Odesílatel:'); + + $x = 120; + $y = 120; + $pdf->Text($x, $y, $package->getSender()->getName()); + + $pdf->Text($x, $y + 10, $package->getSender()->getName2()); + + $pdf->Text($x, $y + 20, $package->getSender()->getStreet()); + + $pdf->Text($x, $y + 30, sprintf('%s %s %s', $package->getSender()->getZipCode(), $package->getSender()->getCity(), $package->getSender()->getCountry())); + + $pdf->MultiCell(173, 48, '', ['LTRB' => ['width' => 1]], 'L', 0, 0, 112, 117, true, 0, false, true, 0); + + return $pdf; + } + + /** + * @param \TCPDF $pdf + * @param IPackage $package + * @param int $position + * @return \TCPDF + * @throws \Exception + */ + public static function generateLabelQuarter(\TCPDF $pdf, IPackage $package, $position = LabelPosition::TOP_LEFT) + { + if (!in_array($position, [1, 2, 3, 4])) { + throw new \Exception('Unknow position'); + } + + switch ($position) { + default: + case LabelPosition::TOP_LEFT: + $xPositionOffset = 0; + $yPositionOffset = 0; + break; + + case LabelPosition::TOP_RIGHT: + $xPositionOffset = 150; + $yPositionOffset = 0; + break; + + case LabelPosition::BOTTOM_LEFT: + $xPositionOffset = 0; + $yPositionOffset = 98; + break; + + case LabelPosition::BOTTOM_RIGHT: + $xPositionOffset = 150; + $yPositionOffset = 98; + break; + } + + //Logo + $pdf->Image(__DIR__ . '/../assets/logo.png', 3 + $xPositionOffset, 3 + $yPositionOffset, 34, '', 'PNG'); + + //Contact info + $pdf->SetFont($pdf->getFontFamily(), '', 9); + $pdf->Text(3 + $xPositionOffset, 20 + $yPositionOffset, 'Modrá linka: 844 775 775'); + $pdf->Text(3 + $xPositionOffset, 25 + $yPositionOffset, 'E-mail: info@ppl.cz'); + $pdf->Text(3 + $xPositionOffset, 30 + $yPositionOffset, 'https://www.ppl.cz'); + + + //Barcode + $pdf->StartTransform(); + $x = 34 + $xPositionOffset; + $y = 40 + $yPositionOffset; + $pdf->Rotate(270, $x, $y); + $pdf->write1DBarcode($package->getPackageNumber(), 'I25+', $x, $y, 40, 30, 0.3, ['stretch' => true]); + + // Stop Transformation + $pdf->StopTransform(); + + //Barcode number + $pdf->StartTransform(); + + $x = 40 + $xPositionOffset; + $y = 39 + $yPositionOffset; + $pdf->Rotate(270, $x, $y); + $pdf->SetFont($pdf->getFontFamily(), '', 13); + $pdf->Text($x, $y, $package->getPackageNumber()); + // Stop Transformation + $pdf->StopTransform(); + + // PackagePosition of PackageCount + $pdf->SetFont($pdf->getFontFamily(), 'B', 13); + $pdf->MultiCell(20, 0, sprintf('%s/%s', $package->getPackagePosition(), $package->getPackageCount()), ['LTRB' => ['width' => 0.7]], 'C', 0, 0, 116 + $xPositionOffset, 85 + $yPositionOffset, + true, 0, false, true, 0); + + // Dobirka + if (in_array($package->getPackageProductType(), Product::$cashOnDelivery)) { + $pdf->SetFont($pdf->getFontFamily(), 'B', 13); + $pdf->SetTextColor(255, 255, 255); + $pdf->SetFillColor(0, 0, 0); + $pdf->MultiCell(15, 0, 'DOB.:', ['LTRB' => ['width' => 0.7]], 'L', true, 0, 4 + $xPositionOffset, 85 + $yPositionOffset, true, 0, false, true, 0); + $pdf->MultiCell(28, 0, sprintf('%s %s', $package->getPaymentInfo()->getCashOnDeliveryPrice(), $package->getPaymentInfo()->getCashOnDeliveryCurrency()), ['LTRB' => ['width' => 0.7]], 'R', + true, 0, 19 + $xPositionOffset, 85 + $yPositionOffset, true, 0, false, true, 0); + $pdf->SetTextColor(0, 0, 0); + $pdf->SetFillColor(255, 255, 255); + } + + //Prijemce + $pdf->SetFont($pdf->getFontFamily(), '', 12); + $pdf->Text(50 + $xPositionOffset, 3 + $yPositionOffset, 'Příjemce:'); + + $x = 53 + $xPositionOffset; + $y = 10 + $yPositionOffset; + if ($package->getRecipient()->getName()) { + $pdf->Text($x, $y, $package->getRecipient()->getName()); + } + + $pdf->Text($x, $y + 5, $package->getRecipient()->getContact()); + $pdf->Text($x, $y + 10, $package->getRecipient()->getStreet()); + $pdf->Text($x, $y + 15, sprintf('%s, %s', $package->getRecipient()->getCity(), $package->getRecipient()->getCountry())); + + $pdf->SetFont($pdf->getFontFamily(), 'B', 27); + $pdf->Text($x, $y + 20, $package->getRecipient()->getZipCode()); + + $pdf->SetFont($pdf->getFontFamily(), '', 10); + $pdf->Text($x, $y + 33, sprintf('Tel.: %s', $package->getRecipient()->getPhone())); + + $pdf->MultiCell(85, 40, '', ['LTRB' => ['width' => 0.7]], 'L', 0, 0, 51 + $xPositionOffset, 9 + $yPositionOffset, true, 0, false, true, 0); + $pdf->SetFont($pdf->getFontFamily(), 'B', 30); + $pdf->SetTextColor(255, 255, 255); + $pdf->SetFillColor(0, 0, 0); + $pdf->MultiCell(30, 15, (in_array(PackageService::EVENING_DELIVERY, \Salamek\PplMyApi\Model\PackageService::packageServicesToArray($package)) ? 'Večer' : 'Den'), ['LTRB' => ['width' => 0.7]], 'C', true, 0, + 106 + $xPositionOffset, 34 + $yPositionOffset, true, 0, false, true, 0); + $pdf->SetTextColor(0, 0, 0); + $pdf->SetFillColor(255, 255, 255); + + //Sender + $pdf->SetFont($pdf->getFontFamily(), '', 12); + $pdf->Text(50 + $xPositionOffset, 51 + $yPositionOffset, 'Odesílatel:'); + + $x = 53 + $xPositionOffset; + $y = 58 + $yPositionOffset; + $pdf->SetFont($pdf->getFontFamily(), '', 10); + $pdf->Text($x, $y, $package->getSender()->getName()); + + $pdf->SetFont($pdf->getFontFamily(), '', 10); + $pdf->Text($x, $y + 5, $package->getSender()->getName2()); + + $pdf->SetFont($pdf->getFontFamily(), '', 10); + $pdf->Text($x, $y + 10, $package->getSender()->getStreet()); + + $pdf->SetFont($pdf->getFontFamily(), '', 10); + $pdf->Text($x, $y + 15, sprintf('%s %s %s', $package->getSender()->getZipCode(), $package->getSender()->getCity(), $package->getSender()->getCountry())); + + $pdf->SetFont($pdf->getFontFamily(), 'B', 13); + $pdf->MultiCell(85, 23, '', ['LTRB' => ['width' => 0.7]], 'L', 0, 0, 51 + $xPositionOffset, 57 + $yPositionOffset, true, 0, false, true, 0); + + return $pdf; + } +} \ No newline at end of file diff --git a/src/ZplLabel.php b/src/ZplLabel.php new file mode 100644 index 0000000..d47be03 --- /dev/null +++ b/src/ZplLabel.php @@ -0,0 +1,172 @@ +getPackageNumber() + ); + + if (in_array($package->getPackageProductType(), Product::$cashOnDelivery)) { + $zpl .= '^FO5,9^LRY^GB6,38,3,B,0^FS'; + $zpl .= '^FO6,10^A0R,4,4^FDDOB:^FS'; + $zpl .= sprintf( + '^FO6,29^A0R,4,4^FD%s %s^FS', + $package->getPaymentInfo()->getCashOnDeliveryPrice(), + $package->getPaymentInfo()->getCashOnDeliveryCurrency() + ); + } + + $zpl .= '^FO95,49^A0R,2,2^FDConsignee / Prijemce^FS'; + $zpl .= '^FO41,49^A0R,2,2^FDConsignor / Odesilatel^FS'; + $zpl .= sprintf( + '^FO86,51^AFR,4^FD%s^FS', + $package->getRecipient()->getName() + ); + $zpl .= sprintf( + '^FO81,51^AFR,4^FD%s^FS', + $package->getRecipient()->getStreet() + ); + $zpl .= sprintf( + '^FO76,51^AFR,4^FD%s, %s^FS', + $package->getRecipient()->getCity(), + $package->getRecipient()->getCountry() + ); + $zpl .= sprintf( + '^FO60,51^A0R,8,8^FD%s^FS', + $package->getRecipient()->getZipCode() + ); + $zpl .= sprintf('^FO55,51^A0R,4,4^FDkontakt^FS'); + $zpl .= '^FO50,51^A0R,3,3^FDTEL.: ^FS'; + $zpl .= sprintf( + '^FO50,59^A0R,3,3^FD%s^FS', + $package->getRecipient()->getPhone() + ); + $zpl .= sprintf( + '^FO53.7,110^A0R,7,7^FD%s^FS', + in_array(PackageService::EVENING_DELIVERY, \Salamek\PplMyApi\Model\PackageService::packageServicesToArray($package)) ? 'Veer' : 'Den' + ); + $zpl .= sprintf( + '^FO35,51^AFR,4^FD%s^FS', + $package->getSender()->getName() + ); + $zpl .= sprintf( + '^FO30,51^AFR,4^FD%s^FS', + $package->getSender()->getStreet() + ); + $zpl .= sprintf( + '^FO25,51^AFR,4^FD%s, %s^FS', + $package->getSender()->getCity(), + $package->getSender()->getCountry() + ); + $zpl .= sprintf( + '^FO16,51^A0R,4,4^FD%s^FS', + $package->getSender()->getZipCode() + ); + $zpl .= sprintf( + '^FO5,118^A0R,5,5^FD%s/%s^FS', + $package->getPackagePosition(), + $package->getPackageCount() + ); + $zpl .= '^FO80,7^ACR,2^FDPevn linka: 225 331 500^FS'; + $zpl .= '^FO76,7^ACR,2^FDhttps://www.ppl.cz^FS'; + $zpl .= '^FO72,7^ACR,2^FDinfo@ppl.cz^FS'; + $zpl .= sprintf( + '^FO66,7^ACR,2^FD%s^FS', + '' + ); + $zpl .= '^FO8,49^A0R,2,2^FD^FS'; + $zpl .= '^FO3,49^A0R,2,2^FD^FS'; + $zpl .= sprintf( + '^FO20,2^BY0.4,3,32^B2N,32,N,N^FD%s%s^FS', + $package->getPackageNumber(), + $package->getPackageNumberChecksum() + ); + + $zpl .= '^XZ'; + + return $zpl; + } + + /** + * @param $pdf + * @param $package + * @throws \Exception + */ + public static function generateLabelFull($pdf, $package) + { + throw new NotImplementedException(); + } + + /** + * @param $pdf + * @param $package + * @param $position + * @throws \Exception + */ + public static function generateLabelQuarter($pdf, $package, $position = null) + { + throw new NotImplementedException(); + } + +} diff --git a/test/PublicTest.php b/test/PublicTest.php index d21d26f..cfb6e90 100644 --- a/test/PublicTest.php +++ b/test/PublicTest.php @@ -7,7 +7,8 @@ use Salamek\PplMyApi\Enum\LabelDecomposition; use Salamek\PplMyApi\Model\Package; use Salamek\PplMyApi\Tools; -use Salamek\PplMyApi\Label; +use Salamek\PplMyApi\PdfLabel; +use Salamek\PplMyApi\ZplLabel; final class PublicTest extends BaseTest { @@ -35,6 +36,14 @@ public function testPackageNumber() $this->assertEquals('40950000115', $this->package->getPackageNumber()); } + /** + * @test + */ + public function testPackageNumberChecksum() + { + $this->assertEquals('7', $this->package->getPackageNumberChecksum()); + } + /** * @test */ @@ -83,7 +92,7 @@ public function testGetSprintRoutes() */ public function testGeneratePdfFullSinglePackage() { - $raw = Label::generateLabels([$this->package], LabelDecomposition::FULL); + $raw = PdfLabel::generateLabels([$this->package], LabelDecomposition::FULL); $this->assertNotEmpty($raw); @@ -99,7 +108,7 @@ public function testGeneratePdfFullSinglePackage() */ public function testGeneratePdfFullMultiplePackages() { - $raw = Label::generateLabels($this->packages, LabelDecomposition::FULL); + $raw = PdfLabel::generateLabels($this->packages, LabelDecomposition::FULL); $this->assertNotEmpty($raw); @@ -122,7 +131,7 @@ public function testGeneratePdfFullMultiplePackages() */ public function testGeneratePdfQuarterSinglePackage() { - $raw = Label::generateLabels([$this->package], LabelDecomposition::QUARTER); + $raw = PdfLabel::generateLabels([$this->package], LabelDecomposition::QUARTER); $this->assertNotEmpty($raw); @@ -138,7 +147,7 @@ public function testGeneratePdfQuarterSinglePackage() */ public function testGeneratePdfQuarterMultiplePackages() { - $raw = Label::generateLabels($this->packages, LabelDecomposition::QUARTER); + $raw = PdfLabel::generateLabels($this->packages, LabelDecomposition::QUARTER); $this->assertNotEmpty($raw); @@ -155,4 +164,17 @@ public function testGeneratePdfQuarterMultiplePackages() $this->assertFileExists($filePath); } + + /** + * @test + */ + public function testGenerateZplLabel() + { + $zplString = ZplLabel::generateLabels([$this->package]); + $this->assertNotEmpty($zplString); + $this->assertEquals( + '^XA^MUM^LH2,2^FS^LL^PW^PON^FO47,49^LRY^GB48,80,0.3,B,0^FS^FO13,49^LRY^GB28,80,0.3,B,0^FS^FO4.7,114^LRY^GB6,15,0.3,B,0^FS^FO47.2,107.7^LRY^GB21,21,10.5,B,0^FS^FO88,7^GFA,2520,2520,9,00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000007C00000000000000007F80000000000000001FE0000000000000000FE0000000000000000E60000000000000000E601E00000000000006601FE0000000000007E01FFC000000000043E01FFC40000000007C001FFC78000000007F801FFC7F800000000FE01FFC7FC000000007E01FFC7FCE00000006601FFC7FCFE0000046601FFC7FCFE000007E601FFC7FCFE380007FE01FFC7FCFE380000BE01FFC7FCFE3800001E01FFC7FCFE380003E001FFC7FCFE380007F801FFC7FCFE38000E3C01FFC7FCFE38000E0E01FFC7FCFE38000E0601FFC7FCFE3800060601FFC7FCFE3800070701FFC7FCFE380003C601FFC7FCFE380001FE01FFC7FCFE380000FC01FFC7FCFE3800070001FFC7FCFE380007F001FFC7FCFE380003FE01FFC7FCFE3800007E01FFC7FCFE3800006601FFC7FCFE3800006601FFC7FCFE3800006601FFC7FCFE3800006601FFC7FCFE3800070601FFC7FCFE380007E601FFC7FCFE380007FE01FFC7FCFE3800067E01FFC7FCFE3800066601FFC7FCFE3800066601FFC7FCFE3800066601FFC7FCFE3800066601FFC7FCFE3800002601FFC7FCFE3800070601FFC7FCFE3800073801FFC7FCFE38000E7C01FFC7FCFE38000E7E01FFC7FCFE38000E66003FC7FCFE380006670007C7FCFE380007E7000047FCFE380003EE000007FCFE380001CE000000FCFE3800070C0000001CFE3800073000000000FE38000E7C000000003E38000E7E000000000638000E6600000000003800066701E0000000080007E701FC000000000003EE01FFC00000000001CE01FFF800000000070C01FFFF8000000007F001FFFFF000000001FE01FFFFFF000000003E01FFFFFFE0000003E201FFFFFFFE000007F801FFFFFFFFC000077C01FFFFFFFFF8000E0E01FFFFFFFFF8000E0601FFFFFFFFF800060601FFFFFFFFF800070701FFFFFFFFF800038701FFFFFFFFF80001FE01FFFFFFFFF80000FE01FFFFFFFFF800071801FFFFFFFFF80007F001FFFFFFFFF80001FE007FFFFFFFF800003E0007FFFFFFF800007E0000FFFFFFF80003FC00000FFFFFF80007C0000007FFFFF80007E0000007FFFFF80003FC000007FBFFF800047E000007F83FF8000706000007F807F8000780000007F803F80001E0000007F803F80001F8000007F803F80001BC000007F803F800019E000007F803F80007FE000007F803F80007FE000007F803F8000780000007F803F8000400000007F803F80007C0000007F803F80007F8000007F803F80006FE000007F803F800061E000007F803F8000600000007F803F8000600000007F803F8000600000007FC07F8000000000007FE07F8000000000007FF0FF8000000000007FFFFF8000000000003FFFFF8000000000003FFFFF8000000000003FFFFF8000000000003FFFFF8000000000003FFFFF8000400000001FFFFF8000780000001FFFFF80007F8000001FFFFF80001FE000000FFFFF00000FE000000FFFFF00000E60000007FFFF00000E60000007FFFE00000660000003FFFE000007E0000001FFFC000063E0000000FFF8000070C00000007FF800007C000000003FE000001E000000000FC000001F80080000000000001BC01F00000000000018E01FF000000000007FE01FFE00000000007FE01FFFC00000000040001FFFFC0000000040001FFFFF800000007C001FFFFFF80000007F801FFFFFFF0000000FE01FFFFFFFF0000006E01FFFFFFFFE000006601FFFFFFFFF800066601FFFFFFFFF80007E601FFFFFFFFF80007FE01FFFFFFFFF800003E01FFFFFFFFF800001E01FFFFFFFFF80007F001FFFFFFFFF80007F801FFFFFFFFF8000E3C01FFFFFFFFF8000E0E00FFFFFFFFF8000606003FFFFFFFF80006070003FFFFFFF800070700007FFFFFF800038E000007FFFFF800001E000007FFFFF800070C000007FFFFF80007F0000007F9FFF80007FE000007F81FF800067E000007F803F8000666000007F803F8000666000007F803F8000666000007F803F8000666000007F803F8000026000007F803F8000706000007F803F80007F0000007F803F80007FE000007F803F800063E000007F803F8000606000007F803F8000600000007F803F8000600000007F803F8000200000007F803F8000000000007F803F8000000000007FC03F8000000000007FC07F8000000000007FE07F8000000000007FF9FF8000000000007FFFFF8000000000003FFFFF8000000000003FFFFF8000700000003FFFFF80007E0000003FFFFF80007FE000003FFFFF800067E000001FFFFF800060E000001FFFFF8000600000000FFFFF8000600000000FFFFF0000600000000FFFFF00000000000007FFFF00003F00000003FFFE00007F80000003FFFE000073C0000001FFFC0000E0E0000000FFF80000E0600000007FF0000060600000003FE000007070000000078000003C701C0000000000001FE01F8000000000000FE01FF800000000003E001FFF00000000007F001FFFF0000000007F801FFFFE00000000E1C01FFFFFE0000000E0E01FFFFFFC00000060601FFFFFFFC000006E701FFFFFFFF800007E701FFFFFFFFF00007EE01FFFFFFFFF80001EE01FFFFFFFFF800060C01FFFFFFFFF80007C001FFFFFFFFF80007FC01FFFFFFFFF800007E01FFFFFFFFF800070E01FFFFFFFFF800073801FFFFFFFFF8000E7C01FFFFFFFFF8000E7E01FFFFFFFFF8000E6601FFFFFFFFF800066701FFFFFFFFF80007E701FF9FFFFFF80003EE01FF83FFFFF80001CE01FF807FFFF800000C01FF8007FFF800000601FF8000FFF800070601FF80000FF80007E601FF800001F80003FE01FF8000001800007E01FF8000000000000601FF8000000000000601FF8000000000070601FF800000000007F601FF800000000003FE01FF8000000000003E01FF800000000003E601FF800000000007F801FF80000000000FFC01FF80000000000E0E01FF80000000000E0601FF8000000000060601FF8000000000070701FF8000000000038F01FF8000000000019E01FF8000000000000C01FF8000000000000001FF8000000000000001FF8000000000000001FF8000000000000000FF80000000000000001F80000000000000000380000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001F00000000000000007FC000000000000000C060000000000000014010000000000000037818000000000000063F0C0000000000000607EC0000000000000404E4000000000000040664000000000000040664000000000000046664000000000000067E6C000000000000020BE80000000000000301D800000000000001803000000000000000C060000000000000007FC0000000000000000E0000000000000000000000^FS^FO24,35^A0N,6,6^FD40950000115^FS^FO95,49^A0R,2,2^FDConsignee / Prijemce^FS^FO41,49^A0R,2,2^FDConsignor / Odesilatel^FS^FO86,51^AFR,4^FDAdam Schubert^FS^FO81,51^AFR,4^FDNa tabulovem vrchu 7^FS^FO76,51^AFR,4^FDOlomouc, CZ^FS^FO60,51^A0R,8,8^FD77900^FS^FO55,51^A0R,4,4^FDkontakt^FS^FO50,51^A0R,3,3^FDTEL.: ^FS^FO50,59^A0R,3,3^FD+420123456789^FS^FO53.7,110^A0R,7,7^FDDen^FS^FO35,51^AFR,4^FDMy Compamy s.r.o.^FS^FO30,51^AFR,4^FDMy Address^FS^FO25,51^AFR,4^FDOlomouc, CZ^FS^FO16,51^A0R,4,4^FD77900^FS^FO5,118^A0R,5,5^FD1/1^FS^FO80,7^ACR,2^FDmodra linka : 844 775 775^FS^FO76,7^ACR,2^FDhttps://www.ppl.cz^FS^FO72,7^ACR,2^FDinfo@ppl.cz^FS^FO66,7^ACR,2^FD^FS^FO8,49^A0R,2,2^FD^FS^FO3,49^A0R,2,2^FD^FS^FO20,2^BY0.40,3,32^B2N,32,N,N^FD409500001157^FS^XZ', + $zplString + ); + } } \ No newline at end of file From 2ec9890e042121f03f3906eee3b6102fcadb87dd Mon Sep 17 00:00:00 2001 From: Samuel Szabo Date: Fri, 1 Dec 2017 10:02:11 +0100 Subject: [PATCH 2/2] PPL Zpl labels --- test/PublicTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/PublicTest.php b/test/PublicTest.php index cfb6e90..1de7827 100644 --- a/test/PublicTest.php +++ b/test/PublicTest.php @@ -173,7 +173,7 @@ public function testGenerateZplLabel() $zplString = ZplLabel::generateLabels([$this->package]); $this->assertNotEmpty($zplString); $this->assertEquals( - '^XA^MUM^LH2,2^FS^LL^PW^PON^FO47,49^LRY^GB48,80,0.3,B,0^FS^FO13,49^LRY^GB28,80,0.3,B,0^FS^FO4.7,114^LRY^GB6,15,0.3,B,0^FS^FO47.2,107.7^LRY^GB21,21,10.5,B,0^FS^FO88,7^GFA,2520,2520,9,00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000007C00000000000000007F80000000000000001FE0000000000000000FE0000000000000000E60000000000000000E601E00000000000006601FE0000000000007E01FFC000000000043E01FFC40000000007C001FFC78000000007F801FFC7F800000000FE01FFC7FC000000007E01FFC7FCE00000006601FFC7FCFE0000046601FFC7FCFE000007E601FFC7FCFE380007FE01FFC7FCFE380000BE01FFC7FCFE3800001E01FFC7FCFE380003E001FFC7FCFE380007F801FFC7FCFE38000E3C01FFC7FCFE38000E0E01FFC7FCFE38000E0601FFC7FCFE3800060601FFC7FCFE3800070701FFC7FCFE380003C601FFC7FCFE380001FE01FFC7FCFE380000FC01FFC7FCFE3800070001FFC7FCFE380007F001FFC7FCFE380003FE01FFC7FCFE3800007E01FFC7FCFE3800006601FFC7FCFE3800006601FFC7FCFE3800006601FFC7FCFE3800006601FFC7FCFE3800070601FFC7FCFE380007E601FFC7FCFE380007FE01FFC7FCFE3800067E01FFC7FCFE3800066601FFC7FCFE3800066601FFC7FCFE3800066601FFC7FCFE3800066601FFC7FCFE3800002601FFC7FCFE3800070601FFC7FCFE3800073801FFC7FCFE38000E7C01FFC7FCFE38000E7E01FFC7FCFE38000E66003FC7FCFE380006670007C7FCFE380007E7000047FCFE380003EE000007FCFE380001CE000000FCFE3800070C0000001CFE3800073000000000FE38000E7C000000003E38000E7E000000000638000E6600000000003800066701E0000000080007E701FC000000000003EE01FFC00000000001CE01FFF800000000070C01FFFF8000000007F001FFFFF000000001FE01FFFFFF000000003E01FFFFFFE0000003E201FFFFFFFE000007F801FFFFFFFFC000077C01FFFFFFFFF8000E0E01FFFFFFFFF8000E0601FFFFFFFFF800060601FFFFFFFFF800070701FFFFFFFFF800038701FFFFFFFFF80001FE01FFFFFFFFF80000FE01FFFFFFFFF800071801FFFFFFFFF80007F001FFFFFFFFF80001FE007FFFFFFFF800003E0007FFFFFFF800007E0000FFFFFFF80003FC00000FFFFFF80007C0000007FFFFF80007E0000007FFFFF80003FC000007FBFFF800047E000007F83FF8000706000007F807F8000780000007F803F80001E0000007F803F80001F8000007F803F80001BC000007F803F800019E000007F803F80007FE000007F803F80007FE000007F803F8000780000007F803F8000400000007F803F80007C0000007F803F80007F8000007F803F80006FE000007F803F800061E000007F803F8000600000007F803F8000600000007F803F8000600000007FC07F8000000000007FE07F8000000000007FF0FF8000000000007FFFFF8000000000003FFFFF8000000000003FFFFF8000000000003FFFFF8000000000003FFFFF8000000000003FFFFF8000400000001FFFFF8000780000001FFFFF80007F8000001FFFFF80001FE000000FFFFF00000FE000000FFFFF00000E60000007FFFF00000E60000007FFFE00000660000003FFFE000007E0000001FFFC000063E0000000FFF8000070C00000007FF800007C000000003FE000001E000000000FC000001F80080000000000001BC01F00000000000018E01FF000000000007FE01FFE00000000007FE01FFFC00000000040001FFFFC0000000040001FFFFF800000007C001FFFFFF80000007F801FFFFFFF0000000FE01FFFFFFFF0000006E01FFFFFFFFE000006601FFFFFFFFF800066601FFFFFFFFF80007E601FFFFFFFFF80007FE01FFFFFFFFF800003E01FFFFFFFFF800001E01FFFFFFFFF80007F001FFFFFFFFF80007F801FFFFFFFFF8000E3C01FFFFFFFFF8000E0E00FFFFFFFFF8000606003FFFFFFFF80006070003FFFFFFF800070700007FFFFFF800038E000007FFFFF800001E000007FFFFF800070C000007FFFFF80007F0000007F9FFF80007FE000007F81FF800067E000007F803F8000666000007F803F8000666000007F803F8000666000007F803F8000666000007F803F8000026000007F803F8000706000007F803F80007F0000007F803F80007FE000007F803F800063E000007F803F8000606000007F803F8000600000007F803F8000600000007F803F8000200000007F803F8000000000007F803F8000000000007FC03F8000000000007FC07F8000000000007FE07F8000000000007FF9FF8000000000007FFFFF8000000000003FFFFF8000000000003FFFFF8000700000003FFFFF80007E0000003FFFFF80007FE000003FFFFF800067E000001FFFFF800060E000001FFFFF8000600000000FFFFF8000600000000FFFFF0000600000000FFFFF00000000000007FFFF00003F00000003FFFE00007F80000003FFFE000073C0000001FFFC0000E0E0000000FFF80000E0600000007FF0000060600000003FE000007070000000078000003C701C0000000000001FE01F8000000000000FE01FF800000000003E001FFF00000000007F001FFFF0000000007F801FFFFE00000000E1C01FFFFFE0000000E0E01FFFFFFC00000060601FFFFFFFC000006E701FFFFFFFF800007E701FFFFFFFFF00007EE01FFFFFFFFF80001EE01FFFFFFFFF800060C01FFFFFFFFF80007C001FFFFFFFFF80007FC01FFFFFFFFF800007E01FFFFFFFFF800070E01FFFFFFFFF800073801FFFFFFFFF8000E7C01FFFFFFFFF8000E7E01FFFFFFFFF8000E6601FFFFFFFFF800066701FFFFFFFFF80007E701FF9FFFFFF80003EE01FF83FFFFF80001CE01FF807FFFF800000C01FF8007FFF800000601FF8000FFF800070601FF80000FF80007E601FF800001F80003FE01FF8000001800007E01FF8000000000000601FF8000000000000601FF8000000000070601FF800000000007F601FF800000000003FE01FF8000000000003E01FF800000000003E601FF800000000007F801FF80000000000FFC01FF80000000000E0E01FF80000000000E0601FF8000000000060601FF8000000000070701FF8000000000038F01FF8000000000019E01FF8000000000000C01FF8000000000000001FF8000000000000001FF8000000000000001FF8000000000000000FF80000000000000001F80000000000000000380000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001F00000000000000007FC000000000000000C060000000000000014010000000000000037818000000000000063F0C0000000000000607EC0000000000000404E4000000000000040664000000000000040664000000000000046664000000000000067E6C000000000000020BE80000000000000301D800000000000001803000000000000000C060000000000000007FC0000000000000000E0000000000000000000000^FS^FO24,35^A0N,6,6^FD40950000115^FS^FO95,49^A0R,2,2^FDConsignee / Prijemce^FS^FO41,49^A0R,2,2^FDConsignor / Odesilatel^FS^FO86,51^AFR,4^FDAdam Schubert^FS^FO81,51^AFR,4^FDNa tabulovem vrchu 7^FS^FO76,51^AFR,4^FDOlomouc, CZ^FS^FO60,51^A0R,8,8^FD77900^FS^FO55,51^A0R,4,4^FDkontakt^FS^FO50,51^A0R,3,3^FDTEL.: ^FS^FO50,59^A0R,3,3^FD+420123456789^FS^FO53.7,110^A0R,7,7^FDDen^FS^FO35,51^AFR,4^FDMy Compamy s.r.o.^FS^FO30,51^AFR,4^FDMy Address^FS^FO25,51^AFR,4^FDOlomouc, CZ^FS^FO16,51^A0R,4,4^FD77900^FS^FO5,118^A0R,5,5^FD1/1^FS^FO80,7^ACR,2^FDmodra linka : 844 775 775^FS^FO76,7^ACR,2^FDhttps://www.ppl.cz^FS^FO72,7^ACR,2^FDinfo@ppl.cz^FS^FO66,7^ACR,2^FD^FS^FO8,49^A0R,2,2^FD^FS^FO3,49^A0R,2,2^FD^FS^FO20,2^BY0.40,3,32^B2N,32,N,N^FD409500001157^FS^XZ', + '^XA^MUM^LH2,2^FS^LL^PW^PON^FO47,49^LRY^GB48,80,0.3,B,0^FS^FO13,49^LRY^GB28,80,0.3,B,0^FS^FO4.7,114^LRY^GB6,15,0.3,B,0^FS^FO47.2,107.7^LRY^GB21,21,10.5,B,0^FS^FO88,7^GFA,2520,2520,9,00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000007C00000000000000007F80000000000000001FE0000000000000000FE0000000000000000E60000000000000000E601E00000000000006601FE0000000000007E01FFC000000000043E01FFC40000000007C001FFC78000000007F801FFC7F800000000FE01FFC7FC000000007E01FFC7FCE00000006601FFC7FCFE0000046601FFC7FCFE000007E601FFC7FCFE380007FE01FFC7FCFE380000BE01FFC7FCFE3800001E01FFC7FCFE380003E001FFC7FCFE380007F801FFC7FCFE38000E3C01FFC7FCFE38000E0E01FFC7FCFE38000E0601FFC7FCFE3800060601FFC7FCFE3800070701FFC7FCFE380003C601FFC7FCFE380001FE01FFC7FCFE380000FC01FFC7FCFE3800070001FFC7FCFE380007F001FFC7FCFE380003FE01FFC7FCFE3800007E01FFC7FCFE3800006601FFC7FCFE3800006601FFC7FCFE3800006601FFC7FCFE3800006601FFC7FCFE3800070601FFC7FCFE380007E601FFC7FCFE380007FE01FFC7FCFE3800067E01FFC7FCFE3800066601FFC7FCFE3800066601FFC7FCFE3800066601FFC7FCFE3800066601FFC7FCFE3800002601FFC7FCFE3800070601FFC7FCFE3800073801FFC7FCFE38000E7C01FFC7FCFE38000E7E01FFC7FCFE38000E66003FC7FCFE380006670007C7FCFE380007E7000047FCFE380003EE000007FCFE380001CE000000FCFE3800070C0000001CFE3800073000000000FE38000E7C000000003E38000E7E000000000638000E6600000000003800066701E0000000080007E701FC000000000003EE01FFC00000000001CE01FFF800000000070C01FFFF8000000007F001FFFFF000000001FE01FFFFFF000000003E01FFFFFFE0000003E201FFFFFFFE000007F801FFFFFFFFC000077C01FFFFFFFFF8000E0E01FFFFFFFFF8000E0601FFFFFFFFF800060601FFFFFFFFF800070701FFFFFFFFF800038701FFFFFFFFF80001FE01FFFFFFFFF80000FE01FFFFFFFFF800071801FFFFFFFFF80007F001FFFFFFFFF80001FE007FFFFFFFF800003E0007FFFFFFF800007E0000FFFFFFF80003FC00000FFFFFF80007C0000007FFFFF80007E0000007FFFFF80003FC000007FBFFF800047E000007F83FF8000706000007F807F8000780000007F803F80001E0000007F803F80001F8000007F803F80001BC000007F803F800019E000007F803F80007FE000007F803F80007FE000007F803F8000780000007F803F8000400000007F803F80007C0000007F803F80007F8000007F803F80006FE000007F803F800061E000007F803F8000600000007F803F8000600000007F803F8000600000007FC07F8000000000007FE07F8000000000007FF0FF8000000000007FFFFF8000000000003FFFFF8000000000003FFFFF8000000000003FFFFF8000000000003FFFFF8000000000003FFFFF8000400000001FFFFF8000780000001FFFFF80007F8000001FFFFF80001FE000000FFFFF00000FE000000FFFFF00000E60000007FFFF00000E60000007FFFE00000660000003FFFE000007E0000001FFFC000063E0000000FFF8000070C00000007FF800007C000000003FE000001E000000000FC000001F80080000000000001BC01F00000000000018E01FF000000000007FE01FFE00000000007FE01FFFC00000000040001FFFFC0000000040001FFFFF800000007C001FFFFFF80000007F801FFFFFFF0000000FE01FFFFFFFF0000006E01FFFFFFFFE000006601FFFFFFFFF800066601FFFFFFFFF80007E601FFFFFFFFF80007FE01FFFFFFFFF800003E01FFFFFFFFF800001E01FFFFFFFFF80007F001FFFFFFFFF80007F801FFFFFFFFF8000E3C01FFFFFFFFF8000E0E00FFFFFFFFF8000606003FFFFFFFF80006070003FFFFFFF800070700007FFFFFF800038E000007FFFFF800001E000007FFFFF800070C000007FFFFF80007F0000007F9FFF80007FE000007F81FF800067E000007F803F8000666000007F803F8000666000007F803F8000666000007F803F8000666000007F803F8000026000007F803F8000706000007F803F80007F0000007F803F80007FE000007F803F800063E000007F803F8000606000007F803F8000600000007F803F8000600000007F803F8000200000007F803F8000000000007F803F8000000000007FC03F8000000000007FC07F8000000000007FE07F8000000000007FF9FF8000000000007FFFFF8000000000003FFFFF8000000000003FFFFF8000700000003FFFFF80007E0000003FFFFF80007FE000003FFFFF800067E000001FFFFF800060E000001FFFFF8000600000000FFFFF8000600000000FFFFF0000600000000FFFFF00000000000007FFFF00003F00000003FFFE00007F80000003FFFE000073C0000001FFFC0000E0E0000000FFF80000E0600000007FF0000060600000003FE000007070000000078000003C701C0000000000001FE01F8000000000000FE01FF800000000003E001FFF00000000007F001FFFF0000000007F801FFFFE00000000E1C01FFFFFE0000000E0E01FFFFFFC00000060601FFFFFFFC000006E701FFFFFFFF800007E701FFFFFFFFF00007EE01FFFFFFFFF80001EE01FFFFFFFFF800060C01FFFFFFFFF80007C001FFFFFFFFF80007FC01FFFFFFFFF800007E01FFFFFFFFF800070E01FFFFFFFFF800073801FFFFFFFFF8000E7C01FFFFFFFFF8000E7E01FFFFFFFFF8000E6601FFFFFFFFF800066701FFFFFFFFF80007E701FF9FFFFFF80003EE01FF83FFFFF80001CE01FF807FFFF800000C01FF8007FFF800000601FF8000FFF800070601FF80000FF80007E601FF800001F80003FE01FF8000001800007E01FF8000000000000601FF8000000000000601FF8000000000070601FF800000000007F601FF800000000003FE01FF8000000000003E01FF800000000003E601FF800000000007F801FF80000000000FFC01FF80000000000E0E01FF80000000000E0601FF8000000000060601FF8000000000070701FF8000000000038F01FF8000000000019E01FF8000000000000C01FF8000000000000001FF8000000000000001FF8000000000000001FF8000000000000000FF80000000000000001F80000000000000000380000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001F00000000000000007FC000000000000000C060000000000000014010000000000000037818000000000000063F0C0000000000000607EC0000000000000404E4000000000000040664000000000000040664000000000000046664000000000000067E6C000000000000020BE80000000000000301D800000000000001803000000000000000C060000000000000007FC0000000000000000E0000000000000000000000^FS^FO24,35^A0N,6,6^FD40950000115^FS^FO95,49^A0R,2,2^FDConsignee / Prijemce^FS^FO41,49^A0R,2,2^FDConsignor / Odesilatel^FS^FO86,51^AFR,4^FDAdam Schubert^FS^FO81,51^AFR,4^FDNa tabulovem vrchu 7^FS^FO76,51^AFR,4^FDOlomouc, CZ^FS^FO60,51^A0R,8,8^FD77900^FS^FO55,51^A0R,4,4^FDkontakt^FS^FO50,51^A0R,3,3^FDTEL.: ^FS^FO50,59^A0R,3,3^FD+420123456789^FS^FO53.7,110^A0R,7,7^FDDen^FS^FO35,51^AFR,4^FDMy Compamy s.r.o.^FS^FO30,51^AFR,4^FDMy Address^FS^FO25,51^AFR,4^FDOlomouc, CZ^FS^FO16,51^A0R,4,4^FD77900^FS^FO5,118^A0R,5,5^FD1/1^FS^FO80,7^ACR,2^FDPevn linka: 225 331 500^FS^FO76,7^ACR,2^FDhttps://www.ppl.cz^FS^FO72,7^ACR,2^FDinfo@ppl.cz^FS^FO66,7^ACR,2^FD^FS^FO8,49^A0R,2,2^FD^FS^FO3,49^A0R,2,2^FD^FS^FO20,2^BY0.4,3,32^B2N,32,N,N^FD409500001157^FS^XZ', $zplString ); }