From c0571b0b2efea7944b2b8a603e80fb84a8ff5335 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Tue, 21 Apr 2015 23:09:45 +0300 Subject: [PATCH] Bug fixes --- app/Http/Controllers/InvoiceController.php | 1 + app/Models/Activity.php | 1 + app/Models/Invoice.php | 4 +++ public/css/built.css | 4 +-- public/css/style.css | 3 +-- public/js/built.js | 7 ++++-- public/js/pdf.pdfmake.js | 7 ++++-- readme.md | 1 + resources/views/clients/show.blade.php | 6 +++-- resources/views/header.blade.php | 2 +- resources/views/invoices/edit.blade.php | 29 +++++++++++----------- resources/views/list.blade.php | 2 +- resources/views/master.blade.php | 2 +- 13 files changed, 42 insertions(+), 27 deletions(-) diff --git a/app/Http/Controllers/InvoiceController.php b/app/Http/Controllers/InvoiceController.php index f94fc288f9a8..244df9183b68 100644 --- a/app/Http/Controllers/InvoiceController.php +++ b/app/Http/Controllers/InvoiceController.php @@ -10,6 +10,7 @@ use Redirect; use DB; use Event; use URL; +use Datatable; use App\Models\Invoice; use App\Models\Invitation; diff --git a/app/Models/Activity.php b/app/Models/Activity.php index c8ea1c62b811..13db7ae3577f 100644 --- a/app/Models/Activity.php +++ b/app/Models/Activity.php @@ -292,6 +292,7 @@ class Activity extends Eloquent $invoice = $payment->invoice; $invoice->balance = $invoice->balance - $payment->amount; $invoice->invoice_status_id = ($invoice->balance > 0) ? INVOICE_STATUS_PARTIAL : INVOICE_STATUS_PAID; + $invoice->partial = 0; $invoice->save(); } diff --git a/app/Models/Invoice.php b/app/Models/Invoice.php index e457732dcfff..db86b9c209d6 100644 --- a/app/Models/Invoice.php +++ b/app/Models/Invoice.php @@ -7,6 +7,10 @@ class Invoice extends EntityModel use SoftDeletes; protected $dates = ['deleted_at']; + protected $casts = [ + 'is_recurring' => 'boolean', + ]; + public function account() { return $this->belongsTo('App\Models\Account'); diff --git a/public/css/built.css b/public/css/built.css index c0164e7c0d90..01e9587a4953 100644 --- a/public/css/built.css +++ b/public/css/built.css @@ -2408,13 +2408,13 @@ div.checkbox > label { .container input[type=email], .container textarea, .container select { - font-family: 'Roboto', sans-serif; + /*font-family: 'Roboto', sans-serif;*/ font-size: 16px; font-weight: 400; width: 100%; color: #000 !important; background: #f9f9f9 !important; - border: 1px solid #ebe7e7; + /*border: 1px solid #ebe7e7;*/ border-radius: 3px; } diff --git a/public/css/style.css b/public/css/style.css index 6476bc32ad23..7d16afe5ff0b 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -811,13 +811,12 @@ div.checkbox > label { .container input[type=email], .container textarea, .container select { - font-family: 'Roboto', sans-serif; font-size: 16px; font-weight: 400; width: 100%; color: #000 !important; background: #f9f9f9 !important; - border: 1px solid #ebe7e7; + /*border: 1px solid #ebe7e7;*/ border-radius: 3px; } diff --git a/public/js/built.js b/public/js/built.js index 9664f4c0c7f1..a7cec8cdf553 100644 --- a/public/js/built.js +++ b/public/js/built.js @@ -33118,15 +33118,18 @@ function truncate(str, length) { function GetPdfMake(invoice, javascript, callback) { var account = invoice.account; eval(javascript); + + /* var fonts = { Roboto: { normal: 'Roboto-Regular.ttf', bold: 'Roboto-Medium.ttf', italics: 'Roboto-Italic.ttf', bolditalics: 'Roboto-Italic.ttf' - } + }, }; - + */ + doc = pdfMake.createPdf(dd); doc.save = function(fileName) { this.download(fileName); diff --git a/public/js/pdf.pdfmake.js b/public/js/pdf.pdfmake.js index 84df5487c99c..8ad88e562480 100644 --- a/public/js/pdf.pdfmake.js +++ b/public/js/pdf.pdfmake.js @@ -1,15 +1,18 @@ function GetPdfMake(invoice, javascript, callback) { var account = invoice.account; eval(javascript); + + /* var fonts = { Roboto: { normal: 'Roboto-Regular.ttf', bold: 'Roboto-Medium.ttf', italics: 'Roboto-Italic.ttf', bolditalics: 'Roboto-Italic.ttf' - } + }, }; - + */ + doc = pdfMake.createPdf(dd); doc.save = function(fileName) { this.download(fileName); diff --git a/readme.md b/readme.md index 8516c1acafa6..631561cf9540 100644 --- a/readme.md +++ b/readme.md @@ -40,6 +40,7 @@ If you'd like to use our code to sell your own invoicing app we have an affiliat * [knockout/knockout](https://github.com/knockout/knockout) - Knockout makes it easier to create rich, responsive UIs with JavaScript * [rniemeyer/knockout-sortable](https://github.com/rniemeyer/knockout-sortable) - A Knockout.js binding to connect observableArrays with jQuery UI sortable functionality * [MrRio/jsPDF](https://github.com/MrRio/jsPDF) - Generate PDF files in JavaScript. HTML5 FTW. +* [bpampuch/pdfmake](https://github.com/bpampuch/pdfmake) - Client/server side PDF printing in pure JavaScript * [FortAwesome/Font-Awesome](https://github.com/FortAwesome/Font-Awesome) - The iconic font designed for Bootstrap that works with twitter bootstrap * [Anahkiasen/former](https://github.com/Anahkiasen/former) - A powerful form builder, for Laravel and other frameworks (stand-alone too) * [barryvdh/laravel-debugbar](https://github.com/barryvdh/laravel-debugbar) - Laravel debugbar diff --git a/resources/views/clients/show.blade.php b/resources/views/clients/show.blade.php index ea69903283c0..92d44a61f66a 100644 --- a/resources/views/clients/show.blade.php +++ b/resources/views/clients/show.blade.php @@ -43,6 +43,8 @@ @endif +
+
@@ -139,8 +141,8 @@
- -

 

+
+