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->invoice_number = 'R' . $recurInvoice->account->getNextInvoiceNumber();
|
||||
$invoice->amount = $recurInvoice->amount;
|
||||
$invoice->balance = $recurInvoice->amount;
|
||||
$invoice->currency_id = $recurInvoice->currency_id;
|
||||
$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();
|
||||
|
||||
foreach ($recurInvoice->invoice_items as $recurItem)
|
||||
@ -57,6 +63,14 @@ class SendRecurringInvoices extends Command {
|
||||
$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->save();
|
||||
|
||||
|
@ -15,9 +15,8 @@ class ConfideSetupUsersTable extends Migration {
|
||||
Schema::dropIfExists('credits');
|
||||
Schema::dropIfExists('activities');
|
||||
Schema::dropIfExists('invitations');
|
||||
Schema::dropIfExists('account_gateways');
|
||||
Schema::dropIfExists('gateways');
|
||||
Schema::dropIfExists('payments');
|
||||
Schema::dropIfExists('account_gateways');
|
||||
Schema::dropIfExists('invoice_items');
|
||||
Schema::dropIfExists('products');
|
||||
Schema::dropIfExists('tax_rates');
|
||||
@ -36,6 +35,7 @@ class ConfideSetupUsersTable extends Migration {
|
||||
Schema::dropIfExists('datetime_formats');
|
||||
Schema::dropIfExists('sizes');
|
||||
Schema::dropIfExists('industries');
|
||||
Schema::dropIfExists('gateways');
|
||||
|
||||
Schema::create('countries', function($table)
|
||||
{
|
||||
@ -522,9 +522,8 @@ class ConfideSetupUsersTable extends Migration {
|
||||
Schema::dropIfExists('credits');
|
||||
Schema::dropIfExists('activities');
|
||||
Schema::dropIfExists('invitations');
|
||||
Schema::dropIfExists('account_gateways');
|
||||
Schema::dropIfExists('gateways');
|
||||
Schema::dropIfExists('payments');
|
||||
Schema::dropIfExists('account_gateways');
|
||||
Schema::dropIfExists('invoice_items');
|
||||
Schema::dropIfExists('products');
|
||||
Schema::dropIfExists('tax_rates');
|
||||
@ -543,5 +542,6 @@ class ConfideSetupUsersTable extends Migration {
|
||||
Schema::dropIfExists('datetime_formats');
|
||||
Schema::dropIfExists('sizes');
|
||||
Schema::dropIfExists('industries');
|
||||
Schema::dropIfExists('gateways');
|
||||
}
|
||||
}
|
||||
|
@ -264,8 +264,15 @@ class Utils
|
||||
"July", "August", "September", "October", "November", "December" ];
|
||||
|
||||
$month = intval(date('n')) - 1;
|
||||
|
||||
$month += $offset;
|
||||
$month = $month % 12;
|
||||
|
||||
if ($month < 0)
|
||||
{
|
||||
$month += 12;
|
||||
}
|
||||
|
||||
return $months[$month];
|
||||
}
|
||||
|
||||
|
@ -14,6 +14,8 @@ class ContactMailer extends Mailer {
|
||||
$view = 'invoice';
|
||||
$subject = '';
|
||||
|
||||
$invoice->load('invitations');
|
||||
|
||||
foreach ($invoice->invitations as $invitation)
|
||||
{
|
||||
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');
|
||||
|
||||
|
||||
|
@ -44,7 +44,7 @@
|
||||
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');
|
||||
|
||||
ga('create', 'UA-46031341-1', 'sketch-out.com');
|
||||
ga('create', 'UA-46031341-1');
|
||||
ga('send', 'pageview');
|
||||
</script>
|
||||
@endif
|
||||
|
@ -421,6 +421,9 @@ function getMonth(offset) {
|
||||
var month = today.getMonth();
|
||||
month = parseInt(month) + offset;
|
||||
month = month % 12;
|
||||
if (month < 0) {
|
||||
month += 12;
|
||||
}
|
||||
return months[month];
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user