Fixes
This commit is contained in:
parent
1706480be9
commit
748ff5802f
File diff suppressed because one or more lines are too long
@ -70,6 +70,16 @@ class Address
|
||||
#[OA\Property(type: 'string')]
|
||||
private string $ustid = "";
|
||||
|
||||
#[OA\Property(type: 'string')]
|
||||
private string $steuerid = "";
|
||||
|
||||
#[OA\Property(type: 'string')]
|
||||
private string $lid = "";
|
||||
|
||||
#[OA\Property(type: 'string')]
|
||||
private string $iban = "";
|
||||
|
||||
|
||||
#[OA\Property(type: 'string')]
|
||||
private string $zusatz1 = "";
|
||||
|
||||
@ -89,7 +99,7 @@ class Address
|
||||
{
|
||||
return $this->uid;
|
||||
}
|
||||
|
||||
|
||||
public function setUid(int $uid): void
|
||||
{
|
||||
$this->uid = $uid;
|
||||
@ -114,32 +124,32 @@ class Address
|
||||
{
|
||||
$this->firstname = $firstname;
|
||||
}
|
||||
|
||||
|
||||
public function getLastname(): string
|
||||
{
|
||||
return $this->lastname;
|
||||
}
|
||||
|
||||
|
||||
public function setLastname(string $lastname): void
|
||||
{
|
||||
$this->lastname = $lastname;
|
||||
}
|
||||
|
||||
|
||||
public function getStreet(): string
|
||||
{
|
||||
return $this->street;
|
||||
}
|
||||
|
||||
|
||||
public function setStreet(string $street): void
|
||||
{
|
||||
$this->street = $street;
|
||||
}
|
||||
|
||||
|
||||
public function getHouseNumber(): string
|
||||
{
|
||||
return $this->houseNumber;
|
||||
}
|
||||
|
||||
|
||||
public function setHouseNumber(string $houseNumber): void
|
||||
{
|
||||
$this->houseNumber = $houseNumber;
|
||||
@ -149,7 +159,7 @@ class Address
|
||||
{
|
||||
return $this->zip;
|
||||
}
|
||||
|
||||
|
||||
public function setZip(string $zip): void
|
||||
{
|
||||
$this->zip = $zip;
|
||||
@ -159,12 +169,12 @@ class Address
|
||||
{
|
||||
return $this->city;
|
||||
}
|
||||
|
||||
|
||||
public function setCity(string $city): void
|
||||
{
|
||||
$this->city = $city;
|
||||
}
|
||||
|
||||
|
||||
public function getPhone(): string
|
||||
{
|
||||
return $this->phone;
|
||||
@ -174,7 +184,7 @@ class Address
|
||||
{
|
||||
$this->phone = $phone;
|
||||
}
|
||||
|
||||
|
||||
public function getMobilPhone(): string
|
||||
{
|
||||
return $this->mobilPhone;
|
||||
@ -184,7 +194,7 @@ class Address
|
||||
{
|
||||
$this->mobilPhone = $mobilPhone;
|
||||
}
|
||||
|
||||
|
||||
public function getEmail(): string
|
||||
{
|
||||
return $this->email;
|
||||
@ -209,7 +219,7 @@ class Address
|
||||
{
|
||||
return $this->anrede;
|
||||
}
|
||||
|
||||
|
||||
public function setAnrede(string $anrede): void
|
||||
{
|
||||
$this->anrede = $anrede;
|
||||
@ -219,13 +229,13 @@ class Address
|
||||
{
|
||||
return $this->country;
|
||||
}
|
||||
|
||||
|
||||
public function setCountry(string $country): void
|
||||
{
|
||||
$this->country = $country;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function getFax(): string
|
||||
{
|
||||
return $this->fax;
|
||||
@ -250,12 +260,12 @@ class Address
|
||||
{
|
||||
return $this->kostenstellung;
|
||||
}
|
||||
|
||||
|
||||
public function setKostenstellung(string $kostenstellung): void
|
||||
{
|
||||
$this->kostenstellung = $kostenstellung;
|
||||
}
|
||||
|
||||
|
||||
public function getAbteilung(): string
|
||||
{
|
||||
return $this->abteilung;
|
||||
@ -265,7 +275,7 @@ class Address
|
||||
{
|
||||
$this->abteilung = $abteilung;
|
||||
}
|
||||
|
||||
|
||||
public function getPosition(): string
|
||||
{
|
||||
return $this->position;
|
||||
@ -276,16 +286,46 @@ class Address
|
||||
$this->position = $position;
|
||||
}
|
||||
|
||||
public function getUstid(): string
|
||||
public function getUstId(): string
|
||||
{
|
||||
return $this->ustid;
|
||||
return (string)$this->ustid;
|
||||
}
|
||||
|
||||
public function setUstid(string $ustid): void
|
||||
|
||||
public function setUstId(string $ustid): void
|
||||
{
|
||||
$this->ustid = $ustid;
|
||||
}
|
||||
|
||||
public function getSteuerId(): string
|
||||
{
|
||||
return (string)$this->steuerid;
|
||||
}
|
||||
|
||||
public function setSteuerId(string $var): void
|
||||
{
|
||||
$this->steuerid = $var;
|
||||
}
|
||||
public function getLId(): string
|
||||
{
|
||||
return (string)$this->lid;
|
||||
}
|
||||
|
||||
public function setLId(string $var): void
|
||||
{
|
||||
$this->lid = $var;
|
||||
}
|
||||
|
||||
public function getIban(): string
|
||||
{
|
||||
return (string)$this->iban;
|
||||
}
|
||||
|
||||
public function setIban(string $var): void
|
||||
{
|
||||
$this->iban = $var;
|
||||
}
|
||||
|
||||
|
||||
public function getZusatz1(): string
|
||||
{
|
||||
return $this->zusatz1;
|
||||
@ -295,27 +335,27 @@ class Address
|
||||
{
|
||||
$this->zusatz1 = $zusatz1;
|
||||
}
|
||||
|
||||
|
||||
public function getZusatz2(): string
|
||||
{
|
||||
return $this->zusatz2;
|
||||
}
|
||||
|
||||
|
||||
public function setZusatz2(string $zusatz2): void
|
||||
{
|
||||
$this->zusatz2 = $zusatz2;
|
||||
}
|
||||
|
||||
|
||||
public function getPos(): int
|
||||
{
|
||||
return $this->pos;
|
||||
}
|
||||
|
||||
|
||||
public function setPos(int $pos): void
|
||||
{
|
||||
$this->pos = $pos;
|
||||
}
|
||||
|
||||
|
||||
public function getKundenNr(): string
|
||||
{
|
||||
return $this->kundenNr;
|
||||
|
||||
@ -19,10 +19,10 @@ use PSC\Shop\EntityBundle\Entity\Contact;
|
||||
use PSC\Shop\EntityBundle\Entity\Shop;
|
||||
use Symfony\Bridge\Doctrine\Security\User\UserLoaderInterface;
|
||||
use Symfony\Component\Security\Core\Exception\CustomUserMessageAuthenticationException;
|
||||
use Symfony\Component\Security\Core\Exception\UsernameNotFoundException;
|
||||
use Symfony\Component\Security\Core\Exception\UserNotFoundException;
|
||||
use Symfony\Component\Security\Core\User\UserInterface;
|
||||
|
||||
class ContactRepository extends ServiceEntityRepository implements UserLoaderInterface
|
||||
class ContactRepository extends ServiceEntityRepository implements UserLoaderInterface
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry, private readonly \PSC\System\SettingsBundle\Service\Shop $shopService)
|
||||
{
|
||||
@ -38,7 +38,7 @@ class ContactRepository extends ServiceEntityRepository implements UserLoaderIn
|
||||
->getOneOrNullResult();
|
||||
if (null === $user) {
|
||||
$message = sprintf('Unable to find an active admin AppBundle:User object identified by "%s".', $username);
|
||||
throw new UsernameNotFoundException($message);
|
||||
throw new UserNotFoundException($message);
|
||||
}
|
||||
|
||||
return $user;
|
||||
|
||||
@ -3,11 +3,6 @@
|
||||
namespace PSC\Shop\ContactBundle\Transformer\Order;
|
||||
|
||||
use PSC\Shop\EntityBundle\Document\Embed\ContactAddress;
|
||||
use PSC\Shop\EntityBundle\Entity\Orderpos;
|
||||
use PSC\Shop\EntityBundle\Entity\Product;
|
||||
use PSC\System\SettingsBundle\Service\Shop;
|
||||
use Symfony\Component\HttpFoundation\Session\SessionInterface;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||
|
||||
class Address
|
||||
{
|
||||
@ -25,9 +20,12 @@ class Address
|
||||
$addressDoc->setHouseNumber((string)$address->getHouseNumber());
|
||||
$addressDoc->setPhone((string)$address->getPhone());
|
||||
$addressDoc->setCountry((string)$address->getCountry());
|
||||
$addressDoc->setUstid((string)$address->getUstid());
|
||||
$addressDoc->setUstId((string)$address->getUstId());
|
||||
$addressDoc->setPosition((string)$address->getPosition());
|
||||
$addressDoc->setUuid((string)$address->getUuid());
|
||||
$addressDoc->setIban((string)$address->getIban());
|
||||
$addressDoc->setLId((string)$address->getLId());
|
||||
$addressDoc->setSteuerId((string)$address->getSteuerId());
|
||||
|
||||
}
|
||||
|
||||
@ -41,12 +39,15 @@ class Address
|
||||
$address->setFax((string)$addressDoc->getFax());
|
||||
$address->setFirstname((string)$addressDoc->getFirstname());
|
||||
$address->setCountry((string)$addressDoc->getCountry());
|
||||
$address->setUstid((string)$addressDoc->getUstid());
|
||||
$address->setUstId((string)$addressDoc->getUstId());
|
||||
$address->setLastname((string)$addressDoc->getLastname());
|
||||
$address->setStreet((string)$addressDoc->getStreet());
|
||||
$address->setHouseNumber((string)$addressDoc->getHouseNumber());
|
||||
$address->setPhone((string)$addressDoc->getPhone());
|
||||
$address->setPosition((string)$addressDoc->getPosition());
|
||||
$address->setUuid((string)$addressDoc->getUuid());
|
||||
$address->setIban((string)$addressDoc->getIban());
|
||||
$address->setLId((string)$addressDoc->getLId());
|
||||
$address->setSteuerId((string)$addressDoc->getSteuerId());
|
||||
}
|
||||
}
|
||||
|
||||
@ -219,6 +219,9 @@ class Contact
|
||||
|
||||
public function getAccountType(): AccountType
|
||||
{
|
||||
if ($this->accountType == null) {
|
||||
return AccountType::tryFrom(1);
|
||||
}
|
||||
return AccountType::tryFrom($this->accountType);
|
||||
}
|
||||
|
||||
|
||||
@ -108,14 +108,15 @@ class ContactAddress
|
||||
*/
|
||||
#[Field(type: 'string')]
|
||||
private $position;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
|
||||
#[Field(type: 'string')]
|
||||
private $ustid;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
#[Field(type: 'string')]
|
||||
private $steuerid;
|
||||
#[Field(type: 'string')]
|
||||
private $iban;
|
||||
#[Field(type: 'string')]
|
||||
private $lid;
|
||||
#[Field(type: 'string')]
|
||||
private $zusatz1;
|
||||
/**
|
||||
@ -133,9 +134,7 @@ class ContactAddress
|
||||
*/
|
||||
#[Field(type: 'string')]
|
||||
private $kundenNr;
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
|
||||
public function getFirstname()
|
||||
{
|
||||
return $this->firstname;
|
||||
@ -437,25 +436,6 @@ class ContactAddress
|
||||
$this->position = $position;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getUstid()
|
||||
{
|
||||
return $this->ustid;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $ustid
|
||||
*/
|
||||
public function setUstid($ustid)
|
||||
{
|
||||
$this->ustid = $ustid;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getZusatz1()
|
||||
{
|
||||
return $this->zusatz1;
|
||||
@ -526,4 +506,44 @@ class ContactAddress
|
||||
{
|
||||
$this->uuid = $uuid;
|
||||
}
|
||||
|
||||
public function getUstId(): string
|
||||
{
|
||||
return (string)$this->ustid;
|
||||
}
|
||||
|
||||
public function setUstId(string $ustid): void
|
||||
{
|
||||
$this->ustid = $ustid;
|
||||
}
|
||||
|
||||
public function getSteuerId(): string
|
||||
{
|
||||
return (string)$this->steuerid;
|
||||
}
|
||||
|
||||
public function setSteuerId(string $var): void
|
||||
{
|
||||
$this->steuerid = $var;
|
||||
}
|
||||
public function getLId(): string
|
||||
{
|
||||
return (string)$this->lid;
|
||||
}
|
||||
|
||||
public function setLId(string $var): void
|
||||
{
|
||||
$this->lid = $var;
|
||||
}
|
||||
|
||||
public function getIban(): string
|
||||
{
|
||||
return (string)$this->iban;
|
||||
}
|
||||
|
||||
public function setIban(string $var): void
|
||||
{
|
||||
$this->iban = $var;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -515,6 +515,15 @@ class Shop
|
||||
protected $senderMobile;
|
||||
#[Field(type: 'string')]
|
||||
protected $senderEmail;
|
||||
#[Field(type: 'string')]
|
||||
protected $senderIban;
|
||||
#[Field(type: 'string')]
|
||||
protected $senderLId;
|
||||
#[Field(type: 'string')]
|
||||
protected $senderUstId;
|
||||
#[Field(type: 'string')]
|
||||
protected $senderSteuerId;
|
||||
|
||||
#[Field(type: 'bool')]
|
||||
protected bool $docInvoiceXML = false;
|
||||
#[Field(type: 'bool')]
|
||||
@ -3119,6 +3128,13 @@ class Shop
|
||||
$address->setZip((string)$this->getSenderZip());
|
||||
$address->setCity((string)$this->getSenderCity());
|
||||
$address->setCountry((string)$this->getSenderCountry());
|
||||
$address->setEmail((string)$this->getSenderEmail());
|
||||
$address->setIban((string)$this->getSenderIban());
|
||||
$address->setLId((string)$this->getSenderLId());
|
||||
$address->setUstId((string)$this->getSenderUstId());
|
||||
$address->setSteuerId((string)$this->getSenderSteuerId());
|
||||
$address->setMobilPhone((string)$this->getSenderMobile());
|
||||
|
||||
return $address;
|
||||
}
|
||||
|
||||
@ -3191,5 +3207,44 @@ class Shop
|
||||
$this->docOfferXML = $value;
|
||||
}
|
||||
|
||||
public function getSenderIban(): string
|
||||
{
|
||||
return (string)$this->senderIban;
|
||||
}
|
||||
|
||||
public function setSenderIban(string $var): void
|
||||
{
|
||||
$this->senderIban = $var;
|
||||
}
|
||||
|
||||
public function getSenderLId(): string
|
||||
{
|
||||
return (string)$this->senderLId;
|
||||
}
|
||||
|
||||
public function setSenderLId(string $var): void
|
||||
{
|
||||
$this->senderLId = $var;
|
||||
}
|
||||
|
||||
public function getSenderUstId(): string
|
||||
{
|
||||
return (string)$this->senderUstId;
|
||||
}
|
||||
|
||||
public function setSenderUstId(string $var): void
|
||||
{
|
||||
$this->senderUstId = $var;
|
||||
}
|
||||
|
||||
public function getSenderSteuerId(): string
|
||||
{
|
||||
return (string)$this->senderSteuerId;
|
||||
}
|
||||
|
||||
public function setSenderSteuerId(string $var): void
|
||||
{
|
||||
$this->senderSteuerId = $var;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -49,15 +49,11 @@ class Calc
|
||||
$order->addTax($order->getPayment()->getCalcPrice()->tax);
|
||||
$this->shippingTransformer->parseModel($order->getShipping());
|
||||
$this->priceShipping->getPrice($order->getShipping(), $order->getNet(), $order->getWeight(), (string)$order->getDeliveryAddress()->getCountry(), (int)$order->getDeliveryAddress()->getZip());
|
||||
var_dump($order->getAllTaxes());
|
||||
var_dump("1");
|
||||
$priceNet = $priceNet->plus(Money::ofMinor($order->getShipping()->getCalcPrice()->net, 'EUR'));
|
||||
$priceVat = $priceVat->plus(Money::ofMinor($order->getShipping()->getCalcPrice()->vat, 'EUR'));
|
||||
$priceGross = $priceGross->plus(Money::ofMinor($order->getShipping()->getCalcPrice()->gross, 'EUR'));
|
||||
$order->setShippingCosts(Money::ofMinor($order->getShipping()->getCalcPrice()->net, 'EUR')->getMinorAmount()->toInt());
|
||||
$order->addTax($order->getShipping()->getCalcPrice()->tax);
|
||||
var_dump($order->getAllTaxes());
|
||||
var_dump("2");
|
||||
foreach ($order->getPositions() as $position) {
|
||||
$position->getProduct()->setShopUuid($order->getShop()->getUuid());
|
||||
if ($this->productTypeRegistry->getProductType($position->getProduct()->getSpecialProductTypeObject()->getTyp())) {
|
||||
@ -76,8 +72,6 @@ class Calc
|
||||
$priceGross = $priceGross->plus(Money::ofMinor($position->getPrice()->getAllGross(), 'EUR'));
|
||||
$order->addTax($position->getPrice()->tax);
|
||||
}
|
||||
var_dump($order->getAllTaxes());
|
||||
var_dump("test");
|
||||
$order->setNet($priceNet->getMinorAmount()->toInt());
|
||||
$order->setVat($priceVat->getMinorAmount()->toInt());
|
||||
$order->setGross($priceGross->getMinorAmount()->toInt());
|
||||
|
||||
@ -151,7 +151,8 @@ class Order extends Base
|
||||
$orderEntity->setMwertAlle(json_encode($mwertAlle));
|
||||
$orderEntity->setVersion(1);
|
||||
|
||||
$orderEntity->setShop($this->shopService->getShopByUid($order->getShop()->getUuid()));
|
||||
$shopEntity = $this->shopService->getShopByUid($order->getShop()->getUuid());
|
||||
$orderEntity->setShop($shopEntity);
|
||||
|
||||
$this->paymentTransformer->toDb($order->getPayment(), $orderEntity);
|
||||
$this->shippingTransformer->toDb($order->getShipping(), $orderEntity);
|
||||
@ -172,9 +173,12 @@ class Order extends Base
|
||||
$orderDoc->setDeliveryAddressSaved($deliveryDoc);
|
||||
|
||||
$senderDoc = new ContactAddress();
|
||||
$senderAddress = $order->getSenderAddress();
|
||||
if ($senderAddress->getUid() == 0 && $senderAddress->getType() == 0 && $senderAddress->getCompany() == "" && $senderAddress->getFirstname() == "" && $senderAddress->getLastname() == "") {
|
||||
$order->setSenderAddress($this->shopService->getMongoShopByUid($shopEntity->getUID())->getSenderAddress());
|
||||
}
|
||||
$this->addressTransformer->toDb($order->getSenderAddress(), $senderDoc);
|
||||
$orderDoc->setSenderAddressSaved($senderDoc);
|
||||
|
||||
$orderDoc->setExternalOrderNumber($order->getExternalOrderNumber());
|
||||
$orderDoc->setDraft($order->isDraft());
|
||||
|
||||
|
||||
@ -95,6 +95,8 @@ class ShopSettingsType extends AbstractType
|
||||
->add('senderEmail', TextType::class, array('required' => false, 'label' => 'EMail'))
|
||||
->add('senderIban', TextType::class, array('required' => false, 'label' => 'Iban'))
|
||||
->add('senderLId', TextType::class, array('required' => false, 'label' => 'Leitweg Id'))
|
||||
->add('senderUstId', TextType::class, array('required' => false, 'label' => 'Umsatzsteuer Nr'))
|
||||
->add('senderSteuerId', TextType::class, array('required' => false, 'label' => 'Steuer Nr'))
|
||||
|
||||
->add('priceFactor', NumberType::class, array('required' => false, 'label' => 'Factor', 'scale' => 5, 'html5' => true,
|
||||
'attr' => array(
|
||||
|
||||
@ -571,6 +571,54 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="row mb-3">
|
||||
<label class="col-md-3 form-control-label">
|
||||
{{ form_label(form.senderIban) }}
|
||||
</label>
|
||||
<div class="col-md-9">
|
||||
{{ form_widget(form.senderIban) }}
|
||||
</div>
|
||||
{{ form_errors(form.senderIban) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="row mb-3">
|
||||
<label class="col-md-3 form-control-label">
|
||||
{{ form_label(form.senderLId) }}
|
||||
</label>
|
||||
<div class="col-md-9">
|
||||
{{ form_widget(form.senderLId) }}
|
||||
</div>
|
||||
{{ form_errors(form.senderLId) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="row mb-3">
|
||||
<label class="col-md-3 form-control-label">
|
||||
{{ form_label(form.senderUstId) }}
|
||||
</label>
|
||||
<div class="col-md-9">
|
||||
{{ form_widget(form.senderUstId) }}
|
||||
</div>
|
||||
{{ form_errors(form.senderUstId) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="row mb-3">
|
||||
<label class="col-md-3 form-control-label">
|
||||
{{ form_label(form.senderSteuerId) }}
|
||||
</label>
|
||||
<div class="col-md-9">
|
||||
{{ form_widget(form.senderSteuerId) }}
|
||||
</div>
|
||||
{{ form_errors(form.senderSteuerId) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane" id="meta" role="tabpanel">
|
||||
<div class="row">
|
||||
|
||||
@ -73,8 +73,7 @@ class Printing
|
||||
->setDocumentInformation($orderModel->getAlias(), "380", $orderModel->getCreated(), "EUR")
|
||||
->addDocumentNote('Rechnung gemäß Bestellung vom ' . $orderModel->getCreated()->format('d.m.Y'))
|
||||
->setDocumentSupplyChainEvent($orderModel->getCreated())
|
||||
->setDocumentBuyerReference("leitwegId")
|
||||
// ->addDocumentSellerGlobalId("4000001123452", "0088")
|
||||
->setDocumentBuyerReference($orderModel->getInvoiceAddress()->getLId())
|
||||
->setDocumentSeller($orderModel->getSenderAddress()->getCompany() . ' ' . $orderModel->getSenderAddress()->getFirstname() . ' ' . $orderModel->getSenderAddress()->getLastname(), "")
|
||||
->setDocumentSellerAddress($orderModel->getSenderAddress()->getStreet() . ' ' . $orderModel->getSenderAddress()->getHouseNumber(), "", "", $orderModel->getSenderAddress()->getZip(), $orderModel->getSenderAddress()->getCity(), $orderModel->getSenderAddress()->getCountry() ?? 'DE')
|
||||
->setDocumentSellerContact($orderModel->getSenderAddress()->getFirstname() . ' ' . $orderModel->getSenderAddress()->getLastname(), $orderModel->getSenderAddress()->getCompany(), $orderModel->getSenderAddress()->getPhone(), $orderModel->getSenderAddress()->getMobilPhone(), $orderModel->getSenderAddress()->getEmail())
|
||||
@ -82,11 +81,11 @@ class Printing
|
||||
->setDocumentBuyer($orderModel->getInvoiceAddress()->getCompany() . ' ' . $orderModel->getInvoiceAddress()->getFirstname() . ' ' . $orderModel->getInvoiceAddress()->getLastname(), $orderModel->getInvoiceAddress()->getKundenNr())
|
||||
->setDocumentBuyerAddress($orderModel->getInvoiceAddress()->getStreet() . ' ' . $orderModel->getInvoiceAddress()->getHouseNumber(), "", "", $orderModel->getInvoiceAddress()->getZip(), $orderModel->getInvoiceAddress()->getCity(), $orderModel->getInvoiceAddress()->getCountry() ?? 'DE')
|
||||
->setDocumentBuyerCommunication("EM", $orderModel->getInvoiceAddress()->getEmail())
|
||||
->addDocumentPaymentMean(ZugferdPaymentMeans::UNTDID_4461_58, null, null, null, null, null, "DE12500105170648489890", null, null, null)
|
||||
->addDocumentPaymentTermXRechnung("Zahlungsbedingungen", [], [], [], null, null)
|
||||
->addDocumentPaymentMean(ZugferdPaymentMeans::UNTDID_4461_58, null, null, null, null, null, $orderModel->getSenderAddress()->getIban(), null, null, null)
|
||||
->addDocumentPaymentTermXRechnung($orderModel->getPayment()->getTitle(), [], [], [], null, null)
|
||||
|
||||
->addDocumentSellerVATRegistrationNumber("DEumsatzsteuer")
|
||||
->addDocumentSellerTaxNumber("steuernummer")
|
||||
->addDocumentSellerVATRegistrationNumber($orderModel->getSenderAddress()->getUstId())
|
||||
->addDocumentSellerTaxNumber($orderModel->getSenderAddress()->getSteuerId())
|
||||
|
||||
;
|
||||
|
||||
@ -156,6 +155,9 @@ class Printing
|
||||
'ShippingCoast'
|
||||
);
|
||||
}
|
||||
dump($orderModel);
|
||||
dump($document);
|
||||
die();
|
||||
return $document->getContent();
|
||||
}
|
||||
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace App\Tests\PSC\Shop\Order\Api;
|
||||
|
||||
use PSC\Shop\EntityBundle\Repository\JobRepository;
|
||||
@ -21,7 +22,7 @@ class CreateTest extends WebTestCase
|
||||
$shopRepository = static::getContainer()->get(ShopRepository::class);
|
||||
|
||||
/**
|
||||
* @var Shop $shop
|
||||
* @var Shop $shop
|
||||
*/
|
||||
$shop = $shopRepository->findOneBy(['title' => 'Printchampion']);
|
||||
|
||||
@ -30,9 +31,11 @@ class CreateTest extends WebTestCase
|
||||
$paymentRepository = static::getContainer()->get(PaymentRepository::class);
|
||||
|
||||
$client->jsonRequest(
|
||||
'POST', '/api/order/create', [
|
||||
'POST',
|
||||
'/api/order/create',
|
||||
[
|
||||
'shop' => [
|
||||
'uuid' => (String)$shop->getUuid()
|
||||
'uuid' => (string)$shop->getUuid()
|
||||
],
|
||||
'type' => 2,
|
||||
'shipping' => [
|
||||
@ -96,7 +99,8 @@ class CreateTest extends WebTestCase
|
||||
]
|
||||
]
|
||||
]
|
||||
], ['HTTP_apiKey' => $shop->getApiKey()]
|
||||
],
|
||||
['HTTP_apiKey' => $shop->getApiKey()]
|
||||
);
|
||||
|
||||
self::assertSame(200, $client->getResponse()->getStatusCode());
|
||||
@ -104,9 +108,12 @@ class CreateTest extends WebTestCase
|
||||
$data = json_decode($client->getResponse()->getContent(), true);
|
||||
|
||||
$client->jsonRequest(
|
||||
'POST', '/api/order/getonebyuuid', [
|
||||
'POST',
|
||||
'/api/order/getonebyuuid',
|
||||
[
|
||||
'uuid' => $data['uuid'],
|
||||
], ['HTTP_apiKey' => $shop->getApiKey()]
|
||||
],
|
||||
['HTTP_apiKey' => $shop->getApiKey()]
|
||||
);
|
||||
|
||||
$data = json_decode($client->getResponse()->getContent(), true);
|
||||
@ -118,10 +125,13 @@ class CreateTest extends WebTestCase
|
||||
|
||||
self::assertSame('Gribow', $data['deliveryAddress']['city']);
|
||||
|
||||
self::assertSame('ShopMusterOrt', $data['senderAddress']['city']);
|
||||
self::assertSame('ShopMusterIban', $data['senderAddress']['iban']);
|
||||
|
||||
self::assertSame(200, $client->getResponse()->getStatusCode());
|
||||
|
||||
/**
|
||||
* @var JobRepository $jobs
|
||||
* @var JobRepository $jobs
|
||||
*/
|
||||
$jobs = static::getContainer()->get(JobRepository::class);
|
||||
|
||||
@ -136,7 +146,7 @@ class CreateTest extends WebTestCase
|
||||
$shopRepository = static::getContainer()->get(ShopRepository::class);
|
||||
|
||||
/**
|
||||
* @var Shop $shop
|
||||
* @var Shop $shop
|
||||
*/
|
||||
$shop = $shopRepository->findOneBy(['title' => 'Printchampion']);
|
||||
|
||||
@ -145,9 +155,11 @@ class CreateTest extends WebTestCase
|
||||
$paymentRepository = static::getContainer()->get(PaymentRepository::class);
|
||||
|
||||
$client->jsonRequest(
|
||||
'POST', '/api/order/create', [
|
||||
'POST',
|
||||
'/api/order/create',
|
||||
[
|
||||
'shop' => [
|
||||
'uuid' => (String)$shop->getUuid()
|
||||
'uuid' => (string)$shop->getUuid()
|
||||
],
|
||||
'type' => 2,
|
||||
'shipping' => [
|
||||
@ -211,7 +223,8 @@ class CreateTest extends WebTestCase
|
||||
]
|
||||
]
|
||||
]
|
||||
], ['HTTP_apiKey' => $shop->getApiKey()]
|
||||
],
|
||||
['HTTP_apiKey' => $shop->getApiKey()]
|
||||
);
|
||||
|
||||
self::assertSame(200, $client->getResponse()->getStatusCode());
|
||||
@ -219,9 +232,12 @@ class CreateTest extends WebTestCase
|
||||
$data = json_decode($client->getResponse()->getContent(), true);
|
||||
|
||||
$client->jsonRequest(
|
||||
'POST', '/api/order/getonebyuuid', [
|
||||
'POST',
|
||||
'/api/order/getonebyuuid',
|
||||
[
|
||||
'uuid' => $data['uuid'],
|
||||
], ['HTTP_apiKey' => $shop->getApiKey()]
|
||||
],
|
||||
['HTTP_apiKey' => $shop->getApiKey()]
|
||||
);
|
||||
|
||||
$data = json_decode($client->getResponse()->getContent(), true);
|
||||
@ -238,13 +254,16 @@ class CreateTest extends WebTestCase
|
||||
self::assertSame(200, $client->getResponse()->getStatusCode());
|
||||
|
||||
/**
|
||||
* @var JobRepository $jobs
|
||||
* @var JobRepository $jobs
|
||||
*/
|
||||
$jobs = static::getContainer()->get(JobRepository::class);
|
||||
|
||||
$client->jsonRequest(
|
||||
'GET', '/api/order/action/create/' . $data['uuid'], [
|
||||
], ['HTTP_apiKey' => $shop->getApiKey()]
|
||||
'GET',
|
||||
'/api/order/action/create/' . $data['uuid'],
|
||||
[
|
||||
],
|
||||
['HTTP_apiKey' => $shop->getApiKey()]
|
||||
);
|
||||
|
||||
self::assertCount(1, $jobs->findBy(['data.order' => $data['uuid']]));
|
||||
|
||||
@ -211,8 +211,6 @@ class CreateOrderTest extends WebTestCase
|
||||
self::assertSame(200, $client->getResponse()->getStatusCode());
|
||||
|
||||
$data = json_decode($client->getResponse()->getContent(), true);
|
||||
var_dump($data['allTaxes']);
|
||||
var_dump($data['payment']);
|
||||
self::assertSame(9520, $data['gross']);
|
||||
|
||||
$client->jsonRequest(
|
||||
@ -227,8 +225,6 @@ class CreateOrderTest extends WebTestCase
|
||||
self::assertSame(200, $client->getResponse()->getStatusCode());
|
||||
$data = json_decode($client->getResponse()->getContent(), true);
|
||||
|
||||
var_dump($data['allTaxes']);
|
||||
var_dump($data['payment']);
|
||||
self::assertSame(9520, $data['gross']);
|
||||
|
||||
$jobs = static::getContainer()->get(JobRepository::class);
|
||||
|
||||
@ -110,6 +110,13 @@ trait RefreshDatabaseTrait
|
||||
$shop->setParcelCancelationNumberPattern('STS-{{ "now"|date("Ym") }}-{{number}}');
|
||||
$shop->setParcelInvoiceNumberPattern('STR-{{ "now"|date("Ym") }}-{{number}}');
|
||||
|
||||
$shop->setSenderZip(12345);
|
||||
$shop->setSenderCity("ShopMusterOrt");
|
||||
$shop->setSenderCompany("ShopMusterCompany");
|
||||
$shop->setSenderLId("ShopMusterLeitwegId");
|
||||
$shop->setSenderIban("ShopMusterIban");
|
||||
$shop->setSenderEmail("ShopMusterEmail");
|
||||
|
||||
$doc->persist($shop);
|
||||
$doc->flush();
|
||||
$doc->clear();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user