Skip to content

Commit

Permalink
storno fixed everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
Tamás KIRÁLY committed Jun 7, 2023
1 parent ac439d8 commit 342a5f6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/Models/NTAKOrder.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function __construct(
if ($orderType !== NTAKOrderType::NORMAL) {
$this->validateIfNotNormal();
}
if ($orderType !== NTAKOrderType::STORNO) {
if ($orderType !== NTAKOrderType::SZTORNO) {
$this->validateIfNotStorno();
}

Expand Down Expand Up @@ -192,7 +192,7 @@ protected function validateIfNotStorno(): void
*/
protected function calculateTotal(): int
{
if ($this->orderType !== NTAKOrderType::STORNO) {
if ($this->orderType !== NTAKOrderType::SZTORNO) {
$total = $this->totalOfOrderItems($this->orderItems);

return $total + $total * $this->serviceFee / 100;
Expand All @@ -212,7 +212,7 @@ protected function calculateTotalWithDiscount(): int
return $this->total;
}

if ($this->orderType !== NTAKOrderType::STORNO) {
if ($this->orderType !== NTAKOrderType::SZTORNO) {
$total = $this->totalOfOrderItemsWithDiscount($this->orderItems);

return $total + $total * $this->serviceFee / 100;
Expand Down
8 changes: 4 additions & 4 deletions src/NTAK.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,21 +88,21 @@ public function handleOrder(NTAKOrder ...$ntakOrders): string
? null
: $ntakOrder->ntakOrderId,
'targynap' => $ntakOrder->end->format('Y-m-d'),
'rendelesKezdete' => $ntakOrder->orderType === NTAKOrderType::STORNO
'rendelesKezdete' => $ntakOrder->orderType === NTAKOrderType::SZTORNO
? null
: $ntakOrder->start->timezone('Europe/Budapest')->toIso8601String(),
'rendelesVege' => $ntakOrder->orderType === NTAKOrderType::STORNO
'rendelesVege' => $ntakOrder->orderType === NTAKOrderType::SZTORNO
? null
: $ntakOrder->end->timezone('Europe/Budapest')->toIso8601String(),
'helybenFogyasztott' => $ntakOrder->isAtTheSpot,
'osszesitett' => false,
'fizetesiInformaciok' => $ntakOrder->orderType === NTAKOrderType::STORNO
'fizetesiInformaciok' => $ntakOrder->orderType === NTAKOrderType::SZTORNO
? null
: [
'rendelesVegosszegeHUF' => $ntakOrder->totalWithDiscount(),
'fizetesiModok' => $ntakOrder->buildPaymentTypes(),
],
'rendelesTetelek' => $ntakOrder->orderType === NTAKOrderType::STORNO
'rendelesTetelek' => $ntakOrder->orderType === NTAKOrderType::SZTORNO
? null
: $ntakOrder->buildOrderItems(),
];
Expand Down

0 comments on commit 342a5f6

Please sign in to comment.