Merge pull request #24110 from FHenry/dev_timespent_invoice_and_line_can_be_updated
feat: update invoice and invoice line on time spend #24102
This commit is contained in:
commit
9670747483
69
htdocs/core/ajax/ajaxinvoiceline.php
Normal file
69
htdocs/core/ajax/ajaxinvoiceline.php
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2022 Florian HENRY <florian.henry@scopen.fr>
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \file htdocs/core/ajax/ajaxinvoiceline.php
|
||||||
|
* \brief File to load contacts combobox
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (!defined('NOTOKENRENEWAL')) {
|
||||||
|
define('NOTOKENRENEWAL', '1'); // Disables token renewal
|
||||||
|
}
|
||||||
|
if (!defined('NOREQUIREMENU')) {
|
||||||
|
define('NOREQUIREMENU', '1');
|
||||||
|
}
|
||||||
|
if (!defined('NOREQUIREAJAX')) {
|
||||||
|
define('NOREQUIREAJAX', '1');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Load Dolibarr environment
|
||||||
|
require '../../main.inc.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
|
||||||
|
|
||||||
|
$invoice_id = GETPOST('id', 'int'); // id of thirdparty
|
||||||
|
$action = GETPOST('action', 'aZ09');
|
||||||
|
$htmlname = GETPOST('htmlname', 'alpha');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Security check
|
||||||
|
restrictedArea($user, 'facture', $invoice_id, '', '', 'fk_soc', 'rowid');
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* View
|
||||||
|
*/
|
||||||
|
|
||||||
|
top_httphead();
|
||||||
|
|
||||||
|
//print '<!-- Ajax page called with url '.dol_escape_htmltag($_SERVER["PHP_SELF"]).'?'.dol_escape_htmltag($_SERVER["QUERY_STRING"]).' -->'."\n";
|
||||||
|
|
||||||
|
// Load original field value
|
||||||
|
if (!empty($invoice_id) && !empty($action) && !empty($htmlname)) {
|
||||||
|
$formProject = new FormProjets($db);
|
||||||
|
|
||||||
|
$return = array();
|
||||||
|
if (empty($showempty)) {
|
||||||
|
$showempty = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
$return['value'] = $formProject->selectInvoiceAndLine($invoice_id, 0, 'invoiceid', 'invoicelineid', 'maxwidth500', array(), 1);
|
||||||
|
//$return['num'] = $form->num;
|
||||||
|
//$return['error'] = $form->error;
|
||||||
|
|
||||||
|
echo json_encode($return);
|
||||||
|
}
|
||||||
@ -903,6 +903,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return combo list of activated countries, into language of user
|
* Return combo list of activated countries, into language of user
|
||||||
*
|
*
|
||||||
@ -1038,6 +1039,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return select list of incoterms
|
* Return select list of incoterms
|
||||||
*
|
*
|
||||||
@ -1126,6 +1128,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return list of types of lines (product or service)
|
* Return list of types of lines (product or service)
|
||||||
* Example: 0=product, 1=service, 9=other (for external module)
|
* Example: 0=product, 1=service, 9=other (for external module)
|
||||||
@ -1187,6 +1190,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load into cache cache_types_fees, array of types of fees
|
* Load into cache cache_types_fees, array of types of fees
|
||||||
*
|
*
|
||||||
@ -1234,6 +1238,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return list of types of notes
|
* Return list of types of notes
|
||||||
*
|
*
|
||||||
@ -1278,6 +1283,7 @@ class Form
|
|||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Output html form to select a third party
|
* Output html form to select a third party
|
||||||
*
|
*
|
||||||
@ -1350,6 +1356,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Output html form to select a third party.
|
* Output html form to select a third party.
|
||||||
* Note, you must use the select_company to get the component to select a third party. This function must only be called by select_company.
|
* Note, you must use the select_company to get the component to select a third party. This function must only be called by select_company.
|
||||||
@ -1579,6 +1586,7 @@ class Form
|
|||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return HTML combo list of absolute discounts
|
* Return HTML combo list of absolute discounts
|
||||||
*
|
*
|
||||||
@ -1665,6 +1673,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return list of all contacts (for a third party or all)
|
* Return list of all contacts (for a third party or all)
|
||||||
*
|
*
|
||||||
@ -1915,6 +1924,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the HTML select list of users
|
* Return the HTML select list of users
|
||||||
*
|
*
|
||||||
@ -1937,6 +1947,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return select list of users
|
* Return select list of users
|
||||||
*
|
*
|
||||||
@ -2090,7 +2101,8 @@ class Form
|
|||||||
$disableline = ($enableonlytext ? $enableonlytext : '1');
|
$disableline = ($enableonlytext ? $enableonlytext : '1');
|
||||||
}
|
}
|
||||||
|
|
||||||
$labeltoshow = ''; $labeltoshowhtml = '';
|
$labeltoshow = '';
|
||||||
|
$labeltoshowhtml = '';
|
||||||
|
|
||||||
// $fullNameMode is 0=Lastname+Firstname (MAIN_FIRSTNAME_NAME_POSITION=1), 1=Firstname+Lastname (MAIN_FIRSTNAME_NAME_POSITION=0)
|
// $fullNameMode is 0=Lastname+Firstname (MAIN_FIRSTNAME_NAME_POSITION=1), 1=Firstname+Lastname (MAIN_FIRSTNAME_NAME_POSITION=0)
|
||||||
$fullNameMode = 0;
|
$fullNameMode = 0;
|
||||||
@ -2105,7 +2117,8 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Complete name with a more info string like: ' (info1 - info2 - ...)'
|
// Complete name with a more info string like: ' (info1 - info2 - ...)'
|
||||||
$moreinfo = ''; $moreinfohtml = '';
|
$moreinfo = '';
|
||||||
|
$moreinfohtml = '';
|
||||||
if (!empty($conf->global->MAIN_SHOW_LOGIN)) {
|
if (!empty($conf->global->MAIN_SHOW_LOGIN)) {
|
||||||
$moreinfo .= ($moreinfo ? ' - ' : ' (');
|
$moreinfo .= ($moreinfo ? ' - ' : ' (');
|
||||||
$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(');
|
$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(');
|
||||||
@ -2192,6 +2205,7 @@ class Form
|
|||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return select list of users. Selected users are stored into session.
|
* Return select list of users. Selected users are stored into session.
|
||||||
* List of users are provided into $_SESSION['assignedtouser'].
|
* List of users are provided into $_SESSION['assignedtouser'].
|
||||||
@ -2288,6 +2302,7 @@ class Form
|
|||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return list of products for customer in Ajax if Ajax activated or go to select_produits_list
|
* Return list of products for customer in Ajax if Ajax activated or go to select_produits_list
|
||||||
*
|
*
|
||||||
@ -2525,6 +2540,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return list of products for a customer.
|
* Return list of products for a customer.
|
||||||
* Called by select_produits.
|
* Called by select_produits.
|
||||||
@ -3216,6 +3232,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return list of products for customer (in Ajax if Ajax activated or go to select_produits_fournisseurs_list)
|
* Return list of products for customer (in Ajax if Ajax activated or go to select_produits_fournisseurs_list)
|
||||||
*
|
*
|
||||||
@ -3262,6 +3279,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return list of suppliers products
|
* Return list of suppliers products
|
||||||
*
|
*
|
||||||
@ -3691,6 +3709,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return list of suppliers prices for a product
|
* Return list of suppliers prices for a product
|
||||||
*
|
*
|
||||||
@ -3800,6 +3819,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return list of delivery address
|
* Return list of delivery address
|
||||||
*
|
*
|
||||||
@ -3848,6 +3868,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load into cache list of payment terms
|
* Load into cache list of payment terms
|
||||||
*
|
*
|
||||||
@ -3896,6 +3917,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load int a cache property th elist of possible delivery delays.
|
* Load int a cache property th elist of possible delivery delays.
|
||||||
*
|
*
|
||||||
@ -4076,6 +4098,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Charge dans cache la liste des types de paiements possibles
|
* Charge dans cache la liste des types de paiements possibles
|
||||||
*
|
*
|
||||||
@ -4127,6 +4150,7 @@ class Form
|
|||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* print list of payment modes.
|
* print list of payment modes.
|
||||||
* Constant MAIN_DEFAULT_PAYMENT_TERM_ID can used to set default value but scope is all application, probably not what you want.
|
* Constant MAIN_DEFAULT_PAYMENT_TERM_ID can used to set default value but scope is all application, probably not what you want.
|
||||||
@ -4243,6 +4267,7 @@ class Form
|
|||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return list of payment methods
|
* Return list of payment methods
|
||||||
* Constant MAIN_DEFAULT_PAYMENT_TYPE_ID can used to set default value but scope is all application, probably not what you want.
|
* Constant MAIN_DEFAULT_PAYMENT_TYPE_ID can used to set default value but scope is all application, probably not what you want.
|
||||||
@ -4385,6 +4410,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load in cache list of transport mode
|
* Load in cache list of transport mode
|
||||||
*
|
*
|
||||||
@ -4700,6 +4726,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a HTML select list of bank accounts
|
* Return a HTML select list of bank accounts
|
||||||
*
|
*
|
||||||
@ -4893,6 +4920,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return list of categories having choosed type
|
* Return list of categories having choosed type
|
||||||
*
|
*
|
||||||
@ -4987,6 +5015,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show a confirmation HTML form or AJAX popup
|
* Show a confirmation HTML form or AJAX popup
|
||||||
*
|
*
|
||||||
@ -5431,6 +5460,7 @@ class Form
|
|||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show a form to select a project
|
* Show a form to select a project
|
||||||
*
|
*
|
||||||
@ -5486,6 +5516,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show a form to select payment conditions
|
* Show a form to select payment conditions
|
||||||
*
|
*
|
||||||
@ -5546,6 +5577,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show a form to select a delivery delay
|
* Show a form to select a delivery delay
|
||||||
*
|
*
|
||||||
@ -5613,6 +5645,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show a form + html select a date
|
* Show a form + html select a date
|
||||||
*
|
*
|
||||||
@ -5662,6 +5695,7 @@ class Form
|
|||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show a select form to choose a user
|
* Show a select form to choose a user
|
||||||
*
|
*
|
||||||
@ -5698,6 +5732,7 @@ class Form
|
|||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show form with payment mode
|
* Show form with payment mode
|
||||||
*
|
*
|
||||||
@ -5775,6 +5810,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show form with multicurrency code
|
* Show form with multicurrency code
|
||||||
*
|
*
|
||||||
@ -5801,6 +5837,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show form with multicurrency rate
|
* Show form with multicurrency rate
|
||||||
*
|
*
|
||||||
@ -5840,6 +5877,7 @@ class Form
|
|||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show a select box with available absolute discounts
|
* Show a select box with available absolute discounts
|
||||||
*
|
*
|
||||||
@ -5941,6 +5979,7 @@ class Form
|
|||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show forms to select a contact
|
* Show forms to select a contact
|
||||||
*
|
*
|
||||||
@ -5983,6 +6022,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Output html select to select thirdparty
|
* Output html select to select thirdparty
|
||||||
*
|
*
|
||||||
@ -6033,6 +6073,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retourne la liste des devises, dans la langue de l'utilisateur
|
* Retourne la liste des devises, dans la langue de l'utilisateur
|
||||||
*
|
*
|
||||||
@ -6167,6 +6208,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load into the cache vat rates of a country
|
* Load into the cache vat rates of a country
|
||||||
*
|
*
|
||||||
@ -6237,6 +6279,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Output an HTML select vat rate.
|
* Output an HTML select vat rate.
|
||||||
* The name of this function should be selectVat. We keep bad name for compatibility purpose.
|
* The name of this function should be selectVat. We keep bad name for compatibility purpose.
|
||||||
@ -6435,6 +6478,7 @@ class Form
|
|||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show a HTML widget to input a date or combo list for day, month, years and optionaly hours and minutes.
|
* Show a HTML widget to input a date or combo list for day, month, years and optionaly hours and minutes.
|
||||||
* Fields are preselected with :
|
* Fields are preselected with :
|
||||||
@ -6991,6 +7035,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function to show a form to select a duration on a page
|
* Function to show a form to select a duration on a page
|
||||||
*
|
*
|
||||||
@ -8913,7 +8958,8 @@ class Form
|
|||||||
'perms' => 1,
|
'perms' => 1,
|
||||||
'label' => 'LinkToContract',
|
'label' => 'LinkToContract',
|
||||||
'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_customer as ref_client, t.ref_supplier, SUM(td.total_ht) as total_ht
|
'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_customer as ref_client, t.ref_supplier, SUM(td.total_ht) as total_ht
|
||||||
FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."contrat as t, ".$this->db->prefix()."contratdet as td WHERE t.fk_soc = s.rowid AND td.fk_contrat = t.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('contract').') GROUP BY s.rowid, s.nom, s.client, t.rowid, t.ref, t.ref_customer, t.ref_supplier'),
|
FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "contrat as t, " . $this->db->prefix() . "contratdet as td WHERE t.fk_soc = s.rowid AND td.fk_contrat = t.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('contract') . ') GROUP BY s.rowid, s.nom, s.client, t.rowid, t.ref, t.ref_customer, t.ref_supplier'
|
||||||
|
),
|
||||||
'fichinter' => array(
|
'fichinter' => array(
|
||||||
'enabled' => isModEnabled('ficheinter'),
|
'enabled' => isModEnabled('ficheinter'),
|
||||||
'perms' => 1,
|
'perms' => 1,
|
||||||
@ -9143,6 +9189,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return list of export templates
|
* Return list of export templates
|
||||||
*
|
*
|
||||||
@ -9643,6 +9690,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return select list of groups
|
* Return select list of groups
|
||||||
*
|
*
|
||||||
@ -10032,7 +10080,7 @@ class Form
|
|||||||
* @param string $projectsListId ''=Automatic filter on project allowed. List of id=Filter on project ids.
|
* @param string $projectsListId ''=Automatic filter on project allowed. List of id=Filter on project ids.
|
||||||
* @param string $showproject 'all' = Show project info, ''=Hide project info
|
* @param string $showproject 'all' = Show project info, ''=Hide project info
|
||||||
* @param User $usertofilter User object to use for filtering
|
* @param User $usertofilter User object to use for filtering
|
||||||
* @return int Nbr of project if OK, <0 if KO
|
* @return string HTML Select Invoice
|
||||||
*/
|
*/
|
||||||
public function selectInvoice($socid = -1, $selected = '', $htmlname = 'invoiceid', $maxlength = 24, $option_only = 0, $show_empty = '1', $discard_closed = 0, $forcefocus = 0, $disabled = 0, $morecss = 'maxwidth500', $projectsListId = '', $showproject = 'all', $usertofilter = null)
|
public function selectInvoice($socid = -1, $selected = '', $htmlname = 'invoiceid', $maxlength = 24, $option_only = 0, $show_empty = '1', $discard_closed = 0, $forcefocus = 0, $disabled = 0, $morecss = 'maxwidth500', $projectsListId = '', $showproject = 'all', $usertofilter = null)
|
||||||
{
|
{
|
||||||
@ -10159,13 +10207,12 @@ class Form
|
|||||||
$out .= '</select>';
|
$out .= '</select>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print $out;
|
return $out;
|
||||||
|
|
||||||
$this->db->free($resql);
|
$this->db->free($resql);
|
||||||
return $num;
|
|
||||||
} else {
|
} else {
|
||||||
dol_print_error($this->db);
|
dol_print_error($this->db);
|
||||||
return -1;
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -56,6 +56,7 @@ class FormProjets
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Output a combo list with projects qualified for a third party / user
|
* Output a combo list with projects qualified for a third party / user
|
||||||
*
|
*
|
||||||
@ -124,6 +125,7 @@ class FormProjets
|
|||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an array with projects qualified for a third party
|
* Returns an array with projects qualified for a third party
|
||||||
*
|
*
|
||||||
@ -508,6 +510,7 @@ class FormProjets
|
|||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build a HTML select list of element of same thirdparty to suggest to link them to project
|
* Build a HTML select list of element of same thirdparty to suggest to link them to project
|
||||||
*
|
*
|
||||||
@ -748,4 +751,130 @@ class FormProjets
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Output a combo list with invoices and lines qualified for a project
|
||||||
|
*
|
||||||
|
* @param int $selectedInvoiceId Id invoice preselected
|
||||||
|
* @param int $selectedLineId Id invoice line preselected
|
||||||
|
* @param string $htmlNameInvoice Name of HTML select for Invoice
|
||||||
|
* @param int $htmlNameInvoiceLine Name of HTML select for Invoice Line
|
||||||
|
* @param string $morecss More css added to the select component
|
||||||
|
* @param array $filters Array of filters
|
||||||
|
* @param int $lineOnly return only option for line
|
||||||
|
* @return string HTML Select
|
||||||
|
*/
|
||||||
|
public function selectInvoiceAndLine($selectedInvoiceId = 0, $selectedLineId = 0, $htmlNameInvoice = 'invoiceid', $htmlNameInvoiceLine = 'invoicelineid', $morecss = 'maxwidth500', $filters = array(), $lineOnly = 0)
|
||||||
|
{
|
||||||
|
global $user, $conf, $langs;
|
||||||
|
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
|
||||||
|
|
||||||
|
$out = '';
|
||||||
|
if (empty($lineOnly)) {
|
||||||
|
// Search Invoice
|
||||||
|
$sql = "SELECT f.rowid, f.ref as fref,";
|
||||||
|
$sql .= ' s.nom as name';
|
||||||
|
$sql .= ' FROM ' . $this->db->prefix() . 'projet as p';
|
||||||
|
$sql .= ' INNER JOIN ' . $this->db->prefix() . 'societe as s ON s.rowid = p.fk_soc';
|
||||||
|
$sql .= ' INNER JOIN ' . $this->db->prefix() . 'facture as f ON f.fk_projet = p.rowid';
|
||||||
|
$sql .= " WHERE p.entity IN (" . getEntity('project') . ")";
|
||||||
|
if (!empty($filters)) {
|
||||||
|
foreach ($filters as $key => $value) {
|
||||||
|
if ($key == 'p.rowid') {
|
||||||
|
$sql .= " AND p.rowid=" . (int) $value;
|
||||||
|
}
|
||||||
|
if ($key == 'f.rowid') {
|
||||||
|
$sql .= " AND f.rowid=" . (int) $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$sql .= " ORDER BY p.ref, f.ref ASC";
|
||||||
|
|
||||||
|
$resql = $this->db->query($sql);
|
||||||
|
if ($resql) {
|
||||||
|
// Use select2 selector
|
||||||
|
if (!empty($conf->use_javascript_ajax)) {
|
||||||
|
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
|
||||||
|
$comboenhancement = ajax_combobox($htmlNameInvoice, array(array('method'=>'getLines', 'url'=>dol_buildpath('/core/ajax/ajaxinvoiceline.php', 1), 'htmlname'=>$htmlNameInvoiceLine)), 0, 0);
|
||||||
|
$out .= $comboenhancement;
|
||||||
|
$morecss = 'minwidth200imp maxwidth500';
|
||||||
|
}
|
||||||
|
|
||||||
|
$out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlNameInvoice . '" name="' . $htmlNameInvoice . '">';
|
||||||
|
$num = $this->db->num_rows($resql);
|
||||||
|
if ($num) {
|
||||||
|
while ($obj = $this->db->fetch_object($resql)) {
|
||||||
|
$labeltoshow = $obj->fref; // Invoice ref
|
||||||
|
if ($obj->name) {
|
||||||
|
$labeltoshow .= ' - ' . $obj->name;
|
||||||
|
}
|
||||||
|
|
||||||
|
$out .= '<option value="' . $obj->rowid . '" ';
|
||||||
|
if (!empty($selectedInvoiceId) && $selectedInvoiceId == $obj->rowid) {
|
||||||
|
$out .= ' selected ';
|
||||||
|
}
|
||||||
|
$out .= '>' . $labeltoshow . '</option>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$out .= '</select>';
|
||||||
|
} else {
|
||||||
|
dol_print_error($this->db->lasterror);
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Search Invoice Line
|
||||||
|
$sql = "SELECT fd.rowid, fd.label, fd.description";
|
||||||
|
$sql .= ' FROM ' . $this->db->prefix() . 'projet as p';
|
||||||
|
$sql .= ' INNER JOIN ' . $this->db->prefix() . 'societe as s ON s.rowid = p.fk_soc';
|
||||||
|
$sql .= ' INNER JOIN ' . $this->db->prefix() . 'facture as f ON f.fk_projet = p.rowid';
|
||||||
|
$sql .= ' INNER JOIN ' . $this->db->prefix() . 'facturedet as fd ON fd.fk_facture = f.rowid';
|
||||||
|
$sql .= " WHERE p.entity IN (" . getEntity('project') . ")";
|
||||||
|
if (!empty($filters)) {
|
||||||
|
foreach ($filters as $key => $value) {
|
||||||
|
if ($key == 'p.rowid') {
|
||||||
|
$sql .= " AND p.rowid=" . (int) $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!empty($selectedInvoiceId)) {
|
||||||
|
$sql .= " AND f.rowid=" . (int) $selectedInvoiceId;
|
||||||
|
}
|
||||||
|
$sql .= " ORDER BY p.ref, f.ref ASC";
|
||||||
|
$resql = $this->db->query($sql);
|
||||||
|
if ($resql) {
|
||||||
|
// Use select2 selector
|
||||||
|
if (empty($lineOnly)) {
|
||||||
|
if (!empty($conf->use_javascript_ajax)) {
|
||||||
|
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
|
||||||
|
$comboenhancement = ajax_combobox($htmlNameInvoiceLine, '', 0, 0);
|
||||||
|
$out .= $comboenhancement;
|
||||||
|
$morecss = 'minwidth200imp maxwidth500';
|
||||||
|
}
|
||||||
|
|
||||||
|
$out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlNameInvoiceLine . '" name="' . $htmlNameInvoiceLine . '">';
|
||||||
|
}
|
||||||
|
$num = $this->db->num_rows($resql);
|
||||||
|
if ($num) {
|
||||||
|
while ($obj = $this->db->fetch_object($resql)) {
|
||||||
|
$labeltoshow .= $obj->description; // Invoice ref
|
||||||
|
|
||||||
|
$out .= '<option value="' . $obj->rowid . '" ';
|
||||||
|
if (!empty($selectedLineId) && $selectedLineId == $obj->rowid) {
|
||||||
|
$out .= ' selected ';
|
||||||
|
}
|
||||||
|
$out .= '>' . $labeltoshow . '</option>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (empty($lineOnly)) {
|
||||||
|
$out .= '</select>';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
dol_print_error($this->db->lasterror);
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
return $out;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -128,6 +128,8 @@ class Task extends CommonObjectLine
|
|||||||
public $timespent_thm;
|
public $timespent_thm;
|
||||||
public $timespent_note;
|
public $timespent_note;
|
||||||
public $timespent_fk_product;
|
public $timespent_fk_product;
|
||||||
|
public $timespent_invoiceid;
|
||||||
|
public $timespent_invoicelineid;
|
||||||
|
|
||||||
public $comments = array();
|
public $comments = array();
|
||||||
|
|
||||||
@ -1736,6 +1738,8 @@ class Task extends CommonObjectLine
|
|||||||
$sql .= " task_duration = ".((int) $this->timespent_duration).",";
|
$sql .= " task_duration = ".((int) $this->timespent_duration).",";
|
||||||
$sql .= " fk_user = ".((int) $this->timespent_fk_user).",";
|
$sql .= " fk_user = ".((int) $this->timespent_fk_user).",";
|
||||||
$sql .= " fk_product = ".((int) $this->timespent_fk_product).",";
|
$sql .= " fk_product = ".((int) $this->timespent_fk_product).",";
|
||||||
|
$sql .= " invoice_id = ".((int) $this->timespent_invoiceid).",";
|
||||||
|
$sql .= " invoice_line_id = ".((int) $this->timespent_invoicelineid).",";
|
||||||
$sql .= " note = ".(isset($this->timespent_note) ? "'".$this->db->escape($this->timespent_note)."'" : "null");
|
$sql .= " note = ".(isset($this->timespent_note) ? "'".$this->db->escape($this->timespent_note)."'" : "null");
|
||||||
$sql .= " WHERE rowid = ".((int) $this->timespent_id);
|
$sql .= " WHERE rowid = ".((int) $this->timespent_id);
|
||||||
|
|
||||||
|
|||||||
@ -309,6 +309,8 @@ if (($action == 'updateline' || $action == 'updatesplitline') && !$cancel && $us
|
|||||||
}
|
}
|
||||||
$object->timespent_fk_user = GETPOST("userid_line", 'int');
|
$object->timespent_fk_user = GETPOST("userid_line", 'int');
|
||||||
$object->timespent_fk_product = GETPOST("fk_product", 'int');
|
$object->timespent_fk_product = GETPOST("fk_product", 'int');
|
||||||
|
$object->timespent_invoiceid = GETPOST("invoiceid", 'int');
|
||||||
|
$object->timespent_invoicelineid = GETPOST("invoicelineid", 'int');
|
||||||
|
|
||||||
$result = 0;
|
$result = 0;
|
||||||
if (in_array($object->timespent_fk_user, $childids) || $user->rights->projet->all->creer) {
|
if (in_array($object->timespent_fk_user, $childids) || $user->rights->projet->all->creer) {
|
||||||
@ -336,8 +338,10 @@ if (($action == 'updateline' || $action == 'updatesplitline') && !$cancel && $us
|
|||||||
}
|
}
|
||||||
$object->timespent_fk_user = GETPOST("userid_line", 'int');
|
$object->timespent_fk_user = GETPOST("userid_line", 'int');
|
||||||
$object->timespent_fk_product = GETPOST("fk_product", 'int');
|
$object->timespent_fk_product = GETPOST("fk_product", 'int');
|
||||||
|
$object->timespent_invoiceid = GETPOST("invoiceid", 'int');
|
||||||
|
$object->timespent_invoicelineid = GETPOST("invoicelineid", 'int');
|
||||||
$result = 0;
|
$result = 0;
|
||||||
|
|
||||||
if (in_array($object->timespent_fk_user, $childids) || $user->rights->projet->all->creer) {
|
if (in_array($object->timespent_fk_user, $childids) || $user->rights->projet->all->creer) {
|
||||||
$result = $object->updateTimeSpent($user);
|
$result = $object->updateTimeSpent($user);
|
||||||
|
|
||||||
@ -1468,7 +1472,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
|||||||
print $langs->trans('InvoiceToUse');
|
print $langs->trans('InvoiceToUse');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$form->selectInvoice($projectstatic->thirdparty->id, '', 'invoiceid', 24, 0, $langs->trans('NewInvoice'), 1, 0, 0, 'maxwidth500', '', 'all');
|
print $form->selectInvoice($projectstatic->thirdparty->id, '', 'invoiceid', 24, 0, $langs->trans('NewInvoice'), 1, 0, 0, 'maxwidth500', '', 'all');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
/*print '<tr>';
|
/*print '<tr>';
|
||||||
@ -1553,6 +1557,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
|||||||
$sql .= " u.lastname, u.firstname, u.login, u.photo, u.statut as user_status,";
|
$sql .= " u.lastname, u.firstname, u.login, u.photo, u.statut as user_status,";
|
||||||
$sql .= " il.fk_facture as invoice_id, inv.fk_statut,";
|
$sql .= " il.fk_facture as invoice_id, inv.fk_statut,";
|
||||||
$sql .= " p.fk_soc,s.name_alias,";
|
$sql .= " p.fk_soc,s.name_alias,";
|
||||||
|
$sql .= " t.invoice_line_id";
|
||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
@ -2344,7 +2349,19 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
|||||||
if ($task_time->invoice_id) {
|
if ($task_time->invoice_id) {
|
||||||
$result = $tmpinvoice->fetch($task_time->invoice_id);
|
$result = $tmpinvoice->fetch($task_time->invoice_id);
|
||||||
if ($result > 0) {
|
if ($result > 0) {
|
||||||
|
if ($action=='editline' && $_GET['lineid'] == $task_time->rowid) {
|
||||||
|
print $formproject->selectInvoiceAndLine($task_time->invoice_id, $task_time->invoice_line_id, 'invoiceid', 'invoicelineid', 'maxwidth500', array('p.rowid'=>$projectstatic->id));
|
||||||
|
} else {
|
||||||
print $tmpinvoice->getNomUrl(1);
|
print $tmpinvoice->getNomUrl(1);
|
||||||
|
if (!empty($task_time->invoice_line_id)) {
|
||||||
|
$invoiceLine = new FactureLigne($db);
|
||||||
|
$invoiceLine->fetch($task_time->invoice_line_id);
|
||||||
|
if (!empty($invoiceLine->id)) {
|
||||||
|
print '<br>'.$langs->trans('Qty').':'.$invoiceLine->qty;
|
||||||
|
print ' '.$langs->trans('TotalHT').':'.price($invoiceLine->total_ht);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
print $langs->trans("No");
|
print $langs->trans("No");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user