diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php
index 5bdb99330f6..350713ca17e 100644
--- a/htdocs/adherents/card.php
+++ b/htdocs/adherents/card.php
@@ -1286,7 +1286,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print '';
// EMail
- print '
'; // Todo : remove .center by adding style to form-setup-button-container css class in all themes
$out.= $this->htmlOutputMoreButton;
$out .= ' '; // Todo fix dolibarr style for formAttributes['action'] . '">'.$langs->trans('Cancel').'';
$out .= '
';
}
@@ -283,8 +285,13 @@ class FormSetup
$out = '';
if ($item->enabled==1) {
+ $trClass = 'oddeven';
+ if ($item->getType() == 'title') {
+ $trClass = 'liste_titre';
+ }
+
$this->setupNotEmpty++;
- $out.= '';
$out.= '';
$out.= '';
@@ -579,6 +586,15 @@ class FormSetupItem
/** @var int $rank */
public $rank = 0;
+ /** @var array set this var for options on select and multiselect items */
+ public $fieldOptions = array();
+
+ /** @var callable $saveCallBack */
+ public $saveCallBack;
+
+ /** @var callable $setValueFromPostCallBack */
+ public $setValueFromPostCallBack;
+
/**
* @var string $errors
*/
@@ -636,6 +652,10 @@ class FormSetupItem
*/
public function saveConfValue()
{
+ if (!empty($this->saveCallBack) && is_callable($this->saveCallBack)) {
+ return call_user_func($this->saveCallBack);
+ }
+
// Modify constant only if key was posted (avoid resetting key to the null value)
if ($this->type != 'title') {
$result = dolibarr_set_const($this->db, $this->confKey, $this->fieldValue, 'chaine', 0, '', $this->entity);
@@ -647,6 +667,25 @@ class FormSetupItem
}
}
+ /**
+ * Set an override function for saving data
+ * @param callable $callBack a callable function
+ * @return void
+ */
+ public function setSaveCallBack(callable $callBack)
+ {
+ $this->saveCallBack = $callBack;
+ }
+
+ /**
+ * Set an override function for get data from post
+ * @param callable $callBack a callable function
+ * @return void
+ */
+ public function setValueFromPostCallBack(callable $callBack)
+ {
+ $this->setValueFromPostCallBack = $callBack;
+ }
/**
* Save const value based on htdocs/core/actions_setmoduleoptions.inc.php
@@ -654,6 +693,10 @@ class FormSetupItem
*/
public function setValueFromPost()
{
+ if (!empty($this->setValueFromPostCallBack) && is_callable($this->setValueFromPostCallBack)) {
+ return call_user_func($this->setValueFromPostCallBack);
+ }
+
// Modify constant only if key was posted (avoid resetting key to the null value)
if ($this->type != 'title') {
if (preg_match('/category:/', $this->type)) {
@@ -662,6 +705,13 @@ class FormSetupItem
} else {
$val_const = GETPOST($this->confKey, 'int');
}
+ } elseif ($this->type == 'multiselect') {
+ $val = GETPOST($this->confKey, 'array');
+ if ($val && is_array($val)) {
+ $val_const = implode(',', $val);
+ }
+ } elseif ($this->type == 'html') {
+ $val_const = GETPOST($this->confKey, 'restricthtml');
} else {
$val_const = GETPOST($this->confKey, 'alpha');
}
@@ -719,6 +769,10 @@ class FormSetupItem
if ($this->type == 'title') {
$out.= $this->generateOutputField(); // title have no input
+ } elseif ($this->type == 'multiselect') {
+ $out.= $this->generateInputFieldMultiSelect();
+ } elseif ($this->type == 'select') {
+ $out.= $this->generateInputFieldSelect();
} elseif ($this->type == 'textarea') {
$out.= $this->generateInputFieldTextarea();
} elseif ($this->type== 'html') {
@@ -851,6 +905,29 @@ class FormSetupItem
return $out;
}
+
+ /**
+ * @return string
+ */
+ public function generateInputFieldMultiSelect()
+ {
+ $TSelected = array();
+ if ($this->fieldValue) {
+ $TSelected = explode(',', $this->fieldValue);
+ }
+
+ return $this->form->multiselectarray($this->confKey, $this->fieldOptions, $TSelected, 0, 0, '', 0, 0, 'style="min-width:100px"');
+ }
+
+
+ /**
+ * @return string
+ */
+ public function generateInputFieldSelect()
+ {
+ return $this->form->selectarray($this->confKey, $this->fieldOptions, $this->fieldValue);
+ }
+
/**
* get the type : used for old module builder setup conf style conversion and tests
* because this two class will quickly evolve it's important to not set or get directly $this->type (will be protected) so this method exist
@@ -916,6 +993,10 @@ class FormSetupItem
// nothing to do
} elseif ($this->type == 'textarea') {
$out.= dol_nl2br($this->fieldValue);
+ } elseif ($this->type == 'multiselect') {
+ $out.= $this->generateOutputFieldMultiSelect();
+ } elseif ($this->type == 'select') {
+ $out.= $this->generateOutputFieldSelect();
} elseif ($this->type== 'html') {
$out.= $this->fieldValue;
} elseif ($this->type == 'yesno') {
@@ -969,6 +1050,41 @@ class FormSetupItem
}
+ /**
+ * @return string
+ */
+ public function generateOutputFieldMultiSelect()
+ {
+ $outPut = '';
+ $TSelected = array();
+ if (!empty($this->fieldValue)) {
+ $TSelected = explode(',', $this->fieldValue);
+ }
+
+ if (!empty($TSelected)) {
+ foreach ($TSelected as $selected) {
+ if (!empty($this->fieldOptions[$selected])) {
+ $outPut.= dolGetBadge('', $this->fieldOptions[$selected], 'info').' ';
+ }
+ }
+ }
+ return $outPut;
+ }
+
+
+ /**
+ * @return string
+ */
+ public function generateOutputFieldSelect()
+ {
+ $outPut = '';
+ if (!empty($this->fieldOptions[$this->fieldValue])) {
+ $outPut = $this->fieldOptions[$this->fieldValue];
+ }
+
+ return $outPut;
+ }
+
/*
* METHODS FOR SETTING DISPLAY TYPE
*/
@@ -1076,4 +1192,37 @@ class FormSetupItem
$this->type = 'title';
return $this;
}
+
+
+ /**
+ * Set type of input as a simple title
+ * no data to store
+ * @param array $fieldOptions A table of field options
+ * @return self
+ */
+ public function setAsMultiSelect($fieldOptions)
+ {
+ if (is_array($fieldOptions)) {
+ $this->fieldOptions = $fieldOptions;
+ }
+
+ $this->type = 'multiselect';
+ return $this;
+ }
+
+ /**
+ * Set type of input as a simple title
+ * no data to store
+ * @param array $fieldOptions A table of field options
+ * @return self
+ */
+ public function setAsSelect($fieldOptions)
+ {
+ if (is_array($fieldOptions)) {
+ $this->fieldOptions = $fieldOptions;
+ }
+
+ $this->type = 'select';
+ return $this;
+ }
}
diff --git a/htdocs/core/modules/modTicket.class.php b/htdocs/core/modules/modTicket.class.php
index fc7e72388ea..13967fc4096 100644
--- a/htdocs/core/modules/modTicket.class.php
+++ b/htdocs/core/modules/modTicket.class.php
@@ -134,10 +134,10 @@ class modTicket extends DolibarrModules
$this->dictionaries = array(
'langs' => 'ticket',
'tabname' => array(
- MAIN_DB_PREFIX."c_ticket_type",
- MAIN_DB_PREFIX."c_ticket_severity",
- MAIN_DB_PREFIX."c_ticket_category",
- MAIN_DB_PREFIX."c_ticket_resolution"
+ "c_ticket_type",
+ "c_ticket_severity",
+ "c_ticket_category",
+ "c_ticket_resolution"
),
'tablib' => array(
"TicketDictType",
diff --git a/htdocs/fourn/class/api_supplier_invoices.class.php b/htdocs/fourn/class/api_supplier_invoices.class.php
index 35e783729ff..154da0dce93 100644
--- a/htdocs/fourn/class/api_supplier_invoices.class.php
+++ b/htdocs/fourn/class/api_supplier_invoices.class.php
@@ -647,7 +647,8 @@ class SupplierInvoices extends DolibarrApi
$request_data->array_options,
$request_data->fk_unit,
$request_data->multicurrency_subprice,
- $request_data->ref_supplier
+ $request_data->ref_supplier,
+ $request_data->rang
);
if ($updateRes > 0) {
diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php
index 94f66f0d0b3..52d9b19bfaf 100644
--- a/htdocs/fourn/class/fournisseur.facture.class.php
+++ b/htdocs/fourn/class/fournisseur.facture.class.php
@@ -2277,9 +2277,10 @@ class FactureFournisseur extends CommonInvoice
* @param string $fk_unit Code of the unit to use. Null to use the default one
* @param double $pu_devise Amount in currency
* @param string $ref_supplier Supplier ref
+ * @param integer $rang line rank
* @return int <0 if KO, >0 if OK
*/
- public function updateline($id, $desc, $pu, $vatrate, $txlocaltax1 = 0, $txlocaltax2 = 0, $qty = 1, $idproduct = 0, $price_base_type = 'HT', $info_bits = 0, $type = 0, $remise_percent = 0, $notrigger = false, $date_start = '', $date_end = '', $array_options = 0, $fk_unit = null, $pu_devise = 0, $ref_supplier = '')
+ public function updateline($id, $desc, $pu, $vatrate, $txlocaltax1 = 0, $txlocaltax2 = 0, $qty = 1, $idproduct = 0, $price_base_type = 'HT', $info_bits = 0, $type = 0, $remise_percent = 0, $notrigger = false, $date_start = '', $date_end = '', $array_options = 0, $fk_unit = null, $pu_devise = 0, $ref_supplier = '', $rang = 0)
{
global $mysoc, $langs;
@@ -2401,6 +2402,7 @@ class FactureFournisseur extends CommonInvoice
$line->product_type = $product_type;
$line->info_bits = $info_bits;
$line->fk_unit = $fk_unit;
+ $line->rang = $rang;
if (is_array($array_options) && count($array_options) > 0) {
// We replace values in this->line->array_options only for entries defined into $array_options
@@ -3686,6 +3688,10 @@ class SupplierInvoiceLine extends CommonObjectLine
$sql .= ", info_bits = ".((int) $this->info_bits);
$sql .= ", fk_unit = ".($fk_unit > 0 ? (int) $fk_unit : 'null');
+ if (!empty($this->rang)) {
+ $sql .= ", rang=".((int) $this->rang);
+ }
+
// Multicurrency
$sql .= " , multicurrency_subprice=".price2num($this->multicurrency_subprice)."";
$sql .= " , multicurrency_total_ht=".price2num($this->multicurrency_total_ht)."";
diff --git a/htdocs/install/mysql/data/llx_10_c_regions.sql b/htdocs/install/mysql/data/llx_10_c_regions.sql
index 368b6d9dccf..1ab671f085e 100644
--- a/htdocs/install/mysql/data/llx_10_c_regions.sql
+++ b/htdocs/install/mysql/data/llx_10_c_regions.sql
@@ -512,3 +512,25 @@ INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 2
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 232, 23208, '', 0, 'Nor-Oriental');
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 232, 23209, '', 0, 'Zuliana');
+
+
+-- Burundi Regions (id country=61) -- https://fr.wikipedia.org/wiki/Provinces_du_Burundi
+INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES ( 61, 6101, '', 0, "Bubanza");
+INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES ( 61, 6102, '', 0, "Bujumbura Mairie");
+INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES ( 61, 6103, '', 0, "Bujumbura Rural");
+INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES ( 61, 6104, '', 0, "Bururi");
+INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES ( 61, 6105, '', 0, "Cankuzo");
+INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES ( 61, 6106, '', 0, "Cibitoke");
+INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES ( 61, 6107, '', 0, "Gitega");
+INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES ( 61, 6108, '', 0, "Karuzi");
+INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES ( 61, 6109, '', 0, "Kayanza");
+INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES ( 61, 6110, '', 0, "Kirundo");
+INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES ( 61, 6111, '', 0, "Makamba");
+INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES ( 61, 6112, '', 0, "Muramvya");
+INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES ( 61, 6113, '', 0, "Muyinga");
+INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES ( 61, 6114, '', 0, "Mwaro");
+INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES ( 61, 6115, '', 0, "Ngozi");
+INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES ( 61, 6116, '', 0, "Rumonge");
+INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES ( 61, 6117, '', 0, "Rutana");
+INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES ( 61, 6118, '', 0, "Ruyigi");
+
diff --git a/htdocs/install/mysql/data/llx_20_c_departements.sql b/htdocs/install/mysql/data/llx_20_c_departements.sql
index a49d74b8a3a..6ccc22776f9 100644
--- a/htdocs/install/mysql/data/llx_20_c_departements.sql
+++ b/htdocs/install/mysql/data/llx_20_c_departements.sql
@@ -1759,6 +1759,127 @@ INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, nc
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('VE-S', 23209, '', 0, 'VE-S', 'Táchira', 1);
+-- Burundi Communes (id country=61) -- https://fr.wikipedia.org/wiki/Communes_du_Burundi
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6101, 'BI0001', '', 0, '', 'Bubanza');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6101, 'BI0002', '', 0, '', 'Gihanga');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6101, 'BI0003', '', 0, '', 'Musigati');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6101, 'BI0004', '', 0, '', 'Mpanda');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6101, 'BI0005', '', 0, '', 'Rugazi');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6102, 'BI0006', '', 0, '', 'Muha');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6102, 'BI0007', '', 0, '', 'Mukaza');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6102, 'BI0008', '', 0, '', 'Ntahangwa');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6103, 'BI0009', '', 0, '', 'Isale');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6103, 'BI0010', '', 0, '', 'Kabezi');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6103, 'BI0011', '', 0, '', 'Kanyosha');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6103, 'BI0012', '', 0, '', 'Mubimbi');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6103, 'BI0013', '', 0, '', 'Mugongomanga');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6103, 'BI0014', '', 0, '', 'Mukike');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6103, 'BI0015', '', 0, '', 'Mutambu');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6103, 'BI0016', '', 0, '', 'Mutimbuzi');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6103, 'BI0017', '', 0, '', 'Nyabiraba');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6104, 'BI0018', '', 0, '', 'Bururi');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6104, 'BI0019', '', 0, '', 'Matana');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6104, 'BI0020', '', 0, '', 'Mugamba');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6104, 'BI0021', '', 0, '', 'Rutovu');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6104, 'BI0022', '', 0, '', 'Songa');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6104, 'BI0023', '', 0, '', 'Vyanda');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6105, 'BI0024', '', 0, '', 'Cankuzo');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6105, 'BI0025', '', 0, '', 'Cendajuru');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6105, 'BI0026', '', 0, '', 'Gisagara');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6105, 'BI0027', '', 0, '', 'Kigamba');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6105, 'BI0028', '', 0, '', 'Mishiha');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6106, 'BI0029', '', 0, '', 'Buganda');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6106, 'BI0030', '', 0, '', 'Bukinanyana');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6106, 'BI0031', '', 0, '', 'Mabayi');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6106, 'BI0032', '', 0, '', 'Mugina');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6106, 'BI0033', '', 0, '', 'Murwi');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6106, 'BI0034', '', 0, '', 'Rugombo');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6107, 'BI0035', '', 0, '', 'Bugendana');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6107, 'BI0036', '', 0, '', 'Bukirasazi');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6107, 'BI0037', '', 0, '', 'Buraza');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6107, 'BI0038', '', 0, '', 'Giheta');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6107, 'BI0039', '', 0, '', 'Gishubi');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6107, 'BI0040', '', 0, '', 'Gitega');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6107, 'BI0041', '', 0, '', 'Itaba');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6107, 'BI0042', '', 0, '', 'Makebuko');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6107, 'BI0043', '', 0, '', 'Mutaho');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6107, 'BI0044', '', 0, '', 'Nyanrusange');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6107, 'BI0045', '', 0, '', 'Ryansoro');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6108, 'BI0046', '', 0, '', 'Bugenyuzi');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6108, 'BI0047', '', 0, '', 'Buhiga');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6108, 'BI0048', '', 0, '', 'Gihogazi');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6108, 'BI0049', '', 0, '', 'Gitaramuka');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6108, 'BI0050', '', 0, '', 'Mutumba');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6108, 'BI0051', '', 0, '', 'Nyabikere');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6108, 'BI0052', '', 0, '', 'Shombo');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6109, 'BI0053', '', 0, '', 'Butaganzwa');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6109, 'BI0054', '', 0, '', 'Gahombo');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6109, 'BI0055', '', 0, '', 'Gatara');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6109, 'BI0056', '', 0, '', 'Kabarore');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6109, 'BI0057', '', 0, '', 'Kayanza');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6109, 'BI0058', '', 0, '', 'Matongo');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6109, 'BI0059', '', 0, '', 'Muhanga');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6109, 'BI0060', '', 0, '', 'Muruta');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6109, 'BI0061', '', 0, '', 'Rango');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6110, 'BI0062', '', 0, '', 'Bugabira');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6110, 'BI0063', '', 0, '', 'Busoni');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6110, 'BI0064', '', 0, '', 'Bwambarangwe');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6110, 'BI0065', '', 0, '', 'Gitobe');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6110, 'BI0066', '', 0, '', 'Kirundo');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6110, 'BI0067', '', 0, '', 'Ntega');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6110, 'BI0068', '', 0, '', 'Vumbi');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6111, 'BI0069', '', 0, '', 'Kayogoro');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6111, 'BI0070', '', 0, '', 'Kibago');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6111, 'BI0071', '', 0, '', 'Mabanda');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6111, 'BI0072', '', 0, '', 'Makamba');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6111, 'BI0073', '', 0, '', 'Nyanza-Lac');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6111, 'BI0074', '', 0, '', 'Vugizo');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6112, 'BI0075', '', 0, '', 'Bukeye');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6112, 'BI0076', '', 0, '', 'Kiganda');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6112, 'BI0077', '', 0, '', 'Mbuye');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6112, 'BI0078', '', 0, '', 'Muramvya');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6112, 'BI0079', '', 0, '', 'Rutegama');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6113, 'BI0080', '', 0, '', 'Buhinyuza');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6113, 'BI0081', '', 0, '', 'Butihinda');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6113, 'BI0082', '', 0, '', 'Gashoho');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6113, 'BI0083', '', 0, '', 'Gasorwe');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6113, 'BI0084', '', 0, '', 'Giteranyi');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6113, 'BI0085', '', 0, '', 'Muyinga');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6113, 'BI0086', '', 0, '', 'Mwakiro');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6114, 'BI0087', '', 0, '', 'Bisoro');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6114, 'BI0088', '', 0, '', 'Gisozi');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6114, 'BI0089', '', 0, '', 'Kayokwe');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6114, 'BI0090', '', 0, '', 'Ndava');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6114, 'BI0091', '', 0, '', 'Nyabihanga');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6114, 'BI0092', '', 0, '', 'Rusaka');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6115, 'BI0093', '', 0, '', 'Busiga');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6115, 'BI0094', '', 0, '', 'Gashikanwa');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6115, 'BI0095', '', 0, '', 'Kiremba');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6115, 'BI0096', '', 0, '', 'Marangara');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6115, 'BI0097', '', 0, '', 'Mwumba');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6115, 'BI0098', '', 0, '', 'Ngozi');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6115, 'BI0099', '', 0, '', 'Nyamurenza');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6115, 'BI0100', '', 0, '', 'Ruhororo');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6115, 'BI0101', '', 0, '', 'Tangara');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6116, 'BI0102', '', 0, '', 'Bugarama');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6116, 'BI0103', '', 0, '', 'Burambi');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6116, 'BI0104', '', 0, '', 'Buyengero');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6116, 'BI0105', '', 0, '', 'Muhuta');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6116, 'BI0106', '', 0, '', 'Rumonge');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6117, 'BI0107', '', 0, '', 'Bukemba');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6117, 'BI0108', '', 0, '', 'Giharo');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6117, 'BI0109', '', 0, '', 'Gitanga');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6117, 'BI0110', '', 0, '', 'Mpinga-Kayove');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6117, 'BI0111', '', 0, '', 'Musongati');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6117, 'BI0112', '', 0, '', 'Rutana');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6118, 'BI0113', '', 0, '', 'Butaganzwa');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6118, 'BI0114', '', 0, '', 'Butezi');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6118, 'BI0115', '', 0, '', 'Bweru');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6118, 'BI0116', '', 0, '', 'Gisuru');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6118, 'BI0117', '', 0, '', 'Kinyinya');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6118, 'BI0118', '', 0, '', 'Nyabitsinda');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6118, 'BI0119', '', 0, '', 'Ruyigi');
+
-- Provinces United Arab Emirates (id country=227)
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('AE-1', 22701, '', 0, '', 'Abu Dhabi');
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('AE-2', 22701, '', 0, '', 'Dubai');
@@ -1767,4 +1888,3 @@ INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('AE-5', 22701, '', 0, '', 'Ras al-Khaimah');
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('AE-6', 22701, '', 0, '', 'Sharjah');
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('AE-7', 22701, '', 0, '', 'Umm al-Quwain');
-
diff --git a/htdocs/install/mysql/data/llx_c_currencies.sql b/htdocs/install/mysql/data/llx_c_currencies.sql
index df887d68be7..bc5a01c3992 100644
--- a/htdocs/install/mysql/data/llx_c_currencies.sql
+++ b/htdocs/install/mysql/data/llx_c_currencies.sql
@@ -7,6 +7,7 @@
-- Copyright (C) 2007 Patrick Raguin
-- Copyright (C) 2011 Juanjo Menent
-- Copyright (C) 2020 Udo Tamm
+-- Copyright (C) 2022 Éric Seigne
-- Copyright (C) 2021 Lenin Rivas
--
-- This program is free software; you can redistribute it and/or modify
@@ -57,6 +58,7 @@ INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'BWP'
INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'BGN', '[1083,1074]', 1, 'Bulgaria Lev');
INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'BRL', '[82,36]', 1, 'Brazil Real');
INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'BND', '[36]', 1, 'Brunei Darussalam Dollar');
+INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'BIF', NULL, 1, 'Burundi Franc');
INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'KHR', '[6107]', 1, 'Cambodia Riel');
INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'CAD', '[36]', 1, 'Canada Dollar');
INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'CVE', '[4217]', 1, 'Cap Verde Escudo');
diff --git a/htdocs/install/mysql/data/llx_c_forme_juridique.sql b/htdocs/install/mysql/data/llx_c_forme_juridique.sql
index 2b3accc5482..bb8dd4c4efb 100644
--- a/htdocs/install/mysql/data/llx_c_forme_juridique.sql
+++ b/htdocs/install/mysql/data/llx_c_forme_juridique.sql
@@ -384,6 +384,13 @@ INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2010', '
INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2011', 'Ideell förening');
INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2012', 'Stiftelse');
+-- Burundi (id contry=61)
+insert into llx_c_forme_juridique (fk_pays, code, libelle) values (61,'6100','Indépendant - Personne physique');
+insert into llx_c_forme_juridique (fk_pays, code, libelle) values (61,'6101','Société Unipersonnelle');
+insert into llx_c_forme_juridique (fk_pays, code, libelle) values (61,'6102','Société de personne à responsabilité limité (SPRL)');
+insert into llx_c_forme_juridique (fk_pays, code, libelle) values (61,'6103','Société anonyme (SA)');
+insert into llx_c_forme_juridique (fk_pays, code, libelle) values (61,'6104','Société coopérative');
+
-- Croatia (id country=76)
INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (76, '7601', 'Društvo s ograničenom odgovornošću (d.o.o.)');
INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (76, '7602', 'Jednostavno društvo s ograničenom odgovornošću (j.d.o.o.)');
diff --git a/htdocs/langs/fr_FR/companies.lang b/htdocs/langs/fr_FR/companies.lang
index 6cc6efc18d7..02a6a88f3fc 100644
--- a/htdocs/langs/fr_FR/companies.lang
+++ b/htdocs/langs/fr_FR/companies.lang
@@ -139,6 +139,12 @@ ProfId3BE=-
ProfId4BE=-
ProfId5BE=Numéro EORI
ProfId6BE=-
+ProfId1BI=Id. prof. 1 (TIN)
+ProfId2BI=Id. prof. 2 (PAN)
+ProfId3BI=Id. prof. 3 (SRVC TAX)
+ProfId4BI=Id. prof. 4 (FISCAL CENTER)
+ProfId5BI=Id. prof. 5
+ProfId6BI=-
ProfId1BR=-
ProfId2BR=IE (Inscricao Estadual)
ProfId3BR=IM (Inscricao Municipal)
diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php
index ad33a43b17f..8f121f2788f 100644
--- a/htdocs/mrp/mo_production.php
+++ b/htdocs/mrp/mo_production.php
@@ -50,6 +50,7 @@ $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'moc
$backtopage = GETPOST('backtopage', 'alpha');
$lineid = GETPOST('lineid', 'int');
$fk_movement = GETPOST('fk_movement', 'int');
+$fk_default_warehouse = GETPOST('fk_default_warehouse', 'int');
$collapse = GETPOST('collapse', 'aZ09comma');
@@ -734,6 +735,16 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '';
if ($collapse || in_array($action, array('consumeorproduce', 'consumeandproduceall'))) {
print $langs->trans("Warehouse");
+
+ // Select warehouse to force it everywhere
+ if (in_array($action, array('consumeorproduce', 'consumeandproduceall'))) {
+ $listwarehouses = $tmpwarehouse->list_array(1);
+ if (count($listwarehouses) > 1) {
+ print '' . $langs->trans("ForceTo") . ' ' . $form->selectarray('fk_default_warehouse', $listwarehouses, $fk_default_warehouse, 1, 0, 0, '', 0, 0, 0, '', 'minwidth100 maxwidth300', 1);
+ } elseif (count($listwarehouses) == 1) {
+ print '' . $langs->trans("ForceTo") . ' ' . $form->selectarray('fk_default_warehouse', $listwarehouses, $fk_default_warehouse, 0, 0, 0, '', 0, 0, 0, '', 'minwidth100 maxwidth300', 1);
+ }
+ }
}
print ' ';
if ($conf->stock->enabled) {
@@ -1057,6 +1068,16 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '';
print '';
+ // default warehouse processing
+ print '';
+
// Lines to produce
diff --git a/htdocs/product/agenda.php b/htdocs/product/agenda.php
index 40d451653e7..ec8a6dd4951 100644
--- a/htdocs/product/agenda.php
+++ b/htdocs/product/agenda.php
@@ -192,7 +192,7 @@ if ($id > 0 || $ref) {
if (get_class($objproduct) == 'Product') {
$out .= '&prodid='.$objproduct->id.'&origin=product&originid='.$id;
}
- $out .= (!empty($objcon->id) ? '&contactid='.$objcon->id : '').'&backtopage=1&percentage=-1';
+ $out .= (!empty($objcon->id) ? '&contactid='.$objcon->id : '').'&backtopage='.$_SERVER["PHP_SELF"].'?id='.$object->id.'&percentage=-1';
//$out.=$langs->trans("AddAnAction").' ';
//$out.=img_picto($langs->trans("AddAnAction"),'filenew');
//$out.="";
diff --git a/htdocs/product/card.php b/htdocs/product/card.php
index eb292e8c7f0..6040e116fa5 100644
--- a/htdocs/product/card.php
+++ b/htdocs/product/card.php
@@ -1650,9 +1650,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print ''.$langs->trans("ProductAccountancySellCode").' ';
print '';
if ($type == 0) {
- $accountancy_code_sell = (GETPOSTISSET('accountancy_code_sell') ? GETPOST('accountancy_code_sell', 'alpha') : $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT);
+ $accountancy_code_sell = (GETPOSTISSET('accountancy_code_sell') ? GETPOST('accountancy_code_sell', 'alpha') : getDolGlobalString("ACCOUNTING_PRODUCT_SOLD_ACCOUNT"));
} else {
- $accountancy_code_sell = (GETPOSTISSET('accountancy_code_sell') ? GETPOST('accountancy_code_sell', 'alpha') : $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT);
+ $accountancy_code_sell = (GETPOSTISSET('accountancy_code_sell') ? GETPOST('accountancy_code_sell', 'alpha') : getDolGlobalString("ACCOUNTING_SERVICE_SOLD_ACCOUNT"));
}
print $formaccounting->select_account($accountancy_code_sell, 'accountancy_code_sell', 1, null, 1, 1, 'minwidth150 maxwidth300', 1);
print ' ';
@@ -1662,9 +1662,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print ''.$langs->trans("ProductAccountancySellIntraCode").' ';
print '';
if ($type == 0) {
- $accountancy_code_sell_intra = (GETPOSTISSET('accountancy_code_sell_intra') ? GETPOST('accountancy_code_sell_intra', 'alpha') : $conf->global->ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT);
+ $accountancy_code_sell_intra = (GETPOSTISSET('accountancy_code_sell_intra') ? GETPOST('accountancy_code_sell_intra', 'alpha') : getDolGlobalString("ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT"));
} else {
- $accountancy_code_sell_intra = (GETPOSTISSET('accountancy_code_sell_intra') ? GETPOST('accountancy_code_sell_intra', 'alpha') : $conf->global->ACCOUNTING_SERVICE_SOLD_INTRA_ACCOUNT);
+ $accountancy_code_sell_intra = (GETPOSTISSET('accountancy_code_sell_intra') ? GETPOST('accountancy_code_sell_intra', 'alpha') : getDolGlobalString("ACCOUNTING_SERVICE_SOLD_INTRA_ACCOUNT"));
}
print $formaccounting->select_account($accountancy_code_sell_intra, 'accountancy_code_sell_intra', 1, null, 1, 1, 'minwidth150 maxwidth300', 1);
print ' ';
@@ -1674,9 +1674,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print ''.$langs->trans("ProductAccountancySellExportCode").' ';
print '';
if ($type == 0) {
- $accountancy_code_sell_export = (GETPOST('accountancy_code_sell_export') ? GETPOST('accountancy_code_sell_export', 'alpha') : $conf->global->ACCOUNTING_PRODUCT_SOLD_EXPORT_ACCOUNT);
+ $accountancy_code_sell_export = (GETPOST('accountancy_code_sell_export') ? GETPOST('accountancy_code_sell_export', 'alpha') : getDolGlobalString("ACCOUNTING_PRODUCT_SOLD_EXPORT_ACCOUNT"));
} else {
- $accountancy_code_sell_export = (GETPOST('accountancy_code_sell_export') ? GETPOST('accountancy_code_sell_export', 'alpha') : $conf->global->ACCOUNTING_SERVICE_SOLD_EXPORT_ACCOUNT);
+ $accountancy_code_sell_export = (GETPOST('accountancy_code_sell_export') ? GETPOST('accountancy_code_sell_export', 'alpha') : getDolGlobalString("ACCOUNTING_SERVICE_SOLD_EXPORT_ACCOUNT"));
}
print $formaccounting->select_account($accountancy_code_sell_export, 'accountancy_code_sell_export', 1, null, 1, 1, 'minwidth150 maxwidth300', 1);
print ' ';
@@ -1685,9 +1685,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print ''.$langs->trans("ProductAccountancyBuyCode").' ';
print '';
if ($type == 0) {
- $accountancy_code_buy = (GETPOST('accountancy_code_buy', 'alpha') ? (GETPOST('accountancy_code_buy', 'alpha')) : $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT);
+ $accountancy_code_buy = (GETPOST('accountancy_code_buy', 'alpha') ? (GETPOST('accountancy_code_buy', 'alpha')) : getDolGlobalString("ACCOUNTING_PRODUCT_BUY_ACCOUNT"));
} else {
- $accountancy_code_buy = (GETPOST('accountancy_code_buy', 'alpha') ? (GETPOST('accountancy_code_buy', 'alpha')) : $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT);
+ $accountancy_code_buy = (GETPOST('accountancy_code_buy', 'alpha') ? (GETPOST('accountancy_code_buy', 'alpha')) : getDolGlobalString("ACCOUNTING_SERVICE_BUY_ACCOUNT"));
}
print $formaccounting->select_account($accountancy_code_buy, 'accountancy_code_buy', 1, null, 1, 1, 'minwidth150 maxwidth300', 1);
print ' ';
@@ -1697,9 +1697,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print ''.$langs->trans("ProductAccountancyBuyIntraCode").' ';
print '';
if ($type == 0) {
- $accountancy_code_buy_intra = (GETPOSTISSET('accountancy_code_buy_intra') ? GETPOST('accountancy_code_buy_intra', 'alpha') : $conf->global->ACCOUNTING_PRODUCT_BUY_INTRA_ACCOUNT);
+ $accountancy_code_buy_intra = (GETPOSTISSET('accountancy_code_buy_intra') ? GETPOST('accountancy_code_buy_intra', 'alpha') : getDolGlobalString("ACCOUNTING_PRODUCT_BUY_INTRA_ACCOUNT"));
} else {
- $accountancy_code_buy_intra = (GETPOSTISSET('accountancy_code_buy_intra') ? GETPOST('accountancy_code_buy_intra', 'alpha') : $conf->global->ACCOUNTING_SERVICE_BUY_INTRA_ACCOUNT);
+ $accountancy_code_buy_intra = (GETPOSTISSET('accountancy_code_buy_intra') ? GETPOST('accountancy_code_buy_intra', 'alpha') : getDolGlobalString("ACCOUNTING_SERVICE_BUY_INTRA_ACCOUNT"));
}
print $formaccounting->select_account($accountancy_code_buy_intra, 'accountancy_code_buy_intra', 1, null, 1, 1, 'minwidth150 maxwidth300', 1);
print ' ';
@@ -1709,9 +1709,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print ''.$langs->trans("ProductAccountancyBuyExportCode").' ';
print '';
if ($type == 0) {
- $accountancy_code_buy_export = (GETPOST('accountancy_code_buy_export') ? GETPOST('accountancy_code_buy_export', 'alpha') : $conf->global->ACCOUNTING_PRODUCT_BUY_EXPORT_ACCOUNT);
+ $accountancy_code_buy_export = (GETPOST('accountancy_code_buy_export') ? GETPOST('accountancy_code_buy_export', 'alpha') : getDolGlobalString("ACCOUNTING_PRODUCT_BUY_EXPORT_ACCOUNT"));
} else {
- $accountancy_code_buy_export = (GETPOST('accountancy_code_buy_export') ? GETPOST('accountancy_code_buy_export', 'alpha') : $conf->global->ACCOUNTING_SERVICE_BUY_EXPORT_ACCOUNT);
+ $accountancy_code_buy_export = (GETPOST('accountancy_code_buy_export') ? GETPOST('accountancy_code_buy_export', 'alpha') : getDolGlobalString("ACCOUNTING_SERVICE_BUY_EXPORT_ACCOUNT"));
}
print $formaccounting->select_account($accountancy_code_buy_export, 'accountancy_code_buy_export', 1, null, 1, 1, 'minwidth150 maxwidth300', 1);
print ' ';
diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php
index a6bb38adfe2..ec96bba20d6 100644
--- a/htdocs/product/composition/card.php
+++ b/htdocs/product/composition/card.php
@@ -74,6 +74,9 @@ if ($object->id > 0) {
} else {
restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
}
+$usercanread = (($object->type == Product::TYPE_PRODUCT && $user->rights->produit->lire) || ($object->type == Product::TYPE_SERVICE && $user->rights->service->lire));
+$usercancreate = (($object->type == Product::TYPE_PRODUCT && $user->rights->produit->creer) || ($object->type == Product::TYPE_SERVICE && $user->rights->service->creer));
+$usercandelete = (($object->type == Product::TYPE_PRODUCT && $user->rights->produit->supprimer) || ($object->type == Product::TYPE_SERVICE && $user->rights->service->supprimer));
/*
diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php
index 8a8f3793b8f..41a4705bdd6 100644
--- a/htdocs/product/fournisseurs.php
+++ b/htdocs/product/fournisseurs.php
@@ -764,7 +764,7 @@ END;
// Reputation
print ''.$langs->trans("ReferenceReputation").' ';
- echo $form->selectarray('supplier_reputation', $object->reputations, $supplier_reputation ? $supplier_reputation : $object->supplier_reputation);
+ echo $form->selectarray('supplier_reputation', $object->reputations, !empty($supplier_reputation) ? $supplier_reputation : $object->supplier_reputation);
print ' ';
// Barcode
@@ -775,7 +775,7 @@ END;
print '';
print ''.$langs->trans('BarcodeType').' ';
print '';
- print $formbarcode->selectBarcodeType(($rowid ? $object->supplier_fk_barcode_type : $conf->global->PRODUIT_DEFAULT_BARCODE_TYPE), 'fk_barcode_type', 1);
+ print $formbarcode->selectBarcodeType(($rowid ? $object->supplier_fk_barcode_type : getDolGlobalint("PRODUIT_DEFAULT_BARCODE_TYPE")), 'fk_barcode_type', 1);
print ' ';
print ' ';
@@ -787,7 +787,7 @@ END;
}
// Option to define a transport cost on supplier price
- if ($conf->global->PRODUCT_CHARGES) {
+ if (!empty($conf->global->PRODUCT_CHARGES)) {
if (!empty($conf->margin->enabled)) {
print '';
print ''.$langs->trans("Charges").' ';
@@ -815,7 +815,7 @@ END;
// Extrafields
$extrafields->fetch_name_optionals_label("product_fournisseur_price");
- $extralabels = $extrafields->attributes["product_fournisseur_price"]['label'];
+ $extralabels = !empty($extrafields->attributes["product_fournisseur_price"]['label']) ? $extrafields->attributes["product_fournisseur_price"]['label'] : '';
$extrafield_values = $extrafields->getOptionalsFromPost("product_fournisseur_price");
if (!empty($extralabels)) {
if (empty($rowid)) {
@@ -868,7 +868,7 @@ END;
}
if (is_object($hookmanager)) {
- $parameters = array('id_fourn'=>$id_fourn, 'prod_id'=>$object->id);
+ $parameters = array('id_fourn'=>!empty($id_fourn) ? $id_fourn : 0, 'prod_id'=>$object->id);
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action);
print $hookmanager->resPrint;
}
diff --git a/htdocs/product/popuprop.php b/htdocs/product/popuprop.php
index 471418b2bd9..b8118ba4884 100644
--- a/htdocs/product/popuprop.php
+++ b/htdocs/product/popuprop.php
@@ -143,6 +143,9 @@ if ($type !== '') {
}
$sql .= " GROUP BY p.rowid, p.label, p.ref, p.fk_product_type";
+$num = 0;
+$totalnboflines = 0;
+
if (!empty($mode) && $mode != '-1') {
$result = $db->query($sql);
if ($result) {
diff --git a/htdocs/product/price.php b/htdocs/product/price.php
index ab3086bfd0b..3abc01e9346 100644
--- a/htdocs/product/price.php
+++ b/htdocs/product/price.php
@@ -1753,7 +1753,7 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action == 'showlog_defaul
if (empty($positiverates)) {
$positiverates = '0';
}
- echo vatrate($positiverates.($objp->default_vat_code ? ' ('.$objp->default_vat_code.')' : ''), '%', $objp->tva_npr);
+ echo vatrate($positiverates.($objp->default_vat_code ? ' ('.$objp->default_vat_code.')' : ''), '%', !empty($objp->tva_npr) ? $objp->tva_npr : 0);
/*
if ($objp->default_vat_code)
{
diff --git a/htdocs/product/stats/card.php b/htdocs/product/stats/card.php
index 21a23fce277..8d9188f1965 100644
--- a/htdocs/product/stats/card.php
+++ b/htdocs/product/stats/card.php
@@ -46,6 +46,7 @@ $mode = (GETPOST('mode', 'alpha') ? GETPOST('mode', 'alpha') : 'byunit');
$search_year = GETPOST('search_year', 'int');
$search_categ = GETPOST('search_categ', 'int');
$notab = GETPOST('notab', 'int');
+$type = GETPOST('type', 'alpha');
$error = 0;
$mesg = '';
diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php
index 3d16b6bac7c..88d5b0f0c3b 100644
--- a/htdocs/product/stock/product.php
+++ b/htdocs/product/stock/product.php
@@ -986,6 +986,7 @@ if (!$variants) {
$num = 0;
$total = 0;
$totalvalue = $totalvaluesell = 0;
+ $totalwithpmp = 0;
$resql = $db->query($sql);
if ($resql) {
diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php
index a620bd02d39..154a376cca7 100644
--- a/htdocs/societe/card.php
+++ b/htdocs/societe/card.php
@@ -909,7 +909,7 @@ if (empty($reshook)) {
// Actions to build doc
$id = $socid;
- $upload_dir = $conf->societe->multidir_output[$object->entity];
+ $upload_dir = !empty($conf->societe->multidir_output[$object->entity])?$conf->societe->multidir_output[$object->entity]:$conf->societe->dir_output;
$permissiontoadd = $user->rights->societe->creer;
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
}
diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php
index 2284a496c0f..9e1d791a626 100644
--- a/htdocs/variants/combinations.php
+++ b/htdocs/variants/combinations.php
@@ -52,6 +52,9 @@ $toselect = GETPOST('toselect', 'array');
$cancel = GETPOST('cancel', 'alpha');
$delete_product = GETPOST('delete_product', 'alpha');
$subaction = GETPOST('subaction', 'aZ09');
+$backtopage = GETPOST('backtopage', 'alpha');
+$sortfield = GETPOST('sortfield', 'aZ09comma');
+$sortorder = GETPOST('sortorder', 'aZ09comma');
// Security check
$fieldvalue = (!empty($id) ? $id : $ref);
@@ -66,7 +69,7 @@ if ($id > 0 || $ref) {
$object->fetch($id, $ref);
}
-$selectedvariant = $_SESSION['addvariant_'.$object->id];
+$selectedvariant = !empty($_SESSION['addvariant_'.$object->id]) ? $_SESSION['addvariant_'.$object->id] : 0;
// Security check
if (empty($conf->variants->enabled)) {
@@ -86,6 +89,9 @@ if ($object->id > 0) {
} else {
restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
}
+$usercanread = (($object->type == Product::TYPE_PRODUCT && $user->rights->produit->lire) || ($object->type == Product::TYPE_SERVICE && $user->rights->service->lire));
+$usercancreate = (($object->type == Product::TYPE_PRODUCT && $user->rights->produit->creer) || ($object->type == Product::TYPE_SERVICE && $user->rights->service->creer));
+$usercandelete = (($object->type == Product::TYPE_PRODUCT && $user->rights->produit->supprimer) || ($object->type == Product::TYPE_SERVICE && $user->rights->service->supprimer));
/*