From 34727286f1c6e154681acc9ca90dec8113b2882a Mon Sep 17 00:00:00 2001 From: BENKE Charlene Date: Sun, 25 Jun 2017 22:03:06 +0200 Subject: [PATCH 01/14] Let's time to refactoring the tpl folder Propose to refactoring all the file present in /tpl folder for hamonisation with the rest of dolibarr file. Good resolution for this summer --- htdocs/core/tpl/bloc_showhide.tpl.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/core/tpl/bloc_showhide.tpl.php b/htdocs/core/tpl/bloc_showhide.tpl.php index 2c5d71c79d5..60ea83043a8 100644 --- a/htdocs/core/tpl/bloc_showhide.tpl.php +++ b/htdocs/core/tpl/bloc_showhide.tpl.php @@ -49,15 +49,15 @@ $(document).ready(function() { }); -
-
-
+'.img_picto('', '1uparrow.png').''."\n"; +print '
'.img_picto('', '1downarrow.png').'
'."\n"; +print '
'.$title.'
'."\n"; +print '
'."\n"; -
- - - -
-
- - \ No newline at end of file +include DOL_DOCUMENT_ROOT.'/core/tpl/'.$blocname.'.tpl.php'; +print '

'; +?> + From fe749cbd95cdc155ee87e35928fc77b054be9497 Mon Sep 17 00:00:00 2001 From: BENKE Charlene Date: Sun, 25 Jun 2017 22:27:38 +0200 Subject: [PATCH 02/14] Update bloc_showhide.tpl.php --- htdocs/core/tpl/bloc_showhide.tpl.php | 52 ++++++++++++++------------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/htdocs/core/tpl/bloc_showhide.tpl.php b/htdocs/core/tpl/bloc_showhide.tpl.php index 60ea83043a8..a98e8314097 100644 --- a/htdocs/core/tpl/bloc_showhide.tpl.php +++ b/htdocs/core/tpl/bloc_showhide.tpl.php @@ -21,35 +21,37 @@ if (isset($parameters['showblocbydefault'])) $hide=(empty($parameters['showblocb if (isset($object->extraparams[$blocname]['showhide'])) $hide = (empty($object->extraparams[$blocname]['showhide']) ? true : false); ?> - - +print '$("#show-'.$blocname.'").click(function(){'."\n"; +print ' setShowHide(1);'."\n"; +print ' $("#'.$blocname.'").show("blind", {direction: "vertical"}, 300).addClass("nohideobject");'."\n"; +print ' $(this).hide();'."\n"; +print ' $("#hide-'.$blocname.'").show();'."\n"; +print '});'."\n"; + +print 'function setShowHide(status) {'."\n"; +print ' var id = '.$object->id."\n"; +print ' var element = '.$object->element."\n"; +print ' var htmlelement = '.$blocname."\n"; +print ' var type = "showhide";'."\n"; +print ' $.get("'.dol_buildpath('/core/ajax/extraparams.php', 1); +print '?id="+id+"&element="+element+"&htmlelement="+htmlelement+"&type="+type+"&value="+status);'."\n"; +print '}'."\n"; + +print '});'."\n"; +print ''."\n"; -'.img_picto('', '1uparrow.png').''."\n"; print '
Date: Sun, 23 Jul 2017 11:42:18 +0200 Subject: [PATCH 03/14] Fix: remove unused $_COOKIE['DOLENTITY'] --- htdocs/master.inc.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php index fc1c41895a4..a8d068cfd7d 100644 --- a/htdocs/master.inc.php +++ b/htdocs/master.inc.php @@ -160,10 +160,6 @@ else if (defined('DOLENTITY') && is_numeric(DOLENTITY)) // For public page wit { $conf->entity = DOLENTITY; } -else if (!empty($_COOKIE['DOLENTITY'])) // For other application with MultiCompany module (TODO: We should remove this. entity to use should never be stored into client side) -{ - $conf->entity = $_COOKIE['DOLENTITY']; -} // Sanitize entity if (! is_numeric($conf->entity)) $conf->entity=1; From c934f1bd13cce511ce8013ad8a717cb5140fad63 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 23 Jul 2017 12:07:20 +0200 Subject: [PATCH 04/14] Fix: remove unused old code --- htdocs/user/logout.php | 7 ------- 1 file changed, 7 deletions(-) diff --git a/htdocs/user/logout.php b/htdocs/user/logout.php index 37ff691fdcc..4421c6d6298 100644 --- a/htdocs/user/logout.php +++ b/htdocs/user/logout.php @@ -50,13 +50,6 @@ if ($result < 0) { $error++; } // Define url to go after disconnect $urlfrom=empty($_SESSION["urlfrom"])?'':$_SESSION["urlfrom"]; -// Destroy some cookies -// TODO external module -if (! empty($conf->phenix->enabled) && ! empty($conf->phenix->cookie)) -{ - setcookie($conf->phenix->cookie, '', 1, "/"); -} - // Define url to go $url=DOL_URL_ROOT."/index.php"; // By default go to login page if ($urlfrom) $url=DOL_URL_ROOT.$urlfrom; From b9d5f4ba107e80f0ac9631ce14d829696c9ae83b Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Mon, 24 Jul 2017 09:02:32 +0200 Subject: [PATCH 05/14] fix : Various misspelling class (eclipse Oxygen standard PHP control) --- htdocs/accountancy/class/bookkeeping.class.php | 2 +- htdocs/compta/bank/class/api_bankaccounts.class.php | 10 +++++----- .../contract/doc/doc_generic_contract_odt.modules.php | 2 +- .../propale/doc/doc_generic_proposal_odt.modules.php | 4 ++-- htdocs/fourn/facture/list.php | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 1431df9f8a2..ad28dd1af97 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -1260,7 +1260,7 @@ class BookKeeping extends CommonObject global $user; $error = 0; - $object = new Accountingbookkeeping($this->db); + $object = new BookKeeping($this->db); $this->db->begin(); diff --git a/htdocs/compta/bank/class/api_bankaccounts.class.php b/htdocs/compta/bank/class/api_bankaccounts.class.php index 869b86238ff..c6fd3f72def 100644 --- a/htdocs/compta/bank/class/api_bankaccounts.class.php +++ b/htdocs/compta/bank/class/api_bankaccounts.class.php @@ -72,7 +72,7 @@ class BankAccounts extends DolibarrApi $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."bank_account as t"; $sql.= ' WHERE t.entity IN ('.getEntity('bank_account').')'; // Add sql filters - if ($sqlfilters) + if ($sqlfilters) { if (! DolibarrApi::_checkFilters($sqlfilters)) { @@ -81,7 +81,7 @@ class BankAccounts extends DolibarrApi $regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)'; $sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")"; } - + $sql.= $this->db->order($sortfield, $sortorder); if ($limit) { if ($page < 0) @@ -89,10 +89,10 @@ class BankAccounts extends DolibarrApi $page = 0; } $offset = $limit * $page; - + $sql.= $this->db->plimit($limit + 1, $offset); } - + dol_syslog("API Rest request"); $result = $this->db->query($sql); @@ -236,7 +236,7 @@ class BankAccounts extends DolibarrApi function _validate($data) { $account = array(); - foreach (Accounts::$FIELDS as $field) { + foreach (BankAccounts::$FIELDS as $field) { if (! isset($data[$field])) throw new RestException(400, "$field field missing"); $account[$field] = $data[$field]; diff --git a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php index 64d0da9b5fd..f9dac51389f 100644 --- a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php +++ b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php @@ -211,7 +211,7 @@ class doc_generic_contract_odt extends ModelePDFContract if (! is_object($object)) { $id = $object; - $object = new Contract($this->db); + $object = new Contrat($this->db); $result=$object->fetch($id); if ($result < 0) { diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php index 0339f2ea255..130aa90ecfd 100644 --- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php +++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php @@ -167,7 +167,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales $texte.=$file['name'].'
'; } $texte.='
'; - + if ($conf->global->MAIN_PROPAL_CHOOSE_ODT_DOCUMENT > 0) { // Model for creation @@ -252,7 +252,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales if (! is_object($object)) { $id = $object; - $object = new Propale($this->db); + $object = new Propal($this->db); $result=$object->fetch($id); if ($result < 0) { diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 87483dca12f..909fa1dadfd 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -492,7 +492,7 @@ if ($resql) if (! GETPOST('cancel')) { - $objecttmp=new FactureFourn($db); + $objecttmp=new FactureFournisseur($db); $listofselectedid=array(); $listofselectedthirdparties=array(); $listofselectedref=array(); From 50262491e6712334a4af56bb2886c8e8bee40506 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josep=20Llu=C3=ADs?= Date: Mon, 24 Jul 2017 16:24:53 +0200 Subject: [PATCH 06/14] Fix supplier invoice permission on board Fix reading supplier invoice permission on main board --- htdocs/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/index.php b/htdocs/index.php index 187273ef2b4..8afb3fec6bb 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -448,7 +448,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) } // Number of supplier invoices (has paid) -if (! empty($conf->supplier_invoice->enabled) && ! empty($conf->facture->enabled) && $user->rights->facture->lire) +if (! empty($conf->supplier_invoice->enabled) && ! empty($conf->facture->enabled) && $user->rights->fournisseur->facture->lire) { include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; $board=new FactureFournisseur($db); From 5f144ca9400d2f05398f02b7e8c470b4e6edbeac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josep=20Llu=C3=ADs?= Date: Mon, 24 Jul 2017 16:39:08 +0200 Subject: [PATCH 07/14] Update index.php --- htdocs/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/index.php b/htdocs/index.php index 8afb3fec6bb..cb4db301bcc 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -448,7 +448,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) } // Number of supplier invoices (has paid) -if (! empty($conf->supplier_invoice->enabled) && ! empty($conf->facture->enabled) && $user->rights->fournisseur->facture->lire) +if (! empty($conf->supplier_invoice->enabled) && $user->rights->fournisseur->facture->lire) { include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; $board=new FactureFournisseur($db); From e1f8cfd474869ffb3e088a2b191b31b17efd760e Mon Sep 17 00:00:00 2001 From: hguibourgdev Date: Mon, 24 Jul 2017 20:59:46 +0200 Subject: [PATCH 08/14] NEW : Add toolkit for StockLimit and DesiredStock --- htdocs/product/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 833330126bb..c36f56c59a2 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1001,11 +1001,11 @@ else // Stock min level if ($type != 1 && ! empty($conf->stock->enabled)) { - print ''.$langs->trans("StockLimit").''; + print ''.$form->textwithpicto($langs->trans("StockLimit"), $langs->trans("StockLimitDesc"), 1).''; print ''; print ''; // Stock desired level - print ''.$langs->trans("DesiredStock").''; + print ''.$form->textwithpicto($langs->trans("DesiredStock"), $langs->trans("DesiredStockDesc"), 1).''; print ''; print ''; } From 6b9d25708bed93b2cf294a26bdbcf40ea3b4caca Mon Sep 17 00:00:00 2001 From: hguibourgdev Date: Mon, 24 Jul 2017 21:05:21 +0200 Subject: [PATCH 09/14] NEW : Add toolkit for StockLimit --- htdocs/product/stock/product.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index e3211b157df..ec9118f44eb 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -595,7 +595,7 @@ if ($id > 0 || $ref) } // Stock alert threshold - print ''.$form->editfieldkey("StockLimit",'seuil_stock_alerte',$object->seuil_stock_alerte,$object,$user->rights->produit->creer).''; + print ''.$form->editfieldkey($form->textwithpicto($langs->trans("StockLimit"), $langs->trans("StockLimitDesc"), 1),'seuil_stock_alerte',$object->seuil_stock_alerte,$object,$user->rights->produit->creer).''; print $form->editfieldval("StockLimit",'seuil_stock_alerte',$object->seuil_stock_alerte,$object,$user->rights->produit->creer,'string'); print ''; From 0dba6f3383c33ebc9fbaee5eb3f3fcf46b009e5e Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Tue, 25 Jul 2017 11:32:41 +0200 Subject: [PATCH 10/14] NEW : Deposit invoice more explicit in invocie line description --- htdocs/compta/facture/card.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index d77f83cbb2e..d7409c29c3c 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1105,8 +1105,17 @@ if (empty($reshook)) foreach ($amountdeposit as $tva => $amount) { + $arraylist = array('amount' => 'FixAmount','variable' => 'VarAmount'); + $descline = $langs->trans('Deposit'); + $descline.= ' - '.$langs->trans($arraylist[$typeamount]); + if ($typeamount=='amount') { + $descline.= ' ('. price($valuedeposit, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).')'; + } elseif ($typeamount=='variable') { + $descline.= ' ('. $valuedeposit.'%)'; + } + $descline.= ' - '.$srcobject->ref; $result = $object->addline( - $langs->trans('Deposit'), + $descline, $amount, // subprice 1, // quantity $tva, // vat rate @@ -1128,8 +1137,8 @@ if (empty($reshook)) 0, 0, 0, - 0, - $langs->trans('Deposit') + 0 + //,$langs->trans('Deposit') //Deprecated ); } From d2ecebdddd34ce3d7632a54403df126830612a1d Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Tue, 25 Jul 2017 11:57:36 +0200 Subject: [PATCH 11/14] new :new column into extrafeild table to get update create information --- htdocs/core/class/extrafields.class.php | 41 +++++++++++++++---- .../install/mysql/tables/llx_extrafields.sql | 6 ++- htdocs/install/pgsql/functions/functions.sql | 1 + 3 files changed, 40 insertions(+), 8 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index e44fa8a5aec..63f15bfcf79 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -281,7 +281,7 @@ class ExtraFields */ private function create_label($attrname, $label='', $type='', $pos=0, $size=0, $elementtype='member', $unique=0, $required=0, $param='', $alwayseditable=0, $perms='', $list=0, $ishidden=0, $default='', $computed='') { - global $conf; + global $conf,$user; if ($elementtype == 'thirdparty') $elementtype='societe'; if ($elementtype == 'contact') $elementtype='socpeople'; @@ -305,7 +305,26 @@ class ExtraFields $params=''; } - $sql = "INSERT INTO ".MAIN_DB_PREFIX."extrafields(name, label, type, pos, size, entity, elementtype, fieldunique, fieldrequired, param, alwayseditable, perms, list, ishidden, fielddefault, fieldcomputed)"; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."extrafields("; + $sql.= " name,"; + $sql.= " label,"; + $sql.= " type,"; + $sql.= " pos,"; + $sql.= " size,"; + $sql.= " elementtype,"; + $sql.= " fieldunique,"; + $sql.= " fieldrequired,"; + $sql.= " param,"; + $sql.= " alwayseditable,"; + $sql.= " perms,"; + $sql.= " list,"; + $sql.= " ishidden,"; + $sql.= " fielddefault,"; + $sql.= " fieldcomputed,"; + $sql.= " fk_user_author,"; + $sql.= " fk_user_modif,"; + $sql.= " datec"; + $sql.= " )"; $sql.= " VALUES('".$attrname."',"; $sql.= " '".$this->db->escape($label)."',"; $sql.= " '".$type."',"; @@ -321,8 +340,10 @@ class ExtraFields $sql.= " ".$list.","; $sql.= " ".$ishidden.","; $sql.= " ".($default?"'".$this->db->escape($default)."'":"null").","; - $sql.= " ".($computed?"'".$this->db->escape($computed)."'":"null"); - $sql.=')'; + $sql.= " ".($computed?"'".$this->db->escape($computed)."'":"null").","; + $sql .= " " . $user->id . ","; + $sql .= " " . $user->id . ","; + $sql .= "'" . $this->db->idate(dol_now()) . "'"; dol_syslog(get_class($this)."::create_label", LOG_DEBUG); if ($this->db->query($sql)) @@ -562,7 +583,7 @@ class ExtraFields */ private function update_label($attrname,$label,$type,$size,$elementtype,$unique=0,$required=0,$pos=0,$param='',$alwayseditable=0,$perms='',$list=0,$ishidden=0,$default='',$computed='') { - global $conf; + global $conf, $user; dol_syslog(get_class($this)."::update_label ".$attrname.", ".$label.", ".$type.", ".$size.", ".$elementtype.", ".$unique.", ".$required.", ".$pos.", ".$alwayseditable.", ".$perms.", ".$list.", ".$ishidden.", ".$default.", ".$computed); // Clean parameters @@ -603,7 +624,10 @@ class ExtraFields $sql.= " list,"; $sql.= " ishidden,"; $sql.= " fielddefault,"; - $sql.= " fieldcomputed"; + $sql.= " fieldcomputed,"; + $sql.= " fk_user_author,"; + $sql.= " fk_user_modif,"; + $sql.= " datec"; $sql.= ") VALUES ("; $sql.= "'".$attrname."',"; $sql.= " ".$conf->entity.","; @@ -620,7 +644,10 @@ class ExtraFields $sql.= " ".$list.", "; $sql.= " ".$ishidden.", "; $sql.= " ".($default?"'".$this->db->escape($default)."'":"null").","; - $sql.= " ".($computed?"'".$this->db->escape($computed)."'":"null"); + $sql.= " ".($computed?"'".$this->db->escape($computed)."'":"null").","; + $sql .= " " . $user->id . ","; + $sql .= " " . $user->id . ","; + $sql .= "'" . $this->db->idate(dol_now()) . "'"; $sql.= ")"; $resql2=$this->db->query($sql); diff --git a/htdocs/install/mysql/tables/llx_extrafields.sql b/htdocs/install/mysql/tables/llx_extrafields.sql index aee51524e6f..101254ea186 100644 --- a/htdocs/install/mysql/tables/llx_extrafields.sql +++ b/htdocs/install/mysql/tables/llx_extrafields.sql @@ -37,5 +37,9 @@ create table llx_extrafields param text, -- extra parameters to define possible values of field list integer DEFAULT 0, -- list of values for field that are combo lists langs varchar(24), -- example: fileofmymodule@mymodule - ishidden integer DEFAULT 0 -- ??? example of use case ??? + ishidden integer DEFAULT 0, -- Can be foreign key of external system + fk_user_author integer, -- user making creation + fk_user_modif integer, -- user making last change + datec datetime, -- date de creation + tms timestamp )ENGINE=innodb; diff --git a/htdocs/install/pgsql/functions/functions.sql b/htdocs/install/pgsql/functions/functions.sql index 06ef2ed41e3..e5b9d47a0ba 100644 --- a/htdocs/install/pgsql/functions/functions.sql +++ b/htdocs/install/pgsql/functions/functions.sql @@ -165,6 +165,7 @@ CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_usergroup_extrafield CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_product_price_by_qty FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_website FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_website_page FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); +CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); -- Add triggers for timestamp fields named date_m From cdcbff2a8529bc107520ba306f9f9ba4a97cdacd Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Tue, 25 Jul 2017 12:20:51 +0200 Subject: [PATCH 12/14] NEW : generate invoice PDF on disount application or payment --- htdocs/compta/facture/card.php | 16 ++++++++++++++++ .../compta/paiement/class/paiement.class.php | 18 ++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index d77f83cbb2e..b89329941bb 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -400,6 +400,22 @@ if (empty($reshook)) setEventMessages($discount->error, $discount->errors, 'errors'); } } + + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) + { + $outputlangs = $langs; + $newlang = ''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09'); + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; + if (! empty($newlang)) { + $outputlangs = new Translate("", $conf); + $outputlangs->setDefaultLang($newlang); + } + $ret = $object->fetch($id); // Reload to get new records + + $result = $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); + } } else if ($action == 'setref_client' && $user->rights->facture->creer) diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index f4e61380a9c..8e67825c085 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -337,6 +337,24 @@ class Paiement extends CommonObject $error++; } } + } + + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) + { + $outputlangs = $langs; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $invoice->thirdparty->default_lang; + if (! empty($newlang)) { + $outputlangs = new Translate("", $conf); + $outputlangs->setDefaultLang($newlang); + } + $ret = $invoice->fetch($id); // Reload to get new records + + $result = $invoice->generateDocument($invoice->modelpdf, $outputlangs); + if ($result < 0) { + setEventMessages($invoice->error, $invoice->errors, 'errors'); + $error++; + } + } } } From 6e8498465ac7fa61d651b0489f0aa1ba23adce12 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 Jul 2017 20:01:47 +0200 Subject: [PATCH 13/14] Update extrafields.class.php --- htdocs/core/class/extrafields.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 63f15bfcf79..cd38a2fcd6a 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -311,6 +311,7 @@ class ExtraFields $sql.= " type,"; $sql.= " pos,"; $sql.= " size,"; + $sql.= " entity,"; $sql.= " elementtype,"; $sql.= " fieldunique,"; $sql.= " fieldrequired,"; From 0e23b04fab681c68c25b837e41e67e2715e824fa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 Jul 2017 20:04:10 +0200 Subject: [PATCH 14/14] Update extrafields.class.php --- htdocs/core/class/extrafields.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index cd38a2fcd6a..966f3f859c0 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -345,7 +345,8 @@ class ExtraFields $sql .= " " . $user->id . ","; $sql .= " " . $user->id . ","; $sql .= "'" . $this->db->idate(dol_now()) . "'"; - + $sql.=')'; + dol_syslog(get_class($this)."::create_label", LOG_DEBUG); if ($this->db->query($sql)) {