Gutschriften Anpassungen
This commit is contained in:
parent
3754f1c571
commit
e670b92f5d
28 changed files with 303 additions and 99 deletions
2
.env
2
.env
|
|
@ -49,7 +49,7 @@ MAIL_USERNAME=web28p3
|
|||
MAIL_PASSWORD=WeE2bmI9GjB7pDgi
|
||||
#MAIL_ENCRYPTION=SSL
|
||||
MAIL_FROM_ADDRESS=partner@gruene-seele.bio
|
||||
MAIL_FROM_NAME="Partner Grüne Seele bio"
|
||||
MAIL_FROM_NAME="Partner GRÜNE SEELE Naturkosmetik"
|
||||
|
||||
AWS_ACCESS_KEY_ID=
|
||||
AWS_SECRET_ACCESS_KEY=
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ use App\Models\HomepartyUser;
|
|||
use App\Models\Product;
|
||||
use App\Models\ShoppingOrder;
|
||||
use App\Models\ShoppingUser;
|
||||
|
||||
use App\Models\UserCredit;
|
||||
use App\User;
|
||||
use Request;
|
||||
|
||||
|
|
@ -73,6 +73,13 @@ class ModalController extends Controller
|
|||
$ret = view("admin.modal.add_pay_credit", compact('value', 'data'))->render();
|
||||
}
|
||||
|
||||
if($data['action'] === 'user-credit-status'){
|
||||
$value = UserCredit::find($data['id']); //current user form order
|
||||
$ret = view("admin.modal.user-credit-status", compact('value', 'data'))->render();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*if($data['action'] === 'homeparty-add-product') {
|
||||
$homeparty = Homeparty::find($data['id']);
|
||||
$homeparty_user = HomepartyUser::find($data['user_id']);
|
||||
|
|
|
|||
|
|
@ -67,17 +67,27 @@ class PaymentCreditController extends Controller
|
|||
|
||||
public function create(){
|
||||
$data = Request::all();
|
||||
if(!isset($data['userid'])){
|
||||
abort(404);
|
||||
}
|
||||
if(isset($data['action'])){
|
||||
if($data['action'] === 'create_credit'){
|
||||
if(!isset($data['userid'])){
|
||||
abort(404);
|
||||
}
|
||||
$user = User::findOrFail($data['userid']);
|
||||
$invoice_repo = new CreditRepository($user);
|
||||
$invoice_repo->create($data);
|
||||
\Session()->flash('alert-success', "Gutschrift erstellt");
|
||||
return redirect($data['back']);
|
||||
}
|
||||
if($data['action'] === 'user-credit-status'){
|
||||
$UserCredit = UserCredit::findOrFail($data['id']);
|
||||
$UserCredit->status = $data['status'];
|
||||
$UserCredit->save();
|
||||
\Session()->flash('alert-success', "Status gespeichert");
|
||||
return back();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private function setActiveYears(){
|
||||
|
|
@ -127,10 +137,18 @@ class PaymentCreditController extends Controller
|
|||
return $ret;
|
||||
})
|
||||
|
||||
->addColumn('status', function (UserCredit $UserCredit) {
|
||||
return '<a href="#" data-toggle="modal" data-target="#modals-load-content" data-modal="modal-lg"
|
||||
data-id="'.$UserCredit->id.'" data-route="'.route('modal_load').'" data-action="user-credit-status" data-view="">
|
||||
<span class="badge badge-pill badge-'.$UserCredit->getStatusColor().'">'.$UserCredit->getStatusType().' <span class="ion ion-md-cash"></span></span>
|
||||
</a>';
|
||||
})
|
||||
|
||||
|
||||
->orderColumn('id', 'id $1')
|
||||
->orderColumn('status', 'status $1')
|
||||
->orderColumn('total', 'total $1')
|
||||
->rawColumns(['shipping_order', 'total', 'credit', 'user_margins'])
|
||||
->rawColumns(['shipping_order', 'total', 'credit', 'status', 'user_margins'])
|
||||
->make(true);
|
||||
}
|
||||
}
|
||||
|
|
@ -92,6 +92,7 @@ class PaymentInvoiceController extends Controller
|
|||
})
|
||||
|
||||
->orderColumn('id', 'id $1')
|
||||
->orderColumn('invoice_number', 'invoice_number $1')
|
||||
->orderColumn('txaction', 'txaction $1')
|
||||
->orderColumn('shipped', 'shipped $1')
|
||||
->orderColumn('total_shipping', 'total_shipping $1')
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ class AdminToolsController extends Controller
|
|||
public function index($action)
|
||||
{
|
||||
|
||||
dd($action);
|
||||
switch ($action) {
|
||||
case 'pay_credits':
|
||||
# code...
|
||||
|
|
@ -56,7 +57,10 @@ class AdminToolsController extends Controller
|
|||
|
||||
public function store($action)
|
||||
{
|
||||
|
||||
|
||||
dd($action);
|
||||
|
||||
$data = [];
|
||||
switch ($action) {
|
||||
case 'pay_credits':
|
||||
|
|
|
|||
|
|
@ -32,14 +32,12 @@ class MailCheckout extends Mailable
|
|||
|
||||
if($this->txaction === 'paid'){
|
||||
$this->subject = __('email.checkout_subject_paid')." ";
|
||||
$this->subject .= ".gruene-seele.bio";
|
||||
}elseif($this->txaction === 'extern'){
|
||||
$this->subject = __('email.checkout_subject_extern').": ";
|
||||
$this->subject .= $shopping_order->member->account->m_first_name." ".$shopping_order->member->account->m_last_name." - ";
|
||||
$this->subject .= $shopping_order->shopping_user->billing_firstname." ".$shopping_order->shopping_user->billing_lastname;
|
||||
}else{
|
||||
$this->subject = __('email.checkout_subject')." ";
|
||||
$this->subject .= ".gruene-seele.bio";
|
||||
}
|
||||
|
||||
/*if($shopping_order->user_shop){
|
||||
|
|
|
|||
|
|
@ -126,6 +126,7 @@ class ShoppingOrder extends Model
|
|||
'weight',
|
||||
'paid',
|
||||
'invoice',
|
||||
'invoice_number',
|
||||
'txaction',
|
||||
'wp_invoice_path',
|
||||
'wp_notice',
|
||||
|
|
|
|||
|
|
@ -127,12 +127,12 @@ class UserAccount extends Model
|
|||
'm_account', 'm_salutation', 'm_first_name', 'm_last_name', 'm_notes', 'company', 'salutation', 'first_name', 'last_name', 'address', 'address_2', 'zipcode', 'city', 'country_id', 'pre_phone_id', 'phone', 'pre_mobil_id', 'mobil',
|
||||
'tax_number', 'tax_identification_number', 'taxable_sales', 'same_as_billing',
|
||||
'shipping_salutation', 'shipping_company', 'shipping_firstname', 'shipping_lastname', 'shipping_address', 'shipping_address_2', 'shipping_zipcode', 'shipping_city', 'shipping_country_id', 'shipping_pre_phone_id', 'shipping_phone',
|
||||
'birthday', 'website', 'facebook', 'facebook_fanpage', 'instagram', 'notice'
|
||||
'birthday', 'website', 'facebook', 'facebook_fanpage', 'instagram', 'notice', 'payment_data'
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'payment_data' => 'array',
|
||||
'notice' => 'array',
|
||||
'notice' => 'array'
|
||||
];
|
||||
|
||||
use SoftDeletes;
|
||||
|
|
@ -194,6 +194,10 @@ class UserAccount extends Model
|
|||
return Carbon::parse($this->attributes['accept_contract'])->format(\Util::formatDateTimeDB());
|
||||
}
|
||||
|
||||
public function getPaymentData($key)
|
||||
{
|
||||
return isset($this->payment_data[$key]) ? $this->payment_data[$key] : '';
|
||||
}
|
||||
|
||||
public function getCountryAttrAs($attr, $as = false){
|
||||
if($this->country){
|
||||
|
|
|
|||
|
|
@ -65,6 +65,7 @@ class UserCredit extends Model
|
|||
|
||||
protected $fillable = [
|
||||
'auth_user_id',
|
||||
'credit_number',
|
||||
'net',
|
||||
'tax_rate',
|
||||
'tax',
|
||||
|
|
@ -77,6 +78,20 @@ class UserCredit extends Model
|
|||
'status'
|
||||
];
|
||||
|
||||
public static $statusTypes = [
|
||||
0 => 'offen',
|
||||
1 => 'bezahlt',
|
||||
2 => 'prüfen',
|
||||
10 => 'storniert'
|
||||
];
|
||||
|
||||
public static $statusColors = [
|
||||
0 => 'warning',
|
||||
1 => 'success',
|
||||
2 => 'secondary',
|
||||
10 => 'danger',
|
||||
];
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(\App\User::class, 'auth_user_id');
|
||||
|
|
@ -113,4 +128,13 @@ class UserCredit extends Model
|
|||
return formatNumber($this->attributes['total']);
|
||||
}
|
||||
|
||||
|
||||
public function getStatusType(){
|
||||
return isset(self::$statusTypes[$this->status]) ? self::$statusTypes[$this->status] : "";
|
||||
}
|
||||
|
||||
public function getStatusColor(){
|
||||
return isset(self::$statusColors[$this->status]) ? self::$statusColors[$this->status] : "default";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,11 +58,12 @@ class CreditRepository extends BaseRepository {
|
|||
'filename' => $filename,
|
||||
'dir' => $dir,
|
||||
'disk' => 'public',
|
||||
'invoice_number' => $credit_number,
|
||||
'credit_number' => $credit_number,
|
||||
'credit_date' => $credit_date,
|
||||
];
|
||||
$user_credit = UserCredit::create([
|
||||
'auth_user_id' => $this->model->id,
|
||||
'credit_number' => $credit_number,
|
||||
'net' => $user_credits->net,
|
||||
'tax_rate' => $user_credits->tax_rate,
|
||||
'tax' => $user_credits->tax,
|
||||
|
|
@ -78,10 +79,7 @@ class CreditRepository extends BaseRepository {
|
|||
Credit::sendCreditMail($user_credit);
|
||||
}
|
||||
$this->finishUserCredit($user_credit);
|
||||
|
||||
return true;
|
||||
//return $pdf->stream('invoice.pdf');
|
||||
//return $this->output($path.$dir, $filename);
|
||||
}
|
||||
|
||||
private function finishUserCredit($user_credit){
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ class InvoiceRepository extends BaseRepository {
|
|||
'invoice_date' => $invoice_date,
|
||||
];
|
||||
$this->model->invoice = $data_file;
|
||||
$this->model->invoice_number = $invoice_number;
|
||||
$this->model->save();
|
||||
|
||||
if($invoice_send_mail){
|
||||
|
|
|
|||
|
|
@ -16,23 +16,23 @@ class Credit
|
|||
|
||||
|
||||
public static function makeNextCreditNumber(){
|
||||
$invoice_number = self::getCreditNumber();
|
||||
$invoice_number = $invoice_number+1;
|
||||
Setting::setContentBySlug('credit-number', $invoice_number, 'int');
|
||||
return $invoice_number;
|
||||
$credit_number = self::getCreditNumber();
|
||||
$credit_number = $credit_number+1;
|
||||
Setting::setContentBySlug('credit-number', $credit_number, 'int');
|
||||
return $credit_number;
|
||||
}
|
||||
|
||||
public static function createCreditNumber($invoice_number, $invoice_date){
|
||||
$prefix = "GS".\Carbon::parse($invoice_date)->format('Ym');
|
||||
return $prefix.$invoice_number;
|
||||
public static function createCreditNumber($credit_number, $credit_date){
|
||||
$prefix = "GS".\Carbon::parse($credit_date)->format('Ym');
|
||||
return $prefix.$credit_number;
|
||||
}
|
||||
|
||||
public static function getCreditStorageDir($invoice_date){
|
||||
return "/credit/".\Carbon::parse($invoice_date)->format('Y/m/');
|
||||
public static function getCreditStorageDir($credit_date){
|
||||
return "/credit/".\Carbon::parse($credit_date)->format('Y/m/');
|
||||
}
|
||||
|
||||
public static function makeCreditFilename($invoice_number){
|
||||
return "Gutschrift-".$invoice_number.".pdf";
|
||||
public static function makeCreditFilename($credit_number){
|
||||
return "Gutschrift-".$credit_number.".pdf";
|
||||
}
|
||||
|
||||
public static function isCredit(UserCredit $user_credit){
|
||||
|
|
@ -64,7 +64,6 @@ class Credit
|
|||
public static function sendCreditMail(UserCredit $user_credit){
|
||||
$bcc = [];
|
||||
$email = $user_credit->user->email;
|
||||
$email = "kevin.adametz@me.com";
|
||||
if(!$email){
|
||||
if($user_credit->user->mode === 'test'){
|
||||
}else{
|
||||
|
|
|
|||
|
|
@ -394,6 +394,18 @@ class HTMLHelper
|
|||
return $ret;
|
||||
}
|
||||
|
||||
public static function getAnyOptions($id, $options = [], $all=true){#
|
||||
$ret = "";
|
||||
if($all){
|
||||
$ret .= '<option value="">'.__('please select').'</option>\n';
|
||||
}
|
||||
foreach ($options as $key=>$value){
|
||||
$attr = ($key == $id) ? 'selected="selected"' : '';
|
||||
$ret .= '<option value="'.$key.'" '.$attr.'>'.$value.'</option>\n';
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
public static function getOptionRange($select, $from=1, $to=50){
|
||||
$values = range($from, $to);
|
||||
$ret = "";
|
||||
|
|
|
|||
|
|
@ -47,6 +47,8 @@ class CreateShoppingOrdersTable extends Migration
|
|||
|
||||
$table->boolean('paid')->default(false);
|
||||
$table->text('invoice')->nullable();
|
||||
|
||||
$table->string('invoice_number', 255)->nullable();
|
||||
$table->string('wp_invoice_path', 255)->nullable();
|
||||
$table->text('wp_notice')->nullable();
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ class CreateUserCreditsTable extends Migration
|
|||
Schema::create('user_credits', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedInteger('auth_user_id');
|
||||
$table->string('credit_number', 255)->nullable();
|
||||
$table->decimal('net', 13, 2)->nullable();
|
||||
$table->decimal('tax_rate', 8, 2)->nullable();
|
||||
$table->decimal('tax', 8, 2)->nullable();
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@
|
|||
'sender' => 'Dein Team von Grüne Seele',
|
||||
'request_from' => 'Anfrage von Grüne Seele',
|
||||
'your_request_from' => 'Deine Anfrage von',
|
||||
'checkout_subject' => 'Deine Bestellung bei',
|
||||
'checkout_subject_paid' => 'Zahlungsbestätigung - Deine Bestellung bei',
|
||||
'checkout_subject' => 'Deine Bestellung',
|
||||
'checkout_subject_paid' => 'Zahlungsbestätigung - Deine Bestellung',
|
||||
'checkout_subject_extern' => 'Neue Bestellung',
|
||||
'change_e_mail' => 'E-Mail Adresse ändern',
|
||||
'salutation' => 'Hallo',
|
||||
|
|
@ -48,7 +48,7 @@
|
|||
'invoice_title' => 'Rechnung zu Deiner Bestellung auf Grüne Seele',
|
||||
'credit_title' => 'Gutschrift aus Vertriebspartnerbestellungen auf Grüne Seele',
|
||||
'invoice_copy1line' => 'vielen Dank für Deine Bestellung bei Grüne Seele. Nachfolgend senden wir Dir die Rechnung zu deiner Bestellung: ',
|
||||
'credit_copy1line' => 'vielen Dank für Deine Vertriebspartnerschaft bei Grüne Seele. Nachfolgend senden wir Dir eine Gutschrift zu Bestellungen von deinen Vertriebspartnern: ',
|
||||
'credit_copy1line' => 'vielen Dank für Deine Vertriebspartnerschaft bei Grüne Seele. Nachfolgend senden wir Dir Deine Gutschrift zu. Der Betrag wird zeitnah angewiesen, bitte prüfen deine Zahlungsdaten in deinem Konto: <a href="https://partner.gruene-seele.bio/user/edit">Mein Konto -> Meine Daten</a>.',
|
||||
'footer_copy1' => 'GRÜNE SEELE GbR | Hauptstrasse 174 | 51143 Köln | Telefon: (+49) 2203 183 86 14 | E-Mail: service@gruene-seele.bio',
|
||||
'footer_copy2' => '',
|
||||
'footer_copy3' => '© 2021 All Rights Reserved',
|
||||
|
|
|
|||
|
|
@ -44,5 +44,6 @@ return [
|
|||
'credit' => 'Gutschriften',
|
||||
'invoice' => 'Rechnungen',
|
||||
'revenue' => 'Umsätze',
|
||||
'paycredit' => 'Guthaben',
|
||||
'paycredit' => 'Einkaufsguthaben',
|
||||
'commissions' => 'Provisionen'
|
||||
];
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{!! Form::open(['url' => route('admin_payments_paycredit'), 'class' => 'modal-content', 'enctype' => 'multipart/form-data']) !!}
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">
|
||||
{{ __('Guthaben') }}
|
||||
{{ __('Einkaufsguthaben') }}
|
||||
<span class="font-weight-light">aufladen</span>
|
||||
</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>
|
||||
|
|
@ -33,7 +33,7 @@
|
|||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">schließen</button>
|
||||
<button type="submit" class="btn btn-primary">{{__('Guthaben aufladen')}}</button>
|
||||
<button type="submit" class="btn btn-primary">{{__('Einkaufsguthaben aufladen')}}</button>
|
||||
|
||||
</div>
|
||||
{!! Form::close() !!}
|
||||
|
|
|
|||
82
resources/views/admin/modal/user-credit-status.blade.php
Normal file
82
resources/views/admin/modal/user-credit-status.blade.php
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
{!! Form::open(['url' => route('admin_payments_credit_create'), 'class' => 'modal-content', 'enctype' => 'multipart/form-data']) !!}
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
.unselectable {
|
||||
-moz-user-select: none;
|
||||
-webkit-user-select: none;
|
||||
-ms-user-select: none;
|
||||
}
|
||||
.selectall {
|
||||
-moz-user-select: all;
|
||||
-webkit-user-select: all;
|
||||
-ms-user-select: all;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">
|
||||
{{ __('Gutschriften Zahlung') }}
|
||||
</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<input type="hidden" name="action" value="{{$data['action']}}">
|
||||
<input type="hidden" name="id" value="{{$data['id']}}">
|
||||
|
||||
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-12">
|
||||
<label for="status" class="form-label">{{ __('Status') }}*</label>
|
||||
{{ Form::select('status', $value::$statusTypes, false, array('data-live-search'=>'false', 'class'=>'selectpicker') ) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table class="table user-view-table m-0">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Zahlungsart:</td>
|
||||
<td>
|
||||
@if ($value->user->account->getPaymentData('payout') === 'paypal')
|
||||
<span class="btn btn-sm btn-outline-twitter">PayPal</span>
|
||||
@endif
|
||||
@if ($value->user->account->getPaymentData('payout') === 'bank')
|
||||
<span class="btn btn-outline-google">Banküberweisung</span>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="unselectable">
|
||||
<td>Bankinhaber</td>
|
||||
<td><div class="selectall">{{ $value->user->account->getPaymentData('bankaccountholder') }}</div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>IBAN:</td>
|
||||
<td><div class="selectall">{{ $value->user->account->getPaymentData('iban') }}</div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>BIC:</td>
|
||||
<td><div class="selectall">{{ $value->user->account->getPaymentData('bic') }}</div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>PayPal:</td>
|
||||
<td><div class="selectall">{{ $value->user->account->getPaymentData('paypal_address') }}</div></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">schließen</button>
|
||||
<button type="submit" class="btn btn-primary">{{__('speichern')}}</button>
|
||||
|
||||
</div>
|
||||
{!! Form::close() !!}
|
||||
|
||||
<script type="text/javascript">
|
||||
$( document ).ready(function() {
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">
|
||||
{{ __('Zahlungen / Guthaben') }}
|
||||
{{ __('Zahlungen / Einkaufsguthaben') }}
|
||||
<strong>
|
||||
@if($user->account)
|
||||
{{ $user->account->first_name }}
|
||||
|
|
@ -43,7 +43,7 @@
|
|||
<td><div class="no-line-break">{{ formatDate($user_pay_credit->created_at) }}</div></td>
|
||||
|
||||
@if($user_pay_credit->shopping_order_id)
|
||||
<td><a class="btn btn-secondary btn-xs" href="{{ route('admin_sales_users_detail', [$user_pay_credit->shopping_order_id]) }}"><i class="ion ion-ios-redo"></i></a></td>
|
||||
<td><a class="btn btn-secondary btn-xs" href="{{ route('admin_sales_users_detail', [$user_pay_credit->shopping_order_id]) }}"><i class="ion ion-md-eye"></i></a></td>
|
||||
@else
|
||||
@if($user_pay_credit->status === 3 && $deleteTime = $user_pay_credit->deleteTime())
|
||||
<td><div class="no-line-break"><a class="btn btn-danger btn-xs" href="{{ route('admin_payments_paycredit_delete', [$user_pay_credit->id]) }}"><i class="ion ion-ios-trash"></i></a> noch {{ $deleteTime }} min.</div>
|
||||
|
|
|
|||
|
|
@ -122,14 +122,15 @@
|
|||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>{{__('G.Nr.')}}</th>
|
||||
<th>{{__('Gutschrift')}}</th>
|
||||
<th>{{__('Vorname')}}</th>
|
||||
<th>{{__('Nachname') }}</th>
|
||||
<th>{{__('E-Mail') }}</th>
|
||||
<th>{{__('Betrag') }}</th>
|
||||
<th>{{__('Datum') }}</th>
|
||||
<th>{{__('Zahlung')}}</th>
|
||||
<th>{{__('aus Bestellung')}}</th>
|
||||
<th>{{__('Status')}}</th>
|
||||
<th>{{__('Gutschrift')}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
|
@ -137,59 +138,9 @@
|
|||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$( document ).ready(function() {
|
||||
var oTable = $('#datatable-credit').DataTable({
|
||||
"processing": true,
|
||||
"serverSide": true,
|
||||
ajax: {
|
||||
url: '{!! route( 'admin_payments_credit_datatable') !!}',
|
||||
data: function(d) {
|
||||
d.filter_sales_year = $('select[name=filter_sales_year]').val();
|
||||
}
|
||||
},
|
||||
"order": [[0, "desc" ]],
|
||||
"columns": [
|
||||
{ data: 'id', searchable: false },
|
||||
{ data: 'user.account.first_name', name: 'user.account.first_name', orderable: false },
|
||||
{ data: 'user.account.last_name', name: 'user.account.last_name', orderable: false },
|
||||
{ data: 'user.email', name: 'user.email', orderable: false },
|
||||
{ data: 'total', name: 'total' },
|
||||
{ data: 'date', name: 'date' },
|
||||
{ data: 'user_margins', name: 'user_margins', orderable: false },
|
||||
{ data: 'status', name: 'status', searchable: false },
|
||||
{ data: 'credit', name: 'credit', orderable: false, searchable: false },
|
||||
],
|
||||
"bLengthChange": false,
|
||||
"iDisplayLength": 100,
|
||||
"language": {
|
||||
"url": "/js/German.json"
|
||||
}
|
||||
});
|
||||
$('#filter_sales_year').on('change', function(){
|
||||
oTable.draw();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
/*$('#filter_sales_year').on('change', function(){
|
||||
$('#form_filter_sales_year').submit();
|
||||
});*/
|
||||
|
||||
|
||||
$( document ).ready(function() {
|
||||
$('#modals-credit').on('show.bs.modal', function (event) {
|
||||
var button = $(event.relatedTarget);
|
||||
$(this).find(".modal-content input[name='userid']").val(button.data('userid'));
|
||||
$(this).find(".modal-body #set_credit_send_mail").html(button.data('email'));
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<div class="modal fade" id="modals-credit">
|
||||
<div class="modal-dialog">
|
||||
<form class="modal-content" action="{{ route('admin_payments_credit_create') }}" method="post">
|
||||
|
|
@ -217,7 +168,7 @@
|
|||
<div class="form-group col-sm-12">
|
||||
<label class="custom-control custom-checkbox">
|
||||
{!! Form::checkbox('credit_send_mail', 1, true, ['class'=>'custom-control-input']) !!}
|
||||
<span class="custom-control-label">Rechnung an <span id="set_credit_send_mail">123</span></span>
|
||||
<span class="custom-control-label">Gutschrift an <span id="set_credit_send_mail">mail</span></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -228,5 +179,50 @@
|
|||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$( document ).ready(function() {
|
||||
var oTable = $('#datatable-credit').DataTable({
|
||||
"processing": true,
|
||||
"serverSide": true,
|
||||
ajax: {
|
||||
url: '{!! route( 'admin_payments_credit_datatable') !!}',
|
||||
data: function(d) {
|
||||
d.filter_sales_year = $('select[name=filter_sales_year]').val();
|
||||
}
|
||||
},
|
||||
"order": [[0, "desc" ]],
|
||||
"columns": [
|
||||
{ data: 'id', searchable: false },
|
||||
{ data: 'credit_number', name: 'credit_number' },
|
||||
{ data: 'credit', name: 'credit', orderable: false, searchable: false },
|
||||
{ data: 'user.account.first_name', name: 'user.account.first_name', orderable: false },
|
||||
{ data: 'user.account.last_name', name: 'user.account.last_name', orderable: false },
|
||||
{ data: 'user.email', name: 'user.email', orderable: false },
|
||||
{ data: 'total', name: 'total' },
|
||||
{ data: 'date', name: 'date' },
|
||||
{ data: 'status', name: 'status', searchable: false },
|
||||
{ data: 'user_margins', name: 'user_margins', orderable: false },
|
||||
],
|
||||
"bLengthChange": false,
|
||||
"iDisplayLength": 100,
|
||||
"language": {
|
||||
"url": "/js/German.json"
|
||||
}
|
||||
});
|
||||
$('#filter_sales_year').on('change', function(){
|
||||
oTable.draw();
|
||||
});
|
||||
|
||||
$( document ).ready(function() {
|
||||
$('#modals-credit').on('show.bs.modal', function (event) {
|
||||
var button = $(event.relatedTarget);
|
||||
$(this).find(".modal-content input[name='userid']").val(button.data('userid'));
|
||||
$(this).find(".modal-body #set_credit_send_mail").html(button.data('email'));
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
|
|
|
|||
|
|
@ -22,15 +22,16 @@
|
|||
<table class="datatables-style table table-striped table-bordered" id="datatable-invoice">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>#</th>
|
||||
<th>{{__('Re.Nr.')}}</th>
|
||||
<th>{{__('Rechnung')}}</th>
|
||||
<th>{{__('Vorname')}}</th>
|
||||
<th>{{__('Nachname') }}</th>
|
||||
<th>{{__('E-Mail') }}</th>
|
||||
<th>{{__('Betrag') }}</th>
|
||||
<th>{{__('Datum') }}</th>
|
||||
<th>{{__('Order')}}</th>
|
||||
<th>{{__('Status')}}</th>
|
||||
<th>{{__('Rechnung')}}</th>
|
||||
<th>{{__('Order')}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
|
@ -55,14 +56,15 @@
|
|||
"order": [[0, "desc" ]],
|
||||
"columns": [
|
||||
{ data: 'id', searchable: false },
|
||||
{ data: 'invoice_number', name: 'invoice_number' },
|
||||
{ data: 'invoice', name: 'invoice', orderable: false, searchable: false },
|
||||
{ data: 'shopping_user.billing_firstname', name: 'shopping_user.billing_firstname', orderable: false },
|
||||
{ data: 'shopping_user.billing_lastname', name: 'shopping_user.billing_lastname', orderable: false },
|
||||
{ data: 'shopping_user.billing_email', name: 'shopping_user.billing_email', orderable: false },
|
||||
{ data: 'total_shipping', name: 'total_shipping' },
|
||||
{ data: 'created_at', name: 'shopping_orders.created_at' },
|
||||
{ data: 'shipping_order', name: 'shipping_order', orderable: false },
|
||||
{ data: 'txaction', name: 'txaction', searchable: false },
|
||||
{ data: 'invoice', name: 'invoice', orderable: false, searchable: false },
|
||||
{ data: 'shipping_order', name: 'shipping_order', orderable: false },
|
||||
],
|
||||
"bLengthChange": false,
|
||||
"iDisplayLength": 100,
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
data-id="new"
|
||||
data-action="add-user-pay-credit"
|
||||
data-back="{{url()->current()}}"
|
||||
data-route="{{ route('modal_load') }}"><span class="far fa-plus-circle"></span> Guthaben aufladen
|
||||
data-route="{{ route('modal_load') }}"><span class="far fa-plus-circle"></span> Einkaufsguthaben aufladen
|
||||
</button>
|
||||
</div>
|
||||
</h6>
|
||||
|
|
|
|||
|
|
@ -204,7 +204,7 @@
|
|||
<a class="btn btn-sm btn-secondary" href="{{ route('user_payment_paycredit') }}">zur Übersicht</a>
|
||||
</div>
|
||||
<span class="ion ion-md-checkmark-circle-outline text-secondary"></span>
|
||||
{{__('Guthaben')}}: <strong>{{ $user->getFormattedPaymentCredit() }} €</strong>
|
||||
{{__('Einkaufsguthaben')}}: <strong>{{ $user->getFormattedPaymentCredit() }} €</strong>
|
||||
|
||||
</p>
|
||||
<hr>
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
<div class="demo-navbar-user nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" href="#" data-toggle="dropdown">
|
||||
<span class="d-inline-flex flex-lg-row-reverse align-items-center align-middle">
|
||||
<span class="px-1 ml-2 ml-lg-0"> Guthaben <strong>{{ Auth::user()->getFormattedPaymentCredit() }} €</strong> |<br class="d-sm-none"> {{ Auth::user()->email }}</span>
|
||||
<span class="px-1 ml-2 ml-lg-0"> Einkaufsguthaben <strong>{{ Auth::user()->getFormattedPaymentCredit() }} €</strong> |<br class="d-sm-none"> {{ Auth::user()->email }}</span>
|
||||
</span>
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-menu-right">
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
</li>
|
||||
{{--
|
||||
<li class="sidenav-item Request::is('user/payment/credit') ? ' active' : '' }} {{ Request::is('user/payment/credit') ? ' active' : '' }}">
|
||||
<a href="{{ route('user_payment_credit') }}" class="sidenav-link"><i class="sidenav-icon ion ion-md-cash"></i><div>{{ __('navigation.credit') }}</div></a>
|
||||
<a href="{{ route('user_payment_credit') }}" class="sidenav-link"><i class="sidenav-icon ion ion-md-cash"></i><div>{{ __('navigation.commissions') }}</div></a>
|
||||
</li>
|
||||
--}}
|
||||
<li class="sidenav-item{{ Request::is('user/edit') ? ' active' : '' }}">
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
@else
|
||||
<th scope="row">{{ trans('payment.'.$user_pay_credit->message) }}
|
||||
@if($user_pay_credit->shopping_order_id)
|
||||
<a class="btn btn-outline-secondary btn-xs" href="{{ route('admin_sales_users_detail', [$user_pay_credit->shopping_order_id]) }}"><i class="ion ion-ios-redo"></i></a>
|
||||
<a class="btn btn-outline-secondary btn-xs" href="{{ route('admin_sales_users_detail', [$user_pay_credit->shopping_order_id]) }}"><i class="ion ion-md-eye"></i></a>
|
||||
@endif
|
||||
</th>
|
||||
@endif
|
||||
|
|
|
|||
|
|
@ -322,7 +322,60 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="card mb-4">
|
||||
<h5 class="card-header">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
Zahlungsdaten
|
||||
</div>
|
||||
</div>
|
||||
</h5>
|
||||
<div class="card-body">
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label class="form-label" for="payment_data_payout">{{ __('Auszahlungsart') }}</label>
|
||||
<select class="selectpicker" name="payment_data[payout]" id="payment_data_payout" data-style="btn-light">
|
||||
{!! HTMLHelper::getAnyOptions($user->account->getPaymentData('payout'), ['bank'=>'Banküberweisung', 'paypal'=>'PayPal']) !!}
|
||||
</select>
|
||||
<p class="badge">Bitte wählen Deine bevorzugte Auszahlungsart</p>
|
||||
</div>
|
||||
<div class="form-group col-md-12">
|
||||
<label class="form-label" for="payment_data_bankaccountholder">{{ __('Kontoinhaber') }}</label>
|
||||
{{ Form::text('payment_data[bankaccountholder]', $user->account->getPaymentData('bankaccountholder'), array('placeholder'=>__('Vornamen Nachname'), 'class'=>'form-control', 'id'=>'payment_data_bankaccountholder')) }}
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label class="form-label" for="payment_data_iban">{{ __('IBAN') }}</label>
|
||||
{{ Form::text('payment_data[iban]', $user->account->getPaymentData('iban'), array('placeholder'=>__('DE0212030000000012345'), 'class'=>'form-control', 'id'=>'payment_data_iban')) }}
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label class="form-label" for="payment_data_bic">{{ __('BIC') }}</label>
|
||||
{{ Form::text('payment_data[bic]', $user->account->getPaymentData('bic'), array('placeholder'=>__('BYLADEM1234'), 'class'=>'form-control', 'id'=>'payment_data_bic')) }}
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<hr>
|
||||
</div>
|
||||
<div class="form-group col-md-12">
|
||||
<label class="form-label" for="payment_data_paypal_address">{{ __('PayPal-Adresse') }}</label>
|
||||
{{ Form::text('payment_data[paypal_address]', $user->account->getPaymentData('paypal_address'), array('placeholder'=>__('E-Mail-Adresse'), 'class'=>'form-control', 'id'=>'payment_data_paypal_address')) }}
|
||||
<div class="badge badge-default mt-2">Hinweis: Bei einer Auszahlung über PayPal fallen Gebühren an!</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mb-4">
|
||||
<h5 class="card-header">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
Steuerdaten
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</h5>
|
||||
<div class="card-body">
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue