Added fibu account numbers to Address; new permission fibu + employee
This commit is contained in:
@@ -1,20 +1,23 @@
|
||||
<?php
|
||||
|
||||
class AddressModel {
|
||||
public $parent_id = null;
|
||||
public $customer_number = null;
|
||||
public $spin = null;
|
||||
public $company = null;
|
||||
public $firstname = null;
|
||||
public $lastname = null;
|
||||
public $street = null;
|
||||
public $zip = null;
|
||||
public $city = null;
|
||||
public $country = null;
|
||||
public $phone = null;
|
||||
public $fax = null;
|
||||
public $mobile = null;
|
||||
public $email = null;
|
||||
public $parent_id;
|
||||
public $customer_number;
|
||||
public $fibu_account_number;
|
||||
public $fibu_supplier_number;
|
||||
public $fibu_primary_account;
|
||||
public $spin;
|
||||
public $company;
|
||||
public $firstname;
|
||||
public $lastname;
|
||||
public $street;
|
||||
public $zip;
|
||||
public $city;
|
||||
public $country;
|
||||
public $phone;
|
||||
public $fax;
|
||||
public $mobile;
|
||||
public $email;
|
||||
public $uid;
|
||||
public $billing_type;
|
||||
public $billing_delivery;
|
||||
@@ -25,12 +28,12 @@ class AddressModel {
|
||||
public $allow_contact;
|
||||
public $allow_spin;
|
||||
|
||||
public $note = null;
|
||||
public $note;
|
||||
|
||||
public $create_by = null;
|
||||
public $edit_by = null;
|
||||
public $create = null;
|
||||
public $edit = null;
|
||||
public $create_by;
|
||||
public $edit_by;
|
||||
public $create;
|
||||
public $edit;
|
||||
|
||||
public static function create(Array $data) {
|
||||
$model = new Address();
|
||||
@@ -232,6 +235,34 @@ class AddressModel {
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists("fibu_account_number", $filter)) {
|
||||
$fan = $filter["fibu_account_number"];
|
||||
if($fan) {
|
||||
if(is_numeric($fan)) {
|
||||
$where .= " AND fibu_account_number=$fan";
|
||||
} else {
|
||||
$fan = FronkDB::singleton()->escape($fan);
|
||||
$where .= " AND fibu_account_number LIKE '$fan'";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists("fibu_supplier_number", $filter)) {
|
||||
$fsn = $filter["fibu_supplier_number"];
|
||||
if(is_numeric($fsn)) {
|
||||
$where .= " AND fibu_supplier_number=$fsn";
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists("fibu_primary_account", $filter)) {
|
||||
$fpa = $filter["fibu_primary_account"];
|
||||
if($fpa) {
|
||||
$where .= " AND fibu_primary_account=1";
|
||||
} else {
|
||||
$where .= " AND fibu_primary_account=0";
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists("spin", $filter)) {
|
||||
$spin = FronkDB::singleton()->escape($filter["spin"]);
|
||||
if($spin) {
|
||||
|
||||
Reference in New Issue
Block a user