Declaration of property fields of thirdparties
This commit is contained in:
parent
02a96e163f
commit
cffc56b80b
@ -86,9 +86,9 @@ class Contact extends CommonObject
|
||||
'phone_mobile' =>array('type'=>'varchar(30)', 'label'=>'Phone mobile', 'enabled'=>1, 'visible'=>-1, 'position'=>100),
|
||||
'fax' =>array('type'=>'varchar(30)', 'label'=>'Fax', 'enabled'=>1, 'visible'=>-1, 'position'=>105),
|
||||
'email' =>array('type'=>'varchar(255)', 'label'=>'Email', 'enabled'=>1, 'visible'=>-1, 'position'=>110),
|
||||
'socialnetworks' =>array('type'=>'text', 'label'=>'Socialnetworks', 'enabled'=>1, 'visible'=>-1, 'position'=>115),
|
||||
'socialnetworks' =>array('type'=>'text', 'label'=>'SocialNetworks', 'enabled'=>1, 'visible'=>-1, 'position'=>115),
|
||||
'photo' =>array('type'=>'varchar(255)', 'label'=>'Photo', 'enabled'=>1, 'visible'=>-1, 'position'=>170),
|
||||
'priv' =>array('type'=>'smallint(6)', 'label'=>'Priv', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>175),
|
||||
'priv' =>array('type'=>'smallint(6)', 'label'=>'Private', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>175),
|
||||
'no_email' =>array('type'=>'smallint(6)', 'label'=>'No email', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>180),
|
||||
'fk_user_creat' =>array('type'=>'integer', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-1, 'position'=>185),
|
||||
'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-1, 'position'=>190),
|
||||
|
||||
@ -74,7 +74,8 @@ $object = null;
|
||||
$ObjectClassName = '';
|
||||
$arrayoftype = array(
|
||||
'thirdparty' => array('label' => 'ThirdParties', 'ObjectClassName' => 'Societe'),
|
||||
'contract' => array('label' => 'Contracts', 'ObjectClassName' => 'Contrat'),
|
||||
'contact' => array('label' => 'Contacts', 'ObjectClassName' => 'Contact'),
|
||||
'contract' => array('label' => 'Contracts', 'ObjectClassName' => 'Contrat'),
|
||||
'invoice' => array('label' => 'Invoices', 'ObjectClassName' => 'Facture'),
|
||||
'invoice_template'=>array('label' => 'PredefinedInvoices', 'ObjectClassName' => 'FactureRec'),
|
||||
'bom' => array('label' => 'BOM', 'ObjectClassName' => 'Bom'),
|
||||
@ -242,7 +243,9 @@ print '</div>';
|
||||
print '<div class="divadvancedsearchfield">';
|
||||
foreach($object->fields as $key => $val) {
|
||||
if (! $val['measure']) {
|
||||
if (in_array($key, array('id', 'ref_int', 'ref_ext', 'rowid', 'entity', 'last_main_doc', 'extraparams'))) continue;
|
||||
if (in_array($key, array(
|
||||
'id', 'ref_int', 'ref_ext', 'rowid', 'entity', 'last_main_doc', 'logo', 'logo_squarred', 'extraparams',
|
||||
'parent', 'photo', 'socialnetworks', 'webservices_url', 'webservices_key'))) continue;
|
||||
if (isset($val['enabled']) && ! dol_eval($val['enabled'], 1)) continue;
|
||||
if (isset($val['visible']) && ! dol_eval($val['visible'], 1)) continue;
|
||||
if (preg_match('/^fk_/', $key) && ! preg_match('/^fk_statu/', $key)) continue;
|
||||
|
||||
@ -125,23 +125,99 @@ class Societe extends CommonObject
|
||||
/**
|
||||
* @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
|
||||
*/
|
||||
public $fields = array(
|
||||
'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'index'=>1, 'position'=>1, 'comment'=>'Id'),
|
||||
'nom' =>array('type'=>'varchar(128)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'),
|
||||
'name_alias' =>array('type'=>'varchar(128)', 'label'=>'AliasNames', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'),
|
||||
'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'default'=>1, 'notnull'=>1, 'index'=>1, 'position'=>20),
|
||||
'note_public' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>60),
|
||||
'note_private' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>61),
|
||||
'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>500),
|
||||
'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>501),
|
||||
//'date_valid' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>502),
|
||||
'fk_user_creat' =>array('type'=>'integer', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>510),
|
||||
'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>511),
|
||||
//'fk_user_valid' =>array('type'=>'integer', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>512),
|
||||
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'index'=>1, 'position'=>1000),
|
||||
public $fields=array(
|
||||
'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10),
|
||||
'parent' =>array('type'=>'integer', 'label'=>'Parent', 'enabled'=>1, 'visible'=>-1, 'position'=>20),
|
||||
'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>25),
|
||||
'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>30),
|
||||
'nom' =>array('type'=>'varchar(128)', 'label'=>'Nom', 'enabled'=>1, 'visible'=>-1, 'position'=>35),
|
||||
'name_alias' =>array('type'=>'varchar(128)', 'label'=>'Name alias', 'enabled'=>1, 'visible'=>-1, 'position'=>36),
|
||||
'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>40, 'index'=>1),
|
||||
'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'Ref ext', 'enabled'=>1, 'visible'=>0, 'position'=>45),
|
||||
'ref_int' =>array('type'=>'varchar(60)', 'label'=>'Ref int', 'enabled'=>1, 'visible'=>-1, 'position'=>50),
|
||||
'code_client' =>array('type'=>'varchar(24)', 'label'=>'Code client', 'enabled'=>1, 'visible'=>-1, 'position'=>55),
|
||||
'code_fournisseur' =>array('type'=>'varchar(24)', 'label'=>'Code fournisseur', 'enabled'=>1, 'visible'=>-1, 'position'=>60),
|
||||
'code_compta' =>array('type'=>'varchar(24)', 'label'=>'Code compta', 'enabled'=>1, 'visible'=>-1, 'position'=>65),
|
||||
'code_compta_fournisseur' =>array('type'=>'varchar(24)', 'label'=>'Code compta fournisseur', 'enabled'=>1, 'visible'=>-1, 'position'=>70),
|
||||
'address' =>array('type'=>'varchar(255)', 'label'=>'Address', 'enabled'=>1, 'visible'=>-1, 'position'=>75),
|
||||
'zip' =>array('type'=>'varchar(25)', 'label'=>'Zip', 'enabled'=>1, 'visible'=>-1, 'position'=>80),
|
||||
'town' =>array('type'=>'varchar(50)', 'label'=>'Town', 'enabled'=>1, 'visible'=>-1, 'position'=>85),
|
||||
'fk_departement' =>array('type'=>'integer', 'label'=>'Fk departement', 'enabled'=>1, 'visible'=>-1, 'position'=>90),
|
||||
'fk_pays' =>array('type'=>'integer', 'label'=>'Fk pays', 'enabled'=>1, 'visible'=>-1, 'position'=>95),
|
||||
'phone' =>array('type'=>'varchar(20)', 'label'=>'Phone', 'enabled'=>1, 'visible'=>-1, 'position'=>100),
|
||||
'fax' =>array('type'=>'varchar(20)', 'label'=>'Fax', 'enabled'=>1, 'visible'=>-1, 'position'=>105),
|
||||
'url' =>array('type'=>'varchar(255)', 'label'=>'Url', 'enabled'=>1, 'visible'=>-1, 'position'=>110),
|
||||
'email' =>array('type'=>'varchar(128)', 'label'=>'Email', 'enabled'=>1, 'visible'=>-1, 'position'=>115),
|
||||
'socialnetworks' =>array('type'=>'text', 'label'=>'Socialnetworks', 'enabled'=>1, 'visible'=>-1, 'position'=>120),
|
||||
/*'skype' =>array('type'=>'varchar(255)', 'label'=>'Skype', 'enabled'=>1, 'visible'=>-1, 'position'=>125),
|
||||
'whatsapp' =>array('type'=>'varchar(255)', 'label'=>'Whatsapp', 'enabled'=>1, 'visible'=>-1, 'position'=>130),
|
||||
'linkedin' =>array('type'=>'varchar(255)', 'label'=>'Linkedin', 'enabled'=>1, 'visible'=>-1, 'position'=>135),
|
||||
'youtube' =>array('type'=>'varchar(255)', 'label'=>'Youtube', 'enabled'=>1, 'visible'=>-1, 'position'=>140),
|
||||
'googleplus' =>array('type'=>'varchar(255)', 'label'=>'Googleplus', 'enabled'=>1, 'visible'=>-1, 'position'=>145),
|
||||
'snapchat' =>array('type'=>'varchar(255)', 'label'=>'Snapchat', 'enabled'=>1, 'visible'=>-1, 'position'=>150),
|
||||
'instagram' =>array('type'=>'varchar(255)', 'label'=>'Instagram', 'enabled'=>1, 'visible'=>-1, 'position'=>155),
|
||||
'facebook' =>array('type'=>'varchar(255)', 'label'=>'Facebook', 'enabled'=>1, 'visible'=>-1, 'position'=>160),
|
||||
'twitter' =>array('type'=>'varchar(255)', 'label'=>'Twitter', 'enabled'=>1, 'visible'=>-1, 'position'=>165),*/
|
||||
'fk_effectif' =>array('type'=>'integer', 'label'=>'Fk effectif', 'enabled'=>1, 'visible'=>-1, 'position'=>170),
|
||||
'fk_typent' =>array('type'=>'integer', 'label'=>'Fk typent', 'enabled'=>1, 'visible'=>-1, 'position'=>175),
|
||||
'fk_forme_juridique' =>array('type'=>'integer', 'label'=>'Fk forme juridique', 'enabled'=>1, 'visible'=>-1, 'position'=>180),
|
||||
'fk_currency' =>array('type'=>'varchar(3)', 'label'=>'Fk currency', 'enabled'=>1, 'visible'=>-1, 'position'=>185),
|
||||
'siren' =>array('type'=>'varchar(128)', 'label'=>'Idprof1', 'enabled'=>1, 'visible'=>-1, 'position'=>190),
|
||||
'siret' =>array('type'=>'varchar(128)', 'label'=>'Idprof2', 'enabled'=>1, 'visible'=>-1, 'position'=>195),
|
||||
'ape' =>array('type'=>'varchar(128)', 'label'=>'Idprof3', 'enabled'=>1, 'visible'=>-1, 'position'=>200),
|
||||
'idprof4' =>array('type'=>'varchar(128)', 'label'=>'Idprof4', 'enabled'=>1, 'visible'=>-1, 'position'=>205),
|
||||
'idprof5' =>array('type'=>'varchar(128)', 'label'=>'Idprof5', 'enabled'=>1, 'visible'=>-1, 'position'=>206),
|
||||
'idprof6' =>array('type'=>'varchar(128)', 'label'=>'Idprof6', 'enabled'=>1, 'visible'=>-1, 'position'=>207),
|
||||
'tva_intra' =>array('type'=>'varchar(20)', 'label'=>'Tva intra', 'enabled'=>1, 'visible'=>-1, 'position'=>210),
|
||||
'capital' =>array('type'=>'double(24,8)', 'label'=>'Capital', 'enabled'=>1, 'visible'=>-1, 'position'=>215),
|
||||
'fk_stcomm' =>array('type'=>'integer', 'label'=>'Fk stcomm', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>220),
|
||||
'note_private' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>225),
|
||||
'note_public' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>230),
|
||||
'prefix_comm' =>array('type'=>'varchar(5)', 'label'=>'Prefix comm', 'enabled'=>'$conf->global->SOCIETE_USEPREFIX', 'visible'=>-1, 'position'=>235),
|
||||
'client' =>array('type'=>'tinyint(4)', 'label'=>'Client', 'enabled'=>1, 'visible'=>-1, 'position'=>240),
|
||||
'fournisseur' =>array('type'=>'tinyint(4)', 'label'=>'Fournisseur', 'enabled'=>1, 'visible'=>-1, 'position'=>245),
|
||||
'supplier_account' =>array('type'=>'varchar(32)', 'label'=>'Supplier account', 'enabled'=>1, 'visible'=>-1, 'position'=>250),
|
||||
'fk_prospectlevel' =>array('type'=>'varchar(12)', 'label'=>'ProspectLevel', 'enabled'=>1, 'visible'=>-1, 'position'=>255),
|
||||
'customer_bad' =>array('type'=>'tinyint(4)', 'label'=>'Customer bad', 'enabled'=>1, 'visible'=>-1, 'position'=>260),
|
||||
'customer_rate' =>array('type'=>'double', 'label'=>'Customer rate', 'enabled'=>1, 'visible'=>-1, 'position'=>265),
|
||||
'supplier_rate' =>array('type'=>'double', 'label'=>'Supplier rate', 'enabled'=>1, 'visible'=>-1, 'position'=>270),
|
||||
'fk_user_creat' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'position'=>275),
|
||||
'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>280),
|
||||
//'remise_client' =>array('type'=>'double', 'label'=>'CustomerDiscount', 'enabled'=>1, 'visible'=>-1, 'position'=>285, 'isameasure'=>1),
|
||||
//'remise_supplier' =>array('type'=>'double', 'label'=>'SupplierDiscount', 'enabled'=>1, 'visible'=>-1, 'position'=>290, 'isameasure'=>1),
|
||||
'mode_reglement' =>array('type'=>'tinyint(4)', 'label'=>'Mode reglement', 'enabled'=>1, 'visible'=>-1, 'position'=>295),
|
||||
'cond_reglement' =>array('type'=>'tinyint(4)', 'label'=>'Cond reglement', 'enabled'=>1, 'visible'=>-1, 'position'=>300),
|
||||
'mode_reglement_supplier' =>array('type'=>'integer', 'label'=>'Mode reglement supplier', 'enabled'=>1, 'visible'=>-1, 'position'=>305),
|
||||
'outstanding_limit' =>array('type'=>'double(24,8)', 'label'=>'OutstandingLimit', 'enabled'=>1, 'visible'=>-1, 'position'=>310, 'isameasure'=>1),
|
||||
'order_min_amount' =>array('type'=>'double(24,8)', 'label'=>'Order min amount', 'enabled'=>'!empty($conf->commande->enabled) && !empty($conf->global->ORDER_MANAGE_MIN_AMOUNT)', 'visible'=>-1, 'position'=>315, 'isameasure'=>1),
|
||||
'supplier_order_min_amount' =>array('type'=>'double(24,8)', 'label'=>'Supplier order min amount', 'enabled'=>'!empty($conf->commande->enabled) && !empty($conf->global->ORDER_MANAGE_MIN_AMOUNT)', 'visible'=>-1, 'position'=>320, 'isameasure'=>1),
|
||||
'cond_reglement_supplier' =>array('type'=>'integer', 'label'=>'Cond reglement supplier', 'enabled'=>1, 'visible'=>-1, 'position'=>325),
|
||||
'fk_shipping_method' =>array('type'=>'integer', 'label'=>'Fk shipping method', 'enabled'=>1, 'visible'=>-1, 'position'=>330),
|
||||
'tva_assuj' =>array('type'=>'tinyint(4)', 'label'=>'Tva assuj', 'enabled'=>1, 'visible'=>-1, 'position'=>335),
|
||||
'localtax1_assuj' =>array('type'=>'tinyint(4)', 'label'=>'Localtax1 assuj', 'enabled'=>1, 'visible'=>-1, 'position'=>340),
|
||||
'localtax1_value' =>array('type'=>'double(6,3)', 'label'=>'Localtax1 value', 'enabled'=>1, 'visible'=>-1, 'position'=>345),
|
||||
'localtax2_assuj' =>array('type'=>'tinyint(4)', 'label'=>'Localtax2 assuj', 'enabled'=>1, 'visible'=>-1, 'position'=>350),
|
||||
'localtax2_value' =>array('type'=>'double(6,3)', 'label'=>'Localtax2 value', 'enabled'=>1, 'visible'=>-1, 'position'=>355),
|
||||
'barcode' =>array('type'=>'varchar(255)', 'label'=>'Barcode', 'enabled'=>1, 'visible'=>-1, 'position'=>360),
|
||||
'price_level' =>array('type'=>'integer', 'label'=>'Price level', 'enabled'=>'$conf->global->PRODUIT_MULTIPRICES || $conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES', 'visible'=>-1, 'position'=>365),
|
||||
'default_lang' =>array('type'=>'varchar(6)', 'label'=>'Default lang', 'enabled'=>1, 'visible'=>-1, 'position'=>370),
|
||||
'canvas' =>array('type'=>'varchar(32)', 'label'=>'Canvas', 'enabled'=>1, 'visible'=>-1, 'position'=>375),
|
||||
'fk_barcode_type' =>array('type'=>'integer', 'label'=>'Fk barcode type', 'enabled'=>1, 'visible'=>-1, 'position'=>405),
|
||||
'webservices_url' =>array('type'=>'varchar(255)', 'label'=>'Webservices url', 'enabled'=>1, 'visible'=>-1, 'position'=>410),
|
||||
'webservices_key' =>array('type'=>'varchar(128)', 'label'=>'Webservices key', 'enabled'=>1, 'visible'=>-1, 'position'=>415),
|
||||
'fk_incoterms' =>array('type'=>'integer', 'label'=>'Fk incoterms', 'enabled'=>1, 'visible'=>-1, 'position'=>425),
|
||||
'location_incoterms' =>array('type'=>'varchar(255)', 'label'=>'Location incoterms', 'enabled'=>1, 'visible'=>-1, 'position'=>430),
|
||||
'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>435),
|
||||
'fk_multicurrency' =>array('type'=>'integer', 'label'=>'Fk multicurrency', 'enabled'=>1, 'visible'=>-1, 'position'=>440),
|
||||
'multicurrency_code' =>array('type'=>'varchar(255)', 'label'=>'Multicurrency code', 'enabled'=>1, 'visible'=>-1, 'position'=>445),
|
||||
'fk_account' =>array('type'=>'integer', 'label'=>'Fk account', 'enabled'=>1, 'visible'=>-1, 'position'=>450),
|
||||
'fk_entrepot' =>array('type'=>'integer', 'label'=>'Fk entrepot', 'enabled'=>1, 'visible'=>-1, 'position'=>455),
|
||||
'logo' =>array('type'=>'varchar(255)', 'label'=>'Logo', 'enabled'=>1, 'visible'=>-1, 'position'=>400),
|
||||
'logo_squarred' =>array('type'=>'varchar(255)', 'label'=>'Logo squarred', 'enabled'=>1, 'visible'=>-1, 'position'=>401),
|
||||
'status' =>array('type'=>'tinyint(4)', 'label'=>'Status', 'enabled'=>1, 'visible'=>-1, 'position'=>500),
|
||||
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>1000),
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* @var int Entity
|
||||
*/
|
||||
@ -801,7 +877,8 @@ class Societe extends CommonObject
|
||||
$contact->firstname = $this->firstname;
|
||||
$contact->civility_id = $this->civility_id;
|
||||
$contact->socid = $this->id; // fk_soc
|
||||
$contact->statut = 1;
|
||||
$contact->statut = 1; // deprecated
|
||||
$contact->status = 1;
|
||||
$contact->priv = 0;
|
||||
$contact->country_id = $this->country_id;
|
||||
$contact->state_id = $this->state_id;
|
||||
@ -2003,7 +2080,7 @@ class Societe extends CommonObject
|
||||
|
||||
$reparray = array();
|
||||
|
||||
$sql = "SELECT DISTINCT u.rowid, u.login, u.lastname, u.firstname, u.office_phone, u.job, u.email, u.statut, u.entity, u.photo";
|
||||
$sql = "SELECT DISTINCT u.rowid, u.login, u.lastname, u.firstname, u.office_phone, u.job, u.email, u.statut as status, u.entity, u.photo";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc, ".MAIN_DB_PREFIX."user as u";
|
||||
if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))
|
||||
{
|
||||
@ -2034,7 +2111,8 @@ class Societe extends CommonObject
|
||||
$reparray[$i]['email'] = $obj->email;
|
||||
$reparray[$i]['phone'] = $obj->office_phone;
|
||||
$reparray[$i]['job'] = $obj->job;
|
||||
$reparray[$i]['statut'] = $obj->statut;
|
||||
$reparray[$i]['statut'] = $obj->status; // deprecated
|
||||
$reparray[$i]['status'] = $obj->status;
|
||||
$reparray[$i]['entity'] = $obj->entity;
|
||||
$reparray[$i]['login'] = $obj->login;
|
||||
$reparray[$i]['photo'] = $obj->photo;
|
||||
@ -2492,7 +2570,7 @@ class Societe extends CommonObject
|
||||
$contact_property = array();
|
||||
|
||||
|
||||
$sql = "SELECT rowid, email, statut, phone_mobile, lastname, poste, firstname";
|
||||
$sql = "SELECT rowid, email, statut as status, phone_mobile, lastname, poste, firstname";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople";
|
||||
$sql .= " WHERE fk_soc = ".$this->id;
|
||||
$sql .= " ORDER BY lastname, firstname";
|
||||
@ -2518,7 +2596,7 @@ class Societe extends CommonObject
|
||||
else $property = $obj->$mode;
|
||||
|
||||
// Show all contact. If hidedisabled is 1, showonly contacts with status = 1
|
||||
if ($obj->statut == 1 || empty($hidedisabled))
|
||||
if ($obj->status == 1 || empty($hidedisabled))
|
||||
{
|
||||
if (empty($property))
|
||||
{
|
||||
@ -3869,7 +3947,7 @@ class Societe extends CommonObject
|
||||
* @param int|string $status Id or code for prospection status
|
||||
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
|
||||
* @param string $label Label to use for status for added status
|
||||
* @return string Libelle du statut
|
||||
* @return string Label of prospection status
|
||||
*/
|
||||
public function LibProspCommStatut($status, $mode = 0, $label = '')
|
||||
{
|
||||
@ -3942,7 +4020,7 @@ class Societe extends CommonObject
|
||||
$table = 'propal';
|
||||
if ($mode == 'supplier') $table = 'supplier_proposal';
|
||||
|
||||
$sql = "SELECT rowid, total_ht, total as total_ttc, fk_statut FROM ".MAIN_DB_PREFIX.$table." as f";
|
||||
$sql = "SELECT rowid, total_ht, total as total_ttc, fk_statut as status FROM ".MAIN_DB_PREFIX.$table." as f";
|
||||
$sql .= " WHERE fk_soc = ".$this->id;
|
||||
if ($mode == 'supplier') {
|
||||
$sql .= " AND entity IN (".getEntity('supplier_proposal').")";
|
||||
@ -3960,7 +4038,7 @@ class Societe extends CommonObject
|
||||
while ($obj = $this->db->fetch_object($resql)) {
|
||||
$outstandingTotal += $obj->total_ht;
|
||||
$outstandingTotalIncTax += $obj->total_ttc;
|
||||
if ($obj->fk_statut != 0) // Not a draft
|
||||
if ($obj->status != 0) // Not a draft
|
||||
{
|
||||
$outstandingOpened += $obj->total_ttc;
|
||||
}
|
||||
@ -3982,7 +4060,7 @@ class Societe extends CommonObject
|
||||
$table = 'commande';
|
||||
if ($mode == 'supplier') $table = 'commande_fournisseur';
|
||||
|
||||
$sql = "SELECT rowid, total_ht, total_ttc, fk_statut FROM ".MAIN_DB_PREFIX.$table." as f";
|
||||
$sql = "SELECT rowid, total_ht, total_ttc, fk_statut as status FROM ".MAIN_DB_PREFIX.$table." as f";
|
||||
$sql .= " WHERE fk_soc = ".$this->id;
|
||||
if ($mode == 'supplier') {
|
||||
$sql .= " AND entity IN (".getEntity('supplier_order').")";
|
||||
@ -4000,7 +4078,7 @@ class Societe extends CommonObject
|
||||
while ($obj = $this->db->fetch_object($resql)) {
|
||||
$outstandingTotal += $obj->total_ht;
|
||||
$outstandingTotalIncTax += $obj->total_ttc;
|
||||
if ($obj->fk_statut != 0) // Not a draft
|
||||
if ($obj->status != 0) // Not a draft
|
||||
{
|
||||
$outstandingOpened += $obj->total_ttc;
|
||||
}
|
||||
@ -4029,8 +4107,8 @@ class Societe extends CommonObject
|
||||
$alreadypayed=price2num($paiement + $creditnotes + $deposits,'MT');
|
||||
$remaintopay=price2num($invoice->total_ttc - $paiement - $creditnotes - $deposits,'MT');
|
||||
*/
|
||||
if ($mode == 'supplier') $sql = "SELECT rowid, total_ht as total_ht, total_ttc, paye, type, fk_statut, close_code FROM ".MAIN_DB_PREFIX.$table." as f";
|
||||
else $sql = "SELECT rowid, total as total_ht, total_ttc, paye, fk_statut, close_code FROM ".MAIN_DB_PREFIX.$table." as f";
|
||||
if ($mode == 'supplier') $sql = "SELECT rowid, total_ht as total_ht, total_ttc, paye, type, fk_statut as status, close_code FROM ".MAIN_DB_PREFIX.$table." as f";
|
||||
else $sql = "SELECT rowid, total as total_ht, total_ttc, paye, fk_statut as status, close_code FROM ".MAIN_DB_PREFIX.$table." as f";
|
||||
$sql .= " WHERE fk_soc = ".$this->id;
|
||||
if ($mode == 'supplier') {
|
||||
$sql .= " AND entity IN (".getEntity('facture_fourn').")";
|
||||
@ -4058,18 +4136,18 @@ class Societe extends CommonObject
|
||||
while ($obj = $this->db->fetch_object($resql)) {
|
||||
$tmpobject->id = $obj->rowid;
|
||||
|
||||
if ($obj->fk_statut != $tmpobject::STATUS_DRAFT // Not a draft
|
||||
&& !($obj->fk_statut == $tmpobject::STATUS_ABANDONED && $obj->close_code == 'replaced') // Not a replaced invoice
|
||||
if ($obj->status != $tmpobject::STATUS_DRAFT // Not a draft
|
||||
&& !($obj->status == $tmpobject::STATUS_ABANDONED && $obj->close_code == 'replaced') // Not a replaced invoice
|
||||
)
|
||||
{
|
||||
$outstandingTotal += $obj->total_ht;
|
||||
$outstandingTotalIncTax += $obj->total_ttc;
|
||||
}
|
||||
if ($obj->paye == 0
|
||||
&& $obj->fk_statut != $tmpobject::STATUS_DRAFT // Not a draft
|
||||
&& $obj->fk_statut != $tmpobject::STATUS_ABANDONED // Not abandonned
|
||||
&& $obj->fk_statut != $tmpobject::STATUS_CLOSED) // Not classified as paid
|
||||
//$sql .= " AND (fk_statut <> 3 OR close_code <> 'abandon')"; // Not abandonned for undefined reason
|
||||
&& $obj->status != $tmpobject::STATUS_DRAFT // Not a draft
|
||||
&& $obj->status != $tmpobject::STATUS_ABANDONED // Not abandonned
|
||||
&& $obj->status != $tmpobject::STATUS_CLOSED) // Not classified as paid
|
||||
//$sql .= " AND (status <> 3 OR close_code <> 'abandon')"; // Not abandonned for undefined reason
|
||||
{
|
||||
$paiement = $tmpobject->getSommePaiement();
|
||||
$creditnotes = $tmpobject->getSumCreditNotesUsed();
|
||||
@ -4107,8 +4185,8 @@ class Societe extends CommonObject
|
||||
/**
|
||||
* Return the label of the customer/prospect status
|
||||
*
|
||||
* @param int $status Id statut
|
||||
* @return string Libelle du statut
|
||||
* @param int $status Id of prospection status
|
||||
* @return string Label of prospection status
|
||||
*/
|
||||
public function LibCustProspStatut($status)
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user