Merge pull request #6095 from aspangaro/5.0-b1

Fix presentation on Loan / Expense report / VAT
This commit is contained in:
Laurent Destailleur 2016-12-10 11:42:08 +01:00 committed by GitHub
commit 4bb778c54f
4 changed files with 25 additions and 67 deletions

View File

@ -236,13 +236,13 @@ if ($action == 'create')
print '</label>'; print '</label>';
print '</div>'; print '</div>';
print "<br>\n"; print "<br>\n";
dol_fiche_head(); dol_fiche_head();
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
print "<tr>"; print "<tr>";
print '<td class="fieldrequired">'.$langs->trans("DatePayment").'</td><td>'; print '<td class="titlefieldcreate fieldrequired">'.$langs->trans("DatePayment").'</td><td>';
print $form->select_date($datep,"datep",'','','','add',1,1); print $form->select_date($datep,"datep",'','','','add',1,1);
print '</td></tr>'; print '</td></tr>';
@ -263,7 +263,7 @@ if ($action == 'create')
if (! empty($conf->banque->enabled)) if (! empty($conf->banque->enabled))
{ {
print '<tr><td class="fieldrequired">'.$langs->trans("Account").'</td><td>'; print '<tr><td class="fieldrequired">'.$langs->trans("BankAccount").'</td><td>';
$form->select_comptes($_POST["accountid"],"accountid",0,"courant=1",1); // Affiche liste des comptes courant $form->select_comptes($_POST["accountid"],"accountid",0,"courant=1",1); // Affiche liste des comptes courant
print '</td></tr>'; print '</td></tr>';
} }
@ -273,12 +273,12 @@ if ($action == 'create')
$form->select_types_paiements(GETPOST("type_payment"), "type_payment"); $form->select_types_paiements(GETPOST("type_payment"), "type_payment");
print "</td>\n"; print "</td>\n";
print "</tr>"; print "</tr>";
// Number // Number
print '<tr><td>'.$langs->trans('Numero'); print '<tr><td>'.$langs->trans('Numero');
print ' <em>('.$langs->trans("ChequeOrTransferNumber").')</em>'; print ' <em>('.$langs->trans("ChequeOrTransferNumber").')</em>';
print '<td><input name="num_payment" type="text" value="'.GETPOST("num_payment").'"></td></tr>'."\n"; print '<td><input name="num_payment" type="text" value="'.GETPOST("num_payment").'"></td></tr>'."\n";
// Other attributes // Other attributes
$parameters=array('colspan' => ' colspan="1"'); $parameters=array('colspan' => ' colspan="1"');
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
@ -296,13 +296,7 @@ if ($action == 'create')
print '</form>'; print '</form>';
} }
// View mode
/* ************************************************************************** */
/* */
/* Barre d'action */
/* */
/* ************************************************************************** */
if ($id) if ($id)
{ {
$h = 0; $h = 0;
@ -317,7 +311,7 @@ if ($id)
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
print "<tr>"; print "<tr>";
print '<td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">'; print '<td class="titlefield">'.$langs->trans("Ref").'</td><td colspan="3">';
print $object->ref; print $object->ref;
print '</td></tr>'; print '</td></tr>';
@ -325,19 +319,19 @@ if ($id)
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$object->label.'</td></tr>'; print '<tr><td>'.$langs->trans("Label").'</td><td>'.$object->label.'</td></tr>';
print "<tr>"; print "<tr>";
print '<td>'.$langs->trans("DatePayment").'</td><td colspan="3">'; print '<td>'.$langs->trans("DatePayment").'</td><td>';
print dol_print_date($object->datep,'day'); print dol_print_date($object->datep,'day');
print '</td></tr>'; print '</td></tr>';
print '<tr><td>'; print '<tr><td>';
print $form->editfieldkey("DateValue", 'datev', $object->datev, $object, $user->rights->tax->charges->creer, 'day'); print $form->editfieldkey("DateValue", 'datev', $object->datev, $object, $user->rights->tax->charges->creer, 'day');
print '</td><td colspan="3">'; print '</td><td>';
print $form->editfieldval("DateValue", 'datev', $object->datev, $object, $user->rights->tax->charges->creer, 'day'); print $form->editfieldval("DateValue", 'datev', $object->datev, $object, $user->rights->tax->charges->creer, 'day');
//print dol_print_date($object->datev,'day'); //print dol_print_date($object->datev,'day');
print '</td></tr>'; print '</td></tr>';
print '<tr><td>'.$langs->trans("Amount").'</td><td colspan="3">'.price($object->amount).'</td></tr>'; print '<tr><td>'.$langs->trans("Amount").'</td><td>'.price($object->amount).'</td></tr>';
if (! empty($conf->banque->enabled)) if (! empty($conf->banque->enabled))
{ {
@ -348,7 +342,7 @@ if ($id)
print '<tr>'; print '<tr>';
print '<td>'.$langs->trans('BankTransactionLine').'</td>'; print '<td>'.$langs->trans('BankTransactionLine').'</td>';
print '<td colspan="3">'; print '<td>';
print $bankline->getNomUrl(1,0,'showall'); print $bankline->getNomUrl(1,0,'showall');
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
@ -356,14 +350,12 @@ if ($id)
} }
// Other attributes // Other attributes
$parameters=array('colspan' => ' colspan="3"'); $reshook=$hookmanager->executeHooks('formObjectOptions','',$object,$action); // Note that $action and $object may have been modified by hook
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
print '</table>'; print '</table>';
dol_fiche_end(); dol_fiche_end();
/* /*
* Action buttons * Action buttons
*/ */

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com> /* Copyright (C) 2014-2016 Alexandre Spangaro <aspangaro@zendsi.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr> * Copyright (C) 2015 Frederic France <frederic.france@free.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -41,16 +41,6 @@ function loan_prepare_head($object)
$head[$tab][2] = 'card'; $head[$tab][2] = 'card';
$tab++; $tab++;
if (empty($conf->global->MAIN_DISABLE_NOTES_TAB))
{
$nbNote = (empty($object->note_private)?0:1)+(empty($object->note_public)?0:1);
$head[$tab][0] = DOL_URL_ROOT."/loan/note.php?id=".$object->id;
$head[$tab][1] = $langs->trans("Notes");
if($nbNote > 0) $head[$tab][1].= ' <span class="badge">'.$nbNote.'</span>';
$head[$tab][2] = 'note';
$tab++;
}
// Show more tabs from modules // Show more tabs from modules
// Entries must be declared in modules descriptor with line // Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
@ -68,6 +58,16 @@ function loan_prepare_head($object)
$head[$tab][2] = 'documents'; $head[$tab][2] = 'documents';
$tab++; $tab++;
if (empty($conf->global->MAIN_DISABLE_NOTES_TAB))
{
$nbNote = (empty($object->note_private)?0:1)+(empty($object->note_public)?0:1);
$head[$tab][0] = DOL_URL_ROOT."/loan/note.php?id=".$object->id;
$head[$tab][1] = $langs->trans("Notes");
if($nbNote > 0) $head[$tab][1].= ' <span class="badge">'.$nbNote.'</span>';
$head[$tab][2] = 'note';
$tab++;
}
$head[$tab][0] = DOL_URL_ROOT.'/loan/info.php?id='.$object->id; $head[$tab][0] = DOL_URL_ROOT.'/loan/info.php?id='.$object->id;
$head[$tab][1] = $langs->trans("Info"); $head[$tab][1] = $langs->trans("Info");
$head[$tab][2] = 'info'; $head[$tab][2] = 'info';

View File

@ -1427,26 +1427,6 @@ else
// Other attributes // Other attributes
//$cols = 3; //$cols = 3;
//include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_edit.tpl.php'; //include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_edit.tpl.php';
// Public note
print '<tr>';
print '<td class="border" valign="top">' . $langs->trans('NotePublic') . '</td>';
print '<td valign="top">';
$doleditor = new DolEditor('note_public', $object->note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
print $doleditor->Create(1);
print '</td></tr>';
// Private note
if (empty($user->societe_id)) {
print '<tr>';
print '<td class="border" valign="top">' . $langs->trans('NotePrivate') . '</td>';
print '<td valign="top">';
$doleditor = new DolEditor('note_private', $object->note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
print $doleditor->Create(1);
print '</td></tr>';
}
print '</table>'; print '</table>';
@ -1624,14 +1604,6 @@ else
print '</tr>'; print '</tr>';
*/ */
print '<tr>';
print '<td>'.$langs->trans("NotePublic").'</td>';
print '<td>'.$object->note_public.'</td>';
print '</tr>';
print '<tr>';
print '<td>'.$langs->trans("NotePrivate").'</td>';
print '<td>'.$object->note_private.'</td>';
print '</tr>';
// Amount // Amount
print '<tr>'; print '<tr>';
print '<td>'.$langs->trans("AmountHT").'</td>'; print '<td>'.$langs->trans("AmountHT").'</td>';
@ -2280,7 +2252,7 @@ print '<div class="fichehalfleft">';
* Generate documents * Generate documents
*/ */
if($user->rights->expensereport->export && $action != 'edit') if($user->rights->expensereport->export && $action != 'create' && $action != 'edit')
{ {
$filename = dol_sanitizeFileName($object->ref); $filename = dol_sanitizeFileName($object->ref);
$filedir = $conf->expensereport->dir_output . "/" . dol_sanitizeFileName($object->ref); $filedir = $conf->expensereport->dir_output . "/" . dol_sanitizeFileName($object->ref);

View File

@ -399,12 +399,6 @@ if ($id > 0)
// Rate // Rate
print '<tr><td>'.$langs->trans("Rate").'</td><td>'.$object->rate.' %</td></tr>'; print '<tr><td>'.$langs->trans("Rate").'</td><td>'.$object->rate.' %</td></tr>';
// Note Private
print '<tr><td>'.$langs->trans('NotePrivate').'</td><td>'.nl2br($object->note_private).'</td></tr>';
// Note Public
print '<tr><td>'.$langs->trans('NotePublic').'</td><td>'.nl2br($object->note_public).'</td></tr>';
// Accountancy account capital // Accountancy account capital
print '<tr><td class="nowrap">'; print '<tr><td class="nowrap">';
print $langs->trans("LoanAccountancyCapitalCode"); print $langs->trans("LoanAccountancyCapitalCode");