From cdd4ffde68b1c957ef8b1d06ca53e812e8a2542b Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 4 Jun 2014 23:41:34 +0300 Subject: [PATCH] Bug fixes --- app/commands/SendRecurringInvoices.php | 12 ++++++++---- app/database/seeds/ConstantsSeeder.php | 5 +++-- public/built.js | 2 +- public/js/script.js | 2 +- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/app/commands/SendRecurringInvoices.php b/app/commands/SendRecurringInvoices.php index 503560eff7f2..ef54921372b0 100755 --- a/app/commands/SendRecurringInvoices.php +++ b/app/commands/SendRecurringInvoices.php @@ -21,15 +21,19 @@ class SendRecurringInvoices extends Command { public function fire() { $this->info(date('Y-m-d') . ' Running SendRecurringInvoices...'); - - $today = new DateTime(); - - $invoices = Invoice::with('account.timezone', 'invoice_items') + $today = new DateTime(); + + $invoices = Invoice::with('account.timezone', 'invoice_items', 'client') ->whereRaw('is_deleted IS FALSE AND deleted_at IS NULL AND is_recurring IS TRUE AND start_date <= ? AND (end_date IS NULL OR end_date >= ?)', array($today, $today))->get(); $this->info(count($invoices) . ' recurring invoice(s) found'); foreach ($invoices as $recurInvoice) { + if ($recurInvoice->client->deleted_at) + { + continue; + } + date_default_timezone_set($recurInvoice->account->getTimezone()); $this->info('Processing Invoice ' . $recurInvoice->id . ' - Should send ' . ($recurInvoice->shouldSendToday() ? 'YES' : 'NO')); diff --git a/app/database/seeds/ConstantsSeeder.php b/app/database/seeds/ConstantsSeeder.php index e729e7212938..4e8c44dfb170 100755 --- a/app/database/seeds/ConstantsSeeder.php +++ b/app/database/seeds/ConstantsSeeder.php @@ -125,8 +125,9 @@ class ConstantsSeeder extends Seeder Currency::create(array('name' => 'US Dollar', 'code' => 'USD', 'symbol' => '$', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.')); Currency::create(array('name' => 'Pound Sterling', 'code' => 'GBP', 'symbol' => '£', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.')); Currency::create(array('name' => 'Euro', 'code' => 'EUR', 'symbol' => '€', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.')); - Currency::create(array('name' => 'Rand', 'code' => 'ZAR', 'symbol' => 'R', 'precision' => '2', 'thousand_separator' => ' ', 'decimal_separator' => '.')); - Currency::create(array('name' => 'Danish Krone', 'code' => 'DKK', 'symbol' => 'kr ', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ',')); + Currency::create(array('name' => 'Rand', 'code' => 'ZAR', 'symbol' => 'R', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.')); + Currency::create(array('name' => 'Danish Krone', 'code' => 'DKK', 'symbol' => 'kr ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.')); + Currency::create(array('name' => 'Israeli Shekel', 'code' => 'ILS', 'symbol' => 'NIS ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.')); DatetimeFormat::create(array('format' => 'd/M/Y g:i a', 'label' => '10/Mar/2013')); DatetimeFormat::create(array('format' => 'd-M-Yk g:i a', 'label' => '10-Mar-2013')); diff --git a/public/built.js b/public/built.js index e71cf85fe40d..16a03b8223a6 100644 --- a/public/built.js +++ b/public/built.js @@ -38936,7 +38936,7 @@ function Report3AddHeader (invoice, layout, doc) var LineOne= invoice.account.name; var AlignLine = MaxWidth-30- (doc.getStringUnitWidth(LineOne) * doc.internal.getFontSize()); if (LineOne) { - doc.setFontSize('36'); + doc.setFontSize('30'); doc.setFontType('bold'); doc.text(40, 50, LineOne); } diff --git a/public/js/script.js b/public/js/script.js index 33266b512616..85ff95f9e1b1 100644 --- a/public/js/script.js +++ b/public/js/script.js @@ -1220,7 +1220,7 @@ function Report3AddHeader (invoice, layout, doc) var LineOne= invoice.account.name; var AlignLine = MaxWidth-30- (doc.getStringUnitWidth(LineOne) * doc.internal.getFontSize()); if (LineOne) { - doc.setFontSize('36'); + doc.setFontSize('30'); doc.setFontType('bold'); doc.text(40, 50, LineOne); }