diff --git a/ChangeLog b/ChangeLog
index efe4c3c2eb1..f6d72624b4d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,7 @@ Fix: Bad rounding on margin calculations and display.
Fix: Option drop table into backup was broken.
Fix: [ bug #1105 ] Searching Boxes other search option
Fix: wrong buy price update
+Fix :[ bug #1142 ] Set paiement on invoice (PGSql)
***** ChangeLog for 3.4.1 compared to 3.4.0 *****
Fix: Display buying price on line edit when no supplier price is defined
diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index 02a60d4764a..f1423681e4b 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -3674,16 +3674,16 @@ else if ($id > 0 || ! empty($ref))
// By default if $action=='presend'
$titreform='SendBillByMail';
$topicmail='SendBillRef';
- $action='send';
$modelmail='facture_send';
if ($action == 'prerelance') // For backward compatibility
{
$titrefrom='SendReminderBillByMail';
$topicmail='SendReminderBillRef';
- $action='relance';
$modelmail='facture_relance';
+ $action='relance';
}
+ else $action='send';
$ref = dol_sanitizeFileName($object->ref);
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
diff --git a/htdocs/core/modules/project/pdf/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/pdf/doc_generic_project_odt.modules.php
index bb81a07272a..e8c8076230b 100644
--- a/htdocs/core/modules/project/pdf/doc_generic_project_odt.modules.php
+++ b/htdocs/core/modules/project/pdf/doc_generic_project_odt.modules.php
@@ -522,7 +522,6 @@ class doc_generic_project_odt extends ModelePDFProjects
else // Text
{
$odfHandler->setVars($key, $value, true, 'UTF-8');
- $odfHandler->setVarsHeadFooter($key, $value, true, 'UTF-8');
}
}
catch(OdfException $e)
diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php
index f9ab0cd0cab..e4c0e27ce47 100644
--- a/htdocs/fourn/facture/paiement.php
+++ b/htdocs/fourn/facture/paiement.php
@@ -265,7 +265,7 @@ if ($action == 'create' || $action == 'add_paiement')
$sql.= ' AND f.fk_soc = '.$object->socid;
$sql.= ' AND f.paye = 0';
$sql.= ' AND f.fk_statut = 1'; // Statut=0 => non validee, Statut=2 => annulee
- $sql.= ' GROUP BY f.rowid, f.ref_supplier, f.total_ht, f.total_ttc, f.datef';
+ $sql.= ' GROUP BY f.rowid, f.ref, f.ref_supplier, f.total_ht, f.total_ttc, f.datef';
$resql = $db->query($sql);
if ($resql)
{
diff --git a/htdocs/includes/odtphp/odf.php b/htdocs/includes/odtphp/odf.php
index 94c69705442..d2cb8e0b6e1 100644
--- a/htdocs/includes/odtphp/odf.php
+++ b/htdocs/includes/odtphp/odf.php
@@ -128,33 +128,6 @@ class Odf
return $this;
}
- /**
- * Assing a template variable
- *
- * @param string $key name of the variable within the template
- * @param string $value replacement value
- * @param bool $encode if true, special XML characters are encoded
- * @throws OdfException
- * @return odf
- */
- public function setVarsHeadFooter($key, $value, $encode = true, $charset = 'ISO-8859')
- {
- $tag = $this->config['DELIMITER_LEFT'] . $key . $this->config['DELIMITER_RIGHT'];
- // TODO Warning string may be:
- //
';
- if (strpos($this->stylesXml, $tag) === false && strpos($this->stylesXml , $tag) === false) {
- //if (strpos($this->contentXml, '">'. $key . '') === false) {
- throw new OdfException("var $key not found in the document");
- //}
- }
- $value = $encode ? htmlspecialchars($value) : $value;
- $value = ($charset == 'ISO-8859') ? utf8_encode($value) : $value;
- $this->vars[$tag] = str_replace("\n", "
| '.$langs->trans("Ref").' | |||
| '.$langs->trans("Ref").' | |||
| '.$langs->trans("Label").' | |||
| '.$langs->trans('Country').' | '; - $img=picto_from_langcode($object->country_code); - print ($img?$img.' ':''); + if (! empty($object->country_code)) + { + $img=picto_from_langcode($object->country_code); + print ($img?$img.' ':''); + } print $object->country; print ' | ||