Преглед на файлове

[Administration] Étiquettes : ajout du commentaire de la commande

develop
Guillaume Bourgeois преди 1 месец
родител
ревизия
b8a758ebf1
променени са 1 файла, в които са добавени 18 реда и са изтрити 1 реда
  1. +18
    -1
      domain/Distribution/Distribution/Export/DistributionShoppingCartLabelsPdfGenerator.php

+ 18
- 1
domain/Distribution/Distribution/Export/DistributionShoppingCartLabelsPdfGenerator.php Целия файл

@@ -48,6 +48,7 @@ use domain\Producer\Producer\ProducerSolver;
use kartik\mpdf\Pdf;
use domain\_\AbstractGenerator;
use yii\base\ErrorException;
use yii\helpers\BaseStringHelper;

class DistributionShoppingCartLabelsPdfGenerator extends AbstractGenerator implements DistributionExportGeneratorInterface
{
@@ -176,6 +177,7 @@ class DistributionShoppingCartLabelsPdfGenerator extends AbstractGenerator imple
'username' => 14,
'phoneNumber' => 10,
'pointSale' => 10,
'comment' => 8,
'products' => 10,
'amount' => 10,
],
@@ -183,6 +185,7 @@ class DistributionShoppingCartLabelsPdfGenerator extends AbstractGenerator imple
'username' => 18,
'phoneNumber' => 14,
'pointSale' => 14,
'comment' => 12,
'products' => 14,
'amount' => 14,
]
@@ -220,6 +223,12 @@ class DistributionShoppingCartLabelsPdfGenerator extends AbstractGenerator imple
margin-bottom: 3px;
}
.shopping-cart-label .comment {
font-size: '.$fontSizeArray['comment'].'px;
margin-bottom: 3px;
font-style: italic;
}
.shopping-cart-label .products {
font-size: '.$fontSizeArray['products'].'px;
}
@@ -289,6 +298,8 @@ class DistributionShoppingCartLabelsPdfGenerator extends AbstractGenerator imple

public function getShoppingCartLabelAsHtml(Order $order, int $index, bool $isSpecificFormat, int $specificFormatWidth, int $specificFormatHeight, bool $pdfInCartLabelSpecificFormat): string
{
$isSpecificFormatBig = $isSpecificFormat && $specificFormatWidth >= 100 && $specificFormatHeight >= 150;

$amountAndPayment = '';
if($isSpecificFormat) {
$amountAndPayment = '<div class="amount-and-payment">';
@@ -305,10 +316,15 @@ class DistributionShoppingCartLabelsPdfGenerator extends AbstractGenerator imple
}

$producerLogo = '';
if($isSpecificFormat && $specificFormatWidth >= 100 && $specificFormatHeight >= 150) {
if($isSpecificFormatBig) {
$producerLogo = '<div class="producer-logo"><img src="'.$this->producerSolver->getUrlLogo($this->getProducerContext()).'" /></div>';
}

$comment = '';
if($isSpecificFormatBig && strlen($order->comment)) {
$comment = '<div class="comment">« '.BaseStringHelper::truncate($order->comment, 50).' »</div>';
}

$phoneNumber = '';
if($this->orderSolver->hasPhone($order)) {
$phoneNumber = '<div class="phonenumber">'.$this->orderSolver->getPhone($order).'</div>';
@@ -325,6 +341,7 @@ class DistributionShoppingCartLabelsPdfGenerator extends AbstractGenerator imple
'.date('d/m', strtotime($order->distribution->date)).' &bull;
'.$order->pointSale->name.'
</div>
'.$comment.'
<div class="products">
'.$this->orderRepository->getCartSummary($order).'
</div>

Loading…
Отказ
Запис