From 668bb0cb8682afa5332709e8f2257690e5d97612 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Mon, 4 Nov 2019 11:03:39 +0100 Subject: [PATCH 001/306] NEW add public and private notes in propal list --- htdocs/comm/propal/class/propal.class.php | 43 ++++++++++++++++++++++- htdocs/comm/propal/list.php | 13 +++---- 2 files changed, 46 insertions(+), 10 deletions(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 0df1af873a8..1ec4567d774 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -3536,9 +3536,10 @@ class Propal extends CommonObject * @param string $get_params Parametres added to url * @param int $notooltip 1=Disable tooltip * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @param int $addlinktonotes -1=Disable, 0=Just add label show notes, 1=Add private note (only internal user), 2=Add public note (internal or external user), 3=Add private (internal user) and public note (internal and external user) * @return string String with URL */ - public function getNomUrl($withpicto = 0, $option = '', $get_params = '', $notooltip = 0, $save_lastsearch_value = -1) + public function getNomUrl($withpicto = 0, $option = '', $get_params = '', $notooltip = 0, $save_lastsearch_value = -1, $addlinktonotes = -1) { global $langs, $conf, $user; @@ -3604,6 +3605,46 @@ class Propal extends CommonObject if ($withpicto != 2) $result.= $this->ref; $result .= $linkend; + if ($addlinktonotes >= 0) { + $txttoshow = ''; + + if ($addlinktonotes == 0) { + if (!empty($this->note_private) || !empty($this->note_public)) { + $txttoshow = $langs->trans('ViewPrivateNote'); + } + } elseif ($addlinktonotes == 1) { + if (!empty($this->note_private)) { + $txttoshow .= ($user->socid > 0 ? '' : dol_string_nohtmltag($this->note_private, 1)); + } + } elseif ($addlinktonotes == 2) { + if (!empty($this->note_public)) { + $txttoshow .= dol_string_nohtmltag($this->note_public, 1); + } + } elseif ($addlinktonotes == 3) { + if ($user->socid > 0) { + if (!empty($this->note_public)) { + $txttoshow .= dol_string_nohtmltag($this->note_public, 1); + } + } else { + if (!empty($this->note_private)) { + $txttoshow .= dol_string_nohtmltag($this->note_private, 1); + } + if (!empty($this->note_public)) { + if (!empty($txttoshow)) $txttoshow .= '
'; + $txttoshow .= dol_string_nohtmltag($this->note_public, 1); + } + } + } + + if ($txttoshow) { + $result .= ' '; + $result .= ''; + $result .= img_picto('', 'note'); + $result .= ''; + $result .= ''; + } + } + return $result; } diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index a83d7ee5161..b5a0d1d72aa 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -273,7 +273,7 @@ $sql.= ' s.rowid as socid, s.nom as name, s.email, s.town, s.zip, s.fk_pays, s.c $sql.= " typent.code as typent_code,"; $sql.= " ava.rowid as availability,"; $sql.= " state.code_departement as state_code, state.nom as state_name,"; -$sql.= ' p.rowid, p.entity, p.note_private, p.total_ht, p.tva as total_vat, p.total as total_ttc, p.localtax1, p.localtax2, p.ref, p.ref_client, p.fk_statut, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,p.date_livraison as ddelivery,'; +$sql.= ' p.rowid, p.entity, p.note_private, p.note_public, p.total_ht, p.tva as total_vat, p.total as total_ttc, p.localtax1, p.localtax2, p.ref, p.ref_client, p.fk_statut, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,p.date_livraison as ddelivery,'; $sql.= ' p.datec as date_creation, p.tms as date_update, p.date_cloture as date_cloture,'; $sql.= " pr.rowid as project_id, pr.ref as project_ref, pr.title as project_label,"; $sql.= ' u.login'; @@ -764,6 +764,8 @@ if ($resql) $objectstatic->id=$obj->rowid; $objectstatic->ref=$obj->ref; + $objectstatic->note_private=$obj->note_private; + $objectstatic->note_public=$obj->note_public; $companystatic->id=$obj->socid; $companystatic->name=$obj->name; @@ -784,18 +786,11 @@ if ($resql) print ''; // Picto + Ref print ''; // Warning $warnornote=''; if ($obj->fk_statut == 1 && $db->jdate($obj->dfv) < ($now - $conf->propal->cloture->warning_delay)) $warnornote.=img_warning($langs->trans("Late")); - if (! empty($obj->note_private)) - { - $warnornote.=($warnornote?' ':''); - $warnornote.= ''; - $warnornote.= ''.img_picto($langs->trans("ViewPrivateNote"), 'object_generic').''; - $warnornote.= ''; - } if ($warnornote) { print ''; print ''; + + print ''; + print ''; + print ''; + print ''; } diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index e99d4e46420..a1df94edee1 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1730,6 +1730,7 @@ class Product extends CommonObject $sql .= " pfp.fk_product, pfp.ref_fourn, pfp.desc_fourn, pfp.fk_soc, pfp.tva_tx, pfp.fk_supplier_price_expression"; $sql .= " ,pfp.default_vat_code"; $sql .= " ,pfp.multicurrency_price, pfp.multicurrency_unitprice, pfp.multicurrency_tx, pfp.fk_multicurrency, pfp.multicurrency_code"; + if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) $sql.= ", pfp.packaging"; $sql .= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp"; $sql .= " WHERE pfp.rowid = ".$prodfournprice; if ($qty > 0) { $sql .= " AND pfp.quantity <= ".$qty; @@ -1772,6 +1773,7 @@ class Product extends CommonObject $this->fourn_multicurrency_tx = $obj->multicurrency_tx; $this->fourn_multicurrency_id = $obj->fk_multicurrency; $this->fourn_multicurrency_code = $obj->multicurrency_code; + if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) $this->packaging = $obj->packaging; $result = $obj->fk_product; return $result; } @@ -1782,6 +1784,7 @@ class Product extends CommonObject $sql .= " pfp.fk_product, pfp.ref_fourn as ref_supplier, pfp.desc_fourn as desc_supplier, pfp.tva_tx, pfp.fk_supplier_price_expression"; $sql .= " ,pfp.default_vat_code"; $sql .= " ,pfp.multicurrency_price, pfp.multicurrency_unitprice, pfp.multicurrency_tx, pfp.fk_multicurrency, pfp.multicurrency_code"; + if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) $sql.= ", pfp.packaging"; $sql .= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp"; $sql .= " WHERE pfp.fk_product = ".$product_id; if ($fourn_ref != 'none') { $sql .= " AND pfp.ref_fourn = '".$fourn_ref."'"; @@ -1830,7 +1833,8 @@ class Product extends CommonObject $this->fourn_multicurrency_tx = $obj->multicurrency_tx; $this->fourn_multicurrency_id = $obj->fk_multicurrency; $this->fourn_multicurrency_code = $obj->multicurrency_code; - $result = $obj->fk_product; + if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) $this->packaging = $obj->packaging; + $result = $obj->fk_product; return $result; } else @@ -3669,7 +3673,8 @@ class Product extends CommonObject $sql.= ", quantity"; $sql.= ", fk_user"; $sql.= ", tva_tx"; - $sql.= ") VALUES ("; + if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) $sql.= ", packaging"; + $sql.= ") VALUES ("; $sql.= "'".$this->db->idate($now)."'"; $sql.= ", ".$conf->entity; $sql.= ", ".$this->id; @@ -3678,6 +3683,7 @@ class Product extends CommonObject $sql.= ", ".$quantity; $sql.= ", ".$user->id; $sql.= ", 0"; + if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) $sql.= ", ".(!empty($this->packaging) ? $this->packaging : 1); $sql.= ")"; if ($this->db->query($sql)) { diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index b419185d84e..bb32efba7e5 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -170,6 +170,7 @@ if (empty($reshook)) $supplier_description = GETPOST('supplier_description', 'alpha'); $barcode = GETPOST('barcode', 'alpha'); $fk_barcode_type = GETPOST('fk_barcode_type', 'int'); + $packaging = GETPOST('packaging', 'int'); if ($tva_tx == '') { @@ -232,6 +233,12 @@ if (empty($reshook)) } } + if (empty($packaging)) $packaging = 1; + + if ($packaging < $quantity) $packaging = $quantity; + + $object->packaging = $packaging; + if (!$error) { $db->begin(); @@ -765,6 +772,15 @@ SCRIPT; print ''; } + // Product packaging + if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) + { + print ''; + print ''; + print ''; + print ''; + } + $extrafields->fetch_name_optionals_label("product_fournisseur_price"); $extralabels = $extrafields->attributes["product_fournisseur_price"]['label']; // Extrafields @@ -872,6 +888,7 @@ SCRIPT; print_liste_field_titre("BarcodeValue", $_SERVER["PHP_SELF"], "pfp.barcode", "", $param, '', $sortfield, $sortorder, 'center '); print_liste_field_titre("BarcodeType", $_SERVER["PHP_SELF"], "pfp.fk_barcode_type", "", $param, '', $sortfield, $sortorder, 'center '); } + if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) print_liste_field_titre("PackagingForThisProduct",$_SERVER["PHP_SELF"],"pfp.packaging","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre("DateModification", $_SERVER["PHP_SELF"], "pfp.tms", "", $param, '', $sortfield, $sortorder, 'right '); // fetch optionals attributes and labels @@ -1002,6 +1019,14 @@ SCRIPT; print ''; } + // Packaging + if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) + { + print ''; + } + // Date print ''; } - $datefacture = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); + $datefacture = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); // Date invoice print ''; } // Payment term print ''; if (!empty($conf->global->INVOICE_USE_SITUATION)) diff --git a/htdocs/compta/stats/cabyuser.php b/htdocs/compta/stats/cabyuser.php index 8d49711b121..fb9b06025aa 100644 --- a/htdocs/compta/stats/cabyuser.php +++ b/htdocs/compta/stats/cabyuser.php @@ -170,9 +170,11 @@ elseif ($modecompta == "RECETTES-DEPENSES") } elseif ($modecompta == "BOOKKEEPING") { + // TODO } elseif ($modecompta == "BOOKKEEPINGCOLLECTED") { + // TODO } $period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0); if ($date_end == dol_time_plus_duree($date_start, 1, 'y') - 1) $periodlink = ''.img_previous().''.img_next().''; @@ -387,39 +389,53 @@ if (count($amount)) { // Amount w/o VAT print ''; // Amount with VAT print ''; // Percent diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 498fa314315..39548f3c41e 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3522,6 +3522,7 @@ abstract class CommonObject if ($elementTable == 'user') $fieldstatus = "statut"; if ($elementTable == 'expensereport') $fieldstatus = "fk_statut"; if ($elementTable == 'commande_fournisseur_dispatch') $fieldstatus = "status"; + if (is_array($this->fields) && array_key_exists('status', $this->fields)) $fieldstatus = 'status'; $sql = "UPDATE ".MAIN_DB_PREFIX.$elementTable; $sql .= " SET ".$fieldstatus." = ".$status; @@ -3572,7 +3573,7 @@ abstract class CommonObject else { $this->db->rollback(); - dol_syslog(get_class($this)."::setStatus ".$this->error, LOG_ERR); + dol_syslog(get_class($this)."::setStatut ".$this->error, LOG_ERR); return -1; } } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 909d16d39e6..97409544a90 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1567,7 +1567,7 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi { $accounted = $object->getVentilExportCompta(); $langs->load("accountancy"); - $morehtmlstatus .= '
'.($accounted > 0 ? $langs->trans("Accounted") : ''.$langs->trans("NotYetAccounted").''); + $morehtmlstatus .= '
'.($accounted > 0 ? $langs->trans("Accounted") : $langs->trans("NotYetAccounted")).''; } } diff --git a/htdocs/core/search_page.php b/htdocs/core/search_page.php index 7ca287625eb..194afb86d92 100644 --- a/htdocs/core/search_page.php +++ b/htdocs/core/search_page.php @@ -115,7 +115,7 @@ print "\n"; print "\n"; print '
'; print ''; -print '
'."\n"; +print '
'."\n"; print $searchform; print '
'."\n"; print '
'; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index e4e7768128e..602cc65522e 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1248,6 +1248,7 @@ AskForPreferredShippingMethod=Ask for preferred shipping method for Third Partie FieldEdition=Edition of field %s FillThisOnlyIfRequired=Example: +2 (fill only if timezone offset problems are experienced) GetBarCode=Get barcode +NumberingModules=Numbering models ##### Module password generation PasswordGenerationStandard=Return a password generated according to internal Dolibarr algorithm: 8 characters containing shared numbers and characters in lowercase. PasswordGenerationNone=Do not suggest a generated password. Password must be typed in manually. diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index d7a157c682f..4859162abb0 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -584,8 +584,8 @@ class MyObject extends CommonObject // We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments $oldref = dol_sanitizeFileName($this->ref); $newref = dol_sanitizeFileName($num); - $dirsource = $conf->myobject->dir_output.'/'.$oldref; - $dirdest = $conf->myobject->dir_output.'/'.$newref; + $dirsource = $conf->mymodule->dir_output.'/myobject/'.$oldref; + $dirdest = $conf->mymodule->dir_output.'/myobject/'.$newref; if (!$error && file_exists($dirsource)) { dol_syslog(get_class($this)."::validate() rename dir ".$dirsource." into ".$dirdest); @@ -594,7 +594,7 @@ class MyObject extends CommonObject { dol_syslog("Rename ok"); // Rename docs starting with $oldref with $newref - $listoffiles = dol_dir_list($conf->myobject->dir_output.'/'.$newref, 'files', 1, '^'.preg_quote($oldref, '/')); + $listoffiles = dol_dir_list($conf->mymodule->dir_output.'/myobject/'.$newref, 'files', 1, '^'.preg_quote($oldref, '/')); foreach ($listoffiles as $fileentry) { $dirsource = $fileentry['name']; diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_advanced.php b/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_advanced.php index f9cc9d0b27c..6a3a274f443 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_advanced.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_advanced.php @@ -21,12 +21,12 @@ */ /** - * \file htdocs/core/modules/bom/mod_bom_advanced.php - * \ingroup bom + * \file htdocs/core/modules/mymodule/mod_myobject_advanced.php + * \ingroup mymodule * \brief File containing class for advanced numbering model of MyObject */ -require_once DOL_DOCUMENT_ROOT .'/core/modules/bom/modules_bom.php'; +dol_include_once('/mymodule/core/modules/mymodule/modules_myobject.php'); /** @@ -71,15 +71,15 @@ class mod_myobject_advanced extends ModeleNumRefMyObject $texte.= ''; $texte.= '
'; - print $objectstatic->getNomUrl(1, '', '', 0, 1); + print $objectstatic->getNomUrl(1, '', '', 0, 1, $conf->global->PROPAL_LIST_SHOW_NOTES); print ''; From fefb4a7f95719d4ed74172996b5e858a579517e8 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Tue, 5 Nov 2019 15:13:44 +0100 Subject: [PATCH 002/306] FIX replace
by
--- htdocs/comm/propal/class/propal.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 1ec4567d774..26f28aed9ea 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -3630,7 +3630,7 @@ class Propal extends CommonObject $txttoshow .= dol_string_nohtmltag($this->note_private, 1); } if (!empty($this->note_public)) { - if (!empty($txttoshow)) $txttoshow .= '
'; + if (!empty($txttoshow)) $txttoshow .= '
'; $txttoshow .= dol_string_nohtmltag($this->note_public, 1); } } From bcafef42b0895ee310a13b3bae589f01e3d45598 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Wed, 6 Nov 2019 16:45:52 +0100 Subject: [PATCH 003/306] NEW tooltip notes with first public note and then private note --- htdocs/comm/propal/class/propal.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 26f28aed9ea..74da579e77e 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -3626,13 +3626,13 @@ class Propal extends CommonObject $txttoshow .= dol_string_nohtmltag($this->note_public, 1); } } else { - if (!empty($this->note_private)) { - $txttoshow .= dol_string_nohtmltag($this->note_private, 1); - } if (!empty($this->note_public)) { - if (!empty($txttoshow)) $txttoshow .= '
'; $txttoshow .= dol_string_nohtmltag($this->note_public, 1); } + if (!empty($this->note_private)) { + if (!empty($txttoshow)) $txttoshow .= '

'; + $txttoshow .= dol_string_nohtmltag($this->note_private, 1); + } } } From ce15af098061c85f247cc76714afac8d20b7c293 Mon Sep 17 00:00:00 2001 From: atm-greg Date: Sat, 23 Nov 2019 15:52:34 +0100 Subject: [PATCH 004/306] manage packaging on supplier prices --- .../fourn/class/fournisseur.product.class.php | 19 +++++++++++++- htdocs/langs/en_US/products.lang | 6 ++++- htdocs/product/admin/product.php | 19 ++++++++++++++ htdocs/product/class/product.class.php | 10 ++++++-- htdocs/product/fournisseurs.php | 25 +++++++++++++++++++ 5 files changed, 75 insertions(+), 4 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 069380249db..6545e13fafe 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -273,6 +273,7 @@ class ProductFournisseur extends Product $charges = price2num($charges, 'MU'); $qty = price2num($qty, 'MS'); $unitBuyPrice = price2num($buyprice / $qty, 'MU'); + $packaging = ($this->packaging < $qty) ? $qty : $this->packaging; $error = 0; $now = dol_now(); @@ -359,6 +360,7 @@ class ProductFournisseur extends Product $sql .= " supplier_reputation = ".(empty($supplier_reputation) ? 'NULL' : "'".$this->db->escape($supplier_reputation)."'").","; $sql .= " barcode = ".(empty($barcode) ? 'NULL' : "'".$this->db->escape($barcode)."'").","; $sql .= " fk_barcode_type = ".(empty($fk_barcode_type) ? 'NULL' : "'".$this->db->escape($fk_barcode_type)."'"); + if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) $sql.= ", packaging = ".(empty($packaging) ? 1 : $packaging); $sql .= " WHERE rowid = ".$this->product_fourn_price_id; // TODO Add price_base_type and price_ttc @@ -409,6 +411,7 @@ class ProductFournisseur extends Product $sql = "INSERT INTO ".MAIN_DB_PREFIX."product_fournisseur_price("; $sql .= " multicurrency_price, multicurrency_unitprice, multicurrency_tx, fk_multicurrency, multicurrency_code,"; $sql .= "datec, fk_product, fk_soc, ref_fourn, desc_fourn, fk_user, price, quantity, remise_percent, remise, unitprice, tva_tx, charges, fk_availability, default_vat_code, info_bits, entity, delivery_time_days, supplier_reputation, barcode, fk_barcode_type)"; + if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) $sql.= ", packaging"; $sql .= " values("; $sql .= (isset($multicurrency_buyprice) ? "'".$this->db->escape(price2num($multicurrency_buyprice))."'" : 'null').","; $sql .= (isset($multicurrency_unitBuyPrice) ? "'".$this->db->escape(price2num($multicurrency_unitBuyPrice))."'" : 'null').","; @@ -436,6 +439,7 @@ class ProductFournisseur extends Product $sql .= (empty($supplier_reputation) ? 'NULL' : "'".$this->db->escape($supplier_reputation)."'").","; $sql .= (empty($barcode) ? 'NULL' : "'".$this->db->escape($barcode)."'").","; $sql .= (empty($fk_barcode_type) ? 'NULL' : "'".$this->db->escape($fk_barcode_type)."'"); + if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) $sql.= ", ".(empty($this->packaging) ? 1 : $this->db->escape($this->packaging)) ; $sql .= ")"; $idinserted = 0; @@ -502,6 +506,7 @@ class ProductFournisseur extends Product $sql .= " pfp.supplier_reputation, pfp.fk_user, pfp.datec,"; $sql .= " pfp.multicurrency_price, pfp.multicurrency_unitprice, pfp.multicurrency_tx, pfp.fk_multicurrency, pfp.multicurrency_code,"; $sql .= " pfp.barcode, pfp.fk_barcode_type"; + if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) $sql.= ", pfp.packaging"; $sql .= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp"; $sql .= " WHERE pfp.rowid = ".(int) $rowid; @@ -545,6 +550,12 @@ class ProductFournisseur extends Product $this->fourn_barcode = $obj->barcode; $this->fourn_fk_barcode_type = $obj->fk_barcode_type; } + + if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) { + $this->packaging = $obj->packaging; + if ($this->packaging < $this->fourn_qty) $this->packaging = $this->fourn_qty; + } + if (empty($ignore_expression) && !empty($this->fk_supplier_price_expression)) { $priceparser = new PriceParser($this->db); @@ -599,7 +610,8 @@ class ProductFournisseur extends Product $sql .= " pfp.price, pfp.quantity, pfp.unitprice, pfp.remise_percent, pfp.remise, pfp.tva_tx, pfp.fk_availability, pfp.charges, pfp.info_bits, pfp.delivery_time_days, pfp.supplier_reputation,"; $sql .= " pfp.multicurrency_price, pfp.multicurrency_unitprice, pfp.multicurrency_tx, pfp.fk_multicurrency, pfp.multicurrency_code, pfp.datec, pfp.tms,"; $sql .= " pfp.barcode, pfp.fk_barcode_type"; - $sql .= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp, ".MAIN_DB_PREFIX."societe as s"; + if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) $sql.= ", pfp.packaging"; + $sql .= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp, ".MAIN_DB_PREFIX."societe as s"; $sql .= " WHERE pfp.entity IN (".getEntity('productsupplierprice').")"; $sql .= " AND pfp.fk_soc = s.rowid"; $sql .= " AND s.status=1"; // only enabled company selected @@ -648,6 +660,11 @@ class ProductFournisseur extends Product $prodfourn->fourn_multicurrency_id = $record["fk_multicurrency"]; $prodfourn->fourn_multicurrency_code = $record["multicurrency_code"]; + if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) { + $prodfourn->packaging = $record["packaging"]; + if ($prodfourn->packaging < $prodfourn->fourn_qty) $prodfourn->packaging = $prodfourn->fourn_qty; + } + if ($conf->barcode->enabled) { $prodfourn->barcode = $record["barcode"]; $prodfourn->fk_barcode_type = $record["fk_barcode_type"]; diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index 1ca335da637..42e90c21535 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -303,6 +303,10 @@ PossibleValues=Possible values GoOnMenuToCreateVairants=Go on menu %s - %s to prepare attribute variants (like colors, size, ...) UseProductFournDesc=Add a feature to define the descriptions of products defined by the vendors in addition to descriptions for customers ProductSupplierDescription=Vendor description for the product +UseProductSupplierPackaging=Use packaging on supplier prices (recalculate quantities according to packaging set on supplier price when adding/updating line in supplier documents) +PackagingForThisProduct=Packaging +QtyRecalculatedWithPackaging=The quantity of the line were recalculated according to supplier packaging + #Attributes VariantAttributes=Variant attributes ProductAttributes=Variant attributes for products @@ -347,4 +351,4 @@ ErrorDestinationProductNotFound=Destination product not found ErrorProductCombinationNotFound=Product variant not found ActionAvailableOnVariantProductOnly=Action only available on the variant of product ProductsPricePerCustomer=Product prices per customers -ProductSupplierExtraFields=Additional Attributes (Supplier Prices) \ No newline at end of file +ProductSupplierExtraFields=Additional Attributes (Supplier Prices) diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index deafff12cfe..34d907ca62a 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -156,6 +156,18 @@ if ($action == 'other') $resql_new = $db->query($sql_new); } } + + $value = GETPOST('activate_useProdSupplierPackaging', 'alpha'); + $res = dolibarr_set_const($db, "PRODUCT_USE_SUPPLIER_PACKAGING", $value,'chaine',0,'',$conf->entity); + if ($value) { + $sql_test = "SELECT count(packaging) as cpt FROM ".MAIN_DB_PREFIX."product_fournisseur_price WHERE 1"; + $resql = $db->query($sql_test); + if (!$resql && $db->lasterrno == 'DB_ERROR_NOSUCHFIELD') // if the field does not exist, we create it + { + $sql_new = "ALTER TABLE ".MAIN_DB_PREFIX."product_fournisseur_price ADD COLUMN packaging double(24,8) DEFAULT 1"; + $resql_new = $db->query($sql_new); + } + } } if ($action == 'specimen') // For products @@ -676,6 +688,13 @@ if (! empty($conf->fournisseur->enabled)) print $form->selectyesno("activate_useProdFournDesc", (! empty($conf->global->PRODUIT_FOURN_TEXTS)?$conf->global->PRODUIT_FOURN_TEXTS:0), 1); print '
'.$langs->trans("UseProductSupplierPackaging").''; + print $form->selectyesno("activate_useProdSupplierPackaging", (! empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)?$conf->global->PRODUCT_USE_SUPPLIER_PACKAGING:0), 1); + print '
'.$langs->trans('PackagingForThisProduct').'
'; + print price2num($productfourn->packaging); + print ''; print dol_print_date(($productfourn->fourn_date_modification ? $productfourn->fourn_date_modification : $productfourn->date_modification), "dayhour"); From 89dd04aa0736eb722ad9456ca62d9c31768e5252 Mon Sep 17 00:00:00 2001 From: atm-greg Date: Sat, 23 Nov 2019 19:05:49 +0100 Subject: [PATCH 005/306] implement on supplier_order --- .../class/fournisseur.commande.class.php | 62 ++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index b1ebe4a3895..451084caf4b 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -387,6 +387,7 @@ class CommandeFournisseur extends CommonOrder */ public function fetch_lines($only_product = 0) { + global $conf; // phpcs:enable //$result=$this->fetch_lines(); $this->lines = array(); @@ -399,8 +400,12 @@ class CommandeFournisseur extends CommonOrder $sql .= " l.fk_unit,"; $sql .= " l.date_start, l.date_end,"; $sql .= ' l.fk_multicurrency, l.multicurrency_code, l.multicurrency_subprice, l.multicurrency_total_ht, l.multicurrency_total_tva, l.multicurrency_total_ttc'; + if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) + $sql.= ", pfp.rowid as fk_pfp, pfp.packaging"; $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as l"; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product = p.rowid'; + if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON l.fk_product = pfp.fk_product and l.ref = pfp.ref_fourn"; $sql .= " WHERE l.fk_commande = ".$this->id; if ($only_product) $sql .= ' AND p.fk_product_type = 0'; $sql .= " ORDER BY l.rang, l.rowid"; @@ -451,7 +456,13 @@ class CommandeFournisseur extends CommonOrder $line->ref_fourn = $objp->ref_supplier; // The supplier ref of price when product was added. May have change since $line->ref_supplier = $objp->ref_supplier; // The supplier ref of price when product was added. May have change since - $line->date_start = $this->db->jdate($objp->date_start); + if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) + { + $line->fk_fournprice = $objp->fk_pfp; + $line->packaging = $objp->packaging; + } + + $line->date_start = $this->db->jdate($objp->date_start); $line->date_end = $this->db->jdate($objp->date_end); $line->fk_unit = $objp->fk_unit; @@ -1615,6 +1626,26 @@ class CommandeFournisseur extends CommonOrder return -1; } } + + // redefine quantity according to packaging + if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) + { + $prod = new Product($this->db, $fk_product); + $prod->get_buyprice($fk_prod_fourn_price, $qty, $fk_product, 'none', ($this->fk_soc?$this->fk_soc:$this->socid)); + if ($qty < $prod->packaging) + { + $qty = $prod->packaging; + } + else + { + if (($qty % $prod->packaging) > 0) + { + $coeff = intval($qty/$prod->packaging) + 1; + $qty = $prod->packaging * $coeff; + setEventMessage($langs->trans('QtyRecalculatedWithPackaging'), 'mesgs'); + } + } + } } else { @@ -2531,6 +2562,27 @@ class CommandeFournisseur extends CommonOrder $txtva = preg_replace('/\s*\(.*\)/', '', $txtva); // Remove code into vatrate. } + // redefine quantity according to packaging + if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) + { + $prod = new Product($this->db, $this->line->fk_product); + $prod->get_buyprice($this->line->fk_fournprice, $qty, $this->line->fk_product, 'none', ($this->fk_soc?$this->fk_soc:$this->socid)); + + if ($qty < $prod->packaging) + { + $qty = $prod->packaging; + } + else + { + if (($qty % $prod->packaging) > 0) + { + $coeff = intval($qty/$prod->packaging) + 1; + $qty = $prod->packaging * $coeff; + setEventMessage($langs->trans('QtyRecalculatedWithPackaging'), 'mesgs'); + } + } + } + $tabprice = calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type, $this->thirdparty, $localtaxes_type, 100, $this->multicurrency_tx, $pu_ht_devise); $total_ht = $tabprice[0]; $total_tva = $tabprice[1]; @@ -3309,6 +3361,8 @@ class CommandeFournisseurLigne extends CommonOrderLine */ public function fetch($rowid) { + global $conf; + $sql = 'SELECT cd.rowid, cd.fk_commande, cd.fk_product, cd.product_type, cd.description, cd.qty, cd.tva_tx, cd.special_code,'; $sql .= ' cd.localtax1_tx, cd.localtax2_tx, cd.localtax1_type, cd.localtax2_type, cd.ref,'; $sql .= ' cd.remise, cd.remise_percent, cd.subprice,'; @@ -3317,8 +3371,12 @@ class CommandeFournisseurLigne extends CommonOrderLine $sql .= ' p.ref as product_ref, p.label as product_libelle, p.description as product_desc,'; $sql .= ' cd.date_start, cd.date_end, cd.fk_unit,'; $sql .= ' cd.multicurrency_subprice, cd.multicurrency_total_ht, cd.multicurrency_total_tva, cd.multicurrency_total_ttc'; + if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) + $sql.= ", pfp.rowid as fk_pfp"; $sql .= ' FROM '.MAIN_DB_PREFIX.'commande_fournisseurdet as cd'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON cd.fk_product = p.rowid'; + if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON cd.fk_product = pfp.fk_product and cd.ref = pfp.ref_fourn"; $sql .= ' WHERE cd.rowid = '.$rowid; $result = $this->db->query($sql); if ($result) @@ -3356,6 +3414,8 @@ class CommandeFournisseurLigne extends CommonOrderLine $this->product_ref = $objp->product_ref; $this->product_libelle = $objp->product_libelle; $this->product_desc = $objp->product_desc; + if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) + $this->fk_fournprice = $objp->fk_pfp; $this->date_start = $this->db->jdate($objp->date_start); $this->date_end = $this->db->jdate($objp->date_end); From 5af9784dc91ac330e6005a82a4c4247efb6b64f5 Mon Sep 17 00:00:00 2001 From: atm-greg Date: Mon, 25 Nov 2019 07:40:29 +0100 Subject: [PATCH 006/306] fix update line --- .../class/fournisseur.commande.class.php | 46 ++++++++++--------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 451084caf4b..b356d3f8801 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -2562,27 +2562,6 @@ class CommandeFournisseur extends CommonOrder $txtva = preg_replace('/\s*\(.*\)/', '', $txtva); // Remove code into vatrate. } - // redefine quantity according to packaging - if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) - { - $prod = new Product($this->db, $this->line->fk_product); - $prod->get_buyprice($this->line->fk_fournprice, $qty, $this->line->fk_product, 'none', ($this->fk_soc?$this->fk_soc:$this->socid)); - - if ($qty < $prod->packaging) - { - $qty = $prod->packaging; - } - else - { - if (($qty % $prod->packaging) > 0) - { - $coeff = intval($qty/$prod->packaging) + 1; - $qty = $prod->packaging * $coeff; - setEventMessage($langs->trans('QtyRecalculatedWithPackaging'), 'mesgs'); - } - } - } - $tabprice = calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type, $this->thirdparty, $localtaxes_type, 100, $this->multicurrency_tx, $pu_ht_devise); $total_ht = $tabprice[0]; $total_tva = $tabprice[1]; @@ -2615,6 +2594,26 @@ class CommandeFournisseur extends CommonOrder $this->line->fk_commande = $this->id; //$this->line->label=$label; $this->line->desc = $desc; + + // redefine quantity according to packaging + if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) + { + + if ($qty < $this->line->packaging) + { + $qty = $this->line->packaging; + } + else + { + if (($qty % $this->line->packaging) > 0) + { + $coeff = intval($qty/$this->line->packaging) + 1; + $qty = $this->line->packaging * $coeff; + setEventMessage($langs->trans('QtyRecalculatedWithPackaging'), 'mesgs'); + } + } + } + $this->line->qty = $qty; $this->line->ref_supplier = $ref_supplier; @@ -3372,7 +3371,7 @@ class CommandeFournisseurLigne extends CommonOrderLine $sql .= ' cd.date_start, cd.date_end, cd.fk_unit,'; $sql .= ' cd.multicurrency_subprice, cd.multicurrency_total_ht, cd.multicurrency_total_tva, cd.multicurrency_total_ttc'; if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) - $sql.= ", pfp.rowid as fk_pfp"; + $sql.= ", pfp.rowid as fk_pfp, pfp.packaging"; $sql .= ' FROM '.MAIN_DB_PREFIX.'commande_fournisseurdet as cd'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON cd.fk_product = p.rowid'; if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) @@ -3415,7 +3414,10 @@ class CommandeFournisseurLigne extends CommonOrderLine $this->product_libelle = $objp->product_libelle; $this->product_desc = $objp->product_desc; if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) + { + $this->packaging = $objp->packaging; $this->fk_fournprice = $objp->fk_pfp; + } $this->date_start = $this->db->jdate($objp->date_start); $this->date_end = $this->db->jdate($objp->date_end); From 5d051cc9012d47f661b9c2f7d89629de3d6e36ba Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 25 Nov 2019 07:08:22 +0000 Subject: [PATCH 007/306] Fixing style errors. --- htdocs/fourn/class/fournisseur.commande.class.php | 1 - htdocs/product/admin/product.php | 2 +- htdocs/product/fournisseurs.php | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index b356d3f8801..c065241a807 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -2598,7 +2598,6 @@ class CommandeFournisseur extends CommonOrder // redefine quantity according to packaging if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) { - if ($qty < $this->line->packaging) { $qty = $this->line->packaging; diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index 34d907ca62a..292a6e39254 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -158,7 +158,7 @@ if ($action == 'other') } $value = GETPOST('activate_useProdSupplierPackaging', 'alpha'); - $res = dolibarr_set_const($db, "PRODUCT_USE_SUPPLIER_PACKAGING", $value,'chaine',0,'',$conf->entity); + $res = dolibarr_set_const($db, "PRODUCT_USE_SUPPLIER_PACKAGING", $value, 'chaine', 0, '', $conf->entity); if ($value) { $sql_test = "SELECT count(packaging) as cpt FROM ".MAIN_DB_PREFIX."product_fournisseur_price WHERE 1"; $resql = $db->query($sql_test); diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index bb32efba7e5..7cb6daf6702 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -888,7 +888,7 @@ SCRIPT; print_liste_field_titre("BarcodeValue", $_SERVER["PHP_SELF"], "pfp.barcode", "", $param, '', $sortfield, $sortorder, 'center '); print_liste_field_titre("BarcodeType", $_SERVER["PHP_SELF"], "pfp.fk_barcode_type", "", $param, '', $sortfield, $sortorder, 'center '); } - if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) print_liste_field_titre("PackagingForThisProduct",$_SERVER["PHP_SELF"],"pfp.packaging","",$param,'align="center"',$sortfield,$sortorder); + if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) print_liste_field_titre("PackagingForThisProduct", $_SERVER["PHP_SELF"], "pfp.packaging", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre("DateModification", $_SERVER["PHP_SELF"], "pfp.tms", "", $param, '', $sortfield, $sortorder, 'right '); // fetch optionals attributes and labels From 23b4e3ad6d601b25e3cb414bf8f95df39862b714 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Thu, 26 Dec 2019 09:50:15 +0100 Subject: [PATCH 008/306] FIX resolve conflicts --- htdocs/comm/propal/list.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index b5a0d1d72aa..b3d915e3985 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -273,7 +273,7 @@ $sql.= ' s.rowid as socid, s.nom as name, s.email, s.town, s.zip, s.fk_pays, s.c $sql.= " typent.code as typent_code,"; $sql.= " ava.rowid as availability,"; $sql.= " state.code_departement as state_code, state.nom as state_name,"; -$sql.= ' p.rowid, p.entity, p.note_private, p.note_public, p.total_ht, p.tva as total_vat, p.total as total_ttc, p.localtax1, p.localtax2, p.ref, p.ref_client, p.fk_statut, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,p.date_livraison as ddelivery,'; +$sql .= " p.rowid, p.entity, p.note_private, p.note_public, p.total_ht, p.tva as total_vat, p.total as total_ttc, p.localtax1, p.localtax2, p.ref, p.ref_client, p.fk_statut, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,p.date_livraison as ddelivery,"; $sql.= ' p.datec as date_creation, p.tms as date_update, p.date_cloture as date_cloture,'; $sql.= " pr.rowid as project_id, pr.ref as project_ref, pr.title as project_label,"; $sql.= ' u.login'; @@ -764,8 +764,8 @@ if ($resql) $objectstatic->id=$obj->rowid; $objectstatic->ref=$obj->ref; - $objectstatic->note_private=$obj->note_private; - $objectstatic->note_public=$obj->note_public; + $objectstatic->note_private = $obj->note_private; + $objectstatic->note_public = $obj->note_public; $companystatic->id=$obj->socid; $companystatic->name=$obj->name; From bf1bf10a536d361e1a3c5097ec4b8c887ae36d13 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Thu, 26 Dec 2019 09:56:35 +0100 Subject: [PATCH 009/306] FIX resolve conflicts --- htdocs/comm/propal/list.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index b3d915e3985..1f462d6a205 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -269,14 +269,14 @@ $help_url='EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos'; $sql = 'SELECT'; if ($sall || $search_product_category > 0) $sql = 'SELECT DISTINCT'; -$sql.= ' s.rowid as socid, s.nom as name, s.email, s.town, s.zip, s.fk_pays, s.client, s.code_client, '; -$sql.= " typent.code as typent_code,"; -$sql.= " ava.rowid as availability,"; -$sql.= " state.code_departement as state_code, state.nom as state_name,"; +$sql .= ' s.rowid as socid, s.nom as name, s.email, s.town, s.zip, s.fk_pays, s.client, s.code_client, '; +$sql .= " typent.code as typent_code,"; +$sql .= " ava.rowid as availability,"; +$sql .= " state.code_departement as state_code, state.nom as state_name,"; $sql .= " p.rowid, p.entity, p.note_private, p.note_public, p.total_ht, p.tva as total_vat, p.total as total_ttc, p.localtax1, p.localtax2, p.ref, p.ref_client, p.fk_statut, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,p.date_livraison as ddelivery,"; -$sql.= ' p.datec as date_creation, p.tms as date_update, p.date_cloture as date_cloture,'; -$sql.= " pr.rowid as project_id, pr.ref as project_ref, pr.title as project_label,"; -$sql.= ' u.login'; +$sql .= ' p.datec as date_creation, p.tms as date_update, p.date_cloture as date_cloture,'; +$sql .= " pr.rowid as project_id, pr.ref as project_ref, pr.title as project_label,"; +$sql .= ' u.login'; if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user"; if ($search_categ_cus) $sql .= ", cc.fk_categorie, cc.fk_soc"; // Add fields from extrafields @@ -762,8 +762,8 @@ if ($resql) { $obj = $db->fetch_object($resql); - $objectstatic->id=$obj->rowid; - $objectstatic->ref=$obj->ref; + $objectstatic->id = $obj->rowid; + $objectstatic->ref = $obj->ref; $objectstatic->note_private = $obj->note_private; $objectstatic->note_public = $obj->note_public; From 046aba8abd7325962c0a1ca501a2ba00a05b8fab Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Thu, 26 Dec 2019 10:14:05 +0100 Subject: [PATCH 010/306] FIX indented errors --- htdocs/comm/propal/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 7716cf2a96e..e307d8727f4 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -764,8 +764,8 @@ if ($resql) $objectstatic->id = $obj->rowid; $objectstatic->ref = $obj->ref; - $objectstatic->note_private = $obj->note_private; - $objectstatic->note_public = $obj->note_public; + $objectstatic->note_private = $obj->note_private; + $objectstatic->note_public = $obj->note_public; $companystatic->id = $obj->socid; $companystatic->name = $obj->name; From b53f356638aae5f715e7c6c5cd72c20fe488c018 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 31 Dec 2019 17:30:27 +0100 Subject: [PATCH 011/306] FIX #12760 #12763 #12755 #12765 #12751 --- htdocs/core/class/html.formmargin.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formmargin.class.php b/htdocs/core/class/html.formmargin.class.php index 345a94b3a62..6857eddf44a 100644 --- a/htdocs/core/class/html.formmargin.class.php +++ b/htdocs/core/class/html.formmargin.class.php @@ -1,5 +1,5 @@ +/* Copyright (c) 2015-2019 Laurent Destailleur * * 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 @@ -98,7 +98,7 @@ class FormMargin $pv = $line->total_ht; $pa_ht = ($pv < 0 ? - $line->pa_ht : $line->pa_ht); // We choosed to have line->pa_ht always positive in database, so we guess the correct sign - if ($object->type == Facture::TYPE_SITUATION) { + if ($object->element == 'facture' && $object->type == $object::TYPE_SITUATION) { $pa = $line->qty * $pa_ht * ($line->situation_percent / 100); } else { $pa = $line->qty * $pa_ht; From e5ddc8dfa3c4e35ba8fe62fb727ec914086b28eb Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Tue, 7 Jan 2020 09:43:13 +0100 Subject: [PATCH 012/306] Merge remote-tracking branch 'Dolibarr/11.0' into 11 --- htdocs/compta/facture/card.php | 8 +- htdocs/compta/stats/cabyuser.php | 38 +++++--- htdocs/core/class/commonobject.class.php | 3 +- htdocs/core/lib/functions.lib.php | 2 +- htdocs/core/search_page.php | 2 +- htdocs/langs/en_US/admin.lang | 1 + .../template/class/myobject.class.php | 6 +- .../mymodule/mod_myobject_advanced.php | 16 ++-- .../mymodule/mod_myobject_standard.php | 15 +-- .../modules/mymodule/modules_myobject.php | 17 ++-- htdocs/mrp/mo_production.php | 91 +++++++++++++------ .../stock/class/mouvementstock.class.php | 2 +- htdocs/public/payment/newpayment.php | 48 +++++++--- htdocs/theme/eldy/global.inc.php | 10 +- htdocs/theme/md/style.css.php | 10 +- 15 files changed, 178 insertions(+), 91 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index aefe642970a..6e5ed9de613 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -3206,13 +3206,13 @@ if ($action == 'create') $thirdparty = $soc; $discount_type = 0; - $backtopage = urlencode($_SERVER["PHP_SELF"].'?socid='.$thirdparty->id.'&action='.$action.'&origin='.GETPOST('origin').'&originid='.GETPOST('originid')); + $backtopage = urlencode($_SERVER["PHP_SELF"].'?socid='.$thirdparty->id.'&action='.$action.'&origin='.GETPOST('origin', 'alpha').'&originid='.GETPOST('originid', 'int')); include DOL_DOCUMENT_ROOT.'/core/tpl/object_discounts.tpl.php'; print '
'.$langs->trans('DateInvoice').''; @@ -3223,14 +3223,14 @@ if ($action == 'create') if (!empty($conf->global->INVOICE_POINTOFTAX_DATE)) { print '
'.$langs->trans('DatePointOfTax').''; - $date_pointoftax = dol_mktime(12, 0, 0, $_POST['date_pointoftaxmonth'], $_POST['date_pointoftaxday'], $_POST['date_pointoftaxyear']); + $date_pointoftax = dol_mktime(12, 0, 0, GETPOST('date_pointoftaxmonth', 'int'), GETPOST('date_pointoftaxday', 'int'), GETPOST('date_pointoftaxyear', 'int')); print $form->selectDate($date_pointoftax ? $date_pointoftax : -1, 'date_pointoftax', '', '', '', "add", 1, 1); print '
'.$langs->trans('PaymentConditionsShort').''; - $form->select_conditions_paiements(isset($_POST['cond_reglement_id']) ? $_POST['cond_reglement_id'] : $cond_reglement_id, 'cond_reglement_id'); + $form->select_conditions_paiements(GETPOSTISSET('cond_reglement_id') ? GETPOST('cond_reglement_id', 'int') : $cond_reglement_id, 'cond_reglement_id'); print '
'; - if ($modecompta != 'CREANCES-DETTES') - { + if ($modecompta == 'RECETTES-DEPENSES') { if ($key > 0) { - print ''; + //print ''; } else { - print ''; + //print ''; } - } else { + } + elseif ($modecompta == 'CREANCES-DETTES') { if ($key > 0) { print ''; } else { - print ''; + //print ''; } print price($amount_ht[$key]); + if ($key > 0) print ''; } print ''; - if ($modecompta != 'CREANCES-DETTES') { + if ($modecompta == 'RECETTES-DEPENSES') { if ($key > 0) { - print ''; + //print ''; } else { - print ''; + //print ''; } - } else { + } + elseif ($modecompta == 'CREANCES-DETTES') { if ($key > 0) { print ''; } else { - print ''; + //print ''; } } print price($amount[$key]); + if ($modecompta == 'RECETTES-DEPENSES') { + if ($key > 0) { + //print ''; + } else { + //print ''; + } + } + elseif ($modecompta == 'CREANCES-DETTES') { + if ($key > 0) { + print ''; + } + } print '
'; - $tooltip=$langs->trans("GenericMaskCodes", $langs->transnoentities("Bom"), $langs->transnoentities("Bom")); + $tooltip=$langs->trans("GenericMaskCodes", $langs->transnoentities("MyObject"), $langs->transnoentities("MyObject")); $tooltip.=$langs->trans("GenericMaskCodes2"); $tooltip.=$langs->trans("GenericMaskCodes3"); - $tooltip.=$langs->trans("GenericMaskCodes4a", $langs->transnoentities("Bom"), $langs->transnoentities("Bom")); + $tooltip.=$langs->trans("GenericMaskCodes4a", $langs->transnoentities("MyObject"), $langs->transnoentities("MyObject")); $tooltip.=$langs->trans("GenericMaskCodes5"); // Parametrage du prefix $texte.= ''; - $texte.= ''; + $texte.= ''; $texte.= ''; @@ -137,9 +137,9 @@ class mod_myobject_advanced extends ModeleNumRefMyObject return 0; } - $date = ($object->date_bom ? $object->date_bom : $object->date); + $date = $object->date; - $numFinal=get_next_value($db, $mask, 'bom_bom', 'ref', '', null, $date); + $numFinal=get_next_value($db, $mask, 'mymodule_myobject', 'ref', '', null, $date); return $numFinal; } diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_standard.php b/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_standard.php index 0da53adb55f..f9a786dfe55 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_standard.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_standard.php @@ -18,11 +18,12 @@ */ /** - * \file htdocs/core/modules/bom/mod_bom_standard.php - * \ingroup bom + * \file htdocs/core/modules/mymodule/mod_myobject_standard.php + * \ingroup mymodule * \brief File of class to manage MyObject numbering rules standard */ -require_once DOL_DOCUMENT_ROOT .'/core/modules/bom/modules_bom.php'; +dol_include_once('/mymodule/core/modules/mymodule/modules_myobject.php'); + /** * Class to manage customer order numbering rules standard @@ -85,7 +86,7 @@ class mod_myobject_standard extends ModeleNumRefMyObject $posindice=8; $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; - $sql.= " FROM ".MAIN_DB_PREFIX."bom"; + $sql.= " FROM ".MAIN_DB_PREFIX."mymodule_myobject"; $sql.= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'"; $sql.= " AND entity = ".$conf->entity; @@ -119,7 +120,7 @@ class mod_myobject_standard extends ModeleNumRefMyObject // D'abord on recupere la valeur max $posindice=9; $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; - $sql.= " FROM ".MAIN_DB_PREFIX."bom_bom"; + $sql.= " FROM ".MAIN_DB_PREFIX."mymodule_myobject"; $sql.= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'"; $sql.= " AND entity = ".$conf->entity; @@ -132,7 +133,7 @@ class mod_myobject_standard extends ModeleNumRefMyObject } else { - dol_syslog("mod_bom_standard::getNextValue", LOG_DEBUG); + dol_syslog("mod_myobject_standard::getNextValue", LOG_DEBUG); return -1; } @@ -143,7 +144,7 @@ class mod_myobject_standard extends ModeleNumRefMyObject if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is else $num = sprintf("%04s", $max+1); - dol_syslog("mod_bom_standard::getNextValue return ".$this->prefix.$yymm."-".$num); + dol_syslog("mod_myobject_standard::getNextValue return ".$this->prefix.$yymm."-".$num); return $this->prefix.$yymm."-".$num; } } diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/modules_myobject.php b/htdocs/modulebuilder/template/core/modules/mymodule/modules_myobject.php index 4598a010287..5aa9642a898 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/modules_myobject.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/modules_myobject.php @@ -23,10 +23,9 @@ */ /** - * \file htdocs/core/modules/bom/modules_bom.php - * \ingroup bom - * \brief File that contains parent class for boms models - * and parent class for boms numbering models + * \file htdocs/core/modules/mymodule/modules_myobject.php + * \ingroup mymodule + * \brief File that contains parent class for myobjects document models and parent class for myobjects numbering models */ require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; @@ -34,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // requir /** - * Parent class for boms models + * Parent class for documents models */ abstract class ModelePDFMyObject extends CommonDocGenerator { @@ -52,7 +51,7 @@ abstract class ModelePDFMyObject extends CommonDocGenerator // phpcs:enable global $conf; - $type = 'bom'; + $type = 'mymodule_myobject'; $list = array(); include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; @@ -65,7 +64,7 @@ abstract class ModelePDFMyObject extends CommonDocGenerator /** - * Parent class to manage numbering of BOMs + * Parent class to manage numbering of MyObject */ abstract class ModeleNumRefMyObject { @@ -92,7 +91,7 @@ abstract class ModeleNumRefMyObject public function info() { global $langs; - $langs->load("mrp"); + $langs->load("mymodule@mymodule"); return $langs->trans("NoDescription"); } @@ -104,7 +103,7 @@ abstract class ModeleNumRefMyObject public function getExample() { global $langs; - $langs->load("mrp"); + $langs->load("mymodule@mymodule"); return $langs->trans("NoExample"); } diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 415e7cc7f99..840e46c9c1c 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -182,25 +182,39 @@ if (empty($reshook)) } } - if (! $error) { - // Record consumption - $moline = new MoLine($db); - - $result = $moline->create($user); - if ($result <= 0) { + $idstockmove = 0; + if (! $error && GETPOST('idwarehouse-'.$line->id.'-'.$i) > 0) { + // Record stock movement + $id_product_batch = 0; + $idstockmove = $stockmove->livraison($user, $line->fk_product, GETPOST('idwarehouse-'.$line->id.'-'.$i), GETPOST('qty-'.$line->id.'-'.$i), 0, $labelmovement, dol_now(), '', '', GETPOST('batch-'.$line->id.'-'.$i), $id_product_batch, $codemovement); + if ($idstockmove < 0) { $error++; - setEventMessages($moline->error, $moline->errors, 'errors'); + setEventMessages($stockmove->error, $stockmove->errors, 'errors'); } } if (! $error) { - // Record stock movement - $id_product_batch = 0; - $result = $stockmove->livraison($user, $line->fk_product, GETPOST('idwarehouse-'.$line->id.'-'.$i), GETPOST('qty-'.$line->id.'-'.$i), 0, $labelmovement, dol_now(), '', '', GETPOST('batch-'.$line->id.'-'.$i), $id_product_batch, $codemovement); - if ($result <= 0) { + $pos = 0; + // Record consumption + $moline = new MoLine($db); + $moline->fk_mo = $object->id; + $moline->position = $pos; + $moline->fk_product = $line->fk_product; + $moline->fk_warehouse = GETPOST('idwarehouse-'.$line->id.'-'.$i); + $moline->qty = GETPOST('qty-'.$line->id.'-'.$i); + $moline->batch = GETPOST('batch-'.$line->id.'-'.$i); + $moline->role = 'consumed'; + $moline->fk_mrp_production = $line->id; + $moline->fk_stock_movement = $idstockmove; + $moline->fk_user_creat = $user->id; + + $resultmoline = $moline->create($user); + if ($resultmoline <= 0) { $error++; - setEventMessages($stockmove->error, $stockmove->errors, 'errors'); + setEventMessages($moline->error, $moline->errors, 'errors'); } + + $pos++; } $i++; @@ -230,25 +244,39 @@ if (empty($reshook)) } } - if (! $error) { - // Record production - $moline = new MoLine($db); - - $result = $moline->create($user); - if ($result <= 0) { + $idstockmove = 0; + if (! $error && GETPOST('idwarehousetoproduce-'.$line->id.'-'.$i) > 0) { + // Record stock movement + $id_product_batch = 0; + $idstockmove = $stockmove->reception($user, $line->fk_product, GETPOST('idwarehousetoproduce-'.$line->id.'-'.$i), GETPOST('qtytoproduce-'.$line->id.'-'.$i), 0, $labelmovement, dol_now(), '', '', GETPOST('batchtoproduce-'.$line->id.'-'.$i), $id_product_batch, $codemovement); + if ($idstockmove < 0) { $error++; - setEventMessages($moline->error, $moline->errors, 'errors'); + setEventMessages($stockmove->error, $stockmove->errors, 'errors'); } } if (! $error) { - // Record stock movement - $id_product_batch = 0; - $result = $stockmove->reception($user, $line->fk_product, GETPOST('idwarehouse-'.$line->id.'-'.$i), GETPOST('qty-'.$line->id.'-'.$i), 0, $labelmovement, dol_now(), '', '', GETPOST('batch-'.$line->id.'-'.$i), $id_product_batch, $codemovement); - if ($result <= 0) { + $pos = 0; + // Record production + $moline = new MoLine($db); + $moline->fk_mo = $object->id; + $moline->position = $pos; + $moline->fk_product = $line->fk_product; + $moline->fk_warehouse = GETPOST('idwarehousetoproduce-'.$line->id.'-'.$i); + $moline->qty = GETPOST('qtytoproduce-'.$line->id.'-'.$i); + $moline->batch = GETPOST('batchtoproduce-'.$line->id.'-'.$i); + $moline->role = 'produced'; + $moline->fk_mrp_production = $line->id; + $moline->fk_stock_movement = $idstockmove; + $moline->fk_user_creat = $user->id; + + $resultmoline = $moline->create($user); + if ($resultmoline <= 0) { $error++; - setEventMessages($stockmove->error, $stockmove->errors, 'errors'); + setEventMessages($moline->error, $moline->errors, 'errors'); } + + $pos++; } $i++; @@ -261,9 +289,13 @@ if (empty($reshook)) $qtyremaintoconsume = 0; $qtyremaintoproduce = 0; if ($qtyremaintoconsume == 0 && $qtyremaintoproduce == 0) { - $object->setStatut($object::STATUS_INPROGRESS); + $result = $object->setStatut($object::STATUS_INPROGRESS, 0, '', 'MRP_MO_PRODUCED'); } else { - $object->setStatut($object::STATUS_PRODUCED); + $result = $object->setStatut($object::STATUS_PRODUCED, 0, '', 'MRP_MO_PRODUCED'); + } + if ($result <= 0) { + $error++; + setEventMessages($object->error, $object->errors, 'errors'); } } @@ -273,13 +305,11 @@ if (empty($reshook)) } else { $db->commit(); } - } } - /* * View */ @@ -498,12 +528,13 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if ($action == 'consumeandproduceall') { $defaultstockmovementlabel = GETPOST('inventorylabel', 'alphanohtml') ? GETPOST('inventorylabel', 'alphanohtml') : $langs->trans("ProductionForRefAndDate", $object->ref, dol_print_date(dol_now(), 'standard')); - $defaultstockmovementcode = GETPOST('inventorycode', 'alphanohtml') ? GETPOST('inventorycode', 'alphanohtml') : $object->ref.'_'.dol_print_date(dol_now(), 'dayhourlog'); + //$defaultstockmovementcode = GETPOST('inventorycode', 'alphanohtml') ? GETPOST('inventorycode', 'alphanohtml') : $object->ref.'_'.dol_print_date(dol_now(), 'dayhourlog'); + $defaultstockmovementcode = GETPOST('inventorycode', 'alphanohtml') ? GETPOST('inventorycode', 'alphanohtml') : $object->ref; print '
'; print ''.$langs->trans("ConfirmProductionDesc", $langs->transnoentitiesnoconv("Confirm")).'
'; print $langs->trans("MovementLabel").':   '; - print $langs->trans("InventoryCode").':

'; + print $langs->trans("InventoryCode").':

'; print ' '.$langs->trans("AutoCloseMO").'
'; print ''; print '   '; diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index a85b375b085..c50d816f14f 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -97,7 +97,7 @@ class MouvementStock extends CommonObject * @param int $entrepot_id Id of warehouse * @param int $qty Qty of movement (can be <0 or >0 depending on parameter type) * @param int $type Direction of movement: - * 0=input (stock increase by a stock transfer), 1=output (stock decrease after by a stock transfer), + * 0=input (stock increase by a stock transfer), 1=output (stock decrease by a stock transfer), * 2=output (stock decrease), 3=input (stock increase) * Note that qty should be > 0 with 0 or 3, < 0 with 1 or 2. * @param int $price Unit price HT of product, used to calculate average weighted price (PMP in french). If 0, average weighted price is not changed. diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 1357f9a86bb..f91ec5e0653 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -843,7 +843,11 @@ if (!$source) { $found = true; $tag = GETPOST("tag", 'alpha'); - $fulltag = "TAG=".$tag; + if (GETPOST('fulltag', 'alpha')) { + $fulltag = GETPOST('fulltag', 'alpha'); + } else { + $fulltag = "TAG=".$tag; + } // Creditor print '
"; + } + else + { + $counter = ""; + } + $data[] = array( 'rowid'=>$val['rowid'], 'fk_menu'=>$val['fk_parent'], - 'entry'=>'
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 1).' 
'.$langs->trans("Creditor"); @@ -910,8 +914,12 @@ if ($source == 'order') $amount = price2num($amount); } - $fulltag = 'ORD='.$order->id.'.CUS='.$order->thirdparty->id; - if (!empty($TAG)) { $tag = $TAG; $fulltag .= '.TAG='.$TAG; } + if (GETPOST('fulltag', 'alpha')) { + $fulltag = GETPOST('fulltag', 'alpha'); + } else { + $fulltag = 'ORD='.$order->id.'.CUS='.$order->thirdparty->id; + if (!empty($TAG)) { $tag = $TAG; $fulltag .= '.TAG='.$TAG; } + } $fulltag = dol_string_unaccent($fulltag); // Creditor @@ -1029,9 +1037,12 @@ if ($source == 'invoice') $amount = price2num($amount); } - $fulltag = 'INV='.$invoice->id.'.CUS='.$invoice->thirdparty->id; - //$fulltag.='.NAM='.strtr($invoice->thirdparty->name,"-"," "); - if (!empty($TAG)) { $tag = $TAG; $fulltag .= '.TAG='.$TAG; } + if (GETPOST('fulltag', 'alpha')) { + $fulltag = GETPOST('fulltag', 'alpha'); + } else { + $fulltag = 'INV='.$invoice->id.'.CUS='.$invoice->thirdparty->id; + if (!empty($TAG)) { $tag = $TAG; $fulltag .= '.TAG='.$TAG; } + } $fulltag = dol_string_unaccent($fulltag); // Creditor @@ -1202,9 +1213,12 @@ if ($source == 'contractline') $amount = price2num($amount); } - $fulltag = 'COL='.$contractline->id.'.CON='.$contract->id.'.CUS='.$contract->thirdparty->id.'.DAT='.dol_print_date(dol_now(), '%Y%m%d%H%M'); - //$fulltag.='.NAM='.strtr($contract->thirdparty->name,"-"," "); - if (!empty($TAG)) { $tag = $TAG; $fulltag .= '.TAG='.$TAG; } + if (GETPOST('fulltag', 'alpha')) { + $fulltag = GETPOST('fulltag', 'alpha'); + } else { + $fulltag = 'COL='.$contractline->id.'.CON='.$contract->id.'.CUS='.$contract->thirdparty->id.'.DAT='.dol_print_date(dol_now(), '%Y%m%d%H%M%S'); + if (!empty($TAG)) { $tag = $TAG; $fulltag .= '.TAG='.$TAG; } + } $fulltag = dol_string_unaccent($fulltag); $qty = 1; @@ -1367,8 +1381,12 @@ if ($source == 'membersubscription') $amount = price2num($amount); } - $fulltag = 'MEM='.$member->id.'.DAT='.dol_print_date(dol_now(), '%Y%m%d%H%M'); - if (!empty($TAG)) { $tag = $TAG; $fulltag .= '.TAG='.$TAG; } + if (GETPOST('fulltag', 'alpha')) { + $fulltag = GETPOST('fulltag', 'alpha'); + } else { + $fulltag = 'MEM='.$member->id.'.DAT='.dol_print_date(dol_now(), '%Y%m%d%H%M%S'); + if (!empty($TAG)) { $tag = $TAG; $fulltag .= '.TAG='.$TAG; } + } $fulltag = dol_string_unaccent($fulltag); // Creditor @@ -1531,8 +1549,12 @@ if ($source == 'donation') $amount = price2num($amount); } - $fulltag = 'DON='.$don->ref.'.DAT='.dol_print_date(dol_now(), '%Y%m%d%H%M'); - if (!empty($TAG)) { $tag = $TAG; $fulltag .= '.TAG='.$TAG; } + if (GETPOST('fulltag', 'alpha')) { + $fulltag = GETPOST('fulltag', 'alpha'); + } else { + $fulltag = 'DON='.$don->ref.'.DAT='.dol_print_date(dol_now(), '%Y%m%d%H%M%S'); + if (!empty($TAG)) { $tag = $TAG; $fulltag .= '.TAG='.$TAG; } + } $fulltag = dol_string_unaccent($fulltag); // Creditor diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 55a4f3813e9..c8c535a9038 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -5173,9 +5173,17 @@ dd.dropdowndd ul li { /* ============================================================================== */ -/* JMobile */ +/* JMobile - Android */ /* ============================================================================== */ +.searchpage .tagtr .tagtd { + padding-bottom: 3px; +} +.searchpage .tagtr .tagtd .button { + background: unset; + border: unset; +} + li.ui-li-divider .ui-link { color: #FFF !important; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 604bc743f93..50c637be3c9 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -5306,9 +5306,17 @@ dd.dropdowndd ul li { /* ============================================================================== */ -/* JMobile */ +/* JMobile - Android */ /* ============================================================================== */ +.searchpage .tagtr .tagtd { + padding-bottom: 3px; +} +.searchpage .tagtr .tagtd .button { + background: unset; + border: unset; +} + li.ui-li-divider .ui-link { color: #FFF !important; } From bcdf19f0ffa750a9bb2146626de871c25f31b7f6 Mon Sep 17 00:00:00 2001 From: AdrianDominik Date: Mon, 27 Jan 2020 10:54:08 +0100 Subject: [PATCH 013/306] FIX: #12908 User login with credentials from self-subscription form fails --- htdocs/adherents/class/adherent.class.php | 32 +- htdocs/user/class/user.class.php | 338 +++++++++++----------- 2 files changed, 191 insertions(+), 179 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index ff2e5082736..2c2602bca56 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -641,7 +641,7 @@ class Adherent extends CommonObject $isencrypted = empty($conf->global->DATABASE_PWD_ENCRYPTED)?0:1; // If password to set differs from the one found into database - $result=$this->setPassword($user, $this->pass, $isencrypted, $notrigger, $nosyncuserpass); + $result=$this->setPassword($user, $this->pass, $this->pass_indatabase_crypted, $isencrypted, $notrigger, $nosyncuserpass); if (! $nbrowsaffected) $nbrowsaffected++; } } @@ -966,7 +966,7 @@ class Adherent extends CommonObject * @param int $nosyncuser Do not synchronize linked user * @return string If OK return clear password, 0 if no change, < 0 if error */ - public function setPassword($user, $password = '', $isencrypted = 0, $notrigger = 0, $nosyncuser = 0) + public function setPassword($user, $password = '', $password_indatabase_crypted = '', $isencrypted = 0, $notrigger = 0, $nosyncuser = 0) { global $conf, $langs; @@ -974,21 +974,23 @@ class Adherent extends CommonObject dol_syslog(get_class($this)."::setPassword user=".$user->id." password=".preg_replace('/./i', '*', $password)." isencrypted=".$isencrypted); - // If new password not provided, we generate one - if (! $password) + // If password_crypted not provided, try crypt password provided + if(!$password_indatabase_crypted) { - require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; - $password=getRandomPassword(false); + // If new password not provided, we generate one + if (!$password) + { + require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; + $password=getRandomPassword(false); + } + + // Crypt password + $password_crypted = dol_hash($password); + + } else { + $password_crypted = $password_indatabase_crypted; } - // Crypt password - $password_crypted = dol_hash($password); - - $password_indatabase = ''; - if (! $isencrypted) - { - $password_indatabase = $password; - } $this->db->begin(); @@ -1030,7 +1032,7 @@ class Adherent extends CommonObject if ($result >= 0) { - $result=$luser->setPassword($user, $this->pass, 0, 0, 1); + $result=$luser->setPassword($user, $this->pass, $this->pass_indatabase_crypted, 0, 0, 1); if ($result < 0) { $this->error=$luser->error; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 9bfe66d9dec..ff5639b91ad 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -75,34 +75,34 @@ class User extends CommonObject public $personal_email; - /** - * @var array array of socialnetworks - */ - public $socialnetworks; + /** + * @var array array of socialnetworks + */ + public $socialnetworks; - /** - * Skype username - * @var string - * @deprecated - */ + /** + * Skype username + * @var string + * @deprecated + */ public $skype; - /** - * Twitter username - * @var string - * @deprecated - */ + /** + * Twitter username + * @var string + * @deprecated + */ public $twitter; - /** - * Facebook username - * @var string - * @deprecated - */ + /** + * Facebook username + * @var string + * @deprecated + */ public $facebook; - /** - * Linkedin username - * @var string - * @deprecated - */ + /** + * Linkedin username + * @var string + * @deprecated + */ public $linkedin; public $job; // job position @@ -121,7 +121,7 @@ class User extends CommonObject public $office_phone; public $office_fax; public $user_mobile; - public $personal_mobile; + public $personal_mobile; public $admin; public $login; public $api_key; @@ -139,18 +139,18 @@ class User extends CommonObject public $pass_indatabase_crypted; /** - * Date creation record (datec) - * - * @var integer - */ - public $datec; + * Date creation record (datec) + * + * @var integer + */ + public $datec; /** - * Date modification record (tms) - * - * @var integer - */ - public $datem; + * Date modification record (tms) + * + * @var integer + */ + public $datem; //! If this is defined, it is an external user /** @@ -167,8 +167,8 @@ class User extends CommonObject public $contactid; /** - * @var int ID - */ + * @var int ID + */ public $fk_member; /** @@ -176,7 +176,7 @@ class User extends CommonObject */ public $fk_user; public $fk_user_expense_validator; - public $fk_user_holiday_validator; + public $fk_user_holiday_validator; public $clicktodial_url; public $clicktodial_login; @@ -222,10 +222,10 @@ class User extends CommonObject public $fk_warehouse; public $fields = array( - 'rowid'=>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'index'=>1, 'position'=>1, 'comment'=>'Id'), - 'lastname'=>array('type'=>'varchar(50)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>20, 'searchall'=>1, 'comment'=>'Reference of object'), - 'firstname'=>array('type'=>'varchar(50)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'), - ); + 'rowid'=>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'index'=>1, 'position'=>1, 'comment'=>'Id'), + 'lastname'=>array('type'=>'varchar(50)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>20, 'searchall'=>1, 'comment'=>'Reference of object'), + 'firstname'=>array('type'=>'varchar(50)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'), + ); const STATUS_DISABLED = 0; @@ -391,7 +391,7 @@ class User extends CommonObject $this->office_phone = $obj->office_phone; $this->office_fax = $obj->office_fax; $this->user_mobile = $obj->user_mobile; - $this->personal_mobile = $obj->personal_mobile; + $this->personal_mobile = $obj->personal_mobile; $this->email = $obj->email; $this->personal_email = $obj->personal_email; $this->socialnetworks = (array) json_decode($obj->socialnetworks, true); @@ -427,8 +427,8 @@ class User extends CommonObject $this->contactid = $obj->fk_socpeople; $this->fk_member = $obj->fk_member; $this->fk_user = $obj->fk_user; - $this->fk_user_expense_validator = $obj->fk_user_expense_validator; - $this->fk_user_holiday_validator = $obj->fk_user_holiday_validator; + $this->fk_user_expense_validator = $obj->fk_user_expense_validator; + $this->fk_user_holiday_validator = $obj->fk_user_holiday_validator; $this->default_range = $obj->default_range; $this->default_c_exp_tax_cat = $obj->default_c_exp_tax_cat; @@ -1032,7 +1032,7 @@ class User extends CommonObject * Existing categories are left untouch. * * @param int[]|int $categories Category or categories IDs - * @return void + * @return void */ public function setCategories($categories) { @@ -1122,24 +1122,24 @@ class User extends CommonObject // Remove extrafields if ((!$error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used { - $result = $this->deleteExtraFields(); - if ($result < 0) - { - $error++; - dol_syslog(get_class($this)."::delete error -4 ".$this->error, LOG_ERR); - } + $result = $this->deleteExtraFields(); + if ($result < 0) + { + $error++; + dol_syslog(get_class($this)."::delete error -4 ".$this->error, LOG_ERR); + } } // Remove user if (!$error) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."user WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::delete", LOG_DEBUG); - if (!$this->db->query($sql)) - { - $error++; - $this->error = $this->db->lasterror(); - } + dol_syslog(get_class($this)."::delete", LOG_DEBUG); + if (!$this->db->query($sql)) + { + $error++; + $this->error = $this->db->lasterror(); + } } if (!$error) @@ -1180,7 +1180,7 @@ class User extends CommonObject if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->lastname = ucwords($this->lastname); if (!empty($conf->global->MAIN_ALL_TO_UPPER)) $this->lastname = strtoupper($this->lastname); - if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->firstname = ucwords($this->firstname); + if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->firstname = ucwords($this->firstname); $this->login = trim($this->login); if (!isset($this->entity)) $this->entity = $conf->entity; // If not defined, we use default value @@ -1302,7 +1302,7 @@ class User extends CommonObject } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Create a user from a contact object. User will be internal but if contact is linked to a third party, user will be external * @@ -1313,7 +1313,7 @@ class User extends CommonObject */ public function create_from_contact($contact, $login = '', $password = '') { - // phpcs:enable + // phpcs:enable global $conf, $user, $langs; $error = 0; @@ -1381,7 +1381,7 @@ class User extends CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Create a user into database from a member object * @@ -1391,7 +1391,7 @@ class User extends CommonObject */ public function create_from_member($member, $login = '') { - // phpcs:enable + // phpcs:enable global $conf, $user, $langs; // Positionne parametres @@ -1402,6 +1402,7 @@ class User extends CommonObject $this->email = $member->email; $this->fk_member = $member->id; $this->pass = $member->pass; + $this->pass_indatabase_crypted = $member->pass_indatabase_crypted; $this->address = $member->address; $this->zip = $member->zip; $this->town = $member->town; @@ -1417,7 +1418,7 @@ class User extends CommonObject $result = $this->create($user); if ($result > 0) { - $newpass = $this->setPassword($user, $this->pass); + $newpass = $this->setPassword($user, $this->pass, $this->pass_indatabase_crypted); if (is_numeric($newpass) && $newpass < 0) $result = -2; if ($result > 0 && $member->fk_soc) // If member is linked to a thirdparty @@ -1456,7 +1457,7 @@ class User extends CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Assign rights by default * @@ -1464,7 +1465,7 @@ class User extends CommonObject */ public function set_default_rights() { - // phpcs:enable + // phpcs:enable global $conf; $sql = "SELECT id FROM ".MAIN_DB_PREFIX."rights_def"; @@ -1523,7 +1524,7 @@ class User extends CommonObject if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->lastname = ucwords($this->lastname); if (!empty($conf->global->MAIN_ALL_TO_UPPER)) $this->lastname = strtoupper($this->lastname); - if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->firstname = ucwords($this->firstname); + if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->firstname = ucwords($this->firstname); $this->lastname = trim($this->lastname); $this->firstname = trim($this->firstname); @@ -1541,9 +1542,9 @@ class User extends CommonObject $this->office_phone = trim($this->office_phone); $this->office_fax = trim($this->office_fax); $this->user_mobile = trim($this->user_mobile); - $this->personal_mobile = trim($this->personal_mobile); + $this->personal_mobile = trim($this->personal_mobile); $this->email = trim($this->email); - $this->personal_email = trim($this->personal_email); + $this->personal_email = trim($this->personal_email); $this->job = trim($this->job); $this->signature = trim($this->signature); @@ -1594,10 +1595,10 @@ class User extends CommonObject $sql .= ", office_phone = '".$this->db->escape($this->office_phone)."'"; $sql .= ", office_fax = '".$this->db->escape($this->office_fax)."'"; $sql .= ", user_mobile = '".$this->db->escape($this->user_mobile)."'"; - $sql .= ", personal_mobile = '".$this->db->escape($this->personal_mobile)."'"; + $sql .= ", personal_mobile = '".$this->db->escape($this->personal_mobile)."'"; $sql .= ", email = '".$this->db->escape($this->email)."'"; - $sql .= ", personal_email = '".$this->db->escape($this->personal_email)."'"; - $sql .= ", socialnetworks = '".$this->db->escape(json_encode($this->socialnetworks))."'"; + $sql .= ", personal_email = '".$this->db->escape($this->personal_email)."'"; + $sql .= ", socialnetworks = '".$this->db->escape(json_encode($this->socialnetworks))."'"; $sql .= ", job = '".$this->db->escape($this->job)."'"; $sql .= ", signature = '".$this->db->escape($this->signature)."'"; $sql .= ", accountancy_code = '".$this->db->escape($this->accountancy_code)."'"; @@ -1609,8 +1610,8 @@ class User extends CommonObject $sql .= ", photo = ".($this->photo ? "'".$this->db->escape($this->photo)."'" : "null"); $sql .= ", openid = ".($this->openid ? "'".$this->db->escape($this->openid)."'" : "null"); $sql .= ", fk_user = ".($this->fk_user > 0 ? "'".$this->db->escape($this->fk_user)."'" : "null"); - $sql .= ", fk_user_expense_validator = ".($this->fk_user_expense_validator > 0 ? "'".$this->db->escape($this->fk_user_expense_validator)."'" : "null"); - $sql .= ", fk_user_holiday_validator = ".($this->fk_user_holiday_validator > 0 ? "'".$this->db->escape($this->fk_user_holiday_validator)."'" : "null"); + $sql .= ", fk_user_expense_validator = ".($this->fk_user_expense_validator > 0 ? "'".$this->db->escape($this->fk_user_expense_validator)."'" : "null"); + $sql .= ", fk_user_holiday_validator = ".($this->fk_user_holiday_validator > 0 ? "'".$this->db->escape($this->fk_user_holiday_validator)."'" : "null"); if (isset($this->thm) || $this->thm != '') $sql .= ", thm= ".($this->thm != '' ? "'".$this->db->escape($this->thm)."'" : "null"); if (isset($this->tjm) || $this->tjm != '') $sql .= ", tjm= ".($this->tjm != '' ? "'".$this->db->escape($this->tjm)."'" : "null"); if (isset($this->salary) || $this->salary != '') $sql .= ", salary= ".($this->salary != '' ? "'".$this->db->escape($this->salary)."'" : "null"); @@ -1810,7 +1811,7 @@ class User extends CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Mise a jour en base de la date de derniere connexion d'un utilisateur * Fonction appelee lors d'une nouvelle connexion @@ -1819,7 +1820,7 @@ class User extends CommonObject */ public function update_last_login_date() { - // phpcs:enable + // phpcs:enable $now = dol_now(); $sql = "UPDATE ".MAIN_DB_PREFIX."user SET"; @@ -1854,7 +1855,7 @@ class User extends CommonObject * @param int $nosyncmember Do not synchronize linked member * @return string If OK return clear password, 0 if no change, < 0 if error */ - public function setPassword($user, $password = '', $changelater = 0, $notrigger = 0, $nosyncmember = 0) + public function setPassword($user, $password = '', $password_indatabase_crypted = '', $changelater = 0, $notrigger = 0, $nosyncmember = 0) { global $conf, $langs; require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; @@ -1863,14 +1864,23 @@ class User extends CommonObject dol_syslog(get_class($this)."::setPassword user=".$user->id." password=".preg_replace('/./i', '*', $password)." changelater=".$changelater." notrigger=".$notrigger." nosyncmember=".$nosyncmember, LOG_DEBUG); - // If new password not provided, we generate one - if (!$password) + // If password_crypted not provided, try crypt password provided + if(!$password_indatabase_crypted) { - $password = getRandomPassword(false); + // If new password not provided, we generate one + if (!$password) + { + $password = getRandomPassword(false); + } + + // Crypt password + $password_crypted = dol_hash($password); + + } else { + $password_crypted = $password_indatabase_crypted; } - // Crypt password - $password_crypted = dol_hash($password); + // Mise a jour if (!$changelater) @@ -1913,7 +1923,7 @@ class User extends CommonObject if ($result >= 0) { - $result = $adh->setPassword($user, $this->pass, (empty($conf->global->DATABASE_PWD_ENCRYPTED) ? 0 : 1), 1); // Cryptage non gere dans module adherent + $result = $adh->setPassword($user, $this->pass, $this->pass_indatabase_crypted, (empty($conf->global->DATABASE_PWD_ENCRYPTED) ? 0 : 1), 1); // Cryptage non gere dans module adherent if ($result < 0) { $this->error = $adh->error; @@ -1977,7 +1987,7 @@ class User extends CommonObject } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Send new password by email * @@ -1988,7 +1998,7 @@ class User extends CommonObject */ public function send_password($user, $password = '', $changelater = 0) { - // phpcs:enable + // phpcs:enable global $conf, $langs; global $dolibarr_main_url_root; @@ -2002,19 +2012,19 @@ class User extends CommonObject $outputlangs = new Translate("", $conf); if (isset($this->conf->MAIN_LANG_DEFAULT) - && $this->conf->MAIN_LANG_DEFAULT != 'auto') + && $this->conf->MAIN_LANG_DEFAULT != 'auto') { // If user has defined its own language (rare because in most cases, auto is used) $outputlangs->getDefaultLang($this->conf->MAIN_LANG_DEFAULT); } if ($user->conf->MAIN_LANG_DEFAULT) { - $outputlangs->setDefaultLang($user->conf->MAIN_LANG_DEFAULT); - } + $outputlangs->setDefaultLang($user->conf->MAIN_LANG_DEFAULT); + } else { // If user has not defined its own language, we used current language $outputlangs = $langs; } - // Load translation files required by the page + // Load translation files required by the page $outputlangs->loadLangs(array("main", "errors", "users", "other")); $appli = constant('DOL_APPLICATION_TITLE'); @@ -2057,8 +2067,8 @@ class User extends CommonObject dol_syslog(get_class($this)."::send_password changelater is on, url=".$url); } - $mailfile = new CMailFile( - $subject, + $mailfile = new CMailFile( + $subject, $this->email, $conf->global->MAIN_MAIL_EMAIL_FROM, $mesg, @@ -2068,8 +2078,8 @@ class User extends CommonObject '', '', 0, - $msgishtml - ); + $msgishtml + ); if ($mailfile->sendfile()) { @@ -2094,7 +2104,7 @@ class User extends CommonObject } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Read clicktodial information for user * @@ -2102,7 +2112,7 @@ class User extends CommonObject */ public function fetch_clicktodial() { - // phpcs:enable + // phpcs:enable $sql = "SELECT url, login, pass, poste "; $sql .= " FROM ".MAIN_DB_PREFIX."user_clicktodial as u"; $sql .= " WHERE u.fk_user = ".$this->id; @@ -2132,15 +2142,15 @@ class User extends CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Update clicktodial info * * @return int <0 if KO, >0 if OK - */ - public function update_clicktodial() - { - // phpcs:enable + */ + public function update_clicktodial() + { + // phpcs:enable $this->db->begin(); $sql = "DELETE FROM ".MAIN_DB_PREFIX."user_clicktodial"; @@ -2170,10 +2180,10 @@ class User extends CommonObject $this->error = $this->db->lasterror(); return -1; } - } + } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Add user into a group * @@ -2184,7 +2194,7 @@ class User extends CommonObject */ public function SetInGroup($group, $entity, $notrigger = 0) { - // phpcs:enable + // phpcs:enable global $conf, $langs, $user; $error = 0; @@ -2235,7 +2245,7 @@ class User extends CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Remove a user from a group * @@ -2246,7 +2256,7 @@ class User extends CommonObject */ public function RemoveFromGroup($group, $entity, $notrigger = 0) { - // phpcs:enable + // phpcs:enable global $conf, $langs, $user; $error = 0; @@ -2333,7 +2343,7 @@ class User extends CommonObject global $dolibarr_main_authentication, $dolibarr_main_demo; global $menumanager; - if (!$user->rights->user->user->lire && $user->id != $this->id) $option = 'nolink'; + if (!$user->rights->user->user->lire && $user->id != $this->id) $option = 'nolink'; if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && $withpictoimg) $withpictoimg = 0; @@ -2427,8 +2437,8 @@ class User extends CommonObject $result .= (($option == 'nolink') ? '' : $linkstart); if ($withpictoimg) { - $paddafterimage = ''; - if (abs($withpictoimg) == 1) $paddafterimage = 'style="margin-'.($langs->trans("DIRECTION") == 'rtl' ? 'left' : 'right').': 3px;"'; + $paddafterimage = ''; + if (abs($withpictoimg) == 1) $paddafterimage = 'style="margin-'.($langs->trans("DIRECTION") == 'rtl' ? 'left' : 'right').': 3px;"'; // Only picto if ($withpictoimg > 0) $picto = ''.img_object('', 'user', $paddafterimage.' '.($notooltip ? '' : 'class="classfortooltip"'), 0, 0, $notooltip ? 0 : 1).''; // Picto must be a photo @@ -2482,7 +2492,7 @@ class User extends CommonObject $linkend = ''; } - if ($option == 'nolink') + if ($option == 'nolink') { $linkstart = ''; $linkend = ''; @@ -2506,17 +2516,17 @@ class User extends CommonObject return $this->LibStatut($this->statut, $mode); } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - /** - * Return label of a status of user (active, inactive) - * - * @param int $status Id status + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return label of a status of user (active, inactive) + * + * @param int $status Id status * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto - * @return string Label of status - */ - public function LibStatut($status, $mode = 0) - { - // phpcs:enable + * @return string Label of status + */ + public function LibStatut($status, $mode = 0) + { + // phpcs:enable global $langs; if (empty($this->labelStatus) || empty($this->labelStatusShort)) @@ -2549,7 +2559,7 @@ class User extends CommonObject */ public function _load_ldap_dn($info, $mode = 0) { - // phpcs:enable + // phpcs:enable global $conf; $dn = ''; if ($mode == 0) $dn = $conf->global->LDAP_KEY_USERS."=".$info[$conf->global->LDAP_KEY_USERS].",".$conf->global->LDAP_USER_DN; @@ -2567,7 +2577,7 @@ class User extends CommonObject */ public function _load_ldap_info() { - // phpcs:enable + // phpcs:enable global $conf, $langs; $info = array(); @@ -2593,7 +2603,7 @@ class User extends CommonObject 'LDAP_FIELD_SKYPE' => 'skype', 'LDAP_FIELD_TWITTER' => 'twitter', 'LDAP_FIELD_FACEBOOK' => 'facebook', - 'LDAP_FIELD_LINKEDIN' => 'linkedin' + 'LDAP_FIELD_LINKEDIN' => 'linkedin' ); // Champs @@ -2677,22 +2687,22 @@ class User extends CommonObject if ($this->phone_mobile) $info["phpgwCellTelephoneNumber"] = $this->phone_mobile; } - if (!empty($conf->global->LDAP_FIELD_USERID))$info[$conf->global->LDAP_FIELD_USERID] = $this->id; - if (!empty($info[$conf->global->LDAP_FIELD_GROUPID])) { - $usergroup = new UserGroup($this->db); - $groupslist = $usergroup->listGroupsForUser($this->id); - $info[$conf->global->LDAP_FIELD_GROUPID] = '1'; - if (!empty($groupslist)) { - foreach ($groupslist as $groupforuser) { - $info[$conf->global->LDAP_FIELD_GROUPID] = $groupforuser->id; //Select first group in list - break; - } - } - } - if (!empty($this->firstname) && !empty($conf->global->LDAP_FIELD_HOMEDIRECTORY) && !empty($conf->global->LDAP_FIELD_HOMEDIRECTORYPREFIX)) $info[$conf->global->LDAP_FIELD_HOMEDIRECTORY] = "{$conf->global->LDAP_FIELD_HOMEDIRECTORYPREFIX}/$this->firstname"; + if (!empty($conf->global->LDAP_FIELD_USERID))$info[$conf->global->LDAP_FIELD_USERID] = $this->id; + if (!empty($info[$conf->global->LDAP_FIELD_GROUPID])) { + $usergroup = new UserGroup($this->db); + $groupslist = $usergroup->listGroupsForUser($this->id); + $info[$conf->global->LDAP_FIELD_GROUPID] = '1'; + if (!empty($groupslist)) { + foreach ($groupslist as $groupforuser) { + $info[$conf->global->LDAP_FIELD_GROUPID] = $groupforuser->id; //Select first group in list + break; + } + } + } + if (!empty($this->firstname) && !empty($conf->global->LDAP_FIELD_HOMEDIRECTORY) && !empty($conf->global->LDAP_FIELD_HOMEDIRECTORYPREFIX)) $info[$conf->global->LDAP_FIELD_HOMEDIRECTORY] = "{$conf->global->LDAP_FIELD_HOMEDIRECTORYPREFIX}/$this->firstname"; - return $info; - } + return $info; + } /** @@ -2719,7 +2729,7 @@ class User extends CommonObject $this->note_public = 'This is a note public'; $this->note_private = 'This is a note private'; $this->email = 'email@specimen.com'; - $this->personal_email = 'personalemail@specimen.com'; + $this->personal_email = 'personalemail@specimen.com'; $this->socialnetworks = array( 'skype' => 'skypepseudo', 'twitter' => 'twitterpseudo', @@ -2729,7 +2739,7 @@ class User extends CommonObject $this->office_phone = '0999999999'; $this->office_fax = '0999999998'; $this->user_mobile = '0999999997'; - $this->personal_mobile = '0999999996'; + $this->personal_mobile = '0999999996'; $this->admin = 0; $this->login = 'dolibspec'; $this->pass = 'dolibspec'; @@ -2854,7 +2864,7 @@ class User extends CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Update user using data from the LDAP * @@ -2863,7 +2873,7 @@ class User extends CommonObject */ public function update_ldap2dolibarr(&$ldapuser) { - // phpcs:enable + // phpcs:enable // TODO: Voir pourquoi le update met à jour avec toutes les valeurs vide (global $user écrase ?) global $user, $conf; @@ -2894,7 +2904,7 @@ class User extends CommonObject } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Return and array with all instanciated first level children users of current user * @@ -2903,7 +2913,7 @@ class User extends CommonObject */ public function get_children() { - // phpcs:enable + // phpcs:enable $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."user"; $sql .= " WHERE fk_user = ".$this->id; @@ -2962,7 +2972,7 @@ class User extends CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Build the hierarchy/tree of users into an array. * Set and return this->users that is an array sorted according to tree with arrays of: @@ -2976,9 +2986,9 @@ class User extends CommonObject * @param string $filter SQL filter on users * @return array Array of users $this->users. Note: $this->parentof is also set. */ - public function get_full_tree($deleteafterid = 0, $filter = '') - { - // phpcs:enable + public function get_full_tree($deleteafterid = 0, $filter = '') + { + // phpcs:enable global $conf, $user; global $hookmanager; @@ -3078,8 +3088,8 @@ class User extends CommonObject * @return array Array of user id lower than user (all levels under user). This overwrite this->users. * @see get_children() */ - public function getAllChildIds($addcurrentuser = 0) - { + public function getAllChildIds($addcurrentuser = 0) + { $childids = array(); if (isset($this->cache_childids[$this->id])) @@ -3107,7 +3117,7 @@ class User extends CommonObject return $childids; } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * For user id_user and its childs available in this->users, define property fullpath and fullname. * Function called by get_full_tree(). @@ -3116,9 +3126,9 @@ class User extends CommonObject * @param int $protection Deep counter to avoid infinite loop (no more required, a protection is added with array useridfound) * @return int < 0 if KO (infinit loop), >= 0 if OK */ - public function build_path_from_id_user($id_user, $protection = 0) - { - // phpcs:enable + public function build_path_from_id_user($id_user, $protection = 0) + { + // phpcs:enable dol_syslog(get_class($this)."::build_path_from_id_user id_user=".$id_user." protection=".$protection, LOG_DEBUG); if (!empty($this->users[$id_user]['fullpath'])) @@ -3171,7 +3181,7 @@ class User extends CommonObject } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Load metrics this->nb for dashboard * @@ -3179,7 +3189,7 @@ class User extends CommonObject */ public function load_state_board() { - // phpcs:enable + // phpcs:enable $this->nb = array(); @@ -3215,7 +3225,7 @@ class User extends CommonObject * @param int $hidedetails Hide details of lines * @param int $hidedesc Hide description * @param int $hideref Hide ref - * @param null|array $moreparams Array to provide more information + * @param null|array $moreparams Array to provide more information * @return int 0 if KO, 1 if OK */ public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null) @@ -3242,7 +3252,7 @@ class User extends CommonObject return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams); } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Return property of user from its id * @@ -3252,7 +3262,7 @@ class User extends CommonObject */ public function user_get_property($rowid, $mode) { - // phpcs:enable + // phpcs:enable $user_property = ''; if (empty($rowid)) return ''; @@ -3294,8 +3304,8 @@ class User extends CommonObject * @return int <0 if KO, >0 if OK */ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = array(), $filtermode = 'AND', $entityfilter = false) - { - global $conf, $user; + { + global $conf, $user; $sql = "SELECT t.rowid"; $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t '; @@ -3370,8 +3380,8 @@ class User extends CommonObject } else { - $this->errors[] = $this->db->lasterror(); - return -1; - } - } + $this->errors[] = $this->db->lasterror(); + return -1; + } + } } From dc0237f0e13349f88a26045f8c5abee57e277467 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 27 Jan 2020 09:58:18 +0000 Subject: [PATCH 014/306] Fixing style errors. --- htdocs/user/class/user.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index ff5639b91ad..8809873acc6 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1875,7 +1875,6 @@ class User extends CommonObject // Crypt password $password_crypted = dol_hash($password); - } else { $password_crypted = $password_indatabase_crypted; } From b3e5fcff1099f0d905f66278f549109ce02fd32e Mon Sep 17 00:00:00 2001 From: AdrianDominik Date: Mon, 27 Jan 2020 11:01:13 +0100 Subject: [PATCH 015/306] FIX: #12908 User login with credentials from self-subscription form fails --- htdocs/langs/es_ES/zapier.lang | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 htdocs/langs/es_ES/zapier.lang diff --git a/htdocs/langs/es_ES/zapier.lang b/htdocs/langs/es_ES/zapier.lang new file mode 100644 index 00000000000..6b28c81832e --- /dev/null +++ b/htdocs/langs/es_ES/zapier.lang @@ -0,0 +1,28 @@ +# Copyright (C) 2019 Frédéric FRANCE +# +# 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 +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# +# Generic +# + +# Module label 'ModuleZapierForDolibarrName' +ModuleZapierForDolibarrName = Zapier para Dolibarr +# Module description 'ModuleZapierForDolibarrDesc' +ModuleZapierForDolibarrDesc = Zapier para el módulo Dolibarr + +# +# Admin page +# +ZapierForDolibarrSetup = Configuración de Zapier para Dolibarr From b1724f7038d28418236e9906dcd6817410e36b9d Mon Sep 17 00:00:00 2001 From: AdrianDominik Date: Tue, 28 Jan 2020 09:25:49 +0100 Subject: [PATCH 016/306] FIX: #11975 When a product is split between multiple pages in a document, prices/quantity/etc appear on the last relevant page --- .../commande/doc/pdf_einstein.modules.php | 7 ++++++- .../commande/doc/pdf_eratosthene.modules.php | 16 ++++++++++++++-- .../modules/contract/doc/pdf_strato.modules.php | 8 +++++++- .../expedition/doc/pdf_espadon.modules.php | 16 ++++++++++++++-- .../expedition/doc/pdf_rouget.modules.php | 16 ++++++++++++++-- .../expensereport/doc/pdf_standard.modules.php | 8 +++++++- .../modules/facture/doc/pdf_crabe.modules.php | 16 ++++++++++++++-- .../modules/facture/doc/pdf_sponge.modules.php | 16 ++++++++++++++-- .../modules/livraison/doc/pdf_typhon.modules.php | 8 +++++++- .../modules/project/doc/pdf_baleine.modules.php | 8 +++++++- .../modules/project/doc/pdf_beluga.modules.php | 8 +++++++- .../project/doc/pdf_timespent.modules.php | 8 +++++++- .../modules/propale/doc/pdf_azur.modules.php | 16 ++++++++++++++-- .../modules/propale/doc/pdf_cyan.modules.php | 16 ++++++++++++++-- .../reception/doc/pdf_squille.modules.php | 16 ++++++++++++++-- .../modules/stock/doc/pdf_standard.modules.php | 8 +++++++- .../stock/doc/pdf_stdmovement.modules.php | 8 +++++++- .../supplier_invoice/pdf/pdf_canelle.modules.php | 8 +++++++- .../supplier_order/pdf/pdf_cornas.modules.php | 16 ++++++++++++++-- .../supplier_order/pdf/pdf_muscadet.modules.php | 16 ++++++++++++++-- .../doc/pdf_standard.modules.php | 8 +++++++- .../supplier_proposal/doc/pdf_aurore.modules.php | 16 ++++++++++++++-- 22 files changed, 230 insertions(+), 33 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 075ba0efb84..30fd293533b 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -440,7 +440,12 @@ class pdf_einstein extends ModelePDFCommandes else { // We found a page break - $showpricebeforepagebreak=0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; } } else // No pagebreak diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index 6342cd6ce74..b1dbca4dc56 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -572,7 +572,13 @@ class pdf_eratosthene extends ModelePDFCommandes $pdf->setPage($pageposbefore+1); $curY = $tab_top_newpage; - $showpricebeforepagebreak=0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } if (!empty($this->cols['photo']) && isset($imglinesize['width']) && isset($imglinesize['height'])) @@ -610,7 +616,13 @@ class pdf_eratosthene extends ModelePDFCommandes else { // We found a page break - $showpricebeforepagebreak=0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } } else // No pagebreak diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index badf7343295..c0cc4845aa5 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -391,7 +391,13 @@ class pdf_strato extends ModelePDFContract else { // We found a page break - $showpricebeforepagebreak=0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } } else // No pagebreak diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index 0e74faaa56d..3b917275040 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -433,7 +433,13 @@ class pdf_espadon extends ModelePdfExpedition $pdf->setPage($pageposbefore+1); $curY = $tab_top_newpage; - $showpricebeforepagebreak=0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } @@ -475,7 +481,13 @@ class pdf_espadon extends ModelePdfExpedition else { // We found a page break - $showpricebeforepagebreak=0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } } else // No pagebreak diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 0e9db902662..705b3db4064 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -452,7 +452,13 @@ class pdf_rouget extends ModelePdfExpedition $pdf->setPage($pageposbefore + 1); $curY = $tab_top_newpage; - $showpricebeforepagebreak = 0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } if (isset($imglinesize['width']) && isset($imglinesize['height'])) @@ -494,7 +500,13 @@ class pdf_rouget extends ModelePdfExpedition else { // We found a page break - $showpricebeforepagebreak = 0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } } else // No pagebreak diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index a2cefcf9ff0..2892b6196f3 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -385,7 +385,13 @@ class pdf_standard extends ModeleExpenseReport else { // We found a page break - $showpricebeforepagebreak=0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } } else // No pagebreak diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 64aa3c52e25..f623742bfe0 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -494,7 +494,13 @@ class pdf_crabe extends ModelePDFFactures $pdf->setPage($pageposbefore + 1); $curY = $tab_top_newpage; - $showpricebeforepagebreak = 0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } if (isset($imglinesize['width']) && isset($imglinesize['height'])) @@ -534,7 +540,13 @@ class pdf_crabe extends ModelePDFFactures else { // We found a page break - $showpricebeforepagebreak = 0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } } else // No pagebreak diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 3e00e2cab68..87a9face2bd 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -600,7 +600,13 @@ class pdf_sponge extends ModelePDFFactures $pdf->setPage($pageposbefore+1); $curY = $tab_top_newpage; - $showpricebeforepagebreak=0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } if (!empty($this->cols['photo']) && isset($imglinesize['width']) && isset($imglinesize['height'])) @@ -639,7 +645,13 @@ class pdf_sponge extends ModelePDFFactures else { // We found a page break - $showpricebeforepagebreak=0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } } else // No pagebreak diff --git a/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php b/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php index 00268810ce8..4d659ca193a 100644 --- a/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php +++ b/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php @@ -409,7 +409,13 @@ class pdf_typhon extends ModelePDFDeliveryOrder else { // We found a page break - $showpricebeforepagebreak=0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } } else // No pagebreak diff --git a/htdocs/core/modules/project/doc/pdf_baleine.modules.php b/htdocs/core/modules/project/doc/pdf_baleine.modules.php index 910ef3ec1cf..79941dba8d6 100644 --- a/htdocs/core/modules/project/doc/pdf_baleine.modules.php +++ b/htdocs/core/modules/project/doc/pdf_baleine.modules.php @@ -362,7 +362,13 @@ class pdf_baleine extends ModelePDFProjects else { // We found a page break - $showpricebeforepagebreak=0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + $forcedesconsamepage=1; if ($forcedesconsamepage) { diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index b26b46604ff..4072f22bf58 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -512,7 +512,13 @@ class pdf_beluga extends ModelePDFProjects else { // We found a page break - $showpricebeforepagebreak=0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + $forcedesconsamepage=1; if ($forcedesconsamepage) { diff --git a/htdocs/core/modules/project/doc/pdf_timespent.modules.php b/htdocs/core/modules/project/doc/pdf_timespent.modules.php index 27822545fa2..0c1eba3c9ac 100644 --- a/htdocs/core/modules/project/doc/pdf_timespent.modules.php +++ b/htdocs/core/modules/project/doc/pdf_timespent.modules.php @@ -293,7 +293,13 @@ class pdf_timespent extends ModelePDFProjects else { // We found a page break - $showpricebeforepagebreak=0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + $forcedesconsamepage=1; if ($forcedesconsamepage) { diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 9219de5863c..67496a7597c 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -502,7 +502,13 @@ class pdf_azur extends ModelePDFPropales $pdf->setPage($pageposbefore + 1); $curY = $tab_top_newpage; - $showpricebeforepagebreak = 0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } if (isset($imglinesize['width']) && isset($imglinesize['height'])) @@ -543,7 +549,13 @@ class pdf_azur extends ModelePDFPropales else { // We found a page break - $showpricebeforepagebreak = 0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } } else // No pagebreak diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 1e67ac6485c..308a67bedcc 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -582,7 +582,13 @@ class pdf_cyan extends ModelePDFPropales $pdf->setPage($pageposbefore+1); $curY = $tab_top_newpage; - $showpricebeforepagebreak=0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } @@ -624,7 +630,13 @@ class pdf_cyan extends ModelePDFPropales else { // We found a page break - $showpricebeforepagebreak=0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } } else // No pagebreak diff --git a/htdocs/core/modules/reception/doc/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php index 125c56960ca..93204a44a4b 100644 --- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php +++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php @@ -374,7 +374,13 @@ class pdf_squille extends ModelePdfReception $pdf->setPage($pageposbefore + 1); $curY = $tab_top_newpage; - $showpricebeforepagebreak = 0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } if (isset($imglinesize['width']) && isset($imglinesize['height'])) @@ -417,7 +423,13 @@ class pdf_squille extends ModelePdfReception else { // We found a page break - $showpricebeforepagebreak = 0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } } else // No pagebreak diff --git a/htdocs/core/modules/stock/doc/pdf_standard.modules.php b/htdocs/core/modules/stock/doc/pdf_standard.modules.php index 97c0744c121..292e551a1eb 100644 --- a/htdocs/core/modules/stock/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_standard.modules.php @@ -383,7 +383,13 @@ class pdf_standard extends ModelePDFStock else { // We found a page break - $showpricebeforepagebreak=0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } } else // No pagebreak diff --git a/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php b/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php index 4f59c2510b4..19986161413 100644 --- a/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php @@ -543,7 +543,13 @@ class pdf_stdmovement extends ModelePDFMovement else { // We found a page break - $showpricebeforepagebreak=0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } } else // No pagebreak diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index 32926e098e3..e1d6133ab39 100644 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -430,7 +430,13 @@ class pdf_canelle extends ModelePDFSuppliersInvoices else { // We found a page break - $showpricebeforepagebreak=0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } } else // No pagebreak diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_cornas.modules.php index 8ff4c3ad429..25962f3b45d 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_cornas.modules.php @@ -523,7 +523,13 @@ class pdf_cornas extends ModelePDFSuppliersOrders $pdf->setPage($pageposbefore+1); $curY = $tab_top_newpage; - $showpricebeforepagebreak=0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } if (!empty($imglinesize['width']) && !empty($imglinesize['height'])) @@ -564,7 +570,13 @@ class pdf_cornas extends ModelePDFSuppliersOrders else { // We found a page break - $showpricebeforepagebreak=0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } } else // No pagebreak diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index a30232f0b41..60658bc8e59 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -445,7 +445,13 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->setPage($pageposbefore+1); $curY = $tab_top_newpage; - $showpricebeforepagebreak=0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } if (!empty($imglinesize['width']) && !empty($imglinesize['height'])) @@ -492,7 +498,13 @@ class pdf_muscadet extends ModelePDFSuppliersOrders else { // We found a page break - $showpricebeforepagebreak=0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } } else // No pagebreak diff --git a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php index e8b97224aad..0d3f3569c56 100644 --- a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php @@ -365,7 +365,13 @@ class pdf_standard extends ModelePDFSuppliersPayments else { // We found a page break - $showpricebeforepagebreak=0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } } else // No pagebreak diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index ff8ab76c674..0bd15e86403 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -430,7 +430,13 @@ class pdf_aurore extends ModelePDFSupplierProposal $pdf->setPage($pageposbefore+1); $curY = $tab_top_newpage; - $showpricebeforepagebreak=0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } if (!empty($imglinesize['width']) && !empty($imglinesize['height'])) @@ -480,7 +486,13 @@ class pdf_aurore extends ModelePDFSupplierProposal else { // We found a page break - $showpricebeforepagebreak=0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } } else // No pagebreak From 37aca0704198bb07dfa6e157810ef125d0910056 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 28 Jan 2020 08:29:00 +0000 Subject: [PATCH 017/306] Fixing style errors. --- htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php | 2 -- htdocs/core/modules/contract/doc/pdf_strato.modules.php | 1 - htdocs/core/modules/expedition/doc/pdf_espadon.modules.php | 2 -- htdocs/core/modules/expedition/doc/pdf_rouget.modules.php | 2 -- htdocs/core/modules/expensereport/doc/pdf_standard.modules.php | 1 - htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 2 -- htdocs/core/modules/facture/doc/pdf_sponge.modules.php | 2 -- htdocs/core/modules/livraison/doc/pdf_typhon.modules.php | 1 - htdocs/core/modules/propale/doc/pdf_azur.modules.php | 2 -- htdocs/core/modules/propale/doc/pdf_cyan.modules.php | 2 -- htdocs/core/modules/reception/doc/pdf_squille.modules.php | 2 -- htdocs/core/modules/stock/doc/pdf_standard.modules.php | 1 - htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php | 1 - .../core/modules/supplier_invoice/pdf/pdf_canelle.modules.php | 1 - htdocs/core/modules/supplier_order/pdf/pdf_cornas.modules.php | 2 -- htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php | 2 -- .../core/modules/supplier_payment/doc/pdf_standard.modules.php | 1 - .../core/modules/supplier_proposal/doc/pdf_aurore.modules.php | 2 -- 18 files changed, 29 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index b1dbca4dc56..250f8095b05 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -578,7 +578,6 @@ class pdf_eratosthene extends ModelePDFCommandes $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } if (!empty($this->cols['photo']) && isset($imglinesize['width']) && isset($imglinesize['height'])) @@ -622,7 +621,6 @@ class pdf_eratosthene extends ModelePDFCommandes $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } } else // No pagebreak diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index c0cc4845aa5..0058ad524f4 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -397,7 +397,6 @@ class pdf_strato extends ModelePDFContract $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } } else // No pagebreak diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index 3b917275040..5706ce5d7fa 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -439,7 +439,6 @@ class pdf_espadon extends ModelePdfExpedition $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } @@ -487,7 +486,6 @@ class pdf_espadon extends ModelePdfExpedition $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } } else // No pagebreak diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 705b3db4064..a19d98748ee 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -458,7 +458,6 @@ class pdf_rouget extends ModelePdfExpedition $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } if (isset($imglinesize['width']) && isset($imglinesize['height'])) @@ -506,7 +505,6 @@ class pdf_rouget extends ModelePdfExpedition $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } } else // No pagebreak diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index 2892b6196f3..c1654aa0aec 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -391,7 +391,6 @@ class pdf_standard extends ModeleExpenseReport $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } } else // No pagebreak diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index f623742bfe0..4d7ee892692 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -500,7 +500,6 @@ class pdf_crabe extends ModelePDFFactures $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } if (isset($imglinesize['width']) && isset($imglinesize['height'])) @@ -546,7 +545,6 @@ class pdf_crabe extends ModelePDFFactures $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } } else // No pagebreak diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 87a9face2bd..1a300bee0e0 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -606,7 +606,6 @@ class pdf_sponge extends ModelePDFFactures $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } if (!empty($this->cols['photo']) && isset($imglinesize['width']) && isset($imglinesize['height'])) @@ -651,7 +650,6 @@ class pdf_sponge extends ModelePDFFactures $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } } else // No pagebreak diff --git a/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php b/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php index 4d659ca193a..88a51c7c94f 100644 --- a/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php +++ b/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php @@ -415,7 +415,6 @@ class pdf_typhon extends ModelePDFDeliveryOrder $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } } else // No pagebreak diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 67496a7597c..222858750a7 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -508,7 +508,6 @@ class pdf_azur extends ModelePDFPropales $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } if (isset($imglinesize['width']) && isset($imglinesize['height'])) @@ -555,7 +554,6 @@ class pdf_azur extends ModelePDFPropales $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } } else // No pagebreak diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 308a67bedcc..db9b5a3818d 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -588,7 +588,6 @@ class pdf_cyan extends ModelePDFPropales $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } @@ -636,7 +635,6 @@ class pdf_cyan extends ModelePDFPropales $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } } else // No pagebreak diff --git a/htdocs/core/modules/reception/doc/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php index 93204a44a4b..f1c2eba89e4 100644 --- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php +++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php @@ -380,7 +380,6 @@ class pdf_squille extends ModelePdfReception $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } if (isset($imglinesize['width']) && isset($imglinesize['height'])) @@ -429,7 +428,6 @@ class pdf_squille extends ModelePdfReception $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } } else // No pagebreak diff --git a/htdocs/core/modules/stock/doc/pdf_standard.modules.php b/htdocs/core/modules/stock/doc/pdf_standard.modules.php index 292e551a1eb..b2898c2fbac 100644 --- a/htdocs/core/modules/stock/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_standard.modules.php @@ -389,7 +389,6 @@ class pdf_standard extends ModelePDFStock $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } } else // No pagebreak diff --git a/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php b/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php index 19986161413..362f17c7e9c 100644 --- a/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php @@ -549,7 +549,6 @@ class pdf_stdmovement extends ModelePDFMovement $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } } else // No pagebreak diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index e1d6133ab39..26329ac889f 100644 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -436,7 +436,6 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } } else // No pagebreak diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_cornas.modules.php index 25962f3b45d..6d3fe584eb3 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_cornas.modules.php @@ -529,7 +529,6 @@ class pdf_cornas extends ModelePDFSuppliersOrders $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } if (!empty($imglinesize['width']) && !empty($imglinesize['height'])) @@ -576,7 +575,6 @@ class pdf_cornas extends ModelePDFSuppliersOrders $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } } else // No pagebreak diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index 60658bc8e59..5bad5b6be24 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -451,7 +451,6 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } if (!empty($imglinesize['width']) && !empty($imglinesize['height'])) @@ -504,7 +503,6 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } } else // No pagebreak diff --git a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php index 0d3f3569c56..836d7c04072 100644 --- a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php @@ -371,7 +371,6 @@ class pdf_standard extends ModelePDFSuppliersPayments $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } } else // No pagebreak diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index 0bd15e86403..6b57a81af5a 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -436,7 +436,6 @@ class pdf_aurore extends ModelePDFSupplierProposal $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } if (!empty($imglinesize['width']) && !empty($imglinesize['height'])) @@ -492,7 +491,6 @@ class pdf_aurore extends ModelePDFSupplierProposal $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } } else // No pagebreak From 91575e5b544ddcb363c9acd7973f8c4725301eb7 Mon Sep 17 00:00:00 2001 From: AdrianDominik Date: Tue, 28 Jan 2020 10:52:33 +0100 Subject: [PATCH 018/306] FIX: #12908 User login with credentials from self-subscription form fails --- htdocs/adherents/class/adherent.class.php | 34 +-- htdocs/user/class/user.class.php | 343 +++++++++++----------- 2 files changed, 189 insertions(+), 188 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 2c2602bca56..1ec82f7da31 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -641,7 +641,7 @@ class Adherent extends CommonObject $isencrypted = empty($conf->global->DATABASE_PWD_ENCRYPTED)?0:1; // If password to set differs from the one found into database - $result=$this->setPassword($user, $this->pass, $this->pass_indatabase_crypted, $isencrypted, $notrigger, $nosyncuserpass); + $result=$this->setPassword($user, $this->pass, $isencrypted, $notrigger, $nosyncuserpass); if (! $nbrowsaffected) $nbrowsaffected++; } } @@ -964,9 +964,10 @@ class Adherent extends CommonObject * @param int $isencrypted 0 ou 1 si il faut crypter le mot de passe en base (0 par defaut) * @param int $notrigger 1=Ne declenche pas les triggers * @param int $nosyncuser Do not synchronize linked user + * @param int $alreadyencrypted 1 = password is already encrypted (0 by default) * @return string If OK return clear password, 0 if no change, < 0 if error */ - public function setPassword($user, $password = '', $password_indatabase_crypted = '', $isencrypted = 0, $notrigger = 0, $nosyncuser = 0) + public function setPassword($user, $password = '', $isencrypted = 0, $notrigger = 0, $nosyncuser = 0, $alreadyencrypted = 0) { global $conf, $langs; @@ -974,23 +975,22 @@ class Adherent extends CommonObject dol_syslog(get_class($this)."::setPassword user=".$user->id." password=".preg_replace('/./i', '*', $password)." isencrypted=".$isencrypted); - // If password_crypted not provided, try crypt password provided - if(!$password_indatabase_crypted) + // If new password not provided, we generate one + if (! $password) { - // If new password not provided, we generate one - if (!$password) - { - require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; - $password=getRandomPassword(false); - } - - // Crypt password - $password_crypted = dol_hash($password); - - } else { - $password_crypted = $password_indatabase_crypted; + require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; + $password=getRandomPassword(false); } + // Crypt password + if ($alreadyencrypted != 1) $password_crypted = dol_hash($password); + else $password_crypted = $password; + + $password_indatabase = ''; + if (! $isencrypted) + { + $password_indatabase = $password; + } $this->db->begin(); @@ -1032,7 +1032,7 @@ class Adherent extends CommonObject if ($result >= 0) { - $result=$luser->setPassword($user, $this->pass, $this->pass_indatabase_crypted, 0, 0, 1); + $result=$luser->setPassword($user, $this->pass, 0, 0, 1, 1); if ($result < 0) { $this->error=$luser->error; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 8809873acc6..98bc2a7c7b0 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -75,34 +75,34 @@ class User extends CommonObject public $personal_email; - /** - * @var array array of socialnetworks - */ - public $socialnetworks; + /** + * @var array array of socialnetworks + */ + public $socialnetworks; - /** - * Skype username - * @var string - * @deprecated - */ + /** + * Skype username + * @var string + * @deprecated + */ public $skype; - /** - * Twitter username - * @var string - * @deprecated - */ + /** + * Twitter username + * @var string + * @deprecated + */ public $twitter; - /** - * Facebook username - * @var string - * @deprecated - */ + /** + * Facebook username + * @var string + * @deprecated + */ public $facebook; - /** - * Linkedin username - * @var string - * @deprecated - */ + /** + * Linkedin username + * @var string + * @deprecated + */ public $linkedin; public $job; // job position @@ -121,7 +121,7 @@ class User extends CommonObject public $office_phone; public $office_fax; public $user_mobile; - public $personal_mobile; + public $personal_mobile; public $admin; public $login; public $api_key; @@ -139,18 +139,18 @@ class User extends CommonObject public $pass_indatabase_crypted; /** - * Date creation record (datec) - * - * @var integer - */ - public $datec; + * Date creation record (datec) + * + * @var integer + */ + public $datec; /** - * Date modification record (tms) - * - * @var integer - */ - public $datem; + * Date modification record (tms) + * + * @var integer + */ + public $datem; //! If this is defined, it is an external user /** @@ -167,8 +167,8 @@ class User extends CommonObject public $contactid; /** - * @var int ID - */ + * @var int ID + */ public $fk_member; /** @@ -176,7 +176,7 @@ class User extends CommonObject */ public $fk_user; public $fk_user_expense_validator; - public $fk_user_holiday_validator; + public $fk_user_holiday_validator; public $clicktodial_url; public $clicktodial_login; @@ -222,10 +222,10 @@ class User extends CommonObject public $fk_warehouse; public $fields = array( - 'rowid'=>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'index'=>1, 'position'=>1, 'comment'=>'Id'), - 'lastname'=>array('type'=>'varchar(50)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>20, 'searchall'=>1, 'comment'=>'Reference of object'), - 'firstname'=>array('type'=>'varchar(50)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'), - ); + 'rowid'=>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'index'=>1, 'position'=>1, 'comment'=>'Id'), + 'lastname'=>array('type'=>'varchar(50)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>20, 'searchall'=>1, 'comment'=>'Reference of object'), + 'firstname'=>array('type'=>'varchar(50)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'), + ); const STATUS_DISABLED = 0; @@ -391,7 +391,7 @@ class User extends CommonObject $this->office_phone = $obj->office_phone; $this->office_fax = $obj->office_fax; $this->user_mobile = $obj->user_mobile; - $this->personal_mobile = $obj->personal_mobile; + $this->personal_mobile = $obj->personal_mobile; $this->email = $obj->email; $this->personal_email = $obj->personal_email; $this->socialnetworks = (array) json_decode($obj->socialnetworks, true); @@ -427,8 +427,8 @@ class User extends CommonObject $this->contactid = $obj->fk_socpeople; $this->fk_member = $obj->fk_member; $this->fk_user = $obj->fk_user; - $this->fk_user_expense_validator = $obj->fk_user_expense_validator; - $this->fk_user_holiday_validator = $obj->fk_user_holiday_validator; + $this->fk_user_expense_validator = $obj->fk_user_expense_validator; + $this->fk_user_holiday_validator = $obj->fk_user_holiday_validator; $this->default_range = $obj->default_range; $this->default_c_exp_tax_cat = $obj->default_c_exp_tax_cat; @@ -1032,7 +1032,7 @@ class User extends CommonObject * Existing categories are left untouch. * * @param int[]|int $categories Category or categories IDs - * @return void + * @return void */ public function setCategories($categories) { @@ -1122,24 +1122,24 @@ class User extends CommonObject // Remove extrafields if ((!$error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used { - $result = $this->deleteExtraFields(); - if ($result < 0) - { - $error++; - dol_syslog(get_class($this)."::delete error -4 ".$this->error, LOG_ERR); - } + $result = $this->deleteExtraFields(); + if ($result < 0) + { + $error++; + dol_syslog(get_class($this)."::delete error -4 ".$this->error, LOG_ERR); + } } // Remove user if (!$error) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."user WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::delete", LOG_DEBUG); - if (!$this->db->query($sql)) - { - $error++; - $this->error = $this->db->lasterror(); - } + dol_syslog(get_class($this)."::delete", LOG_DEBUG); + if (!$this->db->query($sql)) + { + $error++; + $this->error = $this->db->lasterror(); + } } if (!$error) @@ -1180,7 +1180,7 @@ class User extends CommonObject if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->lastname = ucwords($this->lastname); if (!empty($conf->global->MAIN_ALL_TO_UPPER)) $this->lastname = strtoupper($this->lastname); - if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->firstname = ucwords($this->firstname); + if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->firstname = ucwords($this->firstname); $this->login = trim($this->login); if (!isset($this->entity)) $this->entity = $conf->entity; // If not defined, we use default value @@ -1302,7 +1302,7 @@ class User extends CommonObject } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Create a user from a contact object. User will be internal but if contact is linked to a third party, user will be external * @@ -1313,7 +1313,7 @@ class User extends CommonObject */ public function create_from_contact($contact, $login = '', $password = '') { - // phpcs:enable + // phpcs:enable global $conf, $user, $langs; $error = 0; @@ -1381,7 +1381,7 @@ class User extends CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Create a user into database from a member object * @@ -1391,7 +1391,7 @@ class User extends CommonObject */ public function create_from_member($member, $login = '') { - // phpcs:enable + // phpcs:enable global $conf, $user, $langs; // Positionne parametres @@ -1418,7 +1418,9 @@ class User extends CommonObject $result = $this->create($user); if ($result > 0) { - $newpass = $this->setPassword($user, $this->pass, $this->pass_indatabase_crypted); + if(!$this->pass && $this->pass_indatabase_crypted) $newpass = $this->setPassword($user, $this->pass_indatabase_crypted, 0, 0, 0, 1); + else $newpass = $this->setPassword($user, $this->pass); + if (is_numeric($newpass) && $newpass < 0) $result = -2; if ($result > 0 && $member->fk_soc) // If member is linked to a thirdparty @@ -1457,7 +1459,7 @@ class User extends CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Assign rights by default * @@ -1465,7 +1467,7 @@ class User extends CommonObject */ public function set_default_rights() { - // phpcs:enable + // phpcs:enable global $conf; $sql = "SELECT id FROM ".MAIN_DB_PREFIX."rights_def"; @@ -1524,7 +1526,7 @@ class User extends CommonObject if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->lastname = ucwords($this->lastname); if (!empty($conf->global->MAIN_ALL_TO_UPPER)) $this->lastname = strtoupper($this->lastname); - if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->firstname = ucwords($this->firstname); + if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->firstname = ucwords($this->firstname); $this->lastname = trim($this->lastname); $this->firstname = trim($this->firstname); @@ -1542,9 +1544,9 @@ class User extends CommonObject $this->office_phone = trim($this->office_phone); $this->office_fax = trim($this->office_fax); $this->user_mobile = trim($this->user_mobile); - $this->personal_mobile = trim($this->personal_mobile); + $this->personal_mobile = trim($this->personal_mobile); $this->email = trim($this->email); - $this->personal_email = trim($this->personal_email); + $this->personal_email = trim($this->personal_email); $this->job = trim($this->job); $this->signature = trim($this->signature); @@ -1595,10 +1597,10 @@ class User extends CommonObject $sql .= ", office_phone = '".$this->db->escape($this->office_phone)."'"; $sql .= ", office_fax = '".$this->db->escape($this->office_fax)."'"; $sql .= ", user_mobile = '".$this->db->escape($this->user_mobile)."'"; - $sql .= ", personal_mobile = '".$this->db->escape($this->personal_mobile)."'"; + $sql .= ", personal_mobile = '".$this->db->escape($this->personal_mobile)."'"; $sql .= ", email = '".$this->db->escape($this->email)."'"; - $sql .= ", personal_email = '".$this->db->escape($this->personal_email)."'"; - $sql .= ", socialnetworks = '".$this->db->escape(json_encode($this->socialnetworks))."'"; + $sql .= ", personal_email = '".$this->db->escape($this->personal_email)."'"; + $sql .= ", socialnetworks = '".$this->db->escape(json_encode($this->socialnetworks))."'"; $sql .= ", job = '".$this->db->escape($this->job)."'"; $sql .= ", signature = '".$this->db->escape($this->signature)."'"; $sql .= ", accountancy_code = '".$this->db->escape($this->accountancy_code)."'"; @@ -1610,8 +1612,8 @@ class User extends CommonObject $sql .= ", photo = ".($this->photo ? "'".$this->db->escape($this->photo)."'" : "null"); $sql .= ", openid = ".($this->openid ? "'".$this->db->escape($this->openid)."'" : "null"); $sql .= ", fk_user = ".($this->fk_user > 0 ? "'".$this->db->escape($this->fk_user)."'" : "null"); - $sql .= ", fk_user_expense_validator = ".($this->fk_user_expense_validator > 0 ? "'".$this->db->escape($this->fk_user_expense_validator)."'" : "null"); - $sql .= ", fk_user_holiday_validator = ".($this->fk_user_holiday_validator > 0 ? "'".$this->db->escape($this->fk_user_holiday_validator)."'" : "null"); + $sql .= ", fk_user_expense_validator = ".($this->fk_user_expense_validator > 0 ? "'".$this->db->escape($this->fk_user_expense_validator)."'" : "null"); + $sql .= ", fk_user_holiday_validator = ".($this->fk_user_holiday_validator > 0 ? "'".$this->db->escape($this->fk_user_holiday_validator)."'" : "null"); if (isset($this->thm) || $this->thm != '') $sql .= ", thm= ".($this->thm != '' ? "'".$this->db->escape($this->thm)."'" : "null"); if (isset($this->tjm) || $this->tjm != '') $sql .= ", tjm= ".($this->tjm != '' ? "'".$this->db->escape($this->tjm)."'" : "null"); if (isset($this->salary) || $this->salary != '') $sql .= ", salary= ".($this->salary != '' ? "'".$this->db->escape($this->salary)."'" : "null"); @@ -1811,7 +1813,7 @@ class User extends CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Mise a jour en base de la date de derniere connexion d'un utilisateur * Fonction appelee lors d'une nouvelle connexion @@ -1820,7 +1822,7 @@ class User extends CommonObject */ public function update_last_login_date() { - // phpcs:enable + // phpcs:enable $now = dol_now(); $sql = "UPDATE ".MAIN_DB_PREFIX."user SET"; @@ -1853,9 +1855,10 @@ class User extends CommonObject * @param int $changelater 1=Change password only after clicking on confirm email * @param int $notrigger 1=Does not launch triggers * @param int $nosyncmember Do not synchronize linked member + * @param int $alreadyencrypted 1 = password is already encrypted (0 by default) * @return string If OK return clear password, 0 if no change, < 0 if error */ - public function setPassword($user, $password = '', $password_indatabase_crypted = '', $changelater = 0, $notrigger = 0, $nosyncmember = 0) + public function setPassword($user, $password = '', $changelater = 0, $notrigger = 0, $nosyncmember = 0, $alreadyencrypted = 0) { global $conf, $langs; require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; @@ -1864,21 +1867,15 @@ class User extends CommonObject dol_syslog(get_class($this)."::setPassword user=".$user->id." password=".preg_replace('/./i', '*', $password)." changelater=".$changelater." notrigger=".$notrigger." nosyncmember=".$nosyncmember, LOG_DEBUG); - // If password_crypted not provided, try crypt password provided - if(!$password_indatabase_crypted) + // If new password not provided, we generate one + if (!$password) { - // If new password not provided, we generate one - if (!$password) - { - $password = getRandomPassword(false); - } - - // Crypt password - $password_crypted = dol_hash($password); - } else { - $password_crypted = $password_indatabase_crypted; + $password = getRandomPassword(false); } + // Crypt password + if ($alreadyencrypted != 1) $password_crypted = dol_hash($password); + else $password_crypted = $password; // Mise a jour @@ -1922,7 +1919,11 @@ class User extends CommonObject if ($result >= 0) { - $result = $adh->setPassword($user, $this->pass, $this->pass_indatabase_crypted, (empty($conf->global->DATABASE_PWD_ENCRYPTED) ? 0 : 1), 1); // Cryptage non gere dans module adherent + + if ($alreadyencrypted != 1) $result = $adh->setPassword($user, $this->pass, (empty($conf->global->DATABASE_PWD_ENCRYPTED) ? 0 : 1), 1); // Cryptage non gere dans module adherent + else $result = $adh->setPassword($user, $this->pass, (empty($conf->global->DATABASE_PWD_ENCRYPTED) ? 0 : 1), 1, 0, 1); // Dont encrypt the password cause is already encrypted + + if ($result < 0) { $this->error = $adh->error; @@ -1986,7 +1987,7 @@ class User extends CommonObject } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Send new password by email * @@ -1997,7 +1998,7 @@ class User extends CommonObject */ public function send_password($user, $password = '', $changelater = 0) { - // phpcs:enable + // phpcs:enable global $conf, $langs; global $dolibarr_main_url_root; @@ -2011,19 +2012,19 @@ class User extends CommonObject $outputlangs = new Translate("", $conf); if (isset($this->conf->MAIN_LANG_DEFAULT) - && $this->conf->MAIN_LANG_DEFAULT != 'auto') + && $this->conf->MAIN_LANG_DEFAULT != 'auto') { // If user has defined its own language (rare because in most cases, auto is used) $outputlangs->getDefaultLang($this->conf->MAIN_LANG_DEFAULT); } if ($user->conf->MAIN_LANG_DEFAULT) { - $outputlangs->setDefaultLang($user->conf->MAIN_LANG_DEFAULT); - } + $outputlangs->setDefaultLang($user->conf->MAIN_LANG_DEFAULT); + } else { // If user has not defined its own language, we used current language $outputlangs = $langs; } - // Load translation files required by the page + // Load translation files required by the page $outputlangs->loadLangs(array("main", "errors", "users", "other")); $appli = constant('DOL_APPLICATION_TITLE'); @@ -2066,8 +2067,8 @@ class User extends CommonObject dol_syslog(get_class($this)."::send_password changelater is on, url=".$url); } - $mailfile = new CMailFile( - $subject, + $mailfile = new CMailFile( + $subject, $this->email, $conf->global->MAIN_MAIL_EMAIL_FROM, $mesg, @@ -2077,8 +2078,8 @@ class User extends CommonObject '', '', 0, - $msgishtml - ); + $msgishtml + ); if ($mailfile->sendfile()) { @@ -2103,7 +2104,7 @@ class User extends CommonObject } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Read clicktodial information for user * @@ -2111,7 +2112,7 @@ class User extends CommonObject */ public function fetch_clicktodial() { - // phpcs:enable + // phpcs:enable $sql = "SELECT url, login, pass, poste "; $sql .= " FROM ".MAIN_DB_PREFIX."user_clicktodial as u"; $sql .= " WHERE u.fk_user = ".$this->id; @@ -2141,15 +2142,15 @@ class User extends CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Update clicktodial info * * @return int <0 if KO, >0 if OK - */ - public function update_clicktodial() - { - // phpcs:enable + */ + public function update_clicktodial() + { + // phpcs:enable $this->db->begin(); $sql = "DELETE FROM ".MAIN_DB_PREFIX."user_clicktodial"; @@ -2179,10 +2180,10 @@ class User extends CommonObject $this->error = $this->db->lasterror(); return -1; } - } + } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Add user into a group * @@ -2193,7 +2194,7 @@ class User extends CommonObject */ public function SetInGroup($group, $entity, $notrigger = 0) { - // phpcs:enable + // phpcs:enable global $conf, $langs, $user; $error = 0; @@ -2244,7 +2245,7 @@ class User extends CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Remove a user from a group * @@ -2255,7 +2256,7 @@ class User extends CommonObject */ public function RemoveFromGroup($group, $entity, $notrigger = 0) { - // phpcs:enable + // phpcs:enable global $conf, $langs, $user; $error = 0; @@ -2342,7 +2343,7 @@ class User extends CommonObject global $dolibarr_main_authentication, $dolibarr_main_demo; global $menumanager; - if (!$user->rights->user->user->lire && $user->id != $this->id) $option = 'nolink'; + if (!$user->rights->user->user->lire && $user->id != $this->id) $option = 'nolink'; if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && $withpictoimg) $withpictoimg = 0; @@ -2436,8 +2437,8 @@ class User extends CommonObject $result .= (($option == 'nolink') ? '' : $linkstart); if ($withpictoimg) { - $paddafterimage = ''; - if (abs($withpictoimg) == 1) $paddafterimage = 'style="margin-'.($langs->trans("DIRECTION") == 'rtl' ? 'left' : 'right').': 3px;"'; + $paddafterimage = ''; + if (abs($withpictoimg) == 1) $paddafterimage = 'style="margin-'.($langs->trans("DIRECTION") == 'rtl' ? 'left' : 'right').': 3px;"'; // Only picto if ($withpictoimg > 0) $picto = ''.img_object('', 'user', $paddafterimage.' '.($notooltip ? '' : 'class="classfortooltip"'), 0, 0, $notooltip ? 0 : 1).''; // Picto must be a photo @@ -2491,7 +2492,7 @@ class User extends CommonObject $linkend = ''; } - if ($option == 'nolink') + if ($option == 'nolink') { $linkstart = ''; $linkend = ''; @@ -2515,17 +2516,17 @@ class User extends CommonObject return $this->LibStatut($this->statut, $mode); } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - /** - * Return label of a status of user (active, inactive) - * - * @param int $status Id status + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return label of a status of user (active, inactive) + * + * @param int $status Id status * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto - * @return string Label of status - */ - public function LibStatut($status, $mode = 0) - { - // phpcs:enable + * @return string Label of status + */ + public function LibStatut($status, $mode = 0) + { + // phpcs:enable global $langs; if (empty($this->labelStatus) || empty($this->labelStatusShort)) @@ -2558,7 +2559,7 @@ class User extends CommonObject */ public function _load_ldap_dn($info, $mode = 0) { - // phpcs:enable + // phpcs:enable global $conf; $dn = ''; if ($mode == 0) $dn = $conf->global->LDAP_KEY_USERS."=".$info[$conf->global->LDAP_KEY_USERS].",".$conf->global->LDAP_USER_DN; @@ -2576,7 +2577,7 @@ class User extends CommonObject */ public function _load_ldap_info() { - // phpcs:enable + // phpcs:enable global $conf, $langs; $info = array(); @@ -2602,7 +2603,7 @@ class User extends CommonObject 'LDAP_FIELD_SKYPE' => 'skype', 'LDAP_FIELD_TWITTER' => 'twitter', 'LDAP_FIELD_FACEBOOK' => 'facebook', - 'LDAP_FIELD_LINKEDIN' => 'linkedin' + 'LDAP_FIELD_LINKEDIN' => 'linkedin' ); // Champs @@ -2686,22 +2687,22 @@ class User extends CommonObject if ($this->phone_mobile) $info["phpgwCellTelephoneNumber"] = $this->phone_mobile; } - if (!empty($conf->global->LDAP_FIELD_USERID))$info[$conf->global->LDAP_FIELD_USERID] = $this->id; - if (!empty($info[$conf->global->LDAP_FIELD_GROUPID])) { - $usergroup = new UserGroup($this->db); - $groupslist = $usergroup->listGroupsForUser($this->id); - $info[$conf->global->LDAP_FIELD_GROUPID] = '1'; - if (!empty($groupslist)) { - foreach ($groupslist as $groupforuser) { - $info[$conf->global->LDAP_FIELD_GROUPID] = $groupforuser->id; //Select first group in list - break; - } - } - } - if (!empty($this->firstname) && !empty($conf->global->LDAP_FIELD_HOMEDIRECTORY) && !empty($conf->global->LDAP_FIELD_HOMEDIRECTORYPREFIX)) $info[$conf->global->LDAP_FIELD_HOMEDIRECTORY] = "{$conf->global->LDAP_FIELD_HOMEDIRECTORYPREFIX}/$this->firstname"; + if (!empty($conf->global->LDAP_FIELD_USERID))$info[$conf->global->LDAP_FIELD_USERID] = $this->id; + if (!empty($info[$conf->global->LDAP_FIELD_GROUPID])) { + $usergroup = new UserGroup($this->db); + $groupslist = $usergroup->listGroupsForUser($this->id); + $info[$conf->global->LDAP_FIELD_GROUPID] = '1'; + if (!empty($groupslist)) { + foreach ($groupslist as $groupforuser) { + $info[$conf->global->LDAP_FIELD_GROUPID] = $groupforuser->id; //Select first group in list + break; + } + } + } + if (!empty($this->firstname) && !empty($conf->global->LDAP_FIELD_HOMEDIRECTORY) && !empty($conf->global->LDAP_FIELD_HOMEDIRECTORYPREFIX)) $info[$conf->global->LDAP_FIELD_HOMEDIRECTORY] = "{$conf->global->LDAP_FIELD_HOMEDIRECTORYPREFIX}/$this->firstname"; - return $info; - } + return $info; + } /** @@ -2728,7 +2729,7 @@ class User extends CommonObject $this->note_public = 'This is a note public'; $this->note_private = 'This is a note private'; $this->email = 'email@specimen.com'; - $this->personal_email = 'personalemail@specimen.com'; + $this->personal_email = 'personalemail@specimen.com'; $this->socialnetworks = array( 'skype' => 'skypepseudo', 'twitter' => 'twitterpseudo', @@ -2738,7 +2739,7 @@ class User extends CommonObject $this->office_phone = '0999999999'; $this->office_fax = '0999999998'; $this->user_mobile = '0999999997'; - $this->personal_mobile = '0999999996'; + $this->personal_mobile = '0999999996'; $this->admin = 0; $this->login = 'dolibspec'; $this->pass = 'dolibspec'; @@ -2863,7 +2864,7 @@ class User extends CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Update user using data from the LDAP * @@ -2872,7 +2873,7 @@ class User extends CommonObject */ public function update_ldap2dolibarr(&$ldapuser) { - // phpcs:enable + // phpcs:enable // TODO: Voir pourquoi le update met à jour avec toutes les valeurs vide (global $user écrase ?) global $user, $conf; @@ -2903,7 +2904,7 @@ class User extends CommonObject } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Return and array with all instanciated first level children users of current user * @@ -2912,7 +2913,7 @@ class User extends CommonObject */ public function get_children() { - // phpcs:enable + // phpcs:enable $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."user"; $sql .= " WHERE fk_user = ".$this->id; @@ -2971,7 +2972,7 @@ class User extends CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Build the hierarchy/tree of users into an array. * Set and return this->users that is an array sorted according to tree with arrays of: @@ -2985,9 +2986,9 @@ class User extends CommonObject * @param string $filter SQL filter on users * @return array Array of users $this->users. Note: $this->parentof is also set. */ - public function get_full_tree($deleteafterid = 0, $filter = '') - { - // phpcs:enable + public function get_full_tree($deleteafterid = 0, $filter = '') + { + // phpcs:enable global $conf, $user; global $hookmanager; @@ -3087,8 +3088,8 @@ class User extends CommonObject * @return array Array of user id lower than user (all levels under user). This overwrite this->users. * @see get_children() */ - public function getAllChildIds($addcurrentuser = 0) - { + public function getAllChildIds($addcurrentuser = 0) + { $childids = array(); if (isset($this->cache_childids[$this->id])) @@ -3116,7 +3117,7 @@ class User extends CommonObject return $childids; } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * For user id_user and its childs available in this->users, define property fullpath and fullname. * Function called by get_full_tree(). @@ -3125,9 +3126,9 @@ class User extends CommonObject * @param int $protection Deep counter to avoid infinite loop (no more required, a protection is added with array useridfound) * @return int < 0 if KO (infinit loop), >= 0 if OK */ - public function build_path_from_id_user($id_user, $protection = 0) - { - // phpcs:enable + public function build_path_from_id_user($id_user, $protection = 0) + { + // phpcs:enable dol_syslog(get_class($this)."::build_path_from_id_user id_user=".$id_user." protection=".$protection, LOG_DEBUG); if (!empty($this->users[$id_user]['fullpath'])) @@ -3180,7 +3181,7 @@ class User extends CommonObject } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Load metrics this->nb for dashboard * @@ -3188,7 +3189,7 @@ class User extends CommonObject */ public function load_state_board() { - // phpcs:enable + // phpcs:enable $this->nb = array(); @@ -3224,7 +3225,7 @@ class User extends CommonObject * @param int $hidedetails Hide details of lines * @param int $hidedesc Hide description * @param int $hideref Hide ref - * @param null|array $moreparams Array to provide more information + * @param null|array $moreparams Array to provide more information * @return int 0 if KO, 1 if OK */ public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null) @@ -3251,7 +3252,7 @@ class User extends CommonObject return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams); } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Return property of user from its id * @@ -3261,7 +3262,7 @@ class User extends CommonObject */ public function user_get_property($rowid, $mode) { - // phpcs:enable + // phpcs:enable $user_property = ''; if (empty($rowid)) return ''; @@ -3303,8 +3304,8 @@ class User extends CommonObject * @return int <0 if KO, >0 if OK */ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = array(), $filtermode = 'AND', $entityfilter = false) - { - global $conf, $user; + { + global $conf, $user; $sql = "SELECT t.rowid"; $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t '; @@ -3379,8 +3380,8 @@ class User extends CommonObject } else { - $this->errors[] = $this->db->lasterror(); - return -1; - } - } + $this->errors[] = $this->db->lasterror(); + return -1; + } + } } From 77ced158fd3e6f3efe92a27b288678228834516e Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 28 Jan 2020 10:00:14 +0000 Subject: [PATCH 019/306] Fixing style errors. --- htdocs/user/class/user.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 98bc2a7c7b0..af23dca5e96 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1919,7 +1919,6 @@ class User extends CommonObject if ($result >= 0) { - if ($alreadyencrypted != 1) $result = $adh->setPassword($user, $this->pass, (empty($conf->global->DATABASE_PWD_ENCRYPTED) ? 0 : 1), 1); // Cryptage non gere dans module adherent else $result = $adh->setPassword($user, $this->pass, (empty($conf->global->DATABASE_PWD_ENCRYPTED) ? 0 : 1), 1, 0, 1); // Dont encrypt the password cause is already encrypted From 8b3eb35cd173ce9b27a81865a6617370d5865f06 Mon Sep 17 00:00:00 2001 From: Tobias Sekan Date: Wed, 29 Jan 2020 10:55:56 +0100 Subject: [PATCH 020/306] [NEW] Hidden option MAIN_TEMP_DIR --- htdocs/core/class/conf.class.php | 204 ++++++++++++++++--------------- 1 file changed, 107 insertions(+), 97 deletions(-) diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 4136cef1be5..fdc42848d78 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -289,158 +289,168 @@ class Conf { $rootfordata .= '/'.$this->entity; } + // Set standard temporary folder name or global override + $rootfortemp = empty($this->global->MAIN_TEMP_DIR) ? $rootfordata : $this->global->MAIN_TEMP_DIR; // Define default dir_output and dir_temp for directories of modules - foreach ($this->modules as $module) + foreach($this->modules as $module) { //var_dump($module); // For multicompany sharings - $this->$module->multidir_output = array($this->entity => $rootfordata."/".$module); - $this->$module->multidir_temp = array($this->entity => $rootfordata."/".$module."/temp"); + $this->$module->multidir_output = array($this->entity => $rootfordata."/".$module); + $this->$module->multidir_temp = array($this->entity => $rootfortemp."/".$module."/temp"); // For backward compatibility - $this->$module->dir_output = $rootfordata."/".$module; - $this->$module->dir_temp = $rootfordata."/".$module."/temp"; + $this->$module->dir_output = $rootfordata."/".$module; + $this->$module->dir_temp = $rootfortemp."/".$module."/temp"; } // External modules storage - if (!empty($this->modules_parts['dir'])) + if (! empty($this->modules_parts['dir'])) { - foreach ($this->modules_parts['dir'] as $module => $dirs) + foreach($this->modules_parts['dir'] as $module => $dirs) { - if (!empty($this->$module->enabled)) + if (! empty($this->$module->enabled)) { - foreach ($dirs as $type => $name) // $type is 'output' or 'temp' + foreach($dirs as $type => $name) { - $subdir = ($type == 'temp' ? '/temp' : ''); - // For multicompany sharings - $varname = 'multidir_'.$type; - $this->$module->$varname = array($this->entity => $rootfordata."/".$name.$subdir); - // For backward compatibility - $varname = 'dir_'.$type; - $this->$module->$varname = $rootfordata."/".$name.$subdir; + $multidirname = 'multidir_'.$type; + $dirname = 'dir_'.$type; + + if($type != 'temp') + { + // For multicompany sharings + $this->$module->$multidirname = array($this->entity => $rootfordata."/".$name); + + // For backward compatibility + $this->$module->$dirname = $rootfordata."/".$name; + } + else + { + // For multicompany sharings + $this->$module->$multidirname = array($this->entity => $rootfortemp."/".$name."/temp"); + + // For backward compatibility + $this->$module->$dirname = $rootfortemp."/".$name."/temp"; + } } } } } // For mycompany storage - $this->mycompany->multidir_output = array($this->entity => $rootfordata."/mycompany"); - $this->mycompany->multidir_temp = array($this->entity => $rootfordata."/mycompany/temp"); - // For backward compatibility - $this->mycompany->dir_output = $rootfordata."/mycompany"; - $this->mycompany->dir_temp = $rootfordata."/mycompany/temp"; + $this->mycompany->dir_output = $rootfordata."/mycompany"; + $this->mycompany->dir_temp = $rootfortemp."/mycompany/temp"; // For admin storage - $this->admin->dir_output = $rootfordata.'/admin'; - $this->admin->dir_temp = $rootfordata.'/admin/temp'; + $this->admin->dir_output = $rootfordata.'/admin'; + $this->admin->dir_temp = $rootfortemp.'/admin/temp'; // For user storage - $this->user->multidir_output = array($this->entity => $rootfordata."/users"); - $this->user->multidir_temp = array($this->entity => $rootfordata."/users/temp"); + $this->user->multidir_output = array($this->entity => $rootfordata."/users"); + $this->user->multidir_temp = array($this->entity => $rootfortemp."/users/temp"); // For backward compatibility - $this->user->dir_output = $rootforuser."/users"; - $this->user->dir_temp = $rootforuser."/users/temp"; + $this->user->dir_output = $rootforuser."/users"; + $this->user->dir_temp = $rootfortemp."/users/temp"; // For usergroup storage - $this->usergroup->dir_output = $rootforuser."/usergroups"; - $this->usergroup->dir_temp = $rootforuser."/usergroups/temp"; + $this->usergroup->dir_output = $rootforuser."/usergroups"; + $this->usergroup->dir_temp = $rootfortemp."/usergroups/temp"; // For proposal storage - $this->propal->multidir_output = array($this->entity => $rootfordata."/propale"); - $this->propal->multidir_temp = array($this->entity => $rootfordata."/propale/temp"); + $this->propal->multidir_output = array($this->entity => $rootfordata."/propale"); + $this->propal->multidir_temp = array($this->entity => $rootfortemp."/propale/temp"); // For backward compatibility - $this->propal->dir_output = $rootfordata."/propale"; - $this->propal->dir_temp = $rootfordata."/propale/temp"; - - // For bank storage - $this->bank->multidir_output = array($this->entity => $rootfordata."/bank"); - $this->bank->multidir_temp = array($this->entity => $rootfordata."/bank/temp"); - $this->bank->dir_output = $rootfordata."/bank"; - $this->bank->dir_temp = $rootfordata."/bank/temp"; + $this->propal->dir_output = $rootfordata."/propale"; + $this->propal->dir_temp = $rootfortemp."/propale/temp"; // For medias storage - $this->medias->multidir_output = array($this->entity => $rootfordata."/medias"); - $this->medias->multidir_temp = array($this->entity => $rootfordata."/medias/temp"); + $this->medias->multidir_output = array($this->entity => $rootfordata."/medias"); + $this->medias->multidir_temp = array($this->entity => $rootfortemp."/medias/temp"); // Exception: Some dir are not the name of module. So we keep exception here for backward compatibility. // Sous module bons d'expedition - $this->expedition_bon->enabled = (!empty($this->global->MAIN_SUBMODULE_EXPEDITION) ? $this->global->MAIN_SUBMODULE_EXPEDITION : 0); + $this->expedition_bon->enabled=(! empty($this->global->MAIN_SUBMODULE_EXPEDITION)?$this->global->MAIN_SUBMODULE_EXPEDITION:0); // Sous module bons de livraison - $this->livraison_bon->enabled = (!empty($this->global->MAIN_SUBMODULE_LIVRAISON) ? $this->global->MAIN_SUBMODULE_LIVRAISON : 0); + $this->livraison_bon->enabled=(! empty($this->global->MAIN_SUBMODULE_LIVRAISON)?$this->global->MAIN_SUBMODULE_LIVRAISON:0); // Module fournisseur - // TODO To split into module supplier_invoice and supplier_order - if (!empty($this->fournisseur)) + if (! empty($this->fournisseur)) { - $this->fournisseur->commande = new stdClass(); - $this->fournisseur->commande->multidir_output = array($this->entity => $rootfordata."/fournisseur/commande"); - $this->fournisseur->commande->multidir_temp = array($this->entity => $rootfordata."/fournisseur/commande/temp"); - $this->fournisseur->commande->dir_output = $rootfordata."/fournisseur/commande"; // For backward compatibility - $this->fournisseur->commande->dir_temp = $rootfordata."/fournisseur/commande/temp"; // For backward compatibility - $this->fournisseur->facture = new stdClass(); - $this->fournisseur->facture->multidir_output = array($this->entity => $rootfordata."/fournisseur/facture"); - $this->fournisseur->facture->multidir_temp = array($this->entity => $rootfordata."/fournisseur/facture/temp"); - $this->fournisseur->facture->dir_output = $rootfordata."/fournisseur/facture"; // For backward compatibility - $this->fournisseur->facture->dir_temp = $rootfordata."/fournisseur/facture/temp"; // For backward compatibility + $this->fournisseur->commande=new stdClass(); + $this->fournisseur->commande->multidir_output = array($this->entity => $rootfordata."/fournisseur/commande"); + $this->fournisseur->commande->multidir_temp = array($this->entity => $rootfortemp."/fournisseur/commande/temp"); + $this->fournisseur->commande->dir_output = $rootfordata."/fournisseur/commande"; // For backward compatibility + $this->fournisseur->commande->dir_temp = $rootfortemp."/fournisseur/commande/temp"; // For backward compatibility - $this->fournisseur->payment = new stdClass(); - $this->fournisseur->payment->multidir_output = array($this->entity => $rootfordata."/fournisseur/payment"); - $this->fournisseur->payment->multidir_temp = array($this->entity => $rootfordata."/fournisseur/payment/temp"); - $this->fournisseur->payment->dir_output = $rootfordata."/fournisseur/payment"; // For backward compatibility - $this->fournisseur->payment->dir_temp = $rootfordata."/fournisseur/payment/temp"; // For backward compatibility + $this->fournisseur->facture=new stdClass(); + $this->fournisseur->facture->multidir_output = array($this->entity => $rootfordata."/fournisseur/facture"); + $this->fournisseur->facture->multidir_temp = array($this->entity => $rootfortemp."/fournisseur/facture/temp"); + $this->fournisseur->facture->dir_output = $rootfordata."/fournisseur/facture"; // For backward compatibility + $this->fournisseur->facture->dir_temp = $rootfortemp."/fournisseur/facture/temp"; // For backward compatibility - // To prepare split of module vendor(fournisseur) into vendor + supplier_order + supplier_invoice + supplierproposal - if (!empty($this->fournisseur->enabled)) // By default, if module supplier is on, we set new properties + $this->supplierproposal=new stdClass(); + $this->supplierproposal->multidir_output = array($this->entity => $rootfordata."/supplier_proposal"); + $this->supplierproposal->multidir_temp = array($this->entity => $rootfortemp."/supplier_proposal/temp"); + $this->supplierproposal->dir_output = $rootfordata."/supplier_proposal"; // For backward compatibility + $this->supplierproposal->dir_temp = $rootfortemp."/supplier_proposal/temp"; // For backward compatibility + + $this->fournisseur->payment=new stdClass(); + $this->fournisseur->payment->multidir_output = array($this->entity => $rootfordata."/fournisseur/payment"); + $this->fournisseur->payment->multidir_temp = array($this->entity => $rootfortemp."/fournisseur/payment/temp"); + $this->fournisseur->payment->dir_output = $rootfordata."/fournisseur/payment"; // For backward compatibility + $this->fournisseur->payment->dir_temp = $rootfortemp."/fournisseur/payment/temp"; // For backward compatibility + + // To prepare split of module fournisseur into fournisseur + supplier_order + supplier_invoice + if (! empty($this->fournisseur->enabled) && empty($this->global->MAIN_USE_NEW_SUPPLIERMOD)) // By default, if module supplier is on, we set new properties { - if (empty($this->global->MAIN_USE_NEW_SUPPLIERMOD)) // This can be set to 1 once modules purchase order and supplier invoice exists - { - $this->supplier_order = new stdClass(); - $this->supplier_order->enabled = 1; - $this->supplier_order->multidir_output = array($this->entity => $rootfordata."/fournisseur/commande"); - $this->supplier_order->multidir_temp = array($this->entity => $rootfordata."/fournisseur/commande/temp"); - $this->supplier_order->dir_output = $rootfordata."/fournisseur/commande"; // For backward compatibility - $this->supplier_order->dir_temp = $rootfordata."/fournisseur/commande/temp"; // For backward compatibility - } + $this->supplier_order=new stdClass(); + $this->supplier_order->enabled = 1; + $this->supplier_order->multidir_output = array($this->entity => $rootfordata."/fournisseur/commande"); + $this->supplier_order->multidir_temp = array($this->entity => $rootfortemp."/fournisseur/commande/temp"); + $this->supplier_order->dir_output = $rootfordata."/fournisseur/commande"; // For backward compatibility + $this->supplier_order->dir_temp = $rootfortemp."/fournisseur/commande/temp"; // For backward compatibility - if (empty($this->global->MAIN_USE_NEW_SUPPLIERMOD)) // This can be set to 1 once modules purchase order and supplier invoice exists - { - $this->supplier_invoice = new stdClass(); - $this->supplier_invoice->enabled = 1; - $this->supplier_invoice->multidir_output = array($this->entity => $rootfordata."/fournisseur/facture"); - $this->supplier_invoice->multidir_temp = array($this->entity => $rootfordata."/fournisseur/facture/temp"); - $this->supplier_invoice->dir_output = $rootfordata."/fournisseur/facture"; // For backward compatibility - $this->supplier_invoice->dir_temp = $rootfordata."/fournisseur/facture/temp"; // For backward compatibility - } + $this->supplier_invoice=new stdClass(); + $this->supplier_invoice->enabled = 1; + $this->supplier_invoice->multidir_output = array($this->entity => $rootfordata."/fournisseur/facture"); + $this->supplier_invoice->multidir_temp = array($this->entity => $rootfortemp."/fournisseur/facture/temp"); + $this->supplier_invoice->dir_output = $rootfordata."/fournisseur/facture"; // For backward compatibility + $this->supplier_invoice->dir_temp = $rootfortemp."/fournisseur/facture/temp"; // For backward compatibility + + $this->supplierproposal=new stdClass(); + $this->supplierproposal->multidir_output = array($this->entity => $rootfordata."/supplier_proposal"); + $this->supplierproposal->multidir_temp = array($this->entity => $rootfortemp."/supplier_proposal/temp"); + $this->supplierproposal->dir_output = $rootfordata."/supplier_proposal"; // For backward compatibility + $this->supplierproposal->dir_temp = $rootfortemp."/supplier_proposal/temp"; // For backward compatibility } } // Module product/service - $this->product->multidir_output = array($this->entity => $rootfordata."/produit"); - $this->product->multidir_temp = array($this->entity => $rootfordata."/produit/temp"); - $this->service->multidir_output = array($this->entity => $rootfordata."/produit"); - $this->service->multidir_temp = array($this->entity => $rootfordata."/produit/temp"); + $this->product->multidir_output = array($this->entity => $rootfordata."/produit"); + $this->product->multidir_temp = array($this->entity => $rootfortemp."/produit/temp"); + $this->service->multidir_output = array($this->entity => $rootfordata."/produit"); + $this->service->multidir_temp = array($this->entity => $rootfortemp."/produit/temp"); // For backward compatibility - $this->product->dir_output = $rootfordata."/produit"; - $this->product->dir_temp = $rootfordata."/produit/temp"; - $this->service->dir_output = $rootfordata."/produit"; - $this->service->dir_temp = $rootfordata."/produit/temp"; + $this->product->dir_output = $rootfordata."/produit"; + $this->product->dir_temp = $rootfortemp."/produit/temp"; + $this->service->dir_output = $rootfordata."/produit"; + $this->service->dir_temp = $rootfortemp."/produit/temp"; // Module productbatch - $this->productbatch->multidir_output = array($this->entity => $rootfordata."/produitlot"); - $this->productbatch->multidir_temp = array($this->entity => $rootfordata."/produitlot/temp"); + $this->productbatch->multidir_output = array($this->entity => $rootfordata."/produitlot"); + $this->productbatch->multidir_temp = array($this->entity => $rootfortemp."/produitlot/temp"); // Module contrat - $this->contrat->multidir_output = array($this->entity => $rootfordata."/contract"); - $this->contrat->multidir_temp = array($this->entity => $rootfordata."/contract/temp"); + $this->contrat->multidir_output = array($this->entity => $rootfordata."/contract"); + $this->contrat->multidir_temp = array($this->entity => $rootfortemp."/contract/temp"); // For backward compatibility - $this->contrat->dir_output = $rootfordata."/contract"; - $this->contrat->dir_temp = $rootfordata."/contract/temp"; + $this->contrat->dir_output = $rootfordata."/contract"; + $this->contrat->dir_temp = $rootfortemp."/contract/temp"; // Module bank - $this->bank->dir_output = $rootfordata."/bank"; - $this->bank->dir_temp = $rootfordata."/bank/temp"; - + $this->bank->dir_output = $rootfordata."/bank"; + $this->bank->dir_temp = $rootfortemp."/bank/temp"; // Set some default values //$this->global->MAIN_LIST_FILTER_ON_DAY=1; // On filter that show date, we must show input field for day before or after month From a4c1c00728d94c237facbdc6f1507a178295ad70 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Sun, 2 Feb 2020 21:02:43 +0100 Subject: [PATCH 021/306] Update image path after move image directory We need change path after move image in the commit: https://github.com/Dolibarr/dolibarr/commit/de4183ea6552e917ac33f8416f784340966f2a8d#diff-7af3f43d430a17d6e548d766fbacecc2 --- htdocs/core/class/dolreceiptprinter.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/dolreceiptprinter.class.php b/htdocs/core/class/dolreceiptprinter.class.php index 4425e43cda2..72d07bfc9e0 100644 --- a/htdocs/core/class/dolreceiptprinter.class.php +++ b/htdocs/core/class/dolreceiptprinter.class.php @@ -515,7 +515,7 @@ class dolReceiptPrinter extends Printer { global $conf; $error = 0; - $img = EscposImage::load(DOL_DOCUMENT_ROOT.'/theme/common/dolibarr_logo_bw.png'); + $img = EscposImage::load(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo_bw.png'); //$this->profile = CapabilityProfile::load("TM-T88IV"); $ret = $this->initPrinter($printerid); if ($ret > 0) { From 7903e0379b286135050cac0d437e95c3304dfd87 Mon Sep 17 00:00:00 2001 From: Tobias Sekan Date: Mon, 3 Feb 2020 09:50:44 +0100 Subject: [PATCH 022/306] Fix wrong category name on user category card --- htdocs/categories/viewcat.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 7f4156a6d15..db0fdd1dd73 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -207,7 +207,7 @@ elseif ($type == Categorie::TYPE_MEMBER) $title = $langs->trans("MembersCateg elseif ($type == Categorie::TYPE_CONTACT) $title = $langs->trans("ContactCategoriesShort"); elseif ($type == Categorie::TYPE_ACCOUNT) $title = $langs->trans("AccountsCategoriesShort"); elseif ($type == Categorie::TYPE_PROJECT) $title = $langs->trans("ProjectsCategoriesShort"); -elseif ($type == Categorie::TYPE_USER) $title = $langs->trans("ProjectsCategoriesShort"); +elseif ($type == Categorie::TYPE_USER) $title = $langs->trans("UsersCategoriesShort"); else $title = $langs->trans("Category"); $head = categories_prepare_head($object, $type); From 540e82102b32da0f242ec27fac0c3a028f5d2243 Mon Sep 17 00:00:00 2001 From: AdrianDominik Date: Mon, 27 Jan 2020 10:54:08 +0100 Subject: [PATCH 023/306] FIX: #12908 User login with credentials from self-subscription form fails --- htdocs/adherents/class/adherent.class.php | 32 +- htdocs/user/class/user.class.php | 338 +++++++++++----------- 2 files changed, 191 insertions(+), 179 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index ec4042cdf88..4dbdb519831 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -641,7 +641,7 @@ class Adherent extends CommonObject $isencrypted = empty($conf->global->DATABASE_PWD_ENCRYPTED)?0:1; // If password to set differs from the one found into database - $result=$this->setPassword($user, $this->pass, $isencrypted, $notrigger, $nosyncuserpass); + $result=$this->setPassword($user, $this->pass, $this->pass_indatabase_crypted, $isencrypted, $notrigger, $nosyncuserpass); if (! $nbrowsaffected) $nbrowsaffected++; } } @@ -966,7 +966,7 @@ class Adherent extends CommonObject * @param int $nosyncuser Do not synchronize linked user * @return string If OK return clear password, 0 if no change, < 0 if error */ - public function setPassword($user, $password = '', $isencrypted = 0, $notrigger = 0, $nosyncuser = 0) + public function setPassword($user, $password = '', $password_indatabase_crypted = '', $isencrypted = 0, $notrigger = 0, $nosyncuser = 0) { global $conf, $langs; @@ -974,21 +974,23 @@ class Adherent extends CommonObject dol_syslog(get_class($this)."::setPassword user=".$user->id." password=".preg_replace('/./i', '*', $password)." isencrypted=".$isencrypted); - // If new password not provided, we generate one - if (! $password) + // If password_crypted not provided, try crypt password provided + if(!$password_indatabase_crypted) { - require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; - $password=getRandomPassword(false); + // If new password not provided, we generate one + if (!$password) + { + require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; + $password=getRandomPassword(false); + } + + // Crypt password + $password_crypted = dol_hash($password); + + } else { + $password_crypted = $password_indatabase_crypted; } - // Crypt password - $password_crypted = dol_hash($password); - - $password_indatabase = ''; - if (! $isencrypted) - { - $password_indatabase = $password; - } $this->db->begin(); @@ -1030,7 +1032,7 @@ class Adherent extends CommonObject if ($result >= 0) { - $result=$luser->setPassword($user, $this->pass, 0, 0, 1); + $result=$luser->setPassword($user, $this->pass, $this->pass_indatabase_crypted, 0, 0, 1); if ($result < 0) { $this->error=$luser->error; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 9bfe66d9dec..ff5639b91ad 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -75,34 +75,34 @@ class User extends CommonObject public $personal_email; - /** - * @var array array of socialnetworks - */ - public $socialnetworks; + /** + * @var array array of socialnetworks + */ + public $socialnetworks; - /** - * Skype username - * @var string - * @deprecated - */ + /** + * Skype username + * @var string + * @deprecated + */ public $skype; - /** - * Twitter username - * @var string - * @deprecated - */ + /** + * Twitter username + * @var string + * @deprecated + */ public $twitter; - /** - * Facebook username - * @var string - * @deprecated - */ + /** + * Facebook username + * @var string + * @deprecated + */ public $facebook; - /** - * Linkedin username - * @var string - * @deprecated - */ + /** + * Linkedin username + * @var string + * @deprecated + */ public $linkedin; public $job; // job position @@ -121,7 +121,7 @@ class User extends CommonObject public $office_phone; public $office_fax; public $user_mobile; - public $personal_mobile; + public $personal_mobile; public $admin; public $login; public $api_key; @@ -139,18 +139,18 @@ class User extends CommonObject public $pass_indatabase_crypted; /** - * Date creation record (datec) - * - * @var integer - */ - public $datec; + * Date creation record (datec) + * + * @var integer + */ + public $datec; /** - * Date modification record (tms) - * - * @var integer - */ - public $datem; + * Date modification record (tms) + * + * @var integer + */ + public $datem; //! If this is defined, it is an external user /** @@ -167,8 +167,8 @@ class User extends CommonObject public $contactid; /** - * @var int ID - */ + * @var int ID + */ public $fk_member; /** @@ -176,7 +176,7 @@ class User extends CommonObject */ public $fk_user; public $fk_user_expense_validator; - public $fk_user_holiday_validator; + public $fk_user_holiday_validator; public $clicktodial_url; public $clicktodial_login; @@ -222,10 +222,10 @@ class User extends CommonObject public $fk_warehouse; public $fields = array( - 'rowid'=>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'index'=>1, 'position'=>1, 'comment'=>'Id'), - 'lastname'=>array('type'=>'varchar(50)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>20, 'searchall'=>1, 'comment'=>'Reference of object'), - 'firstname'=>array('type'=>'varchar(50)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'), - ); + 'rowid'=>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'index'=>1, 'position'=>1, 'comment'=>'Id'), + 'lastname'=>array('type'=>'varchar(50)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>20, 'searchall'=>1, 'comment'=>'Reference of object'), + 'firstname'=>array('type'=>'varchar(50)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'), + ); const STATUS_DISABLED = 0; @@ -391,7 +391,7 @@ class User extends CommonObject $this->office_phone = $obj->office_phone; $this->office_fax = $obj->office_fax; $this->user_mobile = $obj->user_mobile; - $this->personal_mobile = $obj->personal_mobile; + $this->personal_mobile = $obj->personal_mobile; $this->email = $obj->email; $this->personal_email = $obj->personal_email; $this->socialnetworks = (array) json_decode($obj->socialnetworks, true); @@ -427,8 +427,8 @@ class User extends CommonObject $this->contactid = $obj->fk_socpeople; $this->fk_member = $obj->fk_member; $this->fk_user = $obj->fk_user; - $this->fk_user_expense_validator = $obj->fk_user_expense_validator; - $this->fk_user_holiday_validator = $obj->fk_user_holiday_validator; + $this->fk_user_expense_validator = $obj->fk_user_expense_validator; + $this->fk_user_holiday_validator = $obj->fk_user_holiday_validator; $this->default_range = $obj->default_range; $this->default_c_exp_tax_cat = $obj->default_c_exp_tax_cat; @@ -1032,7 +1032,7 @@ class User extends CommonObject * Existing categories are left untouch. * * @param int[]|int $categories Category or categories IDs - * @return void + * @return void */ public function setCategories($categories) { @@ -1122,24 +1122,24 @@ class User extends CommonObject // Remove extrafields if ((!$error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used { - $result = $this->deleteExtraFields(); - if ($result < 0) - { - $error++; - dol_syslog(get_class($this)."::delete error -4 ".$this->error, LOG_ERR); - } + $result = $this->deleteExtraFields(); + if ($result < 0) + { + $error++; + dol_syslog(get_class($this)."::delete error -4 ".$this->error, LOG_ERR); + } } // Remove user if (!$error) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."user WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::delete", LOG_DEBUG); - if (!$this->db->query($sql)) - { - $error++; - $this->error = $this->db->lasterror(); - } + dol_syslog(get_class($this)."::delete", LOG_DEBUG); + if (!$this->db->query($sql)) + { + $error++; + $this->error = $this->db->lasterror(); + } } if (!$error) @@ -1180,7 +1180,7 @@ class User extends CommonObject if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->lastname = ucwords($this->lastname); if (!empty($conf->global->MAIN_ALL_TO_UPPER)) $this->lastname = strtoupper($this->lastname); - if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->firstname = ucwords($this->firstname); + if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->firstname = ucwords($this->firstname); $this->login = trim($this->login); if (!isset($this->entity)) $this->entity = $conf->entity; // If not defined, we use default value @@ -1302,7 +1302,7 @@ class User extends CommonObject } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Create a user from a contact object. User will be internal but if contact is linked to a third party, user will be external * @@ -1313,7 +1313,7 @@ class User extends CommonObject */ public function create_from_contact($contact, $login = '', $password = '') { - // phpcs:enable + // phpcs:enable global $conf, $user, $langs; $error = 0; @@ -1381,7 +1381,7 @@ class User extends CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Create a user into database from a member object * @@ -1391,7 +1391,7 @@ class User extends CommonObject */ public function create_from_member($member, $login = '') { - // phpcs:enable + // phpcs:enable global $conf, $user, $langs; // Positionne parametres @@ -1402,6 +1402,7 @@ class User extends CommonObject $this->email = $member->email; $this->fk_member = $member->id; $this->pass = $member->pass; + $this->pass_indatabase_crypted = $member->pass_indatabase_crypted; $this->address = $member->address; $this->zip = $member->zip; $this->town = $member->town; @@ -1417,7 +1418,7 @@ class User extends CommonObject $result = $this->create($user); if ($result > 0) { - $newpass = $this->setPassword($user, $this->pass); + $newpass = $this->setPassword($user, $this->pass, $this->pass_indatabase_crypted); if (is_numeric($newpass) && $newpass < 0) $result = -2; if ($result > 0 && $member->fk_soc) // If member is linked to a thirdparty @@ -1456,7 +1457,7 @@ class User extends CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Assign rights by default * @@ -1464,7 +1465,7 @@ class User extends CommonObject */ public function set_default_rights() { - // phpcs:enable + // phpcs:enable global $conf; $sql = "SELECT id FROM ".MAIN_DB_PREFIX."rights_def"; @@ -1523,7 +1524,7 @@ class User extends CommonObject if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->lastname = ucwords($this->lastname); if (!empty($conf->global->MAIN_ALL_TO_UPPER)) $this->lastname = strtoupper($this->lastname); - if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->firstname = ucwords($this->firstname); + if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->firstname = ucwords($this->firstname); $this->lastname = trim($this->lastname); $this->firstname = trim($this->firstname); @@ -1541,9 +1542,9 @@ class User extends CommonObject $this->office_phone = trim($this->office_phone); $this->office_fax = trim($this->office_fax); $this->user_mobile = trim($this->user_mobile); - $this->personal_mobile = trim($this->personal_mobile); + $this->personal_mobile = trim($this->personal_mobile); $this->email = trim($this->email); - $this->personal_email = trim($this->personal_email); + $this->personal_email = trim($this->personal_email); $this->job = trim($this->job); $this->signature = trim($this->signature); @@ -1594,10 +1595,10 @@ class User extends CommonObject $sql .= ", office_phone = '".$this->db->escape($this->office_phone)."'"; $sql .= ", office_fax = '".$this->db->escape($this->office_fax)."'"; $sql .= ", user_mobile = '".$this->db->escape($this->user_mobile)."'"; - $sql .= ", personal_mobile = '".$this->db->escape($this->personal_mobile)."'"; + $sql .= ", personal_mobile = '".$this->db->escape($this->personal_mobile)."'"; $sql .= ", email = '".$this->db->escape($this->email)."'"; - $sql .= ", personal_email = '".$this->db->escape($this->personal_email)."'"; - $sql .= ", socialnetworks = '".$this->db->escape(json_encode($this->socialnetworks))."'"; + $sql .= ", personal_email = '".$this->db->escape($this->personal_email)."'"; + $sql .= ", socialnetworks = '".$this->db->escape(json_encode($this->socialnetworks))."'"; $sql .= ", job = '".$this->db->escape($this->job)."'"; $sql .= ", signature = '".$this->db->escape($this->signature)."'"; $sql .= ", accountancy_code = '".$this->db->escape($this->accountancy_code)."'"; @@ -1609,8 +1610,8 @@ class User extends CommonObject $sql .= ", photo = ".($this->photo ? "'".$this->db->escape($this->photo)."'" : "null"); $sql .= ", openid = ".($this->openid ? "'".$this->db->escape($this->openid)."'" : "null"); $sql .= ", fk_user = ".($this->fk_user > 0 ? "'".$this->db->escape($this->fk_user)."'" : "null"); - $sql .= ", fk_user_expense_validator = ".($this->fk_user_expense_validator > 0 ? "'".$this->db->escape($this->fk_user_expense_validator)."'" : "null"); - $sql .= ", fk_user_holiday_validator = ".($this->fk_user_holiday_validator > 0 ? "'".$this->db->escape($this->fk_user_holiday_validator)."'" : "null"); + $sql .= ", fk_user_expense_validator = ".($this->fk_user_expense_validator > 0 ? "'".$this->db->escape($this->fk_user_expense_validator)."'" : "null"); + $sql .= ", fk_user_holiday_validator = ".($this->fk_user_holiday_validator > 0 ? "'".$this->db->escape($this->fk_user_holiday_validator)."'" : "null"); if (isset($this->thm) || $this->thm != '') $sql .= ", thm= ".($this->thm != '' ? "'".$this->db->escape($this->thm)."'" : "null"); if (isset($this->tjm) || $this->tjm != '') $sql .= ", tjm= ".($this->tjm != '' ? "'".$this->db->escape($this->tjm)."'" : "null"); if (isset($this->salary) || $this->salary != '') $sql .= ", salary= ".($this->salary != '' ? "'".$this->db->escape($this->salary)."'" : "null"); @@ -1810,7 +1811,7 @@ class User extends CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Mise a jour en base de la date de derniere connexion d'un utilisateur * Fonction appelee lors d'une nouvelle connexion @@ -1819,7 +1820,7 @@ class User extends CommonObject */ public function update_last_login_date() { - // phpcs:enable + // phpcs:enable $now = dol_now(); $sql = "UPDATE ".MAIN_DB_PREFIX."user SET"; @@ -1854,7 +1855,7 @@ class User extends CommonObject * @param int $nosyncmember Do not synchronize linked member * @return string If OK return clear password, 0 if no change, < 0 if error */ - public function setPassword($user, $password = '', $changelater = 0, $notrigger = 0, $nosyncmember = 0) + public function setPassword($user, $password = '', $password_indatabase_crypted = '', $changelater = 0, $notrigger = 0, $nosyncmember = 0) { global $conf, $langs; require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; @@ -1863,14 +1864,23 @@ class User extends CommonObject dol_syslog(get_class($this)."::setPassword user=".$user->id." password=".preg_replace('/./i', '*', $password)." changelater=".$changelater." notrigger=".$notrigger." nosyncmember=".$nosyncmember, LOG_DEBUG); - // If new password not provided, we generate one - if (!$password) + // If password_crypted not provided, try crypt password provided + if(!$password_indatabase_crypted) { - $password = getRandomPassword(false); + // If new password not provided, we generate one + if (!$password) + { + $password = getRandomPassword(false); + } + + // Crypt password + $password_crypted = dol_hash($password); + + } else { + $password_crypted = $password_indatabase_crypted; } - // Crypt password - $password_crypted = dol_hash($password); + // Mise a jour if (!$changelater) @@ -1913,7 +1923,7 @@ class User extends CommonObject if ($result >= 0) { - $result = $adh->setPassword($user, $this->pass, (empty($conf->global->DATABASE_PWD_ENCRYPTED) ? 0 : 1), 1); // Cryptage non gere dans module adherent + $result = $adh->setPassword($user, $this->pass, $this->pass_indatabase_crypted, (empty($conf->global->DATABASE_PWD_ENCRYPTED) ? 0 : 1), 1); // Cryptage non gere dans module adherent if ($result < 0) { $this->error = $adh->error; @@ -1977,7 +1987,7 @@ class User extends CommonObject } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Send new password by email * @@ -1988,7 +1998,7 @@ class User extends CommonObject */ public function send_password($user, $password = '', $changelater = 0) { - // phpcs:enable + // phpcs:enable global $conf, $langs; global $dolibarr_main_url_root; @@ -2002,19 +2012,19 @@ class User extends CommonObject $outputlangs = new Translate("", $conf); if (isset($this->conf->MAIN_LANG_DEFAULT) - && $this->conf->MAIN_LANG_DEFAULT != 'auto') + && $this->conf->MAIN_LANG_DEFAULT != 'auto') { // If user has defined its own language (rare because in most cases, auto is used) $outputlangs->getDefaultLang($this->conf->MAIN_LANG_DEFAULT); } if ($user->conf->MAIN_LANG_DEFAULT) { - $outputlangs->setDefaultLang($user->conf->MAIN_LANG_DEFAULT); - } + $outputlangs->setDefaultLang($user->conf->MAIN_LANG_DEFAULT); + } else { // If user has not defined its own language, we used current language $outputlangs = $langs; } - // Load translation files required by the page + // Load translation files required by the page $outputlangs->loadLangs(array("main", "errors", "users", "other")); $appli = constant('DOL_APPLICATION_TITLE'); @@ -2057,8 +2067,8 @@ class User extends CommonObject dol_syslog(get_class($this)."::send_password changelater is on, url=".$url); } - $mailfile = new CMailFile( - $subject, + $mailfile = new CMailFile( + $subject, $this->email, $conf->global->MAIN_MAIL_EMAIL_FROM, $mesg, @@ -2068,8 +2078,8 @@ class User extends CommonObject '', '', 0, - $msgishtml - ); + $msgishtml + ); if ($mailfile->sendfile()) { @@ -2094,7 +2104,7 @@ class User extends CommonObject } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Read clicktodial information for user * @@ -2102,7 +2112,7 @@ class User extends CommonObject */ public function fetch_clicktodial() { - // phpcs:enable + // phpcs:enable $sql = "SELECT url, login, pass, poste "; $sql .= " FROM ".MAIN_DB_PREFIX."user_clicktodial as u"; $sql .= " WHERE u.fk_user = ".$this->id; @@ -2132,15 +2142,15 @@ class User extends CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Update clicktodial info * * @return int <0 if KO, >0 if OK - */ - public function update_clicktodial() - { - // phpcs:enable + */ + public function update_clicktodial() + { + // phpcs:enable $this->db->begin(); $sql = "DELETE FROM ".MAIN_DB_PREFIX."user_clicktodial"; @@ -2170,10 +2180,10 @@ class User extends CommonObject $this->error = $this->db->lasterror(); return -1; } - } + } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Add user into a group * @@ -2184,7 +2194,7 @@ class User extends CommonObject */ public function SetInGroup($group, $entity, $notrigger = 0) { - // phpcs:enable + // phpcs:enable global $conf, $langs, $user; $error = 0; @@ -2235,7 +2245,7 @@ class User extends CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Remove a user from a group * @@ -2246,7 +2256,7 @@ class User extends CommonObject */ public function RemoveFromGroup($group, $entity, $notrigger = 0) { - // phpcs:enable + // phpcs:enable global $conf, $langs, $user; $error = 0; @@ -2333,7 +2343,7 @@ class User extends CommonObject global $dolibarr_main_authentication, $dolibarr_main_demo; global $menumanager; - if (!$user->rights->user->user->lire && $user->id != $this->id) $option = 'nolink'; + if (!$user->rights->user->user->lire && $user->id != $this->id) $option = 'nolink'; if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && $withpictoimg) $withpictoimg = 0; @@ -2427,8 +2437,8 @@ class User extends CommonObject $result .= (($option == 'nolink') ? '' : $linkstart); if ($withpictoimg) { - $paddafterimage = ''; - if (abs($withpictoimg) == 1) $paddafterimage = 'style="margin-'.($langs->trans("DIRECTION") == 'rtl' ? 'left' : 'right').': 3px;"'; + $paddafterimage = ''; + if (abs($withpictoimg) == 1) $paddafterimage = 'style="margin-'.($langs->trans("DIRECTION") == 'rtl' ? 'left' : 'right').': 3px;"'; // Only picto if ($withpictoimg > 0) $picto = ''.img_object('', 'user', $paddafterimage.' '.($notooltip ? '' : 'class="classfortooltip"'), 0, 0, $notooltip ? 0 : 1).''; // Picto must be a photo @@ -2482,7 +2492,7 @@ class User extends CommonObject $linkend = ''; } - if ($option == 'nolink') + if ($option == 'nolink') { $linkstart = ''; $linkend = ''; @@ -2506,17 +2516,17 @@ class User extends CommonObject return $this->LibStatut($this->statut, $mode); } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - /** - * Return label of a status of user (active, inactive) - * - * @param int $status Id status + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return label of a status of user (active, inactive) + * + * @param int $status Id status * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto - * @return string Label of status - */ - public function LibStatut($status, $mode = 0) - { - // phpcs:enable + * @return string Label of status + */ + public function LibStatut($status, $mode = 0) + { + // phpcs:enable global $langs; if (empty($this->labelStatus) || empty($this->labelStatusShort)) @@ -2549,7 +2559,7 @@ class User extends CommonObject */ public function _load_ldap_dn($info, $mode = 0) { - // phpcs:enable + // phpcs:enable global $conf; $dn = ''; if ($mode == 0) $dn = $conf->global->LDAP_KEY_USERS."=".$info[$conf->global->LDAP_KEY_USERS].",".$conf->global->LDAP_USER_DN; @@ -2567,7 +2577,7 @@ class User extends CommonObject */ public function _load_ldap_info() { - // phpcs:enable + // phpcs:enable global $conf, $langs; $info = array(); @@ -2593,7 +2603,7 @@ class User extends CommonObject 'LDAP_FIELD_SKYPE' => 'skype', 'LDAP_FIELD_TWITTER' => 'twitter', 'LDAP_FIELD_FACEBOOK' => 'facebook', - 'LDAP_FIELD_LINKEDIN' => 'linkedin' + 'LDAP_FIELD_LINKEDIN' => 'linkedin' ); // Champs @@ -2677,22 +2687,22 @@ class User extends CommonObject if ($this->phone_mobile) $info["phpgwCellTelephoneNumber"] = $this->phone_mobile; } - if (!empty($conf->global->LDAP_FIELD_USERID))$info[$conf->global->LDAP_FIELD_USERID] = $this->id; - if (!empty($info[$conf->global->LDAP_FIELD_GROUPID])) { - $usergroup = new UserGroup($this->db); - $groupslist = $usergroup->listGroupsForUser($this->id); - $info[$conf->global->LDAP_FIELD_GROUPID] = '1'; - if (!empty($groupslist)) { - foreach ($groupslist as $groupforuser) { - $info[$conf->global->LDAP_FIELD_GROUPID] = $groupforuser->id; //Select first group in list - break; - } - } - } - if (!empty($this->firstname) && !empty($conf->global->LDAP_FIELD_HOMEDIRECTORY) && !empty($conf->global->LDAP_FIELD_HOMEDIRECTORYPREFIX)) $info[$conf->global->LDAP_FIELD_HOMEDIRECTORY] = "{$conf->global->LDAP_FIELD_HOMEDIRECTORYPREFIX}/$this->firstname"; + if (!empty($conf->global->LDAP_FIELD_USERID))$info[$conf->global->LDAP_FIELD_USERID] = $this->id; + if (!empty($info[$conf->global->LDAP_FIELD_GROUPID])) { + $usergroup = new UserGroup($this->db); + $groupslist = $usergroup->listGroupsForUser($this->id); + $info[$conf->global->LDAP_FIELD_GROUPID] = '1'; + if (!empty($groupslist)) { + foreach ($groupslist as $groupforuser) { + $info[$conf->global->LDAP_FIELD_GROUPID] = $groupforuser->id; //Select first group in list + break; + } + } + } + if (!empty($this->firstname) && !empty($conf->global->LDAP_FIELD_HOMEDIRECTORY) && !empty($conf->global->LDAP_FIELD_HOMEDIRECTORYPREFIX)) $info[$conf->global->LDAP_FIELD_HOMEDIRECTORY] = "{$conf->global->LDAP_FIELD_HOMEDIRECTORYPREFIX}/$this->firstname"; - return $info; - } + return $info; + } /** @@ -2719,7 +2729,7 @@ class User extends CommonObject $this->note_public = 'This is a note public'; $this->note_private = 'This is a note private'; $this->email = 'email@specimen.com'; - $this->personal_email = 'personalemail@specimen.com'; + $this->personal_email = 'personalemail@specimen.com'; $this->socialnetworks = array( 'skype' => 'skypepseudo', 'twitter' => 'twitterpseudo', @@ -2729,7 +2739,7 @@ class User extends CommonObject $this->office_phone = '0999999999'; $this->office_fax = '0999999998'; $this->user_mobile = '0999999997'; - $this->personal_mobile = '0999999996'; + $this->personal_mobile = '0999999996'; $this->admin = 0; $this->login = 'dolibspec'; $this->pass = 'dolibspec'; @@ -2854,7 +2864,7 @@ class User extends CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Update user using data from the LDAP * @@ -2863,7 +2873,7 @@ class User extends CommonObject */ public function update_ldap2dolibarr(&$ldapuser) { - // phpcs:enable + // phpcs:enable // TODO: Voir pourquoi le update met à jour avec toutes les valeurs vide (global $user écrase ?) global $user, $conf; @@ -2894,7 +2904,7 @@ class User extends CommonObject } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Return and array with all instanciated first level children users of current user * @@ -2903,7 +2913,7 @@ class User extends CommonObject */ public function get_children() { - // phpcs:enable + // phpcs:enable $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."user"; $sql .= " WHERE fk_user = ".$this->id; @@ -2962,7 +2972,7 @@ class User extends CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Build the hierarchy/tree of users into an array. * Set and return this->users that is an array sorted according to tree with arrays of: @@ -2976,9 +2986,9 @@ class User extends CommonObject * @param string $filter SQL filter on users * @return array Array of users $this->users. Note: $this->parentof is also set. */ - public function get_full_tree($deleteafterid = 0, $filter = '') - { - // phpcs:enable + public function get_full_tree($deleteafterid = 0, $filter = '') + { + // phpcs:enable global $conf, $user; global $hookmanager; @@ -3078,8 +3088,8 @@ class User extends CommonObject * @return array Array of user id lower than user (all levels under user). This overwrite this->users. * @see get_children() */ - public function getAllChildIds($addcurrentuser = 0) - { + public function getAllChildIds($addcurrentuser = 0) + { $childids = array(); if (isset($this->cache_childids[$this->id])) @@ -3107,7 +3117,7 @@ class User extends CommonObject return $childids; } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * For user id_user and its childs available in this->users, define property fullpath and fullname. * Function called by get_full_tree(). @@ -3116,9 +3126,9 @@ class User extends CommonObject * @param int $protection Deep counter to avoid infinite loop (no more required, a protection is added with array useridfound) * @return int < 0 if KO (infinit loop), >= 0 if OK */ - public function build_path_from_id_user($id_user, $protection = 0) - { - // phpcs:enable + public function build_path_from_id_user($id_user, $protection = 0) + { + // phpcs:enable dol_syslog(get_class($this)."::build_path_from_id_user id_user=".$id_user." protection=".$protection, LOG_DEBUG); if (!empty($this->users[$id_user]['fullpath'])) @@ -3171,7 +3181,7 @@ class User extends CommonObject } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Load metrics this->nb for dashboard * @@ -3179,7 +3189,7 @@ class User extends CommonObject */ public function load_state_board() { - // phpcs:enable + // phpcs:enable $this->nb = array(); @@ -3215,7 +3225,7 @@ class User extends CommonObject * @param int $hidedetails Hide details of lines * @param int $hidedesc Hide description * @param int $hideref Hide ref - * @param null|array $moreparams Array to provide more information + * @param null|array $moreparams Array to provide more information * @return int 0 if KO, 1 if OK */ public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null) @@ -3242,7 +3252,7 @@ class User extends CommonObject return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams); } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Return property of user from its id * @@ -3252,7 +3262,7 @@ class User extends CommonObject */ public function user_get_property($rowid, $mode) { - // phpcs:enable + // phpcs:enable $user_property = ''; if (empty($rowid)) return ''; @@ -3294,8 +3304,8 @@ class User extends CommonObject * @return int <0 if KO, >0 if OK */ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = array(), $filtermode = 'AND', $entityfilter = false) - { - global $conf, $user; + { + global $conf, $user; $sql = "SELECT t.rowid"; $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t '; @@ -3370,8 +3380,8 @@ class User extends CommonObject } else { - $this->errors[] = $this->db->lasterror(); - return -1; - } - } + $this->errors[] = $this->db->lasterror(); + return -1; + } + } } From 478f927df3667dca551eca96c0a2f08c07b038e5 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 27 Jan 2020 09:58:18 +0000 Subject: [PATCH 024/306] Fixing style errors. --- htdocs/user/class/user.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index ff5639b91ad..8809873acc6 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1875,7 +1875,6 @@ class User extends CommonObject // Crypt password $password_crypted = dol_hash($password); - } else { $password_crypted = $password_indatabase_crypted; } From ad2e10a679f082c7c16a0d1f9c65d7866c212778 Mon Sep 17 00:00:00 2001 From: AdrianDominik Date: Mon, 27 Jan 2020 11:01:13 +0100 Subject: [PATCH 025/306] FIX: #12908 User login with credentials from self-subscription form fails --- htdocs/langs/es_ES/zapier.lang | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 htdocs/langs/es_ES/zapier.lang diff --git a/htdocs/langs/es_ES/zapier.lang b/htdocs/langs/es_ES/zapier.lang new file mode 100644 index 00000000000..6b28c81832e --- /dev/null +++ b/htdocs/langs/es_ES/zapier.lang @@ -0,0 +1,28 @@ +# Copyright (C) 2019 Frédéric FRANCE +# +# 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 +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# +# Generic +# + +# Module label 'ModuleZapierForDolibarrName' +ModuleZapierForDolibarrName = Zapier para Dolibarr +# Module description 'ModuleZapierForDolibarrDesc' +ModuleZapierForDolibarrDesc = Zapier para el módulo Dolibarr + +# +# Admin page +# +ZapierForDolibarrSetup = Configuración de Zapier para Dolibarr From ed269a387f0740ec506844ba054e80cc6c8f5e3a Mon Sep 17 00:00:00 2001 From: AdrianDominik Date: Tue, 28 Jan 2020 09:25:49 +0100 Subject: [PATCH 026/306] FIX: #11975 When a product is split between multiple pages in a document, prices/quantity/etc appear on the last relevant page --- .../commande/doc/pdf_einstein.modules.php | 7 ++++++- .../commande/doc/pdf_eratosthene.modules.php | 16 ++++++++++++++-- .../modules/contract/doc/pdf_strato.modules.php | 8 +++++++- .../expedition/doc/pdf_espadon.modules.php | 16 ++++++++++++++-- .../expedition/doc/pdf_rouget.modules.php | 16 ++++++++++++++-- .../expensereport/doc/pdf_standard.modules.php | 8 +++++++- .../modules/facture/doc/pdf_crabe.modules.php | 16 ++++++++++++++-- .../modules/facture/doc/pdf_sponge.modules.php | 16 ++++++++++++++-- .../modules/livraison/doc/pdf_typhon.modules.php | 8 +++++++- .../modules/project/doc/pdf_baleine.modules.php | 8 +++++++- .../modules/project/doc/pdf_beluga.modules.php | 8 +++++++- .../project/doc/pdf_timespent.modules.php | 8 +++++++- .../modules/propale/doc/pdf_azur.modules.php | 16 ++++++++++++++-- .../modules/propale/doc/pdf_cyan.modules.php | 16 ++++++++++++++-- .../reception/doc/pdf_squille.modules.php | 16 ++++++++++++++-- .../modules/stock/doc/pdf_standard.modules.php | 8 +++++++- .../stock/doc/pdf_stdmovement.modules.php | 8 +++++++- .../supplier_invoice/pdf/pdf_canelle.modules.php | 8 +++++++- .../supplier_order/pdf/pdf_cornas.modules.php | 16 ++++++++++++++-- .../supplier_order/pdf/pdf_muscadet.modules.php | 16 ++++++++++++++-- .../doc/pdf_standard.modules.php | 8 +++++++- .../supplier_proposal/doc/pdf_aurore.modules.php | 16 ++++++++++++++-- 22 files changed, 230 insertions(+), 33 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 075ba0efb84..30fd293533b 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -440,7 +440,12 @@ class pdf_einstein extends ModelePDFCommandes else { // We found a page break - $showpricebeforepagebreak=0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; } } else // No pagebreak diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index 6342cd6ce74..b1dbca4dc56 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -572,7 +572,13 @@ class pdf_eratosthene extends ModelePDFCommandes $pdf->setPage($pageposbefore+1); $curY = $tab_top_newpage; - $showpricebeforepagebreak=0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } if (!empty($this->cols['photo']) && isset($imglinesize['width']) && isset($imglinesize['height'])) @@ -610,7 +616,13 @@ class pdf_eratosthene extends ModelePDFCommandes else { // We found a page break - $showpricebeforepagebreak=0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } } else // No pagebreak diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index badf7343295..c0cc4845aa5 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -391,7 +391,13 @@ class pdf_strato extends ModelePDFContract else { // We found a page break - $showpricebeforepagebreak=0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } } else // No pagebreak diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index 0e74faaa56d..3b917275040 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -433,7 +433,13 @@ class pdf_espadon extends ModelePdfExpedition $pdf->setPage($pageposbefore+1); $curY = $tab_top_newpage; - $showpricebeforepagebreak=0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } @@ -475,7 +481,13 @@ class pdf_espadon extends ModelePdfExpedition else { // We found a page break - $showpricebeforepagebreak=0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } } else // No pagebreak diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 0e9db902662..705b3db4064 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -452,7 +452,13 @@ class pdf_rouget extends ModelePdfExpedition $pdf->setPage($pageposbefore + 1); $curY = $tab_top_newpage; - $showpricebeforepagebreak = 0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } if (isset($imglinesize['width']) && isset($imglinesize['height'])) @@ -494,7 +500,13 @@ class pdf_rouget extends ModelePdfExpedition else { // We found a page break - $showpricebeforepagebreak = 0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } } else // No pagebreak diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index a2cefcf9ff0..2892b6196f3 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -385,7 +385,13 @@ class pdf_standard extends ModeleExpenseReport else { // We found a page break - $showpricebeforepagebreak=0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } } else // No pagebreak diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index fa661610d3b..48c1710f74f 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -494,7 +494,13 @@ class pdf_crabe extends ModelePDFFactures $pdf->setPage($pageposbefore + 1); $curY = $tab_top_newpage; - $showpricebeforepagebreak = 0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } if (isset($imglinesize['width']) && isset($imglinesize['height'])) @@ -534,7 +540,13 @@ class pdf_crabe extends ModelePDFFactures else { // We found a page break - $showpricebeforepagebreak = 0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } } else // No pagebreak diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 2911cf5d5bc..d838dd970a4 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -600,7 +600,13 @@ class pdf_sponge extends ModelePDFFactures $pdf->setPage($pageposbefore+1); $curY = $tab_top_newpage; - $showpricebeforepagebreak=0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } if (!empty($this->cols['photo']) && isset($imglinesize['width']) && isset($imglinesize['height'])) @@ -639,7 +645,13 @@ class pdf_sponge extends ModelePDFFactures else { // We found a page break - $showpricebeforepagebreak=0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } } else // No pagebreak diff --git a/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php b/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php index 00268810ce8..4d659ca193a 100644 --- a/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php +++ b/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php @@ -409,7 +409,13 @@ class pdf_typhon extends ModelePDFDeliveryOrder else { // We found a page break - $showpricebeforepagebreak=0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } } else // No pagebreak diff --git a/htdocs/core/modules/project/doc/pdf_baleine.modules.php b/htdocs/core/modules/project/doc/pdf_baleine.modules.php index 910ef3ec1cf..79941dba8d6 100644 --- a/htdocs/core/modules/project/doc/pdf_baleine.modules.php +++ b/htdocs/core/modules/project/doc/pdf_baleine.modules.php @@ -362,7 +362,13 @@ class pdf_baleine extends ModelePDFProjects else { // We found a page break - $showpricebeforepagebreak=0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + $forcedesconsamepage=1; if ($forcedesconsamepage) { diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index b26b46604ff..4072f22bf58 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -512,7 +512,13 @@ class pdf_beluga extends ModelePDFProjects else { // We found a page break - $showpricebeforepagebreak=0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + $forcedesconsamepage=1; if ($forcedesconsamepage) { diff --git a/htdocs/core/modules/project/doc/pdf_timespent.modules.php b/htdocs/core/modules/project/doc/pdf_timespent.modules.php index 27822545fa2..0c1eba3c9ac 100644 --- a/htdocs/core/modules/project/doc/pdf_timespent.modules.php +++ b/htdocs/core/modules/project/doc/pdf_timespent.modules.php @@ -293,7 +293,13 @@ class pdf_timespent extends ModelePDFProjects else { // We found a page break - $showpricebeforepagebreak=0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + $forcedesconsamepage=1; if ($forcedesconsamepage) { diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 9219de5863c..67496a7597c 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -502,7 +502,13 @@ class pdf_azur extends ModelePDFPropales $pdf->setPage($pageposbefore + 1); $curY = $tab_top_newpage; - $showpricebeforepagebreak = 0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } if (isset($imglinesize['width']) && isset($imglinesize['height'])) @@ -543,7 +549,13 @@ class pdf_azur extends ModelePDFPropales else { // We found a page break - $showpricebeforepagebreak = 0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } } else // No pagebreak diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 1e67ac6485c..308a67bedcc 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -582,7 +582,13 @@ class pdf_cyan extends ModelePDFPropales $pdf->setPage($pageposbefore+1); $curY = $tab_top_newpage; - $showpricebeforepagebreak=0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } @@ -624,7 +630,13 @@ class pdf_cyan extends ModelePDFPropales else { // We found a page break - $showpricebeforepagebreak=0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } } else // No pagebreak diff --git a/htdocs/core/modules/reception/doc/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php index 125c56960ca..93204a44a4b 100644 --- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php +++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php @@ -374,7 +374,13 @@ class pdf_squille extends ModelePdfReception $pdf->setPage($pageposbefore + 1); $curY = $tab_top_newpage; - $showpricebeforepagebreak = 0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } if (isset($imglinesize['width']) && isset($imglinesize['height'])) @@ -417,7 +423,13 @@ class pdf_squille extends ModelePdfReception else { // We found a page break - $showpricebeforepagebreak = 0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } } else // No pagebreak diff --git a/htdocs/core/modules/stock/doc/pdf_standard.modules.php b/htdocs/core/modules/stock/doc/pdf_standard.modules.php index 97c0744c121..292e551a1eb 100644 --- a/htdocs/core/modules/stock/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_standard.modules.php @@ -383,7 +383,13 @@ class pdf_standard extends ModelePDFStock else { // We found a page break - $showpricebeforepagebreak=0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } } else // No pagebreak diff --git a/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php b/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php index 4f59c2510b4..19986161413 100644 --- a/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php @@ -543,7 +543,13 @@ class pdf_stdmovement extends ModelePDFMovement else { // We found a page break - $showpricebeforepagebreak=0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } } else // No pagebreak diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index 32926e098e3..e1d6133ab39 100644 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -430,7 +430,13 @@ class pdf_canelle extends ModelePDFSuppliersInvoices else { // We found a page break - $showpricebeforepagebreak=0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } } else // No pagebreak diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_cornas.modules.php index 8ff4c3ad429..25962f3b45d 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_cornas.modules.php @@ -523,7 +523,13 @@ class pdf_cornas extends ModelePDFSuppliersOrders $pdf->setPage($pageposbefore+1); $curY = $tab_top_newpage; - $showpricebeforepagebreak=0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } if (!empty($imglinesize['width']) && !empty($imglinesize['height'])) @@ -564,7 +570,13 @@ class pdf_cornas extends ModelePDFSuppliersOrders else { // We found a page break - $showpricebeforepagebreak=0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } } else // No pagebreak diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index a30232f0b41..60658bc8e59 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -445,7 +445,13 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->setPage($pageposbefore+1); $curY = $tab_top_newpage; - $showpricebeforepagebreak=0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } if (!empty($imglinesize['width']) && !empty($imglinesize['height'])) @@ -492,7 +498,13 @@ class pdf_muscadet extends ModelePDFSuppliersOrders else { // We found a page break - $showpricebeforepagebreak=0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } } else // No pagebreak diff --git a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php index e8b97224aad..0d3f3569c56 100644 --- a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php @@ -365,7 +365,13 @@ class pdf_standard extends ModelePDFSuppliersPayments else { // We found a page break - $showpricebeforepagebreak=0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } } else // No pagebreak diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index ff8ab76c674..0bd15e86403 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -430,7 +430,13 @@ class pdf_aurore extends ModelePDFSupplierProposal $pdf->setPage($pageposbefore+1); $curY = $tab_top_newpage; - $showpricebeforepagebreak=0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } if (!empty($imglinesize['width']) && !empty($imglinesize['height'])) @@ -480,7 +486,13 @@ class pdf_aurore extends ModelePDFSupplierProposal else { // We found a page break - $showpricebeforepagebreak=0; + + // Allows data in the first page if description is long enough to break in multiples pages + if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + $showpricebeforepagebreak = 1; + else + $showpricebeforepagebreak = 0; + } } else // No pagebreak From 5dcd5e5b87bd06136976447539fe9573fedcfd58 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 28 Jan 2020 08:29:00 +0000 Subject: [PATCH 027/306] Fixing style errors. --- htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php | 2 -- htdocs/core/modules/contract/doc/pdf_strato.modules.php | 1 - htdocs/core/modules/expedition/doc/pdf_espadon.modules.php | 2 -- htdocs/core/modules/expedition/doc/pdf_rouget.modules.php | 2 -- htdocs/core/modules/expensereport/doc/pdf_standard.modules.php | 1 - htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 2 -- htdocs/core/modules/facture/doc/pdf_sponge.modules.php | 2 -- htdocs/core/modules/livraison/doc/pdf_typhon.modules.php | 1 - htdocs/core/modules/propale/doc/pdf_azur.modules.php | 2 -- htdocs/core/modules/propale/doc/pdf_cyan.modules.php | 2 -- htdocs/core/modules/reception/doc/pdf_squille.modules.php | 2 -- htdocs/core/modules/stock/doc/pdf_standard.modules.php | 1 - htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php | 1 - .../core/modules/supplier_invoice/pdf/pdf_canelle.modules.php | 1 - htdocs/core/modules/supplier_order/pdf/pdf_cornas.modules.php | 2 -- htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php | 2 -- .../core/modules/supplier_payment/doc/pdf_standard.modules.php | 1 - .../core/modules/supplier_proposal/doc/pdf_aurore.modules.php | 2 -- 18 files changed, 29 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index b1dbca4dc56..250f8095b05 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -578,7 +578,6 @@ class pdf_eratosthene extends ModelePDFCommandes $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } if (!empty($this->cols['photo']) && isset($imglinesize['width']) && isset($imglinesize['height'])) @@ -622,7 +621,6 @@ class pdf_eratosthene extends ModelePDFCommandes $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } } else // No pagebreak diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index c0cc4845aa5..0058ad524f4 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -397,7 +397,6 @@ class pdf_strato extends ModelePDFContract $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } } else // No pagebreak diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index 3b917275040..5706ce5d7fa 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -439,7 +439,6 @@ class pdf_espadon extends ModelePdfExpedition $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } @@ -487,7 +486,6 @@ class pdf_espadon extends ModelePdfExpedition $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } } else // No pagebreak diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 705b3db4064..a19d98748ee 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -458,7 +458,6 @@ class pdf_rouget extends ModelePdfExpedition $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } if (isset($imglinesize['width']) && isset($imglinesize['height'])) @@ -506,7 +505,6 @@ class pdf_rouget extends ModelePdfExpedition $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } } else // No pagebreak diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index 2892b6196f3..c1654aa0aec 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -391,7 +391,6 @@ class pdf_standard extends ModeleExpenseReport $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } } else // No pagebreak diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 48c1710f74f..6b6c6bb2beb 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -500,7 +500,6 @@ class pdf_crabe extends ModelePDFFactures $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } if (isset($imglinesize['width']) && isset($imglinesize['height'])) @@ -546,7 +545,6 @@ class pdf_crabe extends ModelePDFFactures $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } } else // No pagebreak diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index d838dd970a4..0df384cdeb6 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -606,7 +606,6 @@ class pdf_sponge extends ModelePDFFactures $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } if (!empty($this->cols['photo']) && isset($imglinesize['width']) && isset($imglinesize['height'])) @@ -651,7 +650,6 @@ class pdf_sponge extends ModelePDFFactures $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } } else // No pagebreak diff --git a/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php b/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php index 4d659ca193a..88a51c7c94f 100644 --- a/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php +++ b/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php @@ -415,7 +415,6 @@ class pdf_typhon extends ModelePDFDeliveryOrder $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } } else // No pagebreak diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 67496a7597c..222858750a7 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -508,7 +508,6 @@ class pdf_azur extends ModelePDFPropales $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } if (isset($imglinesize['width']) && isset($imglinesize['height'])) @@ -555,7 +554,6 @@ class pdf_azur extends ModelePDFPropales $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } } else // No pagebreak diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 308a67bedcc..db9b5a3818d 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -588,7 +588,6 @@ class pdf_cyan extends ModelePDFPropales $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } @@ -636,7 +635,6 @@ class pdf_cyan extends ModelePDFPropales $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } } else // No pagebreak diff --git a/htdocs/core/modules/reception/doc/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php index 93204a44a4b..f1c2eba89e4 100644 --- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php +++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php @@ -380,7 +380,6 @@ class pdf_squille extends ModelePdfReception $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } if (isset($imglinesize['width']) && isset($imglinesize['height'])) @@ -429,7 +428,6 @@ class pdf_squille extends ModelePdfReception $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } } else // No pagebreak diff --git a/htdocs/core/modules/stock/doc/pdf_standard.modules.php b/htdocs/core/modules/stock/doc/pdf_standard.modules.php index 292e551a1eb..b2898c2fbac 100644 --- a/htdocs/core/modules/stock/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_standard.modules.php @@ -389,7 +389,6 @@ class pdf_standard extends ModelePDFStock $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } } else // No pagebreak diff --git a/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php b/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php index 19986161413..362f17c7e9c 100644 --- a/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php @@ -549,7 +549,6 @@ class pdf_stdmovement extends ModelePDFMovement $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } } else // No pagebreak diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index e1d6133ab39..26329ac889f 100644 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -436,7 +436,6 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } } else // No pagebreak diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_cornas.modules.php index 25962f3b45d..6d3fe584eb3 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_cornas.modules.php @@ -529,7 +529,6 @@ class pdf_cornas extends ModelePDFSuppliersOrders $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } if (!empty($imglinesize['width']) && !empty($imglinesize['height'])) @@ -576,7 +575,6 @@ class pdf_cornas extends ModelePDFSuppliersOrders $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } } else // No pagebreak diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index 60658bc8e59..5bad5b6be24 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -451,7 +451,6 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } if (!empty($imglinesize['width']) && !empty($imglinesize['height'])) @@ -504,7 +503,6 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } } else // No pagebreak diff --git a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php index 0d3f3569c56..836d7c04072 100644 --- a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php @@ -371,7 +371,6 @@ class pdf_standard extends ModelePDFSuppliersPayments $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } } else // No pagebreak diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index 0bd15e86403..6b57a81af5a 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -436,7 +436,6 @@ class pdf_aurore extends ModelePDFSupplierProposal $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } if (!empty($imglinesize['width']) && !empty($imglinesize['height'])) @@ -492,7 +491,6 @@ class pdf_aurore extends ModelePDFSupplierProposal $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; - } } else // No pagebreak From 9f7b51938ff4361c98c457d5f77d7bb55749625e Mon Sep 17 00:00:00 2001 From: AdrianDominik Date: Tue, 28 Jan 2020 10:52:33 +0100 Subject: [PATCH 028/306] FIX: #12908 User login with credentials from self-subscription form fails --- htdocs/adherents/class/adherent.class.php | 34 +-- htdocs/user/class/user.class.php | 343 +++++++++++----------- 2 files changed, 189 insertions(+), 188 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 4dbdb519831..0aa7bcbf6ea 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -641,7 +641,7 @@ class Adherent extends CommonObject $isencrypted = empty($conf->global->DATABASE_PWD_ENCRYPTED)?0:1; // If password to set differs from the one found into database - $result=$this->setPassword($user, $this->pass, $this->pass_indatabase_crypted, $isencrypted, $notrigger, $nosyncuserpass); + $result=$this->setPassword($user, $this->pass, $isencrypted, $notrigger, $nosyncuserpass); if (! $nbrowsaffected) $nbrowsaffected++; } } @@ -964,9 +964,10 @@ class Adherent extends CommonObject * @param int $isencrypted 0 ou 1 si il faut crypter le mot de passe en base (0 par defaut) * @param int $notrigger 1=Ne declenche pas les triggers * @param int $nosyncuser Do not synchronize linked user + * @param int $alreadyencrypted 1 = password is already encrypted (0 by default) * @return string If OK return clear password, 0 if no change, < 0 if error */ - public function setPassword($user, $password = '', $password_indatabase_crypted = '', $isencrypted = 0, $notrigger = 0, $nosyncuser = 0) + public function setPassword($user, $password = '', $isencrypted = 0, $notrigger = 0, $nosyncuser = 0, $alreadyencrypted = 0) { global $conf, $langs; @@ -974,23 +975,22 @@ class Adherent extends CommonObject dol_syslog(get_class($this)."::setPassword user=".$user->id." password=".preg_replace('/./i', '*', $password)." isencrypted=".$isencrypted); - // If password_crypted not provided, try crypt password provided - if(!$password_indatabase_crypted) + // If new password not provided, we generate one + if (! $password) { - // If new password not provided, we generate one - if (!$password) - { - require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; - $password=getRandomPassword(false); - } - - // Crypt password - $password_crypted = dol_hash($password); - - } else { - $password_crypted = $password_indatabase_crypted; + require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; + $password=getRandomPassword(false); } + // Crypt password + if ($alreadyencrypted != 1) $password_crypted = dol_hash($password); + else $password_crypted = $password; + + $password_indatabase = ''; + if (! $isencrypted) + { + $password_indatabase = $password; + } $this->db->begin(); @@ -1032,7 +1032,7 @@ class Adherent extends CommonObject if ($result >= 0) { - $result=$luser->setPassword($user, $this->pass, $this->pass_indatabase_crypted, 0, 0, 1); + $result=$luser->setPassword($user, $this->pass, 0, 0, 1, 1); if ($result < 0) { $this->error=$luser->error; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 8809873acc6..98bc2a7c7b0 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -75,34 +75,34 @@ class User extends CommonObject public $personal_email; - /** - * @var array array of socialnetworks - */ - public $socialnetworks; + /** + * @var array array of socialnetworks + */ + public $socialnetworks; - /** - * Skype username - * @var string - * @deprecated - */ + /** + * Skype username + * @var string + * @deprecated + */ public $skype; - /** - * Twitter username - * @var string - * @deprecated - */ + /** + * Twitter username + * @var string + * @deprecated + */ public $twitter; - /** - * Facebook username - * @var string - * @deprecated - */ + /** + * Facebook username + * @var string + * @deprecated + */ public $facebook; - /** - * Linkedin username - * @var string - * @deprecated - */ + /** + * Linkedin username + * @var string + * @deprecated + */ public $linkedin; public $job; // job position @@ -121,7 +121,7 @@ class User extends CommonObject public $office_phone; public $office_fax; public $user_mobile; - public $personal_mobile; + public $personal_mobile; public $admin; public $login; public $api_key; @@ -139,18 +139,18 @@ class User extends CommonObject public $pass_indatabase_crypted; /** - * Date creation record (datec) - * - * @var integer - */ - public $datec; + * Date creation record (datec) + * + * @var integer + */ + public $datec; /** - * Date modification record (tms) - * - * @var integer - */ - public $datem; + * Date modification record (tms) + * + * @var integer + */ + public $datem; //! If this is defined, it is an external user /** @@ -167,8 +167,8 @@ class User extends CommonObject public $contactid; /** - * @var int ID - */ + * @var int ID + */ public $fk_member; /** @@ -176,7 +176,7 @@ class User extends CommonObject */ public $fk_user; public $fk_user_expense_validator; - public $fk_user_holiday_validator; + public $fk_user_holiday_validator; public $clicktodial_url; public $clicktodial_login; @@ -222,10 +222,10 @@ class User extends CommonObject public $fk_warehouse; public $fields = array( - 'rowid'=>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'index'=>1, 'position'=>1, 'comment'=>'Id'), - 'lastname'=>array('type'=>'varchar(50)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>20, 'searchall'=>1, 'comment'=>'Reference of object'), - 'firstname'=>array('type'=>'varchar(50)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'), - ); + 'rowid'=>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'index'=>1, 'position'=>1, 'comment'=>'Id'), + 'lastname'=>array('type'=>'varchar(50)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>20, 'searchall'=>1, 'comment'=>'Reference of object'), + 'firstname'=>array('type'=>'varchar(50)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'), + ); const STATUS_DISABLED = 0; @@ -391,7 +391,7 @@ class User extends CommonObject $this->office_phone = $obj->office_phone; $this->office_fax = $obj->office_fax; $this->user_mobile = $obj->user_mobile; - $this->personal_mobile = $obj->personal_mobile; + $this->personal_mobile = $obj->personal_mobile; $this->email = $obj->email; $this->personal_email = $obj->personal_email; $this->socialnetworks = (array) json_decode($obj->socialnetworks, true); @@ -427,8 +427,8 @@ class User extends CommonObject $this->contactid = $obj->fk_socpeople; $this->fk_member = $obj->fk_member; $this->fk_user = $obj->fk_user; - $this->fk_user_expense_validator = $obj->fk_user_expense_validator; - $this->fk_user_holiday_validator = $obj->fk_user_holiday_validator; + $this->fk_user_expense_validator = $obj->fk_user_expense_validator; + $this->fk_user_holiday_validator = $obj->fk_user_holiday_validator; $this->default_range = $obj->default_range; $this->default_c_exp_tax_cat = $obj->default_c_exp_tax_cat; @@ -1032,7 +1032,7 @@ class User extends CommonObject * Existing categories are left untouch. * * @param int[]|int $categories Category or categories IDs - * @return void + * @return void */ public function setCategories($categories) { @@ -1122,24 +1122,24 @@ class User extends CommonObject // Remove extrafields if ((!$error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used { - $result = $this->deleteExtraFields(); - if ($result < 0) - { - $error++; - dol_syslog(get_class($this)."::delete error -4 ".$this->error, LOG_ERR); - } + $result = $this->deleteExtraFields(); + if ($result < 0) + { + $error++; + dol_syslog(get_class($this)."::delete error -4 ".$this->error, LOG_ERR); + } } // Remove user if (!$error) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."user WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::delete", LOG_DEBUG); - if (!$this->db->query($sql)) - { - $error++; - $this->error = $this->db->lasterror(); - } + dol_syslog(get_class($this)."::delete", LOG_DEBUG); + if (!$this->db->query($sql)) + { + $error++; + $this->error = $this->db->lasterror(); + } } if (!$error) @@ -1180,7 +1180,7 @@ class User extends CommonObject if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->lastname = ucwords($this->lastname); if (!empty($conf->global->MAIN_ALL_TO_UPPER)) $this->lastname = strtoupper($this->lastname); - if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->firstname = ucwords($this->firstname); + if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->firstname = ucwords($this->firstname); $this->login = trim($this->login); if (!isset($this->entity)) $this->entity = $conf->entity; // If not defined, we use default value @@ -1302,7 +1302,7 @@ class User extends CommonObject } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Create a user from a contact object. User will be internal but if contact is linked to a third party, user will be external * @@ -1313,7 +1313,7 @@ class User extends CommonObject */ public function create_from_contact($contact, $login = '', $password = '') { - // phpcs:enable + // phpcs:enable global $conf, $user, $langs; $error = 0; @@ -1381,7 +1381,7 @@ class User extends CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Create a user into database from a member object * @@ -1391,7 +1391,7 @@ class User extends CommonObject */ public function create_from_member($member, $login = '') { - // phpcs:enable + // phpcs:enable global $conf, $user, $langs; // Positionne parametres @@ -1418,7 +1418,9 @@ class User extends CommonObject $result = $this->create($user); if ($result > 0) { - $newpass = $this->setPassword($user, $this->pass, $this->pass_indatabase_crypted); + if(!$this->pass && $this->pass_indatabase_crypted) $newpass = $this->setPassword($user, $this->pass_indatabase_crypted, 0, 0, 0, 1); + else $newpass = $this->setPassword($user, $this->pass); + if (is_numeric($newpass) && $newpass < 0) $result = -2; if ($result > 0 && $member->fk_soc) // If member is linked to a thirdparty @@ -1457,7 +1459,7 @@ class User extends CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Assign rights by default * @@ -1465,7 +1467,7 @@ class User extends CommonObject */ public function set_default_rights() { - // phpcs:enable + // phpcs:enable global $conf; $sql = "SELECT id FROM ".MAIN_DB_PREFIX."rights_def"; @@ -1524,7 +1526,7 @@ class User extends CommonObject if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->lastname = ucwords($this->lastname); if (!empty($conf->global->MAIN_ALL_TO_UPPER)) $this->lastname = strtoupper($this->lastname); - if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->firstname = ucwords($this->firstname); + if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->firstname = ucwords($this->firstname); $this->lastname = trim($this->lastname); $this->firstname = trim($this->firstname); @@ -1542,9 +1544,9 @@ class User extends CommonObject $this->office_phone = trim($this->office_phone); $this->office_fax = trim($this->office_fax); $this->user_mobile = trim($this->user_mobile); - $this->personal_mobile = trim($this->personal_mobile); + $this->personal_mobile = trim($this->personal_mobile); $this->email = trim($this->email); - $this->personal_email = trim($this->personal_email); + $this->personal_email = trim($this->personal_email); $this->job = trim($this->job); $this->signature = trim($this->signature); @@ -1595,10 +1597,10 @@ class User extends CommonObject $sql .= ", office_phone = '".$this->db->escape($this->office_phone)."'"; $sql .= ", office_fax = '".$this->db->escape($this->office_fax)."'"; $sql .= ", user_mobile = '".$this->db->escape($this->user_mobile)."'"; - $sql .= ", personal_mobile = '".$this->db->escape($this->personal_mobile)."'"; + $sql .= ", personal_mobile = '".$this->db->escape($this->personal_mobile)."'"; $sql .= ", email = '".$this->db->escape($this->email)."'"; - $sql .= ", personal_email = '".$this->db->escape($this->personal_email)."'"; - $sql .= ", socialnetworks = '".$this->db->escape(json_encode($this->socialnetworks))."'"; + $sql .= ", personal_email = '".$this->db->escape($this->personal_email)."'"; + $sql .= ", socialnetworks = '".$this->db->escape(json_encode($this->socialnetworks))."'"; $sql .= ", job = '".$this->db->escape($this->job)."'"; $sql .= ", signature = '".$this->db->escape($this->signature)."'"; $sql .= ", accountancy_code = '".$this->db->escape($this->accountancy_code)."'"; @@ -1610,8 +1612,8 @@ class User extends CommonObject $sql .= ", photo = ".($this->photo ? "'".$this->db->escape($this->photo)."'" : "null"); $sql .= ", openid = ".($this->openid ? "'".$this->db->escape($this->openid)."'" : "null"); $sql .= ", fk_user = ".($this->fk_user > 0 ? "'".$this->db->escape($this->fk_user)."'" : "null"); - $sql .= ", fk_user_expense_validator = ".($this->fk_user_expense_validator > 0 ? "'".$this->db->escape($this->fk_user_expense_validator)."'" : "null"); - $sql .= ", fk_user_holiday_validator = ".($this->fk_user_holiday_validator > 0 ? "'".$this->db->escape($this->fk_user_holiday_validator)."'" : "null"); + $sql .= ", fk_user_expense_validator = ".($this->fk_user_expense_validator > 0 ? "'".$this->db->escape($this->fk_user_expense_validator)."'" : "null"); + $sql .= ", fk_user_holiday_validator = ".($this->fk_user_holiday_validator > 0 ? "'".$this->db->escape($this->fk_user_holiday_validator)."'" : "null"); if (isset($this->thm) || $this->thm != '') $sql .= ", thm= ".($this->thm != '' ? "'".$this->db->escape($this->thm)."'" : "null"); if (isset($this->tjm) || $this->tjm != '') $sql .= ", tjm= ".($this->tjm != '' ? "'".$this->db->escape($this->tjm)."'" : "null"); if (isset($this->salary) || $this->salary != '') $sql .= ", salary= ".($this->salary != '' ? "'".$this->db->escape($this->salary)."'" : "null"); @@ -1811,7 +1813,7 @@ class User extends CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Mise a jour en base de la date de derniere connexion d'un utilisateur * Fonction appelee lors d'une nouvelle connexion @@ -1820,7 +1822,7 @@ class User extends CommonObject */ public function update_last_login_date() { - // phpcs:enable + // phpcs:enable $now = dol_now(); $sql = "UPDATE ".MAIN_DB_PREFIX."user SET"; @@ -1853,9 +1855,10 @@ class User extends CommonObject * @param int $changelater 1=Change password only after clicking on confirm email * @param int $notrigger 1=Does not launch triggers * @param int $nosyncmember Do not synchronize linked member + * @param int $alreadyencrypted 1 = password is already encrypted (0 by default) * @return string If OK return clear password, 0 if no change, < 0 if error */ - public function setPassword($user, $password = '', $password_indatabase_crypted = '', $changelater = 0, $notrigger = 0, $nosyncmember = 0) + public function setPassword($user, $password = '', $changelater = 0, $notrigger = 0, $nosyncmember = 0, $alreadyencrypted = 0) { global $conf, $langs; require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; @@ -1864,21 +1867,15 @@ class User extends CommonObject dol_syslog(get_class($this)."::setPassword user=".$user->id." password=".preg_replace('/./i', '*', $password)." changelater=".$changelater." notrigger=".$notrigger." nosyncmember=".$nosyncmember, LOG_DEBUG); - // If password_crypted not provided, try crypt password provided - if(!$password_indatabase_crypted) + // If new password not provided, we generate one + if (!$password) { - // If new password not provided, we generate one - if (!$password) - { - $password = getRandomPassword(false); - } - - // Crypt password - $password_crypted = dol_hash($password); - } else { - $password_crypted = $password_indatabase_crypted; + $password = getRandomPassword(false); } + // Crypt password + if ($alreadyencrypted != 1) $password_crypted = dol_hash($password); + else $password_crypted = $password; // Mise a jour @@ -1922,7 +1919,11 @@ class User extends CommonObject if ($result >= 0) { - $result = $adh->setPassword($user, $this->pass, $this->pass_indatabase_crypted, (empty($conf->global->DATABASE_PWD_ENCRYPTED) ? 0 : 1), 1); // Cryptage non gere dans module adherent + + if ($alreadyencrypted != 1) $result = $adh->setPassword($user, $this->pass, (empty($conf->global->DATABASE_PWD_ENCRYPTED) ? 0 : 1), 1); // Cryptage non gere dans module adherent + else $result = $adh->setPassword($user, $this->pass, (empty($conf->global->DATABASE_PWD_ENCRYPTED) ? 0 : 1), 1, 0, 1); // Dont encrypt the password cause is already encrypted + + if ($result < 0) { $this->error = $adh->error; @@ -1986,7 +1987,7 @@ class User extends CommonObject } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Send new password by email * @@ -1997,7 +1998,7 @@ class User extends CommonObject */ public function send_password($user, $password = '', $changelater = 0) { - // phpcs:enable + // phpcs:enable global $conf, $langs; global $dolibarr_main_url_root; @@ -2011,19 +2012,19 @@ class User extends CommonObject $outputlangs = new Translate("", $conf); if (isset($this->conf->MAIN_LANG_DEFAULT) - && $this->conf->MAIN_LANG_DEFAULT != 'auto') + && $this->conf->MAIN_LANG_DEFAULT != 'auto') { // If user has defined its own language (rare because in most cases, auto is used) $outputlangs->getDefaultLang($this->conf->MAIN_LANG_DEFAULT); } if ($user->conf->MAIN_LANG_DEFAULT) { - $outputlangs->setDefaultLang($user->conf->MAIN_LANG_DEFAULT); - } + $outputlangs->setDefaultLang($user->conf->MAIN_LANG_DEFAULT); + } else { // If user has not defined its own language, we used current language $outputlangs = $langs; } - // Load translation files required by the page + // Load translation files required by the page $outputlangs->loadLangs(array("main", "errors", "users", "other")); $appli = constant('DOL_APPLICATION_TITLE'); @@ -2066,8 +2067,8 @@ class User extends CommonObject dol_syslog(get_class($this)."::send_password changelater is on, url=".$url); } - $mailfile = new CMailFile( - $subject, + $mailfile = new CMailFile( + $subject, $this->email, $conf->global->MAIN_MAIL_EMAIL_FROM, $mesg, @@ -2077,8 +2078,8 @@ class User extends CommonObject '', '', 0, - $msgishtml - ); + $msgishtml + ); if ($mailfile->sendfile()) { @@ -2103,7 +2104,7 @@ class User extends CommonObject } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Read clicktodial information for user * @@ -2111,7 +2112,7 @@ class User extends CommonObject */ public function fetch_clicktodial() { - // phpcs:enable + // phpcs:enable $sql = "SELECT url, login, pass, poste "; $sql .= " FROM ".MAIN_DB_PREFIX."user_clicktodial as u"; $sql .= " WHERE u.fk_user = ".$this->id; @@ -2141,15 +2142,15 @@ class User extends CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Update clicktodial info * * @return int <0 if KO, >0 if OK - */ - public function update_clicktodial() - { - // phpcs:enable + */ + public function update_clicktodial() + { + // phpcs:enable $this->db->begin(); $sql = "DELETE FROM ".MAIN_DB_PREFIX."user_clicktodial"; @@ -2179,10 +2180,10 @@ class User extends CommonObject $this->error = $this->db->lasterror(); return -1; } - } + } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Add user into a group * @@ -2193,7 +2194,7 @@ class User extends CommonObject */ public function SetInGroup($group, $entity, $notrigger = 0) { - // phpcs:enable + // phpcs:enable global $conf, $langs, $user; $error = 0; @@ -2244,7 +2245,7 @@ class User extends CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Remove a user from a group * @@ -2255,7 +2256,7 @@ class User extends CommonObject */ public function RemoveFromGroup($group, $entity, $notrigger = 0) { - // phpcs:enable + // phpcs:enable global $conf, $langs, $user; $error = 0; @@ -2342,7 +2343,7 @@ class User extends CommonObject global $dolibarr_main_authentication, $dolibarr_main_demo; global $menumanager; - if (!$user->rights->user->user->lire && $user->id != $this->id) $option = 'nolink'; + if (!$user->rights->user->user->lire && $user->id != $this->id) $option = 'nolink'; if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && $withpictoimg) $withpictoimg = 0; @@ -2436,8 +2437,8 @@ class User extends CommonObject $result .= (($option == 'nolink') ? '' : $linkstart); if ($withpictoimg) { - $paddafterimage = ''; - if (abs($withpictoimg) == 1) $paddafterimage = 'style="margin-'.($langs->trans("DIRECTION") == 'rtl' ? 'left' : 'right').': 3px;"'; + $paddafterimage = ''; + if (abs($withpictoimg) == 1) $paddafterimage = 'style="margin-'.($langs->trans("DIRECTION") == 'rtl' ? 'left' : 'right').': 3px;"'; // Only picto if ($withpictoimg > 0) $picto = ''.img_object('', 'user', $paddafterimage.' '.($notooltip ? '' : 'class="classfortooltip"'), 0, 0, $notooltip ? 0 : 1).''; // Picto must be a photo @@ -2491,7 +2492,7 @@ class User extends CommonObject $linkend = ''; } - if ($option == 'nolink') + if ($option == 'nolink') { $linkstart = ''; $linkend = ''; @@ -2515,17 +2516,17 @@ class User extends CommonObject return $this->LibStatut($this->statut, $mode); } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - /** - * Return label of a status of user (active, inactive) - * - * @param int $status Id status + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return label of a status of user (active, inactive) + * + * @param int $status Id status * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto - * @return string Label of status - */ - public function LibStatut($status, $mode = 0) - { - // phpcs:enable + * @return string Label of status + */ + public function LibStatut($status, $mode = 0) + { + // phpcs:enable global $langs; if (empty($this->labelStatus) || empty($this->labelStatusShort)) @@ -2558,7 +2559,7 @@ class User extends CommonObject */ public function _load_ldap_dn($info, $mode = 0) { - // phpcs:enable + // phpcs:enable global $conf; $dn = ''; if ($mode == 0) $dn = $conf->global->LDAP_KEY_USERS."=".$info[$conf->global->LDAP_KEY_USERS].",".$conf->global->LDAP_USER_DN; @@ -2576,7 +2577,7 @@ class User extends CommonObject */ public function _load_ldap_info() { - // phpcs:enable + // phpcs:enable global $conf, $langs; $info = array(); @@ -2602,7 +2603,7 @@ class User extends CommonObject 'LDAP_FIELD_SKYPE' => 'skype', 'LDAP_FIELD_TWITTER' => 'twitter', 'LDAP_FIELD_FACEBOOK' => 'facebook', - 'LDAP_FIELD_LINKEDIN' => 'linkedin' + 'LDAP_FIELD_LINKEDIN' => 'linkedin' ); // Champs @@ -2686,22 +2687,22 @@ class User extends CommonObject if ($this->phone_mobile) $info["phpgwCellTelephoneNumber"] = $this->phone_mobile; } - if (!empty($conf->global->LDAP_FIELD_USERID))$info[$conf->global->LDAP_FIELD_USERID] = $this->id; - if (!empty($info[$conf->global->LDAP_FIELD_GROUPID])) { - $usergroup = new UserGroup($this->db); - $groupslist = $usergroup->listGroupsForUser($this->id); - $info[$conf->global->LDAP_FIELD_GROUPID] = '1'; - if (!empty($groupslist)) { - foreach ($groupslist as $groupforuser) { - $info[$conf->global->LDAP_FIELD_GROUPID] = $groupforuser->id; //Select first group in list - break; - } - } - } - if (!empty($this->firstname) && !empty($conf->global->LDAP_FIELD_HOMEDIRECTORY) && !empty($conf->global->LDAP_FIELD_HOMEDIRECTORYPREFIX)) $info[$conf->global->LDAP_FIELD_HOMEDIRECTORY] = "{$conf->global->LDAP_FIELD_HOMEDIRECTORYPREFIX}/$this->firstname"; + if (!empty($conf->global->LDAP_FIELD_USERID))$info[$conf->global->LDAP_FIELD_USERID] = $this->id; + if (!empty($info[$conf->global->LDAP_FIELD_GROUPID])) { + $usergroup = new UserGroup($this->db); + $groupslist = $usergroup->listGroupsForUser($this->id); + $info[$conf->global->LDAP_FIELD_GROUPID] = '1'; + if (!empty($groupslist)) { + foreach ($groupslist as $groupforuser) { + $info[$conf->global->LDAP_FIELD_GROUPID] = $groupforuser->id; //Select first group in list + break; + } + } + } + if (!empty($this->firstname) && !empty($conf->global->LDAP_FIELD_HOMEDIRECTORY) && !empty($conf->global->LDAP_FIELD_HOMEDIRECTORYPREFIX)) $info[$conf->global->LDAP_FIELD_HOMEDIRECTORY] = "{$conf->global->LDAP_FIELD_HOMEDIRECTORYPREFIX}/$this->firstname"; - return $info; - } + return $info; + } /** @@ -2728,7 +2729,7 @@ class User extends CommonObject $this->note_public = 'This is a note public'; $this->note_private = 'This is a note private'; $this->email = 'email@specimen.com'; - $this->personal_email = 'personalemail@specimen.com'; + $this->personal_email = 'personalemail@specimen.com'; $this->socialnetworks = array( 'skype' => 'skypepseudo', 'twitter' => 'twitterpseudo', @@ -2738,7 +2739,7 @@ class User extends CommonObject $this->office_phone = '0999999999'; $this->office_fax = '0999999998'; $this->user_mobile = '0999999997'; - $this->personal_mobile = '0999999996'; + $this->personal_mobile = '0999999996'; $this->admin = 0; $this->login = 'dolibspec'; $this->pass = 'dolibspec'; @@ -2863,7 +2864,7 @@ class User extends CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Update user using data from the LDAP * @@ -2872,7 +2873,7 @@ class User extends CommonObject */ public function update_ldap2dolibarr(&$ldapuser) { - // phpcs:enable + // phpcs:enable // TODO: Voir pourquoi le update met à jour avec toutes les valeurs vide (global $user écrase ?) global $user, $conf; @@ -2903,7 +2904,7 @@ class User extends CommonObject } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Return and array with all instanciated first level children users of current user * @@ -2912,7 +2913,7 @@ class User extends CommonObject */ public function get_children() { - // phpcs:enable + // phpcs:enable $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."user"; $sql .= " WHERE fk_user = ".$this->id; @@ -2971,7 +2972,7 @@ class User extends CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Build the hierarchy/tree of users into an array. * Set and return this->users that is an array sorted according to tree with arrays of: @@ -2985,9 +2986,9 @@ class User extends CommonObject * @param string $filter SQL filter on users * @return array Array of users $this->users. Note: $this->parentof is also set. */ - public function get_full_tree($deleteafterid = 0, $filter = '') - { - // phpcs:enable + public function get_full_tree($deleteafterid = 0, $filter = '') + { + // phpcs:enable global $conf, $user; global $hookmanager; @@ -3087,8 +3088,8 @@ class User extends CommonObject * @return array Array of user id lower than user (all levels under user). This overwrite this->users. * @see get_children() */ - public function getAllChildIds($addcurrentuser = 0) - { + public function getAllChildIds($addcurrentuser = 0) + { $childids = array(); if (isset($this->cache_childids[$this->id])) @@ -3116,7 +3117,7 @@ class User extends CommonObject return $childids; } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * For user id_user and its childs available in this->users, define property fullpath and fullname. * Function called by get_full_tree(). @@ -3125,9 +3126,9 @@ class User extends CommonObject * @param int $protection Deep counter to avoid infinite loop (no more required, a protection is added with array useridfound) * @return int < 0 if KO (infinit loop), >= 0 if OK */ - public function build_path_from_id_user($id_user, $protection = 0) - { - // phpcs:enable + public function build_path_from_id_user($id_user, $protection = 0) + { + // phpcs:enable dol_syslog(get_class($this)."::build_path_from_id_user id_user=".$id_user." protection=".$protection, LOG_DEBUG); if (!empty($this->users[$id_user]['fullpath'])) @@ -3180,7 +3181,7 @@ class User extends CommonObject } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Load metrics this->nb for dashboard * @@ -3188,7 +3189,7 @@ class User extends CommonObject */ public function load_state_board() { - // phpcs:enable + // phpcs:enable $this->nb = array(); @@ -3224,7 +3225,7 @@ class User extends CommonObject * @param int $hidedetails Hide details of lines * @param int $hidedesc Hide description * @param int $hideref Hide ref - * @param null|array $moreparams Array to provide more information + * @param null|array $moreparams Array to provide more information * @return int 0 if KO, 1 if OK */ public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null) @@ -3251,7 +3252,7 @@ class User extends CommonObject return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams); } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Return property of user from its id * @@ -3261,7 +3262,7 @@ class User extends CommonObject */ public function user_get_property($rowid, $mode) { - // phpcs:enable + // phpcs:enable $user_property = ''; if (empty($rowid)) return ''; @@ -3303,8 +3304,8 @@ class User extends CommonObject * @return int <0 if KO, >0 if OK */ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = array(), $filtermode = 'AND', $entityfilter = false) - { - global $conf, $user; + { + global $conf, $user; $sql = "SELECT t.rowid"; $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t '; @@ -3379,8 +3380,8 @@ class User extends CommonObject } else { - $this->errors[] = $this->db->lasterror(); - return -1; - } - } + $this->errors[] = $this->db->lasterror(); + return -1; + } + } } From ae95cc68690e44957dc3245fb647918931411142 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 28 Jan 2020 10:00:14 +0000 Subject: [PATCH 029/306] Fixing style errors. --- htdocs/user/class/user.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 98bc2a7c7b0..af23dca5e96 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1919,7 +1919,6 @@ class User extends CommonObject if ($result >= 0) { - if ($alreadyencrypted != 1) $result = $adh->setPassword($user, $this->pass, (empty($conf->global->DATABASE_PWD_ENCRYPTED) ? 0 : 1), 1); // Cryptage non gere dans module adherent else $result = $adh->setPassword($user, $this->pass, (empty($conf->global->DATABASE_PWD_ENCRYPTED) ? 0 : 1), 1, 0, 1); // Dont encrypt the password cause is already encrypted From cc09257fcde9ff177a1b07ee0986606566e2158c Mon Sep 17 00:00:00 2001 From: AdrianDominik Date: Mon, 3 Feb 2020 10:04:58 +0100 Subject: [PATCH 030/306] Withdrawing changes --- htdocs/adherents/class/adherent.class.php | 8 +++----- htdocs/user/class/user.class.php | 17 ++++------------- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 0aa7bcbf6ea..ec4042cdf88 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -964,10 +964,9 @@ class Adherent extends CommonObject * @param int $isencrypted 0 ou 1 si il faut crypter le mot de passe en base (0 par defaut) * @param int $notrigger 1=Ne declenche pas les triggers * @param int $nosyncuser Do not synchronize linked user - * @param int $alreadyencrypted 1 = password is already encrypted (0 by default) * @return string If OK return clear password, 0 if no change, < 0 if error */ - public function setPassword($user, $password = '', $isencrypted = 0, $notrigger = 0, $nosyncuser = 0, $alreadyencrypted = 0) + public function setPassword($user, $password = '', $isencrypted = 0, $notrigger = 0, $nosyncuser = 0) { global $conf, $langs; @@ -983,8 +982,7 @@ class Adherent extends CommonObject } // Crypt password - if ($alreadyencrypted != 1) $password_crypted = dol_hash($password); - else $password_crypted = $password; + $password_crypted = dol_hash($password); $password_indatabase = ''; if (! $isencrypted) @@ -1032,7 +1030,7 @@ class Adherent extends CommonObject if ($result >= 0) { - $result=$luser->setPassword($user, $this->pass, 0, 0, 1, 1); + $result=$luser->setPassword($user, $this->pass, 0, 0, 1); if ($result < 0) { $this->error=$luser->error; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index af23dca5e96..9bfe66d9dec 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1402,7 +1402,6 @@ class User extends CommonObject $this->email = $member->email; $this->fk_member = $member->id; $this->pass = $member->pass; - $this->pass_indatabase_crypted = $member->pass_indatabase_crypted; $this->address = $member->address; $this->zip = $member->zip; $this->town = $member->town; @@ -1418,9 +1417,7 @@ class User extends CommonObject $result = $this->create($user); if ($result > 0) { - if(!$this->pass && $this->pass_indatabase_crypted) $newpass = $this->setPassword($user, $this->pass_indatabase_crypted, 0, 0, 0, 1); - else $newpass = $this->setPassword($user, $this->pass); - + $newpass = $this->setPassword($user, $this->pass); if (is_numeric($newpass) && $newpass < 0) $result = -2; if ($result > 0 && $member->fk_soc) // If member is linked to a thirdparty @@ -1855,10 +1852,9 @@ class User extends CommonObject * @param int $changelater 1=Change password only after clicking on confirm email * @param int $notrigger 1=Does not launch triggers * @param int $nosyncmember Do not synchronize linked member - * @param int $alreadyencrypted 1 = password is already encrypted (0 by default) * @return string If OK return clear password, 0 if no change, < 0 if error */ - public function setPassword($user, $password = '', $changelater = 0, $notrigger = 0, $nosyncmember = 0, $alreadyencrypted = 0) + public function setPassword($user, $password = '', $changelater = 0, $notrigger = 0, $nosyncmember = 0) { global $conf, $langs; require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; @@ -1874,9 +1870,7 @@ class User extends CommonObject } // Crypt password - if ($alreadyencrypted != 1) $password_crypted = dol_hash($password); - else $password_crypted = $password; - + $password_crypted = dol_hash($password); // Mise a jour if (!$changelater) @@ -1919,10 +1913,7 @@ class User extends CommonObject if ($result >= 0) { - if ($alreadyencrypted != 1) $result = $adh->setPassword($user, $this->pass, (empty($conf->global->DATABASE_PWD_ENCRYPTED) ? 0 : 1), 1); // Cryptage non gere dans module adherent - else $result = $adh->setPassword($user, $this->pass, (empty($conf->global->DATABASE_PWD_ENCRYPTED) ? 0 : 1), 1, 0, 1); // Dont encrypt the password cause is already encrypted - - + $result = $adh->setPassword($user, $this->pass, (empty($conf->global->DATABASE_PWD_ENCRYPTED) ? 0 : 1), 1); // Cryptage non gere dans module adherent if ($result < 0) { $this->error = $adh->error; From 2f951c044191d06b42b2b7e41c76251f8d0c675a Mon Sep 17 00:00:00 2001 From: Tobias Sekan Date: Mon, 3 Feb 2020 11:01:58 +0100 Subject: [PATCH 031/306] New - Show list of users in user category card --- htdocs/categories/viewcat.php | 54 +++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 7f4156a6d15..68a946daee4 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -144,6 +144,13 @@ if ($id > 0 && $removeelem > 0) $result = $tmpobject->fetch($removeelem); $elementtype = 'project'; } + elseif ($type == Categorie::TYPE_USER && $user->rights->user->user->creer) + { + require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; + $tmpobject = new User($db); + $result = $tmpobject->fetch($removeelem); + $elementtype = 'user'; + } $result = $object->del_type($tmpobject, $elementtype); if ($result < 0) dol_print_error('', $object->error); @@ -834,6 +841,53 @@ if ($type == Categorie::TYPE_PROJECT) } } +// List of users +if ($type == Categorie::TYPE_USER) +{ + require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; + + $users = $object->getObjectsInCateg("user"); + if ($users < 0) + { + dol_print_error($db, $object->error, $object->errors); + } + else + { + print "
"; + print "\n"; + print ''."\n"; + + if (count($users) > 0) + { + // Use "$userentry" here, because "$user" is the current user + foreach ($users as $key => $userentry) + { + print "\t".''."\n"; + print '\n"; + print '\n"; + + // Link to delete from category + print '\n"; + } + } + else + { + print ''; + } + print "
'.$langs->trans("Users").' '.count($users).'
'; + print $userentry->getNomUrl(1); + print "'.$userentry->job."'; + if ($user->rights->user->user->creer) + { + print ""; + print $langs->trans("DeleteFromCat"); + print img_picto($langs->trans("DeleteFromCat"), 'unlink'); + print ""; + } + print "
'.$langs->trans("ThisCategoryHasNoUsers").'
\n"; + } +} + // End of page llxFooter(); $db->close(); From bc3a210d12add514e6f96f1ec61bef5f6bd2a995 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 3 Feb 2020 11:46:18 +0100 Subject: [PATCH 032/306] FIX compatibility with multicompany (avoid duplicate data) --- htdocs/holiday/class/holiday.class.php | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 66a118c744b..1e3567549a9 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -1658,19 +1658,19 @@ class Holiday extends CommonObject { // Si utilisateur de Dolibarr - $sql = "SELECT u.rowid"; + $sql = "SELECT DISTINCT u.rowid"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; if (! empty($conf->multicompany->enabled) && ! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { - $sql.= ", ".MAIN_DB_PREFIX."usergroup_user as ug"; - $sql.= " WHERE (ug.fk_user = u.rowid"; - $sql.= " AND ug.entity = ".$conf->entity.")"; - $sql.= " OR u.admin = 1"; + $sql.= ",".MAIN_DB_PREFIX."usergroup_user as ug"; + $sql.= " WHERE ((ug.fk_user = u.rowid"; + $sql.= " AND ug.entity IN (".getEntity('user')."))"; + $sql.= " OR u.entity = 0)"; // Show always superadmin } else { - $sql.= " WHERE u.entity IN (0,".$conf->entity.")"; + $sql.= " WHERE u.entity IN (".getEntity('user').")"; } $sql.= " AND u.statut > 0"; if ($filters) $sql.=$filters; @@ -1754,18 +1754,20 @@ class Holiday extends CommonObject // List for Dolibarr users if ($type) { - $sql = "SELECT u.rowid, u.lastname, u.firstname, u.gender, u.photo, u.employee, u.statut, u.fk_user"; + $sql = "SELECT DISTINCT u.rowid, u.lastname, u.firstname, u.gender, u.photo, u.employee, u.statut, u.fk_user"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; if (! empty($conf->multicompany->enabled) && ! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { - $sql.= ", ".MAIN_DB_PREFIX."usergroup_user as ug"; - $sql.= " WHERE (ug.fk_user = u.rowid"; - $sql.= " AND ug.entity = ".$conf->entity.")"; - $sql.= " OR u.admin = 1"; + $sql.= ",".MAIN_DB_PREFIX."usergroup_user as ug"; + $sql.= " WHERE ((ug.fk_user = u.rowid"; + $sql.= " AND ug.entity IN (".getEntity('user')."))"; + $sql.= " OR u.entity = 0)"; // Show always superadmin } else - $sql.= " WHERE u.entity IN (0,".$conf->entity.")"; + { + $sql.= " WHERE u.entity IN (".getEntity('user').")"; + } $sql.= " AND u.statut > 0"; if ($filters) $sql.=$filters; From e74e63941d6914241a60d5855a891cda1d9a14e8 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 3 Feb 2020 11:55:55 +0100 Subject: [PATCH 033/306] FIX use "usergroup" instead "user" --- htdocs/holiday/class/holiday.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 1e3567549a9..31723379314 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -1665,7 +1665,7 @@ class Holiday extends CommonObject { $sql.= ",".MAIN_DB_PREFIX."usergroup_user as ug"; $sql.= " WHERE ((ug.fk_user = u.rowid"; - $sql.= " AND ug.entity IN (".getEntity('user')."))"; + $sql.= " AND ug.entity IN (".getEntity('usergroup')."))"; $sql.= " OR u.entity = 0)"; // Show always superadmin } else @@ -1761,7 +1761,7 @@ class Holiday extends CommonObject { $sql.= ",".MAIN_DB_PREFIX."usergroup_user as ug"; $sql.= " WHERE ((ug.fk_user = u.rowid"; - $sql.= " AND ug.entity IN (".getEntity('user')."))"; + $sql.= " AND ug.entity IN (".getEntity('usergroup')."))"; $sql.= " OR u.entity = 0)"; // Show always superadmin } else From 90f29c060a99b027735c20142adee0544f9b4e32 Mon Sep 17 00:00:00 2001 From: Tobias Sekan Date: Mon, 3 Feb 2020 12:03:17 +0100 Subject: [PATCH 034/306] New show counts of categories --- htdocs/categories/index.php | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php index bb876cb0533..34d89fa05d3 100644 --- a/htdocs/categories/index.php +++ b/htdocs/categories/index.php @@ -161,6 +161,15 @@ $cate_arbo = $categstatic->get_full_arbo($typetext); // Define fulltree array $fulltree = $cate_arbo; +// Load possible missing includes +if($conf->global->CATEGORY_SHOW_COUNTS) +{ + if ($type == Categorie::TYPE_MEMBER) require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; + if ($type == Categorie::TYPE_ACCOUNT) require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + if ($type == Categorie::TYPE_PROJECT) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + if ($type == Categorie::TYPE_USER) require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; +} + // Define data (format for treeview) $data = array(); $data[] = array('rowid'=>0, 'fk_menu'=>-1, 'title'=>"racine", 'mainmenu'=>'', 'leftmenu'=>'', 'fk_mainmenu'=>'', 'fk_leftmenu'=>''); @@ -173,10 +182,29 @@ foreach ($fulltree as $key => $val) $li = $categstatic->getNomUrl(1, '', 60); $desc = dol_htmlcleanlastbr($val['description']); + if($conf->global->CATEGORY_SHOW_COUNTS) + { + // we need only a count of the elements, so it is enough to consume only the id's from the database + if ($type == Categorie::TYPE_PRODUCT) $elements = $categstatic->getObjectsInCateg("product", 1); + if ($type == Categorie::TYPE_SUPPLIER) $elements = $categstatic->getObjectsInCateg("supplier", 1); + if ($type == Categorie::TYPE_CUSTOMER) $elements = $categstatic->getObjectsInCateg("customer", 1); + if ($type == Categorie::TYPE_MEMBER) $elements = $categstatic->getObjectsInCateg("member", 1); + if ($type == Categorie::TYPE_CONTACT) $elements = $categstatic->getObjectsInCateg("contact", 1); + if ($type == Categorie::TYPE_ACCOUNT) $elements = $categstatic->getObjectsInCateg("account", 1); + if ($type == Categorie::TYPE_PROJECT) $elements = $categstatic->getObjectsInCateg("project", 1); + if ($type == Categorie::TYPE_USER) $elements = $categstatic->getObjectsInCateg("user", 1); + + $counter = "
".count($elements)."
'. + 'entry'=>'
color ? ' style="background: #'.$categstatic->color.';"' : ' style="background: #aaa"').'>'.$li.'
'.$counter. //''. ''. '
color ? ' style="background: #'.$categstatic->color.';"' : ' style="background: #aaa"').'>'.$li.''.dolGetFirstLineOfText($desc).''.img_view().'
' From 24ec36408195e78f01275c81b464b3be88c9a6ff Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 3 Feb 2020 11:10:04 +0000 Subject: [PATCH 035/306] Fixing style errors. --- htdocs/categories/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php index 34d89fa05d3..c71be0cd919 100644 --- a/htdocs/categories/index.php +++ b/htdocs/categories/index.php @@ -200,7 +200,7 @@ foreach ($fulltree as $key => $val) { $counter = ""; } - + $data[] = array( 'rowid'=>$val['rowid'], 'fk_menu'=>$val['fk_parent'], From eb5ac0d9a9c53cf6f3d343c802f660a2ec541e45 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Mon, 3 Feb 2020 14:28:57 +0100 Subject: [PATCH 036/306] fix url field in edit mode societe/card.php --- htdocs/societe/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index b6bef4473f3..ab8256f6473 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1988,7 +1988,7 @@ else print ''.img_picto('', 'object_email').' '.$form->editfieldkey('EMail', 'email', GETPOST('email', 'alpha'), $object, 0, 'string', '', (!empty($conf->global->SOCIETE_EMAIL_MANDATORY))).''; print ''; print ''.img_picto('', 'globe').' '.$form->editfieldkey('Web', 'url', GETPOST('url', 'alpha'), $object, 0).''; - print ''; + print ''; if (!empty($conf->socialnetworks->enabled)) { foreach ($socialnetworks as $key => $value) { From 36461afea95663b573f0c9287ef8ef1faaa13807 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 3 Feb 2020 14:54:35 +0100 Subject: [PATCH 037/306] FIX Creation of Stripe card from backoffice must return a clean message --- htdocs/langs/en_US/stripe.lang | 1 + htdocs/societe/paymentmodes.php | 6 ++-- htdocs/stripe/class/stripe.class.php | 47 +++++++++++++++++++++------- 3 files changed, 38 insertions(+), 16 deletions(-) diff --git a/htdocs/langs/en_US/stripe.lang b/htdocs/langs/en_US/stripe.lang index cfc0620db5c..5541250d9a6 100644 --- a/htdocs/langs/en_US/stripe.lang +++ b/htdocs/langs/en_US/stripe.lang @@ -68,3 +68,4 @@ ToOfferALinkForTestWebhook=Link to setup Stripe WebHook to call the IPN (test mo ToOfferALinkForLiveWebhook=Link to setup Stripe WebHook to call the IPN (live mode) PaymentWillBeRecordedForNextPeriod=Payment will be recorded for the next period. ClickHereToTryAgain=Click here to try again... +CreationOfPaymentModeMustBeDoneFromStripeInterface=Due to Strong Customer Authenticatin rules, creation of a card must be done from Stripe backoffice. You can click here to switch on Stripe customer record: %s \ No newline at end of file diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 1952fb8304c..21602dae3c4 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -546,16 +546,14 @@ if (empty($reshook)) if (!$error) { // Creation of Stripe card + update of societe_account + // Note that with the new Stripe API, option to create a card is no more available, instead an error message will be returned to + // ask to create the crdit card from Stripe backoffice. $card = $stripe->cardStripe($cu, $companypaymentmode, $stripeacc, $servicestatus, 1); if (!$card) { $error++; setEventMessages($stripe->error, $stripe->errors, 'errors'); } - else - { - $stripecard = $card->id; - } } } } diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index 931cfbfa83e..f5656387192 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -680,18 +680,18 @@ class Stripe extends CommonObject /** - * Get the Stripe card of a company payment mode (with option to create it on Stripe if not linked yet) + * Get the Stripe card of a company payment mode (option to create it on Stripe if not linked yet is no more available on new Stripe API) * * @param \Stripe\StripeCustomer $cu Object stripe customer * @param CompanyPaymentMode $object Object companypaymentmode to check, or create on stripe (create on stripe also update the societe_rib table for current entity) * @param string $stripeacc ''=Use common API. If not '', it is the Stripe connect account 'acc_....' to use Stripe connect * @param int $status Status (0=test, 1=live) - * @param int $createifnotlinkedtostripe 1=Create the stripe card and the link if the card is not yet linked to a stripe card + * @param int $createifnotlinkedtostripe 1=Create the stripe card and the link if the card is not yet linked to a stripe card. Deprecated with new Stripe API and SCA. * @return \Stripe\StripeCard|\Stripe\PaymentMethod|null Stripe Card or null if not found */ public function cardStripe($cu, CompanyPaymentMode $object, $stripeacc = '', $status = 0, $createifnotlinkedtostripe = 0) { - global $conf, $user; + global $conf, $user, $langs; $card = null; @@ -754,27 +754,54 @@ class Stripe extends CommonObject //$a = \Stripe\Stripe::getApiKey(); //var_dump($a);var_dump($stripeacc);exit; - dol_syslog("Try to create card with dataforcard = ".json_encode($dataforcard)); try { if (empty($stripeacc)) { // If the Stripe connect account not set, we use common API usage if (empty($conf->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION)) { + dol_syslog("Try to create card with dataforcard = ".json_encode($dataforcard)); $card = $cu->sources->create($dataforcard); + if (! $card) + { + $this->error = 'Creation of card on Stripe has failed'; + } } else { - // TODO - dol_syslog("Error: This case is not supported", LOG_ERR); + $connect = ''; + if (!empty($stripeacc)) $connect = $stripeacc.'/'; + $url = 'https://dashboard.stripe.com/'.$connect.'test/customers/'.$cu->id; + if ($status) + { + $url = 'https://dashboard.stripe.com/'.$connect.'customers/'.$cu->id; + } + $urtoswitchonstripe = ' '.img_picto($langs->trans('ShowInStripe'), 'globe').''; + + //dol_syslog("Error: This case is not supported", LOG_ERR); + $this->error = $langs->trans('CreationOfPaymentModeMustBeDoneFromStripeInterface', $urtoswitchonstripe); } } else { if (empty($conf->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION)) { + dol_syslog("Try to create card with dataforcard = ".json_encode($dataforcard)); $card = $cu->sources->create($dataforcard, array("stripe_account" => $stripeacc)); + if (! $card) + { + $this->error = 'Creation of card on Stripe has failed'; + } } else { - // TODO - dol_syslog("Error: This case is not supported", LOG_ERR); + $connect = ''; + if (!empty($stripeacc)) $connect = $stripeacc.'/'; + $url = 'https://dashboard.stripe.com/'.$connect.'test/customers/'.$cu->id; + if ($status) + { + $url = 'https://dashboard.stripe.com/'.$connect.'customers/'.$cu->id; + } + $urtoswitchonstripe = ' '.img_picto($langs->trans('ShowInStripe'), 'globe').''; + + //dol_syslog("Error: This case is not supported", LOG_ERR); + $this->error = $langs->trans('CreationOfPaymentModeMustBeDoneFromStripeInterface', $urtoswitchonstripe); } } @@ -792,10 +819,6 @@ class Stripe extends CommonObject $this->error = $this->db->lasterror(); } } - else - { - $this->error = 'Call to cu->source->create return empty card'; - } } catch (Exception $e) { From e6dc384ee93a839b6e6249b3e272216c911883f1 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Mon, 3 Feb 2020 19:33:23 +0100 Subject: [PATCH 038/306] Add bold tags --- htdocs/core/class/dolreceiptprinter.class.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/dolreceiptprinter.class.php b/htdocs/core/class/dolreceiptprinter.class.php index 4425e43cda2..90a8ca9556e 100644 --- a/htdocs/core/class/dolreceiptprinter.class.php +++ b/htdocs/core/class/dolreceiptprinter.class.php @@ -30,7 +30,8 @@ * Use font A of printer * Use font B of printer * Use font C of printer - * Text Bold + * Text Bold + * Disable Text Bold * Text double height * Text double width * Underline text @@ -162,7 +163,7 @@ class dolReceiptPrinter extends Printer 'dol_use_font_b', 'dol_use_font_c', 'dol_bold', - '/dol_bold', + 'dol_bold_disabled', 'dol_double_height', '/dol_double_height', 'dol_double_width', @@ -711,6 +712,12 @@ class dolReceiptPrinter extends Printer break; case 'DOL_USE_FONT_C': $this->printer->setFont(Printer::FONT_C); + break; + case 'DOL_BOLD': + $this->printer->setEmphasis(true); + break; + case 'DOL_BOLD_DISABLED': + $this->printer->setEmphasis(false); break; default: $this->printer->text($vals[$tplline]['tag']); From 5a248f31a60322c2ca771054bea66533ed8cd563 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Mon, 3 Feb 2020 19:34:39 +0100 Subject: [PATCH 039/306] Add langs --- htdocs/langs/en_US/receiptprinter.lang | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/langs/en_US/receiptprinter.lang b/htdocs/langs/en_US/receiptprinter.lang index 5714ba78151..f79974558d6 100644 --- a/htdocs/langs/en_US/receiptprinter.lang +++ b/htdocs/langs/en_US/receiptprinter.lang @@ -45,3 +45,5 @@ DOL_ACTIVATE_BUZZER=Activate buzzer DOL_PRINT_QRCODE=Print QR Code DOL_PRINT_LOGO=Print logo of my company DOL_PRINT_LOGO_OLD=Print logo of my company (old printers) +DOL_BOLD=Bold +DOL_BOLD_DISABLED=Disable bold From d4ae8b81e4d461bcce675a30a79ee6e11d94a560 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 3 Feb 2020 20:49:21 +0100 Subject: [PATCH 040/306] Card examples --- htdocs/stripe/admin/stripe.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/stripe/admin/stripe.php b/htdocs/stripe/admin/stripe.php index c26f1ea709c..838cc5ca37a 100644 --- a/htdocs/stripe/admin/stripe.php +++ b/htdocs/stripe/admin/stripe.php @@ -467,7 +467,7 @@ $token = ''; include DOL_DOCUMENT_ROOT.'/core/tpl/onlinepaymentlinks.tpl.php'; -print info_admin($langs->trans("ExampleOfTestCreditCard", '4242424242424242 (no 3DSecure) or 4000000000003063 (3DSecure required) or 4000000000003220 (3DSecure2 required)', '4000000000000101', '4000000000000069', '4000000000000341')); +print info_admin($langs->trans("ExampleOfTestCreditCard", '4242424242424242 (no 3DSecure) or 4000000000003063 (3DSecure required) or 4000002760003184 (3DSecure2 required on all transaction) or 4000003800000446 (3DSecure2 required the off-seesion allowed)', '4000000000000101', '4000000000000069', '4000000000000341')); if (!empty($conf->use_javascript_ajax)) { From c367c6f34eb12ab9bdab6bb8a370a891353b9268 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 3 Feb 2020 21:17:45 +0100 Subject: [PATCH 041/306] Avoid warning --- htdocs/core/tpl/extrafields_list_search_param.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/extrafields_list_search_param.tpl.php b/htdocs/core/tpl/extrafields_list_search_param.tpl.php index ca72293365a..6e6d6305106 100644 --- a/htdocs/core/tpl/extrafields_list_search_param.tpl.php +++ b/htdocs/core/tpl/extrafields_list_search_param.tpl.php @@ -8,7 +8,7 @@ if (empty($conf) || !is_object($conf)) } // Loop to complete $param for extrafields -if (!empty($search_array_options)) // $extrafieldsobject is the $object->table_element like 'societe', 'socpeople', ... +if (!empty($search_array_options) && is_array($search_array_options)) // $extrafieldsobject is the $object->table_element like 'societe', 'socpeople', ... { if (empty($search_options_pattern)) $search_options_pattern = 'search_options_'; From bf4fca0c7e9ff9c4cc6962598fc0e45f0d42e3ff Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 3 Feb 2020 22:09:21 +0100 Subject: [PATCH 042/306] Fix warning --- htdocs/core/tpl/extrafields_list_search_sql.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/extrafields_list_search_sql.tpl.php b/htdocs/core/tpl/extrafields_list_search_sql.tpl.php index bdaf963b4f5..59b73b4c861 100644 --- a/htdocs/core/tpl/extrafields_list_search_sql.tpl.php +++ b/htdocs/core/tpl/extrafields_list_search_sql.tpl.php @@ -10,7 +10,7 @@ if (empty($conf) || ! is_object($conf)) if (empty($extrafieldsobjectkey) && is_object($object)) $extrafieldsobjectkey=$object->table_element; // Loop to complete the sql search criterias from extrafields -if (! empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_element like 'societe', 'socpeople', ... +if (! empty($extrafieldsobjectkey) && ! empty($search_array_options) && is_array($search_array_options)) // $extrafieldsobject is the $object->table_element like 'societe', 'socpeople', ... { foreach ($search_array_options as $key => $val) { From 24c305dc7fc48ed8d3ed4cb1b0d4a945f216de73 Mon Sep 17 00:00:00 2001 From: Tobias Sekan Date: Tue, 4 Feb 2020 09:00:31 +0100 Subject: [PATCH 043/306] Fix unset gender property in contact class --- htdocs/contact/class/contact.class.php | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index f56d03ceeb3..0cea298973a 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -992,19 +992,25 @@ class Contact extends CommonObject } + /** - * Set property ->gender from property ->civility_id + * Set the property "gender" of this class, based on the property "civility_id" + * or use property "civility_code" as fallback, when "civility_id" is not available. * * @return void */ public function setGenderFromCivility() { - unset($this->gender); - if (in_array($this->civility_id, array('MR'))) { - $this->gender = 'man'; - } elseif (in_array($this->civility_id, array('MME', 'MLE'))) { - $this->gender = 'woman'; - } + unset($this->gender); + + if (in_array($this->civility_id, array('MR')) || in_array($this->civility_code, array('MR'))) + { + $this->gender = 'man'; + } + elseif(in_array($this->civility_id, array('MME','MLE')) || in_array($this->civility_code, array('MME','MLE'))) + { + $this->gender = 'woman'; + } } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps From d93a597a1eb62db89392aa44b79b73ba19e7c6bb Mon Sep 17 00:00:00 2001 From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Date: Tue, 4 Feb 2020 09:17:02 +0100 Subject: [PATCH 044/306] Fix Compatbility with Multicompany Before : Show all projects of all entities Now : Show only projects that are allowed by permissions --- htdocs/core/boxes/box_project.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/boxes/box_project.php b/htdocs/core/boxes/box_project.php index e7281708802..5e06e154987 100644 --- a/htdocs/core/boxes/box_project.php +++ b/htdocs/core/boxes/box_project.php @@ -3,6 +3,7 @@ * Copyright (C) 2014 Marcos García * Copyright (C) 2015 Frederic France * Copyright (C) 2016 Juan José Menent + * Copyright (C) 2020 Pierre Ardoin * * 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 @@ -99,6 +100,7 @@ class box_project extends ModeleBoxes $sql = "SELECT p.rowid, p.ref, p.title, p.fk_statut, p.public"; $sql.= " FROM ".MAIN_DB_PREFIX."projet as p"; $sql.= " WHERE p.fk_statut = 1"; // Only open projects + $sql .= " AND entity IN (".getEntity('projet').")"; // Only current entity or severals if permission ok if (! $user->rights->projet->all->lire) $sql.= " AND p.rowid IN (".$projectsListId.")"; // public and assigned to, or restricted to company for external users $sql.= " ORDER BY p.datec DESC"; From 157745a1bbb888416dfaff55031592fe71f0b6d6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Feb 2020 14:18:37 +0100 Subject: [PATCH 045/306] Fix phpcs --- htdocs/core/lib/functionsnumtoword.lib.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/functionsnumtoword.lib.php b/htdocs/core/lib/functionsnumtoword.lib.php index e056360ec29..1e8b3ba264e 100644 --- a/htdocs/core/lib/functionsnumtoword.lib.php +++ b/htdocs/core/lib/functionsnumtoword.lib.php @@ -41,21 +41,21 @@ function dol_convertToWord($num, $langs, $currency = false, $centimes = false) if (! $num) { return false; } + if ($centimes && strlen($num) == 1) { $num = $num*10; } + if (! empty($conf->global->MAIN_MODULE_NUMBERWORDS)) { - if ($currency == true) { $type = 1; - }else{ + } else { $type = 0; } $concatWords = $langs->getLabelFromNumber($num, $type); return $concatWords; - - }else{ + } else { $TNum = explode('.', $num); $num = (int) $TNum[0]; $words = array(); From 976ce0a954c186bad0485811719a22199b20a666 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Feb 2020 14:33:25 +0100 Subject: [PATCH 046/306] Fix scrutinizer --- htdocs/core/lib/functionsnumtoword.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functionsnumtoword.lib.php b/htdocs/core/lib/functionsnumtoword.lib.php index 1e8b3ba264e..94479fe2c28 100644 --- a/htdocs/core/lib/functionsnumtoword.lib.php +++ b/htdocs/core/lib/functionsnumtoword.lib.php @@ -47,7 +47,7 @@ function dol_convertToWord($num, $langs, $currency = false, $centimes = false) } if (! empty($conf->global->MAIN_MODULE_NUMBERWORDS)) { - if ($currency == true) { + if ($currency) { $type = 1; } else { $type = 0; From bb9f4c8ec38d491acd1448811a1bf1179e518c92 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Feb 2020 14:34:40 +0100 Subject: [PATCH 047/306] Fix var_dump --- htdocs/mrp/class/mo.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index a87ab150070..2f364c359fa 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -513,7 +513,6 @@ class Mo extends CommonObject return $resarray; } else { $this->error = $this->db->lasterror(); - var_dump($this->error); return array(); } } From c5da131749add87d34156ae21701373616cf97b8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Feb 2020 14:40:11 +0100 Subject: [PATCH 048/306] Fix param not defined --- htdocs/mrp/class/mo.class.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 2f364c359fa..e677c64efc0 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -558,9 +558,10 @@ class Mo extends CommonObject * Erase and update the line to produce. * * @param User $user User that modifies + * @param bool $notrigger false=launch triggers after, true=disable triggers * @return int <0 if KO, >0 if OK */ - public function updateProduction(User $user) + public function updateProduction(User $user, $notrigger = true) { $error = 0; @@ -592,7 +593,7 @@ class Mo extends CommonObject $moline->role = 'toproduce'; $moline->position = 1; - $resultline = $moline->create($user); + $resultline = $moline->create($user, false); // Never use triggers here if ($resultline <= 0) { $error++; $this->error = $moline->error; @@ -624,7 +625,7 @@ class Mo extends CommonObject $moline->qty_frozen = $line->qty_frozen; $moline->disable_stock_change = $line->disable_stock_change; - $resultline = $moline->create($user); + $resultline = $moline->create($user, false); // Never use triggers here if ($resultline <= 0) { $error++; $this->error = $moline->error; From af7a5b510d6706fb6ad6e7c70b13f5d424fde49d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Feb 2020 14:47:30 +0100 Subject: [PATCH 049/306] Fix phpcs --- htdocs/compta/cashcontrol/cashcontrol_card.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/cashcontrol/cashcontrol_card.php b/htdocs/compta/cashcontrol/cashcontrol_card.php index 4c60434619a..8e83e6a33a4 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_card.php +++ b/htdocs/compta/cashcontrol/cashcontrol_card.php @@ -345,7 +345,8 @@ if ($action == "create" || $action == "start") print ''; $array = array(); - for($i = 1; $i <= max(1, $conf->global->TAKEPOS_NUM_TERMINALS); $i++) { + $numterminals = max(1, $conf->global->TAKEPOS_NUM_TERMINALS); + for($i = 1; $i <= $numterminals; $i++) { $array[$i] = $i; } $selectedposnumber = 0; $showempty = 1; From bb1c9a66dd8ef86ec0bb18636305335136ff1997 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Feb 2020 16:37:30 +0100 Subject: [PATCH 050/306] Fix code alignement on modulebuilder --- htdocs/asset/class/asset.class.php | 2 +- htdocs/asset/class/asset_type.class.php | 11 ++ htdocs/asset/list.php | 248 ++++++++++++------------ htdocs/core/lib/functions.lib.php | 4 +- htdocs/theme/eldy/global.inc.php | 4 + 5 files changed, 145 insertions(+), 124 deletions(-) diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index 0e34cd9b989..e39c7a3e1c1 100644 --- a/htdocs/asset/class/asset.class.php +++ b/htdocs/asset/class/asset.class.php @@ -82,7 +82,7 @@ class Asset extends CommonObject 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'notnull'=>-1, 'searchall'=>1, 'help'=>"Help text",), 'amount_ht' => array('type'=>'double(24,8)', 'label'=>'AmountHTShort', 'visible'=>1, 'enabled'=>1, 'position'=>40, 'notnull'=>-1, 'isameasure'=>'1', 'help'=>"Help text",), 'amount_vat' => array('type'=>'double(24,8)', 'label'=>'AmountVAT', 'visible'=>1, 'enabled'=>1, 'position'=>40, 'notnull'=>-1, 'isameasure'=>'1', 'help'=>"Help text",), - 'fk_asset_type' => array('type'=>'integer:AssetType:asset/class/asset.class.php', 'label'=>'AssetsType', 'visible'=>1, 'enabled'=>1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'searchall'=>1, 'help'=>"LinkToThirparty",), + 'fk_asset_type' => array('type'=>'integer:AssetType:asset/class/asset_type.class.php', 'label'=>'AssetsType', 'visible'=>1, 'enabled'=>1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'searchall'=>1, 'help'=>"LinkToThirparty",), 'description' => array('type'=>'text', 'label'=>'Description', 'visible'=>-1, 'enabled'=>1, 'position'=>90, 'notnull'=>-1,), 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'visible'=>-1, 'enabled'=>1, 'position'=>91, 'notnull'=>-1,), 'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'visible'=>-1, 'enabled'=>1, 'position'=>92, 'notnull'=>-1,), diff --git a/htdocs/asset/class/asset_type.class.php b/htdocs/asset/class/asset_type.class.php index d48ebf9d089..23c1bd630fa 100644 --- a/htdocs/asset/class/asset_type.class.php +++ b/htdocs/asset/class/asset_type.class.php @@ -70,6 +70,17 @@ class AssetType extends CommonObject /** @var array Array of asset */ public $asset=array(); + public $fields=array( + 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10), + 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>15, 'index'=>1), + 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>20), + 'label' =>array('type'=>'varchar(50)', 'label'=>'Label', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>25, 'showoncombobox'=>1), + 'accountancy_code_asset' =>array('type'=>'varchar(32)', 'label'=>'Accountancy code asset', 'enabled'=>1, 'visible'=>-1, 'position'=>30), + 'accountancy_code_depreciation_asset' =>array('type'=>'varchar(32)', 'label'=>'Accountancy code depreciation asset', 'enabled'=>1, 'visible'=>-1, 'position'=>35), + 'accountancy_code_depreciation_expense' =>array('type'=>'varchar(32)', 'label'=>'Accountancy code depreciation expense', 'enabled'=>1, 'visible'=>-1, 'position'=>40), + 'note' =>array('type'=>'mediumtext', 'label'=>'Note', 'enabled'=>1, 'visible'=>-1, 'position'=>45), + ); + /** * Constructor diff --git a/htdocs/asset/list.php b/htdocs/asset/list.php index fb8c4066a10..80ecf966e8d 100644 --- a/htdocs/asset/list.php +++ b/htdocs/asset/list.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/asset/class/asset.class.php'; // Load translation files required by the page $langs->loadLangs(array("assets")); -$action = GETPOST('action', 'alpha') ?GETPOST('action', 'alpha') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... +$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) $show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation @@ -50,7 +50,7 @@ $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'alpha'); $sortorder = GETPOST('sortorder', 'alpha'); $page = GETPOST('page', 'int'); -if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 +if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; @@ -63,6 +63,7 @@ $hookmanager->initHooks(array('assetlist')); // Note that conf->hooks_modules co // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); +//$extrafields->fetch_name_optionals_label($object->table_element_line); $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); @@ -70,9 +71,9 @@ $search_array_options = $extrafields->getOptionalsFromPost($object->table_elemen if (!$sortfield) $sortfield = "t.".key($object->fields); // Set here default search field. By default 1st field in definition. if (!$sortorder) $sortorder = "ASC"; -// Protection if external user +// Security check $socid = 0; -if ($user->socid > 0) +if ($user->socid > 0) // Protection if external user { //$socid = $user->socid; accessforbidden(); @@ -84,7 +85,7 @@ $search_all = trim(GETPOST("search_all", 'alpha')); $search = array(); foreach ($object->fields as $key => $val) { - if (GETPOST('search_'.$key, 'alpha')) $search[$key] = GETPOST('search_'.$key, 'alpha'); + if (GETPOST('search_'.$key, 'alpha') !== '') $search[$key] = GETPOST('search_'.$key, 'alpha'); } // List of fields to search into when doing a "search in all" @@ -99,26 +100,33 @@ $arrayfields = array(); foreach ($object->fields as $key => $val) { // If $val['visible']==0, then we never show the field - if (!empty($val['visible'])) $arrayfields['t.'.$key] = array('label'=>$val['label'], 'checked'=>(($val['visible'] < 0) ? 0 : 1), 'enabled'=>$val['enabled'], 'position'=>$val['position']); + if (!empty($val['visible'])) $arrayfields['t.'.$key] = array('label'=>$val['label'], 'checked'=>(($val['visible'] < 0) ? 0 : 1), 'enabled'=>($val['enabled'] && ($val['visible'] != 3)), 'position'=>$val['position']); } // Extra fields if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label']) > 0) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - if (!empty($extrafields->attributes[$object->table_element]['list'][$key])) - $arrayfields["ef.".$key] = array('label'=>$extrafields->attributes[$object->table_element]['label'][$key], 'checked'=>(($extrafields->attributes[$object->table_element]['list'][$key] < 0) ? 0 : 1), 'position'=>$extrafields->attributes[$object->table_element]['pos'][$key], 'enabled'=>(abs($extrafields->attributes[$object->table_element]['list'][$key]) != 3 && $extrafields->attributes[$object->table_element]['perms'][$key])); + if (!empty($extrafields->attributes[$object->table_element]['list'][$key])) { + $arrayfields["ef.".$key] = array( + 'label'=>$extrafields->attributes[$object->table_element]['label'][$key], + 'checked'=>(($extrafields->attributes[$object->table_element]['list'][$key] < 0) ? 0 : 1), + 'position'=>$extrafields->attributes[$object->table_element]['pos'][$key], + 'enabled'=>(abs($extrafields->attributes[$object->table_element]['list'][$key]) != 3 && $extrafields->attributes[$object->table_element]['perms'][$key]) + ); + } } } $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); +$permissiontoread = $user->rights->asset->read; +$permissiontoadd = $user->rights->asset->write; +$permissiontodelete = $user->rights->asset->delete; /* * Actions - * - * Put here all code to do according to value of "$action" parameter */ if (GETPOST('cancel', 'alpha')) { $action = 'list'; $massaction = ''; } @@ -152,8 +160,6 @@ if (empty($reshook)) // Mass actions $objectclass = 'Asset'; $objectlabel = 'Asset'; - $permissiontoread = $user->rights->asset->read; - $permissiontodelete = $user->rights->asset->delete; $uploaddir = $conf->asset->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } @@ -162,8 +168,6 @@ if (empty($reshook)) /* * View - * - * Put here all code to render page */ $form = new Form($db); @@ -183,23 +187,30 @@ foreach ($object->fields as $key => $val) $sql .= 't.'.$key.', '; } // Add fields from extrafields -if (!empty($extrafields->attributes[$object->table_element]['label'])) +if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.' as options_'.$key.', ' : ''); +} // Add fields from hooks $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook -$sql .= $hookmanager->resPrint; +$sql .= preg_replace('/^,/', '', $hookmanager->resPrint); $sql = preg_replace('/,\s*$/', '', $sql); $sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t"; if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)"; -if ($object->ismultientitymanaged == 1) $sql .= " WHERE t.entity IN (".getEntity('assets').")"; +if ($object->ismultientitymanaged == 1) $sql .= " WHERE t.entity IN (".getEntity($object->element).")"; else $sql .= " WHERE 1 = 1"; foreach ($search as $key => $val) { + if ($key == 'status' && $search[$key] == -1) continue; $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); + if (strpos($object->fields[$key]['type'], 'integer:') === 0) { + if ($search[$key] == '-1') $search[$key] = ''; + $mode_search = 2; + } if ($search[$key] != '') $sql .= natural_search($key, $search[$key], (($key == 'status') ? 2 : $mode_search)); } if ($search_all) $sql .= natural_search(array_keys($fieldstosearchall), $search_all); +//$sql.= dolSqlDateFilter("t.field", $search_xxxday, $search_xxxmonth, $search_xxxyear); // Add where from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; // Add where from hooks @@ -216,10 +227,12 @@ foreach($object->fields as $key => $val) // Add fields from extrafields if (! empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : ''); +} // Add where from hooks $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldListGroupBy',$parameters); // Note that $action and $object may have been modified by hook $sql.=$hookmanager->resPrint; +$sql=preg_replace('/,\s*$/','', $sql); */ $sql .= $db->order($sortfield, $sortorder); @@ -228,28 +241,35 @@ $sql .= $db->order($sortfield, $sortorder); $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { - $result = $db->query($sql); - $nbtotalofrecords = $db->num_rows($result); - if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + $resql = $db->query($sql); + $nbtotalofrecords = $db->num_rows($resql); + if (($page * $limit) > $nbtotalofrecords) // if total of record found is smaller than page * limit, goto and load page 0 { $page = 0; $offset = 0; } } - -$sql .= $db->plimit($limit + 1, $offset); - -$resql = $db->query($sql); -if (!$resql) +// if total of record found is smaller than limit, no need to do paging and to restart another select with limits set. +if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit))) { - dol_print_error($db); - exit; + $num = $nbtotalofrecords; +} +else +{ + if ($limit) $sql .= $db->plimit($limit + 1, $offset); + + $resql = $db->query($sql); + if (!$resql) + { + dol_print_error($db); + exit; + } + + $num = $db->num_rows($resql); } -$num = $db->num_rows($resql); - // Direct jump if only one record found -if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all) +if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) { $obj = $db->fetch_object($resql); $id = $obj->rowid; @@ -285,7 +305,8 @@ if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&co if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit); foreach ($search as $key => $val) { - $param .= '&search_'.$key.'='.urlencode($search[$key]); + if (is_array($search[$key]) && count($search[$key])) foreach ($search[$key] as $skey) $param .= '&search_'.$key.'[]='.urlencode($skey); + else $param .= '&search_'.$key.'='.urlencode($search[$key]); } if ($optioncss != '') $param .= '&optioncss='.urlencode($optioncss); // Add $param from extra fields @@ -296,19 +317,11 @@ $arrayofmassactions = array( //'presend'=>$langs->trans("SendByMail"), //'builddoc'=>$langs->trans("PDFMerge"), ); -if ($user->rights->asset->delete) $arrayofmassactions['predelete'] = ''.$langs->trans("Delete"); -if (in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = array(); +if ($permissiontodelete) $arrayofmassactions['predelete'] = ''.$langs->trans("Delete"); +if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = array(); $massactionbutton = $form->selectMassAction('', $arrayofmassactions); -$newcardbutton = ''; -if ($user->rights->asset->write) -{ - $newcardbutton = ''.$langs->trans('NewAsset').''; - $newcardbutton .= ''; - $newcardbutton .= ''; -} - -print '
'; +print ''."\n"; if ($optioncss != '') print ''; print ''; print ''; @@ -318,6 +331,8 @@ print ''; print ''; print ''; +$newcardbutton = dolGetButtonTitle($langs->trans('NewAsset'), '', 'fa fa-plus-circle', dol_buildpath('/asset/card.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd); + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'accountancy', 0, $newcardbutton, '', $limit); // Add code for pre mass action (confirmation or email presend form) @@ -363,11 +378,21 @@ print ''; foreach ($object->fields as $key => $val) { - $align = ''; - if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) $align .= ($align ? ' ' : '').'center'; - if (in_array($val['type'], array('timestamp'))) $align .= ($align ? ' ' : '').'nowrap'; - if ($key == 'status') $align .= ($align ? ' ' : '').'center'; - if (!empty($arrayfields['t.'.$key]['checked'])) print ''; + $cssforfield = (empty($val['css']) ? '' : $val['css']); + if ($key == 'status') $cssforfield .= ($cssforfield ? ' ' : '').'center'; + elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) $cssforfield .= ($cssforfield ? ' ' : '').'center'; + elseif (in_array($val['type'], array('timestamp'))) $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; + elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID') $cssforfield .= ($cssforfield ? ' ' : '').'right'; + if (!empty($arrayfields['t.'.$key]['checked'])) + { + print ''; + } } // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; @@ -389,11 +414,15 @@ print ''."\n"; print ''; foreach($object->fields as $key => $val) { - $align=''; - if (in_array($val['type'], array('date','datetime','timestamp'))) $align.=($align?' ':'').'center'; - if (in_array($val['type'], array('timestamp'))) $align.=($align?' ':'').'nowrap'; - if ($key == 'status') $align.=($align?' ':'').'center'; - if (! empty($arrayfields['t.'.$key]['checked'])) print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($align?'class="'.$align.'"':''), $sortfield, $sortorder, $align.' ')."\n"; + $cssforfield = (empty($val['css']) ? '' : $val['css']); + if ($key == 'status') $cssforfield .= ($cssforfield ? ' ' : '').'center'; + elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) $cssforfield .= ($cssforfield ? ' ' : '').'center'; + elseif (in_array($val['type'], array('timestamp'))) $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; + elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID') $cssforfield .= ($cssforfield ? ' ' : '').'right'; + if (!empty($arrayfields['t.'.$key]['checked'])) + { + print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''))."\n"; + } } // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; @@ -401,19 +430,19 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; $parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder); $reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; +// Action column print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ')."\n"; print ''."\n"; // Detect if we need a fetch on each output line $needToFetchEachLine=0; -if (is_array($extrafields->attributes[$object->table_element]['computed'])) { - foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) { - if (preg_match('/\$object/', $val)) { - // There is at least one compute field that use $object - $needToFetchEachLine++; - } - } +if (is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) +{ + foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) + { + if (preg_match('/\$object/', $val)) $needToFetchEachLine++; // There is at least one compute field that use $object + } } @@ -421,84 +450,65 @@ if (is_array($extrafields->attributes[$object->table_element]['computed'])) { // -------------------------------------------------------------------- $i=0; $totalarray=array(); -while ($i < min($num, $limit)) +while ($i < ($limit ? min($num, $limit) : $num)) { $obj = $db->fetch_object($resql); if (empty($obj)) break; // Should not happen // Store properties in $object - $object->id = $obj->rowid; - foreach($object->fields as $key => $val) - { - if (property_exists($obj, $key)) $object->$key = $obj->$key; - } + $object->setVarsFromFetchObj($obj); // Show here line of result print ''; foreach($object->fields as $key => $val) { - $align=''; - if (in_array($val['type'], array('date','datetime','timestamp'))) $align.=($align?' ':'').'center'; - if (in_array($val['type'], array('timestamp'))) $align.=($align?' ':'').'nowrap'; - if ($key == 'status') $align.=($align?' ':'').'center'; - if (! empty($arrayfields['t.'.$key]['checked'])) + $cssforfield = (empty($val['css']) ? '' : $val['css']); + if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) $cssforfield .= ($cssforfield ? ' ' : '').'center'; + elseif ($key == 'status') $cssforfield .= ($cssforfield ? ' ' : '').'center'; + + if (in_array($val['type'], array('timestamp'))) $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; + elseif ($key == 'ref') $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; + + if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $key != 'status') $cssforfield .= ($cssforfield ? ' ' : '').'right'; + + if (!empty($arrayfields['t.'.$key]['checked'])) { - print ''; - print $object->showOutputField($val, $key, $obj->$key, ''); + print ''; + if ($key == 'status') print $object->getLibStatut(5); + else print $object->showOutputField($val, $key, $object->$key, ''); print ''; - if (! $i) $totalarray['nbfield']++; - if (! empty($val['isameasure'])) + if (!$i) $totalarray['nbfield']++; + if (!empty($val['isameasure'])) { - if (! $i) $totalarray['pos'][$totalarray['nbfield']]='t.'.$key; - $totalarray['val']['t.'.$key] += $obj->$key; + if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; + $totalarray['val']['t.'.$key] += $object->$key; } } } // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column - print ''; if (!$i) $totalarray['nbfield']++; - print ''; + print ''."\n"; $i++; } // Show total line -if (isset($totalarray['pos'])) -{ - print ''; - $i = 0; - while ($i < $totalarray['nbfield']) - { - $i++; - if (!empty($totalarray['pos'][$i])) print ''; - else - { - if ($i == 1) - { - if ($num < $limit) print ''; - else print ''; - } - else print ''; - } - } - print ''; -} +include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; // If no record found if ($num == 0) @@ -522,25 +532,21 @@ print ''."\n"; if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { - if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) - { - require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; - $formfile = new FormFile($db); + $hidegeneratedfilelistifempty = 1; + if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) $hidegeneratedfilelistifempty = 0; + + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; + $formfile = new FormFile($db); + + // Show list of available documents + $urlsource = $_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder; + $urlsource .= str_replace('&', '&', $param); + + $filedir = $diroutputmassaction; + $genallowed = $permissiontoread; + $delallowed = $permissiontoadd; - // Show list of available documents - $urlsource = $_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder; - $urlsource .= str_replace('&', '&', $param); - - $filedir = $diroutputmassaction; - $genallowed = $user->rights->asset->read; - $delallowed = $user->rights->asset->create; - - print $formfile->showdocuments('massfilesarea_asset', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, ''); - } - else - { - print '
'.$langs->trans("ShowTempMassFilesArea").''; - } + print $formfile->showdocuments('massfilesarea_asset', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, ''); } // End of page diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 7d678281adb..72f0d0f19e0 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3165,7 +3165,6 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ } elseif ($pictowithouttext == 'bank') { $fakey = 'fa-'.$arrayconvpictotofa[$pictowithouttext]; - $facolor = '#444'; } elseif ($pictowithouttext == 'stats') { $fakey = 'fa-'.$arrayconvpictotofa[$pictowithouttext]; @@ -4267,8 +4266,9 @@ function print_barre_liste($titre, $page, $file, $options = '', $sortfield = '', print '
'; + if (is_array($val['arrayofkeyval'])) print $form->selectarray('search_'.$key, $val['arrayofkeyval'], $search[$key], $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth75'); + elseif (strpos($val['type'], 'integer:') === 0) { + print $object->showInputField($val, $key, $search[$key], '', '', 'search_', 'maxwidth150', 1); + } + elseif (!preg_match('/^(date|timestamp)/', $val['type'])) print ''; + print '
'; + print ''; if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined { $selected = 0; - if (in_array($obj->rowid, $arrayofselected)) $selected = 1; - print ''; + if (in_array($object->id, $arrayofselected)) $selected = 1; + print ''; } print '
'.price($totalarray['val'][$totalarray['pos'][$i]]).''.$langs->trans("Total").''.$langs->trans("Totalforthispage").'
'; // maring bottom must be same than into load_fiche_tire // Left + + if ($picto && $titre) print ''; print ''; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 5aebfacfdc0..15bd0148851 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1420,6 +1420,10 @@ div.nopadding { margin : 0px auto; } +td.nobordernopadding.widthpictotitle.opacityhigh.valignmiddle.col-picto { + color: rgb(); + opacity: 0.6; +} .pictotitle { margin-: 8px; margin-bottom: 4px; From 71d0ed0754cb9ee0c52e2d70c3c01d125eff744e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Feb 2020 16:44:46 +0100 Subject: [PATCH 051/306] css --- htdocs/theme/eldy/global.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 15bd0148851..e46ba8d5bf9 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1422,7 +1422,7 @@ div.nopadding { td.nobordernopadding.widthpictotitle.opacityhigh.valignmiddle.col-picto { color: rgb(); - opacity: 0.6; + opacity: 0.5; } .pictotitle { margin-: 8px; @@ -3642,7 +3642,7 @@ div.boximport { .fieldrequired { font-weight: bold; color: #000055; } .widthpictotitle { width: 44px; text-align: ; } -span.widthpictotitle { font-size: 2.5em; }; +span.widthpictotitle { font-size: 2.1em; }; .dolgraphtitle { margin-top: 6px; margin-bottom: 4px; } .dolgraphtitlecssboxes { /* margin: 0px; */ } From 9c8119def93c2a9c56fd98cda91b4c5bc810e27b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Feb 2020 18:03:32 +0100 Subject: [PATCH 052/306] Fix phpcs --- htdocs/asset/list.php | 16 ++++++++-------- htdocs/theme/eldy/global.inc.php | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/asset/list.php b/htdocs/asset/list.php index 80ecf966e8d..be681ac5c13 100644 --- a/htdocs/asset/list.php +++ b/htdocs/asset/list.php @@ -257,14 +257,14 @@ if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit else { if ($limit) $sql .= $db->plimit($limit + 1, $offset); - + $resql = $db->query($sql); if (!$resql) { dol_print_error($db); exit; } - + $num = $db->num_rows($resql); } @@ -465,12 +465,12 @@ while ($i < ($limit ? min($num, $limit) : $num)) $cssforfield = (empty($val['css']) ? '' : $val['css']); if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) $cssforfield .= ($cssforfield ? ' ' : '').'center'; elseif ($key == 'status') $cssforfield .= ($cssforfield ? ' ' : '').'center'; - + if (in_array($val['type'], array('timestamp'))) $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; elseif ($key == 'ref') $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; - + if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $key != 'status') $cssforfield .= ($cssforfield ? ' ' : '').'right'; - + if (!empty($arrayfields['t.'.$key]['checked'])) { print ''; @@ -534,14 +534,14 @@ if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $n { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) $hidegeneratedfilelistifempty = 0; - + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; $formfile = new FormFile($db); - + // Show list of available documents $urlsource = $_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder; $urlsource .= str_replace('&', '&', $param); - + $filedir = $diroutputmassaction; $genallowed = $permissiontoread; $delallowed = $permissiontoadd; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index e46ba8d5bf9..8e5fc838936 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -3641,7 +3641,7 @@ div.boximport { .fieldrequired { font-weight: bold; color: #000055; } -.widthpictotitle { width: 44px; text-align: ; } +.widthpictotitle { width: 32px; text-align: ; } span.widthpictotitle { font-size: 2.1em; }; .dolgraphtitle { margin-top: 6px; margin-bottom: 4px; } From 0b45ceaf920186544e1fe40dcaa41e2afa0291ae Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Feb 2020 18:59:49 +0100 Subject: [PATCH 053/306] More logs --- htdocs/stripe/class/stripe.class.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index 0953bda125d..32d9fd4784b 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -561,7 +561,7 @@ class Stripe extends CommonObject { global $conf; - dol_syslog("getSetupIntent", LOG_INFO, 1); + dol_syslog("getSetupIntent description=".$description.' confirmnow='.$confirmnow, LOG_INFO, 1); $error = 0; @@ -603,6 +603,8 @@ class Stripe extends CommonObject global $stripearrayofkeysbyenv; \Stripe\Stripe::setApiKey($stripearrayofkeysbyenv[$status]['secret_key']); + dol_syslog("getSetupIntent ".$stripearrayofkeysbyenv[$status]['publishable_key'], LOG_DEBUG); + // Note: If all data for payment intent are same than a previous on, even if we use 'create', Stripe will return ID of the old existing payment intent. if (empty($key)) { // If the Stripe connect account not set, we use common API usage //$setupintent = \Stripe\SetupIntent::create($dataforintent, array("idempotency_key" => "$description")); @@ -668,14 +670,14 @@ class Stripe extends CommonObject } } - dol_syslog("getSetupIntent return error=".$error, LOG_INFO, -1); - if (!$error) { + dol_syslog("getSetupIntent ".(is_object($setupintent) ? $setupintent->id : ''), LOG_INFO, -1); return $setupintent; } else { + dol_syslog("getSetupIntent return error=".$error, LOG_INFO, -1); return null; } } From bc19f72306c2ec091fb1d269cc33fbfa63e42f2f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Feb 2020 19:33:20 +0100 Subject: [PATCH 054/306] FIX Count of Stripe payment mode must take test/live into account --- htdocs/core/lib/company.lib.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index f108c5cc04f..3f7536368f1 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -208,6 +208,8 @@ function societe_prepare_head(Societe $object) $sql = "SELECT COUNT(n.rowid) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."societe_rib as n"; $sql .= " WHERE fk_soc = ".$object->id; + $sql .= " AND status = ".$servicestatus; + $resql = $db->query($sql); if ($resql) { From 0b891d5e0cc7251595e0b757b1bd5fb7af4390ff Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Feb 2020 19:33:20 +0100 Subject: [PATCH 055/306] FIX Count of Stripe payment mode must take test/live into account --- htdocs/core/lib/company.lib.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index f108c5cc04f..3f7536368f1 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -208,6 +208,8 @@ function societe_prepare_head(Societe $object) $sql = "SELECT COUNT(n.rowid) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."societe_rib as n"; $sql .= " WHERE fk_soc = ".$object->id; + $sql .= " AND status = ".$servicestatus; + $resql = $db->query($sql); if ($resql) { From 262d889700ac6fb2fb149c149799ccfedcce133e Mon Sep 17 00:00:00 2001 From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Date: Wed, 5 Feb 2020 08:50:51 +0100 Subject: [PATCH 056/306] Update box_project.php --- htdocs/core/boxes/box_project.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_project.php b/htdocs/core/boxes/box_project.php index 5e06e154987..d3670d05ee1 100644 --- a/htdocs/core/boxes/box_project.php +++ b/htdocs/core/boxes/box_project.php @@ -100,7 +100,7 @@ class box_project extends ModeleBoxes $sql = "SELECT p.rowid, p.ref, p.title, p.fk_statut, p.public"; $sql.= " FROM ".MAIN_DB_PREFIX."projet as p"; $sql.= " WHERE p.fk_statut = 1"; // Only open projects - $sql .= " AND entity IN (".getEntity('projet').")"; // Only current entity or severals if permission ok + $sql .= " AND entity IN (".getEntity('project').")"; // Only current entity or severals if permission ok if (! $user->rights->projet->all->lire) $sql.= " AND p.rowid IN (".$projectsListId.")"; // public and assigned to, or restricted to company for external users $sql.= " ORDER BY p.datec DESC"; From d5b74a8ca3d1fc210c0d60160cf8e2d42415f125 Mon Sep 17 00:00:00 2001 From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Date: Wed, 5 Feb 2020 09:06:43 +0100 Subject: [PATCH 057/306] Update box_project.php --- htdocs/core/boxes/box_project.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_project.php b/htdocs/core/boxes/box_project.php index d3670d05ee1..ca9618aab9a 100644 --- a/htdocs/core/boxes/box_project.php +++ b/htdocs/core/boxes/box_project.php @@ -100,7 +100,7 @@ class box_project extends ModeleBoxes $sql = "SELECT p.rowid, p.ref, p.title, p.fk_statut, p.public"; $sql.= " FROM ".MAIN_DB_PREFIX."projet as p"; $sql.= " WHERE p.fk_statut = 1"; // Only open projects - $sql .= " AND entity IN (".getEntity('project').")"; // Only current entity or severals if permission ok + $sql.= " WHERE entity IN (".getEntity('project').")"; // Only current entity or severals if permission ok if (! $user->rights->projet->all->lire) $sql.= " AND p.rowid IN (".$projectsListId.")"; // public and assigned to, or restricted to company for external users $sql.= " ORDER BY p.datec DESC"; From 81ed70ffc7ac61844088e1e664324e5fdacb8e78 Mon Sep 17 00:00:00 2001 From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Date: Wed, 5 Feb 2020 09:18:39 +0100 Subject: [PATCH 058/306] Update box_project.php --- htdocs/core/boxes/box_project.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/boxes/box_project.php b/htdocs/core/boxes/box_project.php index ca9618aab9a..071e4b013ec 100644 --- a/htdocs/core/boxes/box_project.php +++ b/htdocs/core/boxes/box_project.php @@ -99,8 +99,8 @@ class box_project extends ModeleBoxes $sql = "SELECT p.rowid, p.ref, p.title, p.fk_statut, p.public"; $sql.= " FROM ".MAIN_DB_PREFIX."projet as p"; - $sql.= " WHERE p.fk_statut = 1"; // Only open projects - $sql.= " WHERE entity IN (".getEntity('project').")"; // Only current entity or severals if permission ok + $sql.= " WHERE entity IN (".getEntity('project').")"; // Only current entity or severals if permission ok + $sql.= " AND p.fk_statut = 1"; // Only open projects if (! $user->rights->projet->all->lire) $sql.= " AND p.rowid IN (".$projectsListId.")"; // public and assigned to, or restricted to company for external users $sql.= " ORDER BY p.datec DESC"; From 373b4ca0d9a9121d08385645b7707245b517e403 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Feb 2020 10:59:32 +0100 Subject: [PATCH 059/306] Use constant --- htdocs/dav/dav.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/dav/dav.class.php b/htdocs/dav/dav.class.php index 7bb598135f3..145da542976 100644 --- a/htdocs/dav/dav.class.php +++ b/htdocs/dav/dav.class.php @@ -175,7 +175,7 @@ class CdavLib $caldata.="LAST-MODIFIED:".gmdate('Ymd\THis', strtotime($obj->lastupd))."Z\n"; $caldata.="DTSTAMP:".gmdate('Ymd\THis', strtotime($obj->lastupd))."Z\n"; if($obj->sourceuid=='') - $caldata.="UID:".$obj->id.'-ev-'.$calid.'-cal-'.CDAV_URI_KEY."\n"; + $caldata.="UID:".$obj->id.'-ev-'.$calid.'-cal-'.constant('CDAV_URI_KEY')."\n"; else $caldata.="UID:".$obj->sourceuid."\n"; $caldata.="SUMMARY:".$obj->label."\n"; @@ -277,7 +277,7 @@ class CdavLib { $calevents[] = array( 'calendardata' => $calendardata, - 'uri' => $obj->id.'-ev-'.CDAV_URI_KEY, + 'uri' => $obj->id.'-ev-'.constant('CDAV_URI_KEY'), 'lastmodified' => strtotime($obj->lastupd), 'etag' => '"'.md5($calendardata).'"', 'calendarid' => $calendarId, @@ -289,7 +289,7 @@ class CdavLib { $calevents[] = array( // 'calendardata' => $calendardata, not necessary because etag+size are present - 'uri' => $obj->id.'-ev-'.CDAV_URI_KEY, + 'uri' => $obj->id.'-ev-'.constant('CDAV_URI_KEY'), 'lastmodified' => strtotime($obj->lastupd), 'etag' => '"'.md5($calendardata).'"', 'calendarid' => $calendarId, From c3cf9e62b3bad4145fa1f145f9863e84c2b046df Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Wed, 5 Feb 2020 11:31:02 +0100 Subject: [PATCH 060/306] FIX links in products/services index --- htdocs/product/index.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/product/index.php b/htdocs/product/index.php index caeb5e5d873..246d50e5c3e 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -143,31 +143,31 @@ print ''; - $statProducts.= ''; + $statProducts.= ''; $statProducts.= ""; $statProducts.= ''; - $statProducts.= ''; + $statProducts.= ''; $statProducts.= ""; $statProducts.= ''; - $statProducts.= ''; + $statProducts.= ''; $statProducts.= ""; $statProducts.= ''; - $statProducts.= ''; + $statProducts.= ''; $statProducts.= ""; } if (! empty($conf->service->enabled)) { $statServices = ''; - $statServices.= ''; + $statServices.= ''; $statServices.= ""; $statServices.= ''; - $statServices.= ''; + $statServices.= ''; $statServices.= ""; $statServices.= ''; - $statServices.= ''; + $statServices.= ''; $statServices.= ""; $statServices.= ''; - $statServices.= ''; + $statServices.= ''; $statServices.= ""; } $total=0; From 94fd2b40c73448181ea035907f8fc9f7f09e5e8e Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Wed, 5 Feb 2020 12:04:27 +0100 Subject: [PATCH 061/306] new fix Count of Stripe payment mode must take test/live into account fix error message for if no stripe enabled https://github.com/Dolibarr/dolibarr/commit/0b891d5e0cc7251595e0b757b1bd5fb7af4390ff --- htdocs/core/lib/company.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 3f7536368f1..30fad0b9f8f 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -207,8 +207,8 @@ function societe_prepare_head(Societe $object) $sql = "SELECT COUNT(n.rowid) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."societe_rib as n"; - $sql .= " WHERE fk_soc = ".$object->id; - $sql .= " AND status = ".$servicestatus; + $sql .= " WHERE n.fk_soc = ".$object->id; + if (!empty($conf->stripe->enabled)) $sql .= " AND n.status = ".$servicestatus; $resql = $db->query($sql); if ($resql) From efcd4d0c632c0e792ac70370e4b0fa2c001fdb45 Mon Sep 17 00:00:00 2001 From: Tobias Sekan Date: Tue, 4 Feb 2020 09:00:31 +0100 Subject: [PATCH 062/306] Fix unset gender property in contact class --- htdocs/contact/class/contact.class.php | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 56ba2e24def..465dc4a1e16 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -988,19 +988,25 @@ class Contact extends CommonObject } + /** - * Set property ->gender from property ->civility_id + * Set the property "gender" of this class, based on the property "civility_id" + * or use property "civility_code" as fallback, when "civility_id" is not available. * * @return void */ public function setGenderFromCivility() { - unset($this->gender); - if (in_array($this->civility_id, array('MR'))) { - $this->gender = 'man'; - } elseif (in_array($this->civility_id, array('MME', 'MLE'))) { - $this->gender = 'woman'; - } + unset($this->gender); + + if (in_array($this->civility_id, array('MR')) || in_array($this->civility_code, array('MR'))) + { + $this->gender = 'man'; + } + elseif(in_array($this->civility_id, array('MME','MLE')) || in_array($this->civility_code, array('MME','MLE'))) + { + $this->gender = 'woman'; + } } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps From 63ba601906cb9e0fda349dd06f0968bc48f3330b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Feb 2020 12:39:00 +0100 Subject: [PATCH 063/306] Update box_project.php --- htdocs/core/boxes/box_project.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_project.php b/htdocs/core/boxes/box_project.php index 071e4b013ec..9b3920590d2 100644 --- a/htdocs/core/boxes/box_project.php +++ b/htdocs/core/boxes/box_project.php @@ -99,7 +99,7 @@ class box_project extends ModeleBoxes $sql = "SELECT p.rowid, p.ref, p.title, p.fk_statut, p.public"; $sql.= " FROM ".MAIN_DB_PREFIX."projet as p"; - $sql.= " WHERE entity IN (".getEntity('project').")"; // Only current entity or severals if permission ok + $sql.= " WHERE p.entity IN (".getEntity('project').")"; // Only current entity or severals if permission ok $sql.= " AND p.fk_statut = 1"; // Only open projects if (! $user->rights->projet->all->lire) $sql.= " AND p.rowid IN (".$projectsListId.")"; // public and assigned to, or restricted to company for external users From f8daed7f565b08c4bae34d544adda7d075a05068 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Feb 2020 12:49:56 +0100 Subject: [PATCH 064/306] Update company.lib.php --- htdocs/core/lib/company.lib.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 30fad0b9f8f..2e5583610db 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -208,8 +208,12 @@ function societe_prepare_head(Societe $object) $sql = "SELECT COUNT(n.rowid) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."societe_rib as n"; $sql .= " WHERE n.fk_soc = ".$object->id; - if (!empty($conf->stripe->enabled)) $sql .= " AND n.status = ".$servicestatus; - + if (empty($conf->stripe->enabled)) { + $sql .= " AND n.stripe_card_ref IS NULL"; + } else { + $sql .= " AND (n.stripe_card_ref IS NULL OR (n.stripe_card_ref IS NOT NULL AND n.status = ".$servicestatus."))"; + } + $resql = $db->query($sql); if ($resql) { From bd90cdf49230a20096e373eb8f37830f4190e2e2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Feb 2020 13:03:43 +0100 Subject: [PATCH 065/306] FIX #13023 --- htdocs/admin/reception_setup.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/reception_setup.php b/htdocs/admin/reception_setup.php index bd126d98341..312038d3fcc 100644 --- a/htdocs/admin/reception_setup.php +++ b/htdocs/admin/reception_setup.php @@ -234,7 +234,7 @@ foreach ($dirmodels as $reldir) { $file = substr($file, 0, dol_strlen($file) - 4); - require_once $dir.$file.'.php'; + require_once $dir.'/'.$file.'.php'; $module = new $file; From d35994e5db1a79ddea4babe94f466589f8b8a69a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Feb 2020 13:25:51 +0100 Subject: [PATCH 066/306] Update holiday.class.php --- htdocs/holiday/class/holiday.class.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 31723379314..78210d08bc9 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -1656,9 +1656,12 @@ class Holiday extends CommonObject { if ($type) { - // Si utilisateur de Dolibarr - - $sql = "SELECT DISTINCT u.rowid"; + // If user of Dolibarr + $sql = "SELECT"; + if (! empty($conf->multicompany->enabled) && ! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { + $sql .= " DISTINCT"; + } + $sql.= " u.rowid"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; if (! empty($conf->multicompany->enabled) && ! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) From c101c3dd55ec96f86e23c29618f6a1c4e0ef05ad Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Feb 2020 13:27:22 +0100 Subject: [PATCH 067/306] Update holiday.class.php --- htdocs/holiday/class/holiday.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 78210d08bc9..04ccf239766 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -1757,7 +1757,12 @@ class Holiday extends CommonObject // List for Dolibarr users if ($type) { - $sql = "SELECT DISTINCT u.rowid, u.lastname, u.firstname, u.gender, u.photo, u.employee, u.statut, u.fk_user"; + // If user of Dolibarr + $sql = "SELECT"; + if (! empty($conf->multicompany->enabled) && ! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { + $sql .= " DISTINCT"; + } + $sql = " u.rowid, u.lastname, u.firstname, u.gender, u.photo, u.employee, u.statut, u.fk_user"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; if (! empty($conf->multicompany->enabled) && ! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) From 9100b8a5486857f964b577e9c81d612ea6253317 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Feb 2020 13:41:10 +0100 Subject: [PATCH 068/306] FIX SQL request and phpunit --- htdocs/holiday/class/holiday.class.php | 2 +- test/phpunit/HolidayTest.php | 20 ++++++++------------ 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 66a118c744b..0c058313ad6 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -1712,7 +1712,7 @@ class Holiday extends CommonObject // We want only list of vacation balance for user ids $sql = "SELECT DISTINCT cpu.fk_user"; $sql.= " FROM ".MAIN_DB_PREFIX."holiday_users as cpu, ".MAIN_DB_PREFIX."user as u"; - $sql.= " WHERE cpu.fk_user = u.user"; + $sql.= " WHERE cpu.fk_user = u.rowid"; if ($filters) $sql.=$filters; $resql=$this->db->query($sql); diff --git a/test/phpunit/HolidayTest.php b/test/phpunit/HolidayTest.php index ce3312ba441..190496cf5bf 100644 --- a/test/phpunit/HolidayTest.php +++ b/test/phpunit/HolidayTest.php @@ -247,21 +247,17 @@ class HolidayTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - //$localobject->fetch($localobject->id); + $result = $localobject->fetchUsers(true, true, ''); + $this->assertNotEquals($result, -1); - /* - $result=$localobject->getNomUrl(1); - print __METHOD__." id=".$localobject->id." result=".$result."\n"; - $this->assertNotEquals($result, ''); + $result = $localobject->fetchUsers(true, false, ''); + $this->assertNotEquals($result, -1); - $result=$localobject->getFullAddress(1); - print __METHOD__." id=".$localobject->id." result=".$result."\n"; - $this->assertContains("New address\nNew zip New town\nBelgium", $result); + $result = $localobject->fetchUsers(false, true, ''); + $this->assertNotEquals($result, -1); - $localobject->info($localobject->id); - print __METHOD__." localobject->date_creation=".$localobject->date_creation."\n"; - $this->assertNotEquals($localobject->date_creation, ''); - */ + $result = $localobject->fetchUsers(false, false, ''); + $this->assertNotEquals($result, -1); return $localobject->id; } From db43b2d3ddbedba1a9d84d5ac8487cef58185c10 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Feb 2020 13:53:35 +0100 Subject: [PATCH 069/306] Fix unique key on llx_holiday_users --- htdocs/install/mysql/migration/11.0.0-12.0.0.sql | 4 ++++ htdocs/install/mysql/tables/llx_holiday_users.key.sql | 4 ++-- htdocs/install/mysql/tables/llx_holiday_users.sql | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql index 91b068a3fea..7c63be071c2 100644 --- a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql +++ b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql @@ -44,6 +44,10 @@ ALTER TABLE llx_commande_fournisseur_dispatch_extrafields ADD INDEX idx_commande -- For v12 +ALTER TABLE llx_holiday_users DROP INDEX uk_holiday_users; +ALTER TABLE llx_holiday_users ADD UNIQUE INDEX uk_holiday_users(fk_user, fk_type); + + -- Migration to the new regions (France) UPDATE llx_c_regions set nom = 'Centre-Val de Loire' WHERE fk_pays = 1 AND code_region = 24; insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (1, 27, '21231', 0, 'Bourgogne-Franche-Comté'); diff --git a/htdocs/install/mysql/tables/llx_holiday_users.key.sql b/htdocs/install/mysql/tables/llx_holiday_users.key.sql index 0a055b6006a..8ac7919e658 100644 --- a/htdocs/install/mysql/tables/llx_holiday_users.key.sql +++ b/htdocs/install/mysql/tables/llx_holiday_users.key.sql @@ -1,5 +1,5 @@ -- =================================================================== --- Copyright (C) 2017 Laurent Destailleur +-- Copyright (C) 2017-2020 Laurent Destailleur -- -- 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 @@ -16,4 +16,4 @@ -- -- =================================================================== -ALTER TABLE llx_holiday_users ADD UNIQUE INDEX uk_holiday_users(fk_user, fk_type, nb_holiday); +ALTER TABLE llx_holiday_users ADD UNIQUE INDEX uk_holiday_users(fk_user, fk_type); diff --git a/htdocs/install/mysql/tables/llx_holiday_users.sql b/htdocs/install/mysql/tables/llx_holiday_users.sql index 1d3bcbc9361..3f9a7e61d0a 100644 --- a/htdocs/install/mysql/tables/llx_holiday_users.sql +++ b/htdocs/install/mysql/tables/llx_holiday_users.sql @@ -1,5 +1,5 @@ -- =================================================================== --- Copyright (C) 2012-2015 Laurent Destailleur +-- Copyright (C) 2012-2020 Laurent Destailleur -- -- 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 @@ -14,6 +14,7 @@ -- You should have received a copy of the GNU General Public License -- along with this program. If not, see . -- +-- Table with remain quantity of holiday for each type of leave. -- =================================================================== CREATE TABLE llx_holiday_users From ddd1ca26b94748048079bfac32b85717250db179 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Feb 2020 14:04:19 +0100 Subject: [PATCH 070/306] CSS --- htdocs/core/lib/functions.lib.php | 3 ++- htdocs/theme/eldy/global.inc.php | 2 +- htdocs/theme/md/style.css.php | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 72f0d0f19e0..59c71e6b306 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4201,7 +4201,8 @@ function load_fiche_titre($titre, $morehtmlright = '', $picto = 'generic', $pict if ($picto == 'setup') $picto = 'generic'; $return .= "\n"; - $return .= '
'.img_picto('', $picto, 'class="hideonsmartphone valignmiddle pictotitle widthpictotitle"', $pictoisfullpath).''; - if ($picto && $titre) print img_picto('', $picto, 'class="hideonsmartphone valignmiddle opacityhigh pictotitle widthpictotitle"', $pictoisfullpath); print '
'.$titre; if (!empty($titre) && $savtotalnboflines >= 0 && (string) $savtotalnboflines != '') print ' ('.$totalnboflines.')'; print '
'.$langs->trans("Statistics").'product->enabled)) { $statProducts = '
'.$langs->trans("ProductsNotOnSell").''.round($prodser[0][0]).''.$langs->trans("ProductsNotOnSell").''.round($prodser[0][0]).'
'.$langs->trans("ProductsOnSaleOnly").''.round($prodser[0][1]).''.$langs->trans("ProductsOnSaleOnly").''.round($prodser[0][1]).'
'.$langs->trans("ProductsOnPurchaseOnly").''.round($prodser[0][2]).''.$langs->trans("ProductsOnPurchaseOnly").''.round($prodser[0][2]).'
'.$langs->trans("ProductsOnSellAndOnBuy").''.round($prodser[0][3]).''.$langs->trans("ProductsOnSellAndOnBuy").''.round($prodser[0][3]).'
'.$langs->trans("ServicesNotOnSell").''.round($prodser[1][0]).''.$langs->trans("ServicesNotOnSell").''.round($prodser[1][0]).'
'.$langs->trans("ServicesOnSaleOnly").''.round($prodser[1][1]).''.$langs->trans("ServicesOnSaleOnly").''.round($prodser[1][1]).'
'.$langs->trans("ServicesOnPurchaseOnly").''.round($prodser[1][2]).''.$langs->trans("ServicesOnPurchaseOnly").''.round($prodser[1][2]).'
'.$langs->trans("ServicesOnSellAndOnBuy").''.round($prodser[1][3]).''.$langs->trans("ServicesOnSellAndOnBuy").''.round($prodser[1][3]).'
'; // maring bottom must be same than into print_barre_list + $return .= '
'; // maring bottom must be same than into print_barre_list + $return .= ''; if ($picto) $return .= ''; $return .= ''; // Payment type (VIR, LIQ, ...) $labeltype = $langs->trans("PaymentType".$object->type_code) != ("PaymentType".$object->type_code) ? $langs->trans("PaymentType".$object->type_code) : $object->type_label; print ''; // Amount @@ -297,7 +297,7 @@ if (!empty($conf->banque->enabled)) print ''; print ''; print ''; print ''; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 59c71e6b306..1c4a55e6c09 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5345,10 +5345,10 @@ function get_default_localtax($thirdparty_seller, $thirdparty_buyer, $local, $id /** * Return yes or no in current language * - * @param string $yesno Value to test (1, 'yes', 'true' or 0, 'no', 'false') - * @param integer $case 1=Yes/No, 0=yes/no, 2=Disabled checkbox, 3=Disabled checkbox + Yes/No - * @param int $color 0=texte only, 1=Text is formated with a color font style ('ok' or 'error'), 2=Text is formated with 'ok' color. - * @return string HTML string + * @param string|int $yesno Value to test (1, 'yes', 'true' or 0, 'no', 'false') + * @param integer $case 1=Yes/No, 0=yes/no, 2=Disabled checkbox, 3=Disabled checkbox + Yes/No + * @param int $color 0=texte only, 1=Text is formated with a color font style ('ok' or 'error'), 2=Text is formated with 'ok' color. + * @return string HTML string */ function yn($yesno, $case = 1, $color = 0) { diff --git a/htdocs/langs/en_US/banks.lang b/htdocs/langs/en_US/banks.lang index c160b4ae1d2..e54239e9fb2 100644 --- a/htdocs/langs/en_US/banks.lang +++ b/htdocs/langs/en_US/banks.lang @@ -95,7 +95,7 @@ AddBankRecordLong=Add entry manually Conciliated=Reconciled ConciliatedBy=Reconciled by DateConciliating=Reconcile date -BankLineConciliated=Entry reconciled +BankLineConciliated=Entry reconciled with bank receipt Reconciled=Reconciled NotReconciled=Not reconciled CustomerInvoicePayment=Customer payment From 4f3cc8707778c9eab3ed832e1acad5735da76aca Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Feb 2020 19:23:00 +0100 Subject: [PATCH 084/306] FIX Confusion between 'bank reconciled' and 'accounted'. Show both data --- htdocs/compta/bank/class/account.class.php | 23 +++++++++++++++++----- htdocs/compta/paiement/card.php | 4 ++-- htdocs/core/lib/functions.lib.php | 8 ++++---- htdocs/langs/en_US/banks.lang | 2 +- 4 files changed, 25 insertions(+), 12 deletions(-) diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index b8acb7adc63..6fc0efbd6e0 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -2272,11 +2272,11 @@ class AccountLine extends CommonObject /** - * Return clicable name (with picto eventually) + * Return clickable name (with picto eventually) * * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto * @param int $maxlen Longueur max libelle - * @param string $option Option ('showall') + * @param string $option Option ('', 'showall', 'showconciliated', 'showconciliatedandaccounted'). Options may be slow. * @param int $notooltip 1=Disable tooltip * @return string Chaine avec URL */ @@ -2294,7 +2294,7 @@ class AccountLine extends CommonObject if ($withpicto != 2) $result .= ($this->ref ? $this->ref : $this->rowid); $result .= $linkend; - if ($option == 'showall' || $option == 'showconciliated') $result .= ' ('; + if ($option == 'showall' || $option == 'showconciliated' || $option == 'showconciliatedandaccounted') $result .= ' ('; if ($option == 'showall') { $result .= $langs->trans("BankAccount").': '; @@ -2304,12 +2304,25 @@ class AccountLine extends CommonObject $accountstatic->label = $this->bank_account_label; $result .= $accountstatic->getNomUrl(0).', '; } - if ($option == 'showall' || $option == 'showconciliated') + if ($option == 'showall' || $option == 'showconciliated' || $option == 'showconciliatedandaccounted') { $result .= $langs->trans("BankLineConciliated").': '; $result .= yn($this->rappro); } - if ($option == 'showall' || $option == 'showconciliated') $result .= ')'; + if ($option == 'showall' || $option == 'showconciliatedandaccounted') + { + $sql = "SELECT COUNT(rowid) as nb FROM ".MAIN_DB_PREFIX."accounting_bookkeeping WHERE doc_type = 'bank' AND fk_doc = ".$this->id; + $resql = $this->db->query($sql); + if ($resql) { + $obj = $this->db->fetch_object($resql); + if ($obj && $obj->nb) { + $result .= ' - '.$langs->trans("Accounted").': '.yn(1); + } else { + $result .= ' - '.$langs->trans("Accounted").': '.yn(0); + } + } + } + if ($option == 'showall' || $option == 'showconciliated' || $option == 'showconciliatedandaccounted') $result .= ')'; return $result; } diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php index edc76de0698..887fe2ec570 100644 --- a/htdocs/compta/paiement/card.php +++ b/htdocs/compta/paiement/card.php @@ -222,7 +222,7 @@ print ''; // Payment type (VIR, LIQ, ...) $labeltype = $langs->trans("PaymentType".$object->type_code) != ("PaymentType".$object->type_code) ? $langs->trans("PaymentType".$object->type_code) : $object->type_label; print ''; // Amount @@ -297,7 +297,7 @@ if (!empty($conf->banque->enabled)) print ''; print ''; print ''; print ''; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index a0db5c8333d..b05cc41ea5d 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5344,10 +5344,10 @@ function get_default_localtax($thirdparty_seller, $thirdparty_buyer, $local, $id /** * Return yes or no in current language * - * @param string $yesno Value to test (1, 'yes', 'true' or 0, 'no', 'false') - * @param integer $case 1=Yes/No, 0=yes/no, 2=Disabled checkbox, 3=Disabled checkbox + Yes/No - * @param int $color 0=texte only, 1=Text is formated with a color font style ('ok' or 'error'), 2=Text is formated with 'ok' color. - * @return string HTML string + * @param string|int $yesno Value to test (1, 'yes', 'true' or 0, 'no', 'false') + * @param integer $case 1=Yes/No, 0=yes/no, 2=Disabled checkbox, 3=Disabled checkbox + Yes/No + * @param int $color 0=texte only, 1=Text is formated with a color font style ('ok' or 'error'), 2=Text is formated with 'ok' color. + * @return string HTML string */ function yn($yesno, $case = 1, $color = 0) { diff --git a/htdocs/langs/en_US/banks.lang b/htdocs/langs/en_US/banks.lang index c160b4ae1d2..e54239e9fb2 100644 --- a/htdocs/langs/en_US/banks.lang +++ b/htdocs/langs/en_US/banks.lang @@ -95,7 +95,7 @@ AddBankRecordLong=Add entry manually Conciliated=Reconciled ConciliatedBy=Reconciled by DateConciliating=Reconcile date -BankLineConciliated=Entry reconciled +BankLineConciliated=Entry reconciled with bank receipt Reconciled=Reconciled NotReconciled=Not reconciled CustomerInvoicePayment=Customer payment From 1ef978ccc4a0eb21ecb649e15f11ff05d5fe0070 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Feb 2020 19:32:49 +0100 Subject: [PATCH 085/306] FIX #12966 --- htdocs/theme/md/style.css.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 65436182755..1681c48e4e1 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -923,7 +923,8 @@ div.fiche>form>div.div-table-responsive { flex-grow: 1; flex-shrink: 1; /* flex-basis: 140px; */ - min-width: 150px; + /* min-width: 150px; */ + width: 158px; justify-content: flex-start; align-self: flex-start; } From 98ac0428a57cb66d231d0cccb16f5c92b70a6243 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Feb 2020 20:37:49 +0100 Subject: [PATCH 086/306] Update conf.class.php --- htdocs/core/class/conf.class.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index fdc42848d78..df1dd945064 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -417,12 +417,6 @@ class Conf $this->supplier_invoice->multidir_temp = array($this->entity => $rootfortemp."/fournisseur/facture/temp"); $this->supplier_invoice->dir_output = $rootfordata."/fournisseur/facture"; // For backward compatibility $this->supplier_invoice->dir_temp = $rootfortemp."/fournisseur/facture/temp"; // For backward compatibility - - $this->supplierproposal=new stdClass(); - $this->supplierproposal->multidir_output = array($this->entity => $rootfordata."/supplier_proposal"); - $this->supplierproposal->multidir_temp = array($this->entity => $rootfortemp."/supplier_proposal/temp"); - $this->supplierproposal->dir_output = $rootfordata."/supplier_proposal"; // For backward compatibility - $this->supplierproposal->dir_temp = $rootfortemp."/supplier_proposal/temp"; // For backward compatibility } } From 3e73e97f244adcc62d8b78c716c05022d778791e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Feb 2020 20:39:38 +0100 Subject: [PATCH 087/306] Update conf.class.php --- htdocs/core/class/conf.class.php | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index df1dd945064..34429dd1dbe 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -404,19 +404,25 @@ class Conf // To prepare split of module fournisseur into fournisseur + supplier_order + supplier_invoice if (! empty($this->fournisseur->enabled) && empty($this->global->MAIN_USE_NEW_SUPPLIERMOD)) // By default, if module supplier is on, we set new properties { - $this->supplier_order=new stdClass(); - $this->supplier_order->enabled = 1; - $this->supplier_order->multidir_output = array($this->entity => $rootfordata."/fournisseur/commande"); - $this->supplier_order->multidir_temp = array($this->entity => $rootfortemp."/fournisseur/commande/temp"); - $this->supplier_order->dir_output = $rootfordata."/fournisseur/commande"; // For backward compatibility - $this->supplier_order->dir_temp = $rootfortemp."/fournisseur/commande/temp"; // For backward compatibility - - $this->supplier_invoice=new stdClass(); - $this->supplier_invoice->enabled = 1; - $this->supplier_invoice->multidir_output = array($this->entity => $rootfordata."/fournisseur/facture"); - $this->supplier_invoice->multidir_temp = array($this->entity => $rootfortemp."/fournisseur/facture/temp"); - $this->supplier_invoice->dir_output = $rootfordata."/fournisseur/facture"; // For backward compatibility - $this->supplier_invoice->dir_temp = $rootfortemp."/fournisseur/facture/temp"; // For backward compatibility + if (empty($this->global->MAIN_USE_NEW_SUPPLIERMOD)) // This can be set to 1 once modules purchase order and supplier invoice exists + { + $this->supplier_order=new stdClass(); + $this->supplier_order->enabled = 1; + $this->supplier_order->multidir_output = array($this->entity => $rootfordata."/fournisseur/commande"); + $this->supplier_order->multidir_temp = array($this->entity => $rootfortemp."/fournisseur/commande/temp"); + $this->supplier_order->dir_output = $rootfordata."/fournisseur/commande"; // For backward compatibility + $this->supplier_order->dir_temp = $rootfortemp."/fournisseur/commande/temp"; // For backward compatibility + } + + if (empty($this->global->MAIN_USE_NEW_SUPPLIERMOD)) // This can be set to 1 once modules purchase order and supplier invoice exists + { + $this->supplier_invoice=new stdClass(); + $this->supplier_invoice->enabled = 1; + $this->supplier_invoice->multidir_output = array($this->entity => $rootfordata."/fournisseur/facture"); + $this->supplier_invoice->multidir_temp = array($this->entity => $rootfortemp."/fournisseur/facture/temp"); + $this->supplier_invoice->dir_output = $rootfordata."/fournisseur/facture"; // For backward compatibility + $this->supplier_invoice->dir_temp = $rootfortemp."/fournisseur/facture/temp"; // For backward compatibility + } } } From 1ecef695f8ce23bd664f243d124276ca7fd81594 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 5 Feb 2020 19:40:22 +0000 Subject: [PATCH 088/306] Fixing style errors. --- htdocs/core/class/conf.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 34429dd1dbe..17f062038df 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -413,8 +413,8 @@ class Conf $this->supplier_order->dir_output = $rootfordata."/fournisseur/commande"; // For backward compatibility $this->supplier_order->dir_temp = $rootfortemp."/fournisseur/commande/temp"; // For backward compatibility } - - if (empty($this->global->MAIN_USE_NEW_SUPPLIERMOD)) // This can be set to 1 once modules purchase order and supplier invoice exists + + if (empty($this->global->MAIN_USE_NEW_SUPPLIERMOD)) // This can be set to 1 once modules purchase order and supplier invoice exists { $this->supplier_invoice=new stdClass(); $this->supplier_invoice->enabled = 1; From 7cc959e316dcf4962e1e984a97fae743a276b9b9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Feb 2020 20:42:03 +0100 Subject: [PATCH 089/306] Update conf.class.php --- htdocs/core/class/conf.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 17f062038df..632f2107765 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -449,6 +449,9 @@ class Conf $this->contrat->dir_temp = $rootfortemp."/contract/temp"; // Module bank + $this->bank->multidir_output = array($this->entity => $rootfordata."/bank"); + $this->bank->multidir_temp = array($this->entity => $rootfortemp."/bank/temp"); + // For backward compatibility $this->bank->dir_output = $rootfordata."/bank"; $this->bank->dir_temp = $rootfortemp."/bank/temp"; From 4a077406010d79b69d60d7754a25d832e4e77252 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Feb 2020 20:42:44 +0100 Subject: [PATCH 090/306] Update conf.class.php --- htdocs/core/class/conf.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 632f2107765..4f5602fc5ef 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -311,7 +311,7 @@ class Conf { if (! empty($this->$module->enabled)) { - foreach($dirs as $type => $name) + foreach($dirs as $type => $name) // $type is 'output' or 'temp' { $multidirname = 'multidir_'.$type; $dirname = 'dir_'.$type; From 8ab96447c757c44bb1b4c1925f98e2d278837d4a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Feb 2020 21:31:28 +0100 Subject: [PATCH 091/306] Page of permissions is cleaner now --- htdocs/admin/perms.php | 117 +++++++++++++++++++++++++++-------------- htdocs/user/perms.php | 18 ++++--- 2 files changed, 88 insertions(+), 47 deletions(-) diff --git a/htdocs/admin/perms.php b/htdocs/admin/perms.php index 1f811c325dd..6ad62242f6f 100644 --- a/htdocs/admin/perms.php +++ b/htdocs/admin/perms.php @@ -35,6 +35,8 @@ $action = GETPOST('action', 'aZ09'); if (!$user->admin) accessforbidden(); +$entity=$conf->entity; + /* * Actions @@ -70,14 +72,12 @@ print ''.$langs->trans("DefaultRightsDesc")." ".$lan $db->begin(); -// Charge les modules soumis a permissions +// Search all modules with permission and reload permissions def. $modules = array(); $modulesdir = dolGetModulesDirs(); foreach ($modulesdir as $dir) { - // Load modules attributes in arrays (name, numero, orders) from dir directory - //print $dir."\n
"; $handle = @opendir(dol_osencode($dir)); if (is_resource($handle)) { @@ -102,7 +102,7 @@ foreach ($modulesdir as $dir) // Load all permissions if ($objMod->rights_class) { - $ret = $objMod->insert_permissions(0); + $ret = $objMod->insert_permissions(0, $entity); $modules[$objMod->rights_class] = $objMod; //print "modules[".$objMod->rights_class."]=$objMod;"; } @@ -122,35 +122,58 @@ dol_fiche_head($head, 'default', $langs->trans("Security"), -1); // Show warning about external users print info_admin(showModulesExludedForExternal($modules)).'
'."\n"; +print "\n"; print '
'; print '
'.img_picto('', $picto, 'class="valignmiddle widthpictotitle pictotitle"', $pictoisfullpath).''; $return .= '
'.$titre.'
'; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 8e5fc838936..9f253073a6f 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -2432,7 +2432,7 @@ div.tabBar { width: auto; background: rgb(); } -div.tabBar div.titre { +div.tabBar tr.titre td { padding-top: 20px; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 808e565285e..85cdc1c48b0 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -2572,7 +2572,8 @@ div.tabBar { background: rgb(); border-bottom: 1px solid #aaa; } -div.tabBar div.titre { + +div.tabBar tr.titre td { padding-top: 10px; } From a36cf1f86beb63cfe5bda715885bc06bce8ebfd9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Feb 2020 14:08:13 +0100 Subject: [PATCH 071/306] Fix phpunit --- htdocs/holiday/class/holiday.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 1bbeb869995..25f1d9675bb 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -1762,7 +1762,7 @@ class Holiday extends CommonObject if (! empty($conf->multicompany->enabled) && ! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { $sql .= " DISTINCT"; } - $sql = " u.rowid, u.lastname, u.firstname, u.gender, u.photo, u.employee, u.statut, u.fk_user"; + $sql.= " u.rowid, u.lastname, u.firstname, u.gender, u.photo, u.employee, u.statut, u.fk_user"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; if (! empty($conf->multicompany->enabled) && ! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) From 220f02805d0f8a9cc2b0062bff527e131f96c56e Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Sun, 2 Feb 2020 21:02:43 +0100 Subject: [PATCH 072/306] Update image path after move image directory We need change path after move image in the commit: https://github.com/Dolibarr/dolibarr/commit/de4183ea6552e917ac33f8416f784340966f2a8d#diff-7af3f43d430a17d6e548d766fbacecc2 Conflicts: htdocs/core/class/dolreceiptprinter.class.php --- htdocs/core/class/dolreceiptprinter.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/dolreceiptprinter.class.php b/htdocs/core/class/dolreceiptprinter.class.php index 1d445614981..ba46419d39c 100644 --- a/htdocs/core/class/dolreceiptprinter.class.php +++ b/htdocs/core/class/dolreceiptprinter.class.php @@ -514,7 +514,7 @@ class dolReceiptPrinter extends Printer { global $conf; $error = 0; - $img = EscposImage::load(DOL_DOCUMENT_ROOT .'/theme/common/dolibarr_logo_bw.png'); + $img = EscposImage::load(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo_bw.png'); //$this->profile = CapabilityProfile::load("TM-T88IV"); $ret = $this->initPrinter($printerid); if ($ret>0) { From c015707cbc0add5467044cbfd87d37240eb3aa3e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Feb 2020 14:14:59 +0100 Subject: [PATCH 073/306] Fix Only dolibarr logos are in root of theme --- htdocs/core/lib/security2.lib.php | 2 +- htdocs/core/lib/ticket.lib.php | 2 +- htdocs/public/members/new.php | 2 +- htdocs/theme/{ => common}/login_logo.png | Bin htdocs/user/passwordforgotten.php | 2 +- 5 files changed, 4 insertions(+), 4 deletions(-) rename htdocs/theme/{ => common}/login_logo.png (100%) diff --git a/htdocs/core/lib/security2.lib.php b/htdocs/core/lib/security2.lib.php index 8d3adfa2df7..18d1e9c680a 100644 --- a/htdocs/core/lib/security2.lib.php +++ b/htdocs/core/lib/security2.lib.php @@ -221,7 +221,7 @@ if (! function_exists('dol_loginfunction')) // Show logo (search in order: small company logo, large company logo, theme logo, common logo) $width=0; - $urllogo=DOL_URL_ROOT.'/theme/login_logo.png'; + $urllogo=DOL_URL_ROOT.'/theme/common/login_logo.png'; if (! empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) { diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php index b7c741bd839..fe7fb4ba5a7 100644 --- a/htdocs/core/lib/ticket.lib.php +++ b/htdocs/core/lib/ticket.lib.php @@ -222,7 +222,7 @@ function llxHeaderTicket($title, $head = "", $disablejs = 0, $disablehead = 0, $ // Print logo if (! empty($conf->global->TICKET_SHOW_COMPANY_LOGO)) { - $urllogo = DOL_URL_ROOT . '/theme/login_logo.png'; + $urllogo = DOL_URL_ROOT . '/theme/common/login_logo.png'; if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output . '/logos/thumbs/' . $mysoc->logo_small)) { $urllogo = DOL_URL_ROOT . '/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file=' . urlencode('logos/thumbs/'.$mysoc->logo_small); diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index 0649a937822..5b456893bf9 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -101,7 +101,7 @@ function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $ // Define urllogo $width = 0; - $urllogo = DOL_URL_ROOT.'/theme/login_logo.png'; + $urllogo = DOL_URL_ROOT.'/theme/common/login_logo.png'; if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) { diff --git a/htdocs/theme/login_logo.png b/htdocs/theme/common/login_logo.png similarity index 100% rename from htdocs/theme/login_logo.png rename to htdocs/theme/common/login_logo.png diff --git a/htdocs/user/passwordforgotten.php b/htdocs/user/passwordforgotten.php index 62509b3e6cb..461ab8e7b4a 100644 --- a/htdocs/user/passwordforgotten.php +++ b/htdocs/user/passwordforgotten.php @@ -178,7 +178,7 @@ if (!empty($conf->global->MAIN_SECURITY_ENABLE_SENDPASSWORD)) $disabled = ''; // // Show logo (search in order: small company logo, large company logo, theme logo, common logo) $width = 0; $rowspan = 2; -$urllogo = DOL_URL_ROOT.'/theme/login_logo.png'; +$urllogo = DOL_URL_ROOT.'/theme/common/login_logo.png'; if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) { $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small); From eca001677817eedb36259cba2fa60dfd3f2e15c8 Mon Sep 17 00:00:00 2001 From: Tobias Sekan Date: Mon, 3 Feb 2020 09:50:44 +0100 Subject: [PATCH 074/306] Fix wrong category name on user category card --- htdocs/categories/viewcat.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 2b96b293f2d..e5755edd40b 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -207,7 +207,7 @@ elseif ($type == Categorie::TYPE_MEMBER) $title = $langs->trans("MembersCateg elseif ($type == Categorie::TYPE_CONTACT) $title = $langs->trans("ContactCategoriesShort"); elseif ($type == Categorie::TYPE_ACCOUNT) $title = $langs->trans("AccountsCategoriesShort"); elseif ($type == Categorie::TYPE_PROJECT) $title = $langs->trans("ProjectsCategoriesShort"); -elseif ($type == Categorie::TYPE_USER) $title = $langs->trans("ProjectsCategoriesShort"); +elseif ($type == Categorie::TYPE_USER) $title = $langs->trans("UsersCategoriesShort"); else $title = $langs->trans("Category"); $head = categories_prepare_head($object, $type); From a2bb64354baa08a3288f0b953a86f00013e1b6b3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Feb 2020 14:56:01 +0100 Subject: [PATCH 075/306] Fix bad merge --- htdocs/core/modules/facture/doc/pdf_sponge.modules.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 20506c637ee..60d4650921b 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -651,16 +651,11 @@ class pdf_sponge extends ModelePDFFactures else { // We found a page break -<<<<<<< HEAD - $showpricebeforepagebreak = 0; -======= - // Allows data in the first page if description is long enough to break in multiples pages if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; ->>>>>>> branch '11.0' of git@github.com:Dolibarr/dolibarr.git } } else // No pagebreak From eb17a5202757d91d018b346bc6fe8b5d40c39dd6 Mon Sep 17 00:00:00 2001 From: Florian Mortgat Date: Wed, 5 Feb 2020 14:57:40 +0100 Subject: [PATCH 076/306] FIX 11.0 - default filtering for extrafields of type 'select' should not use a LIKE "%value%" condition because keys might overlap --- htdocs/core/tpl/extrafields_list_search_sql.tpl.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/core/tpl/extrafields_list_search_sql.tpl.php b/htdocs/core/tpl/extrafields_list_search_sql.tpl.php index 29c67094975..3a0bcf6375c 100644 --- a/htdocs/core/tpl/extrafields_list_search_sql.tpl.php +++ b/htdocs/core/tpl/extrafields_list_search_sql.tpl.php @@ -40,7 +40,10 @@ if (! empty($extrafieldsobjectkey) && ! empty($search_array_options) && is_array if (in_array($typ, array('sellist','link')) && $crit != '0' && $crit != '-1') $mode_search=2; // Search on a foreign key int if (in_array($typ, array('chkbxlst','checkbox'))) $mode_search=4; // Search on a multiselect field with sql type = text if (is_array($crit)) $crit = implode(' ', $crit); // natural_search() expects a string - + elseif ($typ === 'select' and is_string($crit) and strpos($crit, ' ') === false) { + $sql .= ' AND (' . $extrafieldsobjectprefix.$tmpkey . ' = "' . $db->escape($crit) . '")'; + continue; + } $sql .= natural_search($extrafieldsobjectprefix.$tmpkey, $crit, $mode_search); } } From fdfc45bbe978afa2e7c460749304e6fa30282c2f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Feb 2020 15:04:11 +0100 Subject: [PATCH 077/306] Fix wrapping --- htdocs/core/class/commondocgenerator.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 9d08480246b..dc4cbeff1ac 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -1090,9 +1090,9 @@ abstract class CommonDocGenerator if (!$reshook) { if (empty($columnText)) return; - $pdf->SetXY($this->getColumnContentXStart($colKey), $curY); // Set curent position + $pdf->SetXY($this->getColumnContentXStart($colKey) - 1, $curY); // Set curent position $colDef = $this->cols[$colKey]; - $pdf->writeHTMLCell($this->getColumnContentWidth($colKey), 2, $this->getColumnContentXStart($colKey), $curY, $columnText, 0, 0, 0, true, $colDef['content']['align']); + $pdf->writeHTMLCell($this->getColumnContentWidth($colKey) + 2, 2, $this->getColumnContentXStart($colKey) - 1, $curY, $columnText, 0, 0, 0, true, $colDef['content']['align']); } } From e81bcbde318831703531bca1aa45a27bb90cdf97 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Feb 2020 16:08:00 +0100 Subject: [PATCH 078/306] FIX export ledger --- htdocs/accountancy/class/accountancyexport.class.php | 2 +- htdocs/accountancy/tpl/export_journal.tpl.php | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index d945513f952..46d3feae5b2 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -125,7 +125,7 @@ class AccountancyExport * @param int $type Format id * @return string Format code */ - private static function getFormatCode($type) + public static function getFormatCode($type) { $formatcode = array( self::$EXPORT_TYPE_CONFIGURABLE => 'csv', diff --git a/htdocs/accountancy/tpl/export_journal.tpl.php b/htdocs/accountancy/tpl/export_journal.tpl.php index 0dec55630d3..4537c497ff6 100644 --- a/htdocs/accountancy/tpl/export_journal.tpl.php +++ b/htdocs/accountancy/tpl/export_journal.tpl.php @@ -34,8 +34,10 @@ $endaccountingperiod = dol_print_date(dol_now(), '%Y%m%d'); header('Content-Type: text/csv'); +include_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancyexport.class.php'; +$accountancyexport = new AccountancyExport($db); -if ($this->getFormatCode($formatexportset) == "fec" && $type_export == "general_ledger") // Specific filename for FEC model export into the general ledger +if ($accountancyexport->getFormatCode($formatexportset) == $accountancyexport::$EXPORT_TYPE_FEC && $type_export == "general_ledger") // Specific filename for FEC model export into the general ledger { // FEC format is defined here: https://www.legifrance.gouv.fr/affichCodeArticle.do?idArticle=LEGIARTI000027804775&cidTexte=LEGITEXT000006069583&dateTexte=20130802&oldAction=rechCodeArticle if (empty($search_date_end)) From 2e0929c2e9f9a1e3b4040133224dff1b97b706f8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Feb 2020 16:08:00 +0100 Subject: [PATCH 079/306] FIX export ledger --- htdocs/accountancy/class/accountancyexport.class.php | 2 +- htdocs/accountancy/tpl/export_journal.tpl.php | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index d945513f952..46d3feae5b2 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -125,7 +125,7 @@ class AccountancyExport * @param int $type Format id * @return string Format code */ - private static function getFormatCode($type) + public static function getFormatCode($type) { $formatcode = array( self::$EXPORT_TYPE_CONFIGURABLE => 'csv', diff --git a/htdocs/accountancy/tpl/export_journal.tpl.php b/htdocs/accountancy/tpl/export_journal.tpl.php index 0dec55630d3..4537c497ff6 100644 --- a/htdocs/accountancy/tpl/export_journal.tpl.php +++ b/htdocs/accountancy/tpl/export_journal.tpl.php @@ -34,8 +34,10 @@ $endaccountingperiod = dol_print_date(dol_now(), '%Y%m%d'); header('Content-Type: text/csv'); +include_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancyexport.class.php'; +$accountancyexport = new AccountancyExport($db); -if ($this->getFormatCode($formatexportset) == "fec" && $type_export == "general_ledger") // Specific filename for FEC model export into the general ledger +if ($accountancyexport->getFormatCode($formatexportset) == $accountancyexport::$EXPORT_TYPE_FEC && $type_export == "general_ledger") // Specific filename for FEC model export into the general ledger { // FEC format is defined here: https://www.legifrance.gouv.fr/affichCodeArticle.do?idArticle=LEGIARTI000027804775&cidTexte=LEGITEXT000006069583&dateTexte=20130802&oldAction=rechCodeArticle if (empty($search_date_end)) From 44ed5980f5af7981e776cf33d731857127b0fbec Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Feb 2020 16:30:39 +0100 Subject: [PATCH 080/306] FIX Avoid deletion of bank record if in accounting --- htdocs/compta/bank/bankentries_list.php | 7 ++++++- htdocs/compta/bank/class/account.class.php | 24 +++++++++++++++++++++- htdocs/langs/en_US/errors.lang | 1 + 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index db9f9443f0e..297f0dd91d4 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -353,8 +353,13 @@ if (GETPOST('save') && !$cancel && $user->rights->banque->modifier) if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->banque->modifier) { $accline = new AccountLine($db); - $result = $accline->fetch(GETPOST("rowid")); + $result = $accline->fetch(GETPOST("rowid", "int")); $result = $accline->delete($user); + if ($result <= 0) { + setEventMessages($accline->error, $accline->errors, 'errors'); + } else { + setEventMessages('RecordDeleted', null, 'mesgs'); + } } diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 594cad56ea0..b8acb7adc63 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -1883,13 +1883,15 @@ class AccountLine extends CommonObject } /** - * Delete transaction bank line record + * Delete bank transaction record * * @param User $user User object that delete * @return int <0 if KO, >0 if OK */ public function delete(User $user = null) { + global $conf; + $nbko = 0; if ($this->rappro) @@ -1901,6 +1903,26 @@ class AccountLine extends CommonObject $this->db->begin(); + // Protection to avoid any delete of accounted lines. Protection on by default + if (empty($conf->global->BANK_ALLOW_TRANSACTION_DELETION_EVEN_IF_IN_ACCOUNTING)) + { + $sql = "SELECT COUNT(rowid) as nb FROM ".MAIN_DB_PREFIX."accounting_bookkeeping WHERE doc_type = 'bank' AND fk_doc = ".$this->id; + $resql = $this->db->query($sql); + if ($resql) { + $obj = $this->db->fetch_object($resql); + if ($obj && $obj->nb) { + $this->error = 'ErrorRecordAlreadyInAccountingDeletionNotPossible'; + $this->db->rollback(); + return -1; + } + } + else { + $this->error = $this->db->lasterror(); + $this->db->rollback(); + return -1; + } + } + // Delete urls $result = $this->delete_urls($user); if ($result < 0) diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 4edca737c66..525131b2a61 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -227,6 +227,7 @@ ErrorNoFieldWithAttributeShowoncombobox=No fields has property 'showoncombobox' ErrorFieldRequiredForProduct=Field '%s' is required for product %s ProblemIsInSetupOfTerminal=Problem is in setup of terminal %s. ErrorAddAtLeastOneLineFirst=Add at least one line first +ErrorRecordAlreadyInAccountingDeletionNotPossible=Error, record is already transferred in accounting, deletion is not possible. # Warnings WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup. WarningPasswordSetWithNoAccount=A password was set for this member. However, no user account was created. So this password is stored but can't be used to login to Dolibarr. It may be used by an external module/interface but if you don't need to define any login nor password for a member, you can disable option "Manage a login for each member" from Member module setup. If you need to manage a login but don't need any password, you can keep this field empty to avoid this warning. Note: Email can also be used as a login if the member is linked to a user. From f3e27695e23a6740898a8e03bbbf05e3cd684fe8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Feb 2020 16:30:39 +0100 Subject: [PATCH 081/306] FIX Avoid deletion of bank record if in accounting --- htdocs/compta/bank/bankentries_list.php | 7 ++++++- htdocs/compta/bank/class/account.class.php | 24 +++++++++++++++++++++- htdocs/langs/en_US/errors.lang | 1 + 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index db9f9443f0e..297f0dd91d4 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -353,8 +353,13 @@ if (GETPOST('save') && !$cancel && $user->rights->banque->modifier) if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->banque->modifier) { $accline = new AccountLine($db); - $result = $accline->fetch(GETPOST("rowid")); + $result = $accline->fetch(GETPOST("rowid", "int")); $result = $accline->delete($user); + if ($result <= 0) { + setEventMessages($accline->error, $accline->errors, 'errors'); + } else { + setEventMessages('RecordDeleted', null, 'mesgs'); + } } diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 594cad56ea0..b8acb7adc63 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -1883,13 +1883,15 @@ class AccountLine extends CommonObject } /** - * Delete transaction bank line record + * Delete bank transaction record * * @param User $user User object that delete * @return int <0 if KO, >0 if OK */ public function delete(User $user = null) { + global $conf; + $nbko = 0; if ($this->rappro) @@ -1901,6 +1903,26 @@ class AccountLine extends CommonObject $this->db->begin(); + // Protection to avoid any delete of accounted lines. Protection on by default + if (empty($conf->global->BANK_ALLOW_TRANSACTION_DELETION_EVEN_IF_IN_ACCOUNTING)) + { + $sql = "SELECT COUNT(rowid) as nb FROM ".MAIN_DB_PREFIX."accounting_bookkeeping WHERE doc_type = 'bank' AND fk_doc = ".$this->id; + $resql = $this->db->query($sql); + if ($resql) { + $obj = $this->db->fetch_object($resql); + if ($obj && $obj->nb) { + $this->error = 'ErrorRecordAlreadyInAccountingDeletionNotPossible'; + $this->db->rollback(); + return -1; + } + } + else { + $this->error = $this->db->lasterror(); + $this->db->rollback(); + return -1; + } + } + // Delete urls $result = $this->delete_urls($user); if ($result < 0) diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 4edca737c66..525131b2a61 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -227,6 +227,7 @@ ErrorNoFieldWithAttributeShowoncombobox=No fields has property 'showoncombobox' ErrorFieldRequiredForProduct=Field '%s' is required for product %s ProblemIsInSetupOfTerminal=Problem is in setup of terminal %s. ErrorAddAtLeastOneLineFirst=Add at least one line first +ErrorRecordAlreadyInAccountingDeletionNotPossible=Error, record is already transferred in accounting, deletion is not possible. # Warnings WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup. WarningPasswordSetWithNoAccount=A password was set for this member. However, no user account was created. So this password is stored but can't be used to login to Dolibarr. It may be used by an external module/interface but if you don't need to define any login nor password for a member, you can disable option "Manage a login for each member" from Member module setup. If you need to manage a login but don't need any password, you can keep this field empty to avoid this warning. Note: Email can also be used as a login if the member is linked to a user. From 80f4e625bef47319c7020d5acac11e847828b54f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Feb 2020 17:07:42 +0100 Subject: [PATCH 082/306] Fix phpcs --- htdocs/core/lib/company.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 2e5583610db..a3771d53cff 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -213,7 +213,7 @@ function societe_prepare_head(Societe $object) } else { $sql .= " AND (n.stripe_card_ref IS NULL OR (n.stripe_card_ref IS NOT NULL AND n.status = ".$servicestatus."))"; } - + $resql = $db->query($sql); if ($resql) { From 30fa8940a99a6936c04fd193542ecd5f636598fb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Feb 2020 19:23:00 +0100 Subject: [PATCH 083/306] FIX Confusion between 'bank reconciled' and 'accounted'. Show both data --- htdocs/compta/bank/class/account.class.php | 23 +++++++++++++++++----- htdocs/compta/paiement/card.php | 4 ++-- htdocs/core/lib/functions.lib.php | 8 ++++---- htdocs/langs/en_US/banks.lang | 2 +- 4 files changed, 25 insertions(+), 12 deletions(-) diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index b8acb7adc63..6fc0efbd6e0 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -2272,11 +2272,11 @@ class AccountLine extends CommonObject /** - * Return clicable name (with picto eventually) + * Return clickable name (with picto eventually) * * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto * @param int $maxlen Longueur max libelle - * @param string $option Option ('showall') + * @param string $option Option ('', 'showall', 'showconciliated', 'showconciliatedandaccounted'). Options may be slow. * @param int $notooltip 1=Disable tooltip * @return string Chaine avec URL */ @@ -2294,7 +2294,7 @@ class AccountLine extends CommonObject if ($withpicto != 2) $result .= ($this->ref ? $this->ref : $this->rowid); $result .= $linkend; - if ($option == 'showall' || $option == 'showconciliated') $result .= ' ('; + if ($option == 'showall' || $option == 'showconciliated' || $option == 'showconciliatedandaccounted') $result .= ' ('; if ($option == 'showall') { $result .= $langs->trans("BankAccount").': '; @@ -2304,12 +2304,25 @@ class AccountLine extends CommonObject $accountstatic->label = $this->bank_account_label; $result .= $accountstatic->getNomUrl(0).', '; } - if ($option == 'showall' || $option == 'showconciliated') + if ($option == 'showall' || $option == 'showconciliated' || $option == 'showconciliatedandaccounted') { $result .= $langs->trans("BankLineConciliated").': '; $result .= yn($this->rappro); } - if ($option == 'showall' || $option == 'showconciliated') $result .= ')'; + if ($option == 'showall' || $option == 'showconciliatedandaccounted') + { + $sql = "SELECT COUNT(rowid) as nb FROM ".MAIN_DB_PREFIX."accounting_bookkeeping WHERE doc_type = 'bank' AND fk_doc = ".$this->id; + $resql = $this->db->query($sql); + if ($resql) { + $obj = $this->db->fetch_object($resql); + if ($obj && $obj->nb) { + $result .= ' - '.$langs->trans("Accounted").': '.yn(1); + } else { + $result .= ' - '.$langs->trans("Accounted").': '.yn(0); + } + } + } + if ($option == 'showall' || $option == 'showconciliated' || $option == 'showconciliatedandaccounted') $result .= ')'; return $result; } diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php index edc76de0698..887fe2ec570 100644 --- a/htdocs/compta/paiement/card.php +++ b/htdocs/compta/paiement/card.php @@ -222,7 +222,7 @@ print '
'.$langs->trans('PaymentMode').''.$labeltype; -print $object->num_paiement ? ' - '.$object->num_paiement : ''; +print $object->num_payment? ' - '.$object->num_payment : ''; print '
'.$langs->trans('BankTransactionLine').''; - print $bankline->getNomUrl(1, 0, 'showconciliated'); + print $bankline->getNomUrl(1, 0, 'showconciliatedandaccounted'); print '
'.$langs->trans('PaymentMode').''.$labeltype; -print $object->num_paiement ? ' - '.$object->num_paiement : ''; +print $object->num_payment? ' - '.$object->num_payment : ''; print '
'.$langs->trans('BankTransactionLine').''; - print $bankline->getNomUrl(1, 0, 'showconciliated'); + print $bankline->getNomUrl(1, 0, 'showconciliatedandaccounted'); print '
'; -// Show permissions lines -$sql = "SELECT r.id, r.libelle, r.module, r.perms, r.subperms, r.bydefault"; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''."\n"; + +//print "xx".$conf->global->MAIN_USE_ADVANCED_PERMS; +$sql = "SELECT r.id, r.libelle as label, r.module, r.module_position, r.perms, r.subperms, r.bydefault"; $sql .= " FROM ".MAIN_DB_PREFIX."rights_def as r"; $sql .= " WHERE r.libelle NOT LIKE 'tou%'"; // On ignore droits "tous" -$sql .= " AND entity = ".$conf->entity; +$sql .= " AND r.entity = ".$entity; if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) $sql .= " AND r.perms NOT LIKE '%_advance'"; // Hide advanced perms if option is not enabled -$sql .= " ORDER BY r.module, r.id"; +$sql .= " ORDER BY r.family_position, r.module_position, r.module, r.id"; $result = $db->query($sql); if ($result) { $num = $db->num_rows($result); $i = 0; - $oldmod = ""; + $oldmod = ''; while ($i < $num) { $obj = $db->fetch_object($result); - // Si la ligne correspond a un module qui n'existe plus (absent de includes/module), on l'ignore - if (!$modules[$obj->module]) + // If line is for a module that doe snot existe anymore (absent of includes/module), we ignore it + if (empty($modules[$obj->module])) { $i++; continue; } + // Save field module_position in database if value is still zero + if (empty($obj->module_position)) + { + if (is_object($modules[$obj->module]) && ($modules[$obj->module]->module_position > 0)) + { + // TODO Define familyposition + $family = $modules[$obj->module]->family_position; + $familyposition = 0; + $sqlupdate = 'UPDATE '.MAIN_DB_PREFIX."rights_def SET module_position = ".$modules[$obj->module]->module_position.","; + $sqlupdate.= " family_position = ".$familyposition; + $sqlupdate.= " WHERE module_position = 0 AND module = '".$db->escape($obj->module)."'"; + $db->query($sqlupdate); + } + } + // Check if permission we found is inside a module definition. If not, we discard it. $found = false; foreach ($modules[$obj->module]->rights as $key => $val) @@ -169,49 +192,65 @@ if ($result) } // Break found, it's a new module to catch - if ($oldmod <> $obj->module) + if (isset($obj->module) && ($oldmod <> $obj->module)) { $oldmod = $obj->module; + + // Break detected, we get objMod $objMod = $modules[$obj->module]; $picto = ($objMod->picto ? $objMod->picto : 'generic'); - print ''; - print ''; - print ''; - print ''; - print ''; - print "\n"; + // Show break line + print ''; + print ''; + print ''; + print ''; + print ''; + print ''."\n"; } - + $perm_libelle = ($conf->global->MAIN_USE_ADVANCED_PERMS && ($langs->trans("PermissionAdvanced".$obj->id) != ("PermissionAdvanced".$obj->id)) ? $langs->trans("PermissionAdvanced".$obj->id) : (($langs->trans("Permission".$obj->id) != ("Permission".$obj->id)) ? $langs->trans("Permission".$obj->id) : $obj->label)); + print ''; - print ''; - $perm_libelle = ($conf->global->MAIN_USE_ADVANCED_PERMS && ($langs->trans("PermissionAdvanced".$obj->id) != ("PermissionAdvanced".$obj->id)) ? $langs->trans("PermissionAdvanced".$obj->id) : (($langs->trans("Permission".$obj->id) != ("Permission".$obj->id)) ? $langs->trans("Permission".$obj->id) : $obj->libelle)); + // Tick + if ($obj->bydefault == 1) + { + print ''; + print ''; + } + else + { + print ''; + print ''; + } + + // Permission and tick print ''; - print ''; + print ''."\n"; + $i++; } } - +else dol_print_error($db); print '
'.$langs->trans("Module").' '.$langs->trans("Default").''.$langs->trans("Permissions").'
'.$langs->trans("Module").''.$langs->trans("Permission").''.$langs->trans("Default").' 
'; + print img_object('', $picto, 'class="pictoobjectwidth"').' '.$objMod->getName(); + print ''; + print '   
'; - print img_object('', $picto, 'class="pictoobjectwidth"').' '.$objMod->getName(); - print ' '; + + // Picto and label of module + print ''; + //print img_object('', $picto, 'class="pictoobjectwidth"').' '.$objMod->getName(); + //print ' '; print ''; + print ''.img_edit_remove().''; + print ''; + print img_picto($langs->trans("Active"), 'tick'); + print ''; + print ''.img_edit_add().''; + print ''; + print ' '; + print ''.$perm_libelle.''; - if ($obj->bydefault == 1) - { - print img_picto($langs->trans("Active"), 'tick'); - print ''; - print ''.img_edit_remove().''; - } - else - { - print ' '; - print ''; - print ''.img_edit_add().''; - } - - print '
'; print ''; diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index 62070e3b31e..05814f4b832 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -77,7 +77,7 @@ $entity=$conf->entity; $hookmanager->initHooks(array('usercard','userperms','globalcard')); -/** +/* * Actions */ @@ -128,7 +128,7 @@ if (empty($reshook)) { } -/** +/* * View */ @@ -175,7 +175,7 @@ foreach($modulesdir as $dir) // Load all permissions if ($objMod->rights_class) { - $ret=$objMod->insert_permissions(0, $entity); + $ret = $objMod->insert_permissions(0, $entity); $modules[$objMod->rights_class]=$objMod; //print "modules[".$objMod->rights_class."]=$objMod;"; } @@ -271,8 +271,9 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e print "\n"; -print '
'; -print ''; +print '
'; +print '
'; + print ''; print ''; if (($caneditperms && empty($objMod->rights_admin_allowed)) || empty($object->admin)) @@ -295,7 +296,7 @@ $sql = "SELECT r.id, r.libelle as label, r.module, r.module_position"; $sql.= " FROM ".MAIN_DB_PREFIX."rights_def as r"; $sql.= " WHERE r.libelle NOT LIKE 'tou%'"; // On ignore droits "tous" $sql.= " AND r.entity = " . $entity; -if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) $sql.= " AND r.perms NOT LIKE '%_advance'"; // Hide advanced perms if option is disable +if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) $sql.= " AND r.perms NOT LIKE '%_advance'"; // Hide advanced perms if option is not enabled $sql.= " ORDER BY r.family_position, r.module_position, r.module, r.id"; $result=$db->query($sql); @@ -370,7 +371,9 @@ if ($result) print ''; // Picto and label of module - print ''; + print ''; // Permission and tick if (! empty($object->admin) && ! empty($objMod->rights_admin_allowed)) // Permission granted because admin @@ -393,7 +396,6 @@ if ($result) print img_picto($langs->trans("Active"), 'tick'); print ''; } - elseif (is_array($permsgroupbyentity[$entity])) { if (in_array($obj->id, $permsgroupbyentity[$entity])) // Permission granted by group From 66590cca1029a972779f3c8ebeef4837e2cf2ba3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Feb 2020 21:40:49 +0100 Subject: [PATCH 092/306] Update list.php --- htdocs/comm/propal/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 96775e04d16..7eeab391f6d 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -798,7 +798,7 @@ if ($resql) print '
'.$langs->trans("Module").'
'.img_object('', $picto, 'class="pictoobjectwidth"').' '.$objMod->getName().''; + //print img_object('', $picto, 'class="pictoobjectwidth"').' '.$objMod->getName(); + print '
'; // Picto + Ref print ''; // Warning $warnornote = ''; From 7411f6468b5df8b63e41b4494dba58236010fe1f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Feb 2020 21:47:41 +0100 Subject: [PATCH 093/306] css --- htdocs/theme/eldy/global.inc.php | 6 ++++++ htdocs/theme/md/style.css.php | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 9f253073a6f..f0918feb9da 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -663,6 +663,12 @@ select.flat.selectlimit { .marginbottomonly { margin-bottom: 10px !important; } +.nomargintop { + margin-top: 0 !important; +} +.nomarginbottom { + margin-bottom: 0 !important; +} .selectlimit, .selectlimit:focus { border-left: none !important; border-top: none !important; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index e7499223221..ab860db6012 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -851,6 +851,13 @@ select.flat.selectlimit { .marginbottomonly { margin-bottom: 10px !important; } +.nomargintop { + margin-top: 0 !important; +} +.nomarginbottom { + margin-bottom: 0 !important; +} + .selectlimit, .selectlimit:focus { border-left: none !important; border-top: none !important; From 5aa4f9b5ae114ff66c72e2a526959878cc66b285 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Feb 2020 21:58:53 +0100 Subject: [PATCH 094/306] Fix phpcs --- htdocs/admin/perms.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/admin/perms.php b/htdocs/admin/perms.php index 6ad62242f6f..b11f909bd37 100644 --- a/htdocs/admin/perms.php +++ b/htdocs/admin/perms.php @@ -173,7 +173,7 @@ if ($result) $db->query($sqlupdate); } } - + // Check if permission we found is inside a module definition. If not, we discard it. $found = false; foreach ($modules[$obj->module]->rights as $key => $val) @@ -195,7 +195,7 @@ if ($result) if (isset($obj->module) && ($oldmod <> $obj->module)) { $oldmod = $obj->module; - + // Break detected, we get objMod $objMod = $modules[$obj->module]; $picto = ($objMod->picto ? $objMod->picto : 'generic'); @@ -213,9 +213,9 @@ if ($result) } $perm_libelle = ($conf->global->MAIN_USE_ADVANCED_PERMS && ($langs->trans("PermissionAdvanced".$obj->id) != ("PermissionAdvanced".$obj->id)) ? $langs->trans("PermissionAdvanced".$obj->id) : (($langs->trans("Permission".$obj->id) != ("Permission".$obj->id)) ? $langs->trans("Permission".$obj->id) : $obj->label)); - + print ''; - + // Picto and label of module print ''; } - + // Permission and tick print ''; print ''."\n"; - + $i++; } } From 7cc87423e48a2438e423d09e7814b5bc67084587 Mon Sep 17 00:00:00 2001 From: oscim Date: Wed, 5 Feb 2020 22:31:27 +0100 Subject: [PATCH 095/306] ref_ext is not in sql requete for save ref_ext is not in sql requete for save --- htdocs/comm/action/class/actioncomm.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index f75244dcf7d..4ec99b6dbb3 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -455,6 +455,7 @@ class ActionComm extends CommonObject $sql .= "durationp,"; // deprecated $sql .= "fk_action,"; $sql .= "code,"; + $sql .= "ref_ext,"; $sql .= "fk_soc,"; $sql .= "fk_project,"; $sql .= "note,"; @@ -484,6 +485,7 @@ class ActionComm extends CommonObject $sql .= ((isset($this->durationp) && $this->durationp >= 0 && $this->durationp != '') ? "'".$this->db->escape($this->durationp)."'" : "null").", "; // deprecated $sql .= (isset($this->type_id) ? $this->type_id : "null").","; $sql .= ($code ? ("'".$code."'") : "null").", "; + $sql .= ($this->ref_ext ? ("'".$this->ref_ext."'") : "null").", "; $sql .= ((isset($this->socid) && $this->socid > 0) ? $this->socid : "null").", "; $sql .= ((isset($this->fk_project) && $this->fk_project > 0) ? $this->fk_project : "null").", "; $sql .= " '".$this->db->escape($this->note_private ? $this->note_private : $this->note)."', "; From 102595f6b1d8d215d92d63414f1028d29ba3199f Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 6 Feb 2020 09:02:15 +0000 Subject: [PATCH 096/306] Fixing style errors. --- htdocs/product/class/product.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 82935981877..3c47bd47765 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1827,8 +1827,8 @@ class Product extends CommonObject $this->fourn_multicurrency_tx = $obj->multicurrency_tx; $this->fourn_multicurrency_id = $obj->fk_multicurrency; $this->fourn_multicurrency_code = $obj->multicurrency_code; - if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) $this->packaging = $obj->packaging; - $result = $obj->fk_product; + if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) $this->packaging = $obj->packaging; + $result = $obj->fk_product; return $result; } else From f3597926c42455b90de986b7166ddf7953c7378f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 6 Feb 2020 10:05:13 +0100 Subject: [PATCH 097/306] Fix missing escape returned by ci --- htdocs/comm/action/class/actioncomm.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 4ec99b6dbb3..5a9c5277ccd 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -485,7 +485,7 @@ class ActionComm extends CommonObject $sql .= ((isset($this->durationp) && $this->durationp >= 0 && $this->durationp != '') ? "'".$this->db->escape($this->durationp)."'" : "null").", "; // deprecated $sql .= (isset($this->type_id) ? $this->type_id : "null").","; $sql .= ($code ? ("'".$code."'") : "null").", "; - $sql .= ($this->ref_ext ? ("'".$this->ref_ext."'") : "null").", "; + $sql .= ($this->ref_ext ? ("'".$this->db->idate($this->ref_ext)."'") : "null").", "; $sql .= ((isset($this->socid) && $this->socid > 0) ? $this->socid : "null").", "; $sql .= ((isset($this->fk_project) && $this->fk_project > 0) ? $this->fk_project : "null").", "; $sql .= " '".$this->db->escape($this->note_private ? $this->note_private : $this->note)."', "; From 40b6886e2a1c9ca5e65d44e7ea14879d50e0c981 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 6 Feb 2020 10:09:27 +0100 Subject: [PATCH 098/306] Fix params --- .../template/core/modules/mymodule/mod_myobject_advanced.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_advanced.php b/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_advanced.php index 371a287dffb..09e4902d6f9 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_advanced.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_advanced.php @@ -104,7 +104,7 @@ class mod_myobject_advanced extends ModeleNumRefMyObject $old_code_type = $mysoc->typent_code; $mysoc->code_client = 'CCCCCCCCCC'; $mysoc->typent_code = 'TTTTTTTTTT'; - $numExample = $this->getNextValue($mysoc, ''); + $numExample = $this->getNextValue($mysoc); $mysoc->code_client = $old_code_client; $mysoc->typent_code = $old_code_type; From 857c22cb29e6685c885290839df746924d9ca3c8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 6 Feb 2020 10:13:10 +0100 Subject: [PATCH 099/306] Fix doc --- htdocs/core/db/DoliDB.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/db/DoliDB.class.php b/htdocs/core/db/DoliDB.class.php index 29d77c089c0..8ca84e0dd10 100644 --- a/htdocs/core/db/DoliDB.class.php +++ b/htdocs/core/db/DoliDB.class.php @@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT .'/core/db/Database.interface.php'; */ abstract class DoliDB implements Database { - /** @var bool|resource Database handler */ + /** @var bool|resource|SQLite3 Database handler */ public $db; /** @var string Database type */ public $type; From 48cd8e131485e6dea93a211940d2a132b20f9eb4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 6 Feb 2020 10:17:06 +0100 Subject: [PATCH 100/306] Fix doc --- htdocs/core/db/mssql.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/db/mssql.class.php b/htdocs/core/db/mssql.class.php index 2c489b25181..597075aa8db 100644 --- a/htdocs/core/db/mssql.class.php +++ b/htdocs/core/db/mssql.class.php @@ -41,7 +41,7 @@ class DoliDBMssql extends DoliDB public $forcecollate='latin1_swedish_ci'; // Can't be static as it may be forced with a dynamic value //! Version min database const VERSIONMIN='2000'; - /** @var resource Resultset of last query */ + /** @var boolean|resource Resultset of last query */ private $_results; /** From 2966b2303b2836a778a13a4a23a4c83c7479c669 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 6 Feb 2020 10:23:04 +0100 Subject: [PATCH 101/306] Fix phpcs --- htdocs/core/db/mssql.class.php | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/htdocs/core/db/mssql.class.php b/htdocs/core/db/mssql.class.php index 597075aa8db..79d26949394 100644 --- a/htdocs/core/db/mssql.class.php +++ b/htdocs/core/db/mssql.class.php @@ -336,6 +336,8 @@ class DoliDBMssql extends DoliDB $query=preg_replace("/([. ,\t(])(percent|file|public)([. ,=\t)])/", "$1[$2]$3", $query); + $original_query=''; + if ($type=="auto" || $type='dml') { $query=preg_replace('/AUTO_INCREMENT/i', 'IDENTITY', $query); @@ -345,7 +347,6 @@ class DoliDBMssql extends DoliDB $query=preg_replace('/([ \t])(MEDIUM|TINY|LONG){0,1}TEXT([ \t,])/i', "$1VARCHAR(MAX)$3", $query); $matches=array(); - $original_query=''; if (preg_match('/ALTER TABLE\h+(\w+?)\h+ADD\h+(?:(UNIQUE)|INDEX)\h+(?:INDEX)?\h*(\w+?)\h*\((.+)\)/is', $query, $matches)) { $original_query=$query; @@ -356,10 +357,12 @@ class DoliDBMssql extends DoliDB $fields_clear=array_map('trim', $fields); $infos=$this->GetFieldInformation(trim($matches[1]), $fields_clear); $query_comp=array(); - foreach($infos as $fld) { - if ($fld->IS_NULLABLE == 'YES') { - $query_comp[]=$fld->COLUMN_NAME." IS NOT NULL"; - } + if (is_array($infos)) { + foreach($infos as $fld) { + if ($fld->IS_NULLABLE == 'YES') { + $query_comp[]=$fld->COLUMN_NAME." IS NOT NULL"; + } + } } if (! empty($query_comp)) $query.=" WHERE ".implode(" AND ", $query_comp); @@ -784,7 +787,8 @@ class DoliDBMssql extends DoliDB public function DDLListTables($database, $table = '') { // phpcs:enable - $this->_results = mssql_list_tables($database, $this->db); + $v = mssql_query("Select name from sysobjects where type like 'u'", $this->db); + $this->_results = mssql_fetch_array($v); return $this->_results; } @@ -825,6 +829,10 @@ class DoliDBMssql extends DoliDB // phpcs:enable // FIXME: $fulltext_keys parameter is unused + $sqlfields = array(); + $sqluq = array(); + $sqlk = array(); + // cles recherchees dans le tableau des descriptions (fields) : type,value,attribute,null,default,extra // ex. : $fields['rowid'] = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment'); $sql = "create table ".$table."("; From 48e6db17bd92d1176b08b27dd67edd1ba832cdb0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 6 Feb 2020 10:28:49 +0100 Subject: [PATCH 102/306] Fix doc --- htdocs/core/modules/import/import_csv.modules.php | 9 ++++----- htdocs/core/modules/import/import_xlsx.modules.php | 10 +++++----- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php index d6c43edd5c3..93d68691a11 100644 --- a/htdocs/core/modules/import/import_csv.modules.php +++ b/htdocs/core/modules/import/import_csv.modules.php @@ -123,7 +123,7 @@ class ImportCsv extends ModeleImports * Output header of an example file for this format * * @param Translate $outputlangs Output language - * @return string + * @return string Empty string */ public function write_header_example($outputlangs) { @@ -137,7 +137,7 @@ class ImportCsv extends ModeleImports * * @param Translate $outputlangs Output language * @param array $headerlinefields Array of fields name - * @return string$limittoachartaccount + * @return string String output */ public function write_title_example($outputlangs, $headerlinefields) { @@ -152,7 +152,7 @@ class ImportCsv extends ModeleImports * * @param Translate $outputlangs Output language * @param array $contentlinevalues Array of lines - * @return string + * @return string String output */ public function write_record_example($outputlangs, $contentlinevalues) { @@ -166,7 +166,7 @@ class ImportCsv extends ModeleImports * Output footer of an example file for this format * * @param Translate $outputlangs Output language - * @return string + * @return string Empty string */ public function write_footer_example($outputlangs) { @@ -175,7 +175,6 @@ class ImportCsv extends ModeleImports } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Open input file diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php index 03b3f941a1d..09628739494 100644 --- a/htdocs/core/modules/import/import_xlsx.modules.php +++ b/htdocs/core/modules/import/import_xlsx.modules.php @@ -130,7 +130,7 @@ class ImportXlsx extends ModeleImports * Output header of an example file for this format * * @param Translate $outputlangs Output language - * @return string + * @return string Empty string */ public function write_header_example($outputlangs) { @@ -164,7 +164,7 @@ class ImportXlsx extends ModeleImports * * @param Translate $outputlangs Output language * @param array $headerlinefields Array of fields name - * @return string + * @return string String output */ public function write_title_example($outputlangs, $headerlinefields) { @@ -190,7 +190,7 @@ class ImportXlsx extends ModeleImports * * @param Translate $outputlangs Output language * @param array $contentlinevalues Array of lines - * @return string + * @return string Empty string */ public function write_record_example($outputlangs, $contentlinevalues) { @@ -210,7 +210,7 @@ class ImportXlsx extends ModeleImports * Output footer of an example file for this format * * @param Translate $outputlangs Output language - * @return string + * @return string String output */ public function write_footer_example($outputlangs) { @@ -258,7 +258,7 @@ class ImportXlsx extends ModeleImports * Return nb of records. File must be closed. * * @param string $file Path of filename - * @return int <0 if KO, >=0 if OK + * @return int <0 if KO, >=0 if OK */ public function import_get_nb_of_lines($file) { From f1cce26ef07e066e12b6687fb4258221dcac9eb4 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Thu, 6 Feb 2020 10:47:56 +0100 Subject: [PATCH 103/306] FIX need weight short label in shipping doc need short label because value + term is too long --- htdocs/core/modules/expedition/doc/pdf_rouget.modules.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index a19d98748ee..ad0272f46a1 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -536,12 +536,12 @@ class pdf_rouget extends ModelePdfExpedition $weighttxt = ''; if ($object->lines[$i]->fk_product_type == 0 && $object->lines[$i]->weight) { - $weighttxt = round($object->lines[$i]->weight * $object->lines[$i]->qty_shipped, 5).' '.measuringUnitString(0, "weight", $object->lines[$i]->weight_units); + $weighttxt = round($object->lines[$i]->weight * $object->lines[$i]->qty_shipped, 5).' '.measuringUnitString(0, "weight", $object->lines[$i]->weight_units, 1); } $voltxt = ''; if ($object->lines[$i]->fk_product_type == 0 && $object->lines[$i]->volume) { - $voltxt = round($object->lines[$i]->volume * $object->lines[$i]->qty_shipped, 5).' '.measuringUnitString(0, "volume", $object->lines[$i]->volume_units ? $object->lines[$i]->volume_units : 0); + $voltxt = round($object->lines[$i]->volume * $object->lines[$i]->qty_shipped, 5).' '.measuringUnitString(0, "volume", $object->lines[$i]->volume_units ? $object->lines[$i]->volume_units : 0, 1); } if (empty($conf->global->SHIPPING_PDF_HIDE_WEIGHT_AND_VOLUME)) From 2ca6b8f6339eeef5f8f6ea13ba88cc608ebfe6a7 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Thu, 6 Feb 2020 10:49:05 +0100 Subject: [PATCH 104/306] Update pdf_espadon.modules.php --- htdocs/core/modules/expedition/doc/pdf_espadon.modules.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index 5706ce5d7fa..0d702adab60 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -519,12 +519,12 @@ class pdf_espadon extends ModelePdfExpedition $weighttxt=''; if ($object->lines[$i]->fk_product_type == 0 && $object->lines[$i]->weight) { - $weighttxt=round($object->lines[$i]->weight * $object->lines[$i]->qty_shipped, 5).' '.measuringUnitString(0, "weight", $object->lines[$i]->weight_units); + $weighttxt=round($object->lines[$i]->weight * $object->lines[$i]->qty_shipped, 5).' '.measuringUnitString(0, "weight", $object->lines[$i]->weight_units, 1); } $voltxt=''; if ($object->lines[$i]->fk_product_type == 0 && $object->lines[$i]->volume) { - $voltxt=round($object->lines[$i]->volume * $object->lines[$i]->qty_shipped, 5).' '.measuringUnitString(0, "volume", $object->lines[$i]->volume_units?$object->lines[$i]->volume_units:0); + $voltxt=round($object->lines[$i]->volume * $object->lines[$i]->qty_shipped, 5).' '.measuringUnitString(0, "volume", $object->lines[$i]->volume_units?$object->lines[$i]->volume_units:0, 1); } From 59c06311728dbfda75f553cc1ececacdd5cddb4d Mon Sep 17 00:00:00 2001 From: Scrutinizer Auto-Fixer Date: Thu, 6 Feb 2020 09:49:12 +0000 Subject: [PATCH 105/306] Scrutinizer Auto-Fixes This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com --- htdocs/asset/class/asset_type.class.php | 134 ++++++++++----------- htdocs/asset/list.php | 16 +-- htdocs/core/lib/functionsnumtoword.lib.php | 96 +++++++-------- 3 files changed, 123 insertions(+), 123 deletions(-) diff --git a/htdocs/asset/class/asset_type.class.php b/htdocs/asset/class/asset_type.class.php index 23c1bd630fa..edb6fdf90c9 100644 --- a/htdocs/asset/class/asset_type.class.php +++ b/htdocs/asset/class/asset_type.class.php @@ -68,9 +68,9 @@ class AssetType extends CommonObject public $note; /** @var array Array of asset */ - public $asset=array(); + public $asset = array(); - public $fields=array( + public $fields = array( 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10), 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>15, 'index'=>1), 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>20), @@ -104,9 +104,9 @@ class AssetType extends CommonObject { global $conf; - $error=0; + $error = 0; - $this->label=trim($this->label); + $this->label = trim($this->label); $this->accountancy_code_asset = trim($this->accountancy_code_asset); $this->accountancy_code_depreciation_asset = trim($this->accountancy_code_depreciation_asset); $this->accountancy_code_depreciation_expense = trim($this->accountancy_code_depreciation_expense); @@ -114,20 +114,20 @@ class AssetType extends CommonObject $this->db->begin(); $sql = "INSERT INTO ".MAIN_DB_PREFIX."asset_type ("; - $sql.= "label"; - $sql.= ", accountancy_code_asset"; - $sql.= ", accountancy_code_depreciation_asset"; - $sql.= ", accountancy_code_depreciation_expense"; - $sql.= ", note"; - $sql.= ", entity"; - $sql.= ") VALUES ("; - $sql.= "'".$this->db->escape($this->label)."'"; - $sql.= ", '".$this->db->escape($this->accountancy_code_asset)."'"; - $sql.= ", '".$this->db->escape($this->accountancy_code_depreciation_asset)."'"; - $sql.= ", '".$this->db->escape($this->accountancy_code_depreciation_expense)."'"; - $sql.= ", '".$this->db->escape($this->note)."'"; - $sql.= ", ".$conf->entity; - $sql.= ")"; + $sql .= "label"; + $sql .= ", accountancy_code_asset"; + $sql .= ", accountancy_code_depreciation_asset"; + $sql .= ", accountancy_code_depreciation_expense"; + $sql .= ", note"; + $sql .= ", entity"; + $sql .= ") VALUES ("; + $sql .= "'".$this->db->escape($this->label)."'"; + $sql .= ", '".$this->db->escape($this->accountancy_code_asset)."'"; + $sql .= ", '".$this->db->escape($this->accountancy_code_depreciation_asset)."'"; + $sql .= ", '".$this->db->escape($this->accountancy_code_depreciation_expense)."'"; + $sql .= ", '".$this->db->escape($this->note)."'"; + $sql .= ", ".$conf->entity; + $sql .= ")"; dol_syslog("Asset_type::create", LOG_DEBUG); $result = $this->db->query($sql); @@ -142,15 +142,15 @@ class AssetType extends CommonObject return -3; } - if (! $notrigger) + if (!$notrigger) { // Call trigger - $result=$this->call_trigger('ASSET_TYPE_CREATE', $user); + $result = $this->call_trigger('ASSET_TYPE_CREATE', $user); if ($result < 0) { $error++; } // End call triggers } - if (! $error) + if (!$error) { $this->db->commit(); return $this->id; @@ -164,7 +164,7 @@ class AssetType extends CommonObject } else { - $this->error=$this->db->lasterror(); + $this->error = $this->db->lasterror(); $this->db->rollback(); return -1; } @@ -181,45 +181,45 @@ class AssetType extends CommonObject { global $conf, $hookmanager; - $error=0; + $error = 0; - $this->label=trim($this->label); + $this->label = trim($this->label); $this->db->begin(); $sql = "UPDATE ".MAIN_DB_PREFIX."asset_type "; - $sql.= "SET "; - $sql.= "label = '".$this->db->escape($this->label) ."',"; - $sql.= "accountancy_code_asset = '".$this->db->escape($this->accountancy_code_asset)."',"; - $sql.= "accountancy_code_depreciation_asset = '".$this->db->escape($this->accountancy_code_depreciation_asset)."',"; - $sql.= "accountancy_code_depreciation_expense = '".$this->db->escape($this->accountancy_code_depreciation_expense)."',"; - $sql.= "note = '".$this->db->escape($this->note) ."'"; - $sql.= " WHERE rowid =".$this->id; + $sql .= "SET "; + $sql .= "label = '".$this->db->escape($this->label)."',"; + $sql .= "accountancy_code_asset = '".$this->db->escape($this->accountancy_code_asset)."',"; + $sql .= "accountancy_code_depreciation_asset = '".$this->db->escape($this->accountancy_code_depreciation_asset)."',"; + $sql .= "accountancy_code_depreciation_expense = '".$this->db->escape($this->accountancy_code_depreciation_expense)."',"; + $sql .= "note = '".$this->db->escape($this->note)."'"; + $sql .= " WHERE rowid =".$this->id; $result = $this->db->query($sql); if ($result) { - $action='update'; + $action = 'update'; // Actions on extra fields if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used { - $result=$this->insertExtraFields(); + $result = $this->insertExtraFields(); if ($result < 0) { $error++; } } - if (! $error && ! $notrigger) + if (!$error && !$notrigger) { // Call trigger - $result=$this->call_trigger('ASSET_TYPE_MODIFY', $user); + $result = $this->call_trigger('ASSET_TYPE_MODIFY', $user); if ($result < 0) { $error++; } // End call triggers } - if (! $error) + if (!$error) { $this->db->commit(); return 1; @@ -233,7 +233,7 @@ class AssetType extends CommonObject } else { - $this->error=$this->db->lasterror(); + $this->error = $this->db->lasterror(); $this->db->rollback(); return -1; } @@ -251,13 +251,13 @@ class AssetType extends CommonObject $error = 0; $sql = "DELETE FROM ".MAIN_DB_PREFIX."asset_type"; - $sql.= " WHERE rowid = ".$this->id; + $sql .= " WHERE rowid = ".$this->id; - $resql=$this->db->query($sql); + $resql = $this->db->query($sql); if ($resql) { // Call trigger - $result=$this->call_trigger('ASSET_TYPE_DELETE', $user); + $result = $this->call_trigger('ASSET_TYPE_DELETE', $user); if ($result < 0) { $error++; $this->db->rollback(); return -2; } // End call triggers @@ -267,7 +267,7 @@ class AssetType extends CommonObject else { $this->db->rollback(); - $this->error=$this->db->lasterror(); + $this->error = $this->db->lasterror(); return -1; } } @@ -286,7 +286,7 @@ class AssetType extends CommonObject dol_syslog("Asset_type::fetch", LOG_DEBUG); - $resql=$this->db->query($sql); + $resql = $this->db->query($sql); if ($resql) { if ($this->db->num_rows($resql)) @@ -306,7 +306,7 @@ class AssetType extends CommonObject } else { - $this->error=$this->db->lasterror(); + $this->error = $this->db->lasterror(); return -1; } } @@ -320,15 +320,15 @@ class AssetType extends CommonObject public function liste_array() { // phpcs:enable - global $conf,$langs; + global $conf, $langs; $assettypes = array(); $sql = "SELECT rowid, label as label"; - $sql.= " FROM ".MAIN_DB_PREFIX."asset_type"; - $sql.= " WHERE entity IN (".getEntity('asset_type').")"; + $sql .= " FROM ".MAIN_DB_PREFIX."asset_type"; + $sql .= " WHERE entity IN (".getEntity('asset_type').")"; - $resql=$this->db->query($sql); + $resql = $this->db->query($sql); if ($resql) { $nump = $this->db->num_rows($resql); @@ -365,13 +365,13 @@ class AssetType extends CommonObject { global $conf, $user; - $ret=array(); + $ret = array(); $sql = "SELECT a.rowid"; - $sql.= " FROM ".MAIN_DB_PREFIX."asset as a"; - $sql.= " WHERE a.entity IN (".getEntity('asset').")"; - $sql.= " AND a.fk_asset_type = ".$this->id; - if (! empty($excludefilter)) $sql.=' AND ('.$excludefilter.')'; + $sql .= " FROM ".MAIN_DB_PREFIX."asset as a"; + $sql .= " WHERE a.entity IN (".getEntity('asset').")"; + $sql .= " AND a.fk_asset_type = ".$this->id; + if (!empty($excludefilter)) $sql .= ' AND ('.$excludefilter.')'; dol_syslog(get_class($this)."::listAssetsForGroup", LOG_DEBUG); $resql = $this->db->query($sql); @@ -379,31 +379,31 @@ class AssetType extends CommonObject { while ($obj = $this->db->fetch_object($resql)) { - if (! array_key_exists($obj->rowid, $ret)) + if (!array_key_exists($obj->rowid, $ret)) { if ($mode < 2) { - $assetstatic=new Asset($this->db); + $assetstatic = new Asset($this->db); if ($mode == 1) { $assetstatic->fetch($obj->rowid, '', '', '', false, false); } else { $assetstatic->fetch($obj->rowid); } - $ret[$obj->rowid]=$assetstatic; + $ret[$obj->rowid] = $assetstatic; } - else $ret[$obj->rowid]=$obj->rowid; + else $ret[$obj->rowid] = $obj->rowid; } } $this->db->free($resql); - $this->asset=$ret; + $this->asset = $ret; return $ret; } else { - $this->error=$this->db->lasterror(); + $this->error = $this->db->lasterror(); return -1; } } @@ -420,15 +420,15 @@ class AssetType extends CommonObject { global $langs; - $result=''; - $label=$langs->trans("ShowTypeCard", $this->label); + $result = ''; + $label = $langs->trans("ShowTypeCard", $this->label); $linkstart = ''; - $linkend=''; + $linkend = ''; $result .= $linkstart; - if ($withpicto) $result.=img_object(($notooltip?'':$label), ($this->picto?$this->picto:'generic'), ($notooltip?(($withpicto != 2) ? 'class="paddingright"' : ''):'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip?0:1); - if ($withpicto != 2) $result.= ($maxlen?dol_trunc($this->label, $maxlen):$this->label); + if ($withpicto) $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1); + if ($withpicto != 2) $result .= ($maxlen ?dol_trunc($this->label, $maxlen) : $this->label); $result .= $linkend; return $result; @@ -448,13 +448,13 @@ class AssetType extends CommonObject // Initialize parameters $this->id = 0; $this->ref = 'ATSPEC'; - $this->specimen=1; + $this->specimen = 1; - $this->label='ASSET TYPE SPECIMEN'; - $this->note='This is a note'; + $this->label = 'ASSET TYPE SPECIMEN'; + $this->note = 'This is a note'; // Assets of this asset type is just me - $this->asset=array( + $this->asset = array( $user->id => $user ); } diff --git a/htdocs/asset/list.php b/htdocs/asset/list.php index be681ac5c13..2a9657baf90 100644 --- a/htdocs/asset/list.php +++ b/htdocs/asset/list.php @@ -412,7 +412,7 @@ print ''."\n"; // Fields title label // -------------------------------------------------------------------- print ''; -foreach($object->fields as $key => $val) +foreach ($object->fields as $key => $val) { $cssforfield = (empty($val['css']) ? '' : $val['css']); if ($key == 'status') $cssforfield .= ($cssforfield ? ' ' : '').'center'; @@ -427,8 +427,8 @@ foreach($object->fields as $key => $val) // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields -$parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder); -$reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook +$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); +$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ')."\n"; @@ -436,7 +436,7 @@ print ''."\n"; // Detect if we need a fetch on each output line -$needToFetchEachLine=0; +$needToFetchEachLine = 0; if (is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) { foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) @@ -448,19 +448,19 @@ if (is_array($extrafields->attributes[$object->table_element]['computed']) && co // Loop on record // -------------------------------------------------------------------- -$i=0; -$totalarray=array(); +$i = 0; +$totalarray = array(); while ($i < ($limit ? min($num, $limit) : $num)) { $obj = $db->fetch_object($resql); - if (empty($obj)) break; // Should not happen + if (empty($obj)) break; // Should not happen // Store properties in $object $object->setVarsFromFetchObj($obj); // Show here line of result print ''; - foreach($object->fields as $key => $val) + foreach ($object->fields as $key => $val) { $cssforfield = (empty($val['css']) ? '' : $val['css']); if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) $cssforfield .= ($cssforfield ? ' ' : '').'center'; diff --git a/htdocs/core/lib/functionsnumtoword.lib.php b/htdocs/core/lib/functionsnumtoword.lib.php index 94479fe2c28..9341fc26c18 100644 --- a/htdocs/core/lib/functionsnumtoword.lib.php +++ b/htdocs/core/lib/functionsnumtoword.lib.php @@ -38,15 +38,15 @@ function dol_convertToWord($num, $langs, $currency = false, $centimes = false) global $conf; $num = str_replace(array(',', ' '), '', trim($num)); - if (! $num) { + if (!$num) { return false; } if ($centimes && strlen($num) == 1) { - $num = $num*10; + $num = $num * 10; } - if (! empty($conf->global->MAIN_MODULE_NUMBERWORDS)) { + if (!empty($conf->global->MAIN_MODULE_NUMBERWORDS)) { if ($currency) { $type = 1; } else { @@ -106,24 +106,24 @@ function dol_convertToWord($num, $langs, $currency = false, $centimes = false) $num_length = strlen($num); $levels = (int) (($num_length + 2) / 3); $max_length = $levels * 3; - $num = substr('00' . $num, -$max_length); + $num = substr('00'.$num, -$max_length); $num_levels = str_split($num, 3); $nboflevels = count($num_levels); for ($i = 0; $i < $nboflevels; $i++) { $levels--; $hundreds = (int) ($num_levels[$i] / 100); - $hundreds = ($hundreds ? ' ' . $list1[$hundreds] . ' '.$langs->transnoentities('hundred') . ( $hundreds == 1 ? '' : 's' ) . ' ': ''); + $hundreds = ($hundreds ? ' '.$list1[$hundreds].' '.$langs->transnoentities('hundred').($hundreds == 1 ? '' : 's').' ' : ''); $tens = (int) ($num_levels[$i] % 100); $singles = ''; - if ( $tens < 20 ) { - $tens = ($tens ? ' ' . $list1[$tens] . ' ' : '' ); + if ($tens < 20) { + $tens = ($tens ? ' '.$list1[$tens].' ' : ''); } else { $tens = (int) ($tens / 10); - $tens = ' ' . $list2[$tens] . ' '; + $tens = ' '.$list2[$tens].' '; $singles = (int) ($num_levels[$i] % 10); - $singles = ' ' . $list1[$singles] . ' '; + $singles = ' '.$list1[$singles].' '; } - $words[] = $hundreds . $tens . $singles . ( ( $levels && ( int ) ( $num_levels[$i] ) ) ? ' ' . $list3[$levels] . ' ' : '' ); + $words[] = $hundreds.$tens.$singles.(($levels && (int) ($num_levels[$i])) ? ' '.$list3[$levels].' ' : ''); } //end for loop $commas = count($words); if ($commas > 1) { @@ -133,15 +133,15 @@ function dol_convertToWord($num, $langs, $currency = false, $centimes = false) // Delete multi whitespaces $concatWords = trim(preg_replace('/[ ]+/', ' ', $concatWords)); - if(!empty($currency)) { + if (!empty($currency)) { $concatWords .= ' '.$currency; } // If we need to write cents call again this function for cents - if(!empty($TNum[1])) { - if(!empty($currency)) $concatWords .= ' '.$langs->transnoentities('and'); + if (!empty($TNum[1])) { + if (!empty($currency)) $concatWords .= ' '.$langs->transnoentities('and'); $concatWords .= ' '.dol_convertToWord($TNum[1], $langs, $currency, true); - if(!empty($currency)) $concatWords .= ' '.$langs->transnoentities('centimes'); + if (!empty($currency)) $concatWords .= ' '.$langs->transnoentities('centimes'); } return $concatWords; } @@ -165,35 +165,35 @@ function dolNumberToWord($numero, $langs, $numorcurrency = 'number') return -1; // Get 2 decimals to cents, another functions round or truncate $strnumber = number_format($numero, 10); - $len=strlen($strnumber); - for ($i=0; $i<$len; $i++) + $len = strlen($strnumber); + for ($i = 0; $i < $len; $i++) { - if ($strnumber[$i]=='.') { - $parte_decimal = $strnumber[$i+1].$strnumber[$i+2]; + if ($strnumber[$i] == '.') { + $parte_decimal = $strnumber[$i + 1].$strnumber[$i + 2]; break; } } /*In dolibarr 3.6.2 (my current version) doesn't have $langs->default and in case exist why ask $lang like a parameter?*/ - if (((is_object($langs) && $langs->default == 'es_MX') || (! is_object($langs) && $langs == 'es_MX')) && $numorcurrency == 'currency') + if (((is_object($langs) && $langs->default == 'es_MX') || (!is_object($langs) && $langs == 'es_MX')) && $numorcurrency == 'currency') { - if ($numero>=1 && $numero<2) { + if ($numero >= 1 && $numero < 2) { return ("UN PESO ".$parte_decimal." / 100 M.N."); } - elseif ($numero>=0 && $numero<1){ + elseif ($numero >= 0 && $numero < 1) { return ("CERO PESOS ".$parte_decimal." / 100 M.N."); } - elseif ($numero>=1000000 && $numero<1000001){ + elseif ($numero >= 1000000 && $numero < 1000001) { return ("UN MILLÓN DE PESOS ".$parte_decimal." / 100 M.N."); } - elseif ($numero>=1000000000000 && $numero<1000000000001){ + elseif ($numero >= 1000000000000 && $numero < 1000000000001) { return ("UN BILLÓN DE PESOS ".$parte_decimal." / 100 M.N."); } else { - $entexto =""; + $entexto = ""; $number = $numero; - if ($number >= 1000000000){ + if ($number >= 1000000000) { $CdMMillon = (int) ($numero / 100000000000); $numero = $numero - $CdMMillon * 100000000000; $DdMMillon = (int) ($numero / 10000000000); @@ -203,7 +203,7 @@ function dolNumberToWord($numero, $langs, $numorcurrency = 'number') $entexto .= hundreds2text($CdMMillon, $DdMMillon, $UdMMillon); $entexto .= " MIL "; } - if ($number >= 1000000){ + if ($number >= 1000000) { $CdMILLON = (int) ($numero / 100000000); $numero = $numero - $CdMILLON * 100000000; $DdMILLON = (int) ($numero / 10000000); @@ -211,7 +211,7 @@ function dolNumberToWord($numero, $langs, $numorcurrency = 'number') $udMILLON = (int) ($numero / 1000000); $numero = $numero - $udMILLON * 1000000; $entexto .= hundreds2text($CdMILLON, $DdMILLON, $udMILLON); - if (!$CdMMillon && !$DdMMillon && !$UdMMillon && !$CdMILLON && !$DdMILLON && $udMILLON==1) + if (!$CdMMillon && !$DdMMillon && !$UdMMillon && !$CdMILLON && !$DdMILLON && $udMILLON == 1) $entexto .= " MILLÓN "; else $entexto .= " MILLONES "; @@ -232,7 +232,7 @@ function dolNumberToWord($numero, $langs, $numorcurrency = 'number') $d = (int) ($numero / 10); $u = (int) $numero - $d * 10; $entexto .= hundreds2text($c, $d, $u); - if (!$cdm && !$ddm && !$udm && !$c && !$d && !$u && $number>1000000) + if (!$cdm && !$ddm && !$udm && !$c && !$d && !$u && $number > 1000000) $entexto .= " DE"; $entexto .= " PESOS ".$parte_decimal." / 100 M.N."; } @@ -250,40 +250,40 @@ function dolNumberToWord($numero, $langs, $numorcurrency = 'number') */ function hundreds2text($hundreds, $tens, $units) { - if ($hundreds==1 && $tens==0 && $units==0){ + if ($hundreds == 1 && $tens == 0 && $units == 0) { return "CIEN"; } - $centenas = array("CIENTO","DOSCIENTOS","TRESCIENTOS","CUATROCIENTOS","QUINIENTOS","SEISCIENTOS","SETECIENTOS","OCHOCIENTOS","NOVECIENTOS"); - $decenas = array("","","TREINTA ","CUARENTA ","CINCUENTA ","SESENTA ","SETENTA ","OCHENTA ","NOVENTA "); - $veintis = array("VEINTE","VEINTIUN","VEINTIDÓS","VEINTITRÉS","VEINTICUATRO","VEINTICINCO","VEINTISÉIS","VEINTISIETE","VEINTIOCHO","VEINTINUEVE"); - $diecis = array("DIEZ","ONCE","DOCE","TRECE","CATORCE","QUINCE","DIECISÉIS","DIECISIETE","DIECIOCHO","DIECINUEVE"); - $unidades = array("UN","DOS","TRES","CUATRO","CINCO","SEIS","SIETE","OCHO","NUEVE"); + $centenas = array("CIENTO", "DOSCIENTOS", "TRESCIENTOS", "CUATROCIENTOS", "QUINIENTOS", "SEISCIENTOS", "SETECIENTOS", "OCHOCIENTOS", "NOVECIENTOS"); + $decenas = array("", "", "TREINTA ", "CUARENTA ", "CINCUENTA ", "SESENTA ", "SETENTA ", "OCHENTA ", "NOVENTA "); + $veintis = array("VEINTE", "VEINTIUN", "VEINTIDÓS", "VEINTITRÉS", "VEINTICUATRO", "VEINTICINCO", "VEINTISÉIS", "VEINTISIETE", "VEINTIOCHO", "VEINTINUEVE"); + $diecis = array("DIEZ", "ONCE", "DOCE", "TRECE", "CATORCE", "QUINCE", "DIECISÉIS", "DIECISIETE", "DIECIOCHO", "DIECINUEVE"); + $unidades = array("UN", "DOS", "TRES", "CUATRO", "CINCO", "SEIS", "SIETE", "OCHO", "NUEVE"); $entexto = ""; - if ($hundreds!=0){ - $entexto .= $centenas[$hundreds-1]; + if ($hundreds != 0) { + $entexto .= $centenas[$hundreds - 1]; } - if ($tens>2){ - if ($hundreds!=0) $entexto .= " "; - $entexto .= $decenas[$tens-1]; - if ($units!=0){ + if ($tens > 2) { + if ($hundreds != 0) $entexto .= " "; + $entexto .= $decenas[$tens - 1]; + if ($units != 0) { $entexto .= " Y "; - $entexto .= $unidades[$units-1]; + $entexto .= $unidades[$units - 1]; } return $entexto; } - elseif ($tens==2){ - if ($hundreds!=0) $entexto .= " "; + elseif ($tens == 2) { + if ($hundreds != 0) $entexto .= " "; $entexto .= " ".$veintis[$units]; return $entexto; } - elseif ($tens==1){ - if ($hundreds!=0) $entexto .= " "; + elseif ($tens == 1) { + if ($hundreds != 0) $entexto .= " "; $entexto .= $diecis[$units]; return $entexto; } - if ($units!=0) { - if ($hundreds!=0 || $tens!=0) $entexto .= " "; - $entexto .= $unidades[$units-1]; + if ($units != 0) { + if ($hundreds != 0 || $tens != 0) $entexto .= " "; + $entexto .= $unidades[$units - 1]; } return $entexto; } From bd6d49f04a5ff374f4631950443518d51cbbed66 Mon Sep 17 00:00:00 2001 From: atm-arnaud Date: Thu, 6 Feb 2020 12:08:50 +0100 Subject: [PATCH 106/306] FIX advanced target emailing sql and ergonomy --- htdocs/comm/mailing/class/advtargetemailing.class.php | 2 +- htdocs/core/tpl/advtarget.tpl.php | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/mailing/class/advtargetemailing.class.php b/htdocs/comm/mailing/class/advtargetemailing.class.php index ed04192d0e9..6eaddb799cf 100644 --- a/htdocs/comm/mailing/class/advtargetemailing.class.php +++ b/htdocs/comm/mailing/class/advtargetemailing.class.php @@ -141,7 +141,7 @@ class AdvanceTargetingMailing extends CommonObject $sql.= " ".(! isset($this->filtervalue)?'NULL':"'".$this->db->escape($this->filtervalue)."'").","; $sql.= " ".$user->id.","; $sql.= " '".$this->db->idate(dol_now())."',"; - $sql.= " null"; + $sql.= " ".$user->id; $sql.= ")"; $this->db->begin(); diff --git a/htdocs/core/tpl/advtarget.tpl.php b/htdocs/core/tpl/advtarget.tpl.php index 2c351996632..b6c9033cad4 100644 --- a/htdocs/core/tpl/advtarget.tpl.php +++ b/htdocs/core/tpl/advtarget.tpl.php @@ -73,7 +73,10 @@ print ''; +} +print '
'; + + +// Add Filter +print '
'; +print $form->searchComponent(array($object->element => $object->fields), $search_component_params); +print '
'; + +// Measures +print '
'; +foreach($object->fields as $key => $val) { + if ($val['isameasure']) { + $arrayofmesures['t.'.$key.'-sum'] = $langs->trans($val['label']).' ('.$langs->trans("Sum").')'; + $arrayofmesures['t.'.$key.'-average'] = $langs->trans($val['label']).' ('.$langs->trans("Average").')'; + } +} +// Add measure from extrafields +if ($object->isextrafieldmanaged) { + foreach($extrafields->attributes[$object->table_element]['label'] as $key => $val) { + if (! empty($extrafields->attributes[$object->table_element]['totalizable'][$key])) { + $arrayofmesures['te.'.$key.'-sum'] = $langs->trans($extrafields->attributes[$object->table_element]['label'][$key]).' ('.$langs->trans("Sum").')'; + $arrayofmesures['te.'.$key.'-average'] = $langs->trans($extrafields->attributes[$object->table_element]['label'][$key]).' ('.$langs->trans("Average").')'; + } + } +} +print '
'.$langs->trans("Measures").'
'; +print $form->multiselectarray('search_measures', $arrayofmesures, $search_measures, 0, 0, 'minwidth500', 1); +print '
'; + +// XAxis +print '
'; +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 (isset($val['enabled']) && ! dol_eval($val['enabled'], 1)) continue; + if (preg_match('/^fk_/', $key)) continue; + if (in_array($val['type'], array('html', 'text'))) continue; + if (in_array($val['type'], array('timestamp', 'date', 'datetime'))) { + $arrayofxaxis['t.'.$key.'-year'] = array('label' => $langs->trans($val['label']).' ('.$langs->trans("Year").')', 'position' => $val['position']); + $arrayofxaxis['t.'.$key.'-month'] = array('label' => $langs->trans($val['label']).' ('.$langs->trans("Month").')', 'position' => $val['position']); + $arrayofxaxis['t.'.$key.'-day'] = array('label' => $langs->trans($val['label']).' ('.$langs->trans("Day").')', 'position' => $val['position']); + } else { + $arrayofxaxis['t.'.$key] = array('label' => $val['label'], 'position' => (int) $val['position']); + } + } + // Add measure from extrafields + if ($object->isextrafieldmanaged) { + foreach($extrafields->attributes[$object->table_element]['label'] as $key => $val) { + if (! empty($extrafields->attributes[$object->table_element]['totalizable'][$key])) { + $arrayofxaxis['te.'.$key] = array('label' => $extrafields->attributes[$object->table_element]['label'][$key], 'position' => (int) $extrafields->attributes[$object->table_element]['pos'][$key]); + } + } + } +} +$arrayofxaxis = dol_sort_array($arrayofxaxis, 'position'); +$arrayofxaxislabel = array(); +foreach($arrayofxaxis as $key => $val) { + $arrayofxaxislabel[$key] = $val['label']; +} +print '
'.$langs->trans("XAxis").'
'; +print $form->multiselectarray('search_xaxis', $arrayofxaxislabel, $search_xaxis, 0, 0, 'minwidth500', 1); +print '
'; + +// YAxis +if ($mode == 'grid') { + print '
'; + foreach($object->fields as $key => $val) { + if (! $val['measure']) { + if (in_array($key, array('id', 'rowid', 'entity', 'last_main_doc', 'extraparams'))) continue; + if (preg_match('/^fk_/', $key)) continue; + if (in_array($val['type'], array('html', 'text'))) continue; + if (in_array($val['type'], array('timestamp', 'date', 'datetime'))) { + $arrayofyaxis['t.'.$key.'-year'] = array('label' => $langs->trans($val['label']).' ('.$langs->trans("Year").')', 'position' => $val['position']); + $arrayofyaxis['t.'.$key.'-month'] = array('label' => $langs->trans($val['label']).' ('.$langs->trans("Month").')', 'position' => $val['position']); + $arrayofyaxis['t.'.$key.'-day'] = array('label' => $langs->trans($val['label']).' ('.$langs->trans("Day").')', 'position' => $val['position']); + } else { + $arrayofyaxis['t.'.$key] = array('label' => $val['label'], 'position' => (int) $val['position']); + } + } + // Add measure from extrafields + if ($object->isextrafieldmanaged) { + foreach($extrafields->attributes[$object->table_element]['label'] as $key => $val) { + if (! empty($extrafields->attributes[$object->table_element]['totalizable'][$key])) { + $arrayofyaxis['te.'.$key] = array('label' => $extrafields->attributes[$object->table_element]['label'][$key], 'position' => (int) $extrafields->attributes[$object->table_element]['pos'][$key]); + } + } + } + } + $arrayofyaxis = dol_sort_array($arrayofyaxis, 'position'); + $arrayofyaxislabel = array(); + foreach($arrayofyaxis as $key => $val) { + $arrayofyaxislabel[$key] = $val['label']; + } + print '
'.$langs->trans("YAxis").'
'; + print $form->multiselectarray('search_yaxis', $arrayofyaxislabel, $search_yaxis, 0, 0, 'minwidth100', 1); + print '
'; +} + +if ($mode == 'graph') { + print '
'; + $arrayofgraphs = array('line', 'bars'); // also 'pies' + print '
'.$langs->trans("Graph").'
'; + print $form->selectarray('search_graph', $arrayofgraphs, $search_graph, 0, 0, 'minwidth100', 1); + print '
'; +} +print '
'; +print ''; +print '
'; +print ''; +print ''; + + +// Generate the SQL request +$sql = ''; +if (! empty($search_measures) && ! empty($search_xaxis)) +{ + $fieldid = 'rowid'; + + $sql = 'SELECT '; + foreach($search_xaxis as $key => $val) { + if (preg_match('/\-year$/', $val)) { + $tmpval = preg_replace('/\-year$/', '', $val); + $sql .= 'DATE_FORMAT('.$tmpval.", '%Y') as x_".$key.', '; + } elseif (preg_match('/\-month$/', $val)) { + $tmpval = preg_replace('/\-month$/', '', $val); + $sql .= 'DATE_FORMAT('.$tmpval.", '%Y-%m') as x_".$key.', '; + } elseif (preg_match('/\-day$/', $val)) { + $tmpval = preg_replace('/\-day$/', '', $val); + $sql .= 'DATE_FORMAT('.$tmpval.", '%Y-%m-%d') as x_".$key.', '; + } + else $sql .= $val.' as x_'.$key.', '; + } + foreach($search_measures as $key => $val) { + if ($val == 't.count') $sql .= 'COUNT(t.'.$fieldid.') as y_'.$key.', '; + elseif (preg_match('/\-sum$/', $val)) { + $tmpval = preg_replace('/\-sum$/', '', $val); + $sql .= 'SUM('.$db->ifsql($tmpval.' IS NULL', '0', $tmpval).') as y_'.$key.', '; + } + elseif (preg_match('/\-average$/', $val)) { + $tmpval = preg_replace('/\-average$/', '', $val); + $sql .= 'AVG('.$db->ifsql($tmpval.' IS NULL', '0', $tmpval).') as y_'.$key.', '; + } + } + $sql = preg_replace('/,\s*$/', '', $sql); + $sql .= ' FROM '.MAIN_DB_PREFIX.$object->table_element.' as t'; + // Add measure from extrafields + if ($object->isextrafieldmanaged) { + $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.$object->table_element.'_extrafields as te ON te.fk_object = t.'.$fieldid; + } + $sql .= ' WHERE 1 = 1'; + $sql .= ' AND entity IN ('.getEntity($object->element).')'; + foreach($search_filters as $key => $val) { + + } + $sql .= ' GROUP BY '; + foreach($search_xaxis as $key => $val) { + if (preg_match('/\-year$/', $val)) { + $tmpval = preg_replace('/\-year$/', '', $val); + $sql .= 'DATE_FORMAT('.$tmpval.", '%Y'), "; + } elseif (preg_match('/\-month$/', $val)) { + $tmpval = preg_replace('/\-month$/', '', $val); + $sql .= 'DATE_FORMAT('.$tmpval.", '%Y-%m'), "; + } elseif (preg_match('/\-day$/', $val)) { + $tmpval = preg_replace('/\-day$/', '', $val); + $sql .= 'DATE_FORMAT('.$tmpval.", '%Y-%m-%d'), "; + } + else $sql .= $val.', '; + } + $sql = preg_replace('/,\s*$/', '', $sql); + $sql .= ' ORDER BY '; + foreach($search_xaxis as $key => $val) { + if (preg_match('/\-year$/', $val)) { + $tmpval = preg_replace('/\-year$/', '', $val); + $sql .= 'DATE_FORMAT('.$tmpval.", '%Y'), "; + } elseif (preg_match('/\-month$/', $val)) { + $tmpval = preg_replace('/\-month$/', '', $val); + $sql .= 'DATE_FORMAT('.$tmpval.", '%Y-%m'), "; + } elseif (preg_match('/\-day$/', $val)) { + $tmpval = preg_replace('/\-day$/', '', $val); + $sql .= 'DATE_FORMAT('.$tmpval.", '%Y-%m-%d'), "; + } + else $sql .= $val.', '; + } + $sql = preg_replace('/,\s*$/', '', $sql); +} + + +$legend=array(); +foreach($search_measures as $key => $val) { + $legend[] = $langs->trans($arrayofmesures[$val]); +} + +// Execute the SQL request +$totalnbofrecord = 0; +$data = array(); +if ($sql) { + $resql = $db->query($sql); + if (! $resql) { + dol_print_error($db); + } + + while($obj = $db->fetch_object($resql)) { + // $this->data = array(array(0=>'labelxA',1=>yA1,...,n=>yAn), array('labelxB',yB1,...yBn)); // or when there is n series to show for each x + foreach($search_xaxis as $xkey => $xval) { + $fieldforxkey = 'x_'.$xkey; + $xlabel = $obj->$fieldforxkey; + $xvalwithoutprefix = preg_replace('/^[a-z]+\./', '', $xval); + if (! empty($object->fields[$xvalwithoutprefix]['arrayofkeyval'])) { + $xlabel = $object->fields[$xvalwithoutprefix]['arrayofkeyval'][$obj->$fieldforxkey]; + } + $xarray = array(0 => (($xlabel || $xlabel == '0') ? dol_trunc($xlabel, 20, 'middle') : $langs->trans("NotDefined"))); + foreach($search_measures as $key => $val) { + $fieldfory = 'y_'.$key; + $xarray[] = $obj->$fieldfory; + } + $data[] = $xarray; + } + } + + $totalnbofrecord = count($data); +} + + +print '
'; + + +if ($mode == 'grid') { + + +} + +if ($mode == 'graph') { + $WIDTH = '80%'; + $HEIGHT = 200; + + // Show graph + $px1 = new DolGraph(); + $mesg = $px1->isGraphKo(); + if (! $mesg) + { + $px1->SetData($data); + unset($data); + + $arrayoftypes = array(); + foreach($search_measures as $key => $val) { + $arrayoftypes[] = $search_graph; + } + + $px1->SetLegend($legend); + $px1->SetMinValue($px1->GetFloorMinValue()); + $px1->SetMaxValue($px1->GetCeilMaxValue()); + $px1->SetWidth($WIDTH); + $px1->SetHeight($HEIGHT); + $px1->SetYLabel($langs->trans("Y")); + $px1->SetShading(3); + $px1->SetHorizTickIncrement(1); + $px1->SetCssPrefix("cssboxes"); + $px1->SetType($arrayoftypes); + $px1->mode='depth'; + $px1->SetTitle(''); + + $dir=$conf->user->dir_temp; + dol_mkdir($dir); + $filenamenb = $dir.'/customreport_'.$object->element.'.png'; + $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=user&file=customreport_'.$object->element.'.png'; + + $px1->draw($filenamenb, $fileurlnb); + + print $px1->show($totalnbofrecord ? 0 : $langs->trans("SelectYourGraphOptionsFirst")); + } +} + +if ($sql) { + // Show admin info + print '
'.info_admin($langs->trans("SQLUsedForExport").':
'.$sql); +} + +print '
'; + +dol_fiche_end(); + + +// End of page +llxFooter(); + +$db->close(); From a915a4faaf118f898d3938e5194766e3039214ca Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 7 Feb 2020 11:14:13 +0100 Subject: [PATCH 122/306] FIX missing hook parameter --- htdocs/comm/propal/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index ae713bbab20..7f5c80b11e8 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -996,7 +996,7 @@ if ($resql) // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i); $reshook=$hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation From 53e1b807425252f2c28845f163c7fe980d87cfc3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 7 Feb 2020 11:52:55 +0100 Subject: [PATCH 123/306] FIX Disable ticket status change if ticket close FIX Use ref into label of ticket message --- htdocs/core/class/html.formticket.class.php | 10 +++++----- htdocs/ticket/card.php | 9 +++++---- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index d99a6c091cc..ecf137adb04 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -919,7 +919,7 @@ class FormTicket print '
'; $label_title = empty($conf->global->MAIN_APPLICATION_TITLE) ? $mysoc->name : $conf->global->MAIN_APPLICATION_TITLE; - print ''; // Destinataires @@ -935,13 +935,13 @@ class FormTicket if (is_array($contacts) && count($contacts) > 0) { foreach ($contacts as $key => $info_sendto) { if ($info_sendto['email'] != '') { - $sendto[] = dol_escape_htmltag(trim($info_sendto['firstname']." ".$info_sendto['lastname'])." <".$info_sendto['email'].">")." (".dol_escape_htmltag($info_sendto['libelle']).")"; + $sendto[] = dol_escape_htmltag(trim($info_sendto['firstname']." ".$info_sendto['lastname'])." <".$info_sendto['email'].">").' ('.dol_escape_htmltag($info_sendto['libelle']).")"; } } } if ($ticketstat->origin_email && !in_array($this->dao->origin_email, $sendto)) { - $sendto[] = dol_escape_htmltag($ticketstat->origin_email)." (".$langs->trans("TicketEmailOriginIssuer").")"; + $sendto[] = dol_escape_htmltag($ticketstat->origin_email).' ('.$langs->trans("TicketEmailOriginIssuer").")"; } if ($ticketstat->fk_soc > 0) { @@ -949,12 +949,12 @@ class FormTicket $ticketstat->fetch_thirdparty(); if (is_array($ticketstat->thirdparty->email) && !in_array($ticketstat->thirdparty->email, $sendto)) { - $sendto[] = $ticketstat->thirdparty->email.' ('.$langs->trans('Customer').')'; + $sendto[] = $ticketstat->thirdparty->email.' ('.$langs->trans('Customer').')'; } } if ($conf->global->TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS) { - $sendto[] = $conf->global->TICKET_NOTIFICATION_EMAIL_TO.' (generic email)'; + $sendto[] = $conf->global->TICKET_NOTIFICATION_EMAIL_TO.' (generic email)'; } // Print recipient list diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 940710ff55c..b64c20ed9e2 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -854,15 +854,15 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd // Creation date print ''; // Read date print ''; @@ -1034,7 +1034,7 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd // Display navbar with links to change ticket status print ''; - if (!$user->socid && $user->rights->ticket->write && $object->fk_status < 8 && GETPOST('set') !== 'properties') { + if (!$user->socid && $user->rights->ticket->write && $object->fk_statut < 8 && GETPOST('set') !== 'properties') { $actionobject->viewStatusActions($object); } @@ -1289,6 +1289,7 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd $formticket->action = $action; $formticket->track_id = $object->track_id; + $formticket->ref = $object->ref; $formticket->id = $object->id; $formticket->withfile = 2; From 54414f7bb0b5024b84ee78e50ff09a91b33f9c6b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 7 Feb 2020 11:53:09 +0100 Subject: [PATCH 124/306] WIP Generic report --- htdocs/core/customreports.php | 25 +++++++++++++++++++------ htdocs/core/lib/files.lib.php | 1 + htdocs/core/lib/security.lib.php | 5 ++++- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/htdocs/core/customreports.php b/htdocs/core/customreports.php index 45e15ba8de2..d29f9cb6b71 100644 --- a/htdocs/core/customreports.php +++ b/htdocs/core/customreports.php @@ -79,7 +79,7 @@ $arrayoftype = array( 'invoice_template'=>array('label' => 'PredefinedInvoices', 'ObjectClassName' => 'FactureRec'), 'bom' => array('label' => 'BOM', 'ObjectClassName' => 'Bom'), 'mo' => array('label' => 'MO', 'ObjectClassName' => 'Mo'), - 'ticket' => array('label' => 'Ticket', 'ObjectClassName' => 'Societe'), + 'ticket' => array('label' => 'Ticket', 'ObjectClassName' => 'Ticket'), ); if ($objecttype == 'thirdparty') { require_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"); @@ -104,7 +104,7 @@ elseif ($objecttype) { $parameters = array('objecttype'=>$objecttype, 'tabfamily'=>$tabfamily); $reshook = $hookmanager->executeHooks('loadDataForCustomReports', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); -else { +elseif (is_array($hookmanager->resArray)) { if (! empty($hookmanager->resArray['title'])) { // Add entries for tabs $title = $hookmanager->resArray['title']; } @@ -114,9 +114,9 @@ else { if (! empty($hookmanager->resArray['head'])) { // Add entries for tabs $head = array_merge($head, $hookmanager->resArray['head']); } - if (is_array($hookmanager->resArray) && ! empty($hookmanager->resArray)) { // Add entries from hook - foreach($hookmanager->resArray as $key => $val) { - $arrayoftype[$key] = $val['arrayoftype']; + if (! empty($hookmanager->resArray['arrayoftype'])) { // Add entries from hook + foreach($hookmanager->resArray['arrayoftype'] as $key => $val) { + $arrayoftype[$key] = $val; } } } @@ -134,6 +134,15 @@ else { } +// Security check +$socid = 0; +if ($user->socid > 0) // Protection if external user +{ + //$socid = $user->socid; + accessforbidden(); +} +$result = restrictedArea($user, $object->element, 0, ''); + // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); //$extrafields->fetch_name_optionals_label($object->table_element_line); @@ -213,6 +222,8 @@ foreach($object->fields as $key => $val) { if ($val['isameasure']) { $arrayofmesures['t.'.$key.'-sum'] = $langs->trans($val['label']).' ('.$langs->trans("Sum").')'; $arrayofmesures['t.'.$key.'-average'] = $langs->trans($val['label']).' ('.$langs->trans("Average").')'; + $arrayofmesures['t.'.$key.'-min'] = $langs->trans($val['label']).' ('.$langs->trans("Minimum").')'; + $arrayofmesures['t.'.$key.'-max'] = $langs->trans($val['label']).' ('.$langs->trans("Maximum").')'; } } // Add measure from extrafields @@ -221,6 +232,8 @@ if ($object->isextrafieldmanaged) { if (! empty($extrafields->attributes[$object->table_element]['totalizable'][$key])) { $arrayofmesures['te.'.$key.'-sum'] = $langs->trans($extrafields->attributes[$object->table_element]['label'][$key]).' ('.$langs->trans("Sum").')'; $arrayofmesures['te.'.$key.'-average'] = $langs->trans($extrafields->attributes[$object->table_element]['label'][$key]).' ('.$langs->trans("Average").')'; + $arrayofmesures['te.'.$key.'-min'] = $langs->trans($extrafields->attributes[$object->table_element]['label'][$key]).' ('.$langs->trans("Minimum").')'; + $arrayofmesures['te.'.$key.'-max'] = $langs->trans($extrafields->attributes[$object->table_element]['label'][$key]).' ('.$langs->trans("Maximum").')'; } } } @@ -234,7 +247,7 @@ 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 (isset($val['enabled']) && ! dol_eval($val['enabled'], 1)) continue; - if (preg_match('/^fk_/', $key)) continue; + if (preg_match('/^fk_/', $key) && ! preg_match('/^fk_statu/', $key)) continue; if (in_array($val['type'], array('html', 'text'))) continue; if (in_array($val['type'], array('timestamp', 'date', 'datetime'))) { $arrayofxaxis['t.'.$key.'-year'] = array('label' => $langs->trans($val['label']).' ('.$langs->trans("Year").')', 'position' => $val['position']); diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 4568ab2774d..38264ac9029 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -2912,6 +2912,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, if ($fuser->admin) $accessallowed = 1; // If user is admin // Define $accessallowed + $reg = array(); if (preg_match('/^([a-z]+)_user_temp$/i', $modulepart, $reg)) { if (empty($conf->{$reg[1]}->dir_temp)) // modulepart not supported diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 93f17422c47..1490169ec8d 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -168,7 +168,7 @@ function dol_verifyHash($chain, $hash, $type = '0') * If GETPOST('action','aZ09') defined, we also check write and delete permission. * * @param User $user User to check - * @param string $features Features to check (it must be module name. Examples: 'societe', 'contact', 'produit&service', 'produit|service', ...) + * @param string $features Features to check (it must be module $object->element. Examples: 'societe', 'contact', 'produit&service', 'produit|service', ...) * @param int $objectid Object ID if we want to check a particular record (optional) is linked to a owned thirdparty (optional). * @param string $tableandshare 'TableName&SharedElement' with Tablename is table where object is stored. SharedElement is an optional key to define where to check entity for multicompany modume. Param not used if objectid is null (optional). * @param string $feature2 Feature to check, second level of permission (optional). Can be a 'or' check with 'sublevela|sublevelb'. @@ -188,6 +188,9 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f //print ", dbtablename=".$dbtablename.", dbt_socfield=".$dbt_keyfield.", dbt_select=".$dbt_select; //print ", perm: ".$features."->".$feature2."=".($user->rights->$features->$feature2->lire)."
"; + if ($features == 'facturerec') $features = 'facture'; + if ($features == 'mo') $features = 'mrp'; + // Get more permissions checks from hooks $parameters = array('features'=>$features, 'objectid'=>$objectid, 'idtype'=>$dbt_select); $reshook = $hookmanager->executeHooks('restrictedArea', $parameters); From c4204f95d4ef4d97a1657f18a41213439dec381b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 7 Feb 2020 12:12:10 +0100 Subject: [PATCH 125/306] FIX Missing include --- htdocs/product/stock/product.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 5929a46edb8..af12804aac5 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -1018,7 +1018,8 @@ if (!$variants) { } } else { // List of variants - + include_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php'; + include_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination2ValuePair.class.php'; $prodstatic = new Product($db); $prodcomb = new ProductCombination($db); $comb2val = new ProductCombination2ValuePair($db); From 11c64470964bc03af0f4363de52e027a0461cf64 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 7 Feb 2020 12:13:55 +0100 Subject: [PATCH 126/306] Generic report --- .../template/class/actions_mymodule.class.php | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/htdocs/modulebuilder/template/class/actions_mymodule.class.php b/htdocs/modulebuilder/template/class/actions_mymodule.class.php index 743c46bfc39..45548c28312 100644 --- a/htdocs/modulebuilder/template/class/actions_mymodule.class.php +++ b/htdocs/modulebuilder/template/class/actions_mymodule.class.php @@ -238,5 +238,46 @@ class ActionsMyModule return $ret; } + + + /** + * Overloading the loadDataForCustomReports function : returns data to complete the customreport tool + * + * @param array $parameters Hook metadatas (context, etc...) + * @param string $action Current action (if set). Generally create or edit or null + * @param HookManager $hookmanager Hook manager propagated to allow calling another hook + * @return int < 0 on error, 0 on success, 1 to replace standard code + */ + public function loadDataForCustomReports($parameters, &$action, $hookmanager) + { + global $conf, $user, $langs; + + $langs->load("mymodule@mymodule"); + + $this->results = array(); + + $head = array(); + $h = 0; + + if ($parameters['tabfamily'] == 'mymodule') { + $head[$h][0] = dol_buildpath('/module/index.php', 1); + $head[$h][1] = $langs->trans("Home"); + $head[$h][2] = 'home'; + $h++; + + $this->results['title'] = $langs->trans("MyModule"); + $this->results['picto'] = 'mymodule@mymodule'; + } + + $head[$h][0] = 'customreports.php?objecttype='.$parameters['objecttype'].(empty($parameters['tabfamily'])?'':'&tabfamily='.$parameters['tabfamily']); + $head[$h][1] = $langs->trans("CustomReports"); + $head[$h][2] = 'customreports'; + + $this->results['head'] = $head; + + return 1; + } + + /* Add here any other hooked methods... */ } From 84c1228ad4b00120fb2f5a539661e2ae11680c1d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 7 Feb 2020 11:52:55 +0100 Subject: [PATCH 127/306] FIX Disable ticket status change if ticket close FIX Use ref into label of ticket message --- htdocs/core/class/html.formticket.class.php | 10 +++++----- htdocs/ticket/card.php | 9 +++++---- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index d99a6c091cc..ecf137adb04 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -919,7 +919,7 @@ class FormTicket print '
'; $label_title = empty($conf->global->MAIN_APPLICATION_TITLE) ? $mysoc->name : $conf->global->MAIN_APPLICATION_TITLE; - print ''; // Destinataires @@ -935,13 +935,13 @@ class FormTicket if (is_array($contacts) && count($contacts) > 0) { foreach ($contacts as $key => $info_sendto) { if ($info_sendto['email'] != '') { - $sendto[] = dol_escape_htmltag(trim($info_sendto['firstname']." ".$info_sendto['lastname'])." <".$info_sendto['email'].">")." (".dol_escape_htmltag($info_sendto['libelle']).")"; + $sendto[] = dol_escape_htmltag(trim($info_sendto['firstname']." ".$info_sendto['lastname'])." <".$info_sendto['email'].">").' ('.dol_escape_htmltag($info_sendto['libelle']).")"; } } } if ($ticketstat->origin_email && !in_array($this->dao->origin_email, $sendto)) { - $sendto[] = dol_escape_htmltag($ticketstat->origin_email)." (".$langs->trans("TicketEmailOriginIssuer").")"; + $sendto[] = dol_escape_htmltag($ticketstat->origin_email).' ('.$langs->trans("TicketEmailOriginIssuer").")"; } if ($ticketstat->fk_soc > 0) { @@ -949,12 +949,12 @@ class FormTicket $ticketstat->fetch_thirdparty(); if (is_array($ticketstat->thirdparty->email) && !in_array($ticketstat->thirdparty->email, $sendto)) { - $sendto[] = $ticketstat->thirdparty->email.' ('.$langs->trans('Customer').')'; + $sendto[] = $ticketstat->thirdparty->email.' ('.$langs->trans('Customer').')'; } } if ($conf->global->TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS) { - $sendto[] = $conf->global->TICKET_NOTIFICATION_EMAIL_TO.' (generic email)'; + $sendto[] = $conf->global->TICKET_NOTIFICATION_EMAIL_TO.' (generic email)'; } // Print recipient list diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 940710ff55c..b64c20ed9e2 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -854,15 +854,15 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd // Creation date print ''; // Read date print ''; @@ -1034,7 +1034,7 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd // Display navbar with links to change ticket status print ''; - if (!$user->socid && $user->rights->ticket->write && $object->fk_status < 8 && GETPOST('set') !== 'properties') { + if (!$user->socid && $user->rights->ticket->write && $object->fk_statut < 8 && GETPOST('set') !== 'properties') { $actionobject->viewStatusActions($object); } @@ -1289,6 +1289,7 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd $formticket->action = $action; $formticket->track_id = $object->track_id; + $formticket->ref = $object->ref; $formticket->id = $object->id; $formticket->withfile = 2; From 2eae9a2fa22001f03cf080d0a8968c30d3d3f11d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 7 Feb 2020 12:12:10 +0100 Subject: [PATCH 128/306] FIX Missing include --- htdocs/product/stock/product.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 5929a46edb8..af12804aac5 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -1018,7 +1018,8 @@ if (!$variants) { } } else { // List of variants - + include_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php'; + include_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination2ValuePair.class.php'; $prodstatic = new Product($db); $prodcomb = new ProductCombination($db); $comb2val = new ProductCombination2ValuePair($db); From cd58822d9810d0bca914173718bcd2883d4a8a1d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 7 Feb 2020 12:48:41 +0100 Subject: [PATCH 129/306] Can edit a table of resolution code for tickets --- htdocs/core/modules/modTicket.class.php | 20 ++++++------- .../mysql/data/llx_c_ticket_resolution.sql | 22 +++++++++++++++ .../install/mysql/migration/11.0.0-12.0.0.sql | 23 ++++++++++++++- .../tables/llx_c_ticket_resolution.key.sql | 18 ++++++++++++ .../mysql/tables/llx_c_ticket_resolution.sql | 28 +++++++++++++++++++ htdocs/langs/en_US/admin.lang | 1 + htdocs/langs/en_US/ticket.lang | 1 + 7 files changed, 102 insertions(+), 11 deletions(-) create mode 100644 htdocs/install/mysql/data/llx_c_ticket_resolution.sql create mode 100644 htdocs/install/mysql/tables/llx_c_ticket_resolution.key.sql create mode 100644 htdocs/install/mysql/tables/llx_c_ticket_resolution.sql diff --git a/htdocs/core/modules/modTicket.class.php b/htdocs/core/modules/modTicket.class.php index 8d7f16fcaf7..fbf560565ee 100644 --- a/htdocs/core/modules/modTicket.class.php +++ b/htdocs/core/modules/modTicket.class.php @@ -120,16 +120,16 @@ 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"), - 'tablib' => array("TicketDictType", "TicketDictSeverity", "TicketDictCategory"), - 'tabsql' => array('SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM ' . MAIN_DB_PREFIX . 'c_ticket_type as f', 'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM ' . MAIN_DB_PREFIX . 'c_ticket_severity as f', 'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM ' . MAIN_DB_PREFIX . 'c_ticket_category as f'), - 'tabsqlsort' => array("pos ASC", "pos ASC", "pos ASC"), - 'tabfield' => array("pos,code,label,use_default", "pos,code,label,use_default", "pos,code,label,use_default"), - 'tabfieldvalue' => array("pos,code,label,use_default", "pos,code,label,use_default", "pos,code,label,use_default"), - 'tabfieldinsert' => array("pos,code,label,use_default", "pos,code,label,use_default", "pos,code,label,use_default"), - 'tabrowid' => array("rowid", "rowid", "rowid"), - 'tabcond' => array($conf->ticket->enabled, $conf->ticket->enabled, $conf->ticket->enabled), - 'tabhelp' => array(array('code'=>$langs->trans("EnterAnyCode"), 'use_default'=>$langs->trans("Enter0or1")), array('code'=>$langs->trans("EnterAnyCode"), 'use_default'=>$langs->trans("Enter0or1")), array('code'=>$langs->trans("EnterAnyCode"), 'use_default'=>$langs->trans("Enter0or1"))), + '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"), + 'tablib' => array("TicketDictType", "TicketDictSeverity", "TicketDictCategory", "TicketDictResolution"), + 'tabsql' => array('SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM '.MAIN_DB_PREFIX.'c_ticket_type as f', 'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM '.MAIN_DB_PREFIX.'c_ticket_severity as f', 'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM '.MAIN_DB_PREFIX.'c_ticket_category as f', 'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM '.MAIN_DB_PREFIX.'c_ticket_resolution as f'), + 'tabsqlsort' => array("pos ASC", "pos ASC", "pos ASC", "pos ASC"), + 'tabfield' => array("pos,code,label,use_default", "pos,code,label,use_default", "pos,code,label,use_default", "pos,code,label,use_default"), + 'tabfieldvalue' => array("pos,code,label,use_default", "pos,code,label,use_default", "pos,code,label,use_default", "pos,code,label,use_default"), + 'tabfieldinsert' => array("pos,code,label,use_default", "pos,code,label,use_default", "pos,code,label,use_default", "pos,code,label,use_default"), + 'tabrowid' => array("rowid", "rowid", "rowid", "rowid"), + 'tabcond' => array($conf->ticket->enabled, $conf->ticket->enabled, $conf->ticket->enabled, $conf->ticket->enabled), + 'tabhelp' => array(array('code'=>$langs->trans("EnterAnyCode"), 'use_default'=>$langs->trans("Enter0or1")), array('code'=>$langs->trans("EnterAnyCode"), 'use_default'=>$langs->trans("Enter0or1")), array('code'=>$langs->trans("EnterAnyCode"), 'use_default'=>$langs->trans("Enter0or1")), array('code'=>$langs->trans("EnterAnyCode"), 'use_default'=>$langs->trans("Enter0or1"))), ); // Boxes diff --git a/htdocs/install/mysql/data/llx_c_ticket_resolution.sql b/htdocs/install/mysql/data/llx_c_ticket_resolution.sql new file mode 100644 index 00000000000..2fa139b602d --- /dev/null +++ b/htdocs/install/mysql/data/llx_c_ticket_resolution.sql @@ -0,0 +1,22 @@ +-- Copyright (C) 2018 Laurent Destailleur +-- +-- 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 +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- +-- +-- Contenu de la table llx_c_ticket_resolution +-- + +INSERT INTO llx_c_ticket_resolution (code, pos, label, active, use_default, description) VALUES('SOLVED', '10', 'Solved', 1, 0, NULL); +INSERT INTO llx_c_ticket_resolution (code, pos, label, active, use_default, description) VALUES('CANCELED', '50', 'Canceled', 1, 0, NULL); +INSERT INTO llx_c_ticket_resolution (code, pos, label, active, use_default, description) VALUES('OTHER', '90', 'Other', 1, 0, NULL); diff --git a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql index 7c63be071c2..c647ef122b2 100644 --- a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql +++ b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql @@ -133,4 +133,25 @@ UPDATE llx_c_forme_juridique set libelle = 'SRL - Société à responsabilité l ALTER TABLE llx_c_country ADD COLUMN eec integer; UPDATE llx_c_country SET eec = 1 WHERE code IN ('AT','BE','BG','CY','CZ','DE','DK','EE','ES','FI','FR','GB','GR','HR','NL','HU','IE','IM','IT','LT','LU','LV','MC','MT','PL','PT','RO','SE','SK','SI','UK'); -INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 1, 'PCG18-ASSOC', 'French foundation chart of accounts 2018', 1); \ No newline at end of file +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 1, 'PCG18-ASSOC', 'French foundation chart of accounts 2018', 1); + + + +create table llx_c_ticket_resolution +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + entity integer DEFAULT 1, + code varchar(32) NOT NULL, + pos varchar(32) NOT NULL, + label varchar(128) NOT NULL, + active integer DEFAULT 1, + use_default integer DEFAULT 1, + description varchar(255) +)ENGINE=innodb; + +ALTER TABLE llx_c_ticket_resolution ADD UNIQUE INDEX uk_code (code, entity); + +INSERT INTO llx_c_ticket_resolution (code, pos, label, active, use_default, description) VALUES('SOLVED', '10', 'Solved', 1, 0, NULL); +INSERT INTO llx_c_ticket_resolution (code, pos, label, active, use_default, description) VALUES('CANCELED', '50', 'Canceled', 1, 0, NULL); +INSERT INTO llx_c_ticket_resolution (code, pos, label, active, use_default, description) VALUES('OTHER', '90', 'Other', 1, 0, NULL); + diff --git a/htdocs/install/mysql/tables/llx_c_ticket_resolution.key.sql b/htdocs/install/mysql/tables/llx_c_ticket_resolution.key.sql new file mode 100644 index 00000000000..ac3690b70bb --- /dev/null +++ b/htdocs/install/mysql/tables/llx_c_ticket_resolution.key.sql @@ -0,0 +1,18 @@ +-- Copyright (C) 2020 Laurent Destailleur +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- +-- + +ALTER TABLE llx_c_ticket_resolution ADD UNIQUE INDEX uk_code (code, entity); diff --git a/htdocs/install/mysql/tables/llx_c_ticket_resolution.sql b/htdocs/install/mysql/tables/llx_c_ticket_resolution.sql new file mode 100644 index 00000000000..2f6d0d1d3da --- /dev/null +++ b/htdocs/install/mysql/tables/llx_c_ticket_resolution.sql @@ -0,0 +1,28 @@ +-- Copyright (C) 2020 Laurent Destailleur +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- +-- + +create table llx_c_ticket_resolution +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + entity integer DEFAULT 1, + code varchar(32) NOT NULL, + pos varchar(32) NOT NULL, + label varchar(128) NOT NULL, + active integer DEFAULT 1, + use_default integer DEFAULT 1, + description varchar(255) +)ENGINE=innodb; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 7d2d622887e..6ec05d5e956 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1794,6 +1794,7 @@ BackgroundTableLineEvenColor=Background color for even table lines MinimumNoticePeriod=Minimum notice period (Your leave request must be done before this delay) NbAddedAutomatically=Number of days added to counters of users (automatically) each month EnterAnyCode=This field contains a reference to identify line. Enter any value of your choice, but without special characters. +Enter0or1=Enter 0 or 1 UnicodeCurrency=Enter here between braces, list of byte number that represent the currency symbol. For example: for $, enter [36] - for brazil real R$ [82,36] - for €, enter [8364] ColorFormat=The RGB color is in HEX format, eg: FF0000 PositionIntoComboList=Position of line into combo lists diff --git a/htdocs/langs/en_US/ticket.lang b/htdocs/langs/en_US/ticket.lang index f29c2f4a5ba..2a6c5bb3308 100644 --- a/htdocs/langs/en_US/ticket.lang +++ b/htdocs/langs/en_US/ticket.lang @@ -30,6 +30,7 @@ Permission56005=See tickets of all third parties (not effective for external use TicketDictType=Ticket - Types TicketDictCategory=Ticket - Groupes TicketDictSeverity=Ticket - Severities +TicketDictResolution=Ticket - Resolution TicketTypeShortBUGSOFT=Dysfonctionnement logiciel TicketTypeShortBUGHARD=Dysfonctionnement matériel TicketTypeShortCOM=Commercial question From d9fda71a230be027c102627a2365987b4b5122c5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 7 Feb 2020 12:51:08 +0100 Subject: [PATCH 130/306] Fix phpcs --- htdocs/core/customreports.php | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/htdocs/core/customreports.php b/htdocs/core/customreports.php index d29f9cb6b71..fbac65a1942 100644 --- a/htdocs/core/customreports.php +++ b/htdocs/core/customreports.php @@ -22,10 +22,10 @@ */ require '../main.inc.php'; -require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/core/lib/company.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/core/class/dolgraph.class.php"); -require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php"); +require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"; +require_once DOL_DOCUMENT_ROOT."/core/lib/company.lib.php"; +require_once DOL_DOCUMENT_ROOT."/core/class/dolgraph.class.php"; +require_once DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php"; // Load traductions files requiredby by page $langs->loadLangs(array("companies", "contracts", "bills", "other", "exports")); @@ -34,7 +34,7 @@ $langs->loadLangs(array("companies", "contracts", "bills", "other", "exports")); $action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) -$mode = GETPOST('mode','alpha') ? GETPOST('mode','alpha') : 'graph'; +$mode = GETPOST('mode', 'alpha') ? GETPOST('mode', 'alpha') : 'graph'; $objecttype = GETPOST('objecttype', 'aZ09'); $tabfamily = GETPOST('tabfamily', 'aZ09'); @@ -82,22 +82,22 @@ $arrayoftype = array( 'ticket' => array('label' => 'Ticket', 'ObjectClassName' => 'Ticket'), ); if ($objecttype == 'thirdparty') { - require_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"); + require_once DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"; } elseif ($objecttype == 'contract') { - require_once(DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php"); + require_once DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php"; } elseif ($objecttype == 'invoice') { - require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php"); + require_once DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php"; } elseif ($objecttype == 'invoice_template') { - require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture-rec.class.php"); + require_once DOL_DOCUMENT_ROOT."/compta/facture/class/facture-rec.class.php"; } elseif ($objecttype == 'mo') { - require_once(DOL_DOCUMENT_ROOT."/mrp/class/mo.class.php"); + require_once DOL_DOCUMENT_ROOT."/mrp/class/mo.class.php" ; } elseif ($objecttype) { - require_once(DOL_DOCUMENT_ROOT."/".$objecttype."/class/".$objecttype.".class.php"); + require_once DOL_DOCUMENT_ROOT."/".$objecttype."/class/".$objecttype.".class.php"; } // Complete $arrayoftype @@ -130,9 +130,6 @@ if ($objecttype) { print 'Failed to load class for type '.$objecttype; } } -else { - -} // Security check $socid = 0; @@ -364,7 +361,7 @@ if (! empty($search_measures) && ! empty($search_xaxis)) $sql .= ' WHERE 1 = 1'; $sql .= ' AND entity IN ('.getEntity($object->element).')'; foreach($search_filters as $key => $val) { - + // TODO } $sql .= ' GROUP BY '; foreach($search_xaxis as $key => $val) { @@ -439,8 +436,7 @@ print '
array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>40), 'date_contrat' =>array('type'=>'datetime', 'label'=>'Date contrat', 'enabled'=>1, 'visible'=>-1, 'position'=>45), 'statut' =>array('type'=>'smallint(6)', 'label'=>'Statut', 'enabled'=>1, 'visible'=>-1, 'position'=>500, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Validated', 2=>'Closed')), - 'mise_en_service' =>array('type'=>'datetime', 'label'=>'Mise en service', 'enabled'=>1, 'visible'=>-1, 'position'=>55), 'fin_validite' =>array('type'=>'datetime', 'label'=>'Fin validite', 'enabled'=>1, 'visible'=>-1, 'position'=>60), 'date_cloture' =>array('type'=>'datetime', 'label'=>'Date cloture', 'enabled'=>1, 'visible'=>-1, 'position'=>65), 'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>70), @@ -240,7 +239,6 @@ class Contrat extends CommonObject 'fk_commercial_signature' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk commercial signature', 'enabled'=>1, 'visible'=>-1, 'position'=>80), 'fk_commercial_suivi' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk commercial suivi', 'enabled'=>1, 'visible'=>-1, 'position'=>85), 'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk user author', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>90), - 'fk_user_mise_en_service' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk user mise en service', 'enabled'=>1, 'visible'=>-1, 'position'=>95), 'fk_user_cloture' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk user cloture', 'enabled'=>1, 'visible'=>-1, 'position'=>100), 'note_private' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>105), 'note_public' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>110), @@ -696,11 +694,11 @@ class Contrat extends CommonObject */ public function fetch($id, $ref = '', $ref_customer = '', $ref_supplier = '') { - $sql = "SELECT rowid, statut, ref, fk_soc, mise_en_service as datemise,"; + $sql = "SELECT rowid, statut, ref, fk_soc,"; $sql .= " ref_supplier, ref_customer,"; $sql .= " ref_ext,"; $sql .= " entity,"; - $sql .= " fk_user_mise_en_service, date_contrat as datecontrat,"; + $sql .= " date_contrat as datecontrat,"; $sql .= " fk_user_author, fin_validite, date_cloture,"; $sql .= " fk_projet as fk_project,"; $sql .= " fk_commercial_signature, fk_commercial_suivi,"; @@ -744,7 +742,6 @@ class Contrat extends CommonObject $this->ref_ext = $obj->ref_ext; $this->entity = $obj->entity; $this->statut = $obj->statut; - $this->mise_en_service = $this->db->jdate($obj->datemise); $this->date_contrat = $this->db->jdate($obj->datecontrat); $this->date_creation = $this->db->jdate($obj->datecontrat); @@ -1367,7 +1364,6 @@ class Contrat extends CommonObject if (isset($this->fk_soc)) $this->fk_soc = (int) $this->fk_soc; if (isset($this->fk_commercial_signature)) $this->fk_commercial_signature = trim($this->fk_commercial_signature); if (isset($this->fk_commercial_suivi)) $this->fk_commercial_suivi = trim($this->fk_commercial_suivi); - if (isset($this->fk_user_mise_en_service)) $this->fk_user_mise_en_service = (int) $this->fk_user_mise_en_service; if (isset($this->fk_user_cloture)) $this->fk_user_cloture = (int) $this->fk_user_cloture; if (isset($this->note_private)) $this->note_private = trim($this->note_private); if (isset($this->note_public)) $this->note_public = trim($this->note_public); @@ -1386,14 +1382,12 @@ class Contrat extends CommonObject $sql .= " entity=".$conf->entity.","; $sql .= " date_contrat=".(dol_strlen($this->date_contrat) != 0 ? "'".$this->db->idate($this->date_contrat)."'" : 'null').","; $sql .= " statut=".(isset($this->statut) ? $this->statut : "null").","; - $sql .= " mise_en_service=".(dol_strlen($this->mise_en_service) != 0 ? "'".$this->db->idate($this->mise_en_service)."'" : 'null').","; $sql .= " fin_validite=".(dol_strlen($this->fin_validite) != 0 ? "'".$this->db->idate($this->fin_validite)."'" : 'null').","; $sql .= " date_cloture=".(dol_strlen($this->date_cloture) != 0 ? "'".$this->db->idate($this->date_cloture)."'" : 'null').","; $sql .= " fk_soc=".($this->fk_soc > 0 ? $this->fk_soc : "null").","; $sql .= " fk_projet=".($this->fk_project > 0 ? $this->fk_project : "null").","; $sql .= " fk_commercial_signature=".(isset($this->fk_commercial_signature) ? $this->fk_commercial_signature : "null").","; $sql .= " fk_commercial_suivi=".(isset($this->fk_commercial_suivi) ? $this->fk_commercial_suivi : "null").","; - $sql .= " fk_user_mise_en_service=".(isset($this->fk_user_mise_en_service) ? $this->fk_user_mise_en_service : "null").","; $sql .= " fk_user_cloture=".(isset($this->fk_user_cloture) ? $this->fk_user_cloture : "null").","; $sql .= " note_private=".(isset($this->note_private) ? "'".$this->db->escape($this->note_private)."'" : "null").","; $sql .= " note_public=".(isset($this->note_public) ? "'".$this->db->escape($this->note_public)."'" : "null").","; diff --git a/htdocs/core/customreports.php b/htdocs/core/customreports.php index dca4da544c9..31923fa7b95 100644 --- a/htdocs/core/customreports.php +++ b/htdocs/core/customreports.php @@ -309,7 +309,7 @@ if ($mode == 'grid') { if ($mode == 'graph') { print '
'; - $arrayofgraphs = array('line', 'bars'); // also 'pies' + $arrayofgraphs = array('bars', 'line'); // also 'pies' print '
'.$langs->trans("Graph").'
'; print $form->selectarray('search_graph', $arrayofgraphs, $search_graph, 0, 0, 'minwidth100', 1); print '
'; diff --git a/htdocs/core/modules/modContrat.class.php b/htdocs/core/modules/modContrat.class.php index fe846c1fd4c..3b8a7aa3f8b 100644 --- a/htdocs/core/modules/modContrat.class.php +++ b/htdocs/core/modules/modContrat.class.php @@ -165,7 +165,7 @@ class modContrat extends DolibarrModules $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode', 's.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode', 's.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra', - 'co.rowid'=>"Id",'co.ref'=>"Ref",'co.datec'=>"DateCreation",'co.date_contrat'=>"DateContract",'co.mise_en_service'=>"ContractStartDate", + 'co.rowid'=>"Id",'co.ref'=>"Ref",'co.datec'=>"DateCreation",'co.date_contrat'=>"DateContract", 'co.fin_validite'=>"ContractEndDate",'co.date_cloture'=>"Closing",'co.note_private'=>"NotePrivate",'co.note_public'=>"NotePublic", 'cod.rowid'=>'LineId','cod.label'=>"LineLabel",'cod.description'=>"LineDescription",'cod.price_ht'=>"LineUnitPrice",'cod.tva_tx'=>"LineVATRate", 'cod.qty'=>"LineQty",'cod.total_ht'=>"LineTotalHT",'cod.total_tva'=>"LineTotalVAT",'cod.total_ttc'=>"LineTotalTTC", @@ -175,7 +175,7 @@ class modContrat extends DolibarrModules $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company', 's.town'=>'company','c.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company', 's.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company', - 'co.rowid'=>"contract",'co.ref'=>"contract",'co.datec'=>"contract",'co.date_contrat'=>"contract",'co.mise_en_service'=>"contract", + 'co.rowid'=>"contract",'co.ref'=>"contract",'co.datec'=>"contract",'co.date_contrat'=>"contract", 'co.fin_validite'=>"contract",'co.date_cloture'=>"contract",'co.note_private'=>"contract",'co.note_public'=>"contract", 'cod.rowid'=>'contract_line','cod.label'=>"contract_line",'cod.description'=>"contract_line",'cod.price_ht'=>"contract_line",'cod.tva_tx'=>"contract_line", 'cod.qty'=>"contract_line",'cod.total_ht'=>"contract_line",'cod.total_tva'=>"contract_line",'cod.total_ttc'=>"contract_line", @@ -185,7 +185,7 @@ class modContrat extends DolibarrModules $this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text', 's.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text', 's.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text', - 'co.ref'=>"Text",'co.datec'=>"Date",'co.date_contrat'=>"Date",'co.mise_en_service'=>"Date", + 'co.ref'=>"Text",'co.datec'=>"Date",'co.date_contrat'=>"Date", 'co.fin_validite'=>"Date",'co.date_cloture'=>"Date",'co.note_private'=>"Text",'co.note_public'=>"Text", 'cod.label'=>"Text",'cod.description'=>"Text",'cod.price_ht'=>"Numeric",'cod.tva_tx'=>"Numeric", 'cod.qty'=>"Numeric",'cod.total_ht'=>"Numeric",'cod.total_tva'=>"Numeric",'cod.total_ttc'=>"Numeric", diff --git a/htdocs/install/mysql/tables/llx_contrat.sql b/htdocs/install/mysql/tables/llx_contrat.sql index d3f84a8bb6c..fbb36a5674b 100644 --- a/htdocs/install/mysql/tables/llx_contrat.sql +++ b/htdocs/install/mysql/tables/llx_contrat.sql @@ -30,7 +30,6 @@ create table llx_contrat datec datetime, -- creation date date_contrat datetime, statut smallint DEFAULT 0, -- not used. deprecated - mise_en_service datetime, fin_validite datetime, date_cloture datetime, fk_soc integer NOT NULL, @@ -39,7 +38,6 @@ create table llx_contrat fk_commercial_suivi integer, -- obsolete fk_user_author integer NOT NULL default 0, fk_user_modif integer, - fk_user_mise_en_service integer, fk_user_cloture integer, note_private text, note_public text, diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index c5d1d7837e9..a1da7bef43a 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -983,7 +983,7 @@ function migrate_contracts_det($db, $langs, $conf) print '
'; print ''.$langs->trans('MigrationContractsUpdate')."
\n"; - $sql = "SELECT c.rowid as cref, c.date_contrat, c.statut, c.mise_en_service, c.fin_validite, c.date_cloture, c.fk_product, c.fk_facture, c.fk_user_author,"; + $sql = "SELECT c.rowid as cref, c.date_contrat, c.statut, c.fin_validite, c.date_cloture, c.fk_product, c.fk_facture, c.fk_user_author,"; $sql .= " p.ref, p.label, p.description, p.price, p.tva_tx, p.duration, cd.rowid"; $sql .= " FROM ".MAIN_DB_PREFIX."contrat as c"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p"; @@ -1014,15 +1014,15 @@ function migrate_contracts_det($db, $langs, $conf) $sql .= "date_ouverture_prevue, date_ouverture, date_fin_validite, tva_tx, qty,"; $sql .= "subprice, price_ht, fk_user_author, fk_user_ouverture)"; $sql .= " VALUES ("; - $sql .= $obj->cref.",".($obj->fk_product ? $obj->fk_product : 0).","; - $sql .= ($obj->mise_en_service ? "4" : "0").","; - $sql .= "'".$db->escape($obj->label)."', null,"; - $sql .= ($obj->mise_en_service ? "'".$obj->mise_en_service."'" : ($obj->date_contrat ? "'".$obj->date_contrat."'" : "null")).","; - $sql .= ($obj->mise_en_service ? "'".$obj->mise_en_service."'" : "null").","; - $sql .= ($obj->fin_validite ? "'".$obj->fin_validite."'" : "null").","; - $sql .= "'".$obj->tva_tx."', 1,"; - $sql .= "'".$obj->price."', '".$obj->price."',".$obj->fk_user_author.","; - $sql .= ($obj->mise_en_service ? $obj->fk_user_author : "null"); + $sql .= $obj->cref.", ".($obj->fk_product ? $obj->fk_product : 0).", "; + $sql .= "0, "; + $sql .= "'".$db->escape($obj->label)."', null, "; + $sql .= ($obj->date_contrat ? "'".$obj->date_contrat."'" : "null").", "; + $sql .= "null, "; + $sql .= ($obj->fin_validite ? "'".$obj->fin_validite."'" : "null").", "; + $sql .= "'".$obj->tva_tx."' , 1, "; + $sql .= "'".$obj->price."', '".$obj->price."', ".$obj->fk_user_author.","; + $sql .= "null"; $sql .= ")"; if ($db->query($sql)) From 9fdef6858bf98bad6492eae9243bc58d908d821e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 7 Feb 2020 13:37:37 +0100 Subject: [PATCH 133/306] Remove code using a no more used field --- htdocs/contrat/class/contrat.class.php | 29 +++----------------------- htdocs/install/upgrade2.php | 4 ++-- 2 files changed, 5 insertions(+), 28 deletions(-) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 99294483491..1f77e1905cf 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -165,12 +165,6 @@ class Contrat extends CommonObject */ public $date_contrat; - /** - * @var integer|string Date of contract closure - * @deprecated we close contract lines, not a contract - */ - public $date_cloture; - public $commercial_signature_id; public $commercial_suivi_id; @@ -232,14 +226,11 @@ class Contrat extends CommonObject 'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>40), 'date_contrat' =>array('type'=>'datetime', 'label'=>'Date contrat', 'enabled'=>1, 'visible'=>-1, 'position'=>45), 'statut' =>array('type'=>'smallint(6)', 'label'=>'Statut', 'enabled'=>1, 'visible'=>-1, 'position'=>500, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Validated', 2=>'Closed')), - 'fin_validite' =>array('type'=>'datetime', 'label'=>'Fin validite', 'enabled'=>1, 'visible'=>-1, 'position'=>60), - 'date_cloture' =>array('type'=>'datetime', 'label'=>'Date cloture', 'enabled'=>1, 'visible'=>-1, 'position'=>65), 'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>70), 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Fk projet', 'enabled'=>1, 'visible'=>-1, 'position'=>75), 'fk_commercial_signature' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk commercial signature', 'enabled'=>1, 'visible'=>-1, 'position'=>80), 'fk_commercial_suivi' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk commercial suivi', 'enabled'=>1, 'visible'=>-1, 'position'=>85), 'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk user author', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>90), - 'fk_user_cloture' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk user cloture', 'enabled'=>1, 'visible'=>-1, 'position'=>100), 'note_private' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>105), 'note_public' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>110), 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>115), @@ -699,7 +690,7 @@ class Contrat extends CommonObject $sql .= " ref_ext,"; $sql .= " entity,"; $sql .= " date_contrat as datecontrat,"; - $sql .= " fk_user_author, fin_validite, date_cloture,"; + $sql .= " fk_user_author,"; $sql .= " fk_projet as fk_project,"; $sql .= " fk_commercial_signature, fk_commercial_suivi,"; $sql .= " note_private, note_public, model_pdf, extraparams"; @@ -746,10 +737,6 @@ class Contrat extends CommonObject $this->date_contrat = $this->db->jdate($obj->datecontrat); $this->date_creation = $this->db->jdate($obj->datecontrat); - $this->fin_validite = $this->db->jdate($obj->fin_validite); - $this->date_cloture = $this->db->jdate($obj->date_cloture); - - $this->user_author_id = $obj->fk_user_author; $this->commercial_signature_id = $obj->fk_commercial_signature; @@ -1364,7 +1351,6 @@ class Contrat extends CommonObject if (isset($this->fk_soc)) $this->fk_soc = (int) $this->fk_soc; if (isset($this->fk_commercial_signature)) $this->fk_commercial_signature = trim($this->fk_commercial_signature); if (isset($this->fk_commercial_suivi)) $this->fk_commercial_suivi = trim($this->fk_commercial_suivi); - if (isset($this->fk_user_cloture)) $this->fk_user_cloture = (int) $this->fk_user_cloture; if (isset($this->note_private)) $this->note_private = trim($this->note_private); if (isset($this->note_public)) $this->note_public = trim($this->note_public); if (isset($this->import_key)) $this->import_key = trim($this->import_key); @@ -1382,13 +1368,10 @@ class Contrat extends CommonObject $sql .= " entity=".$conf->entity.","; $sql .= " date_contrat=".(dol_strlen($this->date_contrat) != 0 ? "'".$this->db->idate($this->date_contrat)."'" : 'null').","; $sql .= " statut=".(isset($this->statut) ? $this->statut : "null").","; - $sql .= " fin_validite=".(dol_strlen($this->fin_validite) != 0 ? "'".$this->db->idate($this->fin_validite)."'" : 'null').","; - $sql .= " date_cloture=".(dol_strlen($this->date_cloture) != 0 ? "'".$this->db->idate($this->date_cloture)."'" : 'null').","; $sql .= " fk_soc=".($this->fk_soc > 0 ? $this->fk_soc : "null").","; $sql .= " fk_projet=".($this->fk_project > 0 ? $this->fk_project : "null").","; $sql .= " fk_commercial_signature=".(isset($this->fk_commercial_signature) ? $this->fk_commercial_signature : "null").","; $sql .= " fk_commercial_suivi=".(isset($this->fk_commercial_suivi) ? $this->fk_commercial_suivi : "null").","; - $sql .= " fk_user_cloture=".(isset($this->fk_user_cloture) ? $this->fk_user_cloture : "null").","; $sql .= " note_private=".(isset($this->note_private) ? "'".$this->db->escape($this->note_private)."'" : "null").","; $sql .= " note_public=".(isset($this->note_public) ? "'".$this->db->escape($this->note_public)."'" : "null").","; $sql .= " import_key=".(isset($this->import_key) ? "'".$this->db->escape($this->import_key)."'" : "null").""; @@ -2090,9 +2073,9 @@ class Contrat extends CommonObject */ public function info($id) { - $sql = "SELECT c.rowid, c.ref, c.datec, c.date_cloture,"; + $sql = "SELECT c.rowid, c.ref, c.datec,"; $sql .= " c.tms as date_modification,"; - $sql .= " fk_user_author, fk_user_cloture"; + $sql .= " fk_user_author"; $sql .= " FROM ".MAIN_DB_PREFIX."contrat as c"; $sql .= " WHERE c.rowid = ".$id; @@ -2111,15 +2094,9 @@ class Contrat extends CommonObject $this->user_creation = $cuser; } - if ($obj->fk_user_cloture) { - $cuser = new User($this->db); - $cuser->fetch($obj->fk_user_cloture); - $this->user_cloture = $cuser; - } $this->ref = (!$obj->ref) ? $obj->rowid : $obj->ref; $this->date_creation = $this->db->jdate($obj->datec); $this->date_modification = $this->db->jdate($obj->date_modification); - $this->date_cloture = $this->db->jdate($obj->date_cloture); } $this->db->free($result); diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index a1da7bef43a..b3ff583042d 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -983,7 +983,7 @@ function migrate_contracts_det($db, $langs, $conf) print '
'; print ''.$langs->trans('MigrationContractsUpdate')."
\n"; - $sql = "SELECT c.rowid as cref, c.date_contrat, c.statut, c.fin_validite, c.date_cloture, c.fk_product, c.fk_facture, c.fk_user_author,"; + $sql = "SELECT c.rowid as cref, c.date_contrat, c.statut, c.fk_product, c.fk_facture, c.fk_user_author,"; $sql .= " p.ref, p.label, p.description, p.price, p.tva_tx, p.duration, cd.rowid"; $sql .= " FROM ".MAIN_DB_PREFIX."contrat as c"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p"; @@ -1019,7 +1019,7 @@ function migrate_contracts_det($db, $langs, $conf) $sql .= "'".$db->escape($obj->label)."', null, "; $sql .= ($obj->date_contrat ? "'".$obj->date_contrat."'" : "null").", "; $sql .= "null, "; - $sql .= ($obj->fin_validite ? "'".$obj->fin_validite."'" : "null").", "; + $sql .= "null, "; $sql .= "'".$obj->tva_tx."' , 1, "; $sql .= "'".$obj->price."', '".$obj->price."', ".$obj->fk_user_author.","; $sql .= "null"; From ecea726323b695197955d1fd01544aa7aa26cfbb Mon Sep 17 00:00:00 2001 From: atm-lena Date: Fri, 7 Feb 2020 14:53:42 +0100 Subject: [PATCH 134/306] FIX CA by prod list filter --- htdocs/compta/stats/cabyprodserv.php | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php index e7a3d4da480..a2a8b734b17 100644 --- a/htdocs/compta/stats/cabyprodserv.php +++ b/htdocs/compta/stats/cabyprodserv.php @@ -122,22 +122,24 @@ $year_end = $tmpe['year']; $nbofyear = ($year_end - $year_start) + 1; $commonparams=array(); -$commonparams['modecompta']=$modecompta; -$commonparams['sortorder'] = $sortorder; -$commonparams['sortfield'] = $sortfield; +if(!empty($modecompta)) $commonparams['modecompta']=$modecompta; +if(!empty($sortorder)) $commonparams['sortorder'] = $sortorder; +if(!empty($sortfield)) $commonparams['sortfield'] = $sortfield; $headerparams = array(); -$headerparams['date_startyear'] = $date_startyear; -$headerparams['date_startmonth'] = $date_startmonth; -$headerparams['date_startday'] = $date_startday; -$headerparams['date_endyear'] = $date_endyear; -$headerparams['date_endmonth'] = $date_endmonth; -$headerparams['date_endday'] = $date_endday; +if(!empty($date_startyear)) $headerparams['date_startyear'] = $date_startyear; +if(!empty($date_startmonth)) $headerparams['date_startmonth'] = $date_startmonth; +if(!empty($date_startday)) $headerparams['date_startday'] = $date_startday; +if(!empty($date_endyear)) $headerparams['date_endyear'] = $date_endyear; +if(!empty($date_endmonth)) $headerparams['date_endmonth'] = $date_endmonth; +if(!empty($date_endday)) $headerparams['date_endday'] = $date_endday; +if(!empty($year)) $headerparams['year'] = $year; +if(!empty($month)) $headerparams['month'] = $month; $headerparams['q'] = $q; $tableparams = array(); -$tableparams['search_categ'] = $selected_cat; -$tableparams['search_type'] = $selected_type; +if(!empty($selected_cat)) $tableparams['search_categ'] = $selected_cat; +if(!empty($selected_type)) $tableparams['search_type'] = $selected_type; $tableparams['subcat'] = ($subcat === true)?'yes':''; // Adding common parameters From fe7b79c83cba3224b7f4b8a603537ec13bc36c69 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 7 Feb 2020 15:51:14 +0100 Subject: [PATCH 135/306] Fix definition of objects --- .../facture/class/facture-rec.class.php | 19 +++++++++---------- htdocs/compta/facture/class/facture.class.php | 2 +- htdocs/core/customreports.php | 1 + .../install/mysql/migration/11.0.0-12.0.0.sql | 2 ++ 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 8a25ee42745..fdffc320880 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -128,8 +128,8 @@ class FactureRec extends CommonInvoice 'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>30), //'amount' =>array('type'=>'double(24,8)', 'label'=>'Amount', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>35), 'remise' =>array('type'=>'double', 'label'=>'Remise', 'enabled'=>1, 'visible'=>-1, 'position'=>40), - 'remise_percent' =>array('type'=>'double', 'label'=>'Remise percent', 'enabled'=>1, 'visible'=>-1, 'position'=>45), - 'remise_absolue' =>array('type'=>'double', 'label'=>'Remise absolue', 'enabled'=>1, 'visible'=>-1, 'position'=>50), + //'remise_percent' =>array('type'=>'double', 'label'=>'Remise percent', 'enabled'=>1, 'visible'=>-1, 'position'=>45), + //'remise_absolue' =>array('type'=>'double', 'label'=>'Remise absolue', 'enabled'=>1, 'visible'=>-1, 'position'=>50), 'tva' =>array('type'=>'double(24,8)', 'label'=>'Tva', 'enabled'=>1, 'visible'=>-1, 'position'=>55, 'isameasure'=>1), 'localtax1' =>array('type'=>'double(24,8)', 'label'=>'Localtax1', 'enabled'=>1, 'visible'=>-1, 'position'=>60, 'isameasure'=>1), 'localtax2' =>array('type'=>'double(24,8)', 'label'=>'Localtax2', 'enabled'=>1, 'visible'=>-1, 'position'=>65, 'isameasure'=>1), @@ -150,20 +150,19 @@ class FactureRec extends CommonInvoice 'nb_gen_done' =>array('type'=>'integer', 'label'=>'Nb gen done', 'enabled'=>1, 'visible'=>-1, 'position'=>140), 'nb_gen_max' =>array('type'=>'integer', 'label'=>'Nb gen max', 'enabled'=>1, 'visible'=>-1, 'position'=>145), 'frequency' =>array('type'=>'integer', 'label'=>'Frequency', 'enabled'=>1, 'visible'=>-1, 'position'=>150), - 'usenewprice' =>array('type'=>'integer', 'label'=>'Usenewprice', 'enabled'=>1, 'visible'=>-1, 'position'=>155), - 'revenuestamp' =>array('type'=>'double(24,8)', 'label'=>'Revenuestamp', 'enabled'=>1, 'visible'=>-1, 'position'=>160), + 'usenewprice' =>array('type'=>'integer', 'label'=>'UseNewPrice', 'enabled'=>1, 'visible'=>0, 'position'=>155), + 'revenuestamp' =>array('type'=>'double(24,8)', 'label'=>'RevenueStamp', 'enabled'=>1, 'visible'=>-1, 'position'=>160, 'isameasure'=>1), 'auto_validate' =>array('type'=>'integer', 'label'=>'Auto validate', 'enabled'=>1, 'visible'=>-1, 'position'=>165), 'generate_pdf' =>array('type'=>'integer', 'label'=>'Generate pdf', 'enabled'=>1, 'visible'=>-1, 'position'=>170), 'fk_account' =>array('type'=>'integer', 'label'=>'Fk account', 'enabled'=>1, 'visible'=>-1, 'position'=>175), 'fk_multicurrency' =>array('type'=>'integer', 'label'=>'Fk multicurrency', 'enabled'=>1, 'visible'=>-1, 'position'=>180), 'multicurrency_code' =>array('type'=>'varchar(255)', 'label'=>'Multicurrency code', 'enabled'=>1, 'visible'=>-1, 'position'=>185), - 'multicurrency_tx' =>array('type'=>'double(24,8)', 'label'=>'Multicurrency tx', 'enabled'=>1, 'visible'=>-1, 'position'=>190), - 'multicurrency_total_ht' =>array('type'=>'double(24,8)', 'label'=>'Multicurrency total ht', 'enabled'=>1, 'visible'=>-1, 'position'=>195), - 'multicurrency_total_tva' =>array('type'=>'double(24,8)', 'label'=>'Multicurrency total tva', 'enabled'=>1, 'visible'=>-1, 'position'=>200), - 'multicurrency_total_ttc' =>array('type'=>'double(24,8)', 'label'=>'Multicurrency total ttc', 'enabled'=>1, 'visible'=>-1, 'position'=>205), + 'multicurrency_tx' =>array('type'=>'double(24,8)', 'label'=>'Multicurrency tx', 'enabled'=>1, 'visible'=>-1, 'position'=>190, 'isameasure'=>1), + 'multicurrency_total_ht' =>array('type'=>'double(24,8)', 'label'=>'Multicurrency total ht', 'enabled'=>1, 'visible'=>-1, 'position'=>195, 'isameasure'=>1), + 'multicurrency_total_tva' =>array('type'=>'double(24,8)', 'label'=>'Multicurrency total tva', 'enabled'=>1, 'visible'=>-1, 'position'=>200, 'isameasure'=>1), + 'multicurrency_total_ttc' =>array('type'=>'double(24,8)', 'label'=>'Multicurrency total ttc', 'enabled'=>1, 'visible'=>-1, 'position'=>205, 'isameasure'=>1), 'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>210), 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>215), - 'vat_src_code' =>array('type'=>'varchar(10)', 'label'=>'Vat src code', 'enabled'=>1, 'visible'=>-1, 'position'=>220), 'suspended' =>array('type'=>'integer', 'label'=>'Suspended', 'enabled'=>1, 'visible'=>-1, 'position'=>225), ); // END MODULEBUILDER PROPERTIES @@ -1676,7 +1675,7 @@ class FactureRec extends CommonInvoice $xnbp++; } - $this->usenewprice = 1; + $this->usenewprice = 0; } /** diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index a9a1e286d1e..48cf1d12e6b 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -278,7 +278,7 @@ class Facture extends CommonInvoice 'revenuestamp' =>array('type'=>'double(24,8)', 'label'=>'RevenueStamp', 'enabled'=>1, 'visible'=>-1, 'position'=>130, 'isameasure'=>1), 'total' =>array('type'=>'double(24,8)', 'label'=>'TotalHT', 'enabled'=>1, 'visible'=>-1, 'position'=>135, 'isameasure'=>1), 'total_ttc' =>array('type'=>'double(24,8)', 'label'=>'TotalTTC', 'enabled'=>1, 'visible'=>-1, 'position'=>140, 'isameasure'=>1), - 'fk_statut' =>array('type'=>'smallint(6)', 'label'=>'Status', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>500), + 'fk_statut' =>array('type'=>'smallint(6)', 'label'=>'Status', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>500, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Validated', 2=>'Paid', 3=>'Abandonned')), 'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-1, 'position'=>150), 'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>155), 'fk_user_valid' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>160), diff --git a/htdocs/core/customreports.php b/htdocs/core/customreports.php index 31923fa7b95..7f579e73a4f 100644 --- a/htdocs/core/customreports.php +++ b/htdocs/core/customreports.php @@ -244,6 +244,7 @@ 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 (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; if (in_array($val['type'], array('html', 'text'))) continue; if (in_array($val['type'], array('timestamp', 'date', 'datetime'))) { diff --git a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql index c647ef122b2..9bc2ee8bb2a 100644 --- a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql +++ b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql @@ -47,6 +47,8 @@ ALTER TABLE llx_commande_fournisseur_dispatch_extrafields ADD INDEX idx_commande ALTER TABLE llx_holiday_users DROP INDEX uk_holiday_users; ALTER TABLE llx_holiday_users ADD UNIQUE INDEX uk_holiday_users(fk_user, fk_type); +--ALTER TABLE llx_facturerec DROP COLUMN vat_src_code; + -- Migration to the new regions (France) UPDATE llx_c_regions set nom = 'Centre-Val de Loire' WHERE fk_pays = 1 AND code_region = 24; From f114ca9479abb2bd60ee3cff89f63643dc52e208 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 7 Feb 2020 15:53:50 +0100 Subject: [PATCH 136/306] Missing column import_key on ticket table --- htdocs/install/mysql/migration/11.0.0-12.0.0.sql | 2 ++ htdocs/install/mysql/tables/llx_ticket.sql | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql index 9bc2ee8bb2a..bce7725871a 100644 --- a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql +++ b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql @@ -47,6 +47,8 @@ ALTER TABLE llx_commande_fournisseur_dispatch_extrafields ADD INDEX idx_commande ALTER TABLE llx_holiday_users DROP INDEX uk_holiday_users; ALTER TABLE llx_holiday_users ADD UNIQUE INDEX uk_holiday_users(fk_user, fk_type); +ALTER TABLE llx_ticket ADD COLUMN import_key varchar(14); + --ALTER TABLE llx_facturerec DROP COLUMN vat_src_code; diff --git a/htdocs/install/mysql/tables/llx_ticket.sql b/htdocs/install/mysql/tables/llx_ticket.sql index 3f3cdf58cd9..82e692a7f0d 100644 --- a/htdocs/install/mysql/tables/llx_ticket.sql +++ b/htdocs/install/mysql/tables/llx_ticket.sql @@ -38,5 +38,6 @@ CREATE TABLE llx_ticket date_read datetime, date_close datetime, notify_tiers_at_create tinyint, - tms timestamp + tms timestamp, + import_key varchar(14) )ENGINE=innodb; From 9f9002d6a6d140fdf48839d8d18c34f6cc645b4a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 7 Feb 2020 16:05:04 +0100 Subject: [PATCH 137/306] Update field definition --- htdocs/compta/facture/class/facture.class.php | 2 +- htdocs/install/default.css | 16 ++++++++-------- htdocs/ticket/class/ticket.class.php | 3 ++- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 48cf1d12e6b..294493ed081 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -293,7 +293,6 @@ class Facture extends CommonInvoice 'note_private' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>205), 'note_public' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>210), 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>215), - 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>220), 'extraparams' =>array('type'=>'varchar(255)', 'label'=>'Extraparams', 'enabled'=>1, 'visible'=>-1, 'position'=>225), 'situation_cycle_ref' =>array('type'=>'smallint(6)', 'label'=>'Situation cycle ref', 'enabled'=>'$conf->global->INVOICE_USE_SITUATION', 'visible'=>-1, 'position'=>230), 'situation_counter' =>array('type'=>'smallint(6)', 'label'=>'Situation counter', 'enabled'=>'$conf->global->INVOICE_USE_SITUATION', 'visible'=>-1, 'position'=>235), @@ -314,6 +313,7 @@ class Facture extends CommonInvoice 'last_main_doc' =>array('type'=>'varchar(255)', 'label'=>'Last main doc', 'enabled'=>1, 'visible'=>-1, 'position'=>310), 'module_source' =>array('type'=>'varchar(32)', 'label'=>'POSModule', 'enabled'=>1, 'visible'=>-1, 'position'=>315), 'pos_source' =>array('type'=>'varchar(32)', 'label'=>'POSTerminal', 'enabled'=>1, 'visible'=>-1, 'position'=>320), + 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>220), ); // END MODULEBUILDER PROPERTIES diff --git a/htdocs/install/default.css b/htdocs/install/default.css index ab4e36c9f68..65d8e8021a8 100644 --- a/htdocs/install/default.css +++ b/htdocs/install/default.css @@ -53,10 +53,9 @@ div.titre { } span.titre { - font-size: 90%; font-weight: bold; background: #FFFFFF; - color: #444; + color: rgb(0,113,121); border: 1px solid #bbb; padding: 10px 10px 10px 10px; margin: 0 0 10px 10px; @@ -347,13 +346,14 @@ ul { .button { - background: #fcfcfc; - border: 1px solid #e0e0e0; + background: rgb(0,113,121); + color: #fff; + /* border: 1px solid #e0e0e0; */ padding: 0.3em 0.7em; margin: 0 0.5em; - -moz-border-radius: 5px 5px 5px 5px; - -webkit-border-radius: 5px 5px 5px 5px; - border-radius: 5px 5px 5px 5px; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; -moz-box-shadow: 2px 2px 3px #ddd; -webkit-box-shadow: 2px 2px 3px #ddd; box-shadow: 2px 2px 3px #ddd; @@ -363,7 +363,7 @@ a.button:hover { } .choiceselected { - background-color: #dfd; + background-color: #f4fcf4; background-repeat: repeat-x; background-position: top left; } diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index f5132809dd1..e030782cc94 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -200,7 +200,8 @@ class Ticket extends CommonObject 'message' => array('type'=>'text', 'label'=>'Message', 'visible'=>-2, 'enabled'=>1, 'position'=>540, 'notnull'=>-1,), 'progress' => array('type'=>'varchar(100)', 'label'=>'Progression', 'visible'=>-1, 'enabled'=>1, 'position'=>540, 'notnull'=>-1, 'css'=>'right', 'help'=>""), 'resolution' => array('type'=>'integer', 'label'=>'Resolution', 'visible'=>-1, 'enabled'=>1, 'position'=>550, 'notnull'=>1), - 'fk_statut' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>600, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array(0 => 'Unread', 1 => 'Read', 3 => 'Answered', 4 => 'Assigned', 5 => 'InProgress', 6 => 'Waiting', 8 => 'Closed', 9 => 'Deleted')) + 'fk_statut' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>600, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array(0 => 'Unread', 1 => 'Read', 3 => 'Answered', 4 => 'Assigned', 5 => 'InProgress', 6 => 'Waiting', 8 => 'Closed', 9 => 'Deleted')), + 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>900), ); /** From 8eb9c10788e739fc4e9d1d9c343be18cf4cb6c3c Mon Sep 17 00:00:00 2001 From: pnueda Date: Fri, 7 Feb 2020 18:01:14 +0100 Subject: [PATCH 138/306] Update html.formfile.class.php Corrects a bug that adds a second '?' in the url string. When strpos returns 0 as the initial position for '?', it is (mis)taken as FALSE value, and then replaced by a second '?' in the list of get parameters, resulting in something like: /compta/facture/card.php?facid=397?action=remove_file... instead of /compta/facture/card.php?facid=397&action=remove_file... --- htdocs/core/class/html.formfile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index a3d73b627b7..7a3b48e1c40 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -859,7 +859,7 @@ class FormFile if ($delallowed) { $tmpurlsource = preg_replace('/#[a-zA-Z0-9_]*$/', '', $urlsource); - $out .= ' Date: Fri, 7 Feb 2020 18:32:08 +0100 Subject: [PATCH 139/306] Add receipt tags to lang --- htdocs/langs/en_US/receiptprinter.lang | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/htdocs/langs/en_US/receiptprinter.lang b/htdocs/langs/en_US/receiptprinter.lang index f79974558d6..9a3b28fa399 100644 --- a/htdocs/langs/en_US/receiptprinter.lang +++ b/htdocs/langs/en_US/receiptprinter.lang @@ -47,3 +47,10 @@ DOL_PRINT_LOGO=Print logo of my company DOL_PRINT_LOGO_OLD=Print logo of my company (old printers) DOL_BOLD=Bold DOL_BOLD_DISABLED=Disable bold +DOL_DOUBLE_HEIGHT=Double height size +DOL_DOUBLE_WIDTH=Double width size +DOL_DEFAULT_HEIGHT_WIDTH=Default height and width size +DOL_UNDERLINE=Enable underline +DOL_UNDERLINE_DISABLED=Disable underline +DOL_BEEP=Beed sound +DOL_PRINT_TEXT=Print text From ae061511469f2b8396cc917ff313913de2a4b762 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Fri, 7 Feb 2020 18:34:58 +0100 Subject: [PATCH 140/306] Add and finish receipt printer tags --- htdocs/core/class/dolreceiptprinter.class.php | 50 +++++++++++-------- 1 file changed, 29 insertions(+), 21 deletions(-) diff --git a/htdocs/core/class/dolreceiptprinter.class.php b/htdocs/core/class/dolreceiptprinter.class.php index 4738ea92974..0c37832f00c 100644 --- a/htdocs/core/class/dolreceiptprinter.class.php +++ b/htdocs/core/class/dolreceiptprinter.class.php @@ -1,5 +1,6 @@ + * Copyright (C) 2020 Andreu Bisquerra * * 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 @@ -32,19 +33,16 @@ * Use font C of printer * Text Bold * Disable Text Bold - * Text double height - * Text double width - * Underline text - * Underline with double line - * Emphasized text - * Print in white on black - * Ticket print width of 57mm + * Text double height + * Text double width + * Text default height and width + * Underline text + * Disable underline text * Cut ticket completely * Cut ticket partially * Open cash drawer - * Activate buzzer + * Activate buzzer * Print barcode - * Print QR Code * Print logo stored on printer. Example : 32|32 * Print logo stored on printer. Must be followed by logo code. For old printers. * Print object lines @@ -165,24 +163,15 @@ class dolReceiptPrinter extends Printer 'dol_bold', 'dol_bold_disabled', 'dol_double_height', - '/dol_double_height', 'dol_double_width', - '/dol_double_width', + 'dol_default_height_width', 'dol_underline', - '/dol_underline', - 'dol_underline_2dots', - '/dol_underline', - 'dol_emphasized', - '/dol_emphasized', - 'dol_switch_colors', - '/dol_switch_colors', - 'dol_set_print_width_57', + 'dol_underline_disabled', 'dol_cut_paper_full', 'dol_cut_paper_partial', 'dol_open_drawer', - //'dol_activate_buzzer', + 'dol_beep', 'dol_print_text', - 'dol_print_qrcode', 'dol_print_barcode', 'dol_value_date', 'dol_value_date_time', @@ -718,6 +707,24 @@ class dolReceiptPrinter extends Printer break; case 'DOL_BOLD_DISABLED': $this->printer->setEmphasis(false); + break; + case 'DOL_DOUBLE_HEIGHT': + $this->printer->setTextSize(1,2); + break; + case 'DOL_DOUBLE_WIDTH': + $this->printer->setTextSize(2,1); + break; + case 'DOL_DEFAULT_HEIGHT_WIDTH': + $this->printer->setTextSize(1,1); + break; + case 'DOL_UNDERLINE': + $this->printer->setUnderline(true); + break; + case 'DOL_UNDERLINE_DISABLED': + $this->printer->setUnderline(false); + break; + case 'DOL_BEEP': + $this->printer->getPrintConnector() -> write("\x1e"); break; default: $this->printer->text($vals[$tplline]['tag']); @@ -826,3 +833,4 @@ class dolReceiptPrinter extends Printer return $error; } } + From 1e5940fbf0dfd9ecf46f4965a4215e00943cb4dd Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Fri, 7 Feb 2020 19:25:28 +0100 Subject: [PATCH 141/306] Fix travis errors --- htdocs/core/class/dolreceiptprinter.class.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/dolreceiptprinter.class.php b/htdocs/core/class/dolreceiptprinter.class.php index 0c37832f00c..e8e43281d79 100644 --- a/htdocs/core/class/dolreceiptprinter.class.php +++ b/htdocs/core/class/dolreceiptprinter.class.php @@ -709,13 +709,13 @@ class dolReceiptPrinter extends Printer $this->printer->setEmphasis(false); break; case 'DOL_DOUBLE_HEIGHT': - $this->printer->setTextSize(1,2); + $this->printer->setTextSize(1, 2); break; case 'DOL_DOUBLE_WIDTH': - $this->printer->setTextSize(2,1); + $this->printer->setTextSize(2, 1); break; case 'DOL_DEFAULT_HEIGHT_WIDTH': - $this->printer->setTextSize(1,1); + $this->printer->setTextSize(1, 1); break; case 'DOL_UNDERLINE': $this->printer->setUnderline(true); @@ -833,4 +833,3 @@ class dolReceiptPrinter extends Printer return $error; } } - From c29a7527ade58c9c8ab2cddcd43c011ba21b0766 Mon Sep 17 00:00:00 2001 From: Norbert Penel Date: Sat, 8 Feb 2020 10:19:38 +0100 Subject: [PATCH 142/306] accounting austrian --- .../mysql/data/llx_accounting_account_at.sql | 345 ++++++++++++++++++ 1 file changed, 345 insertions(+) create mode 100644 htdocs/install/mysql/data/llx_accounting_account_at.sql diff --git a/htdocs/install/mysql/data/llx_accounting_account_at.sql b/htdocs/install/mysql/data/llx_accounting_account_at.sql new file mode 100644 index 00000000000..9adccb27658 --- /dev/null +++ b/htdocs/install/mysql/data/llx_accounting_account_at.sql @@ -0,0 +1,345 @@ +-- Copyright (C) 2020 Norbert Penel +-- +-- 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 +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- + +-- +-- Ne pas placer de commentaire en fin de ligne, ce fichier est parsé lors +-- de l'install et tous les sigles '--' sont supprimés. +-- + +-- Descriptif des plans comptables autrichiens standard + + +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","0","GROUP0","110","0","Patentrechte") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","0","GROUP0","120","0","Software") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","0","GROUP0","121","0","ERP System") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","0","GROUP0","122","0","Homepage") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","0","GROUP0","125","0","Software Fremdentwicklung_noch nicht aktivieren") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","0","GROUP0","160","0","Umgründungsmehrwert") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","0","GROUP0","250","0","Mieterinvestitionen") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","0","GROUP0","400","0","Maschinen") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","0","GROUP0","600","0","Betriebs u. Geschäftsausstattung") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","0","GROUP0","601","0","Ausstellungsstücke") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","0","GROUP0","602","0","Leihstellungsstücke") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","0","GROUP0","603","0","Getriebeprüfstand_hinten") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","0","GROUP0","604","0","Wuchtstand_links_AQ") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","0","GROUP0","605","0","Messlabor(Messraum)") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","0","GROUP0","606","0","PAK-System") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","0","GROUP0","607","0","Server") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","0","GROUP0","608","0","EDV-Ausstattung (Hardware)") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","0","GROUP0","609","0","Werkstattausstattung (Werkzeug)") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","0","GROUP0","610","0","Wuchtprüfstand neu_noch nicht in Betrieb genommen") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","0","GROUP0","611","0","Messequipment/Ausstattung") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","0","GROUP0","630","0","PKW") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","0","GROUP0","640","0","LKW") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","0","GROUP0","680","0","GWG-Geschäftsausstattung") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","0","GROUP0","710","0","Anlagen in Bau") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","1","GROUP1","1100","0","Rohstoffe") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","1","GROUP1","1200","0","Bezogenen Teile") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","1","GROUP1","1300","0","Hilfsstoffe und Betriebsstoffe") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","1","GROUP1","1400","0","fertige Erzeugnisse") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","1","GROUP1","1500","0","unfertige Erzeugnisse") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","1","GROUP1","1600","0","Waren") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","1","GROUP1","1700","0","Noch nicht abrechenbare Leist.") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","1","GROUP1","1701","0","Bestandsveränderung laufend") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","1","GROUP1","1800","0","Vorrat Verpackungsmaterial") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","1","GROUP1","1810","0","Vorrat Werbematerial") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2000","0","Lieferforderungen Inland I") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2080","0","Einzelwertb. Ford. Inland") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2292","0","geleistete Anzahlungen (20%)") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2293","0","gel. Anzahlungen i.g.") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2301","0","Forderung Forschungsprämie") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2302","0","Forderungen gelieferte (noch nicht fakturierte Waren)") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2303","0","Vorauszahlung Leasing Server") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2306","0","Kaution Pfauengarten") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2307","0","Kaution Werkstatt") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2308","0","Kaution Parkplatz PKW") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2309","0","Kaution Werkstatt") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2310","0","Kaution Studentenwohnheim") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2311","0","Kaution China") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2312","0","Vorauszahlung Xerox") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2313","0","Verrechnung Bildungsscheck") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2315","0","Aktivierung Körperschaftsteuer") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2500","0","Vorsteuer") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2501","0","Vorsteuer aus i. g. Erwerb") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2502","0","Vorsteuer reverse charge syst.") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2503","0","Vorsteuer Reverse Charge § 19/1d") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2508","0","Vorsteuer sonstige Leistungen EU") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2509","0","EUSt Forderung") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2510","0","Einfuhrumsatzsteuer") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2531","0","Vorsteuer Frankreich") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2532","0","Vorsteuer Niederlande") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2533","0","Vorsteuer GB") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2534","0","Vorsteuer Belgien") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2535","0","Vorsteuer GB") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2901","0","Leasingvorauszahlung Vito") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3020","0","Rückstellung für Körperschaftsteuer") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3060","0","Rst. für Beratungskosten") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3064","0","Rst. für Sonderzahlungen") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3072","0","Rst. für nicht konsum. Urlaube") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3214","0","Raika 40-00.800.185") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3286","0","Darlehen Dipl. Ing. REICH GMBH") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3287","0","Darlehen Dr.Höfler") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3288","0","Darlehen DI Mayrhofer") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3289","0","Darlehen AWS") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3292","0","Anzahlungen von Kunden 20 %") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3294","0","Anzahlungen von Kunden Drittland") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3300","0","Lieferverbindlichkeiten I") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3481","0","Verrechnungskto DI Mayrhofer") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3500","0","Umsatzsteuer") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3501","0","Umsatzsteuer aus i. g. Erwerb") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3502","0","USt § 19/Art 19 (reverse Charge)") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3503","0","Umsatzsteuer Reverse Charge § 19/1d") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3508","0","Umsatzsteuer sonstige Leistung") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3531","0","FA-Zahllast Dezember") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3533","0","Umsatzsteuer 2012") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3535","0","Umsatzsteuer 2013") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3536","0","Umsatzsteuer 2014") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3537","0","Umsatzsteuer 2015") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3632","0","Verrechnungskonto EUSt") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3892","0","Verbindlichkeiten Anzahlungsrechn.") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3898","0","Abgrenzung Sonderzahlungen") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4000","0","Erlöse Lieferungen 20 %") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4001","0","Erlöse i.g. Lieferung") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4002","0","Erlöse Dienstleistungen EU") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4003","0","Erlöse Dienstleistungen 20 %") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4004","0","Erlöse Software 20 %") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4005","0","Erlöse Software EU") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4006","0","Evidenz Kfd. Reverse Charge") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4050","0","Erlöse 0 % Drittland") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4051","0","Erlöse Dienstleistungen Drittland") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4052","0","Erlöse Software Drittland") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4069","0","Erlöse § 19/1d Schrott") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4400","0","Kundenskonto 20 %") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4405","0","Kundenskonto 0 % Ausfuhrlieferungen") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4410","0","Skontoaufwand i.g. Lieferung") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4413","0","Kundenskonto sonstige Leistung EU") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4420","0","Kundenskonto EU-Land A x %") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4450","0","Kundenrabatt 20%") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4500","0","Bestandsveränderungen fertige Erzeugnisse") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4510","0","Best.Veränd.Halbf.Erzeugnisse") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4519","0","Bestandsveränderung laufend") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4520","0","Best.Veränd.n.n.abger.Leist.") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4530","0","Gelieferte (noch nicht fakturierte Waren)") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4580","0","Aktivierte Eigenleistung") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4630","0","Erträge aus d.Abgang v.Anlagen") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4801","0","Zuwendungen a.öffentl. Mitteln") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4831","0","sonstige betriebliche Erträge (nicht steuerbar)") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4840","0","Sonstige Erlöse 20 %") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4850","0","Erl. Aufwandersätze") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4881","0","Versicherungsvergütungen") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4885","0","Zuschreibungen zum Umlaufvermögen") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4950","0","Privatanteil 20 %") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4991","0","Sachbezüge 20%") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","5","GROUP5","5000","0","Handelswareneinsatz") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","5","GROUP5","5001","0","Materialeinkauf Fremdfertigung") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","5","GROUP5","5002","0","Wareneinkauf Verkauf") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","5","GROUP5","5020","0","Materialeinkauf") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","5","GROUP5","5090","0","Bezugskosten") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","5","GROUP5","5100","0","Verbrauch Rohstoffe") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","5","GROUP5","5199","0","Aufwand für TW-AFA Vorräte") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","5","GROUP5","5200","0","Verbrauch bezogenen Teile") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","5","GROUP5","5300","0","Verbrauch Hilfsstoffe") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","5","GROUP5","5400","0","Hilfsstoffverbrauch") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","5","GROUP5","5440","0","Inventurveränderung Fremdbarb. + GK") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","5","GROUP5","5441","0","GWG Fremdbarb. + GK") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","5","GROUP5","5450","0","Verpackungsmaterial") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","5","GROUP5","5800","0","Fremdleistungen") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","5","GROUP5","5880","0","Lieferantenskonti") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","5","GROUP5","5900","0","Skontoertrag ig.E. 0% (m.VST)") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","5","GROUP5","5920","0","Skontoertrag ig.E. 20% (m.VST)") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6000","0","Löhne") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6001","0","Rückerstattung AUVA Arbeiter") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6010","0","Lehrlingsentschädigung Arb.") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6020","0","Nichtleistungslöhne") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6100","0","Leihpersonal Aufwand") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6150","0","Sonderzahlungen Arbeiter") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6200","0","Gehälter") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6201","0","Förderung AMS") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6202","0","Rückerstattung AUVA Angestellte") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6210","0","Veränderung Mehrarbeitsvergütung RSt Ang") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6211","0","Veränderung Mehrarbeitsvergütung RSt Arbeiter") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6230","0","Sonderzahlungen Angestellte") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6231","0","Dotierung RST Sonderzahlungen") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6255","0","Geschäftsführerbezüge") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6256","0","Geschäftsführersachbezüge") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6300","0","Sonderzahlung aliquot vorläufig") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6310","0","Dotierung Urlaubsrückstellung") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6311","0","Veränderung Urlaubsrückstellung Arbeiter") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6402","0","Betriebliche Vorsorgekassa Arbeiter") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6407","0","Betriebliche Vorsorgekassa Angestellte") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6416","0","Veränderung Pensionsrückstellung (Angestellte)") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6435","0","sonstige Beiträge für die Altersversorgung") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6500","0","Gesetzlicher Sozialaufwand") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6600","0","Gesetzlicher Sozialaufwand Arbeiter") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6605","0","Gesetzlicher Sozialaufwand Angestellte") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6610","0","Dienstgeberbeitrag Arbeiter") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6611","0","Dienstgeberbeitrag Angestellte") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6620","0","Zuschlag zum DB") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6621","0","Zuschlag zum DB Angestellte") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6630","0","Ausgleichstaxe") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6690","0","Lohnsteuer") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6693","0","Kommunalsteuer Arbeiter") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6694","0","Kommunalsteuer Angestellte") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6700","0","Freiwilliger Sozialaufwand") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6710","0","Arbeitskleidung") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6720","0","Fahrspesen Dienstnehmer") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6730","0","Weihnachtsgeschenke Arbeitnehmer") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6740","0","Betriebsveranstaltungen") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6750","0","Konto frei") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6760","0","Vergleichszahlung Dienstnehmer") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7030","0","Abschreibung G W G") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7070","0","Buchwert ausgeschiedener Anlagen") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7080","0","Planmäßige AFA immat.WG.") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7081","0","Planmäßige Abschreibung für Sachanlagen") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7100","0","Nicht abzugsfähige Vorsteuer (VStK)") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7110","0","Gebühren und Abgaben_Zoll") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7111","0","Kammerumlage") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7200","0","Instandhaltung Gebäude") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7201","0","Instandhaltung Außenanlagen") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7202","0","Instandh. - Maschinen u. Anl.") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7204","0","Instandhaltung und Betriebskosten Betriebs und Geschäftsgebäude") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7205","0","Verbrauchsmaterial Werkstatt") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7210","0","Müllentsorgung") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7211","0","Entsorgungskosten") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7230","0","Reinigungsmaterial (div. Verbrauchsmaterial)") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7231","0","Berufsbekleidung") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7235","0","Reinigung durch Dritte") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7240","0","LKW-Betriebskosten Vito G 437 MB") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7241","0","Leasing Mercedes Vito G 437 MB") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7250","0","KFZ Betriebskosten allgemein") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7251","0","KFZ Leasing allgemein") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7252","0","KFZ Versicherungen allgemein") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7253","0","Wachdienst") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7254","0","Konto frei") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7255","0","Aufwand Leihwagen") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7256","0","PKW-Betriebskosten VW Golf G 854 SH Versuchsfahrzeug") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7257","0","Leasing VW Golf G 854 SH") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7258","0","Konto frei") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7285","0","Strom") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7286","0","Betriebskosten/Beheizung Mietobjekte") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7300","0","Transporte durch Dritte") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7330","0","Reise und Fahrtspesen") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7331","0","Kilometergelder") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7360","0","Reisediäten") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7380","0","Telefon") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7381","0","Internet") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7382","0","Wartung Homepage") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7390","0","Postgebühren") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7400","0","Konto frei") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7401","0","Konto frei") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7402","0","Konto frei") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7403","0","Miete Büro Linz") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7404","0","Miete Gradnerstraße") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7410","0","Maschinen u. Gerätemieten") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7411","0","Wartungskosten BuG Ausstattung") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7420","0","Mobilien-Leasing ") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7421","0","Konto frei") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7422","0","Leasing Server") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7423","0","Konto frei") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7424","0","Konto frei") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7480","0","Lizenzgebühren") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7540","0","Provisionen an Dritte") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7600","0","Büromaterial") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7601","0","EDV-Material") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7610","0","Drucksorten") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7620","0","Fachliteratur und Zeitungen") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7630","0","Gästeunt. u. Zeitschriften") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7650","0","Werbeaufwand/Inserate") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7651","0","Anbahnung") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7652","0","Aufwand Messen") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7653","0","Konto frei") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7654","0","Inserate") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7670","0","Bewirtungskosten") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7690","0","Trinkgelder u. Spenden") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7691","0","Spenden an begünstigte Institutionen/Sponsoring") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7696","0","Säumnis- und Verspätungszuschläge") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7700","0","Betriebsversicherungen") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7701","0","Transportversicherungen") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7710","0","Pflichtversich. Unternehmer") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7749","0","Aufwand Japan") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7750","0","Steuerberatung (Lohnverrechnung, Buchhaltung)") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7751","0","Patentkosten") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7752","0","Rechtsberatung") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7753","0","Unternehmensberatung") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7754","0","Aufwand tectos China") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7755","0","Wartung (Betreuung EDV)") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7756","0","Lizenzgebühren Abaqus") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7757","0","Lizenzgebühren Sonstige") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7758","0","Sonstige Beratungskosten") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7759","0","EDV-Beratung") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7760","0","Mitgliedsbeiträge/freiwillige Beiträge") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7761","0","Prüfung Jahresabschluss") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7770","0","Aus- und Fortbildung") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7775","0","Forschung und Entwicklung") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7776","0","Messentwicklung") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7777","0","Produktentwicklung") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7785","0","Freiwillige Verbandsbeiträge") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7790","0","Spesen des Geldverkehrs") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7791","0","Kursdifferenzen") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7800","0","Betriebsbedingte Schadensfälle") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7801","0","Ausgaben nicht absetzbar") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7802","0","Strafen") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7805","0","Forderungsverluste 20") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7806","0","Abschreibungen auf Forderungen (EU)") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7807","0","Abschreibungen auf Forderungen (Drittland)") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7810","0","Zuweisung an Einzel-WB Forderungen") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7811","0","Zuweisung pauschale Wertberichtigungen zu Exportforderungen") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7812","0","Abschreibungen auf Vorräte") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7820","0","Buchwert abgegangener Sachanlagen") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7840","0","Gründungskosten") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7850","0","Sonstiger Aufwand") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7851","0","Sonstiger Aufwand Gewinnanteil Reich") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7930","0","Aufw. Gewährleistungsverpfl.") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7940","0","Aufwand aus Vorperioden") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8020","0","Gewinnüberrg. v. Organgesell.") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8060","0","Zinserträge") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8090","0","Ertr.a.Ant.a.and. Unternehmen") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8100","0","Habenzinsen") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8280","0","Zinsen f. Kredite u. Darlehen") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8286","0","Kursgewinne/Kursverluste") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8288","0","Zinsen auf Lieferantenkredite") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8291","0","Sonst. Zinsen und ähnliche Aufwendungen") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8500","0","Körperschaftsteuer") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8505","0","Kapitalertragsteuer") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8510","0","Körperschaftsteuervorauszahl.") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8511","0","Dotierung KöSt-Rückstellung") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8512","0","Aktivierung Körperschaftsteuer") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8513","0","Köst Vorperioden") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8520","0","Forschungsprämie") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8595","0","Ertrag aus der Aktivierung latenter Steuern") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8610","0","Auflösung sonstiger unversteuerter Rücklagen") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8700","0","Auflösung gebundener Kapitalrücklage") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8710","0","Auflösung Rücklage für eigene Anteile") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8720","0","Auflösung nicht gebundene Kapitalrücklage") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8750","0","Auflösung gesetzliche Rücklage") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8760","0","Auflösung satzungsmäßige Rücklage") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8770","0","Auflösung andere (freie) Rücklage") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8810","0","Zuweisung sonstige unversteuerte Rücklagen") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8820","0","Zuweisung Inv. Rücklage") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8890","0","Zuw.Bew.Res.GWG") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8900","0","Zuweisung gesetzliche Rücklagen") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8910","0","Zuweisung satzungsmäßige Rücklagen") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8920","0","Zuweisung andere (freie) Rücklagen") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","9","GROUP9","9390","0","Bilanzgewinn") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","9","GROUP9","9391","0","Bilanzverlust") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","9","GROUP9","9700","0","Wachdienst") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","9","GROUP9","9991","0","Gewinnvortrag") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","9","GROUP9","9993","0","Verlustvortrag") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","9","GROUP9","9994","0","Verlustvortrag") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","5","GROUP5","50200","0","Materialeinkauf") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","60000","0","kalk. Löhne u Gehälter") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","64160","0","Veränderung Pensionsrückstellung (Angestellte)") ; +INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","66300","0","Leistungserfassung") ; From 02a96e163f4a91f5d405fcbfa2eed0a262bf56cb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 8 Feb 2020 11:26:16 +0100 Subject: [PATCH 143/306] FIX If we can change vendor status, we must be able to chane vendor code --- htdocs/societe/card.php | 41 +++++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index e46d2f80ff8..b7bdda5d6ba 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1903,30 +1903,27 @@ else print $form->editfieldkey('SupplierCode', 'supplier_code', '', $object, 0); } print '
'; } From cffc56b80b1b4644c65ab89491527cb592ce56ad Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 8 Feb 2020 11:32:38 +0100 Subject: [PATCH 144/306] Declaration of property fields of thirdparties --- htdocs/contact/class/contact.class.php | 4 +- htdocs/core/customreports.php | 7 +- htdocs/societe/class/societe.class.php | 148 +++++++++++++++++++------ 3 files changed, 120 insertions(+), 39 deletions(-) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 0cea298973a..b1eb83eebdb 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -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), diff --git a/htdocs/core/customreports.php b/htdocs/core/customreports.php index 7f579e73a4f..3d245218807 100644 --- a/htdocs/core/customreports.php +++ b/htdocs/core/customreports.php @@ -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 ''; print '
'; 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; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index f22455cea1b..11f6a91871b 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -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) { From 56079f928fbfce8157feacd82b662ea2d3143373 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 8 Feb 2020 11:34:25 +0100 Subject: [PATCH 145/306] Label of field --- htdocs/societe/class/societe.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 11f6a91871b..08416ed8842 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -188,7 +188,7 @@ class Societe extends CommonObject '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), + 'outstanding_limit' =>array('type'=>'double(24,8)', 'label'=>'OutstandingBill', '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), From 5f75ae48307ef8b1f6f564bc952c4147e6ec78ac Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 8 Feb 2020 11:26:16 +0100 Subject: [PATCH 146/306] FIX If we can change vendor status, we must be able to chane vendor code --- htdocs/societe/card.php | 41 +++++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index ab8256f6473..f570be1bebf 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1903,30 +1903,27 @@ else print $form->editfieldkey('SupplierCode', 'supplier_code', '', $object, 0); } print '
'; } From c3beb854a2f2bdcc166a8b561da34534048dc199 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 8 Feb 2020 13:44:31 +0100 Subject: [PATCH 147/306] Definition of $fields for member and subscriptions --- htdocs/adherents/class/adherent.class.php | 56 ++++++++++++++++ htdocs/adherents/class/subscription.class.php | 20 ++++++ htdocs/core/customreports.php | 65 ++++++++++--------- htdocs/core/lib/security.lib.php | 2 + htdocs/modulebuilder/index.php | 2 + .../template/class/myobject.class.php | 3 +- 6 files changed, 118 insertions(+), 30 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 9dbe3bb5928..203ded8cedd 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -241,6 +241,62 @@ class Adherent extends CommonObject */ public $entity; + + public $fields=array( + 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10), + 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>15, 'index'=>1), + 'ref_ext' =>array('type'=>'varchar(128)', 'label'=>'Ref ext', 'enabled'=>1, 'visible'=>0, 'position'=>20), + 'civility' =>array('type'=>'varchar(6)', 'label'=>'Civility', 'enabled'=>1, 'visible'=>-1, 'position'=>25), + 'lastname' =>array('type'=>'varchar(50)', 'label'=>'Lastname', 'enabled'=>1, 'visible'=>-1, 'position'=>30), + 'firstname' =>array('type'=>'varchar(50)', 'label'=>'Firstname', 'enabled'=>1, 'visible'=>-1, 'position'=>35), + 'login' =>array('type'=>'varchar(50)', 'label'=>'Login', 'enabled'=>1, 'visible'=>-1, 'position'=>40), + 'gender' =>array('type'=>'varchar(10)', 'label'=>'Gender', 'enabled'=>1, 'visible'=>-1, 'position'=>250), + 'pass' =>array('type'=>'varchar(50)', 'label'=>'Pass', 'enabled'=>1, 'visible'=>-1, 'position'=>45), + 'pass_crypted' =>array('type'=>'varchar(128)', 'label'=>'Pass crypted', 'enabled'=>1, 'visible'=>-1, 'position'=>50), + 'fk_adherent_type' =>array('type'=>'integer', 'label'=>'Fk adherent type', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>55), + 'morphy' =>array('type'=>'varchar(3)', 'label'=>'MorPhy', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>60), + 'societe' =>array('type'=>'varchar(128)', 'label'=>'Societe', 'enabled'=>1, 'visible'=>-1, 'position'=>65), + 'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>1, 'visible'=>-1, 'position'=>70), + 'address' =>array('type'=>'text', 'label'=>'Address', 'enabled'=>1, 'visible'=>-1, 'position'=>75), + 'zip' =>array('type'=>'varchar(10)', 'label'=>'Zip', 'enabled'=>1, 'visible'=>-1, 'position'=>80), + 'town' =>array('type'=>'varchar(50)', 'label'=>'Town', 'enabled'=>1, 'visible'=>-1, 'position'=>85), + 'state_id' =>array('type'=>'integer', 'label'=>'State id', 'enabled'=>1, 'visible'=>-1, 'position'=>90), + 'country' =>array('type'=>'integer', 'label'=>'Country', 'enabled'=>1, 'visible'=>-1, 'position'=>95), + 'email' =>array('type'=>'varchar(255)', 'label'=>'Email', 'enabled'=>1, 'visible'=>-1, 'position'=>100), + 'socialnetworks' =>array('type'=>'text', 'label'=>'Socialnetworks', 'enabled'=>1, 'visible'=>-1, 'position'=>105), + //'skype' =>array('type'=>'varchar(255)', 'label'=>'Skype', 'enabled'=>1, 'visible'=>-1, 'position'=>110), + 'phone' =>array('type'=>'varchar(30)', 'label'=>'Phone', 'enabled'=>1, 'visible'=>-1, 'position'=>115), + 'phone_perso' =>array('type'=>'varchar(30)', 'label'=>'Phone perso', 'enabled'=>1, 'visible'=>-1, 'position'=>120), + 'phone_mobile' =>array('type'=>'varchar(30)', 'label'=>'Phone mobile', 'enabled'=>1, 'visible'=>-1, 'position'=>125), + 'birth' =>array('type'=>'date', 'label'=>'DateToBirth', 'enabled'=>1, 'visible'=>-1, 'position'=>130), + 'photo' =>array('type'=>'varchar(255)', 'label'=>'Photo', 'enabled'=>1, 'visible'=>-1, 'position'=>135), + 'public' =>array('type'=>'smallint(6)', 'label'=>'Public', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>145), + 'datefin' =>array('type'=>'datetime', 'label'=>'DateEnd', 'enabled'=>1, 'visible'=>-1, 'position'=>150), + 'note_private' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>155), + 'note_public' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>160), + 'datevalid' =>array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>165), + 'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>170), + 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>175), + 'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk user author', 'enabled'=>1, 'visible'=>-1, 'position'=>180), + 'fk_user_mod' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk user mod', 'enabled'=>1, 'visible'=>-1, 'position'=>185), + 'fk_user_valid' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>190), + 'canvas' =>array('type'=>'varchar(32)', 'label'=>'Canvas', 'enabled'=>1, 'visible'=>-1, 'position'=>195), + 'statut' =>array('type'=>'smallint(6)', 'label'=>'Statut', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>500, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Validated', -1=>'MemberStatusResiliatedShort')), + 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>800), + 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>805), + /*'twitter' =>array('type'=>'varchar(255)', 'label'=>'Twitter', 'enabled'=>1, 'visible'=>-1, 'position'=>210), + 'facebook' =>array('type'=>'varchar(255)', 'label'=>'Facebook', 'enabled'=>1, 'visible'=>-1, 'position'=>215), + 'instagram' =>array('type'=>'varchar(255)', 'label'=>'Instagram', 'enabled'=>1, 'visible'=>-1, 'position'=>220), + 'snapchat' =>array('type'=>'varchar(255)', 'label'=>'Snapchat', 'enabled'=>1, 'visible'=>-1, 'position'=>225), + 'googleplus' =>array('type'=>'varchar(255)', 'label'=>'Googleplus', 'enabled'=>1, 'visible'=>-1, 'position'=>230), + 'youtube' =>array('type'=>'varchar(255)', 'label'=>'Youtube', 'enabled'=>1, 'visible'=>-1, 'position'=>235), + 'whatsapp' =>array('type'=>'varchar(255)', 'label'=>'Whatsapp', 'enabled'=>1, 'visible'=>-1, 'position'=>240), + 'linkedin' =>array('type'=>'varchar(255)', 'label'=>'Linkedin', 'enabled'=>1, 'visible'=>-1, 'position'=>245),*/ + ); + + + + /** * Constructor * diff --git a/htdocs/adherents/class/subscription.class.php b/htdocs/adherents/class/subscription.class.php index e2fc13edadf..99a0c113e9a 100644 --- a/htdocs/adherents/class/subscription.class.php +++ b/htdocs/adherents/class/subscription.class.php @@ -42,6 +42,11 @@ class Subscription extends CommonObject */ public $table_element='subscription'; + /** + * @var int Does myobject support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by fk_soc, 'field@table'=Test with link by field@table + */ + public $ismultientitymanaged = 'fk_adherent@adherent'; + /** * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png */ @@ -88,6 +93,21 @@ class Subscription extends CommonObject */ public $fk_bank; + public $fields=array( + 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10), + 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>15), + 'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>20), + 'fk_adherent' =>array('type'=>'integer', 'label'=>'Member', 'enabled'=>1, 'visible'=>-1, 'position'=>25), + 'dateadh' =>array('type'=>'datetime', 'label'=>'DateSubscription', 'enabled'=>1, 'visible'=>-1, 'position'=>30), + 'datef' =>array('type'=>'date', 'label'=>'DateEndSubscription', 'enabled'=>1, 'visible'=>-1, 'position'=>35), + 'subscription' =>array('type'=>'double(24,8)', 'label'=>'Amount', 'enabled'=>1, 'visible'=>-1, 'position'=>40, 'isameasure'=>1), + 'fk_bank' =>array('type'=>'integer', 'label'=>'BankId', 'enabled'=>1, 'visible'=>-1, 'position'=>45), + 'note' =>array('type'=>'text', 'label'=>'Note', 'enabled'=>1, 'visible'=>-1, 'position'=>50), + 'fk_type' =>array('type'=>'integer', 'label'=>'MemberType', 'enabled'=>1, 'visible'=>-1, 'position'=>55), + 'fk_user_creat' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'position'=>60), + 'fk_user_valid' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>65), + ); + /** * Constructor diff --git a/htdocs/core/customreports.php b/htdocs/core/customreports.php index 3d245218807..f278de1a506 100644 --- a/htdocs/core/customreports.php +++ b/htdocs/core/customreports.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2020 Laurent Destailleur * * 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 @@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT."/core/class/dolgraph.class.php"; require_once DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php"; // Load traductions files requiredby by page -$langs->loadLangs(array("companies", "contracts", "bills", "other", "exports")); +$langs->loadLangs(array("companies", "bills", "other", "exports")); // Get parameters $action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... @@ -73,33 +73,17 @@ $head = array(); $object = null; $ObjectClassName = ''; $arrayoftype = array( - 'thirdparty' => array('label' => 'ThirdParties', 'ObjectClassName' => 'Societe'), - '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'), - 'mo' => array('label' => 'MO', 'ObjectClassName' => 'Mo'), - 'ticket' => array('label' => 'Ticket', 'ObjectClassName' => 'Ticket'), + 'thirdparty' => array('label' => 'ThirdParties', 'ObjectClassName' => 'Societe', 'enabled' => $conf->societe->enabled, 'ClassPath' => DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"), + 'contact' => array('label' => 'Contacts', 'ObjectClassName' => 'Contact', 'enabled' => $conf->societe->enabled, 'ClassPath' => DOL_DOCUMENT_ROOT."/contact/class/contact.class.php"), + 'contract' => array('label' => 'Contracts', 'ObjectClassName' => 'Contrat', 'enabled' => $conf->contrat->enabled, 'ClassPath' => DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php", 'langs'=>'contract'), + 'invoice' => array('label' => 'Invoices', 'ObjectClassName' => 'Facture', 'enabled' => $conf->facture->enabled, 'ClassPath' => DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php"), + 'invoice_template'=>array('label' => 'PredefinedInvoices', 'ObjectClassName' => 'FactureRec', 'enabled' => $conf->facture->enabled, 'ClassPath' => DOL_DOCUMENT_ROOT."/compta/class/facturerec.class.php"), + 'bom' => array('label' => 'BOM', 'ObjectClassName' => 'Bom', 'enabled' => $conf->bom->enabled), + 'mo' => array('label' => 'MO', 'ObjectClassName' => 'Mo', 'enabled' => $conf->mo->enabled, 'ClassPath' => DOL_DOCUMENT_ROOT."/mrp/class/mo.class.php"), + 'ticket' => array('label' => 'Ticket', 'ObjectClassName' => 'Ticket', 'enabled' => $conf->ticket->enabled), + 'member' => array('label' => 'Adherent', 'ObjectClassName' => 'Adherent', 'enabled' => $conf->adherent->enabled, 'ClassPath' => DOL_DOCUMENT_ROOT."/adherents/class/adherent.class.php", 'langs'=>'members'), + 'cotisation' => array('label' => 'Subscriptions', 'ObjectClassName' => 'Subscription', 'enabled' => $conf->adherent->enabled, 'ClassPath' => DOL_DOCUMENT_ROOT."/adherents/class/subscription.class.php", 'langs'=>'members'), ); -if ($objecttype == 'thirdparty') { - require_once DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"; -} -elseif ($objecttype == 'contract') { - require_once DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php"; -} -elseif ($objecttype == 'invoice') { - require_once DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php"; -} -elseif ($objecttype == 'invoice_template') { - require_once DOL_DOCUMENT_ROOT."/compta/facture/class/facture-rec.class.php"; -} -elseif ($objecttype == 'mo') { - require_once DOL_DOCUMENT_ROOT."/mrp/class/mo.class.php" ; -} -elseif ($objecttype) { - require_once DOL_DOCUMENT_ROOT."/".$objecttype."/class/".$objecttype.".class.php"; -} // Complete $arrayoftype $parameters = array('objecttype'=>$objecttype, 'tabfamily'=>$tabfamily); @@ -124,6 +108,14 @@ elseif (is_array($hookmanager->resArray)) { if ($objecttype) { try { + if ($arrayoftype[$objecttype]['langs']) { + $langs->load($arrayoftype[$objecttype]['langs']); + } + if ($arrayoftype[$objecttype]['ClassPath']) { + include_once $arrayoftype[$objecttype]['ClassPath']; + } else { + include_once DOL_DOCUMENT_ROOT."/".$objecttype."/class/".$objecttype.".class.php"; + } $ObjectClassName = $arrayoftype[$objecttype]['ObjectClassName']; $object = new $ObjectClassName($db); } @@ -249,6 +241,7 @@ foreach($object->fields as $key => $val) { 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; + if (preg_match('/^pass/', $key)) continue; if (in_array($val['type'], array('html', 'text'))) continue; if (in_array($val['type'], array('timestamp', 'date', 'datetime'))) { $arrayofxaxis['t.'.$key.'-year'] = array('label' => $langs->trans($val['label']).' ('.$langs->trans("Year").')', 'position' => $val['position']); @@ -370,8 +363,22 @@ if (! empty($search_measures) && ! empty($search_xaxis)) if ($object->isextrafieldmanaged) { $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.$object->table_element.'_extrafields as te ON te.fk_object = t.'.$fieldid; } + if ($object->ismultientitymanaged) { + if ($object->ismultientitymanaged == 1) { + // Nothing here + } else if ($object->ismultientitymanaged == 2) { + $sql .= ' INNER JOIN '.MAIN_DB_PREFIX.'societe as parenttable ON t.fk_soc = parenttable.rowid'; + $sql .= ' AND parenttable.entity IN ('.getEntity('societe').')'; + } else { + $tmparray = explode('@', $object->ismultientitymanaged); + $sql .= ' INNER JOIN '.MAIN_DB_PREFIX.$tmparray[1].' as parenttable ON t.'.$tmparray[0].' = parenttable.rowid'; + $sql .= ' AND parenttable.entity IN ('.getEntity($tmparray[1]).')'; + } + } $sql .= ' WHERE 1 = 1'; - $sql .= ' AND entity IN ('.getEntity($object->element).')'; + if ($object->ismultientitymanaged == 1) { + $sql .= ' AND entity IN ('.getEntity($object->element).')'; + } foreach($search_filters as $key => $val) { // TODO } diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 1490169ec8d..c09f43cdedd 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -190,6 +190,8 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f if ($features == 'facturerec') $features = 'facture'; if ($features == 'mo') $features = 'mrp'; + if ($features == 'member') $features = 'adherent'; + if ($features == 'subscription') { $features = 'adherent'; $feature2 = 'cotisation'; }; // Get more permissions checks from hooks $parameters = array('features'=>$features, 'objectid'=>$objectid, 'idtype'=>$dbt_select); diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index bbc4e08df23..531d8d224d9 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -659,6 +659,7 @@ if ($dirins && $action == 'confirm_removefile' && !empty($module)) } } +// Build the $fields array from SQL table (initfromtablename) if ($dirins && $action == 'initobject' && $module && GETPOST('createtablearray', 'alpha')) { $tablename = GETPOST('initfromtablename', 'alpha'); @@ -757,6 +758,7 @@ if ($dirins && $action == 'initobject' && $module && GETPOST('createtablearray', // position $position = $i; if (in_array($fieldname, array('status', 'statut', 'fk_status', 'fk_statut'))) $position = 500; + if ($fieldname == 'import_key') $position = 900; // index $index = 0; if ($fieldname == 'entity') $index = 1; diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index afa906be06c..5c30783f8e5 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -43,7 +43,8 @@ class MyObject extends CommonObject public $table_element = 'mymodule_myobject'; /** - * @var int Does myobject support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + * @var int Does myobject support multicompany module ? + * 0=No test on entity, 1=Test with field entity, 2=Test with link by fk_soc, 'field@table'=Test with link by field@table */ public $ismultientitymanaged = 0; From 3a74c3d7e9b3e3b5e2fac14098b668082ab23352 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 8 Feb 2020 14:40:30 +0100 Subject: [PATCH 148/306] Enhance property ->ismulticompanymanaged to define an object with entity on its parent. --- htdocs/core/class/commonobject.class.php | 28 +++++++++++++------ htdocs/core/class/html.form.class.php | 13 +++++++-- htdocs/core/customreports.php | 3 -- .../template/class/myobject.class.php | 4 +-- .../class/companypaymentmode.class.php | 5 ++-- 5 files changed, 34 insertions(+), 19 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 39bdc678fc4..c7dbab57b31 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1766,19 +1766,22 @@ abstract class CommonObject if ($user->socid > 0) $socid = $user->socid; // this->ismultientitymanaged contains - // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe - $alias = 's'; - if ($this->element == 'societe') $alias = 'te'; + // 0=No test on entity, 1=Test with field entity, 'field@table'=Test with link by field@table + $aliastablesociete = 's'; + if ($this->element == 'societe') $aliastablesociete = 'te'; // te as table_element $sql = "SELECT MAX(te.".$fieldid.")"; $sql .= " FROM ".(empty($nodbprefix) ?MAIN_DB_PREFIX:'').$this->table_element." as te"; if ($this->element == 'user' && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { $sql .= ",".MAIN_DB_PREFIX."usergroup_user as ug"; } - if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 2) $sql .= ", ".MAIN_DB_PREFIX."societe as s"; // If we need to link to societe to limit select to entity + if (isset($this->ismultientitymanaged) && ! is_numeric($this->ismultientitymanaged)) { + $tmparray = explode('@', $this->ismultientitymanaged); + $sql .= ", ".MAIN_DB_PREFIX.$tmparray[1]." as ".($tmparray[1] == 'societe' ? 's' : 'parenttable'); // If we need to link to this table to limit select to entity + } elseif ($this->restrictiononfksoc == 1 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe as s"; // If we need to link to societe to limit select to socid elseif ($this->restrictiononfksoc == 2 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON te.fk_soc = s.rowid"; // If we need to link to societe to limit select to socid - if ($this->restrictiononfksoc && !$user->rights->societe->client->voir && !$socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON ".$alias.".rowid = sc.fk_soc"; + if ($this->restrictiononfksoc && !$user->rights->societe->client->voir && !$socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON ".$aliastablesociete.".rowid = sc.fk_soc"; $sql .= " WHERE te.".$fieldid." < '".$this->db->escape($this->ref)."'"; // ->ref must always be defined (set to id if field does not exists) if ($this->restrictiononfksoc == 1 && !$user->rights->societe->client->voir && !$socid) $sql .= " AND sc.fk_user = ".$user->id; if ($this->restrictiononfksoc == 2 && !$user->rights->societe->client->voir && !$socid) $sql .= " AND (sc.fk_user = ".$user->id.' OR te.fk_soc IS NULL)'; @@ -1787,7 +1790,10 @@ abstract class CommonObject if (!preg_match('/^\s*AND/i', $filter)) $sql .= " AND "; // For backward compatibility $sql .= $filter; } - if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 2) $sql .= ' AND te.fk_soc = s.rowid'; // If we need to link to societe to limit select to entity + if (isset($this->ismultientitymanaged) && ! is_numeric($this->ismultientitymanaged)) { + $tmparray = explode('@', $this->ismultientitymanaged); + $sql .= ' AND te.'.$tmparray[0].' = '.($tmparray[1] == 'societe' ? 's' : 'parenttable').'.rowid'; // If we need to link to this table to limit select to entity + } elseif ($this->restrictiononfksoc == 1 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql .= ' AND te.fk_soc = s.rowid'; // If we need to link to societe to limit select to socid if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) { if ($this->element == 'user' && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { @@ -1801,6 +1807,10 @@ abstract class CommonObject $sql .= ' AND te.entity IN ('.getEntity($this->element).')'; } } + if (isset($this->ismultientitymanaged) && ! is_numeric($this->ismultientitymanaged) && $this->element != 'societe') { + $tmparray = explode('@', $this->ismultientitymanaged); + $sql .= ' AND parenttable.entity IN ('.getEntity($tmparray[1]).')'; + } if ($this->restrictiononfksoc == 1 && $socid && $this->element != 'societe') $sql .= ' AND te.fk_soc = '.$socid; if ($this->restrictiononfksoc == 2 && $socid && $this->element != 'societe') $sql .= ' AND (te.fk_soc = '.$socid.' OR te.fk_soc IS NULL)'; if ($this->restrictiononfksoc && $socid && $this->element == 'societe') $sql .= ' AND te.rowid = '.$socid; @@ -1821,10 +1831,10 @@ abstract class CommonObject if ($this->element == 'user' && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { $sql .= ",".MAIN_DB_PREFIX."usergroup_user as ug"; } - if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 2) $sql .= ", ".MAIN_DB_PREFIX."societe as s"; // If we need to link to societe to limit select to entity + if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 'fk_soc@societe') $sql .= ", ".MAIN_DB_PREFIX."societe as s"; // If we need to link to societe to limit select to entity elseif ($this->restrictiononfksoc == 1 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe as s"; // If we need to link to societe to limit select to socid elseif ($this->restrictiononfksoc == 2 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON te.fk_soc = s.rowid"; // If we need to link to societe to limit select to socid - if ($this->restrictiononfksoc && !$user->rights->societe->client->voir && !$socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON ".$alias.".rowid = sc.fk_soc"; + if ($this->restrictiononfksoc && !$user->rights->societe->client->voir && !$socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON ".$aliastablesociete.".rowid = sc.fk_soc"; $sql .= " WHERE te.".$fieldid." > '".$this->db->escape($this->ref)."'"; // ->ref must always be defined (set to id if field does not exists) if ($this->restrictiononfksoc == 1 && !$user->rights->societe->client->voir && !$socid) $sql .= " AND sc.fk_user = ".$user->id; if ($this->restrictiononfksoc == 2 && !$user->rights->societe->client->voir && !$socid) $sql .= " AND (sc.fk_user = ".$user->id.' OR te.fk_soc IS NULL)'; @@ -1833,7 +1843,7 @@ abstract class CommonObject if (!preg_match('/^\s*AND/i', $filter)) $sql .= " AND "; // For backward compatibility $sql .= $filter; } - if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 2) $sql .= ' AND te.fk_soc = s.rowid'; // If we need to link to societe to limit select to entity + if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 'fk_soc@societe') $sql .= ' AND te.fk_soc = s.rowid'; // If we need to link to societe to limit select to entity elseif ($this->restrictiononfksoc == 1 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql .= ' AND te.fk_soc = s.rowid'; // If we need to link to societe to limit select to socid if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) { if ($this->element == 'user' && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index e7cd695dc0b..b8ec41c7c16 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6037,16 +6037,23 @@ class Form // Search data $sql = "SELECT t.rowid, ".$fieldstoshow." FROM ".MAIN_DB_PREFIX.$objecttmp->table_element." as t"; - if ($objecttmp->ismultientitymanaged == 2) + if (isset($objecttmp->ismultientitymanaged) && ! is_numeric($objecttmp->ismultientitymanaged)) { + $tmparray = explode('@', $objecttmp->ismultientitymanaged); + $sql .= ' INNER JOIN '.MAIN_DB_PREFIX.$tmparray[1].' as parenttable ON parenttable.rowid = t.'.$tmparray[0]; + } + if ($objecttmp->ismultientitymanaged == 'fk_soc@societe') if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql .= " WHERE 1=1"; - if (!empty($objecttmp->ismultientitymanaged)) $sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")"; + if (isset($objecttmp->ismultientitymanaged) && $objecttmp->ismultientitymanaged == 1) $sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")"; + if (isset($objecttmp->ismultientitymanaged) && ! is_numeric($objecttmp->ismultientitymanaged)) { + $sql .= ' AND parenttable.entity = t.'.$tmparray[0]; + } if ($objecttmp->ismultientitymanaged == 1 && !empty($user->socid)) { if ($objecttmp->element == 'societe') $sql .= " AND t.rowid = ".$user->socid; else $sql .= " AND t.fk_soc = ".$user->socid; } if ($searchkey != '') $sql .= natural_search(explode(',', $fieldstoshow), $searchkey); - if ($objecttmp->ismultientitymanaged == 2) { + if ($objecttmp->ismultientitymanaged == 'fk_soc@societe') { if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; } if ($objecttmp->filter) { // Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')" diff --git a/htdocs/core/customreports.php b/htdocs/core/customreports.php index f278de1a506..03bc1b0ef04 100644 --- a/htdocs/core/customreports.php +++ b/htdocs/core/customreports.php @@ -366,9 +366,6 @@ if (! empty($search_measures) && ! empty($search_xaxis)) if ($object->ismultientitymanaged) { if ($object->ismultientitymanaged == 1) { // Nothing here - } else if ($object->ismultientitymanaged == 2) { - $sql .= ' INNER JOIN '.MAIN_DB_PREFIX.'societe as parenttable ON t.fk_soc = parenttable.rowid'; - $sql .= ' AND parenttable.entity IN ('.getEntity('societe').')'; } else { $tmparray = explode('@', $object->ismultientitymanaged); $sql .= ' INNER JOIN '.MAIN_DB_PREFIX.$tmparray[1].' as parenttable ON t.'.$tmparray[0].' = parenttable.rowid'; diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index 5c30783f8e5..fe4cc0931fd 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -43,8 +43,8 @@ class MyObject extends CommonObject public $table_element = 'mymodule_myobject'; /** - * @var int Does myobject support multicompany module ? - * 0=No test on entity, 1=Test with field entity, 2=Test with link by fk_soc, 'field@table'=Test with link by field@table + * @var int Does this object support multicompany module ? + * 0=No test on entity, 1=Test with field entity, 'field@table'=Test with link by field@table */ public $ismultientitymanaged = 0; diff --git a/htdocs/societe/class/companypaymentmode.class.php b/htdocs/societe/class/companypaymentmode.class.php index 0134437adc7..6cd09ce49c4 100644 --- a/htdocs/societe/class/companypaymentmode.class.php +++ b/htdocs/societe/class/companypaymentmode.class.php @@ -43,9 +43,10 @@ class CompanyPaymentMode extends CommonObject public $table_element = 'societe_rib'; /** - * @var int Does companypaymentmode support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + * @var int Does this object support multicompany module ? + * 0=No test on entity, 1=Test with field entity, 'field@table'=Test with link by field@table */ - public $ismultientitymanaged = 2; + public $ismultientitymanaged = 'fk_soc@societe'; /** * @var int Does companypaymentmode support extrafields ? 0=No, 1=Yes From 9c12c4be08b6a08e445fa25db6b5493d9ad4efd8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 8 Feb 2020 14:49:26 +0100 Subject: [PATCH 149/306] Fix customreports --- htdocs/core/customreports.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/customreports.php b/htdocs/core/customreports.php index 03bc1b0ef04..80d88f72203 100644 --- a/htdocs/core/customreports.php +++ b/htdocs/core/customreports.php @@ -180,6 +180,7 @@ $arrayofyaxis = array(); print '
'; print ''; +print ''; print '
'; @@ -193,7 +194,7 @@ else { jQuery(document).ready(function() { jQuery("#objecttype").change(function() { console.log("Reload for "+jQuery("#objecttype").val()); - location.href = "'.$_SERVER["PHP_SELF"].'?objecttype="+jQuery("#objecttype").val(); + location.href = "'.$_SERVER["PHP_SELF"].'?objecttype="+jQuery("#objecttype").val()+"'.($tabfamily?'&tabfamily='.$tabfamily:'').'"; }); }); '; From 85c4013a0d074a1b8d3897e2055157bde272fdd8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 8 Feb 2020 14:52:02 +0100 Subject: [PATCH 150/306] Update card.php --- htdocs/user/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/user/card.php b/htdocs/user/card.php index f1d4f639e79..7feaf2911fa 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -2147,7 +2147,7 @@ else print '
'; } @@ -954,7 +952,7 @@ if ($action == 'create') $numcontrat = $formcontract->select_contract($soc->id, GETPOST('contratid', 'int'), 'contratid', 0, 1); if ($numcontrat == 0) { - print '   '.$langs->trans("AddContract").''; + print '   '; } print ''; } From bc8d9e6c7eee9c0f2bc84f60bece8c7f3f9166ad Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Sun, 9 Feb 2020 14:04:22 +0100 Subject: [PATCH 164/306] Add langs tags --- htdocs/langs/en_US/receiptprinter.lang | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/htdocs/langs/en_US/receiptprinter.lang b/htdocs/langs/en_US/receiptprinter.lang index 9a3b28fa399..3df49b9fe67 100644 --- a/htdocs/langs/en_US/receiptprinter.lang +++ b/htdocs/langs/en_US/receiptprinter.lang @@ -54,3 +54,10 @@ DOL_UNDERLINE=Enable underline DOL_UNDERLINE_DISABLED=Disable underline DOL_BEEP=Beed sound DOL_PRINT_TEXT=Print text +DOL_VALUE_DATE=Invoice date +DOL_VALUE_DATE_TIME=Invoice date and time +DOL_VALUE_YEAR=Invoice year +DOL_VALUE_MONTH_LETTERS=Invoice month in letters +DOL_VALUE_MONTH=Invoice month +DOL_VALUE_DAY=Invoice day +DOL_VALUE_DAY_LETTERS=Inovice day in letters From 37e815183ec35355bba30723b8594f76abd26b4a Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Sun, 9 Feb 2020 14:06:02 +0100 Subject: [PATCH 165/306] Add time tags --- htdocs/core/class/dolreceiptprinter.class.php | 20 +++++++------------ 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/htdocs/core/class/dolreceiptprinter.class.php b/htdocs/core/class/dolreceiptprinter.class.php index e8e43281d79..9fa42a8cce8 100644 --- a/htdocs/core/class/dolreceiptprinter.class.php +++ b/htdocs/core/class/dolreceiptprinter.class.php @@ -59,8 +59,6 @@ * Replaced by month number * Replaced by day number * Replaced by day number - * Replaced by table number (for restaurant, bar...) - * Replaced by number of cutlery (for restaurant) * Replaced by object id * Replaced by object ref * Replaced by customer firstname @@ -180,8 +178,6 @@ class dolReceiptPrinter extends Printer 'dol_value_month', 'dol_value_day', 'dol_value_day_letters', - 'dol_value_table', - 'dol_value_cutlery', 'dol_print_payment', 'dol_print_logo', 'dol_print_logo_old', @@ -579,15 +575,13 @@ class dolReceiptPrinter extends Printer $this->template = str_replace('', $object->vendor_firstname, $this->template); $this->template = str_replace('', $object->vendor_lastname, $this->template); $this->template = str_replace('', $object->vendor_mail, $this->template); - $this->template = str_replace('', $object->date, $this->template); - $this->template = str_replace('', $object->date_time, $this->template); - $this->template = str_replace('', $object->date_time, $this->template); - $this->template = str_replace('', $object->date_time, $this->template); - $this->template = str_replace('', $object->date_time, $this->template); - $this->template = str_replace('', $object->date_time, $this->template); - $this->template = str_replace('', $object->date_time, $this->template); - $this->template = str_replace('', $object->table, $this->template); - $this->template = str_replace('', $object->cutlery, $this->template); + $this->template = str_replace('', dol_print_date($object->date, 'day'), $this->template); + $this->template = str_replace('', dol_print_date($object->date, 'dayhour'), $this->template); + $this->template = str_replace('', dol_print_date($object->date, '%Y'), $this->template); + $this->template = str_replace('', $langs->trans("Month".dol_print_date($object->date, '%m')), $this->template); + $this->template = str_replace('', dol_print_date($object->date, '%m'), $this->template); + $this->template = str_replace('', dol_print_date($object->date, '%d'), $this->template); + $this->template = str_replace('', $langs->trans("Day".dol_print_date($object->date, '%m')[1]), $this->template); // parse template $p = xml_parser_create(); From 5d047751646b8c59afef0a364d74783a9dfbb850 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 9 Feb 2020 15:14:01 +0100 Subject: [PATCH 166/306] Fix missing categorie class --- htdocs/projet/element.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 516069614b8..b3e0303c7f4 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -54,6 +54,7 @@ if (! empty($conf->stock->enabled)) require_once DOL_DOCUMENT_ROOT.'/product/s if (! empty($conf->tax->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; if (! empty($conf->banque->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/paymentvarious.class.php'; if (! empty($conf->salaries->enabled)) require_once DOL_DOCUMENT_ROOT.'/salaries/class/paymentsalary.class.php'; +if (! empty($conf->categorie->enabled)) require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; // Load translation files required by the page $langs->loadLangs(array('projects', 'companies', 'suppliers', 'compta')); @@ -855,7 +856,7 @@ foreach ($listofreferent as $key => $value) elseif (in_array($tablename, array('expensereport_det', 'don', 'projet_task', 'stock_mouvement', 'payment_salary'))) print $langs->trans("User"); else print $langs->trans("ThirdParty"); print ''; - // Duration of intervention + // Duration of intervention if ($tablename == 'fichinter') { print ''; // Other attributes diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 750fbc59135..2289d280139 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -337,7 +337,7 @@ abstract class CommonObject /** * @deprecated - * @see $note_public + * @see $note_private */ public $note; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index cba66729d8c..7188be03507 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -298,9 +298,13 @@ class Form $firstline = preg_replace('/[\n\r].*/', '', $firstline); $tmpcontent = $firstline.((strlen($firstline) != strlen($tmpcontent)) ? '...' : ''); } - $ret .= $tmpcontent; + // We dont use dol_escape_htmltag to get the html formating active, but this need we must also + // clean data from some dangerous html + $ret .= dol_string_onlythesehtmltags(dol_htmlentitiesbr($tmpcontent)); + } + else { + $ret .= dol_escape_htmltag($value); } - else $ret .= dol_escape_htmltag($value); if ($formatfunc && method_exists($object, $formatfunc)) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index b05cc41ea5d..681fc28f92a 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5559,22 +5559,27 @@ function dol_string_nohtmltag($stringtoclean, $removelinefeed = 1, $pagecodeto = /** * Clean a string to keep only desirable HTML tags. * - * @param string $stringtoclean String to clean - * @return string String cleaned + * @param string $stringtoclean String to clean + * @param string $cleanalsosomestyles Clean also some tags + * @return string String cleaned * * @see dol_escape_htmltag() strip_tags() dol_string_nohtmltag() dol_string_neverthesehtmltags() */ -function dol_string_onlythesehtmltags($stringtoclean) +function dol_string_onlythesehtmltags($stringtoclean, $cleanalsosomestyles = 1) { $allowed_tags = array( - "html", "head", "meta", "body", "article", "a", "b", "br", "div", "em", "font", "img", "ins", "hr", "i", "li", "link", + "html", "head", "meta", "body", "article", "a", "b", "br", "div", "dl", "dd", "dt", "em", "font", "img", "ins", "hr", "i", "li", "link", "ol", "p", "s", "section", "span", "strong", "title", "table", "tr", "th", "td", "u", "ul" ); - $allowed_tags_string = join("><", $allowed_tags); $allowed_tags_string = preg_replace('/^>/', '', $allowed_tags_string); $allowed_tags_string = preg_replace('/<$/', '', $allowed_tags_string); + $allowed_tags_string = '<'.$allowed_tags_string.'>'; + + if ($cleanalsosomestyles) { + $stringtoclean = preg_replace('/position\s*:\s*(absolute|fixed)\s*!\s*important/', '', $stringtoclean); // Note: If hacker try to introduce css comment into string to avoid this, string should be encoded by the dol_htmlentitiesbr so be harmless + } $temp = strip_tags($stringtoclean, $allowed_tags_string); @@ -5583,14 +5588,16 @@ function dol_string_onlythesehtmltags($stringtoclean) /** * Clean a string from some undesirable HTML tags. + * Note. Not enough secured as dol_string_onlythesehtmltags(). * - * @param string $stringtoclean String to clean - * @param array $disallowed_tags Array of tags not allowed - * @return string String cleaned + * @param string $stringtoclean String to clean + * @param array $disallowed_tags Array of tags not allowed + * @param string $cleanalsosomestyles Clean also some tags + * @return string String cleaned * * @see dol_escape_htmltag() strip_tags() dol_string_nohtmltag() dol_string_onlythesehtmltags() */ -function dol_string_neverthesehtmltags($stringtoclean, $disallowed_tags = array('textarea')) +function dol_string_neverthesehtmltags($stringtoclean, $disallowed_tags = array('textarea'), $cleanalsosomestyles = 0) { $temp = $stringtoclean; foreach ($disallowed_tags as $tagtoremove) @@ -5598,6 +5605,11 @@ function dol_string_neverthesehtmltags($stringtoclean, $disallowed_tags = array( $temp = preg_replace('/<\/?'.$tagtoremove.'>/', '', $temp); $temp = preg_replace('/<\/?'.$tagtoremove.'\s+[^>]*>/', '', $temp); } + + if ($cleanalsosomestyles) { + $temp = preg_replace('/position\s*:\s*(absolute|fixed)\s*!\s*important/', '', $temp); // Note: If hacker try to introduce css comment into string to avoid this, string should be encoded by the dol_htmlentitiesbr so be harmless + } + return $temp; } diff --git a/htdocs/core/tpl/notes.tpl.php b/htdocs/core/tpl/notes.tpl.php index 7663af1c48e..e19d28ce793 100644 --- a/htdocs/core/tpl/notes.tpl.php +++ b/htdocs/core/tpl/notes.tpl.php @@ -1,7 +1,7 @@ * Copyright (C) 2013 Florian Henry - * Copyright (C) 2014-2017 Laurent Destailleur + * Copyright (C) 2014-2020 Laurent Destailleur * * 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 @@ -78,20 +78,21 @@ print '
'."\n if ($module != 'product') { // No public note yet on products print '
'."\n"; - print '
'."\n"; + print '
'."\n"; print $form->editfieldkey("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, $moreparam, '', 0); print '
'."\n"; - print '
'."\n"; + print '
'."\n"; print $form->editfieldval("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, '', null, null, $moreparam, 1)."\n"; print '
'."\n"; print '
'."\n"; } if (empty($user->socid)) { + // Private notes (always hidden to external users) print '
'."\n"; - print '
'."\n"; + print '
'."\n"; print $form->editfieldkey("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, $moreparam, '', 0); print '
'."\n"; - print '
'."\n"; + print '
'."\n"; print $form->editfieldval("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, '', null, null, $moreparam, 1); print '
'."\n"; print '
'."\n"; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index c6386ba7ea2..670734e6706 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -23,6 +23,10 @@ body { trans("DIRECTION").";\n"; ?> } +.sensiblehtmlcontent * { + position: static !important; +} + .thumbstat { font-weight: bold !important; } th a { font-weight: !important; } a.tab { font-weight: 500 !important; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 2f76ee382e9..0293513109d 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -247,6 +247,10 @@ body { trans("DIRECTION").";\n"; ?> } +.sensiblehtmlcontent * { + position: static !important; +} + .thumbstat { font-weight: bold !important; } th a { font-weight: !important; } a.tab { font-weight: 500 !important; } diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php index cd8607a764b..19c52b6fa7f 100644 --- a/htdocs/user/group/card.php +++ b/htdocs/user/group/card.php @@ -386,7 +386,9 @@ else // Note print '
'; - print ''; + print ''; print "\n"; // Other attributes diff --git a/htdocs/user/group/ldap.php b/htdocs/user/group/ldap.php index 448f38aea50..eca923f68be 100644 --- a/htdocs/user/group/ldap.php +++ b/htdocs/user/group/ldap.php @@ -126,7 +126,9 @@ if (! empty($conf->mutlicompany->enabled)) // Note print ''; -print ''; +print ''; print "\n"; // LDAP DN diff --git a/htdocs/user/group/perms.php b/htdocs/user/group/perms.php index 39dc2e61f9f..576cbebff8d 100644 --- a/htdocs/user/group/perms.php +++ b/htdocs/user/group/perms.php @@ -212,7 +212,9 @@ if ($object->id > 0) // Note print ''; - print ''; + print ''; print "\n"; print '
'; - print $objectstatic->getNomUrl(1, '', '', 0, 1, $conf->global->PROPAL_LIST_SHOW_NOTES); + print $objectstatic->getNomUrl(1, '', '', 0, 1, (isset($conf->global->PROPAL_LIST_SHOW_NOTES) ? $conf->global->PROPAL_LIST_SHOW_NOTES : 1)); print '
'; //print img_object('', $picto, 'class="pictoobjectwidth"').' '.$objMod->getName(); @@ -241,12 +241,12 @@ if ($result) print ' '; print ''.$perm_libelle.'
'.$langs->trans("DateCreation").''; print dol_print_date($object->datec, 'dayhour'); - print ' - '.$langs->trans("TimeElapsedSince").': '.''.convertSecondToTime(roundUpToNextMultiple($now - $object->datec, 60)).''; + print ' - '.$langs->trans("TimeElapsedSince").': '.''.convertSecondToTime(roundUpToNextMultiple($now - $object->datec, 60)).''; print '
'.$langs->trans("TicketReadOn").''; if (!empty($object->date_read)) { print dol_print_date($object->date_read, 'dayhour'); - print ' - '.$langs->trans("TicketTimeToRead").': '.convertSecondToTime(roundUpToNextMultiple($object->date_read - $object->datec, 60)).''; - print ' - '.$langs->trans("TimeElapsedSince").': '.''.convertSecondToTime(roundUpToNextMultiple($now - $object->date_read, 60)).''; + print ' - '.$langs->trans("TicketTimeToRead").': '.convertSecondToTime(roundUpToNextMultiple($object->date_read - $object->datec, 60)).''; + print ' - '.$langs->trans("TimeElapsedSince").': '.''.convertSecondToTime(roundUpToNextMultiple($now - $object->date_read, 60)).''; } print '
'.$langs->trans("DateCreation").''; print dol_print_date($object->datec, 'dayhour'); - print ' - '.$langs->trans("TimeElapsedSince").': '.''.convertSecondToTime(roundUpToNextMultiple($now - $object->datec, 60)).''; + print ' - '.$langs->trans("TimeElapsedSince").': '.''.convertSecondToTime(roundUpToNextMultiple($now - $object->datec, 60)).''; print '
'.$langs->trans("TicketReadOn").''; if (!empty($object->date_read)) { print dol_print_date($object->date_read, 'dayhour'); - print ' - '.$langs->trans("TicketTimeToRead").': '.convertSecondToTime(roundUpToNextMultiple($object->date_read - $object->datec, 60)).''; - print ' - '.$langs->trans("TimeElapsedSince").': '.''.convertSecondToTime(roundUpToNextMultiple($now - $object->date_read, 60)).''; + print ' - '.$langs->trans("TicketTimeToRead").': '.convertSecondToTime(roundUpToNextMultiple($object->date_read - $object->datec, 60)).''; + print ' - '.$langs->trans("TimeElapsedSince").': '.''.convertSecondToTime(roundUpToNextMultiple($now - $object->date_read, 60)).''; } print '
'; - if (!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire)) + print '
'; + if ((!$object->code_fournisseur || $object->code_fournisseur == -1) && $modCodeFournisseur->code_auto) { - print '
'; - if ((!$object->code_fournisseur || $object->code_fournisseur == -1) && $modCodeFournisseur->code_auto) - { - $tmpcode = $object->code_fournisseur; - if (empty($tmpcode) && !empty($object->oldcopy->code_fournisseur)) $tmpcode = $object->oldcopy->code_fournisseur; // When there is an error to update a thirdparty, the number for supplier and customer code is kept to old value. - if (empty($tmpcode) && !empty($modCodeFournisseur->code_auto)) $tmpcode = $modCodeFournisseur->getNextValue($object, 1); - print ''; - } - elseif ($object->codefournisseur_modifiable()) - { - print ''; - } - else - { - print $object->code_fournisseur; - print ''; - } - print ''; - $s = $modCodeFournisseur->getToolTip($langs, $object, 1); - print $form->textwithpicto('', $s, 1); - print '
'; + $tmpcode = $object->code_fournisseur; + if (empty($tmpcode) && !empty($object->oldcopy->code_fournisseur)) $tmpcode = $object->oldcopy->code_fournisseur; // When there is an error to update a thirdparty, the number for supplier and customer code is kept to old value. + if (empty($tmpcode) && !empty($modCodeFournisseur->code_auto)) $tmpcode = $modCodeFournisseur->getNextValue($object, 1); + print ''; } + elseif ($object->codefournisseur_modifiable()) + { + print ''; + } + else + { + print $object->code_fournisseur; + print ''; + } + print '
'; + $s = $modCodeFournisseur->getToolTip($langs, $object, 1); + print $form->textwithpicto('', $s, 1); + print '
'; print '
'; - if (!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire)) + print '
'; + if ((!$object->code_fournisseur || $object->code_fournisseur == -1) && $modCodeFournisseur->code_auto) { - print '
'; - if ((!$object->code_fournisseur || $object->code_fournisseur == -1) && $modCodeFournisseur->code_auto) - { - $tmpcode = $object->code_fournisseur; - if (empty($tmpcode) && !empty($object->oldcopy->code_fournisseur)) $tmpcode = $object->oldcopy->code_fournisseur; // When there is an error to update a thirdparty, the number for supplier and customer code is kept to old value. - if (empty($tmpcode) && !empty($modCodeFournisseur->code_auto)) $tmpcode = $modCodeFournisseur->getNextValue($object, 1); - print ''; - } - elseif ($object->codefournisseur_modifiable()) - { - print ''; - } - else - { - print $object->code_fournisseur; - print ''; - } - print ''; - $s = $modCodeFournisseur->getToolTip($langs, $object, 1); - print $form->textwithpicto('', $s, 1); - print '
'; + $tmpcode = $object->code_fournisseur; + if (empty($tmpcode) && !empty($object->oldcopy->code_fournisseur)) $tmpcode = $object->oldcopy->code_fournisseur; // When there is an error to update a thirdparty, the number for supplier and customer code is kept to old value. + if (empty($tmpcode) && !empty($modCodeFournisseur->code_auto)) $tmpcode = $modCodeFournisseur->getNextValue($object, 1); + print ''; } + elseif ($object->codefournisseur_modifiable()) + { + print ''; + } + else + { + print $object->code_fournisseur; + print ''; + } + print '
'; + $s = $modCodeFournisseur->getToolTip($langs, $object, 1); + print $form->textwithpicto('', $s, 1); + print '
'; print '
'; if ($user->admin && !$object->ldap_sid) { - print ''; + print ''; } else { @@ -2173,7 +2173,7 @@ else { if ($caneditpassword) { - $valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').''; + $valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').''; } else { From ae5da164c69bca34655a6e94f481d2ccc82fdc54 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Thu, 6 Feb 2020 10:47:56 +0100 Subject: [PATCH 151/306] FIX need weight short label in shipping doc need short label because value + term is too long --- htdocs/core/modules/expedition/doc/pdf_rouget.modules.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index a19d98748ee..ad0272f46a1 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -536,12 +536,12 @@ class pdf_rouget extends ModelePdfExpedition $weighttxt = ''; if ($object->lines[$i]->fk_product_type == 0 && $object->lines[$i]->weight) { - $weighttxt = round($object->lines[$i]->weight * $object->lines[$i]->qty_shipped, 5).' '.measuringUnitString(0, "weight", $object->lines[$i]->weight_units); + $weighttxt = round($object->lines[$i]->weight * $object->lines[$i]->qty_shipped, 5).' '.measuringUnitString(0, "weight", $object->lines[$i]->weight_units, 1); } $voltxt = ''; if ($object->lines[$i]->fk_product_type == 0 && $object->lines[$i]->volume) { - $voltxt = round($object->lines[$i]->volume * $object->lines[$i]->qty_shipped, 5).' '.measuringUnitString(0, "volume", $object->lines[$i]->volume_units ? $object->lines[$i]->volume_units : 0); + $voltxt = round($object->lines[$i]->volume * $object->lines[$i]->qty_shipped, 5).' '.measuringUnitString(0, "volume", $object->lines[$i]->volume_units ? $object->lines[$i]->volume_units : 0, 1); } if (empty($conf->global->SHIPPING_PDF_HIDE_WEIGHT_AND_VOLUME)) From 81007086393e9ad056d5760d2295cf4a7701b6a8 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Thu, 6 Feb 2020 10:49:05 +0100 Subject: [PATCH 152/306] Update pdf_espadon.modules.php --- htdocs/core/modules/expedition/doc/pdf_espadon.modules.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index 5706ce5d7fa..0d702adab60 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -519,12 +519,12 @@ class pdf_espadon extends ModelePdfExpedition $weighttxt=''; if ($object->lines[$i]->fk_product_type == 0 && $object->lines[$i]->weight) { - $weighttxt=round($object->lines[$i]->weight * $object->lines[$i]->qty_shipped, 5).' '.measuringUnitString(0, "weight", $object->lines[$i]->weight_units); + $weighttxt=round($object->lines[$i]->weight * $object->lines[$i]->qty_shipped, 5).' '.measuringUnitString(0, "weight", $object->lines[$i]->weight_units, 1); } $voltxt=''; if ($object->lines[$i]->fk_product_type == 0 && $object->lines[$i]->volume) { - $voltxt=round($object->lines[$i]->volume * $object->lines[$i]->qty_shipped, 5).' '.measuringUnitString(0, "volume", $object->lines[$i]->volume_units?$object->lines[$i]->volume_units:0); + $voltxt=round($object->lines[$i]->volume * $object->lines[$i]->qty_shipped, 5).' '.measuringUnitString(0, "volume", $object->lines[$i]->volume_units?$object->lines[$i]->volume_units:0, 1); } From e951743077fb435f977a8473260024b091de9517 Mon Sep 17 00:00:00 2001 From: ksar <35605507+ksar-ksar@users.noreply.github.com> Date: Thu, 6 Feb 2020 12:15:18 +0100 Subject: [PATCH 153/306] Update export_files.php Remove Warning --- htdocs/admin/tools/export_files.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/htdocs/admin/tools/export_files.php b/htdocs/admin/tools/export_files.php index 4f9e8b933d2..e3be54458c0 100644 --- a/htdocs/admin/tools/export_files.php +++ b/htdocs/admin/tools/export_files.php @@ -165,9 +165,6 @@ if ($errormsg) setEventMessages($langs->trans("Error")." : ".$errormsg, null, 'errors'); } -print '
'; - - // Redirect t backup page header("Location: dolibarr_export.php"); From 544e05a7dda1cb5481d215e073bc7803cec2c7ac Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 8 Feb 2020 15:06:45 +0100 Subject: [PATCH 154/306] Update card.php --- htdocs/compta/tva/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index 23fd65d4689..d5352f97d00 100644 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -38,8 +38,8 @@ $action=GETPOST("action", "alpha"); $refund=GETPOST("refund", "int"); if (empty($refund)) $refund=0; -$datev=dol_mktime(12, 0, 0, GETPOST("datevmonth"), GETPOST("datevday"), GETPOST("datevyear")); -$datep=dol_mktime(12, 0, 0, GETPOST("datepmonth"), GETPOST("datepday"), GETPOST("datepyear")); +$datev=dol_mktime(12, 0, 0, GETPOST("datevmonth", 'int'), GETPOST("datevday", 'int'), GETPOST("datevyear", 'int')); +$datep=dol_mktime(12, 0, 0, GETPOST("datepmonth", 'int'), GETPOST("datepday", 'int'), GETPOST("datepyear", 'int')); From 1a167aa5b400da4a138b7e8a9bb0bd6121e15f66 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 8 Feb 2020 15:06:45 +0100 Subject: [PATCH 155/306] Update card.php Conflicts: htdocs/compta/tva/card.php --- htdocs/compta/tva/card.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index 174da6b5869..4682fb62af3 100644 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -38,6 +38,9 @@ $action=GETPOST("action", "alpha"); $refund=GETPOST("refund", "int"); if (empty($refund)) $refund=0; +$datev=dol_mktime(12, 0, 0, GETPOST("datevmonth", 'int'), GETPOST("datevday", 'int'), GETPOST("datevyear", 'int')); +$datep=dol_mktime(12, 0, 0, GETPOST("datepmonth", 'int'), GETPOST("datepday", 'int'), GETPOST("datepyear", 'int')); + // Security check $socid = GETPOST('socid', 'int'); if ($user->socid) $socid=$user->socid; @@ -81,12 +84,9 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel")) { $error=0; - $datev=dol_mktime(12, 0, 0, $_POST["datevmonth"], $_POST["datevday"], $_POST["datevyear"]); - $datep=dol_mktime(12, 0, 0, $_POST["datepmonth"], $_POST["datepday"], $_POST["datepyear"]); - - $object->accountid=GETPOST("accountid"); - $object->type_payment=GETPOST("type_payment"); - $object->num_payment=GETPOST("num_payment"); + $object->accountid=GETPOST("accountid", 'int'); + $object->type_payment=GETPOST("type_payment", 'alphanohtml'); + $object->num_payment=GETPOST("num_payment", 'alphanohtml'); $object->datev=$datev; $object->datep=$datep; From 14531bf16092f9287a97e9622ad6504b49f16e27 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 8 Feb 2020 15:28:40 +0100 Subject: [PATCH 156/306] Fix #13046 - Bad parenthesis on test --- htdocs/core/class/html.formmail.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index db758f6c614..10bbda7647b 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -593,7 +593,7 @@ class FormMail extends Form $out.= ' <'.$this->tomail.'>'; if ($this->withtofree) { - $out.= '
'.$langs->trans("and").' withto) :"").'" />'; + $out.= '
'.$langs->trans("and").' withto) : "").'" />'; } } else @@ -606,7 +606,7 @@ class FormMail extends Form { if (! empty($this->withtofree)) { - $out.= 'withto) :"").'" />'; + $out.= 'withto) : "").'" />'; } if (! empty($this->withto) && is_array($this->withto)) { From c27260869b09652478578b0a689f410cec54cad7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 8 Feb 2020 15:59:08 +0100 Subject: [PATCH 157/306] FIX #13046 More complete --- htdocs/core/class/html.formmail.class.php | 4 +++- htdocs/core/tpl/card_presend.tpl.php | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index abad66c8a73..b7e9c53a845 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -676,10 +676,12 @@ class FormMail extends Form } else { + // The free input of email if (!empty($this->withtofree)) { - $out .= 'withto) : "").'" />'; + $out .= 'withto) : "")).'" />'; } + // The select combo if (!empty($this->withto) && is_array($this->withto)) { if (!empty($this->withtofree)) $out .= " ".$langs->trans("and")."/".$langs->trans("or")." "; diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php index 1a9a046bf81..169b7753b92 100644 --- a/htdocs/core/tpl/card_presend.tpl.php +++ b/htdocs/core/tpl/card_presend.tpl.php @@ -188,7 +188,8 @@ if ($action == 'presend') } } - $formmail->withto = GETPOST('sendto') ? GETPOST('sendto') : $liste; + $formmail->withto = $liste; + $formmail->withtofree = (GETPOSTISSET('sendto') ? (GETPOST('sendto') ? GETPOST('sendto') : '1') : ''); $formmail->withtocc = $liste; $formmail->withtoccc = $conf->global->MAIN_EMAIL_USECCC; $formmail->withtopic = $topicmail; From c083458adf871961e9af1c679dde9a6b959c4d57 Mon Sep 17 00:00:00 2001 From: pnueda Date: Fri, 7 Feb 2020 18:01:14 +0100 Subject: [PATCH 158/306] Update html.formfile.class.php Corrects a bug that adds a second '?' in the url string. When strpos returns 0 as the initial position for '?', it is (mis)taken as FALSE value, and then replaced by a second '?' in the list of get parameters, resulting in something like: /compta/facture/card.php?facid=397?action=remove_file... instead of /compta/facture/card.php?facid=397&action=remove_file... --- htdocs/core/class/html.formfile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index a3d73b627b7..7a3b48e1c40 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -859,7 +859,7 @@ class FormFile if ($delallowed) { $tmpurlsource = preg_replace('/#[a-zA-Z0-9_]*$/', '', $urlsource); - $out .= ' Date: Sat, 8 Feb 2020 17:08:45 +0100 Subject: [PATCH 159/306] Fix AT-BASE --- .../install/mysql/data/llx_accounting_abc.sql | 3 + .../mysql/data/llx_accounting_account_at.sql | 644 +++++++++--------- .../mysql/data/llx_accounting_account_fr.sql | 2 + .../install/mysql/migration/11.0.0-12.0.0.sql | 2 + 4 files changed, 329 insertions(+), 322 deletions(-) diff --git a/htdocs/install/mysql/data/llx_accounting_abc.sql b/htdocs/install/mysql/data/llx_accounting_abc.sql index be87c743c38..9ed0afd7da7 100644 --- a/htdocs/install/mysql/data/llx_accounting_abc.sql +++ b/htdocs/install/mysql/data/llx_accounting_abc.sql @@ -67,6 +67,9 @@ INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUE -- Description of chart of account TN PCT INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 10, 'PCT', 'The Tunisia plan', 1); +-- Description of chart of account AT AT-BASE +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 41, 'AT-BASE', 'Plan Austria', 1); + -- Description of chart of account CL CL-PYME INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 67, 'PC-MIPYME', 'The PYME accountancy Chile plan', 1); diff --git a/htdocs/install/mysql/data/llx_accounting_account_at.sql b/htdocs/install/mysql/data/llx_accounting_account_at.sql index 9adccb27658..d4893c224ee 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_at.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_at.sql @@ -20,326 +20,326 @@ -- -- Descriptif des plans comptables autrichiens standard +-- ADD 4100000 to rowid # Do no remove this comment -- - -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","0","GROUP0","110","0","Patentrechte") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","0","GROUP0","120","0","Software") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","0","GROUP0","121","0","ERP System") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","0","GROUP0","122","0","Homepage") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","0","GROUP0","125","0","Software Fremdentwicklung_noch nicht aktivieren") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","0","GROUP0","160","0","Umgründungsmehrwert") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","0","GROUP0","250","0","Mieterinvestitionen") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","0","GROUP0","400","0","Maschinen") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","0","GROUP0","600","0","Betriebs u. Geschäftsausstattung") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","0","GROUP0","601","0","Ausstellungsstücke") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","0","GROUP0","602","0","Leihstellungsstücke") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","0","GROUP0","603","0","Getriebeprüfstand_hinten") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","0","GROUP0","604","0","Wuchtstand_links_AQ") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","0","GROUP0","605","0","Messlabor(Messraum)") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","0","GROUP0","606","0","PAK-System") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","0","GROUP0","607","0","Server") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","0","GROUP0","608","0","EDV-Ausstattung (Hardware)") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","0","GROUP0","609","0","Werkstattausstattung (Werkzeug)") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","0","GROUP0","610","0","Wuchtprüfstand neu_noch nicht in Betrieb genommen") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","0","GROUP0","611","0","Messequipment/Ausstattung") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","0","GROUP0","630","0","PKW") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","0","GROUP0","640","0","LKW") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","0","GROUP0","680","0","GWG-Geschäftsausstattung") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","0","GROUP0","710","0","Anlagen in Bau") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","1","GROUP1","1100","0","Rohstoffe") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","1","GROUP1","1200","0","Bezogenen Teile") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","1","GROUP1","1300","0","Hilfsstoffe und Betriebsstoffe") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","1","GROUP1","1400","0","fertige Erzeugnisse") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","1","GROUP1","1500","0","unfertige Erzeugnisse") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","1","GROUP1","1600","0","Waren") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","1","GROUP1","1700","0","Noch nicht abrechenbare Leist.") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","1","GROUP1","1701","0","Bestandsveränderung laufend") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","1","GROUP1","1800","0","Vorrat Verpackungsmaterial") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","1","GROUP1","1810","0","Vorrat Werbematerial") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2000","0","Lieferforderungen Inland I") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2080","0","Einzelwertb. Ford. Inland") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2292","0","geleistete Anzahlungen (20%)") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2293","0","gel. Anzahlungen i.g.") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2301","0","Forderung Forschungsprämie") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2302","0","Forderungen gelieferte (noch nicht fakturierte Waren)") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2303","0","Vorauszahlung Leasing Server") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2306","0","Kaution Pfauengarten") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2307","0","Kaution Werkstatt") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2308","0","Kaution Parkplatz PKW") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2309","0","Kaution Werkstatt") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2310","0","Kaution Studentenwohnheim") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2311","0","Kaution China") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2312","0","Vorauszahlung Xerox") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2313","0","Verrechnung Bildungsscheck") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2315","0","Aktivierung Körperschaftsteuer") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2500","0","Vorsteuer") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2501","0","Vorsteuer aus i. g. Erwerb") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2502","0","Vorsteuer reverse charge syst.") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2503","0","Vorsteuer Reverse Charge § 19/1d") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2508","0","Vorsteuer sonstige Leistungen EU") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2509","0","EUSt Forderung") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2510","0","Einfuhrumsatzsteuer") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2531","0","Vorsteuer Frankreich") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2532","0","Vorsteuer Niederlande") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2533","0","Vorsteuer GB") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2534","0","Vorsteuer Belgien") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2535","0","Vorsteuer GB") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","2","GROUP2","2901","0","Leasingvorauszahlung Vito") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3020","0","Rückstellung für Körperschaftsteuer") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3060","0","Rst. für Beratungskosten") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3064","0","Rst. für Sonderzahlungen") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3072","0","Rst. für nicht konsum. Urlaube") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3214","0","Raika 40-00.800.185") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3286","0","Darlehen Dipl. Ing. REICH GMBH") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3287","0","Darlehen Dr.Höfler") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3288","0","Darlehen DI Mayrhofer") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3289","0","Darlehen AWS") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3292","0","Anzahlungen von Kunden 20 %") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3294","0","Anzahlungen von Kunden Drittland") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3300","0","Lieferverbindlichkeiten I") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3481","0","Verrechnungskto DI Mayrhofer") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3500","0","Umsatzsteuer") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3501","0","Umsatzsteuer aus i. g. Erwerb") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3502","0","USt § 19/Art 19 (reverse Charge)") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3503","0","Umsatzsteuer Reverse Charge § 19/1d") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3508","0","Umsatzsteuer sonstige Leistung") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3531","0","FA-Zahllast Dezember") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3533","0","Umsatzsteuer 2012") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3535","0","Umsatzsteuer 2013") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3536","0","Umsatzsteuer 2014") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3537","0","Umsatzsteuer 2015") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3632","0","Verrechnungskonto EUSt") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3892","0","Verbindlichkeiten Anzahlungsrechn.") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","3","GROUP3","3898","0","Abgrenzung Sonderzahlungen") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4000","0","Erlöse Lieferungen 20 %") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4001","0","Erlöse i.g. Lieferung") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4002","0","Erlöse Dienstleistungen EU") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4003","0","Erlöse Dienstleistungen 20 %") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4004","0","Erlöse Software 20 %") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4005","0","Erlöse Software EU") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4006","0","Evidenz Kfd. Reverse Charge") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4050","0","Erlöse 0 % Drittland") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4051","0","Erlöse Dienstleistungen Drittland") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4052","0","Erlöse Software Drittland") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4069","0","Erlöse § 19/1d Schrott") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4400","0","Kundenskonto 20 %") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4405","0","Kundenskonto 0 % Ausfuhrlieferungen") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4410","0","Skontoaufwand i.g. Lieferung") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4413","0","Kundenskonto sonstige Leistung EU") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4420","0","Kundenskonto EU-Land A x %") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4450","0","Kundenrabatt 20%") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4500","0","Bestandsveränderungen fertige Erzeugnisse") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4510","0","Best.Veränd.Halbf.Erzeugnisse") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4519","0","Bestandsveränderung laufend") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4520","0","Best.Veränd.n.n.abger.Leist.") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4530","0","Gelieferte (noch nicht fakturierte Waren)") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4580","0","Aktivierte Eigenleistung") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4630","0","Erträge aus d.Abgang v.Anlagen") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4801","0","Zuwendungen a.öffentl. Mitteln") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4831","0","sonstige betriebliche Erträge (nicht steuerbar)") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4840","0","Sonstige Erlöse 20 %") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4850","0","Erl. Aufwandersätze") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4881","0","Versicherungsvergütungen") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4885","0","Zuschreibungen zum Umlaufvermögen") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4950","0","Privatanteil 20 %") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","4","GROUP4","4991","0","Sachbezüge 20%") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","5","GROUP5","5000","0","Handelswareneinsatz") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","5","GROUP5","5001","0","Materialeinkauf Fremdfertigung") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","5","GROUP5","5002","0","Wareneinkauf Verkauf") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","5","GROUP5","5020","0","Materialeinkauf") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","5","GROUP5","5090","0","Bezugskosten") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","5","GROUP5","5100","0","Verbrauch Rohstoffe") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","5","GROUP5","5199","0","Aufwand für TW-AFA Vorräte") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","5","GROUP5","5200","0","Verbrauch bezogenen Teile") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","5","GROUP5","5300","0","Verbrauch Hilfsstoffe") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","5","GROUP5","5400","0","Hilfsstoffverbrauch") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","5","GROUP5","5440","0","Inventurveränderung Fremdbarb. + GK") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","5","GROUP5","5441","0","GWG Fremdbarb. + GK") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","5","GROUP5","5450","0","Verpackungsmaterial") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","5","GROUP5","5800","0","Fremdleistungen") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","5","GROUP5","5880","0","Lieferantenskonti") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","5","GROUP5","5900","0","Skontoertrag ig.E. 0% (m.VST)") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","5","GROUP5","5920","0","Skontoertrag ig.E. 20% (m.VST)") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6000","0","Löhne") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6001","0","Rückerstattung AUVA Arbeiter") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6010","0","Lehrlingsentschädigung Arb.") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6020","0","Nichtleistungslöhne") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6100","0","Leihpersonal Aufwand") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6150","0","Sonderzahlungen Arbeiter") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6200","0","Gehälter") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6201","0","Förderung AMS") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6202","0","Rückerstattung AUVA Angestellte") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6210","0","Veränderung Mehrarbeitsvergütung RSt Ang") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6211","0","Veränderung Mehrarbeitsvergütung RSt Arbeiter") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6230","0","Sonderzahlungen Angestellte") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6231","0","Dotierung RST Sonderzahlungen") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6255","0","Geschäftsführerbezüge") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6256","0","Geschäftsführersachbezüge") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6300","0","Sonderzahlung aliquot vorläufig") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6310","0","Dotierung Urlaubsrückstellung") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6311","0","Veränderung Urlaubsrückstellung Arbeiter") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6402","0","Betriebliche Vorsorgekassa Arbeiter") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6407","0","Betriebliche Vorsorgekassa Angestellte") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6416","0","Veränderung Pensionsrückstellung (Angestellte)") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6435","0","sonstige Beiträge für die Altersversorgung") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6500","0","Gesetzlicher Sozialaufwand") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6600","0","Gesetzlicher Sozialaufwand Arbeiter") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6605","0","Gesetzlicher Sozialaufwand Angestellte") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6610","0","Dienstgeberbeitrag Arbeiter") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6611","0","Dienstgeberbeitrag Angestellte") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6620","0","Zuschlag zum DB") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6621","0","Zuschlag zum DB Angestellte") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6630","0","Ausgleichstaxe") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6690","0","Lohnsteuer") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6693","0","Kommunalsteuer Arbeiter") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6694","0","Kommunalsteuer Angestellte") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6700","0","Freiwilliger Sozialaufwand") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6710","0","Arbeitskleidung") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6720","0","Fahrspesen Dienstnehmer") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6730","0","Weihnachtsgeschenke Arbeitnehmer") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6740","0","Betriebsveranstaltungen") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6750","0","Konto frei") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","6760","0","Vergleichszahlung Dienstnehmer") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7030","0","Abschreibung G W G") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7070","0","Buchwert ausgeschiedener Anlagen") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7080","0","Planmäßige AFA immat.WG.") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7081","0","Planmäßige Abschreibung für Sachanlagen") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7100","0","Nicht abzugsfähige Vorsteuer (VStK)") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7110","0","Gebühren und Abgaben_Zoll") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7111","0","Kammerumlage") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7200","0","Instandhaltung Gebäude") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7201","0","Instandhaltung Außenanlagen") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7202","0","Instandh. - Maschinen u. Anl.") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7204","0","Instandhaltung und Betriebskosten Betriebs und Geschäftsgebäude") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7205","0","Verbrauchsmaterial Werkstatt") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7210","0","Müllentsorgung") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7211","0","Entsorgungskosten") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7230","0","Reinigungsmaterial (div. Verbrauchsmaterial)") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7231","0","Berufsbekleidung") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7235","0","Reinigung durch Dritte") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7240","0","LKW-Betriebskosten Vito G 437 MB") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7241","0","Leasing Mercedes Vito G 437 MB") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7250","0","KFZ Betriebskosten allgemein") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7251","0","KFZ Leasing allgemein") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7252","0","KFZ Versicherungen allgemein") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7253","0","Wachdienst") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7254","0","Konto frei") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7255","0","Aufwand Leihwagen") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7256","0","PKW-Betriebskosten VW Golf G 854 SH Versuchsfahrzeug") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7257","0","Leasing VW Golf G 854 SH") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7258","0","Konto frei") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7285","0","Strom") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7286","0","Betriebskosten/Beheizung Mietobjekte") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7300","0","Transporte durch Dritte") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7330","0","Reise und Fahrtspesen") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7331","0","Kilometergelder") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7360","0","Reisediäten") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7380","0","Telefon") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7381","0","Internet") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7382","0","Wartung Homepage") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7390","0","Postgebühren") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7400","0","Konto frei") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7401","0","Konto frei") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7402","0","Konto frei") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7403","0","Miete Büro Linz") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7404","0","Miete Gradnerstraße") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7410","0","Maschinen u. Gerätemieten") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7411","0","Wartungskosten BuG Ausstattung") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7420","0","Mobilien-Leasing ") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7421","0","Konto frei") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7422","0","Leasing Server") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7423","0","Konto frei") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7424","0","Konto frei") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7480","0","Lizenzgebühren") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7540","0","Provisionen an Dritte") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7600","0","Büromaterial") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7601","0","EDV-Material") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7610","0","Drucksorten") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7620","0","Fachliteratur und Zeitungen") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7630","0","Gästeunt. u. Zeitschriften") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7650","0","Werbeaufwand/Inserate") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7651","0","Anbahnung") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7652","0","Aufwand Messen") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7653","0","Konto frei") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7654","0","Inserate") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7670","0","Bewirtungskosten") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7690","0","Trinkgelder u. Spenden") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7691","0","Spenden an begünstigte Institutionen/Sponsoring") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7696","0","Säumnis- und Verspätungszuschläge") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7700","0","Betriebsversicherungen") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7701","0","Transportversicherungen") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7710","0","Pflichtversich. Unternehmer") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7749","0","Aufwand Japan") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7750","0","Steuerberatung (Lohnverrechnung, Buchhaltung)") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7751","0","Patentkosten") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7752","0","Rechtsberatung") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7753","0","Unternehmensberatung") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7754","0","Aufwand tectos China") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7755","0","Wartung (Betreuung EDV)") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7756","0","Lizenzgebühren Abaqus") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7757","0","Lizenzgebühren Sonstige") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7758","0","Sonstige Beratungskosten") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7759","0","EDV-Beratung") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7760","0","Mitgliedsbeiträge/freiwillige Beiträge") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7761","0","Prüfung Jahresabschluss") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7770","0","Aus- und Fortbildung") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7775","0","Forschung und Entwicklung") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7776","0","Messentwicklung") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7777","0","Produktentwicklung") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7785","0","Freiwillige Verbandsbeiträge") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7790","0","Spesen des Geldverkehrs") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7791","0","Kursdifferenzen") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7800","0","Betriebsbedingte Schadensfälle") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7801","0","Ausgaben nicht absetzbar") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7802","0","Strafen") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7805","0","Forderungsverluste 20") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7806","0","Abschreibungen auf Forderungen (EU)") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7807","0","Abschreibungen auf Forderungen (Drittland)") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7810","0","Zuweisung an Einzel-WB Forderungen") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7811","0","Zuweisung pauschale Wertberichtigungen zu Exportforderungen") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7812","0","Abschreibungen auf Vorräte") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7820","0","Buchwert abgegangener Sachanlagen") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7840","0","Gründungskosten") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7850","0","Sonstiger Aufwand") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7851","0","Sonstiger Aufwand Gewinnanteil Reich") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7930","0","Aufw. Gewährleistungsverpfl.") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","7","GROUP7","7940","0","Aufwand aus Vorperioden") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8020","0","Gewinnüberrg. v. Organgesell.") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8060","0","Zinserträge") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8090","0","Ertr.a.Ant.a.and. Unternehmen") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8100","0","Habenzinsen") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8280","0","Zinsen f. Kredite u. Darlehen") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8286","0","Kursgewinne/Kursverluste") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8288","0","Zinsen auf Lieferantenkredite") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8291","0","Sonst. Zinsen und ähnliche Aufwendungen") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8500","0","Körperschaftsteuer") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8505","0","Kapitalertragsteuer") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8510","0","Körperschaftsteuervorauszahl.") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8511","0","Dotierung KöSt-Rückstellung") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8512","0","Aktivierung Körperschaftsteuer") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8513","0","Köst Vorperioden") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8520","0","Forschungsprämie") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8595","0","Ertrag aus der Aktivierung latenter Steuern") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8610","0","Auflösung sonstiger unversteuerter Rücklagen") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8700","0","Auflösung gebundener Kapitalrücklage") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8710","0","Auflösung Rücklage für eigene Anteile") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8720","0","Auflösung nicht gebundene Kapitalrücklage") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8750","0","Auflösung gesetzliche Rücklage") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8760","0","Auflösung satzungsmäßige Rücklage") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8770","0","Auflösung andere (freie) Rücklage") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8810","0","Zuweisung sonstige unversteuerte Rücklagen") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8820","0","Zuweisung Inv. Rücklage") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8890","0","Zuw.Bew.Res.GWG") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8900","0","Zuweisung gesetzliche Rücklagen") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8910","0","Zuweisung satzungsmäßige Rücklagen") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","8","GROUP8","8920","0","Zuweisung andere (freie) Rücklagen") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","9","GROUP9","9390","0","Bilanzgewinn") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","9","GROUP9","9391","0","Bilanzverlust") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","9","GROUP9","9700","0","Wachdienst") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","9","GROUP9","9991","0","Gewinnvortrag") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","9","GROUP9","9993","0","Verlustvortrag") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","9","GROUP9","9994","0","Verlustvortrag") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","5","GROUP5","50200","0","Materialeinkauf") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","60000","0","kalk. Löhne u Gehälter") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","64160","0","Veränderung Pensionsrückstellung (Angestellte)") ; -INSERT INTO llx_accounting_account (entity, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, "AT-BASE","6","GROUP6","66300","0","Leistungserfassung") ; +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 1, 'AT-BASE','0','GROUP0','110','0','Patentrechte'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 2, 'AT-BASE','0','GROUP0','120','0','Software'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 3, 'AT-BASE','0','GROUP0','121','0','ERP System'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 4, 'AT-BASE','0','GROUP0','122','0','Homepage'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 5, 'AT-BASE','0','GROUP0','125','0','Software Fremdentwicklung_noch nicht aktivieren'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 6, 'AT-BASE','0','GROUP0','160','0','Umgründungsmehrwert'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 7, 'AT-BASE','0','GROUP0','250','0','Mieterinvestitionen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 8, 'AT-BASE','0','GROUP0','400','0','Maschinen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 9, 'AT-BASE','0','GROUP0','600','0','Betriebs u. Geschäftsausstattung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 10, 'AT-BASE','0','GROUP0','601','0','Ausstellungsstücke'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 11, 'AT-BASE','0','GROUP0','602','0','Leihstellungsstücke'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 12, 'AT-BASE','0','GROUP0','603','0','Getriebeprüfstand_hinten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 13, 'AT-BASE','0','GROUP0','604','0','Wuchtstand_links_AQ'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 14, 'AT-BASE','0','GROUP0','605','0','Messlabor(Messraum)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 15, 'AT-BASE','0','GROUP0','606','0','PAK-System'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 16, 'AT-BASE','0','GROUP0','607','0','Server'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 17, 'AT-BASE','0','GROUP0','608','0','EDV-Ausstattung (Hardware)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 18, 'AT-BASE','0','GROUP0','609','0','Werkstattausstattung (Werkzeug)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 19, 'AT-BASE','0','GROUP0','610','0','Wuchtprüfstand neu_noch nicht in Betrieb genommen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 20, 'AT-BASE','0','GROUP0','611','0','Messequipment/Ausstattung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 21, 'AT-BASE','0','GROUP0','630','0','PKW'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 22, 'AT-BASE','0','GROUP0','640','0','LKW'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 23, 'AT-BASE','0','GROUP0','680','0','GWG-Geschäftsausstattung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 24, 'AT-BASE','0','GROUP0','710','0','Anlagen in Bau'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 25, 'AT-BASE','1','GROUP1','1100','0','Rohstoffe'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 26, 'AT-BASE','1','GROUP1','1200','0','Bezogenen Teile'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 27, 'AT-BASE','1','GROUP1','1300','0','Hilfsstoffe und Betriebsstoffe'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 28, 'AT-BASE','1','GROUP1','1400','0','fertige Erzeugnisse'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 29, 'AT-BASE','1','GROUP1','1500','0','unfertige Erzeugnisse'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 30, 'AT-BASE','1','GROUP1','1600','0','Waren'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 31, 'AT-BASE','1','GROUP1','1700','0','Noch nicht abrechenbare Leist.'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 32, 'AT-BASE','1','GROUP1','1701','0','Bestandsveränderung laufend'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 33, 'AT-BASE','1','GROUP1','1800','0','Vorrat Verpackungsmaterial'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 34, 'AT-BASE','1','GROUP1','1810','0','Vorrat Werbematerial'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 35, 'AT-BASE','2','GROUP2','2000','0','Lieferforderungen Inland I'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 36, 'AT-BASE','2','GROUP2','2080','0','Einzelwertb. Ford. Inland'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 37, 'AT-BASE','2','GROUP2','2292','0','geleistete Anzahlungen (20%)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 38, 'AT-BASE','2','GROUP2','2293','0','gel. Anzahlungen i.g.'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 39, 'AT-BASE','2','GROUP2','2301','0','Forderung Forschungsprämie'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 40, 'AT-BASE','2','GROUP2','2302','0','Forderungen gelieferte (noch nicht fakturierte Waren)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 41, 'AT-BASE','2','GROUP2','2303','0','Vorauszahlung Leasing Server'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 42, 'AT-BASE','2','GROUP2','2306','0','Kaution Pfauengarten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 43, 'AT-BASE','2','GROUP2','2307','0','Kaution Werkstatt'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 44, 'AT-BASE','2','GROUP2','2308','0','Kaution Parkplatz PKW'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 45, 'AT-BASE','2','GROUP2','2309','0','Kaution Werkstatt'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 46, 'AT-BASE','2','GROUP2','2310','0','Kaution Studentenwohnheim'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 47, 'AT-BASE','2','GROUP2','2311','0','Kaution China'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 48, 'AT-BASE','2','GROUP2','2312','0','Vorauszahlung Xerox'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 49, 'AT-BASE','2','GROUP2','2313','0','Verrechnung Bildungsscheck'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 50, 'AT-BASE','2','GROUP2','2315','0','Aktivierung Körperschaftsteuer'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 51, 'AT-BASE','2','GROUP2','2500','0','Vorsteuer'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 52, 'AT-BASE','2','GROUP2','2501','0','Vorsteuer aus i. g. Erwerb'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 53, 'AT-BASE','2','GROUP2','2502','0','Vorsteuer reverse charge syst.'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 54, 'AT-BASE','2','GROUP2','2503','0','Vorsteuer Reverse Charge § 19/1d'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 55, 'AT-BASE','2','GROUP2','2508','0','Vorsteuer sonstige Leistungen EU'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 56, 'AT-BASE','2','GROUP2','2509','0','EUSt Forderung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 57, 'AT-BASE','2','GROUP2','2510','0','Einfuhrumsatzsteuer'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 58, 'AT-BASE','2','GROUP2','2531','0','Vorsteuer Frankreich'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 59, 'AT-BASE','2','GROUP2','2532','0','Vorsteuer Niederlande'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 60, 'AT-BASE','2','GROUP2','2533','0','Vorsteuer GB'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 61, 'AT-BASE','2','GROUP2','2534','0','Vorsteuer Belgien'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 62, 'AT-BASE','2','GROUP2','2535','0','Vorsteuer GB'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 63, 'AT-BASE','2','GROUP2','2901','0','Leasingvorauszahlung Vito'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 64, 'AT-BASE','3','GROUP3','3020','0','Rückstellung für Körperschaftsteuer'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 65, 'AT-BASE','3','GROUP3','3060','0','Rst. für Beratungskosten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 66, 'AT-BASE','3','GROUP3','3064','0','Rst. für Sonderzahlungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 67, 'AT-BASE','3','GROUP3','3072','0','Rst. für nicht konsum. Urlaube'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 68, 'AT-BASE','3','GROUP3','3214','0','Raika 40-00.800.185'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 69, 'AT-BASE','3','GROUP3','3286','0','Darlehen Dipl. Ing. REICH GMBH'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 70, 'AT-BASE','3','GROUP3','3287','0','Darlehen Dr.Höfler'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 71, 'AT-BASE','3','GROUP3','3288','0','Darlehen DI Mayrhofer'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 72, 'AT-BASE','3','GROUP3','3289','0','Darlehen AWS'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 73, 'AT-BASE','3','GROUP3','3292','0','Anzahlungen von Kunden 20 %'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 74, 'AT-BASE','3','GROUP3','3294','0','Anzahlungen von Kunden Drittland'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 75, 'AT-BASE','3','GROUP3','3300','0','Lieferverbindlichkeiten I'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 76, 'AT-BASE','3','GROUP3','3481','0','Verrechnungskto DI Mayrhofer'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 77, 'AT-BASE','3','GROUP3','3500','0','Umsatzsteuer'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 78, 'AT-BASE','3','GROUP3','3501','0','Umsatzsteuer aus i. g. Erwerb'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 79, 'AT-BASE','3','GROUP3','3502','0','USt § 19/Art 19 (reverse Charge)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 80, 'AT-BASE','3','GROUP3','3503','0','Umsatzsteuer Reverse Charge § 19/1d'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 81, 'AT-BASE','3','GROUP3','3508','0','Umsatzsteuer sonstige Leistung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 82, 'AT-BASE','3','GROUP3','3531','0','FA-Zahllast Dezember'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 83, 'AT-BASE','3','GROUP3','3533','0','Umsatzsteuer 2012'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 84, 'AT-BASE','3','GROUP3','3535','0','Umsatzsteuer 2013'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 85, 'AT-BASE','3','GROUP3','3536','0','Umsatzsteuer 2014'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 86, 'AT-BASE','3','GROUP3','3537','0','Umsatzsteuer 2015'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 87, 'AT-BASE','3','GROUP3','3632','0','Verrechnungskonto EUSt'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 88, 'AT-BASE','3','GROUP3','3892','0','Verbindlichkeiten Anzahlungsrechn.'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 89, 'AT-BASE','3','GROUP3','3898','0','Abgrenzung Sonderzahlungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 90, 'AT-BASE','4','GROUP4','4000','0','Erlöse Lieferungen 20 %'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 91, 'AT-BASE','4','GROUP4','4001','0','Erlöse i.g. Lieferung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 92, 'AT-BASE','4','GROUP4','4002','0','Erlöse Dienstleistungen EU'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 93, 'AT-BASE','4','GROUP4','4003','0','Erlöse Dienstleistungen 20 %'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 94, 'AT-BASE','4','GROUP4','4004','0','Erlöse Software 20 %'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 95, 'AT-BASE','4','GROUP4','4005','0','Erlöse Software EU'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 96, 'AT-BASE','4','GROUP4','4006','0','Evidenz Kfd. Reverse Charge'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 97, 'AT-BASE','4','GROUP4','4050','0','Erlöse 0 % Drittland'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 98, 'AT-BASE','4','GROUP4','4051','0','Erlöse Dienstleistungen Drittland'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 99, 'AT-BASE','4','GROUP4','4052','0','Erlöse Software Drittland'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 100, 'AT-BASE','4','GROUP4','4069','0','Erlöse § 19/1d Schrott'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 101, 'AT-BASE','4','GROUP4','4400','0','Kundenskonto 20 %'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 102, 'AT-BASE','4','GROUP4','4405','0','Kundenskonto 0 % Ausfuhrlieferungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 103, 'AT-BASE','4','GROUP4','4410','0','Skontoaufwand i.g. Lieferung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 104, 'AT-BASE','4','GROUP4','4413','0','Kundenskonto sonstige Leistung EU'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 105, 'AT-BASE','4','GROUP4','4420','0','Kundenskonto EU-Land A x %'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 106, 'AT-BASE','4','GROUP4','4450','0','Kundenrabatt 20%'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 107, 'AT-BASE','4','GROUP4','4500','0','Bestandsveränderungen fertige Erzeugnisse'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 108, 'AT-BASE','4','GROUP4','4510','0','Best.Veränd.Halbf.Erzeugnisse'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 109, 'AT-BASE','4','GROUP4','4519','0','Bestandsveränderung laufend'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 110, 'AT-BASE','4','GROUP4','4520','0','Best.Veränd.n.n.abger.Leist.'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 111, 'AT-BASE','4','GROUP4','4530','0','Gelieferte (noch nicht fakturierte Waren)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 112, 'AT-BASE','4','GROUP4','4580','0','Aktivierte Eigenleistung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 113, 'AT-BASE','4','GROUP4','4630','0','Erträge aus d.Abgang v.Anlagen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 114, 'AT-BASE','4','GROUP4','4801','0','Zuwendungen a.öffentl. Mitteln'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 115, 'AT-BASE','4','GROUP4','4831','0','sonstige betriebliche Erträge (nicht steuerbar)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 116, 'AT-BASE','4','GROUP4','4840','0','Sonstige Erlöse 20 %'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 117, 'AT-BASE','4','GROUP4','4850','0','Erl. Aufwandersätze'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 118, 'AT-BASE','4','GROUP4','4881','0','Versicherungsvergütungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 119, 'AT-BASE','4','GROUP4','4885','0','Zuschreibungen zum Umlaufvermögen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 120, 'AT-BASE','4','GROUP4','4950','0','Privatanteil 20 %'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 121, 'AT-BASE','4','GROUP4','4991','0','Sachbezüge 20%'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 122, 'AT-BASE','5','GROUP5','5000','0','Handelswareneinsatz'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 123, 'AT-BASE','5','GROUP5','5001','0','Materialeinkauf Fremdfertigung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 124, 'AT-BASE','5','GROUP5','5002','0','Wareneinkauf Verkauf'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 125, 'AT-BASE','5','GROUP5','5020','0','Materialeinkauf'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 126, 'AT-BASE','5','GROUP5','5090','0','Bezugskosten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 127, 'AT-BASE','5','GROUP5','5100','0','Verbrauch Rohstoffe'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 128, 'AT-BASE','5','GROUP5','5199','0','Aufwand für TW-AFA Vorräte'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 129, 'AT-BASE','5','GROUP5','5200','0','Verbrauch bezogenen Teile'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 130, 'AT-BASE','5','GROUP5','5300','0','Verbrauch Hilfsstoffe'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 131, 'AT-BASE','5','GROUP5','5400','0','Hilfsstoffverbrauch'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 132, 'AT-BASE','5','GROUP5','5440','0','Inventurveränderung Fremdbarb. + GK'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 133, 'AT-BASE','5','GROUP5','5441','0','GWG Fremdbarb. + GK'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 134, 'AT-BASE','5','GROUP5','5450','0','Verpackungsmaterial'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 135, 'AT-BASE','5','GROUP5','5800','0','Fremdleistungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 136, 'AT-BASE','5','GROUP5','5880','0','Lieferantenskonti'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 137, 'AT-BASE','5','GROUP5','5900','0','Skontoertrag ig.E. 0% (m.VST)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 138, 'AT-BASE','5','GROUP5','5920','0','Skontoertrag ig.E. 20% (m.VST)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 139, 'AT-BASE','6','GROUP6','6000','0','Löhne'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 140, 'AT-BASE','6','GROUP6','6001','0','Rückerstattung AUVA Arbeiter'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 141, 'AT-BASE','6','GROUP6','6010','0','Lehrlingsentschädigung Arb.'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 142, 'AT-BASE','6','GROUP6','6020','0','Nichtleistungslöhne'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 143, 'AT-BASE','6','GROUP6','6100','0','Leihpersonal Aufwand'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 144, 'AT-BASE','6','GROUP6','6150','0','Sonderzahlungen Arbeiter'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 145, 'AT-BASE','6','GROUP6','6200','0','Gehälter'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 146, 'AT-BASE','6','GROUP6','6201','0','Förderung AMS'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 147, 'AT-BASE','6','GROUP6','6202','0','Rückerstattung AUVA Angestellte'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 148, 'AT-BASE','6','GROUP6','6210','0','Veränderung Mehrarbeitsvergütung RSt Ang'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 149, 'AT-BASE','6','GROUP6','6211','0','Veränderung Mehrarbeitsvergütung RSt Arbeiter'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 150, 'AT-BASE','6','GROUP6','6230','0','Sonderzahlungen Angestellte'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 151, 'AT-BASE','6','GROUP6','6231','0','Dotierung RST Sonderzahlungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 152, 'AT-BASE','6','GROUP6','6255','0','Geschäftsführerbezüge'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 153, 'AT-BASE','6','GROUP6','6256','0','Geschäftsführersachbezüge'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 154, 'AT-BASE','6','GROUP6','6300','0','Sonderzahlung aliquot vorläufig'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 155, 'AT-BASE','6','GROUP6','6310','0','Dotierung Urlaubsrückstellung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 156, 'AT-BASE','6','GROUP6','6311','0','Veränderung Urlaubsrückstellung Arbeiter'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 157, 'AT-BASE','6','GROUP6','6402','0','Betriebliche Vorsorgekassa Arbeiter'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 158, 'AT-BASE','6','GROUP6','6407','0','Betriebliche Vorsorgekassa Angestellte'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 159, 'AT-BASE','6','GROUP6','6416','0','Veränderung Pensionsrückstellung (Angestellte)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 160, 'AT-BASE','6','GROUP6','6435','0','sonstige Beiträge für die Altersversorgung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 161, 'AT-BASE','6','GROUP6','6500','0','Gesetzlicher Sozialaufwand'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 162, 'AT-BASE','6','GROUP6','6600','0','Gesetzlicher Sozialaufwand Arbeiter'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 163, 'AT-BASE','6','GROUP6','6605','0','Gesetzlicher Sozialaufwand Angestellte'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 164, 'AT-BASE','6','GROUP6','6610','0','Dienstgeberbeitrag Arbeiter'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 165, 'AT-BASE','6','GROUP6','6611','0','Dienstgeberbeitrag Angestellte'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 166, 'AT-BASE','6','GROUP6','6620','0','Zuschlag zum DB'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 167, 'AT-BASE','6','GROUP6','6621','0','Zuschlag zum DB Angestellte'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 168, 'AT-BASE','6','GROUP6','6630','0','Ausgleichstaxe'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 169, 'AT-BASE','6','GROUP6','6690','0','Lohnsteuer'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 170, 'AT-BASE','6','GROUP6','6693','0','Kommunalsteuer Arbeiter'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 171, 'AT-BASE','6','GROUP6','6694','0','Kommunalsteuer Angestellte'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 172, 'AT-BASE','6','GROUP6','6700','0','Freiwilliger Sozialaufwand'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 173, 'AT-BASE','6','GROUP6','6710','0','Arbeitskleidung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 174, 'AT-BASE','6','GROUP6','6720','0','Fahrspesen Dienstnehmer'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 175, 'AT-BASE','6','GROUP6','6730','0','Weihnachtsgeschenke Arbeitnehmer'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 176, 'AT-BASE','6','GROUP6','6740','0','Betriebsveranstaltungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 177, 'AT-BASE','6','GROUP6','6750','0','Konto frei'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 178, 'AT-BASE','6','GROUP6','6760','0','Vergleichszahlung Dienstnehmer'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 179, 'AT-BASE','7','GROUP7','7030','0','Abschreibung G W G'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 180, 'AT-BASE','7','GROUP7','7070','0','Buchwert ausgeschiedener Anlagen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 181, 'AT-BASE','7','GROUP7','7080','0','Planmäßige AFA immat.WG.'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 182, 'AT-BASE','7','GROUP7','7081','0','Planmäßige Abschreibung für Sachanlagen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 183, 'AT-BASE','7','GROUP7','7100','0','Nicht abzugsfähige Vorsteuer (VStK)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 184, 'AT-BASE','7','GROUP7','7110','0','Gebühren und Abgaben_Zoll'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 185, 'AT-BASE','7','GROUP7','7111','0','Kammerumlage'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 186, 'AT-BASE','7','GROUP7','7200','0','Instandhaltung Gebäude'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 187, 'AT-BASE','7','GROUP7','7201','0','Instandhaltung Außenanlagen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 188, 'AT-BASE','7','GROUP7','7202','0','Instandh. - Maschinen u. Anl.'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 189, 'AT-BASE','7','GROUP7','7204','0','Instandhaltung und Betriebskosten Betriebs und Geschäftsgebäude'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 190, 'AT-BASE','7','GROUP7','7205','0','Verbrauchsmaterial Werkstatt'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 191, 'AT-BASE','7','GROUP7','7210','0','Müllentsorgung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 192, 'AT-BASE','7','GROUP7','7211','0','Entsorgungskosten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 193, 'AT-BASE','7','GROUP7','7230','0','Reinigungsmaterial (div. Verbrauchsmaterial)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 194, 'AT-BASE','7','GROUP7','7231','0','Berufsbekleidung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 195, 'AT-BASE','7','GROUP7','7235','0','Reinigung durch Dritte'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 196, 'AT-BASE','7','GROUP7','7240','0','LKW-Betriebskosten Vito G 437 MB'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 197, 'AT-BASE','7','GROUP7','7241','0','Leasing Mercedes Vito G 437 MB'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 198, 'AT-BASE','7','GROUP7','7250','0','KFZ Betriebskosten allgemein'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 199, 'AT-BASE','7','GROUP7','7251','0','KFZ Leasing allgemein'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 200, 'AT-BASE','7','GROUP7','7252','0','KFZ Versicherungen allgemein'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 201, 'AT-BASE','7','GROUP7','7253','0','Wachdienst'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 202, 'AT-BASE','7','GROUP7','7254','0','Konto frei'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 203, 'AT-BASE','7','GROUP7','7255','0','Aufwand Leihwagen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 204, 'AT-BASE','7','GROUP7','7256','0','PKW-Betriebskosten VW Golf G 854 SH Versuchsfahrzeug'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 205, 'AT-BASE','7','GROUP7','7257','0','Leasing VW Golf G 854 SH'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 206, 'AT-BASE','7','GROUP7','7258','0','Konto frei'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 207, 'AT-BASE','7','GROUP7','7285','0','Strom'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 208, 'AT-BASE','7','GROUP7','7286','0','Betriebskosten/Beheizung Mietobjekte'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 209, 'AT-BASE','7','GROUP7','7300','0','Transporte durch Dritte'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 210, 'AT-BASE','7','GROUP7','7330','0','Reise und Fahrtspesen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 211, 'AT-BASE','7','GROUP7','7331','0','Kilometergelder'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 212, 'AT-BASE','7','GROUP7','7360','0','Reisediäten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 213, 'AT-BASE','7','GROUP7','7380','0','Telefon'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 214, 'AT-BASE','7','GROUP7','7381','0','Internet'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 215, 'AT-BASE','7','GROUP7','7382','0','Wartung Homepage'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 216, 'AT-BASE','7','GROUP7','7390','0','Postgebühren'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 217, 'AT-BASE','7','GROUP7','7400','0','Konto frei'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 218, 'AT-BASE','7','GROUP7','7401','0','Konto frei'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 219, 'AT-BASE','7','GROUP7','7402','0','Konto frei'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 220, 'AT-BASE','7','GROUP7','7403','0','Miete Büro Linz'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 221, 'AT-BASE','7','GROUP7','7404','0','Miete Gradnerstraße'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 222, 'AT-BASE','7','GROUP7','7410','0','Maschinen u. Gerätemieten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 223, 'AT-BASE','7','GROUP7','7411','0','Wartungskosten BuG Ausstattung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 224, 'AT-BASE','7','GROUP7','7420','0','Mobilien-Leasing '); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 225, 'AT-BASE','7','GROUP7','7421','0','Konto frei'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 226, 'AT-BASE','7','GROUP7','7422','0','Leasing Server'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 227, 'AT-BASE','7','GROUP7','7423','0','Konto frei'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 228, 'AT-BASE','7','GROUP7','7424','0','Konto frei'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 229, 'AT-BASE','7','GROUP7','7480','0','Lizenzgebühren'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 230, 'AT-BASE','7','GROUP7','7540','0','Provisionen an Dritte'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 231, 'AT-BASE','7','GROUP7','7600','0','Büromaterial'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 232, 'AT-BASE','7','GROUP7','7601','0','EDV-Material'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 233, 'AT-BASE','7','GROUP7','7610','0','Drucksorten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 234, 'AT-BASE','7','GROUP7','7620','0','Fachliteratur und Zeitungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 235, 'AT-BASE','7','GROUP7','7630','0','Gästeunt. u. Zeitschriften'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 236, 'AT-BASE','7','GROUP7','7650','0','Werbeaufwand/Inserate'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 237, 'AT-BASE','7','GROUP7','7651','0','Anbahnung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 238, 'AT-BASE','7','GROUP7','7652','0','Aufwand Messen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 239, 'AT-BASE','7','GROUP7','7653','0','Konto frei'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 240, 'AT-BASE','7','GROUP7','7654','0','Inserate'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 241, 'AT-BASE','7','GROUP7','7670','0','Bewirtungskosten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 242, 'AT-BASE','7','GROUP7','7690','0','Trinkgelder u. Spenden'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 243, 'AT-BASE','7','GROUP7','7691','0','Spenden an begünstigte Institutionen/Sponsoring'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 244, 'AT-BASE','7','GROUP7','7696','0','Säumnis- und Verspätungszuschläge'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 245, 'AT-BASE','7','GROUP7','7700','0','Betriebsversicherungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 246, 'AT-BASE','7','GROUP7','7701','0','Transportversicherungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 247, 'AT-BASE','7','GROUP7','7710','0','Pflichtversich. Unternehmer'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 248, 'AT-BASE','7','GROUP7','7749','0','Aufwand Japan'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 249, 'AT-BASE','7','GROUP7','7750','0','Steuerberatung (Lohnverrechnung, Buchhaltung)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 250, 'AT-BASE','7','GROUP7','7751','0','Patentkosten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 251, 'AT-BASE','7','GROUP7','7752','0','Rechtsberatung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 252, 'AT-BASE','7','GROUP7','7753','0','Unternehmensberatung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 253, 'AT-BASE','7','GROUP7','7754','0','Aufwand tectos China'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 254, 'AT-BASE','7','GROUP7','7755','0','Wartung (Betreuung EDV)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 255, 'AT-BASE','7','GROUP7','7756','0','Lizenzgebühren Abaqus'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 256, 'AT-BASE','7','GROUP7','7757','0','Lizenzgebühren Sonstige'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 257, 'AT-BASE','7','GROUP7','7758','0','Sonstige Beratungskosten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 258, 'AT-BASE','7','GROUP7','7759','0','EDV-Beratung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 259, 'AT-BASE','7','GROUP7','7760','0','Mitgliedsbeiträge/freiwillige Beiträge'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 260, 'AT-BASE','7','GROUP7','7761','0','Prüfung Jahresabschluss'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 261, 'AT-BASE','7','GROUP7','7770','0','Aus- und Fortbildung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 262, 'AT-BASE','7','GROUP7','7775','0','Forschung und Entwicklung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 263, 'AT-BASE','7','GROUP7','7776','0','Messentwicklung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 264, 'AT-BASE','7','GROUP7','7777','0','Produktentwicklung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 265, 'AT-BASE','7','GROUP7','7785','0','Freiwillige Verbandsbeiträge'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 266, 'AT-BASE','7','GROUP7','7790','0','Spesen des Geldverkehrs'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 267, 'AT-BASE','7','GROUP7','7791','0','Kursdifferenzen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 268, 'AT-BASE','7','GROUP7','7800','0','Betriebsbedingte Schadensfälle'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 269, 'AT-BASE','7','GROUP7','7801','0','Ausgaben nicht absetzbar'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 270, 'AT-BASE','7','GROUP7','7802','0','Strafen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 271, 'AT-BASE','7','GROUP7','7805','0','Forderungsverluste 20'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 272, 'AT-BASE','7','GROUP7','7806','0','Abschreibungen auf Forderungen (EU)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 273, 'AT-BASE','7','GROUP7','7807','0','Abschreibungen auf Forderungen (Drittland)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 274, 'AT-BASE','7','GROUP7','7810','0','Zuweisung an Einzel-WB Forderungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 275, 'AT-BASE','7','GROUP7','7811','0','Zuweisung pauschale Wertberichtigungen zu Exportforderungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 276, 'AT-BASE','7','GROUP7','7812','0','Abschreibungen auf Vorräte'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 277, 'AT-BASE','7','GROUP7','7820','0','Buchwert abgegangener Sachanlagen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 278, 'AT-BASE','7','GROUP7','7840','0','Gründungskosten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 279, 'AT-BASE','7','GROUP7','7850','0','Sonstiger Aufwand'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 280, 'AT-BASE','7','GROUP7','7851','0','Sonstiger Aufwand Gewinnanteil Reich'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 281, 'AT-BASE','7','GROUP7','7930','0','Aufw. Gewährleistungsverpfl.'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 282, 'AT-BASE','7','GROUP7','7940','0','Aufwand aus Vorperioden'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 283, 'AT-BASE','8','GROUP8','8020','0','Gewinnüberrg. v. Organgesell.'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 284, 'AT-BASE','8','GROUP8','8060','0','Zinserträge'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 285, 'AT-BASE','8','GROUP8','8090','0','Ertr.a.Ant.a.and. Unternehmen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 286, 'AT-BASE','8','GROUP8','8100','0','Habenzinsen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 287, 'AT-BASE','8','GROUP8','8280','0','Zinsen f. Kredite u. Darlehen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 288, 'AT-BASE','8','GROUP8','8286','0','Kursgewinne/Kursverluste'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 289, 'AT-BASE','8','GROUP8','8288','0','Zinsen auf Lieferantenkredite'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 290, 'AT-BASE','8','GROUP8','8291','0','Sonst. Zinsen und ähnliche Aufwendungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 291, 'AT-BASE','8','GROUP8','8500','0','Körperschaftsteuer'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 292, 'AT-BASE','8','GROUP8','8505','0','Kapitalertragsteuer'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 293, 'AT-BASE','8','GROUP8','8510','0','Körperschaftsteuervorauszahl.'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 294, 'AT-BASE','8','GROUP8','8511','0','Dotierung KöSt-Rückstellung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 295, 'AT-BASE','8','GROUP8','8512','0','Aktivierung Körperschaftsteuer'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 296, 'AT-BASE','8','GROUP8','8513','0','Köst Vorperioden'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 297, 'AT-BASE','8','GROUP8','8520','0','Forschungsprämie'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 298, 'AT-BASE','8','GROUP8','8595','0','Ertrag aus der Aktivierung latenter Steuern'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 299, 'AT-BASE','8','GROUP8','8610','0','Auflösung sonstiger unversteuerter Rücklagen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 300, 'AT-BASE','8','GROUP8','8700','0','Auflösung gebundener Kapitalrücklage'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 301, 'AT-BASE','8','GROUP8','8710','0','Auflösung Rücklage für eigene Anteile'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 302, 'AT-BASE','8','GROUP8','8720','0','Auflösung nicht gebundene Kapitalrücklage'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 303, 'AT-BASE','8','GROUP8','8750','0','Auflösung gesetzliche Rücklage'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 304, 'AT-BASE','8','GROUP8','8760','0','Auflösung satzungsmäßige Rücklage'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 305, 'AT-BASE','8','GROUP8','8770','0','Auflösung andere (freie) Rücklage'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 306, 'AT-BASE','8','GROUP8','8810','0','Zuweisung sonstige unversteuerte Rücklagen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 307, 'AT-BASE','8','GROUP8','8820','0','Zuweisung Inv. Rücklage'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 308, 'AT-BASE','8','GROUP8','8890','0','Zuw.Bew.Res.GWG'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 309, 'AT-BASE','8','GROUP8','8900','0','Zuweisung gesetzliche Rücklagen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 310, 'AT-BASE','8','GROUP8','8910','0','Zuweisung satzungsmäßige Rücklagen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 311, 'AT-BASE','8','GROUP8','8920','0','Zuweisung andere (freie) Rücklagen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 312, 'AT-BASE','9','GROUP9','9390','0','Bilanzgewinn'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 313, 'AT-BASE','9','GROUP9','9391','0','Bilanzverlust'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 314, 'AT-BASE','9','GROUP9','9700','0','Wachdienst'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 315, 'AT-BASE','9','GROUP9','9991','0','Gewinnvortrag'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 316, 'AT-BASE','9','GROUP9','9993','0','Verlustvortrag'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 317, 'AT-BASE','9','GROUP9','9994','0','Verlustvortrag'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 318, 'AT-BASE','5','GROUP5','50200','0','Materialeinkauf'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 319, 'AT-BASE','6','GROUP6','60000','0','kalk. Löhne u Gehälter'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 320, 'AT-BASE','6','GROUP6','64160','0','Veränderung Pensionsrückstellung (Angestellte)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label) VALUES (__ENTITY__, 321, 'AT-BASE','6','GROUP6','66300','0','Leistungserfassung'); diff --git a/htdocs/install/mysql/data/llx_accounting_account_fr.sql b/htdocs/install/mysql/data/llx_accounting_account_fr.sql index 8f64f5d108b..d0bdb3cdae4 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_fr.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_fr.sql @@ -24,6 +24,8 @@ -- -- Ne pas placer de commentaire en fin de ligne, ce fichier est parsé lors -- de l''install et tous les sigles '--' sont supprimés. +-- Not: To replace a string thas is '__, 0' inot a increasing num, you can use vi with comment +-- :let @a=1 | %s/__, 0/\='__, '.(@a+setreg('a',@a+1))/g -- -- ID 0 - 438 diff --git a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql index bce7725871a..d13e4a19d00 100644 --- a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql +++ b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql @@ -139,6 +139,8 @@ UPDATE llx_c_country SET eec = 1 WHERE code IN ('AT','BE','BG','CY','CZ','DE','D INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 1, 'PCG18-ASSOC', 'French foundation chart of accounts 2018', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 41, 'AT-BASE', 'Plan Austria', 1); + create table llx_c_ticket_resolution From aed3ea25cb23651c231aebdfb3b7d5be14b84033 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 8 Feb 2020 17:14:04 +0100 Subject: [PATCH 160/306] Code comment --- htdocs/core/lib/functionsnumtoword.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functionsnumtoword.lib.php b/htdocs/core/lib/functionsnumtoword.lib.php index 94479fe2c28..26a4874678c 100644 --- a/htdocs/core/lib/functionsnumtoword.lib.php +++ b/htdocs/core/lib/functionsnumtoword.lib.php @@ -25,7 +25,7 @@ /** * Function to return number in text. - * + * May use module NUMBERWORDS if found. * * @param float $num Number to convert * @param Translate $langs Language From 1ee959a11f134e138b8ec29b5e121e8344a9e420 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 8 Feb 2020 17:46:41 +0100 Subject: [PATCH 161/306] Generic graph --- htdocs/core/customreports.php | 18 +++++++++++++----- htdocs/langs/en_US/other.lang | 2 ++ 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/htdocs/core/customreports.php b/htdocs/core/customreports.php index 80d88f72203..31db8fe5447 100644 --- a/htdocs/core/customreports.php +++ b/htdocs/core/customreports.php @@ -17,7 +17,7 @@ /** * \file htdocs/core/customreports.php - * \ingroup sellyoursaas + * \ingroup core * \brief Page to make custom reports */ @@ -72,6 +72,7 @@ $picto = ''; $head = array(); $object = null; $ObjectClassName = ''; +// Objects available by default $arrayoftype = array( 'thirdparty' => array('label' => 'ThirdParties', 'ObjectClassName' => 'Societe', 'enabled' => $conf->societe->enabled, 'ClassPath' => DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"), 'contact' => array('label' => 'Contacts', 'ObjectClassName' => 'Contact', 'enabled' => $conf->societe->enabled, 'ClassPath' => DOL_DOCUMENT_ROOT."/contact/class/contact.class.php"), @@ -158,8 +159,15 @@ $form=new Form($db); llxHeader('', $langs->transnoentitiesnoconv('CustomReports'), ''); -//print_fiche_titre($langs->trans("DoliCloudArea")); - +// Check parameters +if ($mode == 'graph' && $search_graph == 'bars' && count($search_measures) > 3) { + setEventMessages($langs->trans("GraphInBarsAreLimitedTo3Measures"), null, 'warnings'); + $search_graph = 'lines'; +} +if ($mode == 'graph' && count($search_xaxis) > 1) { + setEventMessages($langs->trans("OnlyOneFieldForXAxisIsPossible"), null, 'warnings'); + $search_xaxis = array(0 => $search_xaxis[0]); +} //$head = commande_prepare_head(null); @@ -307,9 +315,9 @@ if ($mode == 'grid') { if ($mode == 'graph') { print '
'; - $arrayofgraphs = array('bars', 'line'); // also 'pies' + $arrayofgraphs = array('bars' => 'Bars', 'lines' => 'Lines'); // also 'pies' print '
'.$langs->trans("Graph").'
'; - print $form->selectarray('search_graph', $arrayofgraphs, $search_graph, 0, 0, 'minwidth100', 1); + print $form->selectarray('search_graph', $arrayofgraphs, $search_graph, 0, 0, 0, 'minwidth100', 1); print '
'; } print '
'; diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang index 46424590f31..8530c9fbede 100644 --- a/htdocs/langs/en_US/other.lang +++ b/htdocs/langs/en_US/other.lang @@ -30,6 +30,8 @@ PreviousYearOfInvoice=Previous year of invoice date NextYearOfInvoice=Following year of invoice date DateNextInvoiceBeforeGen=Date of next invoice (before generation) DateNextInvoiceAfterGen=Date of next invoice (after generation) +GraphInBarsAreLimitedTo3Measures=Grapics are limited to 3 measures in 'Bars' mode. The mode 'Lines' was automatically selected instead. +OnlyOneFieldForXAxisIsPossible=Only 1 field is currently possible as X-Axis. Only the first selected field has been selected. Notify_ORDER_VALIDATE=Sales order validated Notify_ORDER_SENTBYMAIL=Sales order sent by mail From 0a912f4e8ab63fbb06625a859d6e1a9f5ca25d28 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 8 Feb 2020 18:18:22 +0100 Subject: [PATCH 162/306] Fix missing class --- htdocs/projet/element.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index dd89b3ca9c4..10137156233 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -54,6 +54,7 @@ if (! empty($conf->stock->enabled)) require_once DOL_DOCUMENT_ROOT.'/product/s if (! empty($conf->tax->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; if (! empty($conf->banque->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/paymentvarious.class.php'; if (! empty($conf->salaries->enabled)) require_once DOL_DOCUMENT_ROOT.'/salaries/class/paymentsalary.class.php'; +if (! empty($conf->categorie->enabled)) require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; // Load translation files required by the page $langs->loadLangs(array('projects', 'companies', 'suppliers', 'compta')); From c2830f9e7941321d4277a87990e4d610a58eae0d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 8 Feb 2020 18:18:41 +0100 Subject: [PATCH 163/306] FIX Look and feel v11 --- htdocs/fichinter/card.php | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index c096a889ab4..5e360739ea4 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -818,10 +818,7 @@ llxHeader('', $langs->trans("Intervention")); if ($action == 'create') { - /* - * Mode creation - * Creation d'une nouvelle fiche d'intervention - */ + // Create new intervention $soc = new Societe($db); @@ -831,11 +828,12 @@ if ($action == 'create') if ($socid) $res = $soc->fetch($socid); - if (GETPOST('origin') && GETPOST('originid')) + if (GETPOST('origin', 'alphanohtml') && GETPOST('originid', 'int')) { // Parse element/subelement (ex: project_task) - $element = $subelement = GETPOST('origin'); - if (preg_match('/^([^_]+)_([^_]+)/i', GETPOST('origin'), $regs)) + $regs = array(); + $element = $subelement = GETPOST('origin', 'alphanohtml'); + if (preg_match('/^([^_]+)_([^_]+)/i', GETPOST('origin', 'alphanohtml'), $regs)) { $element = $regs[1]; $subelement = $regs[2]; @@ -843,7 +841,7 @@ if ($action == 'create') if ($element == 'project') { - $projectid = GETPOST('originid'); + $projectid = GETPOST('originid', 'int'); } else { @@ -941,7 +939,7 @@ if ($action == 'create') $numprojet = $formproject->select_projects($soc->id, $projectid, 'projectid'); if ($numprojet == 0) { - print '   '.$langs->trans("AddProject").''; + print '   '; } print '
'; From 18d332994fad0893b625632b3505045bdfeb38d1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 9 Feb 2020 15:51:43 +0100 Subject: [PATCH 167/306] FIX Mail smtps truncated if content has a line with single . --- htdocs/core/class/CMailFile.class.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index dc2b00c586c..aa1aed52822 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -204,7 +204,7 @@ class CMailFile if (empty($msg)) { dol_syslog("CMailFile::CMailfile: Try to send an email with empty body"); - $msg = '.'; // Avoid empty message (with empty message conten show a multipart structure) + $msg = '.'; // Avoid empty message (with empty message content, you will see a multipart structure) } // Detect if message is HTML (use fast method) @@ -226,7 +226,7 @@ class CMailFile //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current // Replace relative /viewimage to absolute path - $msg = preg_replace('/src="'.preg_quote(DOL_URL_ROOT, '/').'\/viewimage\.php/ims', 'src="'.$urlwithroot.'/viewimage.php', $msg, -1, $nbrep); + $msg = preg_replace('/src="'.preg_quote(DOL_URL_ROOT, '/').'\/viewimage\.php/ims', 'src="'.$urlwithroot.'/viewimage.php', $msg, -1); if (!empty($conf->global->MAIN_MAIL_FORCE_CONTENT_TYPE_TO_HTML)) $this->msgishtml = 1; // To force to send everything with content type html. @@ -354,6 +354,9 @@ class CMailFile $msg = $this->checkIfHTML($msg); } + // Replace . alone on a new line with .. to avoid to have SMTP interpret this as end of message + $msg = preg_replace('/(\r|\n)\.(\r|\n)/ims', '\1..\2', $msg); + if ($this->msgishtml) $smtps->setBodyContent($msg, 'html'); else $smtps->setBodyContent($msg, 'plain'); From 5c000159c1ffb8cf1452840ad99aefef63046061 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 9 Feb 2020 15:51:43 +0100 Subject: [PATCH 168/306] FIX Mail smtps truncated if content has a line with single . --- htdocs/core/class/CMailFile.class.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 2318cb90e19..f794c76bcac 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -205,7 +205,7 @@ class CMailFile if (empty($msg)) { dol_syslog("CMailFile::CMailfile: Try to send an email with empty body"); - $msg = '.'; // Avoid empty message (with empty message conten show a multipart structure) + $msg = '.'; // Avoid empty message (with empty message content, you will see a multipart structure) } // Detect if message is HTML (use fast method) @@ -227,7 +227,7 @@ class CMailFile //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current // Replace relative /viewimage to absolute path - $msg = preg_replace('/src="'.preg_quote(DOL_URL_ROOT, '/').'\/viewimage\.php/ims', 'src="'.$urlwithroot.'/viewimage.php', $msg, -1, $nbrep); + $msg = preg_replace('/src="'.preg_quote(DOL_URL_ROOT, '/').'\/viewimage\.php/ims', 'src="'.$urlwithroot.'/viewimage.php', $msg, -1); if (!empty($conf->global->MAIN_MAIL_FORCE_CONTENT_TYPE_TO_HTML)) $this->msgishtml = 1; // To force to send everything with content type html. @@ -349,6 +349,9 @@ class CMailFile $msg = $this->checkIfHTML($msg); } + // Replace . alone on a new line with .. to avoid to have SMTP interpret this as end of message + $msg = preg_replace('/(\r|\n)\.(\r|\n)/ims', '\1..\2', $msg); + if ($this->msgishtml) $smtps->setBodyContent($msg, 'html'); else $smtps->setBodyContent($msg, 'plain'); From 6badf724cf3dbfbccd3ace3523f1d75e110cfd9b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 9 Feb 2020 15:51:43 +0100 Subject: [PATCH 169/306] FIX Mail smtps truncated if content has a line with single . Conflicts: htdocs/core/class/CMailFile.class.php --- htdocs/core/class/CMailFile.class.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 809cf15edbf..853f2f98b05 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -176,7 +176,7 @@ class CMailFile if (empty($msg)) { dol_syslog("CMailFile::CMailfile: Try to send an email with empty body"); - $msg='.'; // Avoid empty message (with empty message conten show a multipart structure) + $msg = '.'; // Avoid empty message (with empty message content, you will see a multipart structure) } // Detect if message is HTML (use fast method) @@ -198,7 +198,7 @@ class CMailFile //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current // Replace relative /viewimage to absolute path - $msg = preg_replace('/src="'.preg_quote(DOL_URL_ROOT, '/').'\/viewimage\.php/ims', 'src="'.$urlwithroot.'/viewimage.php', $msg, -1, $nbrep); + $msg = preg_replace('/src="'.preg_quote(DOL_URL_ROOT, '/').'\/viewimage\.php/ims', 'src="'.$urlwithroot.'/viewimage.php', $msg, -1); if (! empty($conf->global->MAIN_MAIL_FORCE_CONTENT_TYPE_TO_HTML)) $this->msgishtml=1; // To force to send everything with content type html. @@ -330,6 +330,9 @@ class CMailFile $msg = $this->checkIfHTML($msg); } + // Replace . alone on a new line with .. to avoid to have SMTP interpret this as end of message + $msg = preg_replace('/(\r|\n)\.(\r|\n)/ims', '\1..\2', $msg); + if ($this->msgishtml) $smtps->setBodyContent($msg, 'html'); else $smtps->setBodyContent($msg, 'plain'); From c7736dde41826ac6eca3e838e57eab2f0304e256 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 9 Feb 2020 18:28:34 +0100 Subject: [PATCH 170/306] =?UTF-8?q?FIX=20CVE-2019=E2=80=9317223?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/comm/action/card.php | 2 +- htdocs/core/class/commonobject.class.php | 2 +- htdocs/core/class/html.form.class.php | 8 +++++-- htdocs/core/lib/functions.lib.php | 30 +++++++++++++++++------- htdocs/core/tpl/notes.tpl.php | 11 +++++---- htdocs/theme/eldy/global.inc.php | 4 ++++ htdocs/theme/md/style.css.php | 4 ++++ htdocs/user/group/card.php | 4 +++- htdocs/user/group/ldap.php | 4 +++- htdocs/user/group/perms.php | 4 +++- htdocs/user/note.php | 6 ++--- 11 files changed, 55 insertions(+), 24 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 118ab6ededf..5527a7dd7f3 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1789,7 +1789,7 @@ if ($id > 0) // Description print '
'.$langs->trans("Description").''; - print dol_htmlentitiesbr($object->note); + print dol_string_onlythesehtmltags(dol_htmlentitiesbr($object->note_private)); print '
'.$langs->trans("Description").''.dol_htmlentitiesbr($object->note).' '; + print dol_string_onlythesehtmltags(dol_htmlentitiesbr($object->note)); + print '
'.$langs->trans("Description").''.dol_htmlentitiesbr($object->note).''; +print dol_string_onlythesehtmltags(dol_htmlentitiesbr($object->note)); +print '
'.$langs->trans("Description").''.dol_htmlentitiesbr($object->note).''; + print dol_string_onlythesehtmltags(dol_htmlentitiesbr($object->note)); + print '

'; diff --git a/htdocs/user/note.php b/htdocs/user/note.php index cdf6f65b9a1..dc2f11b96fa 100644 --- a/htdocs/user/note.php +++ b/htdocs/user/note.php @@ -111,19 +111,19 @@ if ($id) // Note print ''.$langs->trans("Note").''; - print ''; + print ''; if ($action == 'edit' && $user->rights->user->user->creer) { print ""; print "id."\">"; // Editeur wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor('note_private', $object->note, '', 280, 'dolibarr_notes', 'In', true, false, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_8, '90%'); + $doleditor=new DolEditor('note_private', $object->note_private, '', 280, 'dolibarr_notes', 'In', true, false, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_8, '90%'); $doleditor->Create(); } else { - print dol_htmlentitiesbr($object->note); + print dol_string_onlythesehtmltags(dol_htmlentitiesbr($object->note_private)); } print ""; From 8645fd8946eab2d2edb39ba7a3cf59282fa8b994 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 9 Feb 2020 18:28:34 +0100 Subject: [PATCH 171/306] =?UTF-8?q?FIX=20CVE-2019=E2=80=9317223=20FIX=20#1?= =?UTF-8?q?3053?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/comm/action/card.php | 2 +- htdocs/core/class/commonobject.class.php | 2 +- htdocs/core/class/html.form.class.php | 8 +++++-- htdocs/core/lib/functions.lib.php | 30 +++++++++++++++++------- htdocs/core/tpl/notes.tpl.php | 11 +++++---- htdocs/theme/eldy/global.inc.php | 4 ++++ htdocs/theme/md/style.css.php | 4 ++++ htdocs/user/group/card.php | 4 +++- htdocs/user/group/ldap.php | 4 +++- htdocs/user/group/perms.php | 4 +++- htdocs/user/note.php | 6 ++--- 11 files changed, 55 insertions(+), 24 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 118ab6ededf..5527a7dd7f3 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1789,7 +1789,7 @@ if ($id > 0) // Description print ''.$langs->trans("Description").''; - print dol_htmlentitiesbr($object->note); + print dol_string_onlythesehtmltags(dol_htmlentitiesbr($object->note_private)); print ''; // Other attributes diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 750fbc59135..2289d280139 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -337,7 +337,7 @@ abstract class CommonObject /** * @deprecated - * @see $note_public + * @see $note_private */ public $note; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index cba66729d8c..7188be03507 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -298,9 +298,13 @@ class Form $firstline = preg_replace('/[\n\r].*/', '', $firstline); $tmpcontent = $firstline.((strlen($firstline) != strlen($tmpcontent)) ? '...' : ''); } - $ret .= $tmpcontent; + // We dont use dol_escape_htmltag to get the html formating active, but this need we must also + // clean data from some dangerous html + $ret .= dol_string_onlythesehtmltags(dol_htmlentitiesbr($tmpcontent)); + } + else { + $ret .= dol_escape_htmltag($value); } - else $ret .= dol_escape_htmltag($value); if ($formatfunc && method_exists($object, $formatfunc)) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index b05cc41ea5d..681fc28f92a 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5559,22 +5559,27 @@ function dol_string_nohtmltag($stringtoclean, $removelinefeed = 1, $pagecodeto = /** * Clean a string to keep only desirable HTML tags. * - * @param string $stringtoclean String to clean - * @return string String cleaned + * @param string $stringtoclean String to clean + * @param string $cleanalsosomestyles Clean also some tags + * @return string String cleaned * * @see dol_escape_htmltag() strip_tags() dol_string_nohtmltag() dol_string_neverthesehtmltags() */ -function dol_string_onlythesehtmltags($stringtoclean) +function dol_string_onlythesehtmltags($stringtoclean, $cleanalsosomestyles = 1) { $allowed_tags = array( - "html", "head", "meta", "body", "article", "a", "b", "br", "div", "em", "font", "img", "ins", "hr", "i", "li", "link", + "html", "head", "meta", "body", "article", "a", "b", "br", "div", "dl", "dd", "dt", "em", "font", "img", "ins", "hr", "i", "li", "link", "ol", "p", "s", "section", "span", "strong", "title", "table", "tr", "th", "td", "u", "ul" ); - $allowed_tags_string = join("><", $allowed_tags); $allowed_tags_string = preg_replace('/^>/', '', $allowed_tags_string); $allowed_tags_string = preg_replace('/<$/', '', $allowed_tags_string); + $allowed_tags_string = '<'.$allowed_tags_string.'>'; + + if ($cleanalsosomestyles) { + $stringtoclean = preg_replace('/position\s*:\s*(absolute|fixed)\s*!\s*important/', '', $stringtoclean); // Note: If hacker try to introduce css comment into string to avoid this, string should be encoded by the dol_htmlentitiesbr so be harmless + } $temp = strip_tags($stringtoclean, $allowed_tags_string); @@ -5583,14 +5588,16 @@ function dol_string_onlythesehtmltags($stringtoclean) /** * Clean a string from some undesirable HTML tags. + * Note. Not enough secured as dol_string_onlythesehtmltags(). * - * @param string $stringtoclean String to clean - * @param array $disallowed_tags Array of tags not allowed - * @return string String cleaned + * @param string $stringtoclean String to clean + * @param array $disallowed_tags Array of tags not allowed + * @param string $cleanalsosomestyles Clean also some tags + * @return string String cleaned * * @see dol_escape_htmltag() strip_tags() dol_string_nohtmltag() dol_string_onlythesehtmltags() */ -function dol_string_neverthesehtmltags($stringtoclean, $disallowed_tags = array('textarea')) +function dol_string_neverthesehtmltags($stringtoclean, $disallowed_tags = array('textarea'), $cleanalsosomestyles = 0) { $temp = $stringtoclean; foreach ($disallowed_tags as $tagtoremove) @@ -5598,6 +5605,11 @@ function dol_string_neverthesehtmltags($stringtoclean, $disallowed_tags = array( $temp = preg_replace('/<\/?'.$tagtoremove.'>/', '', $temp); $temp = preg_replace('/<\/?'.$tagtoremove.'\s+[^>]*>/', '', $temp); } + + if ($cleanalsosomestyles) { + $temp = preg_replace('/position\s*:\s*(absolute|fixed)\s*!\s*important/', '', $temp); // Note: If hacker try to introduce css comment into string to avoid this, string should be encoded by the dol_htmlentitiesbr so be harmless + } + return $temp; } diff --git a/htdocs/core/tpl/notes.tpl.php b/htdocs/core/tpl/notes.tpl.php index 7663af1c48e..e19d28ce793 100644 --- a/htdocs/core/tpl/notes.tpl.php +++ b/htdocs/core/tpl/notes.tpl.php @@ -1,7 +1,7 @@ * Copyright (C) 2013 Florian Henry - * Copyright (C) 2014-2017 Laurent Destailleur + * Copyright (C) 2014-2020 Laurent Destailleur * * 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 @@ -78,20 +78,21 @@ print '
'."\n if ($module != 'product') { // No public note yet on products print '
'."\n"; - print '
'."\n"; + print '
'."\n"; print $form->editfieldkey("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, $moreparam, '', 0); print '
'."\n"; - print '
'."\n"; + print '
'."\n"; print $form->editfieldval("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, '', null, null, $moreparam, 1)."\n"; print '
'."\n"; print '
'."\n"; } if (empty($user->socid)) { + // Private notes (always hidden to external users) print '
'."\n"; - print '
'."\n"; + print '
'."\n"; print $form->editfieldkey("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, $moreparam, '', 0); print '
'."\n"; - print '
'."\n"; + print '
'."\n"; print $form->editfieldval("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, '', null, null, $moreparam, 1); print '
'."\n"; print '
'."\n"; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index c6386ba7ea2..670734e6706 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -23,6 +23,10 @@ body { trans("DIRECTION").";\n"; ?> } +.sensiblehtmlcontent * { + position: static !important; +} + .thumbstat { font-weight: bold !important; } th a { font-weight: !important; } a.tab { font-weight: 500 !important; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 2f76ee382e9..0293513109d 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -247,6 +247,10 @@ body { trans("DIRECTION").";\n"; ?> } +.sensiblehtmlcontent * { + position: static !important; +} + .thumbstat { font-weight: bold !important; } th a { font-weight: !important; } a.tab { font-weight: 500 !important; } diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php index cd8607a764b..19c52b6fa7f 100644 --- a/htdocs/user/group/card.php +++ b/htdocs/user/group/card.php @@ -386,7 +386,9 @@ else // Note print ''.$langs->trans("Description").''; - print ''.dol_htmlentitiesbr($object->note).' '; + print ''; + print dol_string_onlythesehtmltags(dol_htmlentitiesbr($object->note)); + print ''; print "\n"; // Other attributes diff --git a/htdocs/user/group/ldap.php b/htdocs/user/group/ldap.php index 448f38aea50..eca923f68be 100644 --- a/htdocs/user/group/ldap.php +++ b/htdocs/user/group/ldap.php @@ -126,7 +126,9 @@ if (! empty($conf->mutlicompany->enabled)) // Note print ''.$langs->trans("Description").''; -print ''.dol_htmlentitiesbr($object->note).''; +print ''; +print dol_string_onlythesehtmltags(dol_htmlentitiesbr($object->note)); +print ''; print "\n"; // LDAP DN diff --git a/htdocs/user/group/perms.php b/htdocs/user/group/perms.php index 39dc2e61f9f..576cbebff8d 100644 --- a/htdocs/user/group/perms.php +++ b/htdocs/user/group/perms.php @@ -212,7 +212,9 @@ if ($object->id > 0) // Note print ''.$langs->trans("Description").''; - print ''.dol_htmlentitiesbr($object->note).''; + print ''; + print dol_string_onlythesehtmltags(dol_htmlentitiesbr($object->note)); + print ''; print "\n"; print '
'; diff --git a/htdocs/user/note.php b/htdocs/user/note.php index cdf6f65b9a1..dc2f11b96fa 100644 --- a/htdocs/user/note.php +++ b/htdocs/user/note.php @@ -111,19 +111,19 @@ if ($id) // Note print ''.$langs->trans("Note").''; - print ''; + print ''; if ($action == 'edit' && $user->rights->user->user->creer) { print ""; print "id."\">"; // Editeur wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor('note_private', $object->note, '', 280, 'dolibarr_notes', 'In', true, false, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_8, '90%'); + $doleditor=new DolEditor('note_private', $object->note_private, '', 280, 'dolibarr_notes', 'In', true, false, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_8, '90%'); $doleditor->Create(); } else { - print dol_htmlentitiesbr($object->note); + print dol_string_onlythesehtmltags(dol_htmlentitiesbr($object->note_private)); } print ""; From 94d6fa06dc75e5f63bc20d33212a5ffed27d85e9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 9 Feb 2020 18:34:53 +0100 Subject: [PATCH 172/306] FIX #13022 --- htdocs/admin/supplier_order.php | 2 ++ htdocs/core/actions_setmoduleoptions.inc.php | 1 + 2 files changed, 3 insertions(+) diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index 55c14a22e4d..c714e469929 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -54,6 +54,8 @@ $specimenthirdparty->initAsSpecimen(); * Actions */ +include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; + if ($action == 'updateMask') { $maskconstorder = GETPOST('maskconstorder', 'alpha'); diff --git a/htdocs/core/actions_setmoduleoptions.inc.php b/htdocs/core/actions_setmoduleoptions.inc.php index e0232ee5c87..ce4a5af49d5 100644 --- a/htdocs/core/actions_setmoduleoptions.inc.php +++ b/htdocs/core/actions_setmoduleoptions.inc.php @@ -64,6 +64,7 @@ if ($action == 'setModuleOptions') { foreach($_POST as $key => $val) { + $reg = array(); if (preg_match('/^param(\d*)$/', $key, $reg)) // Works for POST['param'], POST['param1'], POST['param2'], ... { $param=GETPOST("param".$reg[1], 'alpha'); From d49943ab37fcad2930660c8fc17a0b2d1a88fd02 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 9 Feb 2020 18:38:27 +0100 Subject: [PATCH 173/306] FIX #13019 --- htdocs/core/class/utils.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index 2ac64565e9c..bd0dec24495 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -388,7 +388,9 @@ class Utils if ($compression == 'none') fclose($handle); if ($compression == 'gz') gzclose($handle); if ($compression == 'bz') bzclose($handle); - if ($ok && preg_match('/^-- MySql/i', $errormsg)) $errormsg = ''; // Pas erreur + if ($ok && preg_match('/^-- (MySql|MariaDB)/i', $errormsg)) { // No error + $errormsg = ''; + } else { // Renommer fichier sortie en fichier erreur From 07fbaa02d144090c71a5f9f956e39770e1af23a5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 9 Feb 2020 19:36:12 +0100 Subject: [PATCH 174/306] FIX #13050 --- htdocs/main.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 4e1745413ce..01a999c6a8b 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -553,7 +553,7 @@ if (!defined('NOLOGIN')) // Validation of login/pass/entity // If ok, the variable login will be returned // If error, we will put error message in session under the name dol_loginmesg - if ($test && $goontestloop && GETPOST('actionlogin', 'aZ09') == 'login') + if ($test && $goontestloop && (GETPOST('actionlogin', 'aZ09') == 'login' || $dolibarr_main_authentication != 'dolibarr')) { $login = checkLoginPassEntity($usertotest, $passwordtotest, $entitytotest, $authmode); if ($login) From f70dd8ec06ff2c9f3c5b64d2a844849ba962f1f0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 Feb 2020 00:22:53 +0100 Subject: [PATCH 175/306] Clean code. Load thirdparty for correct lang before generating doc --- htdocs/comm/propal/class/propal.class.php | 16 +++++++++------- htdocs/commande/class/commande.class.php | 14 ++++++++------ htdocs/compta/facture/class/facture.class.php | 16 +++++++++------- htdocs/compta/paiement/class/paiement.class.php | 14 ++++++++++---- 4 files changed, 36 insertions(+), 24 deletions(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 33e33301cfd..c6d1af1287e 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -1365,7 +1365,7 @@ class Propal extends CommonObject } /** - * Load a proposal from database and its ligne array + * Load a proposal from database. Get also lines. * * @param int $rowid id of object to load * @param string $ref Ref of proposal @@ -1373,7 +1373,6 @@ class Propal extends CommonObject */ public function fetch($rowid, $ref = '') { - $sql = "SELECT p.rowid, p.ref, p.entity, p.remise, p.remise_percent, p.remise_absolue, p.fk_soc"; $sql .= ", p.total, p.tva, p.localtax1, p.localtax2, p.total_ht"; $sql .= ", p.datec"; @@ -1437,8 +1436,13 @@ class Propal extends CommonObject $this->total_localtax1 = $obj->localtax1; $this->total_localtax2 = $obj->localtax2; $this->total_ttc = $obj->total; - $this->socid = $obj->fk_soc; - $this->fk_project = $obj->fk_project; + + $this->socid = $obj->fk_soc; + $this->thirdparty = null; // Clear if another value was already set by fetch_thirdparty + + $this->fk_project = $obj->fk_project; + $this->project = null; // Clear if another value was already set by fetch_projet + $this->modelpdf = $obj->model_pdf; $this->last_main_doc = $obj->last_main_doc; $this->note = $obj->note_private; // TODO deprecated @@ -1506,9 +1510,7 @@ class Propal extends CommonObject $this->lines = array(); - /* - * Lines - */ + // Lines $result = $this->fetch_lines(); if ($result < 0) { diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 21b8c983d8e..f095a814652 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1680,7 +1680,7 @@ class Commande extends CommonOrder /** - * Get object and lines from database + * Get object from database. Get also lines. * * @param int $id Id of object to load * @param string $ref Ref of object @@ -1690,7 +1690,6 @@ class Commande extends CommonOrder */ public function fetch($id, $ref = '', $ref_ext = '', $ref_int = '') { - // Check parameters if (empty($id) && empty($ref) && empty($ref_ext) && empty($ref_int)) return -1; @@ -1740,7 +1739,13 @@ class Commande extends CommonOrder $this->ref_customer = $obj->ref_client; $this->ref_ext = $obj->ref_ext; $this->ref_int = $obj->ref_int; + $this->socid = $obj->fk_soc; + $this->thirdparty = null; // Clear if another value was already set by fetch_thirdparty + + $this->fk_project = $obj->fk_project; + $this->project = null; // Clear if another value was already set by fetch_projet + $this->statut = $obj->fk_statut; $this->user_author_id = $obj->fk_user_author; $this->user_valid = $obj->fk_user_valid; @@ -1762,7 +1767,6 @@ class Commande extends CommonOrder $this->note = $obj->note_private; // deprecated $this->note_private = $obj->note_private; $this->note_public = $obj->note_public; - $this->fk_project = $obj->fk_project; $this->modelpdf = $obj->model_pdf; $this->last_main_doc = $obj->last_main_doc; $this->mode_reglement_id = $obj->fk_mode_reglement; @@ -1810,9 +1814,7 @@ class Commande extends CommonOrder $this->db->free($result); - /* - * Lines - */ + // Lines $result = $this->fetch_lines(); if ($result < 0) { diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 294493ed081..0cc72fdcdcc 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1436,7 +1436,7 @@ class Facture extends CommonInvoice } /** - * Get object and lines from database + * Get object from database. Get also lines. * * @param int $rowid Id of object to load * @param string $ref Reference of invoice @@ -1517,7 +1517,13 @@ class Facture extends CommonInvoice $this->paye = $obj->paye; $this->close_code = $obj->close_code; $this->close_note = $obj->close_note; - $this->socid = $obj->fk_soc; + + $this->socid = $obj->fk_soc; + $this->thirdparty = null; // Clear if another value was already set by fetch_thirdparty + + $this->fk_project = $obj->fk_project; + $this->project = null; // Clear if another value was already set by fetch_projet + $this->statut = $obj->fk_statut; $this->date_lim_reglement = $this->db->jdate($obj->dlr); $this->mode_reglement_id = $obj->fk_mode_reglement; @@ -1528,7 +1534,6 @@ class Facture extends CommonInvoice $this->cond_reglement = $obj->cond_reglement_libelle; $this->cond_reglement_doc = $obj->cond_reglement_libelle_doc; $this->fk_account = ($obj->fk_account > 0) ? $obj->fk_account : null; - $this->fk_project = $obj->fk_project; $this->fk_facture_source = $obj->fk_facture_source; $this->fk_fac_rec_source = $obj->fk_fac_rec_source; $this->note = $obj->note_private; // deprecated @@ -1574,10 +1579,7 @@ class Facture extends CommonInvoice // fetch optionals attributes and labels $this->fetch_optionals(); - /* - * Lines - */ - + // Lines $this->lines = array(); $result = $this->fetch_lines(); diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index 75dcb837df9..ad20599ce94 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -272,7 +272,9 @@ class Paiement extends CommonObject return -1; } - $this->db->begin(); + dol_syslog(get_class($this)."::create insert paiement", LOG_DEBUG); + + $this->db->begin(); $this->ref = $this->getNextNumRef(is_object($thirdparty)?$thirdparty:''); @@ -293,7 +295,6 @@ class Paiement extends CommonObject $sql = "INSERT INTO ".MAIN_DB_PREFIX."paiement (entity, ref, datec, datep, amount, multicurrency_amount, fk_paiement, num_paiement, note, ext_payment_id, ext_payment_site, fk_user_creat)"; $sql.= " VALUES (".$conf->entity.", '".$this->db->escape($this->ref)."', '". $this->db->idate($now)."', '".$this->db->idate($this->datepaye)."', ".$total.", ".$mtotal.", ".$this->paiementid.", '".$this->db->escape($num_payment)."', '".$this->db->escape($note)."', ".($this->ext_payment_id?"'".$this->db->escape($this->ext_payment_id)."'":"null").", ".($this->ext_payment_site?"'".$this->db->escape($this->ext_payment_site)."'":"null").", ".$user->id.")"; - dol_syslog(get_class($this)."::Create insert paiement", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -309,7 +310,7 @@ class Paiement extends CommonObject $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'paiement_facture (fk_facture, fk_paiement, amount, multicurrency_amount)'; $sql .= ' VALUES ('.$facid.', '. $this->id.', \''.$amount.'\', \''.$this->multicurrency_amounts[$key].'\')'; - dol_syslog(get_class($this).'::Create Amount line '.$key.' insert paiement_facture', LOG_DEBUG); + dol_syslog(get_class($this).'::create Amount line '.$key.' insert paiement_facture', LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -409,9 +410,14 @@ class Paiement extends CommonObject // Regenerate documents of invoices if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { + dol_syslog(get_class($this).'::create Regenerate the document after inserting payment for thirdparty default_lang='.(is_object($invoice->thirdparty) ? $invoice->thirdparty->default_lang : 'null'), LOG_DEBUG); + $newlang=''; $outputlangs = $langs; - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $invoice->thirdparty->default_lang; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { + $invoice->fetch_thirdparty(); + $newlang = $invoice->thirdparty->default_lang; + } if (! empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); From 70c19fedeb0564bbd7c31534c65d1e057a0a1777 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 Feb 2020 00:47:44 +0100 Subject: [PATCH 176/306] Responsive --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index b8ec41c7c16..ab6653e3f7b 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -8059,7 +8059,7 @@ class Form $ret .= $langs->trans("Filters"); $ret .= ''; //$ret .= ''; - $ret .= '
'; + $ret .= '
'; $ret .= ''; $ret .= '
'; foreach($arrayofcriterias as $criterias) { From ecb1f1f2d70ca030aad5ae0f04be0e805fe378b6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 Feb 2020 01:01:22 +0100 Subject: [PATCH 177/306] Responsive --- htdocs/core/class/html.form.class.php | 2 +- htdocs/core/customreports.php | 2 +- htdocs/theme/eldy/global.inc.php | 5 +++++ htdocs/theme/md/style.css.php | 13 +++++++++++++ 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index ab6653e3f7b..a74872d4a98 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -8059,7 +8059,7 @@ class Form $ret .= $langs->trans("Filters"); $ret .= ''; //$ret .= ''; - $ret .= '
'; + $ret .= '
'; $ret .= ''; $ret .= '
'; foreach($arrayofcriterias as $criterias) { diff --git a/htdocs/core/customreports.php b/htdocs/core/customreports.php index 31db8fe5447..575bbb759d3 100644 --- a/htdocs/core/customreports.php +++ b/htdocs/core/customreports.php @@ -237,7 +237,7 @@ if ($object->isextrafieldmanaged) { } } print '
'.$langs->trans("Measures").'
'; -print $form->multiselectarray('search_measures', $arrayofmesures, $search_measures, 0, 0, 'minwidth500', 1); +print $form->multiselectarray('search_measures', $arrayofmesures, $search_measures, 0, 0, 'maxwidth500', 1); print '
'; // XAxis diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index fc633cbfbc3..679f2b7eb29 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -587,6 +587,7 @@ div.divsearchfield { .divadvancedsearchfield { float: left; padding-left: 15px; + padding-right: 15px; padding-bottom: 2px; padding-top: 2px; } @@ -971,6 +972,10 @@ table[summary="list_of_modules"] .fa-cog { div.refidno { font-size: !important; } + .divadvancedsearchfield { + padding-left: 5px; + padding-right: 5px; + } } /* Force values for small screen 570 */ diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index ab860db6012..be1727d840c 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -793,6 +793,19 @@ div.divsearchfield { padding-bottom: 5px; opacity: 0.6; } +.divadvancedsearchfield:first-child { + margin-top: 3px; +} +.divadvancedsearchfield { + float: left; + padding-left: 15px; + padding-right: 15px; + padding-bottom: 2px; + padding-top: 2px; +} +.divadvancedsearchfield span.select2.select2-container.select2-container--default { + padding-bottom: 4px; +} browser->layout == 'phone') { From 3baf0e66b94c64add701b7c622e66b4cef2d68e2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 Feb 2020 01:11:52 +0100 Subject: [PATCH 178/306] Trans --- htdocs/langs/en_US/admin.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 6ec05d5e956..f87a2f5ee19 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1021,7 +1021,7 @@ CalcLocaltax3Desc=Local Taxes reports are the total of localtaxes sales LabelUsedByDefault=Label used by default if no translation can be found for code LabelOnDocuments=Label on documents LabelOrTranslationKey=Label or translation key -ValueOfConstantKey=Value of constant +ValueOfConstantKey=Value of a configuration constant NbOfDays=No. of days AtEndOfMonth=At end of month CurrentNext=Current/Next From dbffaf3c1ed5289d519e70f552990c99741d9f54 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 Feb 2020 01:50:13 +0100 Subject: [PATCH 179/306] Create greetings file for new PR submiters --- .github/workflows/greetings.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/workflows/greetings.yml diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml new file mode 100644 index 00000000000..5edaf274788 --- /dev/null +++ b/.github/workflows/greetings.yml @@ -0,0 +1,12 @@ +name: Greetings PR + +on: [pull_request, issues] + +jobs: + greeting: + runs-on: ubuntu-latest + steps: + - uses: actions/first-interaction@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + pr-message: 'Welcome on Dolibarr army. You are on the road to become an Admiral (see https://wiki.dolibarr.org/index.php/Dolibarr_Project)' From 9c4ba1c5d2b51b2d25868f45c4ccfd7296b1722c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 Feb 2020 01:50:32 +0100 Subject: [PATCH 180/306] Update greetings.yml --- .github/workflows/greetings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml index 5edaf274788..17e693bf19f 100644 --- a/.github/workflows/greetings.yml +++ b/.github/workflows/greetings.yml @@ -1,6 +1,6 @@ name: Greetings PR -on: [pull_request, issues] +on: [pull_request] jobs: greeting: From 1728fff2472ea78b69adc5262d5d5a1214708e0a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 Feb 2020 02:14:23 +0100 Subject: [PATCH 181/306] Create stale-issues.yml --- .github/workflows/stale-issues.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/stale-issues.yml diff --git a/.github/workflows/stale-issues.yml b/.github/workflows/stale-issues.yml new file mode 100644 index 00000000000..31be3e82e0f --- /dev/null +++ b/.github/workflows/stale-issues.yml @@ -0,0 +1,17 @@ +name: "Close stale issues" +on: + schedule: + - cron: "0 0 * * *" + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + stale-issue-message: 'This issue is stale because it has been open 1 year with no activity. Please remove the stale label or add a comment on issue if you don t have permissions on labels, or this issue will be closed in 10 days.' + stale-issue-label: 'Bug Stale (automatic label)' + exempt-issue-label: 'Bug Security (CVE)' + days-before-stale: 365 + days-before-close: 10 From 6367fff2409410a4f7aa32f8b1fd8bf6aae53c0d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 Feb 2020 02:15:18 +0100 Subject: [PATCH 182/306] Rename greetings.yml to greetings-pr.yml --- .github/workflows/{greetings.yml => greetings-pr.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{greetings.yml => greetings-pr.yml} (100%) diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings-pr.yml similarity index 100% rename from .github/workflows/greetings.yml rename to .github/workflows/greetings-pr.yml From 9f75c10a1320030fd2e109914e36047c01bd61f9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 Feb 2020 02:23:31 +0100 Subject: [PATCH 183/306] Stale workflow --- .github/workflows/stale-issues.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/stale-issues.yml b/.github/workflows/stale-issues.yml index 31be3e82e0f..a9ab9f4afce 100644 --- a/.github/workflows/stale-issues.yml +++ b/.github/workflows/stale-issues.yml @@ -1,4 +1,4 @@ -name: "Close stale issues" +name: "Close stale issues (bugs and feature requests)" on: schedule: - cron: "0 0 * * *" @@ -10,8 +10,8 @@ jobs: - uses: actions/stale@v1 with: repo-token: ${{ secrets.GITHUB_TOKEN }} - stale-issue-message: 'This issue is stale because it has been open 1 year with no activity. Please remove the stale label or add a comment on issue if you don t have permissions on labels, or this issue will be closed in 10 days.' - stale-issue-label: 'Bug Stale (automatic label)' + stale-issue-message: 'This issue is stale because it has been open 1 year with no activity. If this is a bug, please comment to confirm it is still present on latest stable version. if this is a feature request, please comment to notify the request is still relevant and not yet covered by latest stable version. Without comment, this issue will be closed automatically by stale bot in 15 days.' + stale-issue-label: 'Issue Stale (automatic label)' exempt-issue-label: 'Bug Security (CVE)' days-before-stale: 365 days-before-close: 10 From 058524ff82a4661109e820cf93ec657d8d82ea6d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 Feb 2020 02:29:09 +0100 Subject: [PATCH 184/306] Comment --- htdocs/install/mysql/tables/llx_const.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/tables/llx_const.sql b/htdocs/install/mysql/tables/llx_const.sql index 059025b49a4..fcca5f57023 100644 --- a/htdocs/install/mysql/tables/llx_const.sql +++ b/htdocs/install/mysql/tables/llx_const.sql @@ -29,7 +29,7 @@ create table llx_const name varchar(180) NOT NULL, entity integer DEFAULT 1 NOT NULL, -- multi company id value text NOT NULL, -- max 65535 caracteres - type varchar(64) DEFAULT 'string', + type varchar(64) DEFAULT 'string', -- null or 'encrypted' if param has been encrypted visible tinyint DEFAULT 1 NOT NULL, note text, tms timestamp From 2f2a2aa52a4d0b676608d02bcc874505e1d91ed4 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 10 Feb 2020 05:35:16 +0100 Subject: [PATCH 185/306] NEW : Add French farm chart of accounts 2014 --- .../install/mysql/data/llx_accounting_abc.sql | 2 + .../mysql/data/llx_accounting_account_fr.sql | 1127 ++++++++++++++++- .../install/mysql/migration/11.0.0-12.0.0.sql | 2 + 3 files changed, 1130 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/data/llx_accounting_abc.sql b/htdocs/install/mysql/data/llx_accounting_abc.sql index 9ed0afd7da7..64c49b7a901 100644 --- a/htdocs/install/mysql/data/llx_accounting_abc.sql +++ b/htdocs/install/mysql/data/llx_accounting_abc.sql @@ -47,6 +47,8 @@ INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUE INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 1, 'PCG14-DEV', 'The developed accountancy french plan 2014', 1); -- Description of chart of account FR PCG18-ASSOC INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 1, 'PCG18-ASSOC', 'French foundation chart of accounts 2018', 1); +-- Description of chart of account FR PCGAFR14-DEV +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 1, 'PCGAFR14-DEV', 'The developed farm accountancy french plan 2014', 1); -- Description of chart of account BE PCMN-BASE INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 2, 'PCMN-BASE', 'The base accountancy belgium plan', 1); diff --git a/htdocs/install/mysql/data/llx_accounting_account_fr.sql b/htdocs/install/mysql/data/llx_accounting_account_fr.sql index d0bdb3cdae4..a0aa01015e3 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_fr.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_fr.sql @@ -31,6 +31,7 @@ -- ID 0 - 438 -- ID 1501 - 5999 -- ID 7000 - 7208 +-- ID 8000 - 9120 -- ADD 100000 to rowid # Do no remove this comment -- INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1401,'PCG99-ABREGE','CAPIT', 'XXXXXX', '1', '0', 'Fonds propres, provisions pour risques et charges et dettes à plus d''un an', 1); @@ -1598,4 +1599,1128 @@ INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 7112,'PCG18-ASSOC','INCOME', 'XXXXXX', '87', '7208', 'Contributions volontaires en nature', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 7113,'PCG18-ASSOC','INCOME', 'XXXXXX', '870', '7112', 'Dons en nature', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 7114,'PCG18-ASSOC','INCOME', 'XXXXXX', '871', '7112', 'Prestations en nature', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 7115,'PCG18-ASSOC','INCOME', 'XXXXXX', '875', '7112', 'Bénévolat', 1); \ No newline at end of file +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 7115,'PCG18-ASSOC','INCOME', 'XXXXXX', '875', '7112', 'Bénévolat', 1); + +-- +-- Descriptif des plans comptables FR PCGA14-DEV +-- + +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8000,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1', '0', 'Comptes de capitaux', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8001,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '10','8000', 'Capital et réserves', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8002,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '101','8001', 'Capital', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8003,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1011','8002', 'Capital individuel initial (au ../../../)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8004,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1012','8002', 'Variations capital individuel initial', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8005,'PCGAFR14-DEV','CAPIT', 'CAPITAL', '1013','8002', 'Capital souscrit - non appelé', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8006,'PCGAFR14-DEV','CAPIT', 'CAPITAL', '1014','8002', '"Capital souscrit - appelé, versé', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8007,'PCGAFR14-DEV','CAPIT', 'CAPITAL', '1015','8002', '"Capital souscrit - appelé, non versé', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8008,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '10151','8007', 'Capital non amorti', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8009,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '10152','8007', 'Capital amorti', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8010,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1018','8002', 'Capital souscrit soumis à des réglementations particulières', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8011,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '104','8001', 'Primes liées au capital social', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8012,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1041','8011', 'Primes d''émission', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8013,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1042','8011', 'Primes de fusion', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8014,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1043','8011', 'Primes d''apport', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8015,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1044','8011', 'Primes de conversion d''obligations en actions', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8016,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1045','8011', 'Bons de souscription d''actions', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8017,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '105','8001', 'Ecarts de réévaluation', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8018,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1051','8017', 'Réserve spéciale de réévaluation', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8019,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1052','8017', 'Ecart de réévaluation libre', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8020,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1053','8017', 'Réserve de réévaluation', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8021,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1055','8017', 'Ecarts de réévaluation (autres opérations légales)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8022,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1057','8017', 'Autres écarts de réévaluation en France', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8023,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1058','8017', 'Autres écarts de réévaluation à l''Etranger', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8024,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '106','8001', 'Réserves', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8025,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1061','8024', 'Réserve légale', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8026,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '10611','8025', 'Réserve légale proprement dite', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8027,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '10612','8025', 'Plus-values nettes à long terme', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8028,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1062','8024', 'Réserves indisponibles', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8029,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1063','8024', 'Réserves statutaires ou contractuelles', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8030,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1064','8024', 'Réserves réglementées', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8031,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '10641','8030', 'Plus-values nettes à long terme', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8032,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '10643','8030', 'Réserves consécutives à l''octroi de subventions d''investissement', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8033,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '10648','8030', 'Autres réserves réglementées', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8034,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1068','8024', 'Autres réserves', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8035,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '10681','8034', 'Réserve de propre assureur', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8036,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '10688','8034', 'Réserves diverses', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8037,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '107','8001', 'Ecart d''équivalence', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8038,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '108','8001', 'Compte de l''exploitant', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8039,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '109','8001', 'Actionnaires et associés : Capital souscrit - non appelé', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8040,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1091','8039', 'Actionnaires : Capital souscrit - non appelé', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8041,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1092','8039', 'Associés : Capital souscrit - non appelé', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8042,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '11','8000', 'Report à nouveau (solde créditeur ou débiteur)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8043,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '110','8042', 'Report à nouveau (solde créditeur)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8044,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '119','8042', 'Report à nouveau (solde débiteur)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8045,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '12','8000', 'Résultat de l''exercice (bénéfice ou perte)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8046,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '120','8045', 'Résultat de l''exercice (bénéfice)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8047,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '129','8045', 'Résultat de l''exercice (perte)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8048,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '13','8000', 'Subventions d''investissement', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8049,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '131','8048', 'Subventions d''équipement', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8050,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1311','8049', 'Etat', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8051,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1312','8049', 'Régions', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8052,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1313','8049', 'Départements', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8053,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1314','8049', 'Communes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8054,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1315','8049', 'Collectivités publiques', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8055,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1316','8049', 'Entreprises publiques', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8056,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1317','8049', 'Entreprises et organismes privés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8057,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1318','8049', 'Autres', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8058,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '138','8048', 'Autres subventions d''investissement', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8059,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '139','8048', 'Subventions d''investissement inscrites au compte de résultat', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8060,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1391','8059', 'Subventions d''équipement inscrites au compte de résultat', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8061,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '13911','8060', 'Etat', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8062,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '13912','8060', 'Régions', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8063,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '13913','8060', 'Départements', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8064,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '13914','8060', 'Communes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8065,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '13915','8060', 'Collectivités publiques', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8066,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '13916','8060', 'Entreprises publiques', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8067,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '13917','8060', 'Entreprises et organismes privés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8068,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '13918','8060', 'Autres', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8069,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1398','8059', 'Autres subventions d''investissement inscrites au compte de résultat', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8070,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '14','8000', 'Provisions réglementées', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8071,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '142','8070', 'Provisions réglementées relatives aux immobilisations', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8072,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1424','8071', 'Provisions pour investissement (participation des salariés)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8073,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '143','8070', 'Provisions réglementées relatives aux stocks', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8074,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1431','8073', 'Hausse des prix', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8075,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1432','8073', 'Fluctuation des cours', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8076,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '144','8070', 'Provisions réglementées relatives aux autres éléments de l''actif', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8077,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '145','8070', 'Amortissements dérogatoires', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8078,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '146','8070', 'Provision spéciale de réévaluation', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8079,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '147','8070', 'Plus-values réinvesties', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8080,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '148','8070', 'Autres provisions réglementées', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8081,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '15','8000', 'Provisions', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8082,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '151','8081', 'Provisions pour risques', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8083,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1511','8082', 'Provisions pour litiges', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8084,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1512','8082', 'Provisions pour garanties données aux clients', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8085,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1513','8082', 'Provisions pour pertes sur marchés à terme', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8086,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1514','8082', 'Provisions pour amendes et pénalités', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8087,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1515','8082', 'Provisions pour pertes de change', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8088,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1516','8082', 'Provisions pour pertes sur contrats', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8089,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1518','8082', 'Autres provisions pour risques', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8090,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '153','8081', 'Provisions pour pensions et obligations similaires', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8091,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '154','8081', 'Provisions pour restructurations', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8092,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '155','8081', 'Provisions pour impôts', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8093,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '156','8081', 'Provisions pour renouvellement des immobilisations', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8094,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '157','8081', 'Provisions pour charges à répartir sur plusieurs exercices', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8095,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1572','8094', 'Provisions pour gros entretien ou grandes révisions', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8096,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '158','8081', 'Autres provisions pour charges', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8097,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1581','8096', 'Provisions pour remises en état', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8098,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '16','8000', 'Emprunts et dettes assimilées', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8099,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '161','8098', 'Emprunts obligataires convertibles', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8100,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '163','8098', 'Autres emprunts obligataires', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8101,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '164','8098', 'Emprunts auprès des établissements de crédit', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8102,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1641','8101', 'Emprunts fonciers', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8103,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1642','8101', 'Autres emprunts à moyen et long terme', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8104,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1643','8101', 'Emprunts à court terme', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8105,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '165','8098', 'Dépôts et cautionnements reçus', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8106,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1651','8105', 'Dépôts', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8107,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1655','8105', 'Cautionnements', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8108,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '166','8098', 'Participation des salariés aux résultats', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8109,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1661','8108', 'Comptes bloqués', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8110,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1662','8108', 'Fonds de participation', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8111,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '167','8098', 'Emprunts et dettes assortis de conditions particulières', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8112,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1671','8111', 'Emissions de titres participatifs', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8113,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1674','8111', 'Avances conditionnées', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8114,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1675','8111', 'Emprunts participatifs', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8115,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '168','8098', 'Autres emprunts et dettes assimilées', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8116,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1681','8115', 'Autres emprunts', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8117,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1685','8115', 'Rentes viagères capitalisées', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8118,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1687','8115', 'Autres dettes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8119,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1688','8115', 'Intérêts courus', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8120,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '16881','8119', 'sur emprunts obligataires convertibles', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8121,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '16883','8119', 'sur autres emprunts obligataires', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8122,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '16684','8119', 'sur emprunts auprès des établissements de crédit', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8123,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '166841','8122', 'Intérêts courus sur emprunts fonciers', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8124,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '166842','8122', 'Intérêts courus sur autres emprunts MLT', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8125,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '166843','8122', 'Intérêts courus sur emprunts court terme', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8126,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '16885','8119', 'sur dépôts et cautionnements reçus', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8127,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '16886','8119', 'sur participation des salariés aux résultats', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8128,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '16887','8119', 'sur emprunts et dettes assortis de conditions particulières', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8129,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '16888','8119', 'sur autres emprunts et dettes assimilées', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8130,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '169','8098', 'Primes de remboursement des obligations', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8131,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '17','8000', 'Dettes rattachées à des participations', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8132,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '171','8131', 'Dettes rattachées à des participations (groupe)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8133,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1711','8132', 'Principal', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8134,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1712','8132', 'Intérêts courus', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8135,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '172','8131', 'Dettes rattachées à des participations à des organismes professionnels agricoles (autres que les établissements de crédit)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8136,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1721','8135', 'Principal', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8137,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1728','8135', 'Intérêts courus', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8138,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '174','8131', 'Dettes rattachées à des participations (hors groupe)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8139,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1741','8138', 'Principal', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8140,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1748','8138', 'Intérêts courus', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8141,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '178','8131', 'Dettes rattachées à des sociétés en participation', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8142,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1781','8141', 'Principal', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8143,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1788','8141', 'Intérêts courus', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8144,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '18','8000', 'Comptes de liaison des établissements et sociétés en participation', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8145,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '181','8144', 'Comptes de liaison des établissements', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8146,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '186','8144', 'Biens et prestations de services échangés entre établissements (charges)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8147,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '187','8144', 'Biens et prestations de services échangés entre établissements (produits)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8148,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '188','8144', 'Comptes de liaison des sociétés en participation', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8149,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2', '0', 'Comptes d''immobilisations', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8150,'PCGAFR14-DEV','IMMO', 'XXXXXX', '20','8149', 'Immobilisations incorporelles', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8151,'PCGAFR14-DEV','IMMO', 'XXXXXX', '201','8150', 'Frais d''établissement', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8152,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2011','8151', 'Frais de constitution', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8153,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2012','8151', 'Frais de premier établissement', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8154,'PCGAFR14-DEV','IMMO', 'XXXXXX', '20121','8153', 'Frais de prospection', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8155,'PCGAFR14-DEV','IMMO', 'XXXXXX', '20122','8153', 'Frais de publicité', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8156,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2013','8151', 'Frais d''augmentation de capital et d''opérations diverses (fusions, scissions, transformations)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8157,'PCGAFR14-DEV','IMMO', 'XXXXXX', '203','8150', 'Frais de recherche et de développement', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8158,'PCGAFR14-DEV','IMMO', 'XXXXXX', '205','8150', '"Concessions et droits similaires, brevets, licences, marques, procédés, logiciels, droits et valeurs similaires', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8159,'PCGAFR14-DEV','IMMO', 'XXXXXX', '206','8150', 'Droit au bail', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8160,'PCGAFR14-DEV','IMMO', 'XXXXXX', '207','8150', 'Fonds rural et commercial', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8161,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2071','8160', 'Fonds agricole', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8162,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2072','8160', 'Fonds commercial', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8163,'PCGAFR14-DEV','IMMO', 'XXXXXX', '208','8150', 'Autres immobilisations incorporelles', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8164,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2082','8163', 'Usufruit temporaire', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8165,'PCGAFR14-DEV','IMMO', 'XXXXXX', '21','8149', 'Immobilisations corporelles', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8166,'PCGAFR14-DEV','IMMO', 'XXXXXX', '211','8165', 'Terrains', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8167,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2111','8166', 'Terrains nus', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8168,'PCGAFR14-DEV','IMMO', 'XXXXXX', '21111','8167', 'Terrains nus exploités en faire valoir direct', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8169,'PCGAFR14-DEV','IMMO', 'XXXXXX', '21112','8167', 'Autres terrains nus', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8170,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2112','8166', 'Terrains aménagés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8171,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2113','8166', 'Sous-sols et sur-sols', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8172,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2114','8166', 'Terrains de gisement', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8173,'PCGAFR14-DEV','IMMO', 'XXXXXX', '21141','8172', 'Carrières', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8174,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2115','8166', 'Terrains bâtis', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8175,'PCGAFR14-DEV','IMMO', 'XXXXXX', '21151','8174', 'affectés à la production agricole', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8176,'PCGAFR14-DEV','IMMO', 'XXXXXX', '21155','8174', 'affectés à une autre activité professionnelle', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8177,'PCGAFR14-DEV','IMMO', 'XXXXXX', '21158','8174', 'affectés à des opérations non professionnelles', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8178,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2116','8166', 'Compte d''ordre sur immobilisations (art. 6 du décret 78.737 du 11-07-1978)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8179,'PCGAFR14-DEV','IMMO', 'XXXXXX', '212','8165', 'Agencements et aménagements de terrains', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8182,'PCGAFR14-DEV','IMMO', 'XXXXXX', '213','8165', 'Constructions sur sol propre', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8183,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2131','8182', 'Bâtiments', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8184,'PCGAFR14-DEV','IMMO', 'XXXXXX', '21311','8183', 'affectés à la production agricole', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8185,'PCGAFR14-DEV','IMMO', 'XXXXXX', '21315','8183', 'affectés à une autre activité professionnelle', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8186,'PCGAFR14-DEV','IMMO', 'XXXXXX', '21318','8183', 'affectés à des opérations non professionnelles', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8187,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2135','8182', 'Installations générales - agencements - aménagements des constructions', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8188,'PCGAFR14-DEV','IMMO', 'XXXXXX', '21351','8187', 'affectés à la production agricole', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8189,'PCGAFR14-DEV','IMMO', 'XXXXXX', '21355','8187', 'affectés à une autre activité professionnelle', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8190,'PCGAFR14-DEV','IMMO', 'XXXXXX', '21358','8187', 'affectés à des opérations non professionnelles', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8191,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2138','8182', 'Ouvrages d''infrastructure', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8192,'PCGAFR14-DEV','IMMO', 'XXXXXX', '214','8165', 'Constructions sur sol d''autrui', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8193,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2141','8192', 'Bâtiments', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8194,'PCGAFR14-DEV','IMMO', 'XXXXXX', '21411','8193', 'affectés à la production agricole', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8195,'PCGAFR14-DEV','IMMO', 'XXXXXX', '21415','8193', 'affectés à une autre activité professionnelle', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8196,'PCGAFR14-DEV','IMMO', 'XXXXXX', '21418','8193', 'affectés à des opérations non professionnelles', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8197,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2145','8192', 'Installations générales - agencements - aménagements des constructions', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8198,'PCGAFR14-DEV','IMMO', 'XXXXXX', '21451','8197', 'affectés à la production agricole', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8199,'PCGAFR14-DEV','IMMO', 'XXXXXX', '21455','8197', 'affectés à une autre activité professionnelle', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8200,'PCGAFR14-DEV','IMMO', 'XXXXXX', '21458','8197', 'affectés à des opérations non professionnelles', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8201,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2148','8192', 'Ouvrages d''infrastructure', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8202,'PCGAFR14-DEV','IMMO', 'XXXXXX', '215','8165', 'Installations techniques, matériels et outillage', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8203,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2151','8202', 'Installations techniques sur sol propre', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8204,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2153','8202', 'Installations techniques sur sol d''autrui', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8205,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2154','8202', 'Matériel', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8206,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2155','8202', 'Outillage', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8207,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2157','8202', 'Agencements et aménagements du matériel et outillage industriels', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8208,'PCGAFR14-DEV','IMMO', 'XXXXXX', '217','8165', 'Améliorations du fonds', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8209,'PCGAFR14-DEV','IMMO', 'XXXXXX', '218','8165', 'Autres immobilisations corporelles (hors biens vivants)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8210,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2181','8209', 'Installations générales, agencements, aménagements divers', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8211,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2182','8209', 'Matériel de transport', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8212,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2183','8209', 'Matériel de bureau et matériel informatique', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8213,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2184','8209', 'Mobilier', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8214,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2186','8209', 'Emballages récupérables', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8215,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2188','8209', 'Autres', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8216,'PCGAFR14-DEV','IMMO', 'XXXXXX', '22','8149', 'Immobilisations mises en concession', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8217,'PCGAFR14-DEV','IMMO', 'XXXXXX', '23','8149', 'Immobilisations en cours', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8218,'PCGAFR14-DEV','IMMO', 'XXXXXX', '231','8217', 'Immobilisations corporelles en cours (hors biens vivants)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8219,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2311','8218', 'Terrains (en cours)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8220,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2312','8218', 'Agencements et aménagements de terrains (en cours)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8221,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2313','8218', 'Constructions sur sol propre (en cours)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8222,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2314','8218', 'Constructions sur sol d''autrui (en cours)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8223,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2315','8218', 'Installations techniques, matériel et outillage (en cours)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8224,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2318','8218', 'Autres immobilisations corporelles - hors biens vivants (en cours)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8225,'PCGAFR14-DEV','IMMO', 'XXXXXX', '232','8217', 'Immobilisations incorporelles en cours', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8226,'PCGAFR14-DEV','IMMO', 'XXXXXX', '234','8217', 'Immobilisations corporelles en cours (biens vivants)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8227,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2341','8226', 'Animaux reproducteurs (jeunes de renouvellement)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8228,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2343','8226', 'Animaux de services (en cours)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8229,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2346','8226', 'Plantations pérennes (en cours)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8230,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2347','8226', 'Autres végétaux immobilisés (en cours)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8231,'PCGAFR14-DEV','IMMO', 'XXXXXX', '237','8217', 'Avances et acomptes versés sur immobilisations incorporelles', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8232,'PCGAFR14-DEV','IMMO', 'XXXXXX', '238','8217', 'Avances et acomptes versés sur commandes d''immobilisations corporelles', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8233,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2381','8232', 'Immobilisations corporelles (hors biens vivants)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8234,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2384','8232', 'Immobilisations corporelles (biens vivants)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8235,'PCGAFR14-DEV','IMMO', 'XXXXXX', '24','8149', 'Immobilisations en cours (biens vivants)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8236,'PCGAFR14-DEV','IMMO', 'XXXXXX', '241','8235', 'Animaux reproducteurs (adultes)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8237,'PCGAFR14-DEV','IMMO', 'XXXXXX', '242','8235', 'Animaux reproducteurs (jeunes de renouvellement)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8238,'PCGAFR14-DEV','IMMO', 'XXXXXX', '243','8235', 'Animaux de services', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8239,'PCGAFR14-DEV','IMMO', 'XXXXXX', '246','8235', 'Plantations pérennes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8240,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2461','8239', 'Plantations pérennes sur sol propre', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8241,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2465','8239', 'Plantations pérennes sur sol d''autrui', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8242,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2467','8239', 'Aménagements des plantations pérennes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8243,'PCGAFR14-DEV','IMMO', 'XXXXXX', '247','8235', 'Autres végétaux immobilisés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8244,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2471','8243', 'Autres végétaux immobilisés sur sol propre', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8245,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2475','8243', 'Autres végétaux immobilisés sur sol d''autrui', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8246,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2477','8243', 'Aménagements des autres végétaux immobilisés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8247,'PCGAFR14-DEV','IMMO', 'XXXXXX', '25','8149', 'Entreprises liées - parts et créances', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8248,'PCGAFR14-DEV','IMMO', 'XXXXXX', '26','8149', 'Participations et créances rattachées à des participations', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8249,'PCGAFR14-DEV','IMMO', 'XXXXXX', '261','8248', 'Titres de participation', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8250,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2611','8249', 'Actions', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8251,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2618','8249', 'Autres titres', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8252,'PCGAFR14-DEV','IMMO', 'XXXXXX', '262','8248', 'Participations à des organismes professionnels agricoles', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8253,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2621','8252', 'Sociétés coopératives agricoles (sauf CUMA)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8254,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2622','8252', 'CUMA', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8255,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2624','8252', 'SICA', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8256,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2628','8252', 'Autres', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8257,'PCGAFR14-DEV','IMMO', 'XXXXXX', '266','8248', 'Autres formes de participation', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8258,'PCGAFR14-DEV','IMMO', 'XXXXXX', '267','8248', 'Créances rattachées à des participations', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8259,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2671','8258', 'Créances rattachées à des participations (groupe)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8260,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2672','8258', 'Créances rattachées à des participations à des organismes professionnels agricoles', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8261,'PCGAFR14-DEV','IMMO', 'XXXXXX', '26721','8260', 'Sociétés coopératives agricoles (sauf CUMA)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8262,'PCGAFR14-DEV','IMMO', 'XXXXXX', '26722','8260', 'CUMA', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8263,'PCGAFR14-DEV','IMMO', 'XXXXXX', '26724','8260', 'SICA', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8264,'PCGAFR14-DEV','IMMO', 'XXXXXX', '26728','8260', 'Autres', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8265,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2674','8258', 'Créances rattachées à d''autres participations', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8266,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2675','8258', 'Versements représentatifs d''apports non capitalisés (appel de fonds)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8267,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2676','8258', 'Avances consolidables', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8268,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2678','8258', 'Intérêts courus', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8269,'PCGAFR14-DEV','IMMO', 'XXXXXX', '268','8248', 'Créances rattachées à des sociétés en participation', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8270,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2681','8269', 'Principal', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8271,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2688','8269', 'Intérêts courus', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8272,'PCGAFR14-DEV','IMMO', 'XXXXXX', '269','8248', 'Versements restant à effectuer sur titres de participation non libérés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8273,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2691','8272', 'sur titres de participation', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8274,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2692','8272', 'sur participations à des organismes professionnels agricoles', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8275,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2696','8272', 'sur autres formes de participation', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8276,'PCGAFR14-DEV','IMMO', 'XXXXXX', '27','8149', 'Autres immobilisations financières', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8277,'PCGAFR14-DEV','IMMO', 'XXXXXX', '271','8276', 'Titres immobilisés (droit de propriété)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8278,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2711','8277', 'Actions', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8279,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2715','8277', 'Parts dans les établissements de crédit', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8280,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2718','8277', 'Autres titres', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8281,'PCGAFR14-DEV','IMMO', 'XXXXXX', '272','8276', 'Titres immobilisés (droit de créance)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8282,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2721','8281', 'Obligations', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8283,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2722','8281', 'Bons', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8284,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2723','8281', 'Certificats de fonds de développement coopératifs', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8285,'PCGAFR14-DEV','IMMO', 'XXXXXX', '273','8276', 'Titres immobilisés de l''activité de portefeuille', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8286,'PCGAFR14-DEV','IMMO', 'XXXXXX', '274','8276', 'Prêts', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8287,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2741','8286', 'Prêts participatifs', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8288,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2742','8286', 'Prêts aux associés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8289,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2743','8286', 'Prêts au personnel', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8290,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2748','8286', 'Autres prêts', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8291,'PCGAFR14-DEV','IMMO', 'XXXXXX', '275','8276', 'Dépôts et cautionnements versés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8292,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2751','8291', 'Dépôts', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8293,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2755','8291', 'Cautionnements', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8294,'PCGAFR14-DEV','IMMO', 'XXXXXX', '276','8276', 'Autres créances immobilisées', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8295,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2761','8294', 'Créances diverses', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8296,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2768','8294', 'Intérêts courus', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8297,'PCGAFR14-DEV','IMMO', 'XXXXXX', '27682','8296', 'sur titres immobilisés (droit de créance)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8298,'PCGAFR14-DEV','IMMO', 'XXXXXX', '27684','8296', 'sur prêts', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8299,'PCGAFR14-DEV','IMMO', 'XXXXXX', '27685','8296', 'sur dépôts et cautionnements versés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8300,'PCGAFR14-DEV','IMMO', 'XXXXXX', '27688','8296', 'sur créances diverses', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8301,'PCGAFR14-DEV','IMMO', 'XXXXXX', '277','8276', 'Actions propres ou parts propres', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8302,'PCGAFR14-DEV','IMMO', 'XXXXXX', '279','8276', 'Versements restant à effectuer sur titres immobilisés non libérés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8303,'PCGAFR14-DEV','IMMO', 'XXXXXX', '28','8149', 'Amortissements des immobilisations', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8304,'PCGAFR14-DEV','IMMO', 'XXXXXX', '280','8303', 'Amortissements des immobilisations incorporelles', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8305,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2801','8304', 'Frais d''établissement', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8306,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2803','8304', 'Frais de recherche et de développement', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8307,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2805','8304', 'Concessions et droits similaires, brevets, licences, logiciels, droits et valeurs similaires', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8308,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2807','8304', 'Fonds commercial', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8309,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2808','8304', 'Autres immobilisations incorporelles', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8310,'PCGAFR14-DEV','IMMO', 'XXXXXX', '28082','8309', 'Usufruit temporaire', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8311,'PCGAFR14-DEV','IMMO', 'ALLOCATION', '281','8303', 'Amortissements des immobilisations corporelles (hors biens vivants)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8312,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2811','8311', 'Terrains de gisement', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8313,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2812','8311', 'Agencements, aménagements de terrains amortissables', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8314,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2813','8311', 'Constructions sur sol propre', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8315,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2814','8311', 'Constructions sur sol d''autrui', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8316,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2815','8311', 'Installations, matériel et outillage', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8317,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2818','8311', 'Autres immobilisations corporelles (hors biens vivants)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8318,'PCGAFR14-DEV','IMMO', 'XXXXXX', '282','8303', 'Amortissement des immobilisations mises en concession', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8319,'PCGAFR14-DEV','IMMO', 'XXXXXX', '284','8303', 'Amortissement des immobilisations corporelles (biens vivants)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8320,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2841','8319', 'Animaux reproducteurs (adultes)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8321,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2843','8319', 'Animaux de service', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8322,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2846','8319', 'Plantation pérennes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8323,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2847','8319', 'Autres végétaux immobilisés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8324,'PCGAFR14-DEV','IMMO', 'XXXXXX', '29','8149', 'Dépréciations des immobilisations', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8325,'PCGAFR14-DEV','IMMO', 'XXXXXX', '290','8324', 'Dépréciations des immobilisations incorporelles', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8326,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2905','8325', 'Marques, procédés, droits et valeurs similaires', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8327,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2906','8325', 'Droit au bail', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8328,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2907','8325', 'Fonds rural et commercial', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8329,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2908','8325', 'Autres immobilisations incorporelles', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8330,'PCGAFR14-DEV','IMMO', 'XXXXXX', '291','8324', 'Dépréciations des immobilisations corporelles (hors biens vivants)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8331,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2911','8330', 'Terrains', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8332,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2912','8330', 'Agencements et aménagements de terrains', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8333,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2913','8330', 'Constructions sur sol propre', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8334,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2914','8330', 'Constructions sur sol d''autrui', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8335,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2915','8330', 'Installations techniques, matériel et outillage', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8336,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2917','8330', 'Améliorations du fonds', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8337,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2918','8330', 'Autres immobilisations corporelles (hors biens vivants)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8338,'PCGAFR14-DEV','IMMO', 'XXXXXX', '292','8324', 'Dépréciations des immobilisations mises en concession', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8339,'PCGAFR14-DEV','IMMO', 'XXXXXX', '293','8324', 'Dépréciations des immobilisations en cours', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8340,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2931','8339', 'Immobilisations corporelles en cours (hors biens vivants)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8341,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2932','8339', 'Immobilisations incorporelles en cours', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8342,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2934','8339', 'Immobilisations corporelles en cours (biens vivants)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8343,'PCGAFR14-DEV','IMMO', 'XXXXXX', '294','8324', 'Autres immobilisations corporelles (biens vivants)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8344,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2941','8343', 'Animaux reproducteurs (adultes)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8345,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2942','8343', 'Animaux reproducteurs (jeunes de renouvellement)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8346,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2943','8343', 'Animaux de service', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8347,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2946','8343', 'Plantation pérennes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8348,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2947','8343', 'Autres végétaux immobilisés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8349,'PCGAFR14-DEV','IMMO', 'XXXXXX', '296','8324', 'Dépréciations des participations et créances rattachées à des participations', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8350,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2961','8349', 'Titres de participation', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8351,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2962','8349', 'Participations à des organismes professionnels agricoles', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8352,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2966','8349', 'Autres formes de participation', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8353,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2967','8349', 'Créances rattachées à des participations', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8354,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2968','8349', 'Créances rattachées à des sociétés en participation', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8355,'PCGAFR14-DEV','IMMO', 'XXXXXX', '297','8324', 'Dépréciations des autres immobilisations financières', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8356,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2971','8355', 'Titres immobilisés - droit de propriété', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8357,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2972','8355', 'Titres immobilisés - droit de créances', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8358,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2973','8355', 'Titres immobilisés de l''activité de portefeuille', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8359,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2974','8355', 'Prêts', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8360,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2975','8355', 'Dépôts et cautionnements versés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8361,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2976','8355', 'Autres créances immobilisées', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8362,'PCGAFR14-DEV','STOCK', 'XXXXXX', '3',' 0', 'Comptes de stocks et en-cours', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8363,'PCGAFR14-DEV','STOCK', 'XXXXXX', '30','8362', 'Stocks et en-cours', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8364,'PCGAFR14-DEV','STOCK', 'XXXXXX', '301','8363', 'Approvisionnements', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8365,'PCGAFR14-DEV','STOCK', 'XXXXXX', '3011','8364', 'Engrais et amendements', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8366,'PCGAFR14-DEV','STOCK', 'XXXXXX', '3012','8364', 'Semences et plants', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8367,'PCGAFR14-DEV','STOCK', 'XXXXXX', '3013','8364', 'Produits de défense des végétaux', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8368,'PCGAFR14-DEV','STOCK', 'XXXXXX', '3014','8364', 'Aliments du bétail', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8369,'PCGAFR14-DEV','STOCK', 'XXXXXX', '3015','8364', 'Produits de défense des animaux', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8370,'PCGAFR14-DEV','STOCK', 'XXXXXX', '3016','8364', 'Produits de reproduction animale', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8371,'PCGAFR14-DEV','STOCK', 'XXXXXX', '3017','8364', 'Emballages', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8372,'PCGAFR14-DEV','STOCK', 'XXXXXX', '30171','8371', 'Emballages perdus', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8373,'PCGAFR14-DEV','STOCK', 'XXXXXX', '30175','8371', 'Emballages récupérables non identifiables', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8374,'PCGAFR14-DEV','STOCK', 'XXXXXX', '30177','8371', 'Emballages à usage mixte', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8375,'PCGAFR14-DEV','STOCK', 'XXXXXX', '3018','8364', 'Combustibles', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8376,'PCGAFR14-DEV','STOCK', 'XXXXXX', '302','8363', 'Autres approvisionnements', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8377,'PCGAFR14-DEV','STOCK', 'XXXXXX', '3021','8376', 'Carburants et lubrifiants', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8378,'PCGAFR14-DEV','STOCK', 'XXXXXX', '3022','8376', 'Produits d''entretien', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8379,'PCGAFR14-DEV','STOCK', 'XXXXXX', '3023','8376', 'Fournitures d''atelier et de magasin', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8380,'PCGAFR14-DEV','STOCK', 'XXXXXX', '3024','8376', 'Fournitures de bureau', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8381,'PCGAFR14-DEV','STOCK', 'XXXXXX', '3025','8376', 'Denrées et fournitures pour le personnel', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8382,'PCGAFR14-DEV','STOCK', 'XXXXXX', '3026','8376', 'Matériaux divers', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8383,'PCGAFR14-DEV','STOCK', 'XXXXXX', '3027','8376', 'Autres fournitures consommables', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8384,'PCGAFR14-DEV','STOCK', 'XXXXXX', '3028','8376', 'Matières premières', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8385,'PCGAFR14-DEV','STOCK', 'XXXXXX', '307','8363', 'Marchandises', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8386,'PCGAFR14-DEV','STOCK', 'XXXXXX', '31','8362', 'Animaux (cycle long)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8387,'PCGAFR14-DEV','STOCK', 'XXXXXX', '311','8386', 'Stocks d''animaux (cycle long)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8388,'PCGAFR14-DEV','STOCK', 'XXXXXX', '32','8362', 'Animaux (cycle court)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8389,'PCGAFR14-DEV','STOCK', 'XXXXXX', '321','8388', 'Stocks d''animaux (cycle court)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8390,'PCGAFR14-DEV','STOCK', 'XXXXXX', '33','8362', 'Végétaux en terre (cycle long)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8391,'PCGAFR14-DEV','STOCK', 'XXXXXX', '331','8390', 'Avances aux cultures (cycle long)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8392,'PCGAFR14-DEV','STOCK', 'XXXXXX', '3311','8391', 'Engrais et amendements en terre', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8393,'PCGAFR14-DEV','STOCK', 'XXXXXX', '3312','8391', 'Semences et plants en terre', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8394,'PCGAFR14-DEV','STOCK', 'XXXXXX', '3313','8391', 'Produit de défense des végétaux en terre', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8395,'PCGAFR14-DEV','STOCK', 'XXXXXX', '3314','8391', 'Autres approvisionnements en terre', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8396,'PCGAFR14-DEV','STOCK', 'XXXXXX', '3315','8391', 'Façons culturales', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8397,'PCGAFR14-DEV','STOCK', 'XXXXXX', '3318','8391', 'Autres', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8398,'PCGAFR14-DEV','STOCK', 'XXXXXX', '34','8362', 'Végétaux en terre (cycle court)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8399,'PCGAFR14-DEV','STOCK', 'XXXXXX', '341','8398', 'Avances aux cultures (cycle court)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8400,'PCGAFR14-DEV','STOCK', 'XXXXXX', '3411','8399', 'Engrais et amendements en terre', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8401,'PCGAFR14-DEV','STOCK', 'XXXXXX', '3412','8399', 'Semences et plants en terre', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8402,'PCGAFR14-DEV','STOCK', 'XXXXXX', '3413','8399', 'Produit de défense des végétaux en terre', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8403,'PCGAFR14-DEV','STOCK', 'XXXXXX', '3414','8399', 'Autres approvisionnements en terre', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8404,'PCGAFR14-DEV','STOCK', 'XXXXXX', '3415','8399', 'Façons culturales', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8405,'PCGAFR14-DEV','STOCK', 'XXXXXX', '3418','8399', 'Autres', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8406,'PCGAFR14-DEV','STOCK', 'XXXXXX', '348','8398', 'Autres végétaux en terre (cycle court)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8407,'PCGAFR14-DEV','STOCK', 'XXXXXX', '35','8362', 'En-cours de production de biens et services (cycle long)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8408,'PCGAFR14-DEV','STOCK', 'XXXXXX', '351','8407', 'Biens (cycle long)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8409,'PCGAFR14-DEV','STOCK', 'XXXXXX', '352','8407', 'Biens (cycle long)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8410,'PCGAFR14-DEV','STOCK', 'XXXXXX', '353','8407', 'Biens (cycle long)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8411,'PCGAFR14-DEV','STOCK', 'XXXXXX', '354','8407', 'Biens (cycle long)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8412,'PCGAFR14-DEV','STOCK', 'XXXXXX', '355','8407', 'Biens (cycle long)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8413,'PCGAFR14-DEV','STOCK', 'XXXXXX', '356','8407', 'Autres biens (cycle long)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8414,'PCGAFR14-DEV','STOCK', 'XXXXXX', '357','8407', 'Travaux à façon (cycle long)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8415,'PCGAFR14-DEV','STOCK', 'XXXXXX', '358','8407', 'Autres services (cycle long)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8416,'PCGAFR14-DEV','STOCK', 'XXXXXX', '36','8362', 'En-cours de production de biens et services (cycle court)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8417,'PCGAFR14-DEV','STOCK', 'XXXXXX', '361','8416', 'Biens (cycle court) - Produits végétaux', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8418,'PCGAFR14-DEV','STOCK', 'XXXXXX', '362','8416', 'Biens (cycle court) - Produits animaux', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8419,'PCGAFR14-DEV','STOCK', 'XXXXXX', '363','8416', 'Biens (cycle court) - Vins', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8420,'PCGAFR14-DEV','STOCK', 'XXXXXX', '364','8416', 'Biens (cycle court) - Alcools', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8421,'PCGAFR14-DEV','STOCK', 'XXXXXX', '365','8416', 'Biens (cycle court) - Autres produits transformés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8422,'PCGAFR14-DEV','STOCK', 'XXXXXX', '366','8416', 'Autres biens (activités annexes)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8423,'PCGAFR14-DEV','STOCK', 'XXXXXX', '367','8416', 'Travaux à façon (cycle court)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8424,'PCGAFR14-DEV','STOCK', 'XXXXXX', '368','8416', 'Autres services (cycle court)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8425,'PCGAFR14-DEV','STOCK', 'XXXXXX', '37','8362', 'Stocks de Produits', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8426,'PCGAFR14-DEV','STOCK', 'XXXXXX', '371','8425', 'Produits intermédiaires végétaux', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8427,'PCGAFR14-DEV','STOCK', 'XXXXXX', '372','8425', 'Produits intermédiaires animaux', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8428,'PCGAFR14-DEV','STOCK', 'XXXXXX', '373','8425', 'Produits intermédiaires transformés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8429,'PCGAFR14-DEV','STOCK', 'XXXXXX', '374','8425', 'Produits finis végétaux', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8430,'PCGAFR14-DEV','STOCK', 'XXXXXX', '375','8425', 'Produits finis animaux', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8431,'PCGAFR14-DEV','STOCK', 'XXXXXX', '376','8425', 'Produits finis transformés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8432,'PCGAFR14-DEV','STOCK', 'XXXXXX', '377','8425', 'Produits résiduels', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8433,'PCGAFR14-DEV','STOCK', 'XXXXXX', '378','8425', 'Produits (activités annexes)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8434,'PCGAFR14-DEV','STOCK', 'XXXXXX', '38','8362', 'Inventaire permanent', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8435,'PCGAFR14-DEV','STOCK', 'XXXXXX', '39','8362', 'Dépréciations des stocks et en-cours', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8436,'PCGAFR14-DEV','STOCK', 'XXXXXX', '390','8435', 'Dépréciations des approvisionnements et marchandises', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8437,'PCGAFR14-DEV','STOCK', 'XXXXXX', '391','8435', 'Dépréciations des animaux (cycle long)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8438,'PCGAFR14-DEV','STOCK', 'XXXXXX', '392','8435', 'Dépréciations des animaux (cycle court)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8439,'PCGAFR14-DEV','STOCK', 'XXXXXX', '393','8435', 'Dépréciations des végétaux en terre (cycle long)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8440,'PCGAFR14-DEV','STOCK', 'XXXXXX', '394','8435', 'Dépréciations des végétaux en terre (cycle court)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8441,'PCGAFR14-DEV','STOCK', 'XXXXXX', '395','8435', 'Dépréciations des en-cours de production de biens et services (cycle long)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8442,'PCGAFR14-DEV','STOCK', 'XXXXXX', '396','8435', 'Dépréciations des en-cours de production de biens et services (cycle court)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8443,'PCGAFR14-DEV','STOCK', 'XXXXXX', '397','8435', 'Dépréciations des produits', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8444,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4',' 0', 'Comptes de tiers', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8445,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '40','8444', 'Fournisseurs et comptes rattachés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8446,'PCGAFR14-DEV','THIRDPARTY','SUPPLIER', '401','8445', 'Fournisseurs d''exploitation', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8447,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4011','8446', 'Fournisseurs - Achats de biens et de prestations de services', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8448,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4017','8446', 'Fournisseurs - Retenues de garantie', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8449,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '402','8445', 'Fournisseurs d''exploitation - Soldes après compensation', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8450,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '403','8445', 'Fournisseurs - Effets à payer', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8451,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4031','8450', 'Fournisseurs d''exploitation', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8452,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4032','8450', 'Fournisseurs d''exploitation (conventions de compte courant)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8453,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '404','8445', 'Fournisseurs d''immobilisations', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8454,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4041','8453', 'Fournisseurs - Achats d''immobilisations', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8455,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4047','8453', 'Fournisseurs d''immobilisations - Retenues de garantie', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8456,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '405','8445', 'Fournisseurs d''immobilisations - Effets à payer', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8457,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '408','8445', 'Fournisseurs - Factures non parvenues', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8458,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4081','8457', 'Fournisseurs d''exploitation', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8459,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4082','8457', 'Fournisseurs d''exploitation (conventions de compte courant)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8460,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4084','8457', 'Fournisseurs d''immobilisations', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8461,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4088','8457', 'Fournisseurs - Intérêts courus', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8462,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '409','8445', 'Fournisseurs débiteurs', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8463,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4091','8462', 'Fournisseurs - Avances et acomptes versés sur commandes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8464,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4096','8462', 'Fournisseurs - Créances pour emballages et matériel à rendre', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8465,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4097','8462', 'Fournisseurs - Autres avoirs', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8466,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '40971','8465', 'Fournisseurs d''exploitation', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8467,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '40974','8465', 'Fournisseurs d''immobilisations', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8468,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4098','8462', 'Rabais, remises, ristournes à obtenir et autres avoirs non encore reçus', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8469,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '41','8444', 'Clients et comptes rattachés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8470,'PCGAFR14-DEV','THIRDPARTY','CUSTOMER', '411','8469', 'Clients', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8471,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4111','8470', 'Clients - Ventes de biens ou de prestations de services', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8472,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4117','8470', 'Clients - Retenues de garantie', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8473,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '412','8469', 'Clients - Soldes après compensation', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8474,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '413','8469', 'Clients - Effets à recevoir', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8475,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4131','8474', 'Clients', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8476,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4132','8474', 'Clients (conventions de compte courant)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8477,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '416','8469', 'Clients douteux ou litigieux', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8478,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '418','8469', 'Clients - Produits non encore facturés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8479,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4181','8478', 'Clients - Factures à établir', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8480,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4182','8478', 'Clients (conventions de compte courant)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8481,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4188','8478', 'Clients - Intérêts courus', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8482,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '419','8469', 'Clients créditeurs', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8483,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4191','8482', 'Clients - Avances et acomptes reçus sur commandes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8484,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4196','8482', 'Clients - Dettes sur emballages et matériels consignés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8485,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4197','8482', 'Clients - Autres avoirs', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8486,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4198','8482', 'Rabais, remises, ristournes à accorder et autres avoirs à établir', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8487,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '42','8444', 'Personnel et comptes rattachés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8488,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '421','8487', 'Personnel - Rémunérations dues', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8489,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '422','8487', 'Comités d''entreprises, d''établissement', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8490,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '424','8487', 'Participation des salariés aux résultats', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8491,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4246','8490', 'Réserve spéciale (art. L. 442-2 du Code du travail)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8492,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4248','8490', 'Comptes courants', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8493,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '425','8487', 'Personnel - Avances et acomptes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8494,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '426','8487', 'Personnel - Dépôts', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8495,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '427','8487', 'Personnel - Oppositions', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8496,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '428','8487', 'Personnel - Charges à payer et produits à recevoir', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8497,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4282','8496', 'Dettes provisionnées pour congés à payer', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8498,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4284','8496', 'Dettes provisionnées pour participation des salariés aux résultats', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8499,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4286','8496', 'Autres charges à payer', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8500,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4287','8496', 'Produits à recevoir', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8501,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '43','8444', 'Mutualité Sociale Agricole et autres organismes sociaux', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8502,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '431','8501', 'Mutualité Sociale Agricole', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8503,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '437','8501', 'Autres organismes sociaux', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8504,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '438','8501', 'Organismes sociaux - Charges à payer et produits à recevoir', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8505,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4382','8504', 'Charges sociales sur congés à payer', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8506,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4386','8504', 'Autres charges à payer', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8507,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4387','8504', 'Produits à recevoir', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8508,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '44','8444', 'Etat et autres collectivités publiques', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8509,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '441','8508', 'Etat - Subventions à recevoir', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8510,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4411','8509', 'Subventions d''investissement', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8511,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4417','8509', 'Subventions d''exploitation', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8512,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4418','8509', 'Subventions d''équilibre', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8513,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4419','8509', 'Avances sur subventions', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8514,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '442','8508', 'Etat - Impôts et taxes recouvrables sur des tiers', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8515,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4424','8514', 'Obligataires', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8516,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4425','8514', 'Associés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8517,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4428','8514', 'Autres', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8518,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '443','8508', 'Opérations particulières avec l''Etat, les collectivités publiques, les organismes internationaux', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8519,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '444','8508', 'Etat - Impôts sur les bénéfices', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8520,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '445','8508', 'Etat - Taxes sur le chiffre d''affaires', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8521,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4452','8520', 'TVA due intracommunautaire', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8522,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '44528','8521', 'TVA due intracommunautaire sur factures non parvenues', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8523,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4455','8520', 'Taxes sur le chiffre d''affaires à décaisser', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8524,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '44551','8523', 'TVA à décaisser', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8525,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '44552','8523', 'TVA antérieurement déduite à reverser', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8526,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '44558','8523', 'Taxes assimilées à la TVA', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8527,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4456','8520', 'Taxes sur le chiffre d''affaires déductibles', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8528,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '44562','8527', 'TVA sur immobilisations', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8529,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '445622','8528', 'TVA sur intracommunautaire sur immobilisations', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8530,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '44563','8527', 'TVA transférée par d''autres entreprises', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8531,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '44565','8527', 'TVA sur achats à régulariser', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8532,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '44566','8527', 'TVA sur autres biens et services', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8533,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '445662','8532', 'TVA sur intracommunautaire sur biens et services', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8534,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '44567','8527', 'Crédit de TVA à reporter', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8535,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '44568','8527', 'Taxes assimilées à la TVA', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8536,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4457','8520', 'Taxes sur le chiffre d''affaires collectées par l''entreprise', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8537,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '44571','8536', 'TVA collectée', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8538,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '44575','8536', 'TVA collectée à régulariser', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8539,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '44578','8536', 'Taxes assimilées à la TVA', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8540,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4458','8520', 'Taxes sur le chiffre d''affaires à régulariser ou en attente', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8541,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '44581','8540', 'Acomptes - Régime simplifié d''imposition', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8542,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '44582','8540', 'Acomptes - Régime du forfait', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8543,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '44583','8540', 'Remboursement de taxes sur le chiffre d''affaires demandé', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8544,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '44584','8540', 'TVA récupérée d''avance', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8545,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '44586','8540', 'Taxes sur le chiffre d''affaires sur factures non parvenues', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8546,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '445862','8545', 'TVA sur intracommunautaire sur factures non parvenues', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8547,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '44587','8540', 'Taxes sur le chiffre d''affaires sur factures à établir', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8548,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '446','8508', 'Obligations cautionnées', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8549,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '447','8508', 'Autres impôts, taxes et versements assimilés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8550,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '448','8508', 'Etat - Charges à payer et produits à recevoir', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8551,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4482','8550', 'Charges fiscales sur congés à payer', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8552,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4486','8550', 'Autres charges à payer', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8553,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4487','8550', 'Produits à recevoir', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8554,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '45','8444', 'Groupe, communautés d''exploitation et associés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8555,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '451','8554', 'Groupe', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8556,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '452','8554', 'Associés - Opérations faites en commun (GAEC partiels)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8557,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4521','8556', 'Opérations courantes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8558,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4528','8556', 'Intérêts courus', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8559,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '453','8554', 'Associés - Opérations faites en commun et en GIE (banques de travail)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8560,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4531','8559', 'Opérations courantes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8561,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4538','8559', 'Intérêts courus', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8562,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '454','8554', 'Associés - Opérations faites en commun (autres communautés d''exploitation à objets particuliers)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8563,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4541','8562', 'Opérations courantes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8564,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4548','8562', 'Intérêts courus', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8565,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '455','8554', 'Associés - Comptes courants', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8566,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4551','8565', 'Associés - Comptes courants (principal)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8567,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4553','8565', 'Associés - Comptes bloqués (principal)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8568,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4558','8565', 'Associés - Comptes courants (intérêts courus)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8569,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '45581','8568', 'Associés - Comptes courants (intérêts courus)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8570,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '45583','8568', 'Associés - Comptes bloqués (intérêts courus)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8571,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '456','8554', 'Associés - Opérations sur le capital', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8572,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4561','8571', 'Associés - Comptes d''apport en société', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8573,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '45611','8572', 'Apports en nature', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8574,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '45615','8572', 'Apports en numéraire', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8575,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4562','8571', 'Apporteurs - Capital appelé, non versé', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8576,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '45621','8575', 'Actionnaires - Capital souscrit et appelé, non versé', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8577,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '45625','8575', 'Associés - Capital appelé, non versé', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8578,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4563','8571', 'Associés - Versements reçus sur augmentation de capital', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8579,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4564','8571', 'Associés - Versements anticipés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8580,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4566','8571', 'Associés défaillants', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8581,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4567','8571', 'Associés - Capital à rembourser', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8582,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '457','8554', 'Associés - Dividendes à payer', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8583,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '458','8554', 'Associés - Opérations faites en commun et en GIE', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8584,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4581','8583', 'Opérations courantes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8585,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4588','8583', 'Intérêts courus', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8586,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '46','8444', 'Débiteurs divers et créditeurs divers', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8587,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '461','8586', 'Caisse de péréquation des prix', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8588,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '462','8586', 'Créances sur cessions d''immobilisations', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8589,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '464','8586', 'Dettes sur acquisitions de valeurs mobilières de placement', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8590,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '465','8586', 'Créances sur cessions de valeurs mobilières de placement', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8591,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '467','8586', 'Autres comptes débiteurs ou créditeurs', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8592,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4671','8591', 'Autres comptes débiteurs', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8593,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4672','8591', 'Autres comptes créditeurs', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8594,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '468','8586', 'Divers - Charges à payer et produits à recevoir', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8595,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4686','8594', 'Charges à payer', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8596,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4687','8594', 'Produits à recevoir', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8597,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '47','8444', 'Comptes transitoires ou d''attente', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8598,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '471','8597', 'Comptes d''attente', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8599,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '472','8597', 'Opérations de compensation (conventions de compte courant)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8600,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '473','8597', 'Comptes d''attente', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8601,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '474','8597', 'Comptes d''attente', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8602,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '475','8597', 'Comptes d''attente', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8603,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '476','8597', 'Différence de conversion - Actif', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8604,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4761','8603', 'Diminution des créances', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8605,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4762','8603', 'Augmentation des dettes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8606,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4768','8603', 'Différences compensées par couverture de change', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8607,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '477','8597', 'Différences de conversion - Passif', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8608,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4771','8607', 'Augmentation des créances', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8609,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4772','8607', 'Diminution des dettes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8610,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4778','8607', 'Différences compensées par couverture de change', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8611,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '478','8597', 'Autres comptes transitoires', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8612,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '48','8444', 'Comptes de régularisation', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8613,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '481','8612', 'Charges à répartir sur plusieurs exercices', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8614,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4816','8613', 'Frais d''émission des emprunts', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8615,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '486','8612', 'Charges constatées d''avance', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8616,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '487','8612', 'Produits constatés d''avance', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8617,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '488','8612', 'Comptes de répartition périodique des charges et des produits', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8618,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4886','8617', 'Charges', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8619,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4887','8617', 'Produits', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8620,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '49','8444', 'Dépréciations des comptes de tiers', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8621,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '491','8620', 'Dépréciations des comptes de clients', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8622,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '495','8620', 'Dépréciations des comptes du groupe, des communautés d''exploitation et des associés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8623,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4951','8622', 'Comptes du groupe', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8624,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4952','8622', 'Opérations faites en commun (GAEC partiels)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8625,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4953','8622', 'Opérations faites en commun et en GIE (banques de travail)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8626,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4954','8622', 'Opérations faites en commun (autres communauté d''exploitation à objets particuliers)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8627,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4955','8622', 'Comptes courants des associés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8628,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4958','8622', 'Opérations faites en commun et en GIE', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8629,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '496','8620', 'Dépréciations des comptes de débiteurs divers', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8630,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4961','8629', 'Caisse de péréquation des prix', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8631,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4962','8629', 'Créances sur cessions d''immobilisations', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8632,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4965','8629', 'Créances sur cessions de valeurs mobilières de placement', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8633,'PCGAFR14-DEV','THIRDPARTY', 'XXXXXX', '4967','8629', 'Autres comptes débiteurs', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8634,'PCGAFR14-DEV','FINAN', 'XXXXXX', '5', '0', 'Comptes financiers', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8635,'PCGAFR14-DEV','FINAN', 'XXXXXX', '50','8634', 'Valeurs mobilières de placement', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8636,'PCGAFR14-DEV','FINAN', 'XXXXXX', '501','8635', 'Parts dans des entreprises liées', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8637,'PCGAFR14-DEV','FINAN', 'XXXXXX', '502','8635', 'Actions propres', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8638,'PCGAFR14-DEV','FINAN', 'XXXXXX', '503','8635', 'Actions', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8639,'PCGAFR14-DEV','FINAN', 'XXXXXX', '5031','8638', 'Titres cotés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8640,'PCGAFR14-DEV','FINAN', 'XXXXXX', '5035','8638', 'Titres non cotés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8641,'PCGAFR14-DEV','FINAN', 'XXXXXX', '504','8635', 'Autres titres conférant un droit de propriété', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8642,'PCGAFR14-DEV','FINAN', 'XXXXXX', '505','8635', 'Obligations et bons émis par la société et rachetés par elle', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8643,'PCGAFR14-DEV','FINAN', 'XXXXXX', '506','8635', 'Obligations', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8644,'PCGAFR14-DEV','FINAN', 'XXXXXX', '5061','8643', 'Titres cotés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8645,'PCGAFR14-DEV','FINAN', 'XXXXXX', '5065','8643', 'Titres non cotés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8646,'PCGAFR14-DEV','FINAN', 'XXXXXX', '507','8635', 'Bons du Trésor et bons de caisse à court terme', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8647,'PCGAFR14-DEV','FINAN', 'XXXXXX', '508','8635', 'Autres valeurs mobilières de placement et autres créances assimilées', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8648,'PCGAFR14-DEV','FINAN', 'XXXXXX', '5081','8647', 'Autres valeurs mobilières', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8649,'PCGAFR14-DEV','FINAN', 'XXXXXX', '5082','8647', 'Bons de souscription', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8650,'PCGAFR14-DEV','FINAN', 'XXXXXX', '5088','8647', 'Intérêts courus sur obligations, bons et valeurs assimilés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8651,'PCGAFR14-DEV','FINAN', 'XXXXXX', '509','8635', 'Versements restant à effectuer sur valeurs mobilières de placement non libérées', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8652,'PCGAFR14-DEV','FINAN', 'XXXXXX', '51','8634', 'Banques, établissements financiers et assimilés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8653,'PCGAFR14-DEV','FINAN', 'XXXXXX', '511','8652', 'Valeurs à l''encaissement', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8654,'PCGAFR14-DEV','FINAN', 'XXXXXX', '5111','8653', 'Coupons échus à l''encaissement', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8655,'PCGAFR14-DEV','FINAN', 'XXXXXX', '5112','8653', 'Chèques à encaisser', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8656,'PCGAFR14-DEV','FINAN', 'XXXXXX', '5113','8653', 'Effets à l''encaissement', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8657,'PCGAFR14-DEV','FINAN', 'XXXXXX', '5114','8653', 'Effets à l''escompte', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8658,'PCGAFR14-DEV','FINAN', 'XXXXXX', '512','8652', 'Banques', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8659,'PCGAFR14-DEV','FINAN', 'XXXXXX', '514','8652', 'Chèques postaux', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8660,'PCGAFR14-DEV','FINAN', 'XXXXXX', '515','8652', 'Caisses"" du Trésor et des établissements publics', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8661,'PCGAFR14-DEV','FINAN', 'XXXXXX', '516','8652', 'Sociétés de Bourse', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8662,'PCGAFR14-DEV','FINAN', 'XXXXXX', '517','8652', 'Autres organismes financiers', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8663,'PCGAFR14-DEV','FINAN', 'XXXXXX', '518','8652', 'Intérêts courus', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8664,'PCGAFR14-DEV','FINAN', 'XXXXXX', '5181','8663', 'Intérêts courus à payer', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8665,'PCGAFR14-DEV','FINAN', 'XXXXXX', '5188','8663', 'Intérêts courus à recevoir', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8666,'PCGAFR14-DEV','FINAN', 'XXXXXX', '519','8652', 'Concours bancaires courants', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8667,'PCGAFR14-DEV','FINAN', 'XXXXXX', '5191','8666', 'Crédit bancaires de campagne', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8668,'PCGAFR14-DEV','FINAN', 'XXXXXX', '5193','8666', 'Mobilisation de créances nées à l''étranger', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8669,'PCGAFR14-DEV','FINAN', 'XXXXXX', '5197','8666', 'Crédits de mobilisation de créances', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8670,'PCGAFR14-DEV','FINAN', 'XXXXXX', '5198','8666', 'Intérêts courus sur concours bancaires courants', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8671,'PCGAFR14-DEV','FINAN', 'XXXXXX', '52','8634', 'Instruments de trésorerie', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8672,'PCGAFR14-DEV','FINAN', 'XXXXXX', '53','8634', 'Caisse', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8673,'PCGAFR14-DEV','FINAN', 'XXXXXX', '54','8634', 'Régies d''avance et accréditifs', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8674,'PCGAFR14-DEV','FINAN', 'XXXXXX', '58','8634', 'Virements internes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8675,'PCGAFR14-DEV','FINAN', 'XXXXXX', '59','8634', 'Dépréciations des comptes financiers', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8676,'PCGAFR14-DEV','FINAN', 'XXXXXX', '590','8675', 'Dépréciations des valeurs mobilières de placement', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8677,'PCGAFR14-DEV','FINAN', 'XXXXXX', '5903','8676', 'Actions', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8678,'PCGAFR14-DEV','FINAN', 'XXXXXX', '5904','8676', 'Autres titres conférant un droit de propriété', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8679,'PCGAFR14-DEV','FINAN', 'XXXXXX', '5906','8676', 'Obligations', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8680,'PCGAFR14-DEV','FINAN', 'XXXXXX', '5908','8676', 'Autres valeurs mobilières de placement et créances assimilées', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8681,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6', '0', 'Comptes de charges', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8682,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '60','8681', 'Achats (sauf 603)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8683,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '601','8682', 'Achats stockés - approvisionnements', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8684,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6011','8683', 'Engrais et amendements', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8685,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6012','8683', 'Semences et plants', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8686,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6013','8683', 'Produits de défense des végétaux', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8687,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6014','8683', 'Aliments du bétail', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8688,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6015','8683', 'Produits de défense des animaux', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8689,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6016','8683', 'Produits de reproduction animale', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8690,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6017','8683', 'Emballages', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8691,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '60171','8690', 'Emballages perdus', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8692,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '60172','8690', 'Emballages récupérables non identifiables', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8693,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '60173','8690', 'Emballages à usage mixte', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8694,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6018','8683', 'Combustibles', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8695,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '602','8682', 'Achats stockés - Autres approvisionnements', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8696,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6021','8695', 'Carburants et lubrifiants', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8697,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6022','8695', 'Produits d''entretien', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8698,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6023','8695', 'Fournitures d''atelier et de magasin', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8699,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6024','8695', 'Fournitures de bureau', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8700,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6025','8695', 'Denrées et fournitures pour le personnel', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8701,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6026','8695', 'Matériaux divers', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8702,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6027','8695', 'Autres fournitures consommables', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8703,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6028','8695', 'Matières premières', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8704,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '603','8682', 'Variations des stocks (approvisionnements et marchandises)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8705,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6031','8704', 'Variation des stocks d''approvisionnements', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8706,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6032','8704', 'Variation des stocks d''autres approvisionnements', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8707,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6037','8704', 'Variation des stocks de marchandises', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8708,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '604','8682', 'Achats d''animaux', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8709,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6041','8708', 'Animaux reproducteurs (adultes)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8710,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6042','8708', 'Animaux reproducteurs (jeunes de renouvellement)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8711,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6045','8708', 'Autres animaux', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8712,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '605','8682', 'Achats de travaux et services incorporés aux produits', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8713,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6051','8712', 'Achats de travaux et services incorporés pour productions végétales', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8714,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6054','8712', 'Achats de travaux et services incorporés pour productions animales', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8715,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6058','8712', 'Autres achats de travaux et services', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8716,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '606','8682', 'Achats non stockés et fournitures', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8717,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6061','8716', 'Eau', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8718,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6062','8716', 'Gaz', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8719,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6063','8716', 'Electricités', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8720,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6064','8716', 'Carburants et lubrifiants', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8721,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6065','8716', 'Eau d''irrigation', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8722,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6066','8716', 'Fournitures d''entretien et de petit équipement', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8723,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6067','8716', 'Fournitures pour productions immobilisées', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8724,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6068','8716', 'Autres fournitures non stockés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8725,'PCGAFR14-DEV','EXPENSE', 'PRODUCT', '607','8682', 'Achats de marchandises', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8726,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '608','8682', 'Frais accessoires sur achats', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8727,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '609','8682', 'Rabais, remises et ristournes obtenus sur achats', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8728,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6091','8727', 'RRR sur achats d''autres approvisionnements', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8729,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6092','8727', 'RRR sur achats d''approvisionnements', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8730,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6094','8727', 'RRR sur achats d''animaux', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8731,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6095','8727', 'RRR sur achats de travaux et services incorporés aux produits', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8732,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6096','8727', 'RRR sur achats de fournitures non stockés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8733,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6097','8727', 'RRR sur achats de marchandises', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8734,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6098','8727', 'Rabais, remises et ristournes non affectés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8735,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '61','8681', 'Services extérieurs', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8736,'PCGAFR14-DEV','EXPENSE', 'SERVICE', '611','8735', 'Sous-traitance générale', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8737,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '612','8735', 'Redevances de crédit-bail', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8738,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6122','8737', 'Redevances de crédit-bail mobilier', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8739,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6125','8737', 'Redevances de crédit-bail immobilier', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8740,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '613','8735', 'Locations', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8741,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6131','8740', 'Fermages et loyers du foncier', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8742,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6132','8740', 'Locations de matériel', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8743,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6134','8740', 'Locations d''animaux', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8744,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6136','8740', 'Malis sur emballages', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8745,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6138','8740', 'Autres locations', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8746,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '614','8735', 'Charges locatives et de copropriété', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8747,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6141','8746', 'Charges locatives du foncier', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8748,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6142','8746', 'Charges locatives du matériel', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8749,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6144','8746', 'Charges locatives des animaux', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8750,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6148','8746', 'Autres charges locatives et de copropriété', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8751,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '615','8735', 'Entretien et réparations', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8752,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6151','8751', 'Terrains', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8753,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6152','8751', 'Agencements et aménagements de terrains', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8754,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6153','8751', 'Constructions (sur sol propre)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8755,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6154','8751', 'Constructions (sur sol d''autrui)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8756,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6155','8751', 'Installations techniques, matériel et outillage', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8757,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '61551','6155', 'Matériel et outillage', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8758,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '61552','6155', 'Maintenance', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8759,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6156','8751', 'Plantations pérennes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8760,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6157','8751', 'Autres végétaux immobilisés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8761,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6158','8751', 'Autres immobilisations corporelles (hors biens vivants)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8762,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '616','8735', 'Primes d''assurances', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8763,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6161','8762', 'Multirisques', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8764,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6162','8762', 'Assurance obligatoire dommage construction', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8765,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6163','8762', 'Assurance - transport (sur achats)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8766,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6164','8762', 'Assurance - transport (sur ventes)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8767,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6165','8762', 'Assurance - transport (sur autres biens)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8768,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6166','8762', 'Risques d''exploitation', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8769,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6167','8762', 'Insolvabilité clients', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8770,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6168','8762', 'Autres', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8771,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '617','8735', 'Etudes et recherches', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8772,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '618','8735', 'Divers', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8773,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6181','8772', 'Documentation générale', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8774,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6183','8772', 'Documentation technique', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8775,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6185','8772', 'Frais de colloques, séminaires, conférences', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8776,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '619','8735', 'Rabais, remises et ristournes obtenus sur services extérieurs', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8777,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '62','8681', 'Autres services extérieurs', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8778,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '621','8777', 'Personnel extérieur à l''entreprise', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8779,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6211','8778', 'Personnel intérimaire', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8780,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6214','8778', 'Personnel détaché ou prêté à l''entreprise', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8781,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '622','8777', 'Rémunérations d''intermédiaires et honoraires', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8782,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6221','8781', 'Commissions et courtages sur achats', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8783,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6222','8781', 'Commissions et courtages sur ventes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8784,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6223','8781', 'Rémunérations des transitaires', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8785,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6224','8781', 'Rémunérations d''affacturage', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8786,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6225','8781', 'Honoraires vétérinaires', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8787,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6226','8781', 'Autres honoraires', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8788,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6227','8781', 'Frais d''actes et de contentieux', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8789,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6228','8781', 'Divers', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8790,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '623','8777', 'Publicité, publications, relations publiques', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8791,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6231','8790', 'Annonces et insertions', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8792,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6232','8790', 'Echantillons', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8793,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6233','8790', 'Emplacements foires et expositions', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8794,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6234','8790', 'Cadeaux à la clientèle', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8795,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6235','8790', 'Primes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8796,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6236','8790', 'Catalogues et imprimés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8797,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6237','8790', 'Publications', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8798,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6238','8790', 'Divers (pourboire, dons courants, etc)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8799,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '624','8777', 'Transports de biens et transports collectifs du personnel', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8800,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6241','8799', 'Transports sur achats', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8801,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6242','8799', 'Transports sur ventes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8802,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6243','8799', 'Transports entre établissements ou chantiers', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8803,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6244','8799', 'Transports administratifs', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8804,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6247','8799', 'Transports collectifs du personnel', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8805,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6248','8799', 'Autres transports', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8806,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '625','8777', 'Déplacements, missions et réceptions', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8807,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6251','8806', 'Voyages et déplacements', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8808,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6255','8806', 'Frais de déménagement', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8809,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6256','8806', 'Missions', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8810,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6257','8806', 'Réceptions', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8811,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '626','8777', 'Frais postaux et de télécommunications', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8812,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '627','8777', 'Services bancaires et assimilés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8813,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6271','8812', '"Frais sur titres (achat, vente, garde)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8814,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6272','8812', 'Commissions et frais sur émission d''emprunts', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8815,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6275','8812', 'Frais sur effets (commissions d''endos…)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8816,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6276','8812', 'Location de coffres', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8817,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6278','8812', 'Autres frais et commissions sur prestations de services', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8818,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '628','8777', 'Divers', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8819,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6281','8818', 'Cotisations professionnelles (productions animales)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8820,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6284','8818', 'Cotisations professionnelles (productions végétales)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8821,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6286','8818', 'Autres cotisations professionnelles', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8822,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6287','8818', 'Frais de recrutement de personnel', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8823,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6288','8818', 'Autres services extérieurs divers', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8824,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '629','8777', 'Rabais, remises et ristournes obtenus sur autres services extérieurs', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8825,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '63','8681', 'Impôts, taxes et versements assimilés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8826,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '631','8825', 'Impôts, taxes et versements assimilés sur rémunérations (administrations des impôts)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8827,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6311','8826', 'Taxe sur les salaires', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8828,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6312','8826', 'Taxe d''apprentissage', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8829,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6313','8826', 'Participation des employeurs à la formation professionnelle continue', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8830,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6314','8826', 'Cotisation pour défaut d''investissement obligatoire dans la construction', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8831,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6318','8826', 'Autres', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8832,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '633','8825', 'Impôts, taxes et versements assimilés sur rémunérations (autres organismes)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8833,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6331','8832', 'Versement de transport', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8834,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6332','8832', 'Allocations logement', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8835,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6333','8832', 'Participation des employeurs à la formation professionnelle continue', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8836,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6334','8832', 'Participation des employeurs à l''effort de construction', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8837,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6335','8832', 'Versements libératoires ouvrant droit à l''exonération de la taxe d''apprentissage', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8838,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6338','8832', 'Autres', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8839,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '634','8825', 'Taxes spécifiques sur les produits de l''exploitation', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8840,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6341','8839', 'Taxes spécifiques sur les produits végétaux', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8841,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6342','8839', 'Taxes spécifiques sur les produits animaux', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8842,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6343','8839', 'Taxes spécifiques sur les produits transformés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8843,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6344','8839', 'Taxes spécifiques sur les animaux', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8844,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6345','8839', 'Pénalités sur productions', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8845,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6348','8839', 'Taxes spécifiques sur autres produits', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8846,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '635','8825', 'Autres impôts, taxes et versements assimilés (administrations des impôts)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8847,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6351','8846', 'Taxe professionnelle', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8848,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6352','8846', 'Taxes foncières', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8849,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6353','8846', 'Autres impôts locaux', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8850,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6354','8846', 'Autres impôts directs (sauf impôts sur les sociétés)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8851,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6355','8846', 'Taxe sur le chiffre d''affaires non récupérables', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8852,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6356','8846', 'Impôts indirects', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8853,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6357','8846', 'Droits d''enregistrement et de timbre', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8854,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6358','8846', 'Autres droits', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8855,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '637','8825', '"Autres impôts, taxes et versements assimilés (autres organismes)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8856,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6371','8855', 'Contribution sociale de solidarité à la charge des sociétés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8857,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6372','8855', 'Taxes perçues par les organismes publics internationaux', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8858,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6374','8855', 'Impôts et taxes exigibles à l''étranger', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8859,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6378','8855', 'Taxes diverses', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8860,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '64','8681', 'Charges de personnel', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8861,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '641','8860', 'Rémunérations du personnel', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8862,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6411','8861', 'Salaires (personnel salarié)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8863,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '64111','8862', 'Personnel permanent ou régulier', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8864,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '64115','8862', 'Personnel temporaire ou occasionnel', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8865,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6412','8861', 'Rémunérations (associés d''exploitation)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8866,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6413','8861', '"Rémunérations (administrateurs, gérants, associés)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8867,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6415','8861', 'Congés payés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8868,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6416','8861', 'Primes et gratifications', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8869,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6417','8861', 'Indemnités et avantages en espèces divers', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8870,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6418','8861', 'Avantages en nature', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8871,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '644','8860', 'Rémunération du travail de l''exploitant', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8872,'PCGAFR14-DEV','EXPENSE', 'SOCIAL', '645','8860', 'Charges de sécurité sociale et de prévoyance', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8873,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6451','8872', 'Cotisations à la Mutualité Sociale Agricole', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8874,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6452','8872', 'Cotisations aux mutuelles', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8875,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6453','8872', 'Cotisations aux caisses de retraites', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8876,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6454','8872', 'Cotisations aux caisses de chômages', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8877,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6458','8872', 'Cotisations aux autres organismes sociaux', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8878,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '646','8860', 'Cotisations sociales personnelles de l''exploitant', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8879,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '647','8860', 'Autres charges sociales', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8880,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6472','8879', 'Versements aux comités d''entreprise et d''établissement', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8881,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6474','8879', 'Versements aux autres œuvres sociales', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8882,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6475','8879', 'Médecine du travail, pharmacie', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8883,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6478','8879', 'Autres charges sociales diverses', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8884,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '648','8860', 'Autres charges de personnel', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8885,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '65','8681', 'Autres charges de gestion courante', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8886,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '651','8885', 'Redevances pour concessions, brevets, licences, marques, procédés, logiciels, droits et valeurs similaires', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8887,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '653','8885', 'Jetons de présence', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8888,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '654','8885', 'Pertes sur créances irrécouvrables', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8889,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6541','8888', 'Créances de l''exercice', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8890,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6544','8888', 'Créances des exercices antérieurs', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8891,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '655','8885', 'Quotes-parts de résultat sur opérations faites en commun', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8892,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6551','8891', 'Quote-part de bénéfice transférée (comptabilité du gérant)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8893,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6555','8891', 'Quote-part de perte supportée (comptabilité des associés non gérants)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8894,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '656','8885', 'Valeurs comptables des éléments d''actif cédés (cessions courantes)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8895,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6561','8894', 'Animaux reproducteurs adultes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8896,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6562','8894', 'Animaux reproducteurs (jeunes de renouvellement)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8897,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '658','8885', 'Charges diverses de gestion courante', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8898,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '66','8681', 'Charges financières', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8899,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '661','8898', 'Charges d''intérêts', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8900,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6611','8899', 'Intérêts des emprunts fonciers', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8901,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6612','8899', 'Intérêts des autres emprunts à moyen et long terme', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8902,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6613','8899', 'Intérêts des emprunts à court terme', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8903,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6614','8899', 'Intérêts des crédits bancaires de campagne', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8904,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6615','8899', 'Intérêts des dettes rattachées à des participations à des organismes professionnels agricoles (autres que les établissements de crédit)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8905,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6616','8899', 'Intérêts des dettes rattachées à d''autres participations', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8906,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6617','8899', 'Intérêts du crédit fournisseur', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8907,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6618','8899', 'Autres charges d''intérêt', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8908,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '66181','8907', 'Autres intérêts bancaires', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8909,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '66182','8907', 'Intérêts des comptes courants et dépôts créditeurs', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8910,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '66183','8907', 'Intérêts des obligations cautionnées', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8911,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '66188','8907', 'Intérêts des autres dettes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8912,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '664','8898', 'Pertes sur créances liées à des participations', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8913,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '665','8898', 'Escomptes accordés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8914,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '666','8898', 'Pertes de change', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8915,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '667','8898', 'Charges nettes sur cessions de valeurs mobilières de placement', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8916,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '668','8898', 'Autres charges financières', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8917,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '67','8681', 'Charges exceptionnelles', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8918,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '671','8917', 'Charges exceptionnelles sur opérations de gestion', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8919,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6711','8918', 'Pénalités sur marchés (et dédits payés sur achats et ventes)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8920,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6712','8918', 'Pénalités, amendes fiscales et pénales', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8921,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6713','8918', 'Dons, libéralités', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8922,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6714','8918', 'Créances devenues irrécouvrables dans l''exercice', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8923,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6715','8918', 'Subventions accordées', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8924,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6717','8918', 'Rappel d''impôts (autres qu''impôts sur les bénéfices)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8925,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6718','8918', 'Autres charges exceptionnelles sur opérations de gestion', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8926,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '672','8917', 'Charges sur exercices antérieurs', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8927,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '673','8917', 'Charges exeptionnelles relatives aux pénalités statutaires', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8928,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6731','8927', 'Indemnités compensatrices', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8929,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6733','8927', 'Pénalités subies en tant qu''associé défaillant', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8930,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6735','8927', 'Frais de poursuite', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8931,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '675','8917', 'Valeurs comptables des éléments d''actif cédés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8932,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6751','8931', 'Immobilisations incorporelles', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8933,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6752','8931', 'Immobilisations corporelles (hors biens vivants)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8934,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6754','8931', 'Immobilisations corporelles (biens vivants)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8935,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6756','8931', 'Immobilisations financières', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8936,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '678','8917', 'Autres charges exceptionnelles', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8937,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6781','8936', 'Malis provenant de clauses d''indexation', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8938,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6782','8936', 'Lots', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8939,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6783','8936', 'Malis provenant du rachat par l''entreprise d''actions et obligations émises par elle-même', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8940,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6788','8936', 'Charges exceptionnelles diverses', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8941,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '68','8681', 'Dotations aux amortissements, aux dépréciations et aux provisions', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8942,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '681','8941', 'Dotations aux amortissements, aux dépréciations et aux provisions - Charges d''exploitation', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8943,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6811','8942', 'Dotations aux amortissements sur immobilisations incorporelles et corporelles', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8944,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '68111','8943', 'Immobilisations incorporelles', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8945,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '68112','8943', 'Immobilisations corporelles (hors biens vivants)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8946,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '68114','8943', 'Immobilisations corporelles (biens vivants)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8947,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6812','8942', 'Dotations aux amortissements des charges d''exploitation à répartir', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8948,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6815','8942', 'Dotations aux provisions d''exploitation', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8949,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6816','8942', 'Dotations pour dépréciations des immobilisations incorporelles et corporelles', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8950,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '68161','8949', 'Immobilisations incorporelles', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8951,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '68162','8949', 'Immobilisations corporelles (hors biens vivants)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8952,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '68164','8949', 'Immobilisations corporelles (biens vivants)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8953,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6817','8942', 'Dotations pour dépréciations des actifs circulants', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8954,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '68173','8953', 'Stocks et en-cours', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8955,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '68174','8953', 'Créances', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8956,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '686','8941', 'Dotations aux amortissements, aux dépréciations et aux provisions - Charges financières', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8957,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6861','8956', 'Dotations aux amortissements des primes de remboursement des obligations', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8958,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6865','8956', 'Dotations aux provisions financières', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8959,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6866','8956', 'Dotations pour dépréciations des éléments financiers', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8960,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '68662','8959', 'Immobilisations financières', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8961,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '68665','8959', 'Valeurs mobilières de placement', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8962,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6868','8956', 'Autres dotations', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8963,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '687','8941', '"Dotations aux amortissements, aux dépréciations et aux provisions - Charges exceptionnelles', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8964,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6871','8963', 'Dotations aux amortissements exceptionnels des immobilisations', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8965,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6872','8963', 'Dotations aux provisions réglementées (immobilisations)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8966,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '68725','8965', 'Amortissements dérogatoires', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8967,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6873','8963', 'Dotations aux provisions réglementées (stocks)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8968,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6874','8963', 'Dotations aux autres provisions réglementées', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8969,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6875','8963', 'Dotations aux provisions exceptionnelles', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8970,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6876','8963', 'Dotations pour dépréciations exceptionnelles', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8971,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '69','8681', 'Participation des salariés - Impôts sur les bénéfices et assimilés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8972,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '691','8971', 'Participation des salariés aux résultats', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8973,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '695','8971', 'Impôts sur les bénéfices', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8974,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6951','8973', 'Impôts dus en France', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8975,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6954','8973', 'Impôts dus à l''étranger', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8976,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '697','8971', 'Imposition forfaitaire annuelle des sociétés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8977,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '698','8971', 'Intégration fiscale', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8978,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6981','8977', 'Intégration fiscale - Charges', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8979,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6982','8977', 'Intégration fiscale - Produits', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8980,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '699','8971', 'Produits - Reports en arrière des déficits', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8981,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7', '0', 'Comptes de produits', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8982,'PCGAFR14-DEV','INCOME', 'XXXXXX', '70','8981', 'Ventes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8983,'PCGAFR14-DEV','INCOME', 'PRODUCT', '701','8982', 'Ventes de produits végétaux', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8984,'PCGAFR14-DEV','INCOME', 'XXXXXX', '702','8982', 'Ventes de produits animaux', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8985,'PCGAFR14-DEV','INCOME', 'XXXXXX', '703','8982', 'Ventes de produits transformés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8986,'PCGAFR14-DEV','INCOME', 'XXXXXX', '704','8982', 'Ventes d''animaux', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8987,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7041','8986', 'Animaux reproducteurs (adultes)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8988,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7042','8986', 'Animaux reproducteurs (jeunes de renouvellement)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8989,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7045','8986', 'Autres animaux', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8990,'PCGAFR14-DEV','INCOME', 'XXXXXX', '705','8982', 'Ventes de produits résiduels', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8991,'PCGAFR14-DEV','INCOME', 'SERVICE', '706','8982', 'Travaux à façon', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8992,'PCGAFR14-DEV','INCOME', 'PRODUCT', '707','8982', 'Ventes de marchandises', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8993,'PCGAFR14-DEV','INCOME', 'XXXXXX', '708','8982', 'Produits des activités annexes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8994,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7081','8993', 'Produits des services exploités dans l''intérêt du personnel', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8995,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7082','8993', 'Commissions et courtages', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8996,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7083','8993', 'Locations diverses', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8997,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7084','8993', 'Prestations de services à caractère accessoire', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8998,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7085','8993', 'Ports et frais accessoires facturés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8999,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7086','8993', 'Bonis sur reprises d''emballages consignés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9000,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7087','8993', 'Bonifications obtenues des clients et primes sur ventes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9001,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7088','8993', 'Autres produits d''activités annexes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9002,'PCGAFR14-DEV','INCOME', 'XXXXXX', '709','8982', 'Rabais, remises et ristournes accordés par l''entreprise', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9003,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7091','9002', 'RRR sur ventes de produits végétaux', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9004,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7092','9002', 'RRR sur ventes de produits animaux', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9005,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7093','9002', 'RRR sur ventes de produits transformés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9006,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7094','9002', 'RRR sur ventes d''animaux', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9007,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7095','9002', 'RRR sur ventes de produits résiduels', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9008,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7096','9002', 'RRR sur travaux à façon', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9009,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7097','9002', 'RRR sur ventes de marchandises', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9010,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7098','9002', 'RRR sur produits des activités annexes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9011,'PCGAFR14-DEV','INCOME', 'XXXXXX', '71','8981', 'Variation d''inventaire (biens vivants, en-cours de production de biens et services, produits)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9012,'PCGAFR14-DEV','INCOME', 'XXXXXX', '712','9011', 'Variation d''inventaire : animaux reproducteurs immobilisés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9013,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7121','9012', 'Animaux reproducteurs (adultes)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9014,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7122','9012', 'Animaux reproducteurs (jeunes de renouvellement)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9015,'PCGAFR14-DEV','INCOME', 'XXXXXX', '713','9011', 'Variation d''inventaire : biens vivants non immobilisés, en-cours de production de biens et services, produits', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9016,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7131','9015', 'Animaux (cycle long)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9017,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7132','9015', 'Animaux (cycle court)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9018,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7133','9015', 'Végétaux en terre (cycle long)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9019,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7134','9015', 'Végétaux en terre (cycle court)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9020,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7135','9015', 'En-cours de production de biens et services (cycle long)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9021,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7136','9015', 'En-cours de production de biens et services (cycle court)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9022,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7137','9015', 'Produits', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9023,'PCGAFR14-DEV','INCOME', 'XXXXXX', '72','8981', 'Production immobilisée et autoconsommée', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9024,'PCGAFR14-DEV','INCOME', 'XXXXXX', '721','9023', 'Production immobilisée - Immobilisations incorporelles', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9025,'PCGAFR14-DEV','INCOME', 'XXXXXX', '722','9023', 'Production immobilisée - Immobilisations corporelles (hors biens vivants)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9026,'PCGAFR14-DEV','INCOME', 'XXXXXX', '724','9023', 'Production immobilisée - Immobilisations corporelles (biens vivants)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9027,'PCGAFR14-DEV','INCOME', 'XXXXXX', '726','9023', 'Production autoconsommée', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9028,'PCGAFR14-DEV','INCOME', 'XXXXXX', '74','8981', 'Indemnités et Subventions d''exploitation', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9029,'PCGAFR14-DEV','INCOME', 'XXXXXX', '741','9028', 'Remboursement forfaitaire de TVA', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9030,'PCGAFR14-DEV','INCOME', 'XXXXXX', '742','9028', 'Indemnités d''assurance (exploitation)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9031,'PCGAFR14-DEV','INCOME', 'XXXXXX', '743','9028', 'Indemnités du Fond national de garantie des calamités agricoles', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9032,'PCGAFR14-DEV','INCOME', 'XXXXXX', '744','9028', 'Autres indemnités d''exploitation', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9033,'PCGAFR14-DEV','INCOME', 'XXXXXX', '745','9028', 'Subventions d''exploitation', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9034,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7451','9033', 'Subventions aux produits végétaux', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9035,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7452','9033', 'Subventions aux structures (et jachères)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9036,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7453','9033', 'Subventions au revenu', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9037,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7454','9033', 'Subventions aux animaux', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9038,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7458','9033', 'Autres subventions d''exploitation', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9039,'PCGAFR14-DEV','INCOME', 'XXXXXX', '75','8981', 'Autres produits de gestion courante', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9040,'PCGAFR14-DEV','INCOME', 'XXXXXX', '751','9039', 'Redevances pour concessions, brevets, licences, marques, procédés, logiciels, droits et valeurs similaires', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9041,'PCGAFR14-DEV','INCOME', 'XXXXXX', '752','9039', 'Revenus des immeubles non affectés à des activités professionnelles', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9042,'PCGAFR14-DEV','INCOME', 'XXXXXX', '753','9039', 'Jetons de présence, rémunérations et indemnités d''administrateurs, etc', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9043,'PCGAFR14-DEV','INCOME', 'XXXXXX', '754','9039', 'Ristournes perçues des coopératives agricoles (provenant des excédents)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9044,'PCGAFR14-DEV','INCOME', 'XXXXXX', '755','9039', 'Quote-parts de résultat sur opérations faites en commun', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9045,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7551','9044', 'Quote-part de perte transférée (comptabilité du gérant)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9046,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7555','9044', 'Quote-part de bénéfice attribuée (comptabilité des associés non - gérants)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9047,'PCGAFR14-DEV','INCOME', 'XXXXXX', '756','9039', 'Produits des cessions courantes d''éléments d''actif', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9048,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7561','9047', 'Animaux reproducteurs adultes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9049,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7562','9047', 'Animaux reproducteurs (jeunes de renouvellement)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9050,'PCGAFR14-DEV','INCOME', 'XXXXXX', '758','9039', 'Produits divers de gestion courante', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9051,'PCGAFR14-DEV','INCOME', 'XXXXXX', '76','8981', 'Produits financiers', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9052,'PCGAFR14-DEV','INCOME', 'XXXXXX', '761','9051', 'Produits de participations', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9053,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7611','9052', 'Revenus des titres de participation', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9054,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7612','9052', 'Revenus des participations à des organismes professionnels agricoles', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9055,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7616','9052', 'Revenus sur autres formes de participation', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9056,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7617','9052', 'Revenus des créances rattachées à des participations', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9057,'PCGAFR14-DEV','INCOME', 'XXXXXX', '762','9051', 'Produits des autres immobilisations financières', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9058,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7621','9057', 'Revenus des titres immobilisés', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9059,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7626','9057', 'Revenus des prêts', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9060,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7627','9057', 'Revenus des créances immobilisées', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9061,'PCGAFR14-DEV','INCOME', 'XXXXXX', '763','9051', 'Revenus des autres créances', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9062,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7631','9061', 'Revenus des créances commerciales', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9063,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7638','9061', 'Revenus des créances diverses', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9064,'PCGAFR14-DEV','INCOME', 'XXXXXX', '764','9051', 'Revenus des valeurs mobilières de placement', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9065,'PCGAFR14-DEV','INCOME', 'XXXXXX', '765','9051', 'Escomptes obtenus', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9066,'PCGAFR14-DEV','INCOME', 'XXXXXX', '766','9051', 'Gains de change', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9067,'PCGAFR14-DEV','INCOME', 'XXXXXX', '767','9051', 'Produits nets sur cessions de valeurs mobilières de placement', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9068,'PCGAFR14-DEV','INCOME', 'XXXXXX', '768','9051', 'Autres produits financiers', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9069,'PCGAFR14-DEV','INCOME', 'XXXXXX', '77','8981', 'Produits exceptionnels', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9070,'PCGAFR14-DEV','INCOME', 'XXXXXX', '771','9069', 'Produits exceptionnels sur opérations de gestion', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9071,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7711','9070', 'Dédits et pénalités perçus sur achats et sur ventes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9072,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7713','9070', 'Libéralités reçues', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9073,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7714','9070', 'Rentrées sur créances amorties', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9074,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7715','9070', 'Subventions d''équilibre', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9075,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7717','9070', 'Dégrèvements d''impôts (autres qu''impôts sur les bénéfices)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9076,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7718','9070', 'Autres produits exceptionnels sur opérations de gestion', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9077,'PCGAFR14-DEV','INCOME', 'XXXXXX', '772','9069', 'Produits sur exercices antérieurs', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9078,'PCGAFR14-DEV','INCOME', 'XXXXXX', '775','9069', 'Produits des cessions d''éléments d''actif', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9079,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7751','9078', 'Immobilisations incorporelles', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9080,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7752','9078', 'Immobilisations corporelles (hors biens vivants)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9081,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7754','9078', 'Immobilisations corporelles (biens vivants)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9082,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7756','9078', 'Immobilisations financières', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9083,'PCGAFR14-DEV','INCOME', 'XXXXXX', '777','9069', 'Quote-part des subventions d''investissement virée au résultat de l''exercice', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9084,'PCGAFR14-DEV','INCOME', 'XXXXXX', '778','9069', 'Autres produits exceptionnels', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9085,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7781','9084', 'Bonis provenant de clauses d''indexation', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9086,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7782','9084', 'Lots', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9087,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7783','9084', 'Bonis provenant du rachat par l''entreprise de titres émis par elle - même', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9088,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7788','9084', 'Produits exceptionnels divers', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9089,'PCGAFR14-DEV','INCOME', 'XXXXXX', '78','8981', 'Reprises sur amortissements, dépréciations et provisions', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9090,'PCGAFR14-DEV','INCOME', 'XXXXXX', '781','9089', 'Reprises sur amortissements, dépréciations et provisions (à inscrire dans les produits d''exploitation)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9091,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7811','9090', 'Reprises sur amortissements des immobilisations incorporelles et corporelles', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9092,'PCGAFR14-DEV','INCOME', 'XXXXXX', '78111','9091', 'Immobilisations incorporelles', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9093,'PCGAFR14-DEV','INCOME', 'XXXXXX', '78112','9091', 'Immobilisations corporelles (hors biens vivants)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9094,'PCGAFR14-DEV','INCOME', 'XXXXXX', '78114','9091', 'Immobilisations corporelles (biens vivants)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9095,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7815','9090', 'Reprises sur provisions d''exploitation', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9096,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7816','9090', 'Reprises sur dépréciations des immobilisations incorporelles et corporelles', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9097,'PCGAFR14-DEV','INCOME', 'XXXXXX', '78161','9096', 'Immobilisations incorporelles', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9098,'PCGAFR14-DEV','INCOME', 'XXXXXX', '78162','9096', 'Immobilisations corporelles (hors biens vivants)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9099,'PCGAFR14-DEV','INCOME', 'XXXXXX', '78164','9096', 'Immobilisations corporelles (biens vivants)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9100,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7817','9090', 'Reprises sur dépréciations des actifs circulants', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9101,'PCGAFR14-DEV','INCOME', 'XXXXXX', '78173','9100', 'Stocks et en-cours', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9102,'PCGAFR14-DEV','INCOME', 'XXXXXX', '78174','9100', 'Créances', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9103,'PCGAFR14-DEV','INCOME', 'XXXXXX', '786','9089', 'Reprises sur dépréciations et sur provisions (à inscrire dans les produits financiers)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9104,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7865','9103', 'Reprises sur provisions financières', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9105,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7866','9103', 'Reprises sur dépréciations des éléments financiers', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9106,'PCGAFR14-DEV','INCOME', 'XXXXXX', '78662','9105', 'Immobilisations financières', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9107,'PCGAFR14-DEV','INCOME', 'XXXXXX', '78665','9105', 'Valeurs mobilières de placements', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9108,'PCGAFR14-DEV','INCOME', 'XXXXXX', '787','9089', 'Reprises sur dépréciations et sur provisions (à inscrire dans les produits exceptionnels)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9109,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7872','9108', 'Reprises sur provisions réglementées (immobilisations)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9110,'PCGAFR14-DEV','INCOME', 'XXXXXX', '78725','9109', 'Amortissements dérogatoires', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9111,'PCGAFR14-DEV','INCOME', 'XXXXXX', '78726','9109', 'Provision spéciale de réévaluation', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9112,'PCGAFR14-DEV','INCOME', 'XXXXXX', '78727','9109', 'Plus-values réinvesties', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9113,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7873','9108', 'Reprises sur provisions réglementées (stocks)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9114,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7874','9108', 'Reprises sur autres provisions réglementées', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9115,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7875','9108', 'Reprises sur provisions exceptionnelles', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9116,'PCGAFR14-DEV','INCOME', 'XXXXXX', '7876','9108', 'Reprises sur dépréciations exceptionnelles', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9117,'PCGAFR14-DEV','INCOME', 'XXXXXX', '79','8981', 'Transferts de charges', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9118,'PCGAFR14-DEV','INCOME', 'XXXXXX', '791','9117', 'Transferts de charges d''exploitation', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9119,'PCGAFR14-DEV','INCOME', 'XXXXXX', '796','9117', 'Transferts de charges financières', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 9120,'PCGAFR14-DEV','INCOME', 'XXXXXX', '797','9117', 'Transferts de charges exceptionnelles', 1); \ No newline at end of file diff --git a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql index d13e4a19d00..246baaadc04 100644 --- a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql +++ b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql @@ -139,6 +139,8 @@ UPDATE llx_c_country SET eec = 1 WHERE code IN ('AT','BE','BG','CY','CZ','DE','D INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 1, 'PCG18-ASSOC', 'French foundation chart of accounts 2018', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 1, 'PCGAFR14-DEV', 'The developed farm accountancy french plan 2014', 1); + INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 41, 'AT-BASE', 'Plan Austria', 1); From 45711bb43c80de50a8e78aa18a01fac90edfbdf8 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 10 Feb 2020 05:39:49 +0100 Subject: [PATCH 186/306] typo --- htdocs/install/mysql/data/llx_accounting_account_fr.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/install/mysql/data/llx_accounting_account_fr.sql b/htdocs/install/mysql/data/llx_accounting_account_fr.sql index a0aa01015e3..52c3714e896 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_fr.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_fr.sql @@ -1727,10 +1727,10 @@ INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8119,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1688','8115', 'Intérêts courus', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8120,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '16881','8119', 'sur emprunts obligataires convertibles', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8121,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '16883','8119', 'sur autres emprunts obligataires', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8122,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '16684','8119', 'sur emprunts auprès des établissements de crédit', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8123,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '166841','8122', 'Intérêts courus sur emprunts fonciers', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8124,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '166842','8122', 'Intérêts courus sur autres emprunts MLT', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8125,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '166843','8122', 'Intérêts courus sur emprunts court terme', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8122,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '16884','8119', 'sur emprunts auprès des établissements de crédit', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8123,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '168841','8122', 'Intérêts courus sur emprunts fonciers', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8124,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '168842','8122', 'Intérêts courus sur autres emprunts MLT', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8125,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '168843','8122', 'Intérêts courus sur emprunts court terme', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8126,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '16885','8119', 'sur dépôts et cautionnements reçus', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8127,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '16886','8119', 'sur participation des salariés aux résultats', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8128,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '16887','8119', 'sur emprunts et dettes assortis de conditions particulières', 1); From d28f1101006a77de9f3a2c02c77bf868a2268715 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 10 Feb 2020 06:06:27 +0100 Subject: [PATCH 187/306] NEW: Add accountancy code of thirdparty in contact export --- htdocs/core/modules/modSociete.class.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index 2cc525bd8aa..86b3dfd378a 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -336,6 +336,7 @@ class modSociete extends DolibarrModules 'd.nom'=>'State','co.label'=>"Country",'co.code'=>"CountryCode",'c.phone'=>"Phone",'c.fax'=>"Fax",'c.phone_mobile'=>"Mobile",'c.email'=>"EMail", 'c.statut'=>"Status", 's.rowid'=>"IdCompany",'s.nom'=>"CompanyName",'s.status'=>"Status",'s.code_client'=>"CustomerCode",'s.code_fournisseur'=>"SupplierCode", + 's.code_compta'=>"AccountancyCode",'s.code_compta_fournisseur'=>"SupplierAccountancyCode", 's.client'=>'Customer','s.fournisseur'=>'Supplier', 's.address'=>'Address','s.zip'=>"Zip",'s.town'=>"Town",'s.phone'=>'Phone','s.email'=>"Email", 't.libelle'=>"ThirdPartyType" @@ -347,13 +348,15 @@ class modSociete extends DolibarrModules 'c.fax'=>"Text",'c.email'=>"Text", 'c.statut'=>"Status", 's.rowid'=>"List:societe:nom::thirdparty",'s.nom'=>"Text",'s.status'=>"Status",'s.code_client'=>"Text",'s.code_fournisseur'=>"Text", + 's.code_compta'=>"Text",'s.code_compta_fournisseur'=>"Text", 's.client'=>"Text",'s.fournisseur'=>"Text", 's.address'=>"Text",'s.zip'=>"Text",'s.town'=>"Text",'s.phone'=>"Text",'s.email'=>"Text", 't.libelle'=>"Text" ); $this->export_entities_array[$r]=array( - 's.rowid'=>"company",'s.nom'=>"company", 's.status'=>'company', 's.code_client'=>"company",'s.code_fournisseur'=>"company", 's.client'=>"company", - 's.fournisseur'=>"company", + 's.rowid'=>"company",'s.nom'=>"company", 's.status'=>'company', 's.code_client'=>"company",'s.code_fournisseur'=>"company", + 's.code_compta'=>"company",'s.code_compta_fournisseur'=>"company", + 's.client'=>"company", 's.fournisseur'=>"company", 's.address'=>"company", 's.zip'=>"company", 's.town'=>"company", 's.phone'=>"company", 's.email'=>"company", 't.libelle'=>"company" ); // We define here only fields that use another picto From 20f9154cf342fda8a7225404c7fa99b5c31db4c4 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 10 Feb 2020 06:24:13 +0100 Subject: [PATCH 188/306] NEW: Add accountancy code of thirdparty in supplier export --- htdocs/core/modules/modFournisseur.class.php | 27 +++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php index 2042e8b35da..1bcd9b9aa63 100644 --- a/htdocs/core/modules/modFournisseur.class.php +++ b/htdocs/core/modules/modFournisseur.class.php @@ -289,7 +289,8 @@ class modFournisseur extends DolibarrModules $this->export_permission[$r]=array(array("fournisseur","facture","export")); $this->export_fields_array[$r]=array( 's.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.phone'=>'Phone', - 's.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.idprof5'=>'ProfId5','s.idprof6'=>'ProfId6','s.tva_intra'=>'VATIntra', + 's.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.idprof5'=>'ProfId5','s.idprof6'=>'ProfId6', + 's.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra', 'f.rowid'=>"InvoiceId",'f.ref'=>"InvoiceRef",'f.ref_supplier'=>"RefSupplier",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.date_lim_reglement'=>'DateMaxPayment', 'f.total_ht'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.total_tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note_public'=>"InvoiceNote", 'fd.rowid'=>'LineId','fd.description'=>"LineDescription",'fd.tva_tx'=>"LineVATRate",'fd.qty'=>"LineQty",'fd.remise_percent'=>"Discount",'fd.total_ht'=>"LineTotalHT", @@ -304,18 +305,18 @@ class modFournisseur extends DolibarrModules // 'fd.tva'=>"Numeric",'fd.product_type'=>'Numeric','fd.fk_product'=>'List:product:label','p.ref'=>'Text','p.label'=>'Text' //); $this->export_TypeFields_array[$r]=array( - 's.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text', - 's.tva_intra'=>'Text','f.ref'=>"Text",'f.ref_supplier'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>'Date','f.total_ht'=>"Numeric",'f.total_ttc'=>"Numeric", - 'f.total_tva'=>"Numeric",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_public'=>"Text",'fd.description'=>"Text",'fd.tva_tx'=>"Text",'fd.qty'=>"Numeric",'fd.total_ht'=>"Numeric", - 'fd.total_ttc'=>"Numeric",'fd.tva'=>"Numeric",'fd.product_type'=>'Numeric','fd.fk_product'=>'List:product:label', + 's.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.idprof5'=>'Text','s.idprof6'=>'Text', + 's.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.ref'=>"Text",'f.ref_supplier'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>'Date', + 'f.total_ht'=>"Numeric",'f.total_ttc'=>"Numeric",'f.total_tva'=>"Numeric",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_public'=>"Text",'fd.description'=>"Text",'fd.tva_tx'=>"Text", + 'fd.qty'=>"Numeric",'fd.total_ht'=>"Numeric",'fd.total_ttc'=>"Numeric",'fd.tva'=>"Numeric",'fd.product_type'=>'Numeric','fd.fk_product'=>'List:product:label', 'p.ref'=>'Text','p.label'=>'Text','project.ref'=>'Text','project.title'=>'Text' ); $this->export_entities_array[$r]=array( 's.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company', - 's.ape'=>'company','s.idprof4'=>'company','s.idprof5'=>'company','s.idprof6'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.ref'=>"invoice",'f.ref_supplier'=>"invoice", - 'f.datec'=>"invoice",'f.datef'=>"invoice",'f.date_lim_reglement'=>'invoice','f.total_ht'=>"invoice",'f.total_ttc'=>"invoice",'f.total_tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice', - 'f.note_public'=>"invoice",'fd.rowid'=>'invoice_line','fd.description'=>"invoice_line",'fd.tva_tx'=>"invoice_line",'fd.qty'=>"invoice_line",'fd.remise_percent'=>"invoice_line", - 'fd.total_ht'=>"invoice_line",'fd.total_ttc'=>"invoice_line",'fd.tva'=>"invoice_line",'fd.product_type'=>'invoice_line','fd.fk_product'=>'product', + 's.ape'=>'company','s.idprof4'=>'company','s.idprof5'=>'company','s.idprof6'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice", + 'f.ref'=>"invoice",'f.ref_supplier'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.date_lim_reglement'=>'invoice','f.total_ht'=>"invoice",'f.total_ttc'=>"invoice",'f.total_tva'=>"invoice", + 'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note_public'=>"invoice",'fd.rowid'=>'invoice_line','fd.description'=>"invoice_line",'fd.tva_tx'=>"invoice_line",'fd.qty'=>"invoice_line", + 'fd.remise_percent'=>"invoice_line",'fd.total_ht'=>"invoice_line",'fd.total_ttc'=>"invoice_line",'fd.tva'=>"invoice_line",'fd.product_type'=>'invoice_line','fd.fk_product'=>'product', 'p.ref'=>'product','p.label'=>'product','p.accountancy_code_buy'=>'product','project.rowid'=>'project','project.ref'=>'project','project.title'=>'project' ); $this->export_dependencies_array[$r]=array('invoice_line'=>'fd.rowid','product'=>'fd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them @@ -415,7 +416,8 @@ class modFournisseur extends DolibarrModules $this->export_fields_array[$r]=array( 's.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.phone'=>'Phone', 's.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.idprof5'=>'ProfId5','s.idprof6'=>'ProfId6', - 's.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.ref'=>"InvoiceRef",'f.ref_supplier'=>"RefSupplier",'f.datec'=>"InvoiceDateCreation", + 's.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra', + 'f.rowid'=>"InvoiceId",'f.ref'=>"InvoiceRef",'f.ref_supplier'=>"RefSupplier",'f.datec'=>"InvoiceDateCreation", 'f.datef'=>"DateInvoice",'f.total_ht'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.total_tva'=>"TotalVAT",'f.paye'=>"InvoicePaid", 'f.fk_statut'=>'InvoiceStatus','f.note_public'=>"InvoiceNote",'p.rowid'=>'PaymentId','pf.amount'=>'AmountPayment', 'p.datep'=>'DatePayment','p.num_paiement'=>'PaymentNumber','project.rowid'=>'ProjectId','project.ref'=>'ProjectRef','project.title'=>'ProjectLabel' @@ -428,13 +430,14 @@ class modFournisseur extends DolibarrModules //); $this->export_TypeFields_array[$r]=array( 's.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text', - 's.idprof4'=>'Text','s.tva_intra'=>'Text','f.ref'=>"Text",'f.ref_supplier'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.total_ht'=>"Numeric", + 's.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.ref'=>"Text",'f.ref_supplier'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.total_ht'=>"Numeric", 'f.total_ttc'=>"Numeric",'f.total_tva'=>"Numeric",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_public'=>"Text",'pf.amount'=>'Numeric', 'p.datep'=>'Date','p.num_paiement'=>'Numeric','project.ref'=>'Text','project.title'=>'Text' ); $this->export_entities_array[$r]=array( 's.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'company','s.phone'=>'company', - 's.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.idprof5'=>'company','s.idprof6'=>'company','s.tva_intra'=>'company', + 's.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.idprof5'=>'company','s.idprof6'=>'company', + 's.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company', 'f.rowid'=>"invoice",'f.ref'=>"invoice",'f.ref_supplier'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.total_ht'=>"invoice", 'f.total_ttc'=>"invoice",'f.total_tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note_public'=>"invoice",'p.rowid'=>'payment','pf.amount'=>'payment', 'p.datep'=>'payment','p.num_paiement'=>'payment','project.rowid'=>'project','project.ref'=>'project','project.title'=>'project'); From 815206cb15d8881e80c8eb2aaba905e77950e92e Mon Sep 17 00:00:00 2001 From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Date: Mon, 10 Feb 2020 08:59:22 +0100 Subject: [PATCH 189/306] Add Project Title in header of pdf Add project Title if Global Constant PDF_SHOW_PROJECT_TITLE is active. --- .../core/modules/facture/doc/pdf_crabe.modules.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index ed99a04fcc2..597c612d6f1 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1634,6 +1634,18 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetTextColor(0, 0, 60); $pdf->MultiCell($w, 3, $outputlangs->transnoentities("RefCustomer")." : " . $outputlangs->convToOutputCharset($object->ref_client), '', 'R'); } + + if (! empty($conf->global->PDF_SHOW_PROJECT_TITLE)) + { + $object->fetch_projet(); + if (! empty($object->project->ref)) + { + $posy+=3; + $pdf->SetXY($posx,$posy); + $pdf->SetTextColor(0,0,60); + $pdf->MultiCell($w, 3, $outputlangs->transnoentities("Project")." : " . (empty($object->project->title)?'':$object->projet->title), '', 'R'); + } + } $objectidnext=$object->getIdReplacingInvoice('validated'); if ($object->type == 0 && $objectidnext) From 6ffbab0a6371dfcac38b3636745b561a08b66290 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 10 Feb 2020 08:01:40 +0000 Subject: [PATCH 190/306] Fixing style errors. --- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 597c612d6f1..6eb6bb939de 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1641,8 +1641,8 @@ class pdf_crabe extends ModelePDFFactures if (! empty($object->project->ref)) { $posy+=3; - $pdf->SetXY($posx,$posy); - $pdf->SetTextColor(0,0,60); + $pdf->SetXY($posx, $posy); + $pdf->SetTextColor(0, 0, 60); $pdf->MultiCell($w, 3, $outputlangs->transnoentities("Project")." : " . (empty($object->project->title)?'':$object->projet->title), '', 'R'); } } From bd008030900012a779b48d983e82b7f6b0b2d609 Mon Sep 17 00:00:00 2001 From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Date: Mon, 10 Feb 2020 09:03:00 +0100 Subject: [PATCH 191/306] Update pdf_crabe.modules.php --- .../core/modules/facture/doc/pdf_crabe.modules.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 6eb6bb939de..580689d3218 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1646,6 +1646,18 @@ class pdf_crabe extends ModelePDFFactures $pdf->MultiCell($w, 3, $outputlangs->transnoentities("Project")." : " . (empty($object->project->title)?'':$object->projet->title), '', 'R'); } } + + if (! empty($conf->global->PDF_SHOW_PROJECT)) + { + $object->fetch_projet(); + if (! empty($object->project->ref)) + { + $posy+=3; + $pdf->SetXY($posx,$posy); + $pdf->SetTextColor(0, 0, 60); + $pdf->MultiCell($w, 3, $outputlangs->transnoentities("ProjectRef")." : " . (empty($object->project->ref)?'':$object->projet->title), '', 'R'); + } + } $objectidnext=$object->getIdReplacingInvoice('validated'); if ($object->type == 0 && $objectidnext) From 5022e58b95fb9f19bb6d3febe17489eebd56b249 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 10 Feb 2020 08:04:40 +0000 Subject: [PATCH 192/306] Fixing style errors. --- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 580689d3218..9311361b745 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1653,7 +1653,7 @@ class pdf_crabe extends ModelePDFFactures if (! empty($object->project->ref)) { $posy+=3; - $pdf->SetXY($posx,$posy); + $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); $pdf->MultiCell($w, 3, $outputlangs->transnoentities("ProjectRef")." : " . (empty($object->project->ref)?'':$object->projet->title), '', 'R'); } From d74e1d9182b3542e435f054af67f4afb37e06e95 Mon Sep 17 00:00:00 2001 From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Date: Mon, 10 Feb 2020 09:07:26 +0100 Subject: [PATCH 193/306] Update pdf_crabe.modules.php --- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 9311361b745..e7d19d605f7 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1655,7 +1655,7 @@ class pdf_crabe extends ModelePDFFactures $posy+=3; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); - $pdf->MultiCell($w, 3, $outputlangs->transnoentities("ProjectRef")." : " . (empty($object->project->ref)?'':$object->projet->title), '', 'R'); + $pdf->MultiCell($w, 3, $outputlangs->transnoentities("ProjectRef")." : " . (empty($object->project->ref)?'':$object->projet->ref), '', 'R'); } } From 6de379564842d2a59d53dbae91555dfc3417611d Mon Sep 17 00:00:00 2001 From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Date: Mon, 10 Feb 2020 09:10:45 +0100 Subject: [PATCH 194/306] change translation Ref ProjectRef -> RefProject --- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index e7d19d605f7..297c202a57d 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1655,7 +1655,7 @@ class pdf_crabe extends ModelePDFFactures $posy+=3; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); - $pdf->MultiCell($w, 3, $outputlangs->transnoentities("ProjectRef")." : " . (empty($object->project->ref)?'':$object->projet->ref), '', 'R'); + $pdf->MultiCell($w, 3, $outputlangs->transnoentities("RefProject")." : " . (empty($object->project->ref)?'':$object->projet->ref), '', 'R'); } } From 5432ab3b05776eda842f3574331ec10451b5f710 Mon Sep 17 00:00:00 2001 From: AdrianDominik Date: Mon, 10 Feb 2020 11:18:59 +0100 Subject: [PATCH 195/306] FIX: #13018 Extrafields Supplier invoice --- htdocs/fourn/class/fournisseur.facture.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index b64bd1277c0..70b65d823ce 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -1953,7 +1953,7 @@ class FactureFournisseur extends CommonInvoice if (is_array($array_options) && count($array_options) > 0) { // We replace values in this->line->array_options only for entries defined into $array_options foreach($array_options as $key => $value) { - $this->line->array_options[$key] = $array_options[$key]; + $line->array_options[$key] = $array_options[$key]; } } From 342d55a7dbc186d3d4ca147b45d600790a16cb7c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 Feb 2020 11:50:37 +0100 Subject: [PATCH 196/306] Test --- htdocs/main.inc.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 89a9be45633..5a882fdf7ca 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1391,9 +1391,20 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr } else { - print ''."\n"; - print ''."\n"; - print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + /* Test for jflot 4.2 -> not better than current + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + */ } } // jQuery jeditable From 918e570e7a1bceb7b19d84d035a999e4e68c159e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 Feb 2020 12:56:08 +0100 Subject: [PATCH 197/306] FIX Picture of contact not visible in tooltip --- htdocs/contact/class/contact.class.php | 11 +++++++++-- htdocs/contact/list.php | 6 ++++-- htdocs/societe/class/societe.class.php | 2 +- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 465dc4a1e16..9c6602f7a2e 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -1272,9 +1272,16 @@ class Contact extends CommonObject { global $conf, $langs, $hookmanager; - $result = ''; + $result = ''; $label = ''; - $label = ''.$langs->trans("ShowContact").''; + if (!empty($this->photo) && class_exists('Form')) + { + $label .= '
'; + $label .= Form::showphoto('contact', $this, 0, 40, 0, '', 'mini', 0); // Important, we must force height so image will have height tags and if image is inside a tooltip, the tooltip manager can calculate height and position correctly the tooltip. + $label .= '
'; + } + + $label .= ''.$langs->trans("ShowContact").''; $label .= '
'.$langs->trans("Name").': '.$this->getFullName($langs); //if ($this->civility_id) $label.= '
' . $langs->trans("Civility") . ': '.$this->civility_id; // TODO Translate cibilty_id code if (!empty($this->poste)) $label .= '
'.$langs->trans("Poste").': '.$this->poste; diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 1d0c3839f4f..9903e37cd5e 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -290,7 +290,7 @@ $title = (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("C $sql = "SELECT s.rowid as socid, s.nom as name,"; $sql .= " p.rowid, p.lastname as lastname, p.statut, p.firstname, p.zip, p.town, p.poste, p.email, p.no_email,"; -$sql .= " p.socialnetworks,"; +$sql .= " p.socialnetworks, p.photo,"; $sql .= " p.phone as phone_pro, p.phone_mobile, p.phone_perso, p.fax, p.fk_pays, p.priv, p.datec as date_creation, p.tms as date_update,"; $sql .= " co.label as country, co.code as country_code"; // Add fields from extrafields @@ -786,7 +786,6 @@ while ($i < min($num, $limit)) { $obj = $db->fetch_object($result); - print ''; $arraysocialnetworks = (array) json_decode($obj->socialnetworks, true); $contactstatic->lastname = $obj->lastname; $contactstatic->firstname = ''; @@ -802,6 +801,9 @@ while ($i < min($num, $limit)) $contactstatic->socialnetworks = $arraysocialnetworks; $contactstatic->country = $obj->country; $contactstatic->country_code = $obj->country_code; + $contactstatic->photo = $obj->photo; + + print ''; // ID if (!empty($arrayfields['p.rowid']['checked'])) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 6f9b9ad26b8..2fa87eb8086 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2252,7 +2252,7 @@ class Societe extends CommonObject if (!empty($this->logo) && class_exists('Form')) { $label .= '
'; - $label .= Form::showphoto('societe', $this, 0, 40, 0, 'photowithmargin', 'mini', 0); // Important, we must force height so image will have height tags and if image is inside a tooltip, the tooltip manager can calculate height and position correctly the tooltip. + $label .= Form::showphoto('societe', $this, 0, 40, 0, '', 'mini', 0); // Important, we must force height so image will have height tags and if image is inside a tooltip, the tooltip manager can calculate height and position correctly the tooltip. $label .= '
'; } elseif (!empty($this->logo_squarred) && class_exists('Form')) From 8bce409db0333285920b0dd9618a41956e9811a6 Mon Sep 17 00:00:00 2001 From: simicar29 <53998265+simicar29@users.noreply.github.com> Date: Mon, 10 Feb 2020 13:14:42 +0100 Subject: [PATCH 198/306] Show extrafields only when enabled Show extrafields only in context where they are enabled (especially in edit mode that uses the showOptionals function). --- htdocs/core/class/commonobject.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index c7dbab57b31..299fe0c8817 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6624,7 +6624,12 @@ abstract class CommonObject if (is_array($params) && array_key_exists('onlykey', $params) && $key != $params['onlykey']) continue; // @todo Add test also on 'enabled' (different than 'list' that is 'visibility') - //$enabled = 1; + $enabled = 1; + if ($enabled && isset($extrafields->attributes[$this->table_element]['enabled'][$key])) + { + $enabled = dol_eval($extrafields->attributes[$this->table_element]['enabled'][$key], 1); + } + if (empty($enabled)) continue; $visibility = 1; if ($visibility && isset($extrafields->attributes[$this->table_element]['list'][$key])) From b9a8d82b2f15c3dfe8c3991a2fc5dc62b9ab5e71 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 Feb 2020 13:29:26 +0100 Subject: [PATCH 199/306] FIX Filter on list of events were lost after "Back to list" --- htdocs/comm/action/list.php | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 6df7aaa55ba..95a3e6dbe09 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -43,7 +43,7 @@ $action = GETPOST('action', 'alpha'); $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'actioncommlist'; // To manage different context of search $resourceid = GETPOST("search_resourceid", "int") ?GETPOST("search_resourceid", "int") : GETPOST("resourceid", "int"); $pid = GETPOST("search_projectid", 'int', 3) ?GETPOST("search_projectid", 'int', 3) : GETPOST("projectid", 'int', 3); -$status = (GETPOST("search_status", 'alpha') != '') ?GETPOST("search_status", 'alpha') : GETPOST("status", 'alpha'); +$search_status = (GETPOST("search_status", 'alpha') != '') ?GETPOST("search_status", 'alpha') : GETPOST("status", 'alpha'); $type = GETPOST('search_type', 'alphanohtml') ?GETPOST('search_type', 'alphanohtml') : GETPOST('type', 'alphanohtml'); $optioncss = GETPOST('optioncss', 'alpha'); $year = GETPOST("year", 'int'); @@ -67,8 +67,8 @@ $search_note = GETPOST('search_note', 'alpha'); $dateselect = dol_mktime(0, 0, 0, GETPOST('dateselectmonth', 'int'), GETPOST('dateselectday', 'int'), GETPOST('dateselectyear', 'int')); $datestart = dol_mktime(0, 0, 0, GETPOST('datestartmonth', 'int'), GETPOST('datestartday', 'int'), GETPOST('datestartyear', 'int')); $dateend = dol_mktime(0, 0, 0, GETPOST('dateendmonth', 'int'), GETPOST('dateendday', 'int'), GETPOST('dateendyear', 'int')); -if ($status == '' && !isset($_GET['status']) && !isset($_POST['status'])) $status = (empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_STATUS); -if (empty($action) && !isset($_GET['action']) && !isset($_POST['action'])) $action = (empty($conf->global->AGENDA_DEFAULT_VIEW) ? 'show_month' : $conf->global->AGENDA_DEFAULT_VIEW); +if ($search_status == '' && ! GETPOSTISSET('search_status')) $search_status = (empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_STATUS); +if (empty($action) && ! GETPOSTISSET('action')) $action = (empty($conf->global->AGENDA_DEFAULT_VIEW) ? 'show_month' : $conf->global->AGENDA_DEFAULT_VIEW); $filter = GETPOST("search_filter", 'alpha', 3) ?GETPOST("search_filter", 'alpha', 3) : GETPOST("filter", 'alpha', 3); $filtert = GETPOST("search_filtert", "int", 3) ?GETPOST("search_filtert", "int", 3) : GETPOST("filtert", "int", 3); @@ -100,12 +100,12 @@ $offset = $limit * $page; if (!$sortorder) { $sortorder = "DESC,DESC"; - if ($status == 'todo') $sortorder = "DESC,DESC"; + if ($search_status == 'todo') $sortorder = "DESC,DESC"; } if (!$sortfield) { $sortfield = "a.datep,a.id"; - if ($status == 'todo') $sortfield = "a.datep,a.id"; + if ($search_status == 'todo') $sortfield = "a.datep,a.id"; } // Security check @@ -184,7 +184,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' $search_note = ''; $datestart = ''; $dateend = ''; - $status = ''; + $search_status = ''; $search_array_options = array(); } @@ -218,7 +218,7 @@ if ($actioncode != '') { } else $param .= "&search_actioncode=".urlencode($actioncode); } if ($resourceid > 0) $param .= "&search_resourceid=".urlencode($resourceid); -if ($status != '' && $status > -1) $param .= "&search_status=".urlencode($status); +if ($search_status != '' && $search_status > -1) $param .= "&search_status=".urlencode($search_status); if ($filter) $param .= "&search_filter=".urlencode($filter); if ($filtert) $param .= "&search_filtert=".urlencode($filtert); if ($socid) $param .= "&search_socid=".urlencode($socid); @@ -309,12 +309,12 @@ if ($socid > 0) $sql .= " AND s.rowid = ".$socid; // We must filter on assignement table if ($filtert > 0 || $usergroup > 0) $sql .= " AND ar.fk_actioncomm = a.id AND ar.element_type='user'"; if ($type) $sql .= " AND c.id = ".(int) $type; -if ($status == '0') { $sql .= " AND a.percent = 0"; } -if ($status == '-1') { $sql .= " AND a.percent = -1"; } // Not applicable -if ($status == '50') { $sql .= " AND (a.percent > 0 AND a.percent < 100)"; } // Running already started -if ($status == '100') { $sql .= " AND a.percent = 100"; } -if ($status == 'done') { $sql .= " AND (a.percent = 100)"; } -if ($status == 'todo') { $sql .= " AND (a.percent >= 0 AND a.percent < 100)"; } +if ($search_status == '0') { $sql .= " AND a.percent = 0"; } +if ($search_status == '-1') { $sql .= " AND a.percent = -1"; } // Not applicable +if ($search_status == '50') { $sql .= " AND (a.percent > 0 AND a.percent < 100)"; } // Running already started +if ($search_status == '100') { $sql .= " AND a.percent = 100"; } +if ($search_status == 'done') { $sql .= " AND (a.percent = 100)"; } +if ($search_status == 'todo') { $sql .= " AND (a.percent >= 0 AND a.percent < 100)"; } if ($search_id) $sql .= natural_search("a.id", $search_id, 1); if ($search_title) $sql .= natural_search("a.label", $search_title); if ($search_note) $sql .= natural_search('a.note', $search_note); @@ -397,7 +397,7 @@ if ($resql) print $nav; dol_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action'); - print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, -1, $actioncode, $usergroup, '', $resourceid); + print_actions_filter($form, $canedit, $search_status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, -1, $actioncode, $usergroup, '', $resourceid); dol_fiche_end(); // Add link to show birthdays @@ -488,8 +488,8 @@ if ($resql) if (!empty($arrayfields['a.tms']['checked'])) print ''; if (!empty($arrayfields['a.percent']['checked'])) { print ''; - $formactions->form_select_status_action('formaction', $status, 1, 'status', 1, 2, 'minwidth100imp maxwidth125'); - print ajax_combobox('selectstatus'); + $formactions->form_select_status_action('formaction', $search_status, 1, 'search_status', 1, 2, 'minwidth100imp maxwidth125'); + print ajax_combobox('selectsearch_status'); print ''; } // Action column From 644b27bcf9386f678abed5006233d7533116cbd6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 Feb 2020 13:34:09 +0100 Subject: [PATCH 200/306] Fix look and feel v11 --- htdocs/comm/action/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 5527a7dd7f3..e44e5c3a973 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1449,10 +1449,10 @@ if ($id > 0) $langs->load("projects"); print ''.$langs->trans("Project").''; - $numprojet = $formproject->select_projects(($object->socid > 0 ? $object->socid : -1), $object->fk_project, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0); + $numprojet = $formproject->select_projects(($object->socid > 0 ? $object->socid : -1), $object->fk_project, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, 'maxwidth500'); if ($numprojet == 0) { - print '   '.$langs->trans("AddProject").''; + print '   '; } print ''; } From 40ac2d5cbd52155a8b0960dd17f648d3945c4298 Mon Sep 17 00:00:00 2001 From: BENKE Charlene <1179011+defrance@users.noreply.github.com> Date: Mon, 10 Feb 2020 14:34:00 +0100 Subject: [PATCH 201/306] Add finished field on list --- htdocs/product/list.php | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index df65a79f14b..40b76e6784a 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -172,7 +172,8 @@ $arrayfields = array( 'p.fk_product_type'=>array('label'=>$langs->trans("Type"), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && !empty($conf->service->enabled)), 'position'=>11), 'p.barcode'=>array('label'=>$langs->trans("Gencod"), 'checked'=>1, 'enabled'=>(!empty($conf->barcode->enabled)), 'position'=>12), 'p.duration'=>array('label'=>$langs->trans("Duration"), 'checked'=>($contextpage != 'productlist'), 'enabled'=>(!empty($conf->service->enabled) && (string) $type == '1'), 'position'=>13), - 'p.weight'=>array('label'=>$langs->trans('Weight'), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && $type != '1'), 'position'=>20), + 'p.finished'=>array('label'=>$langs->trans("Finished"), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && $contextpage != 'service')), + 'p.weight'=>array('label'=>$langs->trans('Weight'), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && $type != '1'), 'position'=>20), 'p.weight_units'=>array('label'=>$langs->trans('WeightUnits'), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && $type != '1'), 'position'=>21), 'p.length'=>array('label'=>$langs->trans('Length'), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && empty($conf->global->PRODUCT_DISABLE_SIZE) && $type != '1'), 'position'=>22), 'p.length_units'=>array('label'=>$langs->trans('LengthUnits'), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && empty($conf->global->PRODUCT_DISABLE_SIZE) && $type != '1'), 'position'=>23), @@ -294,7 +295,7 @@ else } $sql = 'SELECT DISTINCT p.rowid, p.ref, p.label, p.fk_product_type, p.barcode, p.price, p.tva_tx, p.price_ttc, p.price_base_type, p.entity,'; -$sql .= ' p.fk_product_type, p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock,'; +$sql .= ' p.fk_product_type, p.duration, p.finished, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock,'; $sql .= ' p.tobatch, p.accountancy_code_sell, p.accountancy_code_sell_intra, p.accountancy_code_sell_export, p.accountancy_code_buy,'; $sql .= ' p.datec as date_creation, p.tms as date_update, p.pmp, p.stock,'; $sql .= ' p.weight, p.weight_units, p.length, p.length_units, p.width, p.width_units, p.height, p.height_units, p.surface, p.surface_units, p.volume, p.volume_units,'; @@ -384,7 +385,7 @@ $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; $sql .= " GROUP BY p.rowid, p.ref, p.label, p.barcode, p.price, p.tva_tx, p.price_ttc, p.price_base_type,"; -$sql .= " p.fk_product_type, p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock,"; +$sql .= " p.fk_product_type, p.duration, p.finished, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock,"; $sql .= ' p.datec, p.tms, p.entity, p.tobatch, p.accountancy_code_sell, p.accountancy_code_sell_intra, p.accountancy_code_sell_export, p.accountancy_code_buy, p.pmp, p.stock,'; $sql .= ' p.weight, p.weight_units, p.length, p.length_units, p.width, p.width_units, p.height, p.height_units, p.surface, p.surface_units, p.volume, p.volume_units'; if (!empty($conf->global->PRODUCT_USE_UNITS)) $sql .= ', p.fk_unit, cu.label'; @@ -630,6 +631,12 @@ if ($resql) print ''; } + // Finished + if (!empty($arrayfields['p.finished']['checked'])) + { + print ''; + print ''; + } // Weight if (!empty($arrayfields['p.weight']['checked'])) { @@ -819,6 +826,10 @@ if ($resql) if (!empty($arrayfields['p.duration']['checked'])) { print_liste_field_titre($arrayfields['p.duration']['label'], $_SERVER["PHP_SELF"], "p.duration", "", $param, '', $sortfield, $sortorder, 'center '); } + if (!empty($arrayfields['p.finished']['checked'])) { + print_liste_field_titre($arrayfields['p.finished']['label'], $_SERVER["PHP_SELF"], "p.finished", "", $param, '', $sortfield, $sortorder, 'center '); + } + if (!empty($arrayfields['p.weight']['checked'])) print_liste_field_titre($arrayfields['p.weight']['label'], $_SERVER['PHP_SELF'], 'p.weight', '', $param, '', $sortfield, $sortorder, 'center '); if (!empty($arrayfields['p.weight_units']['checked'])) print_liste_field_titre($arrayfields['p.weight_units']['label'], $_SERVER['PHP_SELF'], 'p.weight_units', '', $param, '', $sortfield, $sortorder, 'center '); if (!empty($arrayfields['p.length']['checked'])) print_liste_field_titre($arrayfields['p.length']['label'], $_SERVER['PHP_SELF'], 'p.length', '', $param, '', $sortfield, $sortorder, 'center '); @@ -927,6 +938,7 @@ if ($resql) $product_static->ref_fourn = $obj->ref_supplier; // deprecated $product_static->ref_supplier = $obj->ref_supplier; $product_static->label = $obj->label; + $product_static->finished = $obj->finished; $product_static->type = $obj->fk_product_type; $product_static->status_buy = $obj->tobuy; $product_static->status = $obj->tosell; @@ -1038,6 +1050,15 @@ if ($resql) if (!$i) $totalarray['nbfield']++; } + // Finished + if (!empty($arrayfields['p.finished']['checked'])) + { + print ''; + print $product_static->getLibFinished(); + print ''; + if (!$i) $totalarray['nbfield']++; + } + // Weight if (!empty($arrayfields['p.weight']['checked'])) { From 9aaed92b49415bd91d20d04ee3ab629ff9508f4d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 Feb 2020 15:33:59 +0100 Subject: [PATCH 202/306] Fix quotes --- .../mysql/data/llx_accounting_account_fr.sql | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/install/mysql/data/llx_accounting_account_fr.sql b/htdocs/install/mysql/data/llx_accounting_account_fr.sql index 52c3714e896..1ab1a873156 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_fr.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_fr.sql @@ -1611,8 +1611,8 @@ INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8003,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1011','8002', 'Capital individuel initial (au ../../../)', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8004,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1012','8002', 'Variations capital individuel initial', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8005,'PCGAFR14-DEV','CAPIT', 'CAPITAL', '1013','8002', 'Capital souscrit - non appelé', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8006,'PCGAFR14-DEV','CAPIT', 'CAPITAL', '1014','8002', '"Capital souscrit - appelé, versé', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8007,'PCGAFR14-DEV','CAPIT', 'CAPITAL', '1015','8002', '"Capital souscrit - appelé, non versé', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8006,'PCGAFR14-DEV','CAPIT', 'CAPITAL', '1014','8002', 'Capital souscrit - appelé, versé', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8007,'PCGAFR14-DEV','CAPIT', 'CAPITAL', '1015','8002', 'Capital souscrit - appelé, non versé', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8008,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '10151','8007', 'Capital non amorti', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8009,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '10152','8007', 'Capital amorti', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8010,'PCGAFR14-DEV','CAPIT', 'XXXXXX', '1018','8002', 'Capital souscrit soumis à des réglementations particulières', 1); @@ -1763,7 +1763,7 @@ INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8155,'PCGAFR14-DEV','IMMO', 'XXXXXX', '20122','8153', 'Frais de publicité', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8156,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2013','8151', 'Frais d''augmentation de capital et d''opérations diverses (fusions, scissions, transformations)', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8157,'PCGAFR14-DEV','IMMO', 'XXXXXX', '203','8150', 'Frais de recherche et de développement', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8158,'PCGAFR14-DEV','IMMO', 'XXXXXX', '205','8150', '"Concessions et droits similaires, brevets, licences, marques, procédés, logiciels, droits et valeurs similaires', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8158,'PCGAFR14-DEV','IMMO', 'XXXXXX', '205','8150', 'Concessions et droits similaires, brevets, licences, marques, procédés, logiciels, droits et valeurs similaires', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8159,'PCGAFR14-DEV','IMMO', 'XXXXXX', '206','8150', 'Droit au bail', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8160,'PCGAFR14-DEV','IMMO', 'XXXXXX', '207','8150', 'Fonds rural et commercial', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8161,'PCGAFR14-DEV','IMMO', 'XXXXXX', '2071','8160', 'Fonds agricole', 1); @@ -2416,7 +2416,7 @@ INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8810,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6257','8806', 'Réceptions', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8811,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '626','8777', 'Frais postaux et de télécommunications', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8812,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '627','8777', 'Services bancaires et assimilés', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8813,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6271','8812', '"Frais sur titres (achat, vente, garde)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8813,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6271','8812', 'Frais sur titres (achat, vente, garde)', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8814,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6272','8812', 'Commissions et frais sur émission d''emprunts', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8815,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6275','8812', 'Frais sur effets (commissions d''endos…)', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8816,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6276','8812', 'Location de coffres', 1); @@ -2458,7 +2458,7 @@ INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8852,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6356','8846', 'Impôts indirects', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8853,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6357','8846', 'Droits d''enregistrement et de timbre', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8854,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6358','8846', 'Autres droits', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8855,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '637','8825', '"Autres impôts, taxes et versements assimilés (autres organismes)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8855,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '637','8825', 'Autres impôts, taxes et versements assimilés (autres organismes)', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8856,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6371','8855', 'Contribution sociale de solidarité à la charge des sociétés', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8857,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6372','8855', 'Taxes perçues par les organismes publics internationaux', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8858,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6374','8855', 'Impôts et taxes exigibles à l''étranger', 1); @@ -2469,7 +2469,7 @@ INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8863,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '64111','8862', 'Personnel permanent ou régulier', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8864,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '64115','8862', 'Personnel temporaire ou occasionnel', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8865,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6412','8861', 'Rémunérations (associés d''exploitation)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8866,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6413','8861', '"Rémunérations (administrateurs, gérants, associés)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8866,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6413','8861', 'Rémunérations (administrateurs, gérants, associés)', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8867,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6415','8861', 'Congés payés', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8868,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6416','8861', 'Primes et gratifications', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8869,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6417','8861', 'Indemnités et avantages en espèces divers', 1); @@ -2566,7 +2566,7 @@ INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8960,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '68662','8959', 'Immobilisations financières', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8961,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '68665','8959', 'Valeurs mobilières de placement', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8962,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6868','8956', 'Autres dotations', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8963,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '687','8941', '"Dotations aux amortissements, aux dépréciations et aux provisions - Charges exceptionnelles', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8963,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '687','8941', 'Dotations aux amortissements, aux dépréciations et aux provisions - Charges exceptionnelles', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8964,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6871','8963', 'Dotations aux amortissements exceptionnels des immobilisations', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8965,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '6872','8963', 'Dotations aux provisions réglementées (immobilisations)', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8966,'PCGAFR14-DEV','EXPENSE', 'XXXXXX', '68725','8965', 'Amortissements dérogatoires', 1); From 3792b8c8c8ea4421fcc0fce8320bca6d74bb0a64 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 Feb 2020 15:34:57 +0100 Subject: [PATCH 203/306] Fix quote pb reported by travis CI --- htdocs/install/mysql/data/llx_accounting_account_fr.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/data/llx_accounting_account_fr.sql b/htdocs/install/mysql/data/llx_accounting_account_fr.sql index 1ab1a873156..a190f0c3c9a 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_fr.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_fr.sql @@ -2263,7 +2263,7 @@ INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8657,'PCGAFR14-DEV','FINAN', 'XXXXXX', '5114','8653', 'Effets à l''escompte', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8658,'PCGAFR14-DEV','FINAN', 'XXXXXX', '512','8652', 'Banques', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8659,'PCGAFR14-DEV','FINAN', 'XXXXXX', '514','8652', 'Chèques postaux', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8660,'PCGAFR14-DEV','FINAN', 'XXXXXX', '515','8652', 'Caisses"" du Trésor et des établissements publics', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8660,'PCGAFR14-DEV','FINAN', 'XXXXXX', '515','8652', 'Caisses du Trésor et des établissements publics', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8661,'PCGAFR14-DEV','FINAN', 'XXXXXX', '516','8652', 'Sociétés de Bourse', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8662,'PCGAFR14-DEV','FINAN', 'XXXXXX', '517','8652', 'Autres organismes financiers', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 8663,'PCGAFR14-DEV','FINAN', 'XXXXXX', '518','8652', 'Intérêts courus', 1); From bb40dbe1c34b9ca10a4ec054e7010457c8f282c1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 Feb 2020 15:53:28 +0100 Subject: [PATCH 204/306] Fix label of field --- htdocs/product/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 40b76e6784a..c8facfe47ce 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -172,7 +172,7 @@ $arrayfields = array( 'p.fk_product_type'=>array('label'=>$langs->trans("Type"), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && !empty($conf->service->enabled)), 'position'=>11), 'p.barcode'=>array('label'=>$langs->trans("Gencod"), 'checked'=>1, 'enabled'=>(!empty($conf->barcode->enabled)), 'position'=>12), 'p.duration'=>array('label'=>$langs->trans("Duration"), 'checked'=>($contextpage != 'productlist'), 'enabled'=>(!empty($conf->service->enabled) && (string) $type == '1'), 'position'=>13), - 'p.finished'=>array('label'=>$langs->trans("Finished"), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && $contextpage != 'service')), + 'p.finished'=>array('label'=>$langs->trans("Nature"), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && $contextpage != 'service'), 'position'=>19), 'p.weight'=>array('label'=>$langs->trans('Weight'), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && $type != '1'), 'position'=>20), 'p.weight_units'=>array('label'=>$langs->trans('WeightUnits'), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && $type != '1'), 'position'=>21), 'p.length'=>array('label'=>$langs->trans('Length'), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && empty($conf->global->PRODUCT_DISABLE_SIZE) && $type != '1'), 'position'=>22), From cab228ebbee0c3c5ceb76632d3c9e6f2beed34e8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 Feb 2020 15:54:46 +0100 Subject: [PATCH 205/306] Fix condition --- htdocs/product/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index c8facfe47ce..2988de62476 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -172,7 +172,7 @@ $arrayfields = array( 'p.fk_product_type'=>array('label'=>$langs->trans("Type"), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && !empty($conf->service->enabled)), 'position'=>11), 'p.barcode'=>array('label'=>$langs->trans("Gencod"), 'checked'=>1, 'enabled'=>(!empty($conf->barcode->enabled)), 'position'=>12), 'p.duration'=>array('label'=>$langs->trans("Duration"), 'checked'=>($contextpage != 'productlist'), 'enabled'=>(!empty($conf->service->enabled) && (string) $type == '1'), 'position'=>13), - 'p.finished'=>array('label'=>$langs->trans("Nature"), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && $contextpage != 'service'), 'position'=>19), + 'p.finished'=>array('label'=>$langs->trans("Nature"), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && $type != '1'), 'position'=>19), 'p.weight'=>array('label'=>$langs->trans('Weight'), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && $type != '1'), 'position'=>20), 'p.weight_units'=>array('label'=>$langs->trans('WeightUnits'), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && $type != '1'), 'position'=>21), 'p.length'=>array('label'=>$langs->trans('Length'), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && empty($conf->global->PRODUCT_DISABLE_SIZE) && $type != '1'), 'position'=>22), From c77169ad878e49fec353f4e720bc8be972ae913b Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 10 Feb 2020 16:01:09 +0100 Subject: [PATCH 206/306] FIX : Problem with column label in subscription list --- htdocs/adherents/subscription/list.php | 51 ++++++-------------------- 1 file changed, 11 insertions(+), 40 deletions(-) diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index e7967aa4782..512f3935177 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -387,46 +387,17 @@ print "\n"; print ''; -if (! empty($arrayfields['d.ref']['checked'])) -{ - print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "c.rowid", $param, "", "", $sortfield, $sortorder); -} -if (! empty($arrayfields['d.fk_type']['checked'])) -{ - print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "c.fk_type", $param, "", "", $sortfield, $sortorder); -} -if (! empty($arrayfields['d.lastname']['checked'])) -{ - print_liste_field_titre("LastName", $_SERVER["PHP_SELF"], "d.lastname", $param, "", "", $sortfield, $sortorder); -} -if (! empty($arrayfields['d.firstname']['checked'])) -{ - print_liste_field_titre("FirstName", $_SERVER["PHP_SELF"], "d.firstname", $param, "", "", $sortfield, $sortorder); -} -if (! empty($arrayfields['d.login']['checked'])) -{ - print_liste_field_titre("Login", $_SERVER["PHP_SELF"], "d.login", $param, "", "", $sortfield, $sortorder); -} -if (! empty($arrayfields['t.libelle']['checked'])) -{ - print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "c.note", $param, "", '', $sortfield, $sortorder); -} -if (! empty($arrayfields['d.bank']['checked'])) -{ - print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "b.fk_account", $param, "", "", $sortfield, $sortorder); -} -if (! empty($arrayfields['c.dateadh']['checked'])) -{ - print_liste_field_titre("DateStart", $_SERVER["PHP_SELF"], "c.dateadh", $param, "", '', $sortfield, $sortorder, 'center nowraponall '); -} -if (! empty($arrayfields['c.datef']['checked'])) -{ - print_liste_field_titre("DateEnd", $_SERVER["PHP_SELF"], "c.datef", $param, "", '', $sortfield, $sortorder, 'center nowraponall '); -} -if (! empty($arrayfields['d.amount']['checked'])) -{ - print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "c.subscription", $param, "", '', $sortfield, $sortorder, 'right '); -} +if (! empty($arrayfields['d.ref']['checked'])) print_liste_field_titre($arrayfields['d.ref']['label'], $_SERVER["PHP_SELF"], "c.rowid", $param, "", "", $sortfield, $sortorder); +if (! empty($arrayfields['d.fk_type']['checked'])) print_liste_field_titre($arrayfields['d.fk_type']['label'], $_SERVER["PHP_SELF"], "c.fk_type", $param, "", "", $sortfield, $sortorder); +if (! empty($arrayfields['d.lastname']['checked'])) print_liste_field_titre($arrayfields['d.lastname']['label'], $_SERVER["PHP_SELF"], "d.lastname", $param, "", "", $sortfield, $sortorder); +if (! empty($arrayfields['d.firstname']['checked'])) print_liste_field_titre($arrayfields['d.firstname']['label'], $_SERVER["PHP_SELF"], "d.firstname", $param, "", "", $sortfield, $sortorder); +if (! empty($arrayfields['d.login']['checked'])) print_liste_field_titre($arrayfields['d.login']['label'], $_SERVER["PHP_SELF"], "d.login", $param, "", "", $sortfield, $sortorder); +if (! empty($arrayfields['t.libelle']['checked'])) print_liste_field_titre($arrayfields['t.libelle']['label'], $_SERVER["PHP_SELF"], "c.note", $param, "", '', $sortfield, $sortorder); +if (! empty($arrayfields['d.bank']['checked'])) print_liste_field_titre($arrayfields['d.bank']['label'], $_SERVER["PHP_SELF"], "b.fk_account", $param, "", "", $sortfield, $sortorder); +if (! empty($arrayfields['c.dateadh']['checked'])) print_liste_field_titre($arrayfields['c.dateadh']['label'], $_SERVER["PHP_SELF"], "c.dateadh", $param, "", '', $sortfield, $sortorder, 'center nowraponall '); +if (! empty($arrayfields['c.datef']['checked'])) print_liste_field_titre($arrayfields['c.datef']['label'], $_SERVER["PHP_SELF"], "c.datef", $param, "", '', $sortfield, $sortorder, 'center nowraponall '); +if (! empty($arrayfields['d.amount']['checked'])) print_liste_field_titre($arrayfields['d.amount']['label'], $_SERVER["PHP_SELF"], "c.subscription", $param, "", '', $sortfield, $sortorder, 'right '); + // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; From f279b4138b555c9dd696ea5d3b764c07318d47f8 Mon Sep 17 00:00:00 2001 From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Date: Mon, 10 Feb 2020 16:52:41 +0100 Subject: [PATCH 207/306] Add Project Ref and Title --- .../facture/doc/pdf_sponge.modules.php | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 1f4d9524bc8..e40f4583fad 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -1665,6 +1665,30 @@ class pdf_sponge extends ModelePDFFactures $pdf->SetTextColor(0, 0, 60); $pdf->MultiCell($w, 3, $outputlangs->transnoentities("RefCustomer")." : " . $outputlangs->convToOutputCharset($object->ref_client), '', 'R'); } + + if (! empty($conf->global->PDF_SHOW_PROJECT_TITLE)) + { + $object->fetch_projet(); + if (! empty($object->project->ref)) + { + $posy+=3; + $pdf->SetXY($posx, $posy); + $pdf->SetTextColor(0, 0, 60); + $pdf->MultiCell($w, 3, $outputlangs->transnoentities("Project")." : " . (empty($object->project->title)?'':$object->projet->title), '', 'R'); + } + } + + if (! empty($conf->global->PDF_SHOW_PROJECT)) + { + $object->fetch_projet(); + if (! empty($object->project->ref)) + { + $posy+=3; + $pdf->SetXY($posx, $posy); + $pdf->SetTextColor(0, 0, 60); + $pdf->MultiCell($w, 3, $outputlangs->transnoentities("RefProject")." : " . (empty($object->project->ref)?'':$object->projet->ref), '', 'R'); + } + } $objectidnext=$object->getIdReplacingInvoice('validated'); if ($object->type == 0 && $objectidnext) From 546e7b1bcf6f64627f9f6db8c64a3a5e8911c4b6 Mon Sep 17 00:00:00 2001 From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Date: Mon, 10 Feb 2020 16:57:02 +0100 Subject: [PATCH 208/306] Add project Ref and Title --- .../commande/doc/pdf_einstein.modules.php | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 7c1aaefb8bf..ae4018b213a 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -1312,6 +1312,30 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetTextColor(0, 0, 60); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("RefCustomer")." : " . $outputlangs->convToOutputCharset($object->ref_client), '', 'R'); } + + if (! empty($conf->global->PDF_SHOW_PROJECT_TITLE)) + { + $object->fetch_projet(); + if (! empty($object->project->ref)) + { + $posy+=3; + $pdf->SetXY($posx, $posy); + $pdf->SetTextColor(0, 0, 60); + $pdf->MultiCell($w, 3, $outputlangs->transnoentities("Project")." : " . (empty($object->project->title)?'':$object->projet->title), '', 'R'); + } + } + + if (! empty($conf->global->PDF_SHOW_PROJECT)) + { + $object->fetch_projet(); + if (! empty($object->project->ref)) + { + $posy+=3; + $pdf->SetXY($posx, $posy); + $pdf->SetTextColor(0, 0, 60); + $pdf->MultiCell($w, 3, $outputlangs->transnoentities("RefProject")." : " . (empty($object->project->ref)?'':$object->projet->ref), '', 'R'); + } + } $posy+=4; $pdf->SetXY($posx, $posy); From 573d86c725d33579d01d3676bb89c6bd310ec5f6 Mon Sep 17 00:00:00 2001 From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Date: Mon, 10 Feb 2020 16:57:59 +0100 Subject: [PATCH 209/306] Add project's ref and Title --- .../commande/doc/pdf_eratosthene.modules.php | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index 89f36d34352..8f39828d3f4 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -1447,6 +1447,30 @@ class pdf_eratosthene extends ModelePDFCommandes $pdf->MultiCell(100, 3, $outputlangs->transnoentities("RefCustomer")." : " . $outputlangs->convToOutputCharset($object->ref_client), '', 'R'); } + if (! empty($conf->global->PDF_SHOW_PROJECT_TITLE)) + { + $object->fetch_projet(); + if (! empty($object->project->ref)) + { + $posy+=3; + $pdf->SetXY($posx, $posy); + $pdf->SetTextColor(0, 0, 60); + $pdf->MultiCell($w, 3, $outputlangs->transnoentities("Project")." : " . (empty($object->project->title)?'':$object->projet->title), '', 'R'); + } + } + + if (! empty($conf->global->PDF_SHOW_PROJECT)) + { + $object->fetch_projet(); + if (! empty($object->project->ref)) + { + $posy+=3; + $pdf->SetXY($posx, $posy); + $pdf->SetTextColor(0, 0, 60); + $pdf->MultiCell($w, 3, $outputlangs->transnoentities("RefProject")." : " . (empty($object->project->ref)?'':$object->projet->ref), '', 'R'); + } + } + $posy+=4; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); From f9b03596f663071e42834b25d31dd5f43b39b994 Mon Sep 17 00:00:00 2001 From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Date: Mon, 10 Feb 2020 17:01:21 +0100 Subject: [PATCH 210/306] Add project ref and title --- .../modules/propale/doc/pdf_azur.modules.php | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 80e80d24d7e..1029187f21c 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1521,6 +1521,30 @@ class pdf_azur extends ModelePDFPropales $pdf->SetTextColor(0, 0, 60); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("RefCustomer")." : " . $outputlangs->convToOutputCharset($object->ref_client), '', 'R'); } + + if (! empty($conf->global->PDF_SHOW_PROJECT_TITLE)) + { + $object->fetch_projet(); + if (! empty($object->project->ref)) + { + $posy+=3; + $pdf->SetXY($posx, $posy); + $pdf->SetTextColor(0, 0, 60); + $pdf->MultiCell($w, 3, $outputlangs->transnoentities("Project")." : " . (empty($object->project->title)?'':$object->projet->title), '', 'R'); + } + } + + if (! empty($conf->global->PDF_SHOW_PROJECT)) + { + $object->fetch_projet(); + if (! empty($object->project->ref)) + { + $posy+=3; + $pdf->SetXY($posx, $posy); + $pdf->SetTextColor(0, 0, 60); + $pdf->MultiCell($w, 3, $outputlangs->transnoentities("RefProject")." : " . (empty($object->project->ref)?'':$object->projet->ref), '', 'R'); + } + } $posy+=4; $pdf->SetXY($posx, $posy); From fab8536f05eefcc4a688475c54117fce800e42bc Mon Sep 17 00:00:00 2001 From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Date: Mon, 10 Feb 2020 17:02:10 +0100 Subject: [PATCH 211/306] add project ref and title --- .../modules/propale/doc/pdf_cyan.modules.php | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index b2d1c9b4996..d810321a2de 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -1559,6 +1559,30 @@ class pdf_cyan extends ModelePDFPropales $pdf->SetTextColor(0, 0, 60); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("RefCustomer")." : " . $outputlangs->convToOutputCharset($object->ref_client), '', 'R'); } + + if (! empty($conf->global->PDF_SHOW_PROJECT_TITLE)) + { + $object->fetch_projet(); + if (! empty($object->project->ref)) + { + $posy+=3; + $pdf->SetXY($posx, $posy); + $pdf->SetTextColor(0, 0, 60); + $pdf->MultiCell($w, 3, $outputlangs->transnoentities("Project")." : " . (empty($object->project->title)?'':$object->projet->title), '', 'R'); + } + } + + if (! empty($conf->global->PDF_SHOW_PROJECT)) + { + $object->fetch_projet(); + if (! empty($object->project->ref)) + { + $posy+=3; + $pdf->SetXY($posx, $posy); + $pdf->SetTextColor(0, 0, 60); + $pdf->MultiCell($w, 3, $outputlangs->transnoentities("RefProject")." : " . (empty($object->project->ref)?'':$object->projet->ref), '', 'R'); + } + } $posy+=4; $pdf->SetXY($posx, $posy); From 2756dc156dd318a26d20b9416cebfd16c8047d87 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 Feb 2020 20:35:18 +0100 Subject: [PATCH 212/306] Add tool to convert pgdump into mysql dump --- dev/initdata/generate-invoice.php | 4 + dev/initdata/generate-order.php | 4 + dev/initdata/generate-product.php | 4 + dev/initdata/generate-proposal.php | 4 + dev/initdata/generate-thirdparty.php | 4 + dev/initdata/import-users.php | 2 +- dev/tools/dolibarr-postgres2mysql.php | 566 ++++++++++++++++++++++++++ 7 files changed, 587 insertions(+), 1 deletion(-) create mode 100644 dev/tools/dolibarr-postgres2mysql.php diff --git a/dev/initdata/generate-invoice.php b/dev/initdata/generate-invoice.php index 220144f2a7d..3fe058e8d3e 100755 --- a/dev/initdata/generate-invoice.php +++ b/dev/initdata/generate-invoice.php @@ -23,6 +23,10 @@ * \brief Script example to inject random customer invoices (for load tests) */ +$sapi_type = php_sapi_name(); +$script_file = basename(__FILE__); +$path=dirname(__FILE__).'/'; + // Test si mode batch $sapi_type = php_sapi_name(); if (substr($sapi_type, 0, 3) == 'cgi') { diff --git a/dev/initdata/generate-order.php b/dev/initdata/generate-order.php index 129313c70fd..1dc56aa5582 100755 --- a/dev/initdata/generate-order.php +++ b/dev/initdata/generate-order.php @@ -24,6 +24,10 @@ * \brief Script example to inject random orders (for load tests) */ +$sapi_type = php_sapi_name(); +$script_file = basename(__FILE__); +$path=dirname(__FILE__).'/'; + // Test si mode batch $sapi_type = php_sapi_name(); if (substr($sapi_type, 0, 3) == 'cgi') { diff --git a/dev/initdata/generate-product.php b/dev/initdata/generate-product.php index 49fd9860467..a82c0262360 100755 --- a/dev/initdata/generate-product.php +++ b/dev/initdata/generate-product.php @@ -24,6 +24,10 @@ * \brief Script example to inject random products (for load tests) */ +$sapi_type = php_sapi_name(); +$script_file = basename(__FILE__); +$path=dirname(__FILE__).'/'; + // Test si mode batch $sapi_type = php_sapi_name(); if (substr($sapi_type, 0, 3) == 'cgi') { diff --git a/dev/initdata/generate-proposal.php b/dev/initdata/generate-proposal.php index d0b2cd4aa56..4c5d70aadc4 100755 --- a/dev/initdata/generate-proposal.php +++ b/dev/initdata/generate-proposal.php @@ -24,6 +24,10 @@ * \brief Script example to inject random proposals (for load tests) */ +$sapi_type = php_sapi_name(); +$script_file = basename(__FILE__); +$path=dirname(__FILE__).'/'; + // Test si mode batch $sapi_type = php_sapi_name(); if (substr($sapi_type, 0, 3) == 'cgi') { diff --git a/dev/initdata/generate-thirdparty.php b/dev/initdata/generate-thirdparty.php index 91c7c969b75..05ac6416aa3 100755 --- a/dev/initdata/generate-thirdparty.php +++ b/dev/initdata/generate-thirdparty.php @@ -24,6 +24,10 @@ * \brief Script example to inject random thirdparties (for load tests) */ +$sapi_type = php_sapi_name(); +$script_file = basename(__FILE__); +$path=dirname(__FILE__).'/'; + // Test si mode batch $sapi_type = php_sapi_name(); if (substr($sapi_type, 0, 3) == 'cgi') { diff --git a/dev/initdata/import-users.php b/dev/initdata/import-users.php index 60a672adf12..4247415288c 100755 --- a/dev/initdata/import-users.php +++ b/dev/initdata/import-users.php @@ -20,7 +20,7 @@ */ /** - * \file dev/initdata/import-thirdparties.php + * \file dev/initdata/import-users.php * \brief Script example to insert thirdparties from a csv file. * To purge data, you can have a look at purge-data.php */ diff --git a/dev/tools/dolibarr-postgres2mysql.php b/dev/tools/dolibarr-postgres2mysql.php new file mode 100644 index 00000000000..27bab945b46 --- /dev/null +++ b/dev/tools/dolibarr-postgres2mysql.php @@ -0,0 +1,566 @@ +#!/usr/bin/env php + Lightbox Technologies Inc. + * Copyright (C) 2020 Rodolphe Quiedeville + * + * 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * ATTENTION DE PAS EXECUTER CE SCRIPT SUR UNE INSTALLATION DE PRODUCTION + */ + +/** + * \file dev/tools/dolibarr-postgres2mysql.php + * \brief Script to migrate a postgresql dump into a mysql dump + */ + + +$sapi_type = php_sapi_name(); +$script_file = basename(__FILE__); +$path=dirname(__FILE__).'/'; + +// Test si mode batch +$sapi_type = php_sapi_name(); +if (substr($sapi_type, 0, 3) == 'cgi') { + echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n"; + exit; +} + + +error_reporting(E_ALL & ~E_DEPRECATED); +define ('PRODUCT',"pg2mysql"); +define ('VERSION',"2.0"); + + +//this is the default, it can be overridden here, or specified as the third parameter on the command line +$config['engine']="InnoDB"; + + + + +if(! ($argv[1] && $argv[2]) ) { + echo "Usage: php pg2mysql_cli.php [engine]\n"; + exit; +} +else { + if(isset($argv[3])) $config['engine']=$argv[3]; + pg2mysql_large($argv[1], $argv[2]); + + + echo <<3 && ( $instr[$len-3]==")" && $instr[$len-2]==";" && $instr[$len-1]=="\n") && $inquotes==false) { + $chunkcount++; + + if ($linenum % 10000 == 0) { + $currentpos=ftell($infp); + $percent=round($currentpos/$fs*100); + $position=formatsize($currentpos); + printf("Processing progress: %3d%% position: %7s line: %9d sql chunk: %9d mem usage: %4dM\r",$percent,$position,$linenum,$chunkcount,$memusage); + } +/* + echo "sending chunk:\n"; + echo "=======================\n"; + print_r($pgsqlchunk); + echo "=======================\n"; +*/ + + /* + foreach ($pgsqlchunk as $aaa) { + if (preg_match('/MAIN_ENABLE_DEFAULT|MAIN_MAIL_SMTP_SE/', $aaa)) { + var_dump($pgsqlchunk); + } + }*/ + + $mysqlchunk=pg2mysql($pgsqlchunk, $arrayofprimaryalreadyintabledef, $first); + fputs($outfp, $mysqlchunk['output']); + + /* + $break = false; + foreach ($pgsqlchunk as $aaa) { + if (preg_match('/MAIN_ENABLE_DEFAULT|MAIN_MAIL_SMTP_SE/', $aaa)) { + var_dump($mysqlchunk); + } + if (preg_match('/MAIN_MAIL_SMTP_SE/', $aaa)) { + $break = true; + } + } + if ($break) break; + */ + + $outputatend.=$mysqlchunk['outputatend']; + + $first=false; + $pgsqlchunk=array(); + $mysqlchunk=""; + } + } + echo "\n\n"; + + fputs($outfp, $outputatend); + + fputs($outfp, "\n"); + + fputs($outfp, '/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;'."\n"); + fputs($outfp, '/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;'."\n"); + fputs($outfp, '/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;'."\n"); + fputs($outfp, '/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;'."\n"); + fputs($outfp, '/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;'."\n"); + fputs($outfp, '/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;'."\n"); + fputs($outfp, '/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;'."\n");; + + printf("Completed! %9d lines %9d sql chunks\n\n",$linenum,$chunkcount); + + fclose($infp); + fclose($outfp); + +} + +function pg2mysql(&$input, &$arrayofprimaryalreadyintabledef, $header=true) +{ + global $config; + + if(is_array($input)) { + $lines=$input; + } else { + $lines=split("\n",$input); + } + + if($header) { + $output = "-- Converted with ".PRODUCT."-".VERSION."\n"; + $output.= "-- Converted on ".date("r")."\n"; + $output.= "\n"; + + $output.="/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;\n"; + $output.="/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;\n"; + $output.="/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;\n"; + $output.="/*!40101 SET NAMES utf8 */;\n"; + $output.="/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;\n"; + $output.="/*!40103 SET TIME_ZONE='+00:00' */;\n"; + $output.="/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;\n"; + $output.="/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;\n"; + $output.="/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;\n"; + $output.="/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;\n"; + $output.="\n"; + + $outputatend=""; + } + else { + $output=""; + $outputatend=""; + } + + $in_create_table = $in_insert = FALSE; + + $linenumber=0; + $tbl_extra=""; + while(isset($lines[$linenumber])) { + $line=$lines[$linenumber]; + //$line =str_replace('ALTER TABLE public\.', '', $line); + + $reg = array(); + if(preg_match('/CREATE SEQUENCE (?:public\.)(.*)_(id|rowid|id_comment)_seq/', $line, $reg)) { + $outputatend.='-- Make field '.$reg[2].' auto_increment for table '.$reg[1]."\n"; + $outputatend.='ALTER TABLE '.$reg[1].' CHANGE COLUMN '.$reg[2].' '.$reg[2].' INTEGER NOT NULL AUTO_INCREMENT;'."\n\n"; + //var_dump($outputatend); + } + + if(substr($line,0,12)=="CREATE TABLE") { + $in_create_table=true; + $line=str_replace("\"", "`", $line); + $line=str_replace('public.', '', $line); + + $reg2= array(); + if (preg_match('/CREATE TABLE ([^\s]+)/', $line, $reg2)) { + $in_create_table = $reg2[1]; + } + + $reg2= array(); + if (preg_match('/CREATE TABLE ([^\s]+)/', $line, $reg2)) { + $output.='DROP TABLE IF EXISTS `'.$reg2[1].'`;'."\n"; + } + $output.=$line; + $linenumber++; + continue; + } + + if(substr($line,0,2)==");" && $in_create_table) { + $in_create_table=false; + $line=") ENGINE={$config['engine']};\n\n"; + + $output.=$tbl_extra; + $output.=$line; + + $linenumber++; + $tbl_extra=""; + continue; + } + + if($in_create_table) { + $regs = array(); + $line=str_replace("\"","`",$line); + $line=str_replace(" integer"," int(11)",$line); + $line=str_replace(" int_unsigned"," int(11) UNSIGNED",$line); + $line=str_replace(" smallint_unsigned"," smallint UNSIGNED",$line); + $line=str_replace(" bigint_unsigned"," bigint UNSIGNED",$line); + $line=str_replace(" serial "," int(11) auto_increment ",$line); + $line=str_replace(" bytea"," BLOB",$line); + $line=str_replace(" boolean"," bool",$line); + $line=str_replace(" bool DEFAULT true"," bool DEFAULT 1",$line); + $line=str_replace(" bool DEFAULT false"," bool DEFAULT 0",$line); + if(preg_match("/ character varying\(([0-9]*)\)/",$line,$regs)) { + $num=$regs[1]; + if($num<=255) + $line=preg_replace("/ character varying\([0-9]*\)/"," varchar($num)",$line); + else + $line=preg_replace("/ character varying\([0-9]*\)/"," text",$line); + } + //character varying with no size, we will default to varchar(255) + if(preg_match("/ character varying/",$line)) { + $line=preg_replace("/ character varying/"," varchar(255)",$line); + } + + if( preg_match("/ DEFAULT \('([0-9]*)'::int/",$line,$regs) || + preg_match("/ DEFAULT \('([0-9]*)'::smallint/",$line,$regs) || + preg_match("/ DEFAULT \('([0-9]*)'::bigint/",$line,$regs) + ) { + $num=$regs[1]; + $line=preg_replace("/ DEFAULT \('([0-9]*)'[^ ,]*/"," DEFAULT $num ",$line); + } + if(preg_match("/ DEFAULT \(([0-9\-]*)\)/",$line,$regs)) { + $num=$regs[1]; + $line=preg_replace("/ DEFAULT \(([0-9\-]*)\)/"," DEFAULT $num ",$line); + } + $line=preg_replace("/ DEFAULT nextval\(.*\) /"," auto_increment ",$line); + $line=preg_replace("/::.*,/",",",$line); + $line=preg_replace("/::.*$/","\n",$line); + if(preg_match("/character\(([0-9]*)\)/",$line,$regs)) { + $num=$regs[1]; + if($num<=255) + $line=preg_replace("/ character\([0-9]*\)/"," varchar($num)",$line); + else + $line=preg_replace("/ character\([0-9]*\)/"," text",$line); + } + //timestamps + $line=str_replace(" timestamp with time zone"," datetime",$line); + $line=str_replace(" timestamp without time zone"," datetime",$line); + + //time + $line=str_replace(" time with time zone"," time",$line); + $line=str_replace(" time without time zone"," time",$line); + + $line=str_replace(" timestamp DEFAULT now()"," timestamp DEFAULT CURRENT_TIMESTAMP",$line); + $line=str_replace(" timestamp without time zone DEFAULT now()"," timestamp DEFAULT CURRENT_TIMESTAMP",$line); + + if (strstr($line, "auto_increment") || preg_match('/ rowid int/', $line) || preg_match('/ id int/', $line)) { + $field=getfieldname($line); + $tbl_extra.=", PRIMARY KEY(`$field`)\n"; + $arrayofprimaryalreadyintabledef[$in_create_table]=$in_create_table; + } + + $specialfields=array("repeat","status","type","call"); + + $field=getfieldname($line); + if(in_array($field,$specialfields)) { + $line=str_replace("$field ","`$field` ",$line); + } + + //text/blob fields are not allowed to have a default, so if we find a text DEFAULT, change it to varchar(255) DEFAULT + if(strstr($line,"text DEFAULT")) { + $line=str_replace(" text DEFAULT "," varchar(255) DEFAULT ",$line); + } + + //just skip a CONSTRAINT line + if(strstr($line," CONSTRAINT ")) { + $line=""; + //and if the previous output ended with a , remove the , + $lastchr=substr($output,-2,1); + // echo "lastchr=$lastchr"; + if($lastchr==",") { + $output=substr($output,0,-2)."\n"; + } + } + + $output.=$line; + } + + if(substr($line,0,11)=="INSERT INTO") { + $line = str_replace('public.', '', $line); + + if(substr($line,-3,-1)==");") { + //we have a complete insert on one line + list($before,$after)=explode(" VALUES ", $line, 2); + //we only replace the " with ` in what comes BEFORE the VALUES + //(ie, field names, like INSERT INTO table ("bla","bla2") VALUES ('s:4:"test"','bladata2'); + //should convert to INSERT INTO table (`bla`,`bla2`) VALUES ('s:4:"test"','bladata2'); + + $before=str_replace("\"","`",$before); + + //in after, we need to watch out for escape format strings, ie (E'escaped \r in a string'), and ('bla',E'escaped \r in a string'), but could also be (number, E'string'); so we cant search for the previoous ' + //ugh i guess its possible these strings could exist IN the data as well, but the only way to solve that is to process these lines one character + //at a time, and thats just stupid, so lets just hope this doesnt appear anywhere in the actual data + $after=str_replace(" (E'"," ('",$after); + $after=str_replace(", E'",", '",$after); + + $output.=$before." VALUES ".$after; + $linenumber++; + continue; + } + else { + //this insert spans multiple lines, so keep dumping the lines until we reach a line + //that ends with ");" + + list($before,$after)=explode(" VALUES ", $line, 2); + //we only replace the " with ` in what comes BEFORE the VALUES + //(ie, field names, like INSERT INTO table ("bla","bla2") VALUES ('s:4:"test"','bladata2'); + //should convert to INSERT INTO table (`bla`,`bla2`) VALUES ('s:4:"test"','bladata2'); + + $before=str_replace("\"","`",$before); + + //in after, we need to watch out for escape format strings, ie (E'escaped \r in a string'), and ('bla',E'escaped \r in a string') + //ugh i guess its possible these strings could exist IN the data as well, but the only way to solve that is to process these lines one character + //at a time, and thats just stupid, so lets just hope this doesnt appear anywhere in the actual data + $after=str_replace(" (E'"," ('",$after); + $after=str_replace(", E'",", '",$after); + + $c=substr_count($line,"'"); + //we have an odd number of ' marks + if($c%2!=0) { + $inquotes=true; + } + else $inquotes=false; + + $output.=$before." VALUES ".$after; + do{ + $linenumber++; + + //in after, we need to watch out for escape format strings, ie (E'escaped \r in a string'), and ('bla',E'escaped \r in a string') + //ugh i guess its possible these strings could exist IN the data as well, but the only way to solve that is to process these lines one character + //at a time, and thats just stupid, so lets just hope this doesnt appear anywhere in the actual data + + //after the first line, we only need to check for it in the middle, not at the beginning of an insert (becuase the beginning will be on the first line) + //$after=str_replace(" (E'","' ('",$after); + $line=$lines[$linenumber]; + $line=str_replace("', E'","', '",$line); + $output.=$line; + +// printf("inquotes: %d linenumber: %4d line: %s\n",$inquotes,$linenumber,$lines[$linenumber]); + + $c=substr_count($line,"'"); + //we have an odd number of ' marks + if($c%2!=0) { + if($inquotes) $inquotes=false; + else $inquotes=true; +// echo "inquotes=$inquotes\n"; + } + + } while(substr($lines[$linenumber],-3,-1)!=");" || $inquotes); + } + } + if(substr($line,0,16)=="ALTER TABLE ONLY") { + $line=preg_replace('/ ONLY/', '', $line); + $line=str_replace("\"", "`", $line); + $line=str_replace("public.", "", $line); + $pkey=$line; + + $linenumber++; + if (! empty($lines[$linenumber])) { + $line = $lines[$linenumber]; + } + else { + $line = ''; + } + + if(strstr($line," PRIMARY KEY ") && substr($line,-3,-1)==");") { + $reg2 = array(); + if (preg_match('/ALTER TABLE ([^\s]+)/', $pkey, $reg2)) { + if (empty($arrayofprimaryalreadyintabledef[$reg2[1]])) { + //looks like we have a single line PRIMARY KEY definition, lets go ahead and add it + $output.=str_replace("\n", "", $pkey); + //the postgres and mysql syntax for this is (at least, in the example im looking at) + //identical, so we can just add it as is. + $output.=$line."\n"; + } else { + $output.='-- '.str_replace("\n", "", $pkey); + $output.='-- '.$line."\n"; + } + } else + { + $output.='-- '.str_replace("\n", "", $pkey); + $output.='-- '.$line."\n"; + } + } + + } + + //while we're here, we might as well catch CREATE INDEX as well + if(substr($line,0,12)=="CREATE INDEX") { + $matches = array(); + preg_match('/CREATE INDEX "?([a-zA-Z0-9_]*)"? ON "?([a-zA-Z0-9_\.]*)"? USING btree \((.*)\);/',$line,$matches); + if (! empty($matches[3])) { + $indexname=$matches[1]; + $tablename=str_replace('public.', '', $matches[2]); + $columns=$matches[3]; + if($tablename && $columns) { + $output.="ALTER TABLE `".$tablename."` ADD INDEX ".$indexname."( {$columns} ) ;\n"; + } + } + } + if(substr($line,0,19)=="CREATE UNIQUE INDEX") { + $matches = array(); + preg_match('/CREATE UNIQUE INDEX "?([a-zA-Z0-9_]*)"? ON "?([a-zA-Z0-9_\.]*)"? USING btree \((.*)\);/',$line,$matches); + if (! empty($matches[3])) { + $indexname=$matches[1]; + $tablename=str_replace('public.', '', $matches[2]); + $columns=str_replace('"', '', $matches[3]); + if($tablename && $columns) { + $output.="ALTER TABLE `".$tablename."` ADD UNIQUE INDEX ".$indexname." ( {$columns} ) ;\n"; + } + } + } + + if(substr($line, 0, 13) == 'DROP DATABASE') + $output .= $line; + + if(substr($line, 0, 15) == 'CREATE DATABASE') { + $matches = array(); + preg_match('/CREATE DATABASE ([a-zA-Z0-9_]*) .* ENCODING = \'(.*)\'/', $line, $matches); + $output .= "CREATE DATABASE `$matches[1]` DEFAULT CHARACTER SET $matches[2];\n\n"; + } + + if(substr($line, 0, 8) == '\\connect') { + $matches = array(); + preg_match('/connect ([a-zA-Z0-9_]*)/', $line, $matches); + $output .= "USE `$matches[1]`;\n\n"; + } + + if(substr($line, 0, 5) == 'COPY ') { + $matches = array(); + preg_match('/COPY (.*) FROM stdin/', $line, $matches); + $heads = str_replace('"', "`", $matches[1]); + $values = array(); + $in_insert = TRUE; + } elseif($in_insert) { + if($line == "\\.\n") { + $in_insert = FALSE; + if($values) $output .= "INSERT INTO $heads VALUES\n" . implode(",\n", $values) . ";\n\n"; + } else { + $vals = explode(' ', $line); + foreach($vals as $i => $val) { + $vals[$i] = ($val == '\\N') + ? 'NULL' + : "'" . str_replace("'", "\\'", trim($val)) . "'"; + } + $values[] = '(' . implode(',', $vals) . ')'; + if(count($values) >= 1000) { + $output .= "INSERT INTO $heads VALUES\n" . implode(",\n", $values) . ";\n"; + $values = array(); + } + } + } + + $linenumber++; + } + + return array('output' => $output, 'outputatend' => $outputatend); +} From 5823e2f5ef621d0aafe1f9c18a39379c5e89e05f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 Feb 2020 20:57:55 +0100 Subject: [PATCH 213/306] add warning --- htdocs/core/class/commonobject.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index c7dbab57b31..cd5fcbc2f67 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4744,6 +4744,7 @@ abstract class CommonObject { if (!dol_is_file($srctemplatepath)) { + dol_syslog("Failed to locate template file ".$srctemplatepath, LOG_WARNING); $this->error = 'ErrorGenerationAskedForOdtTemplateWithSrcFileNotFound'; return -1; } From ee7aa142476b7f33eb1787f9b2570e6743081a0f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 Feb 2020 21:28:49 +0100 Subject: [PATCH 214/306] Fix color of status --- htdocs/contrat/class/contrat.class.php | 8 ++++---- htdocs/product/stats/contrat.php | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index bb506884cab..e40eba40ee2 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -2749,8 +2749,8 @@ class ContratLigne extends CommonObjectLine /** * Return label of this contract line status * - * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto - * @return string Libelle + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status */ public function getLibStatut($mode) { @@ -2762,10 +2762,10 @@ class ContratLigne extends CommonObjectLine * Return label of a contract line status * * @param int $status Id status - * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto * @param int $expired 0=Not expired, 1=Expired, -1=Both or unknown * @param string $moreatt More attribute - * @return string Libelle + * @return string Label of status */ public static function LibStatut($status, $mode, $expired = -1, $moreatt = '') { diff --git a/htdocs/product/stats/contrat.php b/htdocs/product/stats/contrat.php index a478a542f0f..e5e37e44242 100644 --- a/htdocs/product/stats/contrat.php +++ b/htdocs/product/stats/contrat.php @@ -183,9 +183,9 @@ if ($id > 0 || !empty($ref)) print_liste_field_titre("CustomerCode", $_SERVER["PHP_SELF"], "s.code_client", "", "&id=".$product->id, '', $sortfield, $sortorder); print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "c.date_contrat", "", "&id=".$product->id, 'align="center"', $sortfield, $sortorder); //print_liste_field_titre("AmountHT"),$_SERVER["PHP_SELF"],"c.amount","","&id=".$product->id,'align="right"',$sortfield,$sortorder); - print_liste_field_titre($staticcontratligne->LibStatut(0, 3), $_SERVER["PHP_SELF"], "", '', '', 'align="center" width="16"', $sortfield, $sortorder, 'maxwidthsearch '); - print_liste_field_titre($staticcontratligne->LibStatut(4, 3), $_SERVER["PHP_SELF"], "", '', '', 'align="center" width="16"', $sortfield, $sortorder, 'maxwidthsearch '); - print_liste_field_titre($staticcontratligne->LibStatut(5, 3), $_SERVER["PHP_SELF"], "", '', '', 'align="center" width="16"', $sortfield, $sortorder, 'maxwidthsearch '); + print_liste_field_titre($staticcontratligne->LibStatut($staticcontratligne::STATUS_INITIAL, 3, -1, 'class="nochangebackground"'), $_SERVER["PHP_SELF"], "", '', '', 'align="center" width="16"', $sortfield, $sortorder, 'maxwidthsearch '); + print_liste_field_titre($staticcontratligne->LibStatut($staticcontratligne::STATUS_OPEN, 3, -1, 'class="nochangebackground"'), $_SERVER["PHP_SELF"], "", '', '', 'align="center" width="16"', $sortfield, $sortorder, 'maxwidthsearch '); + print_liste_field_titre($staticcontratligne->LibStatut($staticcontratligne::STATUS_CLOSED, 3, -1, 'class="nochangebackground"'), $_SERVER["PHP_SELF"], "", '', '', 'align="center" width="16"', $sortfield, $sortorder, 'maxwidthsearch '); print "\n"; $contracttmp = new Contrat($db); From 8d9de521f3bca87a5fde77c6cf25352f0ddfff1e Mon Sep 17 00:00:00 2001 From: Ruger Date: Tue, 11 Feb 2020 09:13:15 +0100 Subject: [PATCH 215/306] FIX: #13038 ExpenseReport PDF - custom category description is not correct --- .../core/modules/expensereport/doc/pdf_standard.modules.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index c1654aa0aec..631c9ab4251 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -579,8 +579,10 @@ class pdf_standard extends ModeleExpenseReport } $expensereporttypecode = $object->lines[$linenumber]->type_fees_code; - $expensereporttypecodetoshow = $outputlangs->trans($expensereporttypecode); - if ($expensereporttypecodetoshow == $expensereporttypecode) { + $expensereporttypecodetoshow = ($outputlangs->trans(($expensereporttypecode)) == $expensereporttypecode ? $object->lines[$linenumber]->type_fees_libelle : $outputlangs->trans($expensereporttypecode)); + + + if ($expensereporttypecodetoshow == $expensereporttypecode) { $expensereporttypecodetoshow = preg_replace('/^(EX_|TF_)/', '', $expensereporttypecodetoshow); } //$expensereporttypecodetoshow = dol_trunc($expensereporttypecodetoshow, 9); From 6b6355f373a6da044373bd944a187f8fde569c48 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Tue, 11 Feb 2020 09:57:52 +0100 Subject: [PATCH 216/306] Update html.form.class.php --- htdocs/core/class/html.form.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index a74872d4a98..1383b6221b9 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3498,6 +3498,7 @@ class Form // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Return list of payment methods + * Constant MAIN_DEFAULT_PAYMENT_TYPE_ID can used to set default value but scope is all application, probably not what you want. * * @param string $selected Id du mode de paiement pre-selectionne * @param string $htmlname Nom de la zone select @@ -3513,7 +3514,7 @@ class Form public function select_types_paiements($selected = '', $htmlname = 'paiementtype', $filtertype = '', $format = 0, $empty = 1, $noadmininfo = 0, $maxlength = 0, $active = 1, $morecss = '') { // phpcs:enable - global $langs, $user; + global $langs, $user, $conf; dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$filtertype.", ".$format, LOG_DEBUG); @@ -3523,6 +3524,9 @@ class Form elseif ($filtertype != '' && $filtertype != '-1') $filterarray = explode(',', $filtertype); $this->load_cache_types_paiements(); + + // Set default value if not already set by caller + if (empty($selected) && !empty($conf->global->MAIN_DEFAULT_PAYMENT_TYPE_ID)) $selected = $conf->global->MAIN_DEFAULT_PAYMENT_TYPE_ID; print ''; +print ''; print ''; print '
'; @@ -195,7 +206,13 @@ print '
'; // Select object print '
'; print '
'.$langs->trans("StatisticsOn").'
'; -print $form->selectarray('objecttype', $arrayoftype, $objecttype, 0, 0, 0, '', 1, 0, 0, '', '', 1); +$newarrayoftype = array(); +foreach($arrayoftype as $key => $val) { + if (dol_eval($val['enabled'], 1)) { + $newarrayoftype[$key] = $arrayoftype[$key]; + } +} +print $form->selectarray('objecttype', $newarrayoftype, $objecttype, 0, 0, 0, '', 1, 0, 0, '', '', 1); if (empty($conf->use_javascript_ajax)) print ''; else { print ''; + + $result = $tmpresult.$result; + } } - return ($nodiv ? '' : '
').' '.$text.($nodiv ? '' : '
'); + return $result; } diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index f910001a5e0..81e96c24479 100644 --- a/htdocs/exports/export.php +++ b/htdocs/exports/export.php @@ -147,6 +147,7 @@ $htmlother = new FormOther($db); $formfile = new FormFile($db); $sqlusedforexport = ''; +$head = array(); $upload_dir = $conf->export->dir_temp.'/'.$user->id; //$usefilters=($conf->global->MAIN_FEATURES_LEVEL > 1); @@ -1266,22 +1267,17 @@ if ($step == 5 && $datatoexport) print '
'; - print ''; - if ($sqlusedforexport && $user->admin) { - print ''; + print info_admin($langs->trans("SQLUsedForExport").':
'.$sqlusedforexport, 0, 0, 1, '', 'TechnicalInformation'); } - print '
'; - print info_admin($langs->trans("SQLUsedForExport").':
'.$sqlusedforexport); - print '
'; if (!is_dir($conf->export->dir_temp)) dol_mkdir($conf->export->dir_temp); // Show existing generated documents // NB: La fonction show_documents rescanne les modules qd genallowed=1, sinon prend $liste - print $formfile->showdocuments('export', '', $upload_dir, $_SERVER["PHP_SELF"].'?step=5&datatoexport='.$datatoexport, $liste, 1, (!empty($_POST['model']) ? $_POST['model'] : 'csv'), 1, 1, 0, 0, 0, '', ' ', '', '', ''); + print $formfile->showdocuments('export', '', $upload_dir, $_SERVER["PHP_SELF"].'?step=5&datatoexport='.$datatoexport, $liste, 1, (!empty($_POST['model']) ? $_POST['model'] : 'csv'), 1, 1, 0, 0, 0, '', 'none', '', '', ''); } llxFooter(); diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang index 8530c9fbede..59950289236 100644 --- a/htdocs/langs/en_US/other.lang +++ b/htdocs/langs/en_US/other.lang @@ -32,6 +32,8 @@ DateNextInvoiceBeforeGen=Date of next invoice (before generation) DateNextInvoiceAfterGen=Date of next invoice (after generation) GraphInBarsAreLimitedTo3Measures=Grapics are limited to 3 measures in 'Bars' mode. The mode 'Lines' was automatically selected instead. OnlyOneFieldForXAxisIsPossible=Only 1 field is currently possible as X-Axis. Only the first selected field has been selected. +AtLeastOneMeasureIsRequired=At least 1 field for measure is required +AtLeastOneXAxisIsRequired=At least 1 field for X-Axis is required Notify_ORDER_VALIDATE=Sales order validated Notify_ORDER_SENTBYMAIL=Sales order sent by mail From 34cfa0c6af4c974e8ae3e5d9c5a01273d6cc85f9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 11 Feb 2020 10:40:14 +0100 Subject: [PATCH 218/306] Fix look and feel v11 --- htdocs/exports/export.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index 81e96c24479..c636dd292a7 100644 --- a/htdocs/exports/export.php +++ b/htdocs/exports/export.php @@ -939,7 +939,7 @@ if ($step == 4 && $datatoexport) // List of filtered fiels if (isset($objexport->array_export_TypeFields[0]) && is_array($objexport->array_export_TypeFields[0])) { - print ''.$langs->trans("FilteredFields").''; + print ''.$langs->trans("FilteredFields").''; $list = ''; if (!empty($array_filtervalue)) { @@ -953,7 +953,7 @@ if ($step == 4 && $datatoexport) } } } - print ''.(!empty($list) ? $list : $langs->trans("None")).''; + print ''.(!empty($list) ? $list : ''.$langs->trans("None").'').''; print ''; } From 03ee488d5f2350e4ef9e2bc358159e13936540ce Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 11 Feb 2020 10:40:14 +0100 Subject: [PATCH 219/306] Fix look and feel v11 --- htdocs/exports/export.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index 525a5b17c9e..5373ea3a3b2 100644 --- a/htdocs/exports/export.php +++ b/htdocs/exports/export.php @@ -938,7 +938,7 @@ if ($step == 4 && $datatoexport) // List of filtered fiels if (isset($objexport->array_export_TypeFields[0]) && is_array($objexport->array_export_TypeFields[0])) { - print ''.$langs->trans("FilteredFields").''; + print ''.$langs->trans("FilteredFields").''; $list = ''; if (!empty($array_filtervalue)) { @@ -952,7 +952,7 @@ if ($step == 4 && $datatoexport) } } } - print ''.(!empty($list) ? $list : $langs->trans("None")).''; + print ''.(!empty($list) ? $list : ''.$langs->trans("None").'').''; print ''; } From 553352633131db08f5079e854042ded66c9ec6ef Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 11 Feb 2020 11:48:10 +0100 Subject: [PATCH 220/306] Fix phpcs --- dev/tools/dolibarr-postgres2mysql.php | 688 +++++++++++++------------- 1 file changed, 350 insertions(+), 338 deletions(-) diff --git a/dev/tools/dolibarr-postgres2mysql.php b/dev/tools/dolibarr-postgres2mysql.php index 27bab945b46..210f0a05a2c 100644 --- a/dev/tools/dolibarr-postgres2mysql.php +++ b/dev/tools/dolibarr-postgres2mysql.php @@ -1,7 +1,8 @@ #!/usr/bin/env php Lightbox Technologies Inc. - * Copyright (C) 2020 Rodolphe Quiedeville +/* + * Copyright (C) 2005-2011 James Grant Lightbox Technologies Inc. + * Copyright (C) 2020 Laurent Destailleur * * 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 @@ -10,189 +11,197 @@ * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * ATTENTION DE PAS EXECUTER CE SCRIPT SUR UNE INSTALLATION DE PRODUCTION + * This file is base on pg2mysql provided as Open source by lightbox.org. + * It was enhanced and updated by the Dolibarr team. */ /** - * \file dev/tools/dolibarr-postgres2mysql.php - * \brief Script to migrate a postgresql dump into a mysql dump + * \file dev/tools/dolibarr-postgres2mysql.php + * \brief Script to migrate a postgresql dump into a mysql dump */ - $sapi_type = php_sapi_name(); $script_file = basename(__FILE__); -$path=dirname(__FILE__).'/'; +$path = dirname(__FILE__) . '/'; // Test si mode batch $sapi_type = php_sapi_name(); if (substr($sapi_type, 0, 3) == 'cgi') { - echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n"; - exit; + echo "Error: You are using PHP for CGI. To execute " . $script_file . " from command line, you must use PHP for CLI mode.\n"; + exit(); } +error_reporting(E_ALL & ~ E_DEPRECATED); +define('PRODUCT', "pg2mysql"); +define('VERSION', "2.0"); -error_reporting(E_ALL & ~E_DEPRECATED); -define ('PRODUCT',"pg2mysql"); -define ('VERSION',"2.0"); +// this is the default, it can be overridden here, or specified as the third parameter on the command line +$config['engine'] = "InnoDB"; - -//this is the default, it can be overridden here, or specified as the third parameter on the command line -$config['engine']="InnoDB"; - - - - -if(! ($argv[1] && $argv[2]) ) { +if (! ($argv[1] && $argv[2])) { echo "Usage: php pg2mysql_cli.php [engine]\n"; - exit; -} -else { - if(isset($argv[3])) $config['engine']=$argv[3]; + exit(); +} else { + if (isset($argv[3])) + $config['engine'] = $argv[3]; pg2mysql_large($argv[1], $argv[2]); - echo <<=0 if OK + */ +function pg2mysql_large($infilename, $outfilename) +{ + $infp = fopen($infilename, "rt"); + $outfp = fopen($outfilename, "wt"); $outputatend = ''; $arrayofprimaryalreadyintabledef = array(); - //we read until we get a semicolon followed by a newline (;\n); - $pgsqlchunk=array(); - $chunkcount=1; - $linenum=0; - $inquotes=false; - $first=true; - echo "Filesize: ".formatsize($fs)."\n"; + // we read until we get a semicolon followed by a newline (;\n); + $pgsqlchunk = array(); + $chunkcount = 1; + $linenum = 0; + $inquotes = false; + $first = true; - while($instr=fgets($infp)) { - $linenum++; - $memusage=round(memory_get_usage(true)/1024/1024); - $len=strlen($instr); - $pgsqlchunk[]=$instr; - $c=substr_count($instr,"'"); - //we have an odd number of ' marks - if($c%2!=0) { - if($inquotes) - $inquotes=false; + if (empty($infp)) { + print 'Failed to open file '.$infilename."\n"; + return -1; + } + + $fs = filesize($infilename); + echo "Filesize: " . formatsize($fs) . "\n"; + + while ($instr = fgets($infp)) { + $linenum ++; + $memusage = round(memory_get_usage(true) / 1024 / 1024); + $len = strlen($instr); + $pgsqlchunk[] = $instr; + $c = substr_count($instr, "'"); + // we have an odd number of ' marks + if ($c % 2 != 0) { + if ($inquotes) + $inquotes = false; else - $inquotes=true; + $inquotes = true; } - if( $linenum%10000 == 0) { - $currentpos=ftell($infp); - $percent=round($currentpos/$fs*100); - $position=formatsize($currentpos); - printf("Reading progress: %3d%% position: %7s line: %9d sql chunk: %9d mem usage: %4dM\r",$percent,$position,$linenum,$chunkcount,$memusage); + if ($linenum % 10000 == 0) { + $currentpos = ftell($infp); + $percent = round($currentpos / $fs * 100); + $position = formatsize($currentpos); + printf("Reading progress: %3d%% position: %7s line: %9d sql chunk: %9d mem usage: %4dM\r", $percent, $position, $linenum, $chunkcount, $memusage); } - if(strlen($instr)>3 && ( $instr[$len-3]==")" && $instr[$len-2]==";" && $instr[$len-1]=="\n") && $inquotes==false) { - $chunkcount++; + if (strlen($instr) > 3 && ($instr[$len - 3] == ")" && $instr[$len - 2] == ";" && $instr[$len - 1] == "\n") && $inquotes == false) { + $chunkcount ++; if ($linenum % 10000 == 0) { - $currentpos=ftell($infp); - $percent=round($currentpos/$fs*100); - $position=formatsize($currentpos); - printf("Processing progress: %3d%% position: %7s line: %9d sql chunk: %9d mem usage: %4dM\r",$percent,$position,$linenum,$chunkcount,$memusage); + $currentpos = ftell($infp); + $percent = round($currentpos / $fs * 100); + $position = formatsize($currentpos); + printf("Processing progress: %3d%% position: %7s line: %9d sql chunk: %9d mem usage: %4dM\r", $percent, $position, $linenum, $chunkcount, $memusage); } -/* - echo "sending chunk:\n"; - echo "=======================\n"; - print_r($pgsqlchunk); - echo "=======================\n"; -*/ + /* + * echo "sending chunk:\n"; + * echo "=======================\n"; + * print_r($pgsqlchunk); + * echo "=======================\n"; + */ /* - foreach ($pgsqlchunk as $aaa) { - if (preg_match('/MAIN_ENABLE_DEFAULT|MAIN_MAIL_SMTP_SE/', $aaa)) { - var_dump($pgsqlchunk); - } - }*/ + * foreach ($pgsqlchunk as $aaa) { + * if (preg_match('/MAIN_ENABLE_DEFAULT|MAIN_MAIL_SMTP_SE/', $aaa)) { + * var_dump($pgsqlchunk); + * } + * } + */ - $mysqlchunk=pg2mysql($pgsqlchunk, $arrayofprimaryalreadyintabledef, $first); + $mysqlchunk = pg2mysql($pgsqlchunk, $arrayofprimaryalreadyintabledef, $first); fputs($outfp, $mysqlchunk['output']); /* - $break = false; - foreach ($pgsqlchunk as $aaa) { - if (preg_match('/MAIN_ENABLE_DEFAULT|MAIN_MAIL_SMTP_SE/', $aaa)) { - var_dump($mysqlchunk); - } - if (preg_match('/MAIN_MAIL_SMTP_SE/', $aaa)) { - $break = true; - } - } - if ($break) break; - */ + * $break = false; + * foreach ($pgsqlchunk as $aaa) { + * if (preg_match('/MAIN_ENABLE_DEFAULT|MAIN_MAIL_SMTP_SE/', $aaa)) { + * var_dump($mysqlchunk); + * } + * if (preg_match('/MAIN_MAIL_SMTP_SE/', $aaa)) { + * $break = true; + * } + * } + * if ($break) break; + */ - $outputatend.=$mysqlchunk['outputatend']; + $outputatend .= $mysqlchunk['outputatend']; - $first=false; - $pgsqlchunk=array(); - $mysqlchunk=""; + $first = false; + $pgsqlchunk = array(); + $mysqlchunk = ""; } } echo "\n\n"; @@ -201,366 +210,369 @@ function pg2mysql_large($infilename,$outfilename) { fputs($outfp, "\n"); - fputs($outfp, '/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;'."\n"); - fputs($outfp, '/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;'."\n"); - fputs($outfp, '/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;'."\n"); - fputs($outfp, '/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;'."\n"); - fputs($outfp, '/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;'."\n"); - fputs($outfp, '/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;'."\n"); - fputs($outfp, '/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;'."\n");; + fputs($outfp, '/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;' . "\n"); + fputs($outfp, '/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;' . "\n"); + fputs($outfp, '/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;' . "\n"); + fputs($outfp, '/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;' . "\n"); + fputs($outfp, '/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;' . "\n"); + fputs($outfp, '/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;' . "\n"); + fputs($outfp, '/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;' . "\n"); - printf("Completed! %9d lines %9d sql chunks\n\n",$linenum,$chunkcount); + printf("Completed! %9d lines %9d sql chunks\n\n", $linenum, $chunkcount); fclose($infp); fclose($outfp); + return 0; } -function pg2mysql(&$input, &$arrayofprimaryalreadyintabledef, $header=true) +/** + * pg2mysql + * + * @param array $input Array of input + * @param array $arrayofprimaryalreadyintabledef Array of table already output with a primary key set into definition + * @param boolean $header Boolean + * @return string[] Array of output + */ +function pg2mysql(&$input, &$arrayofprimaryalreadyintabledef, $header = true) { global $config; - if(is_array($input)) { - $lines=$input; + if (is_array($input)) { + $lines = $input; } else { - $lines=split("\n",$input); + $lines = split("\n", $input); } - if($header) { - $output = "-- Converted with ".PRODUCT."-".VERSION."\n"; - $output.= "-- Converted on ".date("r")."\n"; - $output.= "\n"; + if ($header) { + $output = "-- Converted with " . PRODUCT . "-" . VERSION . "\n"; + $output .= "-- Converted on " . date("r") . "\n"; + $output .= "\n"; - $output.="/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;\n"; - $output.="/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;\n"; - $output.="/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;\n"; - $output.="/*!40101 SET NAMES utf8 */;\n"; - $output.="/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;\n"; - $output.="/*!40103 SET TIME_ZONE='+00:00' */;\n"; - $output.="/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;\n"; - $output.="/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;\n"; - $output.="/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;\n"; - $output.="/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;\n"; - $output.="\n"; + $output .= "/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;\n"; + $output .= "/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;\n"; + $output .= "/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;\n"; + $output .= "/*!40101 SET NAMES utf8 */;\n"; + $output .= "/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;\n"; + $output .= "/*!40103 SET TIME_ZONE='+00:00' */;\n"; + $output .= "/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;\n"; + $output .= "/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;\n"; + $output .= "/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;\n"; + $output .= "/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;\n"; + $output .= "\n"; - $outputatend=""; - } - else { - $output=""; - $outputatend=""; + $outputatend = ""; + } else { + $output = ""; + $outputatend = ""; } $in_create_table = $in_insert = FALSE; - $linenumber=0; - $tbl_extra=""; - while(isset($lines[$linenumber])) { - $line=$lines[$linenumber]; - //$line =str_replace('ALTER TABLE public\.', '', $line); + $linenumber = 0; + $tbl_extra = ""; + while (isset($lines[$linenumber])) { + $line = $lines[$linenumber]; + // $line =str_replace('ALTER TABLE public\.', '', $line); $reg = array(); - if(preg_match('/CREATE SEQUENCE (?:public\.)(.*)_(id|rowid|id_comment)_seq/', $line, $reg)) { - $outputatend.='-- Make field '.$reg[2].' auto_increment for table '.$reg[1]."\n"; - $outputatend.='ALTER TABLE '.$reg[1].' CHANGE COLUMN '.$reg[2].' '.$reg[2].' INTEGER NOT NULL AUTO_INCREMENT;'."\n\n"; - //var_dump($outputatend); + if (preg_match('/CREATE SEQUENCE (?:public\.)(.*)_(id|rowid|id_comment)_seq/', $line, $reg)) { + $outputatend .= '-- Make field ' . $reg[2] . ' auto_increment for table ' . $reg[1] . "\n"; + $outputatend .= 'ALTER TABLE ' . $reg[1] . ' CHANGE COLUMN ' . $reg[2] . ' ' . $reg[2] . ' INTEGER NOT NULL AUTO_INCREMENT;' . "\n\n"; + // var_dump($outputatend); } - if(substr($line,0,12)=="CREATE TABLE") { - $in_create_table=true; - $line=str_replace("\"", "`", $line); - $line=str_replace('public.', '', $line); + if (substr($line, 0, 12) == "CREATE TABLE") { + $in_create_table = true; + $line = str_replace("\"", "`", $line); + $line = str_replace('public.', '', $line); - $reg2= array(); + $reg2 = array(); if (preg_match('/CREATE TABLE ([^\s]+)/', $line, $reg2)) { $in_create_table = $reg2[1]; } - $reg2= array(); + $reg2 = array(); if (preg_match('/CREATE TABLE ([^\s]+)/', $line, $reg2)) { - $output.='DROP TABLE IF EXISTS `'.$reg2[1].'`;'."\n"; + $output .= 'DROP TABLE IF EXISTS `' . $reg2[1] . '`;' . "\n"; } - $output.=$line; - $linenumber++; + $output .= $line; + $linenumber ++; continue; } - if(substr($line,0,2)==");" && $in_create_table) { - $in_create_table=false; - $line=") ENGINE={$config['engine']};\n\n"; + if (substr($line, 0, 2) == ");" && $in_create_table) { + $in_create_table = false; + $line = ") ENGINE={$config['engine']};\n\n"; - $output.=$tbl_extra; - $output.=$line; + $output .= $tbl_extra; + $output .= $line; - $linenumber++; - $tbl_extra=""; + $linenumber ++; + $tbl_extra = ""; continue; } - if($in_create_table) { + if ($in_create_table) { $regs = array(); - $line=str_replace("\"","`",$line); - $line=str_replace(" integer"," int(11)",$line); - $line=str_replace(" int_unsigned"," int(11) UNSIGNED",$line); - $line=str_replace(" smallint_unsigned"," smallint UNSIGNED",$line); - $line=str_replace(" bigint_unsigned"," bigint UNSIGNED",$line); - $line=str_replace(" serial "," int(11) auto_increment ",$line); - $line=str_replace(" bytea"," BLOB",$line); - $line=str_replace(" boolean"," bool",$line); - $line=str_replace(" bool DEFAULT true"," bool DEFAULT 1",$line); - $line=str_replace(" bool DEFAULT false"," bool DEFAULT 0",$line); - if(preg_match("/ character varying\(([0-9]*)\)/",$line,$regs)) { - $num=$regs[1]; - if($num<=255) - $line=preg_replace("/ character varying\([0-9]*\)/"," varchar($num)",$line); + $line = str_replace("\"", "`", $line); + $line = str_replace(" integer", " int(11)", $line); + $line = str_replace(" int_unsigned", " int(11) UNSIGNED", $line); + $line = str_replace(" smallint_unsigned", " smallint UNSIGNED", $line); + $line = str_replace(" bigint_unsigned", " bigint UNSIGNED", $line); + $line = str_replace(" serial ", " int(11) auto_increment ", $line); + $line = str_replace(" bytea", " BLOB", $line); + $line = str_replace(" boolean", " bool", $line); + $line = str_replace(" bool DEFAULT true", " bool DEFAULT 1", $line); + $line = str_replace(" bool DEFAULT false", " bool DEFAULT 0", $line); + if (preg_match("/ character varying\(([0-9]*)\)/", $line, $regs)) { + $num = $regs[1]; + if ($num <= 255) + $line = preg_replace("/ character varying\([0-9]*\)/", " varchar($num)", $line); else - $line=preg_replace("/ character varying\([0-9]*\)/"," text",$line); + $line = preg_replace("/ character varying\([0-9]*\)/", " text", $line); } - //character varying with no size, we will default to varchar(255) - if(preg_match("/ character varying/",$line)) { - $line=preg_replace("/ character varying/"," varchar(255)",$line); + // character varying with no size, we will default to varchar(255) + if (preg_match("/ character varying/", $line)) { + $line = preg_replace("/ character varying/", " varchar(255)", $line); } - if( preg_match("/ DEFAULT \('([0-9]*)'::int/",$line,$regs) || - preg_match("/ DEFAULT \('([0-9]*)'::smallint/",$line,$regs) || - preg_match("/ DEFAULT \('([0-9]*)'::bigint/",$line,$regs) - ) { - $num=$regs[1]; - $line=preg_replace("/ DEFAULT \('([0-9]*)'[^ ,]*/"," DEFAULT $num ",$line); + if (preg_match("/ DEFAULT \('([0-9]*)'::int/", $line, $regs) || preg_match("/ DEFAULT \('([0-9]*)'::smallint/", $line, $regs) || preg_match("/ DEFAULT \('([0-9]*)'::bigint/", $line, $regs)) { + $num = $regs[1]; + $line = preg_replace("/ DEFAULT \('([0-9]*)'[^ ,]*/", " DEFAULT $num ", $line); } - if(preg_match("/ DEFAULT \(([0-9\-]*)\)/",$line,$regs)) { - $num=$regs[1]; - $line=preg_replace("/ DEFAULT \(([0-9\-]*)\)/"," DEFAULT $num ",$line); + if (preg_match("/ DEFAULT \(([0-9\-]*)\)/", $line, $regs)) { + $num = $regs[1]; + $line = preg_replace("/ DEFAULT \(([0-9\-]*)\)/", " DEFAULT $num ", $line); } - $line=preg_replace("/ DEFAULT nextval\(.*\) /"," auto_increment ",$line); - $line=preg_replace("/::.*,/",",",$line); - $line=preg_replace("/::.*$/","\n",$line); - if(preg_match("/character\(([0-9]*)\)/",$line,$regs)) { - $num=$regs[1]; - if($num<=255) - $line=preg_replace("/ character\([0-9]*\)/"," varchar($num)",$line); + $line = preg_replace("/ DEFAULT nextval\(.*\) /", " auto_increment ", $line); + $line = preg_replace("/::.*,/", ",", $line); + $line = preg_replace("/::.*$/", "\n", $line); + if (preg_match("/character\(([0-9]*)\)/", $line, $regs)) { + $num = $regs[1]; + if ($num <= 255) + $line = preg_replace("/ character\([0-9]*\)/", " varchar($num)", $line); else - $line=preg_replace("/ character\([0-9]*\)/"," text",$line); + $line = preg_replace("/ character\([0-9]*\)/", " text", $line); } - //timestamps - $line=str_replace(" timestamp with time zone"," datetime",$line); - $line=str_replace(" timestamp without time zone"," datetime",$line); + // timestamps + $line = str_replace(" timestamp with time zone", " datetime", $line); + $line = str_replace(" timestamp without time zone", " datetime", $line); - //time - $line=str_replace(" time with time zone"," time",$line); - $line=str_replace(" time without time zone"," time",$line); + // time + $line = str_replace(" time with time zone", " time", $line); + $line = str_replace(" time without time zone", " time", $line); - $line=str_replace(" timestamp DEFAULT now()"," timestamp DEFAULT CURRENT_TIMESTAMP",$line); - $line=str_replace(" timestamp without time zone DEFAULT now()"," timestamp DEFAULT CURRENT_TIMESTAMP",$line); + $line = str_replace(" timestamp DEFAULT now()", " timestamp DEFAULT CURRENT_TIMESTAMP", $line); + $line = str_replace(" timestamp without time zone DEFAULT now()", " timestamp DEFAULT CURRENT_TIMESTAMP", $line); if (strstr($line, "auto_increment") || preg_match('/ rowid int/', $line) || preg_match('/ id int/', $line)) { - $field=getfieldname($line); - $tbl_extra.=", PRIMARY KEY(`$field`)\n"; - $arrayofprimaryalreadyintabledef[$in_create_table]=$in_create_table; + $field = getfieldname($line); + $tbl_extra .= ", PRIMARY KEY(`$field`)\n"; + $arrayofprimaryalreadyintabledef[$in_create_table] = $in_create_table; } - $specialfields=array("repeat","status","type","call"); + $specialfields = array("repeat","status","type","call"); - $field=getfieldname($line); - if(in_array($field,$specialfields)) { - $line=str_replace("$field ","`$field` ",$line); + $field = getfieldname($line); + if (in_array($field, $specialfields)) { + $line = str_replace("$field ", "`$field` ", $line); } - //text/blob fields are not allowed to have a default, so if we find a text DEFAULT, change it to varchar(255) DEFAULT - if(strstr($line,"text DEFAULT")) { - $line=str_replace(" text DEFAULT "," varchar(255) DEFAULT ",$line); + // text/blob fields are not allowed to have a default, so if we find a text DEFAULT, change it to varchar(255) DEFAULT + if (strstr($line, "text DEFAULT")) { + $line = str_replace(" text DEFAULT ", " varchar(255) DEFAULT ", $line); } - //just skip a CONSTRAINT line - if(strstr($line," CONSTRAINT ")) { - $line=""; - //and if the previous output ended with a , remove the , - $lastchr=substr($output,-2,1); - // echo "lastchr=$lastchr"; - if($lastchr==",") { - $output=substr($output,0,-2)."\n"; + // just skip a CONSTRAINT line + if (strstr($line, " CONSTRAINT ")) { + $line = ""; + // and if the previous output ended with a , remove the , + $lastchr = substr($output, - 2, 1); + // echo "lastchr=$lastchr"; + if ($lastchr == ",") { + $output = substr($output, 0, - 2) . "\n"; } } - $output.=$line; + $output .= $line; } - if(substr($line,0,11)=="INSERT INTO") { + if (substr($line, 0, 11) == "INSERT INTO") { $line = str_replace('public.', '', $line); - if(substr($line,-3,-1)==");") { - //we have a complete insert on one line - list($before,$after)=explode(" VALUES ", $line, 2); - //we only replace the " with ` in what comes BEFORE the VALUES - //(ie, field names, like INSERT INTO table ("bla","bla2") VALUES ('s:4:"test"','bladata2'); - //should convert to INSERT INTO table (`bla`,`bla2`) VALUES ('s:4:"test"','bladata2'); + if (substr($line, - 3, - 1) == ");") { + // we have a complete insert on one line + list ($before, $after) = explode(" VALUES ", $line, 2); + // we only replace the " with ` in what comes BEFORE the VALUES + // (ie, field names, like INSERT INTO table ("bla","bla2") VALUES ('s:4:"test"','bladata2'); + // should convert to INSERT INTO table (`bla`,`bla2`) VALUES ('s:4:"test"','bladata2'); - $before=str_replace("\"","`",$before); + $before = str_replace("\"", "`", $before); - //in after, we need to watch out for escape format strings, ie (E'escaped \r in a string'), and ('bla',E'escaped \r in a string'), but could also be (number, E'string'); so we cant search for the previoous ' - //ugh i guess its possible these strings could exist IN the data as well, but the only way to solve that is to process these lines one character - //at a time, and thats just stupid, so lets just hope this doesnt appear anywhere in the actual data - $after=str_replace(" (E'"," ('",$after); - $after=str_replace(", E'",", '",$after); + // in after, we need to watch out for escape format strings, ie (E'escaped \r in a string'), and ('bla',E'escaped \r in a string'), but could also be (number, E'string'); so we cant search for the previoous ' + // ugh i guess its possible these strings could exist IN the data as well, but the only way to solve that is to process these lines one character + // at a time, and thats just stupid, so lets just hope this doesnt appear anywhere in the actual data + $after = str_replace(" (E'", " ('", $after); + $after = str_replace(", E'", ", '", $after); - $output.=$before." VALUES ".$after; - $linenumber++; + $output .= $before . " VALUES " . $after; + $linenumber ++; continue; - } - else { - //this insert spans multiple lines, so keep dumping the lines until we reach a line - //that ends with ");" + } else { + // this insert spans multiple lines, so keep dumping the lines until we reach a line + // that ends with ");" - list($before,$after)=explode(" VALUES ", $line, 2); - //we only replace the " with ` in what comes BEFORE the VALUES - //(ie, field names, like INSERT INTO table ("bla","bla2") VALUES ('s:4:"test"','bladata2'); - //should convert to INSERT INTO table (`bla`,`bla2`) VALUES ('s:4:"test"','bladata2'); + list ($before, $after) = explode(" VALUES ", $line, 2); + // we only replace the " with ` in what comes BEFORE the VALUES + // (ie, field names, like INSERT INTO table ("bla","bla2") VALUES ('s:4:"test"','bladata2'); + // should convert to INSERT INTO table (`bla`,`bla2`) VALUES ('s:4:"test"','bladata2'); - $before=str_replace("\"","`",$before); + $before = str_replace("\"", "`", $before); - //in after, we need to watch out for escape format strings, ie (E'escaped \r in a string'), and ('bla',E'escaped \r in a string') - //ugh i guess its possible these strings could exist IN the data as well, but the only way to solve that is to process these lines one character - //at a time, and thats just stupid, so lets just hope this doesnt appear anywhere in the actual data - $after=str_replace(" (E'"," ('",$after); - $after=str_replace(", E'",", '",$after); + // in after, we need to watch out for escape format strings, ie (E'escaped \r in a string'), and ('bla',E'escaped \r in a string') + // ugh i guess its possible these strings could exist IN the data as well, but the only way to solve that is to process these lines one character + // at a time, and thats just stupid, so lets just hope this doesnt appear anywhere in the actual data + $after = str_replace(" (E'", " ('", $after); + $after = str_replace(", E'", ", '", $after); - $c=substr_count($line,"'"); - //we have an odd number of ' marks - if($c%2!=0) { - $inquotes=true; + $c = substr_count($line, "'"); + // we have an odd number of ' marks + if ($c % 2 != 0) { + $inquotes = true; + } else { + $inquotes = false; } - else $inquotes=false; - $output.=$before." VALUES ".$after; - do{ - $linenumber++; + $output .= $before . " VALUES " . $after; + do { + $linenumber ++; - //in after, we need to watch out for escape format strings, ie (E'escaped \r in a string'), and ('bla',E'escaped \r in a string') - //ugh i guess its possible these strings could exist IN the data as well, but the only way to solve that is to process these lines one character - //at a time, and thats just stupid, so lets just hope this doesnt appear anywhere in the actual data + // in after, we need to watch out for escape format strings, ie (E'escaped \r in a string'), and ('bla',E'escaped \r in a string') + // ugh i guess its possible these strings could exist IN the data as well, but the only way to solve that is to process these lines one character + // at a time, and thats just stupid, so lets just hope this doesnt appear anywhere in the actual data - //after the first line, we only need to check for it in the middle, not at the beginning of an insert (becuase the beginning will be on the first line) - //$after=str_replace(" (E'","' ('",$after); - $line=$lines[$linenumber]; - $line=str_replace("', E'","', '",$line); - $output.=$line; + // after the first line, we only need to check for it in the middle, not at the beginning of an insert (becuase the beginning will be on the first line) + // $after=str_replace(" (E'","' ('",$after); + $line = $lines[$linenumber]; + $line = str_replace("', E'", "', '", $line); + $output .= $line; -// printf("inquotes: %d linenumber: %4d line: %s\n",$inquotes,$linenumber,$lines[$linenumber]); + // printf("inquotes: %d linenumber: %4d line: %s\n",$inquotes,$linenumber,$lines[$linenumber]); - $c=substr_count($line,"'"); - //we have an odd number of ' marks - if($c%2!=0) { - if($inquotes) $inquotes=false; - else $inquotes=true; -// echo "inquotes=$inquotes\n"; + $c = substr_count($line, "'"); + // we have an odd number of ' marks + if ($c % 2 != 0) { + if ($inquotes) + $inquotes = false; + else + $inquotes = true; + // echo "inquotes=$inquotes\n"; } - - } while(substr($lines[$linenumber],-3,-1)!=");" || $inquotes); + } while (substr($lines[$linenumber], - 3, - 1) != ");" || $inquotes); } } - if(substr($line,0,16)=="ALTER TABLE ONLY") { - $line=preg_replace('/ ONLY/', '', $line); - $line=str_replace("\"", "`", $line); - $line=str_replace("public.", "", $line); - $pkey=$line; + if (substr($line, 0, 16) == "ALTER TABLE ONLY") { + $line = preg_replace('/ ONLY/', '', $line); + $line = str_replace("\"", "`", $line); + $line = str_replace("public.", "", $line); + $pkey = $line; - $linenumber++; + $linenumber ++; if (! empty($lines[$linenumber])) { $line = $lines[$linenumber]; - } - else { + } else { $line = ''; } - if(strstr($line," PRIMARY KEY ") && substr($line,-3,-1)==");") { + if (strstr($line, " PRIMARY KEY ") && substr($line, - 3, - 1) == ");") { $reg2 = array(); if (preg_match('/ALTER TABLE ([^\s]+)/', $pkey, $reg2)) { if (empty($arrayofprimaryalreadyintabledef[$reg2[1]])) { - //looks like we have a single line PRIMARY KEY definition, lets go ahead and add it - $output.=str_replace("\n", "", $pkey); - //the postgres and mysql syntax for this is (at least, in the example im looking at) - //identical, so we can just add it as is. - $output.=$line."\n"; + // looks like we have a single line PRIMARY KEY definition, lets go ahead and add it + $output .= str_replace("\n", "", $pkey); + // the postgres and mysql syntax for this is (at least, in the example im looking at) + // identical, so we can just add it as is. + $output .= $line . "\n"; } else { - $output.='-- '.str_replace("\n", "", $pkey); - $output.='-- '.$line."\n"; + $output .= '-- ' . str_replace("\n", "", $pkey); + $output .= '-- ' . $line . "\n"; } - } else - { - $output.='-- '.str_replace("\n", "", $pkey); - $output.='-- '.$line."\n"; + } else { + $output .= '-- ' . str_replace("\n", "", $pkey); + $output .= '-- ' . $line . "\n"; } } - } - //while we're here, we might as well catch CREATE INDEX as well - if(substr($line,0,12)=="CREATE INDEX") { + // while we're here, we might as well catch CREATE INDEX as well + if (substr($line, 0, 12) == "CREATE INDEX") { $matches = array(); - preg_match('/CREATE INDEX "?([a-zA-Z0-9_]*)"? ON "?([a-zA-Z0-9_\.]*)"? USING btree \((.*)\);/',$line,$matches); + preg_match('/CREATE INDEX "?([a-zA-Z0-9_]*)"? ON "?([a-zA-Z0-9_\.]*)"? USING btree \((.*)\);/', $line, $matches); if (! empty($matches[3])) { - $indexname=$matches[1]; - $tablename=str_replace('public.', '', $matches[2]); - $columns=$matches[3]; - if($tablename && $columns) { - $output.="ALTER TABLE `".$tablename."` ADD INDEX ".$indexname."( {$columns} ) ;\n"; + $indexname = $matches[1]; + $tablename = str_replace('public.', '', $matches[2]); + $columns = $matches[3]; + if ($tablename && $columns) { + $output .= "ALTER TABLE `" . $tablename . "` ADD INDEX " . $indexname . "( {$columns} ) ;\n"; } } } - if(substr($line,0,19)=="CREATE UNIQUE INDEX") { + if (substr($line, 0, 19) == "CREATE UNIQUE INDEX") { $matches = array(); - preg_match('/CREATE UNIQUE INDEX "?([a-zA-Z0-9_]*)"? ON "?([a-zA-Z0-9_\.]*)"? USING btree \((.*)\);/',$line,$matches); + preg_match('/CREATE UNIQUE INDEX "?([a-zA-Z0-9_]*)"? ON "?([a-zA-Z0-9_\.]*)"? USING btree \((.*)\);/', $line, $matches); if (! empty($matches[3])) { - $indexname=$matches[1]; - $tablename=str_replace('public.', '', $matches[2]); - $columns=str_replace('"', '', $matches[3]); - if($tablename && $columns) { - $output.="ALTER TABLE `".$tablename."` ADD UNIQUE INDEX ".$indexname." ( {$columns} ) ;\n"; + $indexname = $matches[1]; + $tablename = str_replace('public.', '', $matches[2]); + $columns = str_replace('"', '', $matches[3]); + if ($tablename && $columns) { + $output .= "ALTER TABLE `" . $tablename . "` ADD UNIQUE INDEX " . $indexname . " ( {$columns} ) ;\n"; } } } - if(substr($line, 0, 13) == 'DROP DATABASE') + if (substr($line, 0, 13) == 'DROP DATABASE') $output .= $line; - if(substr($line, 0, 15) == 'CREATE DATABASE') { + if (substr($line, 0, 15) == 'CREATE DATABASE') { $matches = array(); preg_match('/CREATE DATABASE ([a-zA-Z0-9_]*) .* ENCODING = \'(.*)\'/', $line, $matches); $output .= "CREATE DATABASE `$matches[1]` DEFAULT CHARACTER SET $matches[2];\n\n"; } - if(substr($line, 0, 8) == '\\connect') { + if (substr($line, 0, 8) == '\\connect') { $matches = array(); preg_match('/connect ([a-zA-Z0-9_]*)/', $line, $matches); $output .= "USE `$matches[1]`;\n\n"; } - if(substr($line, 0, 5) == 'COPY ') { + if (substr($line, 0, 5) == 'COPY ') { $matches = array(); preg_match('/COPY (.*) FROM stdin/', $line, $matches); $heads = str_replace('"', "`", $matches[1]); $values = array(); $in_insert = TRUE; - } elseif($in_insert) { - if($line == "\\.\n") { + } elseif ($in_insert) { + if ($line == "\\.\n") { $in_insert = FALSE; - if($values) $output .= "INSERT INTO $heads VALUES\n" . implode(",\n", $values) . ";\n\n"; + if ($values) { + $output .= "INSERT INTO $heads VALUES\n" . implode(",\n", $values) . ";\n\n"; + } } else { $vals = explode(' ', $line); - foreach($vals as $i => $val) { - $vals[$i] = ($val == '\\N') - ? 'NULL' - : "'" . str_replace("'", "\\'", trim($val)) . "'"; + foreach ($vals as $i => $val) { + $vals[$i] = ($val == '\\N') ? 'NULL' : "'" . str_replace("'", "\\'", trim($val)) . "'"; } $values[] = '(' . implode(',', $vals) . ')'; - if(count($values) >= 1000) { + if (count($values) >= 1000) { $output .= "INSERT INTO $heads VALUES\n" . implode(",\n", $values) . ";\n"; $values = array(); } } } - $linenumber++; + $linenumber ++; } - return array('output' => $output, 'outputatend' => $outputatend); + return array('output' => $output,'outputatend' => $outputatend); } From 8b677934097381f0e5e0233101ea07b237d88666 Mon Sep 17 00:00:00 2001 From: oscim Date: Tue, 11 Feb 2020 14:13:08 +0100 Subject: [PATCH 221/306] report and apply GETPOST method report and apply GETPOST method for $dateech, $dateperiod, $label --- htdocs/compta/sociales/card.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index c5e142ca7ca..25711c6b4ac 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -47,6 +47,11 @@ $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm'); $projectid = (GETPOST('projectid') ? GETPOST('projectid', 'int') : 0); +$dateech = dol_mktime(GETPOST('echhour'), GETPOST('echmin'), GETPOST('echsec'), GETPOST('echmonth'), GETPOST('echday'), GETPOST('echyear')); +$dateperiod = dol_mktime(GETPOST('periodhour'), GETPOST('periodmin'), GETPOST('periodsec'), GETPOST('periodmonth'), GETPOST('periodday'), GETPOST('periodyear')); +$label = GETPOST('label', 'alpha'); +$actioncode = GETPOST('actioncode'); + // Security check $socid = GETPOST('socid', 'int'); if ($user->socid) $socid = $user->socid; @@ -134,10 +139,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes') // Add social contribution if ($action == 'add' && $user->rights->tax->charges->creer) { - $dateech = dol_mktime(GETPOST('echhour'), GETPOST('echmin'), GETPOST('echsec'), GETPOST('echmonth'), GETPOST('echday'), GETPOST('echyear')); - $dateperiod = dol_mktime(GETPOST('periodhour'), GETPOST('periodmin'), GETPOST('periodsec'), GETPOST('periodmonth'), GETPOST('periodday'), GETPOST('periodyear')); $amount = price2num(GETPOST('amount')); - $actioncode = GETPOST('actioncode'); if (!$dateech) { @@ -187,8 +189,6 @@ if ($action == 'add' && $user->rights->tax->charges->creer) if ($action == 'update' && !$_POST["cancel"] && $user->rights->tax->charges->creer) { - $dateech = dol_mktime(GETPOST('echhour'), GETPOST('echmin'), GETPOST('echsec'), GETPOST('echmonth'), GETPOST('echday'), GETPOST('echyear')); - $dateperiod = dol_mktime(GETPOST('periodhour'), GETPOST('periodmin'), GETPOST('periodsec'), GETPOST('periodmonth'), GETPOST('periodday'), GETPOST('periodyear')); $amount = price2num(GETPOST('amount')); if (!$dateech) From 416cb3016d67e53e5c0483fc22d57f7f1ec0561b Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 11 Feb 2020 13:15:23 +0000 Subject: [PATCH 222/306] Fixing style errors. --- htdocs/compta/sociales/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index 25711c6b4ac..69ad435c64c 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -49,7 +49,7 @@ $projectid = (GETPOST('projectid') ? GETPOST('projectid', 'int') : 0); $dateech = dol_mktime(GETPOST('echhour'), GETPOST('echmin'), GETPOST('echsec'), GETPOST('echmonth'), GETPOST('echday'), GETPOST('echyear')); $dateperiod = dol_mktime(GETPOST('periodhour'), GETPOST('periodmin'), GETPOST('periodsec'), GETPOST('periodmonth'), GETPOST('periodday'), GETPOST('periodyear')); -$label = GETPOST('label', 'alpha'); +$label = GETPOST('label', 'alpha'); $actioncode = GETPOST('actioncode'); // Security check From 878026ebc5d04d3ec202000dcceea00d4ff220c9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 11 Feb 2020 14:44:53 +0100 Subject: [PATCH 223/306] Fix phpcs --- dev/tools/dolibarr-postgres2mysql.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dev/tools/dolibarr-postgres2mysql.php b/dev/tools/dolibarr-postgres2mysql.php index 210f0a05a2c..f2794455ca3 100644 --- a/dev/tools/dolibarr-postgres2mysql.php +++ b/dev/tools/dolibarr-postgres2mysql.php @@ -79,7 +79,7 @@ function getfieldname($l) else return null; } // if its not in quotes, then it should (we hope!) be the first "word" on the line, up to the first space. - else if (preg_match("/([^\ ]*)/", trim($l), $regs)) { + elseif (preg_match("/([^\ ]*)/", trim($l), $regs)) { if ($regs[1]) return $regs[1]; else @@ -98,9 +98,9 @@ function formatsize($s) { if ($s < pow(2, 14)) return "{$s}B"; - else if ($s < pow(2, 20)) + elseif ($s < pow(2, 20)) return sprintf("%.1f", round($s / 1024, 1)) . "K"; - else if ($s < pow(2, 30)) + elseif ($s < pow(2, 30)) return sprintf("%.1f", round($s / 1024 / 1024, 1)) . "M"; else return sprintf("%.1f", round($s / 1024 / 1024 / 1024, 1)) . "G"; @@ -267,7 +267,7 @@ function pg2mysql(&$input, &$arrayofprimaryalreadyintabledef, $header = true) $outputatend = ""; } - $in_create_table = $in_insert = FALSE; + $in_create_table = $in_insert = false; $linenumber = 0; $tbl_extra = ""; @@ -551,10 +551,10 @@ function pg2mysql(&$input, &$arrayofprimaryalreadyintabledef, $header = true) preg_match('/COPY (.*) FROM stdin/', $line, $matches); $heads = str_replace('"', "`", $matches[1]); $values = array(); - $in_insert = TRUE; + $in_insert = true; } elseif ($in_insert) { if ($line == "\\.\n") { - $in_insert = FALSE; + $in_insert = false; if ($values) { $output .= "INSERT INTO $heads VALUES\n" . implode(",\n", $values) . ";\n\n"; } From 66f6d1bfd4f2d569adbcbb9e9468856557cd986e Mon Sep 17 00:00:00 2001 From: atm-greg Date: Tue, 11 Feb 2020 15:57:49 +0100 Subject: [PATCH 224/306] add missing fields --- .../class/accountancyexport.class.php | 31 +++++++++---------- .../accountancy/class/bookkeeping.class.php | 4 +++ 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index 46d3feae5b2..9b107367129 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -935,6 +935,7 @@ class AccountancyExport foreach ($objectLines as $line) { $date_document = dol_print_date($line->doc_date, '%Y%m%d'); $date_creation = dol_print_date($line->date_creation, '%Y%m%d'); + $date_lim_reglement = dol_print_date($line->date_lim_reglement, '%Y%m%d'); // TYPE $type_enregistrement = 'E'; // For write movement @@ -950,7 +951,7 @@ class AccountancyExport // LIBE print $line->label_operation.$separator; // DATH - print $line->date_lim_reglement.$separator; + print $date_lim_reglement.$separator; // CNPI if ($line->doc_type == 'supplier_invoice') { if ($line->montant < 0) { @@ -969,21 +970,19 @@ class AccountancyExport } print $nature_piece.$separator; // RACI - /* - if (! empty($line->subledger_account)) { - if ($line->doc_type == 'supplier_invoice') { - $racine_subledger_account = '40'; - } elseif ($line->doc_type == 'customer_invoice') { - $racine_subledger_account = '41'; - } else { - $nature_piece = ''; - } - print $racine_subledger_account . $separator; - } else { - print $separator; - } - */ - print $separator; // deprecated CPTG & CPTA use instead + // if (! empty($line->subledger_account)) { +// if ($line->doc_type == 'supplier_invoice') { +// $racine_subledger_account = '40'; +// } elseif ($line->doc_type == 'customer_invoice') { +// $racine_subledger_account = '41'; +// } else { +// $racine_subledger_account = ''; +// } +// } else { + $racine_subledger_account = ''; // for records of type E leave this field blank +// } + + print $racine_subledger_account . $separator; // deprecated CPTG & CPTA use instead // MONT print price(abs($line->montant), 0, '', 1, 2).$separator; // CODC diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 6068e6ec0c1..7177e79b427 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -926,6 +926,7 @@ class BookKeeping extends CommonObject $sql .= " t.debit,"; $sql .= " t.credit,"; $sql .= " t.lettering_code,"; + $sql .= " t.date_lettering,"; $sql .= " t.montant,"; $sql .= " t.sens,"; $sql .= " t.fk_user_author,"; @@ -934,6 +935,7 @@ class BookKeeping extends CommonObject $sql .= " t.journal_label,"; $sql .= " t.piece_num,"; $sql .= " t.date_creation,"; + $sql .= " t.date_lim_reglement,"; $sql .= " t.tms as date_modification,"; $sql .= " t.date_export"; $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t'; @@ -1006,12 +1008,14 @@ class BookKeeping extends CommonObject $line->montant = $obj->montant; $line->sens = $obj->sens; $line->lettering_code = $obj->lettering_code; + $line->date_lettering = $obj->date_lettering; $line->fk_user_author = $obj->fk_user_author; $line->import_key = $obj->import_key; $line->code_journal = $obj->code_journal; $line->journal_label = $obj->journal_label; $line->piece_num = $obj->piece_num; $line->date_creation = $this->db->jdate($obj->date_creation); + $line->date_lim_reglement = $this->db->jdate($obj->date_lim_reglement); $line->date_modification = $this->db->jdate($obj->date_modification); $line->date_export = $this->db->jdate($obj->date_export); From 8518e0752f9d2cf6e5479a32ce2a83665389038d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 11 Feb 2020 16:01:32 +0100 Subject: [PATCH 225/306] NEW Can edit option PDF_USE_ALSO_LANGUAGE_CODE from PDF setup page --- htdocs/admin/pdf.php | 26 ++++++++++---- .../facture/doc/pdf_sponge.modules.php | 35 ++++++++++++++----- htdocs/langs/en_US/admin.lang | 3 +- 3 files changed, 48 insertions(+), 16 deletions(-) diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index df62acee3a4..496a32923f7 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -58,12 +58,13 @@ if ($action == 'update') dolibarr_set_const($db, "MAIN_PDF_MARGIN_TOP", $_POST["MAIN_PDF_MARGIN_TOP"], 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_PDF_MARGIN_BOTTOM", $_POST["MAIN_PDF_MARGIN_BOTTOM"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_PROFID1_IN_ADDRESS", $_POST["MAIN_PROFID1_IN_ADDRESS"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_PROFID2_IN_ADDRESS", $_POST["MAIN_PROFID2_IN_ADDRESS"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_PROFID3_IN_ADDRESS", $_POST["MAIN_PROFID3_IN_ADDRESS"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_PROFID4_IN_ADDRESS", $_POST["MAIN_PROFID4_IN_ADDRESS"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_PROFID5_IN_ADDRESS", $_POST["MAIN_PROFID5_IN_ADDRESS"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_PROFID6_IN_ADDRESS", $_POST["MAIN_PROFID6_IN_ADDRESS"], 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_PROFID1_IN_ADDRESS", GETPOST("MAIN_PROFID1_IN_ADDRESS", "nohtml"), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_PROFID2_IN_ADDRESS", GETPOST("MAIN_PROFID2_IN_ADDRESS", "nohtml"), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_PROFID3_IN_ADDRESS", GETPOST("MAIN_PROFID3_IN_ADDRESS", "nohtml"), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_PROFID4_IN_ADDRESS", GETPOST("MAIN_PROFID4_IN_ADDRESS", "nohtml"), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_PROFID5_IN_ADDRESS", GETPOST("MAIN_PROFID5_IN_ADDRESS", "nohtml"), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_PROFID6_IN_ADDRESS", GETPOST("MAIN_PROFID6_IN_ADDRESS", "nohtml"), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT", $_POST["MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT"], 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_TVAINTRA_NOT_IN_ADDRESS", $_POST["MAIN_TVAINTRA_NOT_IN_ADDRESS"], 'chaine', 0, '', $conf->entity); @@ -79,6 +80,9 @@ if ($action == 'update') dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_SECOND_TAX", $_POST["MAIN_PDF_MAIN_HIDE_SECOND_TAX"], 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_THIRD_TAX", $_POST["MAIN_PDF_MAIN_HIDE_THIRD_TAX"], 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "PDF_USE_ALSO_LANGUAGE_CODE", GETPOST('PDF_USE_ALSO_LANGUAGE_CODE', 'alpha'), 'chaine', 0, '', $conf->entity); + + header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); exit; } @@ -295,6 +299,16 @@ print ''.$langs->trans("ShowDetailsInPDFPageFoot").'selectarray('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS', $arraydetailsforpdffoot, $conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS); print ''; +print ''.$langs->trans("PDF_USE_ALSO_LANGUAGE_CODE").''; +//if (! empty($conf->global->MAIN_MULTILANGS)) +//{ +print $formadmin->select_language(GETPOSTISSET('PDF_USE_ALSO_LANGUAGE_CODE') ? GETPOST('PDF_USE_ALSO_LANGUAGE_CODE') : $conf->global->PDF_USE_ALSO_LANGUAGE_CODE, 'PDF_USE_ALSO_LANGUAGE_CODE', 0, null, 1); +//} else { +// print ''.$langs->trans("MultiLangNotEnabled").''; +//} +print ''; + + print ''; print '
'; diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 60d4650921b..341772d6de4 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -396,7 +396,7 @@ class pdf_sponge extends ModelePDFFactures if (!empty($tplidx)) $pdf->useTemplate($tplidx); $pagenb++; - $top_shift = $this->_pagehead($pdf, $object, 1, $outputlangs); + $top_shift = $this->_pagehead($pdf, $object, 1, $outputlangs, $outputlangsbis); $pdf->SetFont('', '', $default_font_size - 1); $pdf->MultiCell(0, 3, ''); // Set interline to 3 $pdf->SetTextColor(0, 0, 0); @@ -813,11 +813,11 @@ class pdf_sponge extends ModelePDFFactures while ($pagenb < $pageposafter) { $pdf->setPage($pagenb); if ($pagenb == $pageposbeforeprintlines) { - $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, $hidetop, 1, $object->multicurrency_code); + $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, $hidetop, 1, $object->multicurrency_code, $outputlangsbis); } else { - $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code); + $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code, $outputlangsbis); } $this->_pagefoot($pdf, $object, $outputlangs, 1); $pagenb++; @@ -828,11 +828,11 @@ class pdf_sponge extends ModelePDFFactures if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == $pageposafter) { - $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, $hidetop, 1, $object->multicurrency_code); + $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, $hidetop, 1, $object->multicurrency_code, $outputlangsbis); } else { - $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code); + $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code, $outputlangsbis); } $this->_pagefoot($pdf, $object, $outputlangs, 1); // New page @@ -846,12 +846,12 @@ class pdf_sponge extends ModelePDFFactures // Show square if ($pagenb == $pageposbeforeprintlines) { - $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, $hidetop, 0, $object->multicurrency_code); + $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, $hidetop, 0, $object->multicurrency_code, $outputlangsbis); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } else { - $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0, $object->multicurrency_code); + $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0, $object->multicurrency_code, $outputlangsbis); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } @@ -1797,9 +1797,10 @@ class pdf_sponge extends ModelePDFFactures * @param int $hidetop 1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title * @param int $hidebottom Hide bottom bar of array * @param string $currency Currency code + * @param Translate $outputlangsbis Langs object bis * @return void */ - protected function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0, $currency = '') + protected function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0, $currency = '', $outputlangsbis = null) { global $conf; @@ -1817,6 +1818,10 @@ class pdf_sponge extends ModelePDFFactures if (empty($hidetop)) { $titre = $outputlangs->transnoentities("AmountInCurrency", $outputlangs->transnoentitiesnoconv("Currency".$currency)); + if (! empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && is_object($outputlangsbis)) { + $titre .= ' - '.$outputlangsbis->transnoentities("AmountInCurrency", $outputlangsbis->transnoentitiesnoconv("Currency".$currency)); + } + $pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top - 4); $pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre); @@ -1848,9 +1853,10 @@ class pdf_sponge extends ModelePDFFactures * @param Object $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output + * @param Translate $outputlangsbis Object lang for output bis * @return void */ - protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs) + protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $outputlangsbis = null) { global $conf, $langs; @@ -1920,6 +1926,17 @@ class pdf_sponge extends ModelePDFFactures if ($object->type == 3) $title = $outputlangs->transnoentities("InvoiceDeposit"); if ($object->type == 4) $title = $outputlangs->transnoentities("InvoiceProForma"); if ($this->situationinvoice) $title = $outputlangs->transnoentities("InvoiceSituation"); + if (! empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && is_object($outputlangsbis)) { + $title .= ' - '; + if ($object->type == 0) { + if ($this->situationinvoice) $title .= $outputlangsbis->transnoentities("InvoiceSituation"); + $title .= $outputlangsbis->transnoentities("PdfInvoiceTitle"); + } + elseif ($object->type == 1) $title .= $outputlangsbis->transnoentities("InvoiceReplacement"); + elseif ($object->type == 2) $title .= $outputlangsbis->transnoentities("InvoiceAvoir"); + elseif ($object->type == 3) $title .= $outputlangsbis->transnoentities("InvoiceDeposit"); + elseif ($object->type == 4) $title .= $outputlangsbis->transnoentities("InvoiceProForma"); + } $pdf->MultiCell($w, 3, $title, '', 'R'); $pdf->SetFont('', 'B', $default_font_size); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index f87a2f5ee19..695be00a14e 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1975,4 +1975,5 @@ NotAPublicIp=Not a public IP MakeAnonymousPing=Make an anonymous Ping '+1' to the Dolibarr foundation server (done 1 time only after installation) to allow the foundation to count the number of Dolibarr installation. FeatureNotAvailableWithReceptionModule=Feature not available when module Reception is enabled EmailTemplate=Template for email -EMailsWillHaveMessageID=Emails will have a tag 'References' matching this syntax \ No newline at end of file +EMailsWillHaveMessageID=Emails will have a tag 'References' matching this syntax +PDF_USE_ALSO_LANGUAGE_CODE=If you want to have some text title in your PDF duplicated in 2 different languages in the same generate PDF, you must set here this second language so generated PDF will contains 2 different languages in same page, the one chosen when generating PDF and this one (only few PDF templates support this). Keep empty for 1 language per PDF. \ No newline at end of file From fc170c1081713a7b89e0a3daa6e014a96d5b6aa9 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 11 Feb 2020 15:20:46 +0000 Subject: [PATCH 226/306] Fixing style errors. --- .../class/accountancyexport.class.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index 9b107367129..c7d14d905c9 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -971,16 +971,16 @@ class AccountancyExport print $nature_piece.$separator; // RACI // if (! empty($line->subledger_account)) { -// if ($line->doc_type == 'supplier_invoice') { -// $racine_subledger_account = '40'; -// } elseif ($line->doc_type == 'customer_invoice') { -// $racine_subledger_account = '41'; -// } else { -// $racine_subledger_account = ''; -// } -// } else { + // if ($line->doc_type == 'supplier_invoice') { + // $racine_subledger_account = '40'; + // } elseif ($line->doc_type == 'customer_invoice') { + // $racine_subledger_account = '41'; + // } else { + // $racine_subledger_account = ''; + // } + // } else { $racine_subledger_account = ''; // for records of type E leave this field blank -// } + // } print $racine_subledger_account . $separator; // deprecated CPTG & CPTA use instead // MONT From 9f5f460ae26c3e798f95fdc19da0e441b37637f3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 11 Feb 2020 16:42:48 +0100 Subject: [PATCH 227/306] Fix field def --- htdocs/societe/class/societe.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 08416ed8842..2c78069c7a0 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -130,8 +130,8 @@ class Societe extends CommonObject '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), + 'nom' =>array('type'=>'varchar(128)', 'label'=>'Nom', 'enabled'=>1, 'visible'=>-1, 'position'=>35, 'showoncombobox'=>1), + 'name_alias' =>array('type'=>'varchar(128)', 'label'=>'Name alias', 'enabled'=>1, 'visible'=>-1, 'position'=>36, 'showoncombobox'=>1), '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), From 3c865cbf722937d75c5e036f1fce47a8882d4ef1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 11 Feb 2020 16:51:38 +0100 Subject: [PATCH 228/306] Fix button cancel and re-open --- htdocs/mrp/mo_card.php | 2 +- htdocs/mrp/mo_production.php | 25 +++++++++++++++++++------ 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php index abaf216b7ab..ca3278c241b 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -620,7 +620,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''.$langs->trans("ToClone").''; } - // Cancel + // Cancel - Reopen if ($permissiontoadd) { if ($object->status == $object::STATUS_VALIDATED || $object->status == $object::STATUS_INPROGRESS) diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 873b154ffeb..278b32043d0 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -551,12 +551,25 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''.$langs->trans('ConsumeAndProduceAll').''; } - // Reopen - if ($object->status == Mo::STATUS_PRODUCED) { - if ($permissiontoproduce) { - print ''.$langs->trans('ReOpen').''; - } else { - print ''.$langs->trans('ReOpen').''; + // Cancel - Reopen + if ($permissiontoadd) + { + if ($object->status == $object::STATUS_VALIDATED || $object->status == $object::STATUS_INPROGRESS) + { + print ''.$langs->trans("Cancel").''."\n"; + } + + if ($object->status == $object::STATUS_CANCELED) + { + print ''.$langs->trans("Re-Open").''."\n"; + } + + if ($object->status == $object::STATUS_PRODUCED) { + if ($permissiontoproduce) { + print ''.$langs->trans('ReOpen').''; + } else { + print ''.$langs->trans('ReOpen').''; + } } } } From 02f268ea4e233bac5ec4a4fbacb9ec4c9bec1014 Mon Sep 17 00:00:00 2001 From: John Botella Date: Tue, 11 Feb 2020 16:54:27 +0100 Subject: [PATCH 229/306] FIX - hasDelay for retained warranty --- htdocs/compta/facture/class/facture.class.php | 34 +++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 9172993acc7..9411f543f35 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -4481,15 +4481,40 @@ class Facture extends CommonInvoice // Paid invoices have status STATUS_CLOSED if ($this->statut != Facture::STATUS_VALIDATED) return false; - return $this->date_lim_reglement < ($now - $conf->facture->client->warning_delay); + $hasDelay = $this->date_lim_reglement < ($now - $conf->facture->client->warning_delay); + if($hasDelay && !empty($this->retained_warranty) && !empty($this->retained_warranty_date_limit)) + { + $totalpaye = $this->getSommePaiement(); + $totalpaye = floatval($totalpaye); + $RetainedWarrantyAmount = $this->getRetainedWarrantyAmount(); + if($totalpaye >= 0 && $RetainedWarrantyAmount>= 0) + { + if( ($totalpaye < $this->total_ttc - $RetainedWarrantyAmount) && $this->date_lim_reglement < ($now - $conf->facture->client->warning_delay) ) + { + $hasDelay = 1; + } + elseif($totalpaye < $this->total_ttc && $this->retained_warranty_date_limit < ($now - $conf->facture->client->warning_delay) ) + { + $hasDelay = 1; + } + else + { + $hasDelay = 0; + } + } + } + + return $hasDelay; } /** + * @param int $rounding Minimum number of decimal to show. If 0, no change, if -1, we use min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT) * @return number or -1 if not available */ - public function getRetainedWarrantyAmount() + public function getRetainedWarrantyAmount($rounding = -1) { + global $conf; if (empty($this->retained_warranty)) { return -1; } @@ -4533,6 +4558,11 @@ class Facture extends CommonInvoice $retainedWarrantyAmount = $this->total_ttc * $this->retained_warranty / 100; } + if ($rounding < 0){ + $rounding=min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT); + return round($retainedWarrantyAmount, 2); + } + return $retainedWarrantyAmount; } From bf49e5cee12de73cb447119c2067731f1422c628 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 11 Feb 2020 17:12:22 +0100 Subject: [PATCH 230/306] Show tab of stock movement of MO --- htdocs/mrp/class/mo.class.php | 33 ++++ htdocs/mrp/lib/mrp_mo.lib.php | 9 +- htdocs/mrp/mo_movements.php | 343 ++++++++++++++++++++++++++++++++++ htdocs/mrp/mo_production.php | 17 -- 4 files changed, 384 insertions(+), 18 deletions(-) create mode 100644 htdocs/mrp/mo_movements.php diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 302c995b64e..699cb726a46 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -517,6 +517,39 @@ class Mo extends CommonObject } } + + /** + * Count number of movement with origin of MO + * + * @return int Number of movements + */ + public function countMovements() { + $result = 0; + + $sql = 'SELECT COUNT(rowid) as nb FROM '.MAIN_DB_PREFIX.'stock_mouvement as sm'; + $sql .= " WHERE sm.origintype = 'mo' and sm.fk_origin = ".$this->id; + + $resql = $this->db->query($sql); + if ($resql) { + $num = $this->db->num_rows($resql); + + $i = 0; + while ($i < $num) { + $obj = $this->db->fetch_object($resql); + if ($obj) { + $result = $obj->nb; + } + + $i++; + } + } else { + $this->error = $this->db->lasterror(); + } + + return $result; + } + + /** * Update object into database * diff --git a/htdocs/mrp/lib/mrp_mo.lib.php b/htdocs/mrp/lib/mrp_mo.lib.php index e1813a3f99c..241a036cc44 100644 --- a/htdocs/mrp/lib/mrp_mo.lib.php +++ b/htdocs/mrp/lib/mrp_mo.lib.php @@ -31,7 +31,7 @@ function moPrepareHead($object) { global $db, $langs, $conf; - $langs->load("mrp"); + $langs->loadLangs(array("mrp", "stocks")); $h = 0; $head = array(); @@ -52,6 +52,13 @@ function moPrepareHead($object) $head[$h][2] = 'production'; $h++; + $head[$h][0] = DOL_URL_ROOT.'/mrp/mo_movements.php?id='.$object->id; + $head[$h][1] = $langs->trans("StockMovements"); + $nbMove = $object->countMovements(); + $head[$h][1] .= ''.$nbMove.''; + $head[$h][2] = 'stockmovement'; + $h++; + if (isset($object->fields['note_public']) || isset($object->fields['note_private'])) { $nbNote = 0; diff --git a/htdocs/mrp/mo_movements.php b/htdocs/mrp/mo_movements.php new file mode 100644 index 00000000000..520327f09b3 --- /dev/null +++ b/htdocs/mrp/mo_movements.php @@ -0,0 +1,343 @@ + + * + * 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file mo_movements.php + * \ingroup mrp + * \brief Page to show tock movements of a MO + */ + +//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Do not create database handler $db +//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Do not load object $user +//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); // Do not load object $mysoc +//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Do not load object $langs +//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION','1'); // Do not check injection attack on GET parameters +//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION','1'); // Do not check injection attack on POST parameters +//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). +//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) +//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK','1'); // Do not check style html tag into posted data +//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no need to load and show top and left menu +//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); // If we don't need to load the html.form.class.php +//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); // Do not load ajax.lib.php library +//if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. +//if (! defined('NOIPCHECK')) define('NOIPCHECK','1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT','auto'); // Force lang to a particular value +//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE','aloginmodule'); // Force authentication handler +//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN',1); // The main.inc.php does not make a redirect if not logged, instead show simple error message +//if (! defined("FORCECSP")) define('FORCECSP','none'); // Disable all Content Security Policies + + +// Load Dolibarr environment +require '../main.inc.php'; + +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; +require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; +require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; +require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; +require_once DOL_DOCUMENT_ROOT.'/product/stock/class/productlot.class.php'; +require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; +dol_include_once('/mrp/class/mo.class.php'); +dol_include_once('/mrp/lib/mrp_mo.lib.php'); + +// Load translation files required by the page +$langs->loadLangs(array("mrp", "stocks", "other")); + +// Get parameters +$id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); +$action = GETPOST('action', 'aZ09'); +$confirm = GETPOST('confirm', 'alpha'); +$cancel = GETPOST('cancel', 'aZ09'); +$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'mocard'; // To manage different context of search +$backtopage = GETPOST('backtopage', 'alpha'); +//$lineid = GETPOST('lineid', 'int'); + +$collapse = GETPOST('collapse', 'aZ09comma'); + +// Initialize technical objects +$object = new Mo($db); +$extrafields = new ExtraFields($db); +$diroutputmassaction = $conf->mrp->dir_output.'/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array('mocard', 'globalcard')); // Note that conf->hooks_modules contains array + +// Fetch optionals attributes and labels +$extrafields->fetch_name_optionals_label($object->table_element); + +$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); + +// Initialize array of search criterias +$search_all = trim(GETPOST("search_all", 'alpha')); +$search = array(); +foreach ($object->fields as $key => $val) +{ + if (GETPOST('search_'.$key, 'alpha')) $search[$key] = GETPOST('search_'.$key, 'alpha'); +} + +if (empty($action) && empty($id) && empty($ref)) $action = 'view'; + +// Load object +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. + +// Security check - Protection if external user +//if ($user->socid > 0) accessforbidden(); +//if ($user->socid > 0) $socid = $user->socid; +//$isdraft = (($object->statut == $object::STATUS_DRAFT) ? 1 : 0); +//$result = restrictedArea($user, 'mrp', $object->id, '', '', 'fk_soc', 'rowid', $isdraft); + +$permissionnote = $user->rights->mrp->write; // Used by the include of actions_setnotes.inc.php +$permissiondellink = $user->rights->mrp->write; // Used by the include of actions_dellink.inc.php +$permissiontoadd = $user->rights->mrp->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php +$permissiontodelete = $user->rights->mrp->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); +$upload_dir = $conf->mrp->multidir_output[isset($object->entity) ? $object->entity : 1]; + +$permissiontoproduce = $permissiontoadd; + + +/* + * Actions + */ + +$parameters = array(); +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + +if (empty($reshook)) +{ + $error = 0; + + $backurlforlist = dol_buildpath('/mrp/mo_list.php', 1); + + if (empty($backtopage) || ($cancel && empty($id))) { + //var_dump($backurlforlist);exit; + if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) $backtopage = $backurlforlist; + else $backtopage = DOL_URL_ROOT.'/mrp/mo_production.php?id='.($id > 0 ? $id : '__ID__'); + } + $triggermodname = 'MRP_MO_MODIFY'; // Name of trigger action code to execute when we modify record + + // Actions cancel, add, update, delete or clone + include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; + + // Actions when linking object each other + include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; + + // Actions when printing a doc from card + include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; + + // Actions to send emails + $triggersendname = 'MO_SENTBYMAIL'; + $autocopy = 'MAIN_MAIL_AUTOCOPY_MO_TO'; + $trackid = 'mo'.$object->id; + include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; + + // Action to move up and down lines of object + //include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once + + if ($action == 'set_thirdparty' && $permissiontoadd) + { + $object->setValueFrom('fk_soc', GETPOST('fk_soc', 'int'), '', '', 'date', '', $user, 'MO_MODIFY'); + } + if ($action == 'classin' && $permissiontoadd) + { + $object->setProject(GETPOST('projectid', 'int')); + } + + if ($action == 'confirm_reopen') { + $result = $object->setStatut($object::STATUS_INPROGRESS, 0, '', 'MRP_REOPEN'); + } +} + + + +/* + * View + */ + +$form = new Form($db); +$formproject = new FormProjets($db); +$formproduct = new FormProduct($db); +$tmpwarehouse = new Entrepot($db); +$tmpbatch = new Productlot($db); + +llxHeader('', $langs->trans('Mo'), ''); + +// Part to show record +if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) +{ + $res = $object->fetch_thirdparty(); + $res = $object->fetch_optionals(); + + $head = moPrepareHead($object); + dol_fiche_head($head, 'stockmovement', $langs->trans("MO"), -1, $object->picto); + + $formconfirm = ''; + + // Confirmation to delete + if ($action == 'delete') + { + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteMo'), $langs->trans('ConfirmDeleteMo'), 'confirm_delete', '', 0, 1); + } + // Confirmation to delete line + if ($action == 'deleteline') + { + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1); + } + // Clone confirmation + if ($action == 'clone') { + // Create an array for form + $formquestion = array(); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneMo', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); + } + + // Confirmation of action xxxx + if ($action == 'xxx') + { + $formquestion = array(); + /* + $forcecombo=0; + if ($conf->browser->name == 'ie') $forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy + $formquestion = array( + // 'text' => $langs->trans("ConfirmClone"), + // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), + // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), + // array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1, 0, 0, '', 0, $forcecombo)) + ); + */ + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220); + } + + // Call Hook formConfirm + $parameters = array('formConfirm' => $formconfirm, 'lineid' => $lineid); + $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + if (empty($reshook)) $formconfirm .= $hookmanager->resPrint; + elseif ($reshook > 0) $formconfirm = $hookmanager->resPrint; + + // Print form confirm + print $formconfirm; + + + // Object card + // ------------------------------------------------------------ + $linkback = ''.$langs->trans("BackToList").''; + + $morehtmlref = '
'; + /* + // Ref bis + $morehtmlref.=$form->editfieldkey("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->mrp->creer, 'string', '', 0, 1); + $morehtmlref.=$form->editfieldval("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->mrp->creer, 'string', '', null, null, '', 1);*/ + // Thirdparty + $morehtmlref .= $langs->trans('ThirdParty').' : '.(is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); + // Project + if (!empty($conf->projet->enabled)) + { + $langs->load("projects"); + $morehtmlref .= '
'.$langs->trans('Project').' '; + if ($permissiontoadd) + { + if ($action != 'classify') + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; + if ($action == 'classify') { + //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->fk_soc, $object->fk_project, 'projectid', 0, 0, 1, 1); + $morehtmlref .= ''; + $morehtmlref .= ''; + $morehtmlref .= ''; + $morehtmlref .= $formproject->select_projects($object->fk_soc, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref .= ''; + $morehtmlref .= ''; + } else { + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_soc, $object->fk_project, 'none', 0, 0, 0, 1); + } + } else { + if (!empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref .= $proj->getNomUrl(); + } else { + $morehtmlref .= ''; + } + } + } + $morehtmlref .= '
'; + + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + + + print '
'; + print '
'; + print '
'; + print ''."\n"; + + // Common attributes + $keyforbreak = 'fk_warehouse'; + unset($object->fields['fk_project']); + unset($object->fields['fk_soc']); + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; + + // Other attributes + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; + + print '
'; + print '
'; + print '
'; + + print '
'; + + dol_fiche_end(); + + /* + print '
'; + + $parameters = array(); + // Note that $action and $object may be modified by hook + $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); + if (empty($reshook)) { + // Cancel - Reopen + if ($permissiontoadd) + { + if ($object->status == $object::STATUS_VALIDATED || $object->status == $object::STATUS_INPROGRESS) + { + print ''.$langs->trans("Cancel").''."\n"; + } + + if ($object->status == $object::STATUS_CANCELED) + { + print ''.$langs->trans("Re-Open").''."\n"; + } + + if ($object->status == $object::STATUS_PRODUCED) { + if ($permissiontoproduce) { + print ''.$langs->trans('ReOpen').''; + } else { + print ''.$langs->trans('ReOpen').''; + } + } + } + } + + print '
'; + */ + + + + +} + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index a681aa9166f..5ffb43a662e 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -379,23 +379,6 @@ $tmpbatch = new Productlot($db); llxHeader('', $langs->trans('Mo'), ''); -// Example : Adding jquery code -print ''; - - - // Part to show record if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) { From 27dd9aec9f2877bd977dd270115dfa1c4b99dfd3 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 11 Feb 2020 16:12:48 +0000 Subject: [PATCH 231/306] Fixing style errors. --- htdocs/compta/facture/class/facture.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 9411f543f35..d4a7efd3cf4 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -4559,7 +4559,7 @@ class Facture extends CommonInvoice } if ($rounding < 0){ - $rounding=min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT); + $rounding=min($conf->global->MAIN_MAX_DECIMALS_UNIT, $conf->global->MAIN_MAX_DECIMALS_TOT); return round($retainedWarrantyAmount, 2); } From c6f46e0aec7c3ffcad244a229477e94cfdea42ce Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 11 Feb 2020 17:20:12 +0100 Subject: [PATCH 232/306] Fix look and feel v11 --- htdocs/mrp/mo_agenda.php | 83 ++++++++++++++++++-------------------- htdocs/mrp/mo_document.php | 43 +++++++++++++++++++- htdocs/mrp/mo_note.php | 69 +++++++++++++++---------------- 3 files changed, 115 insertions(+), 80 deletions(-) diff --git a/htdocs/mrp/mo_agenda.php b/htdocs/mrp/mo_agenda.php index 203408ea79e..e0618064c88 100644 --- a/htdocs/mrp/mo_agenda.php +++ b/htdocs/mrp/mo_agenda.php @@ -25,7 +25,9 @@ // Load Dolibarr environment require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; dol_include_once('/mrp/class/mo.class.php'); @@ -118,6 +120,7 @@ if (empty($reshook)) $contactstatic = new Contact($db); $form = new Form($db); +$formproject = new FormProjets($db); if ($object->id > 0) { @@ -136,49 +139,43 @@ if ($object->id > 0) // ------------------------------------------------------------ $linkback = ''.$langs->trans("BackToList").''; - $morehtmlref = ''; - /* - $morehtmlref = '
'; - // Ref customer - $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); - $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); - // Thirdparty - $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); - // Project - if (! empty($conf->projet->enabled)) - { - $langs->load("projects"); - $morehtmlref.='
'.$langs->trans('Project') . ' '; - if ($user->rights->mrp->creer) - { - if ($action != 'classify') - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; - $morehtmlref.=' : '; - if ($action == 'classify') { - //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref.='
'; - $morehtmlref.=''; - $morehtmlref.=''; - $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref.=''; - $morehtmlref.='
'; - } else { - $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); - } - } else { - if (! empty($object->fk_project)) { - $proj = new Project($db); - $proj->fetch($object->fk_project); - $morehtmlref.=''; - $morehtmlref.=$proj->ref; - $morehtmlref.=''; - } else { - $morehtmlref.=''; - } - } - } - $morehtmlref .= '
'; - */ + $morehtmlref='
'; + // Ref customer + //$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); + //$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); + // Thirdparty + $morehtmlref .= $langs->trans('ThirdParty').' : '.(is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); + // Project + if (!empty($conf->projet->enabled)) + { + $langs->load("projects"); + $morehtmlref .= '
'.$langs->trans('Project').' '; + if ($permissiontoadd) + { + if ($action != 'classify') + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; + if ($action == 'classify') { + //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->fk_soc, $object->fk_project, 'projectid', 0, 0, 1, 1); + $morehtmlref .= '
'; + $morehtmlref .= ''; + $morehtmlref .= ''; + $morehtmlref .= $formproject->select_projects($object->fk_soc, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref .= ''; + $morehtmlref .= '
'; + } else { + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_soc, $object->fk_project, 'none', 0, 0, 0, 1); + } + } else { + if (!empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref .= $proj->getNomUrl(); + } else { + $morehtmlref .= ''; + } + } + } + $morehtmlref.='
'; dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); diff --git a/htdocs/mrp/mo_document.php b/htdocs/mrp/mo_document.php index eae4daf67c9..5044af004d2 100644 --- a/htdocs/mrp/mo_document.php +++ b/htdocs/mrp/mo_document.php @@ -24,10 +24,12 @@ // Load Dolibarr environment require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; dol_include_once('/mrp/class/mo.class.php'); dol_include_once('/mrp/lib/mrp_mo.lib.php'); @@ -85,6 +87,7 @@ include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php'; */ $form = new Form($db); +$formproject = new FormProjets($db); $title=$langs->trans("Mo").' - '.$langs->trans("Files"); $help_url=''; @@ -113,12 +116,50 @@ if ($object->id) // ------------------------------------------------------------ $linkback = '' . $langs->trans("BackToList") . ''; + $morehtmlref='
'; + // Ref customer + //$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); + //$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); + // Thirdparty + $morehtmlref .= $langs->trans('ThirdParty').' : '.(is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); + // Project + if (!empty($conf->projet->enabled)) + { + $langs->load("projects"); + $morehtmlref .= '
'.$langs->trans('Project').' '; + if ($permissiontoadd) + { + if ($action != 'classify') + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; + if ($action == 'classify') { + //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->fk_soc, $object->fk_project, 'projectid', 0, 0, 1, 1); + $morehtmlref .= '
'; + $morehtmlref .= ''; + $morehtmlref .= ''; + $morehtmlref .= $formproject->select_projects($object->fk_soc, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref .= ''; + $morehtmlref .= '
'; + } else { + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_soc, $object->fk_project, 'none', 0, 0, 0, 1); + } + } else { + if (!empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref .= $proj->getNomUrl(); + } else { + $morehtmlref .= ''; + } + } + } + $morehtmlref.='
'; + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); print '
'; print '
'; - print ''; + print '
'; // Number of files print ''; diff --git a/htdocs/mrp/mo_note.php b/htdocs/mrp/mo_note.php index f76602580a7..9c15a5fd2ab 100644 --- a/htdocs/mrp/mo_note.php +++ b/htdocs/mrp/mo_note.php @@ -23,6 +23,8 @@ // Load Dolibarr environment require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; dol_include_once('/mrp/class/mo.class.php'); dol_include_once('/mrp/lib/mrp_mo.lib.php'); @@ -72,6 +74,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, */ $form = new Form($db); +$formproject = new FormProjets($db); //$help_url='EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes'; $help_url=''; @@ -89,49 +92,43 @@ if ($id > 0 || ! empty($ref)) // ------------------------------------------------------------ $linkback = '' . $langs->trans("BackToList") . ''; - $morehtmlref = ''; - /* $morehtmlref='
'; // Ref customer - $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); - $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); + //$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); + //$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); + $morehtmlref .= $langs->trans('ThirdParty').' : '.(is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->projet->enabled)) + if (!empty($conf->projet->enabled)) { - $langs->load("projects"); - $morehtmlref.='
'.$langs->trans('Project') . ' '; - if ($user->rights->mrp->creer) - { - if ($action != 'classify') - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; - $morehtmlref.=' : '; - if ($action == 'classify') { - //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref.='
'; - $morehtmlref.=''; - $morehtmlref.=''; - $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref.=''; - $morehtmlref.=''; - } else { - $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); - } - } else { - if (! empty($object->fk_project)) { - $proj = new Project($db); - $proj->fetch($object->fk_project); - $morehtmlref.=''; - $morehtmlref.=$proj->ref; - $morehtmlref.=''; - } else { - $morehtmlref.=''; - } - } + $langs->load("projects"); + $morehtmlref .= '
'.$langs->trans('Project').' '; + if ($permissiontoadd) + { + if ($action != 'classify') + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; + if ($action == 'classify') { + //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->fk_soc, $object->fk_project, 'projectid', 0, 0, 1, 1); + $morehtmlref .= '
'; + $morehtmlref .= ''; + $morehtmlref .= ''; + $morehtmlref .= $formproject->select_projects($object->fk_soc, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref .= ''; + $morehtmlref .= ''; + } else { + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_soc, $object->fk_project, 'none', 0, 0, 0, 1); + } + } else { + if (!empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref .= $proj->getNomUrl(); + } else { + $morehtmlref .= ''; + } + } } $morehtmlref.='
'; - */ dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); From d2bafe3052714ca8379d7c3578541c952d363b88 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 11 Feb 2020 18:18:04 +0100 Subject: [PATCH 233/306] Add tab with stock movements --- htdocs/mrp/mo_movements.php | 558 +++++++++++++++++- .../stock/class/mouvementstock.class.php | 23 + htdocs/product/stock/movement_card.php | 15 +- 3 files changed, 581 insertions(+), 15 deletions(-) diff --git a/htdocs/mrp/mo_movements.php b/htdocs/mrp/mo_movements.php index 520327f09b3..42202cb79ef 100644 --- a/htdocs/mrp/mo_movements.php +++ b/htdocs/mrp/mo_movements.php @@ -47,11 +47,11 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; -require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; +require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; -require_once DOL_DOCUMENT_ROOT.'/product/stock/class/productlot.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; +require_once DOL_DOCUMENT_ROOT.'/product/stock/class/productlot.class.php'; dol_include_once('/mrp/class/mo.class.php'); dol_include_once('/mrp/lib/mrp_mo.lib.php'); @@ -64,11 +64,32 @@ $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); $cancel = GETPOST('cancel', 'aZ09'); -$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'mocard'; // To manage different context of search +$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'mostockmovement'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); //$lineid = GETPOST('lineid', 'int'); -$collapse = GETPOST('collapse', 'aZ09comma'); +$msid = GETPOST('msid', 'int'); +$year = GETPOST("year", 'int'); +$month = GETPOST("month", 'int'); +$search_ref = GETPOST('search_ref', 'alpha'); +$search_movement = GETPOST("search_movement", 'alpha'); +$search_product_ref = trim(GETPOST("search_product_ref", 'alpha')); +$search_product = trim(GETPOST("search_product", 'alpha')); +$search_warehouse = trim(GETPOST("search_warehouse", 'alpha')); +$search_inventorycode = trim(GETPOST("search_inventorycode", 'alpha')); +$search_user = trim(GETPOST("search_user", 'alpha')); +$search_batch = trim(GETPOST("search_batch", 'alpha')); +$search_qty = trim(GETPOST("search_qty", 'alpha')); +$search_type_mouvement = GETPOST('search_type_mouvement', 'int'); + +$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; +$page = GETPOST("page", 'int'); +$sortfield = GETPOST("sortfield", 'alpha'); +$sortorder = GETPOST("sortorder", 'alpha'); +if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 +$offset = $limit * $page; +if (!$sortfield) $sortfield = "m.datem"; +if (!$sortorder) $sortorder = "DESC"; // Initialize technical objects $object = new Mo($db); @@ -100,6 +121,31 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be includ //$isdraft = (($object->statut == $object::STATUS_DRAFT) ? 1 : 0); //$result = restrictedArea($user, 'mrp', $object->id, '', '', 'fk_soc', 'rowid', $isdraft); +$objectlist = new MouvementStock($db); + +// Definition of fields for list +$arrayfields = array( + 'm.rowid'=>array('label'=>$langs->trans("Ref"), 'checked'=>1), + 'm.datem'=>array('label'=>$langs->trans("Date"), 'checked'=>1), + 'p.ref'=>array('label'=>$langs->trans("ProductRef"), 'checked'=>1, 'css'=>'maxwidth100'), + 'p.label'=>array('label'=>$langs->trans("ProductLabel"), 'checked'=>1), + 'm.batch'=>array('label'=>$langs->trans("BatchNumberShort"), 'checked'=>1, 'enabled'=>(!empty($conf->productbatch->enabled))), + 'pl.eatby'=>array('label'=>$langs->trans("EatByDate"), 'checked'=>0, 'position'=>10, 'enabled'=>(!empty($conf->productbatch->enabled))), + 'pl.sellby'=>array('label'=>$langs->trans("SellByDate"), 'checked'=>0, 'position'=>10, 'enabled'=>(!empty($conf->productbatch->enabled))), + 'e.ref'=>array('label'=>$langs->trans("Warehouse"), 'checked'=>1), + 'm.fk_user_author'=>array('label'=>$langs->trans("Author"), 'checked'=>0), + 'm.inventorycode'=>array('label'=>$langs->trans("InventoryCodeShort"), 'checked'=>1), + 'm.label'=>array('label'=>$langs->trans("MovementLabel"), 'checked'=>1), + 'm.type_mouvement'=>array('label'=>$langs->trans("TypeMovement"), 'checked'=>1), + 'origin'=>array('label'=>$langs->trans("Origin"), 'enabled'=>0, 'checked'=>0), + 'm.value'=>array('label'=>$langs->trans("Qty"), 'checked'=>1), + 'm.price'=>array('label'=>$langs->trans("UnitPurchaseValue"), 'enabled'=>0, 'checked'=>0), + //'m.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), + //'m.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500) +); +$objectlist->fields = dol_sort_array($objectlist->fields, 'position'); +$arrayfields = dol_sort_array($arrayfields, 'position'); + $permissionnote = $user->rights->mrp->write; // Used by the include of actions_setnotes.inc.php $permissiondellink = $user->rights->mrp->write; // Used by the include of actions_dellink.inc.php $permissiontoadd = $user->rights->mrp->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php @@ -113,10 +159,35 @@ $permissiontoproduce = $permissiontoadd; * Actions */ +if (GETPOST('cancel', 'alpha')) { $action = 'list'; $massaction = ''; } +if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction = ''; } + $parameters = array(); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; + +// Do we click on purge search criteria ? +if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // Both test are required to be compatible with all browsers +{ + $year = ''; + $month = ''; + $search_ref = ''; + $search_movement = ""; + $search_type_mouvement = ""; + $search_inventorycode = ""; + $search_product_ref = ""; + $search_product = ""; + $search_warehouse = ""; + $search_user = ""; + $search_batch = ""; + $search_qty = ''; + $sall = ""; + $toselect = ''; + $search_array_options = array(); +} + if (empty($reshook)) { $error = 0; @@ -171,8 +242,10 @@ if (empty($reshook)) $form = new Form($db); $formproject = new FormProjets($db); $formproduct = new FormProduct($db); -$tmpwarehouse = new Entrepot($db); -$tmpbatch = new Productlot($db); +$productstatic = new Product($db); +$productlot = new ProductLot($db); +$warehousestatic = new Entrepot($db); +$userstatic = new User($db); llxHeader('', $langs->trans('Mo'), ''); @@ -334,7 +407,480 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea */ + $sql = "SELECT p.rowid, p.ref as product_ref, p.label as produit, p.tobatch, p.fk_product_type as type, p.entity,"; + $sql .= " e.ref as warehouse_ref, e.rowid as entrepot_id, e.lieu,"; + $sql .= " m.rowid as mid, m.value as qty, m.datem, m.fk_user_author, m.label, m.inventorycode, m.fk_origin, m.origintype,"; + $sql .= " m.batch, m.price,"; + $sql .= " m.type_mouvement,"; + $sql .= " pl.rowid as lotid, pl.eatby, pl.sellby,"; + $sql .= " u.login, u.photo, u.lastname, u.firstname"; + // Add fields from extrafields + if (!empty($extrafields->attributes[$objectlist->table_element]['label'])) { + foreach ($extrafields->attributes[$objectlist->table_element]['label'] as $key => $val) $sql .= ($extrafields->attributes[$objectlist->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key : ''); + } + // Add fields from hooks + $parameters = array(); + $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $objectlist may have been modified by hook + $sql .= $hookmanager->resPrint; + $sql .= " FROM ".MAIN_DB_PREFIX."entrepot as e,"; + $sql .= " ".MAIN_DB_PREFIX."product as p,"; + $sql .= " ".MAIN_DB_PREFIX."stock_mouvement as m"; + if (is_array($extrafields->attributes[$objectlist->table_element]['label']) && count($extrafields->attributes[$objectlist->table_element]['label'])) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$objectlist->table_element."_extrafields as ef on (m.rowid = ef.fk_object)"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON m.fk_user_author = u.rowid"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_lot as pl ON m.batch = pl.batch AND m.fk_product = pl.fk_product"; + $sql .= " WHERE m.fk_product = p.rowid"; + $sql .= " AND m.origintype = 'mo' AND m.fk_origin = ".(int) $object->id; + if ($msid > 0) $sql .= " AND m.rowid = ".$msid; + $sql .= " AND m.fk_entrepot = e.rowid"; + $sql .= " AND e.entity IN (".getEntity('stock').")"; + if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) $sql .= " AND p.fk_product_type = 0"; + $sql .= dolSqlDateFilter('m.datem', 0, $month, $year); + if (!empty($search_ref)) $sql .= natural_search('m.rowid', $search_ref, 1); + if (!empty($search_movement)) $sql .= natural_search('m.label', $search_movement); + if (!empty($search_inventorycode)) $sql .= natural_search('m.inventorycode', $search_inventorycode); + if (!empty($search_product_ref)) $sql .= natural_search('p.ref', $search_product_ref); + if (!empty($search_product)) $sql .= natural_search('p.label', $search_product); + if ($search_warehouse != '' && $search_warehouse != '-1') $sql .= natural_search('e.rowid', $search_warehouse, 2); + if (!empty($search_user)) $sql .= natural_search('u.login', $search_user); + if (!empty($search_batch)) $sql .= natural_search('m.batch', $search_batch); + if ($search_qty != '') $sql .= natural_search('m.value', $search_qty, 1); + if ($search_type_mouvement != '' && $search_type_mouvement != '-1') $sql .= natural_search('m.type_mouvement', $search_type_mouvement, 2); + // Add where from extra fields + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; + // Add where from hooks + $parameters = array(); + $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $objectlist may have been modified by hook + $sql .= $hookmanager->resPrint; + $sql .= $db->order($sortfield, $sortorder); + $nbtotalofrecords = ''; + if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) + { + $result = $db->query($sql); + $nbtotalofrecords = $db->num_rows($result); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } + } + $sql .= $db->plimit($limit + 1, $offset); + + $param = ''; + if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage); + if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit); + if ($id > 0) $param .= '&id='.urlencode($id); + if ($search_movement) $param .= '&search_movement='.urlencode($search_movement); + if ($search_inventorycode) $param .= '&search_inventorycode='.urlencode($search_inventorycode); + if ($search_type_mouvement) $param .= '&search_type_mouvement='.urlencode($search_type_mouvement); + if ($search_product_ref) $param .= '&search_product_ref='.urlencode($search_product_ref); + if ($search_product) $param .= '&search_product='.urlencode($search_product); + if ($search_batch) $param .= '&search_batch='.urlencode($search_batch); + if ($search_warehouse > 0) $param .= '&search_warehouse='.urlencode($search_warehouse); + if ($search_user) $param .= '&search_user='.urlencode($search_user); + + // Add $param from extra fields + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; + + // List of mass actions available + $arrayofmassactions = array( + // 'presend'=>$langs->trans("SendByMail"), + // 'builddoc'=>$langs->trans("PDFMerge"), + ); + //if ($user->rights->stock->supprimer) $arrayofmassactions['predelete']=''.$langs->trans("Delete"); + if (in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = array(); + $massactionbutton = $form->selectMassAction('', $arrayofmassactions); + + print '
'; + if ($optioncss != '') print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + if ($id > 0) print ''; + + if ($id > 0) print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, '', 0, '', '', $limit); + else print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'generic', 0, '', '', $limit); + + $moreforfilter = ''; + + $parameters = array(); + $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook + if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint; + else $moreforfilter = $hookmanager->resPrint; + + if (!empty($moreforfilter)) + { + print '
'; + print $moreforfilter; + print '
'; + } + + $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; + $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields + + print '
'; + print '
'.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
'."\n"; + + // Fields title search + print ''; + if (!empty($arrayfields['m.rowid']['checked'])) + { + // Ref + print ''; + } + if (!empty($arrayfields['m.datem']['checked'])) + { + print ''; + } + if (!empty($arrayfields['p.ref']['checked'])) + { + // Product Ref + print ''; + } + if (!empty($arrayfields['p.label']['checked'])) + { + // Product label + print ''; + } + // Batch + if (!empty($arrayfields['m.batch']['checked'])) + { + print ''; + } + if (!empty($arrayfields['pl.eatby']['checked'])) + { + print ''; + } + if (!empty($arrayfields['pl.sellby']['checked'])) + { + print ''; + } + // Warehouse + if (!empty($arrayfields['e.ref']['checked'])) + { + print ''; + } + if (!empty($arrayfields['m.fk_user_author']['checked'])) + { + // Author + print ''; + } + if (!empty($arrayfields['m.inventorycode']['checked'])) + { + // Inventory code + print ''; + } + if (!empty($arrayfields['m.label']['checked'])) + { + // Label of movement + print ''; + } + if (!empty($arrayfields['m.type_mouvement']['checked'])) + { + // Type of movement + print ''; + } + if (!empty($arrayfields['origin']['checked'])) + { + // Origin of movement + print ''; + } + if (!empty($arrayfields['m.value']['checked'])) + { + // Qty + print ''; + } + if (!empty($arrayfields['m.price']['checked'])) + { + // Price + print ''; + } + + + // Extra fields + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; + + // Fields from hook + $parameters = array('arrayfields'=>$arrayfields); + $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + // Date creation + if (!empty($arrayfields['m.datec']['checked'])) + { + print ''; + } + // Date modification + if (!empty($arrayfields['m.tms']['checked'])) + { + print ''; + } + // Actions + print ''; + print "\n"; + + print ''; + if (! empty($arrayfields['m.rowid']['checked'])) + print_liste_field_titre($arrayfields['m.rowid']['label'], $_SERVER["PHP_SELF"], 'm.rowid', '', $param, '', $sortfield, $sortorder); + if (! empty($arrayfields['m.datem']['checked'])) + print_liste_field_titre($arrayfields['m.datem']['label'], $_SERVER["PHP_SELF"], 'm.datem', '', $param, '', $sortfield, $sortorder); + if (! empty($arrayfields['p.ref']['checked'])) + print_liste_field_titre($arrayfields['p.ref']['label'], $_SERVER["PHP_SELF"], 'p.ref', '', $param, '', $sortfield, $sortorder); + if (! empty($arrayfields['p.label']['checked'])) + print_liste_field_titre($arrayfields['p.label']['label'], $_SERVER["PHP_SELF"], 'p.label', '', $param, '', $sortfield, $sortorder); + if (! empty($arrayfields['m.batch']['checked'])) + print_liste_field_titre($arrayfields['m.batch']['label'], $_SERVER["PHP_SELF"], 'm.batch', '', $param, '', $sortfield, $sortorder, 'center '); + if (! empty($arrayfields['pl.eatby']['checked'])) + print_liste_field_titre($arrayfields['pl.eatby']['label'], $_SERVER["PHP_SELF"], 'pl.eatby', '', $param, '', $sortfield, $sortorder, 'center '); + if (! empty($arrayfields['pl.sellby']['checked'])) + print_liste_field_titre($arrayfields['pl.sellby']['label'], $_SERVER["PHP_SELF"], 'pl.sellby', '', $param, '', $sortfield, $sortorder, 'center '); + if (! empty($arrayfields['e.ref']['checked'])) { + // We are on a specific warehouse card, no filter on other should be possible + print_liste_field_titre($arrayfields['e.ref']['label'], $_SERVER["PHP_SELF"], "e.ref", "", $param, "", $sortfield, $sortorder); + } + if (! empty($arrayfields['m.fk_user_author']['checked'])) + print_liste_field_titre($arrayfields['m.fk_user_author']['label'], $_SERVER["PHP_SELF"], "m.fk_user_author", "", $param, "", $sortfield, $sortorder); + if (! empty($arrayfields['m.inventorycode']['checked'])) + print_liste_field_titre($arrayfields['m.inventorycode']['label'], $_SERVER["PHP_SELF"], "m.inventorycode", "", $param, "", $sortfield, $sortorder); + if (! empty($arrayfields['m.label']['checked'])) + print_liste_field_titre($arrayfields['m.label']['label'], $_SERVER["PHP_SELF"], "m.label", "", $param, "", $sortfield, $sortorder); + if (! empty($arrayfields['m.type_mouvement']['checked'])) + print_liste_field_titre($arrayfields['m.type_mouvement']['label'], $_SERVER["PHP_SELF"], "m.type_mouvement", "", $param, '', $sortfield, $sortorder, 'center '); + if (! empty($arrayfields['origin']['checked'])) + print_liste_field_titre($arrayfields['origin']['label'], $_SERVER["PHP_SELF"], "", "", $param, "", $sortfield, $sortorder); + if (! empty($arrayfields['m.value']['checked'])) + print_liste_field_titre($arrayfields['m.value']['label'], $_SERVER["PHP_SELF"], "m.value", "", $param, '', $sortfield, $sortorder, 'right '); + if (! empty($arrayfields['m.price']['checked'])) + print_liste_field_titre($arrayfields['m.price']['label'], $_SERVER["PHP_SELF"], "m.price", "", $param, '', $sortfield, $sortorder, 'right '); + + // Extra fields + include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_search_title.tpl.php'; + + // Hook fields + $parameters = array('arrayfields' => $arrayfields,'param' => $param,'sortfield' => $sortfield,'sortorder' => $sortorder); + $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + if (! empty($arrayfields['m.datec']['checked'])) { + print_liste_field_titre($arrayfields['p.datec']['label'], $_SERVER["PHP_SELF"], "p.datec", "", $param, '', $sortfield, $sortorder, 'center nowrap '); + } + if (! empty($arrayfields['m.tms']['checked'])) { + print_liste_field_titre($arrayfields['p.tms']['label'], $_SERVER["PHP_SELF"], "p.tms", "", $param, '', $sortfield, $sortorder, 'center nowrap '); + } + print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch '); + print "\n"; + + $resql = $db->query($sql); + if (! $resql) { + dol_print_error($db); + } + $num = $db->num_rows($resql); + + $i = 0; + while ($i < ($limit ? min($num, $limit) : $num)) { + $objp = $db->fetch_object($resql); + + $userstatic->id = $objp->fk_user_author; + $userstatic->login = $objp->login; + $userstatic->lastname = $objp->lastname; + $userstatic->firstname = $objp->firstname; + $userstatic->photo = $objp->photo; + + $productstatic->id = $objp->rowid; + $productstatic->ref = $objp->product_ref; + $productstatic->label = $objp->produit; + $productstatic->type = $objp->type; + $productstatic->entity = $objp->entity; + $productstatic->status_batch = $objp->tobatch; + + $productlot->id = $objp->lotid; + $productlot->batch = $objp->batch; + $productlot->eatby = $objp->eatby; + $productlot->sellby = $objp->sellby; + + $warehousestatic->id = $objp->entrepot_id; + $warehousestatic->libelle = $objp->warehouse_ref; // deprecated + $warehousestatic->label = $objp->warehouse_ref; + $warehousestatic->lieu = $objp->lieu; + + if (! empty($objp->fk_origin)) { + $origin = $objectlist->get_origin($objp->fk_origin, $objp->origintype); + } else { + $origin = ''; + } + + print ''; + // Id movement + if (! empty($arrayfields['m.rowid']['checked'])) { + // This is primary not movement id + print ''; + } + if (! empty($arrayfields['m.datem']['checked'])) { + // Date + print ''; + } + if (! empty($arrayfields['p.ref']['checked'])) { + // Product ref + print '\n"; + } + if (! empty($arrayfields['p.label']['checked'])) { + // Product label + print '\n"; + } + if (! empty($arrayfields['m.batch']['checked'])) { + print ''; + } + if (! empty($arrayfields['pl.eatby']['checked'])) { + print ''; + } + if (! empty($arrayfields['pl.sellby']['checked'])) { + print ''; + } + // Warehouse + if (! empty($arrayfields['e.ref']['checked'])) { + print '\n"; + } + // Author + if (! empty($arrayfields['m.fk_user_author']['checked'])) { + print '\n"; + } + if (! empty($arrayfields['m.inventorycode']['checked'])) { + // Inventory code + print ''; + } + if (! empty($arrayfields['m.label']['checked'])) { + // Label of movement + print ''; + } + if (! empty($arrayfields['m.type_mouvement']['checked'])) { + // Type of movement + switch ($objp->type_mouvement) { + case "0": + print ''; + break; + case "1": + print ''; + break; + case "2": + print ''; + break; + case "3": + print ''; + break; + } + } + if (! empty($arrayfields['origin']['checked'])) { + // Origin of movement + print ''; + } + if (! empty($arrayfields['m.value']['checked'])) { + // Qty + print ''; + } + if (! empty($arrayfields['m.price']['checked'])) { + // Price + print ''; + } + // Action column + print ''; + if (! $i) + $totalarray['nbfield'] ++; + + print "\n"; + $i++; + } + $db->free($resql); + + print "
'; + print ''; + print ''; + print ''; + if (empty($conf->productbatch->enabled)) print ' '; + //else print '
'; + $syear = $year ? $year : -1; + print ''; + //print $formother->selectyear($syear,'year',1, 20, 5); + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + //print ''; + print $formproduct->selectWarehouses($search_warehouse, 'search_warehouse', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, null, 'maxwidth200'); + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + //print ''; + print ''; + print ajax_combobox('search_type_mouvement'); + // TODO: add new function $formentrepot->selectTypeOfMovement(...) like + // print $formproduct->selectWarehouses($search_warehouse, 'search_warehouse', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, null, 'maxwidth200'); + print ''; + print '  '; + print ''; + print ''; + print ''; + print '  '; + print ''; + print ''; + print ''; + $searchpicto = $form->showFilterAndCheckAddButtons(0); + print $searchpicto; + print '
' . $objp->mid . '' . dol_print_date($db->jdate($objp->datem), 'dayhour') . ''; + print $productstatic->getNomUrl(1, 'stock', 16); + print "'; + /* + * $productstatic->id=$objp->rowid; + * $productstatic->ref=$objp->produit; + * $productstatic->type=$objp->type; + * print $productstatic->getNomUrl(1,'',16); + */ + print $productstatic->label; + print "'; + if ($productlot->id > 0) + print $productlot->getNomUrl(1); + else + print $productlot->batch; // the id may not be defined if movement was entered when lot was not saved or if lot was removed after movement. + print '' . dol_print_date($objp->eatby, 'day') . '' . dol_print_date($objp->sellby, 'day') . ''; + print $warehousestatic->getNomUrl(1); + print "'; + print $userstatic->getNomUrl(- 1); + print "'; + //print ''; + print $objp->inventorycode; + //print ''; + print '' . $objp->label . '' . $langs->trans('StockIncreaseAfterCorrectTransfer') . '' . $langs->trans('StockDecreaseAfterCorrectTransfer') . '' . $langs->trans('StockDecrease') . '' . $langs->trans('StockIncrease') . '' . $origin . ''; + if ($objp->qt > 0) + print '+'; + print $objp->qty; + print ''; + if ($objp->price != 0) + print price($objp->price); + print ''; + if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + { + $selected = 0; + if (in_array($obj->rowid, $arrayofselected)) + $selected = 1; + print ''; + } + print '
"; + print '
'; + print ""; } diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 9364dd21fca..64871b12d17 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -77,6 +77,29 @@ class MouvementStock extends CommonObject public $batch; + public $fields=array( + 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10, 'showoncombobox'=>1), + 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>15), + 'datem' =>array('type'=>'datetime', 'label'=>'Datem', 'enabled'=>1, 'visible'=>-1, 'position'=>20), + 'fk_product' =>array('type'=>'integer:Product:product/class/product.class.php:1', 'label'=>'Product', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>25), + 'fk_entrepot' =>array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php', 'label'=>'Warehouse', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>30), + 'value' =>array('type'=>'double', 'label'=>'Value', 'enabled'=>1, 'visible'=>-1, 'position'=>35), + 'price' =>array('type'=>'double(24,8)', 'label'=>'Price', 'enabled'=>1, 'visible'=>-1, 'position'=>40), + 'type_mouvement' =>array('type'=>'smallint(6)', 'label'=>'Type mouvement', 'enabled'=>1, 'visible'=>-1, 'position'=>45), + 'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk user author', 'enabled'=>1, 'visible'=>-1, 'position'=>50), + 'label' =>array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>-1, 'position'=>55), + 'fk_origin' =>array('type'=>'integer', 'label'=>'Fk origin', 'enabled'=>1, 'visible'=>-1, 'position'=>60), + 'origintype' =>array('type'=>'varchar(32)', 'label'=>'Origintype', 'enabled'=>1, 'visible'=>-1, 'position'=>65), + 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>70), + 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>75), + 'inventorycode' =>array('type'=>'varchar(128)', 'label'=>'InventoryCode', 'enabled'=>1, 'visible'=>-1, 'position'=>80), + 'batch' =>array('type'=>'varchar(30)', 'label'=>'Batch', 'enabled'=>1, 'visible'=>-1, 'position'=>85), + 'eatby' =>array('type'=>'date', 'label'=>'Eatby', 'enabled'=>1, 'visible'=>-1, 'position'=>90), + 'sellby' =>array('type'=>'date', 'label'=>'Sellby', 'enabled'=>1, 'visible'=>-1, 'position'=>95), + 'fk_project' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Fk project', 'enabled'=>1, 'visible'=>-1, 'position'=>100), + ); + + /** * Constructor diff --git a/htdocs/product/stock/movement_card.php b/htdocs/product/stock/movement_card.php index d1cb6a8dbde..b7746e81e66 100644 --- a/htdocs/product/stock/movement_card.php +++ b/htdocs/product/stock/movement_card.php @@ -99,7 +99,7 @@ $arrayfields = array( 'p.ref'=>array('label'=>$langs->trans("ProductRef"), 'checked'=>1, 'css'=>'maxwidth100'), 'p.label'=>array('label'=>$langs->trans("ProductLabel"), 'checked'=>1), 'm.batch'=>array('label'=>$langs->trans("BatchNumberShort"), 'checked'=>1, 'enabled'=>(!empty($conf->productbatch->enabled))), - 'pl.eatby'=>array('label'=>$langs->trans("EatByDate"), 'checked'=>0, 'enabled'=>(!empty($conf->productbatch->enabled))), + 'pl.eatby'=>array('label'=>$langs->trans("EatByDate"), 'checked'=>0, 'position'=>10, 'enabled'=>(!empty($conf->productbatch->enabled))), 'pl.sellby'=>array('label'=>$langs->trans("SellByDate"), 'checked'=>0, 'position'=>10, 'enabled'=>(!empty($conf->productbatch->enabled))), 'e.ref'=>array('label'=>$langs->trans("Warehouse"), 'checked'=>1, 'enabled'=>(!$id > 0)), // If we are on specific warehouse, we hide it 'm.fk_user_author'=>array('label'=>$langs->trans("Author"), 'checked'=>0), @@ -113,16 +113,16 @@ $arrayfields = array( //'m.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500) ); +$usercanread = (($user->rights->stock->mouvement->lire)); +$usercancreate = (($user->rights->stock->mouvement->creer)); +$usercandelete = (($user->rights->stock->mouvement->supprimer)); + /* * Actions */ -$usercanread = (($user->rights->stock->mouvement->lire)); -$usercancreate = (($user->rights->stock->mouvement->creer)); -$usercandelete = (($user->rights->stock->mouvement->supprimer)); - if (GETPOST('cancel', 'alpha')) { $action = 'list'; $massaction = ''; } if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction = ''; } @@ -702,8 +702,6 @@ if ($resql) if ($search_product) $param .= '&search_product='.urlencode($search_product); if ($search_batch) $param .= '&search_batch='.urlencode($search_batch); if ($search_warehouse > 0) $param .= '&search_warehouse='.urlencode($search_warehouse); - if (!empty($sref)) $param .= '&sref='.urlencode($sref); // FIXME $sref is not defined - if (!empty($snom)) $param .= '&snom='.urlencode($snom); // FIXME $snom is not defined if ($search_user) $param .= '&search_user='.urlencode($search_user); if ($idproduct > 0) $param .= '&idproduct='.urlencode($idproduct); // Add $param from extra fields @@ -726,7 +724,6 @@ if ($resql) print ''; print ''; print ''; - print ''; print ''; if ($id > 0) print ''; @@ -956,7 +953,7 @@ if ($resql) $arrayofuniqueproduct = array(); - while ($i < min($num, $limit)) { + while ($i < ($limit ? min($num, $limit) : $num)) { $objp = $db->fetch_object($resql); $userstatic->id = $objp->fk_user_author; From aa9ffbba052779595b380f0dc172b328c04e4b25 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 11 Feb 2020 19:18:36 +0100 Subject: [PATCH 234/306] Fix missing fields property --- .../class/fournisseur.commande.class.php | 54 +++++++++++++++++++ .../fourn/class/fournisseur.facture.class.php | 53 ++++++++++++++++++ 2 files changed, 107 insertions(+) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 3b2833fee76..5a7d4e07f92 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -183,6 +183,60 @@ class CommandeFournisseur extends CommonOrder public $multicurrency_total_tva; public $multicurrency_total_ttc; + + + public $fields=array( + 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10), + 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>15), + 'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>20), + 'ref' =>array('type'=>'varchar(255)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>-1, 'showoncombobox'=>1, 'position'=>25), + 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>30, 'index'=>1), + 'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'Ref ext', 'enabled'=>1, 'visible'=>0, 'position'=>35), + 'ref_supplier' =>array('type'=>'varchar(255)', 'label'=>'RefSupplier', 'enabled'=>1, 'visible'=>-1, 'position'=>40), + 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Fk projet', 'enabled'=>1, 'visible'=>-1, 'position'=>45), + 'date_creation' =>array('type'=>'datetime', 'label'=>'Date creation', 'enabled'=>1, 'visible'=>-1, 'position'=>50), + 'date_valid' =>array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>55), + 'date_approve' =>array('type'=>'datetime', 'label'=>'Date approve', 'enabled'=>1, 'visible'=>-1, 'position'=>60), + 'date_approve2' =>array('type'=>'datetime', 'label'=>'Date approve2', 'enabled'=>1, 'visible'=>-1, 'position'=>65), + 'date_commande' =>array('type'=>'date', 'label'=>'Date commande', 'enabled'=>1, 'visible'=>-1, 'position'=>70), + 'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk user author', 'enabled'=>1, 'visible'=>-1, 'position'=>75), + 'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>80), + 'fk_user_valid' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>85), + 'fk_user_approve' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserApproval', 'enabled'=>1, 'visible'=>-1, 'position'=>90), + 'fk_user_approve2' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserSecondApproval', 'enabled'=>1, 'visible'=>-1, 'position'=>95), + 'source' =>array('type'=>'smallint(6)', 'label'=>'Source', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>100), + 'billed' =>array('type'=>'smallint(6)', 'label'=>'Billed', 'enabled'=>1, 'visible'=>-1, 'position'=>110), + 'amount_ht' =>array('type'=>'double(24,8)', 'label'=>'Amount ht', 'enabled'=>1, 'visible'=>-1, 'position'=>115), + 'remise_percent' =>array('type'=>'double', 'label'=>'Remise percent', 'enabled'=>1, 'visible'=>-1, 'position'=>120), + 'remise' =>array('type'=>'double', 'label'=>'Remise', 'enabled'=>1, 'visible'=>-1, 'position'=>125), + 'tva' =>array('type'=>'double(24,8)', 'label'=>'Tva', 'enabled'=>1, 'visible'=>-1, 'position'=>130, 'isameasure'=>1), + 'localtax1' =>array('type'=>'double(24,8)', 'label'=>'Localtax1', 'enabled'=>1, 'visible'=>-1, 'position'=>135, 'isameasure'=>1), + 'localtax2' =>array('type'=>'double(24,8)', 'label'=>'Localtax2', 'enabled'=>1, 'visible'=>-1, 'position'=>140, 'isameasure'=>1), + 'total_ht' =>array('type'=>'double(24,8)', 'label'=>'TotalHT', 'enabled'=>1, 'visible'=>-1, 'position'=>145, 'isameasure'=>1), + 'total_ttc' =>array('type'=>'double(24,8)', 'label'=>'TotalTTC', 'enabled'=>1, 'visible'=>-1, 'position'=>150, 'isameasure'=>1), + 'note_private' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>155), + 'note_public' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>160), + 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'ModelPDF', 'enabled'=>1, 'visible'=>0, 'position'=>165), + 'fk_input_method' =>array('type'=>'integer', 'label'=>'InputMethod', 'enabled'=>1, 'visible'=>-1, 'position'=>170), + 'fk_cond_reglement' =>array('type'=>'integer', 'label'=>'PaymentTerm', 'enabled'=>1, 'visible'=>-1, 'position'=>175), + 'fk_mode_reglement' =>array('type'=>'integer', 'label'=>'PaymentMode', 'enabled'=>1, 'visible'=>-1, 'position'=>180), + 'extraparams' =>array('type'=>'varchar(255)', 'label'=>'Extraparams', 'enabled'=>1, 'visible'=>-1, 'position'=>190), + 'date_livraison' =>array('type'=>'datetime', 'label'=>'DeliveryDate', 'enabled'=>1, 'visible'=>-1, 'position'=>195), + 'fk_account' =>array('type'=>'integer', 'label'=>'Fk account', 'enabled'=>1, 'visible'=>-1, 'position'=>200), + 'fk_incoterms' =>array('type'=>'integer', 'label'=>'IncotermCode', 'enabled'=>1, 'visible'=>-1, 'position'=>205), + 'location_incoterms' =>array('type'=>'varchar(255)', 'label'=>'IncotermLocation', 'enabled'=>1, 'visible'=>-1, 'position'=>210), + 'fk_multicurrency' =>array('type'=>'integer', 'label'=>'Fk multicurrency', 'enabled'=>1, 'visible'=>-1, 'position'=>215), + 'multicurrency_code' =>array('type'=>'varchar(255)', 'label'=>'MulticurrencyCode', 'enabled'=>1, 'visible'=>-1, 'position'=>220), + 'multicurrency_tx' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyRate', 'enabled'=>1, 'visible'=>-1, 'position'=>225), + 'multicurrency_total_ht' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyTotalHT', 'enabled'=>1, 'visible'=>-1, 'position'=>230), + 'multicurrency_total_tva' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyTotalVAT', 'enabled'=>1, 'visible'=>-1, 'position'=>235), + 'multicurrency_total_ttc' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyTotalTTC', 'enabled'=>1, 'visible'=>-1, 'position'=>240), + 'last_main_doc' =>array('type'=>'varchar(255)', 'label'=>'LastMainDoc', 'enabled'=>1, 'visible'=>-1, 'position'=>245), + 'fk_statut' =>array('type'=>'smallint(6)', 'label'=>'Status', 'enabled'=>1, 'visible'=>-1, 'position'=>500), + 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>900), + ); + + /** * Draft status */ diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 70b65d823ce..8b07b0fbebe 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -217,6 +217,59 @@ class FactureFournisseur extends CommonInvoice */ public $fk_facture_source; + + public $fields=array( + 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10), + 'ref' =>array('type'=>'varchar(255)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'showoncombobox'=>1, 'position'=>15), + 'ref_supplier' =>array('type'=>'varchar(255)', 'label'=>'RefSupplier', 'enabled'=>1, 'visible'=>-1, 'position'=>20), + 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>25, 'index'=>1), + 'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'RefExt', 'enabled'=>1, 'visible'=>0, 'position'=>30), + 'type' =>array('type'=>'smallint(6)', 'label'=>'Type', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>35), + 'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>40), + 'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>45), + 'datef' =>array('type'=>'date', 'label'=>'Date', 'enabled'=>1, 'visible'=>-1, 'position'=>50), + 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>55), + 'libelle' =>array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>-1, 'position'=>60), + 'paye' =>array('type'=>'smallint(6)', 'label'=>'Paye', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>65), + 'amount' =>array('type'=>'double(24,8)', 'label'=>'Amount', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>70), + 'remise' =>array('type'=>'double(24,8)', 'label'=>'Discount', 'enabled'=>1, 'visible'=>-1, 'position'=>75), + 'close_code' =>array('type'=>'varchar(16)', 'label'=>'CloseCode', 'enabled'=>1, 'visible'=>-1, 'position'=>80), + 'close_note' =>array('type'=>'varchar(128)', 'label'=>'CloseNote', 'enabled'=>1, 'visible'=>-1, 'position'=>85), + 'tva' =>array('type'=>'double(24,8)', 'label'=>'Tva', 'enabled'=>1, 'visible'=>-1, 'position'=>90), + 'localtax1' =>array('type'=>'double(24,8)', 'label'=>'Localtax1', 'enabled'=>1, 'visible'=>-1, 'position'=>95), + 'localtax2' =>array('type'=>'double(24,8)', 'label'=>'Localtax2', 'enabled'=>1, 'visible'=>-1, 'position'=>100), + 'total_ht' =>array('type'=>'double(24,8)', 'label'=>'TotalHT', 'enabled'=>1, 'visible'=>-1, 'position'=>105), + 'total_tva' =>array('type'=>'double(24,8)', 'label'=>'TotalVAT', 'enabled'=>1, 'visible'=>-1, 'position'=>110), + 'total_ttc' =>array('type'=>'double(24,8)', 'label'=>'TotalTTC', 'enabled'=>1, 'visible'=>-1, 'position'=>115), + 'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-1, 'position'=>125), + 'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>130), + 'fk_user_valid' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>135), + 'fk_facture_source' =>array('type'=>'integer', 'label'=>'Fk facture source', 'enabled'=>1, 'visible'=>-1, 'position'=>140), + 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>1, 'visible'=>-1, 'position'=>145), + 'fk_account' =>array('type'=>'integer', 'label'=>'Account', 'enabled'=>1, 'visible'=>-1, 'position'=>150), + 'fk_cond_reglement' =>array('type'=>'integer', 'label'=>'PaymentTerm', 'enabled'=>1, 'visible'=>-1, 'position'=>155), + 'fk_mode_reglement' =>array('type'=>'integer', 'label'=>'PaymentMode', 'enabled'=>1, 'visible'=>-1, 'position'=>160), + 'date_lim_reglement' =>array('type'=>'date', 'label'=>'DateLimReglement', 'enabled'=>1, 'visible'=>-1, 'position'=>165), + 'note_private' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>170), + 'note_public' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>175), + 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'ModelPdf', 'enabled'=>1, 'visible'=>0, 'position'=>180), + 'extraparams' =>array('type'=>'varchar(255)', 'label'=>'Extraparams', 'enabled'=>1, 'visible'=>-1, 'position'=>190), + 'fk_incoterms' =>array('type'=>'integer', 'label'=>'IncotermCode', 'enabled'=>1, 'visible'=>-1, 'position'=>195), + 'location_incoterms' =>array('type'=>'varchar(255)', 'label'=>'IncotermLocation', 'enabled'=>1, 'visible'=>-1, 'position'=>200), + 'fk_multicurrency' =>array('type'=>'integer', 'label'=>'MulticurrencyId', 'enabled'=>1, 'visible'=>-1, 'position'=>205), + 'multicurrency_code' =>array('type'=>'varchar(255)', 'label'=>'MulticurrencyCode', 'enabled'=>1, 'visible'=>-1, 'position'=>210), + 'multicurrency_tx' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyRate', 'enabled'=>1, 'visible'=>-1, 'position'=>215), + 'multicurrency_total_ht' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyTotalHT', 'enabled'=>1, 'visible'=>-1, 'position'=>220), + 'multicurrency_total_tva' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyTotalVAT', 'enabled'=>1, 'visible'=>-1, 'position'=>225), + 'multicurrency_total_ttc' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyTotalTTC', 'enabled'=>1, 'visible'=>-1, 'position'=>230), + 'date_pointoftax' =>array('type'=>'date', 'label'=>'Date pointoftax', 'enabled'=>1, 'visible'=>-1, 'position'=>235), + 'date_valid' =>array('type'=>'date', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>240), + 'last_main_doc' =>array('type'=>'varchar(255)', 'label'=>'Last main doc', 'enabled'=>1, 'visible'=>-1, 'position'=>245), + 'fk_statut' =>array('type'=>'smallint(6)', 'label'=>'Status', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>500), + 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>900), + ); + + /** * Standard invoice */ From 2afe86a1d6cccb338e995709fa20035fc6f8cef1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 11 Feb 2020 19:19:13 +0100 Subject: [PATCH 235/306] Fix look and feel v11 --- htdocs/core/tpl/admin_extrafields_add.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/admin_extrafields_add.tpl.php b/htdocs/core/tpl/admin_extrafields_add.tpl.php index 37ca5e1ec10..e695c7aa95f 100644 --- a/htdocs/core/tpl/admin_extrafields_add.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_add.tpl.php @@ -148,7 +148,7 @@ $langs->load("modulebuilder"); trans("LabelOrTranslationKey"); ?> -trans("AttributeCode"); ?> (trans("AlphaNumOnlyLowerCharsAndNoSpace"); ?>) +trans("AttributeCode"); ?> (trans("AlphaNumOnlyLowerCharsAndNoSpace"); ?>) trans("Type"); ?> selectarray('type', $type2label, GETPOST('type', 'alpha')); ?> From cc6313cdf3e37f32aa4bd57fb370fdef1f006c6c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 11 Feb 2020 19:32:27 +0100 Subject: [PATCH 236/306] Fix import examples --- htdocs/core/modules/modUser.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/modUser.class.php b/htdocs/core/modules/modUser.class.php index 6e5924945c9..449ad1f5cf4 100644 --- a/htdocs/core/modules/modUser.class.php +++ b/htdocs/core/modules/modUser.class.php @@ -314,7 +314,8 @@ class modUser extends DolibarrModules 'u.birth'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$' ); $this->import_examplevalues_array[$r]=array( - 'u.lastname'=>"Doe", 'u.firstname'=>'John', 'u.login'=>'jdoe', 'u.employee'=>'0 or 1', + 'u.lastname'=>"Doe", 'u.firstname'=>'John', 'u.login'=>'jdoe', 'u.employee'=>'0 or 1', 'u.job'=>'CTO', 'u.gender'=>'0 or 1', + 'u.pass_crypted'=>'Encrypted password', 'u.fk_soc'=>'0 (internal user) or company name (external user)', 'u.datec'=>dol_print_date(dol_now(), '%Y-%m-%d'), 'u.address'=>"61 jump street", 'u.zip'=>"123456",'u.town'=>"Big town",'u.fk_country'=>'US, FR, DE...','u.office_phone'=>"0101010101",'u.office_fax'=>"0101010102", 'u.email'=>"test@mycompany.com",'u.salary'=>"10000",'u.note'=>"This is an example of note for record",'u.datec'=>"2015-01-01 or 2015-01-01 12:30:00", From 92dc43de93469ed48fc1dc5e9092f5607fb465fd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 11 Feb 2020 19:37:24 +0100 Subject: [PATCH 237/306] Fix phpcs --- htdocs/mrp/class/mo.class.php | 3 ++- htdocs/mrp/mo_agenda.php | 22 +++++++++++----------- htdocs/mrp/mo_document.php | 22 +++++++++++----------- htdocs/mrp/mo_movements.php | 1 - htdocs/mrp/mo_note.php | 24 ++++++++++++------------ 5 files changed, 36 insertions(+), 36 deletions(-) diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 699cb726a46..52c02b0f762 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -523,7 +523,8 @@ class Mo extends CommonObject * * @return int Number of movements */ - public function countMovements() { + public function countMovements() + { $result = 0; $sql = 'SELECT COUNT(rowid) as nb FROM '.MAIN_DB_PREFIX.'stock_mouvement as sm'; diff --git a/htdocs/mrp/mo_agenda.php b/htdocs/mrp/mo_agenda.php index e0618064c88..4d34037704f 100644 --- a/htdocs/mrp/mo_agenda.php +++ b/htdocs/mrp/mo_agenda.php @@ -154,17 +154,17 @@ if ($object->id > 0) { if ($action != 'classify') $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; - if ($action == 'classify') { - //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->fk_soc, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref .= '
'; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->fk_soc, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $morehtmlref .= '
'; - } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_soc, $object->fk_project, 'none', 0, 0, 0, 1); - } + if ($action == 'classify') { + //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->fk_soc, $object->fk_project, 'projectid', 0, 0, 1, 1); + $morehtmlref .= '
'; + $morehtmlref .= ''; + $morehtmlref .= ''; + $morehtmlref .= $formproject->select_projects($object->fk_soc, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref .= ''; + $morehtmlref .= '
'; + } else { + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_soc, $object->fk_project, 'none', 0, 0, 0, 1); + } } else { if (!empty($object->fk_project)) { $proj = new Project($db); diff --git a/htdocs/mrp/mo_document.php b/htdocs/mrp/mo_document.php index 5044af004d2..2bf6636cd6f 100644 --- a/htdocs/mrp/mo_document.php +++ b/htdocs/mrp/mo_document.php @@ -131,17 +131,17 @@ if ($object->id) { if ($action != 'classify') $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; - if ($action == 'classify') { - //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->fk_soc, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref .= '
'; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->fk_soc, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $morehtmlref .= '
'; - } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_soc, $object->fk_project, 'none', 0, 0, 0, 1); - } + if ($action == 'classify') { + //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->fk_soc, $object->fk_project, 'projectid', 0, 0, 1, 1); + $morehtmlref .= '
'; + $morehtmlref .= ''; + $morehtmlref .= ''; + $morehtmlref .= $formproject->select_projects($object->fk_soc, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref .= ''; + $morehtmlref .= '
'; + } else { + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_soc, $object->fk_project, 'none', 0, 0, 0, 1); + } } else { if (!empty($object->fk_project)) { $proj = new Project($db); diff --git a/htdocs/mrp/mo_movements.php b/htdocs/mrp/mo_movements.php index 42202cb79ef..ace336b7d29 100644 --- a/htdocs/mrp/mo_movements.php +++ b/htdocs/mrp/mo_movements.php @@ -881,7 +881,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ""; print '
'; print ""; - } // End of page diff --git a/htdocs/mrp/mo_note.php b/htdocs/mrp/mo_note.php index 9c15a5fd2ab..99d9d62d6dc 100644 --- a/htdocs/mrp/mo_note.php +++ b/htdocs/mrp/mo_note.php @@ -18,7 +18,7 @@ /** * \file mo_note.php * \ingroup mrp - * \brief Car with notes on Mo + * \brief Card with notes on Mo */ // Load Dolibarr environment @@ -107,17 +107,17 @@ if ($id > 0 || ! empty($ref)) { if ($action != 'classify') $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; - if ($action == 'classify') { - //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->fk_soc, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref .= '
'; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->fk_soc, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $morehtmlref .= '
'; - } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_soc, $object->fk_project, 'none', 0, 0, 0, 1); - } + if ($action == 'classify') { + //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->fk_soc, $object->fk_project, 'projectid', 0, 0, 1, 1); + $morehtmlref .= '
'; + $morehtmlref .= ''; + $morehtmlref .= ''; + $morehtmlref .= $formproject->select_projects($object->fk_soc, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref .= ''; + $morehtmlref .= '
'; + } else { + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_soc, $object->fk_project, 'none', 0, 0, 0, 1); + } } else { if (!empty($object->fk_project)) { $proj = new Project($db); From 5459e4b821df1f24e256c56bc311fb98470cf5c2 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 11 Feb 2020 20:11:37 +0100 Subject: [PATCH 238/306] Fix netmeasure update and display nb: netmeasure is for real weight, volume or piece; i'll try to introduce in v12 price by unit using this value ( needed for some business ie fruits, vegetables....) --- htdocs/product/card.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 6d36495d5fc..f62979f96d3 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -17,7 +17,7 @@ * Copyright (C) 2016 Meziane Sof * Copyright (C) 2017 Josep Lluís Amador * Copyright (C) 2019 Frédéric France - * Copyright (C) 2019 Thibault FOUCART + * Copyright (C) 2019-2020 Thibault FOUCART * * 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 @@ -1513,7 +1513,7 @@ else // Net Measure print ''.$langs->trans("NetMeasure").''; print ' '; - print $formproduct->selectMeasuringUnits($object->net_measure_units, '', 0, 0, 0); + print $formproduct->selectMeasuringUnits("net_measure_units", "", $object->net_measure_units, 0, 0); print ''; } } @@ -1955,7 +1955,7 @@ else print ''.$langs->trans("NetMeasure").''; if ($object->net_measure != '') { - print $object->net_measure." ".measuringUnitString(0, "weight", $object->net_measure_units); + print $object->net_measure." ".measuringUnitString($object->net_measure_units, "", ""); } else { From 558ccdd8b9ee4edfb1f524cfa81f56ee56f8fc10 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 11 Feb 2020 20:20:34 +0100 Subject: [PATCH 239/306] Update card.php --- htdocs/product/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index f62979f96d3..9d126ca96d9 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1955,7 +1955,7 @@ else print ''.$langs->trans("NetMeasure").''; if ($object->net_measure != '') { - print $object->net_measure." ".measuringUnitString($object->net_measure_units, "", ""); + print $object->net_measure." ".measuringUnitString($object->net_measure_units); } else { From f17c7f4cb3ca1914282a619e0758c765327304e0 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 11 Feb 2020 20:21:53 +0100 Subject: [PATCH 240/306] fix for unit with rowid (netmeasure) --- htdocs/core/lib/product.lib.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index 9cf28ff20ee..f58af3500c0 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -520,7 +520,14 @@ function measuringUnitString($unit, $measuring_style = '', $scale = '', $use_sho require_once DOL_DOCUMENT_ROOT.'/core/class/cunits.class.php'; $measuringUnits= new CUnits($db); - if ($scale !== '') + if ($measuring_style == '' && $scale == '') + { + $arrayforfilter = array( + 't.rowid' => $unit, + 't.active' => 1 + ); + } + elseif ($scale !== '') { $arrayforfilter = array( 't.scale' => $scale, From c7181830fc3539f0388f8e68dff097997a90bf26 Mon Sep 17 00:00:00 2001 From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Date: Wed, 12 Feb 2020 09:11:39 +0100 Subject: [PATCH 241/306] Fix the display of the banner with multicompany Before : if a account of a entity require to define the Journal code, Banner displayed in all entities. Now : Show the banner only in the entity concerned. --- htdocs/accountancy/journal/bankjournal.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 16996358425..2c59d677d96 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -972,7 +972,7 @@ if (empty($action) || $action == 'view') { // Test that setup is complete - $sql = 'SELECT COUNT(rowid) as nb FROM '.MAIN_DB_PREFIX.'bank_account WHERE fk_accountancy_journal IS NULL AND clos=0'; + $sql = 'SELECT COUNT(rowid) as nb FROM '.MAIN_DB_PREFIX.'bank_account WHERE entity IN ('.getEntity('bank_account').') AND fk_accountancy_journal IS NULL AND clos=0'; $resql = $db->query($sql); if ($resql) { From de8660fb5581d557bbb3e920a3fb4b3165fba171 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio Date: Wed, 12 Feb 2020 12:09:03 +0100 Subject: [PATCH 242/306] FIX: situation invoice: allow excess paid to be converted to discount --- htdocs/compta/facture/card.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 62f5899c025..d99e26a65be 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -682,7 +682,7 @@ if (empty($reshook)) $canconvert=0; if ($object->type == Facture::TYPE_DEPOSIT && empty($discountcheck->id)) $canconvert=1; // we can convert deposit into discount if deposit is payed (completely, partially or not at all) and not already converted (see real condition into condition used to show button converttoreduc) - if (($object->type == Facture::TYPE_CREDIT_NOTE || $object->type == Facture::TYPE_STANDARD) && $object->paye == 0 && empty($discountcheck->id)) $canconvert=1; // we can convert credit note into discount if credit note is not payed back and not already converted and amount of payment is 0 (see real condition into condition used to show button converttoreduc) + if (($object->type == Facture::TYPE_CREDIT_NOTE || $object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_SITUATION) && $object->paye == 0 && empty($discountcheck->id)) $canconvert=1; // we can convert credit note into discount if credit note is not payed back and not already converted and amount of payment is 0 (see real condition into condition used to show button converttoreduc) if ($canconvert) { $db->begin(); @@ -3409,7 +3409,7 @@ else if ($id > 0 || ! empty($ref)) // Confirmation de la conversion de l'avoir en reduc if ($action == 'converttoreduc') { - if($object->type == Facture::TYPE_STANDARD) $type_fac = 'ExcessReceived'; + if($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_SITUATION) $type_fac = 'ExcessReceived'; elseif($object->type == Facture::TYPE_CREDIT_NOTE) $type_fac = 'CreditNote'; elseif($object->type == Facture::TYPE_DEPOSIT) $type_fac = 'Deposit'; $text = $langs->trans('ConfirmConvertToReduc', strtolower($langs->transnoentities($type_fac))); @@ -4698,7 +4698,7 @@ else if ($id > 0 || ! empty($ref)) } // Reverse back money or convert to reduction - if ($object->type == Facture::TYPE_CREDIT_NOTE || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_STANDARD) { + if ($object->type == Facture::TYPE_CREDIT_NOTE || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_SITUATION) { // For credit note only if ($object->type == Facture::TYPE_CREDIT_NOTE && $object->statut == 1 && $object->paye == 0 && $user->rights->facture->paiement) { @@ -4713,7 +4713,7 @@ else if ($id > 0 || ! empty($ref)) } // For standard invoice with excess received - if ($object->type == Facture::TYPE_STANDARD && empty($object->paye) && ($object->total_ttc - $totalpaye - $totalcreditnotes - $totaldeposits) < 0 && $user->rights->facture->creer && empty($discount->id)) + if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_SITUATION) && empty($object->paye) && $resteapayer < 0 && $user->rights->facture->creer && empty($discount->id)) { print ''; } From b1b00450a9f2ff6f3f6890f539281872e117540b Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio Date: Wed, 12 Feb 2020 12:10:48 +0100 Subject: [PATCH 243/306] FIX: situation invoice: bad amount for previous payments because of local variable overwriting a more global one --- htdocs/compta/facture/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index d99e26a65be..16dc6e82fd0 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -4133,7 +4133,7 @@ else if ($id > 0 || ! empty($ref)) $current_situation_counter = array(); foreach ($object->tab_previous_situation_invoice as $prev_invoice) { - $totalpaye = $prev_invoice->getSommePaiement(); + $totalpaye_prev = $prev_invoice->getSommePaiement(); $total_prev_ht += $prev_invoice->total_ht; $total_prev_ttc += $prev_invoice->total_ttc; $current_situation_counter[] = (($prev_invoice->type == Facture::TYPE_CREDIT_NOTE)?-1:1) * $prev_invoice->situation_counter; @@ -4144,7 +4144,7 @@ else if ($id > 0 || ! empty($ref)) if (! empty($conf->banque->enabled)) print ''; print '' . price($prev_invoice->total_ht) . ''; print '' . price($prev_invoice->total_ttc) . ''; - print '' . $prev_invoice->getLibStatut(3, $totalpaye) . ''; + print '' . $prev_invoice->getLibStatut(3, $totalpaye_prev) . ''; print ''; } } From 30c49478d82ca508807a9479caa087ca9785ac5e Mon Sep 17 00:00:00 2001 From: Thomas Date: Wed, 12 Feb 2020 13:50:58 +0100 Subject: [PATCH 244/306] Fixed missing trigger on contact delete --- htdocs/societe/class/api_contacts.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/class/api_contacts.class.php b/htdocs/societe/class/api_contacts.class.php index cfddddb7b96..6b6c5a439a6 100644 --- a/htdocs/societe/class/api_contacts.class.php +++ b/htdocs/societe/class/api_contacts.class.php @@ -293,7 +293,7 @@ class Contacts extends DolibarrApi throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login); } $this->contact->oldcopy = clone $this->contact; - return $this->contact->delete($id); + return $this->contact->delete(); } /** From 2dafbe0f917c64b872b8799cfa34e7c6136c54f5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Feb 2020 15:19:42 +0100 Subject: [PATCH 245/306] Fix labels --- htdocs/adherents/subscription/list.php | 54 +++++++++++++------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index 56862e794e8..d2d8a53da73 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -35,8 +35,8 @@ $action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); $toselect = GETPOST('toselect', 'array'); +$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'myobjectlist'; // To manage different context of search -$filter = GETPOST("filter", "alpha"); $statut = (GETPOSTISSET("statut") ?GETPOST("statut", "alpha") : 1); $search_ref = GETPOST('search_ref', 'alpha'); $search_type = GETPOST('search_type', 'alpha'); @@ -47,6 +47,7 @@ $search_note = GETPOST('search_note', 'alpha'); $search_account = GETPOST('search_account', 'int'); $search_amount = GETPOST('search_amount', 'alpha'); $optioncss = GETPOST('optioncss', 'alpha'); +$sall=''; $date_select = GETPOST("date_select", 'alpha'); @@ -76,21 +77,21 @@ $search_array_options = $extrafields->getOptionalsFromPost($object->table_elemen $fieldstosearchall = array( ); $arrayfields = array( - 'd.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1), - 'd.fk_type'=>array('label'=>$langs->trans("Type"), 'checked'=>1), - 'd.lastname'=>array('label'=>$langs->trans("Lastname"), 'checked'=>1), - 'd.firstname'=>array('label'=>$langs->trans("Firstname"), 'checked'=>1), - 'd.login'=>array('label'=>$langs->trans("Login"), 'checked'=>1), - 't.libelle'=>array('label'=>$langs->trans("Label"), 'checked'=>1), - 'd.bank'=>array('label'=>$langs->trans("BankAccount"), 'checked'=>1, 'enabled'=>(!empty($conf->banque->enabled))), - /*'d.note_public'=>array('label'=>$langs->trans("NotePublic"), 'checked'=>0), - 'd.note_private'=>array('label'=>$langs->trans("NotePrivate"), 'checked'=>0),*/ - 'c.dateadh'=>array('label'=>$langs->trans("DateSubscription"), 'checked'=>1, 'position'=>100), - 'c.datef'=>array('label'=>$langs->trans("EndSubscription"), 'checked'=>1, 'position'=>101), - 'd.amount'=>array('label'=>$langs->trans("Amount"), 'checked'=>1, 'position'=>102), - 'c.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), - 'c.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), -// 'd.statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000) + 'd.ref'=>array('label'=>"Ref", 'checked'=>1), + 'd.fk_type'=>array('label'=>"Type", 'checked'=>1), + 'd.lastname'=>array('label'=>"Lastname", 'checked'=>1), + 'd.firstname'=>array('label'=>"Firstname", 'checked'=>1), + 'd.login'=>array('label'=>"Login", 'checked'=>1), + 't.libelle'=>array('label'=>"Label", 'checked'=>1), + 'd.bank'=>array('label'=>"BankAccount", 'checked'=>1, 'enabled'=>(!empty($conf->banque->enabled))), + /*'d.note_public'=>array('label'=>"NotePublic", 'checked'=>0), + 'd.note_private'=>array('label'=>"NotePrivate", 'checked'=>0),*/ + 'c.dateadh'=>array('label'=>"DateSubscription", 'checked'=>1, 'position'=>100), + 'c.datef'=>array('label'=>"EndSubscription", 'checked'=>1, 'position'=>101), + 'd.amount'=>array('label'=>"Amount", 'checked'=>1, 'position'=>102), + 'c.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500), + 'c.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500), +// 'd.statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000) ); // Security check @@ -256,7 +257,6 @@ if ($optioncss != '') print ''; print ''; print ''; -print ''; print ''; print ''; print ''; @@ -390,43 +390,43 @@ print "\n"; print ''; if (!empty($arrayfields['d.ref']['checked'])) { - print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "c.rowid", $param, "", "", $sortfield, $sortorder); + print_liste_field_titre($arrayfields['d.ref']['label'], $_SERVER["PHP_SELF"], "c.rowid", $param, "", "", $sortfield, $sortorder); } if (!empty($arrayfields['d.fk_type']['checked'])) { - print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "c.fk_type", $param, "", "", $sortfield, $sortorder); + print_liste_field_titre($arrayfields['d.fk_type']['label'], $_SERVER["PHP_SELF"], "c.fk_type", $param, "", "", $sortfield, $sortorder); } if (!empty($arrayfields['d.lastname']['checked'])) { - print_liste_field_titre("LastName", $_SERVER["PHP_SELF"], "d.lastname", $param, "", "", $sortfield, $sortorder); + print_liste_field_titre($arrayfields['d.lastname']['label'], $_SERVER["PHP_SELF"], "d.lastname", $param, "", "", $sortfield, $sortorder); } if (!empty($arrayfields['d.firstname']['checked'])) { - print_liste_field_titre("FirstName", $_SERVER["PHP_SELF"], "d.firstname", $param, "", "", $sortfield, $sortorder); + print_liste_field_titre($arrayfields['d.firstname']['label'], $_SERVER["PHP_SELF"], "d.firstname", $param, "", "", $sortfield, $sortorder); } if (!empty($arrayfields['d.login']['checked'])) { - print_liste_field_titre("Login", $_SERVER["PHP_SELF"], "d.login", $param, "", "", $sortfield, $sortorder); + print_liste_field_titre($arrayfields['d.login']['label'], $_SERVER["PHP_SELF"], "d.login", $param, "", "", $sortfield, $sortorder); } if (!empty($arrayfields['t.libelle']['checked'])) { - print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "c.note", $param, "", '', $sortfield, $sortorder); + print_liste_field_titre($arrayfields['t.libelle']['label'], $_SERVER["PHP_SELF"], "c.note", $param, "", '', $sortfield, $sortorder); } if (!empty($arrayfields['d.bank']['checked'])) { - print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "b.fk_account", $param, "", "", $sortfield, $sortorder); + print_liste_field_titre($arrayfields['d.bank']['label'], $_SERVER["PHP_SELF"], "b.fk_account", $param, "", "", $sortfield, $sortorder); } if (!empty($arrayfields['c.dateadh']['checked'])) { - print_liste_field_titre("DateStart", $_SERVER["PHP_SELF"], "c.dateadh", $param, "", '', $sortfield, $sortorder, 'center nowraponall '); + print_liste_field_titre($arrayfields['c.dateadh']['label'], $_SERVER["PHP_SELF"], "c.dateadh", $param, "", '', $sortfield, $sortorder, 'center nowraponall '); } if (!empty($arrayfields['c.datef']['checked'])) { - print_liste_field_titre("DateEnd", $_SERVER["PHP_SELF"], "c.datef", $param, "", '', $sortfield, $sortorder, 'center nowraponall '); + print_liste_field_titre($arrayfields['c.datef']['label'], $_SERVER["PHP_SELF"], "c.datef", $param, "", '', $sortfield, $sortorder, 'center nowraponall '); } if (!empty($arrayfields['d.amount']['checked'])) { - print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "c.subscription", $param, "", '', $sortfield, $sortorder, 'right '); + print_liste_field_titre($arrayfields['d.amount']['label'], $_SERVER["PHP_SELF"], "c.subscription", $param, "", '', $sortfield, $sortorder, 'right '); } // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; From 66493672ebf3824938e2f328202bb35a33549097 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Feb 2020 15:20:37 +0100 Subject: [PATCH 246/306] Clean code --- htdocs/adherents/subscription/list.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index d2d8a53da73..09837405f04 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -441,12 +441,10 @@ print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], '', '', '', 'alig print "\n"; -$total = 0; $totalarray = array(); while ($i < min($num, $limit)) { $obj = $db->fetch_object($result); - $total += $obj->subscription; $subscription->ref = $obj->crowid; $subscription->id = $obj->crowid; From e74df397eb08f0c9a196e167a469547b0f689eb7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Feb 2020 17:28:18 +0100 Subject: [PATCH 247/306] FIX #13094 --- htdocs/core/lib/security.lib.php | 3 ++ htdocs/user/card.php | 57 +++++++++++++++++++++++--------- 2 files changed, 44 insertions(+), 16 deletions(-) diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 5a7b8342bd6..b811fe70abf 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -311,6 +311,9 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f { foreach ($feature2 as $subfeature) { + if ($subfeature == 'user' && $user->id == $objectid && $user->rights->user->self->creer) continue; // User can edit its own card + if ($subfeature == 'user' && $user->id == $objectid && $user->rights->user->self->password) continue; // User can edit its own password + if (empty($user->rights->$feature->$subfeature->creer) && empty($user->rights->$feature->$subfeature->write) && empty($user->rights->$feature->$subfeature->create)) { diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 7feaf2911fa..d12f6064131 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -40,6 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; require_once DOL_DOCUMENT_ROOT.'/user/class/usergroup.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; @@ -85,8 +86,7 @@ if ($id) $socid = 0; if ($user->socid > 0) $socid = $user->socid; $feature2 = 'user'; - -$result = restrictedArea($user, 'user', $id, 'user&user', $feature2); +$result = restrictedArea($user, 'user', $id, 'user', $feature2); if ($user->id <> $id && !$canreaduser) accessforbidden(); @@ -567,12 +567,14 @@ if (empty($reshook)) { $object->fetch($id); - $object->oldcopy = clone $object; + if (GETPOST("password", "none")) { // If pass is empty, we do not change it. + $object->oldcopy = clone $object; - $ret = $object->setPassword($user, GETPOST("password")); - if ($ret < 0) - { - setEventMessages($object->error, $object->errors, 'errors'); + $ret = $object->setPassword($user, GETPOST("password", "none")); + if ($ret < 0) + { + setEventMessages($object->error, $object->errors, 'errors'); + } } } } @@ -1551,7 +1553,7 @@ else else { if ($user->admin) $valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').$langs->trans("Crypted").': '.$object->pass_indatabase_crypted; - else $valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').$langs->trans("Hidden"); + else $valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').''.$langs->trans("Hidden").''; } } @@ -2307,7 +2309,11 @@ else print ''.$langs->trans("Gender").''; print ''; $arraygender = array('man'=>$langs->trans("Genderman"), 'woman'=>$langs->trans("Genderwoman")); - print $form->selectarray('gender', $arraygender, GETPOST('gender') ?GETPOST('gender') : $object->gender, 1); + if ($caneditfield) { + print $form->selectarray('gender', $arraygender, GETPOSTISSET('gender') ?GETPOST('gender') : $object->gender, 1); + } else { + print $arraygender[$object->gender]; + } print ''; // Employee @@ -2387,31 +2393,50 @@ else // Address print ''.$form->editfieldkey('Address', 'address', '', $object, 0).''; - print ''; + if ($caneditfield) print ''; + print ''; // Zip print ''.$form->editfieldkey('Zip', 'zipcode', '', $object, 0).''; - print $formcompany->select_ziptown($object->zip, 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6); + if ($caneditfield) { + print $formcompany->select_ziptown($object->zip, 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6); + } else { + print $object->zip; + } print ''; // Town print ''.$form->editfieldkey('Town', 'town', '', $object, 0).''; - print $formcompany->select_ziptown($object->town, 'town', array('zipcode', 'selectcountry_id', 'state_id')); + if ($caneditfield) { + print $formcompany->select_ziptown($object->town, 'town', array('zipcode', 'selectcountry_id', 'state_id')); + } else { + print $object->town; + } print ''; // Country print ''.$form->editfieldkey('Country', 'selectcounty_id', '', $object, 0).''; - print $form->select_country((GETPOST('country_id') != '' ?GETPOST('country_id') : $object->country_id), 'country_id'); - if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); + if ($caneditfield) { + print $form->select_country((GETPOST('country_id') != '' ?GETPOST('country_id') : $object->country_id), 'country_id'); + if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); + } else { + $countrylabel = getCountry($object->country_id, '0'); + print $countrylabel; + } print ''; // State if (empty($conf->global->USER_DISABLE_STATE)) { print ''.$form->editfieldkey('State', 'state_id', '', $object, 0).''; - print $formcompany->select_state($object->state_id, $object->country_code, 'state_id'); + if ($caneditfield) { + print $formcompany->select_state($object->state_id, $object->country_code, 'state_id'); + } else { + print $object->state_label; + } print ''; } From 03a8414ba8fdcb1153e90c442b6ea875d9bc4bbd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Feb 2020 18:21:45 +0100 Subject: [PATCH 248/306] FIX #13085 --- htdocs/accountancy/class/accountancyexport.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index 46d3feae5b2..c8160c7bc96 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -239,6 +239,7 @@ class AccountancyExport $filename = 'general_ledger-'.$this->getFormatCode($formatexportset); $type_export = 'general_ledger'; + global $db; // The tpl file use $db include DOL_DOCUMENT_ROOT.'/accountancy/tpl/export_journal.tpl.php'; From 9b0b5f755b9568b89d305778ff044de6ce27cd63 Mon Sep 17 00:00:00 2001 From: Thomas Date: Wed, 12 Feb 2020 13:50:58 +0100 Subject: [PATCH 249/306] Fixed missing trigger on contact delete --- htdocs/societe/class/api_contacts.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/class/api_contacts.class.php b/htdocs/societe/class/api_contacts.class.php index cfddddb7b96..6b6c5a439a6 100644 --- a/htdocs/societe/class/api_contacts.class.php +++ b/htdocs/societe/class/api_contacts.class.php @@ -293,7 +293,7 @@ class Contacts extends DolibarrApi throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login); } $this->contact->oldcopy = clone $this->contact; - return $this->contact->delete($id); + return $this->contact->delete(); } /** From bd0666bf539708efe5860028d8900035c6829a04 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Feb 2020 18:35:15 +0100 Subject: [PATCH 250/306] Update product.lib.php --- htdocs/core/lib/product.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index f58af3500c0..54555eb018c 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -504,7 +504,7 @@ function measuring_units_string($scale = '', $measuring_style = '', $unit = 0, $ * Return translation label of a unit key * * @param int $unit ID of unit (rowid in llx_c_units table) - * @param string $measuring_style Style of unit: weight, volume,... + * @param string $measuring_style Style of unit: 'weight', 'volume', ..., '' = 'net_measure' for option PRODUCT_ADD_NET_MEASURE * @param string $scale Scale of unit: '0', '-3', '6', ... * @param int $use_short_label 1=Use short label ('g' instead of 'gram'). Short labels are not translated. * @return string Unit string From 50f0b61f1ea538f49056000592c95cce548bab1d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Feb 2020 18:50:33 +0100 Subject: [PATCH 251/306] Update bankjournal.php --- htdocs/accountancy/journal/bankjournal.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 2c59d677d96..362c1b1708f 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -971,8 +971,8 @@ if (empty($action) || $action == 'view') { journalHead($nom, '', $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink); - // Test that setup is complete - $sql = 'SELECT COUNT(rowid) as nb FROM '.MAIN_DB_PREFIX.'bank_account WHERE entity IN ('.getEntity('bank_account').') AND fk_accountancy_journal IS NULL AND clos=0'; + // Test that setup is complete (we are in accounting, so test on entity is always on $conf->entity only, no sharing allowed) + $sql = 'SELECT COUNT(rowid) as nb FROM '.MAIN_DB_PREFIX.'bank_account WHERE entity = '.$conf->entity.' AND fk_accountancy_journal IS NULL AND clos=0'; $resql = $db->query($sql); if ($resql) { From d419315e98cc7eca08be709a61ed42199eeede26 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Feb 2020 19:36:29 +0100 Subject: [PATCH 252/306] FIX #13048 --- htdocs/modulebuilder/template/mymoduleindex.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/modulebuilder/template/mymoduleindex.php b/htdocs/modulebuilder/template/mymoduleindex.php index 99ed522e273..fe2f932c129 100644 --- a/htdocs/modulebuilder/template/mymoduleindex.php +++ b/htdocs/modulebuilder/template/mymoduleindex.php @@ -47,8 +47,8 @@ $langs->loadLangs(array("mymodule@mymodule")); $action=GETPOST('action', 'alpha'); -// Securite acces client -if (! $user->rights->mymodule->read) accessforbidden(); +// Security check +//if (! $user->rights->mymodule->myobject->read) accessforbidden(); $socid=GETPOST('socid', 'int'); if (isset($user->socid) && $user->socid > 0) { From 3f4c787c840690c36f533ae7330b0a5d3fb5b4a9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Feb 2020 20:22:53 +0100 Subject: [PATCH 253/306] Fix physical stock were truncated in product/reassort page --- htdocs/product/reassort.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php index c107693b8c6..512d5ff2b89 100644 --- a/htdocs/product/reassort.php +++ b/htdocs/product/reassort.php @@ -256,14 +256,14 @@ if ($resql) } $param = ''; - if ($tosell) $param .= "&tosell=".$tosell; - if ($tobuy) $param .= "&tobuy=".$tobuy; - if ($type) $param .= "&type=".$type; - if ($fourn_id) $param .= "&fourn_id=".$fourn_id; - if ($snom) $param .= "&snom=".$snom; - if ($sref) $param .= "&sref=".$sref; - if ($toolowstock) $param .= "&toolowstock=".$toolowstock; - if ($search_categ) $param .= "&search_categ=".$search_categ; + if ($tosell) $param .= "&tosell=".urlencode($tosell); + if ($tobuy) $param .= "&tobuy=".urlencode($tobuy); + if ($type) $param .= "&type=".urlencode($type); + if ($fourn_id) $param .= "&fourn_id=".urlencode($fourn_id); + if ($snom) $param .= "&snom=".urlencode($snom); + if ($sref) $param .= "&sref=".urlencode($sref); + if ($toolowstock) $param .= "&toolowstock=".urlencode($toolowstock); + if ($search_categ) $param .= "&search_categ=".urlencode($search_categ); $formProduct = new FormProduct($db); $formProduct->loadWarehouses(); @@ -362,7 +362,7 @@ if ($resql) // Real stock print ''; if ($objp->seuil_stock_alerte != '' && ($objp->stock_physique < $objp->seuil_stock_alerte)) print img_warning($langs->trans("StockTooLow")).' '; - print $objp->stock_physique | 0; + print price2num($objp->stock_physique, 'MS'); print ''; // Details per warehouse From 83b5fe3c71117676aa481b967484a161311ed1f3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Feb 2020 20:24:58 +0100 Subject: [PATCH 254/306] FIX #13077 Replace left join with inner join (left join was useless) --- htdocs/product/stock/replenish.php | 58 +++++++++++++++--------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 5164b72fa4a..427a8a18785 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -195,6 +195,7 @@ if ($action == 'order' && isset($_POST['valid'])) //we now know how many orders we need and what lines they have $i = 0; + $fail = 0; $orders = array(); $suppliersid = array_keys($suppliers); foreach ($suppliers as $supplier) @@ -311,6 +312,7 @@ if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entre $sql .= ' pse.desiredstock as desiredstockpse, pse.seuil_stock_alerte as seuil_stock_alertepse,'; } $sql .= ' '.$sqldesiredtock.' as desiredstockcombined, '.$sqlalertstock.' as seuil_stock_alertecombined,'; +$sql .= ' s.fk_product,'; $sql .= ' SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").') as stock_physique'; // Add fields from hooks @@ -319,8 +321,8 @@ $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // N $sql .= $hookmanager->resPrint; $sql .= ' FROM '.MAIN_DB_PREFIX.'product as p'; -$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_stock as s'; -$sql .= ' ON (p.rowid = s.fk_product AND s.fk_entrepot IN (SELECT ent.rowid FROM '.MAIN_DB_PREFIX.'entrepot AS ent WHERE ent.entity IN('.getEntity('stock').')))'; +$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_stock as s ON p.rowid = s.fk_product'; +$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'entrepot AS ent ON s.fk_entrepot = ent.rowid AND ent.entity IN('.getEntity('stock').')'; if ($fk_supplier > 0) { $sql .= ' INNER JOIN '.MAIN_DB_PREFIX.'product_fournisseur_price pfp ON (pfp.fk_product = p.rowid AND pfp.fk_soc = '.$fk_supplier.')'; } @@ -360,36 +362,34 @@ $sql .= ', s.fk_product'; if ($usevirtualstock) { - $sqlCommandesCli = "(SELECT ".$db->ifsql("SUM(cd.qty) IS NULL", "0", "SUM(cd.qty)")." as qty"; - $sqlCommandesCli .= " FROM ".MAIN_DB_PREFIX."commandedet as cd"; - $sqlCommandesCli .= " LEFT JOIN ".MAIN_DB_PREFIX."commande as c ON (c.rowid = cd.fk_commande)"; - $sqlCommandesCli .= " WHERE c.entity IN (".getEntity('commande').")"; - $sqlCommandesCli .= " AND cd.fk_product = p.rowid"; - $sqlCommandesCli .= " AND c.fk_statut IN (1,2))"; + $sqlCommandesCli = "(SELECT ".$db->ifsql("SUM(cd1.qty) IS NULL", "0", "SUM(cd1.qty)")." as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL + $sqlCommandesCli .= " FROM ".MAIN_DB_PREFIX."commandedet as cd1, ".MAIN_DB_PREFIX."commande as c1"; + $sqlCommandesCli .= " WHERE c1.rowid = cd1.fk_commande AND c1.entity IN (".getEntity('commande').")"; + $sqlCommandesCli .= " AND cd1.fk_product = p.rowid"; + $sqlCommandesCli .= " AND c1.fk_statut IN (1,2))"; - $sqlExpeditionsCli = "(SELECT ".$db->ifsql("SUM(ed.qty) IS NULL", "0", "SUM(ed.qty)")." as qty"; - $sqlExpeditionsCli .= " FROM ".MAIN_DB_PREFIX."expedition as e"; - $sqlExpeditionsCli .= " LEFT JOIN ".MAIN_DB_PREFIX."expeditiondet as ed ON (ed.fk_expedition = e.rowid)"; - $sqlExpeditionsCli .= " LEFT JOIN ".MAIN_DB_PREFIX."commandedet as cd ON (cd.rowid = ed.fk_origin_line)"; - $sqlExpeditionsCli .= " LEFT JOIN ".MAIN_DB_PREFIX."commande as c ON (c.rowid = cd.fk_commande)"; - $sqlExpeditionsCli .= " WHERE e.entity IN (".getEntity('expedition').")"; - $sqlExpeditionsCli .= " AND cd.fk_product = p.rowid"; - $sqlExpeditionsCli .= " AND e.fk_statut IN (1,2))"; + $sqlExpeditionsCli = "(SELECT ".$db->ifsql("SUM(ed2.qty) IS NULL", "0", "SUM(ed2.qty)")." as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL + $sqlExpeditionsCli .= " FROM ".MAIN_DB_PREFIX."expedition as e2,"; + $sqlExpeditionsCli .= " ".MAIN_DB_PREFIX."expeditiondet as ed2,"; + $sqlExpeditionsCli .= " ".MAIN_DB_PREFIX."commandedet as cd2"; + $sqlExpeditionsCli .= " WHERE ed2.fk_expedition = e2.rowid AND cd2.rowid = ed2.fk_origin_line AND e2.entity IN (".getEntity('expedition').")"; + $sqlExpeditionsCli .= " AND cd2.fk_product = p.rowid"; + $sqlExpeditionsCli .= " AND e2.fk_statut IN (1,2))"; - $sqlCommandesFourn = "(SELECT ".$db->ifsql("SUM(cd.qty) IS NULL", "0", "SUM(cd.qty)")." as qty"; - $sqlCommandesFourn .= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as cd"; - $sqlCommandesFourn .= ", ".MAIN_DB_PREFIX."commande_fournisseur as c"; - $sqlCommandesFourn .= " WHERE c.rowid = cd.fk_commande"; - $sqlCommandesFourn .= " AND c.entity IN (".getEntity('supplier_order').")"; - $sqlCommandesFourn .= " AND cd.fk_product = p.rowid"; - $sqlCommandesFourn .= " AND c.fk_statut IN (3,4))"; + $sqlCommandesFourn = "(SELECT ".$db->ifsql("SUM(cd3.qty) IS NULL", "0", "SUM(cd3.qty)")." as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL + $sqlCommandesFourn .= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as cd3,"; + $sqlCommandesFourn .= " ".MAIN_DB_PREFIX."commande_fournisseur as c3"; + $sqlCommandesFourn .= " WHERE c3.rowid = cd3.fk_commande"; + $sqlCommandesFourn .= " AND c3.entity IN (".getEntity('supplier_order').")"; + $sqlCommandesFourn .= " AND cd3.fk_product = p.rowid"; + $sqlCommandesFourn .= " AND c3.fk_statut IN (3,4))"; - $sqlReceptionFourn = "(SELECT ".$db->ifsql("SUM(fd.qty) IS NULL", "0", "SUM(fd.qty)")." as qty"; - $sqlReceptionFourn .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as cf"; - $sqlReceptionFourn .= " LEFT JOIN ".MAIN_DB_PREFIX."commande_fournisseur_dispatch as fd ON (fd.fk_commande = cf.rowid)"; - $sqlReceptionFourn .= " WHERE cf.entity IN (".getEntity('supplier_order').")"; - $sqlReceptionFourn .= " AND fd.fk_product = p.rowid"; - $sqlReceptionFourn .= " AND cf.fk_statut IN (3,4))"; + $sqlReceptionFourn = "(SELECT ".$db->ifsql("SUM(fd4.qty) IS NULL", "0", "SUM(fd4.qty)")." as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL + $sqlReceptionFourn .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as cf4,"; + $sqlReceptionFourn .= " ".MAIN_DB_PREFIX."commande_fournisseur_dispatch as fd4"; + $sqlReceptionFourn .= " WHERE fd4.fk_commande = cf4.rowid AND cf4.entity IN (".getEntity('supplier_order').")"; + $sqlReceptionFourn .= " AND fd4.fk_product = p.rowid"; + $sqlReceptionFourn .= " AND cf4.fk_statut IN (3,4))"; $sql .= ' HAVING (('.$sqldesiredtock.' >= 0 AND ('.$sqldesiredtock.' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").')'; $sql .= ' - ('.$sqlCommandesCli.' - '.$sqlExpeditionsCli.') + ('.$sqlCommandesFourn.' - '.$sqlReceptionFourn.')))'; From 0f120037825441693c5628fde81f057553052524 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Feb 2020 21:20:55 +0100 Subject: [PATCH 255/306] Trans --- htdocs/langs/en_US/mrp.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/mrp.lang b/htdocs/langs/en_US/mrp.lang index 11c6915a25c..b054df452d7 100644 --- a/htdocs/langs/en_US/mrp.lang +++ b/htdocs/langs/en_US/mrp.lang @@ -1,6 +1,6 @@ Mrp=Manufacturing Orders MO=Manufacturing Order -MRPDescription=Module to manage Manufacturing Orders (MO). +MRPDescription=Module to manage production and Manufacturing Orders (MO). MRPArea=MRP Area MrpSetupPage=Setup of module MRP MenuBOM=Bills of material From 373a5ff508661e7cfd3c5562d4373e16c61737b8 Mon Sep 17 00:00:00 2001 From: josemariagomezroncero Date: Wed, 12 Feb 2020 21:31:45 +0100 Subject: [PATCH 256/306] Hook for dynamic price Hook for dynamic price --- .../dynamic_price/class/price_parser.class.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/htdocs/product/dynamic_price/class/price_parser.class.php b/htdocs/product/dynamic_price/class/price_parser.class.php index 65494ec78ee..e2960951348 100644 --- a/htdocs/product/dynamic_price/class/price_parser.class.php +++ b/htdocs/product/dynamic_price/class/price_parser.class.php @@ -133,7 +133,16 @@ class PriceParser public function parseExpression($product, $expression, $values) { global $user; - + global $hookmanager; + $hookmanager->initHooks(array('productcard','globalcard')); + $action = 'PARSEEXPRESSION'; + if ($result = $hookmanager->executeHooks('doDynamiPrice', array( + 'expression' =>$expression, + 'product' => $product, + 'values' => $values + ), $this, $action)) { + return $result; + } //Check if empty $expression = trim($expression); if (empty($expression)) From cfd64c7171239503d1ffa99bcd51665d2538b10d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Feb 2020 21:31:49 +0100 Subject: [PATCH 257/306] Fix class not found --- htdocs/mrp/mo_production.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 278b32043d0..e4d8361b721 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -47,6 +47,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; @@ -620,7 +621,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print load_fiche_titre($langs->trans('Consumption'), '', ''); print '
'; - print ''; + print '
'; print ''; print ''; From 6be746e219ac22a0ef7c65428f444ba2ce19654b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Feb 2020 21:42:48 +0100 Subject: [PATCH 258/306] Fix replenishment for virtual stock check if module is on or off --- htdocs/mrp/mo_card.php | 1 + htdocs/product/stock/replenish.php | 102 ++++++++++++++++++++--------- 2 files changed, 72 insertions(+), 31 deletions(-) diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php index ca3278c241b..27cccab3d37 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -47,6 +47,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php'; require_once DOL_DOCUMENT_ROOT.'/mrp/lib/mrp_mo.lib.php'; require_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php'; diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 427a8a18785..2ad465bdedb 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -362,44 +362,84 @@ $sql .= ', s.fk_product'; if ($usevirtualstock) { - $sqlCommandesCli = "(SELECT ".$db->ifsql("SUM(cd1.qty) IS NULL", "0", "SUM(cd1.qty)")." as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL - $sqlCommandesCli .= " FROM ".MAIN_DB_PREFIX."commandedet as cd1, ".MAIN_DB_PREFIX."commande as c1"; - $sqlCommandesCli .= " WHERE c1.rowid = cd1.fk_commande AND c1.entity IN (".getEntity('commande').")"; - $sqlCommandesCli .= " AND cd1.fk_product = p.rowid"; - $sqlCommandesCli .= " AND c1.fk_statut IN (1,2))"; + if (! empty($conf->commande->enabled)) { + $sqlCommandesCli = "(SELECT ".$db->ifsql("SUM(cd1.qty) IS NULL", "0", "SUM(cd1.qty)")." as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL + $sqlCommandesCli .= " FROM ".MAIN_DB_PREFIX."commandedet as cd1, ".MAIN_DB_PREFIX."commande as c1"; + $sqlCommandesCli .= " WHERE c1.rowid = cd1.fk_commande AND c1.entity IN (".getEntity('commande').")"; + $sqlCommandesCli .= " AND cd1.fk_product = p.rowid"; + $sqlCommandesCli .= " AND c1.fk_statut IN (1,2))"; + } else { + $sqlCommandesCli = '0'; + } - $sqlExpeditionsCli = "(SELECT ".$db->ifsql("SUM(ed2.qty) IS NULL", "0", "SUM(ed2.qty)")." as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL - $sqlExpeditionsCli .= " FROM ".MAIN_DB_PREFIX."expedition as e2,"; - $sqlExpeditionsCli .= " ".MAIN_DB_PREFIX."expeditiondet as ed2,"; - $sqlExpeditionsCli .= " ".MAIN_DB_PREFIX."commandedet as cd2"; - $sqlExpeditionsCli .= " WHERE ed2.fk_expedition = e2.rowid AND cd2.rowid = ed2.fk_origin_line AND e2.entity IN (".getEntity('expedition').")"; - $sqlExpeditionsCli .= " AND cd2.fk_product = p.rowid"; - $sqlExpeditionsCli .= " AND e2.fk_statut IN (1,2))"; + if (! empty($conf->expedition->enabled)) { + $sqlExpeditionsCli = "(SELECT ".$db->ifsql("SUM(ed2.qty) IS NULL", "0", "SUM(ed2.qty)")." as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL + $sqlExpeditionsCli .= " FROM ".MAIN_DB_PREFIX."expedition as e2,"; + $sqlExpeditionsCli .= " ".MAIN_DB_PREFIX."expeditiondet as ed2,"; + $sqlExpeditionsCli .= " ".MAIN_DB_PREFIX."commandedet as cd2"; + $sqlExpeditionsCli .= " WHERE ed2.fk_expedition = e2.rowid AND cd2.rowid = ed2.fk_origin_line AND e2.entity IN (".getEntity('expedition').")"; + $sqlExpeditionsCli .= " AND cd2.fk_product = p.rowid"; + $sqlExpeditionsCli .= " AND e2.fk_statut IN (1,2))"; + } else { + $sqlExpeditionsCli = '0'; + } - $sqlCommandesFourn = "(SELECT ".$db->ifsql("SUM(cd3.qty) IS NULL", "0", "SUM(cd3.qty)")." as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL - $sqlCommandesFourn .= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as cd3,"; - $sqlCommandesFourn .= " ".MAIN_DB_PREFIX."commande_fournisseur as c3"; - $sqlCommandesFourn .= " WHERE c3.rowid = cd3.fk_commande"; - $sqlCommandesFourn .= " AND c3.entity IN (".getEntity('supplier_order').")"; - $sqlCommandesFourn .= " AND cd3.fk_product = p.rowid"; - $sqlCommandesFourn .= " AND c3.fk_statut IN (3,4))"; + if (! empty($conf->fournisseur->enabled)) { + $sqlCommandesFourn = "(SELECT ".$db->ifsql("SUM(cd3.qty) IS NULL", "0", "SUM(cd3.qty)")." as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL + $sqlCommandesFourn .= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as cd3,"; + $sqlCommandesFourn .= " ".MAIN_DB_PREFIX."commande_fournisseur as c3"; + $sqlCommandesFourn .= " WHERE c3.rowid = cd3.fk_commande"; + $sqlCommandesFourn .= " AND c3.entity IN (".getEntity('supplier_order').")"; + $sqlCommandesFourn .= " AND cd3.fk_product = p.rowid"; + $sqlCommandesFourn .= " AND c3.fk_statut IN (3,4))"; - $sqlReceptionFourn = "(SELECT ".$db->ifsql("SUM(fd4.qty) IS NULL", "0", "SUM(fd4.qty)")." as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL - $sqlReceptionFourn .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as cf4,"; - $sqlReceptionFourn .= " ".MAIN_DB_PREFIX."commande_fournisseur_dispatch as fd4"; - $sqlReceptionFourn .= " WHERE fd4.fk_commande = cf4.rowid AND cf4.entity IN (".getEntity('supplier_order').")"; - $sqlReceptionFourn .= " AND fd4.fk_product = p.rowid"; - $sqlReceptionFourn .= " AND cf4.fk_statut IN (3,4))"; + $sqlReceptionFourn = "(SELECT ".$db->ifsql("SUM(fd4.qty) IS NULL", "0", "SUM(fd4.qty)")." as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL + $sqlReceptionFourn .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as cf4,"; + $sqlReceptionFourn .= " ".MAIN_DB_PREFIX."commande_fournisseur_dispatch as fd4"; + $sqlReceptionFourn .= " WHERE fd4.fk_commande = cf4.rowid AND cf4.entity IN (".getEntity('supplier_order').")"; + $sqlReceptionFourn .= " AND fd4.fk_product = p.rowid"; + $sqlReceptionFourn .= " AND cf4.fk_statut IN (3,4))"; + } else { + $sqlCommandesFourn = '0'; + $sqlReceptionFourn = '0'; + } - $sql .= ' HAVING (('.$sqldesiredtock.' >= 0 AND ('.$sqldesiredtock.' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").')'; - $sql .= ' - ('.$sqlCommandesCli.' - '.$sqlExpeditionsCli.') + ('.$sqlCommandesFourn.' - '.$sqlReceptionFourn.')))'; - $sql .= ' OR ('.$sqlalertstock.' >= 0 AND ('.$sqlalertstock.' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").')'; - $sql .= ' - ('.$sqlCommandesCli.' - '.$sqlExpeditionsCli.') + ('.$sqlCommandesFourn.' - '.$sqlReceptionFourn.'))))'; + if (! empty($conf->mrp->enabled)) { + $sqlProductionToConsume = "(SELECT GREATEST(0, ".$db->ifsql("SUM(".$db->ifsql("mp5.role = 'toconsume'", 'mp5.qty', '- mp5.qty').") IS NULL", "0", "SUM(".$db->ifsql("mp5.role = 'toconsume'", 'mp5.qty', '- mp5.qty').")").") as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL + $sqlProductionToConsume .= " FROM ".MAIN_DB_PREFIX."mrp_mo as mm5,"; + $sqlProductionToConsume .= " ".MAIN_DB_PREFIX."mrp_production as mp5"; + $sqlProductionToConsume .= " WHERE mm5.rowid = mp5.fk_mo AND mm5.entity IN (".getEntity('mo').")"; + $sqlProductionToConsume .= " AND mp5.fk_product = p.rowid"; + $sqlProductionToConsume .= " AND mp5.role IN ('toconsume', 'consummed')"; + $sqlProductionToConsume .= " AND mm5.status IN (1,2))"; + + $sqlProductionToProduce = "(SELECT GREATEST(0, ".$db->ifsql("SUM(".$db->ifsql("mp5.role = 'toproduce'", 'mp5.qty', '- mp5.qty').") IS NULL", "0", "SUM(".$db->ifsql("mp5.role = 'toconsume'", 'mp5.qty', '- mp5.qty').")").") as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL + $sqlProductionToProduce .= " FROM ".MAIN_DB_PREFIX."mrp_mo as mm5,"; + $sqlProductionToProduce .= " ".MAIN_DB_PREFIX."mrp_production as mp5"; + $sqlProductionToProduce .= " WHERE mm5.rowid = mp5.fk_mo AND mm5.entity IN (".getEntity('mo').")"; + $sqlProductionToProduce .= " AND mp5.fk_product = p.rowid"; + $sqlProductionToProduce .= " AND mp5.role IN ('toproduce', 'produced')"; + $sqlProductionToProduce .= " AND mm5.status IN (1,2))"; + } else + { + $sqlProductionToConsume = '0'; + $sqlProductionToProduce = '0'; + } + + $sql .= ' HAVING ('; + $sql .= ' ('.$sqldesiredtock.' >= 0 AND ('.$sqldesiredtock.' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").')'; + $sql .= ' - ('.$sqlCommandesCli.' - '.$sqlExpeditionsCli.') + ('.$sqlCommandesFourn.' - '.$sqlReceptionFourn.') + ('.$sqlProductionToProduce.' - '.$sqlProductionToConsume.')))'; + $sql .= ' OR '; + $sql .= ' ('.$sqlalertstock.' >= 0 AND ('.$sqlalertstock.' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").')'; + $sql .= ' - ('.$sqlCommandesCli.' - '.$sqlExpeditionsCli.') + ('.$sqlCommandesFourn.' - '.$sqlReceptionFourn.') + ('.$sqlProductionToProduce.' - '.$sqlProductionToConsume.')))'; + $sql .= ')'; if ($salert == 'on') // Option to see when stock is lower than alert { - $sql .= ' AND ('.$sqlalertstock.' >= 0 AND ('.$sqlalertstock.' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").')'; - $sql .= ' - ('.$sqlCommandesCli.' - '.$sqlExpeditionsCli.') + ('.$sqlCommandesFourn.' - '.$sqlReceptionFourn.')))'; + $sql .= ' AND ('; + $sql .= $sqlalertstock.' >= 0 AND ('.$sqlalertstock.' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").')'; + $sql .= ' - ('.$sqlCommandesCli.' - '.$sqlExpeditionsCli.') + ('.$sqlCommandesFourn.' - '.$sqlReceptionFourn.') + ('.$sqlProductionToProduce.' - '.$sqlProductionToConsume.'))'; + $sql .= ')'; $alertchecked = 'checked'; } } else { From f8eaca24af5c7ae75f84a5639a90391faf19f6bd Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 12 Feb 2020 20:54:56 +0000 Subject: [PATCH 259/306] Fixing style errors. --- htdocs/core/modules/commande/doc/pdf_einstein.modules.php | 4 ++-- .../core/modules/commande/doc/pdf_eratosthene.modules.php | 6 +++--- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 4 ++-- htdocs/core/modules/facture/doc/pdf_sponge.modules.php | 4 ++-- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 4 ++-- htdocs/core/modules/propale/doc/pdf_cyan.modules.php | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index b3cec036ee9..6e3d887cbce 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -1314,7 +1314,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetTextColor(0, 0, 60); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("RefCustomer")." : ".$outputlangs->convToOutputCharset($object->ref_client), '', 'R'); } - + if (! empty($conf->global->PDF_SHOW_PROJECT_TITLE)) { $object->fetch_projet(); @@ -1326,7 +1326,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->MultiCell($w, 3, $outputlangs->transnoentities("Project")." : " . (empty($object->project->title)?'':$object->projet->title), '', 'R'); } } - + if (! empty($conf->global->PDF_SHOW_PROJECT)) { $object->fetch_projet(); diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index 5dcfb2ffd81..f4fc2b3cb2f 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -1486,7 +1486,7 @@ class pdf_eratosthene extends ModelePDFCommandes $pdf->MultiCell($w, 3, $outputlangs->transnoentities("Project")." : " . (empty($object->project->title)?'':$object->projet->title), '', 'R'); } } - + if (! empty($conf->global->PDF_SHOW_PROJECT)) { $object->fetch_projet(); @@ -1498,10 +1498,10 @@ class pdf_eratosthene extends ModelePDFCommandes $pdf->MultiCell($w, 3, $outputlangs->transnoentities("RefProject")." : " . (empty($object->project->ref)?'':$object->projet->ref), '', 'R'); } } - + $posy += 4; - $pdf->SetXY($posx, $posy); + $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("OrderDate")." : ".dol_print_date($object->date, "day", false, $outputlangs, true), '', 'R'); diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 440970105bf..6e8918920a6 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1706,7 +1706,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetTextColor(0, 0, 60); $pdf->MultiCell($w, 3, $outputlangs->transnoentities("RefCustomer")." : ".$outputlangs->convToOutputCharset($object->ref_client), '', 'R'); } - + if (! empty($conf->global->PDF_SHOW_PROJECT_TITLE)) { $object->fetch_projet(); @@ -1718,7 +1718,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->MultiCell($w, 3, $outputlangs->transnoentities("Project")." : " . (empty($object->project->title)?'':$object->projet->title), '', 'R'); } } - + if (! empty($conf->global->PDF_SHOW_PROJECT)) { $object->fetch_projet(); diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 195660e5fb0..37fa1cb3ae2 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -1962,7 +1962,7 @@ class pdf_sponge extends ModelePDFFactures $pdf->SetTextColor(0, 0, 60); $pdf->MultiCell($w, 3, $outputlangs->transnoentities("RefCustomer")." : ".$outputlangs->convToOutputCharset($object->ref_client), '', 'R'); } - + if (! empty($conf->global->PDF_SHOW_PROJECT_TITLE)) { $object->fetch_projet(); @@ -1974,7 +1974,7 @@ class pdf_sponge extends ModelePDFFactures $pdf->MultiCell($w, 3, $outputlangs->transnoentities("Project")." : " . (empty($object->project->title)?'':$object->projet->title), '', 'R'); } } - + if (! empty($conf->global->PDF_SHOW_PROJECT)) { $object->fetch_projet(); diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 8d93df6cb67..3810ad67237 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1527,7 +1527,7 @@ class pdf_azur extends ModelePDFPropales $pdf->SetTextColor(0, 0, 60); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("RefCustomer")." : ".$outputlangs->convToOutputCharset($object->ref_client), '', 'R'); } - + if (! empty($conf->global->PDF_SHOW_PROJECT_TITLE)) { $object->fetch_projet(); @@ -1539,7 +1539,7 @@ class pdf_azur extends ModelePDFPropales $pdf->MultiCell($w, 3, $outputlangs->transnoentities("Project")." : " . (empty($object->project->title)?'':$object->projet->title), '', 'R'); } } - + if (! empty($conf->global->PDF_SHOW_PROJECT)) { $object->fetch_projet(); diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index f1417e309cf..07ceb461803 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -1587,7 +1587,7 @@ class pdf_cyan extends ModelePDFPropales $pdf->SetTextColor(0, 0, 60); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("RefCustomer")." : ".$outputlangs->convToOutputCharset($object->ref_client), '', 'R'); } - + if (! empty($conf->global->PDF_SHOW_PROJECT_TITLE)) { $object->fetch_projet(); @@ -1599,7 +1599,7 @@ class pdf_cyan extends ModelePDFPropales $pdf->MultiCell($w, 3, $outputlangs->transnoentities("Project")." : " . (empty($object->project->title)?'':$object->projet->title), '', 'R'); } } - + if (! empty($conf->global->PDF_SHOW_PROJECT)) { $object->fetch_projet(); From d78e12db085de16a2f0ce439a482c79becaf2545 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Feb 2020 21:56:00 +0100 Subject: [PATCH 260/306] Typo --- .github/workflows/greetings-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/greetings-pr.yml b/.github/workflows/greetings-pr.yml index 17e693bf19f..e8bbb023b38 100644 --- a/.github/workflows/greetings-pr.yml +++ b/.github/workflows/greetings-pr.yml @@ -9,4 +9,4 @@ jobs: - uses: actions/first-interaction@v1 with: repo-token: ${{ secrets.GITHUB_TOKEN }} - pr-message: 'Welcome on Dolibarr army. You are on the road to become an Admiral (see https://wiki.dolibarr.org/index.php/Dolibarr_Project)' + pr-message: 'Welcome to the Dolibarr army. You are on the road to become an Admiral (see https://wiki.dolibarr.org/index.php/Dolibarr_Project)' From 4981da235c257bf9265f6f97d15631ea382aa3ef Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Feb 2020 22:00:44 +0100 Subject: [PATCH 261/306] Fix phpcs --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 04bcc74c618..21505242b01 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3528,7 +3528,7 @@ class Form elseif ($filtertype != '' && $filtertype != '-1') $filterarray = explode(',', $filtertype); $this->load_cache_types_paiements(); - + // Set default value if not already set by caller if (empty($selected) && !empty($conf->global->MAIN_DEFAULT_PAYMENT_TYPE_ID)) $selected = $conf->global->MAIN_DEFAULT_PAYMENT_TYPE_ID; From 2ce0aa87e6285a3c589f7d4833ac8782880b731d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Feb 2020 22:10:26 +0100 Subject: [PATCH 262/306] Responsive --- htdocs/core/customreports.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/customreports.php b/htdocs/core/customreports.php index 4478f6f2ce6..c0eb1249012 100644 --- a/htdocs/core/customreports.php +++ b/htdocs/core/customreports.php @@ -253,7 +253,7 @@ if ($object->isextrafieldmanaged) { } } print '
'.$langs->trans("Measures").'
'; -print $form->multiselectarray('search_measures', $arrayofmesures, $search_measures, 0, 0, 'maxwidth500', 1); +print $form->multiselectarray('search_measures', $arrayofmesures, $search_measures, 0, 0, 'minwidth500', 1); print ''; // XAxis From 139dfc3022e4299b6319cb5bbe740e5dca14cf10 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Feb 2020 22:45:27 +0100 Subject: [PATCH 263/306] Debug MRP module --- htdocs/langs/en_US/mrp.lang | 3 + htdocs/mrp/class/mo.class.php | 104 ++++++++++++++------------ htdocs/mrp/mo_card.php | 4 +- htdocs/mrp/mo_production.php | 135 ++++++++++++++++++++++++++-------- 4 files changed, 167 insertions(+), 79 deletions(-) diff --git a/htdocs/langs/en_US/mrp.lang b/htdocs/langs/en_US/mrp.lang index b054df452d7..9a756ba3a79 100644 --- a/htdocs/langs/en_US/mrp.lang +++ b/htdocs/langs/en_US/mrp.lang @@ -66,3 +66,6 @@ AutoCloseMO=Close automatically the Manufacturing Order if quantities to consume NoStockChangeOnServices=No stock change on services ProductQtyToConsumeByMO=Product quantity still to consume by open MO ProductQtyToProduceByMO=Product quentity still to produce by open MO +AddNewConsumeLines=Add new line to consume +ProductsToConsume=Products to consume +ProductsToProduce=Products to produce \ No newline at end of file diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index e677c64efc0..bfbbf3d9a58 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -573,66 +573,69 @@ class Mo extends CommonObject $this->db->begin(); // Insert lines in mrp_production table from BOM data - if (!$error && $this->fk_bom > 0) + if (!$error) { // TODO Check that production has not started. If yes, we stop here. + $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'mrp_production WHERE fk_mo = '.$this->id; $this->db->query($sql); - include_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php'; - $bom = new Bom($this->db); - $bom->fetch($this->fk_bom); - if ($bom->id > 0) - { - $moline = new MoLine($this->db); + $moline = new MoLine($this->db); - // Line to produce - $moline->fk_mo = $this->id; - $moline->qty = $this->qty; - $moline->fk_product = $this->fk_product; - $moline->role = 'toproduce'; - $moline->position = 1; + // Line to produce + $moline->fk_mo = $this->id; + $moline->qty = $this->qty; + $moline->fk_product = $this->fk_product; + $moline->role = 'toproduce'; + $moline->position = 1; - $resultline = $moline->create($user, false); // Never use triggers here - if ($resultline <= 0) { - $error++; - $this->error = $moline->error; - $this->errors = $moline->errors; - dol_print_error($this->db, $moline->error, $moline->errors); - } + $resultline = $moline->create($user, false); // Never use triggers here + if ($resultline <= 0) { + $error++; + $this->error = $moline->error; + $this->errors = $moline->errors; + dol_print_error($this->db, $moline->error, $moline->errors); + } - // Lines to consume - if (! $error) { - foreach ($bom->lines as $line) - { - $moline = new MoLine($this->db); + if ($this->fk_bom > 0) { // If a BOM is defined, we know what to consume. + include_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php'; + $bom = new Bom($this->db); + $bom->fetch($this->fk_bom); + if ($bom->id > 0) + { + // Lines to consume + if (! $error) { + foreach ($bom->lines as $line) + { + $moline = new MoLine($this->db); - $moline->fk_mo = $this->id; - if ($line->qty_frozen) { - $moline->qty = $line->qty; // Qty to consume does not depends on quantity to produce - } else { - $moline->qty = round($line->qty * $this->qty / $bom->efficiency, 2); - } - if ($moline->qty <= 0) { - $error++; - $this->error = "BadValueForquantityToConsume"; - break; - } - else { - $moline->fk_product = $line->fk_product; - $moline->role = 'toconsume'; - $moline->position = $line->position; - $moline->qty_frozen = $line->qty_frozen; - $moline->disable_stock_change = $line->disable_stock_change; - - $resultline = $moline->create($user, false); // Never use triggers here - if ($resultline <= 0) { + $moline->fk_mo = $this->id; + if ($line->qty_frozen) { + $moline->qty = $line->qty; // Qty to consume does not depends on quantity to produce + } else { + $moline->qty = round($line->qty * $this->qty / $bom->efficiency, 2); + } + if ($moline->qty <= 0) { $error++; - $this->error = $moline->error; - $this->errors = $moline->errors; - dol_print_error($this->db, $moline->error, $moline->errors); + $this->error = "BadValueForquantityToConsume"; break; } + else { + $moline->fk_product = $line->fk_product; + $moline->role = 'toconsume'; + $moline->position = $line->position; + $moline->qty_frozen = $line->qty_frozen; + $moline->disable_stock_change = $line->disable_stock_change; + + $resultline = $moline->create($user, false); // Never use triggers here + if ($resultline <= 0) { + $error++; + $this->error = $moline->error; + $this->errors = $moline->errors; + dol_print_error($this->db, $moline->error, $moline->errors); + break; + } + } } } } @@ -1416,6 +1419,11 @@ class MoLine extends CommonObjectLine */ public function create(User $user, $notrigger = false) { + if (empty($this->qty)) { + $this->error = 'BadValueForQty'; + return -1; + } + return $this->createCommon($user, $notrigger); } diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php index 27cccab3d37..db05bfd408d 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -518,7 +518,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print '
'; print ''; - print ''; + print ''; print ''; print ''; - print ''; + print ''; print ''; if (!$i) $totalarray['nbfield']++; diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 0f1b6e24e54..3971914304d 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -941,7 +941,7 @@ if ($resql) // Ref customer if (!empty($arrayfields['c.ref_client']['checked'])) { - print ''; + print ''; if (!$i) $totalarray['nbfield']++; } diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index db1ba28c14e..6fe15241c5a 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -982,6 +982,7 @@ if ($resql) $facturestatic->id = $obj->id; $facturestatic->ref = $obj->ref; + $facturestatic->ref_client = $obj->ref_client; $facturestatic->type = $obj->type; $facturestatic->total_ht = $obj->total_ht; $facturestatic->total_tva = $obj->total_vat; @@ -1071,7 +1072,7 @@ if ($resql) // Customer ref if (!empty($arrayfields['f.ref_client']['checked'])) { - print ''; if (!$i) $totalarray['nbfield']++; diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 9b865cae3e6..6dc24c71b57 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -433,8 +433,8 @@ if ($resql) } $param = '&socid='.$socid; - if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.$contextpage; - if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.$limit; + if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage); + if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit); if ($search_all) $param .= '&search_all='.urlencode($search_all); if ($day) $param .= '&day='.urlencode($day); if ($month) $param .= '&month='.urlencode($month); @@ -455,9 +455,9 @@ if ($resql) if ($search_amount_no_tax) $param .= '&search_amount_no_tax='.urlencode($search_amount_no_tax); if ($search_amount_all_tax) $param .= '&search_amount_all_tax='.urlencode($search_amount_all_tax); if ($search_status >= 0) $param .= "&search_status=".urlencode($search_status); - if ($show_files) $param .= '&show_files='.$show_files; - if ($option) $param .= "&option=".$option; - if ($optioncss != '') $param .= '&optioncss='.$optioncss; + if ($show_files) $param .= '&show_files='.urlencode($show_files); + if ($option) $param .= "&option=".urlencode($option); + if ($optioncss != '') $param .= '&optioncss='.urlencode($optioncss); // Add $param from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; @@ -879,7 +879,7 @@ if ($resql) // Supplier ref if (!empty($arrayfields['f.ref_supplier']['checked'])) { - print ''; if (!$i) $totalarray['nbfield']++; From e0dd31389ca739489ca0bb6ac95178c0318e7102 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Feb 2020 18:05:02 +0100 Subject: [PATCH 284/306] Prepare 11.0.1 --- htdocs/filefunc.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 5c854d0ecb1..a498c933d4b 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -31,7 +31,7 @@ */ if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE', 'Dolibarr'); -if (! defined('DOL_VERSION')) define('DOL_VERSION', '11.0.0'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c +if (! defined('DOL_VERSION')) define('DOL_VERSION', '11.0.1'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c if (! defined('EURO')) define('EURO', chr(128)); From f0596b4bcfab919947f34806809ccc5936652ce3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Feb 2020 18:11:48 +0100 Subject: [PATCH 285/306] Prepare 11.0.1 --- ChangeLog | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/ChangeLog b/ChangeLog index 6980edf4e6f..b11910d25c0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,78 @@ English Dolibarr ChangeLog -------------------------------------------------------------- +***** ChangeLog for 11.0.1 compared to 11.0.0 ***** +FIX: advanced target emailing sql and ergonomy. +FIX: After import of a website template, home page was not set. +FIX: Avoid deletion of bank record if in accounting +FIX: compatibility with multicompany (avoid duplicate data) +FIX: Confusion between 'bank reconciled' and 'accounted'. Show both data. +FIX: Count of Stripe payment mode must take test/live into account +FIX: Creation of Stripe card from backoffice must return a clean message +FIX: CVE-2019–17223 +FIX: CVE-2019–17223 +FIX: CVE-2020-7994 +FIX: CVE Need permission to be able to develop modules +FIX: #13053 +FIX: Disable ticket status change if ticket closed +FIX: doc of dictionnary API +FIX: expedition ceate line new parameter is not required. +FIX: export ledger +FIX: FEC export have specific name +FIX: Filenames must not contains non ascii char or we will get non ascii +FIX: Filter on list of events were lost after "Back to list" +FIX: hasDelay for retained warranty +FIX: If we can change vendor status, we must be able to chane vendor code +FIX: links in products/services index +FIX: Log of authentication ok or ko + CVE-2020-7996 +FIX: Look and feel v11 +FIX: Mail smtps truncated if content has a line with single . +FIX: missing hook parameter +FIX: Missing include +FIX: need weight short label in shipping doc +FIX: Picture of contact not visible in tooltip +FIX: Problem with column label in subscription list +FIX: ref_client not visible in tooltip. +FIX: search filter on extrafields were not restored after "Back to list" +FIX: situation invoice: allow excess paid to be converted to discount +FIX: situation invoice: bad amount for previous payments because of local variable overwriting a more global one +FIX: situation invoice: can't convert excess received to discount & bad previous payment amount +FIX: SQL request and phpunit +FIX: Update export_files.php +FIX: Use ref into label of ticket message +FIX: use "usergroup" instead of "user" +FIX: Warning on admin/export_files +FIX: #10203 +FIX: default filtering for 'select' extrafields should use "=", not "LIKE" +FIX: #11975 When a product is split between multiple pages in a document, prices/quantity/etc appear on the last relevant page +FIX: #12760 #12763 #12755 #12765 #12751 +FIX: #12874 +FIX: #12892 +FIX: #12908 User login with credentials from self-subscription form fails +FIX: #12932 +FIX: #12966 +FIX: #12973 +FIX: #12974 +FIX: #12975 +FIX: #12978 +FIX: #12986 +FIX: #12991 +FIX: #12992 +FIX: #12995 +FIX: #13018 Extrafields Supplier invoice +FIX: #13019 +FIX: #13022 +FIX: #13028 +FIX: #13038 ExpenseReport PDF - custom category description is not correct +FIX: #13046 More complete +FIX: #13048 +FIX: #13050 +FIX: #13077 Replace left join with inner join (left join was useless) +FIX: #13085 +FIX: #13094 +FIX: #13096 +FIX: #13100 + ***** ChangeLog for 11.0.0 compared to 10.0.0 ***** For Users: From 7e2e0b39862a62fb2145bc7dacc96115a1a490c3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Feb 2020 18:26:55 +0100 Subject: [PATCH 286/306] Fix readme --- README-FR.md | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README-FR.md b/README-FR.md index 94af10cb04f..14a53fc8e11 100644 --- a/README-FR.md +++ b/README-FR.md @@ -150,7 +150,7 @@ La documentation utilisateur, développeur et traducteur est disponible sous for ## CONTRIBUER -Ce projet existe grâce à ses nombreux contributeurs [[Contribuer](https://github.com/Dolibarr/dolibarr/blob/develop/.github/CONTRIBUTING.md)]. +Ce projet existe grâce à ses nombreux contributeurs [Contribuer](https://github.com/Dolibarr/dolibarr/blob/develop/.github/CONTRIBUTING.md). ## CREDITS diff --git a/README.md b/README.md index 085ab808488..0fade3dc810 100644 --- a/README.md +++ b/README.md @@ -170,7 +170,7 @@ Administrator, user, developer and translator's documentations are available alo ## CONTRIBUTING -This project exists thanks to all the people who contribute. [[Contribute](https://github.com/Dolibarr/dolibarr/blob/develop/.github/CONTRIBUTING.md)]. +This project exists thanks to all the people who contribute. [Contribute](https://github.com/Dolibarr/dolibarr/blob/develop/.github/CONTRIBUTING.md). ## CREDITS From 921cc08743c6d9da96b0d94d521983ed323a6711 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Feb 2020 18:41:03 +0100 Subject: [PATCH 287/306] Fix url --- README-FR.md | 1 + README.md | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README-FR.md b/README-FR.md index 14a53fc8e11..24a0a64ad05 100644 --- a/README-FR.md +++ b/README-FR.md @@ -151,6 +151,7 @@ La documentation utilisateur, développeur et traducteur est disponible sous for ## CONTRIBUER Ce projet existe grâce à ses nombreux contributeurs [Contribuer](https://github.com/Dolibarr/dolibarr/blob/develop/.github/CONTRIBUTING.md). + ## CREDITS diff --git a/README.md b/README.md index 0fade3dc810..b8d067ffb7a 100644 --- a/README.md +++ b/README.md @@ -170,7 +170,8 @@ Administrator, user, developer and translator's documentations are available alo ## CONTRIBUTING -This project exists thanks to all the people who contribute. [Contribute](https://github.com/Dolibarr/dolibarr/blob/develop/.github/CONTRIBUTING.md). +This project exists thanks to all the people who contribute. [[Contribute](https://github.com/Dolibarr/dolibarr/blob/develop/.github/CONTRIBUTING.md)] + ## CREDITS From 886e76b6db12779c090b07a589ef40aef8b4b210 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Feb 2020 18:48:43 +0100 Subject: [PATCH 288/306] Fix doc --- README-FR.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README-FR.md b/README-FR.md index 24a0a64ad05..bccb7b0143b 100644 --- a/README-FR.md +++ b/README-FR.md @@ -150,7 +150,7 @@ La documentation utilisateur, développeur et traducteur est disponible sous for ## CONTRIBUER -Ce projet existe grâce à ses nombreux contributeurs [Contribuer](https://github.com/Dolibarr/dolibarr/blob/develop/.github/CONTRIBUTING.md). +Ce projet existe grâce à ses nombreux contributeurs [[Contribuer](https://github.com/Dolibarr/dolibarr/blob/develop/.github/CONTRIBUTING.md)]. From 72e59e6fe2be1ddce1261eeb278f619fa8d02719 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Fri, 14 Feb 2020 16:07:06 +0100 Subject: [PATCH 289/306] FIX: Force FEC export to txt format --- htdocs/accountancy/tpl/export_journal.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/tpl/export_journal.tpl.php b/htdocs/accountancy/tpl/export_journal.tpl.php index ca3c9c49ea0..810d95a9ca3 100644 --- a/htdocs/accountancy/tpl/export_journal.tpl.php +++ b/htdocs/accountancy/tpl/export_journal.tpl.php @@ -55,7 +55,7 @@ if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == "11" && $type_export == "genera $endaccountingperiod = dol_print_date(dol_get_last_day($tmparray['year'], $tmparray['mon']), 'dayxcard'); - $completefilename = $siren . "FEC" . $endaccountingperiod . "." . $format; + $completefilename = $siren . "FEC" . $endaccountingperiod . ".txt"; } else { From 4d29cb17de9d13dc949bcba80f958a968d47e103 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 14 Feb 2020 19:04:08 +0100 Subject: [PATCH 290/306] FIX #13110 --- htdocs/accountancy/journal/bankjournal.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 3757a6ab766..8372a728cd2 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -663,7 +663,7 @@ if (! $error && $action == 'writebookkeeping') { } elseif ($tabtype[$key] == 'payment_various') { $bookkeeping->subledger_account = $k; $bookkeeping->subledger_label = $tabcompany[$key]['name']; - $bookkeeping->numero_compte = $tabpay[$obj->rowid]["account_various"]; + $bookkeeping->numero_compte = $tabpay[$key]["account_various"]; $accountingaccount->fetch(null, $bookkeeping->numero_compte, true); $bookkeeping->label_compte = $accountingaccount->label; From 3faed758b32320ff614a1fb22cfb035686500389 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 14 Feb 2020 19:04:08 +0100 Subject: [PATCH 291/306] FIX #13110 --- htdocs/accountancy/journal/bankjournal.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 3757a6ab766..8372a728cd2 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -663,7 +663,7 @@ if (! $error && $action == 'writebookkeeping') { } elseif ($tabtype[$key] == 'payment_various') { $bookkeeping->subledger_account = $k; $bookkeeping->subledger_label = $tabcompany[$key]['name']; - $bookkeeping->numero_compte = $tabpay[$obj->rowid]["account_various"]; + $bookkeeping->numero_compte = $tabpay[$key]["account_various"]; $accountingaccount->fetch(null, $bookkeeping->numero_compte, true); $bookkeeping->label_compte = $accountingaccount->label; From a7df72ee6f427659cd11ef8cd0397eadf4849480 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 14 Feb 2020 19:34:26 +0100 Subject: [PATCH 292/306] FIX #13067 --- htdocs/accountancy/bookkeeping/balance.php | 29 +- .../bookkeeping/openingbalance.php | 336 ------------------ 2 files changed, 19 insertions(+), 346 deletions(-) delete mode 100644 htdocs/accountancy/bookkeeping/openingbalance.php diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index 4a98365f3f9..f76b6fef347 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -99,10 +99,8 @@ if (empty($search_date_start) && !GETPOSTISSET('formfilteraction')) $search_date_end = dol_get_last_day($year_end, $month_end); } } -if ($sortorder == "") - $sortorder = "ASC"; -if ($sortfield == "") - $sortfield = "t.numero_compte"; +if ($sortorder == "") $sortorder = "ASC"; +if ($sortfield == "") $sortfield = "t.numero_compte"; $param = ''; @@ -204,8 +202,7 @@ if ($action != 'export_csv') print ''; $button = 'global->ACCOUNTING_EXPORT_FORMAT.')" />'; - - $button .= dolGetButtonTitle($langs->trans('ShowOpeningBalance'), '', 'fa fa-eye paddingleft', DOL_URL_ROOT.'/accountancy/bookkeeping/openingbalance.php?'.$param); + //$button .= dolGetButtonTitle($langs->trans('HideOpeningBalance'), '', 'fa fa-eye-slash paddingleft', DOL_URL_ROOT.'/accountancy/bookkeeping/balance.php?'.$param); print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $button, $result, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit); @@ -230,7 +227,7 @@ if ($action != 'export_csv') print '
'.$langs->trans("Product").'
'.$langs->trans("ToConsume").''.$langs->trans("ProductsToConsume").''; if (!empty($object->lines)) { @@ -537,7 +537,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print '
'.$langs->trans("ToProduce").''.$langs->trans("ProductsToProduce").''; if (!empty($object->lines)) { diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index e4d8361b721..32d2007141b 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -162,6 +162,25 @@ if (empty($reshook)) $result = $object->setStatut($object::STATUS_INPROGRESS, 0, '', 'MRP_REOPEN'); } + if ($action == 'confirm_addconsumeline' && GETPOST('addconsumelinebutton')) { + $moline = new MoLine($db); + + // Line to produce + $moline->fk_mo = $object->id; + $moline->qty = GETPOST('qtytoadd', 'int');; + $moline->fk_product = GETPOST('productidtoadd', 'int'); + $moline->role = 'toconsume'; + $moline->position = 0; + + $resultline = $moline->create($user, false); // Never use triggers here + if ($resultline <= 0) { + $error++; + setEventMessages($moline->error, $molines->errors, 'errors'); + } + + $action = ''; + } + if (in_array($action, array('confirm_consumeorproduce', 'confirm_consumeandproduceall'))) { $stockmove = new MouvementStock($db); @@ -425,21 +444,43 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneMo', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); } - // Confirmation of action xxxx - if ($action == 'xxx') + // Confirmation of validation + if ($action == 'validate') { + // We check that object has a temporary ref + $ref = substr($object->ref, 1, 4); + if ($ref == 'PROV') { + $object->fetch_product(); + $numref = $object->getNextNumRef($object->fk_product); + } else { + $numref = $object->ref; + } + + $text = $langs->trans('ConfirmValidateMo', $numref); + /*if (! empty($conf->notification->enabled)) + { + require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; + $notify = new Notify($db); + $text .= '
'; + $text .= $notify->confirmMessage('BOM_VALIDATE', $object->socid, $object); + }*/ + $formquestion = array(); - /* - $forcecombo=0; - if ($conf->browser->name == 'ie') $forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy - $formquestion = array( - // 'text' => $langs->trans("ConfirmClone"), - // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), - // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), - // array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1, 0, 0, '', 0, $forcecombo)) - ); - */ - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220); + if (!empty($conf->mrp->enabled)) + { + $langs->load("mrp"); + require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; + $formproduct = new FormProduct($db); + $forcecombo = 0; + if ($conf->browser->name == 'ie') $forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy + $formquestion = array( + // 'text' => $langs->trans("ConfirmClone"), + // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), + // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), + ); + } + + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('Validate'), $text, 'confirm_validate', $formquestion, 0, 1, 220); } // Call Hook formConfirm @@ -530,6 +571,23 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Note that $action and $object may be modified by hook $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); if (empty($reshook)) { + // Validate + if ($object->status == $object::STATUS_DRAFT) + { + if ($permissiontoadd) + { + if (empty($object->table_element_line) || (is_array($object->lines) && count($object->lines) > 0)) + { + print ''.$langs->trans("Validate").''; + } + else + { + $langs->load("errors"); + print ''.$langs->trans("Validate").''; + } + } + } + // Consume or produce if ($object->status == Mo::STATUS_VALIDATED || $object->status == Mo::STATUS_INPROGRESS) { if ($permissiontoproduce) { @@ -578,7 +636,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; } - if (in_array($action, array('consumeorproduce', 'consumeandproduceall'))) + if (in_array($action, array('consumeorproduce', 'consumeandproduceall', 'addconsumeline'))) { print '
'; print ''; @@ -586,20 +644,22 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; print ''; - $defaultstockmovementlabel = GETPOST('inventorylabel', 'alphanohtml') ? GETPOST('inventorylabel', 'alphanohtml') : $langs->trans("ProductionForRef", $object->ref); - //$defaultstockmovementcode = GETPOST('inventorycode', 'alphanohtml') ? GETPOST('inventorycode', 'alphanohtml') : $object->ref.'_'.dol_print_date(dol_now(), 'dayhourlog'); - $defaultstockmovementcode = GETPOST('inventorycode', 'alphanohtml') ? GETPOST('inventorycode', 'alphanohtml') : $langs->trans("ProductionForRef", $object->ref); + if (in_array($action, array('consumeorproduce', 'consumeandproduceall'))) { + $defaultstockmovementlabel = GETPOST('inventorylabel', 'alphanohtml') ? GETPOST('inventorylabel', 'alphanohtml') : $langs->trans("ProductionForRef", $object->ref); + //$defaultstockmovementcode = GETPOST('inventorycode', 'alphanohtml') ? GETPOST('inventorycode', 'alphanohtml') : $object->ref.'_'.dol_print_date(dol_now(), 'dayhourlog'); + $defaultstockmovementcode = GETPOST('inventorycode', 'alphanohtml') ? GETPOST('inventorycode', 'alphanohtml') : $langs->trans("ProductionForRef", $object->ref); - print '
'; - print ''.$langs->trans("ConfirmProductionDesc", $langs->transnoentitiesnoconv("Confirm")).'
'; - print $langs->trans("MovementLabel").':   '; - print $langs->trans("InventoryCode").':

'; - print '
'; - print ''; - print '   '; - print ''; - print '
'; - print '
'; + print '
'; + print ''.$langs->trans("ConfirmProductionDesc", $langs->transnoentitiesnoconv("Confirm")).'
'; + print $langs->trans("MovementLabel").':   '; + print $langs->trans("InventoryCode").':

'; + print '
'; + print ''; + print '   '; + print ''; + print '
'; + print '
'; + } } @@ -618,7 +678,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print '
'; print '
'; - print load_fiche_titre($langs->trans('Consumption'), '', ''); + $newlinetext = ''.$langs->trans("AddNewConsumeLines").''; + print load_fiche_titre($langs->trans('Consumption'), '', '', 0, '', '', $newlinetext); print '
'; print ''; @@ -637,6 +698,22 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } print ''; + if ($action == 'addconsumeline') { + print ''; + print ''; + print ''; + print ''; + print ''; + if ($conf->productbatch->enabled) { + print ''; + } + print ''; + } + if (!empty($object->lines)) { $nblinetoconsume = 0; @@ -900,7 +977,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; } - if (in_array($action, array('consumeorproduce', 'consumeandproduceall'))) + if (in_array($action, array('consumeorproduce', 'consumeandproduceall', 'addconsumeline'))) { print "\n"; } From 138cf649dfc83c5b3066c949ea778b262a4808df Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Feb 2020 23:17:46 +0100 Subject: [PATCH 264/306] Fix missing amount in table of prelevement --- htdocs/stripe/class/stripe.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index 32d9fd4784b..b2e50c1c42b 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -326,7 +326,7 @@ class Stripe extends CommonObject */ public function getPaymentIntent($amount, $currency_code, $tag, $description = '', $object = null, $customer = null, $key = null, $status = 0, $usethirdpartyemailforreceiptemail = 0, $mode = 'automatic', $confirmnow = false, $payment_method = null, $off_session = 0, $noidempotency_key = 0) { - global $conf; + global $conf, $user; dol_syslog("getPaymentIntent", LOG_INFO, 1); @@ -488,8 +488,8 @@ class Stripe extends CommonObject if (!$paymentintentalreadyexists) { $now = dol_now(); - $sql = "INSERT INTO ".MAIN_DB_PREFIX."prelevement_facture_demande (date_demande, fk_user_demande, ext_payment_id, fk_facture, sourcetype, entity, ext_payment_site)"; - $sql .= " VALUES ('".$this->db->idate($now)."', '0', '".$this->db->escape($paymentintent->id)."', ".$object->id.", '".$this->db->escape($object->element)."', ".$conf->entity.", '".$service."')"; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."prelevement_facture_demande (date_demande, fk_user_demande, ext_payment_id, fk_facture, sourcetype, entity, ext_payment_site, amount)"; + $sql .= " VALUES ('".$this->db->idate($now)."', ".$user->id.", '".$this->db->escape($paymentintent->id)."', ".$object->id.", '".$this->db->escape($object->element)."', ".$conf->entity.", '".$service."', ".$amount.")"; $resql = $this->db->query($sql); if (!$resql) { From 9667482ef21ae64fe179806a8c18eb8e0bcdefc5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Feb 2020 00:04:17 +0100 Subject: [PATCH 265/306] Doc --- htdocs/stripe/class/stripe.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index b2e50c1c42b..28bcf9f3347 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -643,7 +643,7 @@ class Stripe extends CommonObject { $now=dol_now(); $sql = "INSERT INTO " . MAIN_DB_PREFIX . "prelevement_facture_demande (date_demande, fk_user_demande, ext_payment_id, fk_facture, sourcetype, entity, ext_payment_site)"; - $sql .= " VALUES ('".$this->db->idate($now)."', '0', '".$this->db->escape($setupintent->id)."', ".$object->id.", '".$this->db->escape($object->element)."', " . $conf->entity . ", '" . $service . "')"; + $sql .= " VALUES ('".$this->db->idate($now)."', ".$user->id.", '".$this->db->escape($setupintent->id)."', ".$object->id.", '".$this->db->escape($object->element)."', " . $conf->entity . ", '" . $service . "', ".$amount.")"; $resql = $this->db->query($sql); if (! $resql) { From 21d9b00fcebb899058dfeb32bbada22437b0938e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Feb 2020 23:17:46 +0100 Subject: [PATCH 266/306] Fix missing amount in table of prelevement --- htdocs/stripe/class/stripe.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index f5656387192..762b73db43b 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -325,7 +325,7 @@ class Stripe extends CommonObject */ public function getPaymentIntent($amount, $currency_code, $tag, $description = '', $object = null, $customer = null, $key = null, $status = 0, $usethirdpartyemailforreceiptemail = 0, $mode = 'automatic', $confirmnow = false, $payment_method = null, $off_session = 0, $noidempotency_key = 0) { - global $conf; + global $conf, $user; dol_syslog("getPaymentIntent", LOG_INFO, 1); @@ -486,8 +486,8 @@ class Stripe extends CommonObject if (!$paymentintentalreadyexists) { $now = dol_now(); - $sql = "INSERT INTO ".MAIN_DB_PREFIX."prelevement_facture_demande (date_demande, fk_user_demande, ext_payment_id, fk_facture, sourcetype, entity, ext_payment_site)"; - $sql .= " VALUES ('".$this->db->idate($now)."', '0', '".$this->db->escape($paymentintent->id)."', ".$object->id.", '".$this->db->escape($object->element)."', ".$conf->entity.", '".$service."')"; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."prelevement_facture_demande (date_demande, fk_user_demande, ext_payment_id, fk_facture, sourcetype, entity, ext_payment_site, amount)"; + $sql .= " VALUES ('".$this->db->idate($now)."', ".$user->id.", '".$this->db->escape($paymentintent->id)."', ".$object->id.", '".$this->db->escape($object->element)."', ".$conf->entity.", '".$service."', ".$amount.")"; $resql = $this->db->query($sql); if (!$resql) { From 1973f2c9b9832b5c5899a27d1366f940af4d29e8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Feb 2020 10:07:34 +0100 Subject: [PATCH 267/306] Fix look and feel v11 --- htdocs/societe/project.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/project.php b/htdocs/societe/project.php index 1ff2c24956e..c6029544c90 100644 --- a/htdocs/societe/project.php +++ b/htdocs/societe/project.php @@ -118,14 +118,15 @@ if ($socid) dol_fiche_end(); + $params = ''; - $addbutton = ''.$langs->trans("AddProject").''; + $newcardbutton .= dolGetButtonTitle($langs->trans("NewProject"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/card.php?action=create&socid='.$object->id.'&backtopage='.urlencode($backtopage), '', 1, $params); print '
'; // Projects list - $result=show_projects($conf, $langs, $db, $object, $_SERVER["PHP_SELF"].'?socid='.$object->id, 1, $addbutton); + $result=show_projects($conf, $langs, $db, $object, $_SERVER["PHP_SELF"].'?socid='.$object->id, 1, $newcardbutton); } // End of page From 495b3d54f19b9611f1bcab156f3ea79ca38fa169 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Feb 2020 10:41:31 +0100 Subject: [PATCH 268/306] Fix status of emailing target --- htdocs/comm/mailing/cibles.php | 3 ++- htdocs/comm/mailing/class/mailing.class.php | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 3dcfdf9e451..41e49ed09b3 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -673,7 +673,8 @@ if ($object->fetch($id) >= 0) // Date sent print '
'; - print ''; } else diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index 32637096910..553c5e79c15 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -662,10 +662,12 @@ class Mailing extends CommonObject $labelStatusShort = array(); $labelStatus[-1] = $langs->trans('MailingStatusError'); + $labelStatus[0] = $langs->trans('MailingStatusNotSent'); $labelStatus[1] = $langs->trans('MailingStatusSent'); $labelStatus[2] = $langs->trans('MailingStatusRead'); $labelStatus[3] = $langs->trans('MailingStatusNotContact'); $labelStatusShort[-1] = $langs->trans('MailingStatusError'); + $labelStatusShort[0] = $langs->trans('MailingStatusNotSent'); $labelStatusShort[1] = $langs->trans('MailingStatusSent'); $labelStatusShort[2] = $langs->trans('MailingStatusRead'); $labelStatusShort[3] = $langs->trans('MailingStatusNotContact'); From 33b7fc11f0ac1ee75512b87e4c212acbe56ed558 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Feb 2020 10:41:31 +0100 Subject: [PATCH 269/306] Fix status of emailing target --- htdocs/comm/mailing/cibles.php | 3 ++- htdocs/comm/mailing/class/mailing.class.php | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 3dcfdf9e451..41e49ed09b3 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -673,7 +673,8 @@ if ($object->fetch($id) >= 0) // Date sent print ''; - print ''; } else diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index 32637096910..553c5e79c15 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -662,10 +662,12 @@ class Mailing extends CommonObject $labelStatusShort = array(); $labelStatus[-1] = $langs->trans('MailingStatusError'); + $labelStatus[0] = $langs->trans('MailingStatusNotSent'); $labelStatus[1] = $langs->trans('MailingStatusSent'); $labelStatus[2] = $langs->trans('MailingStatusRead'); $labelStatus[3] = $langs->trans('MailingStatusNotContact'); $labelStatusShort[-1] = $langs->trans('MailingStatusError'); + $labelStatusShort[0] = $langs->trans('MailingStatusNotSent'); $labelStatusShort[1] = $langs->trans('MailingStatusSent'); $labelStatusShort[2] = $langs->trans('MailingStatusRead'); $labelStatusShort[3] = $langs->trans('MailingStatusNotContact'); From 17010478ba6e7578a991c601dbc31adceffdabd5 Mon Sep 17 00:00:00 2001 From: Scrutinizer Auto-Fixer Date: Thu, 13 Feb 2020 09:44:08 +0000 Subject: [PATCH 270/306] Scrutinizer Auto-Fixes This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com --- htdocs/comm/action/list.php | 4 +- htdocs/core/class/utils.class.php | 2 +- htdocs/core/customreports.php | 118 +++++++++--------- htdocs/core/lib/functions.lib.php | 16 +-- .../facture/doc/pdf_sponge.modules.php | 22 ++-- htdocs/core/tpl/notes.tpl.php | 60 ++++----- htdocs/mrp/mo_agenda.php | 4 +- htdocs/mrp/mo_document.php | 48 +++---- htdocs/mrp/mo_note.php | 32 ++--- htdocs/user/note.php | 16 +-- 10 files changed, 161 insertions(+), 161 deletions(-) diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 257df35828e..895136f82f0 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -67,8 +67,8 @@ $search_note = GETPOST('search_note', 'alpha'); $dateselect = dol_mktime(0, 0, 0, GETPOST('dateselectmonth', 'int'), GETPOST('dateselectday', 'int'), GETPOST('dateselectyear', 'int')); $datestart = dol_mktime(0, 0, 0, GETPOST('datestartmonth', 'int'), GETPOST('datestartday', 'int'), GETPOST('datestartyear', 'int')); $dateend = dol_mktime(0, 0, 0, GETPOST('dateendmonth', 'int'), GETPOST('dateendday', 'int'), GETPOST('dateendyear', 'int')); -if ($search_status == '' && ! GETPOSTISSET('search_status')) $search_status = (empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_STATUS); -if (empty($action) && ! GETPOSTISSET('action')) $action = (empty($conf->global->AGENDA_DEFAULT_VIEW) ? 'show_month' : $conf->global->AGENDA_DEFAULT_VIEW); +if ($search_status == '' && !GETPOSTISSET('search_status')) $search_status = (empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_STATUS); +if (empty($action) && !GETPOSTISSET('action')) $action = (empty($conf->global->AGENDA_DEFAULT_VIEW) ? 'show_month' : $conf->global->AGENDA_DEFAULT_VIEW); $filter = GETPOST("search_filter", 'alpha', 3) ?GETPOST("search_filter", 'alpha', 3) : GETPOST("filter", 'alpha', 3); $filtert = GETPOST("search_filtert", "int", 3) ?GETPOST("search_filtert", "int", 3) : GETPOST("filtert", "int", 3); diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index 93ac680484f..11b6717216b 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -388,7 +388,7 @@ class Utils if ($compression == 'none') fclose($handle); if ($compression == 'gz') gzclose($handle); if ($compression == 'bz') bzclose($handle); - if ($ok && preg_match('/^-- (MySql|MariaDB)/i', $errormsg)) { // No error + if ($ok && preg_match('/^-- (MySql|MariaDB)/i', $errormsg)) { // No error $errormsg = ''; } else diff --git a/htdocs/core/customreports.php b/htdocs/core/customreports.php index c0eb1249012..9ce35616561 100644 --- a/htdocs/core/customreports.php +++ b/htdocs/core/customreports.php @@ -25,7 +25,7 @@ * \brief Page to make custom reports */ -if (! defined('USE_CUSTOME_REPORT_AS_INCLUDE')) +if (!defined('USE_CUSTOME_REPORT_AS_INCLUDE')) { require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"; @@ -37,7 +37,7 @@ if (! defined('USE_CUSTOME_REPORT_AS_INCLUDE')) $action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) - $mode = GETPOST('mode', 'alpha') ? GETPOST('mode', 'alpha') : 'graph'; + $mode = GETPOST('mode', 'alpha') ? GETPOST('mode', 'alpha') : 'graph'; $objecttype = GETPOST('objecttype', 'aZ09'); $tabfamily = GETPOST('tabfamily', 'aZ09'); @@ -93,21 +93,21 @@ $parameters = array('objecttype'=>$objecttype, 'tabfamily'=>$tabfamily); $reshook = $hookmanager->executeHooks('loadDataForCustomReports', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); elseif (is_array($hookmanager->resArray)) { - if (! empty($hookmanager->resArray['title'])) { // Add entries for tabs + if (!empty($hookmanager->resArray['title'])) { // Add entries for tabs $title = $hookmanager->resArray['title']; } - if (! empty($hookmanager->resArray['picto'])) { // Add entries for tabs + if (!empty($hookmanager->resArray['picto'])) { // Add entries for tabs $picto = $hookmanager->resArray['picto']; } - if (! empty($hookmanager->resArray['head'])) { // Add entries for tabs + if (!empty($hookmanager->resArray['head'])) { // Add entries for tabs $head = array_merge($head, $hookmanager->resArray['head']); } - if (! empty($hookmanager->resArray['arrayoftype'])) { // Add entries from hook - foreach($hookmanager->resArray['arrayoftype'] as $key => $val) { + if (!empty($hookmanager->resArray['arrayoftype'])) { // Add entries from hook + foreach ($hookmanager->resArray['arrayoftype'] as $key => $val) { $arrayoftype[$key] = $val; } } - if (! empty($hookmanager->resArray['modenotusedforlist'])) { // Show objecttype selection even if objecttype is set + if (!empty($hookmanager->resArray['modenotusedforlist'])) { // Show objecttype selection even if objecttype is set $modenotusedforlist = $hookmanager->resArray['modenotusedforlist']; } } @@ -125,7 +125,7 @@ if ($objecttype) { $ObjectClassName = $arrayoftype[$objecttype]['ObjectClassName']; $object = new $ObjectClassName($db); } - catch(Exception $e) { + catch (Exception $e) { print 'Failed to load class for type '.$objecttype; } } @@ -145,7 +145,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); -$search_component_params=array(''); +$search_component_params = array(''); /* @@ -160,9 +160,9 @@ $search_component_params=array(''); * View */ -$form=new Form($db); +$form = new Form($db); -if (! defined('USE_CUSTOME_REPORT_AS_INCLUDE')) { +if (!defined('USE_CUSTOME_REPORT_AS_INCLUDE')) { llxHeader('', $langs->transnoentitiesnoconv('CustomReports'), ''); dol_fiche_head($head, 'customreports', $title, -1, $picto); @@ -170,13 +170,13 @@ if (! defined('USE_CUSTOME_REPORT_AS_INCLUDE')) { // Check parameters if ($action == 'viewgraph') { - if (! count($search_measures)) { + if (!count($search_measures)) { setEventMessages($langs->trans("AtLeastOneMeasureIsRequired"), null, 'warnings'); } elseif ($mode == 'graph' && count($search_xaxis) > 1) { setEventMessages($langs->trans("OnlyOneFieldForXAxisIsPossible"), null, 'warnings'); $search_xaxis = array(0 => $search_xaxis[0]); } - if (! count($search_xaxis)) { + if (!count($search_xaxis)) { setEventMessages($langs->trans("AtLeastOneXAxisIsRequired"), null, 'warnings'); } elseif ($mode == 'graph' && $search_graph == 'bars' && count($search_measures) > 3) { setEventMessages($langs->trans("GraphInBarsAreLimitedTo3Measures"), null, 'warnings'); @@ -184,11 +184,11 @@ if ($action == 'viewgraph') { } } -$tmparray=dol_getdate(dol_now()); -$endyear=$tmparray['year']; -$endmonth=$tmparray['mon']; -$datelastday=dol_get_last_day($endyear, $endmonth, 1); -$startyear=$endyear-2; +$tmparray = dol_getdate(dol_now()); +$endyear = $tmparray['year']; +$endmonth = $tmparray['mon']; +$datelastday = dol_get_last_day($endyear, $endmonth, 1); +$startyear = $endyear - 2; $param = ''; @@ -207,7 +207,7 @@ print '
'; print '
'; print '
'.$langs->trans("StatisticsOn").'
'; $newarrayoftype = array(); -foreach($arrayoftype as $key => $val) { +foreach ($arrayoftype as $key => $val) { if (dol_eval($val['enabled'], 1)) { $newarrayoftype[$key] = $arrayoftype[$key]; } @@ -219,7 +219,7 @@ else { jQuery(document).ready(function() { jQuery("#objecttype").change(function() { console.log("Reload for "+jQuery("#objecttype").val()); - location.href = "'.$_SERVER["PHP_SELF"].'?objecttype="+jQuery("#objecttype").val()+"'.($tabfamily?'&tabfamily='.$tabfamily:'').'"; + location.href = "'.$_SERVER["PHP_SELF"].'?objecttype="+jQuery("#objecttype").val()+"'.($tabfamily ? '&tabfamily='.$tabfamily : '').'"; }); }); '; @@ -233,7 +233,7 @@ print '
'; // Measures print '
'; -foreach($object->fields as $key => $val) { +foreach ($object->fields as $key => $val) { if ($val['isameasure']) { $arrayofmesures['t.'.$key.'-sum'] = $langs->trans($val['label']).' ('.$langs->trans("Sum").')'; $arrayofmesures['t.'.$key.'-average'] = $langs->trans($val['label']).' ('.$langs->trans("Average").')'; @@ -243,8 +243,8 @@ foreach($object->fields as $key => $val) { } // Add measure from extrafields if ($object->isextrafieldmanaged) { - foreach($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - if (! empty($extrafields->attributes[$object->table_element]['totalizable'][$key])) { + foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { + if (!empty($extrafields->attributes[$object->table_element]['totalizable'][$key])) { $arrayofmesures['te.'.$key.'-sum'] = $langs->trans($extrafields->attributes[$object->table_element]['label'][$key]).' ('.$langs->trans("Sum").')'; $arrayofmesures['te.'.$key.'-average'] = $langs->trans($extrafields->attributes[$object->table_element]['label'][$key]).' ('.$langs->trans("Average").')'; $arrayofmesures['te.'.$key.'-min'] = $langs->trans($extrafields->attributes[$object->table_element]['label'][$key]).' ('.$langs->trans("Minimum").')'; @@ -258,14 +258,14 @@ print '
'; // XAxis print '
'; -foreach($object->fields as $key => $val) { - if (! $val['measure']) { +foreach ($object->fields as $key => $val) { + if (!$val['measure']) { 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; + 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; if (preg_match('/^pass/', $key)) continue; if (in_array($val['type'], array('html', 'text'))) continue; if (in_array($val['type'], array('timestamp', 'date', 'datetime'))) { @@ -278,8 +278,8 @@ foreach($object->fields as $key => $val) { } // Add measure from extrafields if ($object->isextrafieldmanaged) { - foreach($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - if (! empty($extrafields->attributes[$object->table_element]['totalizable'][$key])) { + foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { + if (!empty($extrafields->attributes[$object->table_element]['totalizable'][$key])) { $arrayofxaxis['te.'.$key] = array('label' => $extrafields->attributes[$object->table_element]['label'][$key], 'position' => (int) $extrafields->attributes[$object->table_element]['pos'][$key]); } } @@ -287,7 +287,7 @@ foreach($object->fields as $key => $val) { } $arrayofxaxis = dol_sort_array($arrayofxaxis, 'position'); $arrayofxaxislabel = array(); -foreach($arrayofxaxis as $key => $val) { +foreach ($arrayofxaxis as $key => $val) { $arrayofxaxislabel[$key] = $val['label']; } print '
'.$langs->trans("XAxis").'
'; @@ -297,8 +297,8 @@ print '
'; // YAxis if ($mode == 'grid') { print '
'; - foreach($object->fields as $key => $val) { - if (! $val['measure']) { + foreach ($object->fields as $key => $val) { + if (!$val['measure']) { if (in_array($key, array('id', 'rowid', 'entity', 'last_main_doc', 'extraparams'))) continue; if (preg_match('/^fk_/', $key)) continue; if (in_array($val['type'], array('html', 'text'))) continue; @@ -312,8 +312,8 @@ if ($mode == 'grid') { } // Add measure from extrafields if ($object->isextrafieldmanaged) { - foreach($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - if (! empty($extrafields->attributes[$object->table_element]['totalizable'][$key])) { + foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { + if (!empty($extrafields->attributes[$object->table_element]['totalizable'][$key])) { $arrayofyaxis['te.'.$key] = array('label' => $extrafields->attributes[$object->table_element]['label'][$key], 'position' => (int) $extrafields->attributes[$object->table_element]['pos'][$key]); } } @@ -321,7 +321,7 @@ if ($mode == 'grid') { } $arrayofyaxis = dol_sort_array($arrayofyaxis, 'position'); $arrayofyaxislabel = array(); - foreach($arrayofyaxis as $key => $val) { + foreach ($arrayofyaxis as $key => $val) { $arrayofyaxislabel[$key] = $val['label']; } print '
'.$langs->trans("YAxis").'
'; @@ -345,12 +345,12 @@ print ''; // Generate the SQL request $sql = ''; -if (! empty($search_measures) && ! empty($search_xaxis)) +if (!empty($search_measures) && !empty($search_xaxis)) { $fieldid = 'rowid'; $sql = 'SELECT '; - foreach($search_xaxis as $key => $val) { + foreach ($search_xaxis as $key => $val) { if (preg_match('/\-year$/', $val)) { $tmpval = preg_replace('/\-year$/', '', $val); $sql .= 'DATE_FORMAT('.$tmpval.", '%Y') as x_".$key.', '; @@ -363,14 +363,14 @@ if (! empty($search_measures) && ! empty($search_xaxis)) } else $sql .= $val.' as x_'.$key.', '; } - foreach($search_measures as $key => $val) { + foreach ($search_measures as $key => $val) { if ($val == 't.count') $sql .= 'COUNT(t.'.$fieldid.') as y_'.$key.', '; elseif (preg_match('/\-sum$/', $val)) { - $tmpval = preg_replace('/\-sum$/', '', $val); + $tmpval = preg_replace('/\-sum$/', '', $val); $sql .= 'SUM('.$db->ifsql($tmpval.' IS NULL', '0', $tmpval).') as y_'.$key.', '; } elseif (preg_match('/\-average$/', $val)) { - $tmpval = preg_replace('/\-average$/', '', $val); + $tmpval = preg_replace('/\-average$/', '', $val); $sql .= 'AVG('.$db->ifsql($tmpval.' IS NULL', '0', $tmpval).') as y_'.$key.', '; } elseif (preg_match('/\-min$/', $val)) { @@ -378,7 +378,7 @@ if (! empty($search_measures) && ! empty($search_xaxis)) $sql .= 'MIN('.$db->ifsql($tmpval.' IS NULL', '0', $tmpval).') as y_'.$key.', '; } elseif (preg_match('/\-max$/', $val)) { - $tmpval = preg_replace('/\-max$/', '', $val); + $tmpval = preg_replace('/\-max$/', '', $val); $sql .= 'MAX('.$db->ifsql($tmpval.' IS NULL', '0', $tmpval).') as y_'.$key.', '; } } @@ -401,11 +401,11 @@ if (! empty($search_measures) && ! empty($search_xaxis)) if ($object->ismultientitymanaged == 1) { $sql .= ' AND entity IN ('.getEntity($object->element).')'; } - foreach($search_filters as $key => $val) { + foreach ($search_filters as $key => $val) { // TODO } $sql .= ' GROUP BY '; - foreach($search_xaxis as $key => $val) { + foreach ($search_xaxis as $key => $val) { if (preg_match('/\-year$/', $val)) { $tmpval = preg_replace('/\-year$/', '', $val); $sql .= 'DATE_FORMAT('.$tmpval.", '%Y'), "; @@ -420,7 +420,7 @@ if (! empty($search_measures) && ! empty($search_xaxis)) } $sql = preg_replace('/,\s*$/', '', $sql); $sql .= ' ORDER BY '; - foreach($search_xaxis as $key => $val) { + foreach ($search_xaxis as $key => $val) { if (preg_match('/\-year$/', $val)) { $tmpval = preg_replace('/\-year$/', '', $val); $sql .= 'DATE_FORMAT('.$tmpval.", '%Y'), "; @@ -437,8 +437,8 @@ if (! empty($search_measures) && ! empty($search_xaxis)) } -$legend=array(); -foreach($search_measures as $key => $val) { +$legend = array(); +foreach ($search_measures as $key => $val) { $legend[] = $langs->trans($arrayofmesures[$val]); } @@ -447,21 +447,21 @@ $totalnbofrecord = 0; $data = array(); if ($sql) { $resql = $db->query($sql); - if (! $resql) { + if (!$resql) { dol_print_error($db); } - while($obj = $db->fetch_object($resql)) { + while ($obj = $db->fetch_object($resql)) { // $this->data = array(array(0=>'labelxA',1=>yA1,...,n=>yAn), array('labelxB',yB1,...yBn)); // or when there is n series to show for each x - foreach($search_xaxis as $xkey => $xval) { + foreach ($search_xaxis as $xkey => $xval) { $fieldforxkey = 'x_'.$xkey; $xlabel = $obj->$fieldforxkey; $xvalwithoutprefix = preg_replace('/^[a-z]+\./', '', $xval); - if (! empty($object->fields[$xvalwithoutprefix]['arrayofkeyval'])) { + if (!empty($object->fields[$xvalwithoutprefix]['arrayofkeyval'])) { $xlabel = $object->fields[$xvalwithoutprefix]['arrayofkeyval'][$obj->$fieldforxkey]; } $xarray = array(0 => (($xlabel || $xlabel == '0') ? dol_trunc($xlabel, 20, 'middle') : $langs->trans("NotDefined"))); - foreach($search_measures as $key => $val) { + foreach ($search_measures as $key => $val) { $fieldfory = 'y_'.$key; $xarray[] = $obj->$fieldfory; } @@ -473,7 +473,7 @@ if ($sql) { } -print '
'; +print '
'; if ($mode == 'grid') { @@ -487,13 +487,13 @@ if ($mode == 'graph') { // Show graph $px1 = new DolGraph(); $mesg = $px1->isGraphKo(); - if (! $mesg) + if (!$mesg) { $px1->SetData($data); unset($data); $arrayoftypes = array(); - foreach($search_measures as $key => $val) { + foreach ($search_measures as $key => $val) { $arrayoftypes[] = $search_graph; } @@ -507,10 +507,10 @@ if ($mode == 'graph') { $px1->SetHorizTickIncrement(1); $px1->SetCssPrefix("cssboxes"); $px1->SetType($arrayoftypes); - $px1->mode='depth'; + $px1->mode = 'depth'; $px1->SetTitle(''); - $dir=$conf->user->dir_temp; + $dir = $conf->user->dir_temp; dol_mkdir($dir); $filenamenb = $dir.'/customreport_'.$object->element.'.png'; $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=user&file=customreport_'.$object->element.'.png'; @@ -528,7 +528,7 @@ if ($sql) { print '
'; -if (! defined('USE_CUSTOME_REPORT_AS_INCLUDE')) { +if (!defined('USE_CUSTOME_REPORT_AS_INCLUDE')) { dol_fiche_end(); } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 26602874c10..4985ab35b0d 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1105,8 +1105,8 @@ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename = 'ip' => false ); - $remoteip = getUserRemoteIP(); // Get ip when page run on a web server - if (! empty($remoteip)) { + $remoteip = getUserRemoteIP(); // Get ip when page run on a web server + if (!empty($remoteip)) { $data['ip'] = $remoteip; // This is when server run behind a reverse proxy if (!empty($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR'] != $remoteip) $data['ip'] = $_SERVER['HTTP_X_FORWARDED_FOR'].' -> '.$data['ip']; @@ -5600,7 +5600,7 @@ function dol_string_onlythesehtmltags($stringtoclean, $cleanalsosomestyles = 1) $allowed_tags_string = '<'.$allowed_tags_string.'>'; if ($cleanalsosomestyles) { - $stringtoclean = preg_replace('/position\s*:\s*(absolute|fixed)\s*!\s*important/', '', $stringtoclean); // Note: If hacker try to introduce css comment into string to avoid this, string should be encoded by the dol_htmlentitiesbr so be harmless + $stringtoclean = preg_replace('/position\s*:\s*(absolute|fixed)\s*!\s*important/', '', $stringtoclean); // Note: If hacker try to introduce css comment into string to avoid this, string should be encoded by the dol_htmlentitiesbr so be harmless } $temp = strip_tags($stringtoclean, $allowed_tags_string); @@ -5629,7 +5629,7 @@ function dol_string_neverthesehtmltags($stringtoclean, $disallowed_tags = array( } if ($cleanalsosomestyles) { - $temp = preg_replace('/position\s*:\s*(absolute|fixed)\s*!\s*important/', '', $temp); // Note: If hacker try to introduce css comment into string to avoid this, string should be encoded by the dol_htmlentitiesbr so be harmless + $temp = preg_replace('/position\s*:\s*(absolute|fixed)\s*!\s*important/', '', $temp); // Note: If hacker try to introduce css comment into string to avoid this, string should be encoded by the dol_htmlentitiesbr so be harmless } return $temp; @@ -6129,7 +6129,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, $substitutionarray['__REFCLIENT__'] = (isset($object->ref_client) ? $object->ref_client : (isset($object->ref_customer) ? $object->ref_customer : null)); $substitutionarray['__REFSUPPLIER__'] = (isset($object->ref_supplier) ? $object->ref_supplier : null); $substitutionarray['__SUPPLIER_ORDER_DATE_DELIVERY__'] = (isset($object->date_livraison) ? dol_print_date($object->date_livraison, 'day', 0, $outputlangs) : ''); - $substitutionarray['__SUPPLIER_ORDER_DELAY_DELIVERY__'] = $outputlangs->transnoentities("AvailabilityType".$object->availability_code)!=('AvailabilityType'.$object->availability_code)?$outputlangs->transnoentities("AvailabilityType".$object->availability_code):$outputlangs->convToOutputCharset(isset($object->availability)?$object->availability:''); + $substitutionarray['__SUPPLIER_ORDER_DELAY_DELIVERY__'] = $outputlangs->transnoentities("AvailabilityType".$object->availability_code) != ('AvailabilityType'.$object->availability_code) ? $outputlangs->transnoentities("AvailabilityType".$object->availability_code) : $outputlangs->convToOutputCharset(isset($object->availability) ? $object->availability : ''); $birthday = dol_print_date($object->birth, 'day'); @@ -6954,9 +6954,9 @@ function ascii_check($str) { if (function_exists('mb_check_encoding')) { //if (mb_detect_encoding($str, 'ASCII', true) return false; - if (! mb_check_encoding($str, 'ASCII')) return false; + if (!mb_check_encoding($str, 'ASCII')) return false; } else { - if (preg_match('/[^\x00-\x7f]/', $str)) return false; // Contains a byte > 7f + if (preg_match('/[^\x00-\x7f]/', $str)) return false; // Contains a byte > 7f } return true; @@ -8044,7 +8044,7 @@ function dol_mimetype($file, $default = 'application/octet-stream', $mode = 0) if (preg_match('/\.bas$/i', $tmpfile)) { $mime = 'text/plain'; $imgmime = 'text.png'; $srclang = 'bas'; $famime = 'file-code-o'; } if (preg_match('/\.(c)$/i', $tmpfile)) { $mime = 'text/plain'; $imgmime = 'text.png'; $srclang = 'c'; $famime = 'file-code-o'; } if (preg_match('/\.(cpp)$/i', $tmpfile)) { $mime = 'text/plain'; $imgmime = 'text.png'; $srclang = 'cpp'; $famime = 'file-code-o'; } - if (preg_match('/\.cs$/i', $tmpfile)) { $mime = 'text/plain'; $imgmime = 'text.png'; $srclang = 'cs'; $famime = 'file-code-o'; } + if (preg_match('/\.cs$/i', $tmpfile)) { $mime = 'text/plain'; $imgmime = 'text.png'; $srclang = 'cs'; $famime = 'file-code-o'; } if (preg_match('/\.(h)$/i', $tmpfile)) { $mime = 'text/plain'; $imgmime = 'text.png'; $srclang = 'h'; $famime = 'file-code-o'; } if (preg_match('/\.(java|jsp)$/i', $tmpfile)) { $mime = 'text/plain'; $imgmime = 'text.png'; $srclang = 'java'; $famime = 'file-code-o'; } if (preg_match('/\.php([0-9]{1})?$/i', $tmpfile)) { $mime = 'text/plain'; $imgmime = 'php.png'; $srclang = 'php'; $famime = 'file-code-o'; } diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 37fa1cb3ae2..a9d1230fdec 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -609,7 +609,7 @@ class pdf_sponge extends ModelePDFFactures $curY = $tab_top_newpage; // Allows data in the first page if description is long enough to break in multiples pages - if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; @@ -652,7 +652,7 @@ class pdf_sponge extends ModelePDFFactures { // We found a page break // Allows data in the first page if description is long enough to break in multiples pages - if(!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) + if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) $showpricebeforepagebreak = 1; else $showpricebeforepagebreak = 0; @@ -1132,33 +1132,33 @@ class pdf_sponge extends ModelePDFFactures $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posxval, $posy); - $lib_mode_reg=$outputlangs->transnoentities("PaymentType".$object->mode_reglement_code)!=('PaymentType'.$object->mode_reglement_code)?$outputlangs->transnoentities("PaymentType".$object->mode_reglement_code):$outputlangs->convToOutputCharset($object->mode_reglement); + $lib_mode_reg = $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) != ('PaymentType'.$object->mode_reglement_code) ? $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) : $outputlangs->convToOutputCharset($object->mode_reglement); $pdf->MultiCell(80, 5, $lib_mode_reg, 0, 'L'); // Show online payment link - $useonlinepayment = ((! empty($conf->paypal->enabled) || ! empty($conf->stripe->enabled) || ! empty($conf->paybox->enabled)) && !empty($conf->global->PDF_SHOW_LINK_TO_ONLINE_PAYMENT)); + $useonlinepayment = ((!empty($conf->paypal->enabled) || !empty($conf->stripe->enabled) || !empty($conf->paybox->enabled)) && !empty($conf->global->PDF_SHOW_LINK_TO_ONLINE_PAYMENT)); if (($object->mode_reglement_code == 'CB' || $object->mode_reglement_code == 'VAD') && $object->statut != Facture::STATUS_DRAFT && $useonlinepayment) { require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; global $langs; $langs->loadLangs(array('payment', 'paybox')); - $servicename=$langs->transnoentities('Online'); + $servicename = $langs->transnoentities('Online'); $paiement_url = getOnlinePaymentUrl('', 'invoice', $object->ref, '', '', ''); - $linktopay = $langs->trans("ToOfferALinkForOnlinePayment", $servicename).' '.$outputlangs->transnoentities("ClickHere").''; + $linktopay = $langs->trans("ToOfferALinkForOnlinePayment", $servicename).' '.$outputlangs->transnoentities("ClickHere").''; $pdf->writeHTMLCell(80, 10, '', '', dol_htmlentitiesbr($linktopay), 0, 1); } - $posy=$pdf->GetY()+2; + $posy = $pdf->GetY() + 2; } // Show payment mode CHQ if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ') { // If payment mode unregulated or payment mode forced to CHQ - if (! empty($conf->global->FACTURE_CHQ_NUMBER)) + if (!empty($conf->global->FACTURE_CHQ_NUMBER)) { - $diffsizetitle=(empty($conf->global->PDF_DIFFSIZE_TITLE)?3:$conf->global->PDF_DIFFSIZE_TITLE); + $diffsizetitle = (empty($conf->global->PDF_DIFFSIZE_TITLE) ? 3 : $conf->global->PDF_DIFFSIZE_TITLE); if ($conf->global->FACTURE_CHQ_NUMBER > 0) { @@ -1818,7 +1818,7 @@ class pdf_sponge extends ModelePDFFactures if (empty($hidetop)) { $titre = $outputlangs->transnoentities("AmountInCurrency", $outputlangs->transnoentitiesnoconv("Currency".$currency)); - if (! empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && is_object($outputlangsbis)) { + if (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && is_object($outputlangsbis)) { $titre .= ' - '.$outputlangsbis->transnoentities("AmountInCurrency", $outputlangsbis->transnoentitiesnoconv("Currency".$currency)); } @@ -1926,7 +1926,7 @@ class pdf_sponge extends ModelePDFFactures if ($object->type == 3) $title = $outputlangs->transnoentities("InvoiceDeposit"); if ($object->type == 4) $title = $outputlangs->transnoentities("InvoiceProForma"); if ($this->situationinvoice) $title = $outputlangs->transnoentities("InvoiceSituation"); - if (! empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && is_object($outputlangsbis)) { + if (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && is_object($outputlangsbis)) { $title .= ' - '; if ($object->type == 0) { if ($this->situationinvoice) $title .= $outputlangsbis->transnoentities("InvoiceSituation"); diff --git a/htdocs/core/tpl/notes.tpl.php b/htdocs/core/tpl/notes.tpl.php index e19d28ce793..28eb78fa61b 100644 --- a/htdocs/core/tpl/notes.tpl.php +++ b/htdocs/core/tpl/notes.tpl.php @@ -29,56 +29,56 @@ $module = $object->element; $note_public = 'note_public'; $note_private = 'note_private'; -$colwidth=(isset($colwidth)?$colwidth:(empty($cssclass)?'25':'')); +$colwidth = (isset($colwidth) ? $colwidth : (empty($cssclass) ? '25' : '')); // Set $permission from the $permissionnote var defined on calling page -$permission=(isset($permissionnote)?$permissionnote:(isset($permission)?$permission:(isset($user->rights->$module->create)?$user->rights->$module->create:(isset($user->rights->$module->creer)?$user->rights->$module->creer:0)))); -$moreparam=(isset($moreparam)?$moreparam:''); -$value_public=$object->note_public; -$value_private=$object->note_private; -if (! empty($conf->global->MAIN_AUTO_TIMESTAMP_IN_PUBLIC_NOTES)) +$permission = (isset($permissionnote) ? $permissionnote : (isset($permission) ? $permission : (isset($user->rights->$module->create) ? $user->rights->$module->create : (isset($user->rights->$module->creer) ? $user->rights->$module->creer : 0)))); +$moreparam = (isset($moreparam) ? $moreparam : ''); +$value_public = $object->note_public; +$value_private = $object->note_private; +if (!empty($conf->global->MAIN_AUTO_TIMESTAMP_IN_PUBLIC_NOTES)) { - $stringtoadd=dol_print_date(dol_now(), 'dayhour').' '.$user->getFullName($langs).' --'; + $stringtoadd = dol_print_date(dol_now(), 'dayhour').' '.$user->getFullName($langs).' --'; if (GETPOST('action', 'aZ09') == 'edit'.$note_public) { - $value_public=dol_concatdesc($value_public, ($value_public?"\n":"")."-- ".$stringtoadd); - if (dol_textishtml($value_public)) $value_public.="
\n"; - else $value_public.="\n"; + $value_public = dol_concatdesc($value_public, ($value_public ? "\n" : "")."-- ".$stringtoadd); + if (dol_textishtml($value_public)) $value_public .= "
\n"; + else $value_public .= "\n"; } } -if (! empty($conf->global->MAIN_AUTO_TIMESTAMP_IN_PRIVATE_NOTES)) +if (!empty($conf->global->MAIN_AUTO_TIMESTAMP_IN_PRIVATE_NOTES)) { - $stringtoadd=dol_print_date(dol_now(), 'dayhour').' '.$user->getFullName($langs).' --'; + $stringtoadd = dol_print_date(dol_now(), 'dayhour').' '.$user->getFullName($langs).' --'; if (GETPOST('action', 'aZ09') == 'edit'.$note_private) { - $value_private=dol_concatdesc($value_private, ($value_private?"\n":"")."-- ".$stringtoadd); - if (dol_textishtml($value_private)) $value_private.="
\n"; - else $value_private.="\n"; + $value_private = dol_concatdesc($value_private, ($value_private ? "\n" : "")."-- ".$stringtoadd); + if (dol_textishtml($value_private)) $value_private .= "
\n"; + else $value_private .= "\n"; } } // Special cases -if ($module == 'propal') { $permission=$user->rights->propale->creer;} -elseif ($module == 'supplier_proposal') { $permission=$user->rights->supplier_proposal->creer;} -elseif ($module == 'fichinter') { $permission=$user->rights->ficheinter->creer;} -elseif ($module == 'project') { $permission=$user->rights->projet->creer;} -elseif ($module == 'project_task') { $permission=$user->rights->projet->creer;} -elseif ($module == 'invoice_supplier') { $permission=$user->rights->fournisseur->facture->creer;} -elseif ($module == 'order_supplier') { $permission=$user->rights->fournisseur->commande->creer;} -elseif ($module == 'societe') { $permission=$user->rights->societe->creer;} -elseif ($module == 'contact') { $permission=$user->rights->societe->creer;} -elseif ($module == 'shipping') { $permission=$user->rights->expedition->creer;} -elseif ($module == 'product') { $permission=$user->rights->produit->creer;} +if ($module == 'propal') { $permission = $user->rights->propale->creer; } +elseif ($module == 'supplier_proposal') { $permission = $user->rights->supplier_proposal->creer; } +elseif ($module == 'fichinter') { $permission = $user->rights->ficheinter->creer; } +elseif ($module == 'project') { $permission = $user->rights->projet->creer; } +elseif ($module == 'project_task') { $permission = $user->rights->projet->creer; } +elseif ($module == 'invoice_supplier') { $permission = $user->rights->fournisseur->facture->creer; } +elseif ($module == 'order_supplier') { $permission = $user->rights->fournisseur->commande->creer; } +elseif ($module == 'societe') { $permission = $user->rights->societe->creer; } +elseif ($module == 'contact') { $permission = $user->rights->societe->creer; } +elseif ($module == 'shipping') { $permission = $user->rights->expedition->creer; } +elseif ($module == 'product') { $permission = $user->rights->produit->creer; } //else dol_print_error('','Bad value '.$module.' for param module'); -if (! empty($conf->fckeditor->enabled) && ! empty($conf->global->FCKEDITOR_ENABLE_SOCIETE)) $typeofdata='ckeditor:dolibarr_notes:100%:200::1:12:95%:0'; // Rem: This var is for all notes, not only thirdparties note. -else $typeofdata='textarea:12:95%'; +if (!empty($conf->fckeditor->enabled) && !empty($conf->global->FCKEDITOR_ENABLE_SOCIETE)) $typeofdata = 'ckeditor:dolibarr_notes:100%:200::1:12:95%:0'; // Rem: This var is for all notes, not only thirdparties note. +else $typeofdata = 'textarea:12:95%'; print ''."\n"; print '
'."\n"; if ($module != 'product') { // No public note yet on products print '
'."\n"; - print '
'."\n"; + print '
'."\n"; print $form->editfieldkey("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, $moreparam, '', 0); print '
'."\n"; print '
'."\n"; @@ -89,7 +89,7 @@ if ($module != 'product') { if (empty($user->socid)) { // Private notes (always hidden to external users) print '
'."\n"; - print '
'."\n"; + print '
'."\n"; print $form->editfieldkey("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, $moreparam, '', 0); print '
'."\n"; print '
'."\n"; diff --git a/htdocs/mrp/mo_agenda.php b/htdocs/mrp/mo_agenda.php index 4d34037704f..85ad63e19e0 100644 --- a/htdocs/mrp/mo_agenda.php +++ b/htdocs/mrp/mo_agenda.php @@ -139,7 +139,7 @@ if ($object->id > 0) // ------------------------------------------------------------ $linkback = ''.$langs->trans("BackToList").''; - $morehtmlref='
'; + $morehtmlref = '
'; // Ref customer //$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); //$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); @@ -175,7 +175,7 @@ if ($object->id > 0) } } } - $morehtmlref.='
'; + $morehtmlref .= '
'; dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); diff --git a/htdocs/mrp/mo_document.php b/htdocs/mrp/mo_document.php index 2bf6636cd6f..d5b6283a584 100644 --- a/htdocs/mrp/mo_document.php +++ b/htdocs/mrp/mo_document.php @@ -34,12 +34,12 @@ dol_include_once('/mrp/class/mo.class.php'); dol_include_once('/mrp/lib/mrp_mo.lib.php'); // Load translation files required by the page -$langs->loadLangs(array("mrp","companies","other","mails")); +$langs->loadLangs(array("mrp", "companies", "other", "mails")); -$action=GETPOST('action', 'aZ09'); -$confirm=GETPOST('confirm'); -$id=(GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int')); +$action = GETPOST('action', 'aZ09'); +$confirm = GETPOST('confirm'); +$id = (GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int')); $ref = GETPOST('ref', 'alpha'); // Security check - Protection if external user @@ -55,31 +55,31 @@ if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, $offset = $conf->liste_limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; -if (! $sortorder) $sortorder="ASC"; -if (! $sortfield) $sortfield="name"; +if (!$sortorder) $sortorder = "ASC"; +if (!$sortfield) $sortfield = "name"; //if (! $sortfield) $sortfield="position_name"; // Initialize technical objects -$object=new Mo($db); +$object = new Mo($db); $extrafields = new ExtraFields($db); -$diroutputmassaction=$conf->mrp->dir_output . '/temp/massgeneration/'.$user->id; -$hookmanager->initHooks(array('modocument','globalcard')); // Note that conf->hooks_modules contains array +$diroutputmassaction = $conf->mrp->dir_output.'/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array('modocument', 'globalcard')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals //if ($id > 0 || ! empty($ref)) $upload_dir = $conf->mrp->multidir_output[$object->entity?$object->entity:$conf->entity] . "/mo/" . dol_sanitizeFileName($object->id); -if ($id > 0 || ! empty($ref)) $upload_dir = $conf->mrp->multidir_output[$object->entity?$object->entity:$conf->entity] . "/mo/" . dol_sanitizeFileName($object->ref); +if ($id > 0 || !empty($ref)) $upload_dir = $conf->mrp->multidir_output[$object->entity ? $object->entity : $conf->entity]."/mo/".dol_sanitizeFileName($object->ref); /* * Actions */ -include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php'; +include_once DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; /* @@ -89,8 +89,8 @@ include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php'; $form = new Form($db); $formproject = new FormProjets($db); -$title=$langs->trans("Mo").' - '.$langs->trans("Files"); -$help_url=''; +$title = $langs->trans("Mo").' - '.$langs->trans("Files"); +$help_url = ''; //$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; llxHeader('', $title, $help_url); @@ -105,18 +105,18 @@ if ($object->id) // Build file list - $filearray=dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC), 1); - $totalsize=0; - foreach($filearray as $key => $file) + $filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1); + $totalsize = 0; + foreach ($filearray as $key => $file) { - $totalsize+=$file['size']; + $totalsize += $file['size']; } // Object card // ------------------------------------------------------------ - $linkback = '' . $langs->trans("BackToList") . ''; + $linkback = ''.$langs->trans("BackToList").''; - $morehtmlref='
'; + $morehtmlref = '
'; // Ref customer //$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); //$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); @@ -152,7 +152,7 @@ if ($object->id) } } } - $morehtmlref.='
'; + $morehtmlref .= '
'; dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); @@ -176,12 +176,12 @@ if ($object->id) $modulepart = 'mrp'; $permission = $user->rights->mrp->write; $permtoedit = $user->rights->mrp->write; - $param = '&id=' . $object->id; + $param = '&id='.$object->id; //$relativepathwithnofile='mo/' . dol_sanitizeFileName($object->id).'/'; - $relativepathwithnofile='mo/' . dol_sanitizeFileName($object->ref).'/'; + $relativepathwithnofile = 'mo/'.dol_sanitizeFileName($object->ref).'/'; - include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php'; + include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { diff --git a/htdocs/mrp/mo_note.php b/htdocs/mrp/mo_note.php index 99d9d62d6dc..e22d3e4b610 100644 --- a/htdocs/mrp/mo_note.php +++ b/htdocs/mrp/mo_note.php @@ -30,20 +30,20 @@ dol_include_once('/mrp/class/mo.class.php'); dol_include_once('/mrp/lib/mrp_mo.lib.php'); // Load translation files required by the page -$langs->loadLangs(array("mrp","companies")); +$langs->loadLangs(array("mrp", "companies")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOST('id', 'int'); $ref = GETPOST('ref', 'alpha'); -$action = GETPOST('action', 'alpha'); +$action = GETPOST('action', 'alpha'); $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); // Initialize technical objects -$object=new Mo($db); +$object = new Mo($db); $extrafields = new ExtraFields($db); -$diroutputmassaction=$conf->mrp->dir_output . '/temp/massgeneration/'.$user->id; -$hookmanager->initHooks(array('monote','globalcard')); // Note that conf->hooks_modules contains array +$diroutputmassaction = $conf->mrp->dir_output.'/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array('monote', 'globalcard')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); @@ -54,10 +54,10 @@ $extrafields->fetch_name_optionals_label($object->table_element); //$result = restrictedArea($user, 'mrp', $id); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals -if ($id > 0 || ! empty($ref)) $upload_dir = $conf->mrp->multidir_output[$object->entity] . "/" . $object->id; +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +if ($id > 0 || !empty($ref)) $upload_dir = $conf->mrp->multidir_output[$object->entity]."/".$object->id; -$permissionnote=1; +$permissionnote = 1; //$permissionnote=$user->rights->mrp->creer; // Used by the include of actions_setnotes.inc.php @@ -66,7 +66,7 @@ $permissionnote=1; * Actions */ -include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once +include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once /* @@ -77,10 +77,10 @@ $form = new Form($db); $formproject = new FormProjets($db); //$help_url='EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes'; -$help_url=''; +$help_url = ''; llxHeader('', $langs->trans('Mo'), $help_url); -if ($id > 0 || ! empty($ref)) +if ($id > 0 || !empty($ref)) { $object->fetch_thirdparty(); @@ -90,9 +90,9 @@ if ($id > 0 || ! empty($ref)) // Object card // ------------------------------------------------------------ - $linkback = '' . $langs->trans("BackToList") . ''; + $linkback = ''.$langs->trans("BackToList").''; - $morehtmlref='
'; + $morehtmlref = '
'; // Ref customer //$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); //$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); @@ -128,7 +128,7 @@ if ($id > 0 || ! empty($ref)) } } } - $morehtmlref.='
'; + $morehtmlref .= '
'; dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); @@ -137,7 +137,7 @@ if ($id > 0 || ! empty($ref)) print '
'; - $cssclass="titlefield"; + $cssclass = "titlefield"; include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php'; print '
'; diff --git a/htdocs/user/note.php b/htdocs/user/note.php index dc2f11b96fa..ab4df07e193 100644 --- a/htdocs/user/note.php +++ b/htdocs/user/note.php @@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; $id = GETPOST('id', 'int'); $action = GETPOST('action', 'aZ09'); -$contextpage=GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'usernote'; // To manage different context of search +$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'usernote'; // To manage different context of search // Load translation files required by page $langs->loadLangs(array('companies', 'members', 'bills', 'users')); @@ -39,25 +39,25 @@ $object->fetch($id, '', '', 1); $object->getrights(); // If user is not user read and no permission to read other users, we stop -if (($object->id != $user->id) && (! $user->rights->user->user->lire)) accessforbidden(); +if (($object->id != $user->id) && (!$user->rights->user->user->lire)) accessforbidden(); // Security check -$socid=0; +$socid = 0; if ($user->socid > 0) $socid = $user->socid; -$feature2 = (($socid && $user->rights->user->self->creer)?'':'user'); +$feature2 = (($socid && $user->rights->user->self->creer) ? '' : 'user'); $result = restrictedArea($user, 'user', $id, 'user&user', $feature2); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context -$hookmanager->initHooks(array('usercard','usernote','globalcard')); +$hookmanager->initHooks(array('usercard', 'usernote', 'globalcard')); /* * Actions */ -$parameters=array('id'=>$socid); -$reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +$parameters = array('id'=>$socid); +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if (empty($reshook)) { @@ -118,7 +118,7 @@ if ($id) print "id."\">"; // Editeur wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor('note_private', $object->note_private, '', 280, 'dolibarr_notes', 'In', true, false, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_8, '90%'); + $doleditor = new DolEditor('note_private', $object->note_private, '', 280, 'dolibarr_notes', 'In', true, false, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_8, '90%'); $doleditor->Create(); } else From 78d4978d31adae3b57c830c34d9f62691d928dc2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Feb 2020 11:26:11 +0100 Subject: [PATCH 271/306] FIX #13100 --- htdocs/core/class/html.form.class.php | 31 ++++++++++++++++---------- htdocs/product/class/product.class.php | 3 +++ 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 7188be03507..73e9ae0709b 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2110,7 +2110,7 @@ class Form } } - $selectFields = " p.rowid, p.label, p.ref, p.description, p.barcode, p.fk_product_type, p.price, p.price_ttc, p.price_base_type, p.tva_tx, p.duration, p.fk_price_expression"; + $selectFields = " p.rowid, p.ref, p.label, p.description, p.barcode, p.fk_product_type, p.price, p.price_ttc, p.price_base_type, p.tva_tx, p.duration, p.fk_price_expression"; if (count($warehouseStatusArray)) { $selectFieldsGrouped = ", sum(".$db->ifsql("e.statut IS NULL", "0", "ps.reel").") as stock"; // e.statut is null if there is no record in stock @@ -2737,13 +2737,15 @@ class Form $out = ''; $outarray = array(); + $maxlengtharticle = (empty($conf->global->PRODUCT_MAX_LENGTH_COMBO) ? 48 : $conf->global->PRODUCT_MAX_LENGTH_COMBO); + $langs->load('stocks'); // Units if ($conf->global->PRODUCT_USE_UNITS) { $langs->load('other'); } - $sql = "SELECT p.rowid, p.label, p.ref, p.price, p.duration, p.fk_product_type,"; + $sql = "SELECT p.rowid, p.ref, p.label, p.price, p.duration, p.fk_product_type,"; $sql .= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.quantity, pfp.remise_percent, pfp.remise, pfp.unitprice,"; $sql .= " pfp.fk_supplier_price_expression, pfp.fk_product, pfp.tva_tx, pfp.fk_soc, s.nom as name,"; $sql .= " pfp.supplier_reputation"; @@ -2751,7 +2753,7 @@ class Form if ($conf->global->PRODUCT_USE_UNITS) { $sql .= ", u.label as unit_long, u.short_label as unit_short, p.weight, p.weight_units, p.length, p.length_units, p.width, p.width_units, p.height, p.height_units, p.surface, p.surface_units, p.volume, p.volume_units"; } - if (!empty($conf->barcode->enabled)) $sql .= " ,pfp.barcode"; + if (!empty($conf->barcode->enabled)) $sql .= ", pfp.barcode"; $sql .= " FROM ".MAIN_DB_PREFIX."product as p"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; if ($socid) $sql .= " AND pfp.fk_soc = ".$socid; @@ -2814,6 +2816,7 @@ class Form $outref = $objp->ref; $outval = ''; + $outbarcode = $objp->barcode; $outqty = 1; $outdiscount = 0; $outtype = $objp->fk_product_type; @@ -2864,12 +2867,22 @@ class Form if ($filterkey && $filterkey != '') $label = preg_replace('/('.preg_quote($filterkey).')/i', '$1', $label, 1); $optlabel = $objp->ref; - if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) + if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) { $optlabel .= ' ('.$objp->ref_fourn.')'; + } + if (!empty($conf->barcode->enabled) && !empty($objp->barcode)) { + $optlabel .= ' ('.$outbarcode.')'; + } + $optlabel .= ' - '.dol_trunc($label, $maxlengtharticle); $outvallabel = $objRef; - if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) + if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) { $outvallabel .= ' ('.$objRefFourn.')'; + } + if (!empty($conf->barcode->enabled) && !empty($objp->barcode)) { + $outvallabel .= ' ('.$outbarcode.')'; + } + $outvallabel .= ' - '.dol_trunc($label, $maxlengtharticle); // Units $optlabel .= $outvalUnits; @@ -2931,12 +2944,6 @@ class Form $optlabel .= " - ".dol_trunc($objp->name, 8); $outvallabel .= " - ".dol_trunc($objp->name, 8); } - if (!empty($conf->barcode->enabled) && !empty($objp->barcode)) - { - //$optlabel .= " - ".$objp->barcode; - $optlabel .= " - ".$objp->barcode; - $outvallabel .= " - ".$objp->barcode; - } if ($objp->supplier_reputation) { //TODO dictionary @@ -3024,7 +3031,7 @@ class Form $langs->load('stocks'); - $sql = "SELECT p.rowid, p.label, p.ref, p.price, p.duration, pfp.fk_soc,"; + $sql = "SELECT p.rowid, p.ref, p.label, p.price, p.duration, pfp.fk_soc,"; $sql .= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.remise_percent, pfp.quantity, pfp.unitprice,"; $sql .= " pfp.fk_supplier_price_expression, pfp.fk_product, pfp.tva_tx, s.nom as name"; $sql .= " FROM ".MAIN_DB_PREFIX."product as p"; diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 5eb8ab904cc..746f3ce20dd 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -4305,6 +4305,9 @@ class Product extends CommonObject if (!empty($this->label)) { $label .= '
'.$langs->trans('ProductLabel').': '.$this->label; } + if (!empty($conf->barcode->enabled)) { + $label .= '
'.$langs->trans('BarCode').': '.$this->barcode; + } if ($this->type == Product::TYPE_PRODUCT) { From e511deb8e7eea5c4fc69542fb00163a34c68c9ce Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Feb 2020 11:39:08 +0100 Subject: [PATCH 272/306] FIX #13096 --- htdocs/adherents/subscription.php | 2 +- htdocs/compta/paiement/class/paiement.class.php | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 30ecafcf3e4..04acfb93bb4 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -229,7 +229,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && ! // Payment informations $accountid = $_POST["accountid"]; $operation = $_POST["operation"]; // Payment mode - $num_chq = $_POST["num_chq"]; + $num_chq = GETPOST("num_chq", "alphanohtml"); $emetteur_nom = $_POST["chqemetteur"]; $emetteur_banque = $_POST["chqbank"]; $option = $_POST["paymentsave"]; diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index e4a4a275029..87a8d5547ee 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -604,11 +604,12 @@ class Paiement extends CommonObject * @param string $emetteur_nom Name of transmitter * @param string $emetteur_banque Name of bank * @param int $notrigger No trigger + * @param string $num_chq Numero of cheque * @return int <0 if KO, bank_line_id if OK */ public function addPaymentToBank($user, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque, $notrigger = 0) { - global $conf,$langs,$user; + global $conf, $langs, $user; $error=0; $bank_line_id=0; @@ -628,7 +629,7 @@ class Paiement extends CommonObject include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - dol_syslog("$user->id,$mode,$label,$this->fk_account,$emetteur_nom,$emetteur_banque"); + dol_syslog("$user->id, $mode, $label, $this->fk_account, $emetteur_nom, $emetteur_banque"); $acc = new Account($this->db); $result=$acc->fetch($this->fk_account); @@ -647,7 +648,7 @@ class Paiement extends CommonObject $this->paiementid, // Payment mode id or code ("CHQ or VIR for example") $label, $totalamount, // Sign must be positive when we receive money (customer payment), negative when you give money (supplier invoice or credit note) - $this->num_paiement, + $this->num_payment, '', $user, $emetteur_nom, From c2ef63f35cd5033706ec88a6f9bff18182204b86 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Feb 2020 11:57:13 +0100 Subject: [PATCH 273/306] NEW Close #13011 Add button create thirdparty when creating intervention --- htdocs/fichinter/card.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 5e360739ea4..93d5e3339b1 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -96,6 +96,8 @@ if ($id > 0 || !empty($ref)) $permissionnote = $user->rights->ficheinter->creer; // Used by the include of actions_setnotes.inc.php $permissiondellink = $user->rights->ficheinter->creer; // Used by the include of actions_dellink.inc.php +$error = 0; + /* * Actions @@ -1074,6 +1076,7 @@ if ($action == 'create') print '
'; + print $form->select_produits('', 'productidtoadd', '', 0, 0, -1, 2); + print ''; + print ''; + print '
 '.$langs->trans("MailingStatusNotSent"); + print ''; + print $object::libStatutDest($obj->statut, 2, ''); print ' '.$langs->trans("MailingStatusNotSent"); + print ''; + print $object::libStatutDest($obj->statut, 2, ''); print '
'; print ''; print '
'.$langs->trans("ThirdParty").''; print $form->select_company('', 'socid', '', 'SelectThirdParty', 1, 0, null, 0, 'minwidth300'); + print ' '; print '
'; From 4f1c8e7f53ed7e9aea5baf3a4c11e2f6235084ae Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Feb 2020 12:18:26 +0100 Subject: [PATCH 274/306] FIX #10203 --- htdocs/admin/mails.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 474c6020610..5275b77fa14 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -134,9 +134,8 @@ $head = email_admin_prepare_head(); // List of sending methods $listofmethods = array(); $listofmethods['mail'] = 'PHP mail function'; -//$listofmethods['simplemail']='Simplemail class'; $listofmethods['smtps'] = 'SMTP/SMTPS socket library'; -$listofmethods['swiftmailer'] = 'Swift Mailer socket library'; +if (version_compare(phpversion(), '7.0', '>=')) $listofmethods['swiftmailer'] = 'Swift Mailer socket library'; if ($action == 'edit') From 9d4075cc191da89194402ab098c7d331dea9af6a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Feb 2020 12:23:32 +0100 Subject: [PATCH 275/306] Try to exempt 2 labels --- .github/workflows/stale-issues.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/stale-issues.yml b/.github/workflows/stale-issues.yml index a9ab9f4afce..de9fd8d2e4e 100644 --- a/.github/workflows/stale-issues.yml +++ b/.github/workflows/stale-issues.yml @@ -12,6 +12,8 @@ jobs: repo-token: ${{ secrets.GITHUB_TOKEN }} stale-issue-message: 'This issue is stale because it has been open 1 year with no activity. If this is a bug, please comment to confirm it is still present on latest stable version. if this is a feature request, please comment to notify the request is still relevant and not yet covered by latest stable version. Without comment, this issue will be closed automatically by stale bot in 15 days.' stale-issue-label: 'Issue Stale (automatic label)' - exempt-issue-label: 'Bug Security (CVE)' + exempt-issue-label: + - 'Bug Security (CVE)' + - 'Priority High / Blocking' days-before-stale: 365 days-before-close: 10 From 46bccf88d3d2f4e256b3344860739466a0ac3c2b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Feb 2020 12:33:34 +0100 Subject: [PATCH 276/306] Fix var not initialized --- htdocs/core/class/utils.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index 11b6717216b..6dc243d3723 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -305,12 +305,12 @@ class Utils if ($compression == 'gz') $handle = gzopen($outputfile, 'w'); if ($compression == 'bz') $handle = bzopen($outputfile, 'w'); + $ok = 0; if ($handle) { if (!empty($conf->global->MAIN_EXEC_USE_POPEN)) $execmethod = $conf->global->MAIN_EXEC_USE_POPEN; if (empty($execmethod)) $execmethod = 1; - $ok = 0; dol_syslog("Utils::dumpDatabase execmethod=".$execmethod." command:".$fullcommandcrypted, LOG_DEBUG); // TODO Replace with executeCLI function From 011803ac71ec2f3371ed4c4af74d4c7043ac31e5 Mon Sep 17 00:00:00 2001 From: Scrutinizer Auto-Fixer Date: Thu, 13 Feb 2020 11:36:05 +0000 Subject: [PATCH 277/306] Scrutinizer Auto-Fixes This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com --- htdocs/comm/propal/class/propal.class.php | 4 +- htdocs/commande/class/commande.class.php | 4 +- htdocs/compta/facture/class/facture.class.php | 10 +- .../compta/paiement/class/paiement.class.php | 322 ++++++------- htdocs/core/class/html.form.class.php | 18 +- htdocs/core/modules/modFournisseur.class.php | 456 +++++++++--------- htdocs/core/modules/modSociete.class.php | 180 +++---- htdocs/projet/element.php | 62 +-- 8 files changed, 528 insertions(+), 528 deletions(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index c6d1af1287e..3fa163594a2 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -1438,10 +1438,10 @@ class Propal extends CommonObject $this->total_ttc = $obj->total; $this->socid = $obj->fk_soc; - $this->thirdparty = null; // Clear if another value was already set by fetch_thirdparty + $this->thirdparty = null; // Clear if another value was already set by fetch_thirdparty $this->fk_project = $obj->fk_project; - $this->project = null; // Clear if another value was already set by fetch_projet + $this->project = null; // Clear if another value was already set by fetch_projet $this->modelpdf = $obj->model_pdf; $this->last_main_doc = $obj->last_main_doc; diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index f095a814652..a77674aa097 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1741,10 +1741,10 @@ class Commande extends CommonOrder $this->ref_int = $obj->ref_int; $this->socid = $obj->fk_soc; - $this->thirdparty = null; // Clear if another value was already set by fetch_thirdparty + $this->thirdparty = null; // Clear if another value was already set by fetch_thirdparty $this->fk_project = $obj->fk_project; - $this->project = null; // Clear if another value was already set by fetch_projet + $this->project = null; // Clear if another value was already set by fetch_projet $this->statut = $obj->fk_statut; $this->user_author_id = $obj->fk_user_author; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index b8e06d0663e..cb2bf087652 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -250,7 +250,7 @@ class Facture extends CommonInvoice /** * @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( + public $fields = array( 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10), 'ref' =>array('type'=>'varchar(30)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'showoncombobox'=>1, 'position'=>15), 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>20, 'index'=>1), @@ -1514,15 +1514,15 @@ class Facture extends CommonInvoice $this->total_localtax2 = $obj->localtax2; $this->total_ttc = $obj->total_ttc; $this->revenuestamp = $obj->revenuestamp; - $this->paye = $obj->paye; + $this->paye = $obj->paye; $this->close_code = $obj->close_code; $this->close_note = $obj->close_note; $this->socid = $obj->fk_soc; - $this->thirdparty = null; // Clear if another value was already set by fetch_thirdparty + $this->thirdparty = null; // Clear if another value was already set by fetch_thirdparty $this->fk_project = $obj->fk_project; - $this->project = null; // Clear if another value was already set by fetch_projet + $this->project = null; // Clear if another value was already set by fetch_projet $this->statut = $obj->fk_statut; $this->date_lim_reglement = $this->db->jdate($obj->dlr); @@ -4104,7 +4104,7 @@ class Facture extends CommonInvoice if ($generic_facture->hasDelay()) { $response->nbtodolate++; - $response->url_late=DOL_URL_ROOT.'/compta/facture/list.php?search_option=late&mainmenu=billing&leftmenu=customers_bills'; + $response->url_late = DOL_URL_ROOT.'/compta/facture/list.php?search_option=late&mainmenu=billing&leftmenu=customers_bills'; } } diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index f61082d6211..6e06811fa04 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -29,8 +29,8 @@ * \ingroup facture * \brief File of class to manage payments of customers invoices */ -require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; -require_once DOL_DOCUMENT_ROOT .'/multicurrency/class/multicurrency.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; +require_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php'; /** @@ -41,12 +41,12 @@ class Paiement extends CommonObject /** * @var string ID to identify managed object */ - public $element='payment'; + public $element = 'payment'; /** * @var string Name of table without prefix where object is stored */ - public $table_element='paiement'; + public $table_element = 'paiement'; /** * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png @@ -68,12 +68,12 @@ class Paiement extends CommonObject */ public $montant; - public $amount; // Total amount of payment - public $amounts=array(); // Array of amounts - public $multicurrency_amounts=array(); // Array of amounts + public $amount; // Total amount of payment + public $amounts = array(); // Array of amounts + public $multicurrency_amounts = array(); // Array of amounts public $author; - public $paiementid; // Type of payment. Id saved into fields fk_paiement on llx_paiement - public $paiementcode; // Code of payment. + public $paiementid; // Type of payment. Id saved into fields fk_paiement on llx_paiement + public $paiementcode; // Code of payment. /** * @var string type libelle @@ -136,7 +136,7 @@ class Paiement extends CommonObject /** * @var int payment id */ - public $fk_paiement; // Type of payment + public $fk_paiement; // Type of payment /** @@ -160,18 +160,18 @@ class Paiement extends CommonObject public function fetch($id, $ref = '', $fk_bank = '') { $sql = 'SELECT p.rowid, p.ref, p.datep as dp, p.amount, p.statut, p.ext_payment_id, p.ext_payment_site, p.fk_bank,'; - $sql.= ' c.code as type_code, c.libelle as type_label,'; - $sql.= ' p.num_paiement as num_payment, p.note,'; - $sql.= ' b.fk_account'; - $sql.= ' FROM '.MAIN_DB_PREFIX.'paiement as p LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as c ON p.fk_paiement = c.id'; - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON p.fk_bank = b.rowid'; - $sql.= ' WHERE p.entity IN (' . getEntity('invoice').')'; + $sql .= ' c.code as type_code, c.libelle as type_label,'; + $sql .= ' p.num_paiement as num_payment, p.note,'; + $sql .= ' b.fk_account'; + $sql .= ' FROM '.MAIN_DB_PREFIX.'paiement as p LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as c ON p.fk_paiement = c.id'; + $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON p.fk_bank = b.rowid'; + $sql .= ' WHERE p.entity IN ('.getEntity('invoice').')'; if ($id > 0) - $sql.= ' AND p.rowid = '.$id; + $sql .= ' AND p.rowid = '.$id; elseif ($ref) - $sql.= " AND p.ref = '".$ref."'"; + $sql .= " AND p.ref = '".$ref."'"; elseif ($fk_bank) - $sql.= ' AND p.fk_bank = '.$fk_bank; + $sql .= ' AND p.fk_bank = '.$fk_bank; $resql = $this->db->query($sql); if ($resql) @@ -180,15 +180,15 @@ class Paiement extends CommonObject { $obj = $this->db->fetch_object($resql); $this->id = $obj->rowid; - $this->ref = $obj->ref?$obj->ref:$obj->rowid; + $this->ref = $obj->ref ? $obj->ref : $obj->rowid; $this->date = $this->db->jdate($obj->dp); $this->datepaye = $this->db->jdate($obj->dp); - $this->num_paiement = $obj->num_payment; // deprecated + $this->num_paiement = $obj->num_payment; // deprecated $this->num_payment = $obj->num_payment; - $this->montant = $obj->amount; // deprecated + $this->montant = $obj->amount; // deprecated $this->amount = $obj->amount; $this->note = $obj->note; - $this->type_label = $obj->type_label; + $this->type_label = $obj->type_label; $this->type_code = $obj->type_code; $this->statut = $obj->statut; $this->ext_payment_id = $obj->ext_payment_id; @@ -231,7 +231,7 @@ class Paiement extends CommonObject $error = 0; $way = $this->getWay(); - $now=dol_now(); + $now = dol_now(); // Clean parameters $totalamount = 0; @@ -258,7 +258,7 @@ class Paiement extends CommonObject $newvalue = price2num($value, 'MT'); $amounts[$key] = $newvalue; $totalamount += $newvalue; - if (! empty($newvalue)) $atleastonepaymentnotnull++; + if (!empty($newvalue)) $atleastonepaymentnotnull++; } $totalamount = price2num($totalamount); @@ -267,8 +267,8 @@ class Paiement extends CommonObject // Check parameters if (empty($totalamount) && empty($atleastonepaymentnotnull)) // We accept negative amounts for withdraw reject but not empty arrays { - $this->errors[]='TotalAmountEmpty'; - $this->error='TotalAmountEmpty'; + $this->errors[] = 'TotalAmountEmpty'; + $this->error = 'TotalAmountEmpty'; return -1; } @@ -276,7 +276,7 @@ class Paiement extends CommonObject $this->db->begin(); - $this->ref = $this->getNextNumRef(is_object($thirdparty)?$thirdparty:''); + $this->ref = $this->getNextNumRef(is_object($thirdparty) ? $thirdparty : ''); if ($way == 'dolibarr') { @@ -289,11 +289,11 @@ class Paiement extends CommonObject $mtotal = $totalamount; } - $num_payment = ($this->num_payment?$this->num_payment:$this->num_paiement); - $note = ($this->note_public?$this->note_public:$this->note); + $num_payment = ($this->num_payment ? $this->num_payment : $this->num_paiement); + $note = ($this->note_public ? $this->note_public : $this->note); $sql = "INSERT INTO ".MAIN_DB_PREFIX."paiement (entity, ref, datec, datep, amount, multicurrency_amount, fk_paiement, num_paiement, note, ext_payment_id, ext_payment_site, fk_user_creat)"; - $sql.= " VALUES (".$conf->entity.", '".$this->db->escape($this->ref)."', '". $this->db->idate($now)."', '".$this->db->idate($this->datepaye)."', ".$total.", ".$mtotal.", ".$this->paiementid.", '".$this->db->escape($num_payment)."', '".$this->db->escape($note)."', ".($this->ext_payment_id?"'".$this->db->escape($this->ext_payment_id)."'":"null").", ".($this->ext_payment_site?"'".$this->db->escape($this->ext_payment_site)."'":"null").", ".$user->id.")"; + $sql .= " VALUES (".$conf->entity.", '".$this->db->escape($this->ref)."', '".$this->db->idate($now)."', '".$this->db->idate($this->datepaye)."', ".$total.", ".$mtotal.", ".$this->paiementid.", '".$this->db->escape($num_payment)."', '".$this->db->escape($note)."', ".($this->ext_payment_id ? "'".$this->db->escape($this->ext_payment_id)."'" : "null").", ".($this->ext_payment_site ? "'".$this->db->escape($this->ext_payment_site)."'" : "null").", ".$user->id.")"; $resql = $this->db->query($sql); if ($resql) @@ -308,23 +308,23 @@ class Paiement extends CommonObject { $amount = price2num($amount); $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'paiement_facture (fk_facture, fk_paiement, amount, multicurrency_amount)'; - $sql .= ' VALUES ('.$facid.', '. $this->id.', \''.$amount.'\', \''.$this->multicurrency_amounts[$key].'\')'; + $sql .= ' VALUES ('.$facid.', '.$this->id.', \''.$amount.'\', \''.$this->multicurrency_amounts[$key].'\')'; dol_syslog(get_class($this).'::create Amount line '.$key.' insert paiement_facture', LOG_DEBUG); - $resql=$this->db->query($sql); + $resql = $this->db->query($sql); if ($resql) { - $invoice=new Facture($this->db); + $invoice = new Facture($this->db); $invoice->fetch($facid); // If we want to closed payed invoices if ($closepaidinvoices) { $paiement = $invoice->getSommePaiement(); - $creditnotes=$invoice->getSumCreditNotesUsed(); - $deposits=$invoice->getSumDepositsUsed(); - $alreadypayed=price2num($paiement + $creditnotes + $deposits, 'MT'); - $remaintopay=price2num($invoice->total_ttc - $paiement - $creditnotes - $deposits, 'MT'); + $creditnotes = $invoice->getSumCreditNotesUsed(); + $deposits = $invoice->getSumDepositsUsed(); + $alreadypayed = price2num($paiement + $creditnotes + $deposits, 'MT'); + $remaintopay = price2num($invoice->total_ttc - $paiement - $creditnotes - $deposits, 'MT'); //var_dump($invoice->total_ttc.' - '.$paiement.' -'.$creditnotes.' - '.$deposits.' - '.$remaintopay);exit; @@ -395,12 +395,12 @@ class Paiement extends CommonObject } // Set invoice to paid - if (! $error) + if (!$error) { - $result=$invoice->set_paid($user, '', ''); - if ($result<0) + $result = $invoice->set_paid($user, '', ''); + if ($result < 0) { - $this->error=$invoice->error; + $this->error = $invoice->error; $error++; } } @@ -412,13 +412,13 @@ class Paiement extends CommonObject { dol_syslog(get_class($this).'::create Regenerate the document after inserting payment for thirdparty default_lang='.(is_object($invoice->thirdparty) ? $invoice->thirdparty->default_lang : 'null'), LOG_DEBUG); - $newlang=''; + $newlang = ''; $outputlangs = $langs; - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { $invoice->fetch_thirdparty(); $newlang = $invoice->thirdparty->default_lang; } - if (! empty($newlang)) { + if (!empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); } @@ -432,7 +432,7 @@ class Paiement extends CommonObject } else { - $this->error=$this->db->lasterror(); + $this->error = $this->db->lasterror(); $error++; } } @@ -442,25 +442,25 @@ class Paiement extends CommonObject } } - if (! $error) // All payments into $this->amounts were recorded without errors + if (!$error) // All payments into $this->amounts were recorded without errors { // Appel des triggers - $result=$this->call_trigger('PAYMENT_CUSTOMER_CREATE', $user); + $result = $this->call_trigger('PAYMENT_CUSTOMER_CREATE', $user); if ($result < 0) { $error++; } // Fin appel triggers } } else { - $this->error=$this->db->lasterror(); + $this->error = $this->db->lasterror(); $error++; } - if (! $error) + if (!$error) { - $this->amount=$total; - $this->total=$total; // deprecated - $this->multicurrency_amount=$mtotal; + $this->amount = $total; + $this->total = $total; // deprecated + $this->multicurrency_amount = $mtotal; $this->db->commit(); return $this->id; } @@ -484,7 +484,7 @@ class Paiement extends CommonObject { global $conf, $user, $langs; - $error=0; + $error = 0; $bank_line_id = $this->bank_line; @@ -492,12 +492,12 @@ class Paiement extends CommonObject // Verifier si paiement porte pas sur une facture classee // Si c'est le cas, on refuse la suppression - $billsarray=$this->getBillsArray('fk_statut > 1'); + $billsarray = $this->getBillsArray('fk_statut > 1'); if (is_array($billsarray)) { if (count($billsarray)) { - $this->error="ErrorDeletePaymentLinkedToAClosedInvoiceNotPossible"; + $this->error = "ErrorDeletePaymentLinkedToAClosedInvoiceNotPossible"; $this->db->rollback(); return -1; } @@ -513,32 +513,32 @@ class Paiement extends CommonObject { $accline = new AccountLine($this->db); - $result=$accline->fetch($bank_line_id); - if ($result == 0) $accline->rowid=$bank_line_id; // If not found, we set artificially rowid to allow delete of llx_bank_url + $result = $accline->fetch($bank_line_id); + if ($result == 0) $accline->rowid = $bank_line_id; // If not found, we set artificially rowid to allow delete of llx_bank_url // Delete bank account url lines linked to payment - $result=$accline->delete_urls($user); + $result = $accline->delete_urls($user); if ($result < 0) { - $this->error=$accline->error; + $this->error = $accline->error; $this->db->rollback(); return -3; } // Delete bank account lines linked to payment - $result=$accline->delete($user); + $result = $accline->delete($user); if ($result < 0) { - $this->error=$accline->error; + $this->error = $accline->error; $this->db->rollback(); return -4; } } - if (! $notrigger) + if (!$notrigger) { // Call triggers - $result=$this->call_trigger('PAYMENT_CUSTOMER_DELETE', $user); + $result = $this->call_trigger('PAYMENT_CUSTOMER_DELETE', $user); if ($result < 0) { $this->db->rollback(); @@ -549,18 +549,18 @@ class Paiement extends CommonObject // Delete payment (into paiement_facture and paiement) $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'paiement_facture'; - $sql.= ' WHERE fk_paiement = '.$this->id; + $sql .= ' WHERE fk_paiement = '.$this->id; dol_syslog($sql); $result = $this->db->query($sql); if ($result) { $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'paiement'; - $sql.= ' WHERE rowid = '.$this->id; + $sql .= ' WHERE rowid = '.$this->id; dol_syslog($sql); $result = $this->db->query($sql); - if (! $result) + if (!$result) { - $this->error=$this->db->lasterror(); + $this->error = $this->db->lasterror(); $this->db->rollback(); return -3; } @@ -570,7 +570,7 @@ class Paiement extends CommonObject } else { - $this->error=$this->db->error; + $this->error = $this->db->error; $this->db->rollback(); return -5; } @@ -643,7 +643,7 @@ class Paiement extends CommonObject // On connait ainsi le paiement qui a genere l'ecriture bancaire if ($bank_line_id > 0) { - $result=$this->update_fk_bank($bank_line_id); + $result = $this->update_fk_bank($bank_line_id); if ($result <= 0) { $error++; @@ -651,14 +651,14 @@ class Paiement extends CommonObject } // Add link 'payment', 'payment_supplier' in bank_url between payment and bank transaction - if ( ! $error) + if (!$error) { - $url=''; - if ($mode == 'payment') $url=DOL_URL_ROOT.'/compta/paiement/card.php?id='; - if ($mode == 'payment_supplier') $url=DOL_URL_ROOT.'/fourn/paiement/card.php?id='; + $url = ''; + if ($mode == 'payment') $url = DOL_URL_ROOT.'/compta/paiement/card.php?id='; + if ($mode == 'payment_supplier') $url = DOL_URL_ROOT.'/fourn/paiement/card.php?id='; if ($url) { - $result=$acc->add_url_line($bank_line_id, $this->id, $url, '(paiement)', $mode); + $result = $acc->add_url_line($bank_line_id, $this->id, $url, '(paiement)', $mode); if ($result <= 0) { $error++; @@ -669,9 +669,9 @@ class Paiement extends CommonObject // Add link 'company' in bank_url between invoice and bank transaction (for each invoice concerned by payment) //if (! $error && $label != '(WithdrawalPayment)') - if (! $error) + if (!$error) { - $linkaddedforthirdparty=array(); + $linkaddedforthirdparty = array(); foreach ($this->amounts as $key => $value) // We should have invoices always for same third party but we loop in case of. { if ($mode == 'payment') @@ -679,9 +679,9 @@ class Paiement extends CommonObject $fac = new Facture($this->db); $fac->fetch($key); $fac->fetch_thirdparty(); - if (! in_array($fac->thirdparty->id, $linkaddedforthirdparty)) // Not yet done for this thirdparty + if (!in_array($fac->thirdparty->id, $linkaddedforthirdparty)) // Not yet done for this thirdparty { - $result=$acc->add_url_line( + $result = $acc->add_url_line( $bank_line_id, $fac->thirdparty->id, DOL_URL_ROOT.'/comm/card.php?socid=', @@ -689,7 +689,7 @@ class Paiement extends CommonObject 'company' ); if ($result <= 0) dol_syslog(get_class($this).'::addPaymentToBank '.$this->db->lasterror()); - $linkaddedforthirdparty[$fac->thirdparty->id]=$fac->thirdparty->id; // Mark as done for this thirdparty + $linkaddedforthirdparty[$fac->thirdparty->id] = $fac->thirdparty->id; // Mark as done for this thirdparty } } if ($mode == 'payment_supplier') @@ -697,9 +697,9 @@ class Paiement extends CommonObject $fac = new FactureFournisseur($this->db); $fac->fetch($key); $fac->fetch_thirdparty(); - if (! in_array($fac->thirdparty->id, $linkaddedforthirdparty)) // Not yet done for this thirdparty + if (!in_array($fac->thirdparty->id, $linkaddedforthirdparty)) // Not yet done for this thirdparty { - $result=$acc->add_url_line( + $result = $acc->add_url_line( $bank_line_id, $fac->thirdparty->id, DOL_URL_ROOT.'/fourn/card.php?socid=', @@ -707,15 +707,15 @@ class Paiement extends CommonObject 'company' ); if ($result <= 0) dol_syslog(get_class($this).'::addPaymentToBank '.$this->db->lasterror()); - $linkaddedforthirdparty[$fac->thirdparty->id]=$fac->thirdparty->id; // Mark as done for this thirdparty + $linkaddedforthirdparty[$fac->thirdparty->id] = $fac->thirdparty->id; // Mark as done for this thirdparty } } } } // Add link 'WithdrawalPayment' in bank_url - if (! $error && $label == '(WithdrawalPayment)') { - $result=$acc->add_url_line( + if (!$error && $label == '(WithdrawalPayment)') { + $result = $acc->add_url_line( $bank_line_id, $this->id_prelevement, DOL_URL_ROOT.'/compta/prelevement/card.php?id=', @@ -724,21 +724,21 @@ class Paiement extends CommonObject ); } - if (! $error && ! $notrigger) + if (!$error && !$notrigger) { // Appel des triggers - $result=$this->call_trigger('PAYMENT_ADD_TO_BANK', $user); + $result = $this->call_trigger('PAYMENT_ADD_TO_BANK', $user); if ($result < 0) { $error++; } // Fin appel triggers } } else { - $this->error=$acc->error; + $this->error = $acc->error; $error++; } - if (! $error) + if (!$error) { $this->db->commit(); } @@ -748,7 +748,7 @@ class Paiement extends CommonObject } } - if (! $error) + if (!$error) { return $bank_line_id; } @@ -770,7 +770,7 @@ class Paiement extends CommonObject { // phpcs:enable $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element.' set fk_bank = '.$id_bank; - $sql.= ' WHERE rowid = '.$this->id; + $sql .= ' WHERE rowid = '.$this->id; dol_syslog(get_class($this).'::update_fk_bank', LOG_DEBUG); $result = $this->db->query($sql); @@ -780,7 +780,7 @@ class Paiement extends CommonObject } else { - $this->error=$this->db->lasterror(); + $this->error = $this->db->lasterror(); dol_syslog(get_class($this).'::update_fk_bank '.$this->error); return -1; } @@ -796,7 +796,7 @@ class Paiement extends CommonObject public function update_date($date) { // phpcs:enable - $error=0; + $error = 0; if (!empty($date) && $this->statut != 1) { @@ -805,35 +805,35 @@ class Paiement extends CommonObject dol_syslog(get_class($this)."::update_date with date = ".$date, LOG_DEBUG); $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element; - $sql.= " SET datep = '".$this->db->idate($date)."'"; - $sql.= " WHERE rowid = ".$this->id; + $sql .= " SET datep = '".$this->db->idate($date)."'"; + $sql .= " WHERE rowid = ".$this->id; $result = $this->db->query($sql); - if (! $result) + if (!$result) { $error++; - $this->error='Error -1 '.$this->db->error(); + $this->error = 'Error -1 '.$this->db->error(); } $type = $this->element; $sql = "UPDATE ".MAIN_DB_PREFIX.'bank'; - $sql.= " SET dateo = '".$this->db->idate($date)."', datev = '".$this->db->idate($date)."'"; - $sql.= " WHERE rowid IN (SELECT fk_bank FROM ".MAIN_DB_PREFIX."bank_url WHERE type = '".$type."' AND url_id = ".$this->id.")"; - $sql.= " AND rappro = 0"; + $sql .= " SET dateo = '".$this->db->idate($date)."', datev = '".$this->db->idate($date)."'"; + $sql .= " WHERE rowid IN (SELECT fk_bank FROM ".MAIN_DB_PREFIX."bank_url WHERE type = '".$type."' AND url_id = ".$this->id.")"; + $sql .= " AND rappro = 0"; $result = $this->db->query($sql); - if (! $result) + if (!$result) { $error++; - $this->error='Error -1 '.$this->db->error(); + $this->error = 'Error -1 '.$this->db->error(); } - if (! $error) + if (!$error) { } - if (! $error) + if (!$error) { $this->datepaye = $date; $this->date = $date; @@ -860,10 +860,10 @@ class Paiement extends CommonObject public function update_num($num) { // phpcs:enable - if(!empty($num) && $this->statut!=1) { + if (!empty($num) && $this->statut != 1) { $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element; - $sql.= " SET num_paiement = '".$this->db->escape($num)."'"; - $sql.= " WHERE rowid = ".$this->id; + $sql .= " SET num_paiement = '".$this->db->escape($num)."'"; + $sql .= " WHERE rowid = ".$this->id; dol_syslog(get_class($this)."::update_num", LOG_DEBUG); $result = $this->db->query($sql); @@ -874,7 +874,7 @@ class Paiement extends CommonObject } else { - $this->error='Error -1 '.$this->db->error(); + $this->error = 'Error -1 '.$this->db->error(); return -2; } } @@ -899,7 +899,7 @@ class Paiement extends CommonObject } else { - $this->error=$this->db->lasterror(); + $this->error = $this->db->lasterror(); dol_syslog(get_class($this).'::valide '.$this->error); return -1; } @@ -923,7 +923,7 @@ class Paiement extends CommonObject } else { - $this->error=$this->db->lasterror(); + $this->error = $this->db->lasterror(); dol_syslog(get_class($this).'::reject '.$this->error); return -1; } @@ -938,8 +938,8 @@ class Paiement extends CommonObject public function info($id) { $sql = 'SELECT p.rowid, p.datec, p.fk_user_creat, p.fk_user_modif, p.tms'; - $sql.= ' FROM '.MAIN_DB_PREFIX.'paiement as p'; - $sql.= ' WHERE p.rowid = '.$id; + $sql .= ' FROM '.MAIN_DB_PREFIX.'paiement as p'; + $sql .= ' WHERE p.rowid = '.$id; dol_syslog(get_class($this).'::info', LOG_DEBUG); $result = $this->db->query($sql); @@ -954,7 +954,7 @@ class Paiement extends CommonObject { $cuser = new User($this->db); $cuser->fetch($obj->fk_user_creat); - $this->user_creation = $cuser; + $this->user_creation = $cuser; } if ($obj->fk_user_modif) { @@ -982,20 +982,20 @@ class Paiement extends CommonObject public function getBillsArray($filter = '') { $sql = 'SELECT pf.fk_facture'; - $sql.= ' FROM '.MAIN_DB_PREFIX.'paiement_facture as pf, '.MAIN_DB_PREFIX.'facture as f'; // We keep link on invoice to allow use of some filters on invoice - $sql.= ' WHERE pf.fk_facture = f.rowid AND pf.fk_paiement = '.$this->id; - if ($filter) $sql.= ' AND '.$filter; + $sql .= ' FROM '.MAIN_DB_PREFIX.'paiement_facture as pf, '.MAIN_DB_PREFIX.'facture as f'; // We keep link on invoice to allow use of some filters on invoice + $sql .= ' WHERE pf.fk_facture = f.rowid AND pf.fk_paiement = '.$this->id; + if ($filter) $sql .= ' AND '.$filter; $resql = $this->db->query($sql); if ($resql) { - $i=0; - $num=$this->db->num_rows($resql); - $billsarray=array(); + $i = 0; + $num = $this->db->num_rows($resql); + $billsarray = array(); while ($i < $num) { $obj = $this->db->fetch_object($resql); - $billsarray[$i]=$obj->fk_facture; + $billsarray[$i] = $obj->fk_facture; $i++; } @@ -1003,7 +1003,7 @@ class Paiement extends CommonObject } else { - $this->error=$this->db->error(); + $this->error = $this->db->error(); dol_syslog(get_class($this).'::getBillsArray Error '.$this->error.' -', LOG_DEBUG); return -1; } @@ -1017,19 +1017,19 @@ class Paiement extends CommonObject public function getAmountsArray() { $sql = 'SELECT pf.fk_facture, pf.amount'; - $sql.= ' FROM '.MAIN_DB_PREFIX.'paiement_facture as pf'; - $sql.= ' WHERE pf.fk_paiement = '.$this->id; + $sql .= ' FROM '.MAIN_DB_PREFIX.'paiement_facture as pf'; + $sql .= ' WHERE pf.fk_paiement = '.$this->id; $resql = $this->db->query($sql); if ($resql) { - $i=0; - $num=$this->db->num_rows($resql); + $i = 0; + $num = $this->db->num_rows($resql); $amounts = array(); while ($i < $num) { $obj = $this->db->fetch_object($resql); - $amounts[$obj->fk_facture]=$obj->amount; + $amounts[$obj->fk_facture] = $obj->amount; $i++; } @@ -1037,7 +1037,7 @@ class Paiement extends CommonObject } else { - $this->error=$this->db->error(); + $this->error = $this->db->error(); dol_syslog(get_class($this).'::getAmountsArray Error '.$this->error.' -', LOG_DEBUG); return -1; } @@ -1057,13 +1057,13 @@ class Paiement extends CommonObject $langs->load("bills"); // Clean parameters (if not defined or using deprecated value) - if (empty($conf->global->PAYMENT_ADDON)) $conf->global->PAYMENT_ADDON='mod_payment_cicada'; - elseif ($conf->global->PAYMENT_ADDON=='ant') $conf->global->PAYMENT_ADDON='mod_payment_ant'; - elseif ($conf->global->PAYMENT_ADDON=='cicada') $conf->global->PAYMENT_ADDON='mod_payment_cicada'; + if (empty($conf->global->PAYMENT_ADDON)) $conf->global->PAYMENT_ADDON = 'mod_payment_cicada'; + elseif ($conf->global->PAYMENT_ADDON == 'ant') $conf->global->PAYMENT_ADDON = 'mod_payment_ant'; + elseif ($conf->global->PAYMENT_ADDON == 'cicada') $conf->global->PAYMENT_ADDON = 'mod_payment_cicada'; - if (! empty($conf->global->PAYMENT_ADDON)) + if (!empty($conf->global->PAYMENT_ADDON)) { - $mybool=false; + $mybool = false; $file = $conf->global->PAYMENT_ADDON.".php"; $classname = $conf->global->PAYMENT_ADDON; @@ -1077,12 +1077,12 @@ class Paiement extends CommonObject // Load file with numbering class (if found) if (is_file($dir.$file) && is_readable($dir.$file)) { - $mybool |= include_once $dir . $file; + $mybool |= include_once $dir.$file; } } // For compatibility - if (! $mybool) + if (!$mybool) { $file = $conf->global->PAYMENT_ADDON.".php"; $classname = "mod_payment_".$conf->global->PAYMENT_ADDON; @@ -1094,12 +1094,12 @@ class Paiement extends CommonObject // Load file with numbering class (if found) if (is_file($dir.$file) && is_readable($dir.$file)) { - $mybool |= include_once $dir . $file; + $mybool |= include_once $dir.$file; } } } - if (! $mybool) + if (!$mybool) { dol_print_error('', "Failed to include file ".$file); return ''; @@ -1163,16 +1163,16 @@ class Paiement extends CommonObject */ public function initAsSpecimen($option = '') { - global $user,$langs,$conf; + global $user, $langs, $conf; - $now=dol_now(); - $arraynow=dol_getdate($now); - $nownotime=dol_mktime(0, 0, 0, $arraynow['mon'], $arraynow['mday'], $arraynow['year']); + $now = dol_now(); + $arraynow = dol_getdate($now); + $nownotime = dol_mktime(0, 0, 0, $arraynow['mon'], $arraynow['mday'], $arraynow['year']); // Initialize parameters - $this->id=0; + $this->id = 0; $this->ref = 'SPECIMEN'; - $this->specimen=1; + $this->specimen = 1; $this->facid = 1; $this->datepaye = $nownotime; } @@ -1191,49 +1191,49 @@ class Paiement extends CommonObject { global $conf, $langs; - if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips + if (!empty($conf->dol_no_mouse_hover)) $notooltip = 1; // Force disable tooltips - $result=''; + $result = ''; $label = ''.$langs->trans("ShowPayment").'
'; - $label.= ''.$langs->trans("Ref").': '.$this->ref; - if ($this->datepaye ? $this->datepaye : $this->date) $label.= '
'.$langs->trans("Date").': '.dol_print_date($this->datepaye ? $this->datepaye : $this->date, 'dayhour'); + $label .= ''.$langs->trans("Ref").': '.$this->ref; + if ($this->datepaye ? $this->datepaye : $this->date) $label .= '
'.$langs->trans("Date").': '.dol_print_date($this->datepaye ? $this->datepaye : $this->date, 'dayhour'); if ($mode == 'withlistofinvoices') { $arraybill = $this->getBillsArray(); if (is_array($arraybill) && count($arraybill) > 0) { include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; - $facturestatic=new Facture($this->db); + $facturestatic = new Facture($this->db); foreach ($arraybill as $billid) { $facturestatic->fetch($billid); - $label .='
'.$facturestatic->getNomUrl(1).' '.$facturestatic->getLibStatut(2, 1); + $label .= '
'.$facturestatic->getNomUrl(1).' '.$facturestatic->getLibStatut(2, 1); } } } - $linkclose=''; + $linkclose = ''; if (empty($notooltip)) { - if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) + if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { - $label=$langs->trans("ShowMyObject"); - $linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"'; + $label = $langs->trans("ShowMyObject"); + $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; } - $linkclose.=' title="'.dol_escape_htmltag($label, 1).'"'; - $linkclose.=' class="classfortooltip'.($morecss?' '.$morecss:'').'"'; + $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; + $linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"'; } - else $linkclose = ($morecss?' class="'.$morecss.'"':''); + else $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); $url = DOL_URL_ROOT.'/compta/paiement/card.php?id='.$this->id; $linkstart = ''; - $linkend=''; + $linkstart .= $linkclose.'>'; + $linkend = ''; $result .= $linkstart; - if ($withpicto) $result.=img_object(($notooltip?'':$label), ($this->picto?$this->picto:'generic'), ($notooltip?(($withpicto != 2) ? 'class="paddingright"' : ''):'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip?0:1); - if ($withpicto && $withpicto != 2) $result.= ($this->ref?$this->ref:$this->id); + if ($withpicto) $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1); + if ($withpicto && $withpicto != 2) $result .= ($this->ref ? $this->ref : $this->id); $result .= $linkend; return $result; @@ -1261,7 +1261,7 @@ class Paiement extends CommonObject public function LibStatut($status, $mode = 0) { // phpcs:enable - global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage + global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage $langs->load('compta'); /*if ($mode == 0) @@ -1312,7 +1312,7 @@ class Paiement extends CommonObject public function fetch_thirdparty($force_thirdparty_id = 0) { // phpcs:enable - include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; + include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; if (empty($force_thirdparty_id)) { diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index f2e6fc14e8b..8dcbacd43c7 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6052,7 +6052,7 @@ class Form // Search data $sql = "SELECT t.rowid, ".$fieldstoshow." FROM ".MAIN_DB_PREFIX.$objecttmp->table_element." as t"; - if (isset($objecttmp->ismultientitymanaged) && ! is_numeric($objecttmp->ismultientitymanaged)) { + if (isset($objecttmp->ismultientitymanaged) && !is_numeric($objecttmp->ismultientitymanaged)) { $tmparray = explode('@', $objecttmp->ismultientitymanaged); $sql .= ' INNER JOIN '.MAIN_DB_PREFIX.$tmparray[1].' as parenttable ON parenttable.rowid = t.'.$tmparray[0]; } @@ -6060,7 +6060,7 @@ class Form if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql .= " WHERE 1=1"; if (isset($objecttmp->ismultientitymanaged) && $objecttmp->ismultientitymanaged == 1) $sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")"; - if (isset($objecttmp->ismultientitymanaged) && ! is_numeric($objecttmp->ismultientitymanaged)) { + if (isset($objecttmp->ismultientitymanaged) && !is_numeric($objecttmp->ismultientitymanaged)) { $sql .= ' AND parenttable.entity = t.'.$tmparray[0]; } if ($objecttmp->ismultientitymanaged == 1 && !empty($user->socid)) { @@ -7321,21 +7321,21 @@ class Form } elseif ($fieldref != 'none') { - $ret.=dol_htmlentities($object->$fieldref); + $ret .= dol_htmlentities($object->$fieldref); } if ($morehtmlref) { // don't add a additional space, when "$morehtmlref" starts with a HTML div tag - if(substr($morehtmlref, 0, 4) != 'trans("Search").'" value="'.GETPOST("search_component_params_input").'">'; $ret .= '
'; - foreach($arrayofcriterias as $criterias) { - foreach($criterias as $criteriafamilykey => $criteriafamilyval) { + foreach ($arrayofcriterias as $criterias) { + foreach ($criterias as $criteriafamilykey => $criteriafamilyval) { if (in_array('search_'.$criteriafamilykey, $arrayofinputfieldsalreadyoutput)) continue; if (in_array($criteriafamilykey, array('rowid', 'ref_ext', 'entity', 'extraparams'))) continue; if (in_array($criteriafamilyval['type'], array('date', 'datetime', 'timestamp'))) { diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php index 1bcd9b9aa63..779f60e26da 100644 --- a/htdocs/core/modules/modFournisseur.class.php +++ b/htdocs/core/modules/modFournisseur.class.php @@ -25,7 +25,7 @@ * \ingroup fournisseur * \brief Description and activation file for module Supplier */ -include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php'; +include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; /** @@ -58,7 +58,7 @@ class modFournisseur extends DolibarrModules $this->version = 'dolibarr'; $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); - $this->picto='company'; + $this->picto = 'company'; // Data directories to create when module is enabled $this->dirs = array( @@ -79,7 +79,7 @@ class modFournisseur extends DolibarrModules // Constants $this->const = array(); - $r=0; + $r = 0; $this->const[$r][0] = "COMMANDE_SUPPLIER_ADDON_PDF"; $this->const[$r][1] = "chaine"; @@ -120,19 +120,19 @@ class modFournisseur extends DolibarrModules // Boxes $this->boxes = array( - 0=>array('file'=>'box_graph_invoices_supplier_permonth.php','enabledbydefaulton'=>'Home'), - 1=>array('file'=>'box_graph_orders_supplier_permonth.php','enabledbydefaulton'=>'Home'), - 2=>array('file'=>'box_fournisseurs.php','enabledbydefaulton'=>'Home'), - 3=>array('file'=>'box_factures_fourn_imp.php','enabledbydefaulton'=>'Home'), - 4=>array('file'=>'box_factures_fourn.php','enabledbydefaulton'=>'Home'), - 5=>array('file'=>'box_supplier_orders.php','enabledbydefaulton'=>'Home'), - 6=>array('file'=>'box_supplier_orders_awaiting_reception.php','enabledbydefaulton'=>'Home'), + 0=>array('file'=>'box_graph_invoices_supplier_permonth.php', 'enabledbydefaulton'=>'Home'), + 1=>array('file'=>'box_graph_orders_supplier_permonth.php', 'enabledbydefaulton'=>'Home'), + 2=>array('file'=>'box_fournisseurs.php', 'enabledbydefaulton'=>'Home'), + 3=>array('file'=>'box_factures_fourn_imp.php', 'enabledbydefaulton'=>'Home'), + 4=>array('file'=>'box_factures_fourn.php', 'enabledbydefaulton'=>'Home'), + 5=>array('file'=>'box_supplier_orders.php', 'enabledbydefaulton'=>'Home'), + 6=>array('file'=>'box_supplier_orders_awaiting_reception.php', 'enabledbydefaulton'=>'Home'), ); // Permissions $this->rights = array(); $this->rights_class = 'fournisseur'; - $r=0; + $r = 0; $r++; $this->rights[$r][0] = 1181; @@ -205,11 +205,11 @@ class modFournisseur extends DolibarrModules $this->rights[$r][4] = 'commande'; $this->rights[$r][5] = 'supprimer'; - if (! empty($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED)) + if (!empty($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED)) { $r++; $this->rights[$r][0] = 1190; - $this->rights[$r][1] = 'Approve supplier order (second level)'; // $langs->trans("Permission1190"); + $this->rights[$r][1] = 'Approve supplier order (second level)'; // $langs->trans("Permission1190"); $this->rights[$r][2] = 'w'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'commande'; @@ -275,28 +275,28 @@ class modFournisseur extends DolibarrModules // Menus //------- - $this->menu = 1; // This module add menu entries. They are coded into menu manager. + $this->menu = 1; // This module add menu entries. They are coded into menu manager. // Exports //-------- - $r=0; + $r = 0; $r++; - $this->export_code[$r]=$this->rights_class.'_'.$r; - $this->export_label[$r]='Vendor invoices and lines of invoices'; - $this->export_icon[$r]='bill'; - $this->export_permission[$r]=array(array("fournisseur","facture","export")); - $this->export_fields_array[$r]=array( - 's.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.phone'=>'Phone', - 's.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.idprof5'=>'ProfId5','s.idprof6'=>'ProfId6', - 's.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra', - 'f.rowid'=>"InvoiceId",'f.ref'=>"InvoiceRef",'f.ref_supplier'=>"RefSupplier",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.date_lim_reglement'=>'DateMaxPayment', - 'f.total_ht'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.total_tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note_public'=>"InvoiceNote", - 'fd.rowid'=>'LineId','fd.description'=>"LineDescription",'fd.tva_tx'=>"LineVATRate",'fd.qty'=>"LineQty",'fd.remise_percent'=>"Discount",'fd.total_ht'=>"LineTotalHT", - 'fd.total_ttc'=>"LineTotalTTC",'fd.tva'=>"LineTotalVAT",'fd.product_type'=>'TypeOfLineServiceOrProduct','fd.fk_product'=>'ProductId', - 'p.ref'=>'ProductRef','p.label'=>'ProductLabel','p.accountancy_code_buy'=>'ProductAccountancyBuyCode','project.rowid'=>'ProjectId', - 'project.ref'=>'ProjectRef','project.title'=>'ProjectLabel' + $this->export_code[$r] = $this->rights_class.'_'.$r; + $this->export_label[$r] = 'Vendor invoices and lines of invoices'; + $this->export_icon[$r] = 'bill'; + $this->export_permission[$r] = array(array("fournisseur", "facture", "export")); + $this->export_fields_array[$r] = array( + 's.rowid'=>"IdCompany", 's.nom'=>'CompanyName', 's.address'=>'Address', 's.zip'=>'Zip', 's.town'=>'Town', 'c.code'=>'CountryCode', 's.phone'=>'Phone', + 's.siren'=>'ProfId1', 's.siret'=>'ProfId2', 's.ape'=>'ProfId3', 's.idprof4'=>'ProfId4', 's.idprof5'=>'ProfId5', 's.idprof6'=>'ProfId6', + 's.code_compta'=>'CustomerAccountancyCode', 's.code_compta_fournisseur'=>'SupplierAccountancyCode', 's.tva_intra'=>'VATIntra', + 'f.rowid'=>"InvoiceId", 'f.ref'=>"InvoiceRef", 'f.ref_supplier'=>"RefSupplier", 'f.datec'=>"InvoiceDateCreation", 'f.datef'=>"DateInvoice", 'f.date_lim_reglement'=>'DateMaxPayment', + 'f.total_ht'=>"TotalHT", 'f.total_ttc'=>"TotalTTC", 'f.total_tva'=>"TotalVAT", 'f.paye'=>"InvoicePaid", 'f.fk_statut'=>'InvoiceStatus', 'f.note_public'=>"InvoiceNote", + 'fd.rowid'=>'LineId', 'fd.description'=>"LineDescription", 'fd.tva_tx'=>"LineVATRate", 'fd.qty'=>"LineQty", 'fd.remise_percent'=>"Discount", 'fd.total_ht'=>"LineTotalHT", + 'fd.total_ttc'=>"LineTotalTTC", 'fd.tva'=>"LineTotalVAT", 'fd.product_type'=>'TypeOfLineServiceOrProduct', 'fd.fk_product'=>'ProductId', + 'p.ref'=>'ProductRef', 'p.label'=>'ProductLabel', 'p.accountancy_code_buy'=>'ProductAccountancyBuyCode', 'project.rowid'=>'ProjectId', + 'project.ref'=>'ProjectRef', 'project.title'=>'ProjectLabel' ); //$this->export_TypeFields_array[$r]=array( // 's.rowid'=>"List:societe:CompanyName",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text', @@ -304,123 +304,123 @@ class modFournisseur extends DolibarrModules // 'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_public'=>"Text",'fd.description'=>"Text",'fd.tva_tx'=>"Text",'fd.qty'=>"Numeric",'fd.total_ht'=>"Numeric",'fd.total_ttc'=>"Numeric", // 'fd.tva'=>"Numeric",'fd.product_type'=>'Numeric','fd.fk_product'=>'List:product:label','p.ref'=>'Text','p.label'=>'Text' //); - $this->export_TypeFields_array[$r]=array( - 's.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.idprof5'=>'Text','s.idprof6'=>'Text', - 's.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.ref'=>"Text",'f.ref_supplier'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>'Date', - 'f.total_ht'=>"Numeric",'f.total_ttc'=>"Numeric",'f.total_tva'=>"Numeric",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_public'=>"Text",'fd.description'=>"Text",'fd.tva_tx'=>"Text", - 'fd.qty'=>"Numeric",'fd.total_ht'=>"Numeric",'fd.total_ttc'=>"Numeric",'fd.tva'=>"Numeric",'fd.product_type'=>'Numeric','fd.fk_product'=>'List:product:label', - 'p.ref'=>'Text','p.label'=>'Text','project.ref'=>'Text','project.title'=>'Text' + $this->export_TypeFields_array[$r] = array( + 's.nom'=>'Text', 's.address'=>'Text', 's.zip'=>'Text', 's.town'=>'Text', 'c.code'=>'Text', 's.phone'=>'Text', 's.siren'=>'Text', 's.siret'=>'Text', 's.ape'=>'Text', 's.idprof4'=>'Text', 's.idprof5'=>'Text', 's.idprof6'=>'Text', + 's.code_compta'=>'Text', 's.code_compta_fournisseur'=>'Text', 's.tva_intra'=>'Text', 'f.ref'=>"Text", 'f.ref_supplier'=>"Text", 'f.datec'=>"Date", 'f.datef'=>"Date", 'f.date_lim_reglement'=>'Date', + 'f.total_ht'=>"Numeric", 'f.total_ttc'=>"Numeric", 'f.total_tva'=>"Numeric", 'f.paye'=>"Boolean", 'f.fk_statut'=>'Status', 'f.note_public'=>"Text", 'fd.description'=>"Text", 'fd.tva_tx'=>"Text", + 'fd.qty'=>"Numeric", 'fd.total_ht'=>"Numeric", 'fd.total_ttc'=>"Numeric", 'fd.tva'=>"Numeric", 'fd.product_type'=>'Numeric', 'fd.fk_product'=>'List:product:label', + 'p.ref'=>'Text', 'p.label'=>'Text', 'project.ref'=>'Text', 'project.title'=>'Text' ); - $this->export_entities_array[$r]=array( - 's.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company', - 's.ape'=>'company','s.idprof4'=>'company','s.idprof5'=>'company','s.idprof6'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice", - 'f.ref'=>"invoice",'f.ref_supplier'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.date_lim_reglement'=>'invoice','f.total_ht'=>"invoice",'f.total_ttc'=>"invoice",'f.total_tva'=>"invoice", - 'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note_public'=>"invoice",'fd.rowid'=>'invoice_line','fd.description'=>"invoice_line",'fd.tva_tx'=>"invoice_line",'fd.qty'=>"invoice_line", - 'fd.remise_percent'=>"invoice_line",'fd.total_ht'=>"invoice_line",'fd.total_ttc'=>"invoice_line",'fd.tva'=>"invoice_line",'fd.product_type'=>'invoice_line','fd.fk_product'=>'product', - 'p.ref'=>'product','p.label'=>'product','p.accountancy_code_buy'=>'product','project.rowid'=>'project','project.ref'=>'project','project.title'=>'project' + $this->export_entities_array[$r] = array( + 's.rowid'=>"company", 's.nom'=>'company', 's.address'=>'company', 's.zip'=>'company', 's.town'=>'company', 'c.code'=>'company', 's.phone'=>'company', 's.siren'=>'company', 's.siret'=>'company', + 's.ape'=>'company', 's.idprof4'=>'company', 's.idprof5'=>'company', 's.idprof6'=>'company', 's.code_compta'=>'company', 's.code_compta_fournisseur'=>'company', 's.tva_intra'=>'company', 'f.rowid'=>"invoice", + 'f.ref'=>"invoice", 'f.ref_supplier'=>"invoice", 'f.datec'=>"invoice", 'f.datef'=>"invoice", 'f.date_lim_reglement'=>'invoice', 'f.total_ht'=>"invoice", 'f.total_ttc'=>"invoice", 'f.total_tva'=>"invoice", + 'f.paye'=>"invoice", 'f.fk_statut'=>'invoice', 'f.note_public'=>"invoice", 'fd.rowid'=>'invoice_line', 'fd.description'=>"invoice_line", 'fd.tva_tx'=>"invoice_line", 'fd.qty'=>"invoice_line", + 'fd.remise_percent'=>"invoice_line", 'fd.total_ht'=>"invoice_line", 'fd.total_ttc'=>"invoice_line", 'fd.tva'=>"invoice_line", 'fd.product_type'=>'invoice_line', 'fd.fk_product'=>'product', + 'p.ref'=>'product', 'p.label'=>'product', 'p.accountancy_code_buy'=>'product', 'project.rowid'=>'project', 'project.ref'=>'project', 'project.title'=>'project' ); - $this->export_dependencies_array[$r]=array('invoice_line'=>'fd.rowid','product'=>'fd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them + $this->export_dependencies_array[$r] = array('invoice_line'=>'fd.rowid', 'product'=>'fd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them // Add extra fields object - $sql="SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'facture_fourn' AND entity IN (0, ".$conf->entity.")"; - $resql=$this->db->query($sql); + $sql = "SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'facture_fourn' AND entity IN (0, ".$conf->entity.")"; + $resql = $this->db->query($sql); if ($resql) // This can fail when class is used on old database (during migration for example) { - while ($obj=$this->db->fetch_object($resql)) + while ($obj = $this->db->fetch_object($resql)) { - $fieldname='extra.'.$obj->name; - $fieldlabel=ucfirst($obj->label); - $typeFilter="Text"; - switch($obj->type) + $fieldname = 'extra.'.$obj->name; + $fieldlabel = ucfirst($obj->label); + $typeFilter = "Text"; + switch ($obj->type) { case 'int': case 'double': case 'price': - $typeFilter="Numeric"; + $typeFilter = "Numeric"; break; case 'date': case 'datetime': - $typeFilter="Date"; + $typeFilter = "Date"; break; case 'boolean': - $typeFilter="Boolean"; + $typeFilter = "Boolean"; break; case 'sellist': - $tmp=''; - $tmpparam=unserialize($obj->param); // $tmp ay be array 'options' => array 'c_currencies:code_iso:code_iso' => null - if ($tmpparam['options'] && is_array($tmpparam['options'])) $tmp=array_shift(array_keys($tmpparam['options'])); - if (preg_match('/[a-z0-9_]+:[a-z0-9_]+:[a-z0-9_]+/', $tmp)) $typeFilter="List:".$tmp; + $tmp = ''; + $tmpparam = unserialize($obj->param); // $tmp ay be array 'options' => array 'c_currencies:code_iso:code_iso' => null + if ($tmpparam['options'] && is_array($tmpparam['options'])) $tmp = array_shift(array_keys($tmpparam['options'])); + if (preg_match('/[a-z0-9_]+:[a-z0-9_]+:[a-z0-9_]+/', $tmp)) $typeFilter = "List:".$tmp; break; } - $this->export_fields_array[$r][$fieldname]=$fieldlabel; - $this->export_TypeFields_array[$r][$fieldname]=$typeFilter; - $this->export_entities_array[$r][$fieldname]='invoice'; + $this->export_fields_array[$r][$fieldname] = $fieldlabel; + $this->export_TypeFields_array[$r][$fieldname] = $typeFilter; + $this->export_entities_array[$r][$fieldname] = 'invoice'; } } // End add extra fields // Add extra fields line - $sql="SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'facture_fourn_det' AND entity IN (0, ".$conf->entity.")"; - $resql=$this->db->query($sql); + $sql = "SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'facture_fourn_det' AND entity IN (0, ".$conf->entity.")"; + $resql = $this->db->query($sql); if ($resql) // This can fail when class is used on old database (during migration for example) { - while ($obj=$this->db->fetch_object($resql)) + while ($obj = $this->db->fetch_object($resql)) { - $fieldname='extraline.'.$obj->name; - $fieldlabel=ucfirst($obj->label); - $typeFilter="Text"; - switch($obj->type) + $fieldname = 'extraline.'.$obj->name; + $fieldlabel = ucfirst($obj->label); + $typeFilter = "Text"; + switch ($obj->type) { case 'int': case 'double': case 'price': - $typeFilter="Numeric"; + $typeFilter = "Numeric"; break; case 'date': case 'datetime': - $typeFilter="Date"; + $typeFilter = "Date"; break; case 'boolean': - $typeFilter="Boolean"; + $typeFilter = "Boolean"; break; case 'sellist': - $tmp=''; - $tmpparam=unserialize($obj->param); // $tmp ay be array 'options' => array 'c_currencies:code_iso:code_iso' => null - if ($tmpparam['options'] && is_array($tmpparam['options'])) $tmp=array_shift(array_keys($tmpparam['options'])); - if (preg_match('/[a-z0-9_]+:[a-z0-9_]+:[a-z0-9_]+/', $tmp)) $typeFilter="List:".$tmp; + $tmp = ''; + $tmpparam = unserialize($obj->param); // $tmp ay be array 'options' => array 'c_currencies:code_iso:code_iso' => null + if ($tmpparam['options'] && is_array($tmpparam['options'])) $tmp = array_shift(array_keys($tmpparam['options'])); + if (preg_match('/[a-z0-9_]+:[a-z0-9_]+:[a-z0-9_]+/', $tmp)) $typeFilter = "List:".$tmp; break; } - $this->export_fields_array[$r][$fieldname]=$fieldlabel; - $this->export_TypeFields_array[$r][$fieldname]=$typeFilter; - $this->export_entities_array[$r][$fieldname]='invoice_line'; + $this->export_fields_array[$r][$fieldname] = $fieldlabel; + $this->export_TypeFields_array[$r][$fieldname] = $typeFilter; + $this->export_entities_array[$r][$fieldname] = 'invoice_line'; } } // End add extra fields line - $this->export_sql_start[$r]='SELECT DISTINCT '; - $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s'; - if (is_object($user) && empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid,'; - $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'facture_fourn as f'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet as project on (f.fk_projet = project.rowid)'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'facture_fourn_extrafields as extra ON f.rowid = extra.fk_object'; - $this->export_sql_end[$r] .=' , '.MAIN_DB_PREFIX.'facture_fourn_det as fd'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'facture_fourn_det_extrafields as extraline ON fd.rowid = extraline.fk_object'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)'; - $this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid AND f.rowid = fd.fk_facture_fourn'; - $this->export_sql_end[$r] .=' AND f.entity IN ('.getEntity('supplier_invoice').')'; - if (is_object($user) && empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .=' AND sc.fk_user = '.$user->id; + $this->export_sql_start[$r] = 'SELECT DISTINCT '; + $this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'societe as s'; + if (is_object($user) && empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid,'; + $this->export_sql_end[$r] .= ' '.MAIN_DB_PREFIX.'facture_fourn as f'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'projet as project on (f.fk_projet = project.rowid)'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'facture_fourn_extrafields as extra ON f.rowid = extra.fk_object'; + $this->export_sql_end[$r] .= ' , '.MAIN_DB_PREFIX.'facture_fourn_det as fd'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'facture_fourn_det_extrafields as extraline ON fd.rowid = extraline.fk_object'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)'; + $this->export_sql_end[$r] .= ' WHERE f.fk_soc = s.rowid AND f.rowid = fd.fk_facture_fourn'; + $this->export_sql_end[$r] .= ' AND f.entity IN ('.getEntity('supplier_invoice').')'; + if (is_object($user) && empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .= ' AND sc.fk_user = '.$user->id; $r++; - $this->export_code[$r]=$this->rights_class.'_'.$r; - $this->export_label[$r]='Factures fournisseurs et reglements'; - $this->export_icon[$r]='bill'; - $this->export_permission[$r]=array(array("fournisseur","facture","export")); - $this->export_fields_array[$r]=array( - 's.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.phone'=>'Phone', - 's.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.idprof5'=>'ProfId5','s.idprof6'=>'ProfId6', - 's.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra', - 'f.rowid'=>"InvoiceId",'f.ref'=>"InvoiceRef",'f.ref_supplier'=>"RefSupplier",'f.datec'=>"InvoiceDateCreation", - 'f.datef'=>"DateInvoice",'f.total_ht'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.total_tva'=>"TotalVAT",'f.paye'=>"InvoicePaid", - 'f.fk_statut'=>'InvoiceStatus','f.note_public'=>"InvoiceNote",'p.rowid'=>'PaymentId','pf.amount'=>'AmountPayment', - 'p.datep'=>'DatePayment','p.num_paiement'=>'PaymentNumber','project.rowid'=>'ProjectId','project.ref'=>'ProjectRef','project.title'=>'ProjectLabel' + $this->export_code[$r] = $this->rights_class.'_'.$r; + $this->export_label[$r] = 'Factures fournisseurs et reglements'; + $this->export_icon[$r] = 'bill'; + $this->export_permission[$r] = array(array("fournisseur", "facture", "export")); + $this->export_fields_array[$r] = array( + 's.rowid'=>"IdCompany", 's.nom'=>'CompanyName', 's.address'=>'Address', 's.zip'=>'Zip', 's.town'=>'Town', 'c.code'=>'CountryCode', 's.phone'=>'Phone', + 's.siren'=>'ProfId1', 's.siret'=>'ProfId2', 's.ape'=>'ProfId3', 's.idprof4'=>'ProfId4', 's.idprof5'=>'ProfId5', 's.idprof6'=>'ProfId6', + 's.code_compta'=>'CustomerAccountancyCode', 's.code_compta_fournisseur'=>'SupplierAccountancyCode', 's.tva_intra'=>'VATIntra', + 'f.rowid'=>"InvoiceId", 'f.ref'=>"InvoiceRef", 'f.ref_supplier'=>"RefSupplier", 'f.datec'=>"InvoiceDateCreation", + 'f.datef'=>"DateInvoice", 'f.total_ht'=>"TotalHT", 'f.total_ttc'=>"TotalTTC", 'f.total_tva'=>"TotalVAT", 'f.paye'=>"InvoicePaid", + 'f.fk_statut'=>'InvoiceStatus', 'f.note_public'=>"InvoiceNote", 'p.rowid'=>'PaymentId', 'pf.amount'=>'AmountPayment', + 'p.datep'=>'DatePayment', 'p.num_paiement'=>'PaymentNumber', 'project.rowid'=>'ProjectId', 'project.ref'=>'ProjectRef', 'project.title'=>'ProjectLabel' ); //$this->export_TypeFields_array[$r]=array( // 's.rowid'=>"List:societe:CompanyName",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text', @@ -428,201 +428,201 @@ class modFournisseur extends DolibarrModules // 'f.total_ht'=>"Numeric",'f.total_ttc'=>"Numeric",'f.total_tva'=>"Numeric",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_public'=>"Text", // 'pf.amount'=>'Numeric','p.datep'=>'Date','p.num_paiement'=>'Numeric' //); - $this->export_TypeFields_array[$r]=array( - 's.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text', - 's.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.ref'=>"Text",'f.ref_supplier'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.total_ht'=>"Numeric", - 'f.total_ttc'=>"Numeric",'f.total_tva'=>"Numeric",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_public'=>"Text",'pf.amount'=>'Numeric', - 'p.datep'=>'Date','p.num_paiement'=>'Numeric','project.ref'=>'Text','project.title'=>'Text' + $this->export_TypeFields_array[$r] = array( + 's.nom'=>'Text', 's.address'=>'Text', 's.zip'=>'Text', 's.town'=>'Text', 'c.code'=>'Text', 's.phone'=>'Text', 's.siren'=>'Text', 's.siret'=>'Text', 's.ape'=>'Text', + 's.idprof4'=>'Text', 's.code_compta'=>'Text', 's.code_compta_fournisseur'=>'Text', 's.tva_intra'=>'Text', 'f.ref'=>"Text", 'f.ref_supplier'=>"Text", 'f.datec'=>"Date", 'f.datef'=>"Date", 'f.total_ht'=>"Numeric", + 'f.total_ttc'=>"Numeric", 'f.total_tva'=>"Numeric", 'f.paye'=>"Boolean", 'f.fk_statut'=>'Status', 'f.note_public'=>"Text", 'pf.amount'=>'Numeric', + 'p.datep'=>'Date', 'p.num_paiement'=>'Numeric', 'project.ref'=>'Text', 'project.title'=>'Text' ); - $this->export_entities_array[$r]=array( - 's.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'company','s.phone'=>'company', - 's.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.idprof5'=>'company','s.idprof6'=>'company', - 's.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company', - 'f.rowid'=>"invoice",'f.ref'=>"invoice",'f.ref_supplier'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.total_ht'=>"invoice", - 'f.total_ttc'=>"invoice",'f.total_tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note_public'=>"invoice",'p.rowid'=>'payment','pf.amount'=>'payment', - 'p.datep'=>'payment','p.num_paiement'=>'payment','project.rowid'=>'project','project.ref'=>'project','project.title'=>'project'); - $this->export_dependencies_array[$r]=array('payment'=>'p.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them + $this->export_entities_array[$r] = array( + 's.rowid'=>"company", 's.nom'=>'company', 's.address'=>'company', 's.zip'=>'company', 's.town'=>'company', 'c.code'=>'company', 's.phone'=>'company', + 's.siren'=>'company', 's.siret'=>'company', 's.ape'=>'company', 's.idprof4'=>'company', 's.idprof5'=>'company', 's.idprof6'=>'company', + 's.code_compta'=>'company', 's.code_compta_fournisseur'=>'company', 's.tva_intra'=>'company', + 'f.rowid'=>"invoice", 'f.ref'=>"invoice", 'f.ref_supplier'=>"invoice", 'f.datec'=>"invoice", 'f.datef'=>"invoice", 'f.total_ht'=>"invoice", + 'f.total_ttc'=>"invoice", 'f.total_tva'=>"invoice", 'f.paye'=>"invoice", 'f.fk_statut'=>'invoice', 'f.note_public'=>"invoice", 'p.rowid'=>'payment', 'pf.amount'=>'payment', + 'p.datep'=>'payment', 'p.num_paiement'=>'payment', 'project.rowid'=>'project', 'project.ref'=>'project', 'project.title'=>'project'); + $this->export_dependencies_array[$r] = array('payment'=>'p.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them // Add extra fields object - $sql="SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'facture_fourn' AND entity IN (0, ".$conf->entity.")"; - $resql=$this->db->query($sql); + $sql = "SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'facture_fourn' AND entity IN (0, ".$conf->entity.")"; + $resql = $this->db->query($sql); if ($resql) // This can fail when class is used on old database (during migration for example) { - while ($obj=$this->db->fetch_object($resql)) + while ($obj = $this->db->fetch_object($resql)) { - $fieldname='extra.'.$obj->name; - $fieldlabel=ucfirst($obj->label); - $typeFilter="Text"; - switch($obj->type) + $fieldname = 'extra.'.$obj->name; + $fieldlabel = ucfirst($obj->label); + $typeFilter = "Text"; + switch ($obj->type) { case 'int': case 'double': case 'price': - $typeFilter="Numeric"; + $typeFilter = "Numeric"; break; case 'date': case 'datetime': - $typeFilter="Date"; + $typeFilter = "Date"; break; case 'boolean': - $typeFilter="Boolean"; + $typeFilter = "Boolean"; break; case 'sellist': - $tmp=''; - $tmpparam=unserialize($obj->param); // $tmp ay be array 'options' => array 'c_currencies:code_iso:code_iso' => null - if ($tmpparam['options'] && is_array($tmpparam['options'])) $tmp=array_shift(array_keys($tmpparam['options'])); - if (preg_match('/[a-z0-9_]+:[a-z0-9_]+:[a-z0-9_]+/', $tmp)) $typeFilter="List:".$tmp; + $tmp = ''; + $tmpparam = unserialize($obj->param); // $tmp ay be array 'options' => array 'c_currencies:code_iso:code_iso' => null + if ($tmpparam['options'] && is_array($tmpparam['options'])) $tmp = array_shift(array_keys($tmpparam['options'])); + if (preg_match('/[a-z0-9_]+:[a-z0-9_]+:[a-z0-9_]+/', $tmp)) $typeFilter = "List:".$tmp; break; } - $this->export_fields_array[$r][$fieldname]=$fieldlabel; - $this->export_TypeFields_array[$r][$fieldname]=$typeFilter; - $this->export_entities_array[$r][$fieldname]='invoice'; + $this->export_fields_array[$r][$fieldname] = $fieldlabel; + $this->export_TypeFields_array[$r][$fieldname] = $typeFilter; + $this->export_entities_array[$r][$fieldname] = 'invoice'; } } // End add extra fields object - $this->export_sql_start[$r]='SELECT DISTINCT '; - $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s'; - if (is_object($user) && empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid,'; - $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'facture_fourn as f'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet as project on (f.fk_projet = project.rowid)'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'facture_fourn_extrafields as extra ON f.rowid = extra.fk_object'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON pf.fk_facturefourn = f.rowid'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn as p ON pf.fk_paiementfourn = p.rowid'; - $this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid'; - $this->export_sql_end[$r] .=' AND f.entity IN ('.getEntity('supplier_invoice').')'; - if (is_object($user) && empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .=' AND sc.fk_user = '.$user->id; + $this->export_sql_start[$r] = 'SELECT DISTINCT '; + $this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'societe as s'; + if (is_object($user) && empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid,'; + $this->export_sql_end[$r] .= ' '.MAIN_DB_PREFIX.'facture_fourn as f'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'projet as project on (f.fk_projet = project.rowid)'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'facture_fourn_extrafields as extra ON f.rowid = extra.fk_object'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON pf.fk_facturefourn = f.rowid'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn as p ON pf.fk_paiementfourn = p.rowid'; + $this->export_sql_end[$r] .= ' WHERE f.fk_soc = s.rowid'; + $this->export_sql_end[$r] .= ' AND f.entity IN ('.getEntity('supplier_invoice').')'; + if (is_object($user) && empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .= ' AND sc.fk_user = '.$user->id; // Order $r++; - $this->export_code[$r]=$this->rights_class.'_'.$r; - $this->export_label[$r]='Purchase Orders and lines of purchase orders'; - $this->export_icon[$r]='order'; - $this->export_permission[$r]=array(array("fournisseur","commande","export")); - $this->export_fields_array[$r]=array( - 's.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.phone'=>'Phone', - 's.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.idprof5'=>'ProfId5','s.idprof6'=>'ProfId6','s.tva_intra'=>'VATIntra', - 'f.rowid'=>"OrderId",'f.ref'=>"Ref",'f.ref_supplier'=>"RefSupplier",'f.date_creation'=>"DateCreation",'f.date_commande'=>"OrderDate",'f.date_livraison'=>"DateDeliveryPlanned", - 'f.total_ht'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.fk_statut'=>'Status','f.date_approve'=>'DateApprove','f.date_approve2'=>'DateApprove2', - 'f.note_public'=>"NotePublic",'f.note_private'=>"NotePrivate",'ua1.login'=>'ApprovedBy','ua2.login'=>'ApprovedBy2','fd.rowid'=>'LineId','fd.description'=>"LineDescription", - 'fd.tva_tx'=>"LineVATRate",'fd.qty'=>"LineQty",'fd.remise_percent'=>"Discount",'fd.total_ht'=>"LineTotalHT",'fd.total_ttc'=>"LineTotalTTC", - 'fd.total_tva'=>"LineTotalVAT",'fd.product_type'=>'TypeOfLineServiceOrProduct','fd.ref'=>'RefSupplier','fd.fk_product'=>'ProductId', - 'p.ref'=>'ProductRef','p.label'=>'ProductLabel','project.rowid'=>'ProjectId','project.ref'=>'ProjectRef','project.title'=>'ProjectLabel' + $this->export_code[$r] = $this->rights_class.'_'.$r; + $this->export_label[$r] = 'Purchase Orders and lines of purchase orders'; + $this->export_icon[$r] = 'order'; + $this->export_permission[$r] = array(array("fournisseur", "commande", "export")); + $this->export_fields_array[$r] = array( + 's.rowid'=>"IdCompany", 's.nom'=>'CompanyName', 's.address'=>'Address', 's.zip'=>'Zip', 's.town'=>'Town', 'c.code'=>'CountryCode', 's.phone'=>'Phone', + 's.siren'=>'ProfId1', 's.siret'=>'ProfId2', 's.ape'=>'ProfId3', 's.idprof4'=>'ProfId4', 's.idprof5'=>'ProfId5', 's.idprof6'=>'ProfId6', 's.tva_intra'=>'VATIntra', + 'f.rowid'=>"OrderId", 'f.ref'=>"Ref", 'f.ref_supplier'=>"RefSupplier", 'f.date_creation'=>"DateCreation", 'f.date_commande'=>"OrderDate", 'f.date_livraison'=>"DateDeliveryPlanned", + 'f.total_ht'=>"TotalHT", 'f.total_ttc'=>"TotalTTC", 'f.tva'=>"TotalVAT", 'f.fk_statut'=>'Status', 'f.date_approve'=>'DateApprove', 'f.date_approve2'=>'DateApprove2', + 'f.note_public'=>"NotePublic", 'f.note_private'=>"NotePrivate", 'ua1.login'=>'ApprovedBy', 'ua2.login'=>'ApprovedBy2', 'fd.rowid'=>'LineId', 'fd.description'=>"LineDescription", + 'fd.tva_tx'=>"LineVATRate", 'fd.qty'=>"LineQty", 'fd.remise_percent'=>"Discount", 'fd.total_ht'=>"LineTotalHT", 'fd.total_ttc'=>"LineTotalTTC", + 'fd.total_tva'=>"LineTotalVAT", 'fd.product_type'=>'TypeOfLineServiceOrProduct', 'fd.ref'=>'RefSupplier', 'fd.fk_product'=>'ProductId', + 'p.ref'=>'ProductRef', 'p.label'=>'ProductLabel', 'project.rowid'=>'ProjectId', 'project.ref'=>'ProjectRef', 'project.title'=>'ProjectLabel' ); if (empty($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED)) { unset($this->export_fields_array['f.date_approve2']); unset($this->export_fields_array['ua2.login']); } - $this->export_TypeFields_array[$r]=array( - 's.rowid'=>"company",'s.nom'=>'Text','s.address'=>'Text','s.cp'=>'Text','s.ville'=>'Text','c.code'=>'Text','s.tel'=>'Text','s.siren'=>'Text', - 's.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.idprof5'=>'Text','s.idprof6'=>'Text','s.tva_intra'=>'Text','f.ref'=>"Text",'f.ref_supplier'=>"Text", - 'f.date_creation'=>"Date",'f.date_commande'=>"Date",'f.date_livraison'=>"Date",'f.total_ht'=>"Numeric",'f.total_ttc'=>"Numeric",'f.tva'=>"Numeric", - 'f.fk_statut'=>'Status','f.date_approve'=>'Date','f.date_approve2'=>'Date','f.note_public'=>"Text",'f.note_private'=>"Text",'fd.description'=>"Text", - 'fd.tva_tx'=>"Numeric",'fd.qty'=>"Numeric",'fd.remise_percent'=>"Numeric",'fd.total_ht'=>"Numeric",'fd.total_ttc'=>"Numeric",'fd.total_tva'=>"Numeric", - 'fd.product_type'=>'Numeric','fd.ref'=>'Text','fd.fk_product'=>'List:product:label','p.ref'=>'Text','p.label'=>'Text','project.ref'=>'Text','project.title'=>'Text' + $this->export_TypeFields_array[$r] = array( + 's.rowid'=>"company", 's.nom'=>'Text', 's.address'=>'Text', 's.cp'=>'Text', 's.ville'=>'Text', 'c.code'=>'Text', 's.tel'=>'Text', 's.siren'=>'Text', + 's.siret'=>'Text', 's.ape'=>'Text', 's.idprof4'=>'Text', 's.idprof5'=>'Text', 's.idprof6'=>'Text', 's.tva_intra'=>'Text', 'f.ref'=>"Text", 'f.ref_supplier'=>"Text", + 'f.date_creation'=>"Date", 'f.date_commande'=>"Date", 'f.date_livraison'=>"Date", 'f.total_ht'=>"Numeric", 'f.total_ttc'=>"Numeric", 'f.tva'=>"Numeric", + 'f.fk_statut'=>'Status', 'f.date_approve'=>'Date', 'f.date_approve2'=>'Date', 'f.note_public'=>"Text", 'f.note_private'=>"Text", 'fd.description'=>"Text", + 'fd.tva_tx'=>"Numeric", 'fd.qty'=>"Numeric", 'fd.remise_percent'=>"Numeric", 'fd.total_ht'=>"Numeric", 'fd.total_ttc'=>"Numeric", 'fd.total_tva'=>"Numeric", + 'fd.product_type'=>'Numeric', 'fd.ref'=>'Text', 'fd.fk_product'=>'List:product:label', 'p.ref'=>'Text', 'p.label'=>'Text', 'project.ref'=>'Text', 'project.title'=>'Text' ); - $this->export_entities_array[$r]=array( - 's.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'company','s.phone'=>'company','s.siren'=>'company', - 's.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.idprof5'=>'company','s.idprof6'=>'company','s.tva_intra'=>'company','ua1.login'=>'user', - 'ua2.login'=>'user','fd.rowid'=>'order_line','fd.description'=>"order_line",'fd.tva_tx'=>"order_line",'fd.qty'=>"order_line",'fd.remise_percent'=>"order_line", - 'fd.total_ht'=>"order_line",'fd.total_ttc'=>"order_line",'fd.total_tva'=>"order_line",'fd.product_type'=>'order_line','fd.ref'=>'order_line','fd.fk_product'=>'product', - 'p.ref'=>'product','p.label'=>'product','project.rowid'=>'project','project.ref'=>'project','project.title'=>'project' + $this->export_entities_array[$r] = array( + 's.rowid'=>"company", 's.nom'=>'company', 's.address'=>'company', 's.zip'=>'company', 's.town'=>'company', 'c.code'=>'company', 's.phone'=>'company', 's.siren'=>'company', + 's.siret'=>'company', 's.ape'=>'company', 's.idprof4'=>'company', 's.idprof5'=>'company', 's.idprof6'=>'company', 's.tva_intra'=>'company', 'ua1.login'=>'user', + 'ua2.login'=>'user', 'fd.rowid'=>'order_line', 'fd.description'=>"order_line", 'fd.tva_tx'=>"order_line", 'fd.qty'=>"order_line", 'fd.remise_percent'=>"order_line", + 'fd.total_ht'=>"order_line", 'fd.total_ttc'=>"order_line", 'fd.total_tva'=>"order_line", 'fd.product_type'=>'order_line', 'fd.ref'=>'order_line', 'fd.fk_product'=>'product', + 'p.ref'=>'product', 'p.label'=>'product', 'project.rowid'=>'project', 'project.ref'=>'project', 'project.title'=>'project' ); - $this->export_dependencies_array[$r]=array('order_line'=>'fd.rowid','product'=>'fd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them + $this->export_dependencies_array[$r] = array('order_line'=>'fd.rowid', 'product'=>'fd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them // Add extra fields object - $sql="SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'commande_fournisseur' AND entity IN (0, ".$conf->entity.")"; - $resql=$this->db->query($sql); + $sql = "SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'commande_fournisseur' AND entity IN (0, ".$conf->entity.")"; + $resql = $this->db->query($sql); if ($resql) // This can fail when class is used on old database (during migration for example) { - while ($obj=$this->db->fetch_object($resql)) + while ($obj = $this->db->fetch_object($resql)) { - $fieldname='extra.'.$obj->name; - $fieldlabel=ucfirst($obj->label); - $typeFilter="Text"; - switch($obj->type) + $fieldname = 'extra.'.$obj->name; + $fieldlabel = ucfirst($obj->label); + $typeFilter = "Text"; + switch ($obj->type) { case 'int': case 'double': case 'price': - $typeFilter="Numeric"; + $typeFilter = "Numeric"; break; case 'date': case 'datetime': - $typeFilter="Date"; + $typeFilter = "Date"; break; case 'boolean': - $typeFilter="Boolean"; + $typeFilter = "Boolean"; break; case 'sellist': - $tmp=''; - $tmpparam=unserialize($obj->param); // $tmp ay be array 'options' => array 'c_currencies:code_iso:code_iso' => null - $tmpkey=array_keys($tmpparam['options']); - if ($tmpparam['options'] && is_array($tmpparam['options'])) $tmp=array_shift($tmpkey); - if (preg_match('/[a-z0-9_]+:[a-z0-9_]+:[a-z0-9_]+/', $tmp)) $typeFilter="List:".$tmp; + $tmp = ''; + $tmpparam = unserialize($obj->param); // $tmp ay be array 'options' => array 'c_currencies:code_iso:code_iso' => null + $tmpkey = array_keys($tmpparam['options']); + if ($tmpparam['options'] && is_array($tmpparam['options'])) $tmp = array_shift($tmpkey); + if (preg_match('/[a-z0-9_]+:[a-z0-9_]+:[a-z0-9_]+/', $tmp)) $typeFilter = "List:".$tmp; break; } - $this->export_fields_array[$r][$fieldname]=$fieldlabel; - $this->export_TypeFields_array[$r][$fieldname]=$typeFilter; - $this->export_entities_array[$r][$fieldname]='order'; + $this->export_fields_array[$r][$fieldname] = $fieldlabel; + $this->export_TypeFields_array[$r][$fieldname] = $typeFilter; + $this->export_entities_array[$r][$fieldname] = 'order'; } } // End add extra fields object // Add extra fields line - $sql="SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'commande_fournisseurdet' AND entity IN (0, ".$conf->entity.")"; - $resql=$this->db->query($sql); + $sql = "SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'commande_fournisseurdet' AND entity IN (0, ".$conf->entity.")"; + $resql = $this->db->query($sql); if ($resql) // This can fail when class is used on old database (during migration for example) { - while ($obj=$this->db->fetch_object($resql)) + while ($obj = $this->db->fetch_object($resql)) { - $fieldname='extraline.'.$obj->name; - $fieldlabel=ucfirst($obj->label); - $typeFilter="Text"; - switch($obj->type) + $fieldname = 'extraline.'.$obj->name; + $fieldlabel = ucfirst($obj->label); + $typeFilter = "Text"; + switch ($obj->type) { case 'int': case 'double': case 'price': - $typeFilter="Numeric"; + $typeFilter = "Numeric"; break; case 'date': case 'datetime': - $typeFilter="Date"; + $typeFilter = "Date"; break; case 'boolean': - $typeFilter="Boolean"; + $typeFilter = "Boolean"; break; case 'sellist': - $tmp=''; - $tmpparam=unserialize($obj->param); // $tmp ay be array 'options' => array 'c_currencies:code_iso:code_iso' => null + $tmp = ''; + $tmpparam = unserialize($obj->param); // $tmp ay be array 'options' => array 'c_currencies:code_iso:code_iso' => null if ($tmpparam['options'] && is_array($tmpparam['options'])) { - $tmpparam_param_key=array_keys($tmpparam['options']); - $tmp=array_shift($tmpparam_param_key); + $tmpparam_param_key = array_keys($tmpparam['options']); + $tmp = array_shift($tmpparam_param_key); } - if (preg_match('/[a-z0-9_]+:[a-z0-9_]+:[a-z0-9_]+/', $tmp)) $typeFilter="List:".$tmp; + if (preg_match('/[a-z0-9_]+:[a-z0-9_]+:[a-z0-9_]+/', $tmp)) $typeFilter = "List:".$tmp; break; } - $this->export_fields_array[$r][$fieldname]=$fieldlabel; - $this->export_TypeFields_array[$r][$fieldname]=$typeFilter; - $this->export_entities_array[$r][$fieldname]='order_line'; + $this->export_fields_array[$r][$fieldname] = $fieldlabel; + $this->export_TypeFields_array[$r][$fieldname] = $typeFilter; + $this->export_entities_array[$r][$fieldname] = 'order_line'; } } // End add extra fields line - $this->export_sql_start[$r]='SELECT DISTINCT '; - $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s'; - if (is_object($user) && empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid,'; - $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'commande_fournisseur as f'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet as project on (f.fk_projet = project.rowid)'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'user as ua1 ON ua1.rowid = f.fk_user_approve'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'user as ua2 ON ua2.rowid = f.fk_user_approve2'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'commande_fournisseur_extrafields as extra ON f.rowid = extra.fk_object,'; - $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'commande_fournisseurdet as fd'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'commande_fournisseurdet_extrafields as extraline ON fd.rowid = extraline.fk_object'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)'; - $this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid AND f.rowid = fd.fk_commande'; - $this->export_sql_end[$r] .=' AND f.entity IN ('.getEntity('supplier_order').')'; - if (is_object($user) && empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .=' AND sc.fk_user = '.$user->id; + $this->export_sql_start[$r] = 'SELECT DISTINCT '; + $this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'societe as s'; + if (is_object($user) && empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid,'; + $this->export_sql_end[$r] .= ' '.MAIN_DB_PREFIX.'commande_fournisseur as f'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'projet as project on (f.fk_projet = project.rowid)'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user as ua1 ON ua1.rowid = f.fk_user_approve'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user as ua2 ON ua2.rowid = f.fk_user_approve2'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'commande_fournisseur_extrafields as extra ON f.rowid = extra.fk_object,'; + $this->export_sql_end[$r] .= ' '.MAIN_DB_PREFIX.'commande_fournisseurdet as fd'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'commande_fournisseurdet_extrafields as extraline ON fd.rowid = extraline.fk_object'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)'; + $this->export_sql_end[$r] .= ' WHERE f.fk_soc = s.rowid AND f.rowid = fd.fk_commande'; + $this->export_sql_end[$r] .= ' AND f.entity IN ('.getEntity('supplier_order').')'; + if (is_object($user) && empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .= ' AND sc.fk_user = '.$user->id; } @@ -641,19 +641,19 @@ class modFournisseur extends DolibarrModules $this->remove($options); //ODT template - $src=DOL_DOCUMENT_ROOT.'/install/doctemplates/supplier_orders/template_supplier_order.odt'; - $dirodt=DOL_DATA_ROOT.'/doctemplates/supplier_orders'; - $dest=$dirodt.'/template_supplier_order.odt'; + $src = DOL_DOCUMENT_ROOT.'/install/doctemplates/supplier_orders/template_supplier_order.odt'; + $dirodt = DOL_DATA_ROOT.'/doctemplates/supplier_orders'; + $dest = $dirodt.'/template_supplier_order.odt'; - if (file_exists($src) && ! file_exists($dest)) + if (file_exists($src) && !file_exists($dest)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; dol_mkdir($dirodt); - $result=dol_copy($src, $dest, 0, 0); + $result = dol_copy($src, $dest, 0, 0); if ($result < 0) { $langs->load("errors"); - $this->error=$langs->trans('ErrorFailToCopyFile', $src, $dest); + $this->error = $langs->trans('ErrorFailToCopyFile', $src, $dest); return 0; } } diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index 86b3dfd378a..b40ca3df78c 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -247,39 +247,39 @@ class modSociete extends DolibarrModules // Menus //------- - $this->menu = 1; // This module add menu entries. They are coded into menu manager. + $this->menu = 1; // This module add menu entries. They are coded into menu manager. // Exports //-------- - $r=0; + $r = 0; // Export list of third parties and attributes $r++; - $this->export_code[$r]=$this->rights_class.'_'.$r; - $this->export_label[$r]='ExportDataset_company_1'; - $this->export_icon[$r]='company'; - $this->export_permission[$r]=array(array("societe","export")); - $this->export_fields_array[$r]=array( - 's.rowid'=>"Id",'s.nom'=>"Name",'s.name_alias'=>"AliasNameShort",'s.status'=>"Status",'s.client'=>"Customer",'s.fournisseur'=>"Supplier",'s.datec'=>"DateCreation",'s.tms'=>"DateLastModification", - 's.code_client'=>"CustomerCode",'s.code_fournisseur'=>"SupplierCode",'s.code_compta'=>"AccountancyCode",'s.code_compta_fournisseur'=>"SupplierAccountancyCode", - 's.address'=>"Address",'s.zip'=>"Zip",'s.town'=>"Town",'d.nom'=>'State','c.label'=>"Country",'c.code'=>"CountryCode",'s.phone'=>"Phone",'s.fax'=>"Fax", - 's.url'=>"Url",'s.email'=>"Email",'s.default_lang'=>"DefaultLang",'s.siren'=>"ProfId1",'s.siret'=>"ProfId2",'s.ape'=>"ProfId3",'s.idprof4'=>"ProfId4", - 's.idprof5'=>"ProfId5",'s.idprof6'=>"ProfId6",'s.tva_intra'=>"VATIntraShort",'s.capital'=>"Capital",'s.note_private'=>"NotePrivate",'s.note_public'=>"NotePublic", - 't.libelle'=>"ThirdPartyType",'ce.code'=>"Staff","cfj.libelle"=>"JuridicalStatus",'s.fk_prospectlevel'=>'ProspectLevel', - 'st.code'=>'ProspectStatus','payterm.libelle'=>'PaymentConditions','paymode.libelle'=>'PaymentMode' + $this->export_code[$r] = $this->rights_class.'_'.$r; + $this->export_label[$r] = 'ExportDataset_company_1'; + $this->export_icon[$r] = 'company'; + $this->export_permission[$r] = array(array("societe", "export")); + $this->export_fields_array[$r] = array( + 's.rowid'=>"Id", 's.nom'=>"Name", 's.name_alias'=>"AliasNameShort", 's.status'=>"Status", 's.client'=>"Customer", 's.fournisseur'=>"Supplier", 's.datec'=>"DateCreation", 's.tms'=>"DateLastModification", + 's.code_client'=>"CustomerCode", 's.code_fournisseur'=>"SupplierCode", 's.code_compta'=>"AccountancyCode", 's.code_compta_fournisseur'=>"SupplierAccountancyCode", + 's.address'=>"Address", 's.zip'=>"Zip", 's.town'=>"Town", 'd.nom'=>'State', 'c.label'=>"Country", 'c.code'=>"CountryCode", 's.phone'=>"Phone", 's.fax'=>"Fax", + 's.url'=>"Url", 's.email'=>"Email", 's.default_lang'=>"DefaultLang", 's.siren'=>"ProfId1", 's.siret'=>"ProfId2", 's.ape'=>"ProfId3", 's.idprof4'=>"ProfId4", + 's.idprof5'=>"ProfId5", 's.idprof6'=>"ProfId6", 's.tva_intra'=>"VATIntraShort", 's.capital'=>"Capital", 's.note_private'=>"NotePrivate", 's.note_public'=>"NotePublic", + 't.libelle'=>"ThirdPartyType", 'ce.code'=>"Staff", "cfj.libelle"=>"JuridicalStatus", 's.fk_prospectlevel'=>'ProspectLevel', + 'st.code'=>'ProspectStatus', 'payterm.libelle'=>'PaymentConditions', 'paymode.libelle'=>'PaymentMode' ); - if (! empty($conf->global->SOCIETE_USEPREFIX)) $this->export_fields_array[$r]['s.prefix']='Prefix'; - if (! empty($conf->global->PRODUIT_MULTIPRICES)) $this->export_fields_array[$r]['s.price_level']='PriceLevel'; + if (!empty($conf->global->SOCIETE_USEPREFIX)) $this->export_fields_array[$r]['s.prefix'] = 'Prefix'; + if (!empty($conf->global->PRODUIT_MULTIPRICES)) $this->export_fields_array[$r]['s.price_level'] = 'PriceLevel'; // Add multicompany field - if (! empty($conf->global->MULTICOMPANY_ENTITY_IN_EXPORT_IF_SHARED)) + if (!empty($conf->global->MULTICOMPANY_ENTITY_IN_EXPORT_IF_SHARED)) { - $nbofallowedentities=count(explode(',', getEntity('societe'))); // If project are shared, nb will be > 1 - if (! empty($conf->multicompany->enabled) && $nbofallowedentities > 1) $this->export_fields_array[$r]+=array('s.entity'=>'Entity'); + $nbofallowedentities = count(explode(',', getEntity('societe'))); // If project are shared, nb will be > 1 + if (!empty($conf->multicompany->enabled) && $nbofallowedentities > 1) $this->export_fields_array[$r] += array('s.entity'=>'Entity'); } - $keyforselect='societe'; $keyforelement='company'; $keyforaliasextra='extra'; + $keyforselect = 'societe'; $keyforelement = 'company'; $keyforaliasextra = 'extra'; include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; - $this->export_fields_array[$r]+=array('u.login'=>'SaleRepresentativeLogin','u.firstname'=>'SaleRepresentativeFirstname', 'u.lastname'=>'SaleRepresentativeLastname'); + $this->export_fields_array[$r] += array('u.login'=>'SaleRepresentativeLogin', 'u.firstname'=>'SaleRepresentativeFirstname', 'u.lastname'=>'SaleRepresentativeLastname'); //$this->export_TypeFields_array[$r]=array( // 's.rowid'=>"List:societe:nom",'s.nom'=>"Text",'s.status'=>"Text",'s.client'=>"Boolean",'s.fournisseur'=>"Boolean",'s.datec'=>"Date",'s.tms'=>"Date", // 's.code_client'=>"Text",'s.code_fournisseur'=>"Text",'s.address'=>"Text",'s.zip'=>"Text",'s.town'=>"Text",'c.label'=>"List:c_country:label:label", @@ -288,104 +288,104 @@ class modSociete extends DolibarrModules // 't.libelle'=>"Text",'ce.code'=>"List:c_effectif:libelle:code","cfj.libelle"=>"Text",'s.fk_prospectlevel'=>'List:c_prospectlevel:label:code', // 's.fk_stcomm'=>'List:c_stcomm:libelle:code','d.nom'=>'List:c_departements:nom:rowid' //); - $this->export_TypeFields_array[$r]=array( - 's.rowid'=>"Numeric", 's.nom'=>"Text",'s.name_alias'=>"Text",'s.status'=>"Numeric",'s.client'=>"Numeric",'s.fournisseur'=>"Boolean",'s.datec'=>"Date",'s.tms'=>"Date", - 's.code_client'=>"Text",'s.code_fournisseur'=>"Text",'s.code_compta'=>"Text",'s.code_compta_fournisseur'=>"Text",'s.address'=>"Text",'s.zip'=>"Text", - 's.town'=>"Text",'c.label'=>"List:c_country:label:label",'c.code'=>"Text",'s.phone'=>"Text",'s.fax'=>"Text",'s.url'=>"Text",'s.email'=>"Text", - 's.default_lang'=>"Text",'s.siret'=>"Text",'s.siren'=>"Text",'s.ape'=>"Text",'s.idprof4'=>"Text",'s.idprof5'=>"Text",'s.idprof6'=>"Text", - 's.tva_intra'=>"Text",'s.capital'=>"Numeric",'s.note_private'=>"Text",'s.note_public'=>"Text",'t.libelle'=>"Text", - 'ce.code'=>"List:c_effectif:libelle:code","cfj.libelle"=>"Text",'s.fk_prospectlevel'=>'List:c_prospectlevel:label:code', - 'st.code'=>'List:c_stcomm:libelle:code','d.nom'=>'Text','u.login'=>'Text','u.firstname'=>'Text','u.lastname'=>'Text','payterm.libelle'=>'Text', - 'paymode.libelle'=>'Text','s.entity'=>'Numeric', + $this->export_TypeFields_array[$r] = array( + 's.rowid'=>"Numeric", 's.nom'=>"Text", 's.name_alias'=>"Text", 's.status'=>"Numeric", 's.client'=>"Numeric", 's.fournisseur'=>"Boolean", 's.datec'=>"Date", 's.tms'=>"Date", + 's.code_client'=>"Text", 's.code_fournisseur'=>"Text", 's.code_compta'=>"Text", 's.code_compta_fournisseur'=>"Text", 's.address'=>"Text", 's.zip'=>"Text", + 's.town'=>"Text", 'c.label'=>"List:c_country:label:label", 'c.code'=>"Text", 's.phone'=>"Text", 's.fax'=>"Text", 's.url'=>"Text", 's.email'=>"Text", + 's.default_lang'=>"Text", 's.siret'=>"Text", 's.siren'=>"Text", 's.ape'=>"Text", 's.idprof4'=>"Text", 's.idprof5'=>"Text", 's.idprof6'=>"Text", + 's.tva_intra'=>"Text", 's.capital'=>"Numeric", 's.note_private'=>"Text", 's.note_public'=>"Text", 't.libelle'=>"Text", + 'ce.code'=>"List:c_effectif:libelle:code", "cfj.libelle"=>"Text", 's.fk_prospectlevel'=>'List:c_prospectlevel:label:code', + 'st.code'=>'List:c_stcomm:libelle:code', 'd.nom'=>'Text', 'u.login'=>'Text', 'u.firstname'=>'Text', 'u.lastname'=>'Text', 'payterm.libelle'=>'Text', + 'paymode.libelle'=>'Text', 's.entity'=>'Numeric', 's.price_level'=>'Numeric' ); - $this->export_entities_array[$r]=array('u.login'=>'user','u.firstname'=>'user','u.lastname'=>'user'); // We define here only fields that use another picto - $this->export_examplevalues_array[$r]=array('s.client'=>'0 (no customer no prospect)/1 (customer)/2 (prospect)/3 (customer and prospect)','s.fournisseur'=>'0 (not a supplier) or 1 (supplier)'); - $this->export_sql_start[$r]='SELECT DISTINCT '; - $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_extrafields as extra ON s.rowid = extra.fk_object'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_typent as t ON s.fk_typent = t.id'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_effectif as ce ON s.fk_effectif = ce.id'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_forme_juridique as cfj ON s.fk_forme_juridique = cfj.code'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON s.fk_departement = d.rowid'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_stcomm as st ON s.fk_stcomm = st.id'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid LEFT JOIN '.MAIN_DB_PREFIX.'user as u ON sc.fk_user = u.rowid'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_payment_term as payterm ON s.cond_reglement = payterm.rowid'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as paymode ON s.mode_reglement = paymode.id'; - $this->export_sql_end[$r] .=' WHERE s.entity IN ('.getEntity('societe').')'; + $this->export_entities_array[$r] = array('u.login'=>'user', 'u.firstname'=>'user', 'u.lastname'=>'user'); // We define here only fields that use another picto + $this->export_examplevalues_array[$r] = array('s.client'=>'0 (no customer no prospect)/1 (customer)/2 (prospect)/3 (customer and prospect)', 's.fournisseur'=>'0 (not a supplier) or 1 (supplier)'); + $this->export_sql_start[$r] = 'SELECT DISTINCT '; + $this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'societe as s'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe_extrafields as extra ON s.rowid = extra.fk_object'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_typent as t ON s.fk_typent = t.id'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_effectif as ce ON s.fk_effectif = ce.id'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_forme_juridique as cfj ON s.fk_forme_juridique = cfj.code'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON s.fk_departement = d.rowid'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_stcomm as st ON s.fk_stcomm = st.id'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid LEFT JOIN '.MAIN_DB_PREFIX.'user as u ON sc.fk_user = u.rowid'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_payment_term as payterm ON s.cond_reglement = payterm.rowid'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as paymode ON s.mode_reglement = paymode.id'; + $this->export_sql_end[$r] .= ' WHERE s.entity IN ('.getEntity('societe').')'; if (is_object($user) && empty($user->rights->societe->client->voir)) { - $this->export_sql_end[$r] .=' AND (sc.fk_user = '.$user->id.' '; - if (! empty($conf->global->SOCIETE_EXPORT_SUBORDINATES_CHILDS)) { + $this->export_sql_end[$r] .= ' AND (sc.fk_user = '.$user->id.' '; + if (!empty($conf->global->SOCIETE_EXPORT_SUBORDINATES_CHILDS)) { $subordinatesids = $user->getAllChildIds(); - $this->export_sql_end[$r] .=count($subordinatesids)>0 ? ' OR (sc.fk_user IN ('.implode(',', $subordinatesids).')' : ''; + $this->export_sql_end[$r] .= count($subordinatesids) > 0 ? ' OR (sc.fk_user IN ('.implode(',', $subordinatesids).')' : ''; } - $this->export_sql_end[$r] .=')'; + $this->export_sql_end[$r] .= ')'; } // Export list of contacts and attributes $r++; - $this->export_code[$r]=$this->rights_class.'_'.$r; - $this->export_label[$r]='ExportDataset_company_2'; - $this->export_icon[$r]='contact'; - $this->export_permission[$r]=array(array("societe","contact","export")); - $this->export_fields_array[$r]=array( - 'c.rowid'=>"IdContact",'c.civility'=>"CivilityCode",'c.lastname'=>'Lastname','c.firstname'=>'Firstname','c.poste'=>'PostOrFunction', - 'c.datec'=>"DateCreation",'c.tms'=>"DateLastModification",'c.priv'=>"ContactPrivate",'c.address'=>"Address",'c.zip'=>"Zip",'c.town'=>"Town", - 'd.nom'=>'State','co.label'=>"Country",'co.code'=>"CountryCode",'c.phone'=>"Phone",'c.fax'=>"Fax",'c.phone_mobile'=>"Mobile",'c.email'=>"EMail", + $this->export_code[$r] = $this->rights_class.'_'.$r; + $this->export_label[$r] = 'ExportDataset_company_2'; + $this->export_icon[$r] = 'contact'; + $this->export_permission[$r] = array(array("societe", "contact", "export")); + $this->export_fields_array[$r] = array( + 'c.rowid'=>"IdContact", 'c.civility'=>"CivilityCode", 'c.lastname'=>'Lastname', 'c.firstname'=>'Firstname', 'c.poste'=>'PostOrFunction', + 'c.datec'=>"DateCreation", 'c.tms'=>"DateLastModification", 'c.priv'=>"ContactPrivate", 'c.address'=>"Address", 'c.zip'=>"Zip", 'c.town'=>"Town", + 'd.nom'=>'State', 'co.label'=>"Country", 'co.code'=>"CountryCode", 'c.phone'=>"Phone", 'c.fax'=>"Fax", 'c.phone_mobile'=>"Mobile", 'c.email'=>"EMail", 'c.statut'=>"Status", - 's.rowid'=>"IdCompany",'s.nom'=>"CompanyName",'s.status'=>"Status",'s.code_client'=>"CustomerCode",'s.code_fournisseur'=>"SupplierCode", - 's.code_compta'=>"AccountancyCode",'s.code_compta_fournisseur'=>"SupplierAccountancyCode", - 's.client'=>'Customer','s.fournisseur'=>'Supplier', - 's.address'=>'Address','s.zip'=>"Zip",'s.town'=>"Town",'s.phone'=>'Phone','s.email'=>"Email", + 's.rowid'=>"IdCompany", 's.nom'=>"CompanyName", 's.status'=>"Status", 's.code_client'=>"CustomerCode", 's.code_fournisseur'=>"SupplierCode", + 's.code_compta'=>"AccountancyCode", 's.code_compta_fournisseur'=>"SupplierAccountancyCode", + 's.client'=>'Customer', 's.fournisseur'=>'Supplier', + 's.address'=>'Address', 's.zip'=>"Zip", 's.town'=>"Town", 's.phone'=>'Phone', 's.email'=>"Email", 't.libelle'=>"ThirdPartyType" ); - $this->export_examplevalues_array[$r]=array('s.client'=>'0 (no customer no prospect)/1 (customer)/2 (prospect)/3 (customer and prospect)','s.fournisseur'=>'0 (not a supplier) or 1 (supplier)'); - $this->export_TypeFields_array[$r]=array( - 'c.civility'=>"List:c_civility:label:code",'c.lastname'=>'Text','c.firstname'=>'Text','c.poste'=>'Text','c.datec'=>"Date",'c.priv'=>"Boolean", - 'c.address'=>"Text",'c.zip'=>"Text",'c.town'=>"Text",'d.nom'=>'Text','co.label'=>"List:c_country:label:rowid",'co.code'=>"Text",'c.phone'=>"Text", - 'c.fax'=>"Text",'c.email'=>"Text", + $this->export_examplevalues_array[$r] = array('s.client'=>'0 (no customer no prospect)/1 (customer)/2 (prospect)/3 (customer and prospect)', 's.fournisseur'=>'0 (not a supplier) or 1 (supplier)'); + $this->export_TypeFields_array[$r] = array( + 'c.civility'=>"List:c_civility:label:code", 'c.lastname'=>'Text', 'c.firstname'=>'Text', 'c.poste'=>'Text', 'c.datec'=>"Date", 'c.priv'=>"Boolean", + 'c.address'=>"Text", 'c.zip'=>"Text", 'c.town'=>"Text", 'd.nom'=>'Text', 'co.label'=>"List:c_country:label:rowid", 'co.code'=>"Text", 'c.phone'=>"Text", + 'c.fax'=>"Text", 'c.email'=>"Text", 'c.statut'=>"Status", - 's.rowid'=>"List:societe:nom::thirdparty",'s.nom'=>"Text",'s.status'=>"Status",'s.code_client'=>"Text",'s.code_fournisseur'=>"Text", - 's.code_compta'=>"Text",'s.code_compta_fournisseur'=>"Text", - 's.client'=>"Text",'s.fournisseur'=>"Text", - 's.address'=>"Text",'s.zip'=>"Text",'s.town'=>"Text",'s.phone'=>"Text",'s.email'=>"Text", + 's.rowid'=>"List:societe:nom::thirdparty", 's.nom'=>"Text", 's.status'=>"Status", 's.code_client'=>"Text", 's.code_fournisseur'=>"Text", + 's.code_compta'=>"Text", 's.code_compta_fournisseur'=>"Text", + 's.client'=>"Text", 's.fournisseur'=>"Text", + 's.address'=>"Text", 's.zip'=>"Text", 's.town'=>"Text", 's.phone'=>"Text", 's.email'=>"Text", 't.libelle'=>"Text" ); - $this->export_entities_array[$r]=array( - 's.rowid'=>"company",'s.nom'=>"company", 's.status'=>'company', 's.code_client'=>"company",'s.code_fournisseur'=>"company", - 's.code_compta'=>"company",'s.code_compta_fournisseur'=>"company", + $this->export_entities_array[$r] = array( + 's.rowid'=>"company", 's.nom'=>"company", 's.status'=>'company', 's.code_client'=>"company", 's.code_fournisseur'=>"company", + 's.code_compta'=>"company", 's.code_compta_fournisseur'=>"company", 's.client'=>"company", 's.fournisseur'=>"company", 's.address'=>"company", 's.zip'=>"company", 's.town'=>"company", 's.phone'=>"company", 's.email'=>"company", 't.libelle'=>"company" - ); // We define here only fields that use another picto + ); // We define here only fields that use another picto if (empty($conf->fournisseur->enabled)) { unset($this->export_fields_array[$r]['s.code_fournisseur']); unset($this->export_entities_array[$r]['s.code_fournisseur']); } - $keyforselect='socpeople'; $keyforelement='contact'; $keyforaliasextra='extra'; + $keyforselect = 'socpeople'; $keyforelement = 'contact'; $keyforaliasextra = 'extra'; include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; - $keyforselect='societe'; $keyforelement='company'; $keyforaliasextra='extrasoc'; + $keyforselect = 'societe'; $keyforelement = 'company'; $keyforaliasextra = 'extrasoc'; include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; - $this->export_sql_start[$r]='SELECT DISTINCT '; - $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'socpeople as c'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON c.fk_soc = s.rowid'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_extrafields as extrasoc ON s.rowid = extrasoc.fk_object'; - if (is_object($user) && empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON c.fk_departement = d.rowid'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as co ON c.fk_pays = co.rowid'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'socpeople_extrafields as extra ON extra.fk_object = c.rowid'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_typent as t ON s.fk_typent = t.id'; - $this->export_sql_end[$r] .=' WHERE c.entity IN ('.getEntity('socpeople').')'; + $this->export_sql_start[$r] = 'SELECT DISTINCT '; + $this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'socpeople as c'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON c.fk_soc = s.rowid'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe_extrafields as extrasoc ON s.rowid = extrasoc.fk_object'; + if (is_object($user) && empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON c.fk_departement = d.rowid'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as co ON c.fk_pays = co.rowid'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'socpeople_extrafields as extra ON extra.fk_object = c.rowid'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_typent as t ON s.fk_typent = t.id'; + $this->export_sql_end[$r] .= ' WHERE c.entity IN ('.getEntity('socpeople').')'; if (is_object($user) && empty($user->rights->societe->client->voir)) { - $this->export_sql_end[$r] .=' AND (sc.fk_user = '.$user->id.' '; - if (! empty($conf->global->SOCIETE_EXPORT_SUBORDINATES_CHILDS)) { + $this->export_sql_end[$r] .= ' AND (sc.fk_user = '.$user->id.' '; + if (!empty($conf->global->SOCIETE_EXPORT_SUBORDINATES_CHILDS)) { $subordinatesids = $user->getAllChildIds(); - $this->export_sql_end[$r] .=count($subordinatesids)>0 ? ' OR (sc.fk_user IN ('.implode(',', $subordinatesids).')' : ''; + $this->export_sql_end[$r] .= count($subordinatesids) > 0 ? ' OR (sc.fk_user IN ('.implode(',', $subordinatesids).')' : ''; } - $this->export_sql_end[$r] .=')'; + $this->export_sql_end[$r] .= ')'; } diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index b3e0303c7f4..cfc01f85a5f 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -34,27 +34,27 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; -if (! empty($conf->facture->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; -if (! empty($conf->facture->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php'; -if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; -if (! empty($conf->supplier_proposal->enabled)) require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php'; -if (! empty($conf->fournisseur->enabled)) require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; -if (! empty($conf->fournisseur->enabled)) require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; -if (! empty($conf->contrat->enabled)) require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; -if (! empty($conf->ficheinter->enabled)) require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; -if (! empty($conf->expedition->enabled)) require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; -if (! empty($conf->deplacement->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php'; -if (! empty($conf->expensereport->enabled)) require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; -if (! empty($conf->agenda->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; -if (! empty($conf->don->enabled)) require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; -if (! empty($conf->loan->enabled)) require_once DOL_DOCUMENT_ROOT.'/loan/class/loan.class.php'; -if (! empty($conf->loan->enabled)) require_once DOL_DOCUMENT_ROOT.'/loan/class/loanschedule.class.php'; -if (! empty($conf->stock->enabled)) require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; -if (! empty($conf->tax->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; -if (! empty($conf->banque->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/paymentvarious.class.php'; -if (! empty($conf->salaries->enabled)) require_once DOL_DOCUMENT_ROOT.'/salaries/class/paymentsalary.class.php'; -if (! empty($conf->categorie->enabled)) require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; +if (!empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; +if (!empty($conf->facture->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; +if (!empty($conf->facture->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php'; +if (!empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; +if (!empty($conf->supplier_proposal->enabled)) require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php'; +if (!empty($conf->fournisseur->enabled)) require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; +if (!empty($conf->fournisseur->enabled)) require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; +if (!empty($conf->contrat->enabled)) require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; +if (!empty($conf->ficheinter->enabled)) require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; +if (!empty($conf->expedition->enabled)) require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; +if (!empty($conf->deplacement->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php'; +if (!empty($conf->expensereport->enabled)) require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; +if (!empty($conf->agenda->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; +if (!empty($conf->don->enabled)) require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; +if (!empty($conf->loan->enabled)) require_once DOL_DOCUMENT_ROOT.'/loan/class/loan.class.php'; +if (!empty($conf->loan->enabled)) require_once DOL_DOCUMENT_ROOT.'/loan/class/loanschedule.class.php'; +if (!empty($conf->stock->enabled)) require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; +if (!empty($conf->tax->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; +if (!empty($conf->banque->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/paymentvarious.class.php'; +if (!empty($conf->salaries->enabled)) require_once DOL_DOCUMENT_ROOT.'/salaries/class/paymentsalary.class.php'; +if (!empty($conf->categorie->enabled)) require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; // Load translation files required by the page $langs->loadLangs(array('projects', 'companies', 'suppliers', 'compta')); @@ -652,25 +652,25 @@ foreach ($listofreferent as $key => $value) $total_ht_by_line = price2num($tmp['amount'], 'MT'); } } - elseif ($key == 'loan'){ - if((empty($dates) && empty($datee)) || (intval($dates) <= $element->datestart && intval($datee) >= $element->dateend)){ + elseif ($key == 'loan') { + if ((empty($dates) && empty($datee)) || (intval($dates) <= $element->datestart && intval($datee) >= $element->dateend)) { // Get total loan $total_ht_by_line = -$element->capital; } - else{ + else { // Get loan schedule according to date filter $total_ht_by_line = 0; $loanScheduleStatic = new LoanSchedule($element->db); $loanScheduleStatic->fetchAll($element->id); - if(!empty($loanScheduleStatic->lines)){ - foreach($loanScheduleStatic->lines as $loanSchedule){ + if (!empty($loanScheduleStatic->lines)) { + foreach ($loanScheduleStatic->lines as $loanSchedule) { /** * @var $loanSchedule LoanSchedule */ - if( ($loanSchedule->datep >= $dates && $loanSchedule->datep <= $datee) // dates filter is defined + if (($loanSchedule->datep >= $dates && $loanSchedule->datep <= $datee) // dates filter is defined || !empty($dates) && empty($datee) && $loanSchedule->datep >= $dates && $loanSchedule->datep <= dol_now() || empty($dates) && !empty($datee) && $loanSchedule->datep <= $datee - ){ + ) { $total_ht_by_line = -$loanSchedule->amount_capital; } } @@ -688,7 +688,7 @@ foreach ($listofreferent as $key => $value) $defaultvat = get_default_tva($mysoc, $mysoc); $total_ttc_by_line = price2num($total_ht_by_line * (1 + ($defaultvat / 100)), 'MT'); } - elseif ($key == 'loan'){ + elseif ($key == 'loan') { $total_ttc_by_line = $total_ht_by_line; // For loan there is actually no taxe managed in Dolibarr } else $total_ttc_by_line = $element->total_ttc; @@ -968,7 +968,7 @@ foreach ($listofreferent as $key => $value) print $element->getNomUrl(1, 'withproject', 'time'); print ' - '.dol_trunc($element->label, 48); } - elseif ($key == 'loan'){ + elseif ($key == 'loan') { print $element->getNomUrl(1); print ' - '.dol_trunc($element->label, 48); } @@ -1021,7 +1021,7 @@ foreach ($listofreferent as $key => $value) if (empty($date)) $date = $element->datev; } } - elseif ($key == 'loan'){ + elseif ($key == 'loan') { $date = $element->datestart; } From 0d49211dea3f6154d71f7d0dcb906034e3bcb4c5 Mon Sep 17 00:00:00 2001 From: josemariagomezroncero Date: Thu, 13 Feb 2020 12:59:59 +0100 Subject: [PATCH 278/306] Correction for Hook for dynamic price Correction for Hook for dynamic price --- htdocs/product/dynamic_price/class/price_parser.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/product/dynamic_price/class/price_parser.class.php b/htdocs/product/dynamic_price/class/price_parser.class.php index e2960951348..ae7a519e004 100644 --- a/htdocs/product/dynamic_price/class/price_parser.class.php +++ b/htdocs/product/dynamic_price/class/price_parser.class.php @@ -134,7 +134,6 @@ class PriceParser { global $user; global $hookmanager; - $hookmanager->initHooks(array('productcard','globalcard')); $action = 'PARSEEXPRESSION'; if ($result = $hookmanager->executeHooks('doDynamiPrice', array( 'expression' =>$expression, From ce6cf040281ea79211c16083f4132c5e869f7250 Mon Sep 17 00:00:00 2001 From: Muhammad Aboelfotoh <> Date: Thu, 13 Feb 2020 13:53:07 +0000 Subject: [PATCH 279/306] Add new view for balance.php that additionally shows opening balance --- htdocs/accountancy/bookkeeping/balance.php | 2 + .../bookkeeping/openingbalance.php | 336 ++++++++++++++++++ htdocs/langs/en_US/accountancy.lang | 2 + 3 files changed, 340 insertions(+) create mode 100644 htdocs/accountancy/bookkeeping/openingbalance.php diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index 42491afa294..4a98365f3f9 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -205,6 +205,8 @@ if ($action != 'export_csv') $button = 'global->ACCOUNTING_EXPORT_FORMAT.')" />'; + $button .= dolGetButtonTitle($langs->trans('ShowOpeningBalance'), '', 'fa fa-eye paddingleft', DOL_URL_ROOT.'/accountancy/bookkeeping/openingbalance.php?'.$param); + print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $button, $result, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit); $moreforfilter = ''; diff --git a/htdocs/accountancy/bookkeeping/openingbalance.php b/htdocs/accountancy/bookkeeping/openingbalance.php new file mode 100644 index 00000000000..eaef50cf51f --- /dev/null +++ b/htdocs/accountancy/bookkeeping/openingbalance.php @@ -0,0 +1,336 @@ + + * Copyright (C) 2016 Florian Henry + * Copyright (C) 2016-2019 Alexandre Spangaro + * Copyright (C) 2018 Frédéric France + * + * 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * \file htdocs/accountancy/bookkeeping/balance.php + * \ingroup Accountancy (Double entries) + * \brief Balance of book keeping + */ + +require '../../main.inc.php'; + +// Class +require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php'; +require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancyexport.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; + +// Load translation files required by the page +$langs->loadLangs(array("accountancy")); + +$page = GETPOST("page", 'int'); +$sortorder = GETPOST("sortorder", 'alpha'); +$sortfield = GETPOST("sortfield", 'alpha'); +$action = GETPOST('action', 'aZ09'); +if (GETPOST("exportcsv", 'alpha')) $action = 'export_csv'; + +// Load variable for pagination +$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; +$sortfield = GETPOST('sortfield', 'alpha'); +$sortorder = GETPOST('sortorder', 'alpha'); +$page = GETPOST('page', 'int'); +if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +//if (! $sortfield) $sortfield="p.date_fin"; +//if (! $sortorder) $sortorder="DESC"; + + +$search_date_start = dol_mktime(0, 0, 0, GETPOST('date_startmonth', 'int'), GETPOST('date_startday', 'int'), GETPOST('date_startyear', 'int')); +$search_date_end = dol_mktime(23, 59, 59, GETPOST('date_endmonth', 'int'), GETPOST('date_endday', 'int'), GETPOST('date_endyear', 'int')); + +$search_accountancy_code_start = GETPOST('search_accountancy_code_start', 'alpha'); +if ($search_accountancy_code_start == - 1) { + $search_accountancy_code_start = ''; +} +$search_accountancy_code_end = GETPOST('search_accountancy_code_end', 'alpha'); +if ($search_accountancy_code_end == - 1) { + $search_accountancy_code_end = ''; +} + +$object = new BookKeeping($db); + +$formaccounting = new FormAccounting($db); +$formother = new FormOther($db); +$form = new Form($db); + +if (empty($search_date_start) && !GETPOSTISSET('formfilteraction')) +{ + $sql = "SELECT date_start, date_end from ".MAIN_DB_PREFIX."accounting_fiscalyear "; + $sql .= " where date_start < '".$db->idate(dol_now())."' and date_end > '".$db->idate(dol_now())."'"; + $sql .= $db->plimit(1); + $res = $db->query($sql); + if ($res->num_rows > 0) { + $fiscalYear = $db->fetch_object($res); + $search_date_start = strtotime($fiscalYear->date_start); + $search_date_end = strtotime($fiscalYear->date_end); + } else { + $month_start = ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1); + $year_start = dol_print_date(dol_now(), '%Y'); + $year_end = $year_start + 1; + $month_end = $month_start - 1; + if ($month_end < 1) + { + $month_end = 12; + $year_end--; + } + $search_date_start = dol_mktime(0, 0, 0, $month_start, 1, $year_start); + $search_date_end = dol_get_last_day($year_end, $month_end); + } +} +if ($sortorder == "") + $sortorder = "ASC"; +if ($sortfield == "") + $sortfield = "t.numero_compte"; + + +$param = ''; +if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage); +if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit); + +$filter = array(); +if (!empty($search_date_start)) { + $filter['t.doc_date>='] = $search_date_start; + $param .= '&date_startmonth='.GETPOST('date_startmonth', 'int').'&date_startday='.GETPOST('date_startday', 'int').'&date_startyear='.GETPOST('date_startyear', 'int'); +} +if (!empty($search_date_end)) { + $filter['t.doc_date<='] = $search_date_end; + $param .= '&date_endmonth='.GETPOST('date_endmonth', 'int').'&date_endday='.GETPOST('date_endday', 'int').'&date_endyear='.GETPOST('date_endyear', 'int'); +} +if (!empty($search_accountancy_code_start)) { + $filter['t.numero_compte>='] = $search_accountancy_code_start; + $param .= '&search_accountancy_code_start='.$search_accountancy_code_start; +} +if (!empty($search_accountancy_code_end)) { + $filter['t.numero_compte<='] = $search_accountancy_code_end; + $param .= '&search_accountancy_code_end='.$search_accountancy_code_end; +} + +/* + * Action + */ + +if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers +{ + $search_accountancy_code_start = ''; + $search_accountancy_code_end = ''; + $search_date_start = ''; + $search_date_end = ''; + $filter = array(); +} + + +/* + * View + */ + +if ($action == 'export_csv') +{ + $sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV; + + $filename = 'balance'; + $type_export = 'balance'; + include DOL_DOCUMENT_ROOT.'/accountancy/tpl/export_journal.tpl.php'; + + $result = $object->fetchAllBalance($sortorder, $sortfield, $limit, 0, $filter); + if ($result < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + } + + foreach ($object->lines as $line) + { + print length_accountg($line->numero_compte).$sep; + print $object->get_compte_desc($line->numero_compte).$sep; + print price($line->debit).$sep; + print price($line->credit).$sep; + print price($line->debit - $line->credit).$sep; + print "\n"; + } + + exit; +} + + +$title_page = $langs->trans("AccountBalance"); + +llxHeader('', $title_page); + + +if ($action != 'export_csv') +{ + // List + $nbtotalofrecords = ''; + if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) + { + $nbtotalofrecords = $object->fetchAllBalance($sortorder, $sortfield, 0, 0, $filter); + if ($nbtotalofrecords < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + } + } + + $result = $object->fetchAllBalance($sortorder, $sortfield, $limit, $offset, $filter); + if ($result < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + } + + print '
'; + if ($optioncss != '') print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + + $button = 'global->ACCOUNTING_EXPORT_FORMAT.')" />'; + + $button .= dolGetButtonTitle($langs->trans('HideOpeningBalance'), '', 'fa fa-eye-slash paddingleft', DOL_URL_ROOT.'/accountancy/bookkeeping/balance.php?'.$param); + + print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $button, $result, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit); + + $moreforfilter = ''; + + $moreforfilter .= '
'; + $moreforfilter .= $langs->trans('DateStart').': '; + $moreforfilter .= $form->selectDate($search_date_start ? $search_date_start : -1, 'date_start', 0, 0, 1, '', 1, 0); + $moreforfilter .= $langs->trans('DateEnd').': '; + $moreforfilter .= $form->selectDate($search_date_end ? $search_date_end : -1, 'date_end', 0, 0, 1, '', 1, 0); + $moreforfilter .= '
'; + + if (!empty($moreforfilter)) { + print '
'; + print $moreforfilter; + $parameters = array(); + $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + print '
'; + } + + print ''; + + print ''; + print ''; + print ''; + + print ''; + + print ''; + print_liste_field_titre("AccountAccounting", $_SERVER['PHP_SELF'], "t.numero_compte", "", $param, "", $sortfield, $sortorder); + print_liste_field_titre("Label", $_SERVER['PHP_SELF'], "t.label_operation", "", $param, "", $sortfield, $sortorder); + print_liste_field_titre("Opening Balance", $_SERVER['PHP_SELF'], "", $param, "", 'class="right"', $sortfield, $sortorder); + print_liste_field_titre("Debit", $_SERVER['PHP_SELF'], "t.debit", "", $param, 'class="right"', $sortfield, $sortorder); + print_liste_field_titre("Credit", $_SERVER['PHP_SELF'], "t.credit", "", $param, 'class="right"', $sortfield, $sortorder); + print_liste_field_titre("Balance", $_SERVER["PHP_SELF"], "", $param, "", 'class="right"', $sortfield, $sortorder); + print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $param, "", 'width="60" class="center"', $sortfield, $sortorder); + print "\n"; + + $total_debit = 0; + $total_credit = 0; + $sous_total_debit = 0; + $sous_total_credit = 0; + $displayed_account = ""; + + $sql = "select t.numero_compte, (SUM(t.debit) - SUM(t.credit)) as opening_balance from ".MAIN_DB_PREFIX."accounting_bookkeeping as t where entity in (1) and t.doc_date < " + ."'".$db->idate($search_date_start)."' group by t.numero_compte"; + $resql = $db->query($sql); + $nrows = $resql->num_rows; + $opening_balances = Array(); + for($i = 0; $i < $nrows; $i++) { + $arr = $resql->fetch_array(); + $opening_balances["'".$arr['numero_compte']."'"] = $arr['opening_balance']; + } + + foreach ($object->lines as $line) + { + $link = ''; + $total_debit += $line->debit; + $total_credit += $line->credit; + $description = $object->get_compte_desc($line->numero_compte); // Search description of the account + $root_account_description = $object->get_compte_racine($line->numero_compte); + if (empty($description)) { + $link = ''.img_edit_add().''; + } + print ''; + + // Permet d'afficher le compte comptable + if (empty($displayed_account) || $root_account_description != $displayed_account) + { + // Affiche un Sous-Total par compte comptable + if ($displayed_account != "") { + print ''; + print "\n"; + print ''; + } + + // Show first line of a break + print ''; + print ''; + print ''; + + $displayed_account = $root_account_description; + $sous_total_debit = 0; + $sous_total_credit = 0; + } + + // $object->get_compte_racine($line->numero_compte); + + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print "\n"; + + // Comptabilise le sous-total + $sous_total_debit += $line->debit; + $sous_total_credit += $line->credit; + } + + print ''; + print "\n"; + print ''; + + print ''; + print "\n"; + print ''; + + print "
'; + print $langs->trans('From'); + print $formaccounting->select_account($search_accountancy_code_start, 'search_accountancy_code_start', 1, array(), 1, 1, ''); + print ' '; + print $langs->trans('to'); + print $formaccounting->select_account($search_accountancy_code_end, 'search_accountancy_code_end', 1, array(), 1, 1, ''); + print ''; + $searchpicto = $form->showFilterAndCheckAddButtons(0); + print $searchpicto; + print '
' . $langs->trans("SubTotal") . ':' . price($sous_total_debit) . '' . price($sous_total_credit) . '' . price(price2num($sous_total_credit - $sous_total_debit)) . ' 
' . $line->numero_compte . ($root_account_description ? ' - ' . $root_account_description : '') . '
'.length_accountg($line->numero_compte).''.$description.''.price($opening_balances["'".$line->numero_compte."'"]).''.price($line->debit).''.price($line->credit).''.price($line->debit - $line->credit).''.$link; + print '
'.$langs->trans("SubTotal").':'.price($sous_total_debit).''.price($sous_total_credit).''.price(price2num($sous_total_debit - $sous_total_credit)).' 
'.$langs->trans("AccountBalance").':'.price($total_debit).''.price($total_credit).''.price(price2num($total_debit - $total_credit)).' 
"; + print '
'; +} + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index c8302b9617e..17d7f9fa1f6 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -228,6 +228,8 @@ ThirdpartyAccountNotDefinedOrThirdPartyUnknownSubledgerIgnored=Third-party unkno ThirdpartyAccountNotDefinedOrThirdPartyUnknownBlocking=Third-party account not defined or third party unknown. Blocking error. UnknownAccountForThirdpartyAndWaitingAccountNotDefinedBlocking=Unknown third-party account and waiting account not defined. Blocking error PaymentsNotLinkedToProduct=Payment not linked to any product / service +ShowOpeningBalance=Show opening balance +HideOpeningBalance=Hide opening balance Pcgtype=Group of account Pcgsubtype=Subgroup of account From c6c941e09ac1f80496083f8dac204a6de37a8b66 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Feb 2020 15:42:41 +0100 Subject: [PATCH 280/306] Fix phpcs --- htdocs/compta/paiement/class/paiement.class.php | 1 - htdocs/theme/eldy/global.inc.php | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index f61082d6211..373f9c1c4e5 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -588,7 +588,6 @@ class Paiement extends CommonObject * @param string $emetteur_nom Name of transmitter * @param string $emetteur_banque Name of bank * @param int $notrigger No trigger - * @param string $num_chq Numero of cheque * @return int <0 if KO, bank_line_id if OK */ public function addPaymentToBank($user, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque, $notrigger = 0) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 32483fb252f..abee229c441 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -31,7 +31,7 @@ body { th a { font-weight: !important; } a.tab { font-weight: 500 !important; } -a:link, a:visited, a:hover, a:active { font-family: ; font-weight: normal; color: rgb(); text-decoration: none; } +a:link, a:visited, a:hover, a:active { font-family: ; color: rgb(); text-decoration: none; } a:hover { text-decoration: underline; color: rgb(); } a.commonlink { color: rgb() !important; text-decoration: none; } th.liste_titre a div div:hover, th.liste_titre_sel a div div:hover { text-decoration: underline; } @@ -2251,13 +2251,13 @@ a.vmenu:link, a.vmenu:visited, a.vmenu:hover, a.vmenu:active, span.vmenu, span.v font.vmenudisabled { font-family: ; text-align: ; font-weight: bold; color: #aaa; margin-left: 4px; } /* bold = 600, 500 is ko with Edge on 1200x960 */ a.vmenu:link, a.vmenu:visited { color: #; } -a.vsmenu:link, a.vsmenu:visited, a.vsmenu:hover, a.vsmenu:active, span.vsmenu { font-family: ; text-align: ; font-weight: normal; color: #202020; margin: 1px 1px 1px 6px; } -font.vsmenudisabled { font-family: ; text-align: ; font-weight: normal; color: #aaa; } +a.vsmenu:link, a.vsmenu:visited, a.vsmenu:hover, a.vsmenu:active, span.vsmenu { font-family: ; text-align: ; color: #202020; margin: 1px 1px 1px 6px; } +font.vsmenudisabled { font-family: ; text-align: ; color: #aaa; } a.vsmenu:link, a.vsmenu:visited { color: #; white-space: nowrap; } font.vsmenudisabledmargin { margin: 1px 1px 1px 6px; } li a.vsmenudisabled, li.vsmenudisabled { color: #aaa !important; } -a.help:link, a.help:visited, a.help:hover, a.help:active, span.help { font-size:; font-family: ; text-align: ; font-weight: normal; color: #aaa; text-decoration: none; } +a.help:link, a.help:visited, a.help:hover, a.help:active, span.help { font-size:; font-family: ; text-align: ; color: #aaa; text-decoration: none; } .vmenu div.blockvmenufirst, .vmenu div.blockvmenulogo, .vmenu div.blockvmenusearchphone, .vmenu div.blockvmenubookmarks { From ec30938a07d257e17867731d3fe6e3a0dae04eff Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Feb 2020 15:43:53 +0100 Subject: [PATCH 281/306] Fix phpcs --- htdocs/compta/paiement/class/paiement.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index 87a8d5547ee..71c8596e00a 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -604,7 +604,6 @@ class Paiement extends CommonObject * @param string $emetteur_nom Name of transmitter * @param string $emetteur_banque Name of bank * @param int $notrigger No trigger - * @param string $num_chq Numero of cheque * @return int <0 if KO, bank_line_id if OK */ public function addPaymentToBank($user, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque, $notrigger = 0) From fc018d00637a5ea35b706d86c02eee14522af4f5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Feb 2020 17:24:29 +0100 Subject: [PATCH 282/306] Module MO is now stable --- ChangeLog | 2 +- htdocs/core/modules/modMrp.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 83c1adfe3d8..32593e6ce77 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,7 +5,7 @@ English Dolibarr ChangeLog ***** ChangeLog for 12.0.0 compared to 11.0.0 ***** For Users: - +NEW: Module MO (Manufacturing Order) is available as stable module. For Developers or integrators: diff --git a/htdocs/core/modules/modMrp.class.php b/htdocs/core/modules/modMrp.class.php index 1ca8e380aa4..73df7523843 100644 --- a/htdocs/core/modules/modMrp.class.php +++ b/htdocs/core/modules/modMrp.class.php @@ -62,7 +62,7 @@ class modMrp extends DolibarrModules // Used only if file README.md and README-LL.md not found. $this->descriptionlong = "Module to Manage Manufacturing Orders (MO)"; // Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z' - $this->version = 'experimental'; + $this->version = 'dolibarr'; // Url to the file with your last numberversion of this module //$this->url_last_version = 'http://www.example.com/versionmodule.txt'; From bb895cb1d82f242011c583946ea4ea560492b85b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Feb 2020 18:00:59 +0100 Subject: [PATCH 283/306] FIX ref_client not visible in tooltip. --- htdocs/comm/propal/list.php | 3 ++- htdocs/commande/list.php | 2 +- htdocs/compta/facture/list.php | 3 ++- htdocs/fourn/facture/list.php | 12 ++++++------ 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index eee15e0a0c0..4bb794a372a 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -765,6 +765,7 @@ if ($resql) $objectstatic->id = $obj->rowid; $objectstatic->ref = $obj->ref; + $objectstatic->ref_client = $obj->ref_client; $objectstatic->note_public = $obj->note_public; $objectstatic->note_private = $obj->note_private; @@ -813,7 +814,7 @@ if ($resql) if (!empty($arrayfields['p.ref_client']['checked'])) { // Customer ref - print '
'; + print ''; print $obj->ref_client; print ''.$obj->ref_client.''.$obj->ref_client.''; + print ''; print $obj->ref_client; print ''; + print ''; print $obj->ref_supplier; print '
'; print ''; - print ''; print_liste_field_titre("AccountAccounting", $_SERVER['PHP_SELF'], "t.numero_compte", "", $param, "", $sortfield, $sortorder); print_liste_field_titre("Label", $_SERVER['PHP_SELF'], "t.label_operation", "", $param, "", $sortfield, $sortorder); + print_liste_field_titre("Opening Balance", $_SERVER['PHP_SELF'], "", $param, "", 'class="right"', $sortfield, $sortorder); print_liste_field_titre("Debit", $_SERVER['PHP_SELF'], "t.debit", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre("Credit", $_SERVER['PHP_SELF'], "t.credit", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre("Balance", $_SERVER["PHP_SELF"], "", $param, "", 'class="right"', $sortfield, $sortorder); @@ -259,6 +257,16 @@ if ($action != 'export_csv') $sous_total_credit = 0; $displayed_account = ""; + $sql = "select t.numero_compte, (SUM(t.debit) - SUM(t.credit)) as opening_balance from ".MAIN_DB_PREFIX."accounting_bookkeeping as t where entity in ".$conf->entity; + $sql.= " AND t.doc_date < '".$db->idate($search_date_start)."' GROUP BY t.numero_compte"; + $resql = $db->query($sql); + $nrows = $resql->num_rows; + $opening_balances = Array(); + for($i = 0; $i < $nrows; $i++) { + $arr = $resql->fetch_array(); + $opening_balances["'".$arr['numero_compte']."'"] = $arr['opening_balance']; + } + foreach ($object->lines as $line) { $link = ''; @@ -283,7 +291,7 @@ if ($action != 'export_csv') // Show first line of a break print ''; - print ''; + print ''; print ''; $displayed_account = $root_account_description; @@ -295,6 +303,7 @@ if ($action != 'export_csv') print ''; print ''; + print ''; print ''; print ''; print ''; @@ -307,11 +316,11 @@ if ($action != 'export_csv') $sous_total_credit += $line->credit; } - print ''; + print ''; print "\n"; print ''; - print ''; + print ''; print "\n"; print ''; diff --git a/htdocs/accountancy/bookkeeping/openingbalance.php b/htdocs/accountancy/bookkeeping/openingbalance.php deleted file mode 100644 index eaef50cf51f..00000000000 --- a/htdocs/accountancy/bookkeeping/openingbalance.php +++ /dev/null @@ -1,336 +0,0 @@ - - * Copyright (C) 2016 Florian Henry - * Copyright (C) 2016-2019 Alexandre Spangaro - * Copyright (C) 2018 Frédéric France - * - * 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 - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * \file htdocs/accountancy/bookkeeping/balance.php - * \ingroup Accountancy (Double entries) - * \brief Balance of book keeping - */ - -require '../../main.inc.php'; - -// Class -require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php'; -require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancyexport.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; - -// Load translation files required by the page -$langs->loadLangs(array("accountancy")); - -$page = GETPOST("page", 'int'); -$sortorder = GETPOST("sortorder", 'alpha'); -$sortfield = GETPOST("sortfield", 'alpha'); -$action = GETPOST('action', 'aZ09'); -if (GETPOST("exportcsv", 'alpha')) $action = 'export_csv'; - -// Load variable for pagination -$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; -$sortfield = GETPOST('sortfield', 'alpha'); -$sortorder = GETPOST('sortorder', 'alpha'); -$page = GETPOST('page', 'int'); -if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action -$offset = $limit * $page; -$pageprev = $page - 1; -$pagenext = $page + 1; -//if (! $sortfield) $sortfield="p.date_fin"; -//if (! $sortorder) $sortorder="DESC"; - - -$search_date_start = dol_mktime(0, 0, 0, GETPOST('date_startmonth', 'int'), GETPOST('date_startday', 'int'), GETPOST('date_startyear', 'int')); -$search_date_end = dol_mktime(23, 59, 59, GETPOST('date_endmonth', 'int'), GETPOST('date_endday', 'int'), GETPOST('date_endyear', 'int')); - -$search_accountancy_code_start = GETPOST('search_accountancy_code_start', 'alpha'); -if ($search_accountancy_code_start == - 1) { - $search_accountancy_code_start = ''; -} -$search_accountancy_code_end = GETPOST('search_accountancy_code_end', 'alpha'); -if ($search_accountancy_code_end == - 1) { - $search_accountancy_code_end = ''; -} - -$object = new BookKeeping($db); - -$formaccounting = new FormAccounting($db); -$formother = new FormOther($db); -$form = new Form($db); - -if (empty($search_date_start) && !GETPOSTISSET('formfilteraction')) -{ - $sql = "SELECT date_start, date_end from ".MAIN_DB_PREFIX."accounting_fiscalyear "; - $sql .= " where date_start < '".$db->idate(dol_now())."' and date_end > '".$db->idate(dol_now())."'"; - $sql .= $db->plimit(1); - $res = $db->query($sql); - if ($res->num_rows > 0) { - $fiscalYear = $db->fetch_object($res); - $search_date_start = strtotime($fiscalYear->date_start); - $search_date_end = strtotime($fiscalYear->date_end); - } else { - $month_start = ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1); - $year_start = dol_print_date(dol_now(), '%Y'); - $year_end = $year_start + 1; - $month_end = $month_start - 1; - if ($month_end < 1) - { - $month_end = 12; - $year_end--; - } - $search_date_start = dol_mktime(0, 0, 0, $month_start, 1, $year_start); - $search_date_end = dol_get_last_day($year_end, $month_end); - } -} -if ($sortorder == "") - $sortorder = "ASC"; -if ($sortfield == "") - $sortfield = "t.numero_compte"; - - -$param = ''; -if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage); -if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit); - -$filter = array(); -if (!empty($search_date_start)) { - $filter['t.doc_date>='] = $search_date_start; - $param .= '&date_startmonth='.GETPOST('date_startmonth', 'int').'&date_startday='.GETPOST('date_startday', 'int').'&date_startyear='.GETPOST('date_startyear', 'int'); -} -if (!empty($search_date_end)) { - $filter['t.doc_date<='] = $search_date_end; - $param .= '&date_endmonth='.GETPOST('date_endmonth', 'int').'&date_endday='.GETPOST('date_endday', 'int').'&date_endyear='.GETPOST('date_endyear', 'int'); -} -if (!empty($search_accountancy_code_start)) { - $filter['t.numero_compte>='] = $search_accountancy_code_start; - $param .= '&search_accountancy_code_start='.$search_accountancy_code_start; -} -if (!empty($search_accountancy_code_end)) { - $filter['t.numero_compte<='] = $search_accountancy_code_end; - $param .= '&search_accountancy_code_end='.$search_accountancy_code_end; -} - -/* - * Action - */ - -if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers -{ - $search_accountancy_code_start = ''; - $search_accountancy_code_end = ''; - $search_date_start = ''; - $search_date_end = ''; - $filter = array(); -} - - -/* - * View - */ - -if ($action == 'export_csv') -{ - $sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV; - - $filename = 'balance'; - $type_export = 'balance'; - include DOL_DOCUMENT_ROOT.'/accountancy/tpl/export_journal.tpl.php'; - - $result = $object->fetchAllBalance($sortorder, $sortfield, $limit, 0, $filter); - if ($result < 0) { - setEventMessages($object->error, $object->errors, 'errors'); - } - - foreach ($object->lines as $line) - { - print length_accountg($line->numero_compte).$sep; - print $object->get_compte_desc($line->numero_compte).$sep; - print price($line->debit).$sep; - print price($line->credit).$sep; - print price($line->debit - $line->credit).$sep; - print "\n"; - } - - exit; -} - - -$title_page = $langs->trans("AccountBalance"); - -llxHeader('', $title_page); - - -if ($action != 'export_csv') -{ - // List - $nbtotalofrecords = ''; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) - { - $nbtotalofrecords = $object->fetchAllBalance($sortorder, $sortfield, 0, 0, $filter); - if ($nbtotalofrecords < 0) { - setEventMessages($object->error, $object->errors, 'errors'); - } - } - - $result = $object->fetchAllBalance($sortorder, $sortfield, $limit, $offset, $filter); - if ($result < 0) { - setEventMessages($object->error, $object->errors, 'errors'); - } - - print '
'; - if ($optioncss != '') print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - - $button = 'global->ACCOUNTING_EXPORT_FORMAT.')" />'; - - $button .= dolGetButtonTitle($langs->trans('HideOpeningBalance'), '', 'fa fa-eye-slash paddingleft', DOL_URL_ROOT.'/accountancy/bookkeeping/balance.php?'.$param); - - print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $button, $result, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit); - - $moreforfilter = ''; - - $moreforfilter .= '
'; - $moreforfilter .= $langs->trans('DateStart').': '; - $moreforfilter .= $form->selectDate($search_date_start ? $search_date_start : -1, 'date_start', 0, 0, 1, '', 1, 0); - $moreforfilter .= $langs->trans('DateEnd').': '; - $moreforfilter .= $form->selectDate($search_date_end ? $search_date_end : -1, 'date_end', 0, 0, 1, '', 1, 0); - $moreforfilter .= '
'; - - if (!empty($moreforfilter)) { - print '
'; - print $moreforfilter; - $parameters = array(); - $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - print '
'; - } - - print '
'; + print ''; print $langs->trans('From'); print $formaccounting->select_account($search_accountancy_code_start, 'search_accountancy_code_start', 1, array(), 1, 1, ''); print ' '; @@ -247,6 +244,7 @@ if ($action != 'export_csv') print '
' . $line->numero_compte . ($root_account_description ? ' - ' . $root_account_description : '') . '' . $line->numero_compte . ($root_account_description ? ' - ' . $root_account_description : '') . '
'.length_accountg($line->numero_compte).''.$description.''.price($opening_balances["'".$line->numero_compte."'"]).''.price($line->debit).''.price($line->credit).''.price($line->debit - $line->credit).'
'.$langs->trans("SubTotal").':'.price($sous_total_debit).''.price($sous_total_credit).''.price(price2num($sous_total_debit - $sous_total_credit)).'
'.$langs->trans("SubTotal").':'.price($sous_total_debit).''.price($sous_total_credit).''.price(price2num($sous_total_debit - $sous_total_credit)).' 
'.$langs->trans("AccountBalance").':'.price($total_debit).''.price($total_credit).''.price(price2num($total_debit - $total_credit)).'
'.$langs->trans("AccountBalance").':'.price($total_debit).''.price($total_credit).''.price(price2num($total_debit - $total_credit)).' 
'; - - print ''; - print ''; - print ''; - - print ''; - - print ''; - print_liste_field_titre("AccountAccounting", $_SERVER['PHP_SELF'], "t.numero_compte", "", $param, "", $sortfield, $sortorder); - print_liste_field_titre("Label", $_SERVER['PHP_SELF'], "t.label_operation", "", $param, "", $sortfield, $sortorder); - print_liste_field_titre("Opening Balance", $_SERVER['PHP_SELF'], "", $param, "", 'class="right"', $sortfield, $sortorder); - print_liste_field_titre("Debit", $_SERVER['PHP_SELF'], "t.debit", "", $param, 'class="right"', $sortfield, $sortorder); - print_liste_field_titre("Credit", $_SERVER['PHP_SELF'], "t.credit", "", $param, 'class="right"', $sortfield, $sortorder); - print_liste_field_titre("Balance", $_SERVER["PHP_SELF"], "", $param, "", 'class="right"', $sortfield, $sortorder); - print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $param, "", 'width="60" class="center"', $sortfield, $sortorder); - print "\n"; - - $total_debit = 0; - $total_credit = 0; - $sous_total_debit = 0; - $sous_total_credit = 0; - $displayed_account = ""; - - $sql = "select t.numero_compte, (SUM(t.debit) - SUM(t.credit)) as opening_balance from ".MAIN_DB_PREFIX."accounting_bookkeeping as t where entity in (1) and t.doc_date < " - ."'".$db->idate($search_date_start)."' group by t.numero_compte"; - $resql = $db->query($sql); - $nrows = $resql->num_rows; - $opening_balances = Array(); - for($i = 0; $i < $nrows; $i++) { - $arr = $resql->fetch_array(); - $opening_balances["'".$arr['numero_compte']."'"] = $arr['opening_balance']; - } - - foreach ($object->lines as $line) - { - $link = ''; - $total_debit += $line->debit; - $total_credit += $line->credit; - $description = $object->get_compte_desc($line->numero_compte); // Search description of the account - $root_account_description = $object->get_compte_racine($line->numero_compte); - if (empty($description)) { - $link = ''.img_edit_add().''; - } - print ''; - - // Permet d'afficher le compte comptable - if (empty($displayed_account) || $root_account_description != $displayed_account) - { - // Affiche un Sous-Total par compte comptable - if ($displayed_account != "") { - print ''; - print "\n"; - print ''; - } - - // Show first line of a break - print ''; - print ''; - print ''; - - $displayed_account = $root_account_description; - $sous_total_debit = 0; - $sous_total_credit = 0; - } - - // $object->get_compte_racine($line->numero_compte); - - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print "\n"; - - // Comptabilise le sous-total - $sous_total_debit += $line->debit; - $sous_total_credit += $line->credit; - } - - print ''; - print "\n"; - print ''; - - print ''; - print "\n"; - print ''; - - print "
'; - print $langs->trans('From'); - print $formaccounting->select_account($search_accountancy_code_start, 'search_accountancy_code_start', 1, array(), 1, 1, ''); - print ' '; - print $langs->trans('to'); - print $formaccounting->select_account($search_accountancy_code_end, 'search_accountancy_code_end', 1, array(), 1, 1, ''); - print ''; - $searchpicto = $form->showFilterAndCheckAddButtons(0); - print $searchpicto; - print '
' . $langs->trans("SubTotal") . ':' . price($sous_total_debit) . '' . price($sous_total_credit) . '' . price(price2num($sous_total_credit - $sous_total_debit)) . ' 
' . $line->numero_compte . ($root_account_description ? ' - ' . $root_account_description : '') . '
'.length_accountg($line->numero_compte).''.$description.''.price($opening_balances["'".$line->numero_compte."'"]).''.price($line->debit).''.price($line->credit).''.price($line->debit - $line->credit).''.$link; - print '
'.$langs->trans("SubTotal").':'.price($sous_total_debit).''.price($sous_total_credit).''.price(price2num($sous_total_debit - $sous_total_credit)).' 
'.$langs->trans("AccountBalance").':'.price($total_debit).''.price($total_credit).''.price(price2num($total_debit - $total_credit)).' 
"; - print ''; -} - -// End of page -llxFooter(); -$db->close(); From d3d572c8d318d4d19ebf9b4f9fb50f92c9cafabf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 14 Feb 2020 19:55:50 +0100 Subject: [PATCH 293/306] FIX Avoid to download the export if we just press enter to refresh form --- htdocs/accountancy/bookkeeping/balance.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index 42491afa294..375b17e3b96 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -42,7 +42,6 @@ $page = GETPOST("page", 'int'); $sortorder = GETPOST("sortorder", 'alpha'); $sortfield = GETPOST("sortfield", 'alpha'); $action = GETPOST('action', 'aZ09'); -if (GETPOST("exportcsv", 'alpha')) $action = 'export_csv'; // Load variable for pagination $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; @@ -198,12 +197,25 @@ if ($action != 'export_csv') if ($optioncss != '') print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; - $button = 'global->ACCOUNTING_EXPORT_FORMAT.')" />'; + print ''; + + + $button = 'global->ACCOUNTING_EXPORT_FORMAT.')" />'; print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $button, $result, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit); From 69bd616e73c2a151fbaff109fcf0a2911769e559 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 15 Feb 2020 10:40:32 +0100 Subject: [PATCH 294/306] css --- htdocs/theme/eldy/theme_vars.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/theme/eldy/theme_vars.inc.php b/htdocs/theme/eldy/theme_vars.inc.php index e80347e9895..61c5a53672e 100644 --- a/htdocs/theme/eldy/theme_vars.inc.php +++ b/htdocs/theme/eldy/theme_vars.inc.php @@ -53,7 +53,7 @@ $theme_bgcolor = array(hexdec('F4'), hexdec('F4'), hexdec('F4')); $theme_bgcoloronglet = array(hexdec('DE'), hexdec('E7'), hexdec('EC')); // Colors -$colorbackhmenu1 = '68,68,90'; // topmenu +$colorbackhmenu1 = '55,61,90'; // topmenu $colorbackvmenu1 = '250,250,250'; // vmenu $colortopbordertitle1 = '200,200,200'; // top border of title $colorbacktitle1 = '233,234,237'; // title of tables,list From 6c9fb062920eee30049aa9449b5d4add1e977312 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 15 Feb 2020 10:56:44 +0100 Subject: [PATCH 295/306] Perf --- htdocs/core/class/html.form.class.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 8dcbacd43c7..ba8fcabe3f1 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -465,8 +465,6 @@ class Form */ public function textwithtooltip($text, $htmltext, $tooltipon = 1, $direction = 0, $img = '', $extracss = '', $notabs = 3, $incbefore = '', $noencodehtmltext = 0, $tooltiptrigger = '', $forcenowrap = 0) { - global $conf; - if ($incbefore) $text = $incbefore.$text; if (!$htmltext) return $text; @@ -474,9 +472,7 @@ class Form if ($notabs == 2) $tag = 'div'; if ($notabs == 3) $tag = 'span'; // Sanitize tooltip - //$htmltext=str_replace("\\","\\\\",$htmltext); - $htmltext = str_replace("\r", "", $htmltext); - $htmltext = str_replace("\n", "", $htmltext); + $htmltext = str_replace(array("\r", "\n"), '', $htmltext); $extrastyle = ''; if ($direction < 0) { $extracss = ($extracss ? $extracss.' ' : '').($notabs != 3 ? 'inline-block' : ''); $extrastyle = 'padding: 0px; padding-left: 3px !important;'; } @@ -488,7 +484,7 @@ class Form if ($tooltiptrigger == '') { - $htmltext = str_replace('"', """, $htmltext); + $htmltext = str_replace('"', '"', $htmltext); } else { From f47966a25ac5821d0ac9bfeb73e1eee297b8d957 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 15 Feb 2020 17:20:11 +0100 Subject: [PATCH 296/306] NEW Restore version of application on main screen for screenshot --- htdocs/main.inc.php | 12 +++++++----- htdocs/theme/eldy/global.inc.php | 17 +++++++++++++---- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 38395b429ed..a6ab6e63744 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1714,11 +1714,6 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead if ($helpbaseurl && $helppage) { $text = ''; - if (!empty($conf->global->MAIN_SHOWDATABASENAMEINHELPPAGESLINK)) { - $langs->load('admin'); - $appli .= '
'.$langs->trans("Database").': '.$db->database_name; - } - $title = $appli.'
'; $title .= $langs->trans($mode == 'wiki' ? 'GoToWikiHelpPage' : 'GoToHelpPage'); if ($mode == 'wiki') $title .= ' - '.$langs->trans("PageWiki").' "'.dol_escape_htmltag(strtr($helppage, '_', ' ')).'"'; $text .= 'database_name; + } + $text = ''.DOL_VERSION.''; + $toprightmenu .= @Form::textwithtooltip('', $appli, 2, 1, $text, 'login_block_elem', 2); } diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index abee229c441..4941d534b88 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -2125,19 +2125,28 @@ div.login a:hover { } div.login_block_user { display: inline-block; + vertical-align: middle; + line-height: px; + height: px; } div.login_block_other { display: inline-block; + vertical-align: middle; clear: ; + padding-top: 0; + text-align: right; + margin-right: 8px; + max-width: 200px; } -div.login_block_other { padding-top: 0; text-align: right; margin-right: 8px; } .login_block_elem { float: right; vertical-align: top; padding: 0px 3px 0px 4px !important; - line-height: px; - height: px; +} +.login_block_other .login_block_elem { + line-height: 25px; + height: 25px; } .atoplogin, .atoplogin:hover { color: # !important; @@ -2257,7 +2266,7 @@ a.vsmenu:link, a.vsmenu:visited { color: #; wh font.vsmenudisabledmargin { margin: 1px 1px 1px 6px; } li a.vsmenudisabled, li.vsmenudisabled { color: #aaa !important; } -a.help:link, a.help:visited, a.help:hover, a.help:active, span.help { font-size:; font-family: ; text-align: ; color: #aaa; text-decoration: none; } +a.help:link, a.help:visited, a.help:hover, a.help:active, span.help { text-align: ; color: #aaa; text-decoration: none; } .vmenu div.blockvmenufirst, .vmenu div.blockvmenulogo, .vmenu div.blockvmenusearchphone, .vmenu div.blockvmenubookmarks { From 2b3cc0d048bfa1281e2906532447c08fedcbe5c2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 15 Feb 2020 18:00:09 +0100 Subject: [PATCH 297/306] Fix add both public id and ref in topic --- htdocs/langs/en_US/ticket.lang | 4 ++-- htdocs/public/ticket/create_ticket.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/langs/en_US/ticket.lang b/htdocs/langs/en_US/ticket.lang index f29c2f4a5ba..96f5b2e0681 100644 --- a/htdocs/langs/en_US/ticket.lang +++ b/htdocs/langs/en_US/ticket.lang @@ -253,7 +253,7 @@ TicketPublicDesc=You can create a support ticket or check from an existing ID. YourTicketSuccessfullySaved=Ticket has been successfully saved! MesgInfosPublicTicketCreatedWithTrackId=A new ticket has been created with ID %s and Ref %s. PleaseRememberThisId=Please keep the tracking number that we might ask you later. -TicketNewEmailSubject=Ticket creation confirmation - Ref %s +TicketNewEmailSubject=Ticket creation confirmation - Ref %s (public ticket ID %s) TicketNewEmailSubjectCustomer=New support ticket TicketNewEmailBody=This is an automatic email to confirm you have registered a new ticket. TicketNewEmailBodyCustomer=This is an automatic email to confirm a new ticket has just been created into your account. @@ -272,7 +272,7 @@ Subject=Subject ViewTicket=View ticket ViewMyTicketList=View my ticket list ErrorEmailMustExistToCreateTicket=Error: email address not found in our database -TicketNewEmailSubjectAdmin=New ticket created - Ref %s +TicketNewEmailSubjectAdmin=New ticket created - Ref %s (public ticket ID %s) TicketNewEmailBodyAdmin=

Ticket has just been created with ID #%s, see information:

SeeThisTicketIntomanagementInterface=See ticket in management interface TicketPublicInterfaceForbidden=The public interface for the tickets was not enabled diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php index b3e94d5ceb2..181973912e5 100644 --- a/htdocs/public/ticket/create_ticket.php +++ b/htdocs/public/ticket/create_ticket.php @@ -205,7 +205,7 @@ if ($action == 'create_ticket' && GETPOST('add', 'alpha')) { // Send email to customer - $subject = '['.$conf->global->MAIN_INFO_SOCIETE_NOM.'] '.$langs->transnoentities('TicketNewEmailSubject', $object->ref); + $subject = '['.$conf->global->MAIN_INFO_SOCIETE_NOM.'] '.$langs->transnoentities('TicketNewEmailSubject', $object->ref, $object->track_id); $message .= ($conf->global->TICKET_MESSAGE_MAIL_NEW ? $conf->global->TICKET_MESSAGE_MAIL_NEW : $langs->transnoentities('TicketNewEmailBody'))."\n\n"; $message .= $langs->transnoentities('TicketNewEmailBodyInfosTicket')."\n"; @@ -247,7 +247,7 @@ if ($action == 'create_ticket' && GETPOST('add', 'alpha')) { if ($sendto) { - $subject = '['.$conf->global->MAIN_INFO_SOCIETE_NOM.'] '.$langs->transnoentities('TicketNewEmailSubjectAdmin', $object->ref); + $subject = '['.$conf->global->MAIN_INFO_SOCIETE_NOM.'] '.$langs->transnoentities('TicketNewEmailSubjectAdmin', $object->ref, $object->track_id); $message_admin = $langs->transnoentities('TicketNewEmailBodyAdmin', $object->track_id)."\n\n"; $message_admin .= '
  • '.$langs->trans('Title').' : '.$object->subject.'
  • '; $message_admin .= '
  • '.$langs->trans('Type').' : '.$object->type_label.'
  • '; From f14cd9f49f3f7246dd2179cfca23b3e16588c648 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 15 Feb 2020 18:07:23 +0100 Subject: [PATCH 298/306] Look and feel v11 --- htdocs/public/ticket/view.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/ticket/view.php b/htdocs/public/ticket/view.php index 8f6d84059a5..edee0b0ca45 100644 --- a/htdocs/public/ticket/view.php +++ b/htdocs/public/ticket/view.php @@ -236,7 +236,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a print '
    '; - print ''; + print '
    '; // Ref print '
    '.$langs->trans("Ref").''; From 9b6179850a8b0fb3638d37ee9aa4e910b44929c3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 15 Feb 2020 18:07:49 +0100 Subject: [PATCH 299/306] CSS --- htdocs/main.inc.php | 2 +- htdocs/public/ticket/view.php | 6 +++--- htdocs/theme/eldy/badges.inc.php | 2 +- htdocs/theme/md/style.css.php | 13 ++++++++++--- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index a6ab6e63744..c185b4f7968 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1729,7 +1729,7 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead $langs->load('admin'); $appli .= '
    '.$langs->trans("Database").': '.$db->database_name; } - $text = ''.DOL_VERSION.''; + $text = ''.DOL_VERSION.''; $toprightmenu .= @Form::textwithtooltip('', $appli, 2, 1, $text, 'login_block_elem', 2); } diff --git a/htdocs/public/ticket/view.php b/htdocs/public/ticket/view.php index 8f6d84059a5..3c6f40212cc 100644 --- a/htdocs/public/ticket/view.php +++ b/htdocs/public/ticket/view.php @@ -234,9 +234,9 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a print $form->formconfirm($_SERVER["PHP_SELF"]."?track_id=".$track_id, $langs->trans("CloseATicket"), $langs->trans("ConfirmCloseAticket"), "confirm_public_close", '', '', 1); } - print '
    '; + print '
    '; - print ''; + print '
    '; // Ref print ''; print ''; // Date start subscription diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 28594fdea40..b2b94fd5684 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -792,7 +792,7 @@ if ($rowid > 0) $morphys["phy"] = $langs->trans("Physical"); $morphys["mor"] = $langs->trans("Moral"); print '"; print '
    '.$langs->trans("Ref").''; @@ -378,7 +378,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a print ''; } } else { - print '

    '.$langs->trans("TicketPublicMsgViewLogIn").'

    '; + print '
    '.$langs->trans("TicketPublicMsgViewLogIn").'
    '; print '
    '; print '
    '; diff --git a/htdocs/theme/eldy/badges.inc.php b/htdocs/theme/eldy/badges.inc.php index db7802074c1..48619dfc7d0 100644 --- a/htdocs/theme/eldy/badges.inc.php +++ b/htdocs/theme/eldy/badges.inc.php @@ -23,7 +23,7 @@ if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> } .badge-status { - font-size: 1em; + font-size: 0.95em; padding: .19em .35em; /* more than 0.19 generate a change into heigth of lines */ } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 9dee5d21683..596d35b5f3e 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -2247,7 +2247,6 @@ div.login_block { position: fixed; - font-weight: bold; z-index: 10; text-align: center; vertical-align: middle; @@ -2278,12 +2277,20 @@ div.login_block_other { padding-top: 3px; } .login_block_elem { float: right; vertical-align: top; - padding: 0px 0px 0px 4px !important; + padding: 0px 0px 0px 2px !important; height: 16px; } .login_block_elem_name { margin-top: 1px; } +a.aversion { + white-space: nowrap; + width: 48px; + overflow: hidden; + text-overflow: ellipsis; + display: block; +} + .atoplogin, .atoplogin:hover { color: # !important; } @@ -2381,7 +2388,7 @@ font.vsmenudisabled { font-size:px; font-family: ; white-space: nowrap; } font.vsmenudisabledmargin { margin: 1px 1px 1px 8px; } -a.help:link, a.help:visited, a.help:hover, a.help:active, span.help { font-size:px; font-family: ; text-align: ; font-weight: normal; color: #999; text-decoration: none; } +a.help:link, a.help:visited, a.help:hover, a.help:active, span.help { text-align: ; font-weight: normal; color: #999; text-decoration: none; } div.blockvmenulogo { From dc3a15945da298d9a67e245f2722a2175fd0ac43 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 16 Feb 2020 12:05:00 +0100 Subject: [PATCH 300/306] Add method getKanbanView() --- htdocs/commande/class/commande.class.php | 2 +- htdocs/core/class/commonobject.class.php | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index a77674aa097..b19210f894a 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3568,7 +3568,7 @@ class Commande extends CommonOrder * @param int $short ??? * @param int $notooltip 1=Disable tooltip * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking - * @param int $addlinktonotes Add linkt to notes + * @param int $addlinktonotes Add link to notes * @return string String with URL */ public function getNomUrl($withpicto = 0, $option = '', $max = 0, $short = 0, $notooltip = 0, $save_lastsearch_value = -1, $addlinktonotes = 0) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index fde048346eb..f0bbe4867d7 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -491,6 +491,7 @@ abstract class CommonObject return $this->error.(is_array($this->errors) ? (($this->error != '' ? ', ' : '').join(', ', $this->errors)) : ''); } + /** * Return customer ref for screen output. * @@ -559,6 +560,27 @@ abstract class CommonObject return dol_trunc($ret, $maxlen); } + /** + * Return clicable link of object (with eventually picto) + * + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + */ + public function getKanbanView($option = '') + { + $return = '
    '; + $return .= '
    '; + $return .= ''; + $return .= ''; // Can be image + $return .= ''; + $return .= '
    '; + $return .= ''.(method_exists($this, 'getNomUrl') ? $this->getNomUrl() : $this->ref).''; + $return .= '
    '; + $return .= '
    '; + $return .= '
    '; + + return $return; + } + /** * Return full address of contact * From 7cdfc3ca657b1cbdaf9d991d4b6c5fa0996efbc3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 16 Feb 2020 12:55:32 +0100 Subject: [PATCH 301/306] FIX HTML Injection --- htdocs/user/param_ihm.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index dba57f3954b..8dfe8480722 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -89,49 +89,49 @@ if (empty($reshook)) { $tabparam = array(); if (GETPOST("check_MAIN_LANDING_PAGE") == "on") { - $tabparam["MAIN_LANDING_PAGE"] = $_POST["MAIN_LANDING_PAGE"]; + $tabparam["MAIN_LANDING_PAGE"] = GETPOST("MAIN_LANDING_PAGE", 'alphanohtml'); } else { $tabparam["MAIN_LANDING_PAGE"] = ''; } if (GETPOST("check_MAIN_LANG_DEFAULT") == "on") { - $tabparam["MAIN_LANG_DEFAULT"] = $_POST["main_lang_default"]; + $tabparam["MAIN_LANG_DEFAULT"] = GETPOST("main_lang_default", 'aZ09'); } else { $tabparam["MAIN_LANG_DEFAULT"] = ''; } if (GETPOST("check_SIZE_LISTE_LIMIT") == "on") { - $tabparam["MAIN_SIZE_LISTE_LIMIT"] = $_POST["main_size_liste_limit"]; + $tabparam["MAIN_SIZE_LISTE_LIMIT"] = GETPOST("main_size_liste_limit", 'int'); } else { $tabparam["MAIN_SIZE_LISTE_LIMIT"] = ''; } if (GETPOST("check_AGENDA_DEFAULT_VIEW") == "on") { - $tabparam["AGENDA_DEFAULT_VIEW"] = $_POST["AGENDA_DEFAULT_VIEW"]; + $tabparam["AGENDA_DEFAULT_VIEW"] = GETPOST("AGENDA_DEFAULT_VIEW", 'aZ09'); } else { $tabparam["AGENDA_DEFAULT_VIEW"] = ''; } if (GETPOST("check_MAIN_THEME") == "on") { - $tabparam["MAIN_THEME"] = $_POST["main_theme"]; + $tabparam["MAIN_THEME"] = GETPOST('main_theme', 'aZ09'); } else { $tabparam["MAIN_THEME"] = ''; } - $val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1'), array())))); + $val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1', 'alphanohtml'), array())))); if ($val == '') { $tabparam['THEME_ELDY_TOPMENU_BACK1'] = ''; } else { $tabparam['THEME_ELDY_TOPMENU_BACK1'] = join(',', - colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1'), array())); + colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1', 'alphanohtml'), array())); } - $val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1'), array())))); + $val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1', 'alphanohtml'), array())))); if ($val == '') { $tabparam['THEME_ELDY_BACKTITLE1'] = ''; } else { $tabparam['THEME_ELDY_BACKTITLE1'] = join(',', - colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1'), array())); + colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1', 'alphanohtml'), array())); } if (GETPOST('check_THEME_ELDY_USE_HOVER') == 'on') { @@ -153,7 +153,7 @@ if (empty($reshook)) { } if (GETPOST('MAIN_OPTIMIZEFORCOLORBLIND')) { - $tabparam["MAIN_OPTIMIZEFORCOLORBLIND"] = GETPOST('MAIN_OPTIMIZEFORCOLORBLIND'); + $tabparam["MAIN_OPTIMIZEFORCOLORBLIND"] = GETPOST('MAIN_OPTIMIZEFORCOLORBLIND', 'aZ09'); } else { $tabparam["MAIN_OPTIMIZEFORCOLORBLIND"] = 0; } From 5b87b12e64d88898279bd830ee3cccd30a373b96 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 16 Feb 2020 18:06:25 +0100 Subject: [PATCH 302/306] FIX Vulnerability reported by code16 --- htdocs/admin/dict.php | 50 +++++++++++++++++++++++-------- htdocs/admin/mails_templates.php | 51 ++++++++++++++++++++++---------- htdocs/filefunc.inc.php | 4 ++- 3 files changed, 77 insertions(+), 28 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index d634f547ff9..314a4e61954 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -753,20 +753,33 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $i = 0; foreach ($listfieldinsert as $f => $value) { + $keycode = $listfieldvalue[$i]; + if (empty($keycode)) $keycode = $value; + if ($value == 'price' || preg_match('/^amount/i', $value) || $value == 'taux') { - $_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]], 'MU'); + $_POST[$keycode] = price2num($_POST[$keycode], 'MU'); } elseif ($value == 'entity') { - $_POST[$listfieldvalue[$i]] = getEntity($tabname[$id]); + $_POST[$keycode] = getEntity($tabname[$id]); } + if ($i) $sql .= ","; - if ($listfieldvalue[$i] == 'sortorder') // For column name 'sortorder', we use the field name 'position' + if ($keycode == 'sortorder') // For column name 'sortorder', we use the field name 'position' { - $sql .= "'".(int) $db->escape(GETPOST('position'))."'"; + $sql .= "'".(int) GETPOST('position', 'int'); } - elseif ($_POST[$listfieldvalue[$i]] == '' && !($listfieldvalue[$i] == 'code' && $id == 10)) $sql .= "null"; // For vat, we want/accept code = '' - else $sql .= "'".$db->escape(GETPOST($listfieldvalue[$i], 'nohtml'))."'"; + elseif ($_POST[$keycode] == '' && !($keycode == 'code' && $id == 10)) $sql .= "null"; // For vat, we want/accept code = '' + elseif ($keycode == 'content') { + $sql .= "'".$db->escape(GETPOST($keycode, 'restricthtml'))."'"; + } + elseif (in_array($keycode, array('joinfile', 'private', 'position', 'scale'))) { + $sql .= (int) GETPOST($keycode, 'int'); + } + else { + $sql .= "'".$db->escape(GETPOST($keycode, 'nohtml'))."'"; + } + $i++; } $sql .= ",1)"; @@ -806,23 +819,36 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $i = 0; foreach ($listfieldmodify as $field) { + $keycode = $listfieldvalue[$i]; + if (empty($keycode)) $keycode = $field; + if ($field == 'price' || preg_match('/^amount/i', $field) || $field == 'taux') { - $_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]], 'MU'); + $_POST[$keycode] = price2num($_POST[$keycode], 'MU'); } elseif ($field == 'entity') { - $_POST[$listfieldvalue[$i]] = getEntity($tabname[$id]); + $_POST[$keycode] = getEntity($tabname[$id]); } + if ($i) $sql .= ","; $sql .= $field."="; if ($listfieldvalue[$i] == 'sortorder') // For column name 'sortorder', we use the field name 'position' { - $sql .= "'".(int) $db->escape($_POST['position'])."'"; + $sql .= (int) GETPOST('position', 'int'); } - elseif ($_POST[$listfieldvalue[$i]] == '' && !($listfieldvalue[$i] == 'code' && $id == 10)) $sql .= "null"; // For vat, we want/accept code = '' - else $sql .= "'".$db->escape($_POST[$listfieldvalue[$i]])."'"; + elseif ($_POST[$keycode] == '' && !($keycode == 'code' && $id == 10)) $sql .= "null"; // For vat, we want/accept code = '' + elseif ($keycode == 'content') { + $sql .= "'".$db->escape(GETPOST($keycode, 'restricthtml'))."'"; + } + elseif (in_array($keycode, array('private', 'position', 'scale'))) { + $sql .= (int) GETPOST($keycode, 'int'); + } + else { + $sql .= "'".$db->escape(GETPOST($keycode, 'nohtml'))."'"; + } + $i++; } - $sql .= " WHERE ".$rowidcol." = '".$db->escape($rowid)."'"; + $sql .= " WHERE ".$rowidcol." = ".(int) $db->escape($rowid); if (in_array('entity', $listfieldmodify)) $sql .= " AND entity = '".getEntity($tabname[$id])."'"; dol_syslog("actionmodify", LOG_DEBUG); diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index bb5fd72ec29..3aa5927af63 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -58,6 +58,8 @@ $search_topic = GETPOST('search_topic', 'alpha'); if (!empty($user->socid)) accessforbidden(); +$acts = array(); +$actl = array(); $acts[0] = "activate"; $acts[1] = "disable"; $actl[0] = img_picto($langs->trans("Disabled"), 'switch_off'); @@ -261,28 +263,39 @@ if (empty($reshook)) $i = 0; foreach ($listfieldinsert as $f => $value) { - //var_dump($i.' - '.$listfieldvalue[$i].' - '.$_POST[$listfieldvalue[$i]].' - '.$value); $keycode = $listfieldvalue[$i]; - if ($value == 'label') $_POST[$keycode] = dol_escape_htmltag($_POST[$keycode]); if ($value == 'lang') $keycode = 'langcode'; + if (empty($keycode)) $keycode = $value; + if ($value == 'entity') $_POST[$keycode] = $conf->entity; - if ($i) $sql .= ","; if ($value == 'fk_user' && !($_POST[$keycode] > 0)) $_POST[$keycode] = ''; if ($value == 'private' && !is_numeric($_POST[$keycode])) $_POST[$keycode] = '0'; if ($value == 'position' && !is_numeric($_POST[$keycode])) $_POST[$keycode] = '1'; - if ($_POST[$keycode] == '' && $keycode != 'langcode') $sql .= "null"; // lang must be '' if not defined so the unique key that include lang will work - elseif ($_POST[$keycode] == '0' && $keycode == 'langcode') $sql .= "''"; // lang must be '' if not defined so the unique key that include lang will work - else $sql .= "'".$db->escape($_POST[$keycode])."'"; + //var_dump($keycode.' '.$value); + + if ($i) $sql .= ", "; + if (GETPOST($keycode) == '' && $keycode != 'langcode') $sql .= "null"; // langcode must be '' if not defined so the unique key that include lang will work + elseif (GETPOST($keycode) == '0' && $keycode == 'langcode') $sql .= "''"; // langcode must be '' if not defined so the unique key that include lang will work + elseif ($keycode == 'content') { + $sql .= "'".$db->escape(GETPOST($keycode, 'restricthtml'))."'"; + } + elseif (in_array($keycode, array('joinfile', 'private', 'position', 'scale'))) { + $sql .= (int) GETPOST($keycode, 'int'); + } + else { + $sql .= "'".$db->escape(GETPOST($keycode, 'nohtml'))."'"; + } + $i++; } - $sql .= ",1)"; + $sql .= ", 1)"; dol_syslog("actionadd", LOG_DEBUG); $result = $db->query($sql); if ($result) // Add is ok { setEventMessages($langs->transnoentities("RecordSaved"), null, 'mesgs'); - $_POST = array('id'=>$id); // Clean $_POST array, we keep only + $_POST = array('id'=>$id); // Clean $_POST array, we keep only id } else { @@ -308,6 +321,7 @@ if (empty($reshook)) { $keycode = $listfieldvalue[$i]; if ($field == 'lang') $keycode = 'langcode'; + if (empty($keycode)) $keycode = $field; if ($field == 'fk_user' && !($_POST['fk_user'] > 0)) $_POST['fk_user'] = ''; if ($field == 'topic') $_POST['topic'] = $_POST['topic-'.$rowid]; @@ -315,15 +329,22 @@ if (empty($reshook)) if ($field == 'content') $_POST['content'] = $_POST['content-'.$rowid]; if ($field == 'content_lines') $_POST['content_lines'] = $_POST['content_lines-'.$rowid]; if ($field == 'entity') $_POST[$keycode] = $conf->entity; - if ($i) $sql .= ","; + + if ($i) $sql .= ", "; $sql .= $field."="; - //print $keycode.' - '.$_POST[$keycode].'
    '; - if ($_POST[$keycode] == '' || ($keycode != 'langcode' && $keycode != 'position' && $keycode != 'private' && empty($_POST[$keycode]))) $sql .= "null"; // lang must be '' if not defined so the unique key that include lang will work - elseif ($_POST[$keycode] == '0' && $keycode == 'langcode') $sql .= "''"; // lang must be '' if not defined so the unique key that include lang will work - elseif ($keycode == 'private') $sql .= ((int) $_POST[$keycode]); // private must be 0 or 1 - elseif ($keycode == 'position') $sql .= ((int) $_POST[$keycode]); - else $sql .= "'".$db->escape($_POST[$keycode])."'"; + if (GETPOST($keycode) == '' || ($keycode != 'langcode' && $keycode != 'position' && $keycode != 'private' && ! GETPOST($keycode))) $sql .= "null"; // langcode,... must be '' if not defined so the unique key that include lang will work + elseif (GETPOST($keycode) == '0' && $keycode == 'langcode') $sql .= "''"; // langcode must be '' if not defined so the unique key that include lang will work + elseif ($keycode == 'content') { + $sql .= "'".$db->escape(GETPOST($keycode, 'restricthtml'))."'"; + } + elseif (in_array($keycode, array('joinfile', 'private', 'position', 'scale'))) { + $sql .= (int) GETPOST($keycode, 'int'); + } + else { + $sql .= "'".$db->escape(GETPOST($keycode, 'nohtml'))."'"; + } + $i++; } $sql .= " WHERE ".$rowidcol." = '".$rowid."'"; diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index a498c933d4b..01245a466cc 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -165,7 +165,9 @@ if (! defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck)) if ($csrfattack) { //print 'NOCSRFCHECK='.defined('NOCSRFCHECK').' REQUEST_METHOD='.$_SERVER['REQUEST_METHOD'].' HTTP_HOST='.$_SERVER['HTTP_HOST'].' HTTP_REFERER='.$_SERVER['HTTP_REFERER']; - print "Access refused by CSRF protection in main.inc.php. Referer of form (".$_SERVER['HTTP_REFERER'].") is outside the server that serve this page (with method = ".$_SERVER['REQUEST_METHOD'].").\n"; + + // Note: We can't use dol_escape_htmltag here to escape output because lib functions.lib.ph is not yet loaded. + print "Access refused by CSRF protection in main.inc.php. Referer of form (".htmlentities($_SERVER['HTTP_REFERER'], ENT_COMPAT, 'UTF-8').") is outside the server that serve this page (with method = ".htmlentities($_SERVER['REQUEST_METHOD'], ENT_COMPAT, 'UTF-8').").\n"; print "If you access your server behind a proxy using url rewriting, you might check that all HTTP headers are propagated (or add the line \$dolibarr_nocsrfcheck=1 into your conf.php file to remove this security check).\n"; die; } From ac7a077c77b6c6b922225ec0d47120b886898196 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 16 Feb 2020 18:14:10 +0100 Subject: [PATCH 303/306] FIX Vulnerability in module from modulebuilder. Only fields with type html can contains HTML. --- htdocs/core/actions_addupdatedelete.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index 59606ee65b5..ebc8e48d742 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -76,7 +76,7 @@ if ($action == 'add' && !empty($permissiontoadd)) } elseif (preg_match('/^(integer|price|real|double)/', $object->fields[$key]['type'])) { $value = price2num(GETPOST($key, 'none')); // To fix decimal separator according to lang setup } else { - $value = GETPOST($key, 'alpha'); + $value = GETPOST($key, 'alphanohtml'); } if (preg_match('/^integer:/i', $object->fields[$key]['type']) && $value == '-1') $value = ''; // This is an implicit foreign key field if (!empty($object->fields[$key]['foreignkey']) && $value == '-1') $value = ''; // This is an explicit foreign key field From f4f3efec62060d224f2be2254cbebcf25f8d60b4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 16 Feb 2020 19:33:58 +0100 Subject: [PATCH 304/306] Fight against $_POST --- ChangeLog | 5 ++- htdocs/accountancy/admin/accountmodel.php | 8 ++--- htdocs/accountancy/admin/categories_list.php | 2 +- htdocs/accountancy/admin/journals_list.php | 4 +-- htdocs/adherents/subscription/card.php | 2 +- htdocs/adherents/type.php | 2 +- htdocs/admin/dict.php | 6 ++-- htdocs/admin/events.php | 3 +- htdocs/admin/fckeditor.php | 7 ---- htdocs/admin/ldap_groups.php | 14 ++++---- htdocs/admin/menus/edit.php | 10 +++--- htdocs/admin/oauthlogintokens.php | 13 ++++++-- htdocs/admin/security_other.php | 4 +-- htdocs/admin/sms.php | 29 +++++++++-------- htdocs/admin/spip.php | 16 ++++++---- htdocs/admin/supplier_invoice.php | 2 +- htdocs/admin/supplier_order.php | 2 +- htdocs/admin/website.php | 2 +- htdocs/asset/type.php | 32 +++---------------- htdocs/bom/tpl/objectline_create.tpl.php | 2 +- htdocs/cashdesk/tpl/facturation1.tpl.php | 2 +- htdocs/compta/facture/card.php | 4 +-- htdocs/core/class/commonobject.class.php | 2 +- htdocs/core/class/coreobject.class.php | 12 +++---- htdocs/core/lib/functions.lib.php | 3 +- htdocs/core/login/functions_googleoauth.php | 2 +- htdocs/core/login/functions_openid.php | 2 +- htdocs/don/payment/payment.php | 4 +-- htdocs/expedition/card.php | 8 ++--- .../class/expensereport_ik.class.php | 2 +- .../class/expensereport_rule.class.php | 2 +- htdocs/exports/export.php | 6 ++-- htdocs/fourn/commande/dispatch.php | 2 +- htdocs/langs/en_US/oauth.lang | 2 ++ htdocs/main.inc.php | 1 + htdocs/master.inc.php | 2 +- .../mailinglist_mymodule_myobject.modules.php | 2 +- htdocs/product/admin/dynamic_prices.php | 16 +++++----- htdocs/product/card.php | 2 +- htdocs/societe/paymentmodes.php | 2 +- htdocs/variants/ajax/orderAttribute.php | 3 +- 41 files changed, 117 insertions(+), 129 deletions(-) diff --git a/ChangeLog b/ChangeLog index abc660739cf..cdcef2d4e4f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15,7 +15,10 @@ WARNING: Following changes may create regressions for some external modules, but were necessary to make Dolibarr better: * PHP 5.5 is no more supported. Minimum PHP is now 5.6+. - +* Default mode for GETPOST function is now 'alphanohtml' instead of 'none'. So check when you make POST or GET requests + with HTML content that you make a GETPOST('myparam', 'restricthtml') or GETPOST('myparam', 'none') if you really need posted content without sanitizing + the HTML into content (in such a case, sanitize data later) + ***** ChangeLog for 11.0.1 compared to 11.0.0 ***** diff --git a/htdocs/accountancy/admin/accountmodel.php b/htdocs/accountancy/admin/accountmodel.php index 2e39105eb21..da23d3cc33b 100644 --- a/htdocs/accountancy/admin/accountmodel.php +++ b/htdocs/accountancy/admin/accountmodel.php @@ -157,7 +157,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) foreach ($listfield as $f => $value) { if ($value == 'country_id' && in_array($tablib[$id], array('Pcg_version'))) continue; // For some pages, country is not mandatory - if ((! isset($_POST[$value]) || $_POST[$value]=='')) + if ((! GETPOSTISSET($value)) || GETPOST($value) == '') { $ok=0; $fieldnamekey=$listfield[$f]; @@ -170,13 +170,13 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) } } // Other checks - if ($tabname[$id] == MAIN_DB_PREFIX."c_actioncomm" && isset($_POST["type"]) && in_array($_POST["type"], array('system','systemauto'))) { + if ($tabname[$id] == MAIN_DB_PREFIX."c_actioncomm" && GETPOSTISSET("type") && in_array($_POST["type"], array('system','systemauto'))) { $ok=0; setEventMessages($langs->transnoentities('ErrorReservedTypeSystemSystemAuto'), null, 'errors'); } - if (isset($_POST["pcg_version"])) + if (GETPOSTISSET("pcg_version")) { - if ($_POST["pcg_version"]=='0') + if (GETPOST("pcg_version") == '0') { $ok=0; setEventMessages($langs->transnoentities('ErrorCodeCantContainZero'), null, 'errors'); diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php index dbe20bba99d..2924feb58eb 100644 --- a/htdocs/accountancy/admin/categories_list.php +++ b/htdocs/accountancy/admin/categories_list.php @@ -153,7 +153,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) if ($value == 'formula' && empty($_POST['formula'])) continue; if ($value == 'range_account' && empty($_POST['range_account'])) continue; if ($value == 'country' || $value == 'country_id') continue; - if (!isset($_POST[$value]) || $_POST[$value] == '') + if (! GETPOSTISSET($value) || GETPOST($value) == '') { $ok = 0; $fieldnamekey = $listfield[$f]; diff --git a/htdocs/accountancy/admin/journals_list.php b/htdocs/accountancy/admin/journals_list.php index 62313faa2f2..e47fba72756 100644 --- a/htdocs/accountancy/admin/journals_list.php +++ b/htdocs/accountancy/admin/journals_list.php @@ -165,9 +165,9 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) if ($fieldnamekey == 'nature') $fieldnamekey = 'NatureOfJournal'; } // Other checks - if (isset($_POST["code"])) + if (GETPOSTISSET("code")) { - if ($_POST["code"] == '0') + if (GETPOST("code") == '0') { $ok = 0; setEventMessages($langs->transnoentities('ErrorCodeCantContainZero'), null, 'errors'); diff --git a/htdocs/adherents/subscription/card.php b/htdocs/adherents/subscription/card.php index 57c50e1b6b3..02941cb9967 100644 --- a/htdocs/adherents/subscription/card.php +++ b/htdocs/adherents/subscription/card.php @@ -214,7 +214,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'edit') // Type print '
    '.$langs->trans("Type").''; - print $form->selectarray("typeid", $adht->liste_array(), (isset($_POST["typeid"]) ? $_POST["typeid"] : $object->fk_type)); + print $form->selectarray("typeid", $adht->liste_array(), (GETPOSTISSET("typeid") ? GETPOST("typeid") : $object->fk_type)); print'
    '.$langs->trans("MemberNature").''; - print $form->selectarray("morphy", $morphys, isset($_POST["morphy"]) ? $_POST["morphy"] : $object->morphy); + print $form->selectarray("morphy", $morphys, GETPOSTISSET("morphy") ? GETPOST("morphy") : $object->morphy); print "
    '.$langs->trans("SubscriptionRequired").''; diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 314a4e61954..925688abba5 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -678,9 +678,9 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $ok = 0; setEventMessages($langs->transnoentities('ErrorReservedTypeSystemSystemAuto'), null, 'errors'); } - if (isset($_POST["code"])) + if (GETPOSTISSET("code")) { - if ($_POST["code"] == '0') + if (GETPOST("code") == '0') { $ok = 0; setEventMessages($langs->transnoentities('ErrorCodeCantContainZero'), null, 'errors'); @@ -691,7 +691,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'
    '; }*/ } - if (isset($_POST["country"]) && ($_POST["country"] == '0') && ($id != 2)) + if (GETPOSTISSET("country") && ($_POST["country"] == '0') && ($id != 2)) { if (in_array($tablib[$id], array('DictionaryCompanyType', 'DictionaryHolidayTypes'))) // Field country is no mandatory for such dictionaries { diff --git a/htdocs/admin/events.php b/htdocs/admin/events.php index 9265604f427..66794cd4210 100644 --- a/htdocs/admin/events.php +++ b/htdocs/admin/events.php @@ -53,8 +53,7 @@ if ($action == "save") foreach ($eventstolog as $key => $arr) { $param='MAIN_LOGEVENTS_'.$arr['id']; - //print "param=".$param." - ".$_POST[$param]; - if (! empty($_POST[$param])) dolibarr_set_const($db, $param, $_POST[$param], 'chaine', 0, '', $conf->entity); + if (GETPOST($param, 'alphanohtml')) dolibarr_set_const($db, $param, GETPOST($param, 'alphanohtml'), 'chaine', 0, '', $conf->entity); else dolibarr_del_const($db, $param, $conf->entity); } diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index efe8ca1117d..6f2ad22015d 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -239,13 +239,6 @@ else jsdump(CKEDITOR.env, "divforlog"); '; } - - /* - print ''; - print $_POST["formtestfield"]; - print ''; - print $conf->global->FCKEDITOR_TEST; - */ } // End of page diff --git a/htdocs/admin/ldap_groups.php b/htdocs/admin/ldap_groups.php index 194475ab32c..fb49c947411 100644 --- a/htdocs/admin/ldap_groups.php +++ b/htdocs/admin/ldap_groups.php @@ -51,14 +51,14 @@ if ($action == 'setvalue' && $user->admin) $error = 0; $db->begin(); - if (!dolibarr_set_const($db, 'LDAP_GROUP_DN', GETPOST("group"), 'chaine', 0, '', $conf->entity)) $error++; - if (!dolibarr_set_const($db, 'LDAP_GROUP_OBJECT_CLASS', GETPOST("objectclass"), 'chaine', 0, '', $conf->entity)) $error++; + if (!dolibarr_set_const($db, 'LDAP_GROUP_DN', GETPOST("group", 'alphanohtml'), 'chaine', 0, '', $conf->entity)) $error++; + if (!dolibarr_set_const($db, 'LDAP_GROUP_OBJECT_CLASS', GETPOST("objectclass", 'alphanohtml'), 'chaine', 0, '', $conf->entity)) $error++; - if (!dolibarr_set_const($db, 'LDAP_GROUP_FIELD_FULLNAME', GETPOST("fieldfullname"), 'chaine', 0, '', $conf->entity)) $error++; - //if (! dolibarr_set_const($db, 'LDAP_GROUP_FIELD_NAME',$_POST["fieldname"],'chaine',0,'',$conf->entity)) $error++; - if (!dolibarr_set_const($db, 'LDAP_GROUP_FIELD_DESCRIPTION', GETPOST("fielddescription"), 'chaine', 0, '', $conf->entity)) $error++; - if (!dolibarr_set_const($db, 'LDAP_GROUP_FIELD_GROUPMEMBERS', GETPOST("fieldgroupmembers"), 'chaine', 0, '', $conf->entity)) $error++; - if (!dolibarr_set_const($db, 'LDAP_GROUP_FIELD_GROUPID', GETPOST("fieldgroupid"), 'chaine', 0, '', $conf->entity)) $error++; + if (!dolibarr_set_const($db, 'LDAP_GROUP_FIELD_FULLNAME', GETPOST("fieldfullname", 'alphanohtml'), 'chaine', 0, '', $conf->entity)) $error++; + //if (! dolibarr_set_const($db, 'LDAP_GROUP_FIELD_NAME',GETPOST("fieldname", 'alphanohtml'),'chaine',0,'',$conf->entity)) $error++; + if (!dolibarr_set_const($db, 'LDAP_GROUP_FIELD_DESCRIPTION', GETPOST("fielddescription", 'alphanohtml'), 'chaine', 0, '', $conf->entity)) $error++; + if (!dolibarr_set_const($db, 'LDAP_GROUP_FIELD_GROUPMEMBERS', GETPOST("fieldgroupmembers", 'alphanohtml'), 'chaine', 0, '', $conf->entity)) $error++; + if (!dolibarr_set_const($db, 'LDAP_GROUP_FIELD_GROUPID', GETPOST("fieldgroupid", 'alphanohtml'), 'chaine', 0, '', $conf->entity)) $error++; // This one must be after the others $valkey = ''; diff --git a/htdocs/admin/menus/edit.php b/htdocs/admin/menus/edit.php index f82c423d438..cd27ef7b6dc 100644 --- a/htdocs/admin/menus/edit.php +++ b/htdocs/admin/menus/edit.php @@ -31,6 +31,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php'; // Load translation files required by the page $langs->loadLangs(array("other", "admin")); +$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button + if (!$user->admin) accessforbidden(); $dirstandard = array(); @@ -64,12 +66,12 @@ if (GETPOST("menu_handler")) $menu_handler = GETPOST("menu_handler"); if ($action == 'update') { - if (!$_POST['cancel']) + if (! $cancel) { $leftmenu = ''; $mainmenu = ''; - if (!empty($_POST['menuIdParent']) && !is_numeric($_POST['menuIdParent'])) + if (GETPOST('menuIdParent', 'alpha') && !is_numeric(GETPOST('menuIdParent', 'alpha'))) { - $tmp = explode('&', $_POST['menuIdParent']); + $tmp = explode('&', GETPOST('menuIdParent', 'alpha')); foreach ($tmp as $s) { if (preg_match('/fk_mainmenu=/', $s)) @@ -138,7 +140,7 @@ if ($action == 'update') if ($action == 'add') { - if ($_POST['cancel']) + if ($cancel) { header("Location: ".DOL_URL_ROOT."/admin/menus/index.php?menu_handler=".$menu_handler); exit; diff --git a/htdocs/admin/oauthlogintokens.php b/htdocs/admin/oauthlogintokens.php index ca75eee69ef..7b74016207b 100644 --- a/htdocs/admin/oauthlogintokens.php +++ b/htdocs/admin/oauthlogintokens.php @@ -59,9 +59,18 @@ if ($action == 'setconst' && $user->admin) { $error = 0; $db->begin(); - foreach ($_POST['setupdriver'] as $setupconst) { + + $setupconstarray = GETPOST('setupdriver', 'array'); + + foreach ($setupconstarray as $setupconst) { //print '
    '.print_r($setupconst, true).'
    '; - $result = dolibarr_set_const($db, $setupconst['varname'], $setupconst['value'], 'chaine', 0, '', $conf->entity); + + $constname = dol_escape_htmltag($setupconst['varname']); + $constvalue = dol_escape_htmltag($setupconst['value']); + $consttype = dol_escape_htmltag($setupconst['type']); + $constnote = dol_escape_htmltag($setupconst['note']); + + $result = dolibarr_set_const($db, $constname, $constvalue, $consttype, 0, $constnote, $conf->entity); if (!$result > 0) $error++; } diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php index e85853541de..07891630c1a 100644 --- a/htdocs/admin/security_other.php +++ b/htdocs/admin/security_other.php @@ -70,8 +70,8 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) elseif ($action == 'updateform') { - $res1=dolibarr_set_const($db, "MAIN_APPLICATION_TITLE", $_POST["MAIN_APPLICATION_TITLE"], 'chaine', 0, '', $conf->entity); - $res2=dolibarr_set_const($db, "MAIN_SESSION_TIMEOUT", $_POST["MAIN_SESSION_TIMEOUT"], 'chaine', 0, '', $conf->entity); + $res1=dolibarr_set_const($db, "MAIN_APPLICATION_TITLE", GETPOST("MAIN_APPLICATION_TITLE", 'alphanohtml'), 'chaine', 0, '', $conf->entity); + $res2=dolibarr_set_const($db, "MAIN_SESSION_TIMEOUT", GETPOST("MAIN_SESSION_TIMEOUT", 'alphanohtml'), 'chaine', 0, '', $conf->entity); if ($res1 && $res2) setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs'); } diff --git a/htdocs/admin/sms.php b/htdocs/admin/sms.php index b725a2e50ae..4a70104158b 100644 --- a/htdocs/admin/sms.php +++ b/htdocs/admin/sms.php @@ -28,6 +28,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; // Load translation files required by the page $langs->loadLangs(array("companies", "admin", "products", "sms", "other", "errors")); +$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button + if (!$user->admin) accessforbidden(); @@ -46,14 +48,13 @@ $action = GETPOST('action', 'aZ09'); * Actions */ -if ($action == 'update' && empty($_POST["cancel"])) +if ($action == 'update' && !$cancel) { - dolibarr_set_const($db, "MAIN_DISABLE_ALL_SMS", $_POST["MAIN_DISABLE_ALL_SMS"], 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_DISABLE_ALL_SMS", GETPOST("MAIN_DISABLE_ALL_SMS", 'alphanohtml'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_SMS_SENDMODE", $_POST["MAIN_SMS_SENDMODE"], 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_SMS_SENDMODE", GETPOST("MAIN_SMS_SENDMODE", 'alphahtml'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_SMS_FROM", $_POST["MAIN_MAIL_SMS_FROM"], 'chaine', 0, '', $conf->entity); - //dolibarr_set_const($db, "MAIN_MAIL_AUTOCOPY_TO", $_POST["MAIN_MAIL_AUTOCOPY_TO"], 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_SMS_FROM", GETPOST("MAIN_MAIL_SMS_FROM", 'alphanohtml'), 'chaine', 0, '', $conf->entity); header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); exit; @@ -68,15 +69,15 @@ if ($action == 'send' && !$_POST['cancel']) $error = 0; $smsfrom = ''; - if (!empty($_POST["fromsms"])) $smsfrom = GETPOST("fromsms"); - if (empty($smsfrom)) $smsfrom = GETPOST("fromname"); - $sendto = GETPOST("sendto"); - $body = GETPOST('message'); - $deliveryreceipt = GETPOST("deliveryreceipt"); - $deferred = GETPOST('deferred'); - $priority = GETPOST('priority'); - $class = GETPOST('class'); - $errors_to = GETPOST("errorstosms"); + if (!empty($_POST["fromsms"])) $smsfrom = GETPOST("fromsms", 'alphanohtml'); + if (empty($smsfrom)) $smsfrom = GETPOST("fromname", 'alphanohtml'); + $sendto = GETPOST("sendto", 'alphanohtml'); + $body = GETPOST('message', 'alphanohtml'); + $deliveryreceipt = GETPOST("deliveryreceipt", 'alphanohtml'); + $deferred = GETPOST('deferred', 'alphanohtml'); + $priority = GETPOST('priority', 'alphanohtml'); + $class = GETPOST('class', 'alphanohtml'); + $errors_to = GETPOST("errorstosms", 'alphanohtml'); // Create form object include_once DOL_DOCUMENT_ROOT.'/core/class/html.formsms.class.php'; diff --git a/htdocs/admin/spip.php b/htdocs/admin/spip.php index 5b5bf692e22..d33728286e9 100644 --- a/htdocs/admin/spip.php +++ b/htdocs/admin/spip.php @@ -50,18 +50,20 @@ $action = GETPOST('action', 'aZ09'); // Action mise a jour ou ajout d'une constante if ($action == 'update' || $action == 'add') { - $constname=GETPOST("constname"); - $constvalue=GETPOST("constvalue"); + $constnamearray = GETPOST("constname", 'array'); + $constvaluearray = GETPOST("constvalue", 'array'); + $consttypearray = GETPOST("consttype", 'array'); + $constnotearray = GETPOST("constnote", 'array'); // Action mise a jour ou ajout d'une constante if ($action == 'update' || $action == 'add') { - foreach($_POST['constname'] as $key => $val) + foreach($constnamearray as $key => $val) { - $constname=$_POST["constname"][$key]; - $constvalue=$_POST["constvalue"][$key]; - $consttype=$_POST["consttype"][$key]; - $constnote=$_POST["constnote"][$key]; + $constname = dol_escape_htmltag($constnamearray[$key]); + $constvalue = dol_escape_htmltag($constvaluearray[$key]); + $consttype = dol_escape_htmltag($consttypearray[$key]); + $constnote = dol_escape_htmltag($constnotearray[$key]); $res=dolibarr_set_const($db, $constname, $constvalue, $type[$consttype], 0, $constnote, $conf->entity); diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php index 9a17916cb49..977b99d0c99 100644 --- a/htdocs/admin/supplier_invoice.php +++ b/htdocs/admin/supplier_invoice.php @@ -171,7 +171,7 @@ if ($action == 'setmod') if ($action == 'addcat') { $fourn = new Fournisseur($db); - $fourn->CreateCategory($user, $_POST["cat"]); + $fourn->CreateCategory($user, GETPOST('cat', 'alphanohtml')); } if ($action == 'set_SUPPLIER_INVOICE_FREE_TEXT') diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index 1b6b6eb9921..db9b3e257f6 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -165,7 +165,7 @@ elseif ($action == 'setmod') elseif ($action == 'addcat') { $fourn = new Fournisseur($db); - $fourn->CreateCategory($user, $_POST["cat"]); + $fourn->CreateCategory($user, GETPOST('cat', 'alphanohtml')); } elseif ($action == 'set_SUPPLIER_ORDER_OTHER') diff --git a/htdocs/admin/website.php b/htdocs/admin/website.php index d639b8d2a9b..689b65cc954 100644 --- a/htdocs/admin/website.php +++ b/htdocs/admin/website.php @@ -132,7 +132,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) $ok=1; foreach ($listfield as $f => $value) { - if ($value == 'ref' && (! isset($_POST[$value]) || $_POST[$value]=='')) + if ($value == 'ref' && (! GETPOSTISSET($value) || GETPOST($value) == '')) { $ok=0; $fieldnamekey=$listfield[$f]; diff --git a/htdocs/asset/type.php b/htdocs/asset/type.php index 9f5f8597663..542dbc8e23d 100644 --- a/htdocs/asset/type.php +++ b/htdocs/asset/type.php @@ -609,37 +609,15 @@ if ($rowid > 0) print $object->showOptionals($extrafields, 'edit', $parameters); } - print '
    '; + // Other attributes + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php'; - // Extra field - if (empty($reshook)) - { - print '

    '; - foreach ($extrafields->attributes[$object->element]['label'] as $key=>$label) - { - if (isset($_POST["options_".$key])) { - if (is_array($_POST["options_".$key])) { - // $_POST["options"] is an array but following code expects a comma separated string - $value = implode(",", $_POST["options_".$key]); - } else { - $value = $_POST["options_".$key]; - } - } else { - $value = $adht->array_options["options_".$key]; - } - print '\n"; - } - print '
    '.$label.''; - print $extrafields->showInputField($key, $value); - print "


    '; - } + print '
    '; dol_fiche_end(); - print '
    '; - print ''; - print '     '; - print ''; + print '
    '; + print '   '; print '
    '; print ""; diff --git a/htdocs/bom/tpl/objectline_create.tpl.php b/htdocs/bom/tpl/objectline_create.tpl.php index 7f3072d8051..c99e57bcff3 100644 --- a/htdocs/bom/tpl/objectline_create.tpl.php +++ b/htdocs/bom/tpl/objectline_create.tpl.php @@ -109,7 +109,7 @@ if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) } $coldisplay++; -print ''; +print ''; print ''; if ($conf->global->PRODUCT_USE_UNITS) diff --git a/htdocs/cashdesk/tpl/facturation1.tpl.php b/htdocs/cashdesk/tpl/facturation1.tpl.php index f3b76cbaed6..b543abefb8b 100644 --- a/htdocs/cashdesk/tpl/facturation1.tpl.php +++ b/htdocs/cashdesk/tpl/facturation1.tpl.php @@ -117,7 +117,7 @@ for ($i = 0; $i < $nbtoshow; $i++) $buyer = new Societe($db); if ($_SESSION["CASHDESK_ID_THIRDPARTY"] > 0) $buyer->fetch($_SESSION["CASHDESK_ID_THIRDPARTY"]); - echo $form->load_tva('selTva', (isset($_POST["selTva"])?GETPOST("selTva", 'alpha', 2):$vatrate), $mysoc, $buyer, 0, 0, '', false, -1); + echo $form->load_tva('selTva', (GETPOSTISSET("selTva") ? GETPOST("selTva", 'alpha', 2) : $vatrate), $mysoc, $buyer, 0, 0, '', false, -1); ?> diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 24567451840..5038079085b 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -3351,8 +3351,8 @@ if ($action == 'create') print ''; // Bank Account - if (isset($_POST['fk_account'])) { - $fk_account = $_POST['fk_account']; + if (GETPOSTISSET('fk_account')) { + $fk_account = GETPOST('fk_account'); } print ''.$langs->trans('BankAccount').''; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index f0bbe4867d7..c62d6d09273 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4967,7 +4967,7 @@ abstract class CommonObject global $conf, $_POST; // If param here has been posted, we use this value first. - if (isset($_POST[$fieldname])) return GETPOST($fieldname, 2); + if (GETPOSTISSET($fieldname)) return GETPOST($fieldname, 'alphanohtml', 3); if (isset($alternatevalue)) return $alternatevalue; diff --git a/htdocs/core/class/coreobject.class.php b/htdocs/core/class/coreobject.class.php index 672697cd0a3..82a644eabf2 100644 --- a/htdocs/core/class/coreobject.class.php +++ b/htdocs/core/class/coreobject.class.php @@ -416,24 +416,20 @@ class CoreObject extends CommonObject { foreach ($Tab as $key => $value) { - if($this->checkFieldType($key, 'date')) + if ($this->checkFieldType($key, 'date')) { $this->setDate($key, $value); } - elseif( $this->checkFieldType($key, 'array')) - { - $this->{$key} = $value; - } - elseif( $this->checkFieldType($key, 'float') ) + elseif ($this->checkFieldType($key, 'float')) { $this->{$key} = (double) price2num($value); } - elseif( $this->checkFieldType($key, 'int') ) { + elseif ($this->checkFieldType($key, 'int')) { $this->{$key} = (int) price2num($value); } else { - $this->{$key} = $value; + $this->{$key} = dol_string_nohtmltag($value); } } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 4985ab35b0d..eba330e5621 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -291,6 +291,7 @@ function GETPOSTISSET($paramname) * 'array'=check it's array * 'san_alpha'=Use filter_var with FILTER_SANITIZE_STRING (do not use this for free text string) * 'nohtml', 'alphanohtml'=check there is no html content + * 'restricthtml'=check html content is restricted to some tags only * 'custom'= custom filter specify $filter and $options) * @param int $method Type of method (0 = get then post, 1 = only get, 2 = only post, 3 = post then get) * @param int $filter Filter to apply when $check is set to 'custom'. (See http://php.net/manual/en/filter.filters.php for détails) @@ -298,7 +299,7 @@ function GETPOSTISSET($paramname) * @param string $noreplace Force disable of replacement of __xxx__ strings. * @return string|string[] Value found (string or array), or '' if check fails */ -function GETPOST($paramname, $check = 'none', $method = 0, $filter = null, $options = null, $noreplace = 0) +function GETPOST($paramname, $check = 'alphanohtml', $method = 0, $filter = null, $options = null, $noreplace = 0) { global $mysoc, $user, $conf; diff --git a/htdocs/core/login/functions_googleoauth.php b/htdocs/core/login/functions_googleoauth.php index 2f1fbcf3667..e621f41e562 100644 --- a/htdocs/core/login/functions_googleoauth.php +++ b/htdocs/core/login/functions_googleoauth.php @@ -48,7 +48,7 @@ function check_user_password_googleoauth($usertotest, $passwordtotest, $entityto $login = ''; // Get identity from user and redirect browser to Google OAuth Server - if (isset($_POST['username'])) + if (GETPOSTISSET('username')) { /*$openid = new SimpleOpenID(); $openid->SetIdentity($_POST['username']); diff --git a/htdocs/core/login/functions_openid.php b/htdocs/core/login/functions_openid.php index c20b2a32f90..87a8acfd800 100644 --- a/htdocs/core/login/functions_openid.php +++ b/htdocs/core/login/functions_openid.php @@ -43,7 +43,7 @@ function check_user_password_openid($usertotest, $passwordtotest, $entitytotest) $login=''; // Get identity from user and redirect browser to OpenID Server - if (isset($_POST['username'])) + if (GETPOSISSET('username')) { $openid = new SimpleOpenID(); $openid->SetIdentity($_POST['username']); diff --git a/htdocs/don/payment/payment.php b/htdocs/don/payment/payment.php index abdc35c850e..4992c9f8495 100644 --- a/htdocs/don/payment/payment.php +++ b/htdocs/don/payment/payment.php @@ -197,14 +197,14 @@ if ($action == 'create') print ''; print ''.$langs->trans("PaymentMode").''; - $form->select_types_paiements(isset($_POST["paymenttype"])?$_POST["paymenttype"]:$object->paymenttype, "paymenttype"); + $form->select_types_paiements(GETPOSTISSET("paymenttype") ? GETPOST("paymenttype") : $object->paymenttype, "paymenttype"); print "\n"; print ''; print ''; print ''.$langs->trans('AccountToCredit').''; print ''; - $form->select_comptes(isset($_POST["accountid"])?$_POST["accountid"]:$object->accountid, "accountid", 0, '', 1); // Show open bank account list + $form->select_comptes(GETPOSTISSET("accountid") ? GETPOST("accountid") : $object->accountid, "accountid", 0, '', 1); // Show open bank account list print ''; // Number diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 66b47ab563f..dde2b2f7f7b 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -241,11 +241,11 @@ if (empty($reshook)) if ($objectsrc->lines[$i]->product_tobatch) // If product need a batch number { - if (isset($_POST[$batch])) + if (GETPOSTISSET($batch)) { //shipment line with batch-enable product $qty .= '_'.$j; - while (isset($_POST[$batch])) + while (GETPOSTISSET($batch)) { // save line of detail into sub_qty $sub_qty[$j]['q'] = GETPOST($qty, 'int'); // the qty we want to move for this stock record @@ -277,11 +277,11 @@ if (empty($reshook)) } } } - elseif (isset($_POST[$stockLocation])) + elseif (GETPOSTISSET($stockLocation)) { //shipment line from multiple stock locations $qty .= '_'.$j; - while (isset($_POST[$stockLocation])) + while (GETPOSTISSET($stockLocation)) { // save sub line of warehouse $stockLine[$i][$j]['qty'] = GETPOST($qty, 'int'); diff --git a/htdocs/expensereport/class/expensereport_ik.class.php b/htdocs/expensereport/class/expensereport_ik.class.php index bac8522ca74..a62d033af2d 100644 --- a/htdocs/expensereport/class/expensereport_ik.class.php +++ b/htdocs/expensereport/class/expensereport_ik.class.php @@ -72,7 +72,7 @@ class ExpenseReportIk extends CoreObject * Attribute object linked with database * @var array */ - protected $fields=array( + public $fields=array( 'rowid'=>array('type'=>'integer','index'=>true) ,'fk_c_exp_tax_cat'=>array('type'=>'integer','index'=>true) ,'fk_range'=>array('type'=>'integer','index'=>true) diff --git a/htdocs/expensereport/class/expensereport_rule.class.php b/htdocs/expensereport/class/expensereport_rule.class.php index 9726184a94a..08538ac8f61 100644 --- a/htdocs/expensereport/class/expensereport_rule.class.php +++ b/htdocs/expensereport/class/expensereport_rule.class.php @@ -111,7 +111,7 @@ class ExpenseReportRule extends CoreObject * Attribute object linked with database * @var array */ - protected $fields=array( + public $fields=array( 'rowid'=>array('type'=>'integer','index'=>true) ,'dates'=>array('type'=>'date') ,'datee'=>array('type'=>'date') diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index c636dd292a7..a8bb8a68452 100644 --- a/htdocs/exports/export.php +++ b/htdocs/exports/export.php @@ -411,12 +411,12 @@ if ($step == 4 && $action == 'submitFormField') $newcode = (string) preg_replace('/\./', '_', $code); //print 'xxx'.$code."=".$newcode."=".$type."=".$_POST[$newcode]."\n
    "; $filterqualified = 1; - if (!isset($_POST[$newcode]) || $_POST[$newcode] == '') $filterqualified = 0; - elseif (preg_match('/^List/', $type) && (is_numeric($_POST[$newcode]) && $_POST[$newcode] <= 0)) $filterqualified = 0; + if (! GETPOSTISSET($newcode) || GETPOST($newcode, 'restricthtml') == '') $filterqualified = 0; + elseif (preg_match('/^List/', $type) && (is_numeric(GETPOST($newcode, 'restricthtml')) && GETPOST($newcode, 'restricthtml') <= 0)) $filterqualified = 0; if ($filterqualified) { //print 'Filter on '.$newcode.' type='.$type.' value='.$_POST[$newcode]."\n"; - $objexport->array_export_FilterValue[0][$code] = $_POST[$newcode]; + $objexport->array_export_FilterValue[0][$code] = GETPOST($newcode, 'restricthtml'); } } $array_filtervalue = (!empty($objexport->array_export_FilterValue[0]) ? $objexport->array_export_FilterValue[0] : ''); diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index eb9093888af..dd55bb36ffb 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -273,7 +273,7 @@ if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner) if (empty($conf->multicurrency->enabled) && empty($conf->dynamicprices->enabled)) { $dto = GETPOST("dto_".$reg[1].'_'.$reg[2]); //update supplier price - if (isset($_POST[$saveprice])) { + if (GETPOSTISSET($saveprice)) { // TODO Use class $sql = "UPDATE ".MAIN_DB_PREFIX."product_fournisseur_price"; $sql .= " SET unitprice='".GETPOST($pu)."'"; diff --git a/htdocs/langs/en_US/oauth.lang b/htdocs/langs/en_US/oauth.lang index ce02c4e23d8..d52422a194a 100644 --- a/htdocs/langs/en_US/oauth.lang +++ b/htdocs/langs/en_US/oauth.lang @@ -28,3 +28,5 @@ OAUTH_GITHUB_NAME=OAuth GitHub service OAUTH_GITHUB_ID=OAuth GitHub Id OAUTH_GITHUB_SECRET=OAuth GitHub Secret OAUTH_GITHUB_DESC=Go to this page then "Register a new application" to create OAuth credentials +OAUTH_STRIPE_TEST_NAME=OAuth Stripe Test +OAUTH_STRIPE_LIVE_NAME=OAuth Stripe Live \ No newline at end of file diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index c185b4f7968..815674a5b76 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -565,6 +565,7 @@ if (!defined('NOLOGIN')) $dol_tz_string = preg_replace('/,/', '/', $dol_tz_string); $dol_tz_string = preg_replace('/\s/', '_', $dol_tz_string); $dol_dst = 0; + // Keep $_POST here. Do not use GETPOSTISSET if (isset($_POST["dst_first"]) && isset($_POST["dst_second"])) { include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php index 41150e913d5..66446e21ddc 100644 --- a/htdocs/master.inc.php +++ b/htdocs/master.inc.php @@ -170,7 +170,7 @@ elseif (!empty($_ENV["dol_entity"])) // Entity inside a CLI script { $conf->entity = $_ENV["dol_entity"]; } -elseif (isset($_POST["loginfunction"]) && GETPOST("entity", 'int')) // Just after a login page +elseif (GETPOSTISSET("loginfunction") && GETPOST("entity", 'int')) // Just after a login page { $conf->entity = GETPOST("entity", 'int'); } diff --git a/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php b/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php index 43970122919..c8654a14d28 100644 --- a/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php @@ -112,7 +112,7 @@ class mailing_mailinglist_mymodule_myobject extends MailingTargets $sql = " select rowid as id, email, firstname, lastname, plan, partner"; $sql.= " from ".MAIN_DB_PREFIX."myobject"; $sql.= " where email IS NOT NULL AND email != ''"; - if (! empty($_POST['filter']) && $_POST['filter'] != 'none') $sql.= " AND status = '".$this->db->escape($_POST['filter'])."'"; + if (GETPOSTISSET('filter') && GETPOST('filter', 'alphanohtml') != 'none') $sql.= " AND status = '".$this->db->escape(GETPOST('filter', 'alphanohtml'))."'"; $sql.= " ORDER BY email"; // Stocke destinataires dans target diff --git a/htdocs/product/admin/dynamic_prices.php b/htdocs/product/admin/dynamic_prices.php index cf89db252e5..73ab40c75b8 100644 --- a/htdocs/product/admin/dynamic_prices.php +++ b/htdocs/product/admin/dynamic_prices.php @@ -63,9 +63,9 @@ if ($action == 'edit_updater') { if (!empty($action) && empty($cancel)) { //Global variable actions if ($action == 'create_variable' || $action == 'edit_variable') { - $price_globals->code = isset($_POST['code'])?GETPOST('code', 'alpha'):$price_globals->code; - $price_globals->description = isset($_POST['description'])?GETPOST('description', 'alpha'):$price_globals->description; - $price_globals->value = isset($_POST['value'])?GETPOST('value', 'int'):$price_globals->value; + $price_globals->code = GETPOSTISSET('code')?GETPOST('code', 'alpha'):$price_globals->code; + $price_globals->description = GETPOSTISSET('description')?GETPOST('description', 'alpha'):$price_globals->description; + $price_globals->value = GETPOSTISSET('value')?GETPOST('value', 'int'):$price_globals->value; //Check if record already exists only when saving if (!empty($save)) { foreach ($price_globals->listGlobalVariables() as $entry) { @@ -101,11 +101,11 @@ if (!empty($action) && empty($cancel)) { //Updaters actions if ($action == 'create_updater' || $action == 'edit_updater') { - $price_updaters->type = isset($_POST['type'])?GETPOST('type', 'int'):$price_updaters->type; - $price_updaters->description = isset($_POST['description'])?GETPOST('description', 'alpha'):$price_updaters->description; - $price_updaters->parameters = isset($_POST['parameters'])?GETPOST('parameters'):$price_updaters->parameters; - $price_updaters->fk_variable = isset($_POST['fk_variable'])?GETPOST('fk_variable', 'int'):$price_updaters->fk_variable; - $price_updaters->update_interval = isset($_POST['update_interval'])?GETPOST('update_interval', 'int'):$price_updaters->update_interval; + $price_updaters->type = GETPOSTISSET('type')?GETPOST('type', 'int'):$price_updaters->type; + $price_updaters->description = GETPOSTISSET('description')?GETPOST('description', 'alpha'):$price_updaters->description; + $price_updaters->parameters = GETPOSTISSET('parameters')?GETPOST('parameters'):$price_updaters->parameters; + $price_updaters->fk_variable = GETPOSTISSET('fk_variable')?GETPOST('fk_variable', 'int'):$price_updaters->fk_variable; + $price_updaters->update_interval = GETPOSTISSET('update_interval')?GETPOST('update_interval', 'int'):$price_updaters->update_interval; } if ($action == 'create_updater' && !empty($save)) { //Verify if process() works diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 992b61fc993..4cbdc915241 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -331,7 +331,7 @@ if (empty($reshook)) { for ($i = 2; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++) { - if (isset($_POST["price_".$i])) + if (GETPOSTISSET("price_".$i)) { $object->multiprices["$i"] = price2num($_POST["price_".$i], 'MU'); $object->multiprices_base_type["$i"] = $_POST["multiprices_base_type_".$i]; diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index b4c91a3c04d..185c7aaf6ea 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -1874,7 +1874,7 @@ if ($socid && $action == 'create' && $user->rights->societe->creer) print ''.$langs->trans("WithdrawMode").''; $tblArraychoice = array("FRST" => $langs->trans("FRST"), "RECUR" => $langs->trans("RECUR")); - print $form->selectarray("frstrecur", $tblArraychoice, (isset($_POST['frstrecur']) ?GETPOST('frstrecur') : 'FRST'), 0); + print $form->selectarray("frstrecur", $tblArraychoice, (GETPOSTISSET('frstrecur') ? GETPOST('frstrecur') : 'FRST'), 0); print ''; print ''; diff --git a/htdocs/variants/ajax/orderAttribute.php b/htdocs/variants/ajax/orderAttribute.php index 354c9074192..6b697b1c38c 100644 --- a/htdocs/variants/ajax/orderAttribute.php +++ b/htdocs/variants/ajax/orderAttribute.php @@ -33,13 +33,14 @@ require '../../main.inc.php'; top_httphead(); // Registering the location of boxes -if (isset($_POST['roworder'])) { +if (GETPOSTISSET('roworder')) { $roworder=GETPOST('roworder', 'alpha', 2); dol_syslog("AjaxOrderAttribute roworder=".$roworder, LOG_DEBUG); $rowordertab = explode(',', $roworder); + $newrowordertab = array(); foreach ($rowordertab as $value) { if (!empty($value)) { $newrowordertab[] = $value; From 20797920d76b58d0b5cfe674b6092fbee5b3c6d1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 16 Feb 2020 19:35:52 +0100 Subject: [PATCH 305/306] Fix phpcs --- htdocs/core/class/commonobject.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index c62d6d09273..fdedc7b733b 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -563,7 +563,8 @@ abstract class CommonObject /** * Return clicable link of object (with eventually picto) * - * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '') { From 4b5cda5cd290f73d4f1fe432d49688ad2f498909 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 16 Feb 2020 21:16:00 +0100 Subject: [PATCH 306/306] Code comment on OAUth ahtent --- dev/dolibarr_changes.txt | 18 ++++++++++++++++++ htdocs/admin/oauthlogintokens.php | 19 +++++++++++++------ .../modules/oauth/github_oauthcallback.php | 3 +-- .../modules/oauth/google_oauthcallback.php | 2 +- 4 files changed, 33 insertions(+), 9 deletions(-) diff --git a/dev/dolibarr_changes.txt b/dev/dolibarr_changes.txt index 107f561eca6..81a273d102a 100644 --- a/dev/dolibarr_changes.txt +++ b/dev/dolibarr_changes.txt @@ -253,6 +253,24 @@ PARSEDOWN $shortage = 4 - $len % 4; + +OAUTH +----- +Add into Class Google of file OAuth2/Service/Google: + + // LDR CHANGE Add approval_prompt to force the prompt if value is set to 'force' so it force return of a "refresh token" in addition to "standard token" + public $approvalPrompt='auto'; + public function setApprouvalPrompt($prompt) + { + if (!in_array($prompt, array('auto', 'force'), true)) { + // @todo Maybe could we rename this exception + throw new InvalidAccessTypeException('Invalid approuvalPrompt, expected either auto or force.'); + } + $this->approvalPrompt = $prompt; + } + + + JEDITABLE.JS ------------ diff --git a/htdocs/admin/oauthlogintokens.php b/htdocs/admin/oauthlogintokens.php index 7b74016207b..77a5e95c3a5 100644 --- a/htdocs/admin/oauthlogintokens.php +++ b/htdocs/admin/oauthlogintokens.php @@ -24,7 +24,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/oauth.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/oauth.lib.php'; // This define $list require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; use OAuth\Common\Storage\DoliStorage; @@ -128,6 +128,9 @@ $head = oauthadmin_prepare_head(); dol_fiche_head($head, 'tokengeneration', '', -1, 'technic'); +if (GETPOST('error')) { + setEventMessages(GETPOST('error'), null, 'errors'); +} if ($mode == 'setup' && $user->admin) { @@ -144,17 +147,21 @@ if ($mode == 'setup' && $user->admin) if ($key[0] == 'OAUTH_GITHUB_NAME') { $OAUTH_SERVICENAME = 'GitHub'; - $state='user,public_repo'; // List of keys that will be converted into scopes (from constants 'SCOPE_state_in_uppercase' in file of service) - $urltorenew = $urlwithroot.'/core/modules/oauth/github_oauthcallback.php?state='.$state.'&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php'); + // List of keys that will be converted into scopes (from constants 'SCOPE_state_in_uppercase' in file of service). + // We pass this param list in to 'state' because we need it before and after the redirect. + $shortscope='user,public_repo'; + $urltorenew = $urlwithroot.'/core/modules/oauth/github_oauthcallback.php?shortscope='.$shortscope.'&state='.$shortscope.'&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php'); $urltodelete = $urlwithroot.'/core/modules/oauth/github_oauthcallback.php?action=delete&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php'); $urltocheckperms = 'https://github.com/settings/applications/'; } elseif ($key[0] == 'OAUTH_GOOGLE_NAME') { $OAUTH_SERVICENAME = 'Google'; - $state='userinfo_email,userinfo_profile,cloud_print'; // List of keys that will be converted into scopes (from constants 'SCOPE_state_in_uppercase' in file of service) - //$state.=',gmail_full'; - $urltorenew = $urlwithroot.'/core/modules/oauth/google_oauthcallback.php?state='.$state.'&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php'); + // List of keys that will be converted into scopes (from constants 'SCOPE_state_in_uppercase' in file of service). + // We pass this param list in to 'state' because we need it before and after the redirect. + $shortscope='userinfo_email,userinfo_profile,cloud_print'; + //$scope.=',gmail_full'; + $urltorenew = $urlwithroot.'/core/modules/oauth/google_oauthcallback.php?shortscope='.$shortscope.'&state='.$shortscope.'&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php'); $urltodelete = $urlwithroot.'/core/modules/oauth/google_oauthcallback.php?action=delete&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php'); $urltocheckperms = 'https://security.google.com/settings/security/permissions'; } diff --git a/htdocs/core/modules/oauth/github_oauthcallback.php b/htdocs/core/modules/oauth/github_oauthcallback.php index 919781baa93..e84fd023c78 100644 --- a/htdocs/core/modules/oauth/github_oauthcallback.php +++ b/htdocs/core/modules/oauth/github_oauthcallback.php @@ -71,7 +71,7 @@ $credentials = new Credentials( ); $requestedpermissionsarray=array(); -if (GETPOST('state')) $requestedpermissionsarray=explode(',', GETPOST('state')); // Example: 'userinfo_email,userinfo_profile,cloud_print'. 'state' parameter is standard to retrieve some parameters back +if (GETPOST('state')) $requestedpermissionsarray=explode(',', GETPOST('state')); // Example: 'user'. 'state' parameter is standard to retrieve some parameters back if ($action != 'delete' && empty($requestedpermissionsarray)) { print 'Error, parameter state is not defined'; @@ -93,7 +93,6 @@ $langs->load("oauth"); * Actions */ - if ($action == 'delete') { $storage->clearToken('GitHub'); diff --git a/htdocs/core/modules/oauth/google_oauthcallback.php b/htdocs/core/modules/oauth/google_oauthcallback.php index c9fd9869caf..4a313b6736b 100644 --- a/htdocs/core/modules/oauth/google_oauthcallback.php +++ b/htdocs/core/modules/oauth/google_oauthcallback.php @@ -71,7 +71,7 @@ $credentials = new Credentials( ); $requestedpermissionsarray=array(); -if (GETPOST('state')) $requestedpermissionsarray=explode(',', GETPOST('state')); // Example: 'userinfo_email,userinfo_profile,cloud_print'. 'state' parameter is standard to retrieve some parameters back +if (GETPOST('state')) $requestedpermissionsarray=explode(',', GETPOST('state')); // Example: 'userinfo_email,userinfo_profile,cloud_print'. 'state' parameter is standard to store a hash value and can be used to retrieve some parameters back if ($action != 'delete' && empty($requestedpermissionsarray)) { print 'Error, parameter state is not defined';