refs #273 change solution system

This commit is contained in:
cuneytsenturk
2018-07-11 14:05:42 +03:00
parent da091525b0
commit 5503e546c1
14 changed files with 99 additions and 208 deletions

View File

@ -160,6 +160,28 @@ class Invoice extends Model
$this->attributes['currency_rate'] = (double) $value;
}
/**
* Convert invoiced_at to datetime.
*
* @param string $value
* @return void
*/
public function setInvoicedAtAttribute($value)
{
$this->attributes['invoiced_at'] = $value . ' ' . Date::now()->format('H:i:s');
}
/**
* Convert due_at to datetime.
*
* @param string $value
* @return void
*/
public function setDueAtAttribute($value)
{
$this->attributes['due_at'] = $value . ' ' . Date::now()->format('H:i:s');
}
/**
* Get the current balance.
*

View File

@ -85,6 +85,17 @@ class InvoicePayment extends Model
return $query->sum('amount');
}
/**
* Convert paid_at to datetime.
*
* @param string $value
* @return void
*/
public function setPaidAtAttribute($value)
{
$this->attributes['paid_at'] = $value . ' ' . Date::now()->format('H:i:s');
}
/**
* Get the current balance.
*

View File

@ -132,6 +132,17 @@ class Revenue extends Model
$this->attributes['currency_rate'] = (double) $value;
}
/**
* Convert paid_at to datetime.
*
* @param string $value
* @return void
*/
public function setPaidAtAttribute($value)
{
$this->attributes['paid_at'] = $value . ' ' . Date::now()->format('H:i:s');
}
public function scopeLatest($query)
{
return $query->orderBy('paid_at', 'desc');