diff --git a/app/Http/Controllers/FileController.php b/app/Http/Controllers/FileController.php new file mode 100644 index 0000000..c13ba76 --- /dev/null +++ b/app/Http/Controllers/FileController.php @@ -0,0 +1,66 @@ +path($file->dir.$file->filename); + if (file_exists($path)) { + return Response::file($path); + } + } + + + if ($disk === 'invoice'){ + $shopping_order = \App\Models\ShoppingOrder::findOrFail($id); + $filename = Invoice::getFilename($shopping_order); + $path = Invoice::getDownloadPath($shopping_order); + 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/LeadController.php b/app/Http/Controllers/LeadController.php index 2a18979..6bd6507 100755 --- a/app/Http/Controllers/LeadController.php +++ b/app/Http/Controllers/LeadController.php @@ -158,8 +158,6 @@ class LeadController extends Controller if(isset($data['m_account']) && $data['m_account']){ $user = User::findOrFail($data['user_id']); $rules['m_account'] = 'unique:user_accounts,m_account,'.$user->account->id.',id'; - - } $validator = Validator::make(Request::all(), $rules); if ($validator->fails()) { @@ -363,6 +361,9 @@ class LeadController extends Controller ->addColumn('first_name', function (User $user) { return $user->account ? $user->account->first_name : ''; }) + ->addColumn('company', function (User $user) { + return $user->account ? $user->account->company : ''; + }) ->addColumn('last_name', function (User $user) { return $user->account ? $user->account->last_name : ''; }) @@ -400,8 +401,6 @@ class LeadController extends Controller return "-"; }) - - ->orderColumn('id', 'id $1') ->orderColumn('confirmed', 'confirmed $1') ->orderColumn('active', 'active $1') diff --git a/app/Http/Controllers/SalesController.php b/app/Http/Controllers/SalesController.php index 942aa35..91818c8 100755 --- a/app/Http/Controllers/SalesController.php +++ b/app/Http/Controllers/SalesController.php @@ -7,6 +7,7 @@ use App\Models\ShoppingOrder; use App\Models\ShoppingPayment; use App\Models\ShoppingUser; use App\Models\UserShop; +use App\Repositories\InvoiceRepository; use App\Services\CustomerPriority; use App\Services\Payment; use Request; @@ -302,10 +303,26 @@ class SalesController extends Controller } if(isset($data['back'])){ - return redirect($data['back']); } return back(); } + + public function invoice(){ + $data = Request::all(); + //$data['id'] ShoppingOrder id + if(!isset($data['id'])){ + abort(404); + } + if(isset($data['action'])){ + if($data['action'] === 'create_invoice'){ + $shopping_order = ShoppingOrder::findOrFail($data['id']); + $invoice_repo = new InvoiceRepository($shopping_order); + $invoice_repo->create($data); + return redirect(route('admin_sales_users_detail', [$shopping_order->id])); + } + } + } + } \ No newline at end of file diff --git a/app/Http/Controllers/User/OrderController.php b/app/Http/Controllers/User/OrderController.php index 3c6639f..436e8ab 100755 --- a/app/Http/Controllers/User/OrderController.php +++ b/app/Http/Controllers/User/OrderController.php @@ -2,21 +2,22 @@ namespace App\Http\Controllers\User; -use App\Http\Controllers\Controller; +use Auth; +use Yard; +use Request; +use App\User; +use Validator; +use App\Services\Util; use App\Models\Product; -use App\Models\ShippingCountry; -use App\Models\ShoppingInstance; -use App\Models\ShoppingOrder; -use App\Models\ShoppingUser; -use App\Models\UserHistory; use App\Models\UserShop; use App\Services\Payment; -use App\Services\Util; -use App\User; -use Auth; -use Request; -use Validator; -use Yard; +use App\Models\UserHistory; +use App\Models\ShoppingUser; +use App\Models\ShoppingOrder; +use App\Models\ProductCategory; +use App\Models\ShippingCountry; +use App\Models\ShoppingInstance; +use App\Http\Controllers\Controller; class OrderController extends Controller @@ -278,12 +279,8 @@ class OrderController extends Controller public function datatable(){ $show_at = 1; - - // $user = User::find(\Auth::user()->id); - ; - if(Request::get('shipping_is_for') === 'me'){ - $query = Product::select('products.*')->where('active', true)->where(function ($q) { + $query = Product::with('categories')->select('products.*')->where('active', true)->where(function ($q) { $q->where('show_at', '=', 1) ->orWhere('show_at', '=', 2) ->orWhere('show_at', '=', 6); @@ -291,14 +288,11 @@ class OrderController extends Controller }); }else{ - $query = Product::select('products.*')->where('active', true)->where(function ($q) { + $query = Product::with('categories')->select('products.*')->where('active', true)->where(function ($q) { $q->where('show_at', '=', 0) ->orWhere('show_at', '=', 1); }); } - - - //Kunden und Vertriebspartner //->orWhere('show_at', '=', 2); // Nur Vertriebspartner //->orderBy('pos', 'DESC') @@ -347,21 +341,32 @@ class OrderController extends Controller '; })*/ - + + ->addColumn('category', function (Product $product) { + $ret = ""; + foreach($product->categories as $category){ + $ret .= ''.$category->category->name.''; + } + + return $ret; + }) ->addColumn('picture', function (Product $product) { if(count($product->images)){ - return ''; + return ' + + '; } return ""; }) ->addColumn('price_net', function (Product $product) { - return $product->getFormattedPriceWith(true, true). " €"; + return $product->getFormattedPriceWith(true, true). "€"; }) ->addColumn('price_gross', function (Product $product) { - return $product->getFormattedPriceWith(false, true). " €"; + return $product->getFormattedPriceWith(false, true). "€"; }) ->addColumn('price_vk_gross', function (Product $product) { - return $product->getFormattedPriceWith(false, false). " €"; + return $product->getFormattedPriceWith(false, false). "€"; }) ->addColumn('single_commission', function (Product $product) { return $product->single_commission ? 'Handelspanne: '.$product->getFormattedValueCommission().' %' : 'Staffelprovision orderColumn('contents_total', 'contents_total $1') ->orderColumn('single_commission', 'single_commission $1') ->orderColumn('weight', 'weight $1') + // ->orderColumn('category', 'weight $1') + /*->orderColumn('category', function ($query, $order) { + $query->whereHas('categories', + function ($q) use ($order) { + // $q->select('sent_at')->where('sent_at', DB::raw("(select max('sent_at') customer_mails)")); //) + })->orderBy( + ProductCategory::select('id') + ->whereColumn('product_id', 'produkt.id') + ->orderBy('id', 'DESC') + ->limit(1) + , $order); + })*/ - ->rawColumns(['add_card', 'product', 'quantity', 'picture', 'action', 'single_commission']) + + ->rawColumns(['add_card', 'category', 'product', 'quantity', 'picture', 'action', 'single_commission']) ->make(true); } diff --git a/app/Http/Controllers/UserDataController.php b/app/Http/Controllers/UserDataController.php index ae2696e..9d02ff7 100755 --- a/app/Http/Controllers/UserDataController.php +++ b/app/Http/Controllers/UserDataController.php @@ -7,6 +7,7 @@ use App\User; use Auth; use Request; use Validator; +use App\Models\UserAccount; class UserDataController extends Controller @@ -47,6 +48,14 @@ class UserDataController extends Controller 'address'=>'required', 'zipcode'=>'required', 'city' => 'required', + 'phone' => 'required_without:mobil', + 'mobil' => 'required_without:phone', + 'tax_number' => 'required_without:tax_identification_number', + 'tax_identification_number' => 'required_without:tax_number', + 'birthday_day' => 'required', + 'birthday_month' => 'required', + 'birthday_year' => 'required', + 'country_id' => 'required|integer|min:1', 'email' => 'required|string|email|max:255|exists:users,email', 'email-confirm' => 'required|same:email', ); @@ -67,7 +76,6 @@ class UserDataController extends Controller $validator = Validator::make(Request::all(), $rules); if ($validator->fails()) { - return view('user.edit', $data)->withErrors($validator); } else { diff --git a/app/Http/Controllers/WizardController.php b/app/Http/Controllers/WizardController.php index 2a0f155..aaa8e7b 100755 --- a/app/Http/Controllers/WizardController.php +++ b/app/Http/Controllers/WizardController.php @@ -194,9 +194,13 @@ class WizardController extends Controller 'city' => 'required', 'phone' => 'required_without:mobil', 'mobil' => 'required_without:phone', + 'tax_number' => 'required_without:tax_identification_number', + 'tax_identification_number' => 'required_without:tax_number', 'country_id' => 'required|integer|min:1', - 'birthday' => 'required', - ); + 'birthday_day' => 'required', + 'birthday_month' => 'required', + 'birthday_year' => 'required' + ); if (!Request::get('same_as_billing')) { $rules = array_merge($rules, [ @@ -397,8 +401,12 @@ class WizardController extends Controller 'city' => 'required', 'phone' => 'required_without:mobil', 'mobil' => 'required_without:phone', + 'tax_number' => 'required_without:tax_identification_number', + 'tax_identification_number' => 'required_without:tax_number', 'country_id' => 'required|integer|min:1', - 'birthday' => 'required', + 'birthday_day' => 'required', + 'birthday_month' => 'required', + 'birthday_year' => 'required' ); if(!Request::get('same_as_billing')){ diff --git a/app/Models/Setting.php b/app/Models/Setting.php index 268168e..6a14963 100644 --- a/app/Models/Setting.php +++ b/app/Models/Setting.php @@ -44,6 +44,8 @@ use Illuminate\Database\Eloquent\Model; * @method static \Illuminate\Database\Eloquent\Builder|Setting whereType($value) * @method static \Illuminate\Database\Eloquent\Builder|Setting whereUpdatedAt($value) * @mixin \Eloquent + * @property int|null $int + * @method static \Illuminate\Database\Eloquent\Builder|Setting whereInt($value) */ class Setting extends Model { @@ -54,6 +56,7 @@ class Setting extends Model protected $casts = [ 'referenz' => 'int', 'status' => 'int', + 'int' => 'int', 'object' => 'array' ]; @@ -65,6 +68,7 @@ class Setting extends Model 'object', 'full_text', 'text', + 'int', 'status', 'type' ]; @@ -96,6 +100,9 @@ class Setting extends Model case 'text': return $content->text; break; + case 'int': + return $content->int; + break; } } return false; @@ -121,6 +128,9 @@ class Setting extends Model case 'text': $content->text = $value; break; + case 'int': + $content->int = (int) $value; + break; } $content->save(); diff --git a/app/Models/ShoppingOrder.php b/app/Models/ShoppingOrder.php index 812bf2b..18d6acc 100644 --- a/app/Models/ShoppingOrder.php +++ b/app/Models/ShoppingOrder.php @@ -91,6 +91,8 @@ use Illuminate\Database\Eloquent\SoftDeletes; * @method static \Illuminate\Database\Eloquent\Builder|ShoppingOrder whereDiscount($value) * @method static \Illuminate\Database\Eloquent\Builder|ShoppingOrder wherePaymentCredit($value) * @method static \Illuminate\Database\Eloquent\Builder|ShoppingOrder whereSubtotalShipping($value) + * @property string|null $total_without_credit + * @method static \Illuminate\Database\Eloquent\Builder|ShoppingOrder whereTotalWithoutCredit($value) */ class ShoppingOrder extends Model { @@ -119,6 +121,7 @@ class ShoppingOrder extends Model 'points', 'weight', 'paid', + 'invoice', 'txaction', 'wp_invoice_path', 'wp_notice', @@ -129,6 +132,7 @@ class ShoppingOrder extends Model protected $casts = [ 'wp_notice' => 'array', + 'invoice' => 'array', ]; public static $shippedTypes = [ diff --git a/app/Models/UserAccount.php b/app/Models/UserAccount.php index 3f688b6..162caf7 100644 --- a/app/Models/UserAccount.php +++ b/app/Models/UserAccount.php @@ -177,6 +177,9 @@ class UserAccount extends Model return Carbon::parse($value)->format(\Util::formatDateDB()); } + public function getBirthdayRaw(){ + return isset($this->attributes['birthday']) ? $this->attributes['birthday'] : NULL; + } public function setBirthdayAttribute( $value ) { $this->attributes['birthday'] = isset($value) ? (new Carbon($value))->format('Y-m-d') : NULL; } diff --git a/app/Repositories/InvoiceRepository.php b/app/Repositories/InvoiceRepository.php new file mode 100644 index 0000000..7605151 --- /dev/null +++ b/app/Repositories/InvoiceRepository.php @@ -0,0 +1,63 @@ +model = $model; + } + + public function create($request = []) + { + //need invoice $data + $invoice_number = isset($request['invoice_number']) ? $request['invoice_number'] : Invoice::getInvoiceNumber(); + $invoice_date = isset($request['invoice_date']) ? $request['invoice_date'] : $this->model->created_at->format("d.m.Y"); + + $invoice_number = Invoice::createInvoiceNumber($invoice_number, $invoice_date); + + $data = [ + 'shopping_order' => $this->model, + 'invoice_date' => $invoice_date, + 'invoice_number' => $invoice_number, + ]; + $pdf = PDF::loadView('pdf.invoice', $data); + $pdf->setPaper('A4', 'portrait'); + + $dir = Invoice::getInvoiceStorageDir($invoice_date); + + if(!Storage::disk('public')->exists( $dir )){ + Storage::disk('public')->makeDirectory($dir); //creates directory + } + $path = Storage::disk('public')->getAdapter()->getPathPrefix(); + $filename = Invoice::makeInvoiceFilename($invoice_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); + + $data_file = [ + 'filename' => $filename, + 'dir' => $dir, + 'disk' => 'public', + 'invoice_number' => $invoice_number, + 'invoice_date' => $invoice_date, + ]; + $this->model->invoice = $data_file; + $this->model->save(); + Invoice::makeNextInvoiceNumber(); + return true; + //return $pdf->stream('invoice.pdf'); + //return $this->output($path.$dir, $filename); + } +} \ No newline at end of file diff --git a/app/Repositories/UserRepository.php b/app/Repositories/UserRepository.php index 32c873c..e624ed5 100644 --- a/app/Repositories/UserRepository.php +++ b/app/Repositories/UserRepository.php @@ -45,6 +45,11 @@ class UserRepository extends BaseRepository { $data['same_as_billing'] = !isset($data['same_as_billing']) ? 0 : 1; + $data['birthday_day'] = isset($data['birthday_day']) ? $data['birthday_day'] : 1; + $data['birthday_month'] = isset($data['birthday_month']) ? $data['birthday_month'] : 1; + $data['birthday_year'] = isset($data['birthday_year']) ? $data['birthday_year'] : 1970; + $data['birthday'] = $data['birthday_day'].".".$data['birthday_month'].".".$data['birthday_year']; + $account->fill($data)->save(); if(!$this->model->account_id){ diff --git a/app/Services/HTMLHelper.php b/app/Services/HTMLHelper.php index 9ef46eb..52cd3f2 100644 --- a/app/Services/HTMLHelper.php +++ b/app/Services/HTMLHelper.php @@ -65,6 +65,39 @@ class HTMLHelper } + public static function getCustomListOf($name, $select){ + $ret = ""; + if($name === 'day'){ + $start = 1; + $end = 31; + $values = range($start, $end); + $ret = ''.__('Tag').'\n'; + foreach ($values as $value){ + $attr = ($value == $select) ? 'selected="selected"' : ''; + $ret .= ''.$value.'\n'; + } + } + if($name === 'month'){ + $ret = ''.__('Monat').'\n'; + foreach (self::$months as $key=>$value){ + $attr = ($key == $select) ? 'selected="selected"' : ''; + $ret .= ''.$value.'\n'; + } + } + if($name === 'year'){ + $start = date("Y", strtotime("-5 years", time())); + $end = date("Y", strtotime("-90 years", time())); + $values = range($start, $end); + $ret = ''.__('Jahr').'\n'; + foreach ($values as $value){ + $attr = ($value == $select) ? 'selected="selected"' : ''; + $ret .= ''.$value.'\n'; + } + } + + return $ret; + + } public static function setContentReadMore($content){ $sep = '##mehr lesen##'; diff --git a/app/Services/Invoice.php b/app/Services/Invoice.php new file mode 100644 index 0000000..0aec639 --- /dev/null +++ b/app/Services/Invoice.php @@ -0,0 +1,60 @@ +format('Ym'); + return $prefix.$invoice_number; + } + + public static function getInvoiceStorageDir($invoice_date){ + return "/invoice/".\Carbon::parse($invoice_date)->format('Y/m/'); + } + + public static function makeInvoiceFilename($invoice_number){ + + return "Rechnung-".$invoice_number.".pdf"; + } + + public static function isInvoice(ShoppingOrder $shopping_order){ + return isset($shopping_order->invoice['filename']) ? true : false; + } + + public static function getFilename(ShoppingOrder $shopping_order){ + return isset($shopping_order->invoice['filename']) ? $shopping_order->invoice['filename'] : false; + } + + public static function getDir(ShoppingOrder $shopping_order){ + return isset($shopping_order->invoice['dir']) ? $shopping_order->invoice['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); + if(!$full){ + return $dir.$filename; + } + return \Storage::disk('public')->path($dir.$filename); + } +} diff --git a/app/Services/MyPDFMerger.php b/app/Services/MyPDFMerger.php new file mode 100644 index 0000000..5b830c0 --- /dev/null +++ b/app/Services/MyPDFMerger.php @@ -0,0 +1,188 @@ +_rewritepages($pages); + } + + $this->_files[] = array($filepath, $pages); + } else { + throw new \exception("Could not locate PDF on '$filepath'"); + } + + return $this; + } + + + public function myMerge($outputmode = 'browser', $outputpath = 'newfile.pdf', $theme = false) + { + if (!isset($this->_files) || !is_array($this->_files)): throw new \exception("No PDFs to merge."); endif; + + $fpdi = new \setasign\Fpdi\Fpdi(); + $first = 1; + + // + //merger operations + foreach ($this->_files as $file) { + $filename = $file[0]; + $filepages = $file[1]; + + + $count = $fpdi->setSourceFile($filename); + + //add the pages + if ($filepages == 'all') { + for ($i = 1; $i <= $count; $i++) { + $count = $fpdi->setSourceFile($filename); + $template = $fpdi->importPage($i); + $size = $fpdi->getTemplateSize($template); + $orientation = ($size['height'] > $size['width']) ? 'P' : 'L'; + + $fpdi->AddPage($orientation, array($size['width'], $size['height'])); + if($theme){ + $fpdi->setSourceFile('pdf/'.$theme.'-'.$first.'.pdf'); + if($first == 1){ + $first = 2; + } + $backId = $fpdi->importPage(1); + $fpdi->useTemplate($backId); + + } + $fpdi->useTemplate($template); + } + } else { + foreach ($filepages as $page) { + $count = $fpdi->setSourceFile($filename); + if (!$template = $fpdi->importPage($page)): throw new \exception("Could not load page '$page' in PDF '$filename'. Check that the page exists."); endif; + $size = $fpdi->getTemplateSize($template); + $orientation = ($size['h'] > $size['w']) ? 'P' : 'L'; + + $fpdi->AddPage($orientation, array($size['w'], $size['h'])); + if($theme){ + $fpdi->setSourceFile('pdf/'.$theme.'-'.$first.'.pdf'); + if($first == 1){ + $first = 2; + } + $backId = $fpdi->importPage(1); + $fpdi->useTemplate($backId); + } + + $fpdi->useTemplate($template); + } + } + //after first file (invoice) on bpaper + $slug = false; + } + + //output operations + $mode = $this->_switchmode($outputmode); + + if ($mode == 'S') { + return $fpdi->Output($outputpath, 'S'); + } else { + if ($fpdi->Output($outputpath, $mode) == '') { + return true; + } else { + throw new \exception("Error outputting PDF to '$outputmode'."); + return false; + } + } + + + } + + /** + * FPDI uses single characters for specifying the output location. Change our more descriptive string into proper format. + * @param $mode + * @return Character + */ + private function _switchmode($mode) + { + switch (strtolower($mode)) { + case 'download': + return 'D'; + break; + case 'browser': + return 'I'; + break; + case 'file': + return 'F'; + break; + case 'string': + return 'S'; + break; + default: + return 'I'; + break; + } + } + + /** + * Takes our provided pages in the form of 1,3,4,16-50 and creates an array of all pages + * @param $pages + * @return array + * @throws exception + */ + private function _rewritepages($pages) + { + $pages = str_replace(' ', '', $pages); + $part = explode(',', $pages); + + //parse hyphens + foreach ($part as $i) { + $ind = explode('-', $i); + + if (count($ind) == 2) { + $x = $ind[0]; //start page + $y = $ind[1]; //end page + + if ($x > $y): throw new \exception("Starting page, '$x' is greater than ending page '$y'."); + return false; endif; + + //add middle pages + while ($x <= $y): $newpages[] = (int)$x; + $x++; endwhile; + } else { + $newpages[] = (int)$ind[0]; + } + } + + return $newpages; + } +} + + +/* +$pdf = new PDFMerger; + +$pdf->addPDF('samplepdfs/one.pdf', '1, 3, 4') + ->addPDF('samplepdfs/two.pdf', '1-2') + ->addPDF('samplepdfs/three.pdf', 'all') + ->merge('file', 'samplepdfs/TEST2.pdf'); + + //REPLACE 'file' WITH 'browser', 'download', 'string', or 'file' for output options + //You do not need to give a file path for browser, string, or download - just the name. +*/ \ No newline at end of file diff --git a/app/Services/Payment.php b/app/Services/Payment.php index b81e863..c52ec54 100644 --- a/app/Services/Payment.php +++ b/app/Services/Payment.php @@ -3,6 +3,7 @@ namespace App\Services; use App\Mail\MailCheckout; +use App\Models\Setting; use App\Models\ShoppingOrder; use App\Models\ShoppingPayment; use App\User; @@ -67,6 +68,11 @@ class Payment } return "warning"; } + public static function generateNextInvoiceNumber(){ + $invoice_number = \App\Models\Setting::getContentBySlug('invoice-number'); + return $invoice_number; + + } public static function getShoppingOrderBadge(ShoppingOrder $shopping_order){ if($shopping_order->mode === 'test'){ diff --git a/app/User.php b/app/User.php index 66044cc..6911a0c 100644 --- a/app/User.php +++ b/app/User.php @@ -389,6 +389,13 @@ class User extends Authenticatable return "de"; } + public function getBirthdayFormat($format = "d.m.Y"){ + if($this->account && $this->account->getBirthdayRaw()){ + return (int) Carbon::parse($this->account->getBirthdayRaw())->format($format); + } + return null; + } + /** * Send the password reset notification. * diff --git a/composer.json b/composer.json index 00a5d08..cb66750 100644 --- a/composer.json +++ b/composer.json @@ -27,6 +27,7 @@ "laravel/ui": "^3.1", "laravelcollective/html": "*", "reliese/laravel": "*", + "rguedes/pdfmerger": "^1.0", "setasign/fpdf": "*", "setasign/fpdi": "*", "yajra/laravel-datatables-oracle": "*" diff --git a/composer.lock b/composer.lock index 0a09db7..e1a1a28 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ef4569bbf806f3339fc3af3a5cbe0116", + "content-hash": "9a9e6aad9041019ff4baba8deedd02c4", "packages": [ { "name": "askedio/laravel5-profanity-filter", @@ -4425,6 +4425,55 @@ }, "time": "2020-12-07T02:35:15+00:00" }, + { + "name": "rguedes/pdfmerger", + "version": "1.0.4", + "source": { + "type": "git", + "url": "https://github.com/rguedes/PDFMerger.git", + "reference": "8e1caa1093160107bb1796ce07d9fc3d6769fc34" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/rguedes/PDFMerger/zipball/8e1caa1093160107bb1796ce07d9fc3d6769fc34", + "reference": "8e1caa1093160107bb1796ce07d9fc3d6769fc34", + "shasum": "" + }, + "require": { + "php": ">=5.2.0" + }, + "type": "library", + "autoload": { + "psr-0": { + "PDFMerger": "Classes/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL" + ], + "authors": [ + { + "name": "Myo Kyaw Htun", + "homepage": "https://github.com/myokyawhtun" + }, + { + "name": "Rolando Guedes", + "homepage": "https://github.com/rguedes" + } + ], + "description": "PDFMerger for PHP", + "homepage": "https://github.com/rguedes/PDFMerger", + "keywords": [ + "pdf", + "php" + ], + "support": { + "issues": "https://github.com/rguedes/PDFMerger/issues", + "source": "https://github.com/rguedes/PDFMerger/tree/1.0.4" + }, + "time": "2019-01-04T09:47:31+00:00" + }, { "name": "sabberworm/php-css-parser", "version": "8.3.1", diff --git a/config/dompdf.php b/config/dompdf.php index 3ddda23..7dead86 100644 --- a/config/dompdf.php +++ b/config/dompdf.php @@ -38,7 +38,7 @@ return array( * Times-Roman, Times-Bold, Times-BoldItalic, Times-Italic, * Symbol, ZapfDingbats. */ - "font_dir" => storage_path('fonts/'), // advised by dompdf (https://github.com/dompdf/dompdf/pull/782) + "font_dir" => storage_path('fonts'), // advised by dompdf (https://github.com/dompdf/dompdf/pull/782) /** * The location of the DOMPDF font cache directory @@ -48,7 +48,7 @@ return array( * * Note: This directory must exist and be writable by the webserver process. */ - "font_cache" => storage_path('fonts/'), + "font_cache" => storage_path('fonts'), /** * The location of a temporary directory. @@ -132,7 +132,7 @@ return array( * the desired content might be different (e.g. screen or projection view of html file). * Therefore allow specification of content here. */ - "default_media_type" => "screen", + "default_media_type" => "print", /** * The default paper size. @@ -149,7 +149,7 @@ return array( * Used if no suitable fonts can be found. This must exist in the font folder. * @var string */ - "default_font" => "serif", + "default_font" => "sans-serif", /** * Image DPI setting @@ -184,7 +184,7 @@ return array( * * @var int */ - "dpi" => 150, + "dpi" => 300, /** * Enable inline PHP 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 42eb071..455d925 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 @@ -46,6 +46,7 @@ class CreateShoppingOrdersTable extends Migration $table->unsignedInteger('weight')->nullable(); $table->boolean('paid')->default(false); + $table->text('invoice')->nullable(); $table->string('wp_invoice_path', 255)->nullable(); $table->text('wp_notice')->nullable(); diff --git a/database/migrations/2021_01_15_102718_create_settings_table.php b/database/migrations/2021_01_15_102718_create_settings_table.php index 020d752..0a58a39 100644 --- a/database/migrations/2021_01_15_102718_create_settings_table.php +++ b/database/migrations/2021_01_15_102718_create_settings_table.php @@ -23,6 +23,7 @@ class CreateSettingsTable extends Migration $table->text('object')->nullable(); $table->text('full_text')->nullable(); $table->text('text')->nullable(); + $table->integer('int')->nullable(); $table->unsignedTinyInteger('status')->default(0); diff --git a/partner-gs.code-workspace b/partner-gs.code-workspace new file mode 100644 index 0000000..876a149 --- /dev/null +++ b/partner-gs.code-workspace @@ -0,0 +1,8 @@ +{ + "folders": [ + { + "path": "." + } + ], + "settings": {} +} \ No newline at end of file diff --git a/public/10.pdf b/public/10.pdf new file mode 100644 index 0000000..579665e Binary files /dev/null and b/public/10.pdf differ diff --git a/public/fonts/roboto-v20-latin-300.eot b/public/fonts/roboto-v20-latin-300.eot new file mode 100644 index 0000000..574375d Binary files /dev/null and b/public/fonts/roboto-v20-latin-300.eot differ diff --git a/public/fonts/roboto-v20-latin-300.svg b/public/fonts/roboto-v20-latin-300.svg new file mode 100644 index 0000000..4ded944 --- /dev/null +++ b/public/fonts/roboto-v20-latin-300.svg @@ -0,0 +1,312 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/fonts/roboto-v20-latin-300.ttf b/public/fonts/roboto-v20-latin-300.ttf new file mode 100644 index 0000000..57a24e8 Binary files /dev/null and b/public/fonts/roboto-v20-latin-300.ttf differ diff --git a/public/fonts/roboto-v20-latin-300.woff b/public/fonts/roboto-v20-latin-300.woff new file mode 100644 index 0000000..2f6bdb5 Binary files /dev/null and b/public/fonts/roboto-v20-latin-300.woff differ diff --git a/public/fonts/roboto-v20-latin-300.woff2 b/public/fonts/roboto-v20-latin-300.woff2 new file mode 100644 index 0000000..ef8c883 Binary files /dev/null and b/public/fonts/roboto-v20-latin-300.woff2 differ diff --git a/public/fonts/roboto-v20-latin-500.eot b/public/fonts/roboto-v20-latin-500.eot new file mode 100644 index 0000000..2ec7bdd Binary files /dev/null and b/public/fonts/roboto-v20-latin-500.eot differ diff --git a/public/fonts/roboto-v20-latin-500.svg b/public/fonts/roboto-v20-latin-500.svg new file mode 100644 index 0000000..67eecf4 --- /dev/null +++ b/public/fonts/roboto-v20-latin-500.svg @@ -0,0 +1,305 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/fonts/roboto-v20-latin-500.ttf b/public/fonts/roboto-v20-latin-500.ttf new file mode 100644 index 0000000..dd04ff1 Binary files /dev/null and b/public/fonts/roboto-v20-latin-500.ttf differ diff --git a/public/fonts/roboto-v20-latin-500.woff b/public/fonts/roboto-v20-latin-500.woff new file mode 100644 index 0000000..8699258 Binary files /dev/null and b/public/fonts/roboto-v20-latin-500.woff differ diff --git a/public/fonts/roboto-v20-latin-500.woff2 b/public/fonts/roboto-v20-latin-500.woff2 new file mode 100644 index 0000000..6362d7f Binary files /dev/null and b/public/fonts/roboto-v20-latin-500.woff2 differ diff --git a/public/fonts/roboto-v20-latin-700.eot b/public/fonts/roboto-v20-latin-700.eot new file mode 100644 index 0000000..0168f09 Binary files /dev/null and b/public/fonts/roboto-v20-latin-700.eot differ diff --git a/public/fonts/roboto-v20-latin-700.svg b/public/fonts/roboto-v20-latin-700.svg new file mode 100644 index 0000000..11db87d --- /dev/null +++ b/public/fonts/roboto-v20-latin-700.svg @@ -0,0 +1,309 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/fonts/roboto-v20-latin-700.ttf b/public/fonts/roboto-v20-latin-700.ttf new file mode 100644 index 0000000..ea06a63 Binary files /dev/null and b/public/fonts/roboto-v20-latin-700.ttf differ diff --git a/public/fonts/roboto-v20-latin-700.woff b/public/fonts/roboto-v20-latin-700.woff new file mode 100644 index 0000000..0f14eff Binary files /dev/null and b/public/fonts/roboto-v20-latin-700.woff differ diff --git a/public/fonts/roboto-v20-latin-700.woff2 b/public/fonts/roboto-v20-latin-700.woff2 new file mode 100644 index 0000000..32b25ee Binary files /dev/null and b/public/fonts/roboto-v20-latin-700.woff2 differ diff --git a/public/fonts/roboto-v20-latin-regular.eot b/public/fonts/roboto-v20-latin-regular.eot new file mode 100644 index 0000000..4f34800 Binary files /dev/null and b/public/fonts/roboto-v20-latin-regular.eot differ diff --git a/public/fonts/roboto-v20-latin-regular.svg b/public/fonts/roboto-v20-latin-regular.svg new file mode 100644 index 0000000..627f5a3 --- /dev/null +++ b/public/fonts/roboto-v20-latin-regular.svg @@ -0,0 +1,308 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/fonts/roboto-v20-latin-regular.ttf b/public/fonts/roboto-v20-latin-regular.ttf new file mode 100644 index 0000000..a97385d Binary files /dev/null and b/public/fonts/roboto-v20-latin-regular.ttf differ diff --git a/public/fonts/roboto-v20-latin-regular.woff b/public/fonts/roboto-v20-latin-regular.woff new file mode 100644 index 0000000..69c8825 Binary files /dev/null and b/public/fonts/roboto-v20-latin-regular.woff differ diff --git a/public/fonts/roboto-v20-latin-regular.woff2 b/public/fonts/roboto-v20-latin-regular.woff2 new file mode 100644 index 0000000..1a53701 Binary files /dev/null and b/public/fonts/roboto-v20-latin-regular.woff2 differ diff --git a/public/pdf/_old_template_contract_de.pdf b/public/pdf/_old_template_contract_de.pdf new file mode 100644 index 0000000..ab98c74 --- /dev/null +++ b/public/pdf/_old_template_contract_de.pdf @@ -0,0 +1,4430 @@ +%PDF-1.3 % +1 0 obj <>]/Pages 3 0 R/Type/Catalog/ViewerPreferences<>>> endobj 2 0 obj <>stream + + + + + 2021-01-26T17:51:17+01:00 + 2021-01-26T17:51:18+01:00 + 2021-01-26T17:51:18+01:00 + Adobe InDesign 16.0 (Macintosh) + uuid:1f5927c2-18dc-e54e-ad7c-4418abc13b5d + xmp.did:912ceacf-37b6-44d6-b08e-4b5fe086ab77 + xmp.id:cf883c5b-d658-4406-bcb3-5e367b67b4c6 + proof:pdf + 1 + + xmp.iid:33bf8408-e442-41dc-a914-e66209dc6548 + xmp.did:c92c925d-11f6-4937-9edc-27d5cb86549f + xmp.did:912ceacf-37b6-44d6-b08e-4b5fe086ab77 + default + + + + + converted + from application/x-indesign to application/pdf + Adobe InDesign 16.0 (Macintosh) + / + 2021-01-26T17:51:17+01:00 + + + + application/pdf + + + GS_Vorlage-Vertrag_PDF.indd + + + Adobe PDF Library 15.0 + False + PDF/X-3:2002 + PDF/X-3:2002 + PDF/X-3:2002 + + + + endstream endobj 3 0 obj <> endobj 5 0 obj </LastModified/NumberofPages 1/OriginalDocumentID/PageTransformationMatrixList<0[1.0 0.0 0.0 1.0 0.0 0.0]>>/PageUIDList<0 211>>/PageWidthList<0 595.276>>>>>>/Resources<>/Font<>/ProcSet[/PDF/Text]>>/TrimBox[0.0 0.0 595.276 841.89]/Type/Page>> endobj 6 0 obj </LastModified/NumberofPages 1/OriginalDocumentID/PageTransformationMatrixList<0[1.0 0.0 0.0 1.0 0.0 0.0]>>/PageUIDList<0 848>>/PageWidthList<0 595.276>>>>>>/Resources<>/Font<>/ProcSet[/PDF/Text]>>/TrimBox[0.0 0.0 595.276 841.89]/Type/Page>> endobj 7 0 obj </LastModified/NumberofPages 1/OriginalDocumentID/PageTransformationMatrixList<0[1.0 0.0 0.0 1.0 0.0 0.0]>>/PageUIDList<0 1458>>/PageWidthList<0 595.276>>>>>>/Resources<>/Font<>/ProcSet[/PDF/Text]>>/TrimBox[0.0 0.0 595.276 841.89]/Type/Page>> endobj 8 0 obj </LastModified/NumberofPages 1/OriginalDocumentID/PageTransformationMatrixList<0[1.0 0.0 0.0 1.0 0.0 0.0]>>/PageUIDList<0 1790>>/PageWidthList<0 595.276>>>>>>/Resources<>/Font<>/ProcSet[/PDF/Text]>>/TrimBox[0.0 0.0 595.276 841.89]/Type/Page>> endobj 10 0 obj </LastModified/NumberofPages 1/OriginalDocumentID/PageTransformationMatrixList<0[1.0 0.0 0.0 1.0 0.0 0.0]>>/PageUIDList<0 1987>>/PageWidthList<0 595.276>>>>>>/Resources<>/Font<>/ProcSet[/PDF/Text]>>/TrimBox[0.0 0.0 595.276 841.89]/Type/Page>> endobj 22 0 obj <>stream +HWmo.a>̾A㳐"ҳj +JZK(*!)_ߙ٥$wq?Nlweyfv(@Oj~?0zF}$"u\ƚߎins|G7@63،^M=( +l0ݎnoim~dfJYGw}8J 3VFD:ϴsu2}7i)xN9};(0hmZ +}}/;k?O]X C8ݐΫLG[:B"` 'ZO 6Ӳ8hrsMSoh +V29m0|fAgp!(R Y)Y>%Q)5,}JLRmݗ2oDӮ=Cs$8I;m +6 Y?iSl¦lh-WKO䦡_o}¤uC9M"ǪfX7 櫞:[|qlSx_-4a#Yf)w|L?.!>>asLMW<'akͼ.wx!AoC} EUݧ Q +~oi6O&_},<"?q'C\2Y?a>y6XÙ":GQL*&4.bp1m~Yw;̄85wlŶ-]5WsQ\\bJMR\W-n2T:Y<4⇪Ǧ!l[T͆ʷdZ%.`Yv@}]yvRgFjNƍ@x\Þ)Oa@ft;jD56 ;n~Ş`/BL+\k }]톟|Dd.W]k|U +r4.8U5(T0t;Tyr:=#GzHNIZ/x`akSKWXM+g) x@(.랛,o+\FGXB)')kၡ=욚RmȈ70C~f| ahwab+LWʧ%UIMυ){_~ÓM_١Bَ0g8e͟Mʁw3uwP O延Plhx\FM( [l0IP Eb aEDTDK>h)eM9_jI`m?U4bB[ϣ;qxVh>T9M36p)^ЭS'?"g 6^ !qygR{ˆVl$d7էGgIqAϟuH߇z}G>O[itOm͡Dbo4MΝ01QXn<6P{2Vw:Xd4î).9P}e[%d\1#9OYwDulؑQиu{v eHmcr3GJb<;d=Pz;_>?(寞W!]뗲n\e@#'kLTk9mхݠBO?2*T:ja/4<jczUTBC<ːXT__i^@G! +_ZfmP)!vزR(j{"Y>/ !$$m~SQZa&YK~"Ͱ!;^ݿ443 +eVåM6{`aNVM8HKcs'4,?'FxMq&y*TkmYǨ(1 "H@z@{}"`&4:`mAQw|gb^hsV4i&d-q<Sd,#:&ji^rDgB.FqNeODqߎ"$hYOe \pf$(I2]x:z +lnP 3uPYAφؓ6(a%fĒ&*<92B"BrSebP, QjE41'8.x߰Q }/p.vdK[@|lXOOϒLdde(1e{i0 9#0GC9'0~96ldӢ 1GvCs|ƨ@3ByDdr\BO7.CN:K + +|L}^ˮ7Tʈ?ʒ7CN0\K)0Ukbn5>5 CG VS7 e7 bҋ[Zvka(G@p#I<ڌ7t=Te䙙7'3lYYsqg'sȀ26Ia8* y A g{h0,Ր,=}h@ZB<[eש㽼/{y1i;z;thF$eh[sc_UAGb +[L^xS(|7U3OL=gTM%MJ4*ؔ* 7?RJCc^5XhA.sJKᄽ=uaFinԲ4=9bjg)N}AɻM,BOZiJ<[lBi'#b,OEiC +DLh)|)x(Snco