Bug fixes

This commit is contained in:
Hillel Coren 2014-06-04 23:41:34 +03:00
parent a5f991870c
commit cdd4ffde68
4 changed files with 13 additions and 8 deletions

View File

@ -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'));

View File

@ -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'));

View File

@ -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);
}

View File

@ -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);
}