Fixes
@ -37,6 +37,11 @@ server {
|
|||||||
add_header Access-Control-Allow-Credentials true always;
|
add_header Access-Control-Allow-Credentials true always;
|
||||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
|
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
|
||||||
add_header Access-Control-Expose-Headers Access-Control-Allow-Origin always;
|
add_header Access-Control-Expose-Headers Access-Control-Allow-Origin always;
|
||||||
|
add_header Referrer-Policy "strict-origin" always;
|
||||||
|
add_header X-Content-Type-Options nosniff always;
|
||||||
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||||
|
add_header X-XSS-Protection "1; mode=block" always;
|
||||||
|
add_header Content-Security-Policy "default-src https: 'unsafe-eval' 'unsafe-inline'; object-src 'none'" always;
|
||||||
fastcgi_temp_path /tmp/fastcgi 1 2;
|
fastcgi_temp_path /tmp/fastcgi 1 2;
|
||||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||||
fastcgi_pass php-fpm:9000;
|
fastcgi_pass php-fpm:9000;
|
||||||
|
|||||||
@ -11,4 +11,4 @@ opcache.interned_strings_buffer=12
|
|||||||
memory_limit = -1
|
memory_limit = -1
|
||||||
|
|
||||||
disable_functions =
|
disable_functions =
|
||||||
;extension=/pdflib.so
|
extension=/pdflib.so
|
||||||
|
|||||||
@ -18,4 +18,5 @@ CMD ["php-fpm", "-F"]
|
|||||||
|
|
||||||
FROM base as prod
|
FROM base as prod
|
||||||
|
|
||||||
|
COPY ./images/php/fpm/conf.d/zz-app-prod.ini $PHP_INI_DIR/conf.d/
|
||||||
FROM base as local
|
FROM base as local
|
||||||
|
|||||||
@ -11,3 +11,5 @@ intl.default_locale=de
|
|||||||
short_open_tag=On
|
short_open_tag=On
|
||||||
session.cookie_lifetime = 0
|
session.cookie_lifetime = 0
|
||||||
session.gc_maxlifetime = 1440
|
session.gc_maxlifetime = 1440
|
||||||
|
session.cookie_httponly=On
|
||||||
|
session.cookie_secure=Off
|
||||||
|
|||||||
2
.docker/images/php/fpm/conf.d/zz-app-prod.ini
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
; overriding defaults
|
||||||
|
ession.cookie_secure=On
|
||||||
@ -9,9 +9,9 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
|||||||
'csrf_protection' => true,
|
'csrf_protection' => true,
|
||||||
'session' => [
|
'session' => [
|
||||||
'handler_id' => null,
|
'handler_id' => null,
|
||||||
'cookie_secure' => 'auto',
|
'cookie_secure' => false,
|
||||||
|
'cookie_httponly' => true,
|
||||||
'cookie_samesite' => 'lax',
|
'cookie_samesite' => 'lax',
|
||||||
'save_path' => null
|
|
||||||
],
|
],
|
||||||
'php_errors' => ['log' => true]
|
'php_errors' => ['log' => true]
|
||||||
]);
|
]);
|
||||||
|
|||||||
18
src/new/config/packages/prod/framework.php
Executable file
@ -0,0 +1,18 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||||
|
|
||||||
|
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||||
|
$containerConfigurator->extension('framework', ['secret' => '%env(APP_SECRET)%',
|
||||||
|
'csrf_protection' => true,
|
||||||
|
'session' => [
|
||||||
|
'handler_id' => null,
|
||||||
|
'cookie_secure' => true,
|
||||||
|
'cookie_httponly' => true,
|
||||||
|
'cookie_samesite' => 'lax',
|
||||||
|
],
|
||||||
|
'php_errors' => ['log' => true]
|
||||||
|
]);
|
||||||
|
};
|
||||||
@ -26,33 +26,33 @@ PSC\Shop\EntityBundle\Entity\Voucher:
|
|||||||
value: 5
|
value: 5
|
||||||
shop: '@shop_1'
|
shop: '@shop_1'
|
||||||
voucher_3:
|
voucher_3:
|
||||||
title: 50 fest
|
title: onlyZeroPayment
|
||||||
enable: true
|
enable: true
|
||||||
payment: true
|
payment: true
|
||||||
shipping: true
|
shipping: true
|
||||||
more: true
|
more: true
|
||||||
percent: false
|
percent: false
|
||||||
code: 50f
|
code: onlyZeroPayment
|
||||||
zeroPayment: true
|
zeroPayment: true
|
||||||
zeroShipping: true
|
zeroShipping: false
|
||||||
mode: 1
|
mode: 1
|
||||||
fromDate: <(new DateTime("2023-12-12"))>
|
fromDate: <(new DateTime("2023-12-12"))>
|
||||||
toDate: <(new DateTime("2025-12-12"))>
|
toDate: <(new DateTime("2025-12-12"))>
|
||||||
value: 5
|
value: 0
|
||||||
shop: '@shop_1'
|
shop: '@shop_1'
|
||||||
voucher_4:
|
voucher_4:
|
||||||
title: 50%
|
title: onlyZeroShipping
|
||||||
enable: true
|
enable: true
|
||||||
payment: true
|
payment: true
|
||||||
shipping: true
|
shipping: true
|
||||||
more: true
|
more: true
|
||||||
percent: false
|
percent: false
|
||||||
code: 50%
|
code: onlyZeroShipping
|
||||||
zeroPayment: true
|
zeroPayment: false
|
||||||
zeroShipping: true
|
zeroShipping: true
|
||||||
mode: 1
|
mode: 1
|
||||||
fromDate: <(new DateTime("2023-12-12"))>
|
fromDate: <(new DateTime("2023-12-12"))>
|
||||||
toDate: <(new DateTime("2025-12-12"))>
|
toDate: <(new DateTime("2025-12-12"))>
|
||||||
value: 5
|
value: 0
|
||||||
shop: '@shop_1'
|
shop: '@shop_1'
|
||||||
|
|
||||||
|
|||||||
@ -19,7 +19,7 @@ use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
|||||||
* @package PSC\Component\Steplayouter
|
* @package PSC\Component\Steplayouter
|
||||||
* @subpackage Controller
|
* @subpackage Controller
|
||||||
*/
|
*/
|
||||||
class Arr
|
class ToArray
|
||||||
{
|
{
|
||||||
/** @var AuthorizationChecker */
|
/** @var AuthorizationChecker */
|
||||||
protected $authChecker = null;
|
protected $authChecker = null;
|
||||||
@ -10,7 +10,7 @@ use PSC\Component\SteplayouterBundle\Calendar\Generator;
|
|||||||
use PSC\Component\SteplayouterBundle\Calendar\Type\Hoch;
|
use PSC\Component\SteplayouterBundle\Calendar\Type\Hoch;
|
||||||
use PSC\Component\SteplayouterBundle\Calendar\Type\Hochvariable;
|
use PSC\Component\SteplayouterBundle\Calendar\Type\Hochvariable;
|
||||||
use PSC\Component\SteplayouterBundle\Calendar\Type\Quer;
|
use PSC\Component\SteplayouterBundle\Calendar\Type\Quer;
|
||||||
use PSC\Component\SteplayouterBundle\Config\Converter\Arr;
|
use PSC\Component\SteplayouterBundle\Config\Converter\ToArray;
|
||||||
use PSC\Shop\EntityBundle\Document\Motiv;
|
use PSC\Shop\EntityBundle\Document\Motiv;
|
||||||
use PSC\Shop\EntityBundle\Entity\Layoutdesigndata;
|
use PSC\Shop\EntityBundle\Entity\Layoutdesigndata;
|
||||||
use Symfony\Component\HttpKernel\KernelInterface;
|
use Symfony\Component\HttpKernel\KernelInterface;
|
||||||
@ -30,7 +30,7 @@ class Pdf
|
|||||||
protected $converter;
|
protected $converter;
|
||||||
protected $twig;
|
protected $twig;
|
||||||
|
|
||||||
public function __construct(EntityManagerInterface $em, $pdflib_lic, KernelInterface $kernel, Arr $converter, DocumentManager $mongoDb, Environment $twig)
|
public function __construct(EntityManagerInterface $em, $pdflib_lic, KernelInterface $kernel, ToArray $converter, DocumentManager $mongoDb, Environment $twig)
|
||||||
{
|
{
|
||||||
$this->entityManager = $em;
|
$this->entityManager = $em;
|
||||||
$this->pdf_lic = $pdflib_lic;
|
$this->pdf_lic = $pdflib_lic;
|
||||||
|
|||||||
@ -134,7 +134,6 @@ class EditController extends AbstractController
|
|||||||
|
|
||||||
if ($form->isSubmitted() && $form->isValid()) {
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
$contact->setProducts($this->merge([$contact->getProductsOrg(), $contact->getProductsSub()]));
|
$contact->setProducts($this->merge([$contact->getProductsOrg(), $contact->getProductsSub()]));
|
||||||
|
|
||||||
$contact->setUuid(Uuid::uuid4());
|
$contact->setUuid(Uuid::uuid4());
|
||||||
|
|
||||||
$entityManager->persist($contact);
|
$entityManager->persist($contact);
|
||||||
@ -345,6 +344,9 @@ class EditController extends AbstractController
|
|||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
|
|
||||||
if ($form->isSubmitted() && $form->isValid()) {
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
|
if($form->get('password')->getData() !== null) {
|
||||||
|
$contact->setPassword(password_hash($form->get('password')->getData(), PASSWORD_DEFAULT));
|
||||||
|
}
|
||||||
$contact->setProducts($this->merge([$contact->getProductsOrg(), $contact->getProductsSub()]));
|
$contact->setProducts($this->merge([$contact->getProductsOrg(), $contact->getProductsSub()]));
|
||||||
|
|
||||||
$contactDoc->setKundenNr($contact->getKundenNr());
|
$contactDoc->setKundenNr($contact->getKundenNr());
|
||||||
|
|||||||
@ -33,6 +33,7 @@ use Symfony\Component\Form\Extension\Core\Type\IntegerType;
|
|||||||
use Symfony\Component\Form\Extension\Core\Type\LanguageType;
|
use Symfony\Component\Form\Extension\Core\Type\LanguageType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\LocaleType;
|
use Symfony\Component\Form\Extension\Core\Type\LocaleType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\NumberType;
|
use Symfony\Component\Form\Extension\Core\Type\NumberType;
|
||||||
|
use Symfony\Component\Form\Extension\Core\Type\PasswordType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||||
@ -791,7 +792,7 @@ class ContactType extends AbstractType
|
|||||||
])
|
])
|
||||||
->add('kundenNr', TextType::class, ['required' => false, 'label' => 'Customernumber', 'label_attr' => [
|
->add('kundenNr', TextType::class, ['required' => false, 'label' => 'Customernumber', 'label_attr' => [
|
||||||
'data-bs-toggle' => "tooltip", 'data-bs-html' => '{{ contact.kundenNr }}']])
|
'data-bs-toggle' => "tooltip", 'data-bs-html' => '{{ contact.kundenNr }}']])
|
||||||
->add('password', TextType::class, array('required' => false, 'disabled' => false, 'label' => 'password'))
|
->add('password', PasswordType::class, array('required' => false, 'disabled' => false, 'label' => 'password'))
|
||||||
->add('productionStatus', ChoiceType::class, array(
|
->add('productionStatus', ChoiceType::class, array(
|
||||||
'label' => 'Productionstatus',
|
'label' => 'Productionstatus',
|
||||||
'required' => false,
|
'required' => false,
|
||||||
|
|||||||
@ -77,7 +77,7 @@
|
|||||||
{{ 'yes'|trans }}
|
{{ 'yes'|trans }}
|
||||||
</span>
|
</span>
|
||||||
{% for shop in contact.shops %}
|
{% for shop in contact.shops %}
|
||||||
<span class="mr-1">{{ shop.name }}</span>
|
<span class="mr-1">{{ shop.title }}</span>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<span class="badge bg-secondary">{{ 'no'|trans }}</span>
|
<span class="badge bg-secondary">{{ 'no'|trans }}</span>
|
||||||
|
|||||||
@ -262,8 +262,10 @@ class Contact implements UserInterface, PasswordAuthenticatedUserInterface, \Ser
|
|||||||
*/
|
*/
|
||||||
public function setPassword($password)
|
public function setPassword($password)
|
||||||
{
|
{
|
||||||
|
if($password != "") {
|
||||||
$this->password = $password;
|
$this->password = $password;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setzt die ID des Benutzers
|
* Setzt die ID des Benutzers
|
||||||
|
|||||||
@ -63,7 +63,7 @@ class GetFormAsJson extends AbstractController
|
|||||||
|
|
||||||
}
|
}
|
||||||
$producer->setProduct($productModel);
|
$producer->setProduct($productModel);
|
||||||
$producer->setParams(json_decode($request->getContent(), true));
|
$producer->setParams((array)json_decode($request->getContent(), true));
|
||||||
|
|
||||||
$output->jsonForm = $producer->getJsonForm();
|
$output->jsonForm = $producer->getJsonForm();
|
||||||
if($producer instanceof IUiProducer) {
|
if($producer instanceof IUiProducer) {
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace PSC\Shop\VoucherBundle\Transformer;
|
namespace PSC\Shop\VoucherBundle\Transformer;
|
||||||
|
|
||||||
use PSC\Shop\OrderBundle\Model\Order;
|
use PSC\Shop\OrderBundle\Model\Base;
|
||||||
use PSC\Shop\VoucherBundle\Service\Voucher as PSCVoucher;
|
use PSC\Shop\VoucherBundle\Service\Voucher as PSCVoucher;
|
||||||
|
|
||||||
class Voucher
|
class Voucher
|
||||||
@ -11,7 +11,7 @@ class Voucher
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public function parseModel(Order $order): void
|
public function parseModel(Base $order): void
|
||||||
{
|
{
|
||||||
$tmp=[];
|
$tmp=[];
|
||||||
foreach($order->getVouchers() as $voucher) {
|
foreach($order->getVouchers() as $voucher) {
|
||||||
|
|||||||
@ -13,6 +13,6 @@ class VersionTest extends WebTestCase
|
|||||||
$this->assertResponseIsSuccessful();
|
$this->assertResponseIsSuccessful();
|
||||||
|
|
||||||
$data = json_decode($client->getResponse()->getContent(), true);
|
$data = json_decode($client->getResponse()->getContent(), true);
|
||||||
$this->assertSame("2.2", $data['release']);
|
$this->assertSame("2.3", $data['release']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
80
src/new/tests/PSC/Shop/Order/Service/ImportCalcTest.php
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Tests\PSC\Shop\Order\Service;
|
||||||
|
|
||||||
|
use PSC\Shop\OrderBundle\Model\Order\Position\Price;
|
||||||
|
use Tests\RefreshDatabaseTrait;
|
||||||
|
use PSC\Component\ApiBundle\Model\Shop;
|
||||||
|
use PSC\Shop\ContactBundle\Model\Address;
|
||||||
|
use PSC\Shop\OrderBundle\Model\Order\Position;
|
||||||
|
use PSC\Shop\OrderBundle\Service\Calc;
|
||||||
|
use PSC\Shop\PaymentBundle\Model\Payment;
|
||||||
|
use PSC\Shop\ProductBundle\Model\Product;
|
||||||
|
use PSC\Shop\ProductBundle\Model\ProductSpecialObject;
|
||||||
|
use PSC\Shop\ShippingBundle\Model\Shipping;
|
||||||
|
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||||
|
|
||||||
|
class ImportCalcTest extends KernelTestCase
|
||||||
|
{
|
||||||
|
use RefreshDatabaseTrait;
|
||||||
|
|
||||||
|
public function testCalc()
|
||||||
|
{
|
||||||
|
self::bootKernel();
|
||||||
|
|
||||||
|
$container = static::getContainer();
|
||||||
|
|
||||||
|
/** @var Calc $calcService */
|
||||||
|
$calcService = $container->get(Calc::class);
|
||||||
|
|
||||||
|
$shop = new Shop();
|
||||||
|
$shop->setUuid('shop1');
|
||||||
|
|
||||||
|
$order = new \PSC\Shop\OrderBundle\Model\Order();
|
||||||
|
$order->setShop($shop);
|
||||||
|
|
||||||
|
$shipping = new Shipping();
|
||||||
|
$shipping->setTaxClass(7);
|
||||||
|
$shipping->setPrice(560);
|
||||||
|
|
||||||
|
$payment = new Payment();
|
||||||
|
$payment->setTaxClass(19);
|
||||||
|
$payment->setPrice(25.5);
|
||||||
|
|
||||||
|
$order->setShipping($shipping);
|
||||||
|
$order->setPayment($payment);
|
||||||
|
|
||||||
|
$deliveryAddress = new Address();
|
||||||
|
$deliveryAddress->setCountry('de');
|
||||||
|
$deliveryAddress->setZip(17506);
|
||||||
|
|
||||||
|
$order->setDeliveryAddress($deliveryAddress);
|
||||||
|
|
||||||
|
$productW1 = new Product();
|
||||||
|
$productW1->setTitle('Manuelle Position 1');
|
||||||
|
|
||||||
|
$specialProductSettingsW1 = new ProductSpecialObject();
|
||||||
|
$specialProductSettingsW1->setCount(1);
|
||||||
|
$specialProductSettingsW1->setNet(25.5*100);
|
||||||
|
$specialProductSettingsW1->setCent(true);
|
||||||
|
$productW1->setSpecialProductTypeObject($specialProductSettingsW1);
|
||||||
|
$price1 = new Price();
|
||||||
|
$price1->setNet(255);
|
||||||
|
$price1->setAllNet(255);
|
||||||
|
$price1->setCount(1);
|
||||||
|
|
||||||
|
$positionW1 = new Position();
|
||||||
|
$positionW1->setProduct($productW1);
|
||||||
|
$positionW1->setPrice($price1);
|
||||||
|
|
||||||
|
$order->addPosition($positionW1);
|
||||||
|
|
||||||
|
$calcService->calcOrder($order);
|
||||||
|
|
||||||
|
$this->assertSame(2550, $positionW1->getPrice()->getNet());
|
||||||
|
|
||||||
|
$this->assertSame(3135, $order->getNet());
|
||||||
|
$this->assertSame(530, $order->getVat());
|
||||||
|
$this->assertSame(3665, $order->getGross());
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -11,7 +11,7 @@ use PSC\Shop\PaymentBundle\Repository\PaymentRepository;
|
|||||||
use PSC\Shop\ShippingBundle\Repository\ShippingRepository;
|
use PSC\Shop\ShippingBundle\Repository\ShippingRepository;
|
||||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||||
|
|
||||||
class CreateTest extends WebTestCase
|
class F5P5Test extends WebTestCase
|
||||||
{
|
{
|
||||||
use RefreshDatabaseTrait;
|
use RefreshDatabaseTrait;
|
||||||
|
|
||||||
144
src/new/tests/PSC/Shop/Voucher/ZeroPayment.php
Normal file
@ -0,0 +1,144 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Tests\PSC\Shop\Voucher;
|
||||||
|
|
||||||
|
use PSC\Shop\EntityBundle\Repository\JobRepository;
|
||||||
|
use Tests\RefreshDatabaseTrait;
|
||||||
|
use PSC\Shop\ContactBundle\Repository\ContactRepository;
|
||||||
|
use PSC\Shop\EntityBundle\Entity\Shop;
|
||||||
|
use PSC\Shop\EntityBundle\Repository\ShopRepository;
|
||||||
|
use PSC\Shop\PaymentBundle\Repository\PaymentRepository;
|
||||||
|
use PSC\Shop\ShippingBundle\Repository\ShippingRepository;
|
||||||
|
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||||
|
|
||||||
|
class CreateTest extends WebTestCase
|
||||||
|
{
|
||||||
|
use RefreshDatabaseTrait;
|
||||||
|
|
||||||
|
public function testCreateOneOrderWith5FixedVoucher(): void
|
||||||
|
{
|
||||||
|
$client = static::createClient();
|
||||||
|
|
||||||
|
$shopRepository = static::getContainer()->get(ShopRepository::class);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var Shop $shop
|
||||||
|
*/
|
||||||
|
$shop = $shopRepository->findOneBy(['title' => 'Printchampion']);
|
||||||
|
|
||||||
|
$shippingRepository = static::getContainer()->get(ShippingRepository::class);
|
||||||
|
|
||||||
|
$paymentRepository = static::getContainer()->get(PaymentRepository::class);
|
||||||
|
|
||||||
|
$client->jsonRequest(
|
||||||
|
'POST',
|
||||||
|
'/api/order/create',
|
||||||
|
[
|
||||||
|
'shop' => [
|
||||||
|
'uuid' => (string)$shop->getUuid()
|
||||||
|
],
|
||||||
|
'type' => 2,
|
||||||
|
'shipping' => [
|
||||||
|
'uid' => $shippingRepository->findOneBy(['title' => 'Deutschlandweit'])->getUid()
|
||||||
|
],
|
||||||
|
'payment' => [
|
||||||
|
'uid' => $paymentRepository->findOneBy(['title' => 'per Rechnung'])->getUid()
|
||||||
|
],
|
||||||
|
'vouchers' => [
|
||||||
|
[
|
||||||
|
'code' => 'onlyZeroPayment'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'code' => 'onlyZeroShipping'
|
||||||
|
]
|
||||||
|
],
|
||||||
|
'draft' => false,
|
||||||
|
'deliveryAddress' => [
|
||||||
|
'firstname' => 'Thomas',
|
||||||
|
'lastname' => 'Peterson',
|
||||||
|
'street' => 'Chausseestr.',
|
||||||
|
'houseNumber' => '24',
|
||||||
|
'zip' => '17506',
|
||||||
|
'city' => 'Gribow'
|
||||||
|
],
|
||||||
|
'invoiceAddress' => [
|
||||||
|
'firstname' => 'Thomas',
|
||||||
|
'lastname' => 'Peterson',
|
||||||
|
'street' => 'Chausseestr.',
|
||||||
|
'houseNumber' => '24',
|
||||||
|
'zip' => '17400',
|
||||||
|
'city' => 'Berlin'
|
||||||
|
],
|
||||||
|
'positions' => [
|
||||||
|
[
|
||||||
|
'count' => 1,
|
||||||
|
'product' => [
|
||||||
|
'title' => 'test XML',
|
||||||
|
'specialProductTypeObject' => [
|
||||||
|
'typ' => 6,
|
||||||
|
'taxClass' => 1900,
|
||||||
|
'xml' => '<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<kalkulation>
|
||||||
|
<artikel>
|
||||||
|
<name>Blocks A5 25blatt geleimt</name>
|
||||||
|
<kommentar>kein</kommentar>
|
||||||
|
|
||||||
|
<option id="auflage" name="Auflage" type="Input" width="3" require="true" default="1">
|
||||||
|
<auflage>
|
||||||
|
<grenze formel="(10*5)">1-</grenze>
|
||||||
|
</auflage>
|
||||||
|
</option>
|
||||||
|
|
||||||
|
</artikel>
|
||||||
|
</kalkulation>'
|
||||||
|
]
|
||||||
|
]
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'count' => 1,
|
||||||
|
'product' => [
|
||||||
|
'title' => 'test Manual Position',
|
||||||
|
'specialProductTypeObject' => [
|
||||||
|
'typ' => 1,
|
||||||
|
'cent' => true,
|
||||||
|
'net' => 145,
|
||||||
|
'taxClass' => 1900
|
||||||
|
]
|
||||||
|
]
|
||||||
|
]
|
||||||
|
]
|
||||||
|
],
|
||||||
|
['HTTP_apiKey' => $shop->getApiKey()]
|
||||||
|
);
|
||||||
|
|
||||||
|
self::assertSame(200, $client->getResponse()->getStatusCode());
|
||||||
|
|
||||||
|
$data = json_decode($client->getResponse()->getContent(), true);
|
||||||
|
|
||||||
|
$client->jsonRequest(
|
||||||
|
'POST',
|
||||||
|
'/api/order/getonebyuuid',
|
||||||
|
[
|
||||||
|
'uuid' => $data['uuid'],
|
||||||
|
],
|
||||||
|
['HTTP_apiKey' => $shop->getApiKey()]
|
||||||
|
);
|
||||||
|
|
||||||
|
$data = json_decode($client->getResponse()->getContent(), true);
|
||||||
|
self::assertSame(7647, $data['gross']);
|
||||||
|
self::assertSame(6790, $data['grossWithDiscount']);
|
||||||
|
self::assertSame('SAN-'.date("Ym").'-1', $data['alias']);
|
||||||
|
|
||||||
|
self::assertSame('Berlin', $data['invoiceAddress']['city']);
|
||||||
|
|
||||||
|
self::assertSame('Gribow', $data['deliveryAddress']['city']);
|
||||||
|
|
||||||
|
self::assertSame(200, $client->getResponse()->getStatusCode());
|
||||||
|
|
||||||
|
$jobs = static::getContainer()->get(JobRepository::class);
|
||||||
|
|
||||||
|
self::assertCount(0, $jobs->findBy(['data.order' => $data['uuid']]));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
144
src/new/tests/PSC/Shop/Voucher/ZeroShipping.php
Normal file
@ -0,0 +1,144 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Tests\PSC\Shop\Voucher;
|
||||||
|
|
||||||
|
use PSC\Shop\EntityBundle\Repository\JobRepository;
|
||||||
|
use Tests\RefreshDatabaseTrait;
|
||||||
|
use PSC\Shop\ContactBundle\Repository\ContactRepository;
|
||||||
|
use PSC\Shop\EntityBundle\Entity\Shop;
|
||||||
|
use PSC\Shop\EntityBundle\Repository\ShopRepository;
|
||||||
|
use PSC\Shop\PaymentBundle\Repository\PaymentRepository;
|
||||||
|
use PSC\Shop\ShippingBundle\Repository\ShippingRepository;
|
||||||
|
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||||
|
|
||||||
|
class CreateTest extends WebTestCase
|
||||||
|
{
|
||||||
|
use RefreshDatabaseTrait;
|
||||||
|
|
||||||
|
public function testCreateOneOrderWith5FixedVoucher(): void
|
||||||
|
{
|
||||||
|
$client = static::createClient();
|
||||||
|
|
||||||
|
$shopRepository = static::getContainer()->get(ShopRepository::class);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var Shop $shop
|
||||||
|
*/
|
||||||
|
$shop = $shopRepository->findOneBy(['title' => 'Printchampion']);
|
||||||
|
|
||||||
|
$shippingRepository = static::getContainer()->get(ShippingRepository::class);
|
||||||
|
|
||||||
|
$paymentRepository = static::getContainer()->get(PaymentRepository::class);
|
||||||
|
|
||||||
|
$client->jsonRequest(
|
||||||
|
'POST',
|
||||||
|
'/api/order/create',
|
||||||
|
[
|
||||||
|
'shop' => [
|
||||||
|
'uuid' => (string)$shop->getUuid()
|
||||||
|
],
|
||||||
|
'type' => 2,
|
||||||
|
'shipping' => [
|
||||||
|
'uid' => $shippingRepository->findOneBy(['title' => 'Deutschlandweit'])->getUid()
|
||||||
|
],
|
||||||
|
'payment' => [
|
||||||
|
'uid' => $paymentRepository->findOneBy(['title' => 'per Rechnung'])->getUid()
|
||||||
|
],
|
||||||
|
'vouchers' => [
|
||||||
|
[
|
||||||
|
'code' => 'onlyZeroPayment'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'code' => 'onlyZeroShipping'
|
||||||
|
]
|
||||||
|
],
|
||||||
|
'draft' => false,
|
||||||
|
'deliveryAddress' => [
|
||||||
|
'firstname' => 'Thomas',
|
||||||
|
'lastname' => 'Peterson',
|
||||||
|
'street' => 'Chausseestr.',
|
||||||
|
'houseNumber' => '24',
|
||||||
|
'zip' => '17506',
|
||||||
|
'city' => 'Gribow'
|
||||||
|
],
|
||||||
|
'invoiceAddress' => [
|
||||||
|
'firstname' => 'Thomas',
|
||||||
|
'lastname' => 'Peterson',
|
||||||
|
'street' => 'Chausseestr.',
|
||||||
|
'houseNumber' => '24',
|
||||||
|
'zip' => '17400',
|
||||||
|
'city' => 'Berlin'
|
||||||
|
],
|
||||||
|
'positions' => [
|
||||||
|
[
|
||||||
|
'count' => 1,
|
||||||
|
'product' => [
|
||||||
|
'title' => 'test XML',
|
||||||
|
'specialProductTypeObject' => [
|
||||||
|
'typ' => 6,
|
||||||
|
'taxClass' => 1900,
|
||||||
|
'xml' => '<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<kalkulation>
|
||||||
|
<artikel>
|
||||||
|
<name>Blocks A5 25blatt geleimt</name>
|
||||||
|
<kommentar>kein</kommentar>
|
||||||
|
|
||||||
|
<option id="auflage" name="Auflage" type="Input" width="3" require="true" default="1">
|
||||||
|
<auflage>
|
||||||
|
<grenze formel="(10*5)">1-</grenze>
|
||||||
|
</auflage>
|
||||||
|
</option>
|
||||||
|
|
||||||
|
</artikel>
|
||||||
|
</kalkulation>'
|
||||||
|
]
|
||||||
|
]
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'count' => 1,
|
||||||
|
'product' => [
|
||||||
|
'title' => 'test Manual Position',
|
||||||
|
'specialProductTypeObject' => [
|
||||||
|
'typ' => 1,
|
||||||
|
'cent' => true,
|
||||||
|
'net' => 145,
|
||||||
|
'taxClass' => 1900
|
||||||
|
]
|
||||||
|
]
|
||||||
|
]
|
||||||
|
]
|
||||||
|
],
|
||||||
|
['HTTP_apiKey' => $shop->getApiKey()]
|
||||||
|
);
|
||||||
|
|
||||||
|
self::assertSame(200, $client->getResponse()->getStatusCode());
|
||||||
|
|
||||||
|
$data = json_decode($client->getResponse()->getContent(), true);
|
||||||
|
|
||||||
|
$client->jsonRequest(
|
||||||
|
'POST',
|
||||||
|
'/api/order/getonebyuuid',
|
||||||
|
[
|
||||||
|
'uuid' => $data['uuid'],
|
||||||
|
],
|
||||||
|
['HTTP_apiKey' => $shop->getApiKey()]
|
||||||
|
);
|
||||||
|
|
||||||
|
$data = json_decode($client->getResponse()->getContent(), true);
|
||||||
|
self::assertSame(7647, $data['gross']);
|
||||||
|
self::assertSame(6790, $data['grossWithDiscount']);
|
||||||
|
self::assertSame('SAN-'.date("Ym").'-1', $data['alias']);
|
||||||
|
|
||||||
|
self::assertSame('Berlin', $data['invoiceAddress']['city']);
|
||||||
|
|
||||||
|
self::assertSame('Gribow', $data['deliveryAddress']['city']);
|
||||||
|
|
||||||
|
self::assertSame(200, $client->getResponse()->getStatusCode());
|
||||||
|
|
||||||
|
$jobs = static::getContainer()->get(JobRepository::class);
|
||||||
|
|
||||||
|
self::assertCount(0, $jobs->findBy(['data.order' => $data['uuid']]));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
144
src/new/tests/PSC/Shop/Voucher/ZeroShippingZeroPaymentTest.php
Normal file
@ -0,0 +1,144 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Tests\PSC\Shop\Voucher;
|
||||||
|
|
||||||
|
use PSC\Shop\EntityBundle\Repository\JobRepository;
|
||||||
|
use Tests\RefreshDatabaseTrait;
|
||||||
|
use PSC\Shop\ContactBundle\Repository\ContactRepository;
|
||||||
|
use PSC\Shop\EntityBundle\Entity\Shop;
|
||||||
|
use PSC\Shop\EntityBundle\Repository\ShopRepository;
|
||||||
|
use PSC\Shop\PaymentBundle\Repository\PaymentRepository;
|
||||||
|
use PSC\Shop\ShippingBundle\Repository\ShippingRepository;
|
||||||
|
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||||
|
|
||||||
|
class CreateTest extends WebTestCase
|
||||||
|
{
|
||||||
|
use RefreshDatabaseTrait;
|
||||||
|
|
||||||
|
public function testCreateOneOrderWith5FixedVoucher(): void
|
||||||
|
{
|
||||||
|
$client = static::createClient();
|
||||||
|
|
||||||
|
$shopRepository = static::getContainer()->get(ShopRepository::class);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var Shop $shop
|
||||||
|
*/
|
||||||
|
$shop = $shopRepository->findOneBy(['title' => 'Printchampion']);
|
||||||
|
|
||||||
|
$shippingRepository = static::getContainer()->get(ShippingRepository::class);
|
||||||
|
|
||||||
|
$paymentRepository = static::getContainer()->get(PaymentRepository::class);
|
||||||
|
|
||||||
|
$client->jsonRequest(
|
||||||
|
'POST',
|
||||||
|
'/api/order/create',
|
||||||
|
[
|
||||||
|
'shop' => [
|
||||||
|
'uuid' => (string)$shop->getUuid()
|
||||||
|
],
|
||||||
|
'type' => 2,
|
||||||
|
'shipping' => [
|
||||||
|
'uid' => $shippingRepository->findOneBy(['title' => 'Deutschlandweit'])->getUid()
|
||||||
|
],
|
||||||
|
'payment' => [
|
||||||
|
'uid' => $paymentRepository->findOneBy(['title' => 'per Rechnung'])->getUid()
|
||||||
|
],
|
||||||
|
'vouchers' => [
|
||||||
|
[
|
||||||
|
'code' => 'onlyZeroPayment'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'code' => 'onlyZeroShipping'
|
||||||
|
]
|
||||||
|
],
|
||||||
|
'draft' => false,
|
||||||
|
'deliveryAddress' => [
|
||||||
|
'firstname' => 'Thomas',
|
||||||
|
'lastname' => 'Peterson',
|
||||||
|
'street' => 'Chausseestr.',
|
||||||
|
'houseNumber' => '24',
|
||||||
|
'zip' => '17506',
|
||||||
|
'city' => 'Gribow'
|
||||||
|
],
|
||||||
|
'invoiceAddress' => [
|
||||||
|
'firstname' => 'Thomas',
|
||||||
|
'lastname' => 'Peterson',
|
||||||
|
'street' => 'Chausseestr.',
|
||||||
|
'houseNumber' => '24',
|
||||||
|
'zip' => '17400',
|
||||||
|
'city' => 'Berlin'
|
||||||
|
],
|
||||||
|
'positions' => [
|
||||||
|
[
|
||||||
|
'count' => 1,
|
||||||
|
'product' => [
|
||||||
|
'title' => 'test XML',
|
||||||
|
'specialProductTypeObject' => [
|
||||||
|
'typ' => 6,
|
||||||
|
'taxClass' => 1900,
|
||||||
|
'xml' => '<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<kalkulation>
|
||||||
|
<artikel>
|
||||||
|
<name>Blocks A5 25blatt geleimt</name>
|
||||||
|
<kommentar>kein</kommentar>
|
||||||
|
|
||||||
|
<option id="auflage" name="Auflage" type="Input" width="3" require="true" default="1">
|
||||||
|
<auflage>
|
||||||
|
<grenze formel="(10*5)">1-</grenze>
|
||||||
|
</auflage>
|
||||||
|
</option>
|
||||||
|
|
||||||
|
</artikel>
|
||||||
|
</kalkulation>'
|
||||||
|
]
|
||||||
|
]
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'count' => 1,
|
||||||
|
'product' => [
|
||||||
|
'title' => 'test Manual Position',
|
||||||
|
'specialProductTypeObject' => [
|
||||||
|
'typ' => 1,
|
||||||
|
'cent' => true,
|
||||||
|
'net' => 145,
|
||||||
|
'taxClass' => 1900
|
||||||
|
]
|
||||||
|
]
|
||||||
|
]
|
||||||
|
]
|
||||||
|
],
|
||||||
|
['HTTP_apiKey' => $shop->getApiKey()]
|
||||||
|
);
|
||||||
|
|
||||||
|
self::assertSame(200, $client->getResponse()->getStatusCode());
|
||||||
|
|
||||||
|
$data = json_decode($client->getResponse()->getContent(), true);
|
||||||
|
|
||||||
|
$client->jsonRequest(
|
||||||
|
'POST',
|
||||||
|
'/api/order/getonebyuuid',
|
||||||
|
[
|
||||||
|
'uuid' => $data['uuid'],
|
||||||
|
],
|
||||||
|
['HTTP_apiKey' => $shop->getApiKey()]
|
||||||
|
);
|
||||||
|
|
||||||
|
$data = json_decode($client->getResponse()->getContent(), true);
|
||||||
|
self::assertSame(7647, $data['gross']);
|
||||||
|
self::assertSame(6790, $data['grossWithDiscount']);
|
||||||
|
self::assertSame('SAN-'.date("Ym").'-1', $data['alias']);
|
||||||
|
|
||||||
|
self::assertSame('Berlin', $data['invoiceAddress']['city']);
|
||||||
|
|
||||||
|
self::assertSame('Gribow', $data['deliveryAddress']['city']);
|
||||||
|
|
||||||
|
self::assertSame(200, $client->getResponse()->getStatusCode());
|
||||||
|
|
||||||
|
$jobs = static::getContainer()->get(JobRepository::class);
|
||||||
|
|
||||||
|
self::assertCount(0, $jobs->findBy(['data.order' => $data['uuid']]));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -278,7 +278,8 @@ class Import implements QueueInterface, ConfigurableElementInterface
|
|||||||
$this->_entityManager->getRepository(Product::class)->findOneBy(['uid' => $queueSettings->getProduct()]));
|
$this->_entityManager->getRepository(Product::class)->findOneBy(['uid' => $queueSettings->getProduct()]));
|
||||||
$prodSpec = new ProductSpecialObject();
|
$prodSpec = new ProductSpecialObject();
|
||||||
$prodSpec->setCount(intval($item['quantity']));
|
$prodSpec->setCount(intval($item['quantity']));
|
||||||
$prodSpec->setNet(floatval($item->ItemDetail->UnitPrice->Money));
|
$prodSpec->setNet(floatval($item->ItemDetail->UnitPrice->Money)*100);
|
||||||
|
$prodSpec->setCent(true);
|
||||||
$product->setSpecialProductTypeObject($prodSpec);
|
$product->setSpecialProductTypeObject($prodSpec);
|
||||||
|
|
||||||
$position = new Position();
|
$position = new Position();
|
||||||
|
|||||||
@ -6,12 +6,12 @@ use Doctrine\Common\Collections\ArrayCollection;
|
|||||||
use Doctrine\ODM\MongoDB\DocumentManager;
|
use Doctrine\ODM\MongoDB\DocumentManager;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use MongoDB\BSON\Regex;
|
use MongoDB\BSON\Regex;
|
||||||
|
use PSC\Shop\ContactBundle\Service\Contact;
|
||||||
use PSC\Shop\EntityBundle\Document\Contact as PSCContact;
|
use PSC\Shop\EntityBundle\Document\Contact as PSCContact;
|
||||||
use Plugin\Custom\PSC\CollectLayouter\Form\UserType;
|
use Plugin\Custom\PSC\CollectLayouter\Form\UserType;
|
||||||
use Plugin\Custom\PSC\CollectLayouter\Model\Setting;
|
use Plugin\Custom\PSC\CollectLayouter\Model\Setting;
|
||||||
use Plugin\Custom\PSC\CollectLayouter\VCard\VCard;
|
use Plugin\Custom\PSC\CollectLayouter\VCard\VCard;
|
||||||
use PSC\Shop\AccountBundle\Model\Account;
|
use PSC\Shop\AccountBundle\Model\Account;
|
||||||
use PSC\Shop\EntityBundle\Entity\Contact;
|
|
||||||
use PSC\Shop\EntityBundle\Entity\ContactRole;
|
use PSC\Shop\EntityBundle\Entity\ContactRole;
|
||||||
use PSC\Shop\EntityBundle\Entity\Product;
|
use PSC\Shop\EntityBundle\Entity\Product;
|
||||||
use PSC\Shop\EntityBundle\Entity\ShopContact;
|
use PSC\Shop\EntityBundle\Entity\ShopContact;
|
||||||
@ -460,11 +460,55 @@ class UserController extends AbstractController
|
|||||||
$ids[] = (int)$row->getUid();
|
$ids[] = (int)$row->getUid();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$contacts = [];
|
||||||
|
if($productDoc) {
|
||||||
|
$accountMode = $productDoc->getPluginSettingModule('collectlayouter', 'uploadCollectLayouterAccountFilter');
|
||||||
|
$accountSelect = $productDoc->getPluginSettingModule('collectlayouter', 'uploadCollectLayouterOrdersAccount');
|
||||||
|
if($accountMode == 1) {
|
||||||
$contacts = $this->entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Contact')->createQueryBuilder('contact')
|
$contacts = $this->entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Contact')->createQueryBuilder('contact')
|
||||||
->orderBy('contact.' . $orderBy, $sort)
|
->orderBy('contact.' . $orderBy, $sort)
|
||||||
->leftJoin('contact.shops', 'shop')
|
->leftJoin('contact.shops', 'shop')
|
||||||
->where('contact.username != :sysadmin_email AND contact.enable = 1 AND contact.uid != 1 AND shop.uid = :shop')->setParameter('sysadmin_email', "sysadmin@printshopcreator.de")->setParameter('shop', $this->shopService->getShopByDomain()->getId())
|
->where('contact.username != :sysadmin_email AND contact.enable = 1 AND contact.uid != 1 AND shop.uid = :shop')->setParameter('sysadmin_email', "sysadmin@printshopcreator.de")->setParameter('shop', $this->shopService->getShopByDomain()->getId())
|
||||||
->andwhere('(contact.uid in (:ids) or contact.firstname like :q or contact.lastname like :q or contact.username like :q or contact.company like :q or contact.street like :q or contact.houseNumber like :q or contact.city like :q or contact.zip like :q or CONCAT(contact.firstname, \' \', contact.lastname) like :q)')->setParameter('ids', $ids)->setParameter("q", $q)->getQuery()->execute();
|
->andwhere('(contact.uid in (:ids) or contact.firstname like :q or contact.lastname like :q or contact.username like :q or contact.company like :q or contact.street like :q or contact.houseNumber like :q or contact.city like :q or contact.zip like :q or CONCAT(contact.firstname, \' \', contact.lastname) like :q)')->setParameter('ids', $ids)->setParameter("q", $q)->getQuery()->execute();
|
||||||
|
}elseif($accountMode == 2) {
|
||||||
|
$contacts = $this->entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Contact')->createQueryBuilder('contact')
|
||||||
|
->orderBy('contact.' . $orderBy, $sort)
|
||||||
|
->leftJoin('contact.shops', 'shop')
|
||||||
|
->where('contact.username != :sysadmin_email AND contact.enable = 1 AND contact.uid != 1 AND shop.uid = :shop AND contact.account = :account')->setParameter('account', $this->getUser()->getAccount())->setParameter('sysadmin_email', "sysadmin@printshopcreator.de")->setParameter('shop', $this->shopService->getShopByDomain()->getId())
|
||||||
|
->andwhere('(contact.uid in (:ids) or contact.firstname like :q or contact.lastname like :q or contact.username like :q or contact.company like :q or contact.street like :q or contact.houseNumber like :q or contact.city like :q or contact.zip like :q or CONCAT(contact.firstname, \' \', contact.lastname) like :q)')->setParameter('ids', $ids)->setParameter("q", $q)->getQuery()->execute();
|
||||||
|
}elseif($accountMode == 3) {
|
||||||
|
$contacts = $this->entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Contact')->createQueryBuilder('contact')
|
||||||
|
->orderBy('contact.' . $orderBy, $sort)
|
||||||
|
->leftJoin('contact.shops', 'shop')
|
||||||
|
->where('contact.username != :sysadmin_email AND contact.enable = 1 AND contact.uid != 1 AND shop.uid = :shop AND contact.account = :account')->setParameter('account', $accountSelect)->setParameter('sysadmin_email', "sysadmin@printshopcreator.de")->setParameter('shop', $this->shopService->getShopByDomain()->getId())
|
||||||
|
->andwhere('(contact.uid in (:ids) or contact.firstname like :q or contact.lastname like :q or contact.username like :q or contact.company like :q or contact.street like :q or contact.houseNumber like :q or contact.city like :q or contact.zip like :q or CONCAT(contact.firstname, \' \', contact.lastname) like :q)')->setParameter('ids', $ids)->setParameter("q", $q)->getQuery()->execute();
|
||||||
|
}elseif($accountMode == 4) {
|
||||||
|
$accounts = [];
|
||||||
|
$accounts[] = $accountSelect;
|
||||||
|
$accounts = $this->getAccountsForAccount($accounts, $accountSelect);
|
||||||
|
$contacts = $this->entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Contact')->createQueryBuilder('contact')
|
||||||
|
->orderBy('contact.' . $orderBy, $sort)
|
||||||
|
->leftJoin('contact.shops', 'shop')
|
||||||
|
->where('contact.username != :sysadmin_email AND contact.enable = 1 AND contact.uid != 1 AND shop.uid = :shop AND contact.account in (:account)')->setParameter('account', $accounts)->setParameter('sysadmin_email', "sysadmin@printshopcreator.de")->setParameter('shop', $this->shopService->getShopByDomain()->getId())
|
||||||
|
->andwhere('(contact.uid in (:ids) or contact.firstname like :q or contact.lastname like :q or contact.username like :q or contact.company like :q or contact.street like :q or contact.houseNumber like :q or contact.city like :q or contact.zip like :q or CONCAT(contact.firstname, \' \', contact.lastname) like :q)')->setParameter('ids', $ids)->setParameter("q", $q)->getQuery()->execute();
|
||||||
|
}elseif($accountMode == 5) {
|
||||||
|
$accounts = [];
|
||||||
|
$accounts[] = $this->getUser()->getAccount();
|
||||||
|
$accounts = $this->getAccountsForAccount($accounts, $this->getUser()->getAccount());
|
||||||
|
$contacts = $this->entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Contact')->createQueryBuilder('contact')
|
||||||
|
->orderBy('contact.' . $orderBy, $sort)
|
||||||
|
->leftJoin('contact.shops', 'shop')
|
||||||
|
->where('contact.username != :sysadmin_email AND contact.enable = 1 AND contact.uid != 1 AND shop.uid = :shop AND contact.account in (:account)')->setParameter('account', $accounts)->setParameter('sysadmin_email', "sysadmin@printshopcreator.de")->setParameter('shop', $this->shopService->getShopByDomain()->getId())
|
||||||
|
->andwhere('(contact.uid in (:ids) or contact.firstname like :q or contact.lastname like :q or contact.username like :q or contact.company like :q or contact.street like :q or contact.houseNumber like :q or contact.city like :q or contact.zip like :q or CONCAT(contact.firstname, \' \', contact.lastname) like :q)')->setParameter('ids', $ids)->setParameter("q", $q)->getQuery()->execute();
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$contacts = $this->entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Contact')->createQueryBuilder('contact')
|
||||||
|
->orderBy('contact.' . $orderBy, $sort)
|
||||||
|
->leftJoin('contact.shops', 'shop')
|
||||||
|
->where('contact.username != :sysadmin_email AND contact.enable = 1 AND contact.uid != 1 AND shop.uid = :shop')->setParameter('sysadmin_email', "sysadmin@printshopcreator.de")->setParameter('shop', $this->shopService->getShopByDomain()->getId())
|
||||||
|
->andwhere('(contact.uid in (:ids) or contact.firstname like :q or contact.lastname like :q or contact.username like :q or contact.company like :q or contact.street like :q or contact.houseNumber like :q or contact.city like :q or contact.zip like :q or CONCAT(contact.firstname, \' \', contact.lastname) like :q)')->setParameter('ids', $ids)->setParameter("q", $q)->getQuery()->execute();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
$temp = [];
|
$temp = [];
|
||||||
foreach($contacts as $contact) {
|
foreach($contacts as $contact) {
|
||||||
@ -486,9 +530,30 @@ class UserController extends AbstractController
|
|||||||
);
|
);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
$contacts = [];
|
||||||
|
if($productDoc) {
|
||||||
|
$accountMode = $productDoc->getPluginSettingModule('collectlayouter', 'uploadCollectLayouterAccountFilter');
|
||||||
|
$accountSelect = $productDoc->getPluginSettingModule('collectlayouter', 'uploadCollectLayouterOrdersAccount');
|
||||||
|
if($accountMode == 1) {
|
||||||
$contacts = $this->entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Contact')->createQueryBuilder('contact')->leftJoin('contact.shops', 'shop')->where('contact.username != :sysadmin_email AND contact.enable = 1 AND contact.uid != 1 AND shop.uid = :shop')->setParameter('sysadmin_email', "sysadmin@printshopcreator.de")->setParameter('shop', $this->shopService->getShopByDomain()->getId())->orderBy('contact.' . $orderBy, $sort)->getQuery()->execute();
|
$contacts = $this->entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Contact')->createQueryBuilder('contact')->leftJoin('contact.shops', 'shop')->where('contact.username != :sysadmin_email AND contact.enable = 1 AND contact.uid != 1 AND shop.uid = :shop')->setParameter('sysadmin_email', "sysadmin@printshopcreator.de")->setParameter('shop', $this->shopService->getShopByDomain()->getId())->orderBy('contact.' . $orderBy, $sort)->getQuery()->execute();
|
||||||
|
}elseif($accountMode == 2) {
|
||||||
|
$contacts = $this->entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Contact')->createQueryBuilder('contact')->leftJoin('contact.shops', 'shop')->where('contact.username != :sysadmin_email AND contact.enable = 1 AND contact.uid != 1 AND shop.uid = :shop AND contact.account = :account')->setParameter('account', $this->getUser()->getAccount())->setParameter('sysadmin_email', "sysadmin@printshopcreator.de")->setParameter('shop', $this->shopService->getShopByDomain()->getId())->orderBy('contact.' . $orderBy, $sort)->getQuery()->execute();
|
||||||
|
}elseif($accountMode == 3) {
|
||||||
|
$contacts = $this->entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Contact')->createQueryBuilder('contact')->leftJoin('contact.shops', 'shop')->where('contact.username != :sysadmin_email AND contact.enable = 1 AND contact.uid != 1 AND shop.uid = :shop AND contact.account = :account')->setParameter('account', $accountSelect)->setParameter('sysadmin_email', "sysadmin@printshopcreator.de")->setParameter('shop', $this->shopService->getShopByDomain()->getId())->orderBy('contact.' . $orderBy, $sort)->getQuery()->execute();
|
||||||
|
}elseif($accountMode == 4) {
|
||||||
|
$accounts = [];
|
||||||
|
$accounts[] = $accountSelect;
|
||||||
|
$accounts = $this->getAccountsForAccount($accounts, $accountSelect);
|
||||||
|
$contacts = $this->entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Contact')->createQueryBuilder('contact')->leftJoin('contact.shops', 'shop')->where('contact.username != :sysadmin_email AND contact.enable = 1 AND contact.uid != 1 AND shop.uid = :shop AND contact.account in (:account)')->setParameter('account', $accounts)->setParameter('sysadmin_email', "sysadmin@printshopcreator.de")->setParameter('shop', $this->shopService->getShopByDomain()->getId())->orderBy('contact.' . $orderBy, $sort)->getQuery()->execute();
|
||||||
|
}elseif($accountMode == 5) {
|
||||||
|
$accounts = [];
|
||||||
|
$accounts[] = $this->getUser()->getAccount();
|
||||||
|
$accounts = $this->getAccountsForAccount($accounts, $this->getUser()->getAccount());
|
||||||
|
$contacts = $this->entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Contact')->createQueryBuilder('contact')->leftJoin('contact.shops', 'shop')->where('contact.username != :sysadmin_email AND contact.enable = 1 AND contact.uid != 1 AND shop.uid = :shop AND contact.account in (:account)')->setParameter('account', $accounts)->setParameter('sysadmin_email', "sysadmin@printshopcreator.de")->setParameter('shop', $this->shopService->getShopByDomain()->getId())->orderBy('contact.' . $orderBy, $sort)->getQuery()->execute();
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$contacts = $this->entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Contact')->createQueryBuilder('contact')->leftJoin('contact.shops', 'shop')->where('contact.username != :sysadmin_email AND contact.enable = 1 AND contact.uid != 1 AND shop.uid = :shop')->setParameter('sysadmin_email', "sysadmin@printshopcreator.de")->setParameter('shop', $this->shopService->getShopByDomain()->getId())->orderBy('contact.' . $orderBy, $sort)->getQuery()->execute();
|
||||||
|
}
|
||||||
$temp = [];
|
$temp = [];
|
||||||
foreach($contacts as $contact) {
|
foreach($contacts as $contact) {
|
||||||
if(count($contact->getShopContact()) == 1) {
|
if(count($contact->getShopContact()) == 1) {
|
||||||
@ -571,4 +636,15 @@ class UserController extends AbstractController
|
|||||||
$vcard->download();
|
$vcard->download();
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function getAccountsForAccount(array $accounts, $accountSelect)
|
||||||
|
{
|
||||||
|
$accountsEntity = $this->entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Account')->findBy(array('parent' => $accountSelect));
|
||||||
|
foreach($accountsEntity as $accountEntity) {
|
||||||
|
$accounts[] = $accountEntity->getId();
|
||||||
|
$accounts = $this->getAccountsForAccount($accounts, $accountEntity->getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
return $accounts;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -75,7 +75,7 @@ class BackendFields extends \PSC\System\PluginBundle\Form\Field implements Field
|
|||||||
'Alle nicht gesperrten' => 1,
|
'Alle nicht gesperrten' => 1,
|
||||||
'Gleich der angemeldeten Firma' => 2,
|
'Gleich der angemeldeten Firma' => 2,
|
||||||
'Filter nach gewählter Firma' => 3,
|
'Filter nach gewählter Firma' => 3,
|
||||||
'Filter nach gewählter Firma + alle Personen aller Firmen die meiner Firma zugordnet sind' => 4,
|
'Filter nach gewählter Firma + alle Personen aller Firmen die dieser Firma zugordnet sind' => 4,
|
||||||
'Gleich der angemeldeten Firma + alle Personen aller Firmen die meiner Firma zugordnet sind' => 5,
|
'Gleich der angemeldeten Firma + alle Personen aller Firmen die meiner Firma zugordnet sind' => 5,
|
||||||
),
|
),
|
||||||
'label' => 'Firmenfilter'
|
'label' => 'Firmenfilter'
|
||||||
|
|||||||
@ -70,24 +70,24 @@ class Formulare extends AbstractController implements Field
|
|||||||
|
|
||||||
$filenameregister = "/data/www/old/application/design/vorlagen/" . $shopEntity->getLayout() . "/config/user/registercontact.ini";
|
$filenameregister = "/data/www/old/application/design/vorlagen/" . $shopEntity->getLayout() . "/config/user/registercontact.ini";
|
||||||
if(file_exists($filenameregister)) {
|
if(file_exists($filenameregister)) {
|
||||||
$txtregister = file_get_contents($filenamelogin);
|
$txtregister = file_get_contents($filenameregister);
|
||||||
}
|
}
|
||||||
|
|
||||||
$filenamepass = "/data/www/old/application/design/vorlagen/" . $shopEntity->getLayout() . "/config/user/resetpassword.ini";
|
$filenamepass = "/data/www/old/application/design/vorlagen/" . $shopEntity->getLayout() . "/config/user/resetpassword.ini";
|
||||||
if(file_exists($filenamepass)) {
|
if(file_exists($filenamepass)) {
|
||||||
$txtpass = file_get_contents($filenamelogin);
|
$txtpass = file_get_contents($filenamepass);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$filenameaddress = "/data/www/old/application/design/vorlagen/" . $shopEntity->getLayout() . "/config/user/updatecontact.ini";
|
$filenameaddress = "/data/www/old/application/design/vorlagen/" . $shopEntity->getLayout() . "/config/user/updatecontact.ini";
|
||||||
if(file_exists($filenameaddress)) {
|
if(file_exists($filenameaddress)) {
|
||||||
$txtaddress = file_get_contents($filenamelogin);
|
$txtaddress = file_get_contents($filenameaddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$filenameaddaddress = "/data/www/old/application/design/vorlagen/" . $shopEntity->getLayout() . "/config/user/address.ini";
|
$filenameaddaddress = "/data/www/old/application/design/vorlagen/" . $shopEntity->getLayout() . "/config/user/address.ini";
|
||||||
if(file_exists($filenameaddaddress)) {
|
if(file_exists($filenameaddaddress)) {
|
||||||
$txtaddaddress = file_get_contents($filenamelogin);
|
$txtaddaddress = file_get_contents($filenameaddaddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,3 +1,3 @@
|
|||||||
info:
|
info:
|
||||||
datum: 21.01.2023
|
datum: 21.06.2024
|
||||||
release: 2.2
|
release: 2.3
|
||||||
|
|||||||
@ -149,7 +149,7 @@ class Contact extends BaseContact
|
|||||||
|
|
||||||
public function getArray() {
|
public function getArray() {
|
||||||
return array(
|
return array(
|
||||||
'uid' => $this->id,
|
'uid' => (string)$this->id,
|
||||||
'kundenNr' => $this->kundenNr,
|
'kundenNr' => $this->kundenNr,
|
||||||
'calcValue1' => $this->calcValue1,
|
'calcValue1' => $this->calcValue1,
|
||||||
'calcValue2' => $this->calcValue2,
|
'calcValue2' => $this->calcValue2,
|
||||||
@ -346,9 +346,9 @@ class Contact extends BaseContact
|
|||||||
public function saveMongo()
|
public function saveMongo()
|
||||||
{
|
{
|
||||||
$dbMongo = TP_Mongo::getInstance();
|
$dbMongo = TP_Mongo::getInstance();
|
||||||
$obj = $dbMongo->Contact->findOne(array('uid' => $this->id));
|
$obj = $dbMongo->Contact->findOne(array('uid' => (string)$this->id));
|
||||||
if($obj) {
|
if($obj) {
|
||||||
$dbMongo->Contact->updateOne(array('uid' => $this->id), [ '$set' => $this->getArray()]);
|
$dbMongo->Contact->updateOne(array('uid' => (string)$this->id), [ '$set' => $this->getArray()]);
|
||||||
}else{
|
}else{
|
||||||
$dbMongo->Contact->insertOne($this->getArray());
|
$dbMongo->Contact->insertOne($this->getArray());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -66,7 +66,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<?php if ($this->shop->display_delivery) : ?>
|
<?php if (true || $this->shop->display_delivery) : ?>
|
||||||
<div class="col-sm-4 invoice">
|
<div class="col-sm-4 invoice">
|
||||||
<div class="well">
|
<div class="well">
|
||||||
<h4><?php echo $this->translate('Lieferadresse') ?>:</h4>
|
<h4><?php echo $this->translate('Lieferadresse') ?>:</h4>
|
||||||
|
|||||||
@ -135,10 +135,18 @@ a.editAddress.btn.btn-info.btn-xs {
|
|||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
|
|
||||||
<input id="delivery" type="hidden" name="delivery" value="<?php echo $this->delivery ?>" />
|
<input id="delivery" type="hidden" name="delivery" value="custom" />
|
||||||
<input id="sender" type="hidden" name="sender" value="<?php echo $this->sender ?>" />
|
<input id="sender" type="hidden" name="sender" value="<?php echo $this->sender ?>" />
|
||||||
<input id="invoice" type="hidden" name="invoice" value="<?php echo $this->invoice ?>" />
|
<input id="invoice" type="hidden" name="invoice" value="<?php echo $this->invoice ?>" />
|
||||||
|
<input type="text" name="delivery_firstname" value="<?php echo TP_Basket::getBasket()->getDeliveryAddress()['firstname'] ?>"/>
|
||||||
|
<input type="text" name="delivery_lastname" value="<?php echo TP_Basket::getBasket()->getDeliveryAddress()['lastname'] ?>"/>
|
||||||
|
<input type="text" name="delivery_street" value="<?php echo TP_Basket::getBasket()->getDeliveryAddress()['street'] ?>"/>
|
||||||
|
<input type="text" name="delivery_houseNumber" value="<?php echo TP_Basket::getBasket()->getDeliveryAddress()['houseNumber'] ?>"/>
|
||||||
|
<input type="text" name="delivery_zip" value="<?php echo TP_Basket::getBasket()->getDeliveryAddress()['zip'] ?>"/>
|
||||||
|
<input type="text" name="delivery_city" value="<?php echo TP_Basket::getBasket()->getDeliveryAddress()['city'] ?>"/>
|
||||||
|
<input type="text" name="delivery_email" value="<?php echo TP_Basket::getBasket()->getDeliveryAddress()['email'] ?>"/>
|
||||||
|
<input type="text" name="delivery_company" value="<?php echo TP_Basket::getBasket()->getDeliveryAddress()['company'] ?>"/>
|
||||||
|
<input type="text" name="delivery_company2" value="<?php echo TP_Basket::getBasket()->getDeliveryAddress()['company2'] ?>"/>
|
||||||
|
|
||||||
|
|
||||||
<div class="col-xs-12"><input id="review_next" type="submit" value="<?php echo $this->translate('Weiter') ?>" class="btn btn-success btn-lg pull-right" style="margin-right: 15px;" /></div>
|
<div class="col-xs-12"><input id="review_next" type="submit" value="<?php echo $this->translate('Weiter') ?>" class="btn btn-success btn-lg pull-right" style="margin-right: 15px;" /></div>
|
||||||
|
|||||||
@ -67,6 +67,10 @@ user.elements.self_phone_mobile.options.label = "Handy"
|
|||||||
user.elements.self_fax_phone.type = "text"
|
user.elements.self_fax_phone.type = "text"
|
||||||
user.elements.self_fax_phone.options.label = "Fax"
|
user.elements.self_fax_phone.options.label = "Fax"
|
||||||
|
|
||||||
|
user.elements.custom1.type = "text"
|
||||||
|
user.elements.custom1.options.label = "Custom1"
|
||||||
|
|
||||||
|
|
||||||
; submit element
|
; submit element
|
||||||
user.elements.submit.type = "submit"
|
user.elements.submit.type = "submit"
|
||||||
user.elements.submit.options.class = "submit"
|
user.elements.submit.options.class = "submit"
|
||||||
|
|||||||
@ -3104,7 +3104,6 @@ class BasketController extends TP_Controller_Action
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($basket->getInvoice() == 0) {
|
if ($basket->getInvoice() == 0) {
|
||||||
|
|
||||||
if ($this->user->standart_invoice == 0) {
|
if ($this->user->standart_invoice == 0) {
|
||||||
@ -3258,6 +3257,22 @@ class BasketController extends TP_Controller_Action
|
|||||||
$basket->setSender(0);
|
$basket->setSender(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($this->getRequest()->getParam('delivery') == 'custom') {
|
||||||
|
$basket->setDeliveryMode(TP_Basket::DELIVERY_MODE_CUSTOM);
|
||||||
|
$basket->setDeliveryAddress([
|
||||||
|
'country' => 'de',
|
||||||
|
'firstname' => $this->getRequest()->getParam('delivery_firstname', false) ?? '',
|
||||||
|
'lastname' => $this->getRequest()->getParam('delivery_lastname', false) ?? '',
|
||||||
|
'street' => $this->getRequest()->getParam('delivery_street', false) ?? '',
|
||||||
|
'houseNumber' => $this->getRequest()->getParam('delivery_houseNumber', false) ?? '',
|
||||||
|
'zip' => $this->getRequest()->getParam('delivery_zip', false) ?? '',
|
||||||
|
'city' => $this->getRequest()->getParam('delivery_city', false) ?? '',
|
||||||
|
'company' => $this->getRequest()->getParam('delivery_company', false) ?? '',
|
||||||
|
'company2' => $this->getRequest()->getParam('delivery_company2', false) ?? '',
|
||||||
|
'email' => $this->getRequest()->getParam('delivery_email', false) ?? '',
|
||||||
|
'_doctrine_class_name' => 'PSC\\Shop\\EntityBundle\\Document\\Embed\\ContactAddress'
|
||||||
|
]);
|
||||||
|
}
|
||||||
if ($this->getRequest()->getParam('delivery') != '' && $this->getRequest()->getParam('delivery') == 's') {
|
if ($this->getRequest()->getParam('delivery') != '' && $this->getRequest()->getParam('delivery') == 's') {
|
||||||
if ($this->getRequest()->getParam('invoice', false)) {
|
if ($this->getRequest()->getParam('invoice', false)) {
|
||||||
$basket->setDelivery($this->getRequest()->getParam('invoice', false));
|
$basket->setDelivery($this->getRequest()->getParam('invoice', false));
|
||||||
@ -3732,6 +3747,9 @@ class BasketController extends TP_Controller_Action
|
|||||||
|
|
||||||
$order->mongoLoaded = true;
|
$order->mongoLoaded = true;
|
||||||
if ($basket->getDelivery() != "") {
|
if ($basket->getDelivery() != "") {
|
||||||
|
if($basket->getDeliveryMode() == TP_Basket::DELIVERY_MODE_CUSTOM) {
|
||||||
|
$order->setDeliveryAddressSaved($basket->getDeliveryAddress());
|
||||||
|
} else {
|
||||||
$contactaddress = Doctrine_Query::create()->from('ContactAddress c')->where(
|
$contactaddress = Doctrine_Query::create()->from('ContactAddress c')->where(
|
||||||
'c.uuid = ?', array(
|
'c.uuid = ?', array(
|
||||||
$basket->getDelivery()
|
$basket->getDelivery()
|
||||||
@ -3741,6 +3759,7 @@ class BasketController extends TP_Controller_Action
|
|||||||
if ($contactaddress) {
|
if ($contactaddress) {
|
||||||
$order->setDeliveryAddressSaved($contactaddress->getOrderSaveArray());
|
$order->setDeliveryAddressSaved($contactaddress->getOrderSaveArray());
|
||||||
}
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
if ($basket->getInvoice() != "") {
|
if ($basket->getInvoice() != "") {
|
||||||
$contactaddress = Doctrine_Query::create()->from('ContactAddress c')->where(
|
$contactaddress = Doctrine_Query::create()->from('ContactAddress c')->where(
|
||||||
@ -4597,7 +4616,6 @@ class BasketController extends TP_Controller_Action
|
|||||||
} else {
|
} else {
|
||||||
$this->view->display_agb = $this->install->agb;
|
$this->view->display_agb = $this->install->agb;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($basket->getSender() != "") {
|
if ($basket->getSender() != "") {
|
||||||
$this->view->sender_address = Doctrine_Query::create()->select()->from('ContactAddress s')->where('s.contact_id = ? AND s.uuid = ?', array($this->user->id, $basket->getSender()))->fetchOne();
|
$this->view->sender_address = Doctrine_Query::create()->select()->from('ContactAddress s')->where('s.contact_id = ? AND s.uuid = ?', array($this->user->id, $basket->getSender()))->fetchOne();
|
||||||
}
|
}
|
||||||
@ -4605,9 +4623,24 @@ class BasketController extends TP_Controller_Action
|
|||||||
$this->view->invoice_address = Doctrine_Query::create()->select()->from('ContactAddress s')->where('s.contact_id = ? AND s.uuid = ?', array($this->user->id, $basket->getInvoice()))->fetchOne();
|
$this->view->invoice_address = Doctrine_Query::create()->select()->from('ContactAddress s')->where('s.contact_id = ? AND s.uuid = ?', array($this->user->id, $basket->getInvoice()))->fetchOne();
|
||||||
}
|
}
|
||||||
if ($basket->getDelivery() != "") {
|
if ($basket->getDelivery() != "") {
|
||||||
|
if($basket->getDeliveryMode() == TP_Basket::DELIVERY_MODE_CUSTOM) {
|
||||||
|
$this->view->delivery_address = new ContactAddress();
|
||||||
|
$this->view->delivery_address->firstname = $basket->getDeliveryAddress()['firstname'];
|
||||||
|
$this->view->delivery_address->lastname = $basket->getDeliveryAddress()['lastname'];
|
||||||
|
$this->view->delivery_address->street = $basket->getDeliveryAddress()['street'];
|
||||||
|
$this->view->delivery_address->house_number = $basket->getDeliveryAddress()['house_number'];
|
||||||
|
$this->view->delivery_address->zip = $basket->getDeliveryAddress()['zip'];
|
||||||
|
$this->view->delivery_address->city = $basket->getDeliveryAddress()['city'];
|
||||||
|
$this->view->delivery_address->company = $basket->getDeliveryAddress()['company'];
|
||||||
|
$this->view->delivery_address->company2 = $basket->getDeliveryAddress()['company2'];
|
||||||
|
$this->view->delivery_address->email = $basket->getDeliveryAddress()['email'];
|
||||||
|
$basket->setDeliveryUstId($this->view->delivery_address->ustid);
|
||||||
|
$basket->setDeliveryCountry($this->view->delivery_address->country);
|
||||||
|
}else{
|
||||||
$this->view->delivery_address = Doctrine_Query::create()->select()->from('ContactAddress s')->where('s.contact_id = ? AND s.uuid = ?', array($this->user->id, $basket->getDelivery()))->fetchOne();
|
$this->view->delivery_address = Doctrine_Query::create()->select()->from('ContactAddress s')->where('s.contact_id = ? AND s.uuid = ?', array($this->user->id, $basket->getDelivery()))->fetchOne();
|
||||||
$basket->setDeliveryCountry($this->view->delivery_address->country);
|
$basket->setDeliveryCountry($this->view->delivery_address->country);
|
||||||
$basket->setDeliveryUstId($this->view->delivery_address->ustid);
|
$basket->setDeliveryUstId($this->view->delivery_address->ustid);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$basket->setDeliveryPLZ($this->view->invoice_address->country);
|
$basket->setDeliveryPLZ($this->view->invoice_address->country);
|
||||||
$basket->setDeliveryCountry($this->view->invoice_address->country);
|
$basket->setDeliveryCountry($this->view->invoice_address->country);
|
||||||
|
|||||||
@ -3263,64 +3263,64 @@ class UserController extends TP_Controller_Action
|
|||||||
$contact->setCustom4($formData ['rech'] ['custom4']);
|
$contact->setCustom4($formData ['rech'] ['custom4']);
|
||||||
}
|
}
|
||||||
if (isset($formData ['rech'] ['custom5'])) {
|
if (isset($formData ['rech'] ['custom5'])) {
|
||||||
$contact->setCustom4($formData ['rech'] ['custom5']);
|
$contact->setCustom5($formData ['rech'] ['custom5']);
|
||||||
}
|
}
|
||||||
if (isset($formData ['rech'] ['custom6'])) {
|
if (isset($formData ['rech'] ['custom6'])) {
|
||||||
$contact->setCustom4($formData ['rech'] ['custom6']);
|
$contact->setCustom6($formData ['rech'] ['custom6']);
|
||||||
}
|
}
|
||||||
if (isset($formData ['rech'] ['custom7'])) {
|
if (isset($formData ['rech'] ['custom7'])) {
|
||||||
$contact->setCustom4($formData ['rech'] ['custom7']);
|
$contact->setCustom7($formData ['rech'] ['custom7']);
|
||||||
}
|
}
|
||||||
if (isset($formData ['rech'] ['custom8'])) {
|
if (isset($formData ['rech'] ['custom8'])) {
|
||||||
$contact->setCustom4($formData ['rech'] ['custom8']);
|
$contact->setCustom8($formData ['rech'] ['custom8']);
|
||||||
}
|
}
|
||||||
if (isset($formData ['rech'] ['custom9'])) {
|
if (isset($formData ['rech'] ['custom9'])) {
|
||||||
$contact->setCustom4($formData ['rech'] ['custom9']);
|
$contact->setCustom9($formData ['rech'] ['custom9']);
|
||||||
}
|
}
|
||||||
if (isset($formData ['rech'] ['custom10'])) {
|
if (isset($formData ['rech'] ['custom10'])) {
|
||||||
$contact->setCustom4($formData ['rech'] ['custom10']);
|
$contact->setCustom10($formData ['rech'] ['custom10']);
|
||||||
}
|
}
|
||||||
if (isset($formData ['rech'] ['custom11'])) {
|
if (isset($formData ['rech'] ['custom11'])) {
|
||||||
$contact->setCustom4($formData ['rech'] ['custom11']);
|
$contact->setCustom11($formData ['rech'] ['custom11']);
|
||||||
}
|
}
|
||||||
if (isset($formData ['rech'] ['custom12'])) {
|
if (isset($formData ['rech'] ['custom12'])) {
|
||||||
$contact->setCustom4($formData ['rech'] ['custom12']);
|
$contact->setCustom12($formData ['rech'] ['custom12']);
|
||||||
}
|
}
|
||||||
if (isset($formData ['rech'] ['custom13'])) {
|
if (isset($formData ['rech'] ['custom13'])) {
|
||||||
$contact->setCustom4($formData ['rech'] ['custom13']);
|
$contact->setCustom13($formData ['rech'] ['custom13']);
|
||||||
}
|
}
|
||||||
if (isset($formData ['rech'] ['custom14'])) {
|
if (isset($formData ['rech'] ['custom14'])) {
|
||||||
$contact->setCustom4($formData ['rech'] ['custom14']);
|
$contact->setCustom14($formData ['rech'] ['custom14']);
|
||||||
}
|
}
|
||||||
if (isset($formData ['rech'] ['custom15'])) {
|
if (isset($formData ['rech'] ['custom15'])) {
|
||||||
$contact->setCustom4($formData ['rech'] ['custom15']);
|
$contact->setCustom15($formData ['rech'] ['custom15']);
|
||||||
}
|
}
|
||||||
if (isset($formData ['rech'] ['custom16'])) {
|
if (isset($formData ['rech'] ['custom16'])) {
|
||||||
$contact->setCustom4($formData ['rech'] ['custom16']);
|
$contact->setCustom16($formData ['rech'] ['custom16']);
|
||||||
}
|
}
|
||||||
if (isset($formData ['rech'] ['custom17'])) {
|
if (isset($formData ['rech'] ['custom17'])) {
|
||||||
$contact->setCustom4($formData ['rech'] ['custom17']);
|
$contact->setCustom17($formData ['rech'] ['custom17']);
|
||||||
}
|
}
|
||||||
if (isset($formData ['rech'] ['custom18'])) {
|
if (isset($formData ['rech'] ['custom18'])) {
|
||||||
$contact->setCustom4($formData ['rech'] ['custom18']);
|
$contact->setCustom18($formData ['rech'] ['custom18']);
|
||||||
}
|
}
|
||||||
if (isset($formData ['rech'] ['custom19'])) {
|
if (isset($formData ['rech'] ['custom19'])) {
|
||||||
$contact->setCustom4($formData ['rech'] ['custom19']);
|
$contact->setCustom19($formData ['rech'] ['custom19']);
|
||||||
}
|
}
|
||||||
if (isset($formData ['rech'] ['custom20'])) {
|
if (isset($formData ['rech'] ['custom20'])) {
|
||||||
$contact->setCustom4($formData ['rech'] ['custom20']);
|
$contact->setCustom20($formData ['rech'] ['custom20']);
|
||||||
}
|
}
|
||||||
if (isset($formData ['rech'] ['custom21'])) {
|
if (isset($formData ['rech'] ['custom21'])) {
|
||||||
$contact->setCustom4($formData ['rech'] ['custom21']);
|
$contact->setCustom21($formData ['rech'] ['custom21']);
|
||||||
}
|
}
|
||||||
if (isset($formData ['rech'] ['custom22'])) {
|
if (isset($formData ['rech'] ['custom22'])) {
|
||||||
$contact->setCustom4($formData ['rech'] ['custom22']);
|
$contact->setCustom22($formData ['rech'] ['custom22']);
|
||||||
}
|
}
|
||||||
if (isset($formData ['rech'] ['custom23'])) {
|
if (isset($formData ['rech'] ['custom23'])) {
|
||||||
$contact->setCustom4($formData ['rech'] ['custom23']);
|
$contact->setCustom23($formData ['rech'] ['custom23']);
|
||||||
}
|
}
|
||||||
if (isset($formData ['rech'] ['custom24'])) {
|
if (isset($formData ['rech'] ['custom24'])) {
|
||||||
$contact->setCustom4($formData ['rech'] ['custom24']);
|
$contact->setCustom24($formData ['rech'] ['custom24']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$contact->saveMongo();
|
$contact->saveMongo();
|
||||||
|
|||||||
@ -11,7 +11,8 @@ class TP_Basket
|
|||||||
private $_Warenkorb;
|
private $_Warenkorb;
|
||||||
|
|
||||||
const GUTSCHEIN_PRODUCT = 1;
|
const GUTSCHEIN_PRODUCT = 1;
|
||||||
|
const DELIVERY_MODE_NORMAL = 1;
|
||||||
|
const DELIVERY_MODE_CUSTOM = 2;
|
||||||
const GUTSCHEIN_ALL = 2;
|
const GUTSCHEIN_ALL = 2;
|
||||||
|
|
||||||
public function setTempProduct($article, $options, $netto)
|
public function setTempProduct($article, $options, $netto)
|
||||||
@ -930,6 +931,34 @@ class TP_Basket
|
|||||||
{
|
{
|
||||||
return $this->_Warenkorb->offerContact;
|
return $this->_Warenkorb->offerContact;
|
||||||
}
|
}
|
||||||
|
public function getDeliveryMode()
|
||||||
|
{
|
||||||
|
return $this->_Warenkorb->deliveryMode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setDeliveryMode($deliveryMode)
|
||||||
|
{
|
||||||
|
if ($this->_Warenkorb->isLocked() ) {
|
||||||
|
$this->_Warenkorb->unLock();
|
||||||
|
}
|
||||||
|
$this->_Warenkorb->deliveryMode = $deliveryMode;
|
||||||
|
//Namespace wieder sperren
|
||||||
|
$this->_Warenkorb->lock();
|
||||||
|
}
|
||||||
|
public function getDeliveryAddress()
|
||||||
|
{
|
||||||
|
return $this->_Warenkorb->deliveryAddress;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setDeliveryAddress($deliveryAddress)
|
||||||
|
{
|
||||||
|
if ($this->_Warenkorb->isLocked() ) {
|
||||||
|
$this->_Warenkorb->unLock();
|
||||||
|
}
|
||||||
|
$this->_Warenkorb->deliveryAddress = $deliveryAddress;
|
||||||
|
//Namespace wieder sperren
|
||||||
|
$this->_Warenkorb->lock();
|
||||||
|
}
|
||||||
|
|
||||||
public function setOfferContact($offerContact)
|
public function setOfferContact($offerContact)
|
||||||
{
|
{
|
||||||
@ -1020,6 +1049,8 @@ class TP_Basket
|
|||||||
$this->_Warenkorb->initialized = true;
|
$this->_Warenkorb->initialized = true;
|
||||||
$this->_Warenkorb->deliverysame = true;
|
$this->_Warenkorb->deliverysame = true;
|
||||||
$this->_Warenkorb->delivery = 0;
|
$this->_Warenkorb->delivery = 0;
|
||||||
|
$this->_Warenkorb->deliveryMode = self::DELIVERY_MODE_NORMAL;
|
||||||
|
$this->_Warenkorb->deliveryAddress = [];
|
||||||
$this->_Warenkorb->invoicesame = true;
|
$this->_Warenkorb->invoicesame = true;
|
||||||
$this->_Warenkorb->invoice = 0;
|
$this->_Warenkorb->invoice = 0;
|
||||||
$this->_Warenkorb->sendersame = true;
|
$this->_Warenkorb->sendersame = true;
|
||||||
@ -1057,6 +1088,8 @@ class TP_Basket
|
|||||||
$this->_Warenkorb->deliverysame = true;
|
$this->_Warenkorb->deliverysame = true;
|
||||||
$this->_Warenkorb->delivery = 0;
|
$this->_Warenkorb->delivery = 0;
|
||||||
$this->_Warenkorb->invoicesame = true;
|
$this->_Warenkorb->invoicesame = true;
|
||||||
|
$this->_Warenkorb->deliveryAddress = [];
|
||||||
|
$this->_Warenkorb->deliveryMode = self::DELIVERY_MODE_NORMAL;
|
||||||
$this->_Warenkorb->shippingtype_extra_label = "";
|
$this->_Warenkorb->shippingtype_extra_label = "";
|
||||||
$this->_Warenkorb->invoice = 0;
|
$this->_Warenkorb->invoice = 0;
|
||||||
$this->_Warenkorb->offerContact = array();
|
$this->_Warenkorb->offerContact = array();
|
||||||
|
|||||||
@ -146,8 +146,11 @@ class TP_Image {
|
|||||||
{
|
{
|
||||||
$filters = array();
|
$filters = array();
|
||||||
|
|
||||||
if($finfo == 'application/pdf') {
|
if($finfo == 'application/pdf' || $finfo == 'image/svg+xml') {
|
||||||
|
|
||||||
|
if($finfo == 'image/svg+xml' && filesize($image->path)/1024/1024 > 10) {
|
||||||
|
return '/images/no_preview.png';
|
||||||
|
}
|
||||||
$resize = "-resize ";
|
$resize = "-resize ";
|
||||||
if((int)$config->images->$mode->scale->data->width != 0) {
|
if((int)$config->images->$mode->scale->data->width != 0) {
|
||||||
$resize = $resize . (int)$config->images->$mode->scale->data->width;
|
$resize = $resize . (int)$config->images->$mode->scale->data->width;
|
||||||
@ -163,7 +166,7 @@ class TP_Image {
|
|||||||
if($resize == "-resize 0x0") {
|
if($resize == "-resize 0x0") {
|
||||||
exec("convert -density 140 '".$image->path."[0]' -quality 75 -background white -alpha remove -colorspace sRGB ". PUBLIC_PATH.'/temp/thumb/'.$shop['uid'].'/'.$image->id.'_'.$mode.'.png');
|
exec("convert -density 140 '".$image->path."[0]' -quality 75 -background white -alpha remove -colorspace sRGB ". PUBLIC_PATH.'/temp/thumb/'.$shop['uid'].'/'.$image->id.'_'.$mode.'.png');
|
||||||
}else{
|
}else{
|
||||||
exec("convert -density 140 '".$image->path."[0]' ".$resize." -quality 75 -background white -alpha remove -colorspace sRGB ". PUBLIC_PATH.'/temp/thumb/'.$shop['uid'].'/'.$image->id.'_'.$mode.'.png');
|
var_dump("convert -density 140 '".$image->path."[0]' ".$resize." -quality 75 -background white -alpha remove -colorspace sRGB ". PUBLIC_PATH.'/temp/thumb/'.$shop['uid'].'/'.$image->id.'_'.$mode.'.png');
|
||||||
}
|
}
|
||||||
return '/temp/thumb/'.$shop['uid'].'/'.$image->id.'_'.$mode.'.png';
|
return '/temp/thumb/'.$shop['uid'].'/'.$image->id.'_'.$mode.'.png';
|
||||||
}elseif($finfo == 'image/png') {
|
}elseif($finfo == 'image/png') {
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 646 B |
|
Before Width: | Height: | Size: 240 B |
|
Before Width: | Height: | Size: 2.0 KiB |
@ -1,3 +0,0 @@
|
|||||||
[Dolphin]
|
|
||||||
ShowPreview=true
|
|
||||||
Timestamp=2009,3,13,2,6,13
|
|
||||||
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 981 B |
|
Before Width: | Height: | Size: 981 B |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 802 B |
|
Before Width: | Height: | Size: 802 B |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 47 KiB |
|
Before Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 981 B |
|
Before Width: | Height: | Size: 981 B |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 802 B |
|
Before Width: | Height: | Size: 802 B |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 875 B |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 962 B |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 974 B |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |