diff --git a/ChangeLog b/ChangeLog
index 30887bd8379..567c3eaf542 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -229,6 +229,7 @@ Dolibarr better:
FIX [ bug #2855 ] Wrong translation key in localtax report page
FIX [ bug #1852 ] JS error when editing a customer order line
FIX [ bug #2900 ] Courtesy title is not stored in create thirdparty form
+FIX [ bug #3055 ] Product image thumbnails were not deleted after deleting the image
***** ChangeLog for 3.7.1 compared to 3.7.* *****
FIX Bug in the new photo system
@@ -485,6 +486,7 @@ Dolibarr better:
- Fix: [ bug #2542 ] Contracts store localtax preferences
- Fix: Bad permission assignments for stock movements actions
- Fix: [ bug #2891 ] Category hooks do not work
+- Fix: [ bug #2696 ] Adding complementary attribute fails if code is numerics
***** ChangeLog for 3.6.2 compared to 3.6.1 *****
- Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice.
@@ -664,6 +666,10 @@ Fix: [ bug #2861 ] Undefined variable $res when migrating
Fix: [ bug #2837 ] Product list table column header does not match column body
Fix: [ bug #2835 ] Customer prices of a product shows incorrect history order
Fix: [ bug #2814 ] JPEG photos are not displayed in Product photos page
+Fix: [ bug #2715 ] Statistics page has broken layout with long thirdparty names
+Fix: [ bug #2570 ] [Contacts] Page should not process if ID is invalid
+Fix: [ bug #3268 ] SQL error when accessing thirdparty log page without a socid parameter
+Fix: [ bug #3180 ] formObjectOptions hook when editing thirdparty card does not print result
***** ChangeLog for 3.5.6 compared to 3.5.5 *****
Fix: Avoid missing class error for fetch_thirdparty method #1973
diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php
index f336cefda98..b1cd1442f08 100644
--- a/htdocs/compta/bank/class/account.class.php
+++ b/htdocs/compta/bank/class/account.class.php
@@ -1263,7 +1263,7 @@ class AccountLine extends CommonObject
if ($this->rappro)
{
// Protection to avoid any delete of consolidated lines
- $this->error="DeleteNotPossibleLineIsConsolidated";
+ $this->error="ErrorDeleteNotPossibleLineIsConsolidated";
return -1;
}
diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php
index 3dc2461de28..4eeea76abc0 100644
--- a/htdocs/compta/facture/stats/index.php
+++ b/htdocs/compta/facture/stats/index.php
@@ -218,6 +218,13 @@ complete_head_from_modules($conf,$langs,null,$head,$h,$type);
dol_fiche_head($head,'byyear',$langs->trans("Statistics"));
+$tmp_companies = $form->select_thirdparty_list($socid,'socid',$filter,1, 0, 0, array(), '', 1);
+//Array passed as an argument to Form::selectarray to build a proper select input
+$companies = array();
+
+foreach ($tmp_companies as $value) {
+ $companies[$value['value']] = $value['label'];
+}
print '
';
@@ -233,7 +240,7 @@ print '
';
print '
'.$langs->trans("ThirdParty").'
';
if ($mode == 'customer') $filter='s.client in (1,2,3)';
if ($mode == 'supplier') $filter='s.fournisseur = 1';
- print $form->select_company($socid,'socid',$filter,1);
+ print $form->selectarray('socid', $companies, $socid, 1, 0, 0, 'style="width: 100%"');
print '
';
// User
print '
'.$langs->trans("CreatedBy").'
';
diff --git a/htdocs/compta/prelevement/class/rejetprelevement.class.php b/htdocs/compta/prelevement/class/rejetprelevement.class.php
index 2ef37c29e18..820d3a34fcc 100644
--- a/htdocs/compta/prelevement/class/rejetprelevement.class.php
+++ b/htdocs/compta/prelevement/class/rejetprelevement.class.php
@@ -87,7 +87,7 @@ class RejetPrelevement
dol_syslog("RejetPrelevement::Create id $id");
$bankaccount = $conf->global->PRELEVEMENT_ID_BANKACCOUNT;
- $facs = $this->getListInvoices();
+ $facs = $this->getListInvoices(1);
$this->db->begin();
@@ -132,7 +132,7 @@ class RejetPrelevement
for ($i = 0; $i < $num; $i++)
{
$fac = new Facture($this->db);
- $fac->fetch($facs[$i]);
+ $fac->fetch($facs[$i][0]);
// Make a negative payment
$pai = new Paiement($this->db);
@@ -144,7 +144,7 @@ class RejetPrelevement
* PHP installs sends only the part integer negative
*/
- $pai->amounts[$facs[$i]] = price2num($fac->total_ttc * -1);
+ $pai->amounts[$facs[$i][0]] = price2num($facs[$i][1] * -1);
$pai->datepaye = $date_rejet;
$pai->paiementid = 3; // type of payment: withdrawal
$pai->num_paiement = $fac->ref;
@@ -152,7 +152,7 @@ class RejetPrelevement
if ($pai->create($this->user) < 0) // we call with no_commit
{
$error++;
- dol_syslog("RejetPrelevement::Create Error creation payment invoice ".$facs[$i]);
+ dol_syslog("RejetPrelevement::Create Error creation payment invoice ".$facs[$i][0]);
}
else
{
@@ -270,22 +270,24 @@ class RejetPrelevement
}
/**
- * Retrieve the list of invoices
+ * Retrieve the list of invoices
*
- * @return array
+ * @param int $amounts If you want to get the amount of the order for each invoice
+ * @return array Array List of invoices related to the withdrawal line
+ * @TODO A withdrawal line is today linked to one and only one invoice. So the function should return only one object ?
*/
- private function getListInvoices()
+ private function getListInvoices($amounts=0)
{
global $conf;
$arr = array();
//Returns all invoices of a withdrawal
- $sql = "SELECT f.rowid as facid";
+ $sql = "SELECT f.rowid as facid, pl.amount";
$sql.= " FROM ".MAIN_DB_PREFIX."prelevement_facture as pf";
- $sql.= ", ".MAIN_DB_PREFIX."facture as f";
+ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON (pf.fk_facture = f.rowid)";
+ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."prelevement_lignes as pl ON (pf.fk_prelevement_lignes = pl.rowid)";
$sql.= " WHERE pf.fk_prelevement_lignes = ".$this->id;
- $sql.= " AND pf.fk_facture = f.rowid";
$sql.= " AND f.entity = ".$conf->entity;
$resql=$this->db->query($sql);
@@ -299,7 +301,14 @@ class RejetPrelevement
while ($i < $num)
{
$row = $this->db->fetch_row($resql);
- $arr[$i] = $row[0];
+ if (!$amounts) $arr[$i] = $row[0];
+ else
+ {
+ $arr[$i] = array(
+ $row[0],
+ $row[1]
+ );
+ }
$i++;
}
}
@@ -307,7 +316,7 @@ class RejetPrelevement
}
else
{
- dol_syslog("RejetPrelevement Erreur");
+ dol_syslog("getListInvoices", LOG_ERR);
}
return $arr;
diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php
index 45b2c51acfa..ade44bff415 100644
--- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php
+++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php
@@ -317,16 +317,19 @@ class PaymentSocialContribution extends CommonObject
global $conf, $langs;
$error=0;
+ dol_syslog(get_class($this)."::delete");
+
$this->db->begin();
- if (! $error)
+ if ($this->bank_line > 0)
{
- $sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_url";
- $sql.= " WHERE type='payment_sc' AND url_id=".$this->id;
-
- dol_syslog(get_class($this)."::delete", LOG_DEBUG);
- $resql = $this->db->query($sql);
- if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
+ $accline = new AccountLine($this->db);
+ $accline->fetch($this->bank_line);
+ $result = $accline->delete();
+ if($result < 0) {
+ $this->errors[] = $accline->error;
+ $error++;
+ }
}
if (! $error)
diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php
index 0278a864c2f..29d266eff51 100644
--- a/htdocs/contact/card.php
+++ b/htdocs/contact/card.php
@@ -809,7 +809,7 @@ else
print '