Added SLA to Products
This commit is contained in:
@@ -22,6 +22,7 @@ class ProductController extends mfBaseController {
|
||||
$this->layout()->setTemplate("Product/Form");
|
||||
$this->layout()->set("productgroups", ProductgroupModel::getAll());
|
||||
$this->layout()->set("producttechs", ProducttechModel::getAll());
|
||||
$this->layout()->set("slas", SlaModel::getAll());
|
||||
|
||||
}
|
||||
|
||||
@@ -57,18 +58,24 @@ class ProductController extends mfBaseController {
|
||||
$data = [];
|
||||
$data['name'] = $r->name;
|
||||
$data['description'] = $r->description;
|
||||
$data['sla_id'] = $r->sla_id;
|
||||
$data['external'] = ($r->external == 1) ? "1" : "0";
|
||||
$data['price_nne'] = Layout::commaToDot($r->price_nne);
|
||||
$data['price_nbe'] = Layout::commaToDot($r->price_nbe);
|
||||
$data['price'] = Layout::commaToDot($r->price);
|
||||
$data['billing_period'] = $r->billing_period;
|
||||
$data['ivt_id'] = ($r->ivt_id) ? $r->ivt_id : null;
|
||||
$data['note'] = $r->note;
|
||||
|
||||
if(is_numeric($r->producttech_id)) {
|
||||
$data['producttech_id'] = $r->producttech_id;
|
||||
} else {
|
||||
$data['producttech_id'] = null;
|
||||
}
|
||||
if(is_numeric($r->productgroup_id)) {
|
||||
$data['productgroup_id'] = $r->productgroup_id;
|
||||
} else {
|
||||
$data['productgroup_id'] = null;
|
||||
}
|
||||
|
||||
$data['edit_by'] = 1;
|
||||
@@ -105,7 +112,8 @@ class ProductController extends mfBaseController {
|
||||
if($r->producttech_id == "new") {
|
||||
$nt = [];
|
||||
$nt['name'] = $r->producttech_new_name;
|
||||
$nt['code'] = $r->producttech_new_code;
|
||||
$nt['rtrcode'] = $r->producttech_new_rtrcode;
|
||||
$nt['customer_type'] = ($r->producttech_new_customer_type == "business") ? "business" : "residential";
|
||||
$nt['description'] = $r->producttech_new_description;
|
||||
$nt['note'] = $r->producttech_new_note;
|
||||
$tech = ProducttechModel::create($nt);
|
||||
|
||||
Reference in New Issue
Block a user