update payments and vat mentions

This commit is contained in:
ludo
2023-12-21 23:04:42 +01:00
parent 643c26d549
commit 8a463e7b9e
13 changed files with 86 additions and 143 deletions

View File

@@ -64,6 +64,7 @@ class Baskets
'offer_id' => (int) $item->id,
'name' => $offer->article->name.' ('.$offer->variation->name.')',
'quantity' => (int) $item->quantity,
'vat' => $prices ? (float) $prices->vat->value : false,
'price' => $prices ? (float) $prices->price : false,
'tax' => $prices ? $prices->price_taxed - $prices->price : false,
'price_taxed' => $prices ? (float) $prices->price_taxed : false,

View File

@@ -13,7 +13,7 @@ class DeliveryTypeCalculations
{
$price = DeliveryTypeCalculation::byDeliveryType($deliveryTypeId)->byWeight($weight)->first();
return $price ? $price->price : false;
return $price ? (float) $price->price : false;
}
public static function getModel()

View File

@@ -5,6 +5,7 @@ namespace App\Repositories\Shop;
use App\Models\Shop\Order;
use App\Repositories\Core\DateStats;
use App\Traits\Model\Basic;
use Illuminate\Support\Arr;
use Illuminate\Support\Str;
class Orders
@@ -41,7 +42,7 @@ class Orders
$data += self::getSummaryOfBasket($basket);
$order = self::store($data);
$detail = $order ? OrderDetails::saveBasket($order->id, $basket['detail']) : false;
unset($data['comment'], $data['agree'], $data['delivery_address_id'], $data['sale_channel_id']);
$data = Arr::except($data, ['comment', 'agree', 'delivery_address_id', 'sale_channel_id', 'delivery_id', 'delivery_type_id']);
$invoice = $detail ? Invoices::saveInvoice($order->id, $data + $invoice) : false;
return $invoice ? $order : false;