Backend Revocation
Some checks failed
Gitea Actions / Run-Tests-On-Amd64 (push) Failing after 14m57s
Gitea Actions / Merge (push) Successful in 5m40s
Gitea Actions / Run-Tests-On-Arm64 (push) Has been cancelled

This commit is contained in:
Thomas Peterson 2026-06-24 14:53:15 +02:00
parent 982642543d
commit 9906737f39
16 changed files with 156 additions and 26 deletions

View File

@ -20,6 +20,7 @@ use PSC\Shop\QueueBundle\Service\Queue\Manager;
use PSC\System\SettingsBundle\Service\DiskUsage; use PSC\System\SettingsBundle\Service\DiskUsage;
use PSC\System\SettingsBundle\Service\Instance; use PSC\System\SettingsBundle\Service\Instance;
use PSC\System\SettingsBundle\Service\Shop; use PSC\System\SettingsBundle\Service\Shop;
use PSC\System\SettingsBundle\Service\Version;
use PSC\System\UpdateBundle\Service\Migration; use PSC\System\UpdateBundle\Service\Migration;
use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bridge\Twig\Attribute\Template;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
@ -61,6 +62,7 @@ class DashboardController extends AbstractController
ContactRepository $contactRepository, ContactRepository $contactRepository,
Order $orderService, Order $orderService,
DiskUsage $diskUsage, DiskUsage $diskUsage,
Version $version,
) { ) {
// Muss vor dem ersten Laden des Shops geprüft werden: ausstehende // Muss vor dem ersten Laden des Shops geprüft werden: ausstehende
// Migrationen können Spalten ergänzen, die das Shop-Entity bereits mappt // Migrationen können Spalten ergänzen, die das Shop-Entity bereits mappt
@ -173,6 +175,9 @@ class DashboardController extends AbstractController
'instance' => $instanceService->getInstance(), 'instance' => $instanceService->getInstance(),
'chart' => $chart, 'chart' => $chart,
'diskUsage' => $this->isGranted('ROLE_ADMIN') ? $diskUsage->getUsage() : null, 'diskUsage' => $this->isGranted('ROLE_ADMIN') ? $diskUsage->getUsage() : null,
'currentVersion' => $version->getRelease(),
'latestVersion' => $this->isGranted('ROLE_ADMIN') ? $version->getLatestRelease() : null,
'updateAvailable' => $this->isGranted('ROLE_ADMIN') ? $version->isUpdateAvailable() : false,
]; ];
} }
} }

View File

@ -25,6 +25,17 @@
<tr><td class="px-4 py-3">{{ 'psc_backend_dashboard.Layout'|trans }}:</td><td class="px-4 py-3">{{ shop.layout }}</td></tr> <tr><td class="px-4 py-3">{{ 'psc_backend_dashboard.Layout'|trans }}:</td><td class="px-4 py-3">{{ shop.layout }}</td></tr>
<tr><td class="px-4 py-3">{{ 'psc_backend_dashboard.UID'|trans }}:</td><td class="px-4 py-3">{{ shop.uid }}</td></tr> <tr><td class="px-4 py-3">{{ 'psc_backend_dashboard.UID'|trans }}:</td><td class="px-4 py-3">{{ shop.uid }}</td></tr>
<tr><td class="px-4 py-3">{{ 'psc_backend_dashboard.UUID'|trans }}:</td><td class="px-4 py-3">{{ shop.uuid }}</td></tr> <tr><td class="px-4 py-3">{{ 'psc_backend_dashboard.UUID'|trans }}:</td><td class="px-4 py-3">{{ shop.uuid }}</td></tr>
<tr>
<td class="px-4 py-3">Version:</td>
<td class="px-4 py-3">
{{ currentVersion }}
{% if updateAvailable %}
<span class="ml-2 bg-yellow-500 text-yellow-800 text-xs font-medium px-2.5 py-0.5 rounded">Update verfügbar: {{ latestVersion }}</span>
{% elseif latestVersion %}
<span class="ml-2 bg-green-100 text-green-800 text-xs font-medium px-2.5 py-0.5 rounded">Aktuell</span>
{% endif %}
</td>
</tr>
</tbody> </tbody>
</table> </table>
</div> </div>

View File

@ -135,6 +135,14 @@ class Orderpos
*/ */
#[ORM\Column(name: 'revoked_at', type: 'datetime', nullable: true)] #[ORM\Column(name: 'revoked_at', type: 'datetime', nullable: true)]
private ?\DateTimeInterface $revokedAt = null; private ?\DateTimeInterface $revokedAt = null;
/**
* Snapshot zum Bestellzeitpunkt: War der Widerruf für das Produkt möglich?
* Spätere Änderungen am Produkt-Flag wirken sich dadurch nicht auf
* bestehende Bestellungen aus.
*/
#[ORM\Column(name: 'revoke_allowed', type: 'boolean', nullable: true)]
private ?bool $revokeAllowed = null;
/** /**
* @var Product * @var Product
*/ */
@ -1097,4 +1105,17 @@ class Orderpos
{ {
$this->revokedAt = $revokedAt; $this->revokedAt = $revokedAt;
} }
/**
* War der Widerruf für das Produkt zum Bestellzeitpunkt möglich?
*/
public function isRevokeAllowed(): bool
{
return (bool) $this->revokeAllowed;
}
public function setRevokeAllowed(?bool $revokeAllowed): void
{
$this->revokeAllowed = $revokeAllowed;
}
} }

View File

@ -60,7 +60,7 @@ prices: Preise
actions: Aktionen actions: Aktionen
revokePossible: Widerruf möglich revokePossible: Widerruf möglich
revokeNotPossible: Widerruf nicht möglich revokeNotPossible: Widerruf nicht möglich
revokeDoneAt: Widerruf erfolgt am revokeDoneAt: Widerruf erfolgte am
revokeBy: durch revokeBy: durch
customerHint: Hinweis für den Kunden customerHint: Hinweis für den Kunden
printPartnerHint: Hinweis für den Druckpartner printPartnerHint: Hinweis für den Druckpartner

View File

@ -555,10 +555,9 @@
<span> <span>
{{'revokeDoneAt'|trans}} {{'revokeDoneAt'|trans}}
{% if pos.obj.revokedAt %}<span class="font-medium">{{ pos.obj.revokedAt|date('d.m.Y H:i') }} Uhr</span>{% endif %} {% if pos.obj.revokedAt %}<span class="font-medium">{{ pos.obj.revokedAt|date('d.m.Y H:i') }} Uhr</span>{% endif %}
{% if order.contact %}<br>{{'revokeBy'|trans}} {{ order.contact.firstname }} {{ order.contact.lastname }}{% endif %}
</span> </span>
</div> </div>
{% elseif pos.obj.product.revokeButtonEnable %} {% elseif pos.obj.revokeAllowed %}
<div class="flex items-center gap-2 rounded-md border border-emerald-200 bg-emerald-50 px-3 py-2 text-xs font-medium text-emerald-700 mb-3"> <div class="flex items-center gap-2 rounded-md border border-emerald-200 bg-emerald-50 px-3 py-2 text-xs font-medium text-emerald-700 mb-3">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-4 h-4 shrink-0"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg> <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-4 h-4 shrink-0"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>
{{'revokePossible'|trans}} {{'revokePossible'|trans}}

View File

@ -176,6 +176,12 @@ class Order
$positionDoc = new \PSC\Shop\EntityBundle\Document\Position(); $positionDoc = new \PSC\Shop\EntityBundle\Document\Position();
$positionEntity->setOrder($orderEntity); $positionEntity->setOrder($orderEntity);
$this->positionTransformer->toDb($position, $positionEntity, $positionDoc); $this->positionTransformer->toDb($position, $positionEntity, $positionDoc);
// Snapshot zum Bestellzeitpunkt: War der Widerruf für das Produkt
// möglich? Nur bei neu angelegten Positionen setzen, damit spätere
// Produktänderungen bestehende Bestellungen nicht beeinflussen.
if ($positionEntity->getProduct()) {
$positionEntity->setRevokeAllowed($positionEntity->getProduct()->isRevokeButtonEnable());
}
$this->entityManager->persist($positionEntity); $this->entityManager->persist($positionEntity);
$this->entityManager->flush(); $this->entityManager->flush();

View File

@ -4,13 +4,23 @@ namespace PSC\System\SettingsBundle\Service;
use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\Yaml\Yaml; use Symfony\Component\Yaml\Yaml;
use Symfony\Contracts\Cache\CacheInterface;
use Symfony\Contracts\Cache\ItemInterface;
use Symfony\Contracts\HttpClient\HttpClientInterface;
class Version class Version
{ {
/**
* RSS-Feed mit den veröffentlichten Releases.
*/
private const RELEASES_FEED = 'https://git.thomas-peterson.de/boonkerz/printshopcreator/releases.rss';
private ?array $data = null; private ?array $data = null;
public function __construct( public function __construct(
private readonly KernelInterface $kernel, private readonly KernelInterface $kernel,
private readonly HttpClientInterface $httpClient,
private readonly CacheInterface $cache,
) {} ) {}
private function load(): void private function load(): void
@ -37,4 +47,64 @@ class Version
$this->load(); $this->load();
return $this->data['changelog'] ?? []; return $this->data['changelog'] ?? [];
} }
/**
* Neueste verfügbare Version aus dem Release-RSS-Feed.
* Ergebnis wird zwischengespeichert, damit das Dashboard schnell bleibt und
* der Feed nicht bei jedem Aufruf abgefragt wird. Bei Fehlern: null.
*/
public function getLatestRelease(): ?string
{
return $this->cache->get('psc_latest_release_version', function (ItemInterface $item): ?string {
$item->expiresAfter(3600);
try {
$response = $this->httpClient->request('GET', self::RELEASES_FEED, [
'timeout' => 5,
]);
$content = $response->getContent();
$xml = @simplexml_load_string($content);
if ($xml === false) {
return null;
}
// RSS 2.0 (channel->item) bzw. Atom (entry) unterstützen.
$title = null;
if (isset($xml->channel->item[0]->title)) {
$title = (string) $xml->channel->item[0]->title;
} elseif (isset($xml->entry[0]->title)) {
$title = (string) $xml->entry[0]->title;
}
if ($title === null || $title === '') {
return null;
}
// Versionsnummer (z.B. 2.3.7) aus dem Titel extrahieren.
if (preg_match('/\d+\.\d+(?:\.\d+)*/', $title, $matches)) {
return $matches[0];
}
return ltrim(trim($title), 'vV');
} catch (\Throwable) {
return null;
}
});
}
/**
* Ist eine neuere Version als die installierte verfügbar?
*/
public function isUpdateAvailable(): bool
{
$latest = $this->getLatestRelease();
if ($latest === null || $latest === '') {
return false;
}
return version_compare($latest, $this->getRelease(), '>');
}
} }

View File

@ -0,0 +1,12 @@
<?php
namespace PSC\System\UpdateBundle\Migrations;
class Version20260624120000 extends Base
{
public function migrateDatabase(): void
{
$connection = $this->entityManager->getConnection();
$connection->executeQuery("ALTER TABLE orderspos ADD COLUMN revoke_allowed TINYINT(1) NULL DEFAULT NULL;");
}
}

View File

@ -106,6 +106,7 @@ abstract class BaseOrderspos extends Doctrine_Record
$this->hasColumn('revoked', 'boolean', 1); $this->hasColumn('revoked', 'boolean', 1);
$this->hasColumn('revoked_at', 'timestamp'); $this->hasColumn('revoked_at', 'timestamp');
$this->hasColumn('revoke_allowed', 'boolean', 1);
} }
public function setUp() public function setUp()

View File

@ -330,6 +330,7 @@ if($linkend == "") { ?>
<?php if(!$this->designsettings()->get('b2bshop')): ?> <?php if(!$this->designsettings()->get('b2bshop')): ?>
<li><a href="/agb"><?php echo $this->translate('AGB')?></a></li> <li><a href="/agb"><?php echo $this->translate('AGB')?></a></li>
<li><a href="/revocation"><?php echo $this->translate('Widerrufsbelehrung')?></a></li> <li><a href="/revocation"><?php echo $this->translate('Widerrufsbelehrung')?></a></li>
<li><a href="/revocationform"><?php echo $this->translate('Widerruf')?></a></li>
<li><a href="/privacy"><?php echo $this->translate('Datenschutzerklärung')?></a></li> <li><a href="/privacy"><?php echo $this->translate('Datenschutzerklärung')?></a></li>
<li><a href="/impress"><?php echo $this->translate('Impressum')?></a></li> <li><a href="/impress"><?php echo $this->translate('Impressum')?></a></li>
<?php endif; ?> <?php endif; ?>

View File

@ -24,7 +24,7 @@
<td> <td>
<?php if ($pos->revoked): ?> <?php if ($pos->revoked): ?>
<span class="label label-info"><?php echo $this->translate('Widerrufen am') ?> <?php echo $this->escape($pos->revoked_at) ?></span> <span class="label label-info"><?php echo $this->translate('Widerrufen am') ?> <?php echo $this->escape($pos->revoked_at) ?></span>
<?php elseif ($pos->Article->revoke_button_enable): ?> <?php elseif ($pos->revoke_allowed): ?>
<form method="post" action="/revocationform/order/uuid/<?php echo $this->escape($this->order->uuid) ?>" style="margin:0"> <form method="post" action="/revocationform/order/uuid/<?php echo $this->escape($this->order->uuid) ?>" style="margin:0">
<input type="hidden" name="pos" value="<?php echo $this->escape($pos->uuid) ?>" /> <input type="hidden" name="pos" value="<?php echo $this->escape($pos->uuid) ?>" />
<button type="submit" class="btn btn-warning btn-sm"><?php echo $this->translate('Widerrufen') ?></button> <button type="submit" class="btn btn-warning btn-sm"><?php echo $this->translate('Widerrufen') ?></button>

View File

@ -60,27 +60,25 @@
<div class="p-1 bg-headerFooter text-altHeaderFooter"> <div class="p-1 bg-headerFooter text-altHeaderFooter">
<div class="m-auto max-w-[1690px] md:columns-2"> <div class="m-auto max-w-[1690px] md:columns-2">
<div class="text-sm w-full"> <div class="text-sm w-full">
<div class="mr-2 float-left ml-2"> <div class="ml-2 flex flex-wrap items-center gap-x-3 gap-y-1">
<?php echo $this->shop->betreiber_company ?> - <?php echo $this->shop->betreiber_street ?> - <?php echo $this->shop->betreiber_address ?> <span><?php echo $this->shop->betreiber_company ?> - <?php echo $this->shop->betreiber_street ?> - <?php echo $this->shop->betreiber_address ?></span>
</div> <a href="tel:<?php echo $this->shop->betreiber_tel ?>" class="inline-flex items-center">
</div> <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-4 mr-1"><path stroke-linecap="round" stroke-linejoin="round" d="M2.25 6.75c0 8.284 6.716 15 15 15h2.25a2.25 2.25 0 0 0 2.25-2.25v-1.372c0-.516-.351-.966-.852-1.091l-4.423-1.106c-.44-.11-.902.055-1.173.417l-.97 1.293c-.282.376-.769.542-1.21.38a12.035 12.035 0 0 1-7.143-7.143c-.162-.441.004-.928.38-1.21l1.293-.97c.363-.271.527-.734.417-1.173L6.963 3.102a1.125 1.125 0 0 0-1.091-.852H4.5A2.25 2.25 0 0 0 2.25 4.5v2.25Z" /></svg>
<div class="text-sm w-full flex justify-end gap-2">
<div class="">
<a href="tel:<?php echo $this->shop->betreiber_tel ?>">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-4 float-left mr-1 pt-1">
<path stroke-linecap="round" stroke-linejoin="round" d="M2.25 6.75c0 8.284 6.716 15 15 15h2.25a2.25 2.25 0 0 0 2.25-2.25v-1.372c0-.516-.351-.966-.852-1.091l-4.423-1.106c-.44-.11-.902.055-1.173.417l-.97 1.293c-.282.376-.769.542-1.21.38a12.035 12.035 0 0 1-7.143-7.143c-.162-.441.004-.928.38-1.21l1.293-.97c.363-.271.527-.734.417-1.173L6.963 3.102a1.125 1.125 0 0 0-1.091-.852H4.5A2.25 2.25 0 0 0 2.25 4.5v2.25Z" />
</svg>
<?php echo $this->shop->betreiber_tel ?> <?php echo $this->shop->betreiber_tel ?>
</a> </a>
</div> <a href="mailto:<?php echo $this->shop->betreiber_email ?>" class="inline-flex items-center">
<div> <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-4 mr-1"><path stroke-linecap="round" stroke-linejoin="round" d="M21.75 6.75v10.5a2.25 2.25 0 0 1-2.25 2.25h-15a2.25 2.25 0 0 1-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0 0 19.5 4.5h-15a2.25 2.25 0 0 0-2.25 2.25m19.5 0v.243a2.25 2.25 0 0 1-1.07 1.916l-7.5 4.615a2.25 2.25 0 0 1-2.36 0L3.32 8.91a2.25 2.25 0 0 1-1.07-1.916V6.75" /></svg>
<a href="mailto:<?php echo $this->shop->betreiber_email ?>">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-4 mr-1 pt-1 float-left">
<path stroke-linecap="round" stroke-linejoin="round" d="M21.75 6.75v10.5a2.25 2.25 0 0 1-2.25 2.25h-15a2.25 2.25 0 0 1-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0 0 19.5 4.5h-15a2.25 2.25 0 0 0-2.25 2.25m19.5 0v.243a2.25 2.25 0 0 1-1.07 1.916l-7.5 4.615a2.25 2.25 0 0 1-2.36 0L3.32 8.91a2.25 2.25 0 0 1-1.07-1.916V6.75" />
</svg>
<?php echo $this->shop->betreiber_email ?> <?php echo $this->shop->betreiber_email ?>
</a> </a>
</div> </div>
</div>
<div class="text-sm w-full flex justify-end gap-3 mr-2">
<?php if($this->user): ?>
<span class="inline-flex items-center"><?php echo $this->escape($this->user->self_email) ?></span>
<a href="/user/logout" class="inline-flex items-center hover:underline"><?php echo $this->translate('Logout') ?></a>
<?php else: ?>
<a href="/user/login" class="inline-flex items-center hover:underline"><?php echo $this->translate('Login') ?></a>
<?php endif; ?>
</div> </div>
</div> </div>
</div> </div>
@ -135,6 +133,9 @@
<a href="/impress">Impressum</a> <a href="/impress">Impressum</a>
<a rel="privacy-policy" href="/privacy">Datenschutzbestimmungen</a> <a rel="privacy-policy" href="/privacy">Datenschutzbestimmungen</a>
<a rel="privacy-policy" href="/revocation">Wiederrufsbelehrung</a> <a rel="privacy-policy" href="/revocation">Wiederrufsbelehrung</a>
<?php if(!$this->designsettings()->get('b2bshop')): ?>
<a href="/revocationform"><?php echo $this->translate('Widerruf')?></a>
<?php endif; ?>
</div> </div>
</div> </div>
</div> </div>

View File

@ -25,7 +25,7 @@
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-4 h-4"><path stroke-linecap="round" stroke-linejoin="round" d="M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z" /></svg> <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-4 h-4"><path stroke-linecap="round" stroke-linejoin="round" d="M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z" /></svg>
<?php echo $this->translate('Widerrufen am') ?> <?php echo $this->escape($pos->revoked_at) ?> <?php echo $this->translate('Widerrufen am') ?> <?php echo $this->escape($pos->revoked_at) ?>
</span> </span>
<?php elseif ($pos->Article->revoke_button_enable): ?> <?php elseif ($pos->revoke_allowed): ?>
<form method="post" action="/revocationform/order/uuid/<?php echo $this->escape($this->order->uuid) ?>"> <form method="post" action="/revocationform/order/uuid/<?php echo $this->escape($this->order->uuid) ?>">
<input type="hidden" name="pos" value="<?php echo $this->escape($pos->uuid) ?>" /> <input type="hidden" name="pos" value="<?php echo $this->escape($pos->uuid) ?>" />
<button type="submit" class="border bg-highlight text-altHighlight py-1.5 px-4 rounded-md hover:bg-white hover:text-black transition"><?php echo $this->translate('Widerrufen') ?></button> <button type="submit" class="border bg-highlight text-altHighlight py-1.5 px-4 rounded-md hover:bg-white hover:text-black transition"><?php echo $this->translate('Widerrufen') ?></button>

View File

@ -25,7 +25,7 @@
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-4 h-4"><path stroke-linecap="round" stroke-linejoin="round" d="M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z" /></svg> <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-4 h-4"><path stroke-linecap="round" stroke-linejoin="round" d="M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z" /></svg>
<?php echo $this->translate('Widerrufen am') ?> <?php echo $this->escape($pos->revoked_at) ?> <?php echo $this->translate('Widerrufen am') ?> <?php echo $this->escape($pos->revoked_at) ?>
</span> </span>
<?php elseif ($pos->Article->revoke_button_enable): ?> <?php elseif ($pos->revoke_allowed): ?>
<form method="post" action="/revocationform/order/uuid/<?php echo $this->escape($this->order->uuid) ?>"> <form method="post" action="/revocationform/order/uuid/<?php echo $this->escape($this->order->uuid) ?>">
<input type="hidden" name="pos" value="<?php echo $this->escape($pos->uuid) ?>" /> <input type="hidden" name="pos" value="<?php echo $this->escape($pos->uuid) ?>" />
<button type="submit" class="border bg-highlight text-altHighlight py-1.5 px-4 rounded-md hover:bg-white hover:text-black transition"><?php echo $this->translate('Widerrufen') ?></button> <button type="submit" class="border bg-highlight text-altHighlight py-1.5 px-4 rounded-md hover:bg-white hover:text-black transition"><?php echo $this->translate('Widerrufen') ?></button>

View File

@ -1885,6 +1885,7 @@ class BasketController extends TP_Controller_Action
$art->calc_xml = $article->a1_xml; $art->calc_xml = $article->a1_xml;
$art->count = $artikel->getCount(); $art->count = $artikel->getCount();
$art->article_id = $article->id; $art->article_id = $article->id;
$art->revoke_allowed = $article->revoke_button_enable ? 1 : 0;
$art->priceone = $artikel->getNetto(); $art->priceone = $artikel->getNetto();
$art->priceonesteuer = $artikel->getSteuer(); $art->priceonesteuer = $artikel->getSteuer();
$art->priceonebrutto = $artikel->getBrutto(); $art->priceonebrutto = $artikel->getBrutto();
@ -5174,6 +5175,7 @@ class BasketController extends TP_Controller_Action
$art->count = $artikel->getCount(); $art->count = $artikel->getCount();
$art->article_id = $article->id; $art->article_id = $article->id;
$art->revoke_allowed = $article->revoke_button_enable ? 1 : 0;
$art->priceone = $artikel->getNetto(); $art->priceone = $artikel->getNetto();
$art->priceonesteuer = $artikel->getSteuer(); $art->priceonesteuer = $artikel->getSteuer();
$art->priceonebrutto = $artikel->getBrutto(); $art->priceonebrutto = $artikel->getBrutto();
@ -5756,6 +5758,7 @@ class BasketController extends TP_Controller_Action
$art->orders_id = $order->id; $art->orders_id = $order->id;
$art->count = $artikel->getCount(); $art->count = $artikel->getCount();
$art->article_id = $article->id; $art->article_id = $article->id;
$art->revoke_allowed = $article->revoke_button_enable ? 1 : 0;
$art->priceone = $artikel->getNetto(); $art->priceone = $artikel->getNetto();
$art->shipping_type = $artikel->getShippingtype(); $art->shipping_type = $artikel->getShippingtype();
$art->shipping_price = $artikel->getShippingPrice(); $art->shipping_price = $artikel->getShippingPrice();

View File

@ -115,7 +115,7 @@ class RevocationformController extends TP_Controller_Action
->where('p.uuid = ? AND p.orders_id = ?', array($this->_getParam('pos'), $order->id)) ->where('p.uuid = ? AND p.orders_id = ?', array($this->_getParam('pos'), $order->id))
->fetchOne(); ->fetchOne();
if ($pos && $pos->Article && $pos->Article->revoke_button_enable && !$pos->revoked) { if ($pos && $pos->revoke_allowed && !$pos->revoked) {
$pos->revoked = 1; $pos->revoked = 1;
$pos->revoked_at = date('Y-m-d H:i:s'); $pos->revoked_at = date('Y-m-d H:i:s');
$pos->save(); $pos->save();