Browse Source

[Admin] Export étiquettes avancées : ajustements

feature/souke
Guillaume Bourgeois 1 year ago
parent
commit
b33a8249e0
2 changed files with 11 additions and 9 deletions
  1. +1
    -1
      backend/views/distribution/shopping-cart-labels.php
  2. +10
    -8
      common/logic/Distribution/Distribution/Export/DistributionShoppingCartLabelsPdfGenerator.php

+ 1
- 1
backend/views/distribution/shopping-cart-labels.php View File

@@ -8,7 +8,7 @@ $i = 0;
foreach($ordersArray as $key => $order) {
$index ++;

echo $distributionShoppingCartLabelsPdfGenerator->getShoppingCartLabelAsHtml($order);
echo $distributionShoppingCartLabelsPdfGenerator->getShoppingCartLabelAsHtml($order, $index);

if($index == $shoppingCartLabelsPerColumn) {
$index = 0;

+ 10
- 8
common/logic/Distribution/Distribution/Export/DistributionShoppingCartLabelsPdfGenerator.php View File

@@ -145,20 +145,22 @@ class DistributionShoppingCartLabelsPdfGenerator extends AbstractGenerator imple
}';

if($isSpecificFormat) {
$paddingShoppingCartLabel = 3;
$specificFormatWidth = $specificFormatWidth - 2 * $paddingShoppingCartLabel;
$specificFormatHeight = $specificFormatHeight - 2 * $paddingShoppingCartLabel;
$paddingWidthShoppingCartLabel = 8;
$paddingHeightShoppingCartLabel = 5;
$specificFormatWidth = $specificFormatWidth - 2 * $paddingWidthShoppingCartLabel;
$specificFormatHeight = $specificFormatHeight - 2 * $paddingHeightShoppingCartLabel + 1;

$css .= '
.shopping-cart-label {
box-sizing: border-box;
padding: '.$paddingShoppingCartLabel.'mm;
padding-top: '.$paddingHeightShoppingCartLabel.'mm;
padding-bottom: '.$paddingHeightShoppingCartLabel.'mm;
padding-left: '.$paddingWidthShoppingCartLabel.'mm;
padding-right: '.$paddingWidthShoppingCartLabel.'mm;
width: '.$specificFormatWidth.'mm;
height: '.$specificFormatHeight.'mm;
display: block;
float: left;
/*border: solid 1px red;*/
}';
}
else {
@@ -179,9 +181,9 @@ class DistributionShoppingCartLabelsPdfGenerator extends AbstractGenerator imple
return $css;
}

public function getShoppingCartLabelAsHtml(Order $order): string
public function getShoppingCartLabelAsHtml(Order $order, int $index): string
{
return '<div class="shopping-cart-label">
return '<div class="shopping-cart-label shopping-cart-label-'.$index.'">
<div class="inner">
<div class="username">
'.$this->orderSolver->getOrderUsername($order).'

Loading…
Cancel
Save