diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php
index 3c7cfe0006c..0101805cd88 100644
--- a/htdocs/comm/propal/class/propal.class.php
+++ b/htdocs/comm/propal/class/propal.class.php
@@ -1537,7 +1537,9 @@ class Propal extends CommonObject
$this->note = $obj->note_private; // TODO deprecated
$this->note_private = $obj->note_private;
$this->note_public = $obj->note_public;
- $this->statut = (int) $obj->fk_statut;
+
+ $this->status = (int) $obj->fk_statut;
+ $this->statut = $this->status; // deprecated
$this->statut_libelle = $obj->statut_label;
$this->datec = $this->db->jdate($obj->datec); // TODO deprecated
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index c38e69eaa50..447f9569517 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -4264,7 +4264,7 @@ class Form
elseif ($input['type'] == 'select')
{
$more .= '
';
- if (!empty($input['label'])) $more .= $input['label'].'
';
+ if (!empty($input['label'])) $more .= $input['label'].'
';
$more .= $this->selectarray($input['name'], $input['values'], $input['default'], 1, 0, 0, $moreattr, 0, 0, 0, '', $morecss);
$more .= '
'."\n";
}
diff --git a/htdocs/langs/en_US/propal.lang b/htdocs/langs/en_US/propal.lang
index 71d6857c909..273996ab1b1 100644
--- a/htdocs/langs/en_US/propal.lang
+++ b/htdocs/langs/en_US/propal.lang
@@ -84,3 +84,4 @@ DefaultModelPropalClosed=Default template when closing a business proposal (unbi
ProposalCustomerSignature=Written acceptance, company stamp, date and signature
ProposalsStatisticsSuppliers=Vendor proposals statistics
CaseFollowedBy=Case followed by
+SignedOnly=Signed only
diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php
index 2566dcb104d..c6932e34f45 100644
--- a/htdocs/projet/element.php
+++ b/htdocs/projet/element.php
@@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
-if (!empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
+if (!empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
if (!empty($conf->facture->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
if (!empty($conf->facture->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php';
if (!empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
@@ -635,10 +635,10 @@ foreach($listofreferent as $key => $value)
if ($qualified && isset($margin)) // If this element must be included into profit calculation ($margin is 'minus' or 'add')
{
if ($margin == 'add') {
- $tooltiponprofitplus.=' + '.$name."
\n";
+ $tooltiponprofitplus.=' > '.$name." (+)
\n";
}
if ($margin == 'minus') {
- $tooltiponprofitminus.=' - '.$name."
\n";
+ $tooltiponprofitminus.=' > '.$name." (-)
\n";
}
}
}
@@ -693,7 +693,7 @@ foreach ($listofreferent as $key => $value)
}
if ($key == 'propal')
{
- if ($element->statut == Propal::STATUS_NOTSIGNED) $qualifiedfortotal = false; // Refused proposal must not be included in total
+ if ($element->status != Propal::STATUS_SIGNED && $element->status != Propal::STATUS_BILLED) $qualifiedfortotal = false; // Only signed proposal must not be included in total
}
if ($tablename != 'expensereport_det' && method_exists($element, 'fetch_thirdparty')) $element->fetch_thirdparty();
@@ -777,7 +777,8 @@ foreach ($listofreferent as $key => $value)
// Each element with at least one line is output
$qualifiedforfinalprofit = true;
if ($key == 'intervention' && empty($conf->global->PROJECT_INCLUDE_INTERVENTION_AMOUNT_IN_PROFIT)) $qualifiedforfinalprofit = false;
- //var_dump($key);
+ if ($key == 'propal' && $element->status != Propal::STATUS_SIGNED && $element->status != Propal::STATUS_BILLED) $qualifiedforfinalprofit = false;
+ //var_dump($key.' '.$qualifiedforfinalprofit);
// Calculate margin
if ($qualifiedforfinalprofit)
@@ -803,13 +804,19 @@ foreach ($listofreferent as $key => $value)
print ''.$i.' | ';
// Amount HT
print '';
- if (!$qualifiedforfinalprofit) print ''.$form->textwithpicto($langs->trans("NA"), $langs->trans("AmountOfInteventionNotIncludedByDefault")).'';
- else print price($total_ht);
+ if ($key == 'intervention' && !$qualifiedforfinalprofit) print ''.$form->textwithpicto($langs->trans("NA"), $langs->trans("AmountOfInteventionNotIncludedByDefault")).'';
+ else {
+ print price($total_ht);
+ if ($key == 'propal') print ''.$form->textwithpicto('', $langs->trans("SignedOnly")).'';
+ }
print ' | ';
// Amount TTC
print '';
- if (!$qualifiedforfinalprofit) print ''.$form->textwithpicto($langs->trans("NA"), $langs->trans("AmountOfInteventionNotIncludedByDefault")).'';
- else print price($total_ttc);
+ if ($key == 'intervention' && !$qualifiedforfinalprofit) print ''.$form->textwithpicto($langs->trans("NA"), $langs->trans("AmountOfInteventionNotIncludedByDefault")).'';
+ else {
+ print price($total_ttc);
+ if ($key == 'propal') print ''.$form->textwithpicto('', $langs->trans("SignedOnly")).'';
+ }
print ' | ';
print '';
}