1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00

Bug fixes

This commit is contained in:
Hillel Coren 2015-12-17 10:19:56 +02:00
parent 4dc7a8d5f1
commit 372ffb0ea9
10 changed files with 32 additions and 14 deletions

View File

@ -334,7 +334,7 @@ if (!defined('CONTACT_EMAIL')) {
define('MAX_SUBDOMAIN_LENGTH', 30); define('MAX_SUBDOMAIN_LENGTH', 30);
define('MAX_IFRAME_URL_LENGTH', 250); define('MAX_IFRAME_URL_LENGTH', 250);
define('MAX_LOGO_FILE_SIZE', 200); // KB define('MAX_LOGO_FILE_SIZE', 200); // KB
define('MAX_FAILED_LOGINS', 5); define('MAX_FAILED_LOGINS', 10);
define('DEFAULT_FONT_SIZE', 9); define('DEFAULT_FONT_SIZE', 9);
define('DEFAULT_SEND_RECURRING_HOUR', 8); define('DEFAULT_SEND_RECURRING_HOUR', 8);

View File

@ -684,7 +684,7 @@ class Utils
public static function isEmpty($value) 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) public static function startsWith($haystack, $needle)

View File

@ -45,7 +45,7 @@ class InvoiceTransformer extends EntityTransformer
'po_number' => $invoice->po_number, 'po_number' => $invoice->po_number,
'invoice_date' => $invoice->invoice_date, 'invoice_date' => $invoice->invoice_date,
'due_date' => $invoice->due_date, 'due_date' => $invoice->due_date,
'terms' => $invoice->terms, 'invoice_terms' => $invoice->terms,
'public_notes' => $invoice->public_notes, 'public_notes' => $invoice->public_notes,
'is_deleted' => (bool) $invoice->is_deleted, 'is_deleted' => (bool) $invoice->is_deleted,
'is_recurring' => (bool) $invoice->is_recurring, 'is_recurring' => (bool) $invoice->is_recurring,

View File

@ -21,6 +21,7 @@ class QuoteTransformer extends EntityTransformer
'id' => (int) $invoice->public_id, 'id' => (int) $invoice->public_id,
'quote_number' => $invoice->invoice_number, 'quote_number' => $invoice->invoice_number,
'amount' => (float) $invoice->amount, 'amount' => (float) $invoice->amount,
'quote_terms' => $invoice->terms,
]; ];
} }
} }

View File

@ -34,7 +34,7 @@ class ImportService
public static $sources = [ public static $sources = [
IMPORT_CSV, IMPORT_CSV,
IMPORT_FRESHBOOKS, IMPORT_FRESHBOOKS,
IMPORT_HARVEST, //IMPORT_HARVEST,
IMPORT_HIVEAGE, IMPORT_HIVEAGE,
IMPORT_INVOICEABLE, IMPORT_INVOICEABLE,
IMPORT_NUTCACHE, IMPORT_NUTCACHE,

View File

@ -31179,7 +31179,7 @@ NINJA.invoiceLines = function(invoice) {
} }
// show at most one blank line // 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; continue;
} }

View File

@ -300,7 +300,7 @@ NINJA.invoiceLines = function(invoice) {
} }
// show at most one blank line // 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; continue;
} }

View File

@ -862,10 +862,10 @@
@if (!$invoice->id) @if (!$invoice->id)
if (!invoice.terms) { 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) { 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 @endif

View File

@ -138,7 +138,7 @@
->large() ->large()
->dropup() !!} ->dropup() !!}
@else @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']) !!} {!! Button::success(trans('texts.start'))->large()->appendIcon(Icon::create('play'))->withAttributes(['id' => 'start-button']) !!}
@endif @endif
@endif @endif
@ -348,6 +348,11 @@
self.refresh(); self.refresh();
} }
self.removeItems = function() {
self.time_log.removeAll();
self.refresh();
}
self.refresh = function() { self.refresh = function() {
var hasEmpty = false; var hasEmpty = false;
var lastTime = 0; var lastTime = 0;
@ -416,10 +421,22 @@
} else { } else {
$('#datetime-details').fadeIn(); $('#datetime-details').fadeIn();
} }
$('#start-button').toggle(); setButtonsVisible();
$('#save-button').toggle();
}) })
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() { $('#start-button').click(function() {
submitAction('start'); submitAction('start');
}); });