Standardize and update code

This commit is contained in:
Philippe GRAND 2018-09-02 11:08:41 +02:00
parent c4f05aff28
commit 3de16a145e
16 changed files with 226 additions and 126 deletions

View File

@ -55,6 +55,9 @@ class Propal extends CommonObject
*/ */
public $table_element='propal'; public $table_element='propal';
/**
* @var int Name of subtable line
*/
public $table_element_line='propaldet'; public $table_element_line='propaldet';
/** /**

View File

@ -52,7 +52,11 @@ class Commande extends CommonOrder
*/ */
public $table_element='commande'; public $table_element='commande';
/**
* @var int Name of subtable line
*/
public $table_element_line = 'commandedet'; public $table_element_line = 'commandedet';
public $class_element_line = 'OrderLine'; public $class_element_line = 'OrderLine';
/** /**
@ -61,11 +65,13 @@ class Commande extends CommonOrder
public $fk_element = 'fk_commande'; public $fk_element = 'fk_commande';
public $picto = 'order'; public $picto = 'order';
/** /**
* 0=No test on entity, 1=Test with field entity, 2=Test with link by societe * 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
* @var int * @var int
*/ */
public $ismultientitymanaged = 1; public $ismultientitymanaged = 1;
/** /**
* 0=Default, 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user * 0=Default, 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user
* @var integer * @var integer
@ -92,6 +98,7 @@ class Commande extends CommonOrder
* @var int * @var int
*/ */
public $statut; public $statut;
/** /**
* Billed * Billed
* @var int * @var int
@ -114,21 +121,25 @@ class Commande extends CommonOrder
* @var int * @var int
*/ */
public $mode_reglement_id; public $mode_reglement_id;
/** /**
* Payment mode code * Payment mode code
* @var string * @var string
*/ */
public $mode_reglement_code; public $mode_reglement_code;
/** /**
* Availability delivery time id * Availability delivery time id
* @var int * @var int
*/ */
public $availability_id; public $availability_id;
/** /**
* Availability delivery time code * Availability delivery time code
* @var string * @var string
*/ */
public $availability_code; public $availability_code;
/** /**
* Label of availability delivery time. Use it in case translation cannot be found. * Label of availability delivery time. Use it in case translation cannot be found.
* @var string * @var string
@ -138,11 +149,13 @@ class Commande extends CommonOrder
public $demand_reason_id; // Source reason. Why we receive order (after a phone campaign, ...) public $demand_reason_id; // Source reason. Why we receive order (after a phone campaign, ...)
public $demand_reason_code; public $demand_reason_code;
public $date; // Date commande public $date; // Date commande
/** /**
* @deprecated * @deprecated
* @see date * @see date
*/ */
public $date_commande; public $date_commande;
public $date_livraison; // Date expected of shipment (date starting shipment, not the reception that occurs some days after) public $date_livraison; // Date expected of shipment (date starting shipment, not the reception that occurs some days after)
public $fk_remise_except; public $fk_remise_except;
public $remise_percent; public $remise_percent;

View File

@ -41,6 +41,9 @@ class Deplacement extends CommonObject
*/ */
public $table_element='deplacement'; public $table_element='deplacement';
/**
* @var int Name of subtable line
*/
public $table_element_line = ''; public $table_element_line = '';
/** /**
@ -50,22 +53,22 @@ class Deplacement extends CommonObject
public $ismultientitymanaged = 0; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe public $ismultientitymanaged = 0; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
var $datec; // Creation date public $datec; // Creation date
var $dated; public $dated;
var $fk_user_author; public $fk_user_author;
/** /**
* @var int User ID * @var int User ID
*/ */
public $fk_user; public $fk_user;
var $km; public $km;
var $socid; public $socid;
var $statut; // 0=draft, 1=validated public $statut; // 0=draft, 1=validated
var $extraparams=array(); public $extraparams=array();
var $statuts=array(); public $statuts=array();
var $statuts_short=array(); public $statuts_short=array();
/** /**
* Constructor * Constructor

View File

@ -49,6 +49,9 @@ class FactureRec extends CommonInvoice
*/ */
public $table_element='facture_rec'; public $table_element='facture_rec';
/**
* @var int Name of subtable line
*/
public $table_element_line='facturedet_rec'; public $table_element_line='facturedet_rec';
/** /**
@ -58,30 +61,30 @@ class FactureRec extends CommonInvoice
public $picto='bill'; public $picto='bill';
var $entity; public $entity;
var $number; public $number;
var $date; public $date;
var $amount; public $amount;
var $remise; public $remise;
var $tva; public $tva;
var $total; public $total;
var $db_table; public $db_table;
var $propalid; public $propalid;
var $date_last_gen; public $date_last_gen;
var $date_when; public $date_when;
var $nb_gen_done; public $nb_gen_done;
var $nb_gen_max; public $nb_gen_max;
var $frequency; public $frequency;
var $unit_frequency; public $unit_frequency;
var $rang; public $rang;
var $special_code; public $special_code;
var $usenewprice=0; public $usenewprice=0;
var $suspended; // status public $suspended; // status
const STATUS_NOTSUSPENDED = 0; const STATUS_NOTSUSPENDED = 0;
const STATUS_SUSPENDED = 1; const STATUS_SUSPENDED = 1;

View File

@ -63,6 +63,9 @@ class Facture extends CommonInvoice
*/ */
public $table_element='facture'; public $table_element='facture';
/**
* @var int Name of subtable line
*/
public $table_element_line = 'facturedet'; public $table_element_line = 'facturedet';
/** /**
@ -71,11 +74,13 @@ class Facture extends CommonInvoice
public $fk_element = 'fk_facture'; public $fk_element = 'fk_facture';
public $picto='bill'; public $picto='bill';
/** /**
* 0=No test on entity, 1=Test with field entity, 2=Test with link by societe * 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
* @var int * @var int
*/ */
public $ismultientitymanaged = 1; public $ismultientitymanaged = 1;
/** /**
* 0=Default, 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user * 0=Default, 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user
* @var integer * @var integer
@ -125,14 +130,17 @@ class Facture extends CommonInvoice
public $cond_reglement_code; // Code in llx_c_paiement public $cond_reglement_code; // Code in llx_c_paiement
public $mode_reglement_code; // Code in llx_c_paiement public $mode_reglement_code; // Code in llx_c_paiement
public $fk_bank; // Field to store bank id to use when payment mode is withdraw public $fk_bank; // Field to store bank id to use when payment mode is withdraw
/** /**
* @deprecated * @deprecated
*/ */
public $products=array(); public $products=array();
/** /**
* @var FactureLigne[] * @var FactureLigne[]
*/ */
public $lines=array(); public $lines=array();
public $line; public $line;
public $extraparams=array(); public $extraparams=array();
public $specimen; public $specimen;

View File

@ -51,6 +51,9 @@ class Contrat extends CommonObject
*/ */
public $table_element='contrat'; public $table_element='contrat';
/**
* @var int Name of subtable line
*/
public $table_element_line='contratdet'; public $table_element_line='contratdet';
/** /**

View File

@ -73,9 +73,9 @@ abstract class CommonObject
public $table_element; public $table_element;
/** /**
* @var * @var int Name of subtable line
*/ */
public $table_element_line; public $table_element_line='';
/** /**
* @var string Key value used to track if data is coming from import wizard * @var string Key value used to track if data is coming from import wizard
@ -168,6 +168,7 @@ abstract class CommonObject
* @see fetch_origin() * @see fetch_origin()
*/ */
public $origin; public $origin;
/** /**
* @var int The id of originating object * @var int The id of originating object
* @see fetch_origin() * @see fetch_origin()
@ -6175,7 +6176,7 @@ abstract class CommonObject
{ {
//Show only the key field in params //Show only the key field in params
if (is_array($params) && array_key_exists('onlykey',$params) && $key != $params['onlykey']) continue; if (is_array($params) && array_key_exists('onlykey',$params) && $key != $params['onlykey']) continue;
$enabled = 1; $enabled = 1;
if ($enabled && isset($extrafields->attributes[$this->table_element]['list'][$key])) if ($enabled && isset($extrafields->attributes[$this->table_element]['list'][$key]))
{ {

View File

@ -38,6 +38,9 @@ class Fiscalyear extends CommonObject
*/ */
public $table_element='accounting_fiscalyear'; public $table_element='accounting_fiscalyear';
/**
* @var int Name of subtable line
*/
public $table_element_line = ''; public $table_element_line = '';
/** /**

View File

@ -48,61 +48,69 @@ class Expedition extends CommonObject
* @var string ID to identify managed object * @var string ID to identify managed object
*/ */
public $element="shipping"; public $element="shipping";
public $fk_element="fk_expedition"; public $fk_element="fk_expedition";
/** /**
* @var string Name of table without prefix where object is stored * @var string Name of table without prefix where object is stored
*/ */
public $table_element="expedition"; public $table_element="expedition";
/**
* @var int Name of subtable line
*/
public $table_element_line="expeditiondet"; public $table_element_line="expeditiondet";
public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
public $picto = 'sending'; public $picto = 'sending';
var $socid; public $socid;
var $ref_customer; public $ref_customer;
var $ref_int; public $ref_int;
var $brouillon; public $brouillon;
var $entrepot_id; public $entrepot_id;
var $lines=array(); public $lines=array();
var $tracking_number; public $tracking_number;
var $tracking_url; public $tracking_url;
var $billed; public $billed;
var $model_pdf; public $model_pdf;
var $trueWeight; public $trueWeight;
var $weight_units; public $weight_units;
var $trueWidth; public $trueWidth;
var $width_units; public $width_units;
var $trueHeight; public $trueHeight;
var $height_units; public $height_units;
var $trueDepth; public $trueDepth;
var $depth_units; public $depth_units;
// A denormalized value // A denormalized value
var $trueSize; public $trueSize;
public $date_delivery; // Date delivery planed
var $date_delivery; // Date delivery planed
/** /**
* @deprecated * @deprecated
* @see date_shipping * @see date_shipping
*/ */
var $date; public $date;
/** /**
* @deprecated * @deprecated
* @see date_shipping * @see date_shipping
*/ */
var $date_expedition; public $date_expedition;
/** /**
* Effective delivery date * Effective delivery date
* @var int * @var int
*/ */
public $date_shipping; public $date_shipping;
var $date_creation;
var $date_valid;
var $meths; public $date_creation;
var $listmeths; // List of carriers public $date_valid;
public $meths;
public $listmeths; // List of carriers
const STATUS_DRAFT = 0; const STATUS_DRAFT = 0;
@ -478,7 +486,7 @@ class Expedition extends CommonObject
$sql.= ", e.note_private, e.note_public"; $sql.= ", e.note_private, e.note_public";
$sql.= ', e.fk_incoterms, e.location_incoterms'; $sql.= ', e.fk_incoterms, e.location_incoterms';
$sql.= ', i.libelle as libelle_incoterms'; $sql.= ', i.libelle as libelle_incoterms';
$sql.= ', s.libelle as shipping_method'; $sql.= ', s.libelle as shipping_method';
$sql.= ", el.fk_source as origin_id, el.sourcetype as origin"; $sql.= ", el.fk_source as origin_id, el.sourcetype as origin";
$sql.= " FROM ".MAIN_DB_PREFIX."expedition as e"; $sql.= " FROM ".MAIN_DB_PREFIX."expedition as e";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as el ON el.fk_target = e.rowid AND el.targettype = '".$this->db->escape($this->element)."'"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as el ON el.fk_target = e.rowid AND el.targettype = '".$this->db->escape($this->element)."'";
@ -2293,7 +2301,7 @@ class ExpeditionLigne extends CommonObjectLine
* @var string ID to identify managed object * @var string ID to identify managed object
*/ */
public $element='expeditiondet'; public $element='expeditiondet';
/** /**
* @var string Name of table without prefix where object is stored * @var string Name of table without prefix where object is stored
*/ */

View File

@ -50,7 +50,11 @@ class Fichinter extends CommonObject
*/ */
public $fk_element='fk_fichinter'; public $fk_element='fk_fichinter';
/**
* @var int Name of subtable line
*/
public $table_element_line='fichinterdet'; public $table_element_line='fichinterdet';
public $picto = 'intervention'; public $picto = 'intervention';
/** /**
@ -85,14 +89,17 @@ class Fichinter extends CommonObject
* Draft status * Draft status
*/ */
const STATUS_DRAFT = 0; const STATUS_DRAFT = 0;
/** /**
* Validated status * Validated status
*/ */
const STATUS_VALIDATED = 1; const STATUS_VALIDATED = 1;
/** /**
* Billed * Billed
*/ */
const STATUS_BILLED = 2; const STATUS_BILLED = 2;
/** /**
* Closed * Closed
*/ */

View File

@ -4,11 +4,11 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be> * Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2016 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2010-2018 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2012-2015 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2012-2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr> * Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com> * Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -50,7 +50,10 @@ class CommandeFournisseur extends CommonOrder
*/ */
public $table_element='commande_fournisseur'; public $table_element='commande_fournisseur';
public $table_element_line = 'commande_fournisseurdet'; /**
* @var int Name of subtable line
*/
public $table_element_line = 'commande_fournisseurdet';
/** /**
* @var int Field with ID of parent key if this field has a parent * @var int Field with ID of parent key if this field has a parent
@ -108,17 +111,20 @@ class CommandeFournisseur extends CommonOrder
* Delivery date * Delivery date
*/ */
public $date_livraison; public $date_livraison;
public $total_ht; public $total_ht;
public $total_tva; public $total_tva;
public $total_localtax1; // Total Local tax 1 public $total_localtax1; // Total Local tax 1
public $total_localtax2; // Total Local tax 2 public $total_localtax2; // Total Local tax 2
public $total_ttc; public $total_ttc;
public $source; public $source;
/** /**
* @deprecated * @deprecated
* @see note_private, note_public * @see note_private, note_public
*/ */
public $note; public $note;
public $note_private; public $note_private;
public $note_public; public $note_public;
public $model_pdf; public $model_pdf;
@ -144,6 +150,7 @@ class CommandeFournisseur extends CommonOrder
* @var CommandeFournisseurLigne[] * @var CommandeFournisseurLigne[]
*/ */
public $lines = array(); public $lines = array();
//Add for supplier_proposal //Add for supplier_proposal
public $origin; public $origin;
public $origin_id; public $origin_id;
@ -161,34 +168,42 @@ class CommandeFournisseur extends CommonOrder
* Draft status * Draft status
*/ */
const STATUS_DRAFT = 0; const STATUS_DRAFT = 0;
/** /**
* Validated status * Validated status
*/ */
const STATUS_VALIDATED = 1; const STATUS_VALIDATED = 1;
/** /**
* Accepted * Accepted
*/ */
const STATUS_ACCEPTED = 2; const STATUS_ACCEPTED = 2;
/** /**
* Order sent, shipment on process * Order sent, shipment on process
*/ */
const STATUS_ORDERSENT = 3; const STATUS_ORDERSENT = 3;
/** /**
* Received partially * Received partially
*/ */
const STATUS_RECEIVED_PARTIALLY = 4; const STATUS_RECEIVED_PARTIALLY = 4;
/** /**
* Received completely * Received completely
*/ */
const STATUS_RECEIVED_COMPLETELY = 5; const STATUS_RECEIVED_COMPLETELY = 5;
/** /**
* Order canceled * Order canceled
*/ */
const STATUS_CANCELED = 6; const STATUS_CANCELED = 6;
/** /**
* Order canceled/never received * Order canceled/never received
*/ */
const STATUS_CANCELED_AFTER_ORDER = 7; const STATUS_CANCELED_AFTER_ORDER = 7;
/** /**
* Refused * Refused
*/ */

View File

@ -5,7 +5,7 @@
* Copyright (C) 2005 Marc Barilley <marc@ocebo.com> * Copyright (C) 2005 Marc Barilley <marc@ocebo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2017 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2017 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2013-2018 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014-2016 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2014-2016 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Bahfir Abbes <bafbes@gmail.com> * Copyright (C) 2015 Bahfir Abbes <bafbes@gmail.com>
@ -51,7 +51,10 @@ class FactureFournisseur extends CommonInvoice
*/ */
public $table_element='facture_fourn'; public $table_element='facture_fourn';
public $table_element_line='facture_fourn_det'; /**
* @var int Name of subtable line
*/
public $table_element_line='facture_fourn_det';
/** /**
* @var int Field with ID of parent key if this field has a parent * @var int Field with ID of parent key if this field has a parent
@ -144,6 +147,7 @@ class FactureFournisseur extends CommonInvoice
* @var SupplierInvoiceLine[] * @var SupplierInvoiceLine[]
*/ */
public $lines = array(); public $lines = array();
/** /**
* @deprecated * @deprecated
*/ */

View File

@ -38,6 +38,9 @@ class Establishment extends CommonObject
*/ */
public $table_element='establishment'; public $table_element='establishment';
/**
* @var int Name of subtable line
*/
public $table_element_line = ''; public $table_element_line = '';
/** /**

View File

@ -3,8 +3,8 @@
* Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006-2007 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2006-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be> * Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
* Copyright (C) 2011-2018 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2011-2018 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -54,6 +54,9 @@ class Livraison extends CommonObject
*/ */
public $table_element="livraison"; public $table_element="livraison";
/**
* @var int Name of subtable line
*/
public $table_element_line="livraisondet"; public $table_element_line="livraisondet";
public $brouillon; public $brouillon;

View File

@ -43,7 +43,10 @@ class Project extends CommonObject
*/ */
public $table_element = 'projet'; public $table_element = 'projet';
public $table_element_line = 'projet_task'; /**
* @var int Name of subtable line
*/
public $table_element_line = 'projet_task';
/** /**
* @var int Field with ID of parent key if this field has a parent * @var int Field with ID of parent key if this field has a parent
@ -69,31 +72,32 @@ class Project extends CommonObject
* @see title * @see title
*/ */
public $titre; public $titre;
var $title;
var $date_start;
var $date_end;
var $date_close;
var $socid; // To store id of thirdparty public $title;
var $thirdparty_name; // To store name of thirdparty (defined only in some cases) public $date_start;
public $date_end;
public $date_close;
var $user_author_id; //!< Id of project creator. Not defined if shared project. public $socid; // To store id of thirdparty
var $user_close_id; public $thirdparty_name; // To store name of thirdparty (defined only in some cases)
var $public; //!< Tell if this is a public or private project
var $budget_amount;
var $bill_time; // Is the time spent on project must be invoiced or not
var $statuts_short; public $user_author_id; //!< Id of project creator. Not defined if shared project.
var $statuts_long; public $user_close_id;
public $public; //!< Tell if this is a public or private project
public $budget_amount;
public $bill_time; // Is the time spent on project must be invoiced or not
var $statut; // 0=draft, 1=opened, 2=closed public $statuts_short;
var $opp_status; // opportunity status, into table llx_c_lead_status public $statuts_long;
var $opp_percent; // opportunity probability
var $oldcopy; public $statut; // 0=draft, 1=opened, 2=closed
public $opp_status; // opportunity status, into table llx_c_lead_status
public $opp_percent; // opportunity probability
var $weekWorkLoad; // Used to store workload details of a projet public $oldcopy;
var $weekWorkLoadPerTask; // Used to store workload details of tasks of a projet
public $weekWorkLoad; // Used to store workload details of a projet
public $weekWorkLoadPerTask; // Used to store workload details of tasks of a projet
/** /**
* @var int Creation date * @var int Creation date
@ -101,16 +105,19 @@ class Project extends CommonObject
* @see date_c * @see date_c
*/ */
public $datec; public $datec;
/** /**
* @var int Creation date * @var int Creation date
*/ */
public $date_c; public $date_c;
/** /**
* @var int Modification date * @var int Modification date
* @deprecated * @deprecated
* @see date_m * @see date_m
*/ */
public $datem; public $datem;
/** /**
* @var int Modification date * @var int Modification date
*/ */
@ -125,10 +132,12 @@ class Project extends CommonObject
* Draft status * Draft status
*/ */
const STATUS_DRAFT = 0; const STATUS_DRAFT = 0;
/** /**
* Open/Validated status * Open/Validated status
*/ */
const STATUS_VALIDATED = 1; const STATUS_VALIDATED = 1;
/** /**
* Closed status * Closed status
*/ */

View File

@ -7,7 +7,7 @@
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr> * Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
* Copyright (C) 2010-2015 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2011 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2010-2018 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2012-2014 Christophe Battarel <christophe.battarel@altairis.fr> * Copyright (C) 2012-2014 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
@ -55,14 +55,21 @@ class SupplierProposal extends CommonObject
*/ */
public $table_element='supplier_proposal'; public $table_element='supplier_proposal';
public $table_element_line='supplier_proposaldet'; /**
* @var int Name of subtable line
*/
public $table_element_line='supplier_proposaldet';
public $fk_element='fk_supplier_proposal'; public $fk_element='fk_supplier_proposal';
public $picto='propal'; public $picto='propal';
/** /**
* 0=No test on entity, 1=Test with field entity, 2=Test with link by societe * 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
* @var int * @var int
*/ */
public $ismultientitymanaged = 1; public $ismultientitymanaged = 1;
/** /**
* 0=Default, 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user * 0=Default, 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user
* @var integer * @var integer
@ -74,24 +81,25 @@ class SupplierProposal extends CommonObject
*/ */
protected $table_ref_field = 'ref'; protected $table_ref_field = 'ref';
var $socid; // Id client public $socid; // Id client
/** /**
* @deprecated * @deprecated
* @see user_author_id * @see user_author_id
*/ */
var $author; public $author;
var $ref_fourn; //Reference saisie lors de l'ajout d'une ligne à la demande
var $ref_supplier; //Reference saisie lors de l'ajout d'une ligne à la demande public $ref_fourn; //Reference saisie lors de l'ajout d'une ligne à la demande
var $statut; // 0 (draft), 1 (validated), 2 (signed), 3 (not signed), 4 (processed/billed) public $ref_supplier; //Reference saisie lors de l'ajout d'une ligne à la demande
var $date; // Date of proposal public $statut; // 0 (draft), 1 (validated), 2 (signed), 3 (not signed), 4 (processed/billed)
var $date_livraison; public $date; // Date of proposal
public $date_livraison;
/** /**
* @deprecated * @deprecated
* @see date_creation * @see date_creation
*/ */
var $datec; public $datec;
/** /**
* Creation date * Creation date
@ -103,7 +111,7 @@ class SupplierProposal extends CommonObject
* @deprecated * @deprecated
* @see date_validation * @see date_validation
*/ */
var $datev; public $datev;
/** /**
* Validation date * Validation date
@ -112,70 +120,76 @@ class SupplierProposal extends CommonObject
public $date_validation; public $date_validation;
var $user_author_id; public $user_author_id;
var $user_valid_id; public $user_valid_id;
var $user_close_id; public $user_close_id;
/** /**
* @deprecated * @deprecated
* @see price_ht * @see price_ht
*/ */
var $price; public $price;
/** /**
* @deprecated * @deprecated
* @see total_tva * @see total_tva
*/ */
var $tva; public $tva;
/** /**
* @deprecated * @deprecated
* @see total_ttc * @see total_ttc
*/ */
var $total; public $total;
var $cond_reglement_code; public $cond_reglement_code;
var $mode_reglement_code; public $mode_reglement_code;
var $remise = 0; public $remise = 0;
var $remise_percent = 0; public $remise_percent = 0;
var $remise_absolue = 0; public $remise_absolue = 0;
var $products=array(); public $products=array();
var $extraparams=array(); public $extraparams=array();
var $lines = array(); public $lines = array();
var $line; public $line;
var $labelstatut=array(); public $labelstatut=array();
var $labelstatut_short=array(); public $labelstatut_short=array();
var $nbtodo; public $nbtodo;
var $nbtodolate; public $nbtodolate;
var $specimen; public $specimen;
// Multicurrency // Multicurrency
var $fk_multicurrency; public $fk_multicurrency;
var $multicurrency_code; public $multicurrency_code;
var $multicurrency_tx; public $multicurrency_tx;
var $multicurrency_total_ht; public $multicurrency_total_ht;
var $multicurrency_total_tva; public $multicurrency_total_tva;
var $multicurrency_total_ttc; public $multicurrency_total_ttc;
/** /**
* Draft status * Draft status
*/ */
const STATUS_DRAFT = 0; const STATUS_DRAFT = 0;
/** /**
* Validated status * Validated status
*/ */
const STATUS_VALIDATED = 1; const STATUS_VALIDATED = 1;
/** /**
* Signed quote * Signed quote
*/ */
const STATUS_SIGNED = 2; const STATUS_SIGNED = 2;
/** /**
* Not signed quote, canceled * Not signed quote, canceled
*/ */
const STATUS_NOTSIGNED = 3; const STATUS_NOTSIGNED = 3;
/** /**
* Billed or closed/processed quote * Billed or closed/processed quote
*/ */