main system
This commit is contained in:
parent
0baac018a2
commit
a96d7d5c77
115 changed files with 4589 additions and 557 deletions
|
|
@ -16,26 +16,41 @@ class Payment
|
|||
'appointed' => "offen",
|
||||
'failed' => "abbruch",
|
||||
'extern' => "extern",
|
||||
'open' => "offen",
|
||||
'invoice_open' => "Re. offen",
|
||||
'invoice_paid' => "Re. bezahlt",
|
||||
'invoice_non' => "keine Zahlung",
|
||||
'invoice_non' => "Re. keine Zahlung",
|
||||
'non' => "keine Zahlung",
|
||||
'NULL' => 'keine Zahlung',
|
||||
];
|
||||
|
||||
public static $txaction_invoice = [
|
||||
'invoice_open' => "Re. offen",
|
||||
'invoice_paid' => "Re. bezahlt",
|
||||
'invoice_non' => 'keine Zahlung',
|
||||
'open' => "offen",
|
||||
'paid' => "bezahlt",
|
||||
'non' => "keine Zahlung",
|
||||
/*'open_vor' => "Vorkasse offen",
|
||||
'paid_vor' => "Vorkasse bezahlt",
|
||||
'non_vor' => "Vorkasse keine Zahlung",
|
||||
'invoice_open' => "Rechung offen",
|
||||
'invoice_paid' => "Rechung bezahlt",
|
||||
'invoice_non' => 'Rechung keine Zahlung',*/
|
||||
|
||||
];
|
||||
|
||||
public static $txaction_color = [
|
||||
'paid' => "success",
|
||||
'appointed' => "warning",
|
||||
'failed' => "danger",
|
||||
'extern' => "success",
|
||||
'open' => "warning",
|
||||
'paid' => "success",
|
||||
'non' => "danger",
|
||||
'open_vor' => "warning",
|
||||
'paid_vor' => "success",
|
||||
'non_vor' => "danger",
|
||||
'invoice_open' => "warning",
|
||||
'invoice_paid' => "success",
|
||||
'invoice_non' => "failed",
|
||||
'invoice_non' => "danger",
|
||||
|
||||
];
|
||||
|
||||
|
||||
|
|
@ -71,8 +86,9 @@ class Payment
|
|||
}
|
||||
|
||||
|
||||
/* public static function paymentStatusPaidAction(ShoppingOrder $shopping_order, $paid){
|
||||
public static function paymentStatusPaidAction(ShoppingOrder $shopping_order, $paid){
|
||||
$send_link = false;
|
||||
|
||||
$shopping_order->setUserHistoryValue(['status' => 8]);
|
||||
Shop::userOrders();
|
||||
$shopping_order->paid = $paid;
|
||||
|
|
@ -83,6 +99,7 @@ class Payment
|
|||
foreach($shopping_order->shopping_order_items as $shopping_order_item){
|
||||
if($shopping_order_item->product){
|
||||
if($shopping_order_item->product->action){
|
||||
|
||||
$user = User::findOrFail($shopping_order->auth_user_id);
|
||||
$user->save();
|
||||
$send_link = true;
|
||||
|
|
@ -93,12 +110,13 @@ class Payment
|
|||
}
|
||||
foreach ($shopping_order_item->product->action as $do){
|
||||
if($shopping_order_item->product->getActionName($do) === 'payment_for_account'){
|
||||
$user->payment_order_id = $shopping_order_item->product->id; //34
|
||||
// $user->payment_order_id = $shopping_order_item->product->id; //34
|
||||
$user->payment_account = $date;
|
||||
$user->wizard = 100;
|
||||
$user->payment_credit = $shopping_order_item->product->price;
|
||||
$shopping_order->setUserHistoryValue(['status' => 9]);
|
||||
}
|
||||
if($shopping_order_item->product->getActionName($do) === 'payment_for_shop'){
|
||||
/*if($shopping_order_item->product->getActionName($do) === 'payment_for_shop'){
|
||||
$user->payment_order_id = $shopping_order_item->product->id; //35
|
||||
$user->payment_shop = $date;
|
||||
$user->wizard = 100;
|
||||
|
|
@ -115,7 +133,7 @@ class Payment
|
|||
if($shopping_order_item->product->upgrade_to_id){
|
||||
$user->m_level = $shopping_order_item->product->upgrade_to_id;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
$user->save();
|
||||
}
|
||||
}
|
||||
|
|
@ -125,7 +143,7 @@ class Payment
|
|||
}
|
||||
|
||||
return $send_link;
|
||||
}*/
|
||||
}
|
||||
|
||||
public static function paymentStatusSendMail(ShoppingOrder $shopping_order, $shopping_payment, $data){
|
||||
$bcc = [];
|
||||
|
|
|
|||
|
|
@ -107,25 +107,25 @@ class Util
|
|||
}
|
||||
|
||||
|
||||
public static function getUserShopIdentifier(){
|
||||
/*public static function getUserShopIdentifier(){
|
||||
if(\Session::has('user_shop_identifier')){
|
||||
if($user_shop_identifier = \Session::get('user_shop_identifier')){
|
||||
return $user_shop_identifier;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public static function getUserHistory(){
|
||||
}*/
|
||||
|
||||
public static function getUserHistory($identifier){
|
||||
$auth_user = self::getAuthUser();
|
||||
$user_shop_identifier = self::getUserShopIdentifier();
|
||||
if($user_shop_identifier && $auth_user){
|
||||
return UserHistory::whereUserId($auth_user->id)->whereIdentifier($user_shop_identifier)->get()->last();
|
||||
if($auth_user){
|
||||
return UserHistory::whereUserId($auth_user->id)->whereIdentifier($identifier)->get()->last();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function setUserHistoryValue($values = []){
|
||||
if($user_history = self::getUserHistory()){
|
||||
public static function setUserHistoryValue($values = [], $identifier){
|
||||
if($user_history = self::getUserHistory($identifier)){
|
||||
foreach ($values as $key=>$val){
|
||||
$user_history->{$key} = $val;
|
||||
}
|
||||
|
|
@ -133,8 +133,8 @@ class Util
|
|||
}
|
||||
}
|
||||
|
||||
public static function getUserHistoryValue($key){
|
||||
if($user_history = self::getUserHistory()) {
|
||||
public static function getUserHistoryValue($key, $identifier){
|
||||
if($user_history = self::getUserHistory($identifier)) {
|
||||
return $user_history->{$key};
|
||||
}
|
||||
return null;
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ class Yard extends Cart
|
|||
private $shipping_tax = 0;
|
||||
private $shipping_country_id = 0; //default de
|
||||
private $shipping_is_for;
|
||||
private $num_comp;
|
||||
//private $num_comp;
|
||||
private $ysession;
|
||||
private $yinstance;
|
||||
private $shopping_data = [];
|
||||
|
|
@ -52,9 +52,9 @@ class Yard extends Cart
|
|||
$this->shipping_is_for = $this->getYardExtra('shipping_is_for');
|
||||
}
|
||||
|
||||
if($this->getYardExtra('num_comp')){
|
||||
/*if($this->getYardExtra('num_comp')){
|
||||
$this->num_comp = $this->getYardExtra('num_comp');
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
parent::__construct($session, $events);
|
||||
|
|
@ -146,12 +146,13 @@ class Yard extends Cart
|
|||
return;
|
||||
}
|
||||
$shipping = $shippingCountry->shipping;
|
||||
|
||||
if($this->weight() == 0){
|
||||
$shipping_price = $shipping->shipping_prices->first();
|
||||
$shipping_price->price = 0;
|
||||
$shipping_price->price_comp = 0;
|
||||
}else{
|
||||
|
||||
|
||||
//first by price
|
||||
$shipping_price = $this->shippingPriceByTotal($shipping->shipping_prices, $this->total(2, '.', ''));
|
||||
//sec by weight
|
||||
|
|
@ -160,23 +161,24 @@ class Yard extends Cart
|
|||
}
|
||||
//default
|
||||
if(!$shipping_price){
|
||||
|
||||
$shipping_price = $shipping->shipping_prices->first();
|
||||
}
|
||||
}
|
||||
if($shipping_price){
|
||||
$price = $shipping_price->price;
|
||||
$this->num_comp = 0;
|
||||
/*$this->num_comp = 0;
|
||||
if($this->shipping_is_for === 'me'){
|
||||
$price = $shipping_price->price_comp;
|
||||
$this->num_comp = $shipping_price->num_comp;
|
||||
|
||||
}
|
||||
}*/
|
||||
$this->shipping_price = $price;
|
||||
$this->shipping_tax_rate = $shipping_price->tax_rate;
|
||||
$this->shipping_price_net = round($price / ((100+$shipping_price->tax_rate) / 100), 2);
|
||||
$this->shipping_tax = round($price / (100+$shipping_price->tax_rate) * 100, 2);
|
||||
|
||||
$this->putYardExtra('num_comp', $this->num_comp);
|
||||
//$this->putYardExtra('num_comp', $this->num_comp);
|
||||
$this->putYardExtra('shipping_price', $this->shipping_price);
|
||||
$this->putYardExtra('shipping_tax_rate', $this->shipping_tax_rate);
|
||||
$this->putYardExtra('shipping_tax', $this->shipping_tax);
|
||||
|
|
@ -419,7 +421,7 @@ class Yard extends Cart
|
|||
}
|
||||
|
||||
public function getNumComp(){
|
||||
return $this->num_comp;
|
||||
return 0; //$this->num_comp;
|
||||
}
|
||||
|
||||
public function getCompProductBy($comp, $product_id=false){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue