From cb86cd403ca9493cb0fa7e265fa9e9ebdce98784 Mon Sep 17 00:00:00 2001 From: Florian Henry Date: Tue, 3 Sep 2013 20:01:10 +0200 Subject: [PATCH 1/3] Fix: Delete linked element to supplier invoice when deleted (as done for all other object into dolibarr) --- ChangeLog | 1 + htdocs/fourn/class/fournisseur.facture.class.php | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index efdc41b902a..80eabc9a8fe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,6 +21,7 @@ Fix: Mailing module : if an email is already in destinaires list all other email Fix: Localtaxes balance not showing Fix: Intervention box links to contracts id Fix: Compatiblity with multicompany module +Fix: Delete linked element to supplier invoice when deleted ***** ChangeLog for 3.4 compared to 3.3.* ***** For users: diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 19912e3f58f..be2ce721356 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -629,6 +629,13 @@ class FactureFournisseur extends CommonInvoice // Fin appel triggers } + if (! $error) + { + // Delete linked object + $res = $this->deleteObjectLinked(); + if ($res < 0) $error++; + } + if (! $error) { // We remove directory From ddeca06f329467b127fd865026f6cbe499ebd946 Mon Sep 17 00:00:00 2001 From: Florian Henry Date: Tue, 3 Sep 2013 21:13:05 +0200 Subject: [PATCH 2/3] Real ref filter --- htdocs/fourn/facture/index.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/index.php b/htdocs/fourn/facture/index.php index 540cbebea12..8e9d8debab9 100644 --- a/htdocs/fourn/facture/index.php +++ b/htdocs/fourn/facture/index.php @@ -168,6 +168,8 @@ if (GETPOST("search_montant_ttc")) $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($limit+1, $offset); + +dol_syslog("fourn/facture/index.php::list sql=".$sql, LOG_DEBUG); $resql = $db->query($sql); if ($resql) { @@ -193,7 +195,7 @@ if ($resql) print '
'; print ''; print ''; - print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"fac.ref,fac.rowid","",$param,"",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"fac.rowid,fac.ref","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("RefSupplier"),$_SERVER["PHP_SELF"],"ref_supplier","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"fac.datef,fac.rowid","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateDue"),$_SERVER["PHP_SELF"],"fac.date_lim_reglement","",$param,'align="center"',$sortfield,$sortorder); From 2740cc78b6c81eb3c6853d04f7c744cde0c37121 Mon Sep 17 00:00:00 2001 From: Florian Henry Date: Thu, 5 Sep 2013 17:45:30 +0200 Subject: [PATCH 3/3] Add dol_syslog Fix bug on expedition create : create expedition with rowid (or origin_id) that already exits, and you will have all product of the other expedition and the new expedition form order Revert previous commit filter sort on fourn/facture/index.php --- ChangeLog | 1 + htdocs/expedition/class/expedition.class.php | 2 ++ htdocs/expedition/fiche.php | 2 ++ htdocs/fourn/facture/index.php | 2 +- 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 80eabc9a8fe..5e80d99f106 100644 --- a/ChangeLog +++ b/ChangeLog @@ -79,6 +79,7 @@ For users: - Fix: [Bug #958] LocalTax2 for Spain fails on Suppliers - Fix: [ bug #972 ] Auto completion contact field do not take account the min caract number before search - Fix: [ bug #971 ] html.form.class.php select_contact with autocomplete do not exclude id from exclude array +- Fix: Expedition creation, can retreive product from other expedition For translators: - Update language files. diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 888dd6c5eb0..90b1b89d1a5 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -224,6 +224,7 @@ class Expedition extends CommonObject $sql.= ", ".(!empty($this->model_pdf)?"'".$this->db->escape($this->model_pdf)."'":"null"); $sql.= ")"; + dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -323,6 +324,7 @@ class Expedition extends CommonObject $sql.= ", ".$qty; $sql.= ")"; + dol_syslog(get_class($this)."::create_line sql=".$sql, LOG_DEBUG); if (! $this->db->query($sql)) { $error++; diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php index d761480a74f..a5ec2e016c6 100644 --- a/htdocs/expedition/fiche.php +++ b/htdocs/expedition/fiche.php @@ -87,6 +87,8 @@ if ($id > 0 || ! empty($ref)) if ($action == 'add') { $error=0; + + $object = new Expedition($db); $db->begin(); diff --git a/htdocs/fourn/facture/index.php b/htdocs/fourn/facture/index.php index 8e9d8debab9..b15695aa653 100644 --- a/htdocs/fourn/facture/index.php +++ b/htdocs/fourn/facture/index.php @@ -195,7 +195,7 @@ if ($resql) print ''; print '
'; print ''; - print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"fac.rowid,fac.ref","",$param,"",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"fac.ref,fac.rowid","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("RefSupplier"),$_SERVER["PHP_SELF"],"ref_supplier","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"fac.datef,fac.rowid","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateDue"),$_SERVER["PHP_SELF"],"fac.date_lim_reglement","",$param,'align="center"',$sortfield,$sortorder);