2
0
forked from Wavyzz/dolibarr

Minor code fix

This commit is contained in:
Laurent Destailleur
2016-09-29 10:43:53 +02:00
parent 78c0945fe7
commit ccd7100b7f
6 changed files with 31 additions and 20 deletions

View File

@@ -171,9 +171,9 @@ print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td width="200">' . $langs->trans("Account") . '</td>'; print '<tr class="liste_titre"><td width="200">' . $langs->trans("Account") . '</td>';
print '<td width="200" align="left">' . $langs->trans("Label") . '</td>'; print '<td width="200" align="left">' . $langs->trans("Label") . '</td>';
for($i = 1; $i <= 12; $i ++) { for($i = 1; $i <= 12; $i ++) {
print '<td width="60" align="center">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>'; print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>';
} }
print '<td width="60" align="center"><b>' . $langs->trans("Total") . '</b></td></tr>'; print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
$sql = "SELECT " . $db->ifsql('aa.account_number IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.account_number') . " AS codecomptable,"; $sql = "SELECT " . $db->ifsql('aa.account_number IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.account_number') . " AS codecomptable,";
$sql .= " " . $db->ifsql('aa.label IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.label') . " AS intitule,"; $sql .= " " . $db->ifsql('aa.label IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.label') . " AS intitule,";
@@ -220,9 +220,9 @@ print "<br>\n";
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td width="400" align="left">' . $langs->trans("TotalVente") . '</td>'; print '<tr class="liste_titre"><td width="400" align="left">' . $langs->trans("TotalVente") . '</td>';
for($i = 1; $i <= 12; $i ++) { for($i = 1; $i <= 12; $i ++) {
print '<td width="60" align="center">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>'; print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>';
} }
print '<td width="60" align="center"><b>' . $langs->trans("Total") . '</b></td></tr>'; print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
$sql = "SELECT '" . $langs->trans("TotalVente") . "' AS total,"; $sql = "SELECT '" . $langs->trans("TotalVente") . "' AS total,";
for($i = 1; $i <= 12; $i ++) { for($i = 1; $i <= 12; $i ++) {
@@ -264,9 +264,9 @@ if (! empty($conf->margin->enabled)) {
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td width="400">' . $langs->trans("TotalMarge") . '</td>'; print '<tr class="liste_titre"><td width="400">' . $langs->trans("TotalMarge") . '</td>';
for($i = 1; $i <= 12; $i ++) { for($i = 1; $i <= 12; $i ++) {
print '<td width="60" align="center">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>'; print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>';
} }
print '<td width="60" align="center"><b>' . $langs->trans("Total") . '</b></td></tr>'; print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
$sql = "SELECT '" . $langs->trans("Vide") . "' AS marge,"; $sql = "SELECT '" . $langs->trans("Vide") . "' AS marge,";
for($i = 1; $i <= 12; $i ++) { for($i = 1; $i <= 12; $i ++) {
@@ -291,9 +291,9 @@ if (! empty($conf->margin->enabled)) {
print '<tr><td>' . $row[0] . '</td>'; print '<tr><td>' . $row[0] . '</td>';
for($i = 1; $i <= 12; $i ++) { for($i = 1; $i <= 12; $i ++) {
print '<td align="right">' . price($row[$i]) . '</td>'; print '<td align="right">' . price(price2num($row[$i])) . '</td>';
} }
print '<td align="right"><b>' . price($row[13]) . '</b></td>'; print '<td align="right"><b>' . price(price2num($row[13])) . '</b></td>';
print '</tr>'; print '</tr>';
} }
$db->free($resql); $db->free($resql);

View File

@@ -87,6 +87,11 @@ if (! $user->rights->accounting->ventilation->dispatch)
$formventilation = new FormVentilation($db); $formventilation = new FormVentilation($db);
/*
* Actions
*/
// Purge search criteria // Purge search criteria
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
{ {
@@ -148,10 +153,6 @@ print '<script type="text/javascript">
}); });
</script>'; </script>';
/*
* Action
*/
/* /*
* Customer Invoice lines * Customer Invoice lines
*/ */
@@ -251,7 +252,7 @@ if ($result) {
print '<br><div class="inline-block divButAction">' . $langs->trans("ChangeAccount") . '<br>'; print '<br><div class="inline-block divButAction">' . $langs->trans("ChangeAccount") . '<br>';
print $formventilation->select_account($account_parent, 'account_parent', 1); print $formventilation->select_account($account_parent, 'account_parent', 1);
print '<input type="submit" class="butAction" value="' . $langs->trans("Validate") . '"/></div>'; print '<input type="submit" class="button" value="' . $langs->trans("Validate") . '"/></div>';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("Invoice"), $_SERVER["PHP_SELF"], "f.facnumber", "", $param, '', $sortfield, $sortorder); print_liste_field_titre($langs->trans("Invoice"), $_SERVER["PHP_SELF"], "f.facnumber", "", $param, '', $sortfield, $sortorder);

View File

@@ -103,9 +103,12 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) {
$search_vat = ''; $search_vat = '';
} }
/* /*
* View * View
*/ */
llxHeader('', $langs->trans("Ventilation")); llxHeader('', $langs->trans("Ventilation"));
print '<script type="text/javascript"> print '<script type="text/javascript">

View File

@@ -155,9 +155,9 @@ print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td width="200" align="left">' . $langs->trans("Account") . '</td>'; print '<tr class="liste_titre"><td width="200" align="left">' . $langs->trans("Account") . '</td>';
print '<td width="200" align="left">' . $langs->trans("Label") . '</td>'; print '<td width="200" align="left">' . $langs->trans("Label") . '</td>';
for($i = 1; $i <= 12; $i ++) { for($i = 1; $i <= 12; $i ++) {
print '<td width="60" align="center">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>'; print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>';
} }
print '<td width="60" align="center"><b>' . $langs->trans("Total") . '</b></td></tr>'; print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.account_number') ." AS codecomptable,"; $sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.account_number') ." AS codecomptable,";
$sql .= " " . $db->ifsql('aa.label IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.label') . " AS intitule,"; $sql .= " " . $db->ifsql('aa.label IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.label') . " AS intitule,";
@@ -205,9 +205,9 @@ print "<br>\n";
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td width="400" align="left">' . $langs->trans("Total") . '</td>'; print '<tr class="liste_titre"><td width="400" align="left">' . $langs->trans("Total") . '</td>';
for($i = 1; $i <= 12; $i ++) { for($i = 1; $i <= 12; $i ++) {
print '<td width="60" align="center">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>'; print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>';
} }
print '<td width="60" align="center"><b>' . $langs->trans("Total") . '</b></td></tr>'; print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
$sql = "SELECT '" . $langs->trans("CAHTF") . "' AS label,"; $sql = "SELECT '" . $langs->trans("CAHTF") . "' AS label,";
for($i = 1; $i <= 12; $i ++) { for($i = 1; $i <= 12; $i ++) {

View File

@@ -85,6 +85,11 @@ if (! $user->rights->accounting->ventilation->dispatch)
$formventilation = new FormVentilation($db); $formventilation = new FormVentilation($db);
/*
* Actions
*/
// Purge search criteria // Purge search criteria
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
{ {
@@ -121,6 +126,7 @@ if (is_array($changeaccount) && count($changeaccount) > 0) {
} }
} }
/* /*
* View * View
*/ */
@@ -198,7 +204,7 @@ if ($result) {
print '<br><div class="inline-block divButAction">' . $langs->trans("ChangeAccount") . '<br>'; print '<br><div class="inline-block divButAction">' . $langs->trans("ChangeAccount") . '<br>';
print $formventilation->select_account(GETPOST('account_parent'), 'account_parent', 1); print $formventilation->select_account(GETPOST('account_parent'), 'account_parent', 1);
print '<input type="submit" class="butAction" value="' . $langs->trans("Validate") . '" /></div>'; print '<input type="submit" class="button" value="' . $langs->trans("Validate") . '" /></div>';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("Invoice"), $_SERVER["PHP_SELF"], "f.ref", "", $param, '', $sortfield, $sortorder); print_liste_field_titre($langs->trans("Invoice"), $_SERVER["PHP_SELF"], "f.ref", "", $param, '', $sortfield, $sortorder);

View File

@@ -54,7 +54,8 @@ create table llx_facturedet
buy_price_ht double(24,8) DEFAULT 0, -- buying price buy_price_ht double(24,8) DEFAULT 0, -- buying price
fk_product_fournisseur_price integer DEFAULT NULL, -- reference of supplier price when line was added (may be used to update buy_price_ht current price when future invoice will be created) fk_product_fournisseur_price integer DEFAULT NULL, -- reference of supplier price when line was added (may be used to update buy_price_ht current price when future invoice will be created)
fk_code_ventilation integer DEFAULT 0 NOT NULL, fk_code_ventilation integer DEFAULT 0 NOT NULL, -- Id in table llx_accounting_bookeeping to know accounting account for product line
special_code integer DEFAULT 0, -- code pour les lignes speciales special_code integer DEFAULT 0, -- code pour les lignes speciales
rang integer DEFAULT 0, -- position of line rang integer DEFAULT 0, -- position of line
fk_contract_line integer NULL, -- id of contract line when invoice comes from contract lines fk_contract_line integer NULL, -- id of contract line when invoice comes from contract lines