Move invoice config items into the DB
This commit is contained in:
@@ -370,18 +370,13 @@ class Model_Invoice extends ORMOSB {
|
||||
}
|
||||
|
||||
public function min_due($date) {
|
||||
// @todo This should be a DB confirm item
|
||||
return ($date < time()) ? time()+Kohana::config('config.invoice.min_due_days')*86400 : $date;
|
||||
return ($date < time()) ? time()+ORM::factory('invoice')->config('DUE_DAYS_MIN')*86400 : $date;
|
||||
}
|
||||
|
||||
public function save(Validation $validation = NULL) {
|
||||
// Our items will be clobbered once we save the object, so we need to save it here.
|
||||
$items = $this->items();
|
||||
|
||||
// @todo This is added here so we can do payments
|
||||
$this->total_amt = $this->total();
|
||||
$this->billed_amt = 0;
|
||||
|
||||
// Save the invoice
|
||||
parent::save($validation);
|
||||
|
||||
|
Reference in New Issue
Block a user