diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php index cf647dcaa8c6..7577601404d8 100644 --- a/app/Http/Controllers/AccountController.php +++ b/app/Http/Controllers/AccountController.php @@ -387,11 +387,12 @@ class AccountController extends BaseController $account->hide_paid_to_date = Input::get('hide_paid_to_date') ? true : false; $account->primary_color = Input::get('primary_color'); $account->secondary_color = Input::get('secondary_color'); - $account->invoice_design_id = Input::get('invoice_design_id'); + $account->invoice_design_id = Input::get('invoice_design_id'); + if (Input::has('font_size')) { $account->font_size = intval(Input::get('font_size')); } - + $labels = []; foreach (['item', 'description', 'unit_cost', 'quantity'] as $field) { $labels[$field] = trim(Input::get("labels_{$field}")); diff --git a/app/Http/Controllers/DashboardController.php b/app/Http/Controllers/DashboardController.php index 189b277c2c77..dfbd181d86db 100644 --- a/app/Http/Controllers/DashboardController.php +++ b/app/Http/Controllers/DashboardController.php @@ -74,7 +74,7 @@ class DashboardController extends BaseController ->where('clients.deleted_at', '=', null) ->where('contacts.deleted_at', '=', null) ->where('invoices.is_recurring', '=', false) - ->where('invoices.is_quote', '=', false) + //->where('invoices.is_quote', '=', false) ->where('invoices.balance', '>', 0) ->where('invoices.is_deleted', '=', false) ->where('contacts.is_primary', '=', true) @@ -91,7 +91,7 @@ class DashboardController extends BaseController ->where('clients.deleted_at', '=', null) ->where('contacts.deleted_at', '=', null) ->where('invoices.is_recurring', '=', false) - ->where('invoices.is_quote', '=', false) + //->where('invoices.is_quote', '=', false) ->where('invoices.balance', '>', 0) ->where('invoices.is_deleted', '=', false) ->where('contacts.is_primary', '=', true) diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 1308a4378b26..565c637b0952 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -53,7 +53,7 @@ class HomeController extends BaseController $redirectTo = Input::get('redirect_to', 'invoices/create'); return Redirect::to($redirectTo)->with('sign_up', Input::get('sign_up')); } else { - return View::make('public.header', ['invoiceNow' => true]); + return View::make('public.invoice_now'); } } diff --git a/app/Http/Controllers/InvoiceApiController.php b/app/Http/Controllers/InvoiceApiController.php index 4c13259aecb2..c12e909edc88 100644 --- a/app/Http/Controllers/InvoiceApiController.php +++ b/app/Http/Controllers/InvoiceApiController.php @@ -24,13 +24,19 @@ class InvoiceApiController extends Controller $this->mailer = $mailer; } - public function index() + public function index($clientPublicId = false) { $invoices = Invoice::scope() ->with('client', 'invitations.account') - ->where('invoices.is_quote', '=', false) - ->orderBy('created_at', 'desc') - ->get(); + ->where('invoices.is_quote', '=', false); + + if ($clientPublicId) { + $invoices->whereHas('client', function($query) use ($clientPublicId) { + $query->where('public_id', '=', $clientPublicId); + }); + } + + $invoices = $invoices->orderBy('created_at', 'desc')->get(); // Add the first invitation link to the data foreach ($invoices as $key => $invoice) { diff --git a/app/Http/Controllers/InvoiceController.php b/app/Http/Controllers/InvoiceController.php index b7e734ca14cd..6334d9f8cd93 100644 --- a/app/Http/Controllers/InvoiceController.php +++ b/app/Http/Controllers/InvoiceController.php @@ -246,8 +246,13 @@ class InvoiceController extends BaseController $paymentURL = $paymentTypes[0]['url']; } + $showApprove = $invoice->quote_invoice_id ? false : true; + if ($invoice->due_date) { + $showApprove = time() < strtotime($invoice->due_date); + } + $data = array( - 'isConverted' => $invoice->quote_invoice_id ? true : false, + 'showApprove' => $showApprove, 'showBreadcrumbs' => false, 'hideLogo' => $account->isWhiteLabel(), 'invoice' => $invoice->hidePrivateFields(), @@ -265,7 +270,7 @@ class InvoiceController extends BaseController { $invoice = Invoice::scope($publicId)->withTrashed()->with('invitations', 'account.country', 'client.contacts', 'client.country', 'invoice_items')->firstOrFail(); $entityType = $invoice->getEntityType(); - + $contactIds = DB::table('invitations') ->join('contacts', 'contacts.id', '=', 'invitations.contact_id') ->where('invitations.invoice_id', '=', $invoice->id) @@ -472,10 +477,12 @@ class InvoiceController extends BaseController $account = Auth::user()->account; if ($account->invoice_taxes != $input->invoice_taxes || $account->invoice_item_taxes != $input->invoice_item_taxes - || $account->invoice_design_id != $input->invoice->invoice_design_id) { + || $account->invoice_design_id != $input->invoice->invoice_design_id + || $account->show_item_taxes != $input->show_item_taxes) { $account->invoice_taxes = $input->invoice_taxes; $account->invoice_item_taxes = $input->invoice_item_taxes; $account->invoice_design_id = $input->invoice->invoice_design_id; + $account->show_item_taxes = $input->show_item_taxes; $account->save(); } diff --git a/app/Http/Controllers/PaymentApiController.php b/app/Http/Controllers/PaymentApiController.php index 1fb81bf78283..17d2e548f7cb 100644 --- a/app/Http/Controllers/PaymentApiController.php +++ b/app/Http/Controllers/PaymentApiController.php @@ -16,12 +16,18 @@ class PaymentApiController extends Controller $this->paymentRepo = $paymentRepo; } - public function index() + public function index($clientPublicId = false) { $payments = Payment::scope() - ->with('client', 'contact', 'invitation', 'user', 'invoice') - ->orderBy('created_at', 'desc') - ->get(); + ->with('client', 'contact', 'invitation', 'user', 'invoice'); + + if ($clientPublicId) { + $payments->whereHas('client', function($query) use ($clientPublicId) { + $query->where('public_id', '=', $clientPublicId); + }); + } + + $payments = $payments->orderBy('created_at', 'desc')->get(); $payments = Utils::remapPublicIds($payments); $response = json_encode($payments, JSON_PRETTY_PRINT); diff --git a/app/Http/Controllers/PaymentController.php b/app/Http/Controllers/PaymentController.php index 81e102d3fec4..0fec34184c45 100644 --- a/app/Http/Controllers/PaymentController.php +++ b/app/Http/Controllers/PaymentController.php @@ -447,7 +447,7 @@ class PaymentController extends BaseController if (!$response->isSuccessful()) { Session::flash('error', $response->getMessage()); - Utils::logError($response->getMessage()); + Utils::logError('Payment Error [license]: ' . $response->getMessage()); return Redirect::to('license')->withInput(); } @@ -484,7 +484,7 @@ class PaymentController extends BaseController } catch (\Exception $e) { $errorMessage = trans('texts.payment_error'); Session::flash('error', $errorMessage); - Utils::logError(Utils::getErrorString($e)); + Utils::logError('Payment Error [license-uncaught]: ' . Utils::getErrorString($e)); return Redirect::to('license')->withInput(); } @@ -543,7 +543,7 @@ class PaymentController extends BaseController $validator = Validator::make(Input::all(), $rules); if ($validator->fails()) { - Utils::logError('Payment Error [invalid]'); + //Utils::logError('Payment Error [invalid]'); return Redirect::to('payment/'.$invitationKey) ->withErrors($validator) ->withInput(); @@ -711,7 +711,7 @@ class PaymentController extends BaseController if ($accountGateway->isGateway(GATEWAY_DWOLLA) && Input::get('error')) { $errorMessage = trans('texts.payment_error')."\n\n".Input::get('error_description'); Session::flash('error', $errorMessage); - Utils::logError($errorMessage); + Utils::logError('Payment Error [dwolla]: ' . $errorMessage); return Redirect::to('view/'.$invitation->invitation_key); } @@ -729,7 +729,7 @@ class PaymentController extends BaseController } else { $errorMessage = trans('texts.payment_error')."\n\n".$response->getMessage(); Session::flash('error', $errorMessage); - Utils::logError($errorMessage); + Utils::logError('Payment Error [offsite]: ' . $errorMessage); return Redirect::to('view/'.$invitation->invitation_key); } @@ -742,7 +742,7 @@ class PaymentController extends BaseController } catch (\Exception $e) { $errorMessage = trans('texts.payment_error'); Session::flash('error', $errorMessage); - Utils::logError($errorMessage."\n\n".$e->getMessage()); + Utils::logError('Payment Error [offsite-uncaught]: ' . $errorMessage."\n\n".$e->getMessage()); return Redirect::to('view/'.$invitation->invitation_key); } diff --git a/app/Http/Controllers/QuoteApiController.php b/app/Http/Controllers/QuoteApiController.php index 83e5e8781179..24fd1639215f 100644 --- a/app/Http/Controllers/QuoteApiController.php +++ b/app/Http/Controllers/QuoteApiController.php @@ -14,13 +14,19 @@ class QuoteApiController extends Controller $this->invoiceRepo = $invoiceRepo; } - public function index() + public function index($clientPublicId = false) { $invoices = Invoice::scope() ->with('client', 'user') - ->where('invoices.is_quote', '=', true) - ->orderBy('created_at', 'desc') - ->get(); + ->where('invoices.is_quote', '=', true); + + if ($clientPublicId) { + $invoices->whereHas('client', function($query) use ($clientPublicId) { + $query->where('public_id', '=', $clientPublicId); + }); + } + + $invoices = $invoices->orderBy('created_at', 'desc')->get(); $invoices = Utils::remapPublicIds($invoices); $response = json_encode($invoices, JSON_PRETTY_PRINT); diff --git a/app/Http/Controllers/QuoteController.php b/app/Http/Controllers/QuoteController.php index d84ce2fece65..ba1db21ad9cf 100644 --- a/app/Http/Controllers/QuoteController.php +++ b/app/Http/Controllers/QuoteController.php @@ -53,7 +53,7 @@ class QuoteController extends BaseController $data = [ 'title' => trans('texts.quotes'), 'entityType' => ENTITY_QUOTE, - 'columns' => Utils::trans(['checkbox', 'quote_number', 'client', 'quote_date', 'quote_total', 'due_date', 'status', 'action']), + 'columns' => Utils::trans(['checkbox', 'quote_number', 'client', 'quote_date', 'quote_total', 'valid_until', 'status', 'action']), ]; /* diff --git a/app/Http/Controllers/TaskApiController.php b/app/Http/Controllers/TaskApiController.php new file mode 100644 index 000000000000..c15ea9fb659a --- /dev/null +++ b/app/Http/Controllers/TaskApiController.php @@ -0,0 +1,56 @@ +taskRepo = $taskRepo; + } + + public function index($clientPublicId = false) + { + $tasks = Task::scope()->with('client'); + + if ($clientPublicId) { + $tasks->whereHas('client', function($query) use ($clientPublicId) { + $query->where('public_id', '=', $clientPublicId); + }); + } + + $tasks = $tasks->orderBy('created_at', 'desc')->get(); + $tasks = Utils::remapPublicIds($tasks); + + $response = json_encode($tasks, JSON_PRETTY_PRINT); + $headers = Utils::getApiHeaders(count($tasks)); + + return Response::make($response, 200, $headers); + } + + public function store() + { + $data = Input::all(); + $taskId = isset($data['id']) ? $data['id'] : false; + + if (isset($data['client_id']) && $data['client_id']) { + $data['client'] = $data['client_id']; + } + + $task = $this->taskRepo->save($taskId, $data); + $task = Task::scope($task->public_id)->with('client')->first(); + $task = Utils::remapPublicIds([$task]); + + $response = json_encode($task, JSON_PRETTY_PRINT); + $headers = Utils::getApiHeaders(); + + return Response::make($response, 200, $headers); + } + +} diff --git a/app/Http/Controllers/TaskController.php b/app/Http/Controllers/TaskController.php index 9d15eb5f9278..3312b914f764 100644 --- a/app/Http/Controllers/TaskController.php +++ b/app/Http/Controllers/TaskController.php @@ -155,7 +155,7 @@ class TaskController extends BaseController if ($task->invoice) { $actions[] = ['url' => URL::to("inovices/{$task->invoice->public_id}/edit"), 'label' => trans("texts.view_invoice")]; } else { - $actions[] = ['url' => 'javascript:submitAction("invoice")', 'label' => trans("texts.create_invoice")]; + $actions[] = ['url' => 'javascript:submitAction("invoice")', 'label' => trans("texts.invoice_task")]; // check for any open invoices $invoices = $task->client_id ? $this->invoiceRepo->findOpenInvoices($task->client_id) : []; diff --git a/app/Http/Middleware/VerifyCsrfToken.php b/app/Http/Middleware/VerifyCsrfToken.php index bc70cdf6a810..33f62d417d81 100644 --- a/app/Http/Middleware/VerifyCsrfToken.php +++ b/app/Http/Middleware/VerifyCsrfToken.php @@ -11,6 +11,7 @@ class VerifyCsrfToken extends BaseVerifier { 'api/v1/invoices', 'api/v1/quotes', 'api/v1/payments', + 'api/v1/tasks', 'api/v1/email_invoice', 'api/v1/hooks', ]; diff --git a/app/Http/routes.php b/app/Http/routes.php index 12377947f698..128e1f34cd2d 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -182,9 +182,14 @@ Route::group(['middleware' => 'api', 'prefix' => 'api/v1'], function() { Route::resource('ping', 'ClientApiController@ping'); Route::resource('clients', 'ClientApiController'); - Route::resource('invoices', 'InvoiceApiController'); + Route::get('quotes/{client_id?}', 'QuoteApiController@index'); Route::resource('quotes', 'QuoteApiController'); + Route::get('invoices/{client_id?}', 'InvoiceApiController@index'); + Route::resource('invoices', 'InvoiceApiController'); + Route::get('payments/{client_id?}', 'PaymentApiController@index'); Route::resource('payments', 'PaymentApiController'); + Route::get('tasks/{client_id?}', 'TaskApiController@index'); + Route::resource('tasks', 'TaskApiController'); Route::post('hooks', 'IntegrationController@subscribe'); Route::post('email_invoice', 'InvoiceApiController@emailInvoice'); }); diff --git a/app/Models/Account.php b/app/Models/Account.php index fbd10efcd9b6..24884436f8b7 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -16,7 +16,7 @@ class Account extends Eloquent /* protected $casts = [ - 'hide_quantity' => 'boolean', + 'invoice_settings' => 'object', ]; */ @@ -282,6 +282,7 @@ class Account extends Eloquent 'invoice_to', 'details', 'invoice_no', + 'valid_until', ]; foreach ($fields as $field) { @@ -394,11 +395,8 @@ class Account extends Eloquent } $template = "\$client,
\r\n\r\n" . - trans("texts.{$entityType}_message", ['amount' => '$amount']) . "\r\n\r\n"; - - if ($entityType != ENTITY_PAYMENT) { - $template .= "\$link\r\n\r\n"; - } + trans("texts.{$entityType}_message", ['amount' => '$amount']) . "\r\n\r\n" . + "\$link\r\n\r\n"; if ($message) { $template .= "$message\r\n\r\n"; @@ -411,7 +409,7 @@ class Account extends Eloquent { if ($this->email_footer) { // Add line breaks if HTML isn't already being used - return strip_tags($this->email_footer) == $this->email_footer ? nl2br($this->email_footer) : $this->email_footer; + return strip_tags($this->email_footer) == $this->email_footer ? nl2br($this->email_footer) : $this->email_footer; } else { return "" . trans('texts.email_signature') . "
\$account
$client.nameValue
.
Hvis du mangler svar på nogen spørgsmål så post et spørgsmål i vores support forum.
', + 'invoice_due_date' => 'Due Date', + 'quote_due_date' => 'Valid Until', + 'valid_until' => 'Valid Until', + 'reset_terms' => 'Reset terms', + 'reset_footer' => 'Reset footer', + 'invoices_sent' => ':count invoice sent|:count invoices sent', + 'status_draft' => 'Draft', + 'status_sent' => 'Sent', + 'status_viewed' => 'Viewed', + 'status_partial' => 'Partial', + 'status_paid' => 'Paid', + 'show_line_item_tax' => 'Display line item taxes inline', + ); \ No newline at end of file diff --git a/resources/lang/de/texts.php b/resources/lang/de/texts.php index 26dd8210cf52..0aa939ee4776 100644 --- a/resources/lang/de/texts.php +++ b/resources/lang/de/texts.php @@ -752,7 +752,21 @@ return array( 'customize_help' => 'We use pdfmake to define the invoice designs declaratively. The pdfmake playground provide\'s a great way to see the library in action.
You can access any invoice field by adding Value
to the end. For example $invoiceNumberValue
displays the invoice number.
To access a child property using dot notation. For example to show the client name you could use $client.nameValue
.
If you need help figuring something out post a question to our support forum.
' - +If you need help figuring something out post a question to our support forum.
', + + 'invoice_due_date' => 'Due Date', + 'quote_due_date' => 'Valid Until', + 'valid_until' => 'Valid Until', + 'reset_terms' => 'Reset terms', + 'reset_footer' => 'Reset footer', + 'invoices_sent' => ':count invoice sent|:count invoices sent', + 'status_draft' => 'Draft', + 'status_sent' => 'Sent', + 'status_viewed' => 'Viewed', + 'status_partial' => 'Partial', + 'status_paid' => 'Paid', + 'show_line_item_tax' => 'Display line item taxes inline', + + ); diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index 85bfc7395ac5..0e7e605bddb2 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -58,8 +58,8 @@ return array( 'enable' => 'Enable', 'learn_more' => 'Learn more', 'manage_rates' => 'Manage rates', - 'note_to_client' => 'Note to client', - 'invoice_terms' => 'Invoice terms', + 'note_to_client' => 'Note to Client', + 'invoice_terms' => 'Invoice Terms', 'save_as_default_terms' => 'Save as default terms', 'download_pdf' => 'Download PDF', 'pay_now' => 'Pay Now', @@ -536,7 +536,7 @@ return array( 'click_once' => '*Please click "PAY NOW" only once - transaction may take up to 1 minute to process.', 'default_invoice_footer' => 'Set default invoice footer', - 'invoice_footer' => 'Invoice footer', + 'invoice_footer' => 'Invoice Footer', 'save_as_default_footer' => 'Save as default footer', 'token_management' => 'Token Management', @@ -752,8 +752,20 @@ return array( 'customize_help' => 'We use pdfmake to define the invoice designs declaratively. The pdfmake playground provide\'s a great way to see the library in action.
You can access any invoice field by adding Value
to the end. For example $invoiceNumberValue
displays the invoice number.
To access a child property using dot notation. For example to show the client name you could use $client.nameValue
.
If you need help figuring something out post a question to our support forum.
' +If you need help figuring something out post a question to our support forum.
', + 'invoice_due_date' => 'Due Date', + 'quote_due_date' => 'Valid Until', + 'valid_until' => 'Valid Until', + 'reset_terms' => 'Reset terms', + 'reset_footer' => 'Reset footer', + 'invoices_sent' => ':count invoice sent|:count invoices sent', + 'status_draft' => 'Draft', + 'status_sent' => 'Sent', + 'status_viewed' => 'Viewed', + 'status_partial' => 'Partial', + 'status_paid' => 'Paid', + 'show_line_item_tax' => 'Display line item taxes inline', ); diff --git a/resources/lang/es/texts.php b/resources/lang/es/texts.php index eb3b960c436d..4ead48f37a8e 100644 --- a/resources/lang/es/texts.php +++ b/resources/lang/es/texts.php @@ -730,7 +730,20 @@ return array( 'customize_help' => 'Nosotros usamos pdfmake para definir los diseños de las cuentas de cobro de manera declarativa. El playground de pdfmake es una excelente manera de ver a la librería en acción.
Puede acceder cualquier campo de una factura agregando Value
al final. Por ejemplo, $invoiceNumberValue
muestra el número de factura.
Para acceder a una propiedad hija usando notación de punto.Por ejemplo, para mostrar el nombre de un cliente se puede usar $client.nameValue
.
Si necesita ayuda entendiendo algo puede preguntar en nuestro foro de soporte.
' +Si necesita ayuda entendiendo algo puede preguntar en nuestro foro de soporte.
', + + 'invoice_due_date' => 'Due Date', + 'quote_due_date' => 'Valid Until', + 'valid_until' => 'Valid Until', + 'reset_terms' => 'Reset terms', + 'reset_footer' => 'Reset footer', + 'invoices_sent' => ':count invoice sent|:count invoices sent', + 'status_draft' => 'Draft', + 'status_sent' => 'Sent', + 'status_viewed' => 'Viewed', + 'status_partial' => 'Partial', + 'status_paid' => 'Paid', + 'show_line_item_tax' => 'Display line item taxes inline', diff --git a/resources/lang/es_ES/texts.php b/resources/lang/es_ES/texts.php index abac45b8f600..e46005f97a44 100644 --- a/resources/lang/es_ES/texts.php +++ b/resources/lang/es_ES/texts.php @@ -752,7 +752,20 @@ return array( 'customize_help' => 'We use pdfmake to define the invoice designs declaratively. The pdfmake playground provide\'s a great way to see the library in action.
You can access any invoice field by adding Value
to the end. For example $invoiceNumberValue
displays the invoice number.
To access a child property using dot notation. For example to show the client name you could use $client.nameValue
.
If you need help figuring something out post a question to our support forum.
' +If you need help figuring something out post a question to our support forum.
', + + 'invoice_due_date' => 'Due Date', + 'quote_due_date' => 'Valid Until', + 'valid_until' => 'Valid Until', + 'reset_terms' => 'Reset terms', + 'reset_footer' => 'Reset footer', + 'invoices_sent' => ':count invoice sent|:count invoices sent', + 'status_draft' => 'Draft', + 'status_sent' => 'Sent', + 'status_viewed' => 'Viewed', + 'status_partial' => 'Partial', + 'status_paid' => 'Paid', + 'show_line_item_tax' => 'Display line item taxes inline', diff --git a/resources/lang/fr/texts.php b/resources/lang/fr/texts.php index fb2c63f5d2dc..5a6005dfae0d 100644 --- a/resources/lang/fr/texts.php +++ b/resources/lang/fr/texts.php @@ -744,7 +744,20 @@ return array( 'customize_help' => 'Nous utilisons pdfmake pour définir le design des factures. Le bac à sable de pdfmake est une bonne façon de voir cette bibliothèque en action.
Vous pouvez accéder à n\'importe quel champ de facture en ajoutant Value
à la fin. Par exemple $invoiceNumberValue
affiche le numéro de facture.
Pour accéder à une propriété héritée avec la notation par point. Par exemple pour montrer le nom du client vous pouvez utiliser $client.nameValue
.
Si vous avez besoin d\'aide pour comprendre quelque chose envoyez une question à notre forum de support.
' +Si vous avez besoin d\'aide pour comprendre quelque chose envoyez une question à notre forum de support.
', + + 'invoice_due_date' => 'Due Date', + 'quote_due_date' => 'Valid Until', + 'valid_until' => 'Valid Until', + 'reset_terms' => 'Reset terms', + 'reset_footer' => 'Reset footer', + 'invoices_sent' => ':count invoice sent|:count invoices sent', + 'status_draft' => 'Draft', + 'status_sent' => 'Sent', + 'status_viewed' => 'Viewed', + 'status_partial' => 'Partial', + 'status_paid' => 'Paid', + 'show_line_item_tax' => 'Display line item taxes inline', diff --git a/resources/lang/fr_CA/texts.php b/resources/lang/fr_CA/texts.php index 9ccbfb13080d..224f6f21137a 100644 --- a/resources/lang/fr_CA/texts.php +++ b/resources/lang/fr_CA/texts.php @@ -745,7 +745,21 @@ return array( 'customize_help' => 'We use pdfmake to define the invoice designs declaratively. The pdfmake playground provide\'s a great way to see the library in action.
You can access any invoice field by adding Value
to the end. For example $invoiceNumberValue
displays the invoice number.
To access a child property using dot notation. For example to show the client name you could use $client.nameValue
.
If you need help figuring something out post a question to our support forum.
' +If you need help figuring something out post a question to our support forum.
', + + 'invoice_due_date' => 'Due Date', + 'quote_due_date' => 'Valid Until', + 'valid_until' => 'Valid Until', + 'reset_terms' => 'Reset terms', + 'reset_footer' => 'Reset footer', + 'invoices_sent' => ':count invoice sent|:count invoices sent', + 'status_draft' => 'Draft', + 'status_sent' => 'Sent', + 'status_viewed' => 'Viewed', + 'status_partial' => 'Partial', + 'status_paid' => 'Paid', + 'show_line_item_tax' => 'Display line item taxes inline', + diff --git a/resources/lang/it/texts.php b/resources/lang/it/texts.php index 996c4672da8f..b999643fff33 100644 --- a/resources/lang/it/texts.php +++ b/resources/lang/it/texts.php @@ -747,7 +747,20 @@ return array( 'customize_help' => 'We use pdfmake to define the invoice designs declaratively. The pdfmake playground provide\'s a great way to see the library in action.
You can access any invoice field by adding Value
to the end. For example $invoiceNumberValue
displays the invoice number.
To access a child property using dot notation. For example to show the client name you could use $client.nameValue
.
If you need help figuring something out post a question to our support forum.
' +If you need help figuring something out post a question to our support forum.
', + + 'invoice_due_date' => 'Due Date', + 'quote_due_date' => 'Valid Until', + 'valid_until' => 'Valid Until', + 'reset_terms' => 'Reset terms', + 'reset_footer' => 'Reset footer', + 'invoices_sent' => ':count invoice sent|:count invoices sent', + 'status_draft' => 'Draft', + 'status_sent' => 'Sent', + 'status_viewed' => 'Viewed', + 'status_partial' => 'Partial', + 'status_paid' => 'Paid', + 'show_line_item_tax' => 'Display line item taxes inline', diff --git a/resources/lang/lt/texts.php b/resources/lang/lt/texts.php index 1bbf6a1ddd9a..a0957572f616 100644 --- a/resources/lang/lt/texts.php +++ b/resources/lang/lt/texts.php @@ -754,7 +754,20 @@ return array( 'customize_help' => 'We use pdfmake to define the invoice designs declaratively. The pdfmake playground provide\'s a great way to see the library in action.
You can access any invoice field by adding Value
to the end. For example $invoiceNumberValue
displays the invoice number.
To access a child property using dot notation. For example to show the client name you could use $client.nameValue
.
If you need help figuring something out post a question to our support forum.
' +If you need help figuring something out post a question to our support forum.
', + + 'invoice_due_date' => 'Due Date', + 'quote_due_date' => 'Valid Until', + 'valid_until' => 'Valid Until', + 'reset_terms' => 'Reset terms', + 'reset_footer' => 'Reset footer', + 'invoices_sent' => ':count invoice sent|:count invoices sent', + 'status_draft' => 'Draft', + 'status_sent' => 'Sent', + 'status_viewed' => 'Viewed', + 'status_partial' => 'Partial', + 'status_paid' => 'Paid', + 'show_line_item_tax' => 'Display line item taxes inline', diff --git a/resources/lang/nb_NO/texts.php b/resources/lang/nb_NO/texts.php index bdea61343590..12fb585562c1 100644 --- a/resources/lang/nb_NO/texts.php +++ b/resources/lang/nb_NO/texts.php @@ -752,7 +752,20 @@ return array( 'customize_help' => 'We use pdfmake to define the invoice designs declaratively. The pdfmake playground provide\'s a great way to see the library in action.
You can access any invoice field by adding Value
to the end. For example $invoiceNumberValue
displays the invoice number.
To access a child property using dot notation. For example to show the client name you could use $client.nameValue
.
If you need help figuring something out post a question to our support forum.
' +If you need help figuring something out post a question to our support forum.
', + + 'invoice_due_date' => 'Due Date', + 'quote_due_date' => 'Valid Until', + 'valid_until' => 'Valid Until', + 'reset_terms' => 'Reset terms', + 'reset_footer' => 'Reset footer', + 'invoices_sent' => ':count invoice sent|:count invoices sent', + 'status_draft' => 'Draft', + 'status_sent' => 'Sent', + 'status_viewed' => 'Viewed', + 'status_partial' => 'Partial', + 'status_paid' => 'Paid', + 'show_line_item_tax' => 'Display line item taxes inline', diff --git a/resources/lang/nl/texts.php b/resources/lang/nl/texts.php index 273739466a78..7c452a446a85 100644 --- a/resources/lang/nl/texts.php +++ b/resources/lang/nl/texts.php @@ -747,7 +747,20 @@ return array( 'customize_help' => 'We gebruiken pdfmake om de factuur ontwerpen declaratief te definieren. De pdfmake playground is een interessante manier om de library in actie te zien.
Je kan elk factuur veld gebruiken door Veld
toe te voegen op het einde. Bijvoorbeeld $invoiceNumberValue
toont de factuur nummer.
Gebruik dot notatie om een "kind eigenschap" te gebruiken. Bijvoorbeeld voor de klant naam te tonen gebruik je $client.nameValue
.
Als je ergens hulp bij nodig hebt, post dan een vraag op ons support forum.
' +Als je ergens hulp bij nodig hebt, post dan een vraag op ons support forum.
', + + 'invoice_due_date' => 'Due Date', + 'quote_due_date' => 'Valid Until', + 'valid_until' => 'Valid Until', + 'reset_terms' => 'Reset terms', + 'reset_footer' => 'Reset footer', + 'invoices_sent' => ':count invoice sent|:count invoices sent', + 'status_draft' => 'Draft', + 'status_sent' => 'Sent', + 'status_viewed' => 'Viewed', + 'status_partial' => 'Partial', + 'status_paid' => 'Paid', + 'show_line_item_tax' => 'Display line item taxes inline', diff --git a/resources/lang/pt_BR/texts.php b/resources/lang/pt_BR/texts.php index b3e9389e7d0d..083919ab7482 100644 --- a/resources/lang/pt_BR/texts.php +++ b/resources/lang/pt_BR/texts.php @@ -747,8 +747,20 @@ return array( 'customize_help' => 'We use pdfmake to define the invoice designs declaratively. The pdfmake playground provide\'s a great way to see the library in action.
You can access any invoice field by adding Value
to the end. For example $invoiceNumberValue
displays the invoice number.
To access a child property using dot notation. For example to show the client name you could use $client.nameValue
.
If you need help figuring something out post a question to our support forum.
' +If you need help figuring something out post a question to our support forum.
', + 'invoice_due_date' => 'Due Date', + 'quote_due_date' => 'Valid Until', + 'valid_until' => 'Valid Until', + 'reset_terms' => 'Reset terms', + 'reset_footer' => 'Reset footer', + 'invoices_sent' => ':count invoice sent|:count invoices sent', + 'status_draft' => 'Draft', + 'status_sent' => 'Sent', + 'status_viewed' => 'Viewed', + 'status_partial' => 'Partial', + 'status_paid' => 'Paid', + 'show_line_item_tax' => 'Display line item taxes inline', ); diff --git a/resources/lang/sv/texts.php b/resources/lang/sv/texts.php index 4cac8ff4c2ef..96cdb1e885a0 100644 --- a/resources/lang/sv/texts.php +++ b/resources/lang/sv/texts.php @@ -750,7 +750,20 @@ return array( 'customize_help' => 'We use pdfmake to define the invoice designs declaratively. The pdfmake playground provide\'s a great way to see the library in action.
You can access any invoice field by adding Value
to the end. For example $invoiceNumberValue
displays the invoice number.
To access a child property using dot notation. For example to show the client name you could use $client.nameValue
.
If you need help figuring something out post a question to our support forum.
' +If you need help figuring something out post a question to our support forum.
', + + 'invoice_due_date' => 'Due Date', + 'quote_due_date' => 'Valid Until', + 'valid_until' => 'Valid Until', + 'reset_terms' => 'Reset terms', + 'reset_footer' => 'Reset footer', + 'invoices_sent' => ':count invoice sent|:count invoices sent', + 'status_draft' => 'Draft', + 'status_sent' => 'Sent', + 'status_viewed' => 'Viewed', + 'status_partial' => 'Partial', + 'status_paid' => 'Paid', + 'show_line_item_tax' => 'Display line item taxes inline', diff --git a/resources/views/accounts/invoice_design.blade.php b/resources/views/accounts/invoice_design.blade.php index 0e93c4727115..d152914f68e0 100644 --- a/resources/views/accounts/invoice_design.blade.php +++ b/resources/views/accounts/invoice_design.blade.php @@ -35,7 +35,7 @@ invoice.account.hide_quantity = $('#hide_quantity').is(":checked"); invoice.account.hide_paid_to_date = $('#hide_paid_to_date').is(":checked"); invoice.invoice_design_id = $('#invoice_design_id').val(); - + NINJA.primaryColor = $('#primary_color').val(); NINJA.secondaryColor = $('#secondary_color').val(); NINJA.fontSize = parseInt($('#font_size').val()); @@ -82,6 +82,7 @@ {!! Former::populate($account) !!} {!! Former::populateField('hide_quantity', intval($account->hide_quantity)) !!} {!! Former::populateField('hide_paid_to_date', intval($account->hide_paid_to_date)) !!} + @foreach ($invoiceLabels as $field => $value) {!! Former::populateField("labels_{$field}", $value) !!} @endforeach @@ -136,14 +137,14 @@ - @if (Auth::user()->isPro()) - {!! Former::actions( Button::success(trans('texts.save'))->submit()->large()->appendIcon(Icon::create('floppy-disk'))) !!} - @else - + @if (Auth::user()->isPro()) + {!! Former::actions( Button::success(trans('texts.save'))->submit()->large()->appendIcon(Icon::create('floppy-disk'))) !!} + @else + @endif {!! Former::close() !!} diff --git a/resources/views/clients/show.blade.php b/resources/views/clients/show.blade.php index 2c507d504048..2eb8c85937cb 100644 --- a/resources/views/clients/show.blade.php +++ b/resources/views/clients/show.blade.php @@ -200,7 +200,7 @@ trans('texts.quote_number'), trans('texts.quote_date'), trans('texts.total'), - trans('texts.due_date'), + trans('texts.valid_until'), trans('texts.status')) ->setUrl(url('api/quotes/'. $client->public_id)) ->setOptions('sPaginationType', 'bootstrap') diff --git a/resources/views/credits/edit.blade.php b/resources/views/credits/edit.blade.php index 3cb86b89fed9..5c8377038f21 100644 --- a/resources/views/credits/edit.blade.php +++ b/resources/views/credits/edit.blade.php @@ -16,7 +16,10 @@ {!! Former::select('client')->addOption('', '')->addGroupClass('client-select') !!} {!! Former::text('amount') !!} - {!! Former::text('credit_date')->data_date_format(Session::get(SESSION_DATE_PICKER_FORMAT, DEFAULT_DATE_PICKER_FORMAT))->append('') !!} + {!! Former::text('credit_date') + ->data_date_format(Session::get(SESSION_DATE_PICKER_FORMAT, DEFAULT_DATE_PICKER_FORMAT)) + ->addGroupClass('credit_date') + ->append('') !!} {!! Former::textarea('private_notes') !!} @@ -61,6 +64,9 @@ $('#amount').focus(); @endif + $('.credit_date .input-group-addon').click(function() { + toggleDatePicker('credit_date'); + }); }); diff --git a/resources/views/dashboard.blade.php b/resources/views/dashboard.blade.php index f4e52f16e67f..637a7e4430dc 100644 --- a/resources/views/dashboard.blade.php +++ b/resources/views/dashboard.blade.php @@ -72,7 +72,7 @@@@ -185,6 +187,15 @@ scaleLabel : "<%=value%>", }; + $(function() { + $('.start_date .input-group-addon').click(function() { + toggleDatePicker('start_date'); + }); + $('.end_date .input-group-addon').click(function() { + toggleDatePicker('end_date'); + }); + }) + new Chart(ctx).{!! $chartType !!}(chart, options); diff --git a/resources/views/users/account_management.blade.php b/resources/views/users/account_management.blade.php index 3839a0bb4377..328ca9b920e2 100644 --- a/resources/views/users/account_management.blade.php +++ b/resources/views/users/account_management.blade.php @@ -4,7 +4,9 @@
diff --git a/storage/templates/bold.js b/storage/templates/bold.js index 2a289f0f72f9..4784d1fe4367 100644 --- a/storage/templates/bold.js +++ b/storage/templates/bold.js @@ -3,17 +3,12 @@ { "columns": [ { - "image": "$accountLogo", - "width": 80, - "margin": [60, -40, 0, 0] - }, - { - "width": 300, + "width": 380, "stack": [ {"text":"$yourInvoiceLabelUC", "style": "yourInvoice"}, "$clientDetails" ], - "margin": [-32, 120, 0, 0] + "margin": [60, 100, 0, 10] }, { "canvas": [ @@ -29,14 +24,14 @@ } ], "width":10, - "margin":[-10,120,0,0] + "margin":[-10,100,0,10] }, { "table": { "body": "$invoiceDetails" }, "layout": "noBorders", - "margin": [0, 130, 0, 0] + "margin": [0, 110, 0, 0] } ] }, @@ -44,7 +39,7 @@ "style": "invoiceLineItemsTable", "table": { "headerRows": 1, - "widths": ["15%", "*", "12%", "$quantityWidth", "22%"], + "widths": ["15%", "*", "14%", "$quantityWidth", "22%"], "body": "$invoiceLineItems" }, "layout": { @@ -80,36 +75,58 @@ } ], "footer": [ - {"canvas": [{ "type": "line", "x1": 0, "y1": 0, "x2": 600, "y2": 0,"lineWidth": 100,"lineColor":"#2e2b2b"}]}, + {"canvas": [{ "type": "line", "x1": 0, "y1": 0, "x2": 600, "y2": 0,"lineWidth": 100,"lineColor":"$secondaryColor:#2e2b2b"}]}, { "text": "$invoiceFooter", - "margin": [40, -20, 40, 0], + "margin": [40, 0, 40, 0], "alignment": "left", "color": "#FFFFFF" } ], "header": [ - {"canvas": [{ "type": "line", "x1": 0, "y1": 0, "x2": 50, "y2":0,"lineWidth": 200,"lineColor":"#2e2b2b"}],"width":100,"margin":[0,0,0,0]}, - {"canvas": [{ "type": "line", "x1": 0, "y1": 0, "x2": 150, "y2":0,"lineWidth": 60,"lineColor":"#2e2b2b"}],"width":100,"margin":[0,0,0,0]}, - {"canvas": [{ "type": "line", "x1": 149, "y1": 0, "x2": 600, "y2":0,"lineWidth": 200,"lineColor":"#2e2b2b"}],"width":10,"margin":[0,0,0,0]}, - { + { + "canvas": [ + { + "type": "line", + "x1": 0, + "y1": 0, + "x2": 600, + "y2": 0, + "lineWidth": 200, + "lineColor": "$secondaryColor:#2e2b2b" + } + ], + "width": 10 + }, + { "columns": [ - { - "text": " ", - "width": 260 - }, - { - "stack": "$accountDetails", - "margin": [0, 16, 0, 0], - "width": 140 - }, - { - "stack": "$accountAddress", - "margin": [20, 16, 0, 0] - } + { + "image": "$accountLogo", + "fit": [120, 80], + "margin": [30, 20, 0, 0] + }, + { + "stack": "$accountDetails", + "margin": [ + 0, + 16, + 0, + 0 + ], + "width": 140 + }, + { + "stack": "$accountAddress", + "margin": [ + 20, + 16, + 0, + 0 + ] + } ] - } - ], + } + ], "defaultStyle": { "fontSize": "$fontSize", "margin": [8, 4, 8, 4] @@ -120,16 +137,19 @@ }, "accountName": { "bold": true, - "margin": [4, 2, 4, 2], + "margin": [4, 2, 4, 1], "color": "$primaryColor:#36a498" }, "accountDetails": { - "margin": [4, 2, 4, 2], - "color": "#AAA9A9" + "margin": [4, 2, 4, 1], + "color": "#FFFFFF" }, "accountAddress": { - "margin": [4, 2, 4, 2], - "color": "#AAA9A9" + "margin": [4, 2, 4, 1], + "color": "#FFFFFF" + }, + "clientDetails": { + "margin": [0, 2, 0, 1] }, "odd": { "fillColor": "#ebebeb", @@ -169,6 +189,9 @@ "qtyTableHeader": { "alignment": "right" }, + "taxTableHeader": { + "alignment": "right" + }, "lineTotalTableHeader": { "alignment": "right", "margin": [0, 0, 40, 0] diff --git a/storage/templates/clean.js b/storage/templates/clean.js index 8f4c70ee16cb..22b0b7149495 100644 --- a/storage/templates/clean.js +++ b/storage/templates/clean.js @@ -156,6 +156,9 @@ "qtyTableHeader": { "alignment": "right" }, + "taxTableHeader": { + "alignment": "right" + }, "lineTotalTableHeader": { "alignment": "right" }, diff --git a/storage/templates/modern.js b/storage/templates/modern.js index f37bc2acceb7..7471bbeb11b0 100644 --- a/storage/templates/modern.js +++ b/storage/templates/modern.js @@ -14,7 +14,7 @@ ] }, { - "canvas": [{ "type": "rect", "x": 0, "y": 0, "w": 515, "h": 26, "r":0, "lineWidth": 1, "color":"#403d3d"}],"width":10,"margin":[0,25,0,-30]}, + "canvas": [{ "type": "rect", "x": 0, "y": 0, "w": 515, "h": 26, "r":0, "lineWidth": 1, "color":"$secondaryColor:#403d3d"}],"width":10,"margin":[0,25,0,-30]}, { "style": "invoiceLineItemsTable", "table": { @@ -63,7 +63,7 @@ "h": 26, "r": 0, "lineWidth": 1, - "color": "#403d3d" + "color": "$secondaryColor:#403d3d" } ], "width": 10, @@ -183,6 +183,9 @@ "qtyTableHeader": { "alignment": "right" }, + "taxTableHeader": { + "alignment": "right" + }, "lineTotalTableHeader": { "alignment": "right" },