diff --git a/.docker/images/nginx/conf.d/default.conf b/.docker/images/nginx/conf.d/default.conf index 9e84e8358..2d62736b1 100644 --- a/.docker/images/nginx/conf.d/default.conf +++ b/.docker/images/nginx/conf.d/default.conf @@ -64,10 +64,10 @@ server { try_files $uri @sfFront; } - # location /w2p/ { - # proxy_pass http://tp:8080/w2p/; - # proxy_temp_path /tmp/proxy; - # } + location /w2p/ { + proxy_pass http://tp:8080/w2p/; + proxy_temp_path /tmp/proxy; + } location @sfFront { # Symfony if ($request_method = 'OPTIONS') { diff --git a/src/Anleitung_V1.3.pdf.jpg b/src/Anleitung_V1.3.pdf.jpg deleted file mode 100644 index 20529fa61..000000000 Binary files a/src/Anleitung_V1.3.pdf.jpg and /dev/null differ diff --git a/src/new/assets/tailwind/js/order.js b/src/new/assets/tailwind/js/order.js index b6ebe1069..8b8c3f97b 100644 --- a/src/new/assets/tailwind/js/order.js +++ b/src/new/assets/tailwind/js/order.js @@ -33,12 +33,14 @@ const Order_List_Preview = (uploadTypeObject) => { const Order_List_Detail = ({ uuid, basketField1, customerInfo, basketField2, pos, price, product, status, allNet, reOrder, reOrderOrder, reOrderPos, uploadTypeObject }, orderUuid) => `
- ${Order_List_Preview(uploadTypeObject)}
Pos:
${pos}
+
+ ${Order_List_Preview(uploadTypeObject)} +
Produkt:
@@ -48,7 +50,7 @@ const Order_List_Detail = ({ uuid, basketField1, customerInfo, basketField2, pos ${psc.order.get_special_product_options(product.specialProductTypeObject)}
-
+
Auflage:
${price.count}
@@ -56,14 +58,14 @@ const Order_List_Detail = ({ uuid, basketField1, customerInfo, basketField2, pos Kunden Info:
${customerInfo}${(reOrder ? `
Ist eine Nachbestellung` : ``)}
-
+
Preis:
${new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(price.allNet / 100)}
(${new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(price.allGross / 100)})
-
+
Status:
diff --git a/src/new/src/PSC/Shop/OrderBundle/Resources/views/backend/upload/center_modal.html.twig b/src/new/src/PSC/Shop/OrderBundle/Resources/views/backend/upload/center_modal.html.twig new file mode 100644 index 000000000..9883b099d --- /dev/null +++ b/src/new/src/PSC/Shop/OrderBundle/Resources/views/backend/upload/center_modal.html.twig @@ -0,0 +1,114 @@ + + + + + + Upload Center + + + + +{% if error %} +
+ {{ error }} +
+{% endif %} + +{# Vorhandene Uploads #} +{% set uploads = orderpos.uploads %} +{% if uploads|length > 0 %} +
+

Vorhandene Dateien

+
    + {% for upload in uploads %} +
  • +
    + + + + {{ upload.name }} + {% if upload.typ %} + + {{ upload.typ }} + + {% endif %} +
    +
    + + + + + Download + +
    + +
    +
    +
  • + {% endfor %} +
+
+{% else %} +

Noch keine Dateien hochgeladen.

+{% endif %} + +{# Upload-Formular #} +
+

Neue Datei hochladen

+
+
+ + {% if uploadAreas|length > 0 %} + + {% else %} + +

Keine Bereiche am Produkt konfiguriert.

+ {% endif %} +
+
+ + +
+ +
+
+ + + diff --git a/src/new/src/PSC/Shop/ProductBundle/Service/UploadOption/CenterUpload.php b/src/new/src/PSC/Shop/ProductBundle/Service/UploadOption/CenterUpload.php index e9806b5d5..319d02c9e 100644 --- a/src/new/src/PSC/Shop/ProductBundle/Service/UploadOption/CenterUpload.php +++ b/src/new/src/PSC/Shop/ProductBundle/Service/UploadOption/CenterUpload.php @@ -29,7 +29,7 @@ class CenterUpload implements IUploadOption public function getContentUrl(): ?string { - return null; + return '/apps/backend/order/upload/center-modal'; } public function isEnabled(ProductEntity $entity, ?ProductDoc $document): bool diff --git a/src/new/src/PSC/System/PluginBundle/Form/Interfaces/Section.php b/src/new/src/PSC/System/PluginBundle/Form/Interfaces/Section.php index d7e726e13..0224a2b6a 100755 --- a/src/new/src/PSC/System/PluginBundle/Form/Interfaces/Section.php +++ b/src/new/src/PSC/System/PluginBundle/Form/Interfaces/Section.php @@ -29,8 +29,12 @@ interface Section public const Shop = 9; public const Order = 10; public const OrderPositionDetail = 11; + public function getTitle(); + public function getId(); + public function getModule(); + public function getController(); } diff --git a/src/new/var/plugins/Custom/PSC/LaufkartenLayouter/Api/Preview.php b/src/new/var/plugins/Custom/PSC/LaufkartenLayouter/Api/Preview.php index 2c56f5492..74d1d8d03 100644 --- a/src/new/var/plugins/Custom/PSC/LaufkartenLayouter/Api/Preview.php +++ b/src/new/var/plugins/Custom/PSC/LaufkartenLayouter/Api/Preview.php @@ -41,6 +41,7 @@ class Preview array $ocrMarkers, array $configData = [], array $currentFile = [], + array $tab = [], ): void { if (empty($ocrMarkers)) { return; @@ -78,7 +79,9 @@ class Preview // Draw text with configurable font size $pdf->SetFont('helvetica', 'B', $size); // size is font size in pt $pdf->SetTextColor(0, 0, 0); - $pdf->Text($x, $y, $text); + if (isset($tab['tabNumber'])) { + $pdf->Text($x, $y, $text . ' Tab: ' . $tab['tabNumber']); + } // Restore transformation $pdf->StopTransform(); @@ -167,7 +170,7 @@ class Preview }); $tab = array_shift($tab); // Render OCR markers on this page - $this->renderOcrMarkers($pdf, $configData['ocrMarkers'] ?? [], $configData, $file); + $this->renderOcrMarkers($pdf, $configData['ocrMarkers'] ?? [], $configData, $file, $tab); // Draw colored background rectangle $bgColor = $this->getBackgroundColor($file['color']); diff --git a/src/new/var/plugins/Custom/PSC/LaufkartenLayouter/Queue/Render.php b/src/new/var/plugins/Custom/PSC/LaufkartenLayouter/Queue/Render.php index caf695e62..a6b82e1c3 100644 --- a/src/new/var/plugins/Custom/PSC/LaufkartenLayouter/Queue/Render.php +++ b/src/new/var/plugins/Custom/PSC/LaufkartenLayouter/Queue/Render.php @@ -48,21 +48,13 @@ class Render implements QueueInterface, ConfigurableElementInterface return 'LaufkartenLayouter Renderer'; } - public function getForm(FormBuilderInterface $builder, $form_options, EventInterface $event): void - { - } + public function getForm(FormBuilderInterface $builder, $form_options, EventInterface $event): void {} - public function injectDocument(Form $form, EventInterface $event, Queue $objQueue): void - { - } + public function injectDocument(Form $form, EventInterface $event, Queue $objQueue): void {} - public function setFormData(Form $form, EventInterface $event, Queue $queueObj): void - { - } + public function setFormData(Form $form, EventInterface $event, Queue $queueObj): void {} - public function getTemplate(): void - { - } + public function getTemplate(): void {} public function execute(EventInterface $event, Queue $doc): bool { @@ -154,7 +146,7 @@ class Render implements QueueInterface, ConfigurableElementInterface $configData['contentAreaHeight'], false, ); - $this->renderOcrMarkers($pdf, $configData['ocrMarkers'] ?? []); + $this->renderOcrMarkers($pdf, $configData['ocrMarkers'] ?? [], $tab); $this->drawTab($pdf, $tab, $tab['x'], $tab['y'], $file); // Page 2 (back, mirrored) @@ -168,7 +160,7 @@ class Render implements QueueInterface, ConfigurableElementInterface $configData['contentAreaHeight'], false, ); - $this->renderOcrMarkers($pdf, $configData['ocrMarkers'] ?? []); + $this->renderOcrMarkers($pdf, $configData['ocrMarkers'] ?? [], $tab); $xPos = $configData['width'] - $tab['width'] - $tab['x']; $this->drawTab($pdf, $tab, $xPos - 1, $tab['y'] - 1, $file, $tab['width'] + 2, $tab['height'] + 1); } else { @@ -182,7 +174,7 @@ class Render implements QueueInterface, ConfigurableElementInterface $configData['contentAreaHeight'], false, ); - $this->renderOcrMarkers($pdf, $configData['ocrMarkers'] ?? []); + $this->renderOcrMarkers($pdf, $configData['ocrMarkers'] ?? [], $tab); if ($frontSide) { $this->drawTab($pdf, $tab, $tab['x'], $tab['y'], $file); @@ -245,7 +237,7 @@ class Render implements QueueInterface, ConfigurableElementInterface ); } - private function renderOcrMarkers(Fpdi $pdf, array $ocrMarkers): void + private function renderOcrMarkers(Fpdi $pdf, array $ocrMarkers, array $tab = []): void { if (empty($ocrMarkers)) { return; @@ -272,7 +264,7 @@ class Render implements QueueInterface, ConfigurableElementInterface $pdf->Rotate(90, $x, $y); $pdf->SetFont('helvetica', 'B', $size); $pdf->SetTextColor(0, 0, 0); - $pdf->Text($x, $y, $marker['text'] ?? ''); + $pdf->Text($x, $y, $marker['text'] ?? '' . ' Tab: ' . $tab['tabNumber']); $pdf->StopTransform(); break; diff --git a/src/new/var/plugins/System/PSC/Invoice/Button/OrderListButton.php b/src/new/var/plugins/System/PSC/Invoice/Button/OrderListButton.php new file mode 100644 index 000000000..c90461ffb --- /dev/null +++ b/src/new/var/plugins/System/PSC/Invoice/Button/OrderListButton.php @@ -0,0 +1,36 @@ +urlGenerator->generate('psc_backend_invoice_index_create') . '#/' . $order->getUuid(); + + return ( + '' + . '' + . '' + . '' + . 'Bearbeiten' + . '' + ); + } +} diff --git a/src/new/var/plugins/System/PSC/Invoice/InvoiceTS/src/modules/positions/ItemsComponent.tsx b/src/new/var/plugins/System/PSC/Invoice/InvoiceTS/src/modules/positions/ItemsComponent.tsx index 4c0a79616..11e95d429 100644 --- a/src/new/var/plugins/System/PSC/Invoice/InvoiceTS/src/modules/positions/ItemsComponent.tsx +++ b/src/new/var/plugins/System/PSC/Invoice/InvoiceTS/src/modules/positions/ItemsComponent.tsx @@ -19,7 +19,7 @@ const ItemsComponent = ({positions, delPos, shop, changePos}) => { Netto MwSt Brutto - Status + Druckdaten diff --git a/src/new/var/plugins/System/PSC/Invoice/InvoiceTS/src/modules/positions/PosComponent.tsx b/src/new/var/plugins/System/PSC/Invoice/InvoiceTS/src/modules/positions/PosComponent.tsx index be7324853..a1b5b3941 100644 --- a/src/new/var/plugins/System/PSC/Invoice/InvoiceTS/src/modules/positions/PosComponent.tsx +++ b/src/new/var/plugins/System/PSC/Invoice/InvoiceTS/src/modules/positions/PosComponent.tsx @@ -5,7 +5,7 @@ import Button from '../base/Button' import EditPositionComponent from './EditPositionComponent' import { Shop } from '../../model/shop' import Currency from '../base/Currency' -import { Button as FlowbiteButton } from "flowbite-react" +import { Button as FlowbiteButton, Spinner } from "flowbite-react" import ProductService from '../../services/product' import {UploadOption} from '../../model/uploadOption' import UploadOptionModal from './UploadOptionModal' @@ -13,14 +13,20 @@ import UploadOptionModal from './UploadOptionModal' const PosComponent = ({index, pos, delPos, changePos, shop}) => { - const [uploadOptions, setUploadOptions] = useState([]) + const [activeOption, setActiveOption] = useState(null) + const [loadingOption, setLoadingOption] = useState(false) useEffect(() => { - if (pos.product.uuid) { + if (pos.product.uuid && pos.uploadMode) { + setLoadingOption(true) const productService = new ProductService() - productService.getUploadOptions(pos.product).then(setUploadOptions) + productService.getUploadOptions(pos.product).then(options => { + setActiveOption(options.find(o => o.type === pos.uploadMode) ?? null) + }).finally(() => setLoadingOption(false)) + } else { + setActiveOption(null) } - }, [pos.product.uuid]) + }, [pos.product.uuid, pos.uploadMode]) const deletePos = (uuid: String) => { delPos(uuid) @@ -49,13 +55,13 @@ const PosComponent = ({index, pos, delPos, changePos, shop}) => { - {uploadOptions.length > 0 && ( -
- {uploadOptions.map(option => ( - - ))} + {loadingOption ? ( +
+
- )} + ) : activeOption ? ( + + ) : null}
diff --git a/src/new/var/plugins/System/PSC/Invoice/InvoiceTS/src/modules/positions/UploadOptionModal.tsx b/src/new/var/plugins/System/PSC/Invoice/InvoiceTS/src/modules/positions/UploadOptionModal.tsx index 7721250e9..d08f6eb45 100644 --- a/src/new/var/plugins/System/PSC/Invoice/InvoiceTS/src/modules/positions/UploadOptionModal.tsx +++ b/src/new/var/plugins/System/PSC/Invoice/InvoiceTS/src/modules/positions/UploadOptionModal.tsx @@ -1,10 +1,35 @@ import React, {useState} from 'react' -import {Modal, Button as FlowbiteButton} from 'flowbite-react' +import {createPortal} from 'react-dom' +import {Button as FlowbiteButton} from 'flowbite-react' import {UploadOption} from '../../model/uploadOption' import {UploadFile} from '../../model/upload' import {Pos} from '../../model/pos' import {getUploadOptionRenderer} from '../../lib/uploadOptionRegistry' +const BigModal = ({title, onClose, children}: {title: string, onClose: () => void, children: React.ReactNode}) => + createPortal( +
+
e.stopPropagation()}> +
+

{title}

+ +
+
+ {children} +
+
+
, + document.body + ) + const UploadOptionModal = ({option, pos}: {option: UploadOption, pos: Pos}) => { const [show, setShow] = useState(false) const [files, setFiles] = useState(pos.uploads) @@ -17,14 +42,12 @@ const UploadOptionModal = ({option, pos}: {option: UploadOption, pos: Pos}) => { {option.label} - setShow(false)}> - {option.label} — {pos.product.title} - + {show && ( + setShow(false)}> {option.contentUrl ? (