Added affiliate pages and email due invoices
This commit is contained in:
@@ -299,8 +299,6 @@ class Model_Invoice extends ORMOSB {
|
||||
|
||||
} else
|
||||
throw new Kohana_Exception('Couldnt save invoice for some reason?');
|
||||
|
||||
echo Kohana::debug(array('saved'=>$this));
|
||||
}
|
||||
|
||||
public function calc_total(Validate $array, $field) {
|
||||
@@ -325,6 +323,48 @@ class Model_Invoice extends ORMOSB {
|
||||
$this->_changed[$field] = $field;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check the reminder value
|
||||
*/
|
||||
public function remind($key) {
|
||||
if (! $this->loaded())
|
||||
return NULL;
|
||||
|
||||
if (! trim($this->reminders))
|
||||
return FALSE;
|
||||
|
||||
if (! preg_match('/^a:/',$this->reminders))
|
||||
throw new Kohana_Exception('Reminder is not an array? (:reminder)',array(':remind',$this->reminders));
|
||||
|
||||
$remind = unserialize($this->reminders);
|
||||
return isset($remind[$key]) ? $remind[$key] : FALSE;
|
||||
}
|
||||
|
||||
public function set_remind($key,$value,$add=FALSE) {
|
||||
if (! $this->loaded())
|
||||
throw new Kohana_Exception('Cant call :method when a record not loaded.',array(':method',__METHOD__));
|
||||
|
||||
if (! trim($this->reminders)) {
|
||||
$remind = array();
|
||||
$remind[$key][] = $value;
|
||||
|
||||
} else {
|
||||
if (! preg_match('/^a:/',$this->reminders))
|
||||
throw new Kohana_Exception('Reminder is not an array? (:reminder)',array(':remind',$this->reminders));
|
||||
|
||||
$remind = unserialize($this->reminders);
|
||||
|
||||
if ($add)
|
||||
$remind[$key][] = $value;
|
||||
else
|
||||
$remind[$key] = $value;
|
||||
}
|
||||
|
||||
$this->reminders = serialize($remind);
|
||||
$this->save();
|
||||
return $this->saved();
|
||||
}
|
||||
|
||||
/** LIST FUNCTIONS **/
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user