Private Notes for Invoices/Quotes #1293

This commit is contained in:
Hillel Coren 2017-05-16 16:28:00 +03:00
parent efe8d870d3
commit 7d466f5569
6 changed files with 86 additions and 29 deletions

View File

@ -0,0 +1,47 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddDefaultNoteToClient extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('clients', function ($table) {
$table->text('public_notes')->nullable();
});
Schema::table('invoices', function ($table) {
$table->text('private_notes')->nullable();
});
Schema::table('payments', function ($table) {
$table->text('private_notes')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('clients', function ($table) {
$table->dropColumn('public_notes');
});
Schema::table('invoices', function ($table) {
$table->dropColumn('private_notes');
});
Schema::table('payments', function ($table) {
$table->dropColumn('private_notes');
});
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1093,7 +1093,7 @@ div.panel-body div.panel-body {
}
.invoice-table #document-upload{
width:500px;
width:550px;
}
#document-upload .dropzone{

View File

@ -340,7 +340,8 @@
<div role="tabpanel">
<ul class="nav nav-tabs" role="tablist" style="border: none">
<li role="presentation" class="active"><a href="#notes" aria-controls="notes" role="tab" data-toggle="tab">{{ trans('texts.note_to_client') }}</a></li>
<li role="presentation" class="active"><a href="#public_notes" aria-controls="notes" role="tab" data-toggle="tab">{{ trans('texts.public_notes') }}</a></li>
<li role="presentation"><a href="#private_notes" aria-controls="terms" role="tab" data-toggle="tab">{{ trans("texts.private_notes") }}</a></li>
<li role="presentation"><a href="#terms" aria-controls="terms" role="tab" data-toggle="tab">{{ trans("texts.terms") }}</a></li>
<li role="presentation"><a href="#footer" aria-controls="footer" role="tab" data-toggle="tab">{{ trans("texts.footer") }}</a></li>
@if ($account->hasFeature(FEATURE_DOCUMENTS))
@ -354,13 +355,20 @@
</ul>
<div class="tab-content">
<div role="tabpanel" class="tab-pane active" id="notes" style="padding-bottom:44px">
{!! Former::textarea('public_notes')->data_bind("value: public_notes, valueUpdate: 'afterkeydown'")
->label(null)->style('width: 500px;')->rows(4) !!}
<div role="tabpanel" class="tab-pane active" id="public_notes" style="padding-bottom:44px">
{!! Former::textarea('public_notes')
->data_bind("value: public_notes, valueUpdate: 'afterkeydown'")
->label(null)->style('width: 550px')->rows(4) !!}
</div>
<div role="tabpanel" class="tab-pane" id="private_notes" style="padding-bottom:44px">
{!! Former::textarea('private_notes')
->data_bind("value: private_notes, valueUpdate: 'afterkeydown'")
->label(null)->style('width: 550px')->rows(4) !!}
</div>
<div role="tabpanel" class="tab-pane" id="terms">
{!! Former::textarea('terms')->data_bind("value:terms, placeholder: terms_placeholder, valueUpdate: 'afterkeydown'")
->label(false)->style('width: 500px')->rows(4)
{!! Former::textarea('terms')
->data_bind("value:terms, placeholder: terms_placeholder, valueUpdate: 'afterkeydown'")
->label(false)->style('width: 550px')->rows(4)
->help('<div class="checkbox">
<label>
<input name="set_default_terms" type="checkbox" style="width: 24px" data-bind="checked: set_default_terms"/>'.trans('texts.save_as_default_terms').'
@ -371,8 +379,9 @@
</div>') !!}
</div>
<div role="tabpanel" class="tab-pane" id="footer">
{!! Former::textarea('invoice_footer')->data_bind("value:invoice_footer, placeholder: footer_placeholder, valueUpdate: 'afterkeydown'")
->label(false)->style('width: 500px')->rows(4)
{!! Former::textarea('invoice_footer')
->data_bind("value:invoice_footer, placeholder: footer_placeholder, valueUpdate: 'afterkeydown'")
->label(false)->style('width: 550px')->rows(4)
->help('<div class="checkbox">
<label>
<input name="set_default_footer" type="checkbox" style="width: 24px" data-bind="checked: set_default_footer"/>'.trans('texts.save_as_default_footer').'

View File

@ -13,9 +13,9 @@ function ViewModel(data) {
ko.mapping.fromJS(client, model.invoice().client().mapping, model.invoice().client);
@if (!$invoice->id)
self.setDueDate();
@endif
// copy default note from the client to the invoice
model.invoice().public_notes(client.public_notes);
@endif
}
self.showMoreFields = function() {
@ -190,6 +190,7 @@ function InvoiceModel(data) {
self.footer_placeholder = ko.observable({{ (!$invoice->id || $invoice->is_recurring) && $account->invoice_footer ? 'account.invoice_footer' : false}});
self.set_default_footer = ko.observable(false);
self.public_notes = ko.observable('');
self.private_notes = ko.observable('');
self.po_number = ko.observable('');
self.invoice_date = ko.observable('');
self.invoice_number = ko.observable('');