Backup
This commit is contained in:
parent
be27d4b6f0
commit
4724f0c841
@ -474,7 +474,7 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator;
|
|||||||
* datetime?: array{
|
* datetime?: array{
|
||||||
* default_format?: scalar|null, // Default: "Y-m-d\\TH:i:sP"
|
* default_format?: scalar|null, // Default: "Y-m-d\\TH:i:sP"
|
||||||
* default_deserialization_formats?: list<scalar|null>,
|
* default_deserialization_formats?: list<scalar|null>,
|
||||||
* default_timezone?: scalar|null, // Default: "Europe/Berlin"
|
* default_timezone?: scalar|null, // Default: "UTC"
|
||||||
* cdata?: scalar|null, // Default: true
|
* cdata?: scalar|null, // Default: true
|
||||||
* },
|
* },
|
||||||
* array_collection?: array{
|
* array_collection?: array{
|
||||||
@ -574,7 +574,7 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator;
|
|||||||
* datetime?: array{
|
* datetime?: array{
|
||||||
* default_format?: scalar|null, // Default: "Y-m-d\\TH:i:sP"
|
* default_format?: scalar|null, // Default: "Y-m-d\\TH:i:sP"
|
||||||
* default_deserialization_formats?: list<scalar|null>,
|
* default_deserialization_formats?: list<scalar|null>,
|
||||||
* default_timezone?: scalar|null, // Default: "Europe/Berlin"
|
* default_timezone?: scalar|null, // Default: "UTC"
|
||||||
* cdata?: scalar|null, // Default: true
|
* cdata?: scalar|null, // Default: true
|
||||||
* },
|
* },
|
||||||
* array_collection?: array{
|
* array_collection?: array{
|
||||||
|
|||||||
@ -155,12 +155,15 @@ class PdfController extends AbstractController
|
|||||||
$svg = $template->render([
|
$svg = $template->render([
|
||||||
'row' => $row,
|
'row' => $row,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$tmpSvg = tempnam(sys_get_temp_dir(), 'svg_') . '.svg';
|
$tmpSvg = tempnam(sys_get_temp_dir(), 'svg_') . '.svg';
|
||||||
$tmpPdf = tempnam(sys_get_temp_dir(), 'pdf_') . '.pdf';
|
$tmpPdf = tempnam(sys_get_temp_dir(), 'pdf_') . '.pdf';
|
||||||
file_put_contents($tmpSvg, $svg);
|
file_put_contents($tmpSvg, $svg);
|
||||||
$cmd =
|
$cmd =
|
||||||
'cairosvg ' . escapeshellarg($tmpSvg) . ' -f pdf -o ' . escapeshellarg($tmpPdf) . ' --unsafe 2>&1';
|
'cairosvg '
|
||||||
|
. escapeshellarg($tmpSvg)
|
||||||
|
. ' -f pdf -o '
|
||||||
|
. escapeshellarg($tmpPdf)
|
||||||
|
. ' --dpi 72 --unsafe 2>&1';
|
||||||
exec($cmd, $output, $ret);
|
exec($cmd, $output, $ret);
|
||||||
|
|
||||||
unlink($tmpSvg);
|
unlink($tmpSvg);
|
||||||
@ -300,8 +303,13 @@ class PdfController extends AbstractController
|
|||||||
$tmpSvg = tempnam(sys_get_temp_dir(), 'svg_') . '.svg';
|
$tmpSvg = tempnam(sys_get_temp_dir(), 'svg_') . '.svg';
|
||||||
$tmpPdf = tempnam(sys_get_temp_dir(), 'pdf_') . '.pdf';
|
$tmpPdf = tempnam(sys_get_temp_dir(), 'pdf_') . '.pdf';
|
||||||
file_put_contents($tmpSvg, $svg);
|
file_put_contents($tmpSvg, $svg);
|
||||||
|
file_put_contents('/data/www/old/test.svg', $svg);
|
||||||
$cmd =
|
$cmd =
|
||||||
'cairosvg ' . escapeshellarg($tmpSvg) . ' -f pdf -o ' . escapeshellarg($tmpPdf) . ' --unsafe 2>&1';
|
'cairosvg '
|
||||||
|
. escapeshellarg($tmpSvg)
|
||||||
|
. ' -f pdf -o '
|
||||||
|
. escapeshellarg($tmpPdf)
|
||||||
|
. ' --dpi 72 --unsafe 2>&1';
|
||||||
exec($cmd, $output, $ret);
|
exec($cmd, $output, $ret);
|
||||||
|
|
||||||
unlink($tmpSvg);
|
unlink($tmpSvg);
|
||||||
|
|||||||
@ -133,11 +133,16 @@ class Pdf
|
|||||||
$svg = $template->render([
|
$svg = $template->render([
|
||||||
'row' => $row,
|
'row' => $row,
|
||||||
]);
|
]);
|
||||||
|
die($svg);
|
||||||
$tmpSvg = tempnam(sys_get_temp_dir(), 'svg_') . '.svg';
|
$tmpSvg = tempnam(sys_get_temp_dir(), 'svg_') . '.svg';
|
||||||
$tmpPdf = tempnam(sys_get_temp_dir(), 'pdf_') . '.pdf';
|
$tmpPdf = tempnam(sys_get_temp_dir(), 'pdf_') . '.pdf';
|
||||||
file_put_contents($tmpSvg, $svg);
|
file_put_contents($tmpSvg, $svg);
|
||||||
$cmd =
|
$cmd =
|
||||||
'cairosvg ' . escapeshellarg($tmpSvg) . ' -f pdf -o ' . escapeshellarg($tmpPdf) . ' --unsafe 2>&1';
|
'cairosvg '
|
||||||
|
. escapeshellarg($tmpSvg)
|
||||||
|
. ' -f pdf -o '
|
||||||
|
. escapeshellarg($tmpPdf)
|
||||||
|
. ' --dpi 72 --unsafe 2>&1';
|
||||||
exec($cmd, $output, $ret);
|
exec($cmd, $output, $ret);
|
||||||
|
|
||||||
unlink($tmpSvg);
|
unlink($tmpSvg);
|
||||||
|
|||||||
@ -96,22 +96,6 @@ class Order
|
|||||||
#[ORM\ManyToOne(targetEntity: 'Shop')]
|
#[ORM\ManyToOne(targetEntity: 'Shop')]
|
||||||
#[ORM\JoinColumn(name: 'shop_id', referencedColumnName: 'id')]
|
#[ORM\JoinColumn(name: 'shop_id', referencedColumnName: 'id')]
|
||||||
protected $shop;
|
protected $shop;
|
||||||
/**
|
|
||||||
* Install zu welcher die Bestellung gehört
|
|
||||||
*
|
|
||||||
* @var Install
|
|
||||||
*/
|
|
||||||
#[ORM\ManyToOne(targetEntity: 'Install')]
|
|
||||||
#[ORM\JoinColumn(name: 'install_id', referencedColumnName: 'id')]
|
|
||||||
protected $install;
|
|
||||||
/**
|
|
||||||
* Account zu welcher das Motiv gehört
|
|
||||||
*
|
|
||||||
* @var Account
|
|
||||||
*/
|
|
||||||
#[ORM\ManyToOne(targetEntity: 'Account')]
|
|
||||||
#[ORM\JoinColumn(name: 'account_id', referencedColumnName: 'id')]
|
|
||||||
protected $account;
|
|
||||||
/**
|
/**
|
||||||
* Contact zu welcher das Motiv gehört
|
* Contact zu welcher das Motiv gehört
|
||||||
*
|
*
|
||||||
@ -188,7 +172,7 @@ class Order
|
|||||||
#[ORM\ManyToOne(targetEntity: 'ContactAddress')]
|
#[ORM\ManyToOne(targetEntity: 'ContactAddress')]
|
||||||
#[ORM\JoinColumn(name: 'delivery_address', referencedColumnName: 'id')]
|
#[ORM\JoinColumn(name: 'delivery_address', referencedColumnName: 'id')]
|
||||||
protected $deliveryAddress;
|
protected $deliveryAddress;
|
||||||
#
|
//
|
||||||
/**
|
/**
|
||||||
* @var ContactAddress
|
* @var ContactAddress
|
||||||
*/
|
*/
|
||||||
@ -266,6 +250,7 @@ class Order
|
|||||||
*/
|
*/
|
||||||
#[ORM\Column(name: 'type', type: 'integer', length: 8, nullable: true)]
|
#[ORM\Column(name: 'type', type: 'integer', length: 8, nullable: true)]
|
||||||
protected $type;
|
protected $type;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gibt die Id zurück
|
* Gibt die Id zurück
|
||||||
*
|
*
|
||||||
@ -292,22 +277,6 @@ class Order
|
|||||||
$this->shop = $shop;
|
$this->shop = $shop;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return \PSC\Shop\EntityBundle\Entity\Account
|
|
||||||
*/
|
|
||||||
public function getAccount()
|
|
||||||
{
|
|
||||||
return $this->account;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param \PSC\Shop\EntityBundle\Entity\Account $account
|
|
||||||
*/
|
|
||||||
public function setAccount($account)
|
|
||||||
{
|
|
||||||
$this->account = $account;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return \PSC\Shop\EntityBundle\Entity\Contact
|
* @return \PSC\Shop\EntityBundle\Entity\Contact
|
||||||
*/
|
*/
|
||||||
@ -444,7 +413,7 @@ class Order
|
|||||||
*/
|
*/
|
||||||
public function getPaymentType()
|
public function getPaymentType()
|
||||||
{
|
{
|
||||||
if ($this->paymentTypeId == 0 || $this->paymentTypeId == "") {
|
if ($this->paymentTypeId == 0 || $this->paymentTypeId == '') {
|
||||||
return new Payment();
|
return new Payment();
|
||||||
}
|
}
|
||||||
return $this->paymentType;
|
return $this->paymentType;
|
||||||
@ -463,7 +432,7 @@ class Order
|
|||||||
*/
|
*/
|
||||||
public function getShippingType()
|
public function getShippingType()
|
||||||
{
|
{
|
||||||
if ($this->shippingTypeId == 0 || $this->shippingTypeId == "") {
|
if ($this->shippingTypeId == 0 || $this->shippingTypeId == '') {
|
||||||
return new Shipping();
|
return new Shipping();
|
||||||
}
|
}
|
||||||
return $this->shippingType;
|
return $this->shippingType;
|
||||||
@ -530,7 +499,7 @@ class Order
|
|||||||
*/
|
*/
|
||||||
public function getInfo()
|
public function getInfo()
|
||||||
{
|
{
|
||||||
if ($this->info == "") {
|
if ($this->info == '') {
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -652,7 +621,7 @@ class Order
|
|||||||
*/
|
*/
|
||||||
public function getInvoiceAddress()
|
public function getInvoiceAddress()
|
||||||
{
|
{
|
||||||
if (!$this->invoiceAddress || ($this->invoiceAddress && $this->invoiceAddress->getUid() == 0)) {
|
if (!$this->invoiceAddress || $this->invoiceAddress && $this->invoiceAddress->getUid() == 0) {
|
||||||
return $this->getContact()->getStandartInvoice();
|
return $this->getContact()->getStandartInvoice();
|
||||||
}
|
}
|
||||||
return $this->invoiceAddress;
|
return $this->invoiceAddress;
|
||||||
@ -760,7 +729,8 @@ class Order
|
|||||||
return $tmpWert;
|
return $tmpWert;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getMwertForModel() {
|
public function getMwertForModel()
|
||||||
|
{
|
||||||
return json_decode($this->mwertAlle, true);
|
return json_decode($this->mwertAlle, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -852,22 +822,6 @@ class Order
|
|||||||
$this->lang = $lang;
|
$this->lang = $lang;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return Install
|
|
||||||
*/
|
|
||||||
public function getInstall()
|
|
||||||
{
|
|
||||||
return $this->install;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param Install $install
|
|
||||||
*/
|
|
||||||
public function setInstall($install)
|
|
||||||
{
|
|
||||||
$this->install = $install;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
@ -916,7 +870,6 @@ class Order
|
|||||||
$this->senderSame = $senderSame;
|
$this->senderSame = $senderSame;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getWeight()
|
public function getWeight()
|
||||||
{
|
{
|
||||||
$weight = 0;
|
$weight = 0;
|
||||||
@ -933,7 +886,8 @@ class Order
|
|||||||
*/
|
*/
|
||||||
public function getType(): int
|
public function getType(): int
|
||||||
{
|
{
|
||||||
if($this->type == null || $this->type == "") return 1;
|
if ($this->type == null || $this->type == '')
|
||||||
|
return 1;
|
||||||
return (int) $this->type;
|
return (int) $this->type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -59,14 +59,6 @@ class Orderpos
|
|||||||
*/
|
*/
|
||||||
#[ORM\Column(name: 'updatedt', type: 'time', nullable: true)]
|
#[ORM\Column(name: 'updatedt', type: 'time', nullable: true)]
|
||||||
private $updatedTime;
|
private $updatedTime;
|
||||||
/**
|
|
||||||
* Install zu welcher die Bestellung gehört
|
|
||||||
*
|
|
||||||
* @var Install
|
|
||||||
*/
|
|
||||||
#[ORM\ManyToOne(targetEntity: 'Install')]
|
|
||||||
#[ORM\JoinColumn(name: 'install_id', referencedColumnName: 'id')]
|
|
||||||
protected $install;
|
|
||||||
/**
|
/**
|
||||||
* Shop zu welcher das Product gehört
|
* Shop zu welcher das Product gehört
|
||||||
*
|
*
|
||||||
@ -75,11 +67,6 @@ class Orderpos
|
|||||||
#[ORM\ManyToOne(targetEntity: 'Shop')]
|
#[ORM\ManyToOne(targetEntity: 'Shop')]
|
||||||
#[ORM\JoinColumn(name: 'shop_id', referencedColumnName: 'id')]
|
#[ORM\JoinColumn(name: 'shop_id', referencedColumnName: 'id')]
|
||||||
protected $shop;
|
protected $shop;
|
||||||
/**
|
|
||||||
* @var integer
|
|
||||||
*/
|
|
||||||
#[ORM\Column(name: 'account_id', type: 'bigint', nullable: true)]
|
|
||||||
private $account;
|
|
||||||
/**
|
/**
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
@ -278,6 +265,7 @@ class Orderpos
|
|||||||
*/
|
*/
|
||||||
#[ORM\Column(name: 'kst', type: 'string', length: 255, nullable: true)]
|
#[ORM\Column(name: 'kst', type: 'string', length: 255, nullable: true)]
|
||||||
private $basketField2;
|
private $basketField2;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
@ -382,22 +370,6 @@ class Orderpos
|
|||||||
$this->updatedTime = $updatedTime;
|
$this->updatedTime = $updatedTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return Install
|
|
||||||
*/
|
|
||||||
public function getInstall()
|
|
||||||
{
|
|
||||||
return $this->install;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param Install $install
|
|
||||||
*/
|
|
||||||
public function setInstall($install)
|
|
||||||
{
|
|
||||||
$this->install = $install;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Shop
|
* @return Shop
|
||||||
*/
|
*/
|
||||||
@ -414,22 +386,6 @@ class Orderpos
|
|||||||
$this->shop = $shop;
|
$this->shop = $shop;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return int
|
|
||||||
*/
|
|
||||||
public function getAccount()
|
|
||||||
{
|
|
||||||
return $this->account;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param int $account
|
|
||||||
*/
|
|
||||||
public function setAccount($account)
|
|
||||||
{
|
|
||||||
$this->account = $account;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
@ -816,7 +772,7 @@ class Orderpos
|
|||||||
|
|
||||||
public function hasCalcXml()
|
public function hasCalcXml()
|
||||||
{
|
{
|
||||||
return ($this->calcXml != "" && strpos($this->calcXml, "artikel") !== false);
|
return $this->calcXml != '' && strpos($this->calcXml, 'artikel') !== false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -126,7 +126,7 @@ span.row {
|
|||||||
|
|
||||||
<span class="row"><span class="col-5"><label data-bs-toggle="tooltip" data-bs-html="{{ contact.username }}" for="order_username" class="form-label required">{{'username'|trans}}:</label></span><span class="col-7"><a href="mailto:{{ order.contact.username }}">{{ order.contact.username }}</a></span></span>
|
<span class="row"><span class="col-5"><label data-bs-toggle="tooltip" data-bs-html="{{ contact.username }}" for="order_username" class="form-label required">{{'username'|trans}}:</label></span><span class="col-7"><a href="mailto:{{ order.contact.username }}">{{ order.contact.username }}</a></span></span>
|
||||||
<span class="row"><span class="col-5"><label data-bs-toggle="tooltip" data-bs-html="{{ contact.firstname }} {{ contact.lastname }}" for="order_name" class="form-label required">{{'Name'|trans}}:</label></span><span class="col-7"><a href="{{ path("psc_shop_contact_backend_edit", {uuid: order.contact.uuid}) }}">{{ order.contact.firstname }} {{ order.contact.lastname }}</a></span></span>
|
<span class="row"><span class="col-5"><label data-bs-toggle="tooltip" data-bs-html="{{ contact.firstname }} {{ contact.lastname }}" for="order_name" class="form-label required">{{'Name'|trans}}:</label></span><span class="col-7"><a href="{{ path("psc_shop_contact_backend_edit", {uuid: order.contact.uuid}) }}">{{ order.contact.firstname }} {{ order.contact.lastname }}</a></span></span>
|
||||||
<span class="row"><span class="col-5"><label data-bs-toggle="tooltip" data-bs-html="{{ contact.company }}" for="order_company" class="form-label required">{{'company'|trans}}:</label></span><span class="col-7"><a href="{{ path("psc_shop_account_backend_edit", {uuid: order.account.uid}) }}">{{ order.account.title }}</a></span></span>
|
<span class="row"><span class="col-5"><label data-bs-toggle="tooltip" data-bs-html="{{ contact.company }}" for="order_company" class="form-label required">{{'company'|trans}}:</label></span><span class="col-7"><a href="{{ path("psc_shop_account_backend_edit", {uuid: order.contact.account.uid}) }}">{{ order.contact.account.title }}</a></span></span>
|
||||||
<span class="row"><span class="col-5">{{'guest'|trans}}:</span><span class="col-7">{% if order.contact.virtual == 1 %}<span class="badge bg-warning">{{'yes'|trans}}</span>{% else %}<span class="badge bg-secondary">{{'no'|trans}}</span>{% endif %}</span></span>
|
<span class="row"><span class="col-5">{{'guest'|trans}}:</span><span class="col-7">{% if order.contact.virtual == 1 %}<span class="badge bg-warning">{{'yes'|trans}}</span>{% else %}<span class="badge bg-secondary">{{'no'|trans}}</span>{% endif %}</span></span>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -39,8 +39,16 @@ class Order extends Base
|
|||||||
private \PSC\Component\ApiBundle\Transformer\Shop $shopTransformer;
|
private \PSC\Component\ApiBundle\Transformer\Shop $shopTransformer;
|
||||||
|
|
||||||
#[\Symfony\Contracts\Service\Attribute\Required]
|
#[\Symfony\Contracts\Service\Attribute\Required]
|
||||||
public function setAddressTransformer(SerializerInterface $serializer, Address $addressTransformer, Contact $contactTransformer, Account $accountTransformer, Payment $paymentTransformer, Shipping $shippingTransformer, \PSC\Component\ApiBundle\Transformer\Shop $shopTransformer, Operator $operatorTransformer)
|
public function setAddressTransformer(
|
||||||
{
|
SerializerInterface $serializer,
|
||||||
|
Address $addressTransformer,
|
||||||
|
Contact $contactTransformer,
|
||||||
|
Account $accountTransformer,
|
||||||
|
Payment $paymentTransformer,
|
||||||
|
Shipping $shippingTransformer,
|
||||||
|
\PSC\Component\ApiBundle\Transformer\Shop $shopTransformer,
|
||||||
|
Operator $operatorTransformer,
|
||||||
|
) {
|
||||||
$this->addressTransformer = $addressTransformer;
|
$this->addressTransformer = $addressTransformer;
|
||||||
$this->contactTransformer = $contactTransformer;
|
$this->contactTransformer = $contactTransformer;
|
||||||
$this->accountTransformer = $accountTransformer;
|
$this->accountTransformer = $accountTransformer;
|
||||||
@ -51,8 +59,11 @@ class Order extends Base
|
|||||||
$this->operatorTransformer = $operatorTransformer;
|
$this->operatorTransformer = $operatorTransformer;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function fromDb(\PSC\Shop\OrderBundle\Model\Base $order, \PSC\Shop\EntityBundle\Entity\Order $orderEntity, \PSC\Shop\EntityBundle\Document\Order $orderDoc): void
|
public function fromDb(
|
||||||
{
|
\PSC\Shop\OrderBundle\Model\Base $order,
|
||||||
|
\PSC\Shop\EntityBundle\Entity\Order $orderEntity,
|
||||||
|
\PSC\Shop\EntityBundle\Document\Order $orderDoc,
|
||||||
|
): void {
|
||||||
$order->setUuid($orderEntity->getUuid());
|
$order->setUuid($orderEntity->getUuid());
|
||||||
$order->setCreated($orderEntity->getCreated());
|
$order->setCreated($orderEntity->getCreated());
|
||||||
$order->setType($orderEntity->getType());
|
$order->setType($orderEntity->getType());
|
||||||
@ -74,12 +85,14 @@ class Order extends Base
|
|||||||
|
|
||||||
foreach ($orderEntity->getMwertAlle() as $row) {
|
foreach ($orderEntity->getMwertAlle() as $row) {
|
||||||
if (isset($row['name'])) {
|
if (isset($row['name'])) {
|
||||||
$order->addTax(new Tax($row['name'], $row['basis'] ?? 0, $row['value'], TaxEnum::tryFrom($row['type'])));
|
$order->addTax(
|
||||||
|
new Tax($row['name'], $row['basis'] ?? 0, $row['value'], TaxEnum::tryFrom($row['type'])),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->contactTransformer->fromDb($order->getContact(), $orderEntity->getContact());
|
$this->contactTransformer->fromDb($order->getContact(), $orderEntity->getContact());
|
||||||
if ($orderEntity->getAccount()) {
|
if ($orderEntity->getContact()->getAccount()) {
|
||||||
$this->accountTransformer->fromDb($order->getAccount(), $orderEntity->getAccount());
|
$this->accountTransformer->fromDb($order->getAccount(), $orderEntity->getContact()->getAccount());
|
||||||
}
|
}
|
||||||
$this->paymentTransformer->fromDb($order->getPayment(), $orderEntity->getPaymentType());
|
$this->paymentTransformer->fromDb($order->getPayment(), $orderEntity->getPaymentType());
|
||||||
$this->shippingTransformer->fromDb($order->getShipping(), $orderEntity->getShippingType());
|
$this->shippingTransformer->fromDb($order->getShipping(), $orderEntity->getShippingType());
|
||||||
@ -113,8 +126,12 @@ class Order extends Base
|
|||||||
$order->setPluginSettings($orderDoc->getPluginSettings());
|
$order->setPluginSettings($orderDoc->getPluginSettings());
|
||||||
$order->setSendDataToShipping($orderDoc->isSendDataToShipping());
|
$order->setSendDataToShipping($orderDoc->isSendDataToShipping());
|
||||||
|
|
||||||
if ($orderDoc->getVouchers() != "") {
|
if ($orderDoc->getVouchers() != '') {
|
||||||
$order->setVouchers($this->serializer->deserialize($orderDoc->getVouchers(), Voucher::class.'[]', 'json'));
|
$order->setVouchers($this->serializer->deserialize(
|
||||||
|
$orderDoc->getVouchers(),
|
||||||
|
Voucher::class . '[]',
|
||||||
|
'json',
|
||||||
|
));
|
||||||
}
|
}
|
||||||
$operator = new AliasedOperator();
|
$operator = new AliasedOperator();
|
||||||
if ($orderDoc->getOperator() != null) {
|
if ($orderDoc->getOperator() != null) {
|
||||||
@ -124,11 +141,15 @@ class Order extends Base
|
|||||||
}
|
}
|
||||||
$order->setOperator($operator);
|
$order->setOperator($operator);
|
||||||
|
|
||||||
if ($orderDoc->getDiscounts() != "") {
|
if ($orderDoc->getDiscounts() != '') {
|
||||||
$net = 0;
|
$net = 0;
|
||||||
$gross = 0;
|
$gross = 0;
|
||||||
$vat = 0;
|
$vat = 0;
|
||||||
$order->setDiscounts($this->serializer->deserialize($orderDoc->getDiscounts(), Discount::class.'[]', 'json'));
|
$order->setDiscounts($this->serializer->deserialize(
|
||||||
|
$orderDoc->getDiscounts(),
|
||||||
|
Discount::class . '[]',
|
||||||
|
'json',
|
||||||
|
));
|
||||||
foreach ($order->getDiscounts() as $discounts) {
|
foreach ($order->getDiscounts() as $discounts) {
|
||||||
$net += $discounts->getPrice()->getNet();
|
$net += $discounts->getPrice()->getNet();
|
||||||
$vat += $discounts->getPrice()->getVat();
|
$vat += $discounts->getPrice()->getVat();
|
||||||
@ -140,8 +161,11 @@ class Order extends Base
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function toDb(\PSC\Shop\OrderBundle\Model\Base $order, \PSC\Shop\EntityBundle\Entity\Order $orderEntity, \PSC\Shop\EntityBundle\Document\Order $orderDoc): void
|
public function toDb(
|
||||||
{
|
\PSC\Shop\OrderBundle\Model\Base $order,
|
||||||
|
\PSC\Shop\EntityBundle\Entity\Order $orderEntity,
|
||||||
|
\PSC\Shop\EntityBundle\Document\Order $orderDoc,
|
||||||
|
): void {
|
||||||
$orderEntity->setUuid($order->getUuid());
|
$orderEntity->setUuid($order->getUuid());
|
||||||
$orderEntity->setCreated(new \DateTime());
|
$orderEntity->setCreated(new \DateTime());
|
||||||
$orderEntity->setUpdated(new \DateTime());
|
$orderEntity->setUpdated(new \DateTime());
|
||||||
@ -160,7 +184,12 @@ class Order extends Base
|
|||||||
|
|
||||||
$mwertAlle = [];
|
$mwertAlle = [];
|
||||||
foreach ($order->getAllTaxes() as $tax) {
|
foreach ($order->getAllTaxes() as $tax) {
|
||||||
$mwertAlle[] = ['name' => $tax->getName(), 'basis' => $tax->getBasisAmount(), 'value' => $tax->getCalculatedAmount(), 'type' => $tax->getType()->value];
|
$mwertAlle[] = [
|
||||||
|
'name' => $tax->getName(),
|
||||||
|
'basis' => $tax->getBasisAmount(),
|
||||||
|
'value' => $tax->getCalculatedAmount(),
|
||||||
|
'type' => $tax->getType()->value,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
$orderEntity->setMwertAlle(json_encode($mwertAlle));
|
$orderEntity->setMwertAlle(json_encode($mwertAlle));
|
||||||
$orderEntity->setVersion(1);
|
$orderEntity->setVersion(1);
|
||||||
@ -188,7 +217,13 @@ class Order extends Base
|
|||||||
|
|
||||||
$senderDoc = new ContactAddress();
|
$senderDoc = new ContactAddress();
|
||||||
$senderAddress = $order->getSenderAddress();
|
$senderAddress = $order->getSenderAddress();
|
||||||
if ($senderAddress->getUid() == 0 && $senderAddress->getType() == 0 && $senderAddress->getCompany() == "" && $senderAddress->getFirstname() == "" && $senderAddress->getLastname() == "") {
|
if (
|
||||||
|
$senderAddress->getUid() == 0
|
||||||
|
&& $senderAddress->getType() == 0
|
||||||
|
&& $senderAddress->getCompany() == ''
|
||||||
|
&& $senderAddress->getFirstname() == ''
|
||||||
|
&& $senderAddress->getLastname() == ''
|
||||||
|
) {
|
||||||
$order->setSenderAddress($this->shopService->getMongoShopByUid($shopEntity->getUID())->getSenderAddress());
|
$order->setSenderAddress($this->shopService->getMongoShopByUid($shopEntity->getUID())->getSenderAddress());
|
||||||
}
|
}
|
||||||
$this->addressTransformer->toDb($order->getSenderAddress(), $senderDoc);
|
$this->addressTransformer->toDb($order->getSenderAddress(), $senderDoc);
|
||||||
|
|||||||
@ -22,11 +22,6 @@ class Account
|
|||||||
|
|
||||||
public function toDb(\PSC\Shop\AccountBundle\Model\Account $account, Order $orderEntity): void
|
public function toDb(\PSC\Shop\AccountBundle\Model\Account $account, Order $orderEntity): void
|
||||||
{
|
{
|
||||||
$account = $this->entityManager->getRepository(\PSC\Shop\EntityBundle\Entity\Account::class)->findOneBy(['uid' => $account->getUuid()]);
|
|
||||||
if($account) {
|
|
||||||
$orderEntity->setAccount($account);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function fromDb(\PSC\Shop\AccountBundle\Model\Account $account, PSCAccount $accountEntity): void
|
public function fromDb(\PSC\Shop\AccountBundle\Model\Account $account, PSCAccount $accountEntity): void
|
||||||
|
|||||||
@ -727,10 +727,11 @@ class EditController extends AbstractController
|
|||||||
->getRepository('PSC\Shop\EntityBundle\Entity\Product')
|
->getRepository('PSC\Shop\EntityBundle\Entity\Product')
|
||||||
->findOneBy(['uuid' => $uuid, 'shop' => $selectedShop]);
|
->findOneBy(['uuid' => $uuid, 'shop' => $selectedShop]);
|
||||||
|
|
||||||
$sql = 'select count(article_id) as sum from orderspos where article_id = :article_id';
|
$sql = 'select count(article_id) as sum from orderspos where article_id = ?';
|
||||||
|
|
||||||
$stmt = $entityManager->getConnection()->prepare($sql);
|
$stmt = $entityManager->getConnection()->prepare($sql);
|
||||||
$result = $stmt->executeQuery(['article_id' => $product->getUID()]);
|
$stmt->bindValue(1, $product->getUID());
|
||||||
|
$result = $stmt->executeQuery();
|
||||||
$count = (int) $result->fetchOne();
|
$count = (int) $result->fetchOne();
|
||||||
|
|
||||||
$form = $this->createForm(DeleteType::class);
|
$form = $this->createForm(DeleteType::class);
|
||||||
|
|||||||
@ -0,0 +1,14 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace PSC\System\UpdateBundle\Migrations;
|
||||||
|
|
||||||
|
class Version20260217102512 extends Base
|
||||||
|
{
|
||||||
|
public function migrateDatabase(): void
|
||||||
|
{
|
||||||
|
$this->entityManager->getConnection()->executeQuery('ALTER TABLE orders DROP COLUMN account_id;');
|
||||||
|
$this->entityManager->getConnection()->executeQuery('ALTER TABLE orders DROP COLUMN install_id ;');
|
||||||
|
$this->entityManager->getConnection()->executeQuery('ALTER TABLE orderspos DROP COLUMN install_id ;');
|
||||||
|
$this->entityManager->getConnection()->executeQuery('ALTER TABLE orderspos DROP COLUMN account_id;');
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -11,7 +11,6 @@ use PSC\Shop\MotivBundle\Form\Backend\MotivGroupType;
|
|||||||
use PSC\Shop\MotivBundle\Form\Backend\MotivType;
|
use PSC\Shop\MotivBundle\Form\Backend\MotivType;
|
||||||
use PSC\Shop\MotivBundle\Form\Backend\SearchType;
|
use PSC\Shop\MotivBundle\Form\Backend\SearchType;
|
||||||
use PSC\System\SettingsBundle\Service\Shop;
|
use PSC\System\SettingsBundle\Service\Shop;
|
||||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
|
||||||
use Symfony\Bridge\Twig\Attribute\Template;
|
use Symfony\Bridge\Twig\Attribute\Template;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
||||||
@ -19,6 +18,7 @@ use Symfony\Component\HttpFoundation\JsonResponse;
|
|||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Session\SessionInterface;
|
use Symfony\Component\HttpFoundation\Session\SessionInterface;
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
|
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MotivController fürs Backend
|
* MotivController fürs Backend
|
||||||
@ -29,7 +29,7 @@ use Symfony\Component\Routing\Annotation\Route;
|
|||||||
class GroupController extends AbstractController
|
class GroupController extends AbstractController
|
||||||
{
|
{
|
||||||
#[IsGranted('ROLE_ADMIN')]
|
#[IsGranted('ROLE_ADMIN')]
|
||||||
#[Template('@PluginCustomPSCCreativeLayouterControllerBackend/group/index.html.twig')]
|
#[Template('@PluginCustomPSCCreativeLayouter/backend/group/index.html.twig')]
|
||||||
#[Route('/group/list/index', name: 'psc_shop_motive_backend_group_list_index')]
|
#[Route('/group/list/index', name: 'psc_shop_motive_backend_group_list_index')]
|
||||||
public function indexAction(Shop $shopService, DocumentManager $documentManager)
|
public function indexAction(Shop $shopService, DocumentManager $documentManager)
|
||||||
{
|
{
|
||||||
@ -45,7 +45,7 @@ class GroupController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[IsGranted('ROLE_ADMIN')]
|
#[IsGranted('ROLE_ADMIN')]
|
||||||
#[Template('@PluginCustomPSCCreativeLayouterControllerBackend/group/create.html.twig')]
|
#[Template('@PluginCustomPSCCreativeLayouter/backend/group/create.html.twig')]
|
||||||
#[Route('/group/create', name: 'psc_shop_motive_backend_group_create')]
|
#[Route('/group/create', name: 'psc_shop_motive_backend_group_create')]
|
||||||
public function createAction(
|
public function createAction(
|
||||||
Request $request,
|
Request $request,
|
||||||
@ -76,7 +76,7 @@ class GroupController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[IsGranted('ROLE_ADMIN')]
|
#[IsGranted('ROLE_ADMIN')]
|
||||||
#[Template('@PluginCustomPSCCreativeLayouterControllerBackend/group/edit.html.twig')]
|
#[Template('@PluginCustomPSCCreativeLayouter/backend/group/edit.html.twig')]
|
||||||
#[Route('/group/edit/{uuid}', name: 'psc_shop_motive_backend_group_edit')]
|
#[Route('/group/edit/{uuid}', name: 'psc_shop_motive_backend_group_edit')]
|
||||||
public function editAction(Request $request, SessionInterface $session, DocumentManager $documentManager, $uuid)
|
public function editAction(Request $request, SessionInterface $session, DocumentManager $documentManager, $uuid)
|
||||||
{
|
{
|
||||||
@ -102,7 +102,7 @@ class GroupController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[IsGranted('ROLE_ADMIN')]
|
#[IsGranted('ROLE_ADMIN')]
|
||||||
#[Template('@PluginCustomPSCCreativeLayouterControllerBackend/group/delete.html.twig')]
|
#[Template('@PluginCustomPSCCreativeLayouter/backend/group/delete.html.twig')]
|
||||||
#[Route('/group/delete/{uuid}', name: 'psc_shop_motive_backend_group_delete')]
|
#[Route('/group/delete/{uuid}', name: 'psc_shop_motive_backend_group_delete')]
|
||||||
public function deleteAction(Request $request, SessionInterface $session, DocumentManager $documentManager, $uuid)
|
public function deleteAction(Request $request, SessionInterface $session, DocumentManager $documentManager, $uuid)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -7,19 +7,19 @@ use Doctrine\ORM\Mapping\Entity;
|
|||||||
use Gaufrette\FilesystemMapInterface;
|
use Gaufrette\FilesystemMapInterface;
|
||||||
use Knp\Bundle\GaufretteBundle\FilesystemMap;
|
use Knp\Bundle\GaufretteBundle\FilesystemMap;
|
||||||
use Knp\Component\Pager\PaginatorInterface;
|
use Knp\Component\Pager\PaginatorInterface;
|
||||||
use Spiriit\Bundle\FormFilterBundle\Filter\FilterBuilderUpdaterInterface;
|
|
||||||
use PSC\Shop\EntityBundle\Entity\Motiv;
|
use PSC\Shop\EntityBundle\Entity\Motiv;
|
||||||
use PSC\Shop\MotivBundle\Form\Backend\MotivType;
|
use PSC\Shop\MotivBundle\Form\Backend\MotivType;
|
||||||
use PSC\Shop\MotivBundle\Form\Backend\SearchType;
|
use PSC\Shop\MotivBundle\Form\Backend\SearchType;
|
||||||
use PSC\Shop\MotivBundle\Form\Backend\SwapType;
|
use PSC\Shop\MotivBundle\Form\Backend\SwapType;
|
||||||
use PSC\System\SettingsBundle\Service\Shop;
|
use PSC\System\SettingsBundle\Service\Shop;
|
||||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
use Spiriit\Bundle\FormFilterBundle\Filter\FilterBuilderUpdaterInterface;
|
||||||
use Symfony\Bridge\Twig\Attribute\Template;
|
use Symfony\Bridge\Twig\Attribute\Template;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
||||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
|
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MotivController fürs Backend
|
* MotivController fürs Backend
|
||||||
@ -29,22 +29,9 @@ use Symfony\Component\Routing\Annotation\Route;
|
|||||||
*/
|
*/
|
||||||
class ListController extends AbstractController
|
class ListController extends AbstractController
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* Default Seite
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @param Request $request
|
|
||||||
* @param Shop $shopService
|
|
||||||
* @param PaginatorInterface $paginator
|
|
||||||
* @param EntityManagerInterface $entityManager
|
|
||||||
* @param FilterBuilderUpdaterInterface $filterBuilderUpdater
|
|
||||||
* @return array
|
|
||||||
* @throws \Doctrine\ORM\ORMException
|
|
||||||
*/
|
|
||||||
#[IsGranted('ROLE_ADMIN')]
|
#[IsGranted('ROLE_ADMIN')]
|
||||||
#[Route(path: '/list/index', name: 'psc_shop_motive_backend_list_index')]
|
#[Route(path: '/list/index', name: 'psc_shop_motive_backend_list_index')]
|
||||||
#[Template('@PluginCustomPSCCreativeLayouterControllerBackend/list/index.html.twig')]
|
#[Template('@PluginCustomPSCCreativeLayouter/backend/list/index.html.twig')]
|
||||||
public function indexAction(
|
public function indexAction(
|
||||||
Request $request,
|
Request $request,
|
||||||
Shop $shopService,
|
Shop $shopService,
|
||||||
@ -73,21 +60,8 @@ class ListController extends AbstractController
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Swap
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @param Request $request
|
|
||||||
* @param Shop $shopService
|
|
||||||
* @param EntityManagerInterface $entityManager
|
|
||||||
* @param FilesystemMap $filesystemMap
|
|
||||||
* @param $uuid
|
|
||||||
* @return array|\Symfony\Component\HttpFoundation\RedirectResponse
|
|
||||||
* @throws \Doctrine\ORM\ORMException
|
|
||||||
* @throws \ImagickException
|
|
||||||
*/
|
|
||||||
#[Route(path: '/list/swap/{uuid}', name: 'psc_shop_motive_backend_list_swap')]
|
#[Route(path: '/list/swap/{uuid}', name: 'psc_shop_motive_backend_list_swap')]
|
||||||
#[Template('@PluginCustomPSCCreativeLayouterControllerBackend/list/swap.html.twig')]
|
#[Template('@PluginCustomPSCCreativeLayouter/backend/list/swap.html.twig')]
|
||||||
public function swapAction(
|
public function swapAction(
|
||||||
Request $request,
|
Request $request,
|
||||||
Shop $shopService,
|
Shop $shopService,
|
||||||
@ -204,31 +178,13 @@ class ListController extends AbstractController
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Default Seite
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @return View
|
|
||||||
*/
|
|
||||||
#[Route(path: '/list/upload', name: 'psc_shop_motive_backend_list_upload')]
|
#[Route(path: '/list/upload', name: 'psc_shop_motive_backend_list_upload')]
|
||||||
#[Template('@PluginCustomPSCCreativeLayouterControllerBackend/list/upload.html.twig')]
|
#[Template('@PluginCustomPSCCreativeLayouter/backend/list/upload.html.twig')]
|
||||||
public function uploadAction()
|
public function uploadAction()
|
||||||
{
|
{
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Default Seite
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @param Request $request
|
|
||||||
* @param Shop $shopService
|
|
||||||
* @param EntityManagerInterface $entityManager
|
|
||||||
* @param FilesystemMapInterface $filesystemMap
|
|
||||||
* @return JsonResponse
|
|
||||||
* @throws \Doctrine\ORM\ORMException
|
|
||||||
* @throws \ImagickException
|
|
||||||
*/
|
|
||||||
#[Route(path: '/list/upload/do', name: 'psc_shop_motive_backend_list_upload_do')]
|
#[Route(path: '/list/upload/do', name: 'psc_shop_motive_backend_list_upload_do')]
|
||||||
public function doUploadAction(
|
public function doUploadAction(
|
||||||
Request $request,
|
Request $request,
|
||||||
@ -345,15 +301,7 @@ class ListController extends AbstractController
|
|||||||
return $json;
|
return $json;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
#[Template('@PluginCustomPSCCreativeLayouter/backend/list/edit.html.twig')]
|
||||||
* dataAction
|
|
||||||
*
|
|
||||||
* @template()
|
|
||||||
*
|
|
||||||
* @param Request $request Request
|
|
||||||
* @param string $uuid Uuid
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
#[Route(path: '/list/edit/{uuid}', name: 'backend_production_motive_list_edit')]
|
#[Route(path: '/list/edit/{uuid}', name: 'backend_production_motive_list_edit')]
|
||||||
public function editAction(Request $request, Shop $shopService, EntityManagerInterface $entityManager, $uuid)
|
public function editAction(Request $request, Shop $shopService, EntityManagerInterface $entityManager, $uuid)
|
||||||
{
|
{
|
||||||
@ -391,13 +339,6 @@ class ListController extends AbstractController
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* dataAction
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @param string $uuid Uuid
|
|
||||||
* @return View
|
|
||||||
*/
|
|
||||||
#[Route(path: '/list/delete/{uuid}', name: 'backend_production_motive_list_delete')]
|
#[Route(path: '/list/delete/{uuid}', name: 'backend_production_motive_list_delete')]
|
||||||
public function deleteAction($uuid, Shop $shopService, EntityManagerInterface $entityManager)
|
public function deleteAction($uuid, Shop $shopService, EntityManagerInterface $entityManager)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -4,35 +4,23 @@ namespace Plugin\Custom\PSC\CreativeLayouter\Controller\Backend;
|
|||||||
|
|
||||||
use Doctrine\ODM\MongoDB\DocumentManager;
|
use Doctrine\ODM\MongoDB\DocumentManager;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Plugin\System\PSC\CreativeLayouter\Form\XML\EditType;
|
use Plugin\Custom\PSC\CreativeLayouter\Form\XML\EditType;
|
||||||
use PSC\Shop\EntityBundle\Document\Shop;
|
use PSC\Shop\EntityBundle\Document\Shop;
|
||||||
use PSC\Shop\EntityBundle\Entity\Account;
|
use PSC\Shop\EntityBundle\Entity\Account;
|
||||||
use PSC\Shop\EntityBundle\Entity\Product;
|
use PSC\Shop\EntityBundle\Entity\Product;
|
||||||
use PSC\Shop\EntityBundle\Entity\Stockbooking;
|
use PSC\Shop\EntityBundle\Entity\Stockbooking;
|
||||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
|
||||||
use Symfony\Bridge\Twig\Attribute\Template;
|
use Symfony\Bridge\Twig\Attribute\Template;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
||||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
use Symfony\Component\Routing\Attribute\Route;
|
||||||
use Symfony\Component\Security\Core\SecurityContext;
|
use Symfony\Component\Security\Core\SecurityContext;
|
||||||
|
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||||
|
|
||||||
class XmlController extends AbstractController
|
class XmlController extends AbstractController
|
||||||
{
|
{
|
||||||
/**
|
#[Template('@PluginCustomPSCCreativeLayouter/backend/xml/edit.html.twig')]
|
||||||
* creative
|
|
||||||
*
|
|
||||||
* @template()
|
|
||||||
*
|
|
||||||
* @param Request $request Request
|
|
||||||
* @param \PSC\System\SettingsBundle\Service\Shop $shopService
|
|
||||||
* @param EntityManagerInterface $entityManager
|
|
||||||
* @param string $uuid Uuid
|
|
||||||
*
|
|
||||||
* @return array
|
|
||||||
* @throws \Doctrine\ORM\ORMException
|
|
||||||
*/
|
|
||||||
#[Route(path: '/xml/edit/{uuid}', name: 'psc_plugin_creativelayouter_backend_xml_edit')]
|
#[Route(path: '/xml/edit/{uuid}', name: 'psc_plugin_creativelayouter_backend_xml_edit')]
|
||||||
public function editAction(
|
public function editAction(
|
||||||
Request $request,
|
Request $request,
|
||||||
@ -79,4 +67,3 @@ class XmlController extends AbstractController
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -67,23 +67,7 @@ class Preview
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'text':
|
case 'text':
|
||||||
// Build dynamic text with content area info and tab number
|
$text = $marker['text'] ?? '';
|
||||||
$contentAreaWidth = $configData['contentAreaWidth'] ?? 0;
|
|
||||||
$contentAreaHeight = $configData['contentAreaHeight'] ?? 0;
|
|
||||||
$contentAreaLeft = $configData['contentAreaLeft'] ?? 0;
|
|
||||||
$contentAreaTop = $configData['contentAreaTop'] ?? 0;
|
|
||||||
$tabNumber = $currentFile['tabNumber'] ?? '?';
|
|
||||||
$unit = $configData['unit'] ?? 'mm';
|
|
||||||
|
|
||||||
$text = sprintf(
|
|
||||||
'Inhalt: %.1f x %.1f %s @ (%.1f, %.1f) | Tab: %s',
|
|
||||||
$contentAreaWidth,
|
|
||||||
$contentAreaHeight,
|
|
||||||
$unit,
|
|
||||||
$contentAreaLeft,
|
|
||||||
$contentAreaTop,
|
|
||||||
$tabNumber,
|
|
||||||
);
|
|
||||||
|
|
||||||
// Save state and rotate text 90° counter-clockwise (vertical, bottom to top)
|
// Save state and rotate text 90° counter-clockwise (vertical, bottom to top)
|
||||||
$pdf->StartTransform();
|
$pdf->StartTransform();
|
||||||
@ -101,20 +85,10 @@ class Preview
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'triangle':
|
case 'triangle':
|
||||||
// Draw an upward-pointing triangle with configurable side length
|
// Render chr(94) = "^" as triangle marker
|
||||||
$height = ($size * sqrt(3)) / 2; // Height of equilateral triangle
|
$pdf->SetFont('helvetica', 'B', $size);
|
||||||
|
$pdf->SetTextColor(0, 0, 0);
|
||||||
// Calculate triangle points (pointing up)
|
$pdf->Text($x, $y, chr(94));
|
||||||
$points = [
|
|
||||||
$x,
|
|
||||||
$y - ((2 * $height) / 3), // Top point
|
|
||||||
$x - ($size / 2),
|
|
||||||
$y + ($height / 3), // Bottom left
|
|
||||||
$x + ($size / 2),
|
|
||||||
$y + ($height / 3), // Bottom right
|
|
||||||
];
|
|
||||||
|
|
||||||
$pdf->Polygon($points, 'F');
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -169,8 +143,6 @@ class Preview
|
|||||||
$boxY = 40;
|
$boxY = 40;
|
||||||
$boxW = 20;
|
$boxW = 20;
|
||||||
$boxH = 10;
|
$boxH = 10;
|
||||||
$fontSize = 14; // Schriftgröße bleibt in pt
|
|
||||||
|
|
||||||
$pdf = new Fpdi($configData['orientation'], $configData['unit'], [$configData['width'], $configData['height']]);
|
$pdf = new Fpdi($configData['orientation'], $configData['unit'], [$configData['width'], $configData['height']]);
|
||||||
$pdf->setPrintHeader(false);
|
$pdf->setPrintHeader(false);
|
||||||
$pdf->setPrintFooter(false);
|
$pdf->setPrintFooter(false);
|
||||||
@ -190,12 +162,9 @@ class Preview
|
|||||||
false,
|
false,
|
||||||
);
|
);
|
||||||
|
|
||||||
dump($file);
|
|
||||||
dump($configData);
|
|
||||||
$tab = array_filter($configData['tabPositions'], function ($item) use ($file) {
|
$tab = array_filter($configData['tabPositions'], function ($item) use ($file) {
|
||||||
return $item['tabNumber'] == $file['tabNumber'] ? $item : null;
|
return $item['tabNumber'] == $file['tabNumber'] ? $item : null;
|
||||||
});
|
});
|
||||||
dump($tab);
|
|
||||||
$tab = array_shift($tab);
|
$tab = array_shift($tab);
|
||||||
// Render OCR markers on this page
|
// Render OCR markers on this page
|
||||||
$this->renderOcrMarkers($pdf, $configData['ocrMarkers'] ?? [], $configData, $file);
|
$this->renderOcrMarkers($pdf, $configData['ocrMarkers'] ?? [], $configData, $file);
|
||||||
@ -206,7 +175,7 @@ class Preview
|
|||||||
$pdf->Rect($tab['x'], $tab['y'], $tab['width'], $tab['height'], 'F');
|
$pdf->Rect($tab['x'], $tab['y'], $tab['width'], $tab['height'], 'F');
|
||||||
|
|
||||||
// Draw text in black
|
// Draw text in black
|
||||||
$pdf->SetFont('helvetica', '', $fontSize);
|
$pdf->SetFont('helvetica', $tab['bold'] ?? false ? 'B' : '', $tab['fontSize'] ?? 14);
|
||||||
$pdf->SetTextColor(0, 0, 0); // Always black text
|
$pdf->SetTextColor(0, 0, 0); // Always black text
|
||||||
$pdf->MultiCell(
|
$pdf->MultiCell(
|
||||||
$tab['width'],
|
$tab['width'],
|
||||||
@ -245,10 +214,10 @@ class Preview
|
|||||||
// Draw colored background rectangle
|
// Draw colored background rectangle
|
||||||
$bgColor = $this->getBackgroundColor($file['color']);
|
$bgColor = $this->getBackgroundColor($file['color']);
|
||||||
$pdf->SetFillColor($bgColor[0], $bgColor[1], $bgColor[2]);
|
$pdf->SetFillColor($bgColor[0], $bgColor[1], $bgColor[2]);
|
||||||
$pdf->Rect($xPos, $tab['y'], $tab['width'], $tab['height'], 'F');
|
$pdf->Rect($xPos - 1, $tab['y'] - 1, $tab['width'] + 2, $tab['height'] + 1, 'F');
|
||||||
|
|
||||||
// Draw text in black
|
// Draw text in black
|
||||||
$pdf->SetFont('helvetica', '', $fontSize);
|
$pdf->SetFont('helvetica', $tab['bold'] ?? false ? 'B' : '', $tab['fontSize'] ?? 14);
|
||||||
$pdf->SetTextColor(0, 0, 0); // Always black text
|
$pdf->SetTextColor(0, 0, 0); // Always black text
|
||||||
$pdf->MultiCell(
|
$pdf->MultiCell(
|
||||||
$tab['width'],
|
$tab['width'],
|
||||||
@ -296,7 +265,7 @@ class Preview
|
|||||||
$pdf->Rect($tab['x'], $tab['y'], $tab['width'], $tab['height'], 'F');
|
$pdf->Rect($tab['x'], $tab['y'], $tab['width'], $tab['height'], 'F');
|
||||||
|
|
||||||
// Draw text in black
|
// Draw text in black
|
||||||
$pdf->SetFont('helvetica', '', $fontSize);
|
$pdf->SetFont('helvetica', $tab['bold'] ?? false ? 'B' : '', $tab['fontSize'] ?? 14);
|
||||||
$pdf->SetTextColor(0, 0, 0); // Always black text
|
$pdf->SetTextColor(0, 0, 0); // Always black text
|
||||||
$pdf->MultiCell(
|
$pdf->MultiCell(
|
||||||
$tab['width'],
|
$tab['width'],
|
||||||
@ -322,10 +291,10 @@ class Preview
|
|||||||
|
|
||||||
// Draw colored background rectangle
|
// Draw colored background rectangle
|
||||||
$pdf->SetFillColor($bgColor[0], $bgColor[1], $bgColor[2]);
|
$pdf->SetFillColor($bgColor[0], $bgColor[1], $bgColor[2]);
|
||||||
$pdf->Rect($xPos, $tab['y'], $tab['width'], $tab['height'], 'F');
|
$pdf->Rect($xPos - 1, $tab['y'] - 1, $tab['width'] + 2, $tab['height'] + 1, 'F');
|
||||||
|
|
||||||
// Draw text in black
|
// Draw text in black
|
||||||
$pdf->SetFont('helvetica', '', $fontSize);
|
$pdf->SetFont('helvetica', $tab['bold'] ?? false ? 'B' : '', $tab['fontSize'] ?? 14);
|
||||||
$pdf->SetTextColor(0, 0, 0); // Always black text
|
$pdf->SetTextColor(0, 0, 0); // Always black text
|
||||||
$pdf->MultiCell(
|
$pdf->MultiCell(
|
||||||
$tab['width'],
|
$tab['width'],
|
||||||
|
|||||||
@ -121,11 +121,17 @@ class IndexController extends AbstractController
|
|||||||
$setting->setOcrMarkers($ocrMarkers);
|
$setting->setOcrMarkers($ocrMarkers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ensure tab positions match the tabs count
|
||||||
|
$this->ensureTabPositionsCount($setting);
|
||||||
|
|
||||||
// Create tab positions form
|
// Create tab positions form
|
||||||
$tabPositionsForm = $this->createForm(TabPositions::class, $setting);
|
$tabPositionsForm = $this->createForm(TabPositions::class, $setting);
|
||||||
$tabPositionsForm->handleRequest($request);
|
$tabPositionsForm->handleRequest($request);
|
||||||
|
|
||||||
if ($tabPositionsForm->isSubmitted() && $tabPositionsForm->isValid()) {
|
if ($tabPositionsForm->isSubmitted() && $tabPositionsForm->isValid()) {
|
||||||
|
// Ensure tab positions match the (possibly changed) tabs count
|
||||||
|
$this->ensureTabPositionsCount($setting);
|
||||||
|
|
||||||
// Save settings to MongoDB
|
// Save settings to MongoDB
|
||||||
$configArray = json_decode($serializer->serialize($setting, 'json'), true);
|
$configArray = json_decode($serializer->serialize($setting, 'json'), true);
|
||||||
$productDoc->setPluginSettingModule('laufkartenlayouter', 'config', $configArray);
|
$productDoc->setPluginSettingModule('laufkartenlayouter', 'config', $configArray);
|
||||||
@ -143,4 +149,28 @@ class IndexController extends AbstractController
|
|||||||
'setting' => $setting,
|
'setting' => $setting,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function ensureTabPositionsCount(Setting $setting): void
|
||||||
|
{
|
||||||
|
$tabPositions = $setting->getTabPositions();
|
||||||
|
$currentCount = count($tabPositions);
|
||||||
|
$targetCount = $setting->getTabs();
|
||||||
|
|
||||||
|
if ($currentCount < $targetCount) {
|
||||||
|
// Add missing tab positions
|
||||||
|
for ($i = $currentCount + 1; $i <= $targetCount; $i++) {
|
||||||
|
$tabPosition = new \Plugin\Custom\PSC\LaufkartenLayouter\Model\TabPosition();
|
||||||
|
$tabPosition->setTabNumber($i);
|
||||||
|
$tabPosition->setX(0.0);
|
||||||
|
$tabPosition->setY(0.0);
|
||||||
|
$tabPosition->setWidth(0.0);
|
||||||
|
$tabPosition->setHeight(0.0);
|
||||||
|
$tabPositions[] = $tabPosition;
|
||||||
|
}
|
||||||
|
$setting->setTabPositions($tabPositions);
|
||||||
|
} elseif ($currentCount > $targetCount) {
|
||||||
|
// Remove excess tab positions
|
||||||
|
$setting->setTabPositions(array_slice($tabPositions, 0, $targetCount));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -45,6 +45,10 @@ class OcrMarker extends AbstractType
|
|||||||
'html5' => true,
|
'html5' => true,
|
||||||
'attr' => ['step' => '0.1', 'min' => '0.1'],
|
'attr' => ['step' => '0.1', 'min' => '0.1'],
|
||||||
'help' => 'Durchmesser in mm für Dots, Schriftgröße für Text, Seitenlänge für Dreieck',
|
'help' => 'Durchmesser in mm für Dots, Schriftgröße für Text, Seitenlänge für Dreieck',
|
||||||
|
])
|
||||||
|
->add('text', TextType::class, [
|
||||||
|
'label' => 'Text',
|
||||||
|
'required' => false,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
namespace Plugin\Custom\PSC\LaufkartenLayouter\Form;
|
namespace Plugin\Custom\PSC\LaufkartenLayouter\Form;
|
||||||
|
|
||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
|
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
|
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\NumberType;
|
use Symfony\Component\Form\Extension\Core\Type\NumberType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
@ -40,6 +41,16 @@ class TabPosition extends AbstractType
|
|||||||
'scale' => 1,
|
'scale' => 1,
|
||||||
'html5' => true,
|
'html5' => true,
|
||||||
'attr' => ['step' => '0.1'],
|
'attr' => ['step' => '0.1'],
|
||||||
|
])
|
||||||
|
->add('fontSize', NumberType::class, [
|
||||||
|
'label' => 'Schriftgröße (pt)',
|
||||||
|
'scale' => 1,
|
||||||
|
'html5' => true,
|
||||||
|
'attr' => ['step' => '0.5'],
|
||||||
|
])
|
||||||
|
->add('bold', CheckboxType::class, [
|
||||||
|
'label' => 'Fett',
|
||||||
|
'required' => false,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -9,6 +9,7 @@ class OcrMarker
|
|||||||
private float $x = 0.0;
|
private float $x = 0.0;
|
||||||
private float $y = 0.0;
|
private float $y = 0.0;
|
||||||
private float $size = 2.0; // Diameter in mm for dots, font size for text, size for triangle
|
private float $size = 2.0; // Diameter in mm for dots, font size for text, size for triangle
|
||||||
|
private string $text = '';
|
||||||
|
|
||||||
public function getType(): string
|
public function getType(): string
|
||||||
{
|
{
|
||||||
@ -64,4 +65,15 @@ class OcrMarker
|
|||||||
$this->size = $size;
|
$this->size = $size;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getText(): string
|
||||||
|
{
|
||||||
|
return $this->text;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setText(string $text): self
|
||||||
|
{
|
||||||
|
$this->text = $text;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,6 +9,8 @@ class TabPosition
|
|||||||
private float $y = 0.0;
|
private float $y = 0.0;
|
||||||
private float $width = 0.0;
|
private float $width = 0.0;
|
||||||
private float $height = 0.0;
|
private float $height = 0.0;
|
||||||
|
private float $fontSize = 14.0;
|
||||||
|
private bool $bold = false;
|
||||||
|
|
||||||
public function getTabNumber(): int
|
public function getTabNumber(): int
|
||||||
{
|
{
|
||||||
@ -64,4 +66,26 @@ class TabPosition
|
|||||||
$this->height = $height;
|
$this->height = $height;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getFontSize(): float
|
||||||
|
{
|
||||||
|
return $this->fontSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setFontSize(float $fontSize): self
|
||||||
|
{
|
||||||
|
$this->fontSize = $fontSize;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function isBold(): bool
|
||||||
|
{
|
||||||
|
return $this->bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setBold(bool $bold): self
|
||||||
|
{
|
||||||
|
$this->bold = $bold;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,306 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Plugin\Custom\PSC\LaufkartenLayouter\Queue;
|
||||||
|
|
||||||
|
use Doctrine\ODM\MongoDB\DocumentManager;
|
||||||
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
|
use PSC\Shop\EntityBundle\Document\Queue;
|
||||||
|
use PSC\Shop\EntityBundle\Entity\Layoutdesigndata;
|
||||||
|
use PSC\Shop\EntityBundle\Entity\Orderpos;
|
||||||
|
use PSC\Shop\EntityBundle\Entity\Product;
|
||||||
|
use PSC\Shop\MediaBundle\Service\MediaManager;
|
||||||
|
use PSC\Shop\QueueBundle\Event\EventInterface;
|
||||||
|
use PSC\Shop\QueueBundle\Type\ConfigurableElementInterface;
|
||||||
|
use PSC\Shop\QueueBundle\Type\QueueInterface;
|
||||||
|
use setasign\Fpdi\Tcpdf\Fpdi;
|
||||||
|
use Symfony\Component\DependencyInjection\Attribute\AutoconfigureTag;
|
||||||
|
use Symfony\Component\Form\Form;
|
||||||
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
|
|
||||||
|
require_once __DIR__ . '/../../../../../../src/PSC/Shop/EntityBundle/Lagacy/TP_Basket_Item.php';
|
||||||
|
|
||||||
|
#[AutoconfigureTag('queues')]
|
||||||
|
class Render implements QueueInterface, ConfigurableElementInterface
|
||||||
|
{
|
||||||
|
public function __construct(
|
||||||
|
private EntityManagerInterface $entityManager,
|
||||||
|
private DocumentManager $documentManager,
|
||||||
|
private MediaManager $mediaManager,
|
||||||
|
) {}
|
||||||
|
|
||||||
|
public function getType(): string
|
||||||
|
{
|
||||||
|
return 'plugin_custom_psc_laufkartenlayouter_queue_render';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getGroup(): string
|
||||||
|
{
|
||||||
|
return 'Layouter';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDescription(): string
|
||||||
|
{
|
||||||
|
return 'LaufkartenLayouter Renderer';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getName(): string
|
||||||
|
{
|
||||||
|
return 'LaufkartenLayouter Renderer';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getForm(FormBuilderInterface $builder, $form_options, EventInterface $event): void
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public function injectDocument(Form $form, EventInterface $event, Queue $objQueue): void
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setFormData(Form $form, EventInterface $event, Queue $queueObj): void
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getTemplate(): void
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public function execute(EventInterface $event, Queue $doc): bool
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
set_time_limit(0);
|
||||||
|
|
||||||
|
$orderspos = $this->entityManager
|
||||||
|
->getRepository(Orderpos::class)
|
||||||
|
->findby(['layouterMode' => 106, 'renderPrint' => 1]);
|
||||||
|
|
||||||
|
/** @var Orderpos $pos */
|
||||||
|
foreach ($orderspos as $pos) {
|
||||||
|
/** @var \TP_Basket_Item $objPosition */
|
||||||
|
$objPosition = unserialize($pos->getData());
|
||||||
|
|
||||||
|
if ($objPosition->getLayouterId() === '') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$layoutDesignData = $this->entityManager
|
||||||
|
->getRepository(Layoutdesigndata::class)
|
||||||
|
->findOneBy(['uuid' => $objPosition->getLayouterId()]);
|
||||||
|
|
||||||
|
if (!$layoutDesignData) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$design = $layoutDesignData->getDesign();
|
||||||
|
$files = $design['files'] ?? [];
|
||||||
|
|
||||||
|
// Load product config from MongoDB
|
||||||
|
/** @var Product $product */
|
||||||
|
$product = $this->entityManager
|
||||||
|
->getRepository(Product::class)
|
||||||
|
->findOneBy(['uuid' => $layoutDesignData->getArticleUuid()]);
|
||||||
|
|
||||||
|
$productDoc = $this->documentManager
|
||||||
|
->getRepository('PSC\\Shop\\EntityBundle\\Document\\Product')
|
||||||
|
->findOneBy(['uid' => (string) $product->getUid()]);
|
||||||
|
|
||||||
|
$configData = $productDoc->getPluginSettingModule('laufkartenlayouter', 'config');
|
||||||
|
|
||||||
|
// Build output path
|
||||||
|
$outDir =
|
||||||
|
'/data/www/old/market/steplayouter/basket/' . $pos->getOrder()->getUid() . '/' . $pos->getPos();
|
||||||
|
if (!file_exists($outDir)) {
|
||||||
|
mkdir($outDir, 0777, true);
|
||||||
|
}
|
||||||
|
$outFile = $outDir . '/' . $pos->getOrder()->getAlias() . '_' . $pos->getPos() . '.pdf';
|
||||||
|
|
||||||
|
// Generate PDF
|
||||||
|
$this->generatePdf($files, $configData, $outFile);
|
||||||
|
|
||||||
|
$pos->setRenderPrint(0);
|
||||||
|
$this->entityManager->persist($pos);
|
||||||
|
$this->entityManager->flush();
|
||||||
|
}
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
echo $e->getLine();
|
||||||
|
echo $e->getMessage();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function generatePdf(array $files, array $configData, string $outFile): void
|
||||||
|
{
|
||||||
|
$pdf = new Fpdi($configData['orientation'], $configData['unit'], [$configData['width'], $configData['height']]);
|
||||||
|
$pdf->setPrintHeader(false);
|
||||||
|
$pdf->setPrintFooter(false);
|
||||||
|
|
||||||
|
$frontSide = true;
|
||||||
|
foreach ($files as $file) {
|
||||||
|
$media = $this->mediaManager->getModelByUuid($file['uuid']['$oid']);
|
||||||
|
$pdf->setSourceFile($media->getCompletePath());
|
||||||
|
|
||||||
|
$tab = $this->findTab($configData['tabPositions'], $file['tabNumber']);
|
||||||
|
|
||||||
|
if ($file['numPages'] > 1) {
|
||||||
|
// Page 1 (front)
|
||||||
|
$tpl = $pdf->importPage(1);
|
||||||
|
$pdf->AddPage($configData['orientation'], [$configData['width'], $configData['height']]);
|
||||||
|
$pdf->useTemplate(
|
||||||
|
$tpl,
|
||||||
|
$configData['contentAreaLeft'],
|
||||||
|
$configData['contentAreaTop'],
|
||||||
|
$configData['contentAreaWidth'],
|
||||||
|
$configData['contentAreaHeight'],
|
||||||
|
false,
|
||||||
|
);
|
||||||
|
$this->renderOcrMarkers($pdf, $configData['ocrMarkers'] ?? []);
|
||||||
|
$this->drawTab($pdf, $tab, $tab['x'], $tab['y'], $file);
|
||||||
|
|
||||||
|
// Page 2 (back, mirrored)
|
||||||
|
$tpl = $pdf->importPage(2);
|
||||||
|
$pdf->AddPage($configData['orientation'], [$configData['width'], $configData['height']]);
|
||||||
|
$pdf->useTemplate(
|
||||||
|
$tpl,
|
||||||
|
$configData['contentAreaLeft'],
|
||||||
|
$configData['contentAreaTop'],
|
||||||
|
$configData['contentAreaWidth'],
|
||||||
|
$configData['contentAreaHeight'],
|
||||||
|
false,
|
||||||
|
);
|
||||||
|
$this->renderOcrMarkers($pdf, $configData['ocrMarkers'] ?? []);
|
||||||
|
$xPos = $configData['width'] - $tab['width'] - $tab['x'];
|
||||||
|
$this->drawTab($pdf, $tab, $xPos - 1, $tab['y'] - 1, $file, $tab['width'] + 2, $tab['height'] + 1);
|
||||||
|
} else {
|
||||||
|
$tpl = $pdf->importPage(1);
|
||||||
|
$pdf->AddPage($configData['orientation'], [$configData['width'], $configData['height']]);
|
||||||
|
$pdf->useTemplate(
|
||||||
|
$tpl,
|
||||||
|
$configData['contentAreaLeft'],
|
||||||
|
$configData['contentAreaTop'],
|
||||||
|
$configData['contentAreaWidth'],
|
||||||
|
$configData['contentAreaHeight'],
|
||||||
|
false,
|
||||||
|
);
|
||||||
|
$this->renderOcrMarkers($pdf, $configData['ocrMarkers'] ?? []);
|
||||||
|
|
||||||
|
if ($frontSide) {
|
||||||
|
$this->drawTab($pdf, $tab, $tab['x'], $tab['y'], $file);
|
||||||
|
$frontSide = false;
|
||||||
|
} else {
|
||||||
|
$xPos = $configData['width'] - $tab['width'] - $tab['x'];
|
||||||
|
$this->drawTab($pdf, $tab, $xPos - 1, $tab['y'] - 1, $file, $tab['width'] + 2, $tab['height'] + 1);
|
||||||
|
$frontSide = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$pdf->Output($outFile, 'F');
|
||||||
|
}
|
||||||
|
|
||||||
|
private function findTab(array $tabPositions, int $tabNumber): array
|
||||||
|
{
|
||||||
|
foreach ($tabPositions as $tab) {
|
||||||
|
if ($tab['tabNumber'] == $tabNumber) {
|
||||||
|
return $tab;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
private function drawTab(
|
||||||
|
Fpdi $pdf,
|
||||||
|
array $tab,
|
||||||
|
float $x,
|
||||||
|
float $y,
|
||||||
|
array $file,
|
||||||
|
?float $width = null,
|
||||||
|
?float $height = null,
|
||||||
|
): void {
|
||||||
|
$width ??= $tab['width'];
|
||||||
|
$height ??= $tab['height'];
|
||||||
|
|
||||||
|
$bgColor = $this->getBackgroundColor($file['color']);
|
||||||
|
$pdf->SetFillColor($bgColor[0], $bgColor[1], $bgColor[2]);
|
||||||
|
$pdf->Rect($x, $y, $width, $height, 'F');
|
||||||
|
|
||||||
|
$pdf->SetFont('helvetica', $tab['bold'] ?? false ? 'B' : '', $tab['fontSize'] ?? 14);
|
||||||
|
$pdf->SetTextColor(0, 0, 0);
|
||||||
|
$pdf->MultiCell(
|
||||||
|
$tab['width'],
|
||||||
|
$tab['height'],
|
||||||
|
$file['ocrNumber'],
|
||||||
|
0,
|
||||||
|
'C',
|
||||||
|
false,
|
||||||
|
1,
|
||||||
|
$x,
|
||||||
|
$y,
|
||||||
|
true,
|
||||||
|
0,
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
$tab['height'],
|
||||||
|
'M',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function renderOcrMarkers(Fpdi $pdf, array $ocrMarkers): void
|
||||||
|
{
|
||||||
|
if (empty($ocrMarkers)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$pdf->StartTransform();
|
||||||
|
|
||||||
|
foreach ($ocrMarkers as $marker) {
|
||||||
|
$x = $marker['x'] ?? 0;
|
||||||
|
$y = $marker['y'] ?? 0;
|
||||||
|
$type = $marker['type'] ?? 'dot';
|
||||||
|
$size = $marker['size'] ?? 2.0;
|
||||||
|
|
||||||
|
$pdf->SetDrawColor(0, 0, 0);
|
||||||
|
$pdf->SetFillColor(0, 0, 0);
|
||||||
|
|
||||||
|
switch ($type) {
|
||||||
|
case 'dot':
|
||||||
|
$pdf->Circle($x, $y, $size / 2, 0, 360, 'F');
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'text':
|
||||||
|
$pdf->StartTransform();
|
||||||
|
$pdf->Rotate(90, $x, $y);
|
||||||
|
$pdf->SetFont('helvetica', 'B', $size);
|
||||||
|
$pdf->SetTextColor(0, 0, 0);
|
||||||
|
$pdf->Text($x, $y, $marker['text'] ?? '');
|
||||||
|
$pdf->StopTransform();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'triangle':
|
||||||
|
$pdf->SetFont('helvetica', 'B', $size * 3);
|
||||||
|
$pdf->SetTextColor(0, 0, 0);
|
||||||
|
$pdf->Text($x, $y, chr(94));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$pdf->StopTransform();
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getBackgroundColor(string $color): array
|
||||||
|
{
|
||||||
|
return match ($color) {
|
||||||
|
'red' => [255, 0, 0],
|
||||||
|
'green' => [0, 255, 0],
|
||||||
|
'blue' => [0, 0, 255],
|
||||||
|
'yellow' => [255, 255, 0],
|
||||||
|
'white' => [255, 255, 255],
|
||||||
|
default => [255, 255, 255],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getError(): mixed
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -188,11 +188,13 @@
|
|||||||
<table class="table table-striped table-bordered">
|
<table class="table table-striped table-bordered">
|
||||||
<thead class="table-dark">
|
<thead class="table-dark">
|
||||||
<tr>
|
<tr>
|
||||||
<th style="width: 10%">Tab Nr.</th>
|
<th style="width: 8%">Tab Nr.</th>
|
||||||
<th style="width: 22.5%">X Position ({{ setting.unit }})</th>
|
<th style="width: 18%">X Position ({{ setting.unit }})</th>
|
||||||
<th style="width: 22.5%">Y Position ({{ setting.unit }})</th>
|
<th style="width: 18%">Y Position ({{ setting.unit }})</th>
|
||||||
<th style="width: 22.5%">Breite ({{ setting.unit }})</th>
|
<th style="width: 18%">Breite ({{ setting.unit }})</th>
|
||||||
<th style="width: 22.5%">Höhe ({{ setting.unit }})</th>
|
<th style="width: 18%">Höhe ({{ setting.unit }})</th>
|
||||||
|
<th style="width: 12%">Schriftgröße (pt)</th>
|
||||||
|
<th style="width: 8%">Fett</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -214,6 +216,12 @@
|
|||||||
<td>
|
<td>
|
||||||
{{ form_widget(tabPosition.height, {'attr': {'class': 'form-control', 'placeholder': '0.0'}}) }}
|
{{ form_widget(tabPosition.height, {'attr': {'class': 'form-control', 'placeholder': '0.0'}}) }}
|
||||||
</td>
|
</td>
|
||||||
|
<td>
|
||||||
|
{{ form_widget(tabPosition.fontSize, {'attr': {'class': 'form-control', 'placeholder': '14.0'}}) }}
|
||||||
|
</td>
|
||||||
|
<td class="text-center align-middle">
|
||||||
|
{{ form_widget(tabPosition.bold, {'attr': {'class': 'form-check-input'}}) }}
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
@ -254,11 +262,12 @@
|
|||||||
<table class="table table-striped table-bordered">
|
<table class="table table-striped table-bordered">
|
||||||
<thead class="table-dark">
|
<thead class="table-dark">
|
||||||
<tr>
|
<tr>
|
||||||
<th style="width: 12%">Type</th>
|
<th style="width: 10%">Type</th>
|
||||||
<th style="width: 20%">Label</th>
|
<th style="width: 15%">Label</th>
|
||||||
<th style="width: 22%">X Position ({{ setting.unit }})</th>
|
<th style="width: 17%">X Position ({{ setting.unit }})</th>
|
||||||
<th style="width: 22%">Y Position ({{ setting.unit }})</th>
|
<th style="width: 17%">Y Position ({{ setting.unit }})</th>
|
||||||
<th style="width: 24%">Größe ({{ setting.unit }})</th>
|
<th style="width: 17%">Größe ({{ setting.unit }})</th>
|
||||||
|
<th style="width: 24%">Text</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -294,6 +303,13 @@
|
|||||||
<small class="text-muted">Seitenlänge</small>
|
<small class="text-muted">Seitenlänge</small>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
|
<td>
|
||||||
|
{% if ocrMarker.vars.data.type == 'text' %}
|
||||||
|
{{ form_widget(ocrMarker.text, {'attr': {'class': 'form-control', 'placeholder': 'OCR Text...'}}) }}
|
||||||
|
{% else %}
|
||||||
|
{{ form_widget(ocrMarker.text, {'attr': {'class': 'd-none'}}) }}
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@ -8,38 +8,45 @@ use PSC\Shop\EntityBundle\Repository\ProductRepository;
|
|||||||
use PSC\Shop\OrderBundle\Service\Order;
|
use PSC\Shop\OrderBundle\Service\Order;
|
||||||
use PSC\System\SettingsBundle\Service\Shop;
|
use PSC\System\SettingsBundle\Service\Shop;
|
||||||
use PSC\System\SettingsBundle\Service\Status;
|
use PSC\System\SettingsBundle\Service\Status;
|
||||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
|
||||||
use Symfony\Bridge\Twig\Attribute\Template;
|
use Symfony\Bridge\Twig\Attribute\Template;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
use Symfony\Component\Routing\Attribute\Route;
|
||||||
|
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||||
|
|
||||||
class CollectController extends AbstractController
|
class CollectController extends AbstractController
|
||||||
{
|
{
|
||||||
public function __construct(readonly private ProductRepository $productRepository, readonly private DocumentManager $documentManager, private readonly EntityManagerInterface $entityManager, private readonly Shop $shopService, private readonly Order $orderService, private Status $statusService)
|
public function __construct(
|
||||||
{
|
private readonly ProductRepository $productRepository,
|
||||||
}
|
private readonly DocumentManager $documentManager,
|
||||||
|
private readonly EntityManagerInterface $entityManager,
|
||||||
|
private readonly Shop $shopService,
|
||||||
|
private readonly Order $orderService,
|
||||||
|
private Status $statusService,
|
||||||
|
) {}
|
||||||
|
|
||||||
#[Template()]
|
#[Template('@PluginCustomPSCSaxoprint_API_R1/collect/index.html.twig')]
|
||||||
#[Route('/collect/{uuid}', name: 'plugin_custom_psc_saxoprint_product_collect')]
|
#[Route('/collect/{uuid}', name: 'plugin_custom_psc_saxoprint_product_collect')]
|
||||||
#[IsGranted('ROLE_SHOP')]
|
#[IsGranted('ROLE_SHOP')]
|
||||||
public function indexAction(Request $request, string $uuid)
|
public function indexAction(Request $request, string $uuid)
|
||||||
{
|
{
|
||||||
$selectedShop = $this->shopService->getSelectedShop();
|
$selectedShop = $this->shopService->getSelectedShop();
|
||||||
$userRepository = $this->entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Contact');
|
$userRepository = $this->entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Contact');
|
||||||
$qb = $userRepository->createQueryBuilder('contact')
|
$qb = $userRepository
|
||||||
|
->createQueryBuilder('contact')
|
||||||
->leftJoin('contact.shops', 'shops')
|
->leftJoin('contact.shops', 'shops')
|
||||||
->orderBy('contact.uid', 'desc');
|
->orderBy('contact.uid', 'desc');
|
||||||
|
|
||||||
$qb->andwhere('shops.uid = :shop_id')
|
$qb
|
||||||
|
->andwhere('shops.uid = :shop_id')
|
||||||
->andWhere('(contact.username != :sysadminUser OR contact.username is null)')
|
->andWhere('(contact.username != :sysadminUser OR contact.username is null)')
|
||||||
->setParameter("shop_id", $selectedShop->getUid())
|
->setParameter('shop_id', $selectedShop->getUid())
|
||||||
->setParameter("sysadminUser", 'sysadmin@printshopcreator.de');
|
->setParameter('sysadminUser', 'sysadmin@printshopcreator.de');
|
||||||
|
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'contacts' => $qb->getQuery()->execute(),
|
'contacts' => $qb->getQuery()->execute(),
|
||||||
'statuse' => $this->statusService->getPositionStatusAsArray(),
|
'statuse' => $this->statusService->getPositionStatusAsArray(),
|
||||||
'order' => $this->orderService->getOrderByUuid($uuid)];
|
'order' => $this->orderService->getOrderByUuid($uuid),
|
||||||
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,18 +10,21 @@ use PSC\Shop\EntityBundle\Entity\Domain;
|
|||||||
use PSC\Shop\EntityBundle\Repository\ProductRepository;
|
use PSC\Shop\EntityBundle\Repository\ProductRepository;
|
||||||
use PSC\System\SettingsBundle\Service\Shop;
|
use PSC\System\SettingsBundle\Service\Shop;
|
||||||
use PSC\System\SettingsBundle\Service\Tax;
|
use PSC\System\SettingsBundle\Service\Tax;
|
||||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
|
||||||
use Symfony\Bridge\Twig\Attribute\Template;
|
use Symfony\Bridge\Twig\Attribute\Template;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
use Symfony\Component\Routing\Attribute\Route;
|
||||||
|
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||||
|
|
||||||
class ConfigController extends AbstractController
|
class ConfigController extends AbstractController
|
||||||
{
|
{
|
||||||
public function __construct(readonly private ProductRepository $productRepository, readonly private DocumentManager $documentManager, private readonly EntityManagerInterface $entityManager, private readonly Shop $shopService)
|
public function __construct(
|
||||||
{
|
private readonly ProductRepository $productRepository,
|
||||||
}
|
private readonly DocumentManager $documentManager,
|
||||||
|
private readonly EntityManagerInterface $entityManager,
|
||||||
|
private readonly Shop $shopService,
|
||||||
|
) {}
|
||||||
|
|
||||||
#[Template()]
|
#[Template('@PluginCustomPSCSaxoprint_API_R1/config/index.html.twig')]
|
||||||
#[Route('/config/{uuid}', name: 'plugin_custom_psc_saxoprint_product_config')]
|
#[Route('/config/{uuid}', name: 'plugin_custom_psc_saxoprint_product_config')]
|
||||||
#[IsGranted('ROLE_SHOP')]
|
#[IsGranted('ROLE_SHOP')]
|
||||||
public function indexAction(string $uuid, GetProducts $getProducts, Tax $taxService)
|
public function indexAction(string $uuid, GetProducts $getProducts, Tax $taxService)
|
||||||
@ -32,7 +35,8 @@ class ConfigController extends AbstractController
|
|||||||
|
|
||||||
/** @var Domain[] $domains */
|
/** @var Domain[] $domains */
|
||||||
$domains = $this->entityManager
|
$domains = $this->entityManager
|
||||||
->getRepository('PSC\Shop\EntityBundle\Entity\Domain')->getAllByShopId($this->shopService->getSelectedShop());
|
->getRepository('PSC\Shop\EntityBundle\Entity\Domain')
|
||||||
|
->getAllByShopId($this->shopService->getSelectedShop());
|
||||||
|
|
||||||
$shop = $this->shopService->getMongoSelectedShop();
|
$shop = $this->shopService->getMongoSelectedShop();
|
||||||
$getProducts->setShop($shop);
|
$getProducts->setShop($shop);
|
||||||
@ -48,3 +52,4 @@ class ConfigController extends AbstractController
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -65,6 +65,7 @@
|
|||||||
.badge-info {
|
.badge-info {
|
||||||
@apply bg-blue-100 text-blue-800 dark:bg-blue-800 dark:text-blue-100;
|
@apply bg-blue-100 text-blue-800 dark:bg-blue-800 dark:text-blue-100;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@layer utilities {
|
@layer utilities {
|
||||||
@ -95,4 +96,59 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Tailwind styling for default @rjsf/core form markup.
|
||||||
|
Keep outside @layer so Tailwind does not purge it from generated CSS. */
|
||||||
|
.rjsf {
|
||||||
|
@apply space-y-4;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rjsf .form-group {
|
||||||
|
@apply mb-4 grid grid-cols-1 gap-y-1 md:grid-cols-12 md:items-start md:gap-x-4;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rjsf .form-group > * {
|
||||||
|
@apply md:col-span-10 md:col-start-3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rjsf .form-group > label.control-label,
|
||||||
|
.rjsf .form-group > legend {
|
||||||
|
@apply md:col-span-2 md:col-start-1 md:mb-0 md:pt-2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rjsf label.control-label,
|
||||||
|
.rjsf legend {
|
||||||
|
@apply mb-1 block text-sm font-semibold text-gray-700;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rjsf .field-description,
|
||||||
|
.rjsf .help-block {
|
||||||
|
@apply mt-1 text-xs text-gray-500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rjsf .form-control,
|
||||||
|
.rjsf select,
|
||||||
|
.rjsf textarea,
|
||||||
|
.rjsf input[type="text"],
|
||||||
|
.rjsf input[type="email"],
|
||||||
|
.rjsf input[type="number"] {
|
||||||
|
@apply w-full rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 shadow-sm focus:border-blue-500 focus:ring-2 focus:ring-blue-500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rjsf input[type="checkbox"],
|
||||||
|
.rjsf input[type="radio"] {
|
||||||
|
@apply h-4 w-4 border-gray-300 text-blue-600 focus:ring-blue-500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rjsf .checkbox label,
|
||||||
|
.rjsf .radio label {
|
||||||
|
@apply flex items-center gap-2 text-sm text-gray-700;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rjsf .text-danger,
|
||||||
|
.rjsf .error-detail {
|
||||||
|
@apply mt-1 text-xs font-medium text-red-600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rjsf .array-item-list {
|
||||||
|
@apply space-y-3;
|
||||||
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -44,8 +44,14 @@ class Provider extends PaymentProvider
|
|||||||
*/
|
*/
|
||||||
private SessionInterface $session;
|
private SessionInterface $session;
|
||||||
|
|
||||||
public function __construct(RequestStack $requestStack, Manager $eventManager, FormFactoryInterface $formFactory, EntityManagerInterface $entityManager, DocumentManager $doctrine_mongodb, \PSC\System\SettingsBundle\Service\Shop $shopService)
|
public function __construct(
|
||||||
{
|
RequestStack $requestStack,
|
||||||
|
Manager $eventManager,
|
||||||
|
FormFactoryInterface $formFactory,
|
||||||
|
EntityManagerInterface $entityManager,
|
||||||
|
DocumentManager $doctrine_mongodb,
|
||||||
|
\PSC\System\SettingsBundle\Service\Shop $shopService,
|
||||||
|
) {
|
||||||
$this->_formFactory = $formFactory;
|
$this->_formFactory = $formFactory;
|
||||||
$this->_entityManager = $entityManager;
|
$this->_entityManager = $entityManager;
|
||||||
$this->_doctrine_mongodb = $doctrine_mongodb;
|
$this->_doctrine_mongodb = $doctrine_mongodb;
|
||||||
@ -80,16 +86,20 @@ class Provider extends PaymentProvider
|
|||||||
|
|
||||||
public function getSubForm(Gatewaysettings $settings, FormBuilder $builder)
|
public function getSubForm(Gatewaysettings $settings, FormBuilder $builder)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!$settings->getGatewayDocument()) {
|
if (!$settings->getGatewayDocument()) {
|
||||||
$settings->setGatewayDocument(new Paypal());
|
$settings->setGatewayDocument(new Paypal());
|
||||||
}
|
}
|
||||||
|
|
||||||
$builder
|
$builder->add('production', CheckboxType::class, array(
|
||||||
->add('production', CheckboxType::class, array('label' => 'Production?', 'required' => false))
|
'label' => 'Production?',
|
||||||
->add('clientId', TextType::class, array('label' => 'Client Id', 'required' => false))
|
'required' => false,
|
||||||
->add('clientSecret', TextType::class, array('label' => 'Client Secret', 'required' => false))
|
))->add('clientId', TextType::class, array(
|
||||||
->add('brandName', TextType::class, array('label' => 'Brand Name', 'required' => false));
|
'label' => 'Client Id',
|
||||||
|
'required' => false,
|
||||||
|
))->add('clientSecret', TextType::class, array(
|
||||||
|
'label' => 'Client Secret',
|
||||||
|
'required' => false,
|
||||||
|
))->add('brandName', TextType::class, array('label' => 'Brand Name', 'required' => false));
|
||||||
|
|
||||||
$builder->get('production')->setData($settings->getGatewayDocument()->isProduction());
|
$builder->get('production')->setData($settings->getGatewayDocument()->isProduction());
|
||||||
$builder->get('clientId')->setData($settings->getGatewayDocument()->getClientId());
|
$builder->get('clientId')->setData($settings->getGatewayDocument()->getClientId());
|
||||||
@ -106,16 +116,15 @@ class Provider extends PaymentProvider
|
|||||||
|
|
||||||
public function handlePayment(Request $request)
|
public function handlePayment(Request $request)
|
||||||
{
|
{
|
||||||
|
|
||||||
if ($this->getGatewaySettings()->getGatewayDocument()->isProduction()) {
|
if ($this->getGatewaySettings()->getGatewayDocument()->isProduction()) {
|
||||||
$environment = new ProductionEnvironment(
|
$environment = new ProductionEnvironment(
|
||||||
$this->getGatewaySettings()->getGatewayDocument()->getClientId(),
|
$this->getGatewaySettings()->getGatewayDocument()->getClientId(),
|
||||||
$this->getGatewaySettings()->getGatewayDocument()->getClientSecret()
|
$this->getGatewaySettings()->getGatewayDocument()->getClientSecret(),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$environment = new SandboxEnvironment(
|
$environment = new SandboxEnvironment(
|
||||||
$this->getGatewaySettings()->getGatewayDocument()->getClientId(),
|
$this->getGatewaySettings()->getGatewayDocument()->getClientId(),
|
||||||
$this->getGatewaySettings()->getGatewayDocument()->getClientSecret()
|
$this->getGatewaySettings()->getGatewayDocument()->getClientSecret(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -130,22 +139,25 @@ class Provider extends PaymentProvider
|
|||||||
/** @var ContactAddress $invoiceAddress */
|
/** @var ContactAddress $invoiceAddress */
|
||||||
$invoiceAddress = $this->_entityManager->getRepository(ContactAddress::class)->findOneBy(['uuid' => $invoice]);
|
$invoiceAddress = $this->_entityManager->getRepository(ContactAddress::class)->findOneBy(['uuid' => $invoice]);
|
||||||
|
|
||||||
|
$basket = $_SESSION['Basket'];
|
||||||
$requestPaypal = new CreatePaymentRequest();
|
$requestPaypal = new CreatePaymentRequest();
|
||||||
$requestPaypal->buildRequestBody(
|
$requestPaypal->buildRequestBody(
|
||||||
$contact,
|
$contact,
|
||||||
$invoiceAddress,
|
$invoiceAddress,
|
||||||
$this->getGatewaySettings()->getGatewayDocument()->getBrandName(),
|
$this->getGatewaySettings()->getGatewayDocument()->getBrandName(),
|
||||||
$request->get('amount'),
|
round($basket['brutto'] - round($basket['GutscheinAbzug'], 2), 2),
|
||||||
$this->getHost() . '/basket/finish?Data=finish&token=' . $request->get('hash'),
|
$this->getHost() . '/basket/finish?Data=finish&token=' . $request->get('hash'),
|
||||||
$this->getHost().'/basket/finish?error=Fehler'
|
$this->getHost() . '/basket/finish?error=Fehler',
|
||||||
);
|
);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
$response = $client->execute($requestPaypal);
|
$response = $client->execute($requestPaypal);
|
||||||
|
|
||||||
$this->session->set('plugin_system_psc_paypalplus_paymentId', $response->result->id);
|
$this->session->set('plugin_system_psc_paypalplus_paymentId', $response->result->id);
|
||||||
$this->session->set('plugin_system_psc_paypalplus_production', $this->getGatewaySettings()->getGatewayDocument()->isProduction());
|
$this->session->set(
|
||||||
|
'plugin_system_psc_paypalplus_production',
|
||||||
|
$this->getGatewaySettings()->getGatewayDocument()->isProduction(),
|
||||||
|
);
|
||||||
foreach ($response->result->links as $link) {
|
foreach ($response->result->links as $link) {
|
||||||
if ($link->rel == 'approval_url') {
|
if ($link->rel == 'approval_url') {
|
||||||
$this->session->set('plugin_system_psc_paypalplus_link', $link->href);
|
$this->session->set('plugin_system_psc_paypalplus_link', $link->href);
|
||||||
@ -157,7 +169,6 @@ class Provider extends PaymentProvider
|
|||||||
var_dump($e->getMessage());
|
var_dump($e->getMessage());
|
||||||
}
|
}
|
||||||
die();
|
die();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handleNotify(Request $request)
|
public function handleNotify(Request $request)
|
||||||
@ -165,8 +176,11 @@ class Provider extends PaymentProvider
|
|||||||
$request = $request->getContent();
|
$request = $request->getContent();
|
||||||
$request = json_decode($request, true);
|
$request = json_decode($request, true);
|
||||||
|
|
||||||
if (isset($request['resource']) && isset($request['resource']['state']) && $request['resource']['state'] == 'completed') {
|
if (
|
||||||
|
isset($request['resource'])
|
||||||
|
&& isset($request['resource']['state'])
|
||||||
|
&& $request['resource']['state'] == 'completed'
|
||||||
|
) {
|
||||||
/** @var \PSC\Shop\EntityBundle\Document\Order $orderDoc */
|
/** @var \PSC\Shop\EntityBundle\Document\Order $orderDoc */
|
||||||
$orderDoc = $this->_doctrine_mongodb
|
$orderDoc = $this->_doctrine_mongodb
|
||||||
->getRepository('PSC\Shop\EntityBundle\Document\Order')
|
->getRepository('PSC\Shop\EntityBundle\Document\Order')
|
||||||
@ -187,7 +201,6 @@ class Provider extends PaymentProvider
|
|||||||
$notify->setOrder($order->getUuid());
|
$notify->setOrder($order->getUuid());
|
||||||
|
|
||||||
$this->eventManager->addJob($notify);
|
$this->eventManager->addJob($notify);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function doPayment(Request $request)
|
public function doPayment(Request $request)
|
||||||
@ -195,12 +208,12 @@ class Provider extends PaymentProvider
|
|||||||
if ($this->getGatewaySettings()->getGatewayDocument()->isProduction()) {
|
if ($this->getGatewaySettings()->getGatewayDocument()->isProduction()) {
|
||||||
$environment = new ProductionEnvironment(
|
$environment = new ProductionEnvironment(
|
||||||
$this->getGatewaySettings()->getGatewayDocument()->getClientId(),
|
$this->getGatewaySettings()->getGatewayDocument()->getClientId(),
|
||||||
$this->getGatewaySettings()->getGatewayDocument()->getClientSecret()
|
$this->getGatewaySettings()->getGatewayDocument()->getClientSecret(),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$environment = new SandboxEnvironment(
|
$environment = new SandboxEnvironment(
|
||||||
$this->getGatewaySettings()->getGatewayDocument()->getClientId(),
|
$this->getGatewaySettings()->getGatewayDocument()->getClientId(),
|
||||||
$this->getGatewaySettings()->getGatewayDocument()->getClientSecret()
|
$this->getGatewaySettings()->getGatewayDocument()->getClientSecret(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -212,7 +225,13 @@ class Provider extends PaymentProvider
|
|||||||
$response = $client->execute($requestPaypal);
|
$response = $client->execute($requestPaypal);
|
||||||
|
|
||||||
if ($response->statusCode == 200) {
|
if ($response->statusCode == 200) {
|
||||||
return new RedirectResponse($this->getHost().'/basket/finish?token='.$request->get('hash').'&paymentRef='.$response->result->id);
|
return new RedirectResponse(
|
||||||
|
$this->getHost()
|
||||||
|
. '/basket/finish?token='
|
||||||
|
. $request->get('hash')
|
||||||
|
. '&paymentRef='
|
||||||
|
. $response->result->id,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new RedirectResponse($this->getHost() . '/basket/finish?error=DoPayment');
|
return new RedirectResponse($this->getHost() . '/basket/finish?error=DoPayment');
|
||||||
|
|||||||
@ -8,28 +8,33 @@ use PSC\Shop\EntityBundle\Entity\ContactAddress;
|
|||||||
|
|
||||||
class CreatePaymentRequest extends HttpRequest
|
class CreatePaymentRequest extends HttpRequest
|
||||||
{
|
{
|
||||||
|
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct("/v1/payments/payment", "POST");
|
parent::__construct('/v1/payments/payment', 'POST');
|
||||||
$this->headers["Content-Type"] = "application/json";
|
$this->headers['Content-Type'] = 'application/json';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function prefer($prefer)
|
public function prefer($prefer)
|
||||||
{
|
{
|
||||||
$this->headers["Prefer"] = $prefer;
|
$this->headers['Prefer'] = $prefer;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildRequestBody(Contact $contact, ContactAddress $invoiceAddress, $brandName, $amount, $return_url, $cancel_url)
|
public function buildRequestBody(
|
||||||
{
|
Contact $contact,
|
||||||
|
ContactAddress $invoiceAddress,
|
||||||
|
$brandName,
|
||||||
|
$amount,
|
||||||
|
$return_url,
|
||||||
|
$cancel_url,
|
||||||
|
) {
|
||||||
/** @var \TP_Basket_Collection $basket */
|
/** @var \TP_Basket_Collection $basket */
|
||||||
$basket = $_SESSION['Basket'];
|
$basket = $_SESSION['Basket'];
|
||||||
|
|
||||||
$this->body = array(
|
$this->body = array(
|
||||||
'intent' => 'sale',
|
'intent' => 'sale',
|
||||||
'payer' => [
|
'payer' => [
|
||||||
"payment_method" => "paypal",
|
'payment_method' => 'paypal',
|
||||||
"payer_info" => [
|
'payer_info' => [
|
||||||
'payer_id' => $contact->getId(),
|
'payer_id' => $contact->getId(),
|
||||||
'email' => $contact->getEmail(),
|
'email' => $contact->getEmail(),
|
||||||
'last_name' => $contact->getLastname(),
|
'last_name' => $contact->getLastname(),
|
||||||
@ -38,26 +43,25 @@ class CreatePaymentRequest extends HttpRequest
|
|||||||
'postal_code' => $invoiceAddress->getZip(),
|
'postal_code' => $invoiceAddress->getZip(),
|
||||||
'line1' => $invoiceAddress->getStreet() . ' ' . $invoiceAddress->getHouseNumber(),
|
'line1' => $invoiceAddress->getStreet() . ' ' . $invoiceAddress->getHouseNumber(),
|
||||||
'city' => $invoiceAddress->getCity(),
|
'city' => $invoiceAddress->getCity(),
|
||||||
'country_code' => 'DE'
|
'country_code' => 'DE',
|
||||||
]
|
|
||||||
]
|
|
||||||
],
|
],
|
||||||
"transactions"=> [[
|
|
||||||
"amount"=> [
|
|
||||||
"total"=> (string)round($basket['brutto'],2),
|
|
||||||
"currency"=> "EUR"
|
|
||||||
],
|
],
|
||||||
"invoice_number"=> $basket['paymentRef'],
|
],
|
||||||
"item_list"=> [
|
'transactions' => [[
|
||||||
"items"=> [
|
'amount' => [
|
||||||
]
|
'total' => (string) round($basket['brutto'] - round($basket['GutscheinAbzug'], 2), 2),
|
||||||
]
|
'currency' => 'EUR',
|
||||||
|
],
|
||||||
|
'invoice_number' => $basket['paymentRef'],
|
||||||
|
'item_list' => [
|
||||||
|
'items' => [],
|
||||||
|
],
|
||||||
]],
|
]],
|
||||||
"note_to_payer"=> "Contact us for any questions on your order.",
|
'note_to_payer' => 'Contact us for any questions on your order.',
|
||||||
"redirect_urls"=> [
|
'redirect_urls' => [
|
||||||
"return_url"=> $return_url,
|
'return_url' => $return_url,
|
||||||
"cancel_url"=> $cancel_url
|
'cancel_url' => $cancel_url,
|
||||||
]);
|
],
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,11 +1,12 @@
|
|||||||
info:
|
info:
|
||||||
datum: 03.02.2026
|
datum: 17.02.2026
|
||||||
release: 2.3.2
|
release: 2.3.2
|
||||||
|
|
||||||
changelog:
|
changelog:
|
||||||
- version: 2.3.2
|
- version: 2.3.2
|
||||||
datum: 03.02.2026
|
datum: 17.02.2026
|
||||||
changes:
|
changes:
|
||||||
|
- "Fix CreativeLayouter PDF Rendering pt in mm"
|
||||||
- "VoucherBundle: CSV Upload für Gutscheincodes"
|
- "VoucherBundle: CSV Upload für Gutscheincodes"
|
||||||
- "VoucherBundle: Vorschau vor Import"
|
- "VoucherBundle: Vorschau vor Import"
|
||||||
- "Gutschein-Produkt: Verknüpfung mit VoucherBundle"
|
- "Gutschein-Produkt: Verknüpfung mit VoucherBundle"
|
||||||
|
|||||||
@ -42,15 +42,18 @@
|
|||||||
*/
|
*/
|
||||||
abstract class BaseOrders extends Doctrine_Record
|
abstract class BaseOrders extends Doctrine_Record
|
||||||
{
|
{
|
||||||
|
public function setTableDefinition()
|
||||||
public function setTableDefinition() {
|
{
|
||||||
$this->setTableName('orders');
|
$this->setTableName('orders');
|
||||||
$this->hasColumn('id', 'integer', 8, array('primary' => true, 'autoincrement' => true, 'type' => 'integer', 'length' => '8'));
|
$this->hasColumn('id', 'integer', 8, array(
|
||||||
|
'primary' => true,
|
||||||
|
'autoincrement' => true,
|
||||||
|
'type' => 'integer',
|
||||||
|
'length' => '8',
|
||||||
|
));
|
||||||
$this->hasColumn('uuid', 'string', 40, array('type' => 'string', 'length' => '40'));
|
$this->hasColumn('uuid', 'string', 40, array('type' => 'string', 'length' => '40'));
|
||||||
$this->hasColumn('created', 'date', 25, array('type' => 'date', 'length' => '25'));
|
$this->hasColumn('created', 'date', 25, array('type' => 'date', 'length' => '25'));
|
||||||
$this->hasColumn('updated', 'date', 25, array('type' => 'date', 'length' => '25'));
|
$this->hasColumn('updated', 'date', 25, array('type' => 'date', 'length' => '25'));
|
||||||
$this->hasColumn('install_id', 'integer', 8, array('type' => 'integer', 'length' => '8'));
|
|
||||||
$this->hasColumn('account_id', 'integer', 8, array('type' => 'integer', 'length' => '8'));
|
|
||||||
$this->hasColumn('shop_id', 'integer', 8, array('type' => 'integer', 'length' => '8'));
|
$this->hasColumn('shop_id', 'integer', 8, array('type' => 'integer', 'length' => '8'));
|
||||||
$this->hasColumn('alias', 'string', 255, array('type' => 'string', 'length' => '255'));
|
$this->hasColumn('alias', 'string', 255, array('type' => 'string', 'length' => '255'));
|
||||||
$this->hasColumn('preis', 'float', 2147483647, array('type' => 'float', 'length' => '2147483647'));
|
$this->hasColumn('preis', 'float', 2147483647, array('type' => 'float', 'length' => '2147483647'));
|
||||||
@ -92,14 +95,11 @@ abstract class BaseOrders extends Doctrine_Record
|
|||||||
$this->hasColumn('type', 'integer', 1);
|
$this->hasColumn('type', 'integer', 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setUp() {
|
public function setUp()
|
||||||
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
$this->hasOne('Contact', array('local' => 'contact_id', 'foreign' => 'id'));
|
$this->hasOne('Contact', array('local' => 'contact_id', 'foreign' => 'id'));
|
||||||
|
|
||||||
$this->hasOne('Install', array('local' => 'install_id', 'foreign' => 'id'));
|
|
||||||
|
|
||||||
$this->hasOne('Account', array('local' => 'account_id', 'foreign' => 'id'));
|
|
||||||
|
|
||||||
$this->hasOne('Shop', array('local' => 'shop_id', 'foreign' => 'id'));
|
$this->hasOne('Shop', array('local' => 'shop_id', 'foreign' => 'id'));
|
||||||
|
|
||||||
$this->hasOne('Paymenttype', array('local' => 'paymenttype_id', 'foreign' => 'id'));
|
$this->hasOne('Paymenttype', array('local' => 'paymenttype_id', 'foreign' => 'id'));
|
||||||
|
|||||||
@ -40,20 +40,23 @@
|
|||||||
*/
|
*/
|
||||||
abstract class BaseOrderspos extends Doctrine_Record
|
abstract class BaseOrderspos extends Doctrine_Record
|
||||||
{
|
{
|
||||||
|
public function setTableDefinition()
|
||||||
public function setTableDefinition() {
|
{
|
||||||
$this->setTableName('orderspos');
|
$this->setTableName('orderspos');
|
||||||
$this->hasColumn('id', 'integer', 8, array('primary' => true, 'autoincrement' => true, 'type' => 'integer', 'length' => '8'));
|
$this->hasColumn('id', 'integer', 8, array(
|
||||||
|
'primary' => true,
|
||||||
|
'autoincrement' => true,
|
||||||
|
'type' => 'integer',
|
||||||
|
'length' => '8',
|
||||||
|
));
|
||||||
$this->hasColumn('orders_id', 'integer', 8, array('type' => 'integer', 'length' => '8'));
|
$this->hasColumn('orders_id', 'integer', 8, array('type' => 'integer', 'length' => '8'));
|
||||||
$this->hasColumn('uuid', 'string', 40, array('type' => 'string', 'length' => '40'));
|
$this->hasColumn('uuid', 'string', 40, array('type' => 'string', 'length' => '40'));
|
||||||
$this->hasColumn('createdd', 'date', 25, array('type' => 'date', 'length' => '25'));
|
$this->hasColumn('createdd', 'date', 25, array('type' => 'date', 'length' => '25'));
|
||||||
$this->hasColumn('updatedd', 'date', 25, array('type' => 'date', 'length' => '25'));
|
$this->hasColumn('updatedd', 'date', 25, array('type' => 'date', 'length' => '25'));
|
||||||
$this->hasColumn('createdt', 'time', 25, array('type' => 'time', 'length' => '25'));
|
$this->hasColumn('createdt', 'time', 25, array('type' => 'time', 'length' => '25'));
|
||||||
$this->hasColumn('updatedt', 'time', 25, array('type' => 'time', 'length' => '25'));
|
$this->hasColumn('updatedt', 'time', 25, array('type' => 'time', 'length' => '25'));
|
||||||
$this->hasColumn('install_id', 'integer', 8, array('type' => 'integer', 'length' => '8'));
|
|
||||||
$this->hasColumn('article_id', 'integer', 11, array('type' => 'integer', 'length' => '11'));
|
$this->hasColumn('article_id', 'integer', 11, array('type' => 'integer', 'length' => '11'));
|
||||||
$this->hasColumn('shop_id', 'integer', 8, array('type' => 'integer', 'length' => '8'));
|
$this->hasColumn('shop_id', 'integer', 8, array('type' => 'integer', 'length' => '8'));
|
||||||
$this->hasColumn('account_id', 'integer', 8, array('type' => 'integer', 'length' => '8'));
|
|
||||||
$this->hasColumn('count', 'integer', 4, array('type' => 'integer', 'length' => '4'));
|
$this->hasColumn('count', 'integer', 4, array('type' => 'integer', 'length' => '4'));
|
||||||
$this->hasColumn('data', 'blob', 2147483647, array('type' => 'blob', 'length' => '2147483647'));
|
$this->hasColumn('data', 'blob', 2147483647, array('type' => 'blob', 'length' => '2147483647'));
|
||||||
$this->hasColumn('priceone', 'float', 2147483647, array('type' => 'float', 'length' => '2147483647'));
|
$this->hasColumn('priceone', 'float', 2147483647, array('type' => 'float', 'length' => '2147483647'));
|
||||||
@ -102,14 +105,12 @@ abstract class BaseOrderspos extends Doctrine_Record
|
|||||||
$this->hasColumn('kst', 'string', 255);
|
$this->hasColumn('kst', 'string', 255);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setUp() {
|
public function setUp()
|
||||||
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
$this->hasOne('Install', array('local' => 'install_id', 'foreign' => 'id'));
|
|
||||||
|
|
||||||
$this->hasOne('Shop', array('local' => 'shop_id', 'foreign' => 'id'));
|
$this->hasOne('Shop', array('local' => 'shop_id', 'foreign' => 'id'));
|
||||||
|
|
||||||
$this->hasOne('Account', array('local' => 'account_id', 'foreign' => 'id'));
|
|
||||||
|
|
||||||
$this->hasOne('Orders', array('local' => 'orders_id', 'foreign' => 'id'));
|
$this->hasOne('Orders', array('local' => 'orders_id', 'foreign' => 'id'));
|
||||||
|
|
||||||
$this->hasOne('Article', array('local' => 'article_id', 'foreign' => 'id'));
|
$this->hasOne('Article', array('local' => 'article_id', 'foreign' => 'id'));
|
||||||
|
|||||||
@ -1799,10 +1799,8 @@ class BasketController extends TP_Controller_Action
|
|||||||
|
|
||||||
$order = new Orders();
|
$order = new Orders();
|
||||||
$order->Shop = $this->shop;
|
$order->Shop = $this->shop;
|
||||||
$order->Account = $this->shop->Acc;
|
|
||||||
$order->created = date('Y-m-d H:i:s');
|
$order->created = date('Y-m-d H:i:s');
|
||||||
$order->updated = date('Y-m-d H:i:s');
|
$order->updated = date('Y-m-d H:i:s');
|
||||||
$order->Install = $this->shop->Install;
|
|
||||||
$order->enable = 1;
|
$order->enable = 1;
|
||||||
$order->gutschein = $basket->getGutschein();
|
$order->gutschein = $basket->getGutschein();
|
||||||
$order->gutscheinabzug = $basket->getGutscheinAbzug();
|
$order->gutscheinabzug = $basket->getGutscheinAbzug();
|
||||||
@ -1880,8 +1878,6 @@ class BasketController extends TP_Controller_Action
|
|||||||
|
|
||||||
$art = new Orderspos();
|
$art = new Orderspos();
|
||||||
$art->Shop = $this->shop;
|
$art->Shop = $this->shop;
|
||||||
$art->Account = $this->shop->Acc;
|
|
||||||
$art->Install = $this->shop->Install;
|
|
||||||
$art->createdd = date('Y-m-d');
|
$art->createdd = date('Y-m-d');
|
||||||
$art->updatedd = date('Y-m-d');
|
$art->updatedd = date('Y-m-d');
|
||||||
$art->createdt = date('H:i');
|
$art->createdt = date('H:i');
|
||||||
@ -4446,10 +4442,8 @@ class BasketController extends TP_Controller_Action
|
|||||||
|
|
||||||
$order = new Orders();
|
$order = new Orders();
|
||||||
$order->Shop = $this->shop;
|
$order->Shop = $this->shop;
|
||||||
$order->Account = $user->Account;
|
|
||||||
$order->created = date('Y-m-d H:i:s');
|
$order->created = date('Y-m-d H:i:s');
|
||||||
$order->updated = date('Y-m-d H:i:s');
|
$order->updated = date('Y-m-d H:i:s');
|
||||||
$order->Install = $user->Install;
|
|
||||||
$order->enable = 1;
|
$order->enable = 1;
|
||||||
|
|
||||||
$m = TP_Mongo::getInstance();
|
$m = TP_Mongo::getInstance();
|
||||||
@ -4750,8 +4744,6 @@ class BasketController extends TP_Controller_Action
|
|||||||
|
|
||||||
$art = new Orderspos();
|
$art = new Orderspos();
|
||||||
$art->Shop = $this->shop;
|
$art->Shop = $this->shop;
|
||||||
$art->Account = $user->Account;
|
|
||||||
$art->Install = $user->Install;
|
|
||||||
$art->createdd = date('Y-m-d');
|
$art->createdd = date('Y-m-d');
|
||||||
$art->updatedd = date('Y-m-d');
|
$art->updatedd = date('Y-m-d');
|
||||||
$art->createdt = date('H:i');
|
$art->createdt = date('H:i');
|
||||||
@ -5623,10 +5615,8 @@ class BasketController extends TP_Controller_Action
|
|||||||
|
|
||||||
$order = new Orders();
|
$order = new Orders();
|
||||||
$order->Shop = $this->shop;
|
$order->Shop = $this->shop;
|
||||||
$order->Account = $user->Account;
|
|
||||||
$order->created = date('Y-m-d H:i:s');
|
$order->created = date('Y-m-d H:i:s');
|
||||||
$order->updated = date('Y-m-d H:i:s');
|
$order->updated = date('Y-m-d H:i:s');
|
||||||
$order->Install = $user->Install;
|
|
||||||
$order->enable = 1;
|
$order->enable = 1;
|
||||||
|
|
||||||
$install = $this->shop->Install;
|
$install = $this->shop->Install;
|
||||||
@ -5739,8 +5729,6 @@ class BasketController extends TP_Controller_Action
|
|||||||
$article->save();
|
$article->save();
|
||||||
|
|
||||||
$art->Shop = $this->shop;
|
$art->Shop = $this->shop;
|
||||||
$art->Account = $user->Account;
|
|
||||||
$art->Install = $user->Install;
|
|
||||||
$art->status = 20;
|
$art->status = 20;
|
||||||
$art->layouter_mode = true;
|
$art->layouter_mode = true;
|
||||||
$art->calc_xml = $article->a1_xml;
|
$art->calc_xml = $article->a1_xml;
|
||||||
|
|||||||
@ -2798,7 +2798,7 @@ class UserController extends TP_Controller_Action
|
|||||||
'package' => $row->package,
|
'package' => $row->package,
|
||||||
'uuid' => $row->uuid,
|
'uuid' => $row->uuid,
|
||||||
'id' => $row->id,
|
'id' => $row->id,
|
||||||
'account' => $row->Account->company,
|
'account' => $row->Contact->Account->company,
|
||||||
'contact' => $row->Contact->self_firstname . ' ' . $row->Contact->self_lastname,
|
'contact' => $row->Contact->self_firstname . ' ' . $row->Contact->self_lastname,
|
||||||
'email' => $row->Contact->self_email,
|
'email' => $row->Contact->self_email,
|
||||||
'status' => $row->status,
|
'status' => $row->status,
|
||||||
|
|||||||
BIN
src/old/public/temp/69946e954fa75.pdf
Normal file
BIN
src/old/public/temp/69946e954fa75.pdf
Normal file
Binary file not shown.
BIN
src/old/public/temp/69946eb48b974.pdf
Normal file
BIN
src/old/public/temp/69946eb48b974.pdf
Normal file
Binary file not shown.
BIN
src/old/public/temp/69946fae38a31.pdf
Normal file
BIN
src/old/public/temp/69946fae38a31.pdf
Normal file
Binary file not shown.
BIN
src/old/public/temp/69946fd8cf671.pdf
Normal file
BIN
src/old/public/temp/69946fd8cf671.pdf
Normal file
Binary file not shown.
BIN
src/old/public/temp/69946ff40d896.pdf
Normal file
BIN
src/old/public/temp/69946ff40d896.pdf
Normal file
Binary file not shown.
BIN
src/old/public/temp/699470c600573.pdf
Normal file
BIN
src/old/public/temp/699470c600573.pdf
Normal file
Binary file not shown.
BIN
src/old/public/temp/6994717c20e23.pdf
Normal file
BIN
src/old/public/temp/6994717c20e23.pdf
Normal file
Binary file not shown.
BIN
src/old/test.pdf
Normal file
BIN
src/old/test.pdf
Normal file
Binary file not shown.
13
src/old/test.svg
Normal file
13
src/old/test.svg
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="333" height="333" viewBox="0 0 333 333" xml:space="preserve">
|
||||||
|
<desc>Created with Fabric.js 1.6.5</desc>
|
||||||
|
<defs></defs>
|
||||||
|
<g id="canvas" style="display:inline" ><rect id="background-color" x="-333" y="-333" rx="0" ry="0" width="666" height="666" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(255,255,255); fill-rule: nonzero; opacity: 1;" transform="translate(166.75 166.75) scale(0.5 0.5)"/>
|
||||||
|
<clipPath id="canvas-cb1203cc-e905-45a4-c379-e48b1f8c468c"><rect x="-316.4" y="-316.4" rx="0" ry="0" width="632.8" height="632.8" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(255,255,255); fill-opacity: 0; fill-rule: nonzero; opacity: 1;" transform="translate(0 0) matrix(1 0 0 1 -6.100000000000023 -28.700000000000045) "/>
|
||||||
|
</clipPath> <g clip-path="url(#canvas-cb1203cc-e905-45a4-c379-e48b1f8c468c)" transform="translate(166.5 177.8) scale(0.5 0.5)">
|
||||||
|
<text font-family="Noto Serif Display" font-size="40" font-weight="normal" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1;" >
|
||||||
|
<tspan x="-80.53" y="12.6" fill="rgb(0,0,0)">Dein Text</tspan>
|
||||||
|
</text>
|
||||||
|
</g>
|
||||||
|
</g></svg>
|
||||||
|
After Width: | Height: | Size: 1.6 KiB |
Loading…
Reference in New Issue
Block a user