瀏覽代碼

[Admin] Export étiquettes avancées : ajustements

feature/souke
Guillaume Bourgeois 11 月之前
父節點
當前提交
b33a8249e0
共有 2 個檔案被更改,包括 11 行新增9 行删除
  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 查看文件

@@ -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 查看文件

@@ -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…
取消
儲存