fixed #53
This commit is contained in:
parent
07ef2dad8a
commit
5e7d3392ab
@ -2,14 +2,14 @@
|
||||
|
||||
namespace App\Listeners\Updates;
|
||||
|
||||
//use App\Models\Auth\Permission;
|
||||
use App\Events\UpdateFinished;
|
||||
use DB;
|
||||
|
||||
class Version104 extends Listener
|
||||
class Version107 extends Listener
|
||||
{
|
||||
const ALIAS = 'core';
|
||||
|
||||
const VERSION = '1.0.4';
|
||||
const VERSION = '1.0.7';
|
||||
|
||||
/**
|
||||
* Handle the event.
|
||||
@ -24,10 +24,8 @@ class Version104 extends Listener
|
||||
return;
|
||||
}
|
||||
|
||||
/*Permission::create([
|
||||
'name' => 'john-doe',
|
||||
'display_name' => 'John Doe',
|
||||
'description' => 'John Doe',
|
||||
]);*/
|
||||
$table = env('DB_PREFIX') . 'taxes';
|
||||
|
||||
DB::statement("ALTER TABLE `$table` MODIFY `rate` DOUBLE(15,4) NOT NULL");
|
||||
}
|
||||
}
|
@ -71,14 +71,14 @@ class Account extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert opening balance to float.
|
||||
* Convert opening balance to double.
|
||||
*
|
||||
* @param string $value
|
||||
* @return void
|
||||
*/
|
||||
public function setOpeningBalanceAttribute($value)
|
||||
{
|
||||
$this->attributes['opening_balance'] = (float) $value;
|
||||
$this->attributes['opening_balance'] = (double) $value;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -80,25 +80,25 @@ class Bill extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert amount to float.
|
||||
* Convert amount to double.
|
||||
*
|
||||
* @param string $value
|
||||
* @return void
|
||||
*/
|
||||
public function setAmountAttribute($value)
|
||||
{
|
||||
$this->attributes['amount'] = (float) $value;
|
||||
$this->attributes['amount'] = (double) $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert currency rate to float.
|
||||
* Convert currency rate to double.
|
||||
*
|
||||
* @param string $value
|
||||
* @return void
|
||||
*/
|
||||
public function setCurrencyRateAttribute($value)
|
||||
{
|
||||
$this->attributes['currency_rate'] = (float) $value;
|
||||
$this->attributes['currency_rate'] = (double) $value;
|
||||
}
|
||||
|
||||
public function scopeDue($query, $date)
|
||||
|
@ -33,4 +33,26 @@ class BillItem extends Model
|
||||
{
|
||||
return $this->belongsTo('App\Models\Setting\Tax');
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert price to double.
|
||||
*
|
||||
* @param string $value
|
||||
* @return void
|
||||
*/
|
||||
public function setPriceAttribute($value)
|
||||
{
|
||||
$this->attributes['price'] = (double) $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert total to double.
|
||||
*
|
||||
* @param string $value
|
||||
* @return void
|
||||
*/
|
||||
public function setTotalAttribute($value)
|
||||
{
|
||||
$this->attributes['total'] = (double) $value;
|
||||
}
|
||||
}
|
||||
|
@ -45,4 +45,26 @@ class BillPayment extends Model
|
||||
{
|
||||
return $query->orderBy('paid_at', 'desc');
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert amount to double.
|
||||
*
|
||||
* @param string $value
|
||||
* @return void
|
||||
*/
|
||||
public function setAmountAttribute($value)
|
||||
{
|
||||
$this->attributes['amount'] = (double) $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert currency rate to double.
|
||||
*
|
||||
* @param string $value
|
||||
* @return void
|
||||
*/
|
||||
public function setCurrencyRateAttribute($value)
|
||||
{
|
||||
$this->attributes['currency_rate'] = (double) $value;
|
||||
}
|
||||
}
|
||||
|
@ -22,4 +22,15 @@ class BillTotal extends Model
|
||||
{
|
||||
return $this->belongsTo('App\Models\Expense\Bill');
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert amount to double.
|
||||
*
|
||||
* @param string $value
|
||||
* @return void
|
||||
*/
|
||||
public function setAmountAttribute($value)
|
||||
{
|
||||
$this->attributes['amount'] = (double) $value;
|
||||
}
|
||||
}
|
||||
|
@ -65,25 +65,25 @@ class Payment extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert amount to float.
|
||||
* Convert amount to double.
|
||||
*
|
||||
* @param string $value
|
||||
* @return void
|
||||
*/
|
||||
public function setAmountAttribute($value)
|
||||
{
|
||||
$this->attributes['amount'] = (float) $value;
|
||||
$this->attributes['amount'] = (double) $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert currency rate to float.
|
||||
* Convert currency rate to double.
|
||||
*
|
||||
* @param string $value
|
||||
* @return void
|
||||
*/
|
||||
public function setCurrencyRateAttribute($value)
|
||||
{
|
||||
$this->attributes['currency_rate'] = (float) $value;
|
||||
$this->attributes['currency_rate'] = (double) $value;
|
||||
}
|
||||
|
||||
public static function scopeLatest($query)
|
||||
|
@ -85,25 +85,25 @@ class Invoice extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert amount to float.
|
||||
* Convert amount to double.
|
||||
*
|
||||
* @param string $value
|
||||
* @return void
|
||||
*/
|
||||
public function setAmountAttribute($value)
|
||||
{
|
||||
$this->attributes['amount'] = (float) $value;
|
||||
$this->attributes['amount'] = (double) $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert currency rate to float.
|
||||
* Convert currency rate to double.
|
||||
*
|
||||
* @param string $value
|
||||
* @return void
|
||||
*/
|
||||
public function setCurrencyRateAttribute($value)
|
||||
{
|
||||
$this->attributes['currency_rate'] = (float) $value;
|
||||
$this->attributes['currency_rate'] = (double) $value;
|
||||
}
|
||||
|
||||
public function scopeDue($query, $date)
|
||||
|
@ -33,4 +33,26 @@ class InvoiceItem extends Model
|
||||
{
|
||||
return $this->belongsTo('App\Models\Setting\Tax');
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert price to double.
|
||||
*
|
||||
* @param string $value
|
||||
* @return void
|
||||
*/
|
||||
public function setPriceAttribute($value)
|
||||
{
|
||||
$this->attributes['price'] = (double) $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert total to double.
|
||||
*
|
||||
* @param string $value
|
||||
* @return void
|
||||
*/
|
||||
public function setTotalAttribute($value)
|
||||
{
|
||||
$this->attributes['total'] = (double) $value;
|
||||
}
|
||||
}
|
||||
|
@ -45,4 +45,26 @@ class InvoicePayment extends Model
|
||||
{
|
||||
return $query->orderBy('paid_at', 'desc');
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert amount to double.
|
||||
*
|
||||
* @param string $value
|
||||
* @return void
|
||||
*/
|
||||
public function setAmountAttribute($value)
|
||||
{
|
||||
$this->attributes['amount'] = (double) $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert currency rate to double.
|
||||
*
|
||||
* @param string $value
|
||||
* @return void
|
||||
*/
|
||||
public function setCurrencyRateAttribute($value)
|
||||
{
|
||||
$this->attributes['currency_rate'] = (double) $value;
|
||||
}
|
||||
}
|
||||
|
@ -22,4 +22,15 @@ class InvoiceTotal extends Model
|
||||
{
|
||||
return $this->belongsTo('App\Models\Income\Invoice');
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert amount to double.
|
||||
*
|
||||
* @param string $value
|
||||
* @return void
|
||||
*/
|
||||
public function setAmountAttribute($value)
|
||||
{
|
||||
$this->attributes['amount'] = (double) $value;
|
||||
}
|
||||
}
|
||||
|
@ -71,25 +71,25 @@ class Revenue extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert amount to float.
|
||||
* Convert amount to double.
|
||||
*
|
||||
* @param string $value
|
||||
* @return void
|
||||
*/
|
||||
public function setAmountAttribute($value)
|
||||
{
|
||||
$this->attributes['amount'] = (float) $value;
|
||||
$this->attributes['amount'] = (double) $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert currency rate to float.
|
||||
* Convert currency rate to double.
|
||||
*
|
||||
* @param string $value
|
||||
* @return void
|
||||
*/
|
||||
public function setCurrencyRateAttribute($value)
|
||||
{
|
||||
$this->attributes['currency_rate'] = (float) $value;
|
||||
$this->attributes['currency_rate'] = (double) $value;
|
||||
}
|
||||
|
||||
public function scopeLatest($query)
|
||||
|
@ -60,25 +60,25 @@ class Item extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert sale price to float.
|
||||
* Convert sale price to double.
|
||||
*
|
||||
* @param string $value
|
||||
* @return void
|
||||
*/
|
||||
public function setSalePriceAttribute($value)
|
||||
{
|
||||
$this->attributes['sale_price'] = (float) $value;
|
||||
$this->attributes['sale_price'] = (double) $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert purchase price to float.
|
||||
* Convert purchase price to double.
|
||||
*
|
||||
* @param string $value
|
||||
* @return void
|
||||
*/
|
||||
public function setPurchasePriceAttribute($value)
|
||||
{
|
||||
$this->attributes['purchase_price'] = (float) $value;
|
||||
$this->attributes['purchase_price'] = (double) $value;
|
||||
}
|
||||
|
||||
public static function getItems($filter_data = array())
|
||||
|
@ -54,13 +54,13 @@ class Currency extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert rate to float.
|
||||
* Convert rate to double.
|
||||
*
|
||||
* @param string $value
|
||||
* @return void
|
||||
*/
|
||||
public function setRateAttribute($value)
|
||||
{
|
||||
$this->attributes['rate'] = (float) $value;
|
||||
$this->attributes['rate'] = (double) $value;
|
||||
}
|
||||
}
|
||||
|
@ -37,4 +37,15 @@ class Tax extends Model
|
||||
{
|
||||
return $this->hasMany('App\Models\Income\InvoiceItem');
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert rate to double.
|
||||
*
|
||||
* @param string $value
|
||||
* @return void
|
||||
*/
|
||||
public function setRateAttribute($value)
|
||||
{
|
||||
$this->attributes['rate'] = (double) $value;
|
||||
}
|
||||
}
|
||||
|
@ -14,7 +14,8 @@ class EventServiceProvider extends ServiceProvider
|
||||
*/
|
||||
protected $listen = [
|
||||
'App\Events\UpdateFinished' => [
|
||||
'App\Listeners\Updates\Version104',
|
||||
'App\Listeners\Updates\Version106',
|
||||
'App\Listeners\Updates\Version107',
|
||||
],
|
||||
'Illuminate\Auth\Events\Login' => [
|
||||
'App\Listeners\Auth\Login',
|
||||
|
@ -18,7 +18,7 @@ class CreateAccountsTable extends Migration
|
||||
$table->string('name');
|
||||
$table->string('number');
|
||||
$table->string('currency_code');
|
||||
$table->float('opening_balance', 15, 4)->default('0.0000');
|
||||
$table->double('opening_balance', 15, 4)->default('0.0000');
|
||||
$table->string('bank_name')->nullable();
|
||||
$table->string('bank_phone')->nullable();
|
||||
$table->text('bank_address')->nullable();
|
||||
|
@ -20,9 +20,9 @@ class CreateBillsTable extends Migration
|
||||
$table->string('bill_status_code');
|
||||
$table->date('billed_at');
|
||||
$table->date('due_at');
|
||||
$table->float('amount', 15, 4);
|
||||
$table->double('amount', 15, 4);
|
||||
$table->string('currency_code');
|
||||
$table->float('currency_rate', 15, 8);
|
||||
$table->double('currency_rate', 15, 8);
|
||||
$table->integer('vendor_id');
|
||||
$table->string('vendor_name');
|
||||
$table->string('vendor_email');
|
||||
@ -46,8 +46,8 @@ class CreateBillsTable extends Migration
|
||||
$table->string('name');
|
||||
$table->string('sku')->nullable();
|
||||
$table->integer('quantity');
|
||||
$table->float('price', 15, 4);
|
||||
$table->float('total', 15, 4);
|
||||
$table->double('price', 15, 4);
|
||||
$table->double('total', 15, 4);
|
||||
$table->float('tax', 15, 4)->default('0.0000');
|
||||
$table->integer('tax_id');
|
||||
$table->timestamps();
|
||||
@ -73,9 +73,9 @@ class CreateBillsTable extends Migration
|
||||
$table->integer('bill_id');
|
||||
$table->integer('account_id');
|
||||
$table->date('paid_at');
|
||||
$table->float('amount', 15, 4);
|
||||
$table->double('amount', 15, 4);
|
||||
$table->string('currency_code');
|
||||
$table->float('currency_rate', 15, 8);
|
||||
$table->double('currency_rate', 15, 8);
|
||||
$table->text('description')->nullable();
|
||||
$table->string('payment_method');
|
||||
$table->string('reference')->nullable();
|
||||
|
@ -17,7 +17,7 @@ class CreateCurrenciesTable extends Migration
|
||||
$table->integer('company_id');
|
||||
$table->string('name');
|
||||
$table->string('code');
|
||||
$table->float('rate', 15, 8);
|
||||
$table->double('rate', 15, 8);
|
||||
$table->tinyInteger('enabled')->default(0);
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
@ -20,9 +20,9 @@ class CreateInvoicesTable extends Migration
|
||||
$table->string('invoice_status_code');
|
||||
$table->date('invoiced_at');
|
||||
$table->date('due_at');
|
||||
$table->float('amount', 15, 4);
|
||||
$table->double('amount', 15, 4);
|
||||
$table->string('currency_code');
|
||||
$table->float('currency_rate', 15, 8);
|
||||
$table->double('currency_rate', 15, 8);
|
||||
$table->integer('customer_id');
|
||||
$table->string('customer_name');
|
||||
$table->string('customer_email');
|
||||
@ -46,9 +46,9 @@ class CreateInvoicesTable extends Migration
|
||||
$table->string('name');
|
||||
$table->string('sku')->nullable();
|
||||
$table->integer('quantity');
|
||||
$table->float('price', 15, 4);
|
||||
$table->float('total', 15, 4);
|
||||
$table->float('tax', 15, 4)->default('0.0000');
|
||||
$table->double('price', 15, 4);
|
||||
$table->double('total', 15, 4);
|
||||
$table->double('tax', 15, 4)->default('0.0000');
|
||||
$table->integer('tax_id');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
@ -73,9 +73,9 @@ class CreateInvoicesTable extends Migration
|
||||
$table->integer('invoice_id');
|
||||
$table->integer('account_id');
|
||||
$table->date('paid_at');
|
||||
$table->float('amount', 15, 4);
|
||||
$table->double('amount', 15, 4);
|
||||
$table->string('currency_code');
|
||||
$table->float('currency_rate', 15, 8);
|
||||
$table->double('currency_rate', 15, 8);
|
||||
$table->text('description')->nullable();
|
||||
$table->string('payment_method');
|
||||
$table->string('reference')->nullable();
|
||||
|
@ -18,8 +18,8 @@ class CreateItemsTable extends Migration
|
||||
$table->string('name');
|
||||
$table->string('sku');
|
||||
$table->text('description')->nullable();
|
||||
$table->float('sale_price', 15, 4);
|
||||
$table->float('purchase_price', 15, 4);
|
||||
$table->double('sale_price', 15, 4);
|
||||
$table->double('purchase_price', 15, 4);
|
||||
$table->integer('quantity');
|
||||
$table->integer('category_id')->nullable();
|
||||
$table->integer('tax_id')->nullable();
|
||||
|
@ -17,9 +17,9 @@ class CreatePaymentsTable extends Migration
|
||||
$table->integer('company_id');
|
||||
$table->integer('account_id');
|
||||
$table->date('paid_at');
|
||||
$table->float('amount', 15, 4);
|
||||
$table->double('amount', 15, 4);
|
||||
$table->string('currency_code');
|
||||
$table->float('currency_rate', 15, 8);
|
||||
$table->double('currency_rate', 15, 8);
|
||||
$table->integer('vendor_id')->nullable();
|
||||
$table->text('description')->nullable();
|
||||
$table->integer('category_id');
|
||||
|
@ -17,9 +17,9 @@ class CreateRevenuesTable extends Migration
|
||||
$table->integer('company_id');
|
||||
$table->integer('account_id');
|
||||
$table->date('paid_at');
|
||||
$table->float('amount', 15, 4);
|
||||
$table->double('amount', 15, 4);
|
||||
$table->string('currency_code');
|
||||
$table->float('currency_rate', 15, 8);
|
||||
$table->double('currency_rate', 15, 8);
|
||||
$table->integer('customer_id')->nullable();
|
||||
$table->text('description')->nullable();
|
||||
$table->integer('category_id');
|
||||
|
@ -16,7 +16,7 @@ class CreateTaxesTable extends Migration
|
||||
$table->increments('id');
|
||||
$table->integer('company_id');
|
||||
$table->string('name');
|
||||
$table->integer('rate');
|
||||
$table->double('rate', 15, 4);
|
||||
$table->boolean('enabled');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
@ -24,7 +24,7 @@ class CreateBillTotalsTable extends Migration
|
||||
$table->integer('bill_id');
|
||||
$table->string('code')->nullable();
|
||||
$table->string('name');
|
||||
$table->float('amount', 15, 4);
|
||||
$table->double('amount', 15, 4);
|
||||
$table->integer('sort_order');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
@ -24,7 +24,7 @@ class CreateInvoiceTotalsTable extends Migration
|
||||
$table->integer('invoice_id');
|
||||
$table->string('code')->nullable();
|
||||
$table->string('name');
|
||||
$table->float('amount', 15, 4);
|
||||
$table->double('amount', 15, 4);
|
||||
$table->integer('sort_order');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
Loading…
x
Reference in New Issue
Block a user