Add initial version of Manual Invoice functionality with PDF generation and management
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
class ManualInvoiceposition extends mfBaseModel {
|
||||
|
||||
public function getOption($key) {
|
||||
if(!$this->options) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$options = json_decode($this->options, true);
|
||||
if(!$options || !is_array($options)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if(array_key_exists($key, $options)) {
|
||||
return $options[$key];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public function setOption($key, $value) {
|
||||
if(!$this->options) {
|
||||
$this->options = json_encode([]);
|
||||
}
|
||||
|
||||
$options = json_decode($this->options, true);
|
||||
if(!is_array($options)) {
|
||||
$options = [];
|
||||
}
|
||||
|
||||
$options[$key] = $value;
|
||||
$this->options = json_encode($options);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user