Uniformize code
This commit is contained in:
parent
9feb654d74
commit
b2307f9b90
@ -264,7 +264,7 @@ if(!empty($search_town)) $sql.= ' AND s.town LIKE "%'.$search_town.'%"';
|
||||
if($search_country > 0) $sql.= ' AND s.fk_pays = '.$search_country.'';
|
||||
$sql.= " AND f.entity = ".$conf->entity;
|
||||
if ($socid) $sql.= " AND f.fk_soc = ".$socid;
|
||||
$sql.= " GROUP BY s.rowid, s.nom";
|
||||
$sql.= " GROUP BY s.rowid, s.nom, s.zip, s.town, s.fk_pays";
|
||||
$sql.= " ORDER BY s.rowid";
|
||||
//echo $sql;
|
||||
|
||||
|
||||
@ -379,7 +379,7 @@ class FactureFournisseur extends CommonInvoice
|
||||
$sql.= " t.tva,";
|
||||
$sql.= " t.localtax1,";
|
||||
$sql.= " t.localtax2,";
|
||||
$sql.= " t.total,";
|
||||
//$sql.= " t.total,";
|
||||
$sql.= " t.total_ht,";
|
||||
$sql.= " t.total_tva,";
|
||||
$sql.= " t.total_ttc,";
|
||||
@ -440,7 +440,7 @@ class FactureFournisseur extends CommonInvoice
|
||||
$this->tva = $obj->tva;
|
||||
$this->total_localtax1 = $obj->localtax1;
|
||||
$this->total_localtax2 = $obj->localtax2;
|
||||
$this->total = $obj->total;
|
||||
//$this->total = $obj->total;
|
||||
$this->total_ht = $obj->total_ht;
|
||||
$this->total_tva = $obj->total_tva;
|
||||
$this->total_ttc = $obj->total_ttc;
|
||||
|
||||
@ -86,29 +86,34 @@ $text=$langs->trans("Margins");
|
||||
$head=marges_prepare_head($user);
|
||||
$titre=$langs->trans("Margins");
|
||||
$picto='margin';
|
||||
dol_fiche_head($head, 'agentMargins', $titre, 0, $picto);
|
||||
|
||||
print '<form method="post" name="sel" action="'.$_SERVER['PHP_SELF'].'">';
|
||||
|
||||
dol_fiche_head($head, 'agentMargins', $titre, 0, $picto);
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td width="20%">'.$langs->trans('SalesRepresentative').'</td>';
|
||||
print '<tr><td class="titlefield">'.$langs->trans('SalesRepresentative').'</td>';
|
||||
print '<td colspan="4">';
|
||||
print $form->select_dolusers($agentid, 'agentid', 1, '', $user->rights->margins->read->all ? 0 : 1, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
|
||||
print '</td></tr>';
|
||||
|
||||
// Start date
|
||||
print '<td>'.$langs->trans('DateStart').' ('.$langs->trans("DateValidation").')</td>';
|
||||
print '<td width="20%">';
|
||||
print '<td>';
|
||||
$form->select_date($startdate,'startdate','','',1,"sel",1,1);
|
||||
print '</td>';
|
||||
print '<td width="20%">'.$langs->trans('DateEnd').' ('.$langs->trans("DateValidation").')</td>';
|
||||
print '<td width="20%">';
|
||||
print '<td>'.$langs->trans('DateEnd').' ('.$langs->trans("DateValidation").')</td>';
|
||||
print '<td>';
|
||||
$form->select_date($enddate,'enddate','','',1,"sel",1,1);
|
||||
print '</td>';
|
||||
print '<td style="text-align: center;">';
|
||||
print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans('Refresh')).'" />';
|
||||
print '</td></tr>';
|
||||
print "</table>";
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '</form>';
|
||||
|
||||
$sql = "SELECT";
|
||||
@ -242,17 +247,14 @@ else
|
||||
}
|
||||
$db->free($result);
|
||||
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
print "\n".'<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
|
||||
$("#agentid").change(function() {
|
||||
$("div.fiche form").submit();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</script>'."\n";
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
|
||||
@ -118,18 +118,20 @@ llxHeader('', $title);
|
||||
// Show tabs
|
||||
$head = marges_prepare_head($user);
|
||||
$picto = 'margin';
|
||||
dol_fiche_head($head, $langs->trans('checkMargins'), $title, 0, $picto);
|
||||
|
||||
print '<form method="post" name="sel" action="' . $_SERVER['PHP_SELF'] . '">';
|
||||
|
||||
dol_fiche_head($head, $langs->trans('checkMargins'), $title, 0, $picto);
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Start date
|
||||
print '<td>' . $langs->trans('DateStart') . ' (' . $langs->trans("DateValidation") . ')</td>';
|
||||
print '<td width="20%">';
|
||||
print '<td class="titlefield">' . $langs->trans('DateStart') . ' (' . $langs->trans("DateValidation") . ')</td>';
|
||||
print '<td>';
|
||||
$form->select_date($startdate, 'startdate', '', '', 1, "sel", 1, 1);
|
||||
print '</td>';
|
||||
print '<td width="20%">' . $langs->trans('DateEnd') . ' (' . $langs->trans("DateValidation") . ')</td>';
|
||||
print '<td width="20%">';
|
||||
print '<td>' . $langs->trans('DateEnd') . ' (' . $langs->trans("DateValidation") . ')</td>';
|
||||
print '<td>';
|
||||
$form->select_date($enddate, 'enddate', '', '', 1, "sel", 1, 1);
|
||||
print '</td>';
|
||||
print '<td style="text-align: center;">';
|
||||
@ -137,6 +139,9 @@ print '<input type="submit" class="button" value="' . dol_escape_htmltag($langs-
|
||||
print '</td></tr>';
|
||||
print "</table>";
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
$sql = "SELECT";
|
||||
$sql .= " f.facnumber, f.rowid as invoiceid, d.rowid as invoicedetid, d.buy_price_ht, d.total_ht, d.subprice, d.label, d.description , d.qty";
|
||||
$sql .= " ,d.fk_product";
|
||||
@ -243,11 +248,11 @@ if ($result) {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div class="tabsAction">' . "\n";
|
||||
print '<div class="inline-block divButAction"><input type="submit" name="button_updatemagins" id="button_updatemagins" class="butAction" value="' . $langs->trans("Update") . '" /></div>';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
$db->free($result);
|
||||
|
||||
@ -73,9 +73,12 @@ $text=$langs->trans("Margins");
|
||||
$head=marges_prepare_head($user);
|
||||
$titre=$langs->trans("Margins");
|
||||
$picto='margin';
|
||||
dol_fiche_head($head, 'customerMargins', $titre, 0, $picto);
|
||||
|
||||
|
||||
print '<form method="post" name="sel" action="'.$_SERVER['PHP_SELF'].'">';
|
||||
|
||||
dol_fiche_head($head, 'customerMargins', $titre, 0, $picto);
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
$client = false;
|
||||
@ -161,6 +164,9 @@ if (! empty($conf->global->DISPLAY_MARK_RATES)) {
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '</form>';
|
||||
|
||||
$sql = "SELECT";
|
||||
@ -319,22 +325,19 @@ else
|
||||
}
|
||||
$db->free($result);
|
||||
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
print '<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
/*
|
||||
$("#socid").change(function() {
|
||||
$("div.fiche form").submit();
|
||||
});*/
|
||||
|
||||
$("#totalMargin").html("<?php echo price($totalMargin, null, null, null, null, $rounding); ?>");
|
||||
$("#marginRate").html("<?php echo (($marginRate === '')?'n/a':price($marginRate, null, null, null, null, $rounding)."%"); ?>");
|
||||
$("#markRate").html("<?php echo (($markRate === '')?'n/a':price($markRate, null, null, null, null, $rounding)."%"); ?>");
|
||||
|
||||
$("#totalMargin").html("'.price($totalMargin, null, null, null, null, $rounding).'");
|
||||
$("#marginRate").html("'.(($marginRate === '')?'n/a':price($marginRate, null, null, null, null, $rounding)."%").'");
|
||||
$("#markRate").html("'.(($markRate === '')?'n/a':price($markRate, null, null, null, null, $rounding)."%").'");
|
||||
});
|
||||
</script>
|
||||
';
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
@ -95,26 +95,28 @@ $text=$langs->trans("Margins");
|
||||
$head=marges_prepare_head($user);
|
||||
$titre=$langs->trans("Margins");
|
||||
$picto='margin';
|
||||
dol_fiche_head($head, 'productMargins', $titre, 0, $picto);
|
||||
|
||||
print '<form method="post" name="sel" action="'.$_SERVER['PHP_SELF'].'">';
|
||||
|
||||
dol_fiche_head($head, 'productMargins', $titre, 0, $picto);
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
if ($id > 0) {
|
||||
|
||||
print '<tr><td width="20%">'.$langs->trans('ChooseProduct/Service').'</td>';
|
||||
print '<tr><td class="titlefield">'.$langs->trans('ChooseProduct/Service').'</td>';
|
||||
print '<td colspan="4">';
|
||||
print $form->select_produits($id,'id','',20,0,1,2,'',1);
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td width="20%">'.$langs->trans('AllProducts').'</td>';
|
||||
print '<tr><td>'.$langs->trans('AllProducts').'</td>';
|
||||
print '<td colspan="4"><input type="checkbox" id="all" /></td></tr>';
|
||||
|
||||
if (! $sortorder) $sortorder="DESC";
|
||||
if (! $sortfield) $sortfield="f.datef";
|
||||
}
|
||||
else {
|
||||
print '<tr><td width="20%">'.$langs->trans('ChooseProduct/Service').'</td>';
|
||||
print '<tr><td class="titlefield">'.$langs->trans('ChooseProduct/Service').'</td>';
|
||||
print '<td colspan="4">';
|
||||
print $form->select_produits('','id','',20,0,1,2,'',1);
|
||||
print '</td></tr>';
|
||||
@ -122,12 +124,13 @@ else {
|
||||
}
|
||||
|
||||
// Start date
|
||||
print '<td>'.$langs->trans('DateStart').' ('.$langs->trans("DateValidation").')</td>';
|
||||
print '<td width="20%">';
|
||||
print '<tr>';
|
||||
print '<td class="titlefield">'.$langs->trans('DateStart').' ('.$langs->trans("DateValidation").')</td>';
|
||||
print '<td>';
|
||||
$form->select_date($startdate,'startdate','','',1,"sel",1,1);
|
||||
print '</td>';
|
||||
print '<td width="20%">'.$langs->trans('DateEnd').' ('.$langs->trans("DateValidation").')</td>';
|
||||
print '<td width="20%">';
|
||||
print '<td>'.$langs->trans('DateEnd').' ('.$langs->trans("DateValidation").')</td>';
|
||||
print '<td>';
|
||||
$form->select_date($enddate,'enddate','','',1,"sel",1,1);
|
||||
print '</td>';
|
||||
print '<td style="text-align: center;">';
|
||||
@ -141,25 +144,28 @@ print '<br>';
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Total Margin
|
||||
print '<tr><td width="20%">'.$langs->trans("TotalMargin").'</td><td colspan="4">';
|
||||
print '<tr><td class="titlefield">'.$langs->trans("TotalMargin").'</td><td colspan="4">';
|
||||
print '<span id="totalMargin"></span>'; // set by jquery (see below)
|
||||
print '</td></tr>';
|
||||
|
||||
// Margin Rate
|
||||
if (! empty($conf->global->DISPLAY_MARGIN_RATES)) {
|
||||
print '<tr><td width="20%">'.$langs->trans("MarginRate").'</td><td colspan="4">';
|
||||
print '<tr><td>'.$langs->trans("MarginRate").'</td><td colspan="4">';
|
||||
print '<span id="marginRate"></span>'; // set by jquery (see below)
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Mark Rate
|
||||
if (! empty($conf->global->DISPLAY_MARK_RATES)) {
|
||||
print '<tr><td width="20%">'.$langs->trans("MarkRate").'</td><td colspan="4">';
|
||||
print '<tr><td>'.$langs->trans("MarkRate").'</td><td colspan="4">';
|
||||
print '<span id="markRate"></span>'; // set by jquery (see below)
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '</form>';
|
||||
|
||||
$sql = "SELECT p.label, p.rowid, p.fk_product_type, p.ref, p.entity as pentity,";
|
||||
@ -329,25 +335,25 @@ else
|
||||
$db->free($result);
|
||||
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
?>
|
||||
|
||||
print '
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
|
||||
$("#all").change(function() {
|
||||
$("#id").val('').change();
|
||||
$("#id").val(\'\').change();
|
||||
});
|
||||
|
||||
$("#id").change(function() {
|
||||
$("div.fiche form").submit();
|
||||
});
|
||||
|
||||
$("#totalMargin").html("<?php echo price($totalMargin, null, null, null, null, $rounding); ?>");
|
||||
$("#marginRate").html("<?php echo (($marginRate === '')?'n/a':price($marginRate, null, null, null, null, $rounding)."%"); ?>");
|
||||
$("#markRate").html("<?php echo (($markRate === '')?'n/a':price($markRate, null, null, null, null, $rounding)."%"); ?>");
|
||||
$("#totalMargin").html("'.price($totalMargin, null, null, null, null, $rounding).'");
|
||||
$("#marginRate").html("'.(($marginRate === '')?'n/a':price($marginRate, null, null, null, null, $rounding)."%").'");
|
||||
$("#markRate").html("'.(($markRate === '')?'n/a':price($markRate, null, null, null, null, $rounding)."%").'");
|
||||
|
||||
});
|
||||
</script>
|
||||
';
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user