|
@@ -1696,20 +1696,20 @@ if ($action == 'create') {
|
|
|
}
|
|
|
}
|
|
|
}*/
|
|
|
- $morehtmlref .= '</div>';
|
|
|
+ $morehtmlref .= '</div>';
|
|
|
|
|
|
- dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
|
|
+ dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
|
|
|
|
|
- print '<div class="fichecenter">';
|
|
|
- print '<div class="fichehalfleft">';
|
|
|
- print '<div class="underbanner clearboth"></div>';
|
|
|
+ print '<div class="fichecenter">';
|
|
|
+ print '<div class="fichehalfleft">';
|
|
|
+ print '<div class="underbanner clearboth"></div>';
|
|
|
|
|
|
- print '<table class="border tableforfield centpercent">';
|
|
|
+ print '<table class="border tableforfield centpercent">';
|
|
|
|
|
|
- // Author
|
|
|
- print '<tr>';
|
|
|
- print '<td class="titlefield">'.$langs->trans("User").'</td>';
|
|
|
- print '<td>';
|
|
|
+ // Author
|
|
|
+ print '<tr>';
|
|
|
+ print '<td class="titlefield">'.$langs->trans("User").'</td>';
|
|
|
+ print '<td>';
|
|
|
if ($object->fk_user_author > 0) {
|
|
|
$userauthor = new User($db);
|
|
|
$result = $userauthor->fetch($object->fk_user_author);
|
|
@@ -1719,15 +1719,15 @@ if ($action == 'create') {
|
|
|
print $userauthor->getNomUrl(-1);
|
|
|
}
|
|
|
}
|
|
|
- print '</td></tr>';
|
|
|
-
|
|
|
- // Period
|
|
|
- print '<tr>';
|
|
|
- print '<td class="titlefield">'.$langs->trans("Period").'</td>';
|
|
|
- print '<td>';
|
|
|
- print get_date_range($object->date_debut, $object->date_fin, 'day', $langs, 0);
|
|
|
- print '</td>';
|
|
|
- print '</tr>';
|
|
|
+ print '</td></tr>';
|
|
|
+
|
|
|
+ // Period
|
|
|
+ print '<tr>';
|
|
|
+ print '<td class="titlefield">'.$langs->trans("Period").'</td>';
|
|
|
+ print '<td>';
|
|
|
+ print get_date_range($object->date_debut, $object->date_fin, 'day', $langs, 0);
|
|
|
+ print '</td>';
|
|
|
+ print '</tr>';
|
|
|
if (!empty($conf->global->EXPENSEREPORT_ASK_PAYMENTMODE_ON_CREATION)) {
|
|
|
print '<tr>';
|
|
|
print '<td>'.$langs->trans("ModePaiement").'</td>';
|
|
@@ -1735,20 +1735,20 @@ if ($action == 'create') {
|
|
|
print '</tr>';
|
|
|
}
|
|
|
|
|
|
- // Validation date
|
|
|
- print '<tr>';
|
|
|
- print '<td>'.$langs->trans("DATE_SAVE").'</td>';
|
|
|
- print '<td>'.dol_print_date($object->date_valid, 'dayhour', 'tzuser');
|
|
|
+ // Validation date
|
|
|
+ print '<tr>';
|
|
|
+ print '<td>'.$langs->trans("DATE_SAVE").'</td>';
|
|
|
+ print '<td>'.dol_print_date($object->date_valid, 'dayhour', 'tzuser');
|
|
|
if ($object->status == 2 && $object->hasDelay('toapprove')) {
|
|
|
print ' '.img_warning($langs->trans("Late").' - '.$langs->trans("ToApprove"));
|
|
|
}
|
|
|
if ($object->status == 5 && $object->hasDelay('topay')) {
|
|
|
print ' '.img_warning($langs->trans("Late").' - '.$langs->trans("ToPay"));
|
|
|
}
|
|
|
- print '</td></tr>';
|
|
|
- print '</tr>';
|
|
|
+ print '</td></tr>';
|
|
|
+ print '</tr>';
|
|
|
|
|
|
- // User to inform for approval
|
|
|
+ // User to inform for approval
|
|
|
if ($object->status <= ExpenseReport::STATUS_VALIDATED) { // informed
|
|
|
print '<tr>';
|
|
|
print '<td>'.$langs->trans("VALIDATOR").'</td>'; // approver
|
|
@@ -1842,24 +1842,24 @@ if ($action == 'create') {
|
|
|
*/
|
|
|
}
|
|
|
|
|
|
- // Other attributes
|
|
|
- $cols = 2;
|
|
|
- include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
|
|
|
+ // Other attributes
|
|
|
+ $cols = 2;
|
|
|
+ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
|
|
|
|
|
|
- print '</table>';
|
|
|
+ print '</table>';
|
|
|
|
|
|
- print '</div>';
|
|
|
- print '<div class="fichehalfright">';
|
|
|
- print '<div class="ficheaddleft">';
|
|
|
- print '<div class="underbanner clearboth"></div>';
|
|
|
+ print '</div>';
|
|
|
+ print '<div class="fichehalfright">';
|
|
|
+ print '<div class="ficheaddleft">';
|
|
|
+ print '<div class="underbanner clearboth"></div>';
|
|
|
|
|
|
- print '<table class="border tableforfield centpercent">';
|
|
|
+ print '<table class="border tableforfield centpercent">';
|
|
|
|
|
|
- // Amount
|
|
|
- print '<tr>';
|
|
|
- print '<td class="titlefieldmiddle">'.$langs->trans("AmountHT").'</td>';
|
|
|
- print '<td class="nowrap amountcard">'.price($object->total_ht, 1, '', 1, - 1, - 1, $conf->currency).'</td>';
|
|
|
- $rowspan = 5;
|
|
|
+ // Amount
|
|
|
+ print '<tr>';
|
|
|
+ print '<td class="titlefieldmiddle">'.$langs->trans("AmountHT").'</td>';
|
|
|
+ print '<td class="nowrap amountcard">'.price($object->total_ht, 1, '', 1, - 1, - 1, $conf->currency).'</td>';
|
|
|
+ $rowspan = 5;
|
|
|
if ($object->status <= ExpenseReport::STATUS_VALIDATED) {
|
|
|
$rowspan++;
|
|
|
} elseif ($object->status == ExpenseReport::STATUS_CANCELED) {
|
|
@@ -1873,15 +1873,15 @@ if ($action == 'create') {
|
|
|
if ($object->status == ExpenseReport::STATUS_CLOSED) {
|
|
|
$rowspan += 2;
|
|
|
}
|
|
|
- print "</td>";
|
|
|
- print '</tr>';
|
|
|
+ print "</td>";
|
|
|
+ print '</tr>';
|
|
|
|
|
|
- print '<tr>';
|
|
|
- print '<td>'.$langs->trans("AmountVAT").'</td>';
|
|
|
- print '<td class="nowrap amountcard">'.price($object->total_tva, 1, '', 1, -1, -1, $conf->currency).'</td>';
|
|
|
- print '</tr>';
|
|
|
+ print '<tr>';
|
|
|
+ print '<td>'.$langs->trans("AmountVAT").'</td>';
|
|
|
+ print '<td class="nowrap amountcard">'.price($object->total_tva, 1, '', 1, -1, -1, $conf->currency).'</td>';
|
|
|
+ print '</tr>';
|
|
|
|
|
|
- // Amount Local Taxes
|
|
|
+ // Amount Local Taxes
|
|
|
if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) { // Localtax1
|
|
|
print '<tr><td>'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>';
|
|
|
print '<td class="valuefield">'.price($object->total_localtax1, 1, '', 1, -1, -1, $conf->currency).'</td></tr>';
|
|
@@ -1891,45 +1891,45 @@ if ($action == 'create') {
|
|
|
print '<td class="valuefield">'.price($object->total_localtax2, 1, '', 1, -1, -1, $conf->currency).'</td></tr>';
|
|
|
}
|
|
|
|
|
|
- print '<tr>';
|
|
|
- print '<td>'.$langs->trans("AmountTTC").'</td>';
|
|
|
- print '<td class="nowrap amountcard">'.price($object->total_ttc, 1, '', 1, -1, -1, $conf->currency).'</td>';
|
|
|
- print '</tr>';
|
|
|
+ print '<tr>';
|
|
|
+ print '<td>'.$langs->trans("AmountTTC").'</td>';
|
|
|
+ print '<td class="nowrap amountcard">'.price($object->total_ttc, 1, '', 1, -1, -1, $conf->currency).'</td>';
|
|
|
+ print '</tr>';
|
|
|
|
|
|
- // List of payments already done
|
|
|
- $nbcols = 3;
|
|
|
+ // List of payments already done
|
|
|
+ $nbcols = 3;
|
|
|
if (!empty($conf->banque->enabled)) {
|
|
|
$nbrows++;
|
|
|
$nbcols++;
|
|
|
}
|
|
|
|
|
|
- print '<table class="noborder paymenttable" width="100%">';
|
|
|
+ print '<table class="noborder paymenttable" width="100%">';
|
|
|
|
|
|
- print '<tr class="liste_titre">';
|
|
|
- print '<td class="liste_titre">'.$langs->trans('Payments').'</td>';
|
|
|
- print '<td class="liste_titre">'.$langs->trans('Date').'</td>';
|
|
|
- print '<td class="liste_titre">'.$langs->trans('Type').'</td>';
|
|
|
+ print '<tr class="liste_titre">';
|
|
|
+ print '<td class="liste_titre">'.$langs->trans('Payments').'</td>';
|
|
|
+ print '<td class="liste_titre">'.$langs->trans('Date').'</td>';
|
|
|
+ print '<td class="liste_titre">'.$langs->trans('Type').'</td>';
|
|
|
if (!empty($conf->banque->enabled)) {
|
|
|
print '<td class="liste_titre right">'.$langs->trans('BankAccount').'</td>';
|
|
|
}
|
|
|
- print '<td class="liste_titre right">'.$langs->trans('Amount').'</td>';
|
|
|
- print '<td class="liste_titre" width="18"> </td>';
|
|
|
- print '</tr>';
|
|
|
-
|
|
|
- // Payments already done (from payment on this expensereport)
|
|
|
- $sql = "SELECT p.rowid, p.num_payment, p.datep as dp, p.amount, p.fk_bank,";
|
|
|
- $sql .= "c.code as p_code, c.libelle as payment_type,";
|
|
|
- $sql .= "ba.rowid as baid, ba.ref as baref, ba.label, ba.number as banumber, ba.account_number, ba.fk_accountancy_journal";
|
|
|
- $sql .= " FROM ".MAIN_DB_PREFIX."expensereport as e, ".MAIN_DB_PREFIX."payment_expensereport as p";
|
|
|
- $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as c ON p.fk_typepayment = c.id";
|
|
|
- $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON p.fk_bank = b.rowid';
|
|
|
- $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank_account as ba ON b.fk_account = ba.rowid';
|
|
|
- $sql .= " WHERE e.rowid = '".$id."'";
|
|
|
- $sql .= " AND p.fk_expensereport = e.rowid";
|
|
|
- $sql .= ' AND e.entity IN ('.getEntity('expensereport').')';
|
|
|
- $sql .= " ORDER BY dp";
|
|
|
-
|
|
|
- $resql = $db->query($sql);
|
|
|
+ print '<td class="liste_titre right">'.$langs->trans('Amount').'</td>';
|
|
|
+ print '<td class="liste_titre" width="18"> </td>';
|
|
|
+ print '</tr>';
|
|
|
+
|
|
|
+ // Payments already done (from payment on this expensereport)
|
|
|
+ $sql = "SELECT p.rowid, p.num_payment, p.datep as dp, p.amount, p.fk_bank,";
|
|
|
+ $sql .= "c.code as p_code, c.libelle as payment_type,";
|
|
|
+ $sql .= "ba.rowid as baid, ba.ref as baref, ba.label, ba.number as banumber, ba.account_number, ba.fk_accountancy_journal";
|
|
|
+ $sql .= " FROM ".MAIN_DB_PREFIX."expensereport as e, ".MAIN_DB_PREFIX."payment_expensereport as p";
|
|
|
+ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as c ON p.fk_typepayment = c.id";
|
|
|
+ $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON p.fk_bank = b.rowid';
|
|
|
+ $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank_account as ba ON b.fk_account = ba.rowid';
|
|
|
+ $sql .= " WHERE e.rowid = '".$id."'";
|
|
|
+ $sql .= " AND p.fk_expensereport = e.rowid";
|
|
|
+ $sql .= ' AND e.entity IN ('.getEntity('expensereport').')';
|
|
|
+ $sql .= " ORDER BY dp";
|
|
|
+
|
|
|
+ $resql = $db->query($sql);
|
|
|
if ($resql) {
|
|
|
$num = $db->num_rows($resql);
|
|
|
$i = 0; $totalpaid = 0;
|
|
@@ -2000,29 +2000,29 @@ if ($action == 'create') {
|
|
|
} else {
|
|
|
dol_print_error($db);
|
|
|
}
|
|
|
- print "</table>";
|
|
|
+ print "</table>";
|
|
|
|
|
|
- print '</div>';
|
|
|
- print '</div>';
|
|
|
- print '</div>';
|
|
|
+ print '</div>';
|
|
|
+ print '</div>';
|
|
|
+ print '</div>';
|
|
|
|
|
|
- print '<div class="clearboth"></div><br>';
|
|
|
+ print '<div class="clearboth"></div><br>';
|
|
|
|
|
|
- print '<div style="clear: both;"></div>';
|
|
|
+ print '<div style="clear: both;"></div>';
|
|
|
|
|
|
- $actiontouse = 'updateline';
|
|
|
+ $actiontouse = 'updateline';
|
|
|
if (($object->status == 0 || $object->status == 99) && $action != 'editline') {
|
|
|
$actiontouse = 'addline';
|
|
|
}
|
|
|
|
|
|
- print '<form name="expensereport" action="'.$_SERVER["PHP_SELF"].'" enctype="multipart/form-data" method="post" >';
|
|
|
- print '<input type="hidden" name="token" value="'.newToken().'">';
|
|
|
- print '<input type="hidden" name="action" value="'.$actiontouse.'">';
|
|
|
- print '<input type="hidden" name="id" value="'.$object->id.'">';
|
|
|
- print '<input type="hidden" name="fk_expensereport" value="'.$object->id.'" />';
|
|
|
+ print '<form name="expensereport" action="'.$_SERVER["PHP_SELF"].'" enctype="multipart/form-data" method="post" >';
|
|
|
+ print '<input type="hidden" name="token" value="'.newToken().'">';
|
|
|
+ print '<input type="hidden" name="action" value="'.$actiontouse.'">';
|
|
|
+ print '<input type="hidden" name="id" value="'.$object->id.'">';
|
|
|
+ print '<input type="hidden" name="fk_expensereport" value="'.$object->id.'" />';
|
|
|
|
|
|
- print '<div class="div-table-responsive-no-min">';
|
|
|
- print '<table id="tablelines" class="noborder centpercent">';
|
|
|
+ print '<div class="div-table-responsive-no-min">';
|
|
|
+ print '<table id="tablelines" class="noborder centpercent">';
|
|
|
|
|
|
if (!empty($object->lines)) {
|
|
|
$i = 0; $total = 0;
|
|
@@ -2214,6 +2214,7 @@ if ($action == 'create') {
|
|
|
$colspan++;
|
|
|
}
|
|
|
|
|
|
+ print '<!-- line of expense report -->'."\n";
|
|
|
print '<tr class="tredited">';
|
|
|
|
|
|
print '<td class="center">';
|
|
@@ -2333,8 +2334,10 @@ if ($action == 'create') {
|
|
|
//print $line->fk_ecm_files;
|
|
|
print '</td>';
|
|
|
|
|
|
+ print '<td>';
|
|
|
print '<input type="hidden" name="rowid" value="'.$line->rowid.'">';
|
|
|
- print $form->buttonsSaveCancel();
|
|
|
+ print $form->buttonsSaveCancel('Save', 'Cancel', array(), 0, 'small');
|
|
|
+ print '</td>';
|
|
|
|
|
|
print '</tr>';
|
|
|
}
|
|
@@ -2344,10 +2347,8 @@ if ($action == 'create') {
|
|
|
}
|
|
|
|
|
|
// Add a new line
|
|
|
- if (($object->status == ExpenseReport::STATUS_DRAFT || $object->status == ExpenseReport::STATUS_REFUSED)
|
|
|
- && $action != 'editline'
|
|
|
- && $user->rights->expensereport->creer) {
|
|
|
- $colspan = 11;
|
|
|
+ if (($object->status == ExpenseReport::STATUS_DRAFT || $object->status == ExpenseReport::STATUS_REFUSED) && $action != 'editline' && $user->rights->expensereport->creer) {
|
|
|
+ $colspan = 11;
|
|
|
if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) {
|
|
|
$colspan++;
|
|
|
}
|
|
@@ -2358,8 +2359,8 @@ if ($action == 'create') {
|
|
|
$colspan++;
|
|
|
}
|
|
|
|
|
|
- $nbFiles = $nbLinks = 0;
|
|
|
- $arrayoffiles = array();
|
|
|
+ $nbFiles = $nbLinks = 0;
|
|
|
+ $arrayoffiles = array();
|
|
|
if (empty($conf->global->EXPENSEREPORT_DISABLE_ATTACHMENT_ON_LINES)) {
|
|
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
|
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
|
|
@@ -2370,21 +2371,21 @@ if ($action == 'create') {
|
|
|
$nbLinks = Link::count($db, $object->element, $object->id);
|
|
|
}
|
|
|
|
|
|
- // Add line with link to add new file or attach to an existing file
|
|
|
- print '<tr class="liste_titre">';
|
|
|
- print '<td colspan="'.$colspan.'" class="liste_titre">';
|
|
|
- print '<a href="" class="commonlink auploadnewfilenow reposition">'.$langs->trans("UploadANewFileNow");
|
|
|
- print img_picto($langs->trans("UploadANewFileNow"), 'chevron-down', '', false, 0, 0, '', 'marginleftonly');
|
|
|
- print '</a>';
|
|
|
+ // Add line with link to add new file or attach to an existing file
|
|
|
+ print '<tr class="liste_titre">';
|
|
|
+ print '<td colspan="'.$colspan.'" class="liste_titre">';
|
|
|
+ print '<a href="" class="commonlink auploadnewfilenow reposition">'.$langs->trans("UploadANewFileNow");
|
|
|
+ print img_picto($langs->trans("UploadANewFileNow"), 'chevron-down', '', false, 0, 0, '', 'marginleftonly');
|
|
|
+ print '</a>';
|
|
|
if (empty($conf->global->EXPENSEREPORT_DISABLE_ATTACHMENT_ON_LINES)) {
|
|
|
print ' - <a href="" class="commonlink aattachtodoc reposition">'.$langs->trans("AttachTheNewLineToTheDocument");
|
|
|
print img_picto($langs->trans("AttachTheNewLineToTheDocument"), 'chevron-down', '', false, 0, 0, '', 'marginleftonly');
|
|
|
print '</a>';
|
|
|
}
|
|
|
|
|
|
- print '<!-- Code to open/close section to submit or link files in the form to add new line -->'."\n";
|
|
|
- print '<script language="javascript">'."\n";
|
|
|
- print '$(document).ready(function() {
|
|
|
+ print '<!-- Code to open/close section to submit or link files in the form to add new line -->'."\n";
|
|
|
+ print '<script language="javascript">'."\n";
|
|
|
+ print '$(document).ready(function() {
|
|
|
$( ".auploadnewfilenow" ).click(function() {
|
|
|
console.log("We click on toggle of auploadnewfilenow");
|
|
|
jQuery(".truploadnewfilenow").toggle();
|
|
@@ -2405,7 +2406,7 @@ if ($action == 'create') {
|
|
|
if (is_array(GETPOST('attachfile', 'array')) && count(GETPOST('attachfile', 'array')) && $action != 'updateline') {
|
|
|
print 'jQuery(".trattachnewfilenow").show();'."\n";
|
|
|
}
|
|
|
- print '
|
|
|
+ print '
|
|
|
jQuery("form[name=\"expensereport\"]").submit(function() {
|
|
|
if (jQuery(".truploadnewfilenow").is(":hidden")) {
|
|
|
/* When section to send file is not expanded, we disable the button sendit that submit form to add a new file, so button to submit line will work. */
|
|
@@ -2416,47 +2417,47 @@ if ($action == 'create') {
|
|
|
}
|
|
|
});
|
|
|
';
|
|
|
- print '
|
|
|
+ print '
|
|
|
});
|
|
|
';
|
|
|
- print '</script>'."\n";
|
|
|
- print '</td></tr>';
|
|
|
+ print '</script>'."\n";
|
|
|
+ print '</td></tr>';
|
|
|
|
|
|
- include DOL_DOCUMENT_ROOT.'/expensereport/tpl/expensereport_linktofile.tpl.php';
|
|
|
- include DOL_DOCUMENT_ROOT.'/expensereport/tpl/expensereport_addfile.tpl.php';
|
|
|
+ include DOL_DOCUMENT_ROOT.'/expensereport/tpl/expensereport_linktofile.tpl.php';
|
|
|
+ include DOL_DOCUMENT_ROOT.'/expensereport/tpl/expensereport_addfile.tpl.php';
|
|
|
|
|
|
- print '<tr class="liste_titre">';
|
|
|
- print '<td></td>';
|
|
|
- print '<td class="center">'.$langs->trans('Date').'</td>';
|
|
|
+ print '<tr class="liste_titre">';
|
|
|
+ print '<td></td>';
|
|
|
+ print '<td class="center">'.$langs->trans('Date').'</td>';
|
|
|
if (!empty($conf->projet->enabled)) {
|
|
|
print '<td class="minwidth100imp">'.$form->textwithpicto($langs->trans('Project'), $langs->trans("ClosedProjectsAreHidden")).'</td>';
|
|
|
}
|
|
|
- print '<td class="center">'.$langs->trans('Type').'</td>';
|
|
|
+ print '<td class="center">'.$langs->trans('Type').'</td>';
|
|
|
if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) {
|
|
|
print '<td>'.$langs->trans('CarCategory').'</td>';
|
|
|
}
|
|
|
- print '<td>'.$langs->trans('Description').'</td>';
|
|
|
- print '<td class="right">'.$langs->trans('VAT').'</td>';
|
|
|
- print '<td class="right">'.$langs->trans('PriceUHT').'</td>';
|
|
|
- print '<td class="right">'.$langs->trans('PriceUTTC').'</td>';
|
|
|
- print '<td class="right">'.$langs->trans('Qty').'</td>';
|
|
|
- print '<td></td>';
|
|
|
- print '<td></td>';
|
|
|
- print '<td></td>';
|
|
|
- print '<td></td>';
|
|
|
- print '</tr>';
|
|
|
+ print '<td>'.$langs->trans('Description').'</td>';
|
|
|
+ print '<td class="right">'.$langs->trans('VAT').'</td>';
|
|
|
+ print '<td class="right">'.$langs->trans('PriceUHT').'</td>';
|
|
|
+ print '<td class="right">'.$langs->trans('PriceUTTC').'</td>';
|
|
|
+ print '<td class="right">'.$langs->trans('Qty').'</td>';
|
|
|
+ print '<td></td>';
|
|
|
+ print '<td></td>';
|
|
|
+ print '<td></td>';
|
|
|
+ print '<td></td>';
|
|
|
+ print '</tr>';
|
|
|
|
|
|
- print '<tr class="oddeven nohover">';
|
|
|
+ print '<tr class="oddeven nohover">';
|
|
|
|
|
|
- // Line number
|
|
|
- print '<td></td>';
|
|
|
+ // Line number
|
|
|
+ print '<td></td>';
|
|
|
|
|
|
- // Select date
|
|
|
- print '<td class="center">';
|
|
|
- print $form->selectDate($date ? $date : -1, 'date', 0, 0, 0, '', 1, 1);
|
|
|
- print '</td>';
|
|
|
+ // Select date
|
|
|
+ print '<td class="center">';
|
|
|
+ print $form->selectDate($date ? $date : -1, 'date', 0, 0, 0, '', 1, 1);
|
|
|
+ print '</td>';
|
|
|
|
|
|
- // Select project
|
|
|
+ // Select project
|
|
|
if (!empty($conf->projet->enabled)) {
|
|
|
print '<td>';
|
|
|
$formproject->select_projects(-1, $fk_project, 'fk_project', 0, 0, $projectRequired ? 0 : 1, -1, 0, 0, 0, '', 0, 0, 'maxwidth300');
|
|
@@ -2475,48 +2476,48 @@ if ($action == 'create') {
|
|
|
print '</td>';
|
|
|
}
|
|
|
|
|
|
- // Add comments
|
|
|
- print '<td>';
|
|
|
- print '<textarea class="flat_ndf centpercent" name="comments" rows="'.ROWS_2.'">'.dol_escape_htmltag($comments, 0, 1).'</textarea>';
|
|
|
- print '</td>';
|
|
|
+ // Add comments
|
|
|
+ print '<td>';
|
|
|
+ print '<textarea class="flat_ndf centpercent" name="comments" rows="'.ROWS_2.'">'.dol_escape_htmltag($comments, 0, 1).'</textarea>';
|
|
|
+ print '</td>';
|
|
|
|
|
|
- // Select VAT
|
|
|
- print '<td class="right">';
|
|
|
- $defaultvat = -1;
|
|
|
+ // Select VAT
|
|
|
+ print '<td class="right">';
|
|
|
+ $defaultvat = -1;
|
|
|
if (!empty($conf->global->EXPENSEREPORT_NO_DEFAULT_VAT)) {
|
|
|
$conf->global->MAIN_VAT_DEFAULT_IF_AUTODETECT_FAILS = 'none';
|
|
|
}
|
|
|
- print $form->load_tva('vatrate', ($vatrate != '' ? $vatrate : $defaultvat), $mysoc, '', 0, 0, '', false, 1);
|
|
|
- print '</td>';
|
|
|
+ print $form->load_tva('vatrate', ($vatrate != '' ? $vatrate : $defaultvat), $mysoc, '', 0, 0, '', false, 1);
|
|
|
+ print '</td>';
|
|
|
|
|
|
- // Unit price net
|
|
|
- print '<td class="right">';
|
|
|
- print '<input type="text" class="right maxwidth50" id="value_unit_ht" name="value_unit_ht" value="'.dol_escape_htmltag($value_unit_ht).'"'.$taxlessUnitPriceDisabled.' />';
|
|
|
- print '</td>';
|
|
|
+ // Unit price net
|
|
|
+ print '<td class="right">';
|
|
|
+ print '<input type="text" class="right maxwidth50" id="value_unit_ht" name="value_unit_ht" value="'.dol_escape_htmltag($value_unit_ht).'"'.$taxlessUnitPriceDisabled.' />';
|
|
|
+ print '</td>';
|
|
|
|
|
|
- // Unit price with tax
|
|
|
- print '<td class="right">';
|
|
|
- print '<input type="text" class="right maxwidth50" id="value_unit" name="value_unit" value="'.dol_escape_htmltag($value_unit).'">';
|
|
|
- print '</td>';
|
|
|
+ // Unit price with tax
|
|
|
+ print '<td class="right">';
|
|
|
+ print '<input type="text" class="right maxwidth50" id="value_unit" name="value_unit" value="'.dol_escape_htmltag($value_unit).'">';
|
|
|
+ print '</td>';
|
|
|
|
|
|
- // Quantity
|
|
|
- print '<td class="right">';
|
|
|
- print '<input type="text" min="0" class="right maxwidth50" name="qty" value="'.dol_escape_htmltag($qty ? $qty : 1).'">'; // We must be able to enter decimal qty
|
|
|
- print '</td>';
|
|
|
+ // Quantity
|
|
|
+ print '<td class="right">';
|
|
|
+ print '<input type="text" min="0" class="right maxwidth50" name="qty" value="'.dol_escape_htmltag($qty ? $qty : 1).'">'; // We must be able to enter decimal qty
|
|
|
+ print '</td>';
|
|
|
|
|
|
- // Picture
|
|
|
- print '<td></td>';
|
|
|
+ // Picture
|
|
|
+ print '<td></td>';
|
|
|
|
|
|
if ($action != 'editline') {
|
|
|
print '<td class="right"></td>';
|
|
|
print '<td class="right"></td>';
|
|
|
}
|
|
|
|
|
|
- print '<td class="center">';
|
|
|
- print $form->buttonsSaveCancel("Add", '', '', 1);
|
|
|
- print '</td>';
|
|
|
+ print '<td class="center">';
|
|
|
+ print $form->buttonsSaveCancel("Add", '', '', 1);
|
|
|
+ print '</td>';
|
|
|
|
|
|
- print '</tr>';
|
|
|
+ print '</tr>';
|
|
|
} // Fin si c'est payé/validé
|
|
|
|
|
|
print '</table>';
|