diff --git a/include/class/card_property.class.php b/include/class/card_property.class.php index 0472d9758..c40c21d3e 100644 --- a/include/class/card_property.class.php +++ b/include/class/card_property.class.php @@ -201,6 +201,12 @@ class Card_Property $result['input']=new IVATNumber( "av_text" . $this->ad_id,$this->av_text); $result['label']=$this->ad_text; return $result; + }elseif ( $this->ad_id == ATTR_DEF_QUANTITY_TYPE){ + $result['input']=new IText( "av_text" . $this->ad_id,$this->av_text); + $array=$this->cn->get_array("select qc_code,format('%s %s',qc_code,qc_label) label from quantity_code_ref order by qc_label",p_mode: PGSQL_NUM); + $result['input']->set_datalist($array); + $result['label']=$this->ad_text; + return $result; } elseif ($this->ad_id == ATTR_DEF_TVA) { $result['input'] = new ITva_Popup('popup_tva'); diff --git a/include/constant.php b/include/constant.php index dd3f5453f..ee210f115 100644 --- a/include/constant.php +++ b/include/constant.php @@ -249,6 +249,7 @@ define('ATTR_DEF_SIREN', 55); define('ATTR_DEF_SIRET', 56); define('ATTR_DEF_COUNTRY_CODE', 57); define('ATTR_DEF_PEPPOLID', 58); +define('ATTR_DEF_QUANTITY_TYPE', 59); define("FICHE_TYPE_CLIENT", 9); define("FICHE_TYPE_VENTE", 1); diff --git a/sql/upgrade.sql b/sql/upgrade.sql index 50aa9df51..9ffde47cd 100644 --- a/sql/upgrade.sql +++ b/sql/upgrade.sql @@ -20,6 +20,7 @@ insert into attr_def (ad_id,ad_text,ad_type,ad_size,ad_search_followup,ad_defaul insert into attr_def (ad_id,ad_text,ad_type,ad_size,ad_search_followup,ad_default_order) values(56,'SIRET','text',20,1,15); insert into attr_def (ad_id,ad_text,ad_type,ad_size,ad_search_followup,ad_default_order) values(58,'PEPPOL ID','text',20,1,15); +insert into attr_def (ad_id,ad_text,ad_type,ad_size,ad_search_followup,ad_default_order) values(59,'Type de quantité','text',20,1,15); create table country_code_ref( cc_code char(2) primary key, @@ -260,3 +261,32 @@ AS SELECT tva_id, tva_peppol_code FROM tva_rate; +create table quantity_code_ref( + qc_code text not null primary key, + qc_label text not null +); +insert into quantity_code_ref values +('EA','Each — unité pièce'), +('C62','unité'), +('ANN','Année'), +('MON','Mois'), +('DAY','Day — jour'), +('HUR','Hour — heure'), +('MIN','Minute — minute'), +('SEC','Second — seconde'), +('KG','Kilogram — kilogramme'), +('G','Gram — gramme'), +('LB ','Pound (pound) — livre'), +('LTR','Liter — litre'), +('MTR','Meter — mètre'), +('CM','Centimeter — centimètre'), +('MM','Millimeter — millimètre'), +('PK','Paket — paquet'), +('BX','Box — boîte'), +('PR','Pair — paire'), +('PC','Piece (pièce)'), +('LOT','Lot — lot'), +('SET','Set — ensemble'), +('ROLL','Roll — rouleau'), +('COLL','Collection — collection'); +