From 35ae3da2448e6a34e2f91703cf22194e0a221eed Mon Sep 17 00:00:00 2001
From: Kevin Adametz
Date: Wed, 31 Mar 2021 17:58:25 +0200
Subject: [PATCH] Rechnungen + Gutschriften
---
.env | 1 +
app/Http/Controllers/FileController.php | 28 +
.../Controllers/PaymentCreditController.php | 138 +++++
.../Controllers/PaymentInvoiceController.php | 101 ++++
app/Http/Controllers/SalesController.php | 41 +-
app/Http/Controllers/User/OrderController.php | 1 +
.../Controllers/User/RevenueController.php | 53 ++
app/Models/ShoppingOrder.php | 12 +-
app/Models/ShoppingOrderMargin.php | 24 +-
app/Models/UserCredit.php | 116 ++++
app/Repositories/CreditRepository.php | 122 ++++
app/Services/Invoice.php | 31 +-
app/Services/UserMarign.php | 113 +++-
app/Services/Yard.php | 9 +-
app/User.php | 6 +
config/app.php | 1 +
...23_163527_create_shopping_orders_table.php | 2 +
...07_create_shopping_order_margins_table.php | 2 +
...03_23_191712_create_user_credits_table.php | 48 ++
resources/lang/de/navigation.php | 6 +-
resources/views/admin/level/edit.blade.php | 4 +-
.../admin/payment/credit/index.blade.php | 232 +++++++
.../admin/payment/invoice/index.blade.php | 86 +++
.../views/admin/settings/index.blade.php | 14 +
resources/views/dashboard.blade.php | 14 +-
.../layouts/includes/layout-sidenav.blade.php | 21 +-
resources/views/pdf/credit.blade.php | 400 ++++++++++++
resources/views/pdf/invoice.blade.php | 6 +-
resources/views/user/revenue/index.blade.php | 65 ++
resources/views/user/user_form.blade.php | 8 +-
routes/web.php | 19 +
storage/fonts/Times-Bold.afm.php | 572 ++++++++++++++++++
storage/fonts/Times-Italic.afm.php | 572 ++++++++++++++++++
33 files changed, 2834 insertions(+), 34 deletions(-)
create mode 100644 app/Http/Controllers/PaymentCreditController.php
create mode 100644 app/Http/Controllers/PaymentInvoiceController.php
create mode 100644 app/Http/Controllers/User/RevenueController.php
create mode 100644 app/Models/UserCredit.php
create mode 100644 app/Repositories/CreditRepository.php
create mode 100644 database/migrations/2021_03_23_191712_create_user_credits_table.php
create mode 100755 resources/views/admin/payment/credit/index.blade.php
create mode 100755 resources/views/admin/payment/invoice/index.blade.php
create mode 100644 resources/views/pdf/credit.blade.php
create mode 100644 resources/views/user/revenue/index.blade.php
create mode 100644 storage/fonts/Times-Bold.afm.php
create mode 100644 storage/fonts/Times-Italic.afm.php
diff --git a/.env b/.env
index 796215a..a684077 100644
--- a/.env
+++ b/.env
@@ -10,6 +10,7 @@ APP_INFO_MAIL=kevin.adametz@me.com
APP_INFO_TEST_MAIL=kevin.adametz@me.com
APP_MAIN_TAX = 1.19
+APP_MAIN_TAX_RATE = 19
LOG_CHANNEL=stack
LOG_LEVEL=debug
diff --git a/app/Http/Controllers/FileController.php b/app/Http/Controllers/FileController.php
index c13ba76..bd395c3 100644
--- a/app/Http/Controllers/FileController.php
+++ b/app/Http/Controllers/FileController.php
@@ -61,6 +61,34 @@ class FileController extends Controller
}
+ if ($disk === 'credit'){
+ $UserCredit = \App\Models\UserCredit::findOrFail($id);
+ $filename = Invoice::getCreditFilename($UserCredit);
+ $path = Invoice::getCreditDownloadPath($UserCredit);
+ if (!Storage::disk('public')->exists($path)) {
+ return Response::make('File no found.', 404);
+ }
+ $file = Storage::disk('public')->get($path);
+ $type = Storage::disk('public')->mimeType($path);
+
+ if($do === 'download'){
+ return Response::make($file, 200)
+ ->header("Content-Type", $type)
+ ->header('Content-disposition', 'attachment; filename="'.$filename.'"');
+ /* $full_path = Invoice::getDownloadPath($shopping_order, true);
+ $he
+ if (file_exists($full_path)) {
+ return Response::download($full_path, $filename);
+ }*/
+ }
+ if($do === 'stream'){
+ return Response::make($file, 200)
+ ->header("Content-Type", $type)
+ ->header('Content-disposition','filename="'.$filename.'"');
+ }
+
+ }
+
}
}
\ No newline at end of file
diff --git a/app/Http/Controllers/PaymentCreditController.php b/app/Http/Controllers/PaymentCreditController.php
new file mode 100644
index 0000000..7643caf
--- /dev/null
+++ b/app/Http/Controllers/PaymentCreditController.php
@@ -0,0 +1,138 @@
+middleware('auth');
+ $this->startYear = 2021;
+ $this->endYear = date('Y');
+ $this->rangeYears = range($this->startYear, $this->endYear);
+ $this->activeYear = $this->endYear;
+
+ }
+
+ public function index()
+ {
+ $this->setActiveYears();
+ $date1 = Carbon::parse('01.01.'.$this->activeYear." 00:00:00")->format('Y-m-d H:i:s');
+ $date2 = Carbon::parse('31.12.'.$this->activeYear." 23:59:59")->toDateString();
+
+
+ $ShoppingOrderMargins = ShoppingOrderMargin::join('users', 'm_sponsor_id', '=', 'users.id')
+ ->groupBy('m_sponsor_id')
+ ->join('user_accounts', 'account_id', '=', 'user_accounts.id')
+ ->select('users.id as user_id', 'users.email', 'user_accounts.first_name', 'user_accounts.last_name')
+ ->wherePaid(true)
+ ->whereCancellation(false)
+ ->wherePartnerCommissionPaid(false)
+ ->where('partner_commission_pending_to', '<', Carbon::now())
+ ->get();
+
+ $ShoppingOrderMarginPendings = ShoppingOrderMargin::join('users', 'm_sponsor_id', '=', 'users.id')
+ ->groupBy('m_sponsor_id')
+ ->join('user_accounts', 'account_id', '=', 'user_accounts.id')
+ ->select('users.id as user_id', 'users.email', 'user_accounts.first_name', 'user_accounts.last_name')
+ ->wherePaid(true)
+ ->whereCancellation(false)
+ ->wherePartnerCommissionPaid(false)
+ ->where('partner_commission_pending_to', '>=', Carbon::now())
+ ->get();
+
+
+ $data = [
+ 'years' => $this->rangeYears,
+ 'active_year' => $this->activeYear,
+ 'ShoppingOrderMargins' => $ShoppingOrderMargins,
+ 'ShoppingOrderMarginPendings' => $ShoppingOrderMarginPendings,
+ ];
+ return view('admin.payment.credit.index', $data);
+ }
+
+ public function create(){
+ $data = Request::all();
+ if(!isset($data['userid'])){
+ abort(404);
+ }
+ if(isset($data['action'])){
+ if($data['action'] === 'create_credit'){
+ $user = User::findOrFail($data['userid']);
+ $invoice_repo = new CreditRepository($user);
+ $invoice_repo->create($data);
+ return redirect($data['back']);
+ }
+ }
+ }
+
+ private function setActiveYears(){
+ if(Request::get('filter_sales_year')){
+ $this->activeYear = Request::get('filter_sales_year');
+ }
+ }
+
+ public function datatable(){
+
+ $this->setActiveYears();
+ $date1 = Carbon::parse('01.01.'.$this->activeYear)->format('Y-m-d');
+ $date2 = Carbon::parse('31.12.'.$this->activeYear)->format('Y-m-d');
+
+ $query = UserCredit::with('user', 'user.account')->select('user_credits.*')
+ //::with('shopping_user', )->select('shopping_orders.*')
+ //->where('paid', '=', 1)
+ ->whereBetween('date', [$date1, $date2]);
+ //->orderBy('created_at', 'DESC');
+
+ return \DataTables::eloquent($query)
+
+
+ ->addColumn('total', function (UserCredit $UserCredit) {
+ return $UserCredit->getFormattedTotal();
+ })
+ ->addColumn('user_margins', function (UserCredit $UserCredit) {
+ $ret = "";
+ if($UserCredit->user_margins){
+ foreach($UserCredit->user_margins as $user_margin){
+ $ret .= $user_margin->firstname."/".$user_margin->lastname."/".$user_margin->reference."/".$user_margin->created_at." ";
+ }
+ }
+ return $ret;
+ })
+ /* ->addColumn('txaction', function (ShoppingOrder $ShoppingOrder) {
+ return Payment::getShoppingOrderBadge($ShoppingOrder);
+ })*/
+ ->addColumn('credit', function (UserCredit $UserCredit) {
+ $ret = "";
+ if(Invoice::isCredit($UserCredit)){
+ $ret .= ' ';
+ $ret .= ' ';
+ }else{
+ $ret = "-";
+ }
+ return $ret;
+ })
+
+ ->orderColumn('id', 'id $1')
+ ->orderColumn('status', 'status $1')
+ ->orderColumn('total', 'total $1')
+ ->rawColumns(['shipping_order', 'total', 'credit', 'user_margins'])
+ ->make(true);
+ }
+}
\ No newline at end of file
diff --git a/app/Http/Controllers/PaymentInvoiceController.php b/app/Http/Controllers/PaymentInvoiceController.php
new file mode 100644
index 0000000..81774c8
--- /dev/null
+++ b/app/Http/Controllers/PaymentInvoiceController.php
@@ -0,0 +1,101 @@
+middleware('auth');
+ $this->startYear = 2021;
+ $this->endYear = date('Y');
+ $this->rangeYears = range($this->startYear, $this->endYear);
+ $this->activeYear = $this->endYear;
+
+ }
+
+ public function index()
+ {
+ $this->setActiveYears();
+ $date1 = Carbon::parse('01.01.'.$this->activeYear." 00:00:00")->format('Y-m-d H:i:s');
+ $date2 = Carbon::parse('31.12.'.$this->activeYear." 23:59:59")->toDateString();
+
+ $data = [
+ 'years' => $this->rangeYears,
+ 'active_year' => $this->activeYear,
+ ];
+ return view('admin.payment.invoice.index', $data);
+ }
+
+ private function setActiveYears(){
+ if(Request::get('filter_sales_year')){
+ $this->activeYear = Request::get('filter_sales_year');
+ }
+ }
+
+ public function datatable(){
+
+ $this->setActiveYears();
+ $date1 = Carbon::parse('01.01.'.$this->activeYear." 00:00:00")->format('Y-m-d H:i:s');
+ $date2 = Carbon::parse('31.12.'.$this->activeYear." 23:59:59")->toDateString();
+
+ $query = ShoppingOrder::with('shopping_user')->select('shopping_orders.*')
+ ->where('shopping_orders.auth_user_id', '!=', NULL) //::with('shopping_user', )->select('shopping_orders.*')
+ ->where('mode', '=', 'live')
+ //->where('paid', '=', 1)
+ ->whereBetween('created_at', [$date1, $date2]);
+ //->orderBy('created_at', 'DESC');
+
+ return \DataTables::eloquent($query)
+ ->addColumn('id', function (ShoppingOrder $ShoppingOrder) {
+ return ' ';
+ })
+ ->addColumn('total_shipping', function (ShoppingOrder $ShoppingOrder) {
+ return $ShoppingOrder->getFormattedTotalShipping()." €";
+ })
+ ->addColumn('created_at', function (ShoppingOrder $ShoppingOrder) {
+ return $ShoppingOrder->created_at->format("d.m.Y");
+ })
+ ->addColumn('shipping_order', function (ShoppingOrder $ShoppingOrder) {
+ $ret = "";
+ foreach($ShoppingOrder->shopping_order_items as $shopping_order_item){
+ $ret .= $shopping_order_item->product->name." ";
+ }
+ return $ret;
+ })
+ ->addColumn('txaction', function (ShoppingOrder $ShoppingOrder) {
+ return Payment::getShoppingOrderBadge($ShoppingOrder);
+ })
+ ->addColumn('invoice', function (ShoppingOrder $ShoppingOrder) {
+ $ret = "";
+ if(Invoice::isInvoice($ShoppingOrder)){
+ $ret .= ' ';
+ $ret .= ' ';
+ }else{
+ $ret = "-";
+ }
+ return $ret;
+ })
+
+ ->orderColumn('id', 'id $1')
+ ->orderColumn('txaction', 'txaction $1')
+ ->orderColumn('shipped', 'shipped $1')
+ ->orderColumn('total_shipping', 'total_shipping $1')
+ ->rawColumns(['id', 'shipping_order', 'txaction', 'invoice'])
+ ->make(true);
+ }
+}
\ No newline at end of file
diff --git a/app/Http/Controllers/SalesController.php b/app/Http/Controllers/SalesController.php
index 91818c8..65c8dcc 100755
--- a/app/Http/Controllers/SalesController.php
+++ b/app/Http/Controllers/SalesController.php
@@ -3,6 +3,7 @@
namespace App\Http\Controllers;
use App\Models\PaymentTransaction;
+use App\Models\Setting;
use App\Models\ShoppingOrder;
use App\Models\ShoppingPayment;
use App\Models\ShoppingUser;
@@ -245,9 +246,7 @@ class SalesController extends Controller
return '';
})
-
-
- ->orderColumn('id', 'id $1')
+ ->orderColumn('id', 'id $1')
->orderColumn('txaction', 'txaction $1')
->orderColumn('member_id', 'member_id $1')
->orderColumn('shipped', 'shipped $1')
@@ -266,6 +265,42 @@ class SalesController extends Controller
$shopping_order = ShoppingOrder::findOrFail($data['id']);
$shopping_order->shipped = $data['shipped'];
$shopping_order->save();
+
+ if($shopping_order->getAPIShippedType() === 'sent' || $shopping_order->getAPIShippedType() === 'close'){
+ if(!$shopping_order->shipped_at){
+ $shopping_order->shipped_at = now();
+ $shopping_order->save();
+ //set to oder_margin
+ if($shopping_order->shopping_order_margin && $shopping_order->shopping_order_margin->hasPartnerCommission()){
+ $days = Setting::getContentBySlug('pending_partner_commissions_in_days');
+ $days = $days ? $days : 20;
+ $partner_commission_pending_to = $shopping_order->shipped_at;
+ $partner_commission_pending_to->addDays($days);
+ $shopping_order->shopping_order_margin->partner_commission_pending_to = $partner_commission_pending_to;
+ $shopping_order->shopping_order_margin->save();
+ }
+ }
+ }else{
+ $shopping_order->shipped_at = null;
+ $shopping_order->save();
+ if($shopping_order->shopping_order_margin && $shopping_order->shopping_order_margin->hasPartnerCommission()){
+ $shopping_order->shopping_order_margin->partner_commission_pending_to = null;
+ $shopping_order->shopping_order_margin->save();
+ }
+ }
+ if($shopping_order->getAPIShippedType() === 'cancel'){
+ if($shopping_order->shopping_order_margin){
+ $shopping_order->shopping_order_margin->cancellation = true;
+ $shopping_order->shopping_order_margin->save();
+ }
+ }else{
+ if($shopping_order->shopping_order_margin && $shopping_order->shopping_order_margin->cancellation){
+ $shopping_order->shopping_order_margin->cancellation = false;
+ $shopping_order->shopping_order_margin->save();
+ }
+ }
+
+
}
if($data['action'] === 'store_txaction' && isset($data['txaction']) && isset($data['payment_id'])){
diff --git a/app/Http/Controllers/User/OrderController.php b/app/Http/Controllers/User/OrderController.php
index 436e8ab..bfba84e 100755
--- a/app/Http/Controllers/User/OrderController.php
+++ b/app/Http/Controllers/User/OrderController.php
@@ -135,6 +135,7 @@ class OrderController extends Controller
public function list($for, $id=null)
{
+
$user = User::find(\Auth::user()->id);
$shopping_user = null;
$delivery_id = null;
diff --git a/app/Http/Controllers/User/RevenueController.php b/app/Http/Controllers/User/RevenueController.php
new file mode 100644
index 0000000..5ddd592
--- /dev/null
+++ b/app/Http/Controllers/User/RevenueController.php
@@ -0,0 +1,53 @@
+middleware('auth');
+ }
+
+ public function index()
+ {
+ $start = 2021;
+ $end = date('Y');
+ $years = range($start, $end);
+
+ if(Request::get('filter_sales_year')){
+ $active_year = Request::get('filter_sales_year');
+ }else{
+ $active_year = $end;
+ }
+
+ $date1 = Carbon::parse('01.01.'.$active_year." 00:00:00")->format('Y-m-d H:i:s');
+ $date2 = Carbon::parse('31.12.'.$active_year." 23:59:59")->toDateString();
+
+
+ $values = ShoppingOrder::where('shopping_orders.auth_user_id', '!=', NULL) //::with('shopping_user', )->select('shopping_orders.*')
+ ->where('mode', '=', 'live')
+ ->where('paid', '=', 1)
+ ->whereHas('shopping_order_items', function($q) {
+
+ $q->where('product_id', 34)->OrWhere('product_id', 35)->OrWhere('product_id', 36)->OrWhere('product_id', 67)->OrWhere('product_id', 69);
+ })
+ ->whereBetween('created_at', [$date1, $date2])
+ ->get();
+
+ $data = [
+ 'years' => $years,
+ 'active_year' => $active_year,
+ 'values' => $values,
+ ];
+ return view('user.revenue.index', $data);
+ }
+}
\ No newline at end of file
diff --git a/app/Models/ShoppingOrder.php b/app/Models/ShoppingOrder.php
index 18d6acc..df8a464 100644
--- a/app/Models/ShoppingOrder.php
+++ b/app/Models/ShoppingOrder.php
@@ -93,6 +93,10 @@ use Illuminate\Database\Eloquent\SoftDeletes;
* @method static \Illuminate\Database\Eloquent\Builder|ShoppingOrder whereSubtotalShipping($value)
* @property string|null $total_without_credit
* @method static \Illuminate\Database\Eloquent\Builder|ShoppingOrder whereTotalWithoutCredit($value)
+ * @property array|null $invoice
+ * @property \Illuminate\Support\Carbon|null $shipped_at
+ * @method static \Illuminate\Database\Eloquent\Builder|ShoppingOrder whereInvoice($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|ShoppingOrder whereShippedAt($value)
*/
class ShoppingOrder extends Model
{
@@ -127,12 +131,14 @@ class ShoppingOrder extends Model
'wp_notice',
'mode',
'shipped',
+ 'shipped_at',
'tracking'
];
protected $casts = [
'wp_notice' => 'array',
'invoice' => 'array',
+ 'shipped_at' => 'datetime',
];
public static $shippedTypes = [
@@ -159,9 +165,6 @@ class ShoppingOrder extends Model
10 => 'danger',
];
-
-
-
public function shopping_user()
{
return $this->belongsTo('App\Models\ShoppingUser','shopping_user_id');
@@ -298,9 +301,6 @@ class ShoppingOrder extends Model
return formatNumber($this->attributes['total_shipping']);
}
-
-
-
public function getItemsCount(){
$count = 0;
if($this->shopping_order_items){
diff --git a/app/Models/ShoppingOrderMargin.php b/app/Models/ShoppingOrderMargin.php
index f7c740b..9003296 100644
--- a/app/Models/ShoppingOrderMargin.php
+++ b/app/Models/ShoppingOrderMargin.php
@@ -52,6 +52,11 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|ShoppingOrderMargin whereUpdatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|ShoppingOrderMargin whereUserId($value)
* @mixin \Eloquent
+ * @property \Illuminate\Support\Carbon|null $partner_commission_pending_to
+ * @property bool|null $partner_commission_paid
+ * @property-read User|null $m_sponsor
+ * @method static \Illuminate\Database\Eloquent\Builder|ShoppingOrderMargin wherePartnerCommissionPaid($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|ShoppingOrderMargin wherePartnerCommissionPendingTo($value)
*/
class ShoppingOrderMargin extends Model
{
@@ -68,7 +73,9 @@ class ShoppingOrderMargin extends Model
'net_partner_commission' => 'float',
'paid' => 'bool',
'cancellation' => 'bool',
- 'status' => 'int'
+ 'status' => 'int',
+ 'partner_commission_pending_to' => 'datetime',
+ 'partner_commission_paid' => 'bool',
];
protected $dates = [
@@ -88,6 +95,8 @@ class ShoppingOrderMargin extends Model
'paid',
'cancellation',
'status',
+ 'partner_commission_pending_to',
+ 'partner_commission_paid',
'content'
];
@@ -105,4 +114,17 @@ class ShoppingOrderMargin extends Model
{
return $this->belongsTo(User::class, 'm_sponsor_id');
}
+
+
+ public function m_sponsor()
+ {
+ return $this->belongsTo(User::class, 'm_sponsor_id');
+ }
+
+ public function hasPartnerCommission(){
+ if($this->m_sponsor_id || $this->net_partner_commission > 0){
+ return true;
+ }
+ return false;
+ }
}
diff --git a/app/Models/UserCredit.php b/app/Models/UserCredit.php
new file mode 100644
index 0000000..89ba7ed
--- /dev/null
+++ b/app/Models/UserCredit.php
@@ -0,0 +1,116 @@
+ 'int',
+ 'net' => 'float',
+ 'tax_rate' => 'float',
+ 'tax' => 'float',
+ 'total' => 'float',
+ 'paid_out' => 'bool',
+ 'cancellation' => 'bool',
+ 'status' => 'int',
+ 'credit' => 'array',
+ 'user_margins' => 'object'
+ ];
+
+ protected $fillable = [
+ 'auth_user_id',
+ 'net',
+ 'tax_rate',
+ 'tax',
+ 'total',
+ 'date',
+ 'credit',
+ 'user_margins',
+ 'paid_out',
+ 'cancellation',
+ 'status'
+ ];
+
+ public function user()
+ {
+ return $this->belongsTo(\App\User::class, 'auth_user_id');
+ }
+
+ public function getDateAttribute($value)
+ {
+ if(!$value){
+ return "";
+ }
+ return Carbon::parse($value)->format(\Util::formatDateDB());
+ }
+
+
+ public function setDateAttribute( $value ) {
+ $this->attributes['date'] = isset($value) ? (new Carbon($value))->format('Y-m-d') : NULL;
+ }
+ public function getDateRaw(){
+ return isset($this->attributes['date']) ? $this->attributes['date'] : NULL;
+ }
+
+ public function getFormattedTax()
+ {
+ return formatNumber($this->attributes['tax']);
+ }
+
+ public function getFormattedNet()
+ {
+ return formatNumber($this->attributes['net']);
+ }
+
+ public function getFormattedTotal()
+ {
+ return formatNumber($this->attributes['total']);
+ }
+
+}
diff --git a/app/Repositories/CreditRepository.php b/app/Repositories/CreditRepository.php
new file mode 100644
index 0000000..516201b
--- /dev/null
+++ b/app/Repositories/CreditRepository.php
@@ -0,0 +1,122 @@
+model = $model;
+ }
+
+ public function create($request = [])
+ {
+ //need invoice $data
+ $credit_number = isset($request['credit_number']) ? $request['credit_number'] : Invoice::getInvoiceNumber();
+ $credit_date = isset($request['credit_date']) ? $request['credit_date'] : \Carbon::now()->format("d.m.Y");
+ $credit_send_mail = isset($request['credit_send_mail']) ? true: false;
+ $credit_number = Invoice::createInvoiceNumber($credit_number, $credit_date);
+
+ $user_credits = $this->makeUserCredit();
+
+ $data = [
+ 'user' => $this->model,
+ 'credit_date' => $credit_date,
+ 'credit_number' => $credit_number,
+ 'user_credits' => $user_credits,
+ ];
+
+ $pdf = PDF::loadView('pdf.credit', $data);
+ $pdf->setPaper('A4', 'portrait');
+
+ $dir = Invoice::getCreditStorageDir($credit_date);
+
+ if(!Storage::disk('public')->exists( $dir )){
+ Storage::disk('public')->makeDirectory($dir); //creates directory
+ }
+ $path = Storage::disk('public')->getAdapter()->getPathPrefix();
+ $filename = Invoice::makeCreditFilename($credit_number);
+
+ $pdf->save($path.$dir.$filename);
+
+ $pdfMerger = new MyPDFMerger();
+ $pdfMerger->addPDF($path.$dir.$filename);
+ $file = $pdfMerger->myMerge('string', $filename, 'template_invoice_de');
+ Storage::disk('public')->put($dir.$filename, $file);
+
+
+ $credit_file = [
+ 'filename' => $filename,
+ 'dir' => $dir,
+ 'disk' => 'public',
+ 'invoice_number' => $credit_number,
+ 'credit_date' => $credit_date,
+ ];
+ UserCredit::create([
+ 'auth_user_id' => $this->model->id,
+ 'net' => $user_credits->net,
+ 'tax_rate' => $user_credits->tax_rate,
+ 'tax' => $user_credits->tax,
+ 'total' => $user_credits->total,
+ 'date' => $credit_date,
+ 'credit' => $credit_file,
+ 'user_margins' => $user_credits->margins,
+ ]);
+
+
+ if($credit_send_mail){
+ //Invoice::sendInvoiceMail($this->model);
+ }
+ //Invoice::makeNextInvoiceNumber();
+ return true;
+ //return $pdf->stream('invoice.pdf');
+ //return $this->output($path.$dir, $filename);
+ }
+
+ private function makeUserCredit(){
+
+ $ret = new \stdClass();
+ $ret->net = 0;
+ $UserMarigns = UserMarign::getOrderFromPartnerCommissionByID($this->model->id);
+ foreach($UserMarigns as $UserMarign){
+ $margin = new \stdClass();
+ $margin->id = $UserMarign->id;
+ $margin->net = $UserMarign->net_partner_commission;
+ $margin->reference = $UserMarign->shopping_order->getLastShoppingPayment('reference');
+ $margin->firstname = $UserMarign->shopping_order->shopping_user->billing_firstname;
+ $margin->lastname = $UserMarign->shopping_order->shopping_user->billing_lastname;
+ $margin->created_at = $UserMarign->shopping_order->created_at->format("d.m.Y");
+ $ret->margins[] = $margin;
+ $ret->net += $UserMarign->net_partner_commission;
+ }
+ /* taxable_sales //user tax
+ 1 //umsatzsteuerpflichtig
+ 2 // nicht umsatzsteuerpflichtig
+ */
+ if($this->model->account){
+ $ret->taxable = $this->model->account->taxable_sales == 2 ? false : false;
+ if($ret->taxable){
+ $ret->tax_rate = config('app.main_tax_number');
+ $ret->total = round($ret->net * config('app.main_tax'), 2);
+ $ret->tax = $ret->total - $ret->net;
+
+ }else{
+ $ret->tax_rate = 0;
+ $ret->total = $ret->net;
+ $ret->tax = 0;
+
+ }
+ }
+
+ return $ret;
+ }
+}
\ No newline at end of file
diff --git a/app/Services/Invoice.php b/app/Services/Invoice.php
index 88c83ce..69ad32d 100644
--- a/app/Services/Invoice.php
+++ b/app/Services/Invoice.php
@@ -5,6 +5,7 @@ use App\Mail\MailInvoice;
use App\Services\Util;
use App\Models\Setting;
use App\Models\ShoppingOrder;
+use App\Models\UserCredit;
use Illuminate\Support\Facades\Mail;
class Invoice
@@ -30,27 +31,44 @@ class Invoice
return "/invoice/".\Carbon::parse($invoice_date)->format('Y/m/');
}
+ public static function getCreditStorageDir($invoice_date){
+ return "/credit/".\Carbon::parse($invoice_date)->format('Y/m/');
+ }
+
public static function makeInvoiceFilename($invoice_number){
-
return "Rechnung-".$invoice_number.".pdf";
}
+ public static function makeCreditFilename($invoice_number){
+ return "Gutschrift-".$invoice_number.".pdf";
+ }
+
public static function isInvoice(ShoppingOrder $shopping_order){
return isset($shopping_order->invoice['filename']) ? true : false;
}
+ public static function isCredit(UserCredit $user_credit){
+ return isset($user_credit->credit['filename']) ? true : false;
+ }
public static function getFilename(ShoppingOrder $shopping_order){
return isset($shopping_order->invoice['filename']) ? $shopping_order->invoice['filename'] : false;
}
+ public static function getCreditFilename(UserCredit $user_credit){
+ return isset($user_credit->credit['filename']) ? $user_credit->credit['filename'] : false;
+ }
+
public static function getDir(ShoppingOrder $shopping_order){
return isset($shopping_order->invoice['dir']) ? $shopping_order->invoice['dir'] : false;
}
+ public static function getCreditDir(UserCredit $user_credit){
+ return isset($user_credit->credit['dir']) ? $user_credit->credit['dir'] : false;
+ }
+
public static function getDownloadURL(ShoppingOrder $shopping_order, $do = false){
return route('storage_file', [$shopping_order->id, 'cms_download_file', $do]);
}
-
public static function getDownloadPath(ShoppingOrder $shopping_order, $full = false){
$dir = self::getDir($shopping_order);
$filename = self::getFilename($shopping_order);
@@ -60,6 +78,15 @@ class Invoice
return \Storage::disk('public')->path($dir.$filename);
}
+ public static function getCreditDownloadPath(UserCredit $user_credit, $full = false){
+ $dir = self::getCreditDir($user_credit);
+ $filename = self::getCreditFilename($user_credit);
+ if(!$full){
+ return $dir.$filename;
+ }
+ return \Storage::disk('public')->path($dir.$filename);
+ }
+
public static function sendInvoiceMail($shopping_order){
$bcc = [];
$billing_email = $shopping_order->shopping_user->billing_email;
diff --git a/app/Services/UserMarign.php b/app/Services/UserMarign.php
index fa98dff..d243493 100644
--- a/app/Services/UserMarign.php
+++ b/app/Services/UserMarign.php
@@ -9,8 +9,6 @@ use Carbon;
class UserMarign
{
-
-
public static function getMontlyPrice(User $user, $date = null, $format = false){
$now = $date ? Carbon::parse($date) : Carbon::now();
@@ -50,7 +48,7 @@ class UserMarign
$now = $date ? Carbon::parse($date) : Carbon::now();
$startDay = $now->startOfMonth()->toDateString();
$endDay = $now->endOfMonth()->toDateString();
-
+
$sum_net_amount = ShoppingOrderMargin::whereUserId($user->id)
->whereBetween('from', [$startDay, $endDay])
->wherePaid(true)
@@ -64,12 +62,13 @@ class UserMarign
}
-
public static function getMontlyPartnerCommission(User $user, $date = null, $format = false){
- $now = $date ? Carbon::parse($date) : Carbon::now();
- $startDay = $now->startOfMonth()->toDateString();
- $endDay = $now->endOfMonth()->toDateString();
+ //$now = $date ? Carbon::parse($date) : Carbon::now();
+ $start = Carbon::parse('01.01.2021');
+ $end = Carbon::now();
+ $startDay = $start->startOfMonth()->toDateString();
+ $endDay = $end->endOfMonth()->toDateString();
$sum_net_amount = ShoppingOrderMargin::whereMSponsorId($user->id)
->whereBetween('from', [$startDay, $endDay])
@@ -82,6 +81,104 @@ class UserMarign
return $sum_net_amount;
}
- //monthy amount, sum
+
+ public static function getMontlyPartnerCommissionOpen(User $user, $date = null, $format = false){
+
+ //$now = $date ? Carbon::parse($date) : Carbon::now();
+ $start = Carbon::parse('01.01.2021');
+ $end = Carbon::now();
+ $startDay = $start->startOfMonth()->toDateString();
+ $endDay = $end->endOfMonth()->toDateString();
+
+ $sum_net_amount = ShoppingOrderMargin::whereMSponsorId($user->id)
+ ->whereBetween('from', [$startDay, $endDay])
+ ->wherePaid(true)
+ ->whereCancellation(false)
+ ->wherePartnerCommissionPaid(false)
+ ->where('partner_commission_pending_to', '<', Carbon::now())
+ ->sum('net_partner_commission');
+ if($format){
+ $sum_net_amount = Util::formatNumber($sum_net_amount);
+ }
+
+ return $sum_net_amount;
+ }
+
+ public static function getMontlyPartnerCommissionOpenByID($user_id, $date = null, $format = false){
+
+ $sum_net_amount = ShoppingOrderMargin::whereMSponsorId($user_id)
+ ->wherePaid(true)
+ ->whereCancellation(false)
+ ->wherePartnerCommissionPaid(false)
+ ->where('partner_commission_pending_to', '<', Carbon::now())
+ ->sum('net_partner_commission');
+ if($format){
+ $sum_net_amount = Util::formatNumber($sum_net_amount);
+ }
+
+ return $sum_net_amount;
+ }
+
+ public static function getMontlyPartnerCommissionPending(User $user, $date = null, $format = false){
+
+ //$now = $date ? Carbon::parse($date) : Carbon::now();
+ $start = Carbon::parse('01.01.2021');
+ $end = Carbon::now();
+ $startDay = $start->startOfMonth()->toDateString();
+ $endDay = $end->endOfMonth()->toDateString();
+
+ $sum_net_amount = ShoppingOrderMargin::whereMSponsorId($user->id)
+ ->whereBetween('from', [$startDay, $endDay])
+ ->wherePaid(true)
+ ->whereCancellation(false)
+ ->wherePartnerCommissionPaid(false)
+ ->where('partner_commission_pending_to', '>=', Carbon::now())
+ ->sum('net_partner_commission');
+ if($format){
+ $sum_net_amount = Util::formatNumber($sum_net_amount);
+ }
+
+ return $sum_net_amount;
+ }
+
+ public static function getMontlyPartnerCommissionPendingByID($user_id, $date = null, $format = false){
+
+ $sum_net_amount = ShoppingOrderMargin::whereMSponsorId($user_id)
+ ->wherePaid(true)
+ ->whereCancellation(false)
+ ->wherePartnerCommissionPaid(false)
+ ->where('partner_commission_pending_to', '>=', Carbon::now())
+ ->sum('net_partner_commission');
+ if($format){
+ $sum_net_amount = Util::formatNumber($sum_net_amount);
+ }
+
+ return $sum_net_amount;
+ }
+
+
+ public static function getOrderFromPartnerCommissionByID($user_id){
+
+ $ShoppingOrderMargins = ShoppingOrderMargin::whereMSponsorId($user_id)
+ ->wherePaid(true)
+ ->whereCancellation(false)
+ ->wherePartnerCommissionPaid(false)
+ ->where('partner_commission_pending_to', '<', Carbon::now())
+ ->get();
+
+ return $ShoppingOrderMargins;
+ }
+
+ public static function getOrderFromPartnerCommissionPendingByID($user_id){
+
+ $ShoppingOrderMargins = ShoppingOrderMargin::whereMSponsorId($user_id)
+ ->wherePaid(true)
+ ->whereCancellation(false)
+ ->wherePartnerCommissionPaid(false)
+ ->where('partner_commission_pending_to', '>=', Carbon::now())
+ ->get();
+
+ return $ShoppingOrderMargins;
+ }
}
\ No newline at end of file
diff --git a/app/Services/Yard.php b/app/Services/Yard.php
index e61d272..c730189 100644
--- a/app/Services/Yard.php
+++ b/app/Services/Yard.php
@@ -168,6 +168,7 @@ class Yard extends Cart
$yard_commission = new Commission();
$yard_commission = $content->reduce(function ($yard_commission, CartItem $cartItem) {
$price_net = $cartItem->price / ((100 + $cartItem->taxRate) / 100);
+ //nicht vom Staffelrabatt -> extra Rabatt / Provision
if($cartItem->options->single_commission){
$value_commission = $price_net / 100 * $cartItem->options->value_commission;
$partner_commission = $price_net / 100 * $cartItem->options->partner_commission;
@@ -175,7 +176,7 @@ class Yard extends Cart
$price_net_commission = ($cartItem->qty * $price_net) - ($cartItem->qty * $value_commission);
$yard_commission->single_price_net += ($cartItem->qty * $price_net);
$yard_commission->single_value_commission += ($cartItem->qty * $value_commission);
- if($this->user->user_level->partner_provision){
+ if($this->user->sponsorHasCommisson()){
$yard_commission->single_partner_commission += ($cartItem->qty * $partner_commission);
}
$yard_commission->single_price_net_commission += $price_net_commission;
@@ -227,13 +228,17 @@ class Yard extends Cart
}
$last_limit = $user_level_margin->price_from;
if($balance != 0){
+ $commission = 0;
+ if($this->user->sponsorHasCommisson()){
+ $commission = $user_level_margin->commission;
+ }
$margin->add($user_level_margin->price_from, [
'price_net' => $price_net,
'range' => $range,
'rest_amount' => $rest_amount,
'balance' => $balance,
'trading_margin'=> $user_level_margin->trading_margin,
- 'commission'=> $user_level_margin->commission,
+ 'commission'=> $commission,
]);
}
}
diff --git a/app/User.php b/app/User.php
index 6911a0c..ea9e231 100644
--- a/app/User.php
+++ b/app/User.php
@@ -148,6 +148,12 @@ class User extends Authenticatable
return $this->belongsTo('App\User', 'm_sponsor');
}
+ public function sponsorHasCommisson(){
+ if($this->user_sponsor && $this->user_sponsor->user_level && $this->user_sponsor->user_level->partner_provision){
+ return true;
+ }
+ return false;
+ }
public function files(){
return $this->hasMany('App\Models\File', 'user_id', '');
}
diff --git a/config/app.php b/config/app.php
index 1874893..2df1e72 100644
--- a/config/app.php
+++ b/config/app.php
@@ -60,6 +60,7 @@ return [
'info_test_mail' => env('APP_INFO_TEST_MAIL', 'kevin.adametz@me.com'),
'main_tax' => env('APP_MAIN_TAX', 1.19),
+ 'main_tax_rate' => env('APP_MAIN_TAX_RATE', 19),
'asset_url' => env('ASSET_URL', null),
diff --git a/database/migrations/2020_12_23_163527_create_shopping_orders_table.php b/database/migrations/2020_12_23_163527_create_shopping_orders_table.php
index 455d925..75fe1cc 100644
--- a/database/migrations/2020_12_23_163527_create_shopping_orders_table.php
+++ b/database/migrations/2020_12_23_163527_create_shopping_orders_table.php
@@ -52,6 +52,8 @@ class CreateShoppingOrdersTable extends Migration
$table->string('txaction', 20)->nullable()->index();
$table->unsignedTinyInteger('shipped')->default(0);
+ $table->timestamp('shipped_at')->nullable();
+
$table->string('tracking', 255)->nullable();
$table->char('mode', 4)->nullable();
diff --git a/database/migrations/2021_01_21_170707_create_shopping_order_margins_table.php b/database/migrations/2021_01_21_170707_create_shopping_order_margins_table.php
index ba05c86..d310b80 100644
--- a/database/migrations/2021_01_21_170707_create_shopping_order_margins_table.php
+++ b/database/migrations/2021_01_21_170707_create_shopping_order_margins_table.php
@@ -32,6 +32,8 @@ class CreateShoppingOrderMarginsTable extends Migration
$table->boolean('cancellation')->default(false);
$table->unsignedTinyInteger('status')->index()->default(0);
+ $table->timestamp('partner_commission_pending_to')->nullable();
+ $table->boolean('partner_commission_paid')->default(false);
$table->text('content')->nullable();
diff --git a/database/migrations/2021_03_23_191712_create_user_credits_table.php b/database/migrations/2021_03_23_191712_create_user_credits_table.php
new file mode 100644
index 0000000..59798c1
--- /dev/null
+++ b/database/migrations/2021_03_23_191712_create_user_credits_table.php
@@ -0,0 +1,48 @@
+id();
+ $table->unsignedInteger('auth_user_id');
+ $table->decimal('net', 13, 2)->nullable();
+ $table->decimal('tax_rate', 8, 2)->nullable();
+ $table->decimal('tax', 8, 2)->nullable();
+ $table->decimal('total', 13, 2)->nullable();
+ $table->date('date')->nullable();
+ $table->text('credit')->nullable();
+ $table->text('user_margins')->nullable();
+
+ $table->boolean('paid_out')->default(false);
+ $table->boolean('cancellation')->default(false);
+ $table->unsignedTinyInteger('status')->index()->default(0);
+
+ $table->timestamps();
+
+ $table->foreign('auth_user_id')
+ ->references('id')
+ ->on('users');
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::dropIfExists('user_credits');
+ }
+}
diff --git a/resources/lang/de/navigation.php b/resources/lang/de/navigation.php
index 9232a94..4d454ec 100755
--- a/resources/lang/de/navigation.php
+++ b/resources/lang/de/navigation.php
@@ -39,5 +39,9 @@ return [
'countries'=>'Länder',
'logout'=>'Logout',
'system_settings' => 'Systemeinstellungen',
- 'new_register' => 'neu registrieren'
+ 'new_register' => 'neu registrieren',
+ 'payments' => 'Zahlungen',
+ 'credit' => 'Gutschriften',
+ 'invoice' => 'Rechnungen',
+ 'revenue' => 'Umsätze',
];
diff --git a/resources/views/admin/level/edit.blade.php b/resources/views/admin/level/edit.blade.php
index e22659d..a452e91 100755
--- a/resources/views/admin/level/edit.blade.php
+++ b/resources/views/admin/level/edit.blade.php
@@ -53,8 +53,10 @@
{!! Form::checkbox('partner_provision', 1, $value->partner_provision, ['class'=>'custom-control-input']) !!}
- Vertriebspartner Provision berechnen
+ Bekommt Provision von seinen Vertriebspartner
+ Auch immer die Provision bei den Staffelpreisen eintragen! Die Provision wird beim Käufer berechnet und nur ein Sponsor mit der Rolle wo diese Checkbox aktiv ist bekommt die Provison gutgeschrieben.
+
diff --git a/resources/views/admin/payment/credit/index.blade.php b/resources/views/admin/payment/credit/index.blade.php
new file mode 100755
index 0000000..d17d529
--- /dev/null
+++ b/resources/views/admin/payment/credit/index.blade.php
@@ -0,0 +1,232 @@
+@extends('layouts.layout-2')
+
+@section('content')
+
+
+
+
+
+
+
+
+
+
+
+ {!! Form::open(['url' => route('admin_payments_credit'), 'class' => 'form-horizontal', 'id'=>'form_filter_sales_year']) !!}
+
+ Filter Jahr
+
+ @foreach($years as $year)
+ {{$year}}
+ @endforeach
+
+ {!! Form::close() !!}
+
+
+
+
+
+
+
+ ID
+ {{__('Vorname')}}
+ {{__('Nachname') }}
+ {{__('E-Mail') }}
+ {{__('Betrag') }}
+ {{__('Datum') }}
+ {{__('aus Bestellung')}}
+ {{__('Status')}}
+ {{__('Gutschrift')}}
+
+
+
+
+
+
+
+
+
+
+
+
+@endsection
diff --git a/resources/views/admin/payment/invoice/index.blade.php b/resources/views/admin/payment/invoice/index.blade.php
new file mode 100755
index 0000000..2900c5d
--- /dev/null
+++ b/resources/views/admin/payment/invoice/index.blade.php
@@ -0,0 +1,86 @@
+@extends('layouts.layout-2')
+
+@section('content')
+
+
+
+ {!! Form::open(['url' => route('admin_payments_invoice'), 'class' => 'form-horizontal', 'id'=>'form_filter_sales_year']) !!}
+
+ Filter Jahr
+
+ @foreach($years as $year)
+ {{$year}}
+ @endforeach
+
+ {!! Form::close() !!}
+
+
+
+
+
+
+
+ ID
+ {{__('Vorname')}}
+ {{__('Nachname') }}
+ {{__('E-Mail') }}
+ {{__('Betrag') }}
+ {{__('Datum') }}
+ {{__('Order')}}
+ {{__('Status')}}
+ {{__('Rechnung')}}
+
+
+
+
+
+
+
+
+
+
+@endsection
diff --git a/resources/views/admin/settings/index.blade.php b/resources/views/admin/settings/index.blade.php
index 26f8e9f..9e1101a 100755
--- a/resources/views/admin/settings/index.blade.php
+++ b/resources/views/admin/settings/index.blade.php
@@ -50,6 +50,20 @@
+
+
+
Bestellungen Einstellungen
+
+
speichern
+
+
+
{!! Form::close() !!}
@endsection
diff --git a/resources/views/dashboard.blade.php b/resources/views/dashboard.blade.php
index d1be2b4..42ab15a 100755
--- a/resources/views/dashboard.blade.php
+++ b/resources/views/dashboard.blade.php
@@ -160,7 +160,7 @@
@endif
- {{__('Umsätze')}} {{date('m.Y')}}
+ {{__('Umsätze')}} {{ date('m.Y') }}
{{__('Umsatz gesamt')}}:
@@ -182,12 +182,18 @@
- {{__('Provision')}} {{date('m.Y')}}
+ {{__('Provision')}} {{-- date('m.Y') --}}
- {{__('Vertriebspartner Provision')}}:
+ {{__('Vertriebspartner Provision')}} pending:
- {!! \App\Services\UserMarign::getMontlyPartnerCommission($user, null, true) !!} €*
+ {!! \App\Services\UserMarign::getMontlyPartnerCommissionPending($user, null, true) !!} €*
+
+
+
+ {{__('Vertriebspartner Provision')}} bestätigt:
+
+ {!! \App\Services\UserMarign::getMontlyPartnerCommissionOpen($user, null, true) !!} €*
diff --git a/resources/views/layouts/includes/layout-sidenav.blade.php b/resources/views/layouts/includes/layout-sidenav.blade.php
index 298ad03..93be243 100644
--- a/resources/views/layouts/includes/layout-sidenav.blade.php
+++ b/resources/views/layouts/includes/layout-sidenav.blade.php
@@ -13,7 +13,6 @@
@if(Auth::user()->showSideNav())
-
@@ -28,6 +27,10 @@
+ {{--
+ {{ __('navigation.revenue') }}
+ --}}
+
@if(Auth::user()->isActiveAccount())
@@ -101,6 +104,22 @@
+
+
+
+
+ {{ __('navigation.payments') }}
+
+
+
+
diff --git a/resources/views/pdf/credit.blade.php b/resources/views/pdf/credit.blade.php
new file mode 100644
index 0000000..1101c5e
--- /dev/null
+++ b/resources/views/pdf/credit.blade.php
@@ -0,0 +1,400 @@
+
+
+
+
+ partner.gruene-seele.bio
+
+
+
+
+
GRÜNE SEELE GbR • Hauptstr. 174 • 51143 Köln
+ @if($user->account)
+ @if($user->account->company)
+ {{ $user->account->company }}
+ @else
+ Firma
+ @endif
+ {{ \App\Services\HTMLHelper::getSalutationLang($user->account->salutation) }}
+ {{ $user->account->first_name }} {{ $user->account->last_name }}
+ {{ $user->account->address }}
+ @if($user->account->address_2)
+ {{ $user->account->address_2 }}
+ @endif
+ {{ $user->account->zipcode}} {{ $user->account->city }}
+ @if($user->account->country)
+ {{ $user->account->country->getLocated() }}
+ @endif
+ @endif
+
+
+
+
GUTSCHRIFT
+ {{-- @if($cancellation)
+
{{ $invoice->invoice_name }}
+ @endif--}}
+
+
+
+
+
+
+ {{ __('Gutschriftsnummer') }}: {{ $credit_number }}
+
+
+
+
+
+
+
+
+ {{ __('Datum') }}/{{ __('Leistungsdatum)') }}: {{ $credit_date }}
+
+
+ @if($user->account->tax_number)
+
+
+ {{ __('St.-Nr') }}: {{ $user->account->tax_number}}
+
+
+ @else
+ @if($user->account->tax_identification_number)
+
+
+ {{ __('USt-IdNr.') }}: {{ $user->account->tax_identification_number}}
+
+
+ @endif
+ @endif
+
+
+
+
+
+
+ Gutschrift aus
+ Betrag
+
+
+
+ @foreach($user_credits->margins as $margin)
+
+
+ {{ $margin->firstname }} {{ $margin->lastname }} / {{ $margin->reference }} / {{ $margin->created_at }}
+
+
+ {{ \App\Services\Util::formatNumber($margin->net) }} €*
+
+
+ @endforeach
+
+
+
+
+ Zwischensumme
+
+
+ {{ \App\Services\Util::formatNumber($user_credits->net) }} €*
+
+
+
+ @if ($user_credits->taxable)
+
+
+ Mehrwertsteuer: {{ $user_credits->tax_rate }} %
+
+
+ {{ \App\Services\Util::formatNumber($user_credits->tax) }} €
+
+
+
+ @else
+
+
+ Mehrwertsteuer: {{ $user_credits->tax_rate }} %
+ Gutschriftsempfänger ist Kleinunternehmer nach § 19 (1) UStG.
+
+
+
+ {{ \App\Services\Util::formatNumber($user_credits->tax) }} €
+
+
+ @endif
+
+
+
+ Auszahlungsbetrag (Brutto):
+
+
+ {{ \App\Services\Util::formatNumber($user_credits->total) }} €
+
+ * Nettobeträge
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/resources/views/pdf/invoice.blade.php b/resources/views/pdf/invoice.blade.php
index 98f3491..b3c51af 100644
--- a/resources/views/pdf/invoice.blade.php
+++ b/resources/views/pdf/invoice.blade.php
@@ -264,10 +264,12 @@
-
GÜNE SEELE • Hauptstr. 174 • 51143 Köln
+
GRÜNE SEELE GbR • Hauptstr. 174 • 51143 Köln
@if($shopping_order->shopping_user->billing_company)
{{ $shopping_order->shopping_user->billing_company }}
+ @else
+ Firma
@endif
{{ \App\Services\HTMLHelper::getSalutationLang($shopping_order->shopping_user->billing_salutation) }}
{{ $shopping_order->shopping_user->billing_firstname }} {{ $shopping_order->shopping_user->billing_lastname }}
@@ -276,7 +278,9 @@
{{ $shopping_order->shopping_user->billing_address_2 }}
@endif
{{ $shopping_order->shopping_user->billing_zipcode }} {{ $shopping_order->shopping_user->billing_city }}
+ @if($shopping_order->shopping_user->billing_country)
{{ $shopping_order->shopping_user->billing_country->getLocated() }}
+ @endif
diff --git a/resources/views/user/revenue/index.blade.php b/resources/views/user/revenue/index.blade.php
new file mode 100644
index 0000000..44a50c5
--- /dev/null
+++ b/resources/views/user/revenue/index.blade.php
@@ -0,0 +1,65 @@
+@extends('layouts.layout-2')
+
+@section('content')
+
+
+
+ {!! Form::open(['url' => route('user_revenue'), 'class' => 'form-horizontal', 'id'=>'filter_sales_member']) !!}
+
+ Filter Jahr
+
+ @foreach($years as $year)
+ {{$year}}
+ @endforeach
+
+ {!! Form::close() !!}
+
+
+
+
+
+
+
+ {{__('Vorname')}}
+ {{__('Nachname') }}
+ {{__('E-Mail') }}
+ {{__('Betrag') }}
+ {{__('Datum') }}
+ {{__('Order')}}
+ {{__('Status')}}
+
+
+
+ @foreach($values as $value)
+
+ {{ $value->shopping_user->billing_firstname }}
+ {{ $value->shopping_user->billing_lastname }}
+ {{ $value->shopping_user->billing_email }}
+ {{ $value->getFormattedTotalShipping()." €" }}
+ {{ $value->created_at->format("d.m.Y") }}
+ @foreach($value->shopping_order_items as $shopping_order_item)
+ {{ $shopping_order_item->product->name }}
+ @endforeach
+
+
+
+ {!! App\Services\Payment::getShoppingOrderBadge($value) !!}
+
+ @endforeach
+
+
+
+
+
+
+
+@endsection
diff --git a/resources/views/user/user_form.blade.php b/resources/views/user/user_form.blade.php
index f9c1561..a640a05 100644
--- a/resources/views/user/user_form.blade.php
+++ b/resources/views/user/user_form.blade.php
@@ -131,9 +131,9 @@
@@ -344,9 +344,9 @@
diff --git a/routes/web.php b/routes/web.php
index 2482ab3..8707b4f 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -179,6 +179,10 @@ Route::group(['middleware' => ['auth:user']], function() {
Route::get('/user/membership', 'MembershipController@index')->name('user_membership');
Route::post('/user/membership/store/{action}', 'MembershipController@storePayment')->name('user_membership_store');
+ Route::get('/user/revenue', 'User\RevenueController@index')->name('user_revenue');
+ Route::post('/user/revenue', 'User\RevenueController@index')->name('user_revenue');
+
+
Route::get('/user/checkout/{identifier?}', 'User\CheckoutController@checkout')->name('user_checkout');
Route::post('/user/checkout_store/{identifier?}', 'User\CheckoutController@store')->name('user_checkout_store');
Route::get('/user/checkout_final/{payid}/{reference}/{identifier?}', 'User\CheckoutController@final')->name('user_checkout_final');
@@ -277,6 +281,21 @@ Route::group(['middleware' => ['admin']], function()
Route::post('/admin/sales/store', 'SalesController@store')->name('admin_sales_store');
Route::post('/admin/sales/invoice', 'SalesController@invoice')->name('admin_sales_invoice');
+
+ //payments
+ Route::get('/admin/payments/credit', 'PaymentCreditController@index')->name('admin_payments_credit');
+ Route::post('/admin/payments/credit', 'PaymentCreditController@index')->name('admin_payments_credit');
+ Route::get('/admin/payments/credit/datatable', 'PaymentCreditController@datatable')->name('admin_payments_credit_datatable');
+ Route::post('/admin/payments/credit/create', 'PaymentCreditController@create')->name('admin_payments_credit_create');
+
+
+ Route::get('/admin/payments/invoice', 'PaymentInvoiceController@index')->name('admin_payments_invoice');
+ Route::post('/admin/payments/invoice', 'PaymentInvoiceController@index')->name('admin_payments_invoice');
+ Route::get('/admin/payments/invoice/datatable', 'PaymentInvoiceController@datatable')->name('admin_payments_invoice_datatable');
+
+
+
+
});
//login pages for superadmin
diff --git a/storage/fonts/Times-Bold.afm.php b/storage/fonts/Times-Bold.afm.php
new file mode 100644
index 0000000..33691a6
--- /dev/null
+++ b/storage/fonts/Times-Bold.afm.php
@@ -0,0 +1,572 @@
+
+ array (
+ 32 => 'space',
+ 160 => 'space',
+ 33 => 'exclam',
+ 34 => 'quotedbl',
+ 35 => 'numbersign',
+ 36 => 'dollar',
+ 37 => 'percent',
+ 38 => 'ampersand',
+ 146 => 'quoteright',
+ 40 => 'parenleft',
+ 41 => 'parenright',
+ 42 => 'asterisk',
+ 43 => 'plus',
+ 44 => 'comma',
+ 45 => 'hyphen',
+ 173 => 'hyphen',
+ 46 => 'period',
+ 47 => 'slash',
+ 48 => 'zero',
+ 49 => 'one',
+ 50 => 'two',
+ 51 => 'three',
+ 52 => 'four',
+ 53 => 'five',
+ 54 => 'six',
+ 55 => 'seven',
+ 56 => 'eight',
+ 57 => 'nine',
+ 58 => 'colon',
+ 59 => 'semicolon',
+ 60 => 'less',
+ 61 => 'equal',
+ 62 => 'greater',
+ 63 => 'question',
+ 64 => 'at',
+ 65 => 'A',
+ 66 => 'B',
+ 67 => 'C',
+ 68 => 'D',
+ 69 => 'E',
+ 70 => 'F',
+ 71 => 'G',
+ 72 => 'H',
+ 73 => 'I',
+ 74 => 'J',
+ 75 => 'K',
+ 76 => 'L',
+ 77 => 'M',
+ 78 => 'N',
+ 79 => 'O',
+ 80 => 'P',
+ 81 => 'Q',
+ 82 => 'R',
+ 83 => 'S',
+ 84 => 'T',
+ 85 => 'U',
+ 86 => 'V',
+ 87 => 'W',
+ 88 => 'X',
+ 89 => 'Y',
+ 90 => 'Z',
+ 91 => 'bracketleft',
+ 92 => 'backslash',
+ 93 => 'bracketright',
+ 94 => 'asciicircum',
+ 95 => 'underscore',
+ 145 => 'quoteleft',
+ 97 => 'a',
+ 98 => 'b',
+ 99 => 'c',
+ 100 => 'd',
+ 101 => 'e',
+ 102 => 'f',
+ 103 => 'g',
+ 104 => 'h',
+ 105 => 'i',
+ 106 => 'j',
+ 107 => 'k',
+ 108 => 'l',
+ 109 => 'm',
+ 110 => 'n',
+ 111 => 'o',
+ 112 => 'p',
+ 113 => 'q',
+ 114 => 'r',
+ 115 => 's',
+ 116 => 't',
+ 117 => 'u',
+ 118 => 'v',
+ 119 => 'w',
+ 120 => 'x',
+ 121 => 'y',
+ 122 => 'z',
+ 123 => 'braceleft',
+ 124 => 'bar',
+ 125 => 'braceright',
+ 126 => 'asciitilde',
+ 161 => 'exclamdown',
+ 162 => 'cent',
+ 163 => 'sterling',
+ 165 => 'yen',
+ 131 => 'florin',
+ 167 => 'section',
+ 164 => 'currency',
+ 39 => 'quotesingle',
+ 147 => 'quotedblleft',
+ 171 => 'guillemotleft',
+ 139 => 'guilsinglleft',
+ 155 => 'guilsinglright',
+ 150 => 'endash',
+ 134 => 'dagger',
+ 135 => 'daggerdbl',
+ 183 => 'periodcentered',
+ 182 => 'paragraph',
+ 149 => 'bullet',
+ 130 => 'quotesinglbase',
+ 132 => 'quotedblbase',
+ 148 => 'quotedblright',
+ 187 => 'guillemotright',
+ 133 => 'ellipsis',
+ 137 => 'perthousand',
+ 191 => 'questiondown',
+ 96 => 'grave',
+ 180 => 'acute',
+ 136 => 'circumflex',
+ 152 => 'tilde',
+ 175 => 'macron',
+ 168 => 'dieresis',
+ 184 => 'cedilla',
+ 151 => 'emdash',
+ 198 => 'AE',
+ 170 => 'ordfeminine',
+ 216 => 'Oslash',
+ 140 => 'OE',
+ 186 => 'ordmasculine',
+ 230 => 'ae',
+ 248 => 'oslash',
+ 156 => 'oe',
+ 223 => 'germandbls',
+ 207 => 'Idieresis',
+ 233 => 'eacute',
+ 159 => 'Ydieresis',
+ 247 => 'divide',
+ 221 => 'Yacute',
+ 194 => 'Acircumflex',
+ 225 => 'aacute',
+ 219 => 'Ucircumflex',
+ 253 => 'yacute',
+ 234 => 'ecircumflex',
+ 220 => 'Udieresis',
+ 218 => 'Uacute',
+ 203 => 'Edieresis',
+ 169 => 'copyright',
+ 229 => 'aring',
+ 224 => 'agrave',
+ 227 => 'atilde',
+ 154 => 'scaron',
+ 237 => 'iacute',
+ 251 => 'ucircumflex',
+ 226 => 'acircumflex',
+ 231 => 'ccedilla',
+ 222 => 'Thorn',
+ 179 => 'threesuperior',
+ 210 => 'Ograve',
+ 192 => 'Agrave',
+ 215 => 'multiply',
+ 250 => 'uacute',
+ 255 => 'ydieresis',
+ 238 => 'icircumflex',
+ 202 => 'Ecircumflex',
+ 228 => 'adieresis',
+ 235 => 'edieresis',
+ 205 => 'Iacute',
+ 177 => 'plusminus',
+ 166 => 'brokenbar',
+ 174 => 'registered',
+ 200 => 'Egrave',
+ 142 => 'Zcaron',
+ 208 => 'Eth',
+ 199 => 'Ccedilla',
+ 193 => 'Aacute',
+ 196 => 'Adieresis',
+ 232 => 'egrave',
+ 211 => 'Oacute',
+ 243 => 'oacute',
+ 239 => 'idieresis',
+ 212 => 'Ocircumflex',
+ 217 => 'Ugrave',
+ 254 => 'thorn',
+ 178 => 'twosuperior',
+ 214 => 'Odieresis',
+ 181 => 'mu',
+ 236 => 'igrave',
+ 190 => 'threequarters',
+ 153 => 'trademark',
+ 204 => 'Igrave',
+ 189 => 'onehalf',
+ 244 => 'ocircumflex',
+ 241 => 'ntilde',
+ 201 => 'Eacute',
+ 188 => 'onequarter',
+ 138 => 'Scaron',
+ 176 => 'degree',
+ 242 => 'ograve',
+ 249 => 'ugrave',
+ 209 => 'Ntilde',
+ 245 => 'otilde',
+ 195 => 'Atilde',
+ 197 => 'Aring',
+ 213 => 'Otilde',
+ 206 => 'Icircumflex',
+ 172 => 'logicalnot',
+ 246 => 'odieresis',
+ 252 => 'udieresis',
+ 240 => 'eth',
+ 158 => 'zcaron',
+ 185 => 'onesuperior',
+ 128 => 'Euro',
+ ),
+ 'isUnicode' => false,
+ 'FontName' => 'Times-Bold',
+ 'FullName' => 'Times Bold',
+ 'FamilyName' => 'Times',
+ 'Weight' => 'Bold',
+ 'ItalicAngle' => '0',
+ 'IsFixedPitch' => 'false',
+ 'CharacterSet' => 'ExtendedRoman',
+ 'FontBBox' =>
+ array (
+ 0 => '-168',
+ 1 => '-218',
+ 2 => '1000',
+ 3 => '935',
+ ),
+ 'UnderlinePosition' => '-100',
+ 'UnderlineThickness' => '50',
+ 'Version' => '002.000',
+ 'EncodingScheme' => 'WinAnsiEncoding',
+ 'CapHeight' => '676',
+ 'XHeight' => '461',
+ 'Ascender' => '683',
+ 'Descender' => '-217',
+ 'StdHW' => '44',
+ 'StdVW' => '139',
+ 'StartCharMetrics' => '317',
+ 'C' =>
+ array (
+ 32 => 250.0,
+ 160 => 250.0,
+ 33 => 333.0,
+ 34 => 555.0,
+ 35 => 500.0,
+ 36 => 500.0,
+ 37 => 1000.0,
+ 38 => 833.0,
+ 146 => 333.0,
+ 40 => 333.0,
+ 41 => 333.0,
+ 42 => 500.0,
+ 43 => 570.0,
+ 44 => 250.0,
+ 45 => 333.0,
+ 173 => 333.0,
+ 46 => 250.0,
+ 47 => 278.0,
+ 48 => 500.0,
+ 49 => 500.0,
+ 50 => 500.0,
+ 51 => 500.0,
+ 52 => 500.0,
+ 53 => 500.0,
+ 54 => 500.0,
+ 55 => 500.0,
+ 56 => 500.0,
+ 57 => 500.0,
+ 58 => 333.0,
+ 59 => 333.0,
+ 60 => 570.0,
+ 61 => 570.0,
+ 62 => 570.0,
+ 63 => 500.0,
+ 64 => 930.0,
+ 65 => 722.0,
+ 66 => 667.0,
+ 67 => 722.0,
+ 68 => 722.0,
+ 69 => 667.0,
+ 70 => 611.0,
+ 71 => 778.0,
+ 72 => 778.0,
+ 73 => 389.0,
+ 74 => 500.0,
+ 75 => 778.0,
+ 76 => 667.0,
+ 77 => 944.0,
+ 78 => 722.0,
+ 79 => 778.0,
+ 80 => 611.0,
+ 81 => 778.0,
+ 82 => 722.0,
+ 83 => 556.0,
+ 84 => 667.0,
+ 85 => 722.0,
+ 86 => 722.0,
+ 87 => 1000.0,
+ 88 => 722.0,
+ 89 => 722.0,
+ 90 => 667.0,
+ 91 => 333.0,
+ 92 => 278.0,
+ 93 => 333.0,
+ 94 => 581.0,
+ 95 => 500.0,
+ 145 => 333.0,
+ 97 => 500.0,
+ 98 => 556.0,
+ 99 => 444.0,
+ 100 => 556.0,
+ 101 => 444.0,
+ 102 => 333.0,
+ 103 => 500.0,
+ 104 => 556.0,
+ 105 => 278.0,
+ 106 => 333.0,
+ 107 => 556.0,
+ 108 => 278.0,
+ 109 => 833.0,
+ 110 => 556.0,
+ 111 => 500.0,
+ 112 => 556.0,
+ 113 => 556.0,
+ 114 => 444.0,
+ 115 => 389.0,
+ 116 => 333.0,
+ 117 => 556.0,
+ 118 => 500.0,
+ 119 => 722.0,
+ 120 => 500.0,
+ 121 => 500.0,
+ 122 => 444.0,
+ 123 => 394.0,
+ 124 => 220.0,
+ 125 => 394.0,
+ 126 => 520.0,
+ 161 => 333.0,
+ 162 => 500.0,
+ 163 => 500.0,
+ 'fraction' => 167.0,
+ 165 => 500.0,
+ 131 => 500.0,
+ 167 => 500.0,
+ 164 => 500.0,
+ 39 => 278.0,
+ 147 => 500.0,
+ 171 => 500.0,
+ 139 => 333.0,
+ 155 => 333.0,
+ 'fi' => 556.0,
+ 'fl' => 556.0,
+ 150 => 500.0,
+ 134 => 500.0,
+ 135 => 500.0,
+ 183 => 250.0,
+ 182 => 540.0,
+ 149 => 350.0,
+ 130 => 333.0,
+ 132 => 500.0,
+ 148 => 500.0,
+ 187 => 500.0,
+ 133 => 1000.0,
+ 137 => 1000.0,
+ 191 => 500.0,
+ 96 => 333.0,
+ 180 => 333.0,
+ 136 => 333.0,
+ 152 => 333.0,
+ 175 => 333.0,
+ 'breve' => 333.0,
+ 'dotaccent' => 333.0,
+ 168 => 333.0,
+ 'ring' => 333.0,
+ 184 => 333.0,
+ 'hungarumlaut' => 333.0,
+ 'ogonek' => 333.0,
+ 'caron' => 333.0,
+ 151 => 1000.0,
+ 198 => 1000.0,
+ 170 => 300.0,
+ 'Lslash' => 667.0,
+ 216 => 778.0,
+ 140 => 1000.0,
+ 186 => 330.0,
+ 230 => 722.0,
+ 'dotlessi' => 278.0,
+ 'lslash' => 278.0,
+ 248 => 500.0,
+ 156 => 722.0,
+ 223 => 556.0,
+ 207 => 389.0,
+ 233 => 444.0,
+ 'abreve' => 500.0,
+ 'uhungarumlaut' => 556.0,
+ 'ecaron' => 444.0,
+ 159 => 722.0,
+ 247 => 570.0,
+ 221 => 722.0,
+ 194 => 722.0,
+ 225 => 500.0,
+ 219 => 722.0,
+ 253 => 500.0,
+ 'scommaaccent' => 389.0,
+ 234 => 444.0,
+ 'Uring' => 722.0,
+ 220 => 722.0,
+ 'aogonek' => 500.0,
+ 218 => 722.0,
+ 'uogonek' => 556.0,
+ 203 => 667.0,
+ 'Dcroat' => 722.0,
+ 'commaaccent' => 250.0,
+ 169 => 747.0,
+ 'Emacron' => 667.0,
+ 'ccaron' => 444.0,
+ 229 => 500.0,
+ 'Ncommaaccent' => 722.0,
+ 'lacute' => 278.0,
+ 224 => 500.0,
+ 'Tcommaaccent' => 667.0,
+ 'Cacute' => 722.0,
+ 227 => 500.0,
+ 'Edotaccent' => 667.0,
+ 154 => 389.0,
+ 'scedilla' => 389.0,
+ 237 => 278.0,
+ 'lozenge' => 494.0,
+ 'Rcaron' => 722.0,
+ 'Gcommaaccent' => 778.0,
+ 251 => 556.0,
+ 226 => 500.0,
+ 'Amacron' => 722.0,
+ 'rcaron' => 444.0,
+ 231 => 444.0,
+ 'Zdotaccent' => 667.0,
+ 222 => 611.0,
+ 'Omacron' => 778.0,
+ 'Racute' => 722.0,
+ 'Sacute' => 556.0,
+ 'dcaron' => 672.0,
+ 'Umacron' => 722.0,
+ 'uring' => 556.0,
+ 179 => 300.0,
+ 210 => 778.0,
+ 192 => 722.0,
+ 'Abreve' => 722.0,
+ 215 => 570.0,
+ 250 => 556.0,
+ 'Tcaron' => 667.0,
+ 'partialdiff' => 494.0,
+ 255 => 500.0,
+ 'Nacute' => 722.0,
+ 238 => 278.0,
+ 202 => 667.0,
+ 228 => 500.0,
+ 235 => 444.0,
+ 'cacute' => 444.0,
+ 'nacute' => 556.0,
+ 'umacron' => 556.0,
+ 'Ncaron' => 722.0,
+ 205 => 389.0,
+ 177 => 570.0,
+ 166 => 220.0,
+ 174 => 747.0,
+ 'Gbreve' => 778.0,
+ 'Idotaccent' => 389.0,
+ 'summation' => 600.0,
+ 200 => 667.0,
+ 'racute' => 444.0,
+ 'omacron' => 500.0,
+ 'Zacute' => 667.0,
+ 142 => 667.0,
+ 'greaterequal' => 549.0,
+ 208 => 722.0,
+ 199 => 722.0,
+ 'lcommaaccent' => 278.0,
+ 'tcaron' => 416.0,
+ 'eogonek' => 444.0,
+ 'Uogonek' => 722.0,
+ 193 => 722.0,
+ 196 => 722.0,
+ 232 => 444.0,
+ 'zacute' => 444.0,
+ 'iogonek' => 278.0,
+ 211 => 778.0,
+ 243 => 500.0,
+ 'amacron' => 500.0,
+ 'sacute' => 389.0,
+ 239 => 278.0,
+ 212 => 778.0,
+ 217 => 722.0,
+ 'Delta' => 612.0,
+ 254 => 556.0,
+ 178 => 300.0,
+ 214 => 778.0,
+ 181 => 556.0,
+ 236 => 278.0,
+ 'ohungarumlaut' => 500.0,
+ 'Eogonek' => 667.0,
+ 'dcroat' => 556.0,
+ 190 => 750.0,
+ 'Scedilla' => 556.0,
+ 'lcaron' => 394.0,
+ 'Kcommaaccent' => 778.0,
+ 'Lacute' => 667.0,
+ 153 => 1000.0,
+ 'edotaccent' => 444.0,
+ 204 => 389.0,
+ 'Imacron' => 389.0,
+ 'Lcaron' => 667.0,
+ 189 => 750.0,
+ 'lessequal' => 549.0,
+ 244 => 500.0,
+ 241 => 556.0,
+ 'Uhungarumlaut' => 722.0,
+ 201 => 667.0,
+ 'emacron' => 444.0,
+ 'gbreve' => 500.0,
+ 188 => 750.0,
+ 138 => 556.0,
+ 'Scommaaccent' => 556.0,
+ 'Ohungarumlaut' => 778.0,
+ 176 => 400.0,
+ 242 => 500.0,
+ 'Ccaron' => 722.0,
+ 249 => 556.0,
+ 'radical' => 549.0,
+ 'Dcaron' => 722.0,
+ 'rcommaaccent' => 444.0,
+ 209 => 722.0,
+ 245 => 500.0,
+ 'Rcommaaccent' => 722.0,
+ 'Lcommaaccent' => 667.0,
+ 195 => 722.0,
+ 'Aogonek' => 722.0,
+ 197 => 722.0,
+ 213 => 778.0,
+ 'zdotaccent' => 444.0,
+ 'Ecaron' => 667.0,
+ 'Iogonek' => 389.0,
+ 'kcommaaccent' => 556.0,
+ 'minus' => 570.0,
+ 206 => 389.0,
+ 'ncaron' => 556.0,
+ 'tcommaaccent' => 333.0,
+ 172 => 570.0,
+ 246 => 500.0,
+ 252 => 556.0,
+ 'notequal' => 549.0,
+ 'gcommaaccent' => 500.0,
+ 240 => 500.0,
+ 158 => 444.0,
+ 'ncommaaccent' => 556.0,
+ 185 => 300.0,
+ 'imacron' => 278.0,
+ 128 => 500.0,
+ ),
+ 'CIDtoGID_Compressed' => true,
+ 'CIDtoGID' => 'eJwDAAAAAAE=',
+ '_version_' => 6,
+);
\ No newline at end of file
diff --git a/storage/fonts/Times-Italic.afm.php b/storage/fonts/Times-Italic.afm.php
new file mode 100644
index 0000000..37d76fb
--- /dev/null
+++ b/storage/fonts/Times-Italic.afm.php
@@ -0,0 +1,572 @@
+
+ array (
+ 32 => 'space',
+ 160 => 'space',
+ 33 => 'exclam',
+ 34 => 'quotedbl',
+ 35 => 'numbersign',
+ 36 => 'dollar',
+ 37 => 'percent',
+ 38 => 'ampersand',
+ 146 => 'quoteright',
+ 40 => 'parenleft',
+ 41 => 'parenright',
+ 42 => 'asterisk',
+ 43 => 'plus',
+ 44 => 'comma',
+ 45 => 'hyphen',
+ 173 => 'hyphen',
+ 46 => 'period',
+ 47 => 'slash',
+ 48 => 'zero',
+ 49 => 'one',
+ 50 => 'two',
+ 51 => 'three',
+ 52 => 'four',
+ 53 => 'five',
+ 54 => 'six',
+ 55 => 'seven',
+ 56 => 'eight',
+ 57 => 'nine',
+ 58 => 'colon',
+ 59 => 'semicolon',
+ 60 => 'less',
+ 61 => 'equal',
+ 62 => 'greater',
+ 63 => 'question',
+ 64 => 'at',
+ 65 => 'A',
+ 66 => 'B',
+ 67 => 'C',
+ 68 => 'D',
+ 69 => 'E',
+ 70 => 'F',
+ 71 => 'G',
+ 72 => 'H',
+ 73 => 'I',
+ 74 => 'J',
+ 75 => 'K',
+ 76 => 'L',
+ 77 => 'M',
+ 78 => 'N',
+ 79 => 'O',
+ 80 => 'P',
+ 81 => 'Q',
+ 82 => 'R',
+ 83 => 'S',
+ 84 => 'T',
+ 85 => 'U',
+ 86 => 'V',
+ 87 => 'W',
+ 88 => 'X',
+ 89 => 'Y',
+ 90 => 'Z',
+ 91 => 'bracketleft',
+ 92 => 'backslash',
+ 93 => 'bracketright',
+ 94 => 'asciicircum',
+ 95 => 'underscore',
+ 145 => 'quoteleft',
+ 97 => 'a',
+ 98 => 'b',
+ 99 => 'c',
+ 100 => 'd',
+ 101 => 'e',
+ 102 => 'f',
+ 103 => 'g',
+ 104 => 'h',
+ 105 => 'i',
+ 106 => 'j',
+ 107 => 'k',
+ 108 => 'l',
+ 109 => 'm',
+ 110 => 'n',
+ 111 => 'o',
+ 112 => 'p',
+ 113 => 'q',
+ 114 => 'r',
+ 115 => 's',
+ 116 => 't',
+ 117 => 'u',
+ 118 => 'v',
+ 119 => 'w',
+ 120 => 'x',
+ 121 => 'y',
+ 122 => 'z',
+ 123 => 'braceleft',
+ 124 => 'bar',
+ 125 => 'braceright',
+ 126 => 'asciitilde',
+ 161 => 'exclamdown',
+ 162 => 'cent',
+ 163 => 'sterling',
+ 165 => 'yen',
+ 131 => 'florin',
+ 167 => 'section',
+ 164 => 'currency',
+ 39 => 'quotesingle',
+ 147 => 'quotedblleft',
+ 171 => 'guillemotleft',
+ 139 => 'guilsinglleft',
+ 155 => 'guilsinglright',
+ 150 => 'endash',
+ 134 => 'dagger',
+ 135 => 'daggerdbl',
+ 183 => 'periodcentered',
+ 182 => 'paragraph',
+ 149 => 'bullet',
+ 130 => 'quotesinglbase',
+ 132 => 'quotedblbase',
+ 148 => 'quotedblright',
+ 187 => 'guillemotright',
+ 133 => 'ellipsis',
+ 137 => 'perthousand',
+ 191 => 'questiondown',
+ 96 => 'grave',
+ 180 => 'acute',
+ 136 => 'circumflex',
+ 152 => 'tilde',
+ 175 => 'macron',
+ 168 => 'dieresis',
+ 184 => 'cedilla',
+ 151 => 'emdash',
+ 198 => 'AE',
+ 170 => 'ordfeminine',
+ 216 => 'Oslash',
+ 140 => 'OE',
+ 186 => 'ordmasculine',
+ 230 => 'ae',
+ 248 => 'oslash',
+ 156 => 'oe',
+ 223 => 'germandbls',
+ 207 => 'Idieresis',
+ 233 => 'eacute',
+ 159 => 'Ydieresis',
+ 247 => 'divide',
+ 221 => 'Yacute',
+ 194 => 'Acircumflex',
+ 225 => 'aacute',
+ 219 => 'Ucircumflex',
+ 253 => 'yacute',
+ 234 => 'ecircumflex',
+ 220 => 'Udieresis',
+ 218 => 'Uacute',
+ 203 => 'Edieresis',
+ 169 => 'copyright',
+ 229 => 'aring',
+ 224 => 'agrave',
+ 227 => 'atilde',
+ 154 => 'scaron',
+ 237 => 'iacute',
+ 251 => 'ucircumflex',
+ 226 => 'acircumflex',
+ 231 => 'ccedilla',
+ 222 => 'Thorn',
+ 179 => 'threesuperior',
+ 210 => 'Ograve',
+ 192 => 'Agrave',
+ 215 => 'multiply',
+ 250 => 'uacute',
+ 255 => 'ydieresis',
+ 238 => 'icircumflex',
+ 202 => 'Ecircumflex',
+ 228 => 'adieresis',
+ 235 => 'edieresis',
+ 205 => 'Iacute',
+ 177 => 'plusminus',
+ 166 => 'brokenbar',
+ 174 => 'registered',
+ 200 => 'Egrave',
+ 142 => 'Zcaron',
+ 208 => 'Eth',
+ 199 => 'Ccedilla',
+ 193 => 'Aacute',
+ 196 => 'Adieresis',
+ 232 => 'egrave',
+ 211 => 'Oacute',
+ 243 => 'oacute',
+ 239 => 'idieresis',
+ 212 => 'Ocircumflex',
+ 217 => 'Ugrave',
+ 254 => 'thorn',
+ 178 => 'twosuperior',
+ 214 => 'Odieresis',
+ 181 => 'mu',
+ 236 => 'igrave',
+ 190 => 'threequarters',
+ 153 => 'trademark',
+ 204 => 'Igrave',
+ 189 => 'onehalf',
+ 244 => 'ocircumflex',
+ 241 => 'ntilde',
+ 201 => 'Eacute',
+ 188 => 'onequarter',
+ 138 => 'Scaron',
+ 176 => 'degree',
+ 242 => 'ograve',
+ 249 => 'ugrave',
+ 209 => 'Ntilde',
+ 245 => 'otilde',
+ 195 => 'Atilde',
+ 197 => 'Aring',
+ 213 => 'Otilde',
+ 206 => 'Icircumflex',
+ 172 => 'logicalnot',
+ 246 => 'odieresis',
+ 252 => 'udieresis',
+ 240 => 'eth',
+ 158 => 'zcaron',
+ 185 => 'onesuperior',
+ 128 => 'Euro',
+ ),
+ 'isUnicode' => false,
+ 'FontName' => 'Times-Italic',
+ 'FullName' => 'Times Italic',
+ 'FamilyName' => 'Times',
+ 'Weight' => 'Medium',
+ 'ItalicAngle' => '-15.5',
+ 'IsFixedPitch' => 'false',
+ 'CharacterSet' => 'ExtendedRoman',
+ 'FontBBox' =>
+ array (
+ 0 => '-169',
+ 1 => '-217',
+ 2 => '1010',
+ 3 => '883',
+ ),
+ 'UnderlinePosition' => '-100',
+ 'UnderlineThickness' => '50',
+ 'Version' => '002.000',
+ 'EncodingScheme' => 'WinAnsiEncoding',
+ 'CapHeight' => '653',
+ 'XHeight' => '441',
+ 'Ascender' => '683',
+ 'Descender' => '-217',
+ 'StdHW' => '32',
+ 'StdVW' => '76',
+ 'StartCharMetrics' => '317',
+ 'C' =>
+ array (
+ 32 => 250.0,
+ 160 => 250.0,
+ 33 => 333.0,
+ 34 => 420.0,
+ 35 => 500.0,
+ 36 => 500.0,
+ 37 => 833.0,
+ 38 => 778.0,
+ 146 => 333.0,
+ 40 => 333.0,
+ 41 => 333.0,
+ 42 => 500.0,
+ 43 => 675.0,
+ 44 => 250.0,
+ 45 => 333.0,
+ 173 => 333.0,
+ 46 => 250.0,
+ 47 => 278.0,
+ 48 => 500.0,
+ 49 => 500.0,
+ 50 => 500.0,
+ 51 => 500.0,
+ 52 => 500.0,
+ 53 => 500.0,
+ 54 => 500.0,
+ 55 => 500.0,
+ 56 => 500.0,
+ 57 => 500.0,
+ 58 => 333.0,
+ 59 => 333.0,
+ 60 => 675.0,
+ 61 => 675.0,
+ 62 => 675.0,
+ 63 => 500.0,
+ 64 => 920.0,
+ 65 => 611.0,
+ 66 => 611.0,
+ 67 => 667.0,
+ 68 => 722.0,
+ 69 => 611.0,
+ 70 => 611.0,
+ 71 => 722.0,
+ 72 => 722.0,
+ 73 => 333.0,
+ 74 => 444.0,
+ 75 => 667.0,
+ 76 => 556.0,
+ 77 => 833.0,
+ 78 => 667.0,
+ 79 => 722.0,
+ 80 => 611.0,
+ 81 => 722.0,
+ 82 => 611.0,
+ 83 => 500.0,
+ 84 => 556.0,
+ 85 => 722.0,
+ 86 => 611.0,
+ 87 => 833.0,
+ 88 => 611.0,
+ 89 => 556.0,
+ 90 => 556.0,
+ 91 => 389.0,
+ 92 => 278.0,
+ 93 => 389.0,
+ 94 => 422.0,
+ 95 => 500.0,
+ 145 => 333.0,
+ 97 => 500.0,
+ 98 => 500.0,
+ 99 => 444.0,
+ 100 => 500.0,
+ 101 => 444.0,
+ 102 => 278.0,
+ 103 => 500.0,
+ 104 => 500.0,
+ 105 => 278.0,
+ 106 => 278.0,
+ 107 => 444.0,
+ 108 => 278.0,
+ 109 => 722.0,
+ 110 => 500.0,
+ 111 => 500.0,
+ 112 => 500.0,
+ 113 => 500.0,
+ 114 => 389.0,
+ 115 => 389.0,
+ 116 => 278.0,
+ 117 => 500.0,
+ 118 => 444.0,
+ 119 => 667.0,
+ 120 => 444.0,
+ 121 => 444.0,
+ 122 => 389.0,
+ 123 => 400.0,
+ 124 => 275.0,
+ 125 => 400.0,
+ 126 => 541.0,
+ 161 => 389.0,
+ 162 => 500.0,
+ 163 => 500.0,
+ 'fraction' => 167.0,
+ 165 => 500.0,
+ 131 => 500.0,
+ 167 => 500.0,
+ 164 => 500.0,
+ 39 => 214.0,
+ 147 => 556.0,
+ 171 => 500.0,
+ 139 => 333.0,
+ 155 => 333.0,
+ 'fi' => 500.0,
+ 'fl' => 500.0,
+ 150 => 500.0,
+ 134 => 500.0,
+ 135 => 500.0,
+ 183 => 250.0,
+ 182 => 523.0,
+ 149 => 350.0,
+ 130 => 333.0,
+ 132 => 556.0,
+ 148 => 556.0,
+ 187 => 500.0,
+ 133 => 889.0,
+ 137 => 1000.0,
+ 191 => 500.0,
+ 96 => 333.0,
+ 180 => 333.0,
+ 136 => 333.0,
+ 152 => 333.0,
+ 175 => 333.0,
+ 'breve' => 333.0,
+ 'dotaccent' => 333.0,
+ 168 => 333.0,
+ 'ring' => 333.0,
+ 184 => 333.0,
+ 'hungarumlaut' => 333.0,
+ 'ogonek' => 333.0,
+ 'caron' => 333.0,
+ 151 => 889.0,
+ 198 => 889.0,
+ 170 => 276.0,
+ 'Lslash' => 556.0,
+ 216 => 722.0,
+ 140 => 944.0,
+ 186 => 310.0,
+ 230 => 667.0,
+ 'dotlessi' => 278.0,
+ 'lslash' => 278.0,
+ 248 => 500.0,
+ 156 => 667.0,
+ 223 => 500.0,
+ 207 => 333.0,
+ 233 => 444.0,
+ 'abreve' => 500.0,
+ 'uhungarumlaut' => 500.0,
+ 'ecaron' => 444.0,
+ 159 => 556.0,
+ 247 => 675.0,
+ 221 => 556.0,
+ 194 => 611.0,
+ 225 => 500.0,
+ 219 => 722.0,
+ 253 => 444.0,
+ 'scommaaccent' => 389.0,
+ 234 => 444.0,
+ 'Uring' => 722.0,
+ 220 => 722.0,
+ 'aogonek' => 500.0,
+ 218 => 722.0,
+ 'uogonek' => 500.0,
+ 203 => 611.0,
+ 'Dcroat' => 722.0,
+ 'commaaccent' => 250.0,
+ 169 => 760.0,
+ 'Emacron' => 611.0,
+ 'ccaron' => 444.0,
+ 229 => 500.0,
+ 'Ncommaaccent' => 667.0,
+ 'lacute' => 278.0,
+ 224 => 500.0,
+ 'Tcommaaccent' => 556.0,
+ 'Cacute' => 667.0,
+ 227 => 500.0,
+ 'Edotaccent' => 611.0,
+ 154 => 389.0,
+ 'scedilla' => 389.0,
+ 237 => 278.0,
+ 'lozenge' => 471.0,
+ 'Rcaron' => 611.0,
+ 'Gcommaaccent' => 722.0,
+ 251 => 500.0,
+ 226 => 500.0,
+ 'Amacron' => 611.0,
+ 'rcaron' => 389.0,
+ 231 => 444.0,
+ 'Zdotaccent' => 556.0,
+ 222 => 611.0,
+ 'Omacron' => 722.0,
+ 'Racute' => 611.0,
+ 'Sacute' => 500.0,
+ 'dcaron' => 544.0,
+ 'Umacron' => 722.0,
+ 'uring' => 500.0,
+ 179 => 300.0,
+ 210 => 722.0,
+ 192 => 611.0,
+ 'Abreve' => 611.0,
+ 215 => 675.0,
+ 250 => 500.0,
+ 'Tcaron' => 556.0,
+ 'partialdiff' => 476.0,
+ 255 => 444.0,
+ 'Nacute' => 667.0,
+ 238 => 278.0,
+ 202 => 611.0,
+ 228 => 500.0,
+ 235 => 444.0,
+ 'cacute' => 444.0,
+ 'nacute' => 500.0,
+ 'umacron' => 500.0,
+ 'Ncaron' => 667.0,
+ 205 => 333.0,
+ 177 => 675.0,
+ 166 => 275.0,
+ 174 => 760.0,
+ 'Gbreve' => 722.0,
+ 'Idotaccent' => 333.0,
+ 'summation' => 600.0,
+ 200 => 611.0,
+ 'racute' => 389.0,
+ 'omacron' => 500.0,
+ 'Zacute' => 556.0,
+ 142 => 556.0,
+ 'greaterequal' => 549.0,
+ 208 => 722.0,
+ 199 => 667.0,
+ 'lcommaaccent' => 278.0,
+ 'tcaron' => 300.0,
+ 'eogonek' => 444.0,
+ 'Uogonek' => 722.0,
+ 193 => 611.0,
+ 196 => 611.0,
+ 232 => 444.0,
+ 'zacute' => 389.0,
+ 'iogonek' => 278.0,
+ 211 => 722.0,
+ 243 => 500.0,
+ 'amacron' => 500.0,
+ 'sacute' => 389.0,
+ 239 => 278.0,
+ 212 => 722.0,
+ 217 => 722.0,
+ 'Delta' => 612.0,
+ 254 => 500.0,
+ 178 => 300.0,
+ 214 => 722.0,
+ 181 => 500.0,
+ 236 => 278.0,
+ 'ohungarumlaut' => 500.0,
+ 'Eogonek' => 611.0,
+ 'dcroat' => 500.0,
+ 190 => 750.0,
+ 'Scedilla' => 500.0,
+ 'lcaron' => 300.0,
+ 'Kcommaaccent' => 667.0,
+ 'Lacute' => 556.0,
+ 153 => 980.0,
+ 'edotaccent' => 444.0,
+ 204 => 333.0,
+ 'Imacron' => 333.0,
+ 'Lcaron' => 611.0,
+ 189 => 750.0,
+ 'lessequal' => 549.0,
+ 244 => 500.0,
+ 241 => 500.0,
+ 'Uhungarumlaut' => 722.0,
+ 201 => 611.0,
+ 'emacron' => 444.0,
+ 'gbreve' => 500.0,
+ 188 => 750.0,
+ 138 => 500.0,
+ 'Scommaaccent' => 500.0,
+ 'Ohungarumlaut' => 722.0,
+ 176 => 400.0,
+ 242 => 500.0,
+ 'Ccaron' => 667.0,
+ 249 => 500.0,
+ 'radical' => 453.0,
+ 'Dcaron' => 722.0,
+ 'rcommaaccent' => 389.0,
+ 209 => 667.0,
+ 245 => 500.0,
+ 'Rcommaaccent' => 611.0,
+ 'Lcommaaccent' => 556.0,
+ 195 => 611.0,
+ 'Aogonek' => 611.0,
+ 197 => 611.0,
+ 213 => 722.0,
+ 'zdotaccent' => 389.0,
+ 'Ecaron' => 611.0,
+ 'Iogonek' => 333.0,
+ 'kcommaaccent' => 444.0,
+ 'minus' => 675.0,
+ 206 => 333.0,
+ 'ncaron' => 500.0,
+ 'tcommaaccent' => 278.0,
+ 172 => 675.0,
+ 246 => 500.0,
+ 252 => 500.0,
+ 'notequal' => 549.0,
+ 'gcommaaccent' => 500.0,
+ 240 => 500.0,
+ 158 => 389.0,
+ 'ncommaaccent' => 500.0,
+ 185 => 300.0,
+ 'imacron' => 278.0,
+ 128 => 500.0,
+ ),
+ 'CIDtoGID_Compressed' => true,
+ 'CIDtoGID' => 'eJwDAAAAAAE=',
+ '_version_' => 6,
+);
\ No newline at end of file