From 1b054f1b363ba0a627065a4e4467acf06165ef04 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sat, 27 Oct 2018 09:19:02 +0200 Subject: [PATCH 1/7] Fix invoice creation from contract was invoicing closed services #9087 --- htdocs/compta/facture/card.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 993194e0f91..daff7c95f56 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1196,6 +1196,8 @@ if (empty($reshook)) { // Don't add lines with qty 0 when coming from a shipment including all order lines if($srcobject->element == 'shipping' && $conf->global->SHIPMENT_GETS_ALL_ORDER_PRODUCTS && $lines[$i]->qty == 0) continue; + // Don't add closed lines when coming from a contract + if($srcobject->element == 'contrat' && $lines[$i]->statut == 5) continue; $label=(! empty($lines[$i]->label)?$lines[$i]->label:''); $desc=(! empty($lines[$i]->desc)?$lines[$i]->desc:$lines[$i]->libelle); From d1133916e0041406b7341a8fb6888d925c74bb8f Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Thu, 1 Nov 2018 15:33:14 +0100 Subject: [PATCH 2/7] Fix tracking field in dictionnary should not be mandatory --- htdocs/admin/dict.php | 2 +- htdocs/install/mysql/migration/6.0.0-7.0.0.sql | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 72ac51e1799..c62595ea8a6 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -629,7 +629,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) if ($value == 'formula' && empty($_POST['formula'])) continue; if ($value == 'sortorder') continue; // For a column name 'sortorder', we use the field name 'position' if ((! isset($_POST[$value]) || $_POST[$value]=='') - && (! in_array($listfield[$f], array('decalage','module','accountancy_code','accountancy_code_sell','accountancy_code_buy')) // Fields that are not mandatory + && (! in_array($listfield[$f], array('decalage','module','accountancy_code','accountancy_code_sell','accountancy_code_buy','tracking')) // Fields that are not mandatory && (! ($id == 10 && $listfield[$f] == 'code')) // Code is mandatory fir table 10 ) ) diff --git a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql index c2e17386488..354bf0743bd 100644 --- a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql +++ b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql @@ -716,3 +716,5 @@ ALTER TABLE llx_facture_rec_extrafields ADD INDEX idx_facture_rec_extrafields (f UPDATE llx_cronjob set entity = 1 where entity = 0 and label in ('RecurringInvoices', 'SendEmailsReminders'); UPDATE llx_cronjob set entity = 0 where entity = 1 and label in ('PurgeDeleteTemporaryFilesShort', 'MakeLocalDatabaseDumpShort'); + +ALTER TABLE llx_c_shipment_mode CHANGE COLUMN tracking tracking VARCHAR(255) DEFAULT NULL; \ No newline at end of file From 29c0448a2ed9bc78543b10b0da15778e3c3469c0 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Thu, 1 Nov 2018 15:41:58 +0100 Subject: [PATCH 3/7] Fix parent link was not removed on societe deletion #9106 --- htdocs/societe/class/societe.class.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 2a488aacf44..0a49bb80f1b 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1518,6 +1518,19 @@ class Societe extends CommonObject dol_syslog(get_class($this)."::delete error -3 ".$this->error, LOG_ERR); } } + + // Remove links to subsidiaries companies + if (! $error) + { + $sql = "UPDATE ".MAIN_DB_PREFIX."societe"; + $sql.= " SET parent = NULL"; + $sql.= " WHERE parent = " . $id; + if (! $this->db->query($sql)) + { + $error++; + $this->errors[] = $this->db->lasterror(); + } + } // Remove third party if (! $error) From 263e8ed4afc601f80916349e5360c7b5d9a48005 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Thu, 1 Nov 2018 20:45:08 +0100 Subject: [PATCH 4/7] Fix payout --- htdocs/public/stripe/ipn.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/public/stripe/ipn.php b/htdocs/public/stripe/ipn.php index ad6aee43bd4..ac366da9210 100644 --- a/htdocs/public/stripe/ipn.php +++ b/htdocs/public/stripe/ipn.php @@ -66,6 +66,7 @@ else { $servicestatus = 1; } } + $payload = @file_get_contents("php://input"); $sig_header = $_SERVER["HTTP_STRIPE_SIGNATURE"]; $event = null; @@ -159,7 +160,7 @@ elseif ($event->type == 'payout.paid') { $accountfrom->fetch($conf->global->STRIPE_BANK_ACCOUNT_FOR_PAYMENTS); $accountto=new Account($db); - $accountto->fetch($conf->global->STRIPE_BANK_ACCOUNT_FOR_BANKTRANFERS); + $accountto->fetch($conf->global->STRIPE_BANK_ACCOUNT_FOR_BANKTRANSFERS); if ($accountto->currency_code != $accountfrom->currency_code) { $error++; @@ -353,4 +354,3 @@ elseif ($event->type == 'customer.deleted') { $db->query($sql); $db->commit(); } - From c01113e28bc76e8123f2525c67d637d3a0588e42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 3 Nov 2018 22:49:30 +0100 Subject: [PATCH 5/7] typo --- htdocs/ticket/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/ticket/index.php b/htdocs/ticket/index.php index 9acfd66c3bb..43be6bd2f57 100644 --- a/htdocs/ticket/index.php +++ b/htdocs/ticket/index.php @@ -184,8 +184,8 @@ if ($result) { $dataseries[] = array('label' => $langs->trans("Assigned"), 'data' => round($tick['assigned'])); $dataseries[] = array('label' => $langs->trans("InProgress"), 'data' => round($tick['inprogress'])); $dataseries[] = array('label' => $langs->trans("Waiting"), 'data' => round($tick['waiting'])); - $dataseries[] = array('label' => $langs->trans("Closed"), 'data' => round($tick['Closed'])); - $dataseries[] = array('label' => $langs->trans("Deleted"), 'data' => round($tick['Deleted'])); + $dataseries[] = array('label' => $langs->trans("Closed"), 'data' => round($tick['closed'])); + $dataseries[] = array('label' => $langs->trans("Deleted"), 'data' => round($tick['deleted'])); } } else { dol_print_error($db); From 488ac8c8f0b1fd5a08b6a3eea5452eb4e109095b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 3 Nov 2018 23:44:25 +0100 Subject: [PATCH 6/7] Update index.php --- htdocs/ticket/index.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/htdocs/ticket/index.php b/htdocs/ticket/index.php index 43be6bd2f57..1f01e335a7c 100644 --- a/htdocs/ticket/index.php +++ b/htdocs/ticket/index.php @@ -191,8 +191,7 @@ if ($result) { dol_print_error($db); } -$stringtoshow = ''; -$stringtoshow .= '