Better Invoice Layout

This commit is contained in:
Thomas Peterson 2025-10-06 11:10:50 +02:00
parent 70dc88cd29
commit 749138b541
7 changed files with 44 additions and 21 deletions

View File

@ -3,7 +3,7 @@ import "reflect-metadata";
import * as $ from "jquery"; import * as $ from "jquery";
import { App } from "./app/app"; import { App } from "./app/app";
let jwt_token: String = "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpYXQiOjE3NTk3MzQ4NzEsImV4cCI6MTc1OTczODQ3MSwicm9sZXMiOlsiUk9MRV9BRE1JTiIsIlJPTEVfU0hPUF9PUEVSQVRPUiIsIlJPTEVfVVNFUiIsIlJPTEVfVVNFUiIsIlJPTEVfUFNDX0NvbGxlY3RfQ29udGFjdF9FZGl0IiwiUk9MRV9QU0NfQ29sbGVjdF9Db250YWN0X0FkZCIsIlJPTEVfUFNDX0NvbGxlY3RfQ29udGFjdF9EZWxldGUiLCJST0xFX1BTQ19Db2xsZWN0X0NvbnRhY3RfTG9jayIsIlJPTEVfUFNDX1IyX1NlbmRjbG91ZF9TaG93Il0sInVpZCI6MX0.n5IAqcnge4Gh7-XB6KazcT3eFF_H2VZFC_-jgR878svsgcAv5zXFDpLpuS5KZRl_NF1B7e1SZV1dChoOpl6rL0j0Q3dCz76S62nq7imGA0ATj9VJae-Y1DWKRfu1T7nP6ST2gQWK6BpbLKHaVyBi4doEQZr0_0VX05MmIQC1Vci5pUsPqmJ3LRpsdcxZFhN-Vn-s8Rnr8DjTGS4PzX1u1G-UcZvqON39TqaE9PuL8_SvGqtEOj0iNsK0Szp2BPljoAD_f8eM12KyIVhyrbbyO7rYmo-Ob51eoV3tbJcONau20709ShA9PAj1bQsLlZkKEetzdmiKkoXbbIYrID2HvQ"; let jwt_token: String = "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpYXQiOjE3NTk3NDE2OTYsImV4cCI6MTc1OTc0NTI5Niwicm9sZXMiOlsiUk9MRV9BRE1JTiIsIlJPTEVfU0hPUF9PUEVSQVRPUiIsIlJPTEVfVVNFUiIsIlJPTEVfVVNFUiIsIlJPTEVfUFNDX0NvbGxlY3RfQ29udGFjdF9FZGl0IiwiUk9MRV9QU0NfQ29sbGVjdF9Db250YWN0X0FkZCIsIlJPTEVfUFNDX0NvbGxlY3RfQ29udGFjdF9EZWxldGUiLCJST0xFX1BTQ19Db2xsZWN0X0NvbnRhY3RfTG9jayIsIlJPTEVfUFNDX1IyX1NlbmRjbG91ZF9TaG93Il0sInVpZCI6MX0.jFEl7EgvuFKOhG_MwRjQ1Tbx7Q48PSwfxuZUGxt0vGRSPj5ImoLJTQEsf0hQqaXIMG-kerbNXNfbvYniZT1xCBUSWADCg3Io_5QJrGhC8Su0FHOeT1iCICFV11_1q0r6PGA_KaBTVNDrMGvDx06UdrKwIosocRa1cHDmf_vUqmPy8OsqeKwSm0mqaiDuRIIsBQvxEiPz5l5R0QEHaKObUAfb1eXBSV7R3-QNX4EKDUjeoT8YiF04ZlLe2qOOkRW0gCmEEKyxgwIvbeucwipaiNVRUeroAQ7FlTaIW3GoXAsDs7yaXeDZVRnNz3Q4Rkfss0J_OL1BAgW0muQJvBDEfw";
let app = new App(jwt_token); let app = new App(jwt_token);
app.init(); app.init();
app.run(); app.run();

View File

@ -33,7 +33,7 @@ const ContactComponent = ({order, shop}) => {
} }
return ( return (
<div className="bg-white dark:bg-gray-800 rounded-lg shadow-sm p-4 animate-fade-in"> <div className="bg-white dark:bg-gray-800 rounded-lg shadow-lg p-4 animate-fade-in border-2 border-blue-200 dark:border-blue-900">
<h2 className="text-lg font-semibold mb-3 text-gray-800 dark:text-gray-100 flex items-center gap-2"> <h2 className="text-lg font-semibold mb-3 text-gray-800 dark:text-gray-100 flex items-center gap-2">
<svg className="w-6 h-6 text-blue-600 dark:text-blue-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <svg className="w-6 h-6 text-blue-600 dark:text-blue-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" /> <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" />

View File

@ -35,24 +35,44 @@ const InfoFieldComponent = ({shop, order}) => {
} }
return ( return (
<div className=""> <div className="bg-white dark:bg-gray-800 rounded-lg shadow-lg p-4 animate-fade-in border-2 border-amber-200 dark:border-amber-900">
<div className={"flex"}> <h2 className="text-lg font-semibold mb-3 text-gray-800 dark:text-gray-100 flex items-center gap-2">
<div className={"flex-1"}> <svg className="w-6 h-6 text-amber-600 dark:text-amber-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<div className='flex gap-1'> <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
<input type="text" name="basketField1" value={basketField1} onChange={ e => changeBasketField1(e.target.value)} className={"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"} placeholder={"Info 1"} /> </svg>
<label>{shop.basketField1}</label> Zusatzinformationen
</div> </h2>
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<label className="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
{shop.basketField1 || "Info 1"}
</label>
<input
type="text"
name="basketField1"
value={basketField1}
onChange={e => changeBasketField1(e.target.value)}
className="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-amber-500 focus:border-amber-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-amber-500 dark:focus:border-amber-500"
placeholder={shop.basketField1 || "Info 1"}
/>
</div> </div>
<div className={"flex-1"}> <div>
<div className='flex gap-1'> <label className="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
<input type="text" name="basketField2" value={basketField2} onChange={e => changeBasketField2(e.target.value)} className={"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"} placeholder={"Info 2"} /> {shop.basketField2 || "Info 2"}
<label>{shop.basketField2}</label> </label>
</div> <input
type="text"
name="basketField2"
value={basketField2}
onChange={e => changeBasketField2(e.target.value)}
className="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-amber-500 focus:border-amber-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-amber-500 dark:focus:border-amber-500"
placeholder={shop.basketField2 || "Info 2"}
/>
</div> </div>
</div> </div>
</div> </div>
); );
} };
InfoFieldComponent.propTypes = { InfoFieldComponent.propTypes = {
order: PropTypes.instanceOf(Order), order: PropTypes.instanceOf(Order),

View File

@ -44,7 +44,7 @@ const PaymentComponent = ({ shop, order }) => {
} }
return ( return (
<div className="bg-white dark:bg-gray-800 rounded-lg shadow-sm p-4 animate-fade-in"> <div className="bg-white dark:bg-gray-800 rounded-lg shadow-lg p-4 animate-fade-in border-2 border-emerald-200 dark:border-emerald-900">
<h2 className="text-lg font-semibold mb-3 text-gray-800 dark:text-gray-100 flex items-center gap-2"> <h2 className="text-lg font-semibold mb-3 text-gray-800 dark:text-gray-100 flex items-center gap-2">
<svg className="w-6 h-6 text-emerald-600 dark:text-emerald-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <svg className="w-6 h-6 text-emerald-600 dark:text-emerald-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z" /> <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z" />

View File

@ -43,9 +43,9 @@ const PositionsComponent = ({order, shop, updateOrder}) => {
}, [positions]) }, [positions])
return ( return (
<div className="bg-white dark:bg-gray-800 rounded-lg shadow-sm p-4 animate-fade-in"> <div className="bg-white dark:bg-gray-800 rounded-lg shadow-lg p-4 animate-fade-in border-2 border-indigo-200 dark:border-indigo-900">
<h2 className="text-lg font-semibold mb-3 text-gray-800 dark:text-gray-100 flex items-center gap-2"> <h2 className="text-lg font-semibold mb-3 text-gray-800 dark:text-gray-100 flex items-center gap-2">
<svg className="w-6 h-6 text-purple-600 dark:text-purple-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <svg className="w-6 h-6 text-indigo-600 dark:text-indigo-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01" /> <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01" />
</svg> </svg>
Positionen Positionen

View File

@ -42,7 +42,7 @@ const ShippingComponent = ({shop, order}) => {
} }
return ( return (
<div className="bg-white dark:bg-gray-800 rounded-lg shadow-sm p-4 animate-fade-in"> <div className="bg-white dark:bg-gray-800 rounded-lg shadow-lg p-4 animate-fade-in border-2 border-orange-200 dark:border-orange-900">
<h2 className="text-lg font-semibold mb-3 text-gray-800 dark:text-gray-100 flex items-center gap-2"> <h2 className="text-lg font-semibold mb-3 text-gray-800 dark:text-gray-100 flex items-center gap-2">
<svg className="w-6 h-6 text-orange-600 dark:text-orange-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <svg className="w-6 h-6 text-orange-600 dark:text-orange-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M5 8h14M5 8a2 2 0 110-4h14a2 2 0 110 4M5 8v10a2 2 0 002 2h10a2 2 0 002-2V8m-9 4h4" /> <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M5 8h14M5 8a2 2 0 110-4h14a2 2 0 110 4M5 8v10a2 2 0 002 2h10a2 2 0 002-2V8m-9 4h4" />

View File

@ -4237,6 +4237,9 @@ class BasketController extends TP_Controller_Action
->fetchOne(); ->fetchOne();
$basket->setDeliveryPLZ($delivery_address->zip); $basket->setDeliveryPLZ($delivery_address->zip);
$basket->setDeliveryCountry($delivery_address->country ?? 'DE'); $basket->setDeliveryCountry($delivery_address->country ?? 'DE');
if ($basket->getDeliveryCountry() == '') {
$basket->setDeliveryCountry('DE');
}
$shippingtype = Doctrine_Query::create() $shippingtype = Doctrine_Query::create()
->select() ->select()
->from('Shippingtype s') ->from('Shippingtype s')