diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php
index cd811137c38f..6fc1595c03a7 100755
--- a/app/controllers/AccountController.php
+++ b/app/controllers/AccountController.php
@@ -315,9 +315,9 @@ class AccountController extends \BaseController {
}
else if ($section == ACCOUNT_ADVANCED_SETTINGS)
{
- if ($subSection == ACCOUNT_CUSTOM_FIELDS)
+ if ($subSection == ACCOUNT_INVOICE_SETTINGS)
{
- return AccountController::saveCustomFields();
+ return AccountController::saveInvoiceSettings();
}
else if ($subSection == ACCOUNT_INVOICE_DESIGN)
{
@@ -342,11 +342,12 @@ class AccountController extends \BaseController {
return Redirect::to('company/products');
}
- private function saveCustomFields()
+ private function saveInvoiceSettings()
{
if (Auth::user()->account->isPro())
{
$account = Auth::user()->account;
+
$account->custom_label1 = trim(Input::get('custom_label1'));
$account->custom_value1 = trim(Input::get('custom_value1'));
$account->custom_label2 = trim(Input::get('custom_label2'));
@@ -357,12 +358,26 @@ class AccountController extends \BaseController {
$account->custom_invoice_label2 = trim(Input::get('custom_invoice_label2'));
$account->custom_invoice_taxes1 = Input::get('custom_invoice_taxes1') ? true : false;
$account->custom_invoice_taxes2 = Input::get('custom_invoice_taxes2') ? true : false;
- $account->save();
- Session::flash('message', trans('texts.updated_settings'));
+ $account->invoice_number_prefix = Input::get('invoice_number_prefix');
+ $account->invoice_number_counter = Input::get('invoice_number_counter');
+ $account->quote_number_prefix = Input::get('quote_number_prefix');
+ $account->share_counter = Input::get('share_counter') ? true : false;
+
+ if (!$account->share_counter) {
+ $account->quote_number_counter = Input::get('quote_number_counter');
+ }
+
+ if (!$account->share_counter && $account->invoice_number_prefix == $account->quote_number_prefix) {
+ Session::flash('error', trans('texts.invalid_counter'));
+ return Redirect::to('company/advanced_settings/invoice_settings')->withInput();
+ } else {
+ $account->save();
+ Session::flash('message', trans('texts.updated_settings'));
+ }
}
- return Redirect::to('company/advanced_settings/custom_fields');
+ return Redirect::to('company/advanced_settings/invoice_settings');
}
private function saveInvoiceDesign()
diff --git a/app/controllers/InvoiceController.php b/app/controllers/InvoiceController.php
index 590d7dca7e88..18062f31a420 100755
--- a/app/controllers/InvoiceController.php
+++ b/app/controllers/InvoiceController.php
@@ -151,7 +151,7 @@ class InvoiceController extends \BaseController {
if ($clone)
{
$invoice->id = null;
- $invoice->invoice_number = Auth::user()->account->getNextInvoiceNumber();
+ $invoice->invoice_number = Auth::user()->account->getNextInvoiceNumber($invoice->is_quote);
$invoice->balance = $invoice->amount;
$method = 'POST';
$url = "{$entityType}s";
diff --git a/app/controllers/QuoteController.php b/app/controllers/QuoteController.php
index 3dee961af837..683cc0bf00ec 100644
--- a/app/controllers/QuoteController.php
+++ b/app/controllers/QuoteController.php
@@ -60,7 +60,7 @@ class QuoteController extends \BaseController {
}
$client = null;
- $invoiceNumber = Auth::user()->account->getNextInvoiceNumber();
+ $invoiceNumber = Auth::user()->account->getNextInvoiceNumber(true);
$account = Account::with('country')->findOrFail(Auth::user()->account_id);
if ($clientPublicId)
diff --git a/app/database/migrations/2014_10_13_054100_add_invoice_number_settings.php b/app/database/migrations/2014_10_13_054100_add_invoice_number_settings.php
new file mode 100644
index 000000000000..27abab49d1d8
--- /dev/null
+++ b/app/database/migrations/2014_10_13_054100_add_invoice_number_settings.php
@@ -0,0 +1,63 @@
+text('invoice_number_prefix')->nullable();
+ $table->integer('invoice_number_counter')->default(1)->nullable();
+
+ $table->text('quote_number_prefix')->nullable();
+ $table->integer('quote_number_counter')->default(1)->nullable();
+
+ $table->boolean('share_counter')->default(true);
+ });
+
+ // set initial counter value for accounts with invoices
+ $accounts = DB::table('accounts')->lists('id');
+
+ foreach ($accounts as $accountId) {
+
+ $invoiceNumbers = DB::table('invoices')->where('account_id', $accountId)->lists('invoice_number');
+ $max = 0;
+
+ foreach ($invoiceNumbers as $invoiceNumber) {
+ $number = intval(preg_replace('/[^0-9]/', '', $invoiceNumber));
+ $max = max($max, $number);
+ }
+
+ DB::table('accounts')->where('id', $accountId)->update(['invoice_number_counter' => ++$max]);
+ }
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::table('accounts', function($table)
+ {
+ $table->dropColumn('invoice_number_prefix');
+ $table->dropColumn('invoice_number_counter');
+
+ $table->dropColumn('quote_number_prefix');
+ $table->dropColumn('quote_number_counter');
+
+ $table->dropColumn('share_counter');
+ });
+
+ }
+
+}
diff --git a/app/lang/de/texts.php b/app/lang/de/texts.php
index f7ad286a6072..eafe2549cfa3 100644
--- a/app/lang/de/texts.php
+++ b/app/lang/de/texts.php
@@ -424,5 +424,14 @@ return array(
'sample_data' => 'Sample data shown',
'hide' => 'Hide',
'new_version_available' => 'A new version of :releases_link is available. You\'re running v:user_version, the latest is v:latest_version',
+
+ 'invoice_settings' => 'Invoice Settings',
+ 'invoice_number_prefix' => 'Invoice Number Prefix',
+ 'invoice_number_counter' => 'Invoice Number Counter',
+ 'quote_number_prefix' => 'Quote Number Prefix',
+ 'quote_number_counter' => 'Quote Number Counter',
+ 'share_invoice_counter' => 'Share invoice counter',
+ 'invoice_issued_to' => 'Invoice issued to',
+ 'invalid_counter' => 'To prevent a possible conflict please set either an invoice or quote number prefix',
);
diff --git a/app/lang/en/texts.php b/app/lang/en/texts.php
index a6d3b9f495e5..2b60a0101375 100644
--- a/app/lang/en/texts.php
+++ b/app/lang/en/texts.php
@@ -433,4 +433,14 @@ return array(
'hide' => 'Hide',
'new_version_available' => 'A new version of :releases_link is available. You\'re running v:user_version, the latest is v:latest_version',
+ 'invoice_settings' => 'Invoice Settings',
+ 'invoice_number_prefix' => 'Invoice Number Prefix',
+ 'invoice_number_counter' => 'Invoice Number Counter',
+ 'quote_number_prefix' => 'Quote Number Prefix',
+ 'quote_number_counter' => 'Quote Number Counter',
+ 'share_invoice_counter' => 'Share invoice counter',
+ 'invoice_issued_to' => 'Invoice issued to',
+ 'invalid_counter' => 'To prevent a possible conflict please set either an invoice or quote number prefix',
+
+
);
\ No newline at end of file
diff --git a/app/lang/es/texts.php b/app/lang/es/texts.php
index 668e2abb590b..30fd20b6c0c6 100644
--- a/app/lang/es/texts.php
+++ b/app/lang/es/texts.php
@@ -422,5 +422,14 @@ return array(
'sample_data' => 'Sample data shown',
'hide' => 'Hide',
'new_version_available' => 'A new version of :releases_link is available. You\'re running v:user_version, the latest is v:latest_version',
+
+ 'invoice_settings' => 'Invoice Settings',
+ 'invoice_number_prefix' => 'Invoice Number Prefix',
+ 'invoice_number_counter' => 'Invoice Number Counter',
+ 'quote_number_prefix' => 'Quote Number Prefix',
+ 'quote_number_counter' => 'Quote Number Counter',
+ 'share_invoice_counter' => 'Share invoice counter',
+ 'invoice_issued_to' => 'Invoice issued to',
+ 'invalid_counter' => 'To prevent a possible conflict please set either an invoice or quote number prefix',
);
diff --git a/app/lang/fr/texts.php b/app/lang/fr/texts.php
index e5cc815f7093..f0bacd42185e 100644
--- a/app/lang/fr/texts.php
+++ b/app/lang/fr/texts.php
@@ -425,5 +425,14 @@ return array(
'hide' => 'Hide',
'new_version_available' => 'A new version of :releases_link is available. You\'re running v:user_version, the latest is v:latest_version',
+
+ 'invoice_settings' => 'Invoice Settings',
+ 'invoice_number_prefix' => 'Invoice Number Prefix',
+ 'invoice_number_counter' => 'Invoice Number Counter',
+ 'quote_number_prefix' => 'Quote Number Prefix',
+ 'quote_number_counter' => 'Quote Number Counter',
+ 'share_invoice_counter' => 'Share invoice counter',
+ 'invoice_issued_to' => 'Invoice issued to',
+ 'invalid_counter' => 'To prevent a possible conflict please set either an invoice or quote number prefix',
);
diff --git a/app/lang/it/texts.php b/app/lang/it/texts.php
index 8a6df978935c..1d7890a569fd 100644
--- a/app/lang/it/texts.php
+++ b/app/lang/it/texts.php
@@ -425,5 +425,14 @@ return array(
'hide' => 'Hide',
'new_version_available' => 'A new version of :releases_link is available. You\'re running v:user_version, the latest is v:latest_version',
+ 'invoice_settings' => 'Invoice Settings',
+ 'invoice_number_prefix' => 'Invoice Number Prefix',
+ 'invoice_number_counter' => 'Invoice Number Counter',
+ 'quote_number_prefix' => 'Quote Number Prefix',
+ 'quote_number_counter' => 'Quote Number Counter',
+ 'share_invoice_counter' => 'Share invoice counter',
+ 'invoice_issued_to' => 'Invoice issued to',
+ 'invalid_counter' => 'To prevent a possible conflict please set either an invoice or quote number prefix',
+
);
diff --git a/app/lang/lt/texts.php b/app/lang/lt/texts.php
index f345dd6dd993..9b6056163ebb 100644
--- a/app/lang/lt/texts.php
+++ b/app/lang/lt/texts.php
@@ -433,6 +433,15 @@ return array(
'hide' => 'Hide',
'new_version_available' => 'A new version of :releases_link is available. You\'re running v:user_version, the latest is v:latest_version',
+ 'invoice_settings' => 'Invoice Settings',
+ 'invoice_number_prefix' => 'Invoice Number Prefix',
+ 'invoice_number_counter' => 'Invoice Number Counter',
+ 'quote_number_prefix' => 'Quote Number Prefix',
+ 'quote_number_counter' => 'Quote Number Counter',
+ 'share_invoice_counter' => 'Share invoice counter',
+ 'invoice_issued_to' => 'Invoice issued to',
+ 'invalid_counter' => 'To prevent a possible conflict please set either an invoice or quote number prefix',
+
);
diff --git a/app/lang/nb_NO/texts.php b/app/lang/nb_NO/texts.php
index 44b5e0bbc354..7bcba4ebcb47 100644
--- a/app/lang/nb_NO/texts.php
+++ b/app/lang/nb_NO/texts.php
@@ -433,5 +433,14 @@ return array(
'hide' => 'Hide',
'new_version_available' => 'A new version of :releases_link is available. You\'re running v:user_version, the latest is v:latest_version',
+ 'invoice_settings' => 'Invoice Settings',
+ 'invoice_number_prefix' => 'Invoice Number Prefix',
+ 'invoice_number_counter' => 'Invoice Number Counter',
+ 'quote_number_prefix' => 'Quote Number Prefix',
+ 'quote_number_counter' => 'Quote Number Counter',
+ 'share_invoice_counter' => 'Share invoice counter',
+ 'invoice_issued_to' => 'Invoice issued to',
+ 'invalid_counter' => 'To prevent a possible conflict please set either an invoice or quote number prefix',
+
);
\ No newline at end of file
diff --git a/app/lang/nl/texts.php b/app/lang/nl/texts.php
index 319c7ccfea21..eab50cef2afa 100644
--- a/app/lang/nl/texts.php
+++ b/app/lang/nl/texts.php
@@ -425,6 +425,15 @@ return array(
'sample_data' => 'Sample data shown',
'hide' => 'Hide',
'new_version_available' => 'A new version of :releases_link is available. You\'re running v:user_version, the latest is v:latest_version',
+
+ 'invoice_settings' => 'Invoice Settings',
+ 'invoice_number_prefix' => 'Invoice Number Prefix',
+ 'invoice_number_counter' => 'Invoice Number Counter',
+ 'quote_number_prefix' => 'Quote Number Prefix',
+ 'quote_number_counter' => 'Quote Number Counter',
+ 'share_invoice_counter' => 'Share invoice counter',
+ 'invoice_issued_to' => 'Invoice issued to',
+ 'invalid_counter' => 'To prevent a possible conflict please set either an invoice or quote number prefix',
);
diff --git a/app/lang/pt_BR/texts.php b/app/lang/pt_BR/texts.php
index 0c8b6fd58886..fccd9b2871c2 100644
--- a/app/lang/pt_BR/texts.php
+++ b/app/lang/pt_BR/texts.php
@@ -413,6 +413,15 @@ return array(
'sample_data' => 'Sample data shown',
'hide' => 'Hide',
'new_version_available' => 'A new version of :releases_link is available. You\'re running v:user_version, the latest is v:latest_version',
+
+ 'invoice_settings' => 'Invoice Settings',
+ 'invoice_number_prefix' => 'Invoice Number Prefix',
+ 'invoice_number_counter' => 'Invoice Number Counter',
+ 'quote_number_prefix' => 'Quote Number Prefix',
+ 'quote_number_counter' => 'Quote Number Counter',
+ 'share_invoice_counter' => 'Share invoice counter',
+ 'invoice_issued_to' => 'Invoice issued to',
+ 'invalid_counter' => 'To prevent a possible conflict please set either an invoice or quote number prefix',
);
diff --git a/app/models/Account.php b/app/models/Account.php
index 5cfdb4365a9c..cf80925b018b 100755
--- a/app/models/Account.php
+++ b/app/models/Account.php
@@ -141,28 +141,25 @@ class Account extends Eloquent
return $height;
}
- public function getNextInvoiceNumber()
- {
- $invoices = Invoice::withTrashed()->scope(false, $this->id)->get(['invoice_number']);
+ public function getNextInvoiceNumber($isQuote = false)
+ {
+ $counter = $isQuote && !$this->share_counter ? $this->quote_number_counter : $this->invoice_number_counter;
+ $prefix = $isQuote ? $this->quote_number_prefix : $this->invoice_number_prefix;
- $max = 0;
-
- foreach ($invoices as $invoice)
- {
- $number = intval(preg_replace("/[^0-9]/", "", $invoice->invoice_number));
- $max = max($max, $number);
- }
-
- if ($max > 0)
- {
- return str_pad($max+1, 4, "0", STR_PAD_LEFT);
- }
- else
- {
- return DEFAULT_INVOICE_NUMBER;
- }
+ return $prefix . str_pad($counter, 4, "0", STR_PAD_LEFT);
}
+ public function incrementCounter($isQuote = false)
+ {
+ if ($isQuote && !$this->share_counter) {
+ $this->quote_number_counter += 1;
+ } else {
+ $this->invoice_number_counter += 1;
+ }
+
+ $this->save();
+ }
+
public function getLocale()
{
$language = Language::remember(DEFAULT_QUERY_CACHE)->where('id', '=', $this->account->language_id)->first();
@@ -208,6 +205,7 @@ class Account extends Eloquent
'quote_date',
'quote_number',
'total',
+ 'invoice_issued_to',
];
foreach ($fields as $field)
diff --git a/app/models/Invoice.php b/app/models/Invoice.php
index 9ae5c8e6ce7a..4438fef6b979 100755
--- a/app/models/Invoice.php
+++ b/app/models/Invoice.php
@@ -217,6 +217,7 @@ class Invoice extends EntityModel
Invoice::created(function($invoice)
{
+ $invoice->account->incrementCounter($invoice->is_quote);
Activity::createInvoice($invoice);
});
diff --git a/app/ninja/repositories/InvoiceRepository.php b/app/ninja/repositories/InvoiceRepository.php
index dad05fbd6fa4..b462f2dff230 100755
--- a/app/ninja/repositories/InvoiceRepository.php
+++ b/app/ninja/repositories/InvoiceRepository.php
@@ -359,12 +359,11 @@ class InvoiceRepository
$clone = Invoice::createNew($invoice);
$clone->balance = $invoice->amount;
- $clone->invoice_number = $invoice->account->getNextInvoiceNumber();
+ $clone->invoice_number = $invoice->account->getNextInvoiceNumber($invoice->is_quote);
foreach ([
'client_id',
'discount',
- //'shipping',
'invoice_date',
'po_number',
'due_date',
@@ -378,7 +377,11 @@ class InvoiceRepository
'tax_name',
'tax_rate',
'amount',
- 'is_quote'] as $field)
+ 'is_quote',
+ 'custom_value1',
+ 'custom_value2',
+ 'custom_taxes1',
+ 'custom_taxes2'] as $field)
{
$clone->$field = $invoice->$field;
}
diff --git a/app/routes.php b/app/routes.php
index 9f75562d1e58..84874dfcc920 100755
--- a/app/routes.php
+++ b/app/routes.php
@@ -1,5 +1,6 @@
hide_quantity)) }}
{{ Former::populateField('hide_paid_to_date', intval($account->hide_paid_to_date)) }}
- {{ Former::legend('invoice_options') }}
- {{ Former::checkbox('hide_quantity')->text(trans('texts.hide_quantity_help')) }}
- {{ Former::checkbox('hide_paid_to_date')->text(trans('texts.hide_paid_to_date_help')) }}
-
-
-
-
{{ Former::legend('invoice_design') }}
{{ Former::select('invoice_design_id')->style('display:inline;width:120px')
->fromQuery($invoiceDesigns, 'name', 'id') }}
@@ -80,6 +73,13 @@
+ {{ Former::legend('invoice_options') }}
+ {{ Former::checkbox('hide_quantity')->text(trans('texts.hide_quantity_help')) }}
+ {{ Former::checkbox('hide_paid_to_date')->text(trans('texts.hide_paid_to_date_help')) }}
+
+
+
+
@if (Auth::user()->isPro())
{{ Former::actions( Button::lg_success_submit(trans('texts.save'))->append_with_icon('floppy-disk') ) }}
@else
diff --git a/app/views/accounts/custom_fields.blade.php b/app/views/accounts/invoice_settings.blade.php
similarity index 57%
rename from app/views/accounts/custom_fields.blade.php
rename to app/views/accounts/invoice_settings.blade.php
index b856a5337995..bf789be9be32 100644
--- a/app/views/accounts/custom_fields.blade.php
+++ b/app/views/accounts/invoice_settings.blade.php
@@ -8,6 +8,8 @@
{{ Former::populate($account) }}
{{ Former::populateField('custom_invoice_taxes1', intval($account->custom_invoice_taxes1)) }}
{{ Former::populateField('custom_invoice_taxes2', intval($account->custom_invoice_taxes2)) }}
+ {{ Former::populateField('share_counter', intval($account->share_counter)) }}
+
{{ Former::legend('invoice_fields') }}
{{ Former::text('custom_invoice_label1')->label(trans('texts.field_label'))
@@ -27,17 +29,45 @@
{{ Former::text('custom_label2')->label(trans('texts.field_label')) }}
{{ Former::text('custom_value2')->label(trans('texts.field_value')) }}
+
+
+ {{ Former::legend('invoice_number') }}
+ {{ Former::text('invoice_number_prefix')->label(trans('texts.invoice_number_prefix')) }}
+ {{ Former::text('invoice_number_counter')->label(trans('texts.invoice_number_counter')) }}
+
+
+ {{ Former::legend('quote_number') }}
+ {{ Former::text('quote_number_prefix')->label(trans('texts.quote_number_prefix')) }}
+ {{ Former::text('quote_number_counter')->label(trans('texts.quote_number_counter'))
+ ->append(Former::checkbox('share_counter')->raw()->onclick('setQuoteNumberEnabled()') . ' ' . trans('texts.share_invoice_counter')) }}
+
@if (Auth::user()->isPro())
{{ Former::actions( Button::lg_success_submit(trans('texts.save'))->append_with_icon('floppy-disk') ) }}
@else
@endif
{{ Former::close() }}
+
+
+
+
@stop
\ No newline at end of file
diff --git a/app/views/accounts/nav.blade.php b/app/views/accounts/nav.blade.php
index 627c0cf8ab03..66fca0dcc43b 100755
--- a/app/views/accounts/nav.blade.php
+++ b/app/views/accounts/nav.blade.php
@@ -8,7 +8,7 @@
{{ HTML::nav_link('company/products', 'product_library') }}
{{ HTML::nav_link('company/notifications', 'notifications') }}
{{ HTML::nav_link('company/import_export', 'import_export', 'company/import_map') }}
- {{ HTML::nav_link('company/advanced_settings/custom_fields', 'advanced_settings', '*/advanced_settings/*') }}
+ {{ HTML::nav_link('company/advanced_settings/invoice_settings', 'advanced_settings', '*/advanced_settings/*') }}
diff --git a/app/views/accounts/nav_advanced.blade.php b/app/views/accounts/nav_advanced.blade.php
index 498a28d43b26..e24ea16f09fb 100644
--- a/app/views/accounts/nav_advanced.blade.php
+++ b/app/views/accounts/nav_advanced.blade.php
@@ -1,5 +1,5 @@
- {{ HTML::nav_link('company/advanced_settings/custom_fields', 'custom_fields') }}
+ {{ HTML::nav_link('company/advanced_settings/invoice_settings', 'invoice_settings') }}
{{ HTML::nav_link('company/advanced_settings/invoice_design', 'invoice_design') }}
{{ HTML::nav_link('company/advanced_settings/data_visualizations', 'data_visualizations') }}
{{ HTML::nav_link('company/advanced_settings/chart_builder', 'chart_builder') }}
diff --git a/app/views/header.blade.php b/app/views/header.blade.php
index 0b1d85d59c75..ca3619bd3018 100755
--- a/app/views/header.blade.php
+++ b/app/views/header.blade.php
@@ -104,7 +104,7 @@
- {{ link_to('company/products', uctrans('texts.product_library')) }}
- {{ link_to('company/notifications', uctrans('texts.notifications')) }}
- {{ link_to('company/import_export', uctrans('texts.import_export')) }}
- - {{ uctrans('texts.advanced_settings') . Utils::getProLabel(ACCOUNT_ADVANCED_SETTINGS) }}
+ - {{ uctrans('texts.advanced_settings') . Utils::getProLabel(ACCOUNT_ADVANCED_SETTINGS) }}
- {{ link_to('#', trans('texts.logout'), array('onclick'=>'logout()')) }}
diff --git a/public/built.js b/public/built.js
index 29a6b85da813..136e1f8d2a69 100644
--- a/public/built.js
+++ b/public/built.js
@@ -46052,6 +46052,10 @@ function SetPdfColor(color, doc, role)
return doc.setTextColor(251,251,251);//select color Custom Report GRAY Colour
}
+ if (color=='orange') {
+ return doc.setTextColor(234,121,45);//select color Custom Report GRAY Colour
+ }
+
}
@@ -46127,105 +46131,106 @@ function getQuarter(offset) {
/* Default class modification */
-$.extend( $.fn.dataTableExt.oStdClasses, {
- "sWrapper": "dataTables_wrapper form-inline"
-} );
+if ($.fn.dataTableExt) {
+ $.extend( $.fn.dataTableExt.oStdClasses, {
+ "sWrapper": "dataTables_wrapper form-inline"
+ } );
-/* API method to get paging information */
-$.fn.dataTableExt.oApi.fnPagingInfo = function ( oSettings )
-{
- return {
- "iStart": oSettings._iDisplayStart,
- "iEnd": oSettings.fnDisplayEnd(),
- "iLength": oSettings._iDisplayLength,
- "iTotal": oSettings.fnRecordsTotal(),
- "iFilteredTotal": oSettings.fnRecordsDisplay(),
- "iPage": oSettings._iDisplayLength === -1 ?
- 0 : Math.ceil( oSettings._iDisplayStart / oSettings._iDisplayLength ),
- "iTotalPages": oSettings._iDisplayLength === -1 ?
- 0 : Math.ceil( oSettings.fnRecordsDisplay() / oSettings._iDisplayLength )
+ /* API method to get paging information */
+ $.fn.dataTableExt.oApi.fnPagingInfo = function ( oSettings )
+ {
+ return {
+ "iStart": oSettings._iDisplayStart,
+ "iEnd": oSettings.fnDisplayEnd(),
+ "iLength": oSettings._iDisplayLength,
+ "iTotal": oSettings.fnRecordsTotal(),
+ "iFilteredTotal": oSettings.fnRecordsDisplay(),
+ "iPage": oSettings._iDisplayLength === -1 ?
+ 0 : Math.ceil( oSettings._iDisplayStart / oSettings._iDisplayLength ),
+ "iTotalPages": oSettings._iDisplayLength === -1 ?
+ 0 : Math.ceil( oSettings.fnRecordsDisplay() / oSettings._iDisplayLength )
+ };
};
-};
-/* Bootstrap style pagination control */
-$.extend( $.fn.dataTableExt.oPagination, {
- "bootstrap": {
- "fnInit": function( oSettings, nPaging, fnDraw ) {
- var oLang = oSettings.oLanguage.oPaginate;
- var fnClickHandler = function ( e ) {
- e.preventDefault();
- if ( oSettings.oApi._fnPageChange(oSettings, e.data.action) ) {
- fnDraw( oSettings );
+ /* Bootstrap style pagination control */
+ $.extend( $.fn.dataTableExt.oPagination, {
+ "bootstrap": {
+ "fnInit": function( oSettings, nPaging, fnDraw ) {
+ var oLang = oSettings.oLanguage.oPaginate;
+ var fnClickHandler = function ( e ) {
+ e.preventDefault();
+ if ( oSettings.oApi._fnPageChange(oSettings, e.data.action) ) {
+ fnDraw( oSettings );
+ }
+ };
+
+ $(nPaging).addClass('pagination').append(
+ ''
+ );
+ var els = $('a', nPaging);
+ $(els[0]).bind( 'click.DT', { action: "previous" }, fnClickHandler );
+ $(els[1]).bind( 'click.DT', { action: "next" }, fnClickHandler );
+ },
+
+ "fnUpdate": function ( oSettings, fnDraw ) {
+ var iListLength = 5;
+ var oPaging = oSettings.oInstance.fnPagingInfo();
+ var an = oSettings.aanFeatures.p;
+ var i, ien, j, sClass, iStart, iEnd, iHalf=Math.floor(iListLength/2);
+
+ if ( oPaging.iTotalPages < iListLength) {
+ iStart = 1;
+ iEnd = oPaging.iTotalPages;
}
- };
-
- $(nPaging).addClass('pagination').append(
- ''
- );
- var els = $('a', nPaging);
- $(els[0]).bind( 'click.DT', { action: "previous" }, fnClickHandler );
- $(els[1]).bind( 'click.DT', { action: "next" }, fnClickHandler );
- },
-
- "fnUpdate": function ( oSettings, fnDraw ) {
- var iListLength = 5;
- var oPaging = oSettings.oInstance.fnPagingInfo();
- var an = oSettings.aanFeatures.p;
- var i, ien, j, sClass, iStart, iEnd, iHalf=Math.floor(iListLength/2);
-
- if ( oPaging.iTotalPages < iListLength) {
- iStart = 1;
- iEnd = oPaging.iTotalPages;
- }
- else if ( oPaging.iPage <= iHalf ) {
- iStart = 1;
- iEnd = iListLength;
- } else if ( oPaging.iPage >= (oPaging.iTotalPages-iHalf) ) {
- iStart = oPaging.iTotalPages - iListLength + 1;
- iEnd = oPaging.iTotalPages;
- } else {
- iStart = oPaging.iPage - iHalf + 1;
- iEnd = iStart + iListLength - 1;
- }
-
- for ( i=0, ien=an.length ; i'+j+'')
- .insertBefore( $('li:last', an[i])[0] )
- .bind('click', function (e) {
- e.preventDefault();
- oSettings._iDisplayStart = (parseInt($('a', this).text(),10)-1) * oPaging.iLength;
- fnDraw( oSettings );
- } );
- }
-
- // Add / remove disabled classes from the static elements
- if ( oPaging.iPage === 0 ) {
- $('li:first', an[i]).addClass('disabled');
+ else if ( oPaging.iPage <= iHalf ) {
+ iStart = 1;
+ iEnd = iListLength;
+ } else if ( oPaging.iPage >= (oPaging.iTotalPages-iHalf) ) {
+ iStart = oPaging.iTotalPages - iListLength + 1;
+ iEnd = oPaging.iTotalPages;
} else {
- $('li:first', an[i]).removeClass('disabled');
+ iStart = oPaging.iPage - iHalf + 1;
+ iEnd = iStart + iListLength - 1;
}
- if ( oPaging.iPage === oPaging.iTotalPages-1 || oPaging.iTotalPages === 0 ) {
- $('li:last', an[i]).addClass('disabled');
- } else {
- $('li:last', an[i]).removeClass('disabled');
+ for ( i=0, ien=an.length ; i'+j+'')
+ .insertBefore( $('li:last', an[i])[0] )
+ .bind('click', function (e) {
+ e.preventDefault();
+ oSettings._iDisplayStart = (parseInt($('a', this).text(),10)-1) * oPaging.iLength;
+ fnDraw( oSettings );
+ } );
+ }
+
+ // Add / remove disabled classes from the static elements
+ if ( oPaging.iPage === 0 ) {
+ $('li:first', an[i]).addClass('disabled');
+ } else {
+ $('li:first', an[i]).removeClass('disabled');
+ }
+
+ if ( oPaging.iPage === oPaging.iTotalPages-1 || oPaging.iTotalPages === 0 ) {
+ $('li:last', an[i]).addClass('disabled');
+ } else {
+ $('li:last', an[i]).removeClass('disabled');
+ }
}
}
}
- }
-} );
-
+ } );
+}
/*
* TableTools Bootstrap compatibility
@@ -46348,54 +46353,55 @@ function convertDataURIToBinary(dataURI) {
return base64DecToArr(base64);
}
-ko.bindingHandlers.dropdown = {
- init: function (element, valueAccessor, allBindingsAccessor) {
- var options = allBindingsAccessor().dropdownOptions|| {};
- var value = ko.utils.unwrapObservable(valueAccessor());
- var id = (value && value.public_id) ? value.public_id() : (value && value.id) ? value.id() : value ? value : false;
- if (id) $(element).val(id);
- //console.log("combo-init: %s", id);
- $(element).combobox(options);
+if (window.ko) {
+ ko.bindingHandlers.dropdown = {
+ init: function (element, valueAccessor, allBindingsAccessor) {
+ var options = allBindingsAccessor().dropdownOptions|| {};
+ var value = ko.utils.unwrapObservable(valueAccessor());
+ var id = (value && value.public_id) ? value.public_id() : (value && value.id) ? value.id() : value ? value : false;
+ if (id) $(element).val(id);
+ //console.log("combo-init: %s", id);
+ $(element).combobox(options);
- /*
- ko.utils.registerEventHandler(element, "change", function () {
- console.log("change: %s", $(element).val());
- //var
- valueAccessor($(element).val());
- //$(element).combobox('refresh');
- });
- */
- },
- update: function (element, valueAccessor) {
- var value = ko.utils.unwrapObservable(valueAccessor());
- var id = (value && value.public_id) ? value.public_id() : (value && value.id) ? value.id() : value ? value : false;
- //console.log("combo-update: %s", id);
- if (id) {
- $(element).val(id);
- $(element).combobox('refresh');
- } else {
- $(element).combobox('clearTarget');
- $(element).combobox('clearElement');
- }
- }
-};
+ /*
+ ko.utils.registerEventHandler(element, "change", function () {
+ console.log("change: %s", $(element).val());
+ //var
+ valueAccessor($(element).val());
+ //$(element).combobox('refresh');
+ });
+ */
+ },
+ update: function (element, valueAccessor) {
+ var value = ko.utils.unwrapObservable(valueAccessor());
+ var id = (value && value.public_id) ? value.public_id() : (value && value.id) ? value.id() : value ? value : false;
+ //console.log("combo-update: %s", id);
+ if (id) {
+ $(element).val(id);
+ $(element).combobox('refresh');
+ } else {
+ $(element).combobox('clearTarget');
+ $(element).combobox('clearElement');
+ }
+ }
+ };
-ko.bindingHandlers.datePicker = {
- init: function (element, valueAccessor, allBindingsAccessor) {
- var value = ko.utils.unwrapObservable(valueAccessor());
- if (value) $(element).datepicker('update', value);
- $(element).change(function() {
- var value = valueAccessor();
- value($(element).val());
- })
- },
- update: function (element, valueAccessor) {
- var value = ko.utils.unwrapObservable(valueAccessor());
- if (value) $(element).datepicker('update', value);
- }
-};
-
+ ko.bindingHandlers.datePicker = {
+ init: function (element, valueAccessor, allBindingsAccessor) {
+ var value = ko.utils.unwrapObservable(valueAccessor());
+ if (value) $(element).datepicker('update', value);
+ $(element).change(function() {
+ var value = valueAccessor();
+ value($(element).val());
+ })
+ },
+ update: function (element, valueAccessor) {
+ var value = ko.utils.unwrapObservable(valueAccessor());
+ if (value) $(element).datepicker('update', value);
+ }
+ };
+}
function wordWrapText(value, width)
{
@@ -46986,6 +46992,21 @@ function displayInvoiceItems(doc, invoice, layout) {
doc.rect(left, top, width-left, newTop-top, 'FD');
}
+ } else if (invoice.invoice_design_id == 5) {
+ if (i%2 == 0) {
+ doc.setDrawColor(255,255,255);
+ doc.setFillColor(247,247,247);
+ doc.rect(left, top, width-left+17, newTop-top, 'FD');
+ doc.setLineWidth(0.3);
+ doc.setDrawColor(255,255,255);
+ } else {
+ doc.setDrawColor(255,255,255);
+ doc.setFillColor(232,232,232);
+ doc.rect(left, top, width-left+17, newTop-top, 'FD');
+
+ doc.setLineWidth(0.3);
+ doc.setDrawColor(255,255,255);
+ }
} else {
doc.setLineWidth(0.3);
doc.setDrawColor(150,150,150);
@@ -47000,10 +47021,38 @@ function displayInvoiceItems(doc, invoice, layout) {
SetPdfColor('SomeGreen', doc, 'primary');
} else if (invoice.invoice_design_id == 3) {
doc.setFontType('bold');
- } else {
+ } else if (invoice.invoice_design_id == 4) {
+ SetPdfColor('Black', doc);
+ } else if (invoice.invoice_design_id == 5) {
SetPdfColor('Black', doc);
}
- doc.text(layout.marginLeft, y+2, productKey);
+
+ var splitTitle = doc.splitTextToSize(productKey, 60);
+ doc.text(layout.marginLeft, y+2, splitTitle);
+
+ if (invoice.invoice_design_id == 5) {
+ doc.setDrawColor(255, 255, 255);
+ doc.setLineWidth(1);
+ doc.line(layout.descriptionLeft-8, y-16,layout.descriptionLeft-8, y+55);
+
+ doc.setDrawColor(255, 255, 255);
+ doc.setLineWidth(1);
+ doc.line(costX-30, y-16,costX-30, y+55);
+
+ doc.setDrawColor(255, 255, 255);
+ doc.setLineWidth(1);
+ doc.line(qtyX-45, y-16,qtyX-45, y+55);
+
+ if (invoice.has_taxes) {
+ doc.setDrawColor(255, 255, 255);
+ doc.setLineWidth(1);
+ doc.line(taxX-15, y-16,taxX-15, y+55);
+ }
+
+ doc.setDrawColor(255, 255, 255);
+ doc.setLineWidth(1);
+ doc.line(totalX-27, y-16,totalX-27, y+55);
+ }
SetPdfColor('Black', doc);
doc.setFontType('normal');
diff --git a/public/js/script.js b/public/js/script.js
index 46719c57ae08..4498a9421665 100644
--- a/public/js/script.js
+++ b/public/js/script.js
@@ -127,6 +127,10 @@ function SetPdfColor(color, doc, role)
return doc.setTextColor(251,251,251);//select color Custom Report GRAY Colour
}
+ if (color=='orange') {
+ return doc.setTextColor(234,121,45);//select color Custom Report GRAY Colour
+ }
+
}
@@ -202,105 +206,106 @@ function getQuarter(offset) {
/* Default class modification */
-$.extend( $.fn.dataTableExt.oStdClasses, {
- "sWrapper": "dataTables_wrapper form-inline"
-} );
+if ($.fn.dataTableExt) {
+ $.extend( $.fn.dataTableExt.oStdClasses, {
+ "sWrapper": "dataTables_wrapper form-inline"
+ } );
-/* API method to get paging information */
-$.fn.dataTableExt.oApi.fnPagingInfo = function ( oSettings )
-{
- return {
- "iStart": oSettings._iDisplayStart,
- "iEnd": oSettings.fnDisplayEnd(),
- "iLength": oSettings._iDisplayLength,
- "iTotal": oSettings.fnRecordsTotal(),
- "iFilteredTotal": oSettings.fnRecordsDisplay(),
- "iPage": oSettings._iDisplayLength === -1 ?
- 0 : Math.ceil( oSettings._iDisplayStart / oSettings._iDisplayLength ),
- "iTotalPages": oSettings._iDisplayLength === -1 ?
- 0 : Math.ceil( oSettings.fnRecordsDisplay() / oSettings._iDisplayLength )
+ /* API method to get paging information */
+ $.fn.dataTableExt.oApi.fnPagingInfo = function ( oSettings )
+ {
+ return {
+ "iStart": oSettings._iDisplayStart,
+ "iEnd": oSettings.fnDisplayEnd(),
+ "iLength": oSettings._iDisplayLength,
+ "iTotal": oSettings.fnRecordsTotal(),
+ "iFilteredTotal": oSettings.fnRecordsDisplay(),
+ "iPage": oSettings._iDisplayLength === -1 ?
+ 0 : Math.ceil( oSettings._iDisplayStart / oSettings._iDisplayLength ),
+ "iTotalPages": oSettings._iDisplayLength === -1 ?
+ 0 : Math.ceil( oSettings.fnRecordsDisplay() / oSettings._iDisplayLength )
+ };
};
-};
-/* Bootstrap style pagination control */
-$.extend( $.fn.dataTableExt.oPagination, {
- "bootstrap": {
- "fnInit": function( oSettings, nPaging, fnDraw ) {
- var oLang = oSettings.oLanguage.oPaginate;
- var fnClickHandler = function ( e ) {
- e.preventDefault();
- if ( oSettings.oApi._fnPageChange(oSettings, e.data.action) ) {
- fnDraw( oSettings );
+ /* Bootstrap style pagination control */
+ $.extend( $.fn.dataTableExt.oPagination, {
+ "bootstrap": {
+ "fnInit": function( oSettings, nPaging, fnDraw ) {
+ var oLang = oSettings.oLanguage.oPaginate;
+ var fnClickHandler = function ( e ) {
+ e.preventDefault();
+ if ( oSettings.oApi._fnPageChange(oSettings, e.data.action) ) {
+ fnDraw( oSettings );
+ }
+ };
+
+ $(nPaging).addClass('pagination').append(
+ ''
+ );
+ var els = $('a', nPaging);
+ $(els[0]).bind( 'click.DT', { action: "previous" }, fnClickHandler );
+ $(els[1]).bind( 'click.DT', { action: "next" }, fnClickHandler );
+ },
+
+ "fnUpdate": function ( oSettings, fnDraw ) {
+ var iListLength = 5;
+ var oPaging = oSettings.oInstance.fnPagingInfo();
+ var an = oSettings.aanFeatures.p;
+ var i, ien, j, sClass, iStart, iEnd, iHalf=Math.floor(iListLength/2);
+
+ if ( oPaging.iTotalPages < iListLength) {
+ iStart = 1;
+ iEnd = oPaging.iTotalPages;
}
- };
-
- $(nPaging).addClass('pagination').append(
- ''
- );
- var els = $('a', nPaging);
- $(els[0]).bind( 'click.DT', { action: "previous" }, fnClickHandler );
- $(els[1]).bind( 'click.DT', { action: "next" }, fnClickHandler );
- },
-
- "fnUpdate": function ( oSettings, fnDraw ) {
- var iListLength = 5;
- var oPaging = oSettings.oInstance.fnPagingInfo();
- var an = oSettings.aanFeatures.p;
- var i, ien, j, sClass, iStart, iEnd, iHalf=Math.floor(iListLength/2);
-
- if ( oPaging.iTotalPages < iListLength) {
- iStart = 1;
- iEnd = oPaging.iTotalPages;
- }
- else if ( oPaging.iPage <= iHalf ) {
- iStart = 1;
- iEnd = iListLength;
- } else if ( oPaging.iPage >= (oPaging.iTotalPages-iHalf) ) {
- iStart = oPaging.iTotalPages - iListLength + 1;
- iEnd = oPaging.iTotalPages;
- } else {
- iStart = oPaging.iPage - iHalf + 1;
- iEnd = iStart + iListLength - 1;
- }
-
- for ( i=0, ien=an.length ; i'+j+'')
- .insertBefore( $('li:last', an[i])[0] )
- .bind('click', function (e) {
- e.preventDefault();
- oSettings._iDisplayStart = (parseInt($('a', this).text(),10)-1) * oPaging.iLength;
- fnDraw( oSettings );
- } );
- }
-
- // Add / remove disabled classes from the static elements
- if ( oPaging.iPage === 0 ) {
- $('li:first', an[i]).addClass('disabled');
+ else if ( oPaging.iPage <= iHalf ) {
+ iStart = 1;
+ iEnd = iListLength;
+ } else if ( oPaging.iPage >= (oPaging.iTotalPages-iHalf) ) {
+ iStart = oPaging.iTotalPages - iListLength + 1;
+ iEnd = oPaging.iTotalPages;
} else {
- $('li:first', an[i]).removeClass('disabled');
+ iStart = oPaging.iPage - iHalf + 1;
+ iEnd = iStart + iListLength - 1;
}
- if ( oPaging.iPage === oPaging.iTotalPages-1 || oPaging.iTotalPages === 0 ) {
- $('li:last', an[i]).addClass('disabled');
- } else {
- $('li:last', an[i]).removeClass('disabled');
+ for ( i=0, ien=an.length ; i'+j+'')
+ .insertBefore( $('li:last', an[i])[0] )
+ .bind('click', function (e) {
+ e.preventDefault();
+ oSettings._iDisplayStart = (parseInt($('a', this).text(),10)-1) * oPaging.iLength;
+ fnDraw( oSettings );
+ } );
+ }
+
+ // Add / remove disabled classes from the static elements
+ if ( oPaging.iPage === 0 ) {
+ $('li:first', an[i]).addClass('disabled');
+ } else {
+ $('li:first', an[i]).removeClass('disabled');
+ }
+
+ if ( oPaging.iPage === oPaging.iTotalPages-1 || oPaging.iTotalPages === 0 ) {
+ $('li:last', an[i]).addClass('disabled');
+ } else {
+ $('li:last', an[i]).removeClass('disabled');
+ }
}
}
}
- }
-} );
-
+ } );
+}
/*
* TableTools Bootstrap compatibility
@@ -423,54 +428,55 @@ function convertDataURIToBinary(dataURI) {
return base64DecToArr(base64);
}
-ko.bindingHandlers.dropdown = {
- init: function (element, valueAccessor, allBindingsAccessor) {
- var options = allBindingsAccessor().dropdownOptions|| {};
- var value = ko.utils.unwrapObservable(valueAccessor());
- var id = (value && value.public_id) ? value.public_id() : (value && value.id) ? value.id() : value ? value : false;
- if (id) $(element).val(id);
- //console.log("combo-init: %s", id);
- $(element).combobox(options);
+if (window.ko) {
+ ko.bindingHandlers.dropdown = {
+ init: function (element, valueAccessor, allBindingsAccessor) {
+ var options = allBindingsAccessor().dropdownOptions|| {};
+ var value = ko.utils.unwrapObservable(valueAccessor());
+ var id = (value && value.public_id) ? value.public_id() : (value && value.id) ? value.id() : value ? value : false;
+ if (id) $(element).val(id);
+ //console.log("combo-init: %s", id);
+ $(element).combobox(options);
- /*
- ko.utils.registerEventHandler(element, "change", function () {
- console.log("change: %s", $(element).val());
- //var
- valueAccessor($(element).val());
- //$(element).combobox('refresh');
- });
- */
- },
- update: function (element, valueAccessor) {
- var value = ko.utils.unwrapObservable(valueAccessor());
- var id = (value && value.public_id) ? value.public_id() : (value && value.id) ? value.id() : value ? value : false;
- //console.log("combo-update: %s", id);
- if (id) {
- $(element).val(id);
- $(element).combobox('refresh');
- } else {
- $(element).combobox('clearTarget');
- $(element).combobox('clearElement');
- }
- }
-};
+ /*
+ ko.utils.registerEventHandler(element, "change", function () {
+ console.log("change: %s", $(element).val());
+ //var
+ valueAccessor($(element).val());
+ //$(element).combobox('refresh');
+ });
+ */
+ },
+ update: function (element, valueAccessor) {
+ var value = ko.utils.unwrapObservable(valueAccessor());
+ var id = (value && value.public_id) ? value.public_id() : (value && value.id) ? value.id() : value ? value : false;
+ //console.log("combo-update: %s", id);
+ if (id) {
+ $(element).val(id);
+ $(element).combobox('refresh');
+ } else {
+ $(element).combobox('clearTarget');
+ $(element).combobox('clearElement');
+ }
+ }
+ };
-ko.bindingHandlers.datePicker = {
- init: function (element, valueAccessor, allBindingsAccessor) {
- var value = ko.utils.unwrapObservable(valueAccessor());
- if (value) $(element).datepicker('update', value);
- $(element).change(function() {
- var value = valueAccessor();
- value($(element).val());
- })
- },
- update: function (element, valueAccessor) {
- var value = ko.utils.unwrapObservable(valueAccessor());
- if (value) $(element).datepicker('update', value);
- }
-};
-
+ ko.bindingHandlers.datePicker = {
+ init: function (element, valueAccessor, allBindingsAccessor) {
+ var value = ko.utils.unwrapObservable(valueAccessor());
+ if (value) $(element).datepicker('update', value);
+ $(element).change(function() {
+ var value = valueAccessor();
+ value($(element).val());
+ })
+ },
+ update: function (element, valueAccessor) {
+ var value = ko.utils.unwrapObservable(valueAccessor());
+ if (value) $(element).datepicker('update', value);
+ }
+ };
+}
function wordWrapText(value, width)
{
@@ -1061,6 +1067,21 @@ function displayInvoiceItems(doc, invoice, layout) {
doc.rect(left, top, width-left, newTop-top, 'FD');
}
+ } else if (invoice.invoice_design_id == 5) {
+ if (i%2 == 0) {
+ doc.setDrawColor(255,255,255);
+ doc.setFillColor(247,247,247);
+ doc.rect(left, top, width-left+17, newTop-top, 'FD');
+ doc.setLineWidth(0.3);
+ doc.setDrawColor(255,255,255);
+ } else {
+ doc.setDrawColor(255,255,255);
+ doc.setFillColor(232,232,232);
+ doc.rect(left, top, width-left+17, newTop-top, 'FD');
+
+ doc.setLineWidth(0.3);
+ doc.setDrawColor(255,255,255);
+ }
} else {
doc.setLineWidth(0.3);
doc.setDrawColor(150,150,150);
@@ -1075,10 +1096,38 @@ function displayInvoiceItems(doc, invoice, layout) {
SetPdfColor('SomeGreen', doc, 'primary');
} else if (invoice.invoice_design_id == 3) {
doc.setFontType('bold');
- } else {
+ } else if (invoice.invoice_design_id == 4) {
+ SetPdfColor('Black', doc);
+ } else if (invoice.invoice_design_id == 5) {
SetPdfColor('Black', doc);
}
- doc.text(layout.marginLeft, y+2, productKey);
+
+ var splitTitle = doc.splitTextToSize(productKey, 60);
+ doc.text(layout.marginLeft, y+2, splitTitle);
+
+ if (invoice.invoice_design_id == 5) {
+ doc.setDrawColor(255, 255, 255);
+ doc.setLineWidth(1);
+ doc.line(layout.descriptionLeft-8, y-16,layout.descriptionLeft-8, y+55);
+
+ doc.setDrawColor(255, 255, 255);
+ doc.setLineWidth(1);
+ doc.line(costX-30, y-16,costX-30, y+55);
+
+ doc.setDrawColor(255, 255, 255);
+ doc.setLineWidth(1);
+ doc.line(qtyX-45, y-16,qtyX-45, y+55);
+
+ if (invoice.has_taxes) {
+ doc.setDrawColor(255, 255, 255);
+ doc.setLineWidth(1);
+ doc.line(taxX-15, y-16,taxX-15, y+55);
+ }
+
+ doc.setDrawColor(255, 255, 255);
+ doc.setLineWidth(1);
+ doc.line(totalX-27, y-16,totalX-27, y+55);
+ }
SetPdfColor('Black', doc);
doc.setFontType('normal');