commit 08-2025
This commit is contained in:
parent
9ae662f63e
commit
480fdc65ed
404 changed files with 65310 additions and 2600431 deletions
|
|
@ -23,7 +23,7 @@ class CheckoutRepository extends BaseRepository {
|
|||
public function __construct(SessionManager $session)
|
||||
{
|
||||
$this->session = $session;
|
||||
$this->instance = sprintf('%s.%s', 'cart', 'payments');
|
||||
$this->instance = 'checkout';
|
||||
}
|
||||
|
||||
public function makeShoppingOrder($shopping_user, $data){
|
||||
|
|
@ -34,11 +34,11 @@ class CheckoutRepository extends BaseRepository {
|
|||
//get data
|
||||
$homeparty = Homeparty::find($shopping_user->homeparty_id);
|
||||
//set Data!
|
||||
$total = Yard::instance('shopping')->total(2, '.', ''); //ek_price
|
||||
$total = Yard::instance($this->instance)->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(),
|
||||
'country_id' => Yard::instance($this->instance)->getShippingCountryId(),
|
||||
'language' => \App::getLocale(),
|
||||
'user_shop_id' => $user_shop->id,
|
||||
'payment_for' => $shopping_user->getOrderPaymentFor(),
|
||||
|
|
@ -49,7 +49,7 @@ class CheckoutRepository extends BaseRepository {
|
|||
'shipping_net' => $homeparty->order['shipping_price_net'],
|
||||
'subtotal_ws' => 0,
|
||||
'tax' => $total - $homeparty->order['ek_price_net'],
|
||||
'total_shipping' => Yard::instance('shopping')->totalWithShipping(2, '.', ''),
|
||||
'total_shipping' => Yard::instance($this->instance)->totalWithShipping(2, '.', ''),
|
||||
'points' => $homeparty->order['points'] - $homeparty->order['bonus_points_diff'],
|
||||
'weight' => 0,
|
||||
'txaction' => 'prev',
|
||||
|
|
@ -59,11 +59,11 @@ class CheckoutRepository extends BaseRepository {
|
|||
//get data
|
||||
$ShoppingCollectOrder = ShoppingCollectOrder::find($shopping_user->shopping_collect_order_id);
|
||||
//set Data!
|
||||
$total = Yard::instance('shopping')->total(2, '.', ''); //ek_price
|
||||
$total = Yard::instance($this->instance)->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(),
|
||||
'country_id' => Yard::instance($this->instance)->getShippingCountryId(),
|
||||
'language' => \App::getLocale(),
|
||||
'user_shop_id' => $user_shop->id,
|
||||
'payment_for' => $shopping_user->getOrderPaymentFor(),
|
||||
|
|
@ -74,7 +74,7 @@ class CheckoutRepository extends BaseRepository {
|
|||
'subtotal_ws' => $ShoppingCollectOrder->price_total_net,
|
||||
'tax' => $ShoppingCollectOrder->tax_total,
|
||||
'tax_split' => $ShoppingCollectOrder->tax_split,
|
||||
'total_shipping' => Yard::instance('shopping')->totalWithShipping(2, '.', ''),
|
||||
'total_shipping' => Yard::instance($this->instance)->totalWithShipping(2, '.', ''),
|
||||
'points' => $ShoppingCollectOrder->points,
|
||||
'weight' => 0,
|
||||
'txaction' => 'prev',
|
||||
|
|
@ -84,19 +84,19 @@ class CheckoutRepository extends BaseRepository {
|
|||
$data = [
|
||||
'shopping_user_id' => $shopping_user->id,
|
||||
'auth_user_id' => $shopping_user->auth_user_id,
|
||||
'country_id' => Yard::instance('shopping')->getShippingCountryId(),
|
||||
'country_id' => Yard::instance($this->instance)->getShippingCountryId(),
|
||||
'language' => \App::getLocale(),
|
||||
'user_shop_id' => $user_shop->id,
|
||||
'payment_for' => $shopping_user->getOrderPaymentFor(),
|
||||
'total' => Yard::instance('shopping')->total(2, '.', ''),
|
||||
'subtotal' => Yard::instance('shopping')->subtotal(2, '.', ''),
|
||||
'shipping' => Yard::instance('shopping')->shipping(2, '.', ','),
|
||||
'shipping_net' => Yard::instance('shopping')->shippingNet(2, '.', ''),
|
||||
'subtotal_ws' => Yard::instance('shopping')->subtotalWithShipping(2, '.', ''),
|
||||
'tax' => Yard::instance('shopping')->taxWithShipping(2, '.', ''),
|
||||
'total_shipping' => Yard::instance('shopping')->totalWithShipping(2, '.', ''),
|
||||
'points' => Yard::instance('shopping')->points(),
|
||||
'weight' => Yard::instance('shopping')->weight(),
|
||||
'total' => Yard::instance($this->instance)->total(2, '.', ''),
|
||||
'subtotal' => Yard::instance($this->instance)->subtotal(2, '.', ''),
|
||||
'shipping' => Yard::instance($this->instance)->shipping(2, '.', ','),
|
||||
'shipping_net' => Yard::instance($this->instance)->shippingNet(2, '.', ''),
|
||||
'subtotal_ws' => Yard::instance($this->instance)->subtotalWithShipping(2, '.', ''),
|
||||
'tax' => Yard::instance($this->instance)->taxWithShipping(2, '.', ''),
|
||||
'total_shipping' => Yard::instance($this->instance)->totalWithShipping(2, '.', ''),
|
||||
'points' => Yard::instance($this->instance)->points(),
|
||||
'weight' => Yard::instance($this->instance)->weight(),
|
||||
'is_abo' => isset($data['is_abo']) ? $data['is_abo'] : false,
|
||||
'abo_interval' => isset($data['abo_interval']) ? $data['abo_interval'] : null,
|
||||
'txaction' => 'prev',
|
||||
|
|
@ -121,11 +121,11 @@ class CheckoutRepository extends BaseRepository {
|
|||
}
|
||||
$this->putSessionPayments('shopping_order_id', $shopping_order->id);
|
||||
|
||||
$items = Yard::instance('shopping')->getContentByOrder();
|
||||
$items = Yard::instance($this->instance)->getContentByOrder();
|
||||
$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, '.', '');
|
||||
$price_net = Yard::instance($this->instance)->rowPriceNet($item, 2, '.', '');
|
||||
$tax = $item->price - $price_net;
|
||||
$data = [
|
||||
'shopping_order_id' => $shopping_order->id,
|
||||
|
|
@ -159,7 +159,7 @@ class CheckoutRepository extends BaseRepository {
|
|||
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, '.', '');
|
||||
$price_net = Yard::instance($this->instance)->rowPriceNet($item, 2, '.', '');
|
||||
$tax = $item->price - $price_net;
|
||||
|
||||
$data = [
|
||||
|
|
@ -251,7 +251,7 @@ class CheckoutRepository extends BaseRepository {
|
|||
abort(404);
|
||||
}
|
||||
|
||||
public function makeCustomerShoppingUser($shopping_data){
|
||||
public function makeCustomerShoppingUser($shopping_data, $is_for, $is_from){
|
||||
// $shopping_user = ShoppingUser::findOrFail($shopping_data['shopping_user_id']);
|
||||
$shopping_user = new ShoppingUser();
|
||||
$shopping_user->fill($shopping_data);
|
||||
|
|
@ -261,10 +261,90 @@ class CheckoutRepository extends BaseRepository {
|
|||
$shopping_user->same_as_billing = $shopping_user->same_as_billing ? false : true; //reinvert
|
||||
// $shopping_user->id = null;
|
||||
$shopping_user->accepted_data_checkbox = 1;
|
||||
$shopping_user->is_for = $is_for;
|
||||
$shopping_user->is_from = $is_from;
|
||||
$shopping_user->mode = 'prev';
|
||||
$shopping_user->language = \App::getLocale();
|
||||
return $shopping_user;
|
||||
|
||||
}
|
||||
|
||||
public function initShoppingUser($is_for, $is_from, $homeparty_id = null)
|
||||
{
|
||||
$shopping_user = new ShoppingUser();
|
||||
$shopping_user->homeparty_id = $homeparty_id;
|
||||
$shopping_user->language = \App::getLocale();
|
||||
//eingeloggter Kunde
|
||||
if(\Auth::guard('customers')->check()){
|
||||
$shopping_user = $this->shoppingUserByAuthCustomer(\Auth::guard('customers')->user());
|
||||
}
|
||||
//eingeloggter User Berater
|
||||
if(\Auth::guard('user')->check()){
|
||||
$shopping_user = $this->shoppingUserByAuthUser(\Auth::guard('user')->user(), $is_from, $is_for);
|
||||
}
|
||||
$shopping_user->mode = 'prev';
|
||||
$shopping_user->is_for = $is_for;
|
||||
$shopping_user->is_from = $is_from;
|
||||
return $shopping_user;
|
||||
}
|
||||
|
||||
public function shoppingUserByAuthCustomer(\App\Models\Customer $user){
|
||||
|
||||
//clone shopping user!
|
||||
if($user->shopping_user_id){
|
||||
$find_shopping_user = ShoppingUser::find($user->shopping_user_id);
|
||||
if($find_shopping_user){
|
||||
$shopping_user = $find_shopping_user->replicate();
|
||||
$shopping_user->billing_country_id = null;
|
||||
$shopping_user->shipping_country_id = null;
|
||||
}
|
||||
}else{
|
||||
$shopping_user = new ShoppingUser();
|
||||
$shopping_user->language = \App::getLocale();
|
||||
}
|
||||
|
||||
return $shopping_user;
|
||||
}
|
||||
|
||||
public function shoppingUserByAuthUser(\App\User $user, $is_from, $is_for){
|
||||
|
||||
$shopping_user = new ShoppingUser();
|
||||
$shopping_user->language = \App::getLocale();
|
||||
|
||||
$shopping_user->billing_salutation = $user->account->salutation;
|
||||
$shopping_user->billing_company = $user->account->company;
|
||||
$shopping_user->billing_firstname = $user->account->first_name;
|
||||
$shopping_user->billing_lastname = $user->account->last_name;
|
||||
$shopping_user->billing_address = $user->account->address;
|
||||
$shopping_user->billing_address_2 = $user->account->address_2;
|
||||
$shopping_user->billing_zipcode = $user->account->zipcode;
|
||||
$shopping_user->billing_city = $user->account->city;
|
||||
//$shopping_user->billing_country_id = $user->account->country_id;
|
||||
$shopping_user->billing_phone = $user->account->phone;
|
||||
$shopping_user->billing_email = $user->email;
|
||||
$shopping_user->faker_mail = false;
|
||||
$shopping_user->shipping_email = $user->email;
|
||||
|
||||
$shopping_user->accepted_data_checkbox = 1;
|
||||
|
||||
|
||||
//Lieferadresse
|
||||
$shopping_user->same_as_billing = $user->account->same_as_billing ? false : true;
|
||||
$shopping_user->shipping_salutation = $user->account->shipping_salutation;
|
||||
$shopping_user->shipping_company = $user->account->shipping_company;
|
||||
$shopping_user->shipping_firstname = $user->account->shipping_firstname;
|
||||
$shopping_user->shipping_lastname = $user->account->shipping_lastname;
|
||||
$shopping_user->shipping_address = $user->account->shipping_address;
|
||||
$shopping_user->shipping_address_2 = $user->account->shipping_address_2;
|
||||
$shopping_user->shipping_zipcode = $user->account->shipping_zipcode;
|
||||
$shopping_user->shipping_city = $user->account->shipping_city;
|
||||
//$shopping_user->shipping_country_id = $user->account->shipping_country_id;
|
||||
$shopping_user->shipping_phone = $user->account->shipping_phone;
|
||||
|
||||
|
||||
return $shopping_user;
|
||||
}
|
||||
|
||||
public function shoppingUserAuthData($is_from, $is_for, $data = []){
|
||||
|
||||
$user = Util::getAuthUser();
|
||||
|
|
@ -325,7 +405,7 @@ class CheckoutRepository extends BaseRepository {
|
|||
$shopping_user->shipping_address_2 = isset($data['shipping_address_2']) ? $data['shipping_address_2'] : '';
|
||||
$shopping_user->shipping_zipcode = isset($data['shipping_zipcode']) ? $data['shipping_zipcode'] : '';
|
||||
$shopping_user->shipping_city = isset($data['shipping_city']) ? $data['shipping_city'] : '';
|
||||
$shopping_user->shipping_country_id = Yard::instance('shopping')->getShippingCountryCountryId();
|
||||
$shopping_user->shipping_country_id = Yard::instance($this->instance)->getShippingCountryCountryId();
|
||||
$shopping_user->shipping_phone = isset($data['shipping_phone']) ? $data['shipping_phone'] : '';
|
||||
|
||||
}else{
|
||||
|
|
@ -361,8 +441,15 @@ class CheckoutRepository extends BaseRepository {
|
|||
return false;
|
||||
}
|
||||
|
||||
public function sessionDestroy()
|
||||
public function sessionDestroy($with_shopping = false)
|
||||
{
|
||||
if($with_shopping){
|
||||
if(session('user_shop_payment') === 1){ //ShoppingInstance payment 1 = webshop
|
||||
Yard::instance('webshop')->destroy();
|
||||
}else{
|
||||
Yard::instance('shopping')->destroy();
|
||||
}
|
||||
}
|
||||
$this->session->remove($this->instance);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ class ContractPDFRepository extends BaseRepository {
|
|||
$filename = "MIVITA_Beratervertrag.pdf";
|
||||
Storage::disk($this->disk)->put($this->dir.$filename, $pdf->Output('S'));
|
||||
$size = Storage::disk($this->disk)->size($this->dir.$filename);
|
||||
$mine = Storage::disk($this->disk)->getMimeType($this->dir.$filename);
|
||||
$mine = Storage::disk($this->disk)->mimeType($this->dir.$filename);
|
||||
|
||||
File::create([
|
||||
'user_id' => $this->model->id,
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ class CreditRepository extends BaseRepository {
|
|||
if(!Storage::disk('public')->exists( $dir )){
|
||||
Storage::disk('public')->makeDirectory($dir); //creates directory
|
||||
}
|
||||
$path = Storage::disk('public')->getAdapter()->getPathPrefix();
|
||||
$path = Storage::disk('public')->path('');
|
||||
|
||||
$filename = Credit::makeCreditFilename($credit_number);
|
||||
|
||||
|
|
@ -321,7 +321,7 @@ class CreditRepository extends BaseRepository {
|
|||
if(!Storage::disk('public')->exists( $dir )){
|
||||
Storage::disk('public')->makeDirectory($dir); //creates directory
|
||||
}
|
||||
$path = Storage::disk('public')->getAdapter()->getPathPrefix();
|
||||
$path = Storage::disk('public')->path('');
|
||||
$filename = Credit::makeCreditDetailFilename($user_credit->full_number);
|
||||
|
||||
$pdf = new CreditDetailsPDF('pdf.credit_details');
|
||||
|
|
@ -353,7 +353,7 @@ class CreditRepository extends BaseRepository {
|
|||
if(!Storage::disk('public')->exists( $dir )){
|
||||
Storage::disk('public')->makeDirectory($dir); //creates directory
|
||||
}
|
||||
$path = Storage::disk('public')->getAdapter()->getPathPrefix();
|
||||
$path = Storage::disk('public')->path('');
|
||||
|
||||
$filename = Credit::makeCreditFilename($credit_number);
|
||||
|
||||
|
|
|
|||
|
|
@ -7,8 +7,9 @@ use App\Models\DcFile;
|
|||
use App\Services\Util;
|
||||
use App\Models\DcFileTag;
|
||||
use App\Repositories\BaseRepository;
|
||||
use Intervention\Image\Facades\Image;
|
||||
use Imagick;
|
||||
use Intervention\Image\ImageManager;
|
||||
use Imagick;
|
||||
use ImagickException;
|
||||
|
||||
class FileRepository extends BaseRepository {
|
||||
|
||||
|
|
@ -88,21 +89,22 @@ class FileRepository extends BaseRepository {
|
|||
|
||||
private function processImage(string $path, string $filename): void
|
||||
{
|
||||
// ImageManager initialisieren (standardmäßig mit GD)
|
||||
$manager = ImageManager::gd();
|
||||
|
||||
// Thumbnail
|
||||
$img = Image::make($path);
|
||||
$img->resize(542, 360, function ($c) {
|
||||
$c->aspectRatio();
|
||||
$c->upsize();
|
||||
});
|
||||
\Storage::disk('public')->put('dc/thumb/'.basename($filename), (string) $img->encode());
|
||||
$thumbImage = $manager->read($path);
|
||||
$thumbImage->scaleDown(width: self::THUMB_WIDTH, height: self::THUMB_HEIGHT);
|
||||
\Storage::disk('public')->put('dc/thumb/'.basename($filename), (string) $thumbImage->toJpeg());
|
||||
|
||||
// Big image
|
||||
$img = Image::make($path);
|
||||
$img->resize(1600, 900, function ($c) {
|
||||
$c->aspectRatio();
|
||||
$c->upsize();
|
||||
});
|
||||
\Storage::disk('public')->put('dc/big/'.basename($filename), (string) $img->encode());
|
||||
$bigImage = $manager->read($path);
|
||||
$bigImage->scaleDown(width: self::BIG_WIDTH, height: self::BIG_HEIGHT);
|
||||
\Storage::disk('public')->put('dc/big/'.basename($filename), (string) $bigImage->toJpeg());
|
||||
|
||||
// Ressourcen freigeben nicht mehr nötig in v3
|
||||
// $thumbImage->destroy();
|
||||
// $bigImage->destroy();
|
||||
}
|
||||
|
||||
private function processPdf(string $path, string $filename): void
|
||||
|
|
|
|||
151
app/Repositories/DcRepository.php
Normal file
151
app/Repositories/DcRepository.php
Normal file
|
|
@ -0,0 +1,151 @@
|
|||
<?php
|
||||
|
||||
namespace App\Repositories;
|
||||
|
||||
use Request;
|
||||
use App\Models\DcTag;
|
||||
use App\Models\DcFile;
|
||||
use App\Models\DcCategory;
|
||||
|
||||
|
||||
class DcRepository extends BaseRepository {
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
public function makeThumb($id){
|
||||
$file = DcFile::findOrFail($id);
|
||||
$file->makeThumb();
|
||||
}
|
||||
|
||||
public function deleteFile($id){
|
||||
$file = DcFile::findOrFail($id);
|
||||
$file->delete();
|
||||
}
|
||||
|
||||
public function storeItem($obj, $data)
|
||||
{
|
||||
if($obj === 'category' && isset($data['dc_category_name'])){
|
||||
$category = new DcCategory;
|
||||
$category->name = $data['dc_category_name'];
|
||||
$category->pos = 0 ;
|
||||
$category->save();
|
||||
\Session()->flash('alert-success', 'Kategorie erstellt');
|
||||
return redirect(route('admin_downloadcenter_tags'));
|
||||
}
|
||||
|
||||
if($obj === 'tag' && isset($data['dc_tag_name'])){
|
||||
$data = Request::all();
|
||||
$tag = new DcTag;
|
||||
$tag->name = $data['dc_tag_name'];
|
||||
$tag->pos = 0;
|
||||
$tag->save();
|
||||
\Session()->flash('alert-success', 'Tag erstellt');
|
||||
return redirect(route('admin_downloadcenter_tags'));
|
||||
}
|
||||
if($obj === 'structure' && isset($data['nestable'])){
|
||||
$bool = $this->updateStructure($data);
|
||||
if(Request::ajax()){
|
||||
return response()->json([
|
||||
'success' => $bool,
|
||||
'redirect' => route('admin_downloadcenter_tags', ['flash' => true])
|
||||
]);
|
||||
}
|
||||
}
|
||||
if($obj === 'update_ajax' && isset($data['action'])){
|
||||
|
||||
$active = $this->updateAjax($data);
|
||||
if(Request::ajax()){
|
||||
return response()->json([
|
||||
'success' => $data['action'],
|
||||
'active' => $active,
|
||||
]);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function updateAjax($data){
|
||||
|
||||
if($data['action'] == 'update-tag-active' && isset($data['id'])){
|
||||
$tag = DcTag::findOrFail($data['id']);
|
||||
$tag->active = $tag->active ? 0 : 1;
|
||||
$tag->save();
|
||||
return $tag->active;
|
||||
|
||||
}
|
||||
if($data['action'] == 'update-category-active' && isset($data['id'])){
|
||||
$category = DcCategory::findOrFail($data['id']);
|
||||
$category->active = $category->active ? 0 : 1;
|
||||
$category->save();
|
||||
return $category->active;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function updateStructure($data)
|
||||
{
|
||||
if(empty($data['nestable']) || !is_array($data['nestable'])){
|
||||
return false;
|
||||
}
|
||||
$tags = DcTag::all();
|
||||
foreach ($tags as $value) {
|
||||
$value->category_id = null;
|
||||
$value->pos = NULL;
|
||||
$value->save();
|
||||
}
|
||||
$this->saveStructureLevel($data['nestable']);
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function saveStructureLevel($nestable, $deep = 0, $category_id = false){
|
||||
|
||||
foreach ($nestable as $key => $value) {
|
||||
if($value['id'] == 0){
|
||||
continue;
|
||||
}
|
||||
if($deep == 0){
|
||||
$cat = DcCategory::findOrFail($value['id']);
|
||||
$cat->pos = $key;
|
||||
$cat->save();
|
||||
}
|
||||
|
||||
if($deep == 1){
|
||||
$tag = DcTag::findOrFail($value['id']);
|
||||
$tag->category_id = $category_id;
|
||||
$tag->pos = $key;
|
||||
$tag->save();
|
||||
|
||||
}
|
||||
if(!empty($value['children'])){
|
||||
$this->saveStructureLevel($value['children'], $deep+1, $value['id']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function deleteItem($obj, $id){
|
||||
if($obj == 'category'){
|
||||
$this->deleteCategory($id);
|
||||
}
|
||||
if($obj == 'tag'){
|
||||
$this->deleteTag($id);
|
||||
}
|
||||
}
|
||||
|
||||
public function deleteCategory($id){
|
||||
$cat = DcCategory::findOrFail($id);
|
||||
$tags = DcTag::where('category_id', $cat->id)->get();
|
||||
foreach ($tags as $tag) {
|
||||
$this->deleteTag($tag->id);
|
||||
}
|
||||
$cat->delete();
|
||||
}
|
||||
|
||||
public function deleteTag($id){
|
||||
$tag = DcTag::findOrFail($id);
|
||||
$tag->delete();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -15,6 +15,9 @@ use App\Services\BusinessPlan\SalesPointsVolume;
|
|||
|
||||
class InvoiceRepository extends BaseRepository {
|
||||
|
||||
/** @var \App\Models\ShoppingOrder */
|
||||
protected $model;
|
||||
|
||||
private $invoice_date;
|
||||
private $invoice_number;
|
||||
private $filename;
|
||||
|
|
@ -125,7 +128,7 @@ class InvoiceRepository extends BaseRepository {
|
|||
Storage::disk('public')->makeDirectory($this->delivery_dir); //creates directory
|
||||
}
|
||||
|
||||
$path = Storage::disk('public')->getAdapter()->getPathPrefix();
|
||||
$path = Storage::disk('public')->path('');
|
||||
|
||||
//invoice
|
||||
$pdf_file = new InvoicePDF('pdf.invoice');
|
||||
|
|
|
|||
|
|
@ -76,14 +76,14 @@ class UserRepository extends BaseRepository {
|
|||
return $this->model;
|
||||
}
|
||||
|
||||
public function deleteUser(User $user)
|
||||
public function deleteUser(User $user, $complete = false)
|
||||
{
|
||||
$active_sponsor = UserUtil::findNextActiveSponsor($user->id);
|
||||
if($active_sponsor){
|
||||
UserUtil::setNewSponsorToChilds($user->id, $active_sponsor->id);
|
||||
UserUtil::setShoppingUserToNewMember($user->id, $active_sponsor->id);
|
||||
}
|
||||
UserUtil::deleteUser($user);
|
||||
UserUtil::deleteUser($user, $complete);
|
||||
}
|
||||
|
||||
public function reverse_charge_validate($data, $user, $route){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue