mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
INA-2 | Added auto_bill_tries property to the database
This commit is contained in:
parent
431b2b84d4
commit
b15018a73a
@ -91,6 +91,7 @@ class Invoice extends BaseModel
|
|||||||
'auto_bill_enabled',
|
'auto_bill_enabled',
|
||||||
'uses_inclusive_taxes',
|
'uses_inclusive_taxes',
|
||||||
'vendor_id',
|
'vendor_id',
|
||||||
|
'auto_bill_tries'
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
@ -445,14 +446,14 @@ class Invoice extends BaseModel
|
|||||||
$file_path = CreateEntityPdf::dispatchNow($invitation, config('filesystems.default'));
|
$file_path = CreateEntityPdf::dispatchNow($invitation, config('filesystems.default'));
|
||||||
return Storage::disk(config('filesystems.default'))->{$type}($file_path);
|
return Storage::disk(config('filesystems.default'))->{$type}($file_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
try{
|
try{
|
||||||
$file_exists = Storage::disk('public')->exists($file_path);
|
$file_exists = Storage::disk('public')->exists($file_path);
|
||||||
}
|
}
|
||||||
catch(\Exception $e){
|
catch(\Exception $e){
|
||||||
|
|
||||||
nlog($e->getMessage());
|
nlog($e->getMessage());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if($file_exists)
|
if($file_exists)
|
||||||
@ -553,10 +554,10 @@ class Invoice extends BaseModel
|
|||||||
$invoice = $this->fresh();
|
$invoice = $this->fresh();
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'invoice_id' => $invoice->id,
|
'invoice_id' => $invoice->id,
|
||||||
'invoice_amount' => $invoice->amount ?: 0,
|
'invoice_amount' => $invoice->amount ?: 0,
|
||||||
'invoice_partial' => $invoice->partial ?: 0,
|
'invoice_partial' => $invoice->partial ?: 0,
|
||||||
'invoice_balance' => $invoice->balance ?: 0,
|
'invoice_balance' => $invoice->balance ?: 0,
|
||||||
'invoice_paid_to_date' => $invoice->paid_to_date ?: 0,
|
'invoice_paid_to_date' => $invoice->paid_to_date ?: 0,
|
||||||
'invoice_status' => $invoice->status_id ?: 1,
|
'invoice_status' => $invoice->status_id ?: 1,
|
||||||
];
|
];
|
||||||
|
@ -0,0 +1,32 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
class AddAutoBillTriesToInvoicesTable extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('invoices', function (Blueprint $table) {
|
||||||
|
$table->smallInteger('auto_bill_tries')->default(0);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('invoices', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('auto_bill_tries');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user