fixed #53
This commit is contained in:
@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user