FIX Missing contracts into list in page of Refering objects of a
thirdparty.
This commit is contained in:
parent
996c9ca2ba
commit
a9e55fd08f
@ -406,7 +406,7 @@ UniqueThirdParties=Total of unique third parties
|
|||||||
InActivity=Open
|
InActivity=Open
|
||||||
ActivityCeased=Closed
|
ActivityCeased=Closed
|
||||||
ActivityStateFilter=Activity status
|
ActivityStateFilter=Activity status
|
||||||
ProductsIntoElements=List of products into %s
|
ProductsIntoElements=List of products/services into %s
|
||||||
CurrentOutstandingBill=Current outstanding bill
|
CurrentOutstandingBill=Current outstanding bill
|
||||||
OutstandingBill=Max. for outstanding bill
|
OutstandingBill=Max. for outstanding bill
|
||||||
OutstandingBillReached=Reached max. for outstanding bill
|
OutstandingBillReached=Reached max. for outstanding bill
|
||||||
|
|||||||
@ -78,6 +78,7 @@ $langs->load("orders");
|
|||||||
$langs->load("suppliers");
|
$langs->load("suppliers");
|
||||||
$langs->load("propal");
|
$langs->load("propal");
|
||||||
$langs->load("interventions");
|
$langs->load("interventions");
|
||||||
|
$langs->load("contracts");
|
||||||
|
|
||||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||||
$hookmanager->initHooks(array('consumptionthirdparty'));
|
$hookmanager->initHooks(array('consumptionthirdparty'));
|
||||||
@ -149,7 +150,8 @@ if ($object->client)
|
|||||||
if ($conf->propal->enabled && $user->rights->propal->lire) $elementTypeArray['propal']=$langs->transnoentitiesnoconv('Proposals');
|
if ($conf->propal->enabled && $user->rights->propal->lire) $elementTypeArray['propal']=$langs->transnoentitiesnoconv('Proposals');
|
||||||
if ($conf->commande->enabled && $user->rights->commande->lire) $elementTypeArray['order']=$langs->transnoentitiesnoconv('Orders');
|
if ($conf->commande->enabled && $user->rights->commande->lire) $elementTypeArray['order']=$langs->transnoentitiesnoconv('Orders');
|
||||||
if ($conf->facture->enabled && $user->rights->facture->lire) $elementTypeArray['invoice']=$langs->transnoentitiesnoconv('Invoices');
|
if ($conf->facture->enabled && $user->rights->facture->lire) $elementTypeArray['invoice']=$langs->transnoentitiesnoconv('Invoices');
|
||||||
if ($conf->ficheinter>enabled && $user->rights->ficheinter->lire) $elementTypeArray['fichinter']=$langs->transnoentitiesnoconv('Interventions');
|
if ($conf->ficheinter->enabled && $user->rights->ficheinter->lire) $elementTypeArray['fichinter']=$langs->transnoentitiesnoconv('Interventions');
|
||||||
|
if ($conf->contrat->enabled && $user->rights->contrat->lire) $elementTypeArray['contract']=$langs->transnoentitiesnoconv('Contracts');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($object->fournisseur)
|
if ($object->fournisseur)
|
||||||
@ -265,10 +267,24 @@ if ($type_element == 'supplier_order')
|
|||||||
$doc_number='c.ref';
|
$doc_number='c.ref';
|
||||||
$thirdTypeSelect='supplier';
|
$thirdTypeSelect='supplier';
|
||||||
}
|
}
|
||||||
|
if ($type_element == 'contract')
|
||||||
|
{ // Supplier : Show products from orders.
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
|
||||||
|
$documentstatic=new Contrat($db);
|
||||||
|
$documentstaticline=new ContratLigne($db);
|
||||||
|
$sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_contrat as dateprint, d.statut as status, ';
|
||||||
|
$tables_from = MAIN_DB_PREFIX."contrat as c,".MAIN_DB_PREFIX."contratdet as d";
|
||||||
|
$where = " WHERE c.fk_soc = s.rowid AND s.rowid = ".$socid;
|
||||||
|
$where.= " AND d.fk_contrat = c.rowid";
|
||||||
|
$dateprint = 'c.date_valid';
|
||||||
|
$doc_number='c.ref';
|
||||||
|
$thirdTypeSelect='customer';
|
||||||
|
}
|
||||||
|
|
||||||
$sql = $sql_select;
|
$sql = $sql_select;
|
||||||
$sql.= ' d.description as description,';
|
$sql.= ' d.description as description,';
|
||||||
if ($type_element != 'fichinter') $sql.= ' d.label, d.fk_product as product_id, d.fk_product as fk_product, d.info_bits, d.date_start, d.date_end, d.qty, d.qty as prod_qty,';
|
if ($type_element != 'fichinter' && $type_element != 'contract') $sql.= ' d.label, d.fk_product as product_id, d.fk_product as fk_product, d.info_bits, d.date_start, d.date_end, d.qty, d.qty as prod_qty,';
|
||||||
|
if ($type_element == 'contract') $sql.= ' d.label, d.fk_product as product_id, d.fk_product as fk_product, d.info_bits, d.date_ouverture as date_start, d.date_cloture as date_end, d.qty, d.qty as prod_qty,';
|
||||||
if ($type_element != 'fichinter') $sql.= ' p.ref as ref, p.rowid as prod_id, p.rowid as fk_product, p.fk_product_type as prod_type, p.fk_product_type as fk_product_type,';
|
if ($type_element != 'fichinter') $sql.= ' p.ref as ref, p.rowid as prod_id, p.rowid as fk_product, p.fk_product_type as prod_type, p.fk_product_type as fk_product_type,';
|
||||||
$sql.= " s.rowid as socid ";
|
$sql.= " s.rowid as socid ";
|
||||||
if ($type_element != 'fichinter') $sql.= ", p.ref as prod_ref, p.label as product_label";
|
if ($type_element != 'fichinter') $sql.= ", p.ref as prod_ref, p.label as product_label";
|
||||||
@ -352,6 +368,8 @@ if ($sql_select)
|
|||||||
$documentstatic->status=$objp->status;
|
$documentstatic->status=$objp->status;
|
||||||
$documentstatic->paye=$objp->paid;
|
$documentstatic->paye=$objp->paid;
|
||||||
|
|
||||||
|
if (is_object($documentstaticline)) $documentstaticline->statut=$objp->status;
|
||||||
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<tr ".$bc[$var].">";
|
print "<tr ".$bc[$var].">";
|
||||||
print '<td class="nobordernopadding nowrap" width="100">';
|
print '<td class="nobordernopadding nowrap" width="100">';
|
||||||
@ -361,7 +379,14 @@ if ($sql_select)
|
|||||||
|
|
||||||
// Status
|
// Status
|
||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
print $documentstatic->getLibStatut(2);
|
if ($type_element == 'contract')
|
||||||
|
{
|
||||||
|
print $documentstaticline->getLibStatut(2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print $documentstatic->getLibStatut(2);
|
||||||
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td>';
|
print '<td>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user