Update Framework, Invoices
This commit is contained in:
parent
cc5c147c27
commit
9b0b5feb7e
174 changed files with 28356 additions and 8093 deletions
|
|
@ -255,7 +255,6 @@ class CheckoutController extends Controller
|
|||
if ($validator->fails()) {
|
||||
return back()->withErrors($validator)->withInput(Request::all());
|
||||
}
|
||||
|
||||
$data = Request::all();
|
||||
//make User
|
||||
$shopping_user = $this->makeShoppingUser($data);
|
||||
|
|
@ -471,19 +470,20 @@ class CheckoutController extends Controller
|
|||
//get data
|
||||
$homeparty = Homeparty::find($shopping_user->homeparty_id);
|
||||
//set Data!
|
||||
$total = Yard::instance('shopping')->total(2, '.', ''); //ek_price
|
||||
$data = [
|
||||
'shopping_user_id' => $shopping_user->id,
|
||||
'auth_user_id' => $shopping_user->auth_user_id,
|
||||
'country_id' => Yard::instance('shopping')->getShippingCountryId(),
|
||||
'user_shop_id' => $user_shop->id,
|
||||
'payment_for' => Util::getUserPaymentFor(),
|
||||
'payment_for' => $shopping_user->getOrderPaymentFor(),
|
||||
'homeparty_id' => $shopping_user->homeparty_id,
|
||||
'total' => Yard::instance('shopping')->total(2, '.', ''),
|
||||
'subtotal' => $homeparty->order['price_net'],
|
||||
'total' => $total,
|
||||
'subtotal' => $homeparty->order['ek_price_net'],
|
||||
'shipping' => $homeparty->order['shipping_price'],
|
||||
'shipping_net' => $homeparty->order['shipping_price_net'],
|
||||
'subtotal_ws' => 0,
|
||||
'tax' => 0,
|
||||
'tax' => $total - $homeparty->order['ek_price_net'],
|
||||
'total_shipping' => Yard::instance('shopping')->totalWithShipping(2, '.', ''),
|
||||
'points' => $homeparty->order['points'] - $homeparty->order['bonus_points_diff'],
|
||||
'weight' => 0,
|
||||
|
|
@ -496,7 +496,7 @@ class CheckoutController extends Controller
|
|||
'auth_user_id' => $shopping_user->auth_user_id,
|
||||
'country_id' => Yard::instance('shopping')->getShippingCountryId(),
|
||||
'user_shop_id' => $user_shop->id,
|
||||
'payment_for' => Util::getUserPaymentFor(),
|
||||
'payment_for' => $shopping_user->getOrderPaymentFor(),
|
||||
'total' => Yard::instance('shopping')->total(2, '.', ''),
|
||||
'subtotal' => Yard::instance('shopping')->subtotal(2, '.', ''),
|
||||
'shipping' => Yard::instance('shopping')->shipping(2, '.', ','),
|
||||
|
|
@ -528,6 +528,8 @@ class CheckoutController extends Controller
|
|||
$shopping_order->shopping_order_items()->each(function($model) use ($items, $shopping_order, $shopping_user) {
|
||||
foreach ($items as $item) {
|
||||
if ($model->row_id === $item->rowId) {
|
||||
$price_net = Yard::instance('shopping')->rowPriceNet($item, 2, '.', '');
|
||||
$tax = $item->price - $price_net;
|
||||
$data = [
|
||||
'shopping_order_id' => $shopping_order->id,
|
||||
'row_id' => $item->rowId,
|
||||
|
|
@ -535,8 +537,12 @@ class CheckoutController extends Controller
|
|||
'comp' => $item->options->comp,
|
||||
'qty' => $item->qty,
|
||||
'price' => $item->price,
|
||||
'price_net' => Yard::instance('shopping')->rowPriceNet($item, 3, '.', ''),
|
||||
'price_net' => $price_net,
|
||||
'tax_rate' => $item->taxRate,
|
||||
'tax' => $tax,
|
||||
'price_vk_net' => $shopping_order->getPriceVkNetBy($item->id),
|
||||
'discount' => $shopping_order->getUserDiscount(),
|
||||
'points' => $item->options->points,
|
||||
'slug' => $item->options->slug,
|
||||
];
|
||||
if($shopping_user->is_from === 'homeparty'){
|
||||
|
|
@ -549,10 +555,12 @@ class CheckoutController extends Controller
|
|||
}
|
||||
return $model->delete();
|
||||
});
|
||||
|
||||
|
||||
foreach ($items as $item) {
|
||||
if (!ShoppingOrderItem::where('shopping_order_id', $shopping_order->id)->where('row_id', $item->rowId)->count()){
|
||||
|
||||
$price_net = Yard::instance('shopping')->rowPriceNet($item, 2, '.', '');
|
||||
$tax = $item->price - $price_net;
|
||||
|
||||
$data = [
|
||||
'shopping_order_id' => $shopping_order->id,
|
||||
'row_id' => $item->rowId,
|
||||
|
|
@ -560,8 +568,12 @@ class CheckoutController extends Controller
|
|||
'comp' => $item->options->comp,
|
||||
'qty' => $item->qty,
|
||||
'price' => $item->price,
|
||||
'price_net' => Yard::instance('shopping')->rowPriceNet($item, 3, '.', ''),
|
||||
'price_net' => $price_net,
|
||||
'tax_rate' => $item->taxRate,
|
||||
'tax' => $tax,
|
||||
'price_vk_net' => $shopping_order->getPriceVkNetBy($item->id),
|
||||
'discount' => $shopping_order->getUserDiscount(),
|
||||
'points' => $item->options->points,
|
||||
'slug' => $item->options->slug
|
||||
];
|
||||
|
||||
|
|
@ -573,8 +585,11 @@ class CheckoutController extends Controller
|
|||
$shopping_order_item = ShoppingOrderItem::create($data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if($shopping_user->is_from === 'homeparty'){
|
||||
$shopping_order->makeHomepartyTaxSplit();
|
||||
}else{
|
||||
$shopping_order->makeTaxSplit();
|
||||
}
|
||||
return $shopping_order;
|
||||
}
|
||||
|
||||
|
|
@ -605,7 +620,7 @@ class CheckoutController extends Controller
|
|||
{
|
||||
$this->session->remove($this->instance);
|
||||
}
|
||||
|
||||
//is for Rechnung MIV
|
||||
private function directPaymentStatus(PaymentTransaction $payt){
|
||||
|
||||
if(isset($payt->transmitted_data['param'])){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue