Update Framework, Invoices

This commit is contained in:
Kevin Adametz 2022-04-14 13:14:36 +02:00
parent cc5c147c27
commit 9b0b5feb7e
174 changed files with 28356 additions and 8093 deletions

View file

@ -342,8 +342,8 @@ class HomepartyController extends Controller
'tax_rate' => 0,
'points' => $product->points,
'margin' => $margin,
'ek-price' => $product->getPriceWith(true, true, $homeparty->getUserCountry()),
'ek-price_net' => $product->getPriceWith(true, true, $homeparty->getUserCountry()),
'ek_price' => $product->getPriceWith(true, true, $homeparty->getUserCountry()),
'ek_price_net' => $product->getPriceWith(true, true, $homeparty->getUserCountry()),
'slug' => $product->slug
]);
}else{
@ -357,8 +357,8 @@ class HomepartyController extends Controller
'tax_rate' => $product->getTaxWith($homeparty->getUserCountry()),
'points' => $product->points,
'margin' => $margin,
'ek-price' => $product->getPriceWith(false, true, $homeparty->getUserCountry()),
'ek-price_net' => $product->getPriceWith(true, true, $homeparty->getUserCountry()),
'ek_price' => $product->getPriceWith(false, true, $homeparty->getUserCountry()),
'ek_price_net' => $product->getPriceWith(true, true, $homeparty->getUserCountry()),
'slug' => $product->slug
]);
}
@ -459,7 +459,7 @@ class HomepartyController extends Controller
$date = date('d.m.Y H:i:s', $time);
$user = User::find(Auth::user()->id);
Yard::instance('shopping')->destroy();
$cartItem = Yard::instance('shopping')->add($homeparty->id, 'Bestellung Homeparty '.$date, 1, \App\Services\HomepartyCart::$ek_price, ['image' => "", 'slug' => $time, 'weight' => 0]);
$cartItem = Yard::instance('shopping')->add($homeparty->id, 'Bestellung Homeparty '.$date, 1, \App\Services\HomepartyCart::$ek_price, false, false, ['image' => "", 'slug' => $time, 'weight' => 0]);
Yard::setTax($cartItem->rowId, 0);
do {
$identifier = Util::getToken();

View file

@ -68,7 +68,7 @@ class OrderController extends Controller
return Payment::getShoppingOrderBadge($ShoppingOrder);
})
->addColumn('total_shipping', function (ShoppingOrder $ShoppingOrder) {
return $ShoppingOrder->getFormattedTotalShipping()."";
return '<span class="no-line-break">'.$ShoppingOrder->getFormattedTotalShipping()."</span>";
})
->addColumn('payment', function (ShoppingOrder $ShoppingOrder) {
return $ShoppingOrder->getLastShoppingPayment('getPaymentType');
@ -76,17 +76,12 @@ class OrderController extends Controller
->addColumn('shipped', function (ShoppingOrder $ShoppingOrder) {
return '<span class="badge badge-pill badge-'.$ShoppingOrder->getShippedColor().'">'.$ShoppingOrder->getShippedType().'</span>';
})
->addColumn('is_for', function (ShoppingOrder $ShoppingOrder) {
if($ShoppingOrder->shopping_user->is_for === 'me'){
return '<span class="badge badge-pill badge-secondary">Beraterbestellung</span>';
}
if($ShoppingOrder->shopping_user->is_for === 'ot'){
return '<span class="badge badge-pill badge-info">Kundenbestellung</span>';
}
if($ShoppingOrder->shopping_user->is_for === 'hp'){
return '<span class="badge badge-pill badge-dark">Homepartybestellung</span>';
}
return '-';
->addColumn('payment_for', function (ShoppingOrder $ShoppingOrder) {
return '<span class="badge badge-pill badge-'.$ShoppingOrder->getPaymentForColor().'">'.$ShoppingOrder->getPaymentForType().'</span>';
})
->addColumn('invoice', function (ShoppingOrder $ShoppingOrder) {
return $ShoppingOrder->isInvoice() ? '<span class="no-line-break"><a href="'.route('storage_file', [$ShoppingOrder->id, 'invoice', 'download']).'" class="btn btn-primary btn-xs"><i class="fa fa-download"></i></a>
<a href="'.route('storage_file', [$ShoppingOrder->id, 'invoice', 'stream']).'" target="_blank" class="btn btn-warning btn-xs"><i class="fa fa-eye"></i></a></span>' : '-';
})
->addColumn('reference', function (ShoppingOrder $ShoppingOrder) {
return $ShoppingOrder->getLastShoppingPayment('reference');
@ -95,7 +90,9 @@ class OrderController extends Controller
->orderColumn('txaction', 'txaction $1')
->orderColumn('shipped', 'shipped $1')
->orderColumn('total_shipping', 'total_shipping $1')
->rawColumns(['id', 'txaction', 'is_for', 'shipped'])
->orderColumn('payment_for', 'payment_for $1')
->rawColumns(['id', 'txaction', 'payment_for', 'total_shipping', 'invoice', 'shipped'])
->make(true);
}
@ -381,7 +378,7 @@ class OrderController extends Controller
}
//get the card item
$cartItem = Yard::instance('shopping')->add($product->id, $product->getLang('name'), 1, $product->getPriceWith(false, true, Yard::instance('shopping')->getUserCountry()), ['image' => $image, 'slug' => $product->slug, 'weight' => $product->weight, 'points' => $product->points]);
$cartItem = Yard::instance('shopping')->add($product->id, $product->getLang('name'), 1, $product->getPriceWith(false, true, Yard::instance('shopping')->getUserCountry()), false, false, ['image' => $image, 'slug' => $product->slug, 'weight' => $product->weight, 'points' => $product->points]);
Yard::setTax($cartItem->rowId, $product->getTaxWith(Yard::instance('shopping')->getUserCountry()));
if(isset($data['qty']) && $data['qty'] > 0){
@ -458,7 +455,7 @@ class OrderController extends Controller
if ($product->images->count()) {
$image = $product->images->first()->slug;
}
$cartItem = Yard::instance('shopping')->add($product->id, $product->getLang('name'), 1, 0,
$cartItem = Yard::instance('shopping')->add($product->id, $product->getLang('name'), 1, 0, false, false,
['image' => $image, 'slug' => $product->slug, 'weight' => 0, 'points' => 0,
'comp' => $data['comp_num'], 'product_id' => $product->id]);
Yard::setTax($cartItem->rowId, 0);

View file

@ -53,7 +53,7 @@ class ShopSalesController extends Controller
return Payment::getShoppingOrderBadge($ShoppingOrder);
})
->addColumn('total_shipping', function (ShoppingOrder $ShoppingOrder) {
return $ShoppingOrder->getFormattedTotalShipping();
return '<span class="no-line-break">'.$ShoppingOrder->getFormattedTotalShipping()." €</span>";
})
->addColumn('orders', function (ShoppingOrder $ShoppingOrder) {
return $ShoppingOrder->shopping_user ? $ShoppingOrder->shopping_user->orders : '';
@ -61,11 +61,22 @@ class ShopSalesController extends Controller
->addColumn('user_shop_id', function (ShoppingOrder $ShoppingOrder) {
return $ShoppingOrder->user_shop ? '<a href="'.$ShoppingOrder->user_shop->getSubdomain(false).'" target="_blank">'.$ShoppingOrder->user_shop->getSubdomain(false).'</span>' : '';
})
->addColumn('payment_for', function (ShoppingOrder $ShoppingOrder) {
return '<span class="badge badge-pill badge-'.$ShoppingOrder->getPaymentForColor().'">'.$ShoppingOrder->getPaymentForType().'</span>';
})
->addColumn('invoice', function (ShoppingOrder $ShoppingOrder) {
return $ShoppingOrder->isInvoice() ? '<span class="no-line-break"><a href="'.route('storage_file', [$ShoppingOrder->id, 'invoice', 'download']).'" class="btn btn-primary btn-xs"><i class="fa fa-download"></i></a>
<a href="'.route('storage_file', [$ShoppingOrder->id, 'invoice', 'stream']).'" target="_blank" class="btn btn-warning btn-xs"><i class="fa fa-eye"></i></a></span>' : '-';
})
->orderColumn('payment_for', 'payment_for $1')
->orderColumn('id', 'id $1')
->orderColumn('txaction', 'txaction $1')
->orderColumn('user_shop_id', 'user_shop_id $1')
->rawColumns(['id', 'txaction', 'user_shop_id'])
->orderColumn('total_shipping', 'total_shipping $1')
->rawColumns(['id', 'txaction', 'user_shop_id', 'total_shipping', 'invoice', 'payment_for'])
->make(true);
}