first commit

This commit is contained in:
2025-08-02 16:30:27 +02:00
commit 23646bfcee
14851 changed files with 1750626 additions and 0 deletions

View File

@@ -0,0 +1,54 @@
<?php
use KupShop\KupShopBundle\Util\Compat\ServiceContainer;
class PrintCenterWarehousePositions extends Base
{
use DatabaseCommunication;
private $pageVars;
public function __construct($pageVars)
{
$this->pageVars = $pageVars;
}
public function get_vars()
{
$vars = parent::get_vars();
$vars = array_merge($this->pageVars, $vars);
$printLabels = ServiceContainer::getService(\KupShop\AdminBundle\AdminRegister\WarehousePositionsPrintLabelsLocator::class);
$generic = [];
foreach ($printLabels->getPrintClasses() as $class) {
$generic[$class->getLabel()] = $class->getDimensions();
}
if (!($printClass = $printLabels->getPrintClass($vars['template_type']))) {
$printClasses = $printLabels->getPrintClasses();
$printClass = reset($printClasses);
}
$this->setTemplate($printClass->getTemplate());
$vars['count_rows'] = $generic[$vars['template_type']][1];
$vars['count_columns'] = $generic[$vars['template_type']][0];
$qb = sqlQueryBuilder()->select('*')
->from('warehouse_positions', 'wp');
$positions = getVal('positions');
if ($positions) {
$qb->andWhere(\Query\Operator::inIntArray($positions, 'id'));
}
$location = getVal('location');
if ($location) {
$qb->andWhere(\Query\Operator::equals(['id_location' => $location]));
}
$vars['positions'] = $qb->execute();
$vars['positionsArrow'] = getVal('arrows');
$vars['positionsBarcode'] = getVal('barcode_position');
return $vars;
}
}