mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
NEW : Consumption view on thirdparty total line and total HT by element
This commit is contained in:
parent
304a44ffc2
commit
95a5152746
|
|
@ -279,12 +279,12 @@ if ($type_element == 'contract')
|
|||
$thirdTypeSelect='customer';
|
||||
}
|
||||
|
||||
if (!empty($sql_select))
|
||||
if (!empty($sql_select))
|
||||
{
|
||||
$sql = $sql_select;
|
||||
$sql.= ' d.description as description,';
|
||||
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' && $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, d.total_ht as total_ht, ';
|
||||
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, d.total_ht as total_ht, ';
|
||||
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, p.entity as pentity,';
|
||||
$sql.= " s.rowid as socid ";
|
||||
if ($type_element != 'fichinter') $sql.= ", p.ref as prod_ref, p.label as product_label";
|
||||
|
|
@ -313,10 +313,10 @@ if (!empty($sql_select))
|
|||
$sql.=")";
|
||||
}
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
|
||||
|
||||
$resql=$db->query($sql);
|
||||
$totalnboflines = $db->num_rows($resql);
|
||||
|
||||
|
||||
$sql.= $db->plimit($limit + 1, $offset);
|
||||
//print $sql;
|
||||
}
|
||||
|
|
@ -334,6 +334,7 @@ $typeElementString = $form->selectarray("type_element", $elementTypeArray, GETPO
|
|||
$button = '<input type="submit" class="button" name="button_third" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
$param="&sref=".$sref."&month=".$month."&year=".$year."&sprod_fulldescr=".$sprod_fulldescr."&socid=".$socid."&type_element=".$type_element;
|
||||
|
||||
$total_qty=0;
|
||||
|
||||
if ($sql_select)
|
||||
{
|
||||
|
|
@ -362,6 +363,7 @@ if ($sql_select)
|
|||
print_liste_field_titre($langs->trans('Status'),$_SERVER['PHP_SELF'],'fk_statut','',$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Product'),$_SERVER['PHP_SELF'],'','',$param,'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Quantity'),$_SERVER['PHP_SELF'],'prod_qty','',$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('TotalHT'),$_SERVER['PHP_SELF'],'total_ht','',$param,'align="right"',$sortfield,$sortorder);
|
||||
print "</tr>\n";
|
||||
// Filters
|
||||
print '<tr class="liste_titre">';
|
||||
|
|
@ -377,6 +379,8 @@ if ($sql_select)
|
|||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" type="text" name="sprod_fulldescr" size="15" value="'.dol_escape_htmltag($sprod_fulldescr).'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" align="center">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" align="right">';
|
||||
$searchpitco=$form->showFilterAndCheckAddButtons(0);
|
||||
print $searchpitco;
|
||||
|
|
@ -554,11 +558,21 @@ if ($sql_select)
|
|||
//print '<td align="left">'.$prodreftxt.'</td>';
|
||||
|
||||
print '<td align="right">'.$objp->prod_qty.'</td>';
|
||||
$total_qty+=$objp->prod_qty;
|
||||
|
||||
print '<td align="right">'.price($objp->total_ht).'</td>';
|
||||
$total_ht+=$objp->total_ht;
|
||||
|
||||
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
|
||||
print '<tr class="liste_total">';
|
||||
print '<td>' . $langs->trans('Total') . '</td>';
|
||||
print '<td colspan="3"></td>';
|
||||
print '<td align="right">' . $total_qty . '</td>';
|
||||
print '<td align="right">' . price($total_ht) . '</td>';
|
||||
print "</table>";
|
||||
|
||||
if ($num > $limit) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user