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

foreach($ordersArray as $key => $order) { foreach($ordersArray as $key => $order) {
$index ++; $index ++;


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


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

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

}'; }';


if($isSpecificFormat) { 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 .= ' $css .= '
.shopping-cart-label { .shopping-cart-label {
box-sizing: border-box; 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; width: '.$specificFormatWidth.'mm;
height: '.$specificFormatHeight.'mm; height: '.$specificFormatHeight.'mm;
display: block; display: block;
float: left; float: left;
/*border: solid 1px red;*/
}'; }';
} }
else { else {
return $css; 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="inner">
<div class="username"> <div class="username">
'.$this->orderSolver->getOrderUsername($order).' '.$this->orderSolver->getOrderUsername($order).'

Loading…
Cancel
Save