e-invoice : add the quantity , unitCode : UN/ECE

This commit is contained in:
sparkyx 2025-08-01 23:37:52 +02:00
parent 59e1d9b040
commit d3e038bce0
3 changed files with 37 additions and 0 deletions

View file

@ -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');

View file

@ -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);

View file

@ -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');