This commit is contained in:
Thomas Peterson 2024-12-12 22:31:17 +01:00
parent d74cadada6
commit 1706480be9
102 changed files with 518 additions and 216 deletions

View File

@ -17,7 +17,7 @@ NO_COLOR:=\033[0m
# Tool CLI config # Tool CLI config
PHPUNIT_CMD=php -dxdebug.mode=off vendor/bin/phpunit PHPUNIT_CMD=php -dxdebug.mode=off vendor/bin/phpunit
PHPUNIT_CMD_XDEBUG=php vendor/bin/phpunit PHPUNIT_CMD_XDEBUG=php -dxdebug.client_host=172.30.171.37 vendor/bin/phpunit
PHPUNIT_ARGS= PHPUNIT_ARGS=
PHPUNIT_FILES= PHPUNIT_FILES=
PHPSTAN_CMD=php -d xdebug.mode=off -d memory_limit=-1 vendor/bin/phpstan analyse PHPSTAN_CMD=php -d xdebug.mode=off -d memory_limit=-1 vendor/bin/phpstan analyse

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"65e33ea000494a7ca8964539d5f4b421","collectionName":"README","type":"collection"} {"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"25d0bb7069154368a570eea7f471d07c","collectionName":"README","type":"collection"}

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"1d5bf9acbe2d458590e2da2f27d2a7d4","collectionName":"system.version","type":"collection"} {"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"8d5d93c9b0a944fb8b8759bfcc5109fb","collectionName":"system.version","type":"collection"}

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"51ad655db34e4d6eb68c822614f8559e","collectionName":"Account","type":"collection"} {"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"f464b32f1e91419e8ae82be5a7cbd8c5","collectionName":"Account","type":"collection"}

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"5b3a1e45a6254cb9a5a46c32cfecc840","collectionName":"Cms","type":"collection"} {"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"983820c5ed1e48e28874ed11b66dfe94","collectionName":"Cms","type":"collection"}

Binary file not shown.

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"acdd2b4e9f1147b8bb4c5710a2316a2d","collectionName":"Contact","type":"collection"} {"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"eece19a303f548c5bd9c12a50e739f3c","collectionName":"Contact","type":"collection"}

Binary file not shown.

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"e6be3aa895d84f2ca24c571bb13d716c","collectionName":"ContactAddress","type":"collection"} {"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"ed18d08156a740d0b1aa02cc8b500c07","collectionName":"ContactAddress","type":"collection"}

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"57b4a960fb574ad484f8337af8ee4a55","collectionName":"Country","type":"collection"} {"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"91e00f3e1dd646c4b231d05acdc53b04","collectionName":"Country","type":"collection"}

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"31d4b37c92924b6196ba63d24ebfa7a6","collectionName":"Gatewaysettings","type":"collection"} {"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"3d6c548cdf68427c8fa6d7146424ceef","collectionName":"Gatewaysettings","type":"collection"}

BIN
dev_db/dump/psc/Help.bson Normal file

Binary file not shown.

View File

@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"2ced64fb6bbc4cfa8c6adaa0bb8ef82e","collectionName":"Help","type":"collection"}

Binary file not shown.

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"8453fbf618824705a0fda188051fa81f","collectionName":"Instance","type":"collection"} {"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"42ae432455e74b418457b4083beafa93","collectionName":"Instance","type":"collection"}

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"eb638af5c31d49df8f08c1dd36bca550","collectionName":"Job","type":"collection"} {"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"557b49f2e6804dd18b525151cfbae14d","collectionName":"Job","type":"collection"}

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"a0b27cef0dd846c6bf5674322756a473","collectionName":"JobLog","type":"collection"} {"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"219060951c964fbcbf6429149afede7c","collectionName":"JobLog","type":"collection"}

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"603402e4459d44d2b91799395f97f3f4","collectionName":"LayouterSession","type":"collection"} {"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"0b1e008725e2456ea3468b1cfd82c6ec","collectionName":"LayouterSession","type":"collection"}

Binary file not shown.

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"490d127fffd44750b207cb4f230d105f","collectionName":"LogEntry","type":"collection"} {"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"c23546ac53f54d8389c8081e07fb1bdd","collectionName":"LogEntry","type":"collection"}

Binary file not shown.

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"e92802f5bd7e43ba809e2ef27127f3da","collectionName":"Media","type":"collection"} {"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"52c1f9fbbc1d48b18ef1edfb677b2f20","collectionName":"Media","type":"collection"}

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"552dfe44edff4c12a52fca743950b161","collectionName":"Media_Folder","type":"collection"} {"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"5ebdfba1599e4b119e0095a0a282d6a3","collectionName":"Media_Folder","type":"collection"}

Binary file not shown.

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"69f1d56d8b8b4ed1a15798c68c47301b","collectionName":"Migration","type":"collection"} {"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"212b049d422e45d8b57b289d52dbb6e8","collectionName":"Migration","type":"collection"}

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"90ed36a61814457eab59aeb52e91e3d3","collectionName":"Motiv","type":"collection"} {"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"cc073dd7ac9b43748f0124eb57ed1c30","collectionName":"Motiv","type":"collection"}

Binary file not shown.

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"3134138d714e47e2ab2cc62c9bb3ceb0","collectionName":"Order","type":"collection"} {"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"b9fc4bb857e74cb7a38071e4c599f013","collectionName":"Order","type":"collection"}

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"15366185b74945228b73eb7c04059529","collectionName":"Paper","type":"collection"} {"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"463c25aa7e92426c9df6c8ddb4053875","collectionName":"Paper","type":"collection"}

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"2010a42a19b84a359b5c9c61635e71fd","collectionName":"Payment","type":"collection"} {"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"f38f0c14fb86455ebbf7c7f741000e2c","collectionName":"Payment","type":"collection"}

Binary file not shown.

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"6c290b1a91c74646b8243154a78f284e","collectionName":"Plugin","type":"collection"} {"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"33a17bfa5c304f108dc63b959b4e25fe","collectionName":"Plugin","type":"collection"}

Binary file not shown.

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"826cb4ea5c97428c8894003f2bef130c","collectionName":"Position","type":"collection"} {"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"4adc80ea968845348f92696289f06424","collectionName":"Position","type":"collection"}

Binary file not shown.

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"6b11fb2187d042248162bc54af483a10","collectionName":"Product","type":"collection"} {"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"ed17efafa6f140bea24981a1f9413756","collectionName":"Product","type":"collection"}

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"7eac3833a7454b1988bc17b5baf24b16","collectionName":"Productgroup","type":"collection"} {"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"bd525258db1f44a09257ac6c791db3f5","collectionName":"Productgroup","type":"collection"}

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"c53009b975f64e2395b3b00ceeeaf318","collectionName":"Queue","type":"collection"} {"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"64f1023c5bec4674a66e4d37464064ac","collectionName":"Queue","type":"collection"}

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"9b87b6a933d7496dab9a59190b728035","collectionName":"Route","type":"collection"} {"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"d6642e32eb6346dd883cb237efdbc616","collectionName":"Route","type":"collection"}

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"3c5c2be2d4c342c4a803842e1366239e","collectionName":"Shipping","type":"collection"} {"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"a1282f26de2c4cdca6830c33514bae67","collectionName":"Shipping","type":"collection"}

Binary file not shown.

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"076a1f0f5d6146dda4bb4bb48011608e","collectionName":"Shop","type":"collection"} {"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"79f109a7361849fead2c9234f4f84530","collectionName":"Shop","type":"collection"}

Binary file not shown.

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"c6d5348e438d4ed2a9a690a0aa85fbcb","collectionName":"ShopFormular","type":"collection"} {"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"2868de38934a493c99dac48e5bf1f78c","collectionName":"ShopFormular","type":"collection"}

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"16f50bcb95564f3787391205d81185f2","collectionName":"Status","type":"collection"} {"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"50aedc2e4ce34a729e508ab2be053b95","collectionName":"Status","type":"collection"}

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"90f18d7fb4714e7f94b78a045cf6f817","collectionName":"Tax","type":"collection"} {"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"eec5a311568b4f3f9bd1da160d704daa","collectionName":"Tax","type":"collection"}

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"d1b0b597d50c429eae2e49ce552eaec6","collectionName":"accountObj_history","type":"collection"} {"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"bdf220bb034c4046b373081dece9cfe4","collectionName":"accountObj_history","type":"collection"}

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"aed61dd69b70420693c46b88c3d37e73","collectionName":"contactObj_history","type":"collection"} {"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"441cf82e68264d7199e142725a0ca41d","collectionName":"contactObj_history","type":"collection"}

Binary file not shown.

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"902d308c9497459ba96df5688319f4ca","collectionName":"payment_history","type":"collection"} {"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"a1fc89c800424d3caf2001c6dfe8f18c","collectionName":"payment_history","type":"collection"}

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"069dd51198154026b4420f90a7adf985","collectionName":"producktgroupObj_history","type":"collection"} {"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"98a1c5a8e4f8426e8ed6a236436e9a1a","collectionName":"producktgroupObj_history","type":"collection"}

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"c2d028460e5b465387e7b0e45e4d81a8","collectionName":"productObj_history","type":"collection"} {"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"e0d1903ca6e241c8b6047b322e3769cf","collectionName":"productObj_history","type":"collection"}

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"0add9f01539640b0a05d7b06f953e3b7","collectionName":"shipping_history","type":"collection"} {"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"611ff1699e684d1c86c4918c4997d69d","collectionName":"shipping_history","type":"collection"}

Binary file not shown.

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"b95bc48ff4a7416bbef72dd91399792a","collectionName":"shopObj_history","type":"collection"} {"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"c2ca4e26ee1f403c9d0518eda35d6bb6","collectionName":"shopObj_history","type":"collection"}

Binary file not shown.

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"274bbed790314b8096589f7d51b13e02","collectionName":"Contact","type":"collection"} {"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"959fc883790046bdabb6586d31a3e3e7","collectionName":"Contact","type":"collection"}

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"769590c1aa334446b98a8c888cd2f96a","collectionName":"Country","type":"collection"} {"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"364cd5bd6cc146f4a3d6fea9e0e75594","collectionName":"Country","type":"collection"}

Binary file not shown.

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"f2c67e014f25428c823e0d2c037581cb","collectionName":"Instance","type":"collection"} {"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"4348131fe7254f3b82df1f84cf381d6c","collectionName":"Instance","type":"collection"}

Binary file not shown.

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"1056738e00f5449896d1a0da6c071d71","collectionName":"Job","type":"collection"} {"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"d3f956ef489a442e9520d188607d68c8","collectionName":"Job","type":"collection"}

Binary file not shown.

View File

@ -1 +0,0 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"f427d4d30f65441eaf79a1e0f3296fd3","collectionName":"Media","type":"collection"}

Binary file not shown.

View File

@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"2e65b276146b4d4fb23d14c539b0ab95","collectionName":"Order","type":"collection"}

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"b0d4bd99700747fc9a2d88584f170fe1","collectionName":"Plugin","type":"collection"} {"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"3ffd9cb7103f431fa6e291b51560fa7a","collectionName":"Plugin","type":"collection"}

Binary file not shown.

View File

@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"f3f8f7222f644238813897749bdb2cce","collectionName":"Position","type":"collection"}

Binary file not shown.

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"7cc0ff7666b04186b877b282c7390574","collectionName":"Shop","type":"collection"} {"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"08d26904d6fc4fcca1dfce1fc939c185","collectionName":"Shop","type":"collection"}

View File

@ -535,10 +535,9 @@ abstract class Base
public function getTaxesSum() public function getTaxesSum()
{ {
$sum = 0; $sum = 0;
foreach ($this->taxes as $tax) { foreach ($this->allTaxes as $tax) {
$sum = $sum + $tax->getValue(); $sum = $sum + $tax->getCalculatedAmount();
} }
return $sum; return $sum;
} }
@ -556,13 +555,24 @@ abstract class Base
*/ */
public function setTaxes($taxes) public function setTaxes($taxes)
{ {
$this->allTaxes = $taxes;
$this->taxes = $taxes; $this->taxes = $taxes;
} }
public function getSurcharges(): int
{
$price = 0;
$price += $this->payment->getCalcPrice()->net;
$price += $this->shipping->getCalcPrice()->net;
return $price;
}
/** /**
* @param Tax $tax * @param Tax $tax
*/ */
public function addTax($tax) public function addTax(Tax $tax)
{ {
$this->allTaxes[] = $tax; $this->allTaxes[] = $tax;
@ -570,14 +580,15 @@ abstract class Base
$exists = false; $exists = false;
foreach ($this->taxes as $taxEntry) { foreach ($this->taxes as $taxEntry) {
if ($taxEntry->getName() == $tax->getName()) { if ($taxEntry->getName() == $tax->getName()) {
$taxEntry->setValue($taxEntry->getValue() + $tax->getValue()); $taxEntry->setCalculatedAmount($taxEntry->getCalculatedAmount() + $tax->getCalculatedAmount());
$taxEntry->setBasisAmount($taxEntry->getBasisAmount() + $tax->getBasisAmount());
$tmp[] = $taxEntry; $tmp[] = $taxEntry;
$exists = true; $exists = true;
} }
} }
if (!$exists) { if (!$exists) {
$tmp[] = $tax; $tmp[] = clone $tax;
} }
$this->taxes = $tmp; $this->taxes = $tmp;
} }

View File

@ -4,7 +4,8 @@ namespace PSC\Shop\OrderBundle\Model\Order;
use OpenApi\Attributes as OA; use OpenApi\Attributes as OA;
enum TaxEnum: int { enum TaxEnum: int
{
case PAYMENT = 1; case PAYMENT = 1;
case SHIPPING = 2; case SHIPPING = 2;
case POSITION = 3; case POSITION = 3;
@ -28,23 +29,37 @@ class Tax
private int $name; private int $name;
#[OA\Property(type: 'integer')] #[OA\Property(type: 'integer')]
private int $value; private int $basisAmount;
public function __construct(int $name = 0, int $value = 0, TaxEnum $type = TaxEnum::POSITION) #[OA\Property(type: 'integer')]
private int $calculatedAmount;
public function __construct(int $name = 0, int $basisAmount = 0, int $calculatedAmount = 0, TaxEnum $type = TaxEnum::POSITION)
{ {
$this->name = $name; $this->name = $name;
$this->type = $type; $this->type = $type;
$this->value = $value; $this->basisAmount = $basisAmount;
$this->calculatedAmount = $calculatedAmount;
} }
public function getValue(): int public function getCalculatedAmount(): int
{ {
return $this->value; return $this->calculatedAmount;
} }
public function setValue(int $value): void public function setCalculatedAmount(int $calculatedAmount): void
{ {
$this->value = $value; $this->calculatedAmount = $calculatedAmount;
}
public function getBasisAmount(): int
{
return $this->basisAmount;
}
public function setBasisAmount(int $basisAmount): void
{
$this->basisAmount = $basisAmount;
} }
public function getName(): int public function getName(): int

View File

@ -49,11 +49,15 @@ class Calc
$order->addTax($order->getPayment()->getCalcPrice()->tax); $order->addTax($order->getPayment()->getCalcPrice()->tax);
$this->shippingTransformer->parseModel($order->getShipping()); $this->shippingTransformer->parseModel($order->getShipping());
$this->priceShipping->getPrice($order->getShipping(), $order->getNet(), $order->getWeight(), (string)$order->getDeliveryAddress()->getCountry(), (int)$order->getDeliveryAddress()->getZip()); $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')); $priceNet = $priceNet->plus(Money::ofMinor($order->getShipping()->getCalcPrice()->net, 'EUR'));
$priceVat = $priceVat->plus(Money::ofMinor($order->getShipping()->getCalcPrice()->vat, 'EUR')); $priceVat = $priceVat->plus(Money::ofMinor($order->getShipping()->getCalcPrice()->vat, 'EUR'));
$priceGross = $priceGross->plus(Money::ofMinor($order->getShipping()->getCalcPrice()->gross, 'EUR')); $priceGross = $priceGross->plus(Money::ofMinor($order->getShipping()->getCalcPrice()->gross, 'EUR'));
$order->setShippingCosts(Money::ofMinor($order->getShipping()->getCalcPrice()->net, 'EUR')->getMinorAmount()->toInt()); $order->setShippingCosts(Money::ofMinor($order->getShipping()->getCalcPrice()->net, 'EUR')->getMinorAmount()->toInt());
$order->addTax($order->getShipping()->getCalcPrice()->tax); $order->addTax($order->getShipping()->getCalcPrice()->tax);
var_dump($order->getAllTaxes());
var_dump("2");
foreach ($order->getPositions() as $position) { foreach ($order->getPositions() as $position) {
$position->getProduct()->setShopUuid($order->getShop()->getUuid()); $position->getProduct()->setShopUuid($order->getShop()->getUuid());
if ($this->productTypeRegistry->getProductType($position->getProduct()->getSpecialProductTypeObject()->getTyp())) { if ($this->productTypeRegistry->getProductType($position->getProduct()->getSpecialProductTypeObject()->getTyp())) {
@ -72,7 +76,8 @@ class Calc
$priceGross = $priceGross->plus(Money::ofMinor($position->getPrice()->getAllGross(), 'EUR')); $priceGross = $priceGross->plus(Money::ofMinor($position->getPrice()->getAllGross(), 'EUR'));
$order->addTax($position->getPrice()->tax); $order->addTax($position->getPrice()->tax);
} }
var_dump($order->getAllTaxes());
var_dump("test");
$order->setNet($priceNet->getMinorAmount()->toInt()); $order->setNet($priceNet->getMinorAmount()->toInt());
$order->setVat($priceVat->getMinorAmount()->toInt()); $order->setVat($priceVat->getMinorAmount()->toInt());
$order->setGross($priceGross->getMinorAmount()->toInt()); $order->setGross($priceGross->getMinorAmount()->toInt());

View File

@ -283,10 +283,6 @@ class Order
} }
/**
* @param $uuid
* @return \PSC\Shop\OrderBundle\Model\Order
*/
public function getOrderByUuid($uuid, $load_only_order = false): PSCBase public function getOrderByUuid($uuid, $load_only_order = false): PSCBase
{ {
$this->load_only_order = $load_only_order; $this->load_only_order = $load_only_order;

View File

@ -65,12 +65,12 @@ class Order extends Base
$order->setPaymentRef((string)$orderDoc->getPaymentRef()); $order->setPaymentRef((string)$orderDoc->getPaymentRef());
$order->setPaymentGateway((string)$orderDoc->getPaymentGateway()); $order->setPaymentGateway((string)$orderDoc->getPaymentGateway());
$order->setTaxes([]); $order->setTaxes([]);
foreach ($orderEntity->getMwertAlle() as $row) { foreach ($orderEntity->getMwertAlle() as $row) {
if (isset($row['name'])) { if (isset($row['name'])) {
$order->addTax(new Tax($row['name'], $row['value'], TaxEnum::tryFrom($row['type']))); $order->addTax(new Tax($row['name'], $row['basis'] ?? 0, $row['value'], TaxEnum::tryFrom($row['type'])));
} }
} }
$this->contactTransformer->fromDb($order->getContact(), $orderEntity->getContact()); $this->contactTransformer->fromDb($order->getContact(), $orderEntity->getContact());
if ($orderEntity->getAccount()) { if ($orderEntity->getAccount()) {
$this->accountTransformer->fromDb($order->getAccount(), $orderEntity->getAccount()); $this->accountTransformer->fromDb($order->getAccount(), $orderEntity->getAccount());
@ -146,7 +146,7 @@ class Order extends Base
$mwertAlle = []; $mwertAlle = [];
foreach ($order->getAllTaxes() as $tax) { foreach ($order->getAllTaxes() as $tax) {
$mwertAlle[] = ['name' => $tax->getName(), 'value' => $tax->getValue(), 'type' => $tax->getType()->value]; $mwertAlle[] = ['name' => $tax->getName(), 'basis' => $tax->getBasisAmount(), 'value' => $tax->getCalculatedAmount(), 'type' => $tax->getType()->value];
} }
$orderEntity->setMwertAlle(json_encode($mwertAlle)); $orderEntity->setMwertAlle(json_encode($mwertAlle));
$orderEntity->setVersion(1); $orderEntity->setVersion(1);

View File

@ -88,7 +88,6 @@ class Position extends Base
*/ */
if ($this->productTypeRegistry->getProductType($position->getProduct()->getSpecialProductTypeObject()->getTyp())) { if ($this->productTypeRegistry->getProductType($position->getProduct()->getSpecialProductTypeObject()->getTyp())) {
$specialProductTransformer = $this->productTypeRegistry->getProductType($position->getProduct()->getSpecialProductTypeObject()->getTyp())->getPositionProductTransformer(); $specialProductTransformer = $this->productTypeRegistry->getProductType($position->getProduct()->getSpecialProductTypeObject()->getTyp())->getPositionProductTransformer();
$specialProductTransformer->toDb($position, $positionEntity, $positionDoc); $specialProductTransformer->toDb($position, $positionEntity, $positionDoc);
} else { } else {
$position->getProduct()->setSpecialProductTypeObject(new DummyProductTypeObject()); $position->getProduct()->setSpecialProductTypeObject(new DummyProductTypeObject());
@ -105,7 +104,8 @@ class Position extends Base
$position->setProduct($this->productHydrate->hydrateToModel($pos->getProduct())); $position->setProduct($this->productHydrate->hydrateToModel($pos->getProduct()));
$tax = new Tax(); $tax = new Tax();
$tax->setName((int)$pos->getProduct()->getMwert() * 100); $tax->setName((int)$pos->getProduct()->getMwert() * 100);
$tax->setValue((int)$pos->getProduct()->getMwert() * 100); $tax->setBasisAmount((int)$pos->getPriceAllNetto() * 100);
$tax->setCalculatedAmount((int)$pos->getPriceAllSteuer() * 100);
$position->getPrice()->setTax($tax); $position->getPrice()->setTax($tax);
} else { } else {

View File

@ -11,25 +11,25 @@ class Payment
* @OA\Property(type="integer") * @OA\Property(type="integer")
*/ */
private int $uid = 0; private int $uid = 0;
/** /**
* @OA\Property(type="string") * @OA\Property(type="string")
*/ */
private string $title; private string $title;
/** /**
* @OA\Property(type="string") * @OA\Property(type="string")
*/ */
private string $description; private string $description;
/** /**
* @OA\Property(type="integer") * @OA\Property(type="integer")
*/ */
private int $price = 0; private int $price = 0;
/** /**
* @OA\Property(type="boolean") * @OA\Property(type="boolean")
*/ */
private bool $percent = false; private bool $percent = false;
/** /**
* @OA\Property(type="integer") * @OA\Property(type="integer")
*/ */
private int $taxClass = 190; private int $taxClass = 190;
/** /**
@ -37,6 +37,11 @@ class Payment
*/ */
private Price $calcPrice; private Price $calcPrice;
public function construct()
{
$this->calcPrice = new Price();
}
public function setUid(int $uid): void public function setUid(int $uid): void
{ {
$this->uid = $uid; $this->uid = $uid;

View File

@ -20,4 +20,8 @@ class Price
#[OA\Property(ref: new Model(type: Tax::class))] #[OA\Property(ref: new Model(type: Tax::class))]
public Tax $tax; public Tax $tax;
public function __construct()
{
$this->tax = new Tax();
}
} }

View File

@ -8,15 +8,15 @@ use PSC\Shop\OrderBundle\Model\Order\Tax;
use PSC\Shop\OrderBundle\Model\Order\TaxEnum; use PSC\Shop\OrderBundle\Model\Order\TaxEnum;
use PSC\Shop\PaymentBundle\Model\Payment; use PSC\Shop\PaymentBundle\Model\Payment;
class Price { class Price
{
private Payment $payment; private Payment $payment;
private int $net; private int $net;
private string $country; private string $country;
private int $weight; private int $weight;
private int $zip; private int $zip;
public function getPrice(Payment $payment, int $net = 0, int $weight = 0, string $country = 'de', int $zip = 0): \PSC\Shop\PaymentBundle\Model\Price public function getPrice(Payment $payment, int $net = 0, int $weight = 0, string $country = 'de', int $zip = 0): \PSC\Shop\PaymentBundle\Model\Price
{ {
$this->payment = $payment; $this->payment = $payment;
$this->net = $net; $this->net = $net;
@ -36,7 +36,7 @@ class Price {
$price->net = $money->getMinorAmount()->toInt(); $price->net = $money->getMinorAmount()->toInt();
$price->vat = $money->toRational()->dividedBy(100)->multipliedBy($this->payment->getTaxClass())->to($money->getContext(), RoundingMode::UP)->getMinorAmount()->toInt(); $price->vat = $money->toRational()->dividedBy(100)->multipliedBy($this->payment->getTaxClass())->to($money->getContext(), RoundingMode::UP)->getMinorAmount()->toInt();
$price->gross = $price->net + $price->vat; $price->gross = $price->net + $price->vat;
$price->tax = new Tax($this->payment->getTaxClass()*100, $price->vat, TaxEnum::PAYMENT); $price->tax = new Tax($this->payment->getTaxClass() * 100, $price->net, $price->vat, TaxEnum::PAYMENT);
$this->payment->setCalcPrice($price); $this->payment->setCalcPrice($price);
return $price; return $price;

View File

@ -26,7 +26,7 @@ class Payment
public function toDb(\PSC\Shop\PaymentBundle\Model\Payment $payment, Order $orderEntity): void public function toDb(\PSC\Shop\PaymentBundle\Model\Payment $payment, Order $orderEntity): void
{ {
$paymentEntity = $this->paymentRepository->findOneBy(['uid' => $payment->getUid()]); $paymentEntity = $this->paymentRepository->findOneBy(['uid' => $payment->getUid()]);
if($paymentEntity) { if ($paymentEntity) {
$orderEntity->setPaymentType($paymentEntity); $orderEntity->setPaymentType($paymentEntity);
} }
} }
@ -37,20 +37,20 @@ class Payment
$payment->setTitle((string)$paymentEntity->getTitle()); $payment->setTitle((string)$paymentEntity->getTitle());
$payment->setTaxClass((int)$paymentEntity->getTaxClass()); $payment->setTaxClass((int)$paymentEntity->getTaxClass());
$payment->setDescription((string)$paymentEntity->getDescription()); $payment->setDescription((string)$paymentEntity->getDescription());
$payment->setPrice((int)($paymentEntity->getPrice()*100)); $payment->setPrice((int)($paymentEntity->getPrice() * 100));
$price = new Price(); $price = new Price();
$money = Money::ofMinor($payment->getPrice(), 'EUR'); $money = Money::ofMinor($payment->getPrice(), 'EUR');
$price->net = $money->getMinorAmount()->toInt(); $price->net = $money->getMinorAmount()->toInt();
$price->vat = $money->toRational()->dividedBy(100)->multipliedBy($payment->getTaxClass())->to($money->getContext(), RoundingMode::UP)->getMinorAmount()->toInt(); $price->vat = $money->toRational()->dividedBy(100)->multipliedBy($payment->getTaxClass())->to($money->getContext(), RoundingMode::UP)->getMinorAmount()->toInt();
$price->gross = $price->net + $price->vat; $price->gross = $price->net + $price->vat;
$price->tax = new Tax($payment->getTaxClass()*100, $price->vat, TaxEnum::PAYMENT); $price->tax = new Tax($payment->getTaxClass() * 100, $price->net, $price->vat, TaxEnum::PAYMENT);
$payment->setCalcPrice($price); $payment->setCalcPrice($price);
} }
public function parseModel(\PSC\Shop\PaymentBundle\Model\Payment $payment): void public function parseModel(\PSC\Shop\PaymentBundle\Model\Payment $payment): void
{ {
if($payment->getUid()) { if ($payment->getUid()) {
$paymentEntity = $this->paymentRepository->findOneBy(['uid' => $payment->getUid()]); $paymentEntity = $this->paymentRepository->findOneBy(['uid' => $payment->getUid()]);
$this->fromDb($payment, $paymentEntity); $this->fromDb($payment, $paymentEntity);

View File

@ -8,6 +8,7 @@ use PSC\Component\ApiBundle\Dto\Error\NotFound;
use PSC\Shop\EntityBundle\Entity\Product; use PSC\Shop\EntityBundle\Entity\Product;
use PSC\Shop\ProductBundle\Dto\Product\GetFormAsJson\Output; use PSC\Shop\ProductBundle\Dto\Product\GetFormAsJson\Output;
use PSC\Shop\ProductBundle\Hydrate\Product as PSCProduct; use PSC\Shop\ProductBundle\Hydrate\Product as PSCProduct;
use PSC\Shop\ProductBundle\Interfaces\ICalcNeedContact;
use PSC\Shop\ProductBundle\Interfaces\IProducerHydrateModel; use PSC\Shop\ProductBundle\Interfaces\IProducerHydrateModel;
use PSC\Shop\ProductBundle\Interfaces\IUiProducer; use PSC\Shop\ProductBundle\Interfaces\IUiProducer;
use PSC\System\PluginBundle\Service\ProductType; use PSC\System\PluginBundle\Service\ProductType;
@ -52,21 +53,25 @@ class GetFormAsJson extends AbstractController
$productModel = $this->productHydrate->hydrateToModel($product); $productModel = $this->productHydrate->hydrateToModel($product);
$producer = $productObj->getProducer(); $producer = $productObj->getProducer();
if($producer instanceof IProducerHydrateModel) { if ($producer instanceof IProducerHydrateModel) {
$producDoc = $this->documentManager->getRepository(\PSC\Shop\EntityBundle\Document\Product::class)->findOneBy(['uid' => $product->getUID()]); $producDoc = $this->documentManager->getRepository(\PSC\Shop\EntityBundle\Document\Product::class)->findOneBy(['uid' => $product->getUID()]);
if($producDoc) { if ($producDoc) {
$producer->getProductTransformer()->fromDb($productModel, $product, $producDoc); $producer->getProductTransformer()->fromDb($productModel, $product, $producDoc);
}else{ } else {
$producer->getProductTransformer()->fromDb($productModel, $product, new \PSC\Shop\EntityBundle\Document\Product()); $producer->getProductTransformer()->fromDb($productModel, $product, new \PSC\Shop\EntityBundle\Document\Product());
} }
} }
if ($producer instanceof ICalcNeedContact) {
$producer->setContact(null);
}
$producer->setProduct($productModel); $producer->setProduct($productModel);
$producer->setParams((array)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) {
$output->uiJsonForm = $producer->getUiJsonForm(); $output->uiJsonForm = $producer->getUiJsonForm();
} }
$output->price = $producer->getPrice(); $output->price = $producer->getPrice();

View File

@ -1,4 +1,5 @@
<?php <?php
namespace PSC\Shop\ProductBundle\Producer; namespace PSC\Shop\ProductBundle\Producer;
use Brick\Math\RoundingMode; use Brick\Math\RoundingMode;
@ -17,7 +18,6 @@ use PSC\System\SettingsBundle\Service\Tax;
class Producer implements IUiProducer, IProducerHydrateModel class Producer implements IUiProducer, IProducerHydrateModel
{ {
public function __construct(private readonly EntityManagerInterface $entityManager, private readonly Tax $taxService) public function __construct(private readonly EntityManagerInterface $entityManager, private readonly Tax $taxService)
{ {
} }
@ -64,8 +64,8 @@ class Producer implements IUiProducer, IProducerHydrateModel
'required' => ['count', 'net'] 'required' => ['count', 'net']
]; ];
foreach($this->taxService->getTaxes() as $tax) { foreach ($this->taxService->getTaxes() as $tax) {
$temp['properties']['taxClass']['oneOf'][] = ['title' => $tax->getName(), 'const' => $tax->getValue()*100]; $temp['properties']['taxClass']['oneOf'][] = ['title' => $tax->getName(), 'const' => $tax->getValue() * 100];
} }
return $temp; return $temp;
@ -73,16 +73,16 @@ class Producer implements IUiProducer, IProducerHydrateModel
public function setParams(array $params): void public function setParams(array $params): void
{ {
if(isset($params['count'])) { if (isset($params['count'])) {
$this->product->getSpecialProductTypeObject()->setCount($params['count']); $this->product->getSpecialProductTypeObject()->setCount($params['count']);
} }
if(isset($params['net'])) { if (isset($params['net'])) {
$this->product->getSpecialProductTypeObject()->setNet((float)str_replace(',', '.', $params['net'])); $this->product->getSpecialProductTypeObject()->setNet((float)str_replace(',', '.', $params['net']));
} }
if(isset($params['taxClass'])) { if (isset($params['taxClass'])) {
$this->product->getSpecialProductTypeObject()->setTaxClass($params['taxClass']); $this->product->getSpecialProductTypeObject()->setTaxClass($params['taxClass']);
} }
if(isset($params['cent'])) { if (isset($params['cent'])) {
$this->product->getSpecialProductTypeObject()->setCent((bool)$params['cent']); $this->product->getSpecialProductTypeObject()->setCent((bool)$params['cent']);
} }
} }
@ -104,21 +104,21 @@ class Producer implements IUiProducer, IProducerHydrateModel
*/ */
$specProd = $this->product->getSpecialProductTypeObject(); $specProd = $this->product->getSpecialProductTypeObject();
if($specProd->isCent()) { if ($specProd->isCent()) {
$priceObj = Money::ofMinor($specProd->getNet(), 'EUR'); $priceObj = Money::ofMinor($specProd->getNet(), 'EUR');
}else{ } else {
$priceObj = Money::ofMinor($specProd->getNet()*100, 'EUR'); $priceObj = Money::ofMinor($specProd->getNet() * 100, 'EUR');
} }
$price = new Price(); $price = new Price();
$price->setNet($priceObj->getMinorAmount()->toInt()); $price->setNet($priceObj->getMinorAmount()->toInt());
$price->setVat($priceObj->toRational()->dividedBy(100)->multipliedBy($specProd->getTaxClass()/100)->to($priceObj->getContext(), RoundingMode::UP)->getMinorAmount()->toInt()); $price->setVat($priceObj->toRational()->dividedBy(100)->multipliedBy($specProd->getTaxClass() / 100)->to($priceObj->getContext(), RoundingMode::UP)->getMinorAmount()->toInt());
$price->setGross($price->getNet() + $price->getVat()); $price->setGross($price->getNet() + $price->getVat());
$price->setCount($specProd->getCount()); $price->setCount($specProd->getCount());
$price->setAllNet($specProd->getCount() * $price->getNet()); $price->setAllNet($specProd->getCount() * $price->getNet());
$price->setAllVat($specProd->getCount() * $price->getVat()); $price->setAllVat($specProd->getCount() * $price->getVat());
$price->setAllGross($specProd->getCount() * $price->getGross()); $price->setAllGross($specProd->getCount() * $price->getGross());
$price->tax = new \PSC\Shop\OrderBundle\Model\Order\Tax($specProd->getTaxClass(), $specProd->getCount() * $price->getVat(), TaxEnum::POSITION); $price->tax = new \PSC\Shop\OrderBundle\Model\Order\Tax($specProd->getTaxClass(), $price->getAllNet(), $price->getAllVat(), TaxEnum::POSITION);
return $price; return $price;
} }

View File

@ -1,4 +1,5 @@
<?php <?php
namespace PSC\Shop\ProductBundle\Transformer; namespace PSC\Shop\ProductBundle\Transformer;
use PSC\Shop\ProductBundle\Model\ProductSpecialObject; use PSC\Shop\ProductBundle\Model\ProductSpecialObject;
@ -10,7 +11,6 @@ use PSC\System\SettingsBundle\Service\Tax;
class ManuallyPosition implements IPositionTransformer class ManuallyPosition implements IPositionTransformer
{ {
public function __construct(private readonly Tax $taxService) public function __construct(private readonly Tax $taxService)
{ {
} }
@ -18,19 +18,20 @@ class ManuallyPosition implements IPositionTransformer
public function fromDb(\PSC\Shop\OrderBundle\Model\Order\Position $position, Orderpos $posEntity, \PSC\Shop\EntityBundle\Document\Position $posDoc) public function fromDb(\PSC\Shop\OrderBundle\Model\Order\Position $position, Orderpos $posEntity, \PSC\Shop\EntityBundle\Document\Position $posDoc)
{ {
$obj = new ProductSpecialObject(); $obj = new ProductSpecialObject();
if(isset($posDoc->getSpecialProductTypeObject()['count'])) { if (isset($posDoc->getSpecialProductTypeObject()['count'])) {
$obj->setCount($posDoc->getSpecialProductTypeObject()['count']); $obj->setCount($posDoc->getSpecialProductTypeObject()['count']);
} }
if(isset($posDoc->getSpecialProductTypeObject()['net'])) { if (isset($posDoc->getSpecialProductTypeObject()['net'])) {
$obj->setNet($posDoc->getSpecialProductTypeObject()['net']); $obj->setNet($posDoc->getSpecialProductTypeObject()['net']);
} }
if(isset($posDoc->getSpecialProductTypeObject()['cent'])) { if (isset($posDoc->getSpecialProductTypeObject()['cent'])) {
$obj->setCent($posDoc->getSpecialProductTypeObject()['cent']); $obj->setCent($posDoc->getSpecialProductTypeObject()['cent']);
} }
if(isset($posDoc->getSpecialProductTypeObject()['taxClass'])) { if (isset($posDoc->getSpecialProductTypeObject()['taxClass'])) {
$obj->setTaxClass($posDoc->getSpecialProductTypeObject()['taxClass']); $obj->setTaxClass($posDoc->getSpecialProductTypeObject()['taxClass']);
$position->getPrice()->getTax()->setName($posDoc->getSpecialProductTypeObject()['taxClass']); $position->getPrice()->getTax()->setName($posDoc->getSpecialProductTypeObject()['taxClass']);
$position->getPrice()->getTax()->setValue($posDoc->getSpecialProductTypeObject()['taxClass']); $position->getPrice()->getTax()->setBasisAmount($obj->getNet());
$position->getPrice()->getTax()->setCalculatedAmount($posDoc->getSpecialProductTypeObject()['taxClass']);
} }
$position->getProduct()->setSpecialProductTypeObject($obj); $position->getProduct()->setSpecialProductTypeObject($obj);

View File

@ -20,5 +20,9 @@ class Price
#[OA\Property(ref: new Model(type: Tax::class))] #[OA\Property(ref: new Model(type: Tax::class))]
public Tax $tax; public Tax $tax;
public function __construct()
{
$this->tax = new Tax();
}
} }

View File

@ -52,6 +52,11 @@ class Shipping
*/ */
private Price $calcPrice; private Price $calcPrice;
public function __construct()
{
$this->calcPrice = new Price();
}
public function setUid(int $uid): void public function setUid(int $uid): void
{ {
$this->uid = $uid; $this->uid = $uid;

View File

@ -10,14 +10,13 @@ use PSC\Shop\ShippingBundle\Model\Shipping;
class Price class Price
{ {
private Shipping $shipping; private Shipping $shipping;
private int $net; private int $net;
private string $country; private string $country;
private int $weight; private int $weight;
private int $zip; private int $zip;
public function getPrice(\PSC\Shop\ShippingBundle\Model\Shipping $shippingType, int $net = 0, int $weight = 0, string $country = 'de', int $zip = 0): \PSC\Shop\ShippingBundle\Model\Price public function getPrice(\PSC\Shop\ShippingBundle\Model\Shipping $shippingType, int $net = 0, int $weight = 0, string $country = 'de', int $zip = 0): \PSC\Shop\ShippingBundle\Model\Price
{ {
$this->shipping = $shippingType; $this->shipping = $shippingType;
$this->net = $net; $this->net = $net;
@ -32,16 +31,16 @@ class Price
{ {
$price = new \PSC\Shop\ShippingBundle\Model\Price(); $price = new \PSC\Shop\ShippingBundle\Model\Price();
if($this->shipping->getMatrix() != '') { if ($this->shipping->getMatrix() != '') {
$money = $this->calcPriceXML($price); $money = $this->calcPriceXML($price);
}else{ } else {
$money = $this->calcPriceLocal($price); $money = $this->calcPriceLocal($price);
} }
$price->net = $money->getMinorAmount()->toInt(); $price->net = $money->getMinorAmount()->toInt();
$price->vat = $money->toRational()->dividedBy(100)->multipliedBy($this->shipping->getTaxClass())->to($money->getContext(), RoundingMode::UP)->getMinorAmount()->toInt(); $price->vat = $money->toRational()->dividedBy(100)->multipliedBy($this->shipping->getTaxClass())->to($money->getContext(), RoundingMode::UP)->getMinorAmount()->toInt();
$price->gross = $price->net + $price->vat; $price->gross = $price->net + $price->vat;
$price->tax = new Tax($this->shipping->getTaxClass()*100, $money->toRational()->dividedBy(100)->multipliedBy($this->shipping->getTaxClass())->to($money->getContext(), RoundingMode::UP)->getMinorAmount()->toInt(), TaxEnum::SHIPPING); $price->tax = new Tax($this->shipping->getTaxClass() * 100, $price->net, $price->vat, TaxEnum::SHIPPING);
$this->shipping->setCalcPrice($price); $this->shipping->setCalcPrice($price);
return $price; return $price;
} }
@ -50,8 +49,8 @@ class Price
{ {
$money = Money::ofMinor($this->shipping->getPrice(), 'EUR'); $money = Money::ofMinor($this->shipping->getPrice(), 'EUR');
if($this->shipping->getPricePercent() > 0) { if ($this->shipping->getPricePercent() > 0) {
$amount =$this->net / 100 * ($this->shipping->getPricePercent()); $amount = $this->net / 100 * ($this->shipping->getPricePercent());
$money->plus($amount); $money->plus($amount);
} }
return $money; return $money;
@ -66,7 +65,7 @@ class Price
$net = 0; $net = 0;
$country = strtolower($this->country); $country = strtolower($this->country);
if($country == "") { if ($country == "") {
$country = "de"; $country = "de";
} }

View File

@ -13,8 +13,8 @@ class Calc
{ {
$taxes = $order->getTaxes(); $taxes = $order->getTaxes();
usort($taxes, fn (Tax $a, Tax $b) => $a->getValue() < $b->getValue()); usort($taxes, fn (Tax $a, Tax $b) => $a->getCalculatedAmount() < $b->getCalculatedAmount());
if(isset($taxes[0])) { if (isset($taxes[0])) {
$largest = array_shift($taxes); $largest = array_shift($taxes);
} }
$net = 0; $net = 0;
@ -22,11 +22,11 @@ class Calc
$gross = 0; $gross = 0;
$zeroPayment = false; $zeroPayment = false;
$zeroShipping = false; $zeroShipping = false;
foreach($order->getVouchers() as $voucher) { foreach ($order->getVouchers() as $voucher) {
if($voucher->getZeroPayment()) { if ($voucher->getZeroPayment()) {
} }
if($voucher->getValueInCent() > 0) { if ($voucher->getValueInCent() > 0) {
$discount = new Discount(); $discount = new Discount();
$discount->getPrice()->setGross($voucher->getValueInCent()); $discount->getPrice()->setGross($voucher->getValueInCent());
$this->calcMwert($discount->getPrice(), $largest); $this->calcMwert($discount->getPrice(), $largest);
@ -35,7 +35,7 @@ class Calc
$vat += $discount->getPrice()->getVat(); $vat += $discount->getPrice()->getVat();
$gross += $discount->getPrice()->getGross(); $gross += $discount->getPrice()->getGross();
} }
if($voucher->getPercentValue() > 0) { if ($voucher->getPercentValue() > 0) {
$discount = new Discount(); $discount = new Discount();
$discount->getPrice()->setGross(round(($order->getGross() - $gross) / 100 * $voucher->getPercentValue(), 0)); $discount->getPrice()->setGross(round(($order->getGross() - $gross) / 100 * $voucher->getPercentValue(), 0));
$this->calcMwert($discount->getPrice(), $largest); $this->calcMwert($discount->getPrice(), $largest);
@ -53,9 +53,9 @@ class Calc
private function calcMwert(Price $price, ?Tax $tax): void private function calcMwert(Price $price, ?Tax $tax): void
{ {
if($tax != null) { if ($tax != null) {
$price->setNet($price->getGross() / ($tax->getValue() / 10000 + 1)); $price->setNet($price->getGross() / ($tax->getCalculatedAmount() / 10000 + 1));
$price->setVat($price->getGross() - ($price->getGross() / ($tax->getValue() / 10000 + 1))); $price->setVat($price->getGross() - ($price->getGross() / ($tax->getCalculatedAmount() / 10000 + 1)));
} }
} }
} }

View File

@ -81,6 +81,7 @@ class Printing
->setDocumentSellerCommunication("EM", $orderModel->getSenderAddress()->getEmail()) ->setDocumentSellerCommunication("EM", $orderModel->getSenderAddress()->getEmail())
->setDocumentBuyer($orderModel->getInvoiceAddress()->getCompany() . ' ' . $orderModel->getInvoiceAddress()->getFirstname() . ' ' . $orderModel->getInvoiceAddress()->getLastname(), $orderModel->getInvoiceAddress()->getKundenNr()) ->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') ->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) ->addDocumentPaymentMean(ZugferdPaymentMeans::UNTDID_4461_58, null, null, null, null, null, "DE12500105170648489890", null, null, null)
->addDocumentPaymentTermXRechnung("Zahlungsbedingungen", [], [], [], null, null) ->addDocumentPaymentTermXRechnung("Zahlungsbedingungen", [], [], [], null, null)
@ -90,11 +91,24 @@ class Printing
; ;
foreach ($orderModel->getTaxes() as $tax) { foreach ($orderModel->getTaxes() as $tax) {
$document->addDocumentTax("S", "VAT", $tax->getValue() / 100, $tax->getValue() / 100, $tax->getName() / 100); if ($tax->getCalculatedAmount() > 0) {
$document->addDocumentTax("S", "VAT", $tax->getBasisAmount() / 100, $tax->getCalculatedAmount() / 100, $tax->getName() / 100);
}
} }
$document $document
->setDocumentSummation($orderModel->getGross() / 100, $orderModel->getGross() / 100, $orderModel->getPositionsNet() / 100, 20, 0.0, $orderModel->getNet() / 100, $orderModel->getTaxesSum() / 100, null, 0.0); ->setDocumentSummation(
$orderModel->getGross() / 100,
$orderModel->getGross() / 100,
$orderModel->getPositionsNet() / 100,
$orderModel->getSurcharges() / 100,
0.0,
$orderModel->getNet() / 100,
$orderModel->getTaxesSum() / 100,
null,
0.0
);
foreach ($orderModel->getPositions() as $position) { foreach ($orderModel->getPositions() as $position) {
$document $document
@ -107,8 +121,41 @@ class Printing
->setDocumentPositionLineSummation($position->getPrice()->getNet() / 100) ->setDocumentPositionLineSummation($position->getPrice()->getNet() / 100)
; ;
} }
$document
->addDocumentLogisticsServiceCharge("Shippingcost", 20, ['VAT'], [19]); if ($orderModel->getPayment()->getCalcPrice()->net > 0) {
$document
->addDocumentAllowanceCharge(
$orderModel->getPayment()->getCalcPrice()->net / 100,
true,
'S',
'VAT',
$orderModel->getPayment()->getCalcPrice()->tax->getName() / 100,
null,
null,
null,
null,
null,
'CAL',
'PaymentCoast'
);
}
if ($orderModel->getShipping()->getCalcPrice()->net > 0) {
$document
->addDocumentAllowanceCharge(
$orderModel->getShipping()->getCalcPrice()->net / 100,
true,
'S',
'VAT',
$orderModel->getShipping()->getCalcPrice()->tax->getName() / 100,
null,
null,
null,
null,
null,
'SAA',
'ShippingCoast'
);
}
return $document->getContent(); return $document->getContent();
} }

View File

@ -41,8 +41,8 @@ class Barcode extends Node
$compiler->raw( $compiler->raw(
' '
$options = new \PSC\System\SettingsBundle\Barcode\QRGdWithLogoOptions(); $options = new \PSC\System\SettingsBundle\Barcode\QRGdWithLogoOptions();
$options->version = -1; //$options->version = -1;
$options->eccLevel = \chillerlan\QRCode\Common\EccLevel::H; $options->eccLevel = \chillerlan\QRCode\Common\EccLevel::M;
$options->outputType = \chillerlan\QRCode\Output\QROutputInterface::CUSTOM; $options->outputType = \chillerlan\QRCode\Output\QROutputInterface::CUSTOM;
if(isset($_options["logo"]) && $_options["logo"] == true) { if(isset($_options["logo"]) && $_options["logo"] == true) {
$options->logo = $_options["logo"]; $options->logo = $_options["logo"];

View File

@ -91,7 +91,7 @@
<script> <script>
$.post("{{ instanceService.getInstance().formatedSupportUrl }}/apilogin?X-AUTH-TOKEN={{ instanceService.getInstance().supporttoken }}&to=bridge", function(msg){ $.post("{{ instanceService.getInstance().formatedSupportUrl }}/apilogin?X-AUTH-TOKEN={{ instanceService.getInstance().supporttoken }}&to=bridge", function(msg){
if(msg != "") { if(msg != "") {
//$(".swarm").html(msg); $(".swarm").html(msg);
} }
}); });
</script> </script>

View File

@ -0,0 +1,192 @@
<?php
namespace Plugins\System\PSC\XmlCalc\Api;
use PSC\Shop\ContactBundle\Model\AccountType;
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 CreateOrderFromExistingProductTest extends WebTestCase
{
use RefreshDatabaseTrait;
public function testCreateOrderContactPersonal(): void
{
$client = static::createClient();
$shopRepository = static::getContainer()->get(ShopRepository::class);
$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' => 'Abholung vor Ort'])->getUid()
],
'payment' => [
'uid' => $paymentRepository->findOneBy(['title' => 'Bar bei Abholung'])->getUid()
],
'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' => [
'uuid' => '01938686-0e4d-7da9-bae3-b2e1b1681f9f',
'title' => 'test XML',
'specialProductTypeObject' => [
'typ' => 6,
'params' => [
'auflage' => 100
],
]
]
]
]
],
['HTTP_apiKey' => $shop->getApiKey()]
);
self::assertSame(200, $client->getResponse()->getStatusCode());
$data = json_decode($client->getResponse()->getContent(), true);
self::assertSame(3094, $data['gross']);
$client->jsonRequest(
'POST',
'/api/order/getonebyuuid',
[
'uuid' => $data['uuid'],
],
['HTTP_apiKey' => $shop->getApiKey()]
);
self::assertSame(200, $client->getResponse()->getStatusCode());
$data = json_decode($client->getResponse()->getContent(), true);
self::assertSame(3094, $data['gross']);
$jobs = static::getContainer()->get(JobRepository::class);
self::assertCount(0, $jobs->findBy(['data.order' => $data['uuid']]));
}
public function testCreateOrderContactCompany(): void
{
$client = static::createClient();
$shopRepository = static::getContainer()->get(ShopRepository::class);
$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' => 'Abholung vor Ort'])->getUid()
],
'payment' => [
'uid' => $paymentRepository->findOneBy(['title' => 'Bar bei Abholung'])->getUid()
],
'contact' => [
'accountType' => AccountType::COMPANY
],
'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' => [
'uuid' => '01938686-0e4d-7da9-bae3-b2e1b1681f9f',
'title' => 'test XML',
'specialProductTypeObject' => [
'typ' => 6,
'params' => [
'auflage' => 100
],
]
]
]
]
],
['HTTP_apiKey' => $shop->getApiKey()]
);
self::assertSame(200, $client->getResponse()->getStatusCode());
$data = json_decode($client->getResponse()->getContent(), true);
self::assertSame(2476, $data['gross']);
$client->jsonRequest(
'POST',
'/api/order/getonebyuuid',
[
'uuid' => $data['uuid'],
],
['HTTP_apiKey' => $shop->getApiKey()]
);
self::assertSame(200, $client->getResponse()->getStatusCode());
$data = json_decode($client->getResponse()->getContent(), true);
self::assertSame(2476, $data['gross']);
$jobs = static::getContainer()->get(JobRepository::class);
self::assertCount(0, $jobs->findBy(['data.order' => $data['uuid']]));
}
}

View File

@ -211,6 +211,8 @@ class CreateOrderTest extends WebTestCase
self::assertSame(200, $client->getResponse()->getStatusCode()); self::assertSame(200, $client->getResponse()->getStatusCode());
$data = json_decode($client->getResponse()->getContent(), true); $data = json_decode($client->getResponse()->getContent(), true);
var_dump($data['allTaxes']);
var_dump($data['payment']);
self::assertSame(9520, $data['gross']); self::assertSame(9520, $data['gross']);
$client->jsonRequest( $client->jsonRequest(
@ -225,6 +227,8 @@ class CreateOrderTest extends WebTestCase
self::assertSame(200, $client->getResponse()->getStatusCode()); self::assertSame(200, $client->getResponse()->getStatusCode());
$data = json_decode($client->getResponse()->getContent(), true); $data = json_decode($client->getResponse()->getContent(), true);
var_dump($data['allTaxes']);
var_dump($data['payment']);
self::assertSame(9520, $data['gross']); self::assertSame(9520, $data['gross']);
$jobs = static::getContainer()->get(JobRepository::class); $jobs = static::getContainer()->get(JobRepository::class);

View File

@ -1,4 +1,5 @@
<?php <?php
namespace Plugin\Custom\PSC\WMD_API\Producer; namespace Plugin\Custom\PSC\WMD_API\Producer;
use Brick\Math\RoundingMode; use Brick\Math\RoundingMode;
@ -18,7 +19,6 @@ use PSC\System\SettingsBundle\Service\Shop;
class Producer implements IUiProducer, IProducerHydrateModel class Producer implements IUiProducer, IProducerHydrateModel
{ {
public function __construct(private readonly DocumentManager $documentManager, private readonly EntityManagerInterface $entityManager, private readonly Shop $shopService, private readonly \Plugin\Custom\PSC\WMD_API\Api\GetPrices $priceApi) public function __construct(private readonly DocumentManager $documentManager, private readonly EntityManagerInterface $entityManager, private readonly Shop $shopService, private readonly \Plugin\Custom\PSC\WMD_API\Api\GetPrices $priceApi)
{ {
} }
@ -56,10 +56,10 @@ class Producer implements IUiProducer, IProducerHydrateModel
$price->setVat($priceObjVat->getMinorAmount()->toInt()); $price->setVat($priceObjVat->getMinorAmount()->toInt());
$price->setGross($priceObjGross->getMinorAmount()->toInt()); $price->setGross($priceObjGross->getMinorAmount()->toInt());
$price->setCount($this->count); $price->setCount($this->count);
$price->setAllNet($price->getNet()*$this->count); $price->setAllNet($price->getNet() * $this->count);
$price->setAllVat($price->getVat()*$this->count); $price->setAllVat($price->getVat() * $this->count);
$price->setAllGross($price->getGross()*$this->count); $price->setAllGross($price->getGross() * $this->count);
$price->tax = new Tax(19, $price->getVat()*$this->count, TaxEnum::POSITION); $price->tax = new Tax(19, $price->getAllNet(), $price->getAllVat(), TaxEnum::POSITION);
return $price; return $price;
} }
@ -74,19 +74,19 @@ class Producer implements IUiProducer, IProducerHydrateModel
]; ];
$temp['properties']['auflage'] = [ $temp['properties']['auflage'] = [
'default' => $this->product->getSpecialProductTypeObject()->getParams()['auflage']??1, 'default' => $this->product->getSpecialProductTypeObject()->getParams()['auflage'] ?? 1,
'type' => 'string', 'type' => 'string',
'title' => 'Auflage', 'title' => 'Auflage',
]; ];
$temp['properties']['versand'] = [ $temp['properties']['versand'] = [
'default' => $this->product->getSpecialProductTypeObject()->getParams()['versand']??null, 'default' => $this->product->getSpecialProductTypeObject()->getParams()['versand'] ?? null,
'type' => 'string', 'type' => 'string',
'oneOf' => [], 'oneOf' => [],
'title' => 'Versand', 'title' => 'Versand',
]; ];
foreach($this->pricesArray as $priceObj) { foreach ($this->pricesArray as $priceObj) {
$temp['properties']['versand']['oneOf'][] = ['const' => $priceObj['deliveryOption'], 'title' => $priceObj['deliveryOption']]; $temp['properties']['versand']['oneOf'][] = ['const' => $priceObj['deliveryOption'], 'title' => $priceObj['deliveryOption']];
} }
@ -132,12 +132,12 @@ class Producer implements IUiProducer, IProducerHydrateModel
} }
private function setVariables(): void private function setVariables(): void
{ {
if($this->product->getSpecialProductTypeObject()) { if ($this->product->getSpecialProductTypeObject()) {
/** /**
* @var ProductSpecialObject $specProd * @var ProductSpecialObject $specProd
*/ */
$specProd = $this->product->getSpecialProductTypeObject(); $specProd = $this->product->getSpecialProductTypeObject();
$this->engine->setVariable('auflage', $this->product->getSpecialProductTypeObject()->getParams()['auflage']?? 1); $this->engine->setVariable('auflage', $this->product->getSpecialProductTypeObject()->getParams()['auflage'] ?? 1);
$this->engine->calc(); $this->engine->calc();
$this->pricesArray = $this->priceApi->getPrices($this->engine->getArticle()); $this->pricesArray = $this->priceApi->getPrices($this->engine->getArticle());
@ -146,8 +146,8 @@ class Producer implements IUiProducer, IProducerHydrateModel
$priceVat = 0; $priceVat = 0;
$priceGross = 0; $priceGross = 0;
foreach($this->pricesArray as $priceObj) { foreach ($this->pricesArray as $priceObj) {
if($price === 0) { if ($price === 0) {
$price = $priceObj['price']['productPrice']['centAmount']; $price = $priceObj['price']['productPrice']['centAmount'];
$priceVat = $priceObj['price']['productTax']['centAmount']; $priceVat = $priceObj['price']['productTax']['centAmount'];
$priceGross = $priceObj['price']['productPriceWithTax']['centAmount']; $priceGross = $priceObj['price']['productPriceWithTax']['centAmount'];
@ -155,24 +155,24 @@ class Producer implements IUiProducer, IProducerHydrateModel
} }
$this->priceNet = $price; $this->priceNet = $price;
$this->priceVat = $priceVat; $this->priceVat = $priceVat;
$this->priceGross = $priceGross; $this->priceGross = $priceGross;
} }
} }
private function process(): void private function process(): void
{ {
$this->engine = new Engine(); $this->engine = new Engine();
if($this->product->getSpecialProductTypeObject() && $this->product->getSpecialProductTypeObject()->getXml()) { if ($this->product->getSpecialProductTypeObject() && $this->product->getSpecialProductTypeObject()->getXml()) {
} }
if($this->product->getUid()) { if ($this->product->getUid()) {
$product = $this->entityManager->getRepository(\PSC\Shop\EntityBundle\Entity\Product::class)->find($this->product->getUid()); $product = $this->entityManager->getRepository(\PSC\Shop\EntityBundle\Entity\Product::class)->find($this->product->getUid());
$productDoc = $this->documentManager->getRepository(\PSC\Shop\EntityBundle\Document\Product::class)->findOneBy(['uid' => $product->getUid()]); $productDoc = $this->documentManager->getRepository(\PSC\Shop\EntityBundle\Document\Product::class)->findOneBy(['uid' => $product->getUid()]);
$this->engine->loadString($productDoc->getPluginSettingModule('wmd', 'config')); $this->engine->loadString($productDoc->getPluginSettingModule('wmd', 'config'));
$this->priceApi->setShop($this->shopService->getMongoShopByUid($product->getShop()->getUID())); $this->priceApi->setShop($this->shopService->getMongoShopByUid($product->getShop()->getUID()));
}elseif($this->product->getUuid()) { } elseif ($this->product->getUuid()) {
$product = $this->entityManager->getRepository(\PSC\Shop\EntityBundle\Entity\Product::class)->findOneBy(['uuid' => $this->product->getUuid()]); $product = $this->entityManager->getRepository(\PSC\Shop\EntityBundle\Entity\Product::class)->findOneBy(['uuid' => $this->product->getUuid()]);
$productDoc = $this->documentManager->getRepository(\PSC\Shop\EntityBundle\Document\Product::class)->findOneBy(['uid' => $product->getUid()]); $productDoc = $this->documentManager->getRepository(\PSC\Shop\EntityBundle\Document\Product::class)->findOneBy(['uid' => $product->getUid()]);
$this->engine->loadString($productDoc->getPluginSettingModule('wmd', 'config')); $this->engine->loadString($productDoc->getPluginSettingModule('wmd', 'config'));

View File

@ -1,4 +1,5 @@
<?php <?php
namespace Plugin\System\PSC\Warehouse\Producer; namespace Plugin\System\PSC\Warehouse\Producer;
use Brick\Math\RoundingMode; use Brick\Math\RoundingMode;
@ -15,8 +16,8 @@ use PSC\Shop\ProductBundle\Interfaces\IProductTransformer;
use PSC\Shop\ProductBundle\Interfaces\IUiProducer; use PSC\Shop\ProductBundle\Interfaces\IUiProducer;
use PSC\Shop\ProductBundle\Model\Product; use PSC\Shop\ProductBundle\Model\Product;
class Producer implements IUiProducer, IProducerHydrateModel { class Producer implements IUiProducer, IProducerHydrateModel
{
public function __construct(private readonly EntityManagerInterface $entityManager) public function __construct(private readonly EntityManagerInterface $entityManager)
{ {
} }
@ -36,17 +37,17 @@ class Producer implements IUiProducer, IProducerHydrateModel {
{ {
/** @var ProductSpecialObject $specProd */ /** @var ProductSpecialObject $specProd */
$specProd = $this->product->getSpecialProductTypeObject(); $specProd = $this->product->getSpecialProductTypeObject();
$priceObj = Money::ofMinor($this->price*100, 'EUR'); $priceObj = Money::ofMinor($this->price * 100, 'EUR');
$price = new Price(); $price = new Price();
$price->setNet($priceObj->getMinorAmount()->toInt()); $price->setNet($priceObj->getMinorAmount()->toInt());
$price->setVat($priceObj->toRational()->dividedBy(100)->multipliedBy($specProd->getTaxClass()/100)->to($priceObj->getContext(), RoundingMode::UP)->getMinorAmount()->toInt()); $price->setVat($priceObj->toRational()->dividedBy(100)->multipliedBy($specProd->getTaxClass() / 100)->to($priceObj->getContext(), RoundingMode::UP)->getMinorAmount()->toInt());
$price->setGross($price->getNet() + $price->getVat()); $price->setGross($price->getNet() + $price->getVat());
$price->setCount($this->count); $price->setCount($this->count);
$price->setAllNet($price->getNet()*$this->count); $price->setAllNet($price->getNet() * $this->count);
$price->setAllVat($price->getVat()*$this->count); $price->setAllVat($price->getVat() * $this->count);
$price->setAllGross($price->getGross()*$this->count); $price->setAllGross($price->getGross() * $this->count);
$price->tax = new Tax($specProd->getTaxClass(), $price->getVat()*$this->count, TaxEnum::POSITION); $price->tax = new Tax($specProd->getTaxClass(), $price->getAllNet(), $price->getAllVat(), TaxEnum::POSITION);
return $price; return $price;
} }
@ -68,7 +69,7 @@ class Producer implements IUiProducer, IProducerHydrateModel {
public function setParams(array $params): void public function setParams(array $params): void
{ {
if(isset($params['count'])) { if (isset($params['count'])) {
$this->count = $params['count']; $this->count = $params['count'];
} }
} }
@ -104,14 +105,14 @@ class Producer implements IUiProducer, IProducerHydrateModel {
private function process(): void private function process(): void
{ {
if(!empty($this->product->getSpecialProductTypeObject()->getParams()) && isset($this->product->getSpecialProductTypeObject()->getParams()['count'])) { if (!empty($this->product->getSpecialProductTypeObject()->getParams()) && isset($this->product->getSpecialProductTypeObject()->getParams()['count'])) {
$this->count = $this->product->getSpecialProductTypeObject()->getParams()['count']; $this->count = $this->product->getSpecialProductTypeObject()->getParams()['count'];
} }
if($this->product->getUid()) { if ($this->product->getUid()) {
$product = $this->entityManager->getRepository(\PSC\Shop\EntityBundle\Entity\Product::class)->find($this->product->getUid()); $product = $this->entityManager->getRepository(\PSC\Shop\EntityBundle\Entity\Product::class)->find($this->product->getUid());
$this->price = $product->getPrice(); $this->price = $product->getPrice();
}elseif($this->product->getUuid()) { } elseif ($this->product->getUuid()) {
$product = $this->entityManager->getRepository(\PSC\Shop\EntityBundle\Entity\Product::class)->findOneBy(['uuid' => $this->product->getUuid()]); $product = $this->entityManager->getRepository(\PSC\Shop\EntityBundle\Entity\Product::class)->findOneBy(['uuid' => $this->product->getUuid()]);
$this->price = $product->getPrice(); $this->price = $product->getPrice();

View File

@ -32,7 +32,7 @@ class Producer implements IUiProducer, IProducerHydrateModel, ICalcNeedContact
private Product $product; private Product $product;
private Engine $engine; private Engine $engine;
private EntityManagerInterface $entityManager; private EntityManagerInterface $entityManager;
private Contact $contact; private ?Contact $contact = null;
public function __construct(Shop $shopService, PaperDB $paperService, DocumentManager $documentManager, EntityManagerInterface $entityManager) public function __construct(Shop $shopService, PaperDB $paperService, DocumentManager $documentManager, EntityManagerInterface $entityManager)
{ {
@ -81,7 +81,7 @@ class Producer implements IUiProducer, IProducerHydrateModel, ICalcNeedContact
$price->setAllNet($price->getNet()); $price->setAllNet($price->getNet());
$price->setAllVat($price->getVat()); $price->setAllVat($price->getVat());
$price->setAllGross($price->getGross()); $price->setAllGross($price->getGross());
$price->tax = new Tax($specProd->getTaxClass(), $price->getVat(), TaxEnum::POSITION); $price->tax = new Tax($specProd->getTaxClass(), $price->getAllNet(), $price->getAllVat(), TaxEnum::POSITION);
return $price; return $price;
} }
@ -95,7 +95,7 @@ class Producer implements IUiProducer, IProducerHydrateModel, ICalcNeedContact
$specProd = $this->product->getSpecialProductTypeObject(); $specProd = $this->product->getSpecialProductTypeObject();
$this->engine->setVariables($specProd->getParams()); $this->engine->setVariables($specProd->getParams());
if ($this->contact->getAccountType()->value > 1) { if ($this->contact && $this->contact->getAccountType()->value > 1) {
$this->engine->setVariable('contact.accountType', $this->contact->getAccountType()->value); $this->engine->setVariable('contact.accountType', $this->contact->getAccountType()->value);
} else { } else {
$this->engine->setVariable('contact.accountType', 1); $this->engine->setVariable('contact.accountType', 1);
@ -234,7 +234,7 @@ class Producer implements IUiProducer, IProducerHydrateModel, ICalcNeedContact
return $temp; return $temp;
} }
public function setContact(Contact $contact): void public function setContact(?Contact $contact): void
{ {
$this->contact = $contact; $this->contact = $contact;
} }

Some files were not shown because too many files have changed in this diff Show More