Billing / generation of Invoices finished

This commit is contained in:
Frank Schubert
2024-07-07 12:04:51 +02:00
parent f83ef19e8d
commit 564d5c53b5
18 changed files with 665 additions and 60 deletions

View File

@@ -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();