Merge branch 'fronkdev'
This commit is contained in:
@@ -77,12 +77,20 @@ class AddressController extends mfBaseController {
|
||||
$new_filter = [];
|
||||
|
||||
if(is_array($filter) && count($filter)) {
|
||||
|
||||
$new_filter['add-where'] = "";
|
||||
|
||||
if(array_key_exists("kunde", $filter) && $filter["kunde"]) {
|
||||
$kunde = $this->db()->escape($filter['kunde']);
|
||||
$new_filter['add-where'] .= " AND (company like '%$kunde%' OR firstname like '%$kunde%' OR lastname like '%$kunde%' OR concat(firstname, ' ', lastname) like '%$kunde%' OR concat(lastname, ' ', firstname) like '%$kunde%')";
|
||||
}
|
||||
|
||||
if(!array_key_exists("parents_only", $filter)) {
|
||||
$new_filter["parents_only"] = 1;
|
||||
}
|
||||
|
||||
if(array_key_exists("fibu_account_number", $filter) && $filter['fibu_account_number']) {
|
||||
$new_filter['fibu_account_number'] = $filter['fibu_account_number']."%";
|
||||
$new_filter['fibu_or_supplier_account_number'] = $filter['fibu_account_number']."%";
|
||||
unset($filter['fibu_account_number']);
|
||||
}
|
||||
|
||||
|
||||
@@ -263,6 +263,13 @@ class AddressModel {
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists("fibu_or_supplier_account_number", $filter)) {
|
||||
$fsn = $filter["fibu_or_supplier_account_number"];
|
||||
if($fsn) {
|
||||
$where .= " AND (fibu_account_number LIKE '$fsn' OR fibu_supplier_number LIKE '$fsn')";
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists("fibu_primary_account", $filter)) {
|
||||
$fpa = $filter["fibu_primary_account"];
|
||||
if($fpa) {
|
||||
@@ -431,6 +438,11 @@ class AddressModel {
|
||||
}
|
||||
}
|
||||
|
||||
// custom where clause
|
||||
if(array_key_exists("add-where", $filter)) {
|
||||
$where .= " ".$filter['add-where'];
|
||||
}
|
||||
|
||||
//var_dump($filter, $where);exit;
|
||||
return $where;
|
||||
}
|
||||
|
||||
@@ -108,6 +108,10 @@ class ContractModel {
|
||||
return $contract;
|
||||
}
|
||||
|
||||
public function savePrecontract($contract) {
|
||||
|
||||
}
|
||||
|
||||
public static function getAll() {
|
||||
$items = [];
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user