Because this is a legal issue (OPCA), i added the hidden constant for

3.7: WORKFLOW_PROPAL_CAN_CLASSIFY_BILLED_WITHOUT_INVOICES => Button
"Classified Billed" is visible on proposal even if there is no invoice
linked to proposal.
Fixed: Also fix get list of invoice that report too many data.
This commit is contained in:
Laurent Destailleur 2014-12-23 12:59:34 +01:00 committed by Juanjo Menent
parent dc4a874e70
commit bd7f6339ce
4 changed files with 13 additions and 8 deletions

View File

@ -2110,12 +2110,14 @@ if ($action == 'create')
// Create an invoice and classify billed
if ($object->statut == 2) {
if (! empty($conf->facture->enabled) && $user->rights->facture->creer) {
if (! empty($conf->facture->enabled) && $user->rights->facture->creer)
{
print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/compta/facture.php?action=create&amp;origin=' . $object->element . '&amp;originid=' . $object->id . '&amp;socid=' . $object->socid . '">' . $langs->trans("AddBill") . '</a></div>';
}
$arraypropal = $object->getInvoiceArrayList();
if (is_array($arraypropal) && count($arraypropal) > 0) {
$arrayofinvoiceforpropal = $object->getInvoiceArrayList();
if ((is_array($arrayofinvoiceforpropal) && count($arrayofinvoiceforpropal) > 0) || ! empty($conf->global->WORKFLOW_PROPAL_CAN_CLASSIFIED_BILLED_WITHOUT_INVOICES))
{
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&amp;action=classifybilled&amp;socid=' . $object->socid . '">' . $langs->trans("ClassifyBilled") . '</a></div>';
}
}

View File

@ -1987,16 +1987,19 @@ class Propal extends CommonObject
{
$linkedInvoices[] = $objectid[$i];
}
// Cas des factures liees via la commande
// Cas des factures liees par un autre objet (ex: commande)
else
{
{
$this->fetchObjectLinked($objectid[$i],$objecttype);
foreach($this->linkedObjectsIds as $subobjecttype => $subobjectid)
{
$numj=count($subobjectid);
for ($j=0;$j<$numj;$j++)
{
$linkedInvoices[] = $subobjectid[$j];
if ($subobjecttype == 'facture')
{
$linkedInvoices[] = $subobjectid[$j];
}
}
}
}

View File

@ -1851,7 +1851,7 @@ abstract class CommonObject
}
}
else
{
{
$sql.= "(fk_source = '".$sourceid."' AND sourcetype = '".$sourcetype."')";
$sql.= " ".$clause." (fk_target = '".$targetid."' AND targettype = '".$targettype."')";
}

View File

@ -1,6 +1,6 @@
# Dolibarr language file - Source file is en_US - admin
WorkflowSetup=Workflow module setup
WorkflowDesc=This module is designed to modify the behaviour of automatic actions into application. By default, workflow is opened (you make thing in order you want). You can enabled automatic actions that you are interesting in.
WorkflowDesc=This module is designed to modify the behaviour of automatic actions into application. By default, workflow is opened (you make thing in order you want). You can activate the automatic actions that you are interesting in.
ThereIsNoWorkflowToModify=There is no workflow you can modify for module you have activated.
descWORKFLOW_PROPAL_AUTOCREATE_ORDER=Create a customer order automatically after a commercial proposal is signed
descWORKFLOW_PROPAL_AUTOCREATE_INVOICE=Create a customer invoice automatically after a commercial proposal is signed