From 9e88bf1f1c5ca1037af27428b165e425bb452cfa Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 25 Jun 2019 15:41:20 +0200 Subject: [PATCH 01/27] NEW multilangs in fetch_lines --- htdocs/commande/class/commande.class.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 4eb3b3236e0..553d3c501c8 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1890,8 +1890,9 @@ class Commande extends CommonOrder * @param int $only_product Return only physical products * @return int <0 if KO, >0 if OK */ - public function fetch_lines($only_product = 0) + public function fetch_lines($only_product = 0, $loadalsotranslation = 0) { + global $langs, $conf; // phpcs:enable $this->lines=array(); @@ -1983,6 +1984,13 @@ class Commande extends CommonOrder $line->multicurrency_total_ttc = $objp->multicurrency_total_ttc; $line->fetch_optionals(); + + // multilangs + if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($objp->fk_product) && ! empty($loadalsotranslation)) { + $line = new Product($this->db); + $line->fetch($objp->fk_product); + $line->getMultiLangs(); + } $this->lines[$i] = $line; From 66eec4da5297b67c59da27d62064b2c14fc25768 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 25 Jun 2019 15:46:12 +0200 Subject: [PATCH 02/27] Update facture.class.php --- htdocs/compta/facture/class/facture.class.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index f249443ac66..5eb7d43e348 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1469,8 +1469,9 @@ class Facture extends CommonInvoice * * @return int 1 if OK, < 0 if KO */ - public function fetch_lines() + public function fetch_lines($only_product = 0, $loadalsotranslation = 0) { + global $langs, $conf; // phpcs:enable $this->lines=array(); @@ -1559,6 +1560,13 @@ class Facture extends CommonInvoice $line->multicurrency_total_ttc = $objp->multicurrency_total_ttc; $line->fetch_optionals(); + + // multilangs + if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($objp->fk_product) && ! empty($loadalsotranslation)) { + $line = new Product($this->db); + $line->fetch($objp->fk_product); + $line->getMultiLangs(); + } $this->lines[$i] = $line; From df0d540ffb171601570a3f8ea007f99f1125b202 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 25 Jun 2019 15:47:16 +0200 Subject: [PATCH 03/27] Update propal.class.php --- htdocs/comm/propal/class/propal.class.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 36162e8b9aa..e148744660d 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -1618,8 +1618,9 @@ class Propal extends CommonObject * @param int $only_product Return only physical products * @return int <0 if KO, >0 if OK */ - public function fetch_lines($only_product = 0) + public function fetch_lines($only_product = 0, $loadalsotranslation = 0) { + global $langs, $conf; // phpcs:enable $this->lines=array(); @@ -1712,6 +1713,13 @@ class Propal extends CommonObject $line->multicurrency_total_ttc = $objp->multicurrency_total_ttc; $line->fetch_optionals(); + + // multilangs + if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($objp->fk_product) && ! empty($loadalsotranslation)) { + $line = new Product($this->db); + $line->fetch($objp->fk_product); + $line->getMultiLangs(); + } $this->lines[$i] = $line; //dol_syslog("1 ".$line->fk_product); From a9adccabc3fedce5ec4ae67e255f5e6bf0ce2464 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 25 Jun 2019 15:48:41 +0200 Subject: [PATCH 04/27] Update contrat.class.php --- htdocs/contrat/class/contrat.class.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 91a373743c4..0c7eeb66d67 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -718,8 +718,9 @@ class Contrat extends CommonObject * * @return ContratLigne[] Return array of contract lines */ - public function fetch_lines() + public function fetch_lines($loadalsotranslation = 0) { + global $langs, $conf; // phpcs:enable $this->nbofserviceswait=0; $this->nbofservicesopened=0; @@ -828,6 +829,13 @@ class Contrat extends CommonObject // Retreive all extrafields for contract // fetch optionals attributes and labels $line->fetch_optionals(); + + // multilangs + if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($objp->fk_product) && ! empty($loadalsotranslation)) { + $line = new Product($this->db); + $line->fetch($objp->fk_product); + $line->getMultiLangs(); + } $this->lines[$pos] = $line; $this->lines_id_index_mapper[$line->id] = $pos; From 87d4e4e35640c88b4a112cb59bdb018d70b1f646 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 25 Jun 2019 15:49:47 +0200 Subject: [PATCH 05/27] Update contrat.class.php --- htdocs/contrat/class/contrat.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 0c7eeb66d67..ae4e485f87a 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -718,7 +718,7 @@ class Contrat extends CommonObject * * @return ContratLigne[] Return array of contract lines */ - public function fetch_lines($loadalsotranslation = 0) + public function fetch_lines($only_product = 0, $loadalsotranslation = 0) { global $langs, $conf; // phpcs:enable From 174e531d69584a89cf76a55565907b3f6cf28c02 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 25 Jun 2019 18:12:16 +0200 Subject: [PATCH 06/27] Update commande.class.php --- htdocs/commande/class/commande.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 553d3c501c8..8469dc0cd1f 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1888,6 +1888,7 @@ class Commande extends CommonOrder * Load array lines * * @param int $only_product Return only physical products + * @param int $loadalsotranslation Return translation for products * @return int <0 if KO, >0 if OK */ public function fetch_lines($only_product = 0, $loadalsotranslation = 0) From c813c33e42cad2459587a2b824ba99378d7b9f0d Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 25 Jun 2019 18:13:53 +0200 Subject: [PATCH 07/27] Update contrat.class.php --- htdocs/contrat/class/contrat.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index ae4e485f87a..179c2f5ae83 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -716,6 +716,9 @@ class Contrat extends CommonObject * Load lines array into this->lines. * This set also nbofserviceswait, nbofservicesopened, nbofservicesexpired and nbofservicesclosed * + * @param int $only_product Return only physical products + * @param int $loadalsotranslation Return translation for products + * * @return ContratLigne[] Return array of contract lines */ public function fetch_lines($only_product = 0, $loadalsotranslation = 0) From c81ffcd8f00b4e6f54d0917ace00b7d47db3f17b Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 25 Jun 2019 18:14:56 +0200 Subject: [PATCH 08/27] Update facture.class.php --- htdocs/compta/facture/class/facture.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 5eb7d43e348..a502b885ab3 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1467,6 +1467,9 @@ class Facture extends CommonInvoice /** * Load all detailed lines into this->lines * + * @param int $only_product Return only physical products + * @param int $loadalsotranslation Return translation for products + * * @return int 1 if OK, < 0 if KO */ public function fetch_lines($only_product = 0, $loadalsotranslation = 0) From 7f11077f1e00a56968703bc781064be071918720 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 25 Jun 2019 18:16:11 +0200 Subject: [PATCH 09/27] Update propal.class.php --- htdocs/comm/propal/class/propal.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index e148744660d..25b04c7c1e2 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -1615,7 +1615,9 @@ class Propal extends CommonObject /** * Load array lines * - * @param int $only_product Return only physical products + * @param int $only_product Return only physical products + * @param int $loadalsotranslation Return translation for products + * * @return int <0 if KO, >0 if OK */ public function fetch_lines($only_product = 0, $loadalsotranslation = 0) From 30dd3a76d296eb4eb62b0e9ba40b375a3b3d18e2 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Wed, 26 Jun 2019 08:23:06 +0200 Subject: [PATCH 10/27] Update contrat.class.php --- htdocs/contrat/class/contrat.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 179c2f5ae83..e16187412a0 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -716,7 +716,7 @@ class Contrat extends CommonObject * Load lines array into this->lines. * This set also nbofserviceswait, nbofservicesopened, nbofservicesexpired and nbofservicesclosed * - * @param int $only_product Return only physical products + * @param int $only_product Return only physical products * @param int $loadalsotranslation Return translation for products * * @return ContratLigne[] Return array of contract lines From a6a0e2bc77840591b5b0ffb652644b8d00581477 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 26 Jun 2019 10:58:36 +0200 Subject: [PATCH 11/27] NEW: Accountancy - Add hook bookkeepinglist on general ledger --- htdocs/accountancy/bookkeeping/list.php | 294 +++++++++++++----------- 1 file changed, 158 insertions(+), 136 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 0c92bcb8950..ab082bac903 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -37,6 +37,8 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php'; // Load translation files required by the page $langs->loadLangs(array("accountancy")); +$socid = GETPOST('socid', 'int'); + $action = GETPOST('action', 'aZ09'); $search_mvt_num = GETPOST('search_mvt_num', 'int'); $search_doc_type = GETPOST("search_doc_type", 'alpha'); @@ -97,8 +99,9 @@ $pagenext = $page + 1; if ($sortorder == "") $sortorder = "ASC"; if ($sortfield == "") $sortfield = "t.piece_num,t.rowid"; - +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $object = new BookKeeping($db); +$hookmanager->initHooks(array('bookkeepinglist')); $formaccounting = new FormAccounting($db); $formother = new FormOther($db); @@ -160,145 +163,151 @@ if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) unset($arrayfields['t.let if (GETPOST('cancel', 'alpha')) { $action='list'; $massaction=''; } if (! GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } -include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; +$parameters=array('socid'=>$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 (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers +if (empty($reshook)) { - $search_mvt_num = ''; - $search_doc_type = ''; - $search_doc_ref = ''; - $search_doc_date = ''; - $search_accountancy_code = ''; - $search_accountancy_code_start = ''; - $search_accountancy_code_end = ''; - $search_accountancy_aux_code = ''; - $search_accountancy_aux_code_start = ''; - $search_accountancy_aux_code_end = ''; - $search_mvt_label = ''; - $search_direction = ''; - $search_ledger_code = ''; - $search_date_start = ''; - $search_date_end = ''; - $search_date_creation_start = ''; - $search_date_creation_end = ''; - $search_date_modification_start = ''; - $search_date_modification_end = ''; - $search_date_export_start = ''; - $search_date_export_end = ''; - $search_debit = ''; - $search_credit = ''; - $search_lettering_code = ''; -} + include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; -// Must be after the remove filter action, before the export. -$param = ''; -$filter = array (); -if (! empty($search_date_start)) { - $filter['t.doc_date>='] = $search_date_start; - $tmp=dol_getdate($search_date_start); - $param .= '&search_date_startmonth=' . $tmp['mon'] . '&search_date_startday=' . $tmp['mday'] . '&search_date_startyear=' . $tmp['year']; -} -if (! empty($search_date_end)) { - $filter['t.doc_date<='] = $search_date_end; - $tmp=dol_getdate($search_date_end); - $param .= '&search_date_endmonth=' . $tmp['mon'] . '&search_date_endday=' . $tmp['mday'] . '&search_date_endyear=' . $tmp['year']; -} -if (! empty($search_doc_date)) { - $filter['t.doc_date'] = $search_doc_date; - $tmp=dol_getdate($search_doc_date); - $param .= '&doc_datemonth=' . $tmp['mon'] . '&doc_dateday=' . $tmp['mday'] . '&doc_dateyear=' . $tmp['year']; -} -if (! empty($search_doc_type)) { - $filter['t.doc_type'] = $search_doc_type; - $param .= '&search_doc_type=' . urlencode($search_doc_type); -} -if (! empty($search_doc_ref)) { - $filter['t.doc_ref'] = $search_doc_ref; - $param .= '&search_doc_ref=' . urlencode($search_doc_ref); -} -if (! empty($search_accountancy_code)) { - $filter['t.numero_compte'] = $search_accountancy_code; - $param .= '&search_accountancy_code=' . urlencode($search_accountancy_code); -} -if (! empty($search_accountancy_code_start)) { - $filter['t.numero_compte>='] = $search_accountancy_code_start; - $param .= '&search_accountancy_code_start=' . urlencode($search_accountancy_code_start); -} -if (! empty($search_accountancy_code_end)) { - $filter['t.numero_compte<='] = $search_accountancy_code_end; - $param .= '&search_accountancy_code_end=' . urlencode($search_accountancy_code_end); -} -if (! empty($search_accountancy_aux_code)) { - $filter['t.subledger_account'] = $search_accountancy_aux_code; - $param .= '&search_accountancy_aux_code=' . urlencode($search_accountancy_aux_code); -} -if (! empty($search_accountancy_aux_code_start)) { - $filter['t.subledger_account>='] = $search_accountancy_aux_code_start; - $param .= '&search_accountancy_aux_code_start=' . urlencode($search_accountancy_aux_code_start); -} -if (! empty($search_accountancy_aux_code_end)) { - $filter['t.subledger_account<='] = $search_accountancy_aux_code_end; - $param .= '&search_accountancy_aux_code_end=' . urlencode($search_accountancy_aux_code_end); -} -if (! empty($search_mvt_label)) { - $filter['t.label_operation'] = $search_mvt_label; - $param .= '&search_mvt_label=' . urlencode($search_mvt_label); -} -if (! empty($search_direction)) { - $filter['t.sens'] = $search_direction; - $param .= '&search_direction=' . urlencode($search_direction); -} -if (! empty($search_ledger_code)) { - $filter['t.code_journal'] = $search_ledger_code; - $param .= '&search_ledger_code=' . urlencode($search_ledger_code); -} -if (! empty($search_mvt_num)) { - $filter['t.piece_num'] = $search_mvt_num; - $param .= '&search_mvt_num=' . urlencode($search_mvt_num); -} -if (! empty($search_date_creation_start)) { - $filter['t.date_creation>='] = $search_date_creation_start; - $tmp=dol_getdate($search_date_creation_start); - $param .= '&date_creation_startmonth=' . $tmp['mon'] . '&date_creation_startday=' . $tmp['mday'] . '&date_creation_startyear=' . $tmp['year']; -} -if (! empty($search_date_creation_end)) { - $filter['t.date_creation<='] = $search_date_creation_end; - $tmp=dol_getdate($search_date_creation_end); - $param .= '&date_creation_endmonth=' . $tmp['mon'] . '&date_creation_endday=' . $tmp['mday'] . '&date_creation_endyear=' . $tmp['year']; -} -if (! empty($search_date_modification_start)) { - $filter['t.tms>='] = $search_date_modification_start; - $tmp=dol_getdate($search_date_modification_start); - $param .= '&date_modification_startmonth=' . $tmp['mon'] . '&date_modification_startday=' . $tmp['mday'] . '&date_modification_startyear=' . $tmp['year']; -} -if (! empty($search_date_modification_end)) { - $filter['t.tms<='] = $search_date_modification_end; - $tmp=dol_getdate($search_date_modification_end); - $param .= '&date_modification_endmonth=' . $tmp['mon'] . '&date_modification_endday=' . $tmp['mday'] . '&date_modification_endyear=' . $tmp['year']; -} -if (! empty($search_date_export_start)) { - $filter['t.date_export>='] = $search_date_export_start; - $tmp=dol_getdate($search_date_export_start); - $param .= '&date_export_startmonth=' . $tmp['mon'] . '&date_export_startday=' . $tmp['mday'] . '&date_export_startyear=' . $tmp['year']; -} -if (! empty($search_date_export_end)) { - $filter['t.date_export<='] = $search_date_export_end; - $tmp=dol_getdate($search_date_export_end); - $param .= '&date_export_endmonth=' . $tmp['mon'] . '&date_export_endday=' . $tmp['mday'] . '&date_export_endyear=' . $tmp['year']; -} -if (! empty($search_debit)) { - $filter['t.debit'] = $search_debit; - $param .= '&search_debit=' . urlencode($search_debit); -} -if (! empty($search_credit)) { - $filter['t.credit'] = $search_credit; - $param .= '&search_credit=' . urlencode($search_credit); -} -if (! empty($search_lettering_code)) { - $filter['t.lettering_code'] = $search_lettering_code; - $param .= '&search_lettering_code=' . urlencode($search_lettering_code); -} + 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_mvt_num = ''; + $search_doc_type = ''; + $search_doc_ref = ''; + $search_doc_date = ''; + $search_accountancy_code = ''; + $search_accountancy_code_start = ''; + $search_accountancy_code_end = ''; + $search_accountancy_aux_code = ''; + $search_accountancy_aux_code_start = ''; + $search_accountancy_aux_code_end = ''; + $search_mvt_label = ''; + $search_direction = ''; + $search_ledger_code = ''; + $search_date_start = ''; + $search_date_end = ''; + $search_date_creation_start = ''; + $search_date_creation_end = ''; + $search_date_modification_start = ''; + $search_date_modification_end = ''; + $search_date_export_start = ''; + $search_date_export_end = ''; + $search_debit = ''; + $search_credit = ''; + $search_lettering_code = ''; + } + // Must be after the remove filter action, before the export. + $param = ''; + $filter = array (); + if (! empty($search_date_start)) { + $filter['t.doc_date>='] = $search_date_start; + $tmp=dol_getdate($search_date_start); + $param .= '&search_date_startmonth=' . $tmp['mon'] . '&search_date_startday=' . $tmp['mday'] . '&search_date_startyear=' . $tmp['year']; + } + if (! empty($search_date_end)) { + $filter['t.doc_date<='] = $search_date_end; + $tmp=dol_getdate($search_date_end); + $param .= '&search_date_endmonth=' . $tmp['mon'] . '&search_date_endday=' . $tmp['mday'] . '&search_date_endyear=' . $tmp['year']; + } + if (! empty($search_doc_date)) { + $filter['t.doc_date'] = $search_doc_date; + $tmp=dol_getdate($search_doc_date); + $param .= '&doc_datemonth=' . $tmp['mon'] . '&doc_dateday=' . $tmp['mday'] . '&doc_dateyear=' . $tmp['year']; + } + if (! empty($search_doc_type)) { + $filter['t.doc_type'] = $search_doc_type; + $param .= '&search_doc_type=' . urlencode($search_doc_type); + } + if (! empty($search_doc_ref)) { + $filter['t.doc_ref'] = $search_doc_ref; + $param .= '&search_doc_ref=' . urlencode($search_doc_ref); + } + if (! empty($search_accountancy_code)) { + $filter['t.numero_compte'] = $search_accountancy_code; + $param .= '&search_accountancy_code=' . urlencode($search_accountancy_code); + } + if (! empty($search_accountancy_code_start)) { + $filter['t.numero_compte>='] = $search_accountancy_code_start; + $param .= '&search_accountancy_code_start=' . urlencode($search_accountancy_code_start); + } + if (! empty($search_accountancy_code_end)) { + $filter['t.numero_compte<='] = $search_accountancy_code_end; + $param .= '&search_accountancy_code_end=' . urlencode($search_accountancy_code_end); + } + if (! empty($search_accountancy_aux_code)) { + $filter['t.subledger_account'] = $search_accountancy_aux_code; + $param .= '&search_accountancy_aux_code=' . urlencode($search_accountancy_aux_code); + } + if (! empty($search_accountancy_aux_code_start)) { + $filter['t.subledger_account>='] = $search_accountancy_aux_code_start; + $param .= '&search_accountancy_aux_code_start=' . urlencode($search_accountancy_aux_code_start); + } + if (! empty($search_accountancy_aux_code_end)) { + $filter['t.subledger_account<='] = $search_accountancy_aux_code_end; + $param .= '&search_accountancy_aux_code_end=' . urlencode($search_accountancy_aux_code_end); + } + if (! empty($search_mvt_label)) { + $filter['t.label_operation'] = $search_mvt_label; + $param .= '&search_mvt_label=' . urlencode($search_mvt_label); + } + if (! empty($search_direction)) { + $filter['t.sens'] = $search_direction; + $param .= '&search_direction=' . urlencode($search_direction); + } + if (! empty($search_ledger_code)) { + $filter['t.code_journal'] = $search_ledger_code; + $param .= '&search_ledger_code=' . urlencode($search_ledger_code); + } + if (! empty($search_mvt_num)) { + $filter['t.piece_num'] = $search_mvt_num; + $param .= '&search_mvt_num=' . urlencode($search_mvt_num); + } + if (! empty($search_date_creation_start)) { + $filter['t.date_creation>='] = $search_date_creation_start; + $tmp=dol_getdate($search_date_creation_start); + $param .= '&date_creation_startmonth=' . $tmp['mon'] . '&date_creation_startday=' . $tmp['mday'] . '&date_creation_startyear=' . $tmp['year']; + } + if (! empty($search_date_creation_end)) { + $filter['t.date_creation<='] = $search_date_creation_end; + $tmp=dol_getdate($search_date_creation_end); + $param .= '&date_creation_endmonth=' . $tmp['mon'] . '&date_creation_endday=' . $tmp['mday'] . '&date_creation_endyear=' . $tmp['year']; + } + if (! empty($search_date_modification_start)) { + $filter['t.tms>='] = $search_date_modification_start; + $tmp=dol_getdate($search_date_modification_start); + $param .= '&date_modification_startmonth=' . $tmp['mon'] . '&date_modification_startday=' . $tmp['mday'] . '&date_modification_startyear=' . $tmp['year']; + } + if (! empty($search_date_modification_end)) { + $filter['t.tms<='] = $search_date_modification_end; + $tmp=dol_getdate($search_date_modification_end); + $param .= '&date_modification_endmonth=' . $tmp['mon'] . '&date_modification_endday=' . $tmp['mday'] . '&date_modification_endyear=' . $tmp['year']; + } + if (! empty($search_date_export_start)) { + $filter['t.date_export>='] = $search_date_export_start; + $tmp=dol_getdate($search_date_export_start); + $param .= '&date_export_startmonth=' . $tmp['mon'] . '&date_export_startday=' . $tmp['mday'] . '&date_export_startyear=' . $tmp['year']; + } + if (! empty($search_date_export_end)) { + $filter['t.date_export<='] = $search_date_export_end; + $tmp=dol_getdate($search_date_export_end); + $param .= '&date_export_endmonth=' . $tmp['mon'] . '&date_export_endday=' . $tmp['mday'] . '&date_export_endyear=' . $tmp['year']; + } + if (! empty($search_debit)) { + $filter['t.debit'] = $search_debit; + $param .= '&search_debit=' . urlencode($search_debit); + } + if (! empty($search_credit)) { + $filter['t.credit'] = $search_credit; + $param .= '&search_credit=' . urlencode($search_credit); + } + if (! empty($search_lettering_code)) { + $filter['t.lettering_code'] = $search_lettering_code; + $param .= '&search_lettering_code=' . urlencode($search_lettering_code); + } +} if ($action == 'delbookkeeping' && $user->rights->accounting->mouvements->supprimer) { @@ -695,6 +704,10 @@ if (! empty($arrayfields['t.debit']['checked'])) print_liste_field_titre($arr if (! empty($arrayfields['t.credit']['checked'])) print_liste_field_titre($arrayfields['t.credit']['label'], $_SERVER['PHP_SELF'], "t.credit", "", $param, '', $sortfield, $sortorder, 'right '); if (! empty($arrayfields['t.lettering_code']['checked'])) print_liste_field_titre($arrayfields['t.lettering_code']['label'], $_SERVER['PHP_SELF'], "t.lettering_code", "", $param, '', $sortfield, $sortorder, 'center '); if (! empty($arrayfields['t.code_journal']['checked'])) print_liste_field_titre($arrayfields['t.code_journal']['label'], $_SERVER['PHP_SELF'], "t.code_journal", "", $param, '', $sortfield, $sortorder, 'center '); +// 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['t.date_creation']['checked'])) print_liste_field_titre($arrayfields['t.date_creation']['label'], $_SERVER['PHP_SELF'], "t.date_creation", "", $param, '', $sortfield, $sortorder, 'center '); if (! empty($arrayfields['t.tms']['checked'])) print_liste_field_titre($arrayfields['t.tms']['label'], $_SERVER['PHP_SELF'], "t.tms", "", $param, '', $sortfield, $sortorder, 'center '); if (! empty($arrayfields['t.date_export']['checked'])) print_liste_field_titre($arrayfields['t.date_export']['label'], $_SERVER['PHP_SELF'], "t.date_export", "", $param, '', $sortfield, $sortorder, 'center '); @@ -796,6 +809,11 @@ if ($num > 0) if (! $i) $totalarray['nbfield']++; } + // Fields from hook + $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $reshook=$hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + // Creation operation date if (! empty($arrayfields['t.date_creation']['checked'])) { @@ -857,6 +875,10 @@ if ($num > 0) } } +$parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql); +$reshook=$hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; + print ""; print ''; From c9a36cede6d56ebc10c066faed591134ea9e1c99 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 26 Jun 2019 11:13:34 +0200 Subject: [PATCH 12/27] Update work --- htdocs/accountancy/bookkeeping/list.php | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index ab082bac903..dc911db7f9f 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -536,6 +536,11 @@ $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1); +$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; + print '
'; print ''; @@ -644,6 +649,13 @@ if (! empty($arrayfields['t.code_journal']['checked'])) { print ''; } + + +// 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['t.date_creation']['checked'])) { @@ -871,13 +883,14 @@ if ($num > 0) elseif ($totalarray['totalcreditfield'] == $i) print ''; else print ''; } + $parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql); + $reshook=$hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + print ''; } } -$parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql); -$reshook=$hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook -print $hookmanager->resPrint; print "
'.price($totalarray['totalcredit']).'
"; print '
'; From 59f8fb77daf10324512dc2c0d909ad7cc08181d2 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 26 Jun 2019 13:59:32 +0200 Subject: [PATCH 13/27] Travis --- htdocs/accountancy/bookkeeping/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index dc911db7f9f..616c8697c61 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -537,7 +537,7 @@ $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfiel if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1); $parameters=array(); -$reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook +$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; @@ -653,7 +653,7 @@ if (! empty($arrayfields['t.code_journal']['checked'])) // Fields from hook $parameters=array('arrayfields'=>$arrayfields); -$reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook +$reshook=$hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation From b2ec60d53b00340b36d3c1c13e579fb08a420502 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Wed, 26 Jun 2019 14:08:51 +0200 Subject: [PATCH 14/27] Fix qty to negative if refund --- htdocs/societe/consumption.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index afd3a51ec8e..e43bb759e72 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -595,7 +595,7 @@ if ($sql_select) print ''; //print ''.$prodreftxt.''; - + if ($type_element == 'invoice' && $objp->doc_type == '2') $objp->prod_qty=-($objp->prod_qty); print ''.$objp->prod_qty.''; $total_qty+=$objp->prod_qty; From 55bd67058bebb5a080f632daea36a4f1166e8a15 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Wed, 26 Jun 2019 14:10:52 +0200 Subject: [PATCH 15/27] Update facture.php --- htdocs/product/stats/facture.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php index d60c4d835a5..f8aa4fa7ac0 100644 --- a/htdocs/product/stats/facture.php +++ b/htdocs/product/stats/facture.php @@ -234,7 +234,8 @@ if ($id > 0 || ! empty($ref)) while ($i < min($num, $limit)) { $objp = $db->fetch_object($result); - + + if ($objp->type == '2') $objp->qty=-($objp->qty); $total_ht+=$objp->total_ht; $total_qty+=$objp->qty; From c20f9a4842f1a7094f7c5b348044eadc4e17b054 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 27 Jun 2019 09:22:44 +0200 Subject: [PATCH 16/27] translations --- htdocs/core/modules/commande/doc/pdf_proforma.modules.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_proforma.modules.php b/htdocs/core/modules/commande/doc/pdf_proforma.modules.php index f10f858544f..b426cc77d5e 100644 --- a/htdocs/core/modules/commande/doc/pdf_proforma.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_proforma.modules.php @@ -25,7 +25,7 @@ /** * \file htdocs/core/modules/commande/doc/pdf_proforma.modules.php * \ingroup commande - * \brief Fichier de la classe permettant de generer les commandes au modele Proforma + * \brief File of Class to generate PDF orders with template Proforma */ require_once DOL_DOCUMENT_ROOT.'/core/modules/commande/doc/pdf_einstein.modules.php'; @@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; /** - * Classe permettant de generer les commandes au modele Proforma + * Class to generate PDF orders with template Proforma */ class pdf_proforma extends pdf_einstein { From 5a8cc4934b229e1de54c2c6a7032887346ec3c28 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 27 Jun 2019 09:29:00 +0200 Subject: [PATCH 17/27] translations --- .../commande/doc/pdf_eratosthene.modules.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index 1abc6c95e20..0fa47bd94a7 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -7,7 +7,7 @@ * Copyright (C) 2012 Cedric Salvador * Copyright (C) 2015 Marcos García * Copyright (C) 2017 Ferran Marcet - * Copyright (C) 2018 Frédéric France + * 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 @@ -27,7 +27,7 @@ /** * \file htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php * \ingroup commande - * \brief Fichier de la classe permettant de generer les commandes au modele Eratosthène + * \brief File of Class to generate PDF orders with template Eratosthène */ require_once DOL_DOCUMENT_ROOT.'/core/modules/commande/modules_commande.php'; @@ -149,13 +149,13 @@ class pdf_eratosthene extends ModelePDFCommandes $this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10; $this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION - $this->option_modereg = 1; // Affiche mode reglement - $this->option_condreg = 1; // Affiche conditions reglement - $this->option_codeproduitservice = 1; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues - $this->option_escompte = 0; // Affiche si il y a eu escompte + $this->option_logo = 1; // Display logo + $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION + $this->option_modereg = 1; // Display payment mode + $this->option_condreg = 1; // Display payment terms + $this->option_codeproduitservice = 1; // Display product-service code + $this->option_multilang = 1; // Available in several languages + $this->option_escompte = 0; // Displays if there has been a discount $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 1; // Support add of a watermark on drafts From f1e40b4b22eed702a63a03a762cdc9c885257f41 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 27 Jun 2019 09:31:42 +0200 Subject: [PATCH 18/27] translations --- .../modules/contract/doc/pdf_strato.modules.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index 97fedf45808..d358149d7cc 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -4,7 +4,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2011 Fabrice CHERRIER - * Copyright (C) 2013-2018 Philippe Grand + * Copyright (C) 2013-2019 Philippe Grand * Copyright (C) 2015 Marcos García * Copyright (C) 2018 Frédéric France * @@ -144,13 +144,13 @@ class pdf_strato extends ModelePDFContract $this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10; $this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 0; // Gere option tva FACTURE_TVAOPTION - $this->option_modereg = 0; // Affiche mode reglement - $this->option_condreg = 0; // Affiche conditions reglement - $this->option_codeproduitservice = 0; // Affiche code produit-service - $this->option_multilang = 0; // Dispo en plusieurs langues - $this->option_draft_watermark = 1; //Support add of a watermark on drafts + $this->option_logo = 1; // Display logo + $this->option_tva = 0; // Manage the vat option FACTURE_TVAOPTION + $this->option_modereg = 0; // Display payment mode + $this->option_condreg = 0; // Display payment terms + $this->option_codeproduitservice = 0; // Display product-service code + $this->option_multilang = 0; // Available in several languages + $this->option_draft_watermark = 1; // Support add of a watermark on drafts // Get source company $this->emetteur=$mysoc; From 6e8d86fb4a250a4e47316bfe2138a5836b0fd923 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 27 Jun 2019 09:43:50 +0200 Subject: [PATCH 19/27] translations --- htdocs/core/modules/expedition/doc/pdf_merou.modules.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php index 8696bc21a02..235e7e5c66c 100644 --- a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php @@ -3,7 +3,7 @@ * Copyright (C) 2005-2015 Laurent Destailleur * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2013 Florian Henry - * Copyright (C) 2015 Marcos García + * Copyright (C) 2015 Marcos García * * 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 @@ -23,7 +23,7 @@ /** * \file htdocs/core/modules/expedition/doc/pdf_merou.modules.php * \ingroup expedition - * \brief Fichier de la classe permettant de generer les bordereaux envoi au modele Merou + * \brief Class file used to generate the dispatch slips for the Merou model */ require_once DOL_DOCUMENT_ROOT.'/core/modules/expedition/modules_expedition.php'; @@ -134,7 +134,7 @@ class pdf_merou extends ModelePdfExpedition $this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10; $this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10; - $this->option_logo = 1; + $this->option_logo = 1; // Display logo // Get source company $this->emetteur=$mysoc; From 5a4ba837cc84dbfcd19d100a247cd18f0b94a1f8 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 27 Jun 2019 09:47:00 +0200 Subject: [PATCH 20/27] translations --- 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 e8de6ffdb73..ea5efb359d0 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -23,7 +23,7 @@ /** * \file htdocs/core/modules/expedition/doc/pdf_rouget.modules.php * \ingroup expedition - * \brief Fichier de la classe permettant de generer les bordereaux envoi au modele Rouget + * \brief Class file used to generate the dispatch slips for the Rouget model */ require_once DOL_DOCUMENT_ROOT.'/core/modules/expedition/modules_expedition.php'; @@ -133,7 +133,7 @@ class pdf_rouget extends ModelePdfExpedition $this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10; $this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10; - $this->option_logo = 1; + $this->option_logo = 1; // Display logo // Get source company $this->emetteur=$mysoc; From 2c237b8420df54b8c23306311ea35284f7e8439e Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 27 Jun 2019 09:51:48 +0200 Subject: [PATCH 21/27] translations --- .../modules/facture/doc/pdf_crabe.modules.php | 14 +++++++------- .../modules/facture/doc/pdf_sponge.modules.php | 16 ++++++++-------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index de1ebc00a8b..9890df8b607 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -160,13 +160,13 @@ class pdf_crabe extends ModelePDFFactures $this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10; $this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION - $this->option_modereg = 1; // Affiche mode reglement - $this->option_condreg = 1; // Affiche conditions reglement - $this->option_codeproduitservice = 1; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues - $this->option_escompte = 1; // Affiche si il y a eu escompte + $this->option_logo = 1; // Display logo + $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION + $this->option_modereg = 1; // Display payment mode + $this->option_condreg = 1; // Display payment terms + $this->option_codeproduitservice = 1; // Display product-service code + $this->option_multilang = 1; // Available in several languages + $this->option_escompte = 1; // Displays if there has been a discount $this->option_credit_note = 1; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 1; // Support add of a watermark on drafts diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 9c7c7797841..1413bd3c777 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -160,13 +160,13 @@ class pdf_sponge extends ModelePDFFactures $this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10; $this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION - $this->option_modereg = 1; // Affiche mode reglement - $this->option_condreg = 1; // Affiche conditions reglement - $this->option_codeproduitservice = 1; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues - $this->option_escompte = 1; // Affiche si il y a eu escompte + $this->option_logo = 1; // Display logo + $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION + $this->option_modereg = 1; // Display payment mode + $this->option_condreg = 1; // Display payment terms + $this->option_codeproduitservice = 1; // Display product-service code + $this->option_multilang = 1; // Available in several languages + $this->option_escompte = 1; // Displays if there has been a discount $this->option_credit_note = 1; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 1; // Support add of a watermark on drafts @@ -449,7 +449,7 @@ class pdf_sponge extends ModelePDFFactures complete_substitutions_array($substitutionarray, $outputlangs, $object); $notetoshow = make_substitutions($notetoshow, $substitutionarray, $outputlangs); $notetoshow = convertBackOfficeMediasLinksToPublicLinks($notetoshow); - + $pdf->startTransaction(); $pdf->SetFont('', '', $default_font_size - 1); From af83d8836ab5737d659f0c1b9f27ef185693b30b Mon Sep 17 00:00:00 2001 From: fbosman Date: Fri, 28 Jun 2019 07:06:19 +0200 Subject: [PATCH 22/27] Update actions_extrafields.inc.php --- htdocs/core/actions_extrafields.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/actions_extrafields.inc.php b/htdocs/core/actions_extrafields.inc.php index b5eb5257ecc..253ce1f9264 100644 --- a/htdocs/core/actions_extrafields.inc.php +++ b/htdocs/core/actions_extrafields.inc.php @@ -27,7 +27,7 @@ $maxsizestring=255; $maxsizeint=10; $mesg=array(); -$extrasize=GETPOST('size', 'int'); +$extrasize=GETPOST('size','intcomma'); $type=GETPOST('type', 'alpha'); $param=GETPOST('param', 'alpha'); From f44203775af0f1d2519cb67f8c0b94fc5673313c Mon Sep 17 00:00:00 2001 From: fbosman Date: Fri, 28 Jun 2019 07:10:28 +0200 Subject: [PATCH 23/27] Update extrafields.class.php --- htdocs/core/class/extrafields.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index fae30c05e73..c1c87a876a8 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1645,7 +1645,10 @@ class ExtraFields elseif ($type == 'double') { if (!empty($value)) { - $value=price($value); + // $value=price($value); + $sizeparts = explode(",",$size); + $number_decimals = $sizeparts[1]; + $value=price($value, 0, $langs, 0, 0, $number_decimals, ''); } } elseif ($type == 'boolean') From 1b33952028e796864c77edccaaa99790384419a4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 28 Jun 2019 12:37:22 +0200 Subject: [PATCH 24/27] Update facture.php --- htdocs/product/stats/facture.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php index f8aa4fa7ac0..00f9c84338e 100644 --- a/htdocs/product/stats/facture.php +++ b/htdocs/product/stats/facture.php @@ -235,7 +235,7 @@ if ($id > 0 || ! empty($ref)) { $objp = $db->fetch_object($result); - if ($objp->type == '2') $objp->qty=-($objp->qty); + if ($objp->type == Facture::TYPE_CREDIT_NOTE) $objp->qty=-($objp->qty); $total_ht+=$objp->total_ht; $total_qty+=$objp->qty; From 0725ce0e3f4f7b656701c90ebbdf1d6b9e21c4b2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 28 Jun 2019 12:37:44 +0200 Subject: [PATCH 25/27] Update consumption.php --- htdocs/societe/consumption.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index e43bb759e72..1c5c4b82a5d 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -595,7 +595,7 @@ if ($sql_select) print ''; //print ''.$prodreftxt.''; - if ($type_element == 'invoice' && $objp->doc_type == '2') $objp->prod_qty=-($objp->prod_qty); + if ($type_element == 'invoice' && $objp->doc_type == Facture::TYPE_CREDIT_NOTE) $objp->prod_qty=-($objp->prod_qty); print ''.$objp->prod_qty.''; $total_qty+=$objp->prod_qty; From 511be75fca7f6e312a31e5168ae833aab180b605 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 28 Jun 2019 12:55:19 +0200 Subject: [PATCH 26/27] Update actions_extrafields.inc.php --- htdocs/core/actions_extrafields.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/actions_extrafields.inc.php b/htdocs/core/actions_extrafields.inc.php index 253ce1f9264..0900c8c3ffe 100644 --- a/htdocs/core/actions_extrafields.inc.php +++ b/htdocs/core/actions_extrafields.inc.php @@ -27,7 +27,7 @@ $maxsizestring=255; $maxsizeint=10; $mesg=array(); -$extrasize=GETPOST('size','intcomma'); +$extrasize=GETPOST('size', 'intcomma'); $type=GETPOST('type', 'alpha'); $param=GETPOST('param', 'alpha'); From ff7ae5ef2060d42a86eb6274dcf9cccc8f62c715 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 28 Jun 2019 12:56:31 +0200 Subject: [PATCH 27/27] Update extrafields.class.php --- htdocs/core/class/extrafields.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index c1c87a876a8..b8f5c0480b5 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1645,8 +1645,8 @@ class ExtraFields elseif ($type == 'double') { if (!empty($value)) { - // $value=price($value); - $sizeparts = explode(",",$size); + //$value=price($value); + $sizeparts = explode(",", $size); $number_decimals = $sizeparts[1]; $value=price($value, 0, $langs, 0, 0, $number_decimals, ''); }