diff --git a/app/Http/routes.php b/app/Http/routes.php index 7c8fd031fa..216808421e 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -334,7 +334,7 @@ if (!defined('CONTACT_EMAIL')) { define('MAX_SUBDOMAIN_LENGTH', 30); define('MAX_IFRAME_URL_LENGTH', 250); define('MAX_LOGO_FILE_SIZE', 200); // KB - define('MAX_FAILED_LOGINS', 5); + define('MAX_FAILED_LOGINS', 10); define('DEFAULT_FONT_SIZE', 9); define('DEFAULT_SEND_RECURRING_HOUR', 8); diff --git a/app/Libraries/Utils.php b/app/Libraries/Utils.php index 231c29abad..8893cdfcb1 100644 --- a/app/Libraries/Utils.php +++ b/app/Libraries/Utils.php @@ -684,7 +684,7 @@ class Utils public static function isEmpty($value) { - return !$value || $value == '0.00' || $value == '0,00'; + return !$value || $value == '0' || $value == '0.00' || $value == '0,00'; } public static function startsWith($haystack, $needle) diff --git a/app/Ninja/Repositories/TaskRepository.php b/app/Ninja/Repositories/TaskRepository.php index da84feba7c..f6a13c5270 100644 --- a/app/Ninja/Repositories/TaskRepository.php +++ b/app/Ninja/Repositories/TaskRepository.php @@ -81,7 +81,7 @@ class TaskRepository } else { $timeLog = []; } - + array_multisort($timeLog); if (isset($data['action'])) { diff --git a/app/Ninja/Transformers/InvoiceTransformer.php b/app/Ninja/Transformers/InvoiceTransformer.php index 19e823a10c..4899d1cc0a 100644 --- a/app/Ninja/Transformers/InvoiceTransformer.php +++ b/app/Ninja/Transformers/InvoiceTransformer.php @@ -45,7 +45,7 @@ class InvoiceTransformer extends EntityTransformer 'po_number' => $invoice->po_number, 'invoice_date' => $invoice->invoice_date, 'due_date' => $invoice->due_date, - 'terms' => $invoice->terms, + 'invoice_terms' => $invoice->terms, 'public_notes' => $invoice->public_notes, 'is_deleted' => (bool) $invoice->is_deleted, 'is_recurring' => (bool) $invoice->is_recurring, diff --git a/app/Ninja/Transformers/QuoteTransformer.php b/app/Ninja/Transformers/QuoteTransformer.php index d012aceb45..2c92640e80 100644 --- a/app/Ninja/Transformers/QuoteTransformer.php +++ b/app/Ninja/Transformers/QuoteTransformer.php @@ -21,6 +21,7 @@ class QuoteTransformer extends EntityTransformer 'id' => (int) $invoice->public_id, 'quote_number' => $invoice->invoice_number, 'amount' => (float) $invoice->amount, + 'quote_terms' => $invoice->terms, ]; } } \ No newline at end of file diff --git a/app/Services/ImportService.php b/app/Services/ImportService.php index 7b6d46688a..3fd21f0719 100644 --- a/app/Services/ImportService.php +++ b/app/Services/ImportService.php @@ -34,7 +34,7 @@ class ImportService public static $sources = [ IMPORT_CSV, IMPORT_FRESHBOOKS, - IMPORT_HARVEST, + //IMPORT_HARVEST, IMPORT_HIVEAGE, IMPORT_INVOICEABLE, IMPORT_NUTCACHE, diff --git a/public/js/built.js b/public/js/built.js index f4251a1798..4dbeb0a02f 100644 --- a/public/js/built.js +++ b/public/js/built.js @@ -30968,7 +30968,7 @@ function GetPdfMake(invoice, javascript, callback) { dd.footer[1].columns[0].stack.push({image: logoImages.imageLogo3, alignment: 'left', width: 130, margin: [40, 6, 0, 0]}); } } - + /* var fonts = { Roboto: { @@ -31179,7 +31179,7 @@ NINJA.invoiceLines = function(invoice) { } // show at most one blank line - if (shownItem && (!cost || cost == '0.00' || cost == '0,00') && !notes && !productKey) { + if (shownItem && !notes && !productKey && (!cost || cost == '0' || cost == '0.00' || cost == '0,00')) { continue; } diff --git a/public/js/pdf.pdfmake.js b/public/js/pdf.pdfmake.js index 94254ec2bf..333d4352ba 100644 --- a/public/js/pdf.pdfmake.js +++ b/public/js/pdf.pdfmake.js @@ -89,7 +89,7 @@ function GetPdfMake(invoice, javascript, callback) { dd.footer[1].columns[0].stack.push({image: logoImages.imageLogo3, alignment: 'left', width: 130, margin: [40, 6, 0, 0]}); } } - + /* var fonts = { Roboto: { @@ -300,7 +300,7 @@ NINJA.invoiceLines = function(invoice) { } // show at most one blank line - if (shownItem && (!cost || cost == '0.00' || cost == '0,00') && !notes && !productKey) { + if (shownItem && !notes && !productKey && (!cost || cost == '0' || cost == '0.00' || cost == '0,00')) { continue; } diff --git a/resources/views/invoices/edit.blade.php b/resources/views/invoices/edit.blade.php index 190ff9b3af..c250299aae 100644 --- a/resources/views/invoices/edit.blade.php +++ b/resources/views/invoices/edit.blade.php @@ -862,10 +862,10 @@ @if (!$invoice->id) if (!invoice.terms) { - invoice.terms = wordWrapText('{!! str_replace(["\r\n","\r","\n"], '\n', addslashes($account->{"{$entityType}_terms"})) !!}', 300); + invoice.terms = account['{{ $entityType }}_terms']; } if (!invoice.invoice_footer) { - invoice.invoice_footer = wordWrapText('{!! str_replace(["\r\n","\r","\n"], '\n', addslashes($account->invoice_footer)) !!}', 600); + invoice.invoice_footer = account['invoice_footer']; } @endif diff --git a/resources/views/tasks/edit.blade.php b/resources/views/tasks/edit.blade.php index d85d95b351..279e5917fe 100644 --- a/resources/views/tasks/edit.blade.php +++ b/resources/views/tasks/edit.blade.php @@ -138,7 +138,7 @@ ->large() ->dropup() !!} @else - {!! Button::success(trans('texts.save'))->large()->appendIcon(Icon::create('floppy-disk'))->withAttributes(['id' => 'save-button', 'style' => 'display:none']) !!} + {!! Button::success(trans('texts.save'))->large()->appendIcon(Icon::create('floppy-disk'))->withAttributes(['id' => 'save-button']) !!} {!! Button::success(trans('texts.start'))->large()->appendIcon(Icon::create('play'))->withAttributes(['id' => 'start-button']) !!} @endif @endif @@ -348,6 +348,11 @@ self.refresh(); } + self.removeItems = function() { + self.time_log.removeAll(); + self.refresh(); + } + self.refresh = function() { var hasEmpty = false; var lastTime = 0; @@ -416,10 +421,22 @@ } else { $('#datetime-details').fadeIn(); } - $('#start-button').toggle(); - $('#save-button').toggle(); + setButtonsVisible(); }) + function setButtonsVisible() { + //model.removeItems(); + var val = $('input[name=task_type]:checked').val(); + if (val == 'timer') { + $('#start-button').show(); + $('#save-button').hide(); + } else { + $('#start-button').hide(); + $('#save-button').show(); + } + } + setButtonsVisible(); + $('#start-button').click(function() { submitAction('start'); });