Billing / generation of Invoices finished
This commit is contained in:
@@ -2,7 +2,41 @@
|
||||
|
||||
class Invoiceposition extends mfBaseModel {
|
||||
|
||||
public function setOption($name, $value) {
|
||||
$options = $this->getOptions;
|
||||
|
||||
if($options) {
|
||||
$options = json_decode($this->options);
|
||||
if(json_last_error() !== JSON_ERROR_NONE) {
|
||||
$options = new stdClass();
|
||||
}
|
||||
} else {
|
||||
$options = new stdClass();
|
||||
}
|
||||
|
||||
$options->$name = $value;
|
||||
|
||||
$this->options = json_encode($options);
|
||||
}
|
||||
|
||||
public function getOption($name) {
|
||||
if(!$this->options) return null;
|
||||
|
||||
$this->log->debug("getOptions ($name): ".print_r($this->options, true));
|
||||
|
||||
$options = json_decode($this->options);
|
||||
if(json_last_error() !== JSON_ERROR_NONE) {
|
||||
$this->log->debug("getOptions ($name) decoding failed");
|
||||
return null;
|
||||
}
|
||||
|
||||
if(property_exists($options, $name)) {
|
||||
|
||||
return $options->$name;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
public function __clone() {
|
||||
$me = new User;
|
||||
$me->loadMe();
|
||||
|
||||
Reference in New Issue
Block a user