mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
bug fixes
This commit is contained in:
parent
ba9b95f50f
commit
9f79628579
@ -41,9 +41,15 @@ class SendRecurringInvoices extends Command {
|
|||||||
$invoice->recurring_invoice_id = $recurInvoice->id;
|
$invoice->recurring_invoice_id = $recurInvoice->id;
|
||||||
$invoice->invoice_number = 'R' . $recurInvoice->account->getNextInvoiceNumber();
|
$invoice->invoice_number = 'R' . $recurInvoice->account->getNextInvoiceNumber();
|
||||||
$invoice->amount = $recurInvoice->amount;
|
$invoice->amount = $recurInvoice->amount;
|
||||||
|
$invoice->balance = $recurInvoice->amount;
|
||||||
$invoice->currency_id = $recurInvoice->currency_id;
|
$invoice->currency_id = $recurInvoice->currency_id;
|
||||||
$invoice->invoice_date = date_create();
|
$invoice->invoice_date = date_create();
|
||||||
$invoice->due_date = date_create()->modify($invoice->client->payment_terms . ' day');
|
|
||||||
|
if ($invoice->client->payment_terms)
|
||||||
|
{
|
||||||
|
$invoice->due_date = date_create()->modify($invoice->client->payment_terms . ' day');
|
||||||
|
}
|
||||||
|
|
||||||
$invoice->save();
|
$invoice->save();
|
||||||
|
|
||||||
foreach ($recurInvoice->invoice_items as $recurItem)
|
foreach ($recurInvoice->invoice_items as $recurItem)
|
||||||
@ -54,7 +60,15 @@ class SendRecurringInvoices extends Command {
|
|||||||
$item->cost = $recurItem->cost;
|
$item->cost = $recurItem->cost;
|
||||||
$item->notes = Utils::processVariables($recurItem->notes);
|
$item->notes = Utils::processVariables($recurItem->notes);
|
||||||
$item->product_key = Utils::processVariables($recurItem->product_key);
|
$item->product_key = Utils::processVariables($recurItem->product_key);
|
||||||
$invoice->invoice_items()->save($item);
|
$invoice->invoice_items()->save($item);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($recurInvoice->invitations as $recurInvitation)
|
||||||
|
{
|
||||||
|
$invitation = Invitation::createNew($recurInvitation);
|
||||||
|
$invitation->contact_id = $recurInvitation->contact_id;
|
||||||
|
$invitation->invitation_key = str_random(20);
|
||||||
|
$invoice->invitations()->save($invitation);
|
||||||
}
|
}
|
||||||
|
|
||||||
$recurInvoice->last_sent_date = new DateTime();
|
$recurInvoice->last_sent_date = new DateTime();
|
||||||
|
@ -15,9 +15,8 @@ class ConfideSetupUsersTable extends Migration {
|
|||||||
Schema::dropIfExists('credits');
|
Schema::dropIfExists('credits');
|
||||||
Schema::dropIfExists('activities');
|
Schema::dropIfExists('activities');
|
||||||
Schema::dropIfExists('invitations');
|
Schema::dropIfExists('invitations');
|
||||||
Schema::dropIfExists('account_gateways');
|
|
||||||
Schema::dropIfExists('gateways');
|
|
||||||
Schema::dropIfExists('payments');
|
Schema::dropIfExists('payments');
|
||||||
|
Schema::dropIfExists('account_gateways');
|
||||||
Schema::dropIfExists('invoice_items');
|
Schema::dropIfExists('invoice_items');
|
||||||
Schema::dropIfExists('products');
|
Schema::dropIfExists('products');
|
||||||
Schema::dropIfExists('tax_rates');
|
Schema::dropIfExists('tax_rates');
|
||||||
@ -36,6 +35,7 @@ class ConfideSetupUsersTable extends Migration {
|
|||||||
Schema::dropIfExists('datetime_formats');
|
Schema::dropIfExists('datetime_formats');
|
||||||
Schema::dropIfExists('sizes');
|
Schema::dropIfExists('sizes');
|
||||||
Schema::dropIfExists('industries');
|
Schema::dropIfExists('industries');
|
||||||
|
Schema::dropIfExists('gateways');
|
||||||
|
|
||||||
Schema::create('countries', function($table)
|
Schema::create('countries', function($table)
|
||||||
{
|
{
|
||||||
@ -522,9 +522,8 @@ class ConfideSetupUsersTable extends Migration {
|
|||||||
Schema::dropIfExists('credits');
|
Schema::dropIfExists('credits');
|
||||||
Schema::dropIfExists('activities');
|
Schema::dropIfExists('activities');
|
||||||
Schema::dropIfExists('invitations');
|
Schema::dropIfExists('invitations');
|
||||||
Schema::dropIfExists('account_gateways');
|
|
||||||
Schema::dropIfExists('gateways');
|
|
||||||
Schema::dropIfExists('payments');
|
Schema::dropIfExists('payments');
|
||||||
|
Schema::dropIfExists('account_gateways');
|
||||||
Schema::dropIfExists('invoice_items');
|
Schema::dropIfExists('invoice_items');
|
||||||
Schema::dropIfExists('products');
|
Schema::dropIfExists('products');
|
||||||
Schema::dropIfExists('tax_rates');
|
Schema::dropIfExists('tax_rates');
|
||||||
@ -543,5 +542,6 @@ class ConfideSetupUsersTable extends Migration {
|
|||||||
Schema::dropIfExists('datetime_formats');
|
Schema::dropIfExists('datetime_formats');
|
||||||
Schema::dropIfExists('sizes');
|
Schema::dropIfExists('sizes');
|
||||||
Schema::dropIfExists('industries');
|
Schema::dropIfExists('industries');
|
||||||
|
Schema::dropIfExists('gateways');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -264,8 +264,15 @@ class Utils
|
|||||||
"July", "August", "September", "October", "November", "December" ];
|
"July", "August", "September", "October", "November", "December" ];
|
||||||
|
|
||||||
$month = intval(date('n')) - 1;
|
$month = intval(date('n')) - 1;
|
||||||
|
|
||||||
$month += $offset;
|
$month += $offset;
|
||||||
$month = $month % 12;
|
$month = $month % 12;
|
||||||
|
|
||||||
|
if ($month < 0)
|
||||||
|
{
|
||||||
|
$month += 12;
|
||||||
|
}
|
||||||
|
|
||||||
return $months[$month];
|
return $months[$month];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,6 +14,8 @@ class ContactMailer extends Mailer {
|
|||||||
$view = 'invoice';
|
$view = 'invoice';
|
||||||
$subject = '';
|
$subject = '';
|
||||||
|
|
||||||
|
$invoice->load('invitations');
|
||||||
|
|
||||||
foreach ($invoice->invitations as $invitation)
|
foreach ($invoice->invitations as $invitation)
|
||||||
{
|
{
|
||||||
if (!$invitation->user->email)
|
if (!$invitation->user->email)
|
||||||
|
@ -32,7 +32,8 @@ Route::get('/send_emails', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
Route::get('/', 'HomeController@showComingSoon');
|
//Route::get('/', 'HomeController@showComingSoon');
|
||||||
|
Route::get('/', 'HomeController@showWelcome');
|
||||||
Route::get('/rocksteady', 'HomeController@showWelcome');
|
Route::get('/rocksteady', 'HomeController@showWelcome');
|
||||||
|
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@
|
|||||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||||||
|
|
||||||
ga('create', 'UA-46031341-1', 'sketch-out.com');
|
ga('create', 'UA-46031341-1');
|
||||||
ga('send', 'pageview');
|
ga('send', 'pageview');
|
||||||
</script>
|
</script>
|
||||||
@endif
|
@endif
|
||||||
|
@ -421,6 +421,9 @@ function getMonth(offset) {
|
|||||||
var month = today.getMonth();
|
var month = today.getMonth();
|
||||||
month = parseInt(month) + offset;
|
month = parseInt(month) + offset;
|
||||||
month = month % 12;
|
month = month % 12;
|
||||||
|
if (month < 0) {
|
||||||
|
month += 12;
|
||||||
|
}
|
||||||
return months[month];
|
return months[month];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user