Update works
This commit is contained in:
parent
883446c5bb
commit
8800bf8b25
@ -1,11 +1,11 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
|
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
|
||||||
* Copyright (C) 2013-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
* Copyright (C) 2013-2016 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||||
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.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
|
||||||
@ -22,19 +22,20 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* \file htdocs/accountancy/supplier/card.php
|
* \file htdocs/accountancy/supplier/card.php
|
||||||
* \ingroup Accountancy
|
* \ingroup Accountancy
|
||||||
* \brief Card supplier ventilation
|
* \brief Card expense report ventilation
|
||||||
*/
|
*/
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
|
|
||||||
// Class
|
// Class
|
||||||
require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php';
|
||||||
|
|
||||||
// Langs
|
// Langs
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
$langs->load("accountancy");
|
$langs->load("accountancy");
|
||||||
|
$langs->load("trips");
|
||||||
|
|
||||||
$action = GETPOST('action', 'alpha');
|
$action = GETPOST('action', 'alpha');
|
||||||
$codeventil = GETPOST('codeventil');
|
$codeventil = GETPOST('codeventil');
|
||||||
@ -44,16 +45,15 @@ $id = GETPOST('id');
|
|||||||
if ($user->societe_id > 0)
|
if ($user->societe_id > 0)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($action == 'ventil' && $user->rights->accounting->bind->write) {
|
if ($action == 'ventil' && $user->rights->accounting->bind->write) {
|
||||||
if (! GETPOST('cancel', 'alpha')) {
|
if (! GETPOST('cancel', 'alpha')) {
|
||||||
if ($codeventil < 0) $codeventil = 0;
|
if ($codeventil < 0) $codeventil = 0;
|
||||||
|
|
||||||
$sql = " UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det";
|
$sql = " UPDATE " . MAIN_DB_PREFIX . "expensereport_det";
|
||||||
$sql .= " SET fk_code_ventilation = " . $codeventil;
|
$sql .= " SET fk_code_ventilation = " . $codeventil;
|
||||||
$sql .= " WHERE rowid = " . $id;
|
$sql .= " WHERE rowid = " . $id;
|
||||||
|
|
||||||
@ -63,7 +63,7 @@ if ($action == 'ventil' && $user->rights->accounting->bind->write) {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs');
|
setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
header("Location: ./lines.php");
|
header("Location: ./lines.php");
|
||||||
@ -76,7 +76,7 @@ if ($action == 'ventil' && $user->rights->accounting->bind->write) {
|
|||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
llxHeader("", "", "FicheVentilation");
|
llxHeader("", "FicheVentilation");
|
||||||
|
|
||||||
if ($cancel == $langs->trans("Cancel")) {
|
if ($cancel == $langs->trans("Cancel")) {
|
||||||
$action = '';
|
$action = '';
|
||||||
@ -84,21 +84,21 @@ if ($cancel == $langs->trans("Cancel")) {
|
|||||||
|
|
||||||
// Create
|
// Create
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
$facturefournisseur_static = new FactureFournisseur($db);
|
$expensereport_static = new ExpenseReport($db);
|
||||||
$formventilation = new FormVentilation($db);
|
$formventilation = new FormVentilation($db);
|
||||||
|
|
||||||
if (! empty($id)) {
|
if (! empty($id)) {
|
||||||
$sql = "SELECT f.ref as facnumber, f.rowid as facid, l.fk_product, l.description, l.rowid, l.fk_code_ventilation, ";
|
$sql = "SELECT er.ref, er.rowid as facid, erd.fk_c_type_fees, erd.comments, erd.rowid, erd.fk_code_ventilation,";
|
||||||
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label";
|
$sql .= " f.id as fees_id, f.label as fees_label,";
|
||||||
$sql .= ", aa.account_number, aa.label";
|
$sql .= " aa.account_number, aa.label";
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn_det as l";
|
$sql .= " FROM " . MAIN_DB_PREFIX . "expensereport_det as erd";
|
||||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_type_fees as f ON f.id = erd.fk_c_type_fees";
|
||||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON l.fk_code_ventilation = aa.rowid";
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON erd.fk_code_ventilation = aa.rowid";
|
||||||
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn as f ON f.rowid = l.fk_facture_fourn ";
|
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "expensereport as er ON er.rowid = erd.fk_expensereport";
|
||||||
$sql .= " WHERE f.fk_statut > 0 AND l.rowid = " . $id;
|
$sql .= " WHERE er.fk_statut > 0 AND erd.rowid = " . $id;
|
||||||
$sql .= " AND f.entity IN (" . getEntity("facture_fourn", 0) . ")"; // We don't share object for accountancy
|
$sql .= " AND er.entity IN (" . getEntity("expensereport", 0) . ")"; // We don't share object for accountancy
|
||||||
|
|
||||||
dol_syslog("/accounting/supplier/card.php sql=" . $sql, LOG_DEBUG);
|
dol_syslog("/accounting/expensereport/card.php sql=" . $sql, LOG_DEBUG);
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|
||||||
if ($result) {
|
if ($result) {
|
||||||
@ -112,24 +112,29 @@ if (! empty($id)) {
|
|||||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||||
print '<input type="hidden" name="action" value="ventil">';
|
print '<input type="hidden" name="action" value="ventil">';
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans('SuppliersVentilation'), '', 'title_setup');
|
print load_fiche_titre($langs->trans('ExpenseReportsVentilation'), '', 'title_setup');
|
||||||
|
|
||||||
dol_fiche_head();
|
dol_fiche_head();
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// ref invoice
|
// Ref
|
||||||
print '<tr><td>' . $langs->trans("BillsSuppliers") . '</td>';
|
print '<tr><td class="titlefield">' . $langs->trans("ExpenseReport") . '</td>';
|
||||||
$facturefournisseur_static->ref = $objp->facnumber;
|
$expensereport_static->ref = $objp->ref;
|
||||||
$facturefournisseur_static->id = $objp->facid;
|
$expensereport_static->id = $objp->erid;
|
||||||
print '<td>' . $facturefournisseur_static->getNomUrl(1) . '</td>';
|
print '<td>' . $expensereport_static->getNomUrl(1) . '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print '<tr><td width="20%">' . $langs->trans("Line") . '</td>';
|
print '<tr><td>' . $langs->trans("Line") . '</td>';
|
||||||
print '<td>' . stripslashes(nl2br($objp->description)) . '</td></tr>';
|
print '<td>' . stripslashes(nl2br($objp->rowid)) . '</td></tr>';
|
||||||
print '<tr><td width="20%">' . $langs->trans("ProductLabel") . '</td>';
|
|
||||||
print '<td>' . dol_trunc($objp->product_label, 24) . '</td>';
|
print '<tr><td>' . $langs->trans("Description") . '</td>';
|
||||||
print '<tr><td width="20%">' . $langs->trans("Account") . '</td><td>';
|
print '<td>' . stripslashes(nl2br($objp->comments)) . '</td></tr>';
|
||||||
|
|
||||||
|
print '<tr><td>' . $langs->trans("TypeFees") . '</td>';
|
||||||
|
print '<td>' . dol_trunc($objp->fees_label, 24) . '</td>';
|
||||||
|
|
||||||
|
print '<tr><td>' . $langs->trans("Account") . '</td><td>';
|
||||||
print $formventilation->select_account($objp->fk_code_ventilation, 'codeventil', 1);
|
print $formventilation->select_account($objp->fk_code_ventilation, 'codeventil', 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
/* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
* Copyright (C) 2013-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
* Copyright (C) 2013-2016 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||||
* Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
* Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
||||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||||
*
|
*
|
||||||
* 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
|
||||||
@ -20,16 +20,15 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/accountancy/supplier/lines.php
|
* \file htdocs/accountancy/expensereport/lines.php
|
||||||
* \ingroup Advanced accountancy
|
* \ingroup Advanced accountancy
|
||||||
* \brief Page of detail of the lines of ventilation of invoices suppliers
|
* \brief Page of detail of the lines of ventilation of expense reports
|
||||||
*/
|
*/
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
|
|
||||||
// Class
|
// Class
|
||||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||||
|
|
||||||
@ -39,12 +38,12 @@ $langs->load("bills");
|
|||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
$langs->load("main");
|
$langs->load("main");
|
||||||
$langs->load("accountancy");
|
$langs->load("accountancy");
|
||||||
|
$langs->load("trips");
|
||||||
|
|
||||||
$account_parent = GETPOST('account_parent');
|
$account_parent = GETPOST('account_parent');
|
||||||
$changeaccount = GETPOST('changeaccount');
|
$changeaccount = GETPOST('changeaccount');
|
||||||
// Search Getpost
|
// Search Getpost
|
||||||
$search_ref = GETPOST('search_ref', 'alpha');
|
$search_expensereport = GETPOST('search_expensereport', 'alpha');
|
||||||
$search_invoice = GETPOST('search_invoice', 'alpha');
|
|
||||||
$search_label = GETPOST('search_label', 'alpha');
|
$search_label = GETPOST('search_label', 'alpha');
|
||||||
$search_desc = GETPOST('search_desc', 'alpha');
|
$search_desc = GETPOST('search_desc', 'alpha');
|
||||||
$search_amount = GETPOST('search_amount', 'alpha');
|
$search_amount = GETPOST('search_amount', 'alpha');
|
||||||
@ -61,7 +60,7 @@ $offset = $conf->liste_limit * $page;
|
|||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
$pagenext = $page + 1;
|
$pagenext = $page + 1;
|
||||||
if (! $sortfield)
|
if (! $sortfield)
|
||||||
$sortfield = "f.datef, f.ref, l.rowid";
|
$sortfield = "er.date_create, er.ref, erd.rowid";
|
||||||
if (! $sortorder) {
|
if (! $sortorder) {
|
||||||
if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE > 0) {
|
if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE > 0) {
|
||||||
$sortorder = "DESC";
|
$sortorder = "DESC";
|
||||||
@ -84,8 +83,7 @@ $formventilation = new FormVentilation($db);
|
|||||||
// 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
|
||||||
{
|
{
|
||||||
$search_ref = '';
|
$search_expensereport = '';
|
||||||
$search_invoice = '';
|
|
||||||
$search_label = '';
|
$search_label = '';
|
||||||
$search_desc = '';
|
$search_desc = '';
|
||||||
$search_amount = '';
|
$search_amount = '';
|
||||||
@ -98,11 +96,11 @@ if (is_array($changeaccount) && count($changeaccount) > 0) {
|
|||||||
|
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det as l";
|
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "expensereport_det as erd";
|
||||||
$sql1 .= " SET l.fk_code_ventilation=" . GETPOST('account_parent');
|
$sql1 .= " SET erd.fk_code_ventilation=" . GETPOST('account_parent');
|
||||||
$sql1 .= ' WHERE l.rowid IN (' . implode(',', $changeaccount) . ')';
|
$sql1 .= ' WHERE erd.rowid IN (' . implode(',', $changeaccount) . ')';
|
||||||
|
|
||||||
dol_syslog('accountancy/supplier/lines.php::changeaccount sql= ' . $sql1);
|
dol_syslog('accountancy/expensereport/lines.php::changeaccount sql= ' . $sql1);
|
||||||
$resql1 = $db->query($sql1);
|
$resql1 = $db->query($sql1);
|
||||||
if (! $resql1) {
|
if (! $resql1) {
|
||||||
$error ++;
|
$error ++;
|
||||||
@ -124,7 +122,7 @@ if (is_array($changeaccount) && count($changeaccount) > 0) {
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
llxHeader('', $langs->trans("SuppliersVentilation") . ' - ' . $langs->trans("Dispatched"));
|
llxHeader('', $langs->trans("ExpenseReportVentilation") . ' - ' . $langs->trans("Dispatched"));
|
||||||
|
|
||||||
print '<script type="text/javascript">
|
print '<script type="text/javascript">
|
||||||
$(function () {
|
$(function () {
|
||||||
@ -144,38 +142,35 @@ print '<script type="text/javascript">
|
|||||||
</script>';
|
</script>';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Supplier Invoice lines
|
* Expense reports lines
|
||||||
*/
|
*/
|
||||||
$sql = "SELECT f.ref as facnumber, f.rowid as facid, l.fk_product, l.description, l.total_ht , l.qty, l.rowid, l.tva_tx, aa.label, aa.account_number, ";
|
$sql = "SELECT er.ref, er.rowid as erid, erd.rowid, erd.fk_c_type_fees, erd.comments, erd.total_ht, erd.fk_code_ventilation, erd.tva_tx, aa.label, aa.account_number, ";
|
||||||
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type";
|
$sql .= " f.id as fees_id, f.label as fees_label";
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn as f";
|
$sql .= " FROM " . MAIN_DB_PREFIX . "expensereport as er";
|
||||||
$sql .= " , " . MAIN_DB_PREFIX . "accounting_account as aa";
|
$sql .= " , " . MAIN_DB_PREFIX . "accounting_account as aa";
|
||||||
$sql .= " , " . MAIN_DB_PREFIX . "facture_fourn_det as l";
|
$sql .= " , " . MAIN_DB_PREFIX . "expensereport_det as erd";
|
||||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_type_fees as f ON f.id = erd.fk_c_type_fees";
|
||||||
$sql .= " WHERE f.rowid = l.fk_facture_fourn and f.fk_statut >= 1 AND l.fk_code_ventilation <> 0 ";
|
$sql .= " WHERE er.rowid = erd.fk_expensereport and er.fk_statut >= 5 AND erd.fk_code_ventilation <> 0 ";
|
||||||
$sql .= " AND aa.rowid = l.fk_code_ventilation";
|
$sql .= " AND aa.rowid = erd.fk_code_ventilation";
|
||||||
if (strlen(trim($search_invoice))) {
|
if (strlen(trim($search_expensereport))) {
|
||||||
$sql .= " AND f.ref like '%" . $search_invoice . "%'";
|
$sql .= " AND er.ref like '%" . $search_expensereport . "%'";
|
||||||
}
|
|
||||||
if (strlen(trim($search_ref))) {
|
|
||||||
$sql .= " AND p.ref like '%" . $search_ref . "%'";
|
|
||||||
}
|
}
|
||||||
if (strlen(trim($search_label))) {
|
if (strlen(trim($search_label))) {
|
||||||
$sql .= " AND p.label like '%" . $search_label . "%'";
|
$sql .= " AND f.label like '%" . $search_label . "%'";
|
||||||
}
|
}
|
||||||
if (strlen(trim($search_desc))) {
|
if (strlen(trim($search_desc))) {
|
||||||
$sql .= " AND l.description like '%" . $search_desc . "%'";
|
$sql .= " AND er.comments like '%" . $search_desc . "%'";
|
||||||
}
|
}
|
||||||
if (strlen(trim($search_amount))) {
|
if (strlen(trim($search_amount))) {
|
||||||
$sql .= " AND l.total_ht like '%" . $search_amount . "%'";
|
$sql .= " AND erd.total_ht like '%" . $search_amount . "%'";
|
||||||
}
|
}
|
||||||
if (strlen(trim($search_account))) {
|
if (strlen(trim($search_account))) {
|
||||||
$sql .= " AND aa.account_number like '%" . $search_account . "%'";
|
$sql .= " AND aa.account_number like '%" . $search_account . "%'";
|
||||||
}
|
}
|
||||||
if (strlen(trim($search_vat))) {
|
if (strlen(trim($search_vat))) {
|
||||||
$sql .= " AND (l.tva_tx like '" . $search_vat . "%')";
|
$sql .= " AND (erd.tva_tx like '" . $search_vat . "%')";
|
||||||
}
|
}
|
||||||
$sql .= " AND f.entity IN (" . getEntity("facture_fourn", 0) . ")"; // We don't share object for accountancy
|
$sql .= " AND er.entity IN (" . getEntity("expensereport", 0) . ")"; // We don't share object for accountancy
|
||||||
|
|
||||||
$sql .= $db->order($sortfield, $sortorder);
|
$sql .= $db->order($sortfield, $sortorder);
|
||||||
|
|
||||||
@ -189,7 +184,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
|||||||
|
|
||||||
$sql .= $db->plimit($limit + 1, $offset);
|
$sql .= $db->plimit($limit + 1, $offset);
|
||||||
|
|
||||||
dol_syslog('accountancy/supplier/lines.php::list');
|
dol_syslog('accountancy/expensereport/lines.php::list');
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|
||||||
if ($result) {
|
if ($result) {
|
||||||
@ -199,10 +194,8 @@ if ($result) {
|
|||||||
$param='';
|
$param='';
|
||||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
||||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
||||||
if ($search_invoice)
|
if ($search_expensereport)
|
||||||
$param .= "&search_invoice=" . $search_invoice;
|
$param .= "&search_expensereport=" . $search_expensereport;
|
||||||
if ($search_ref)
|
|
||||||
$param .= "&search_ref=" . $search_ref;
|
|
||||||
if ($search_label)
|
if ($search_label)
|
||||||
$param .= "&search_label=" . $search_label;
|
$param .= "&search_label=" . $search_label;
|
||||||
if ($search_desc)
|
if ($search_desc)
|
||||||
@ -224,9 +217,9 @@ if ($result) {
|
|||||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
|
|
||||||
print_barre_liste($langs->trans("InvoiceLinesDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit);
|
print_barre_liste($langs->trans("ExpenseReportLinesDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit);
|
||||||
|
|
||||||
print $langs->trans("DescVentilDoneSupplier") . '<br>';
|
print $langs->trans("DescVentilDoneExpenseReport") . '<br>';
|
||||||
|
|
||||||
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);
|
||||||
@ -237,20 +230,18 @@ if ($result) {
|
|||||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||||
|
|
||||||
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("ExpenseReport"), $_SERVER["PHP_SELF"], "er.ref", "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"], "f.label", "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre($langs->trans("Description"), $_SERVER["PHP_SELF"], "erd.comments", "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre($langs->trans("Description"), $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre($langs->trans("Amount"), $_SERVER["PHP_SELF"], "erd.total_ht", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||||
print_liste_field_titre($langs->trans("Amount"), $_SERVER["PHP_SELF"], "l.total_ht", "", $param, 'align="right"', $sortfield, $sortorder);
|
print_liste_field_titre($langs->trans("VATRate"), $_SERVER["PHP_SELF"], "erd.tva_tx", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||||
print_liste_field_titre($langs->trans("VATRate"), $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, 'align="center"', $sortfield, $sortorder);
|
|
||||||
print_liste_field_titre($langs->trans("Account"), $_SERVER["PHP_SELF"], "aa.account_number", "", $param, 'align="center"', $sortfield, $sortorder);
|
print_liste_field_titre($langs->trans("Account"), $_SERVER["PHP_SELF"], "aa.account_number", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||||
print_liste_field_titre($langs->trans("LineId"), $_SERVER["PHP_SELF"], "l.rowid", "", $param, 'align="right"', $sortfield, $sortorder);
|
print_liste_field_titre($langs->trans("LineId"), $_SERVER["PHP_SELF"], "erd.rowid", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||||
print_liste_field_titre('');
|
print_liste_field_titre('');
|
||||||
print_liste_field_titre('', '', '', '', '', 'align="center"');
|
print_liste_field_titre('', '', '', '', '', 'align="center"');
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
print '<tr class="liste_titre"><td><input type="text" class="flat" name="search_invoice" size="10" value="' . $search_invoice . '"></td>';
|
print '<tr class="liste_titre"><td><input type="text" class="flat" name="search_expensereport" size="10" value="' . $search_expensereport . '"></td>';
|
||||||
print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_ref" value="' . $search_ref . '"></td>';
|
|
||||||
print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_label" value="' . $search_label . '"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_label" value="' . $search_label . '"></td>';
|
||||||
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_desc" value="' . $search_desc . '"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_desc" value="' . $search_desc . '"></td>';
|
||||||
print '<td class="liste_titre" align="right"><input type="text" class="flat" size="6" name="search_amount" value="' . $search_amount . '"></td>';
|
print '<td class="liste_titre" align="right"><input type="text" class="flat" size="6" name="search_amount" value="' . $search_amount . '"></td>';
|
||||||
@ -259,13 +250,12 @@ if ($result) {
|
|||||||
print '<td class="liste_titre" align="right"></td>';
|
print '<td class="liste_titre" align="right"></td>';
|
||||||
print '<td class="liste_titre" align="right"></td>';
|
print '<td class="liste_titre" align="right"></td>';
|
||||||
print '<td class="liste_titre" align="right">';
|
print '<td class="liste_titre" align="right">';
|
||||||
$searchpitco=$form->showFilterAndCheckAddButtons(1);
|
$searchpicto=$form->showFilterAndCheckAddButtons(1);
|
||||||
print $searchpitco;
|
print $searchpicto;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
$facturefournisseur_static = new FactureFournisseur($db);
|
$expensereport_static = new ExpenseReport($db);
|
||||||
$product_static = new Product($db);
|
|
||||||
|
|
||||||
$var = True;
|
$var = True;
|
||||||
while ( $i < min($num_lines, $limit) ) {
|
while ( $i < min($num_lines, $limit) ) {
|
||||||
@ -276,28 +266,23 @@ if ($result) {
|
|||||||
print '<tr '. $bc[$var].'>';
|
print '<tr '. $bc[$var].'>';
|
||||||
|
|
||||||
// Ref Invoice
|
// Ref Invoice
|
||||||
$facturefournisseur_static->ref = $objp->facnumber;
|
$expensereport_static->ref = $objp->ref;
|
||||||
$facturefournisseur_static->id = $objp->facid;
|
$expensereport_static->id = $objp->erid;
|
||||||
print '<td>' . $facturefournisseur_static->getNomUrl(1) . '</td>';
|
print '<td>' . $expensereport_static->getNomUrl(1) . '</td>';
|
||||||
|
|
||||||
// Ref Product
|
print '<td>' . dol_trunc($objp->fees_label, 24) . '</td>';
|
||||||
$product_static->ref = $objp->product_ref;
|
|
||||||
$product_static->id = $objp->product_id;
|
$trunclength = defined('ACCOUNTING_LENGTH_DESCRIPTION') ? ACCOUNTING_LENGTH_DESCRIPTION : 32;
|
||||||
$product_static->type = $objp->type;
|
print '<td>' . nl2br(dol_trunc($objp->comments, $trunclength)) . '</td>';
|
||||||
$product_static->label = $objp->product_label;
|
|
||||||
print '<td>';
|
|
||||||
if ($product_static->id)
|
|
||||||
print $product_static->getNomUrl(1);
|
|
||||||
else
|
|
||||||
print ' ';
|
|
||||||
print '</td>';
|
|
||||||
|
|
||||||
print '<td>' . dol_trunc($objp->product_label, 24) . '</td>';
|
|
||||||
print '<td>' . nl2br(dol_trunc($objp->description, 32)) . '</td>';
|
|
||||||
print '<td align="right">' . price($objp->total_ht) . '</td>';
|
print '<td align="right">' . price($objp->total_ht) . '</td>';
|
||||||
|
|
||||||
print '<td align="center">' . price($objp->tva_tx) . '</td>';
|
print '<td align="center">' . price($objp->tva_tx) . '</td>';
|
||||||
|
|
||||||
print '<td>' . $codeCompta . '</td>';
|
print '<td>' . $codeCompta . '</td>';
|
||||||
|
|
||||||
print '<td align="right">' . $objp->rowid . '</td>';
|
print '<td align="right">' . $objp->rowid . '</td>';
|
||||||
|
|
||||||
print '<td align="left"><a href="./card.php?id=' . $objp->rowid . '">';
|
print '<td align="left"><a href="./card.php?id=' . $objp->rowid . '">';
|
||||||
print img_edit();
|
print img_edit();
|
||||||
print '</a></td>';
|
print '</a></td>';
|
||||||
|
|||||||
@ -66,8 +66,10 @@ CAHTF=Total purchase supplier before tax
|
|||||||
TotalExpenseReport=Total expense report
|
TotalExpenseReport=Total expense report
|
||||||
InvoiceLines=Lines of invoices to bind
|
InvoiceLines=Lines of invoices to bind
|
||||||
InvoiceLinesDone=Bound lines of invoices
|
InvoiceLinesDone=Bound lines of invoices
|
||||||
|
ExpenseReportLinesDone=Bound lines of expense reports
|
||||||
IntoAccount=Bind line with the accounting account
|
IntoAccount=Bind line with the accounting account
|
||||||
|
|
||||||
|
|
||||||
Ventilate=Bind
|
Ventilate=Bind
|
||||||
LineId=Id line
|
LineId=Id line
|
||||||
Processing=Processing
|
Processing=Processing
|
||||||
@ -160,7 +162,7 @@ DescVentilSupplier=Consult here the list of supplier invoice lines bound or not
|
|||||||
DescVentilDoneSupplier=Consult here the list of the lines of invoices supplier and their accounting account
|
DescVentilDoneSupplier=Consult here the list of the lines of invoices supplier and their accounting account
|
||||||
DescVentilExpenseReport=Consult here the list of expense report lines bound (or not) to a fee accounting account
|
DescVentilExpenseReport=Consult here the list of expense report lines bound (or not) to a fee accounting account
|
||||||
DescVentilExpenseReportMore=In most cases, if you use configured fees, the application will be able to make all the binding between your expense report lines and the accounting account of your chart of accounts, just in one click with the button <strong>"%s"</strong>. If account was not set on fees dictionary or if you still has some lines not bound to any account, you will have to make a manual binding from the menu "<strong>%s</strong>".
|
DescVentilExpenseReportMore=In most cases, if you use configured fees, the application will be able to make all the binding between your expense report lines and the accounting account of your chart of accounts, just in one click with the button <strong>"%s"</strong>. If account was not set on fees dictionary or if you still has some lines not bound to any account, you will have to make a manual binding from the menu "<strong>%s</strong>".
|
||||||
|
DescVentilDoneExpenseReport=Consult here the list of the lines of expenses reports and their fees accounting account
|
||||||
|
|
||||||
ValidateHistory=Bind Automatically
|
ValidateHistory=Bind Automatically
|
||||||
AutomaticBindingDone=Automatic binding done
|
AutomaticBindingDone=Automatic binding done
|
||||||
|
|||||||
@ -8,6 +8,7 @@ TripCard=Expense report card
|
|||||||
AddTrip=Create expense report
|
AddTrip=Create expense report
|
||||||
ListOfTrips=List of expense reports
|
ListOfTrips=List of expense reports
|
||||||
ListOfFees=List of fees
|
ListOfFees=List of fees
|
||||||
|
TypeFees=Types of fees
|
||||||
ShowTrip=Show expense report
|
ShowTrip=Show expense report
|
||||||
NewTrip=New expense report
|
NewTrip=New expense report
|
||||||
CompanyVisited=Company/foundation visited
|
CompanyVisited=Company/foundation visited
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user