From 395209a5dbaee724a516e2958d505deaa56212dd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Sep 2014 15:17:05 +0200 Subject: [PATCH 1/7] Fix: Reason to have button greyed is wrong Conflicts: htdocs/compta/facture/prelevement.php --- htdocs/compta/facture/prelevement.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index e579bc21640..81505af34ee 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -1,7 +1,7 @@ * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2004-2010 Laurent Destailleur + * Copyright (C) 2004-2014 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2010 Juanjo Menent * @@ -142,7 +142,7 @@ if ($object->id > 0) /* * Facture - */ + */ print ''; $linkback = ''.$langs->trans("BackToList").''; @@ -450,7 +450,7 @@ if ($object->id > 0) /* * Buttons - */ + */ print "\n
\n"; // Add a withdraw request @@ -467,7 +467,11 @@ if ($object->id > 0) } else { - if ($num == 0) print ''.$langs->trans("MakeWithdrawRequest").''; + if ($num == 0) + { + if ($object->statut > 0) print ''.$langs->trans("MakeWithdrawRequest").''; + else print ''.$langs->trans("MakeWithdrawRequest").''; + } else print ''.$langs->trans("MakeWithdrawRequest").''; } From b88b4fbc2cbf1f50852aa7ac2be6b8ae1415e126 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Sep 2014 14:43:16 +0200 Subject: [PATCH 2/7] Fix: bad balance of td --- htdocs/core/class/html.formfile.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 9299702a1bb..1cdf6fd194e 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -1148,7 +1148,7 @@ class FormFile print ''; print '
'; print ''; - print ''; @@ -1163,7 +1163,7 @@ class FormFile print ''; print ''; print ''; - print ''; } From da8a1cb47507cfcb2fea6888b8166c71df5fdf0c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Sep 2014 15:38:20 +0200 Subject: [PATCH 3/7] Fix: Iban was used instead of Bic into SEPA file. Fix: Must unaccent strings into SEPA file. --- ChangeLog | 2 ++ .../class/bonprelevement.class.php | 27 ++++++++++--------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index e060f84ad15..f8193c0ce1d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,8 @@ For users: - Fix: Trigger on create category call failed because user is not passed on card - Fix: list event view lost type event filter - Fix: Save also code event +- Fix: Iban was used instead of Bic into SEPA file. +- Fix: Must unaccent strings into SEPA file. ***** ChangeLog for 3.6 compared to 3.5.* ***** For users: diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 417f4362000..5c21c3c5fbf 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -1219,11 +1219,11 @@ class BonPrelevement extends CommonObject /** - * Generate a withdrawal file. Generation Formats: - * France: CFONB - * Spain: AEB19 (if external module EsAEB is enabled) - * Others: Warning message - * File is generated with name this->filename + * Generate a withdrawal file. + * Generation Formats: + * - Europe: SEPA (France: CFONB no more supported, Spain: AEB19 if external module EsAEB is enabled) + * - Others countries: Warning message + * File is generated with name this->filename * * @return int 0 if OK, <0 if KO */ @@ -1410,7 +1410,7 @@ class BonPrelevement extends CommonObject fputs($this->file, ' '.$CrLf); fputs($this->file, ' '.$CrLf); fputs($this->file, ''.$CrLf); - + $sql = "SELECT pl.amount"; $sql.= " FROM"; $sql.= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,"; @@ -1419,14 +1419,14 @@ class BonPrelevement extends CommonObject $sql.= " WHERE pl.fk_prelevement_bons = ".$this->id; $sql.= " AND pl.rowid = pf.fk_prelevement_lignes"; $sql.= " AND pf.fk_facture = f.rowid"; - + //Lines $i = 0; $resql=$this->db->query($sql); if ($resql) { $num = $this->db->num_rows($resql); - + while ($i < $num) { $obj = $this->db->fetch_object($resql); @@ -1574,7 +1574,7 @@ class BonPrelevement extends CommonObject * @param string $row_bic rib.bic AS bic, * @param string $row_datec soc.datec, * @param string $row_drum soc.rowid AS drum - * @return void + * @return string Return string with SEPA part DrctDbtTxInf */ function EnregDestinataireSEPA($row_code_client, $row_nom, $row_address, $row_zip, $row_town, $row_country_code, $row_cb, $row_cg, $row_cc, $row_somme, $row_facnumber, $row_idfac, $row_iban, $row_bic, $row_datec, $row_drum) { @@ -1598,15 +1598,15 @@ class BonPrelevement extends CommonObject $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$CrLf; - $XML_DEBITOR .=' '.$row_iban.''.$CrLf; + $XML_DEBITOR .=' '.$row_bic.''.$CrLf; $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$CrLf; - $XML_DEBITOR .=' '.strtoupper($row_nom).''.$CrLf; + $XML_DEBITOR .=' '.strtoupper(dol_string_unaccent($row_nom)).''.$CrLf; $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$row_country_code.''.$CrLf; $XML_DEBITOR .=' '.strtr($row_adr, array(CHR(13) => ", ", CHR(10) => "")).''.$CrLf; - $XML_DEBITOR .=' '.$row_zip.' '.$row_town.''.$CrLf; + $XML_DEBITOR .=' '.dol_string_unaccent($row_zip.' '.$row_town).''.$CrLf; $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$CrLf; @@ -1689,7 +1689,8 @@ class BonPrelevement extends CommonObject } /** - * Write sender of request (me) + * Write sender of request (me). + * Note: The tag PmtInf is opened here but closed into caller * * @param string $configuration conf * @param date $ladate Date From cd00ec29bf6f307c74d301599f4fcbb3ce757ef9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Sep 2014 19:00:28 +0200 Subject: [PATCH 4/7] Fix: Dictionnary with one n Conflicts: htdocs/expedition/fiche.php --- htdocs/expedition/fiche.php | 4 ++-- htdocs/fichinter/fiche.php | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php index 9a52ce47788..f676c1b2138 100644 --- a/htdocs/expedition/fiche.php +++ b/htdocs/expedition/fiche.php @@ -698,7 +698,7 @@ if ($action == 'create') print '\n"; // Tracking number @@ -1262,7 +1262,7 @@ else if ($id || $ref) print ''; $object->fetch_delivery_methods(); print $form->selectarray("shipping_method_id",$object->meths,$object->shipping_method_id,1,0,0,"",1); - if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1); + if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print ''; print ''; } diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php index fcd03755136..bf0583ce0ba 100644 --- a/htdocs/fichinter/fiche.php +++ b/htdocs/fichinter/fiche.php @@ -63,6 +63,7 @@ $confirm = GETPOST('confirm','alpha'); $mesg = GETPOST('msg','alpha'); $origin=GETPOST('origin','alpha'); $originid=(GETPOST('originid','int')?GETPOST('originid','int'):GETPOST('origin_id','int')); // For backward compatibility +$note_public = GETPOST('note_public'); //PDF $hidedetails = (GETPOST('hidedetails','int') ? GETPOST('hidedetails','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0)); @@ -919,8 +920,8 @@ if ($action == 'create') $soc = $objectsrc->client; - $note_private = (! empty($objectsrc->note) ? $objectsrc->note : (! empty($objectsrc->note_private) ? $objectsrc->note_private : '')); - $note_public = (! empty($objectsrc->note_public) ? $objectsrc->note_public : ''); + $note_private = (! empty($objectsrc->note) ? $objectsrc->note : (! empty($objectsrc->note_private) ? $objectsrc->note_private : GETPOST('note_private'))); + $note_public = (! empty($objectsrc->note_public) ? $objectsrc->note_public : GETPOST('note_public')); // Object source contacts list $srccontactslist = $objectsrc->liste_contact(-1,'external',1); @@ -928,8 +929,6 @@ if ($action == 'create') } else { $projectid = GETPOST('projectid','int'); - $note_private = ''; - $note_public = ''; } if (! $conf->global->FICHEINTER_ADDON) @@ -966,7 +965,7 @@ if ($action == 'create') // Description (must be a textarea and not html must be allowed (used in list view) print ''; print ''; // Project From 643fc6c61f8ae7ea4d726be32a2a68ec54f185c3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Sep 2014 19:03:48 +0200 Subject: [PATCH 5/7] Fix: Bad use of fetch_lines Conflicts: htdocs/comm/propal.php htdocs/contrat/fiche.php htdocs/opensurvey/class/opensurveysondage.class.php --- htdocs/commande/fiche.php | 17 +++++++---- htdocs/commande/orderstoinvoice.php | 10 +++++-- htdocs/compta/facture.php | 6 +++- htdocs/contrat/fiche.php | 28 +++++++++++-------- htdocs/expedition/fiche.php | 2 -- htdocs/fichinter/class/fichinter.class.php | 4 +-- htdocs/fichinter/fiche.php | 12 ++++++-- htdocs/fourn/facture/fiche.php | 6 +++- htdocs/livraison/class/livraison.class.php | 2 +- htdocs/livraison/fiche.php | 11 ++++---- .../class/opensurveysondage.class.php | 4 +-- htdocs/opensurvey/public/studs.php | 2 +- htdocs/opensurvey/results.php | 2 +- 13 files changed, 68 insertions(+), 38 deletions(-) diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 8f6df313506..25c8d068ae1 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -269,10 +269,12 @@ else if ($action == 'add' && $user->rights->commande->creer) { if ($ret < 0) $error ++; - if (! $error) { + if (! $error) + { $object_id = $object->create($user); - if ($object_id > 0) { + if ($object_id > 0) + { dol_include_once('/' . $element . '/class/' . $subelement . '.class.php'); $classname = ucfirst($subelement); @@ -280,15 +282,20 @@ else if ($action == 'add' && $user->rights->commande->creer) { dol_syslog("Try to find source object origin=" . $object->origin . " originid=" . $object->origin_id . " to add lines"); $result = $srcobject->fetch($object->origin_id); - if ($result > 0) { + if ($result > 0) + { $lines = $srcobject->lines; if (empty($lines) && method_exists($srcobject, 'fetch_lines')) - $lines = $srcobject->fetch_lines(); + { + $srcobject->fetch_lines(); + $lines = $srcobject->lines; + } $fk_parent_line = 0; $num = count($lines); - for($i = 0; $i < $num; $i ++) { + for($i = 0; $i < $num; $i ++) + { $label = (! empty($lines [$i]->label) ? $lines [$i]->label : ''); $desc = (! empty($lines [$i]->desc) ? $lines [$i]->desc : $lines [$i]->libelle); $product_type = (! empty($lines [$i]->product_type) ? $lines [$i]->product_type : 0); diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php index bdb96718dfa..5332690e40b 100644 --- a/htdocs/commande/orderstoinvoice.php +++ b/htdocs/commande/orderstoinvoice.php @@ -97,7 +97,7 @@ if (($action == 'create' || $action == 'add') && empty($mesgs)) require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php'; if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; - + $langs->load('bills'); $langs->load('products'); $langs->load('main'); @@ -213,13 +213,17 @@ if (($action == 'create' || $action == 'add') && empty($mesgs)) $result=$objectsrc->fetch($orders_id[$ii]); if ($result > 0) { - if ($closeOrders) + if ($closeOrders) { $objectsrc->classifyBilled(); $objectsrc->setStatut(3); } $lines = $objectsrc->lines; - if (empty($lines) && method_exists($objectsrc,'fetch_lines')) $lines = $objectsrc->fetch_lines(); + if (empty($lines) && method_exists($objectsrc, 'fetch_lines')) + { + $objectsrc->fetch_lines(); + $lines = $objectsrc->lines; + } $fk_parent_line=0; $num=count($lines); for ($i=0;$i<$num;$i++) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 8138c56450e..0e237af632c 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -924,7 +924,11 @@ else if ($action == 'add' && $user->rights->facture->creer) if ($result > 0) { $lines = $srcobject->lines; - if (empty($lines) && method_exists($srcobject, 'fetch_lines')) $lines = $srcobject->fetch_lines(); + if (empty($lines) && method_exists($srcobject, 'fetch_lines')) + { + $srcobject->fetch_lines(); + $lines = $srcobject->lines; + } $fk_parent_line=0; $num=count($lines); diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php index 7bcd7fcbc8d..38a2b3f1095 100644 --- a/htdocs/contrat/fiche.php +++ b/htdocs/contrat/fiche.php @@ -250,7 +250,11 @@ if ($action == 'add' && $user->rights->contrat->creer) { $srcobject->fetch_thirdparty(); $lines = $srcobject->lines; - if (empty($lines) && method_exists($srcobject,'fetch_lines')) $lines = $srcobject->fetch_lines(); + if (empty($lines) && method_exists($srcobject,'fetch_lines')) + { + $srcobject->fetch_lines(); + $lines = $srcobject->lines; + } $fk_parent_line=0; $num=count($lines); @@ -337,10 +341,10 @@ if ($action == 'add' && $user->rights->contrat->creer) } else { - + // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost($extralabels, $object); - + $result = $object->create($user); if ($result > 0) { @@ -715,7 +719,7 @@ else if ($action == 'confirm_move' && $confirm == 'yes' && $user->rights->contra $error ++; if (! $error) { - + $result = $object->insertExtraFields(); if ($result < 0) { $error ++; @@ -948,7 +952,7 @@ if ($action == 'create') // Other attributes $parameters=array('objectsrc' => $objectsrc,'colspan' => ' colspan="3"'); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook - + // Other attributes if (empty($reshook) && ! empty($extrafields->attribute_label)) { print $object->showOptionals($extrafields, 'edit'); @@ -1112,7 +1116,7 @@ else // Other attributes $parameters=array('colspan' => ' colspan="3"'); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook - + $res = $object->fetch_optionals($object->id, $extralabels); if (empty($reshook) && ! empty($extrafields->attribute_label)) { foreach ($extrafields->attribute_label as $key => $label) { @@ -1132,16 +1136,16 @@ else if (in_array($extrafields->attribute_type [$key], array('date','datetime'))) { $value = isset($_POST ["options_" . $key]) ? dol_mktime($_POST ["options_" . $key . "hour"], $_POST ["options_" . $key . "min"], 0, $_POST ["options_" . $key . "month"], $_POST ["options_" . $key . "day"], $_POST ["options_" . $key . "year"]) : $db->jdate($object->array_options ['options_' . $key]); } - + if ($action == 'edit_extras' && $user->rights->commande->creer && GETPOST('attribute') == $key) { print '
'; print ''; print ''; print ''; print ''; - + print $extrafields->showInputField($key, $value); - + print ''; print ''; } else { @@ -1153,9 +1157,9 @@ else } } } - - - + + + print "
' . dol_print_date(dol_now(), "dayhour", "tzuser") . ''; + print ''; print ''; print ''; print '' . dol_print_date($link->datea, "dayhour", "tzuser") . ''; + print ''; print '' . img_edit() . ''; // id= is included into $param if ($permtodelete) { print '   ' . img_delete() . ''; // id= is included into $param @@ -1176,7 +1176,7 @@ class FormFile } if ($nboflinks == 0) { - print '
'; + print '
'; print $langs->trans("NoLinkFound"); print '
'; $expe->fetch_delivery_methods(); print $form->selectarray("shipping_method_id",$expe->meths,GETPOST('shipping_method_id','int'),1,0,0,"",1); - if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1); + if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print "
'.$langs->trans("Description").''; - print ''; + print ''; print '
"; diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php index f676c1b2138..c11c1d549a9 100644 --- a/htdocs/expedition/fiche.php +++ b/htdocs/expedition/fiche.php @@ -112,7 +112,6 @@ if ($action == 'add') $classname = ucfirst($object->origin); $objectsrc = new $classname($db); $objectsrc->fetch($object->origin_id); - //$object->fetch_lines(); $object->socid = $objectsrc->socid; $object->ref_customer = $objectsrc->ref_client; @@ -717,7 +716,6 @@ if ($action == 'create') * Lignes de commandes */ - //$lines = $object->fetch_lines(1); $numAsked = count($object->lines); print '