Merge branch 'develop' of github.com:Dolibarr/dolibarr into NEW/integration_GPEC_code
This commit is contained in:
commit
231f809106
28
ChangeLog
28
ChangeLog
@ -2,6 +2,21 @@
|
||||
English Dolibarr ChangeLog
|
||||
--------------------------------------------------------------
|
||||
|
||||
|
||||
***** ChangeLog for 15.0.0 compared to 14.0.0 *****
|
||||
|
||||
For developers:
|
||||
---------------
|
||||
|
||||
WARNING:
|
||||
|
||||
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
|
||||
* Update hook 'printOriginObjectLine', removed check on product type and special code. Need now reshook.
|
||||
* Old deprecated module "SimplePOS" has been completely removed. Use module "TakePOS" is you need a Point Of Sale.
|
||||
* The method static ActionComm::getActions($db, ...) is no more static. Use $actioncomm->getActions(...) instead (without $db param).
|
||||
|
||||
|
||||
|
||||
***** ChangeLog for 14.0.2 compared to 14.0.1 *****
|
||||
|
||||
FIX: #18353 Invoice list translation issue
|
||||
@ -86,19 +101,6 @@ FIX: using Tulip, deposit mask was not saved
|
||||
FIX: #yogosha6907
|
||||
|
||||
|
||||
***** ChangeLog for 15.0.0 compared to 14.0.0 *****
|
||||
|
||||
For developers:
|
||||
---------------
|
||||
|
||||
WARNING:
|
||||
|
||||
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
|
||||
* Update hook 'printOriginObjectLine', removed check on product type and special code. Need now reshook.
|
||||
* Old deprecated module "SimplePOS" has been completely removed. Use module "TakePOS" is you need a Point Of Sale.
|
||||
|
||||
|
||||
|
||||
***** ChangeLog for 14.0.0 compared to 13.0.0 *****
|
||||
|
||||
For users:
|
||||
|
||||
11
README.md
11
README.md
@ -154,18 +154,18 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
|
||||
|
||||
### Other application/modules
|
||||
|
||||
- Electronic Document Management (EDM)
|
||||
- Electronic Document Management (EDM)
|
||||
- Bookmarks management
|
||||
- Reporting
|
||||
- Data export/import
|
||||
- Barcodes
|
||||
- Barcodes
|
||||
- Margin calculations
|
||||
- LDAP connectivity
|
||||
- ClickToDial integration
|
||||
- Mass emailing
|
||||
- RSS integration
|
||||
- Skype integration
|
||||
- Social platforms linking
|
||||
- Social platforms linking
|
||||
- Payment platforms integration (PayPal, Stripe, Paybox...)
|
||||
- Email-Collector
|
||||
|
||||
@ -179,14 +179,11 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
|
||||
- Multi-Users and groups with finely grained rights
|
||||
- Multi-Currency
|
||||
- Multi-Company (by adding of an external module)
|
||||
|
||||
- Very user friendly and easy to use
|
||||
- customizable Dashboard
|
||||
- Highly customizable: enable only the modules you need, add user personalized fields, choose your skin, several menu managers (can be used by internal users as a back-office with a particular menu, or by external users as a front-office with another one)
|
||||
|
||||
- APIs (REST, SOAP)
|
||||
- Code that is easy to understand, maintain and develop (PHP with no heavy framework; trigger and hook architecture)
|
||||
|
||||
- Support a lot of country specific features:
|
||||
- Spanish Tax RE and ISPF
|
||||
- French NPR VAT rate (VAT called "Non Perçue Récupérable" for DOM-TOM)
|
||||
@ -197,7 +194,7 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
|
||||
- Compatible with European GDPR rules
|
||||
- ...
|
||||
- Flexible PDF & ODT generation for invoices, proposals, orders...
|
||||
- …
|
||||
- ...
|
||||
|
||||
|
||||
### System Environment / Requirements
|
||||
|
||||
@ -54,12 +54,12 @@ ONLY vulnerabilities discovered, when the following setup on test platform is us
|
||||
* $dolibarr_main_prod must be set to 1 into conf.php
|
||||
* $dolibarr_nocsrfcheck must be kept to the value 0 into conf.php (this is the default value)
|
||||
* $dolibarr_main_force_https must be set to something else than 0.
|
||||
* The constant MAIN_SECURITY_CSRF_WITH_TOKEN must be set to 2 into backoffice menu Home - Setup - Other (this protection should be set to 2 soon by default)
|
||||
* The constant MAIN_SECURITY_CSRF_WITH_TOKEN must be set to 3 into backoffice menu Home - Setup - Other (this protection should be set to 3 soon by default)
|
||||
* The module DebugBar and ModuleBuilder must NOT be enabled (by default, these modules are not enabled. They are developer tools)
|
||||
* ONLY security reports on modules provided by default and with the "stable" status are valid (troubles into "experimental", "developement" or external modules are not valid vulnerabilities).
|
||||
* The root of web server must link to htdocs and the documents directory must be outside of the web server root (this is the default when using the default installer but may differs with external installer).
|
||||
* The web server setup must be done so only the documents directory is in write mode. The root directory called htdocs must be readonly.
|
||||
* CSRF attacks are accepted when using a POST URL, but when using GET URL, they are validated only for creating, updating or deleting data resctricted from pages restricted to admin users.
|
||||
* CSRF attacks are accepted but double check that you have set MAIN_SECURITY_CSRF_WITH_TOKEN to value 3.
|
||||
* Ability for a high level user to edit web site pages into the CMS by including HTML or Javascript is an expected feature. Vulnerabilities into the website module are validated only if HTML or Javascript injection can be done by a non allowed user.
|
||||
|
||||
Scope is the web application (back office) and the APIs.
|
||||
|
||||
@ -171,7 +171,10 @@ if [ $res -ne 0 ]; then
|
||||
fi
|
||||
|
||||
if [ -s "$mydir/initdemopostsql.sql" ]; then
|
||||
echo A file initdemopostsql.sql was found, we execute it.
|
||||
mysql -P$port $base < "$mydir/initdemopostsql.sql"
|
||||
else
|
||||
echo No file initdemopostsql.sql found, we extra sql action done.
|
||||
fi
|
||||
|
||||
|
||||
|
||||
@ -2056,7 +2056,7 @@ CREATE TABLE `llx_c_holiday_types` (
|
||||
`label` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
|
||||
`affect` int(11) NOT NULL,
|
||||
`delay` int(11) NOT NULL,
|
||||
`newByMonth` double(8,5) NOT NULL DEFAULT 0.00000,
|
||||
`newbymonth` double(8,5) NOT NULL DEFAULT 0.00000,
|
||||
`fk_country` int(11) DEFAULT NULL,
|
||||
`active` int(11) DEFAULT 1,
|
||||
PRIMARY KEY (`rowid`),
|
||||
|
||||
@ -195,7 +195,7 @@ if (empty($reshook)) {
|
||||
} elseif ($action == 'enable' && $permissiontoadd) {
|
||||
if ($accounting->fetch($id)) {
|
||||
$mode = GETPOST('mode', 'int');
|
||||
$result = $accounting->account_activate($id, $mode);
|
||||
$result = $accounting->accountActivate($id, $mode);
|
||||
}
|
||||
$action = 'update';
|
||||
if ($result < 0) {
|
||||
|
||||
@ -75,7 +75,7 @@ if ($action == 'add' && $user->rights->accounting->chartofaccount) {
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors');
|
||||
$action = 'create';
|
||||
} else {
|
||||
$sql = 'SELECT pcg_version FROM ' . MAIN_DB_PREFIX . 'accounting_system WHERE rowid='.((int) $conf->global->CHARTOFACCOUNTS);
|
||||
$sql = "SELECT pcg_version FROM " . MAIN_DB_PREFIX . "accounting_system WHERE rowid = ".((int) $conf->global->CHARTOFACCOUNTS);
|
||||
|
||||
dol_syslog('accountancy/admin/card.php:: $sql=' . $sql);
|
||||
$result = $db->query($sql);
|
||||
@ -138,7 +138,7 @@ if ($action == 'add' && $user->rights->accounting->chartofaccount) {
|
||||
} else {
|
||||
$result = $object->fetch($id);
|
||||
|
||||
$sql = 'SELECT pcg_version FROM '.MAIN_DB_PREFIX.'accounting_system WHERE rowid='.((int) $conf->global->CHARTOFACCOUNTS);
|
||||
$sql = "SELECT pcg_version FROM ".MAIN_DB_PREFIX."accounting_system WHERE rowid=".((int) $conf->global->CHARTOFACCOUNTS);
|
||||
|
||||
dol_syslog('accountancy/admin/card.php:: $sql=' . $sql);
|
||||
$result2 = $db->query($sql);
|
||||
@ -260,7 +260,7 @@ if ($action == 'create') {
|
||||
print '<input type="text" name="pcg_type" list="pcg_type_datalist" value="'.dol_escape_htmltag(GETPOSTISSET('pcg_type') ? GETPOST('pcg_type', 'alpha') : $object->pcg_type).'">';
|
||||
// autosuggest from existing account types if found
|
||||
print '<datalist id="pcg_type_datalist">';
|
||||
$sql = 'SELECT DISTINCT pcg_type FROM ' . MAIN_DB_PREFIX . 'accounting_account';
|
||||
$sql = "SELECT DISTINCT pcg_type FROM " . MAIN_DB_PREFIX . "accounting_account";
|
||||
$sql .= " WHERE fk_pcg_version = '" . $db->escape($accountsystem->ref) . "'";
|
||||
$sql .= ' AND entity in ('.getEntity('accounting_account', 0).')'; // Always limit to current entity. No sharing in accountancy.
|
||||
$sql .= ' LIMIT 50000'; // just as a sanity check
|
||||
|
||||
@ -811,7 +811,7 @@ if ($resql) {
|
||||
|
||||
// Modify link
|
||||
if ($canbemodified) {
|
||||
print '<td class="center"><a class="reposition editfielda" href="'.$url.'action=edit">'.img_edit().'</a></td>';
|
||||
print '<td class="center"><a class="reposition editfielda" href="'.$url.'action=edit&token='.newToken().'">'.img_edit().'</a></td>';
|
||||
} else {
|
||||
print '<td> </td>';
|
||||
}
|
||||
|
||||
@ -186,12 +186,28 @@ if ($action == 'update') {
|
||||
$msg .= '<div><span style="color:red">'.$langs->trans("ErrorDB").' : '.$langs->trans("Product").' '.$productid.' '.$langs->trans("NotVentilatedinAccount").' : id='.$accounting_account_id.'<br> <pre>'.$sql.'</pre></span></div>';
|
||||
$ko++;
|
||||
} else {
|
||||
$db->begin();
|
||||
|
||||
$sql = '';
|
||||
if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."product_perentity (fk_product, entity, '".$db->escape($accountancy_field_name)."')";
|
||||
$sql .= " VALUES (".((int) $productid).", ".((int) $conf->entity).", '".$db->escape($accounting->account_number)."')";
|
||||
$sql .= " ON DUPLICATE KEY UPDATE ".$accountancy_field_name." = '".$db->escape($accounting->account_number)."'";
|
||||
$sql_exists = "SELECT rowid FROM " . MAIN_DB_PREFIX . "product_perentity";
|
||||
$sql_exists .= " WHERE fk_product = " . ((int) $productid) . " AND entity = " . ((int) $conf->entity);
|
||||
$resql_exists = $db->query($sql_exists);
|
||||
if (!$resql_exists) {
|
||||
$msg .= '<div><span style="color:red">'.$langs->trans("ErrorDB").' : '.$langs->trans("Product").' '.$productid.' '.$langs->trans("NotVentilatedinAccount").' : id='.$accounting_account_id.'<br> <pre>'.$resql_exists.'</pre></span></div>';
|
||||
$ko++;
|
||||
} else {
|
||||
$nb_exists = $db->num_rows($resql_exists);
|
||||
if ($nb_exists <= 0) {
|
||||
// insert
|
||||
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "product_perentity (fk_product, entity, '" . $db->escape($accountancy_field_name) . "')";
|
||||
$sql .= " VALUES (" . ((int) $productid) . ", " . ((int) $conf->entity) . ", '" . $db->escape($accounting->account_number) . "')";
|
||||
} else {
|
||||
$obj_exists = $db->fetch_object($resql_exists);
|
||||
// update
|
||||
$sql = "UPDATE " . MAIN_DB_PREFIX . "product_perentity";
|
||||
$sql .= " SET " . $accountancy_field_name . " = '" . $db->escape($accounting->account_number) . "'";
|
||||
$sql .= " WHERE rowid = " . ((int) $obj_exists->rowid);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$sql = " UPDATE ".MAIN_DB_PREFIX."product";
|
||||
$sql .= " SET ".$accountancy_field_name." = '".$db->escape($accounting->account_number)."'";
|
||||
@ -199,6 +215,9 @@ if ($action == 'update') {
|
||||
}
|
||||
|
||||
dol_syslog("/accountancy/admin/productaccount.php", LOG_DEBUG);
|
||||
|
||||
$db->begin();
|
||||
|
||||
if ($db->query($sql)) {
|
||||
$ok++;
|
||||
$db->commit();
|
||||
|
||||
@ -439,13 +439,13 @@ if ($resql) {
|
||||
$e = '';
|
||||
// Customer
|
||||
if ($obj->type == 1) {
|
||||
$e .= '<a class="editfielda" title="'.$langs->trans("Customer").'" href="'.DOL_URL_ROOT.'/societe/card.php?action=edit&socid='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"]).'">'.img_edit().'</a>';
|
||||
$e .= '<a class="editfielda" title="'.$langs->trans("Customer").'" href="'.DOL_URL_ROOT.'/societe/card.php?action=edit&token='.newToken().'&socid='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"]).'">'.img_edit().'</a>';
|
||||
} elseif ($obj->type == 2) {
|
||||
// Supplier
|
||||
$e .= '<a class="editfielda" title="'.$langs->trans("Supplier").'" href="'.DOL_URL_ROOT.'/societe/card.php?action=edit&socid='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"]).'">'.img_edit().'</a>';
|
||||
$e .= '<a class="editfielda" title="'.$langs->trans("Supplier").'" href="'.DOL_URL_ROOT.'/societe/card.php?action=edit&token='.newToken().'&socid='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"]).'">'.img_edit().'</a>';
|
||||
} elseif ($obj->type == 3) {
|
||||
// User
|
||||
$e .= '<a class="editfielda" title="'.$langs->trans("Employee").'" href="'.DOL_URL_ROOT.'/user/card.php?action=edit&id='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"]).'">'.img_edit().'</a>';
|
||||
$e .= '<a class="editfielda" title="'.$langs->trans("Employee").'" href="'.DOL_URL_ROOT.'/user/card.php?action=edit&token='.newToken().'&id='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"]).'">'.img_edit().'</a>';
|
||||
}
|
||||
print $e;
|
||||
print '</td>'."\n";
|
||||
|
||||
@ -433,7 +433,7 @@ if ($action == 'create') {
|
||||
print $langs->trans('Docdate');
|
||||
print '</td>';
|
||||
if ($action != 'editdate') {
|
||||
print '<td class="right"><a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=editdate&piece_num='.$object->piece_num.'&mode='.$mode.'">'.img_edit($langs->transnoentitiesnoconv('SetDate'), 1).'</a></td>';
|
||||
print '<td class="right"><a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=editdate&token='.newToken().'&piece_num='.urlencode($object->piece_num).'&mode='.urlencode($mode).'">'.img_edit($langs->transnoentitiesnoconv('SetDate'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="3">';
|
||||
@ -460,7 +460,7 @@ if ($action == 'create') {
|
||||
print $langs->trans('Codejournal');
|
||||
print '</td>';
|
||||
if ($action != 'editjournal') {
|
||||
print '<td class="right"><a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=editjournal&piece_num='.$object->piece_num.'&mode='.$mode.'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).'</a></td>';
|
||||
print '<td class="right"><a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=editjournal&token='.newToken().'&piece_num='.urlencode($object->piece_num).'&mode='.urlencode($mode).'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
@ -487,7 +487,7 @@ if ($action == 'create') {
|
||||
print $langs->trans('Piece');
|
||||
print '</td>';
|
||||
if ($action != 'editdocref') {
|
||||
print '<td class="right"><a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=editdocref&piece_num='.$object->piece_num.'&mode='.$mode.'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).'</a></td>';
|
||||
print '<td class="right"><a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=editdocref&token='.newToken().'&piece_num='.urlencode($object->piece_num).'&mode='.urlencode($mode).'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
|
||||
@ -591,7 +591,7 @@ if ($action == 'export_fileconfirm' && $user->rights->accounting->mouvements->ex
|
||||
|
||||
if (!empty($accountancyexport->errors)) {
|
||||
setEventMessages('', $accountancyexport->errors, 'errors');
|
||||
} elseif (!$notifiedexportdate || !$notifiedvalidationdate) {
|
||||
} elseif (!empty($notifiedexportdate) || !empty($notifiedvalidationdate)) {
|
||||
// Specify as export : update field date_export or date_validated
|
||||
$error = 0;
|
||||
$db->begin();
|
||||
@ -602,17 +602,18 @@ if ($action == 'export_fileconfirm' && $user->rights->accounting->mouvements->ex
|
||||
|
||||
$sql = " UPDATE ".MAIN_DB_PREFIX."accounting_bookkeeping";
|
||||
$sql .= " SET";
|
||||
if (!$notifiedexportdate && !$notifiedvalidationdate) {
|
||||
if (!empty($notifiedexportdate) && !empty($notifiedvalidationdate)) {
|
||||
$sql .= " date_export = '".$db->idate($now)."'";
|
||||
$sql .= ", date_validated = '".$db->idate($now)."'";
|
||||
} elseif (!$notifiedexportdate) {
|
||||
} elseif (!empty($notifiedexportdate)) {
|
||||
$sql .= " date_export = '".$db->idate($now)."'";
|
||||
} elseif (!$notifiedvalidationdate) {
|
||||
} elseif (!empty($notifiedvalidationdate)) {
|
||||
$sql .= " date_validated = '".$db->idate($now)."'";
|
||||
}
|
||||
$sql .= " WHERE rowid = ".((int) $movement->id);
|
||||
|
||||
dol_syslog("/accountancy/bookeeping/list.php Function export_file Specify movements as exported", LOG_DEBUG);
|
||||
dol_syslog("/accountancy/bookkeeping/list.php Function export_file Specify movements as exported", LOG_DEBUG);
|
||||
|
||||
$result = $db->query($sql);
|
||||
if (!$result) {
|
||||
$error++;
|
||||
|
||||
@ -26,6 +26,9 @@
|
||||
* \brief File of class to manage accounting accounts
|
||||
*/
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
/**
|
||||
* Class to manage accounting accounts
|
||||
*/
|
||||
@ -140,6 +143,11 @@ class AccountingAccount extends CommonObject
|
||||
*/
|
||||
public $reconcilable;
|
||||
|
||||
/**
|
||||
* @var array cache array
|
||||
*/
|
||||
private $accountingaccount_codetotid_cache = array();
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
@ -225,8 +233,8 @@ class AccountingAccount extends CommonObject
|
||||
/**
|
||||
* Insert new accounting account in chart of accounts
|
||||
*
|
||||
* @param User $user User making action
|
||||
* @param int $notrigger Disable triggers
|
||||
* @param User $user User making action
|
||||
* @param int $notrigger Disable triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function create($user, $notrigger = 0)
|
||||
@ -259,7 +267,7 @@ class AccountingAccount extends CommonObject
|
||||
// Put here code to add control on parameters values
|
||||
|
||||
// Insert request
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."accounting_account(";
|
||||
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "accounting_account(";
|
||||
$sql .= "datec";
|
||||
$sql .= ", entity";
|
||||
$sql .= ", fk_pcg_version";
|
||||
@ -293,11 +301,11 @@ class AccountingAccount extends CommonObject
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++;
|
||||
$this->errors[] = "Error ".$this->db->lasterror();
|
||||
$this->errors[] = "Error " . $this->db->lasterror();
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."accounting_account");
|
||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . "accounting_account");
|
||||
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action to call a trigger.
|
||||
@ -313,8 +321,8 @@ class AccountingAccount extends CommonObject
|
||||
// Commit or rollback
|
||||
if ($error) {
|
||||
foreach ($this->errors as $errmsg) {
|
||||
dol_syslog(get_class($this)."::create ".$errmsg, LOG_ERR);
|
||||
$this->error .= ($this->error ? ', '.$errmsg : $errmsg);
|
||||
dol_syslog(get_class($this) . "::create " . $errmsg, LOG_ERR);
|
||||
$this->error .= ($this->error ? ', ' . $errmsg : $errmsg);
|
||||
}
|
||||
$this->db->rollback();
|
||||
return -1 * $error;
|
||||
@ -327,7 +335,7 @@ class AccountingAccount extends CommonObject
|
||||
/**
|
||||
* Update record
|
||||
*
|
||||
* @param User $user Use making update
|
||||
* @param User $user Use making update
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function update($user)
|
||||
@ -339,18 +347,18 @@ class AccountingAccount extends CommonObject
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."accounting_account ";
|
||||
$sql .= " SET fk_pcg_version = ".($this->fk_pcg_version ? "'".$this->db->escape($this->fk_pcg_version)."'" : "null");
|
||||
$sql .= " , pcg_type = ".($this->pcg_type ? "'".$this->db->escape($this->pcg_type)."'" : "null");
|
||||
$sql .= " , account_number = '".$this->db->escape($this->account_number)."'";
|
||||
$sql .= " , account_parent = ".(int) $this->account_parent;
|
||||
$sql .= " , label = ".($this->label ? "'".$this->db->escape($this->label)."'" : "''");
|
||||
$sql .= " , labelshort = ".($this->labelshort ? "'".$this->db->escape($this->labelshort)."'" : "''");
|
||||
$sql .= " , fk_accounting_category = ".(empty($this->account_category) ? 0 : (int) $this->account_category);
|
||||
$sql .= " , fk_user_modif = ".((int) $user->id);
|
||||
$sql .= " , active = ".(int) $this->active;
|
||||
$sql .= " , reconcilable = ".(int) $this->reconcilable;
|
||||
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||
$sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_account ";
|
||||
$sql .= " SET fk_pcg_version = " . ($this->fk_pcg_version ? "'" . $this->db->escape($this->fk_pcg_version) . "'" : "null");
|
||||
$sql .= " , pcg_type = " . ($this->pcg_type ? "'" . $this->db->escape($this->pcg_type) . "'" : "null");
|
||||
$sql .= " , account_number = '" . $this->db->escape($this->account_number) . "'";
|
||||
$sql .= " , account_parent = " . (int) $this->account_parent;
|
||||
$sql .= " , label = " . ($this->label ? "'" . $this->db->escape($this->label) . "'" : "''");
|
||||
$sql .= " , labelshort = " . ($this->labelshort ? "'" . $this->db->escape($this->labelshort) . "'" : "''");
|
||||
$sql .= " , fk_accounting_category = " . (empty($this->account_category) ? 0 : (int) $this->account_category);
|
||||
$sql .= " , fk_user_modif = " . ((int) $user->id);
|
||||
$sql .= " , active = " . (int) $this->active;
|
||||
$sql .= " , reconcilable = " . (int) $this->reconcilable;
|
||||
$sql .= " WHERE rowid = " . ((int) $this->id);
|
||||
|
||||
dol_syslog(get_class($this)."::update", LOG_DEBUG);
|
||||
$result = $this->db->query($sql);
|
||||
@ -413,22 +421,22 @@ class AccountingAccount extends CommonObject
|
||||
$this->db->begin();
|
||||
|
||||
if (!$error) {
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."accounting_account";
|
||||
$sql .= " WHERE rowid=".((int) $this->id);
|
||||
$sql = "DELETE FROM " . MAIN_DB_PREFIX . "accounting_account";
|
||||
$sql .= " WHERE rowid=" . ((int) $this->id);
|
||||
|
||||
dol_syslog(get_class($this)."::delete sql=".$sql);
|
||||
dol_syslog(get_class($this) . "::delete sql=" . $sql);
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++;
|
||||
$this->errors[] = "Error ".$this->db->lasterror();
|
||||
$this->errors[] = "Error " . $this->db->lasterror();
|
||||
}
|
||||
}
|
||||
|
||||
// Commit or rollback
|
||||
if ($error) {
|
||||
foreach ($this->errors as $errmsg) {
|
||||
dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR);
|
||||
$this->error .= ($this->error ? ', '.$errmsg : $errmsg);
|
||||
dol_syslog(get_class($this) . "::delete " . $errmsg, LOG_ERR);
|
||||
$this->error .= ($this->error ? ', ' . $errmsg : $errmsg);
|
||||
}
|
||||
$this->db->rollback();
|
||||
return -1 * $error;
|
||||
@ -444,20 +452,20 @@ class AccountingAccount extends CommonObject
|
||||
/**
|
||||
* Return clicable name (with picto eventually)
|
||||
*
|
||||
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
|
||||
* @param int $withlabel 0=No label, 1=Include label of account
|
||||
* @param int $nourl 1=Disable url
|
||||
* @param string $moretitle Add more text to title tooltip
|
||||
* @param int $notooltip 1=Disable tooltip
|
||||
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
||||
* @param int $withcompletelabel 0=Short label (field short label), 1=Complete label (field label)
|
||||
* @param string $option 'ledger', 'journals', 'accountcard'
|
||||
* @return string String with URL
|
||||
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
|
||||
* @param int $withlabel 0=No label, 1=Include label of account
|
||||
* @param int $nourl 1=Disable url
|
||||
* @param string $moretitle Add more text to title tooltip
|
||||
* @param int $notooltip 1=Disable tooltip
|
||||
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
||||
* @param int $withcompletelabel 0=Short label (field short label), 1=Complete label (field label)
|
||||
* @param string $option 'ledger', 'journals', 'accountcard'
|
||||
* @return string String with URL
|
||||
*/
|
||||
public function getNomUrl($withpicto = 0, $withlabel = 0, $nourl = 0, $moretitle = '', $notooltip = 0, $save_lastsearch_value = -1, $withcompletelabel = 0, $option = '')
|
||||
{
|
||||
global $langs, $conf;
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
|
||||
if (!empty($conf->dol_no_mouse_hover)) {
|
||||
$notooltip = 1; // Force disable tooltips
|
||||
@ -465,15 +473,16 @@ class AccountingAccount extends CommonObject
|
||||
|
||||
$result = '';
|
||||
|
||||
$url = ''; $labelurl = '';
|
||||
$url = '';
|
||||
$labelurl = '';
|
||||
if (empty($option) || $option == 'ledger') {
|
||||
$url = DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?search_accountancy_code_start='.urlencode($this->account_number).'&search_accountancy_code_end='.urlencode($this->account_number);
|
||||
$url = DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?search_accountancy_code_start=' . urlencode($this->account_number) . '&search_accountancy_code_end=' . urlencode($this->account_number);
|
||||
$labelurl = $langs->trans("ShowAccountingAccountInLedger");
|
||||
} elseif ($option == 'journals') {
|
||||
$url = DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?search_accountancy_code_start='.urlencode($this->account_number).'&search_accountancy_code_end='.urlencode($this->account_number);
|
||||
$url = DOL_URL_ROOT . '/accountancy/bookkeeping/list.php?search_accountancy_code_start=' . urlencode($this->account_number) . '&search_accountancy_code_end=' . urlencode($this->account_number);
|
||||
$labelurl = $langs->trans("ShowAccountingAccountInJournals");
|
||||
} elseif ($option == 'accountcard') {
|
||||
$url = DOL_URL_ROOT.'/accountancy/admin/card.php?id='.urlencode($this->id);
|
||||
$url = DOL_URL_ROOT . '/accountancy/admin/card.php?id=' . urlencode($this->id);
|
||||
$labelurl = $langs->trans("ShowAccountingAccount");
|
||||
}
|
||||
|
||||
@ -495,29 +504,29 @@ class AccountingAccount extends CommonObject
|
||||
$labeltoshow = $this->labelshort;
|
||||
}
|
||||
|
||||
$label = '<u>'.$labelurl.'</u>';
|
||||
$label = '<u>' . $labelurl . '</u>';
|
||||
if (!empty($this->account_number)) {
|
||||
$label .= '<br><b>'.$langs->trans('AccountAccounting').':</b> '.length_accountg($this->account_number);
|
||||
$label .= '<br><b>' . $langs->trans('AccountAccounting') . ':</b> ' . length_accountg($this->account_number);
|
||||
}
|
||||
if (!empty($labeltoshow)) {
|
||||
$label .= '<br><b>'.$langs->trans('Label').':</b> '.$labeltoshow;
|
||||
$label .= '<br><b>' . $langs->trans('Label') . ':</b> ' . $labeltoshow;
|
||||
}
|
||||
if ($moretitle) {
|
||||
$label .= ' - '.$moretitle;
|
||||
$label .= ' - ' . $moretitle;
|
||||
}
|
||||
|
||||
$linkclose = '';
|
||||
if (empty($notooltip)) {
|
||||
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
||||
$label = $labelurl;
|
||||
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
|
||||
$linkclose .= ' alt="' . dol_escape_htmltag($label, 1) . '"';
|
||||
}
|
||||
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
|
||||
$linkclose .= ' title="' . dol_escape_htmltag($label, 1) . '"';
|
||||
$linkclose .= ' class="classfortooltip"';
|
||||
}
|
||||
|
||||
$linkstart = '<a href="'.$url.'"';
|
||||
$linkstart .= $linkclose.'>';
|
||||
$linkstart = '<a href="' . $url . '"';
|
||||
$linkstart .= $linkclose . '>';
|
||||
$linkend = '</a>';
|
||||
|
||||
if ($nourl) {
|
||||
@ -528,17 +537,17 @@ class AccountingAccount extends CommonObject
|
||||
|
||||
$label_link = length_accountg($this->account_number);
|
||||
if ($withlabel) {
|
||||
$label_link .= ' - '.($nourl ? '<span class="opacitymedium">' : '').$labeltoshow.($nourl ? '</span>' : '');
|
||||
$label_link .= ' - ' . ($nourl ? '<span class="opacitymedium">' : '') . $labeltoshow . ($nourl ? '</span>' : '');
|
||||
}
|
||||
|
||||
if ($withpicto) {
|
||||
$result .= ($linkstart.img_object(($notooltip ? '' : $label), $picto, ($notooltip ? '' : 'class="classfortooltip"'), 0, 0, $notooltip ? 0 : 1).$linkend);
|
||||
$result .= ($linkstart . img_object(($notooltip ? '' : $label), $picto, ($notooltip ? '' : 'class="classfortooltip"'), 0, 0, $notooltip ? 0 : 1) . $linkend);
|
||||
}
|
||||
if ($withpicto && $withpicto != 2) {
|
||||
$result .= ' ';
|
||||
}
|
||||
if ($withpicto != 2) {
|
||||
$result .= $linkstart.$label_link.$linkend;
|
||||
$result .= $linkstart . $label_link . $linkend;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
@ -552,10 +561,10 @@ class AccountingAccount extends CommonObject
|
||||
public function info($id)
|
||||
{
|
||||
$sql = 'SELECT a.rowid, a.datec, a.fk_user_author, a.fk_user_modif, a.tms';
|
||||
$sql .= ' FROM '.MAIN_DB_PREFIX.'accounting_account as a';
|
||||
$sql .= ' WHERE a.rowid = '.((int) $id);
|
||||
$sql .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as a';
|
||||
$sql .= ' WHERE a.rowid = ' . ((int) $id);
|
||||
|
||||
dol_syslog(get_class($this).'::info sql='.$sql);
|
||||
dol_syslog(get_class($this) . '::info sql=' . $sql);
|
||||
$result = $this->db->query($sql);
|
||||
|
||||
if ($result) {
|
||||
@ -584,8 +593,8 @@ class AccountingAccount extends CommonObject
|
||||
/**
|
||||
* Deactivate an account (for status active or status reconcilable)
|
||||
*
|
||||
* @param int $id Id
|
||||
* @param int $mode 0=field active, 1=field reconcilable
|
||||
* @param int $id Id
|
||||
* @param int $mode 0=field active, 1=field reconcilable
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function accountDeactivate($id, $mode = 0)
|
||||
@ -620,15 +629,15 @@ class AccountingAccount extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
|
||||
/**
|
||||
* Account activated
|
||||
*
|
||||
* @param int $id Id
|
||||
* @param int $mode 0=field active, 1=field reconcilable
|
||||
* @param int $id Id
|
||||
* @param int $mode 0=field active, 1=field reconcilable
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function account_activate($id, $mode = 0)
|
||||
public function accountActivate($id, $mode = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->db->begin();
|
||||
@ -654,12 +663,11 @@ class AccountingAccount extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Retourne le libelle du statut d'un user (actif, inactif)
|
||||
*
|
||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||
* @return string Label of status
|
||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||
* @return string Label of status
|
||||
*/
|
||||
public function getLibStatut($mode = 0)
|
||||
{
|
||||
@ -670,9 +678,9 @@ class AccountingAccount extends CommonObject
|
||||
/**
|
||||
* Renvoi le libelle d'un statut donne
|
||||
*
|
||||
* @param int $status Id status
|
||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||
* @return string Label of status
|
||||
* @param int $status Id status
|
||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||
* @return string Label of status
|
||||
*/
|
||||
public function LibStatut($status, $mode = 0)
|
||||
{
|
||||
@ -694,9 +702,9 @@ class AccountingAccount extends CommonObject
|
||||
}
|
||||
} elseif ($mode == 2) {
|
||||
if ($status == 1) {
|
||||
return img_picto($langs->trans('Enabled'), 'statut4').' '.$langs->trans('Enabled');
|
||||
return img_picto($langs->trans('Enabled'), 'statut4') . ' ' . $langs->trans('Enabled');
|
||||
} elseif ($status == 0) {
|
||||
return img_picto($langs->trans('Disabled'), 'statut5').' '.$langs->trans('Disabled');
|
||||
return img_picto($langs->trans('Disabled'), 'statut5') . ' ' . $langs->trans('Disabled');
|
||||
}
|
||||
} elseif ($mode == 3) {
|
||||
if ($status == 1) {
|
||||
@ -706,15 +714,173 @@ class AccountingAccount extends CommonObject
|
||||
}
|
||||
} elseif ($mode == 4) {
|
||||
if ($status == 1) {
|
||||
return img_picto($langs->trans('Enabled'), 'statut4').' '.$langs->trans('Enabled');
|
||||
return img_picto($langs->trans('Enabled'), 'statut4') . ' ' . $langs->trans('Enabled');
|
||||
} elseif ($status == 0) {
|
||||
return img_picto($langs->trans('Disabled'), 'statut5').' '.$langs->trans('Disabled');
|
||||
return img_picto($langs->trans('Disabled'), 'statut5') . ' ' . $langs->trans('Disabled');
|
||||
}
|
||||
} elseif ($mode == 5) {
|
||||
if ($status == 1) {
|
||||
return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'), 'statut4');
|
||||
return $langs->trans('Enabled') . ' ' . img_picto($langs->trans('Enabled'), 'statut4');
|
||||
} elseif ($status == 0) {
|
||||
return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'), 'statut5');
|
||||
return $langs->trans('Disabled') . ' ' . img_picto($langs->trans('Disabled'), 'statut5');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
|
||||
/**
|
||||
* Return Suggest accounting accounts to bind
|
||||
*
|
||||
* @param Societe $buyer Societe Object Buyers
|
||||
* @param $seller Company Object seller
|
||||
* @param Product $product Product object sell or buy
|
||||
* @param Facture $facture Facture
|
||||
* @param FactureLigne $factureDet Facture Det
|
||||
* @param array $accountingAccount array of Account account
|
||||
*
|
||||
* @return array Accounting accounts suggested
|
||||
*/
|
||||
public function getAccountingCodeToBind(Societe $buyer, $seller, Product $product, Facture $facture, FactureLigne $factureDet, $accountingAccount = array())
|
||||
{
|
||||
global $conf;
|
||||
global $hookmanager;
|
||||
|
||||
// Instantiate hooks for external modules
|
||||
$hookmanager->initHooks(array('accoutancyBindingCalculation'));
|
||||
|
||||
// Execute hook accoutancyBindingCalculation
|
||||
$parameters = array('buyer' => $buyer, 'seller' => $seller, 'product' => $product, 'facture' => $facture, 'factureDet' => $factureDet ,'accountingAccount'=>$accountingAccount);
|
||||
$reshook = $hookmanager->executeHooks('accoutancyBindingCalculation', $parameters); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
if (empty($reshook)) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
|
||||
$isBuyerInEEC = isInEEC($buyer);
|
||||
$isSellerInEEC = isInEEC($seller);
|
||||
$code_sell_l = '';
|
||||
$code_sell_p = '';
|
||||
$code_sell_t = '';
|
||||
$suggestedid = '';
|
||||
|
||||
// Level 1: Search suggested default account for product/service
|
||||
$suggestedaccountingaccountbydefaultfor = '';
|
||||
if ($factureDet->product_type == 1) {
|
||||
if ($buyer->country_code == $seller->country_code || empty($buyer->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country)
|
||||
$code_sell_l = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : '');
|
||||
$suggestedaccountingaccountbydefaultfor = '';
|
||||
} else {
|
||||
if ($isSellerInEEC && $isBuyerInEEC && $factureDet->tva_tx != 0) { // European intravat sale, but with a VAT
|
||||
$code_sell_l = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : '');
|
||||
$suggestedaccountingaccountbydefaultfor = 'eecwithvat';
|
||||
} elseif ($isSellerInEEC && $isBuyerInEEC && empty($buyer->tva_intra)) { // European intravat sale, without VAT intra community number
|
||||
$code_sell_l = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : '');
|
||||
$suggestedaccountingaccountbydefaultfor = 'eecwithoutvatnumber';
|
||||
} elseif ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale
|
||||
$code_sell_l = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_INTRA_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_INTRA_ACCOUNT : '');
|
||||
$suggestedaccountingaccountbydefaultfor = 'eec';
|
||||
} else { // Foreign sale
|
||||
$code_sell_l = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_EXPORT_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_EXPORT_ACCOUNT : '');
|
||||
$suggestedaccountingaccountbydefaultfor = 'export';
|
||||
}
|
||||
}
|
||||
} elseif ($factureDet->product_type == 0) {
|
||||
if ($buyer->country_code == $seller->country_code || empty($buyer->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country)
|
||||
$code_sell_l = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : '');
|
||||
$suggestedaccountingaccountbydefaultfor = '';
|
||||
} else {
|
||||
if ($isSellerInEEC && $isBuyerInEEC && $factureDet->tva_tx != 0) { // European intravat sale, but with a VAT
|
||||
$code_sell_l = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : '');
|
||||
$suggestedaccountingaccountbydefaultfor = 'eecwithvat';
|
||||
} elseif ($isSellerInEEC && $isBuyerInEEC && empty($buyer->tva_intra)) { // European intravat sale, without VAT intra community number
|
||||
$code_sell_l = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : '');
|
||||
$suggestedaccountingaccountbydefaultfor = 'eecwithoutvatnumber';
|
||||
} elseif ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale
|
||||
$code_sell_l = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT : '');
|
||||
$suggestedaccountingaccountbydefaultfor = 'eec';
|
||||
} else {
|
||||
$code_sell_l = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_EXPORT_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_EXPORT_ACCOUNT : '');
|
||||
$suggestedaccountingaccountbydefaultfor = 'export';
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($code_sell_l == -1) {
|
||||
$code_sell_l = '';
|
||||
}
|
||||
|
||||
// Level 2: Search suggested account for product/service (similar code exists in page index.php to make automatic binding)
|
||||
$suggestedaccountingaccountfor = '';
|
||||
if ((($buyer->country_code == $seller->country_code) || empty($buyer->country_code)) && !empty($product->accountancy_code_sell)) { // If buyer in same country than seller (if not defined, we assume it is same country)
|
||||
$code_sell_p = $product->accountancy_code_sell;
|
||||
$suggestedid = $accountingAccount['dom'];
|
||||
$suggestedaccountingaccountfor = 'prodserv';
|
||||
} else {
|
||||
if ($isSellerInEEC && $isBuyerInEEC && $factureDet->tva_tx != 0 && !empty($product->accountancy_code_sell)) { // European intravat sale, but with VAT
|
||||
$code_sell_p = $product->accountancy_code_sell;
|
||||
$suggestedid = $accountingAccount['dom'];
|
||||
$suggestedaccountingaccountfor = 'eecwithvat';
|
||||
} elseif ($isSellerInEEC && $isBuyerInEEC && empty($buyer->tva_intra) && !empty($product->accountancy_code_sell)) { // European intravat sale, without VAT intra community number
|
||||
$code_sell_p = $product->accountancy_code_sell;
|
||||
$suggestedid = $accountingAccount['dom']; // There is a doubt for this case. Is it an error on vat or we just forgot to fill vat number ?
|
||||
$suggestedaccountingaccountfor = 'eecwithoutvatnumber';
|
||||
} elseif ($isSellerInEEC && $isBuyerInEEC && !empty($product->accountancy_code_sell_intra)) { // European intravat sale
|
||||
$code_sell_p = $product->accountancy_code_sell_intra;
|
||||
$suggestedid = $accountingAccount['intra'];
|
||||
$suggestedaccountingaccountfor = 'eec';
|
||||
} elseif (!empty($product->accountancy_code_sell_export)) { // Foreign sale
|
||||
$code_sell_p = $product->accountancy_code_sell_export;
|
||||
$suggestedid = $accountingAccount['export'];
|
||||
$suggestedaccountingaccountfor = 'export';
|
||||
}
|
||||
}
|
||||
|
||||
// Level 3: Search suggested account for this thirdparty (similar code exists in page index.php to make automatic binding)
|
||||
if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) {
|
||||
if (!empty($buyer->code_compta)) {
|
||||
$code_sell_t = $buyer->code_compta;
|
||||
$suggestedid = $accountingAccount['thirdparty'];
|
||||
$suggestedaccountingaccountfor = 'thridparty';
|
||||
}
|
||||
}
|
||||
|
||||
// Manage Deposit
|
||||
if ($factureDet->desc == "(DEPOSIT)") {
|
||||
$accountdeposittoventilated = new self($this->db);
|
||||
$result = $accountdeposittoventilated->fetch('', $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT, 1);
|
||||
if ($result < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
$code_sell_l = $accountdeposittoventilated->ref;
|
||||
$suggestedid = $accountdeposittoventilated->rowid;
|
||||
$suggestedaccountingaccountfor = 'deposit';
|
||||
}
|
||||
|
||||
if (empty($suggestedid) && empty($code_sell_p) && !empty($code_sell_l) && empty($conf->global->ACCOUNTANCY_DO_NOT_AUTOFILL_ACCOUNT_WITH_GENERIC)) {
|
||||
if (empty($this->accountingaccount_codetotid_cache[$code_sell_l])) {
|
||||
$tmpaccount = new self($this->db);
|
||||
$result = $tmpaccount->fetch(0, $code_sell_l, 1);
|
||||
if ($result < 0) {
|
||||
return -1;
|
||||
}
|
||||
if ($tmpaccount->id > 0) {
|
||||
$suggestedid = $tmpaccount->id;
|
||||
}
|
||||
$this->accountingaccount_codetotid_cache[$code_sell_l] = $tmpaccount->id;
|
||||
} else {
|
||||
$suggestedid = $this->accountingaccount_codetotid_cache[$code_sell_l];
|
||||
}
|
||||
}
|
||||
return array(
|
||||
'suggestedaccountingaccountbydefaultfor' => $suggestedaccountingaccountbydefaultfor,
|
||||
'suggestedaccountingaccountfor' => $suggestedaccountingaccountfor,
|
||||
'suggestedid' => $suggestedid,
|
||||
'code_sell_l' => $code_sell_l,
|
||||
'code_sell_p' => $code_sell_p,
|
||||
'code_sell_t' => $code_sell_t,
|
||||
);
|
||||
} else {
|
||||
if (is_array($hookmanager->resArray) && !empty($hookmanager->resArray)) {
|
||||
return $hookmanager->resArray;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -31,6 +31,7 @@ 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/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("compta", "bills", "other", "accountancy"));
|
||||
@ -46,6 +47,7 @@ if (!$user->rights->accounting->bind->write) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
$accountingAccount = new AccountingAccount($db);
|
||||
|
||||
$month_start = ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1);
|
||||
if (GETPOST("year", 'int')) {
|
||||
@ -172,35 +174,75 @@ if ($action == 'validatehistory') {
|
||||
|
||||
$isSellerInEEC = isInEEC($mysoc);
|
||||
|
||||
$thirdpartystatic = new Societe($db);
|
||||
$facture_static = new Facture($db);
|
||||
$facture_static_det = new FactureLigne($db);
|
||||
$product_static = new Product($db);
|
||||
|
||||
$i = 0;
|
||||
while ($i < min($num_lines, 10000)) { // No more than 10000 at once
|
||||
$objp = $db->fetch_object($result);
|
||||
|
||||
$isBuyerInEEC = isInEEC($objp); // This make a database request but there is a cache into $conf->cache['country_code_in_EEC']
|
||||
$thirdpartystatic->id = $objp->socid;
|
||||
$thirdpartystatic->name = $objp->name;
|
||||
$thirdpartystatic->client = $objp->client;
|
||||
$thirdpartystatic->fournisseur = $objp->fournisseur;
|
||||
$thirdpartystatic->code_client = $objp->code_client;
|
||||
$thirdpartystatic->code_compta_client = $objp->code_compta_client;
|
||||
$thirdpartystatic->code_fournisseur = $objp->code_fournisseur;
|
||||
$thirdpartystatic->code_compta_fournisseur = $objp->code_compta_fournisseur;
|
||||
$thirdpartystatic->email = $objp->email;
|
||||
$thirdpartystatic->country_code = $objp->country_code;
|
||||
$thirdpartystatic->tva_intra = $objp->tva_intra;
|
||||
$thirdpartystatic->code_compta = $objp->company_code_sell;
|
||||
|
||||
// Level 2: Search suggested account for product/service (similar code exists in page list.php to make manual binding)
|
||||
$suggestedaccountingaccountfor = '';
|
||||
if (($objp->country_code == $mysoc->country_code) || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country)
|
||||
$objp->code_sell_p = $objp->code_sell;
|
||||
$objp->aarowid_suggest = $objp->aarowid;
|
||||
$suggestedaccountingaccountfor = '';
|
||||
$product_static->ref = $objp->product_ref;
|
||||
$product_static->id = $objp->product_id;
|
||||
$product_static->type = $objp->type;
|
||||
$product_static->label = $objp->product_label;
|
||||
$product_static->status = $objp->status;
|
||||
$product_static->status_buy = $objp->status_buy;
|
||||
$product_static->accountancy_code_sell = $objp->code_sell;
|
||||
$product_static->accountancy_code_sell_intra = $objp->code_sell_intra;
|
||||
$product_static->accountancy_code_sell_export = $objp->code_sell_export;
|
||||
$product_static->accountancy_code_buy = $objp->code_buy;
|
||||
$product_static->accountancy_code_buy_intra = $objp->code_buy_intra;
|
||||
$product_static->accountancy_code_buy_export = $objp->code_buy_export;
|
||||
$product_static->tva_tx = $objp->tva_tx_prod;
|
||||
$product_static->tva_tx = $objp->tva_tx_prod;
|
||||
|
||||
$facture_static->ref = $objp->ref;
|
||||
$facture_static->id = $objp->facid;
|
||||
$facture_static->type = $objp->ftype;
|
||||
$facture_static->datef = $objp->datef;
|
||||
|
||||
$facture_static_det->id = $objp->rowid;
|
||||
$facture_static_det->total_ht = $objp->total_ht;
|
||||
$facture_static_det->tva_tx = $objp->tva_tx_line;
|
||||
$facture_static_det->vat_src_code = $objp->vat_src_code;
|
||||
$facture_static_det->product_type = $objp->type_l;
|
||||
$facture_static_det->desc = $objp->description;
|
||||
|
||||
$accoutinAccountArray = array(
|
||||
'dom'=>$objp->aarowid,
|
||||
'intra'=>$objp->aarowid_intra,
|
||||
'export'=>$objp->aarowid_export,
|
||||
'thirdparty' =>$objp->aarowid_thirdparty);
|
||||
|
||||
$code_sell_p_notset = '';
|
||||
$code_sell_t_notset = '';
|
||||
|
||||
$return=$accountingAccount->getAccountingCodeToBind($thirdpartystatic, $mysoc, $product_static, $facture_static, $facture_static_det, $accoutinAccountArray);
|
||||
if (!is_array($return) && $return<0) {
|
||||
setEventMessage($accountingAccount->error, 'errors');
|
||||
} else {
|
||||
if ($isSellerInEEC && $isBuyerInEEC && $objp->tva_tx_line != 0) { // European intravat sale, but with VAT
|
||||
$objp->code_sell_p = $objp->code_sell;
|
||||
$objp->aarowid_suggest = $objp->aarowid;
|
||||
$suggestedaccountingaccountfor = 'eecwithvat';
|
||||
} elseif ($isSellerInEEC && $isBuyerInEEC && empty($objp->tva_intra)) { // European intravat sale, without VAT intra community number
|
||||
$objp->code_sell_p = $objp->code_sell;
|
||||
$objp->aarowid_suggest = 0; // There is a doubt, no automatic binding
|
||||
$suggestedaccountingaccountfor = 'eecwithoutvatnumber';
|
||||
} elseif ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale
|
||||
$objp->code_sell_p = $objp->code_sell_intra;
|
||||
$objp->aarowid_suggest = $objp->aarowid_intra;
|
||||
$suggestedaccountingaccountfor = 'eec';
|
||||
} else { // Foreign sale
|
||||
$objp->code_sell_p = $objp->code_sell_export;
|
||||
$objp->aarowid_suggest = $objp->aarowid_export;
|
||||
$suggestedaccountingaccountfor = 'export';
|
||||
$suggestedid=$return['suggestedid'];
|
||||
$suggestedaccountingaccountfor=$return['suggestedaccountingaccountfor'];
|
||||
|
||||
if (!empty($suggestedid) && $suggestedaccountingaccountfor<>'') {
|
||||
$suggestedid=$return['suggestedid'];
|
||||
} else {
|
||||
$suggestedid=0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -215,8 +257,8 @@ if ($action == 'validatehistory') {
|
||||
|
||||
if ($objp->aarowid_suggest > 0) {
|
||||
$sqlupdate = "UPDATE ".MAIN_DB_PREFIX."facturedet";
|
||||
$sqlupdate .= " SET fk_code_ventilation = ".((int) $objp->aarowid_suggest);
|
||||
$sqlupdate .= " WHERE fk_code_ventilation <= 0 AND product_type <= 2 AND rowid = ".((int) $objp->rowid);
|
||||
$sqlupdate .= " SET fk_code_ventilation = ".((int) $suggestedid);
|
||||
$sqlupdate .= " WHERE fk_code_ventilation <= 0 AND product_type <= 2 AND rowid = ".((int) $facture_static_det->id);
|
||||
|
||||
$resqlupdate = $db->query($sqlupdate);
|
||||
if (!$resqlupdate) {
|
||||
|
||||
@ -45,6 +45,7 @@ $massaction = GETPOST('massaction', 'alpha');
|
||||
$show_files = GETPOST('show_files', 'int');
|
||||
$confirm = GETPOST('confirm', 'alpha');
|
||||
$toselect = GETPOST('toselect', 'array');
|
||||
$optioncss = GETPOST('optioncss', 'alpha');
|
||||
|
||||
// Select Box
|
||||
$mesCasesCochees = GETPOST('toselect', 'array');
|
||||
@ -96,6 +97,7 @@ if (!$sortorder) {
|
||||
$hookmanager->initHooks(array('accountancycustomerlist'));
|
||||
|
||||
$formaccounting = new FormAccounting($db);
|
||||
$accountingAccount = new AccountingAccount($db);
|
||||
|
||||
$chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version');
|
||||
|
||||
@ -510,17 +512,17 @@ if ($result) {
|
||||
|
||||
$thirdpartystatic = new Societe($db);
|
||||
$facture_static = new Facture($db);
|
||||
$facture_static_det = new FactureLigne($db);
|
||||
$product_static = new Product($db);
|
||||
|
||||
$isSellerInEEC = isInEEC($mysoc);
|
||||
|
||||
$accountingaccount_codetotid_cache = array();
|
||||
|
||||
while ($i < min($num_lines, $limit)) {
|
||||
$objp = $db->fetch_object($result);
|
||||
|
||||
$objp->code_sell_l = '';
|
||||
$objp->code_sell_p = '';
|
||||
$code_sell_l = '';
|
||||
$code_sell_p = '';
|
||||
|
||||
$thirdpartystatic->id = $objp->socid;
|
||||
$thirdpartystatic->name = $objp->name;
|
||||
@ -532,6 +534,8 @@ if ($result) {
|
||||
$thirdpartystatic->code_compta_fournisseur = $objp->code_compta_fournisseur;
|
||||
$thirdpartystatic->email = $objp->email;
|
||||
$thirdpartystatic->country_code = $objp->country_code;
|
||||
$thirdpartystatic->tva_intra = $objp->tva_intra;
|
||||
$thirdpartystatic->code_compta = $objp->company_code_sell;
|
||||
|
||||
$product_static->ref = $objp->product_ref;
|
||||
$product_static->id = $objp->product_id;
|
||||
@ -545,146 +549,84 @@ if ($result) {
|
||||
$product_static->accountancy_code_buy = $objp->code_buy;
|
||||
$product_static->accountancy_code_buy_intra = $objp->code_buy_intra;
|
||||
$product_static->accountancy_code_buy_export = $objp->code_buy_export;
|
||||
$product_static->tva_tx = $objp->tva_tx_prod;
|
||||
$product_static->tva_tx = $objp->tva_tx_prod;
|
||||
|
||||
$facture_static->ref = $objp->ref;
|
||||
$facture_static->id = $objp->facid;
|
||||
$facture_static->type = $objp->ftype;
|
||||
$facture_static->datef = $objp->datef;
|
||||
|
||||
$facture_static_det->id = $objp->rowid;
|
||||
$facture_static_det->total_ht = $objp->total_ht;
|
||||
$facture_static_det->tva_tx = $objp->tva_tx_line;
|
||||
$facture_static_det->vat_src_code = $objp->vat_src_code;
|
||||
$facture_static_det->product_type = $objp->type_l;
|
||||
$facture_static_det->desc = $objp->description;
|
||||
|
||||
$accoutinAccountArray = array(
|
||||
'dom'=>$objp->aarowid,
|
||||
'intra'=>$objp->aarowid_intra,
|
||||
'export'=>$objp->aarowid_export,
|
||||
'thirdparty' =>$objp->aarowid_thirdparty);
|
||||
|
||||
$code_sell_p_notset = '';
|
||||
$code_sell_t_notset = '';
|
||||
$objp->aarowid_suggest = ''; // Will be set later
|
||||
|
||||
$isBuyerInEEC = isInEEC($objp);
|
||||
|
||||
// Level 1: Search suggested default account for product/service
|
||||
$suggestedaccountingaccountbydefaultfor = '';
|
||||
if ($objp->type_l == 1) {
|
||||
if ($objp->country_code == $mysoc->country_code || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country)
|
||||
$objp->code_sell_l = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : '');
|
||||
$suggestedaccountingaccountbydefaultfor = '';
|
||||
} else {
|
||||
if ($isSellerInEEC && $isBuyerInEEC && $objp->tva_tx_line != 0) { // European intravat sale, but with a VAT
|
||||
$objp->code_sell_l = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : '');
|
||||
$suggestedaccountingaccountbydefaultfor = 'eecwithvat';
|
||||
} elseif ($isSellerInEEC && $isBuyerInEEC && empty($objp->tva_intra)) { // European intravat sale, without VAT intra community number
|
||||
$objp->code_sell_l = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : '');
|
||||
$suggestedaccountingaccountbydefaultfor = 'eecwithoutvatnumber';
|
||||
} elseif ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale
|
||||
$objp->code_sell_l = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_INTRA_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_INTRA_ACCOUNT : '');
|
||||
$suggestedaccountingaccountbydefaultfor = 'eec';
|
||||
} else { // Foreign sale
|
||||
$objp->code_sell_l = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_EXPORT_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_EXPORT_ACCOUNT : '');
|
||||
$suggestedaccountingaccountbydefaultfor = 'export';
|
||||
}
|
||||
}
|
||||
} elseif ($objp->type_l == 0) {
|
||||
if ($objp->country_code == $mysoc->country_code || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country)
|
||||
$objp->code_sell_l = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : '');
|
||||
$suggestedaccountingaccountbydefaultfor = '';
|
||||
} else {
|
||||
if ($isSellerInEEC && $isBuyerInEEC && $objp->tva_tx_line != 0) { // European intravat sale, but with a VAT
|
||||
$objp->code_sell_l = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : '');
|
||||
$suggestedaccountingaccountbydefaultfor = 'eecwithvat';
|
||||
} elseif ($isSellerInEEC && $isBuyerInEEC && empty($objp->tva_intra)) { // European intravat sale, without VAT intra community number
|
||||
$objp->code_sell_l = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : '');
|
||||
$suggestedaccountingaccountbydefaultfor = 'eecwithoutvatnumber';
|
||||
} elseif ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale
|
||||
$objp->code_sell_l = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT : '');
|
||||
$suggestedaccountingaccountbydefaultfor = 'eec';
|
||||
} else {
|
||||
$objp->code_sell_l = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_EXPORT_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_EXPORT_ACCOUNT : '');
|
||||
$suggestedaccountingaccountbydefaultfor = 'export';
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($objp->code_sell_l == -1) {
|
||||
$objp->code_sell_l = '';
|
||||
}
|
||||
|
||||
// Level 2: Search suggested account for product/service (similar code exists in page index.php to make automatic binding)
|
||||
$suggestedaccountingaccountfor = '';
|
||||
if (($objp->country_code == $mysoc->country_code) || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country)
|
||||
$objp->code_sell_p = $objp->code_sell;
|
||||
$objp->aarowid_suggest = $objp->aarowid;
|
||||
$suggestedaccountingaccountfor = '';
|
||||
$return=$accountingAccount->getAccountingCodeToBind($thirdpartystatic, $mysoc, $product_static, $facture_static, $facture_static_det, $accoutinAccountArray);
|
||||
if (!is_array($return) && $return<0) {
|
||||
setEventMessage($accountingAccount->error, 'errors');
|
||||
} else {
|
||||
if ($isSellerInEEC && $isBuyerInEEC && $objp->tva_tx_line != 0) { // European intravat sale, but with VAT
|
||||
$objp->code_sell_p = $objp->code_sell;
|
||||
$objp->aarowid_suggest = $objp->aarowid;
|
||||
$suggestedaccountingaccountfor = 'eecwithvat';
|
||||
} elseif ($isSellerInEEC && $isBuyerInEEC && empty($objp->tva_intra)) { // European intravat sale, without VAT intra community number
|
||||
$objp->code_sell_p = $objp->code_sell;
|
||||
$objp->aarowid_suggest = $objp->aarowid; // There is a doubt for this case. Is it an error on vat or we just forgot to fill vat number ?
|
||||
$suggestedaccountingaccountfor = 'eecwithoutvatnumber';
|
||||
} elseif ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale
|
||||
$objp->code_sell_p = $objp->code_sell_intra;
|
||||
$objp->aarowid_suggest = $objp->aarowid_intra;
|
||||
$suggestedaccountingaccountfor = 'eec';
|
||||
} else { // Foreign sale
|
||||
$objp->code_sell_p = $objp->code_sell_export;
|
||||
$objp->aarowid_suggest = $objp->aarowid_export;
|
||||
$suggestedaccountingaccountfor = 'export';
|
||||
}
|
||||
$suggestedid=$return['suggestedid'];
|
||||
$suggestedaccountingaccountfor=$return['suggestedaccountingaccountfor'];
|
||||
$suggestedaccountingaccountbydefaultfor=$return['suggestedaccountingaccountbydefaultfor'];
|
||||
$code_sell_l=$return['code_sell_l'];
|
||||
$code_sell_p=$return['code_sell_p'];
|
||||
$code_sell_t=$return['code_sell_t'];
|
||||
}
|
||||
//var_dump($return);
|
||||
|
||||
// Level 3: Search suggested account for this thirdparty (similar code exists in page index.php to make automatic binding)
|
||||
if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) {
|
||||
if (!empty($objp->company_code_sell)) {
|
||||
$objp->code_sell_t = $objp->company_code_sell;
|
||||
$objp->aarowid_suggest = $objp->aarowid_thirdparty;
|
||||
$suggestedaccountingaccountfor = '';
|
||||
}
|
||||
}
|
||||
|
||||
// Manage Deposit
|
||||
if ($objp->description == "(DEPOSIT)") {
|
||||
$accountdeposittoventilated = new AccountingAccount($db);
|
||||
$accountdeposittoventilated->fetch('', $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT, 1);
|
||||
$objp->code_sell_l = $accountdeposittoventilated->ref;
|
||||
$objp->aarowid_suggest = $accountdeposittoventilated->rowid;
|
||||
}
|
||||
|
||||
if (!empty($objp->code_sell_p)) {
|
||||
if (!empty($code_sell_p)) {
|
||||
// Value was defined previously
|
||||
} else {
|
||||
$code_sell_p_notset = 'color:orange';
|
||||
}
|
||||
if (empty($objp->code_sell_l) && empty($objp->code_sell_p)) {
|
||||
if (empty($code_sell_l) && empty($code_sell_p)) {
|
||||
$code_sell_p_notset = 'color:red';
|
||||
}
|
||||
if ($suggestedaccountingaccountfor == 'eecwithoutvatnumber' && empty($code_sell_p_notset)) {
|
||||
$code_sell_p_notset = 'color:orange';
|
||||
}
|
||||
|
||||
// $objp->code_sell_l is now default code of product/service
|
||||
// $objp->code_sell_p is now code of product/service
|
||||
// $objp->code_sell_t is now code of thirdparty
|
||||
// $code_sell_l is now default code of product/service
|
||||
// $code_sell_p is now code of product/service
|
||||
// $code_sell_t is now code of thirdparty
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// Line id
|
||||
print '<td>'.$objp->rowid.'</td>';
|
||||
print '<td>'.$facture_static_det->id.'</td>';
|
||||
|
||||
// Ref Invoice
|
||||
print '<td class="nowraponall">'.$facture_static->getNomUrl(1).'</td>';
|
||||
|
||||
print '<td class="center">'.dol_print_date($db->jdate($objp->datef), 'day').'</td>';
|
||||
print '<td class="center">'.dol_print_date($db->jdate($facture_static->datef), 'day').'</td>';
|
||||
|
||||
// Ref Product
|
||||
print '<td class="tdoverflowmax150">';
|
||||
if ($product_static->id > 0) {
|
||||
print $product_static->getNomUrl(1);
|
||||
}
|
||||
if ($objp->product_label) {
|
||||
print '<br><span class="opacitymedium small">'.$objp->product_label.'</span>';
|
||||
if ($product_static->label) {
|
||||
print '<br><span class="opacitymedium small">'.$product_static->label.'</span>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Description
|
||||
print '<td class="tdoverflowonsmartphone small">';
|
||||
$text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->description));
|
||||
$text = dolGetFirstLineOfText(dol_string_nohtmltag($facture_static_det->desc));
|
||||
$trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION;
|
||||
print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->description);
|
||||
print $form->textwithtooltip(dol_trunc($text, $trunclength), $facture_static_det->desc);
|
||||
print '</td>';
|
||||
|
||||
print '<td class="right nowraponall amount">';
|
||||
@ -692,11 +634,12 @@ if ($result) {
|
||||
print '</td>';
|
||||
|
||||
// Vat rate
|
||||
if ($objp->vat_tx_l != $objp->vat_tx_p) {
|
||||
$code_vat_differ='';
|
||||
if ($product_static->tva_tx !== $facture_static_det->tva_tx) {
|
||||
$code_vat_differ = 'font-weight:bold; text-decoration:blink; color:red';
|
||||
}
|
||||
print '<td style="'.$code_vat_differ.'" class="right">';
|
||||
print vatrate($objp->tva_tx_line.($objp->vat_src_code ? ' ('.$objp->vat_src_code.')' : ''));
|
||||
print vatrate($facture_static_det->tva_tx.($facture_static_det->vat_src_code ? ' ('.$facture_static_det->vat_src_code.')' : ''));
|
||||
print '</td>';
|
||||
|
||||
// Thirdparty
|
||||
@ -713,18 +656,18 @@ if ($result) {
|
||||
|
||||
// Found accounts
|
||||
print '<td class="small">';
|
||||
$s = '1. '.(($objp->type_l == 1) ? $langs->trans("DefaultForService") : $langs->trans("DefaultForProduct")).': ';
|
||||
$s = '1. '.(($facture_static_det->product_type == 1) ? $langs->trans("DefaultForService") : $langs->trans("DefaultForProduct")).': ';
|
||||
$shelp = '';
|
||||
if ($suggestedaccountingaccountbydefaultfor == 'eec') {
|
||||
$shelp .= $langs->trans("SaleEEC");
|
||||
} elseif ($suggestedaccountingaccountbydefaultfor == 'export') {
|
||||
$shelp .= $langs->trans("SaleExport");
|
||||
}
|
||||
$s .= ($objp->code_sell_l > 0 ? length_accountg($objp->code_sell_l) : '<span style="'.$code_sell_p_notset.'">'.$langs->trans("NotDefined").'</span>');
|
||||
$s .= ($code_sell_l > 0 ? length_accountg($code_sell_l) : '<span style="'.$code_sell_p_notset.'">'.$langs->trans("NotDefined").'</span>');
|
||||
print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
|
||||
if ($objp->product_id > 0) {
|
||||
if ($product_static->id > 0) {
|
||||
print '<br>';
|
||||
$s = '2. '.(($objp->type_l == 1) ? $langs->trans("ThisService") : $langs->trans("ThisProduct")).': ';
|
||||
$s = '2. '.(($facture_static_det->product_type == 1) ? $langs->trans("ThisService") : $langs->trans("ThisProduct")).': ';
|
||||
$shelp = ''; $ttype = 'help';
|
||||
if ($suggestedaccountingaccountfor == 'eec') {
|
||||
$shelp = $langs->trans("SaleEEC");
|
||||
@ -736,7 +679,7 @@ if ($result) {
|
||||
} elseif ($suggestedaccountingaccountfor == 'export') {
|
||||
$shelp = $langs->trans("SaleExport");
|
||||
}
|
||||
$s .= (empty($objp->code_sell_p) ? '<span style="'.$code_sell_p_notset.'">'.$langs->trans("NotDefined").'</span>' : length_accountg($objp->code_sell_p));
|
||||
$s .= (empty($code_sell_p) ? '<span style="'.$code_sell_p_notset.'">'.$langs->trans("NotDefined").'</span>' : length_accountg($code_sell_p));
|
||||
print $form->textwithpicto($s, $shelp, 1, $ttype, '', 0, 2, '', 1);
|
||||
} else {
|
||||
print '<br>';
|
||||
@ -747,38 +690,26 @@ if ($result) {
|
||||
}
|
||||
if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) {
|
||||
print '<br>';
|
||||
$s = '3. '.(($objp->type_l == 1) ? $langs->trans("ServiceForThisThirdparty") : $langs->trans("ProductForThisThirdparty")).': ';
|
||||
$s = '3. '.(($facture_static_det->product_type == 1) ? $langs->trans("ServiceForThisThirdparty") : $langs->trans("ProductForThisThirdparty")).': ';
|
||||
$shelp = '';
|
||||
$s .= ($objp->code_sell_t > 0 ? length_accountg($objp->code_sell_t) : '<span style="'.$code_sell_t_notset.'">'.$langs->trans("NotDefined").'</span>');
|
||||
$s .= ($code_sell_t > 0 ? length_accountg($code_sell_t) : '<span style="'.$code_sell_t_notset.'">'.$langs->trans("NotDefined").'</span>');
|
||||
print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Suggested accounting account
|
||||
print '<td>';
|
||||
$suggestedid = $objp->aarowid_suggest;
|
||||
if (empty($suggestedid) && empty($objp->code_sell_p) && !empty($objp->code_sell_l) && empty($conf->global->ACCOUNTANCY_DO_NOT_AUTOFILL_ACCOUNT_WITH_GENERIC)) {
|
||||
if (empty($accountingaccount_codetotid_cache[$objp->code_sell_l])) {
|
||||
$tmpaccount = new AccountingAccount($db);
|
||||
$tmpaccount->fetch(0, $objp->code_sell_l, 1);
|
||||
if ($tmpaccount->id > 0) {
|
||||
$suggestedid = $tmpaccount->id;
|
||||
}
|
||||
$accountingaccount_codetotid_cache[$objp->code_sell_l] = $tmpaccount->id;
|
||||
} else {
|
||||
$suggestedid = $accountingaccount_codetotid_cache[$objp->code_sell_l];
|
||||
}
|
||||
}
|
||||
print $formaccounting->select_account($suggestedid, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'codeventil maxwidth200 maxwidthonsmartphone', 'cachewithshowemptyone');
|
||||
print $formaccounting->select_account($suggestedid, 'codeventil'.$facture_static_det->id, 1, array(), 0, 0, 'codeventil maxwidth200 maxwidthonsmartphone', 'cachewithshowemptyone');
|
||||
print '</td>';
|
||||
|
||||
// Column with checkbox
|
||||
print '<td class="center">';
|
||||
$ischecked = $objp->aarowid_suggest;
|
||||
if ($suggestedaccountingaccountfor == 'eecwithoutvatnumber') {
|
||||
if (!empty($suggestedid) && $suggestedaccountingaccountfor<>'') {
|
||||
$ischecked=1;
|
||||
} elseif ($suggestedaccountingaccountfor == 'eecwithoutvatnumber') {
|
||||
$ischecked = 0;
|
||||
}
|
||||
print '<input type="checkbox" class="flat checkforselect checkforselect'.$objp->rowid.'" name="toselect[]" value="'.$objp->rowid."_".$i.'"'.($ischecked ? "checked" : "").'/>';
|
||||
print '<input type="checkbox" class="flat checkforselect checkforselect'.$facture_static_det->id.'" name="toselect[]" value="'.$facture_static_det->id."_".$i.'"'.($ischecked ? "checked" : "").'/>';
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
|
||||
@ -362,7 +362,7 @@ if ($result) {
|
||||
|
||||
// Retrieve the accounting code of the social contribution of the payment from link of payment.
|
||||
// Note: We have the social contribution id, it can be faster to get accounting code from social contribution id.
|
||||
$sqlmid = 'SELECT cchgsoc.accountancy_code';
|
||||
$sqlmid = "SELECT cchgsoc.accountancy_code";
|
||||
$sqlmid .= " FROM ".MAIN_DB_PREFIX."c_chargesociales cchgsoc";
|
||||
$sqlmid .= " INNER JOIN ".MAIN_DB_PREFIX."chargesociales as chgsoc ON chgsoc.fk_type = cchgsoc.id";
|
||||
$sqlmid .= " INNER JOIN ".MAIN_DB_PREFIX."paiementcharge as paycharg ON paycharg.fk_charge = chgsoc.rowid";
|
||||
@ -1019,7 +1019,7 @@ if (empty($action) || $action == 'view') {
|
||||
|
||||
|
||||
// Test that setup is complete (we are in accounting, so test on entity is always on $conf->entity only, no sharing allowed)
|
||||
$sql = 'SELECT COUNT(rowid) as nb FROM '.MAIN_DB_PREFIX.'bank_account WHERE entity = '.$conf->entity.' AND fk_accountancy_journal IS NULL AND clos=0';
|
||||
$sql = "SELECT COUNT(rowid) as nb FROM ".MAIN_DB_PREFIX."bank_account WHERE entity = ".((int) $conf->entity)." AND fk_accountancy_journal IS NULL AND clos=0";
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
@ -38,10 +38,12 @@ header('Content-Type: text/csv');
|
||||
include_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancyexport.class.php';
|
||||
$accountancyexport = new AccountancyExport($db);
|
||||
|
||||
if ($accountancyexport->getFormatCode($formatexportset) == $accountancyexport::$EXPORT_TYPE_FEC && $type_export == "general_ledger") { // Specific filename for FEC model export into the general ledger
|
||||
// Specific filename for FEC model export into the general ledger
|
||||
if (($accountancyexport->getFormatCode($formatexportset) == 'fec' || $accountancyexport->getFormatCode($formatexportset) == 'fec2')
|
||||
&& $type_export == "general_ledger") {
|
||||
// FEC format is defined here: https://www.legifrance.gouv.fr/affichCodeArticle.do?idArticle=LEGIARTI000027804775&cidTexte=LEGITEXT000006069583&dateTexte=20130802&oldAction=rechCodeArticle
|
||||
if (empty($search_date_end)) {
|
||||
// TODO Get the max date into bookeeping table
|
||||
// TODO Get the max date into bookkeeping table
|
||||
$search_date_end = dol_now();
|
||||
}
|
||||
$datetouseforfilename = $search_date_end;
|
||||
@ -58,7 +60,7 @@ if ($accountancyexport->getFormatCode($formatexportset) == $accountancyexport::$
|
||||
$endaccountingperiod = dol_print_date(dol_get_last_day($tmparray['year'], $tmparray['mon']), 'dayxcard');
|
||||
|
||||
$completefilename = $siren."FEC".$endaccountingperiod.".txt";
|
||||
} elseif ($accountancyexport->getFormatCode($formatexportset) == $accountancyexport::$EXPORT_TYPE_CIEL && $type_export == "general_ledger" && !empty($conf->global->ACCOUNTING_EXPORT_XIMPORT_FORCE_FILENAME)) {
|
||||
} elseif ($accountancyexport->getFormatCode($formatexportset) == 'ciel' && $type_export == "general_ledger" && !empty($conf->global->ACCOUNTING_EXPORT_XIMPORT_FORCE_FILENAME)) {
|
||||
$completefilename = "XIMPORT.TXT";
|
||||
} else {
|
||||
$completefilename = ($code ? $code."_" : "").($prefix ? $prefix."_" : "").$filename.($nodateexport ? "" : $date_export).".".$format;
|
||||
|
||||
@ -1012,7 +1012,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
if (count($listetype)) {
|
||||
print $form->selectarray("typeid", $listetype, (GETPOST('typeid', 'int') ? GETPOST('typeid', 'int') : $typeid), (count($listetype) > 1 ? 1 : 0), 0, 0, '', 0, 0, 0, '', '', 1);
|
||||
} else {
|
||||
print '<font class="error">'.$langs->trans("NoTypeDefinedGoToSetup").'</font>';
|
||||
print '<span class="error">'.$langs->trans("NoTypeDefinedGoToSetup").'</span>';
|
||||
}
|
||||
print "</td>\n";
|
||||
|
||||
@ -1907,7 +1907,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
|
||||
// Modify
|
||||
if (!empty($user->rights->adherent->creer)) {
|
||||
print '<a class="butAction" href="card.php?rowid='.$id.'&action=edit">'.$langs->trans("Modify").'</a>'."\n";
|
||||
print '<a class="butAction" href="card.php?rowid='.$id.'&action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a>'."\n";
|
||||
} else {
|
||||
print '<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Modify").'</span>'."\n";
|
||||
}
|
||||
@ -1997,7 +1997,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
print '</div>';
|
||||
|
||||
if ($isinspip == -1) {
|
||||
print '<br><br><font class="error">'.$langs->trans('SPIPConnectionFailed').': '.$mailmanspip->error.'</font>';
|
||||
print '<br><br><span class="error">'.$langs->trans('SPIPConnectionFailed').': '.$mailmanspip->error.'</span>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -190,7 +190,7 @@ if ($result > 0) {
|
||||
|
||||
if (empty($dn)) {
|
||||
$langs->load("errors");
|
||||
print '<tr class="oddeven"><td colspan="2"><font class="error">'.$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Member")).'</font></td></tr>';
|
||||
print '<tr class="oddeven"><td colspan="2"><span class="error">'.$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Member")).'</span></td></tr>';
|
||||
} else {
|
||||
$records = $ldap->getAttribute($dn, $search);
|
||||
|
||||
@ -199,7 +199,7 @@ if ($result > 0) {
|
||||
// Show tree
|
||||
if (((!is_numeric($records)) || $records != 0) && (!isset($records['count']) || $records['count'] > 0)) {
|
||||
if (!is_array($records)) {
|
||||
print '<tr class="oddeven"><td colspan="2"><font class="error">'.$langs->trans("ErrorFailedToReadLDAP").'</font></td></tr>';
|
||||
print '<tr class="oddeven"><td colspan="2"><span class="error">'.$langs->trans("ErrorFailedToReadLDAP").'</span></td></tr>';
|
||||
} else {
|
||||
$result = show_ldap_content($records, 0, $records['count'], true);
|
||||
}
|
||||
|
||||
@ -587,7 +587,7 @@ if ($rowid > 0) {
|
||||
print $langs->trans("LinkedToDolibarrThirdParty");
|
||||
print '</td>';
|
||||
if ($action != 'editthirdparty' && $user->rights->adherent->creer) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editthirdparty&rowid='.$object->id.'">'.img_edit($langs->trans('SetLinkToThirdParty'), 1).'</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editthirdparty&token='.newToken().'&rowid='.$object->id.'">'.img_edit($langs->trans('SetLinkToThirdParty'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="2" class="valeur">';
|
||||
@ -631,7 +631,7 @@ if ($rowid > 0) {
|
||||
if ($action != 'editlogin' && $user->rights->adherent->creer) {
|
||||
print '<td class="right">';
|
||||
if ($user->rights->user->user->creer) {
|
||||
print '<a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editlogin&rowid='.$object->id.'">'.img_edit($langs->trans('SetLinkToUser'), 1).'</a>';
|
||||
print '<a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editlogin&token='.newToken().'&rowid='.$object->id.'">'.img_edit($langs->trans('SetLinkToUser'), 1).'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
@ -670,7 +670,7 @@ if ($rowid > 0) {
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
if ($object->statut > 0) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?rowid='.$rowid.'&action=addsubscription">'.$langs->trans("AddSubscription")."</a></div>";
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?rowid='.$rowid.'&action=addsubscription&token='.newToken().'">'.$langs->trans("AddSubscription")."</a></div>";
|
||||
} else {
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("ValidateBefore")).'">'.$langs->trans("AddSubscription").'</a></div>';
|
||||
}
|
||||
|
||||
@ -318,6 +318,19 @@ if (!$rowid && $action != 'create' && $action != 'edit') {
|
||||
print "</tr>";
|
||||
$i++;
|
||||
}
|
||||
|
||||
// If no record found
|
||||
if ($num == 0) {
|
||||
/*$colspan = 1;
|
||||
foreach ($arrayfields as $key => $val) {
|
||||
if (!empty($val['checked'])) {
|
||||
$colspan++;
|
||||
}
|
||||
}*/
|
||||
$colspan = 8;
|
||||
print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoRecordFound").'</td></tr>';
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
print '</div>';
|
||||
|
||||
@ -481,12 +494,12 @@ if ($rowid > 0) {
|
||||
|
||||
// Edit
|
||||
if ($user->rights->adherent->configurer) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit&rowid='.$object->id.'">'.$langs->trans("Modify").'</a></div>';
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit&token='.newToken().'&rowid='.$object->id.'">'.$langs->trans("Modify").'</a></div>';
|
||||
}
|
||||
|
||||
// Add
|
||||
if ($user->rights->adherent->configurer && !empty($object->status)) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?action=create&typeid='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?rowid='.$object->id).'">'.$langs->trans("AddMember").'</a></div>';
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?action=create&token='.newToken().'&typeid='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?rowid='.$object->id).'">'.$langs->trans("AddMember").'</a></div>';
|
||||
} else {
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NoAddMember")).'">'.$langs->trans("AddMember").'</a></div>';
|
||||
}
|
||||
@ -728,10 +741,10 @@ if ($rowid > 0) {
|
||||
// Actions
|
||||
print '<td class="center">';
|
||||
if ($user->rights->adherent->creer) {
|
||||
print '<a class="editfielda marginleftonly" href="card.php?rowid='.$objp->rowid.'&action=edit&backtopage='.urlencode($_SERVER["PHP_SELF"].'?rowid='.$object->id).'">'.img_edit().'</a>';
|
||||
print '<a class="editfielda marginleftonly" href="card.php?rowid='.$objp->rowid.'&action=edit&token='.newToken().'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?rowid='.$object->id).'">'.img_edit().'</a>';
|
||||
}
|
||||
if ($user->rights->adherent->supprimer) {
|
||||
print '<a class="marginleftonly" href="card.php?rowid='.$objp->rowid.'&action=resign">'.img_picto($langs->trans("Resiliate"), 'disable.png').'</a>';
|
||||
print '<a class="marginleftonly" href="card.php?rowid='.$objp->rowid.'&action=resign&token='.newToken().'">'.img_picto($langs->trans("Resiliate"), 'disable.png').'</a>';
|
||||
}
|
||||
print "</td>";
|
||||
|
||||
|
||||
@ -161,7 +161,7 @@ if ($result > 0) {
|
||||
// Show tree
|
||||
if (((!is_numeric($records)) || $records != 0) && (!isset($records['count']) || $records['count'] > 0)) {
|
||||
if (!is_array($records)) {
|
||||
print '<tr class="oddeven"><td colspan="2"><font class="error">'.$langs->trans("ErrorFailedToReadLDAP").'</font></td></tr>';
|
||||
print '<tr class="oddeven"><td colspan="2"><span class="error">'.$langs->trans("ErrorFailedToReadLDAP").'</span></td></tr>';
|
||||
} else {
|
||||
$result = show_ldap_content($records, 0, $records['count'], true);
|
||||
}
|
||||
|
||||
@ -185,9 +185,9 @@ print "\n<div class=\"tabsAction\">\n";
|
||||
|
||||
if ($action == '') {
|
||||
if ($user->rights->produit->creer || $user->rights->service->creer) {
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/adherents/type_translation.php?action=create&rowid='.$object->id.'">'.$langs->trans("Add").'</a>';
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/adherents/type_translation.php?action=create&token='.newToken().'&rowid='.$object->id.'">'.$langs->trans("Add").'</a>';
|
||||
if ($cnt_trans > 0) {
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/adherents/type_translation.php?action=edit&rowid='.$object->id.'">'.$langs->trans("Update").'</a>';
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/adherents/type_translation.php?action=edit&token='.newToken().'&rowid='.$object->id.'">'.$langs->trans("Update").'</a>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -91,7 +91,7 @@ $form = new Form($db);
|
||||
$formother = new FormOther($db);
|
||||
$formcompany = new FormCompany($db);
|
||||
|
||||
$countrynotdefined = '<font class="error">'.$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')</font>';
|
||||
$countrynotdefined = '<span class="error">'.$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')</span>';
|
||||
|
||||
print '<span class="opacitymedium">'.$langs->trans("AccountantDesc")."</span><br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
@ -302,7 +302,7 @@ if (!isset($_SERVER['WINDIR'])) {
|
||||
print '<input type="text" size="40" name="GENBARCODE_LOCATION" value="'.$conf->global->GENBARCODE_LOCATION.'">';
|
||||
if (!empty($conf->global->GENBARCODE_LOCATION) && !@file_exists($conf->global->GENBARCODE_LOCATION)) {
|
||||
$langs->load("errors");
|
||||
print '<br><font class="error">'.$langs->trans("ErrorFileNotFound", $conf->global->GENBARCODE_LOCATION).'</font>';
|
||||
print '<br><span class="error">'.$langs->trans("ErrorFileNotFound", $conf->global->GENBARCODE_LOCATION).'</span>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
@ -373,7 +373,7 @@ if ($conf->product->enabled) {
|
||||
print '</td>';
|
||||
print '<td class="nowrap">'.$modBarCode->getExample($langs)."</td>\n";
|
||||
|
||||
if ($conf->global->BARCODE_PRODUCT_ADDON_NUM == "$file") {
|
||||
if (!empty($conf->global->BARCODE_PRODUCT_ADDON_NUM) && $conf->global->BARCODE_PRODUCT_ADDON_NUM == "$file") {
|
||||
print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setbarcodeproductoff&token='.newToken().'&value='.urlencode($file).'">';
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
print '</a></td>';
|
||||
|
||||
@ -360,7 +360,7 @@ foreach ($boxtoadd as $box) {
|
||||
print '</tr>'."\n";
|
||||
}
|
||||
if (!count($boxtoadd) && count($boxactivated)) {
|
||||
print '<tr><td class="opacitymedium" colspan="4">'.$langs->trans("AllWidgetsWereEnabled").'</td></tr>';
|
||||
print '<tr><td colspan="4"><span class="opacitymedium">'.$langs->trans("AllWidgetsWereEnabled").'</span></td></tr>';
|
||||
}
|
||||
print '</table>'."\n";
|
||||
print '</div>';
|
||||
|
||||
@ -369,7 +369,7 @@ $form = new Form($db);
|
||||
$formother = new FormOther($db);
|
||||
$formcompany = new FormCompany($db);
|
||||
|
||||
$countrynotdefined = '<font class="error">'.$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')</font>';
|
||||
$countrynotdefined = '<span class="error">'.$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')</span>';
|
||||
|
||||
print load_fiche_titre($langs->trans("CompanyFoundation"), '', 'title_setup');
|
||||
|
||||
|
||||
@ -145,7 +145,7 @@ if ($action == 'edit') {
|
||||
print '</table>';
|
||||
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>';
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a>';
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
|
||||
@ -452,7 +452,7 @@ if ($action == 'edit') {
|
||||
print '</form>';
|
||||
} else {
|
||||
print '<br><div class="tabsAction">';
|
||||
print '<a class="butAction" href="delais.php?action=edit">'.$langs->trans("Modify").'</a></div>';
|
||||
print '<a class="butAction" href="delais.php?action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a></div>';
|
||||
}
|
||||
|
||||
// End of page
|
||||
|
||||
@ -223,7 +223,7 @@ $tabsql[24] = "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFI
|
||||
$tabsql[25] = "SELECT rowid as rowid, code, label, active, module FROM ".MAIN_DB_PREFIX."c_type_container as t WHERE t.entity IN (".getEntity('c_type_container').")";
|
||||
//$tabsql[26]= "SELECT rowid as rowid, code, label, short_label, active FROM ".MAIN_DB_PREFIX."c_units";
|
||||
$tabsql[27] = "SELECT id as rowid, code, libelle, picto, active FROM ".MAIN_DB_PREFIX."c_stcomm";
|
||||
$tabsql[28] = "SELECT h.rowid as rowid, h.code, h.label, h.affect, h.delay, h.newByMonth, h.fk_country as country_id, c.code as country_code, c.label as country, h.active FROM ".MAIN_DB_PREFIX."c_holiday_types as h LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON h.fk_country=c.rowid";
|
||||
$tabsql[28] = "SELECT h.rowid as rowid, h.code, h.label, h.affect, h.delay, h.newbymonth, h.fk_country as country_id, c.code as country_code, c.label as country, h.active FROM ".MAIN_DB_PREFIX."c_holiday_types as h LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON h.fk_country=c.rowid";
|
||||
$tabsql[29] = "SELECT rowid as rowid, code, label, percent, position, active FROM ".MAIN_DB_PREFIX."c_lead_status";
|
||||
$tabsql[30] = "SELECT rowid, code, name, paper_size, orientation, metric, leftmargin, topmargin, nx, ny, spacex, spacey, width, height, font_size, custom_x, custom_y, active FROM ".MAIN_DB_PREFIX."c_format_cards";
|
||||
//$tabsql[31]= "SELECT s.rowid as rowid, pcg_version, s.label, s.active FROM ".MAIN_DB_PREFIX."accounting_system as s";
|
||||
@ -315,7 +315,7 @@ $tabfield[24] = "code,label";
|
||||
$tabfield[25] = "code,label";
|
||||
//$tabfield[26]= "code,label,short_label";
|
||||
$tabfield[27] = "code,libelle,picto";
|
||||
$tabfield[28] = "code,label,affect,delay,newByMonth,country_id,country";
|
||||
$tabfield[28] = "code,label,affect,delay,newbymonth,country_id,country";
|
||||
$tabfield[29] = "code,label,percent,position";
|
||||
$tabfield[30] = "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
|
||||
//$tabfield[31]= "pcg_version,label";
|
||||
@ -361,7 +361,7 @@ $tabfieldvalue[24] = "code,label";
|
||||
$tabfieldvalue[25] = "code,label";
|
||||
//$tabfieldvalue[26]= "code,label,short_label";
|
||||
$tabfieldvalue[27] = "code,libelle,picto";
|
||||
$tabfieldvalue[28] = "code,label,affect,delay,newByMonth,country";
|
||||
$tabfieldvalue[28] = "code,label,affect,delay,newbymonth,country";
|
||||
$tabfieldvalue[29] = "code,label,percent,position";
|
||||
$tabfieldvalue[30] = "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
|
||||
//$tabfieldvalue[31]= "pcg_version,label";
|
||||
@ -407,7 +407,7 @@ $tabfieldinsert[24] = "code,label";
|
||||
$tabfieldinsert[25] = "code,label";
|
||||
//$tabfieldinsert[26]= "code,label,short_label";
|
||||
$tabfieldinsert[27] = "code,libelle,picto";
|
||||
$tabfieldinsert[28] = "code,label,affect,delay,newByMonth,fk_country";
|
||||
$tabfieldinsert[28] = "code,label,affect,delay,newbymonth,fk_country";
|
||||
$tabfieldinsert[29] = "code,label,percent,position";
|
||||
$tabfieldinsert[30] = "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
|
||||
//$tabfieldinsert[31]= "pcg_version,label";
|
||||
@ -548,7 +548,7 @@ $tabhelp[24] = array('code'=>$langs->trans("EnterAnyCode"));
|
||||
$tabhelp[25] = array('code'=>$langs->trans('EnterAnyCode'));
|
||||
//$tabhelp[26] = array('code'=>$langs->trans("EnterAnyCode"));
|
||||
$tabhelp[27] = array('code'=>$langs->trans("EnterAnyCode"), 'picto'=>$langs->trans("PictoHelp"));
|
||||
$tabhelp[28] = array('affect'=>$langs->trans("FollowedByACounter"), 'delay'=>$langs->trans("MinimumNoticePeriod"), 'newByMonth'=>$langs->trans("NbAddedAutomatically"));
|
||||
$tabhelp[28] = array('affect'=>$langs->trans("FollowedByACounter"), 'delay'=>$langs->trans("MinimumNoticePeriod"), 'newbymonth'=>$langs->trans("NbAddedAutomatically"));
|
||||
$tabhelp[29] = array('code'=>$langs->trans("EnterAnyCode"), 'percent'=>$langs->trans("OpportunityPercent"), 'position'=>$langs->trans("PositionIntoComboList"));
|
||||
$tabhelp[30] = array('code'=>$langs->trans("EnterAnyCode"), 'name'=>$langs->trans("LabelName"), 'paper_size'=>$langs->trans("LabelPaperSize"));
|
||||
//$tabhelp[31] = array('pcg_version'=>$langs->trans("EnterAnyCode"));
|
||||
@ -1175,6 +1175,8 @@ if ($id) {
|
||||
$sql .= natural_search("r.code_region", $search_code);
|
||||
} elseif ($search_code != '' && $id == 7) {
|
||||
$sql .= natural_search("a.code", $search_code);
|
||||
} elseif ($search_code != '' && $id == 10) {
|
||||
$sql .= natural_search("t.code", $search_code);
|
||||
} elseif ($search_code != '' && $id != 9) {
|
||||
$sql .= natural_search("code", $search_code);
|
||||
}
|
||||
@ -1392,7 +1394,7 @@ if ($id) {
|
||||
if ($value == 'delay') {
|
||||
$valuetoshow = $langs->trans("NoticePeriod");
|
||||
}
|
||||
if ($value == 'newByMonth') {
|
||||
if ($value == 'newbymonth') {
|
||||
$valuetoshow = $langs->trans("NewByMonth");
|
||||
}
|
||||
if ($value == 'fk_tva') {
|
||||
@ -1737,7 +1739,7 @@ if ($id) {
|
||||
if ($value == 'delay') {
|
||||
$valuetoshow = $langs->trans("NoticePeriod");
|
||||
}
|
||||
if ($value == 'newByMonth') {
|
||||
if ($value == 'newbymonth') {
|
||||
$valuetoshow = $langs->trans("NewByMonth");
|
||||
}
|
||||
if ($value == 'fk_tva') {
|
||||
|
||||
@ -232,7 +232,7 @@ class PrestaShopWebservice
|
||||
if ($response != '') {
|
||||
libxml_clear_errors();
|
||||
libxml_use_internal_errors(true);
|
||||
$xml = simplexml_load_string($response, 'SimpleXMLElement', LIBXML_NOCDATA);
|
||||
$xml = simplexml_load_string($response, 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET);
|
||||
if (libxml_get_errors()) {
|
||||
$msg = var_export(libxml_get_errors(), true);
|
||||
libxml_clear_errors();
|
||||
|
||||
@ -656,7 +656,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print '</td>';
|
||||
// Delete
|
||||
print '<td class="right nowraponall">';
|
||||
print '<a class="editfielda marginrightonly" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=editoperation&operationid='.$ruleaction['id'].'">'.img_edit().'</a>';
|
||||
print '<a class="editfielda marginrightonly" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=editoperation&token='.newToken().'&operationid='.$ruleaction['id'].'">'.img_edit().'</a>';
|
||||
print ' <a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=deleteoperation&token='.newToken().'&operationid='.$ruleaction['id'].'">'.img_delete().'</a>';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
@ -693,14 +693,14 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
|
||||
if (empty($reshook)) {
|
||||
// Edit
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit">'.$langs->trans("Edit").'</a></div>';
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken().'">'.$langs->trans("Edit").'</a></div>';
|
||||
|
||||
// Clone
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&object=order">'.$langs->trans("ToClone").'</a></div>';
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&token='.newToken().'&object=order">'.$langs->trans("ToClone").'</a></div>';
|
||||
|
||||
// Collect now
|
||||
if (count($object->actions) > 0) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=collect">'.$langs->trans("CollectNow").'</a></div>';
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=collect&token='.newToken().'">'.$langs->trans("CollectNow").'</a></div>';
|
||||
} else {
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NoOperations")).'">'.$langs->trans("CollectNow").'</a></div>';
|
||||
}
|
||||
|
||||
@ -376,7 +376,7 @@ if ($action == 'edit') {
|
||||
print '</table>';
|
||||
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>';
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a>';
|
||||
print '</div>';
|
||||
} else {
|
||||
print '<br>'.$langs->trans("NothingToSetup");
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/admin/eventorganization_extrafields.php
|
||||
* \file htdocs/admin/eventorganization_confbooth_extrafields.php
|
||||
* \ingroup bom
|
||||
* \brief Page to setup extra fields of EventOrganization
|
||||
*/
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file admin/conferenceorboothattendee_extrafields.php
|
||||
* \file htdocs/admin/eventorganization_confboothattendee_extrafields.php
|
||||
* \ingroup eventorganization
|
||||
* \brief Page to setup extra fields of conferenceorboothattendee
|
||||
*/
|
||||
|
||||
@ -145,7 +145,18 @@ if ($action == 'updateMask') {
|
||||
$draft = GETPOST('EXPENSEREPORT_DRAFT_WATERMARK', 'alpha');
|
||||
$res2 = dolibarr_set_const($db, "EXPENSEREPORT_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if (!$res1 > 0 || !$res2 > 0) {
|
||||
$res3 = 0;
|
||||
if (!empty($conf->projet->enabled) && GETPOSTISSET('EXPENSEREPORT_PROJECT_IS_REQUIRED')) { // Option may not be provided
|
||||
$res3 = dolibarr_set_const($db, 'EXPENSEREPORT_PROJECT_IS_REQUIRED', GETPOST('EXPENSEREPORT_PROJECT_IS_REQUIRED', 'int'), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
|
||||
$dates = GETPOST('EXPENSEREPORT_PREFILL_DATES_WITH_CURRENT_MONTH', 'int');
|
||||
$res4 = dolibarr_set_const($db, 'EXPENSEREPORT_PREFILL_DATES_WITH_CURRENT_MONTH', intval($dates), 'chaine', 0, '', $conf->entity);
|
||||
|
||||
$amounts = GETPOST('EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY', 'int');
|
||||
$res5 = dolibarr_set_const($db, 'EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY', intval($amounts), 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if (!($res1 > 0) || !($res2 > 0) || !($res3 > 0) || !($res4 >0) || !($res5 >0)) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
@ -458,6 +469,26 @@ print $form->textwithpicto($langs->trans("WatermarkOnDraftExpenseReports"), $htm
|
||||
print '<input class="flat minwidth200" type="text" name="EXPENSEREPORT_DRAFT_WATERMARK" value="'.$conf->global->EXPENSEREPORT_DRAFT_WATERMARK.'">';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
if (!empty($conf->projet->enabled)) {
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans('ProjectIsRequiredOnExpenseReports');
|
||||
print '</td><td class="right">';
|
||||
print $form->selectyesno('EXPENSEREPORT_PROJECT_IS_REQUIRED', empty($conf->global->EXPENSEREPORT_PROJECT_IS_REQUIRED) ? 0 : 1, 1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans('PrefillExpenseReportDatesWithCurrentMonth');
|
||||
print '</td><td class="right">';
|
||||
print $form->selectyesno('EXPENSEREPORT_PREFILL_DATES_WITH_CURRENT_MONTH', empty($conf->global->EXPENSEREPORT_PREFILL_DATES_WITH_CURRENT_MONTH) ? 0 : 1, 1);
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans('ForceExpenseReportsLineAmountsIncludingTaxesOnly');
|
||||
print '</td><td class="right">';
|
||||
print $form->selectyesno('EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY', empty($conf->global->EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY) ? 0 : 1, 1);
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print $form->buttonsSaveCancel("Save", '');
|
||||
|
||||
@ -33,10 +33,6 @@ require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport_ik.class.php'
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("admin", "trips", "errors", "other", "dict"));
|
||||
|
||||
if (!$user->admin) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
$error = 0;
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
@ -45,10 +41,20 @@ $ikoffset = GETPOST('ikoffset', 'int');
|
||||
$coef = GETPOST('coef', 'int');
|
||||
|
||||
$fk_c_exp_tax_cat = GETPOST('fk_c_exp_tax_cat');
|
||||
$fk_range = GETPOST('fk_range');
|
||||
$fk_range = GETPOST('fk_range', 'int');
|
||||
|
||||
$expIk = new ExpenseReportIk($db);
|
||||
|
||||
if (!$user->admin) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($action == 'updateik') {
|
||||
$expIk = new ExpenseReportIk($db);
|
||||
if ($id > 0) {
|
||||
$result = $expIk->fetch($id);
|
||||
if ($result < 0) {
|
||||
@ -61,13 +67,13 @@ if ($action == 'updateik') {
|
||||
|
||||
if ($result > 0) {
|
||||
setEventMessages('SetupSaved', null, 'mesgs');
|
||||
|
||||
header('Location: '.$_SERVER['PHP_SELF']);
|
||||
exit;
|
||||
} else {
|
||||
setEventMessages($expIk->error, $expIk->errors, 'errors');
|
||||
}
|
||||
} elseif ($action == 'delete') { // TODO add confirm
|
||||
$expIk = new ExpenseReportIk($db);
|
||||
if ($id > 0) {
|
||||
$result = $expIk->fetch($id);
|
||||
if ($result < 0) {
|
||||
@ -77,12 +83,11 @@ if ($action == 'updateik') {
|
||||
$expIk->delete($user);
|
||||
}
|
||||
|
||||
|
||||
header('Location: '.$_SERVER['PHP_SELF']);
|
||||
exit;
|
||||
}
|
||||
|
||||
$rangesbycateg = ExpenseReportIk::getAllRanges();
|
||||
$rangesbycateg = $expIk->getAllRanges();
|
||||
|
||||
|
||||
/*
|
||||
@ -102,7 +107,8 @@ print dol_get_fiche_head($head, 'expenseik', $langs->trans("ExpenseReportsIk"),
|
||||
echo '<span class="opacitymedium">'.$langs->trans('ExpenseReportIkDesc').'</span>';
|
||||
print '<br><br>';
|
||||
|
||||
echo '<form action="'.$_SERVER['PHP_SELF'].'" method="post">';
|
||||
echo '<form action="'.$_SERVER['PHP_SELF'].'" method="POST">';
|
||||
echo '<input type="hidden" name="token" value="'.newToken().'" />';
|
||||
|
||||
if ($action == 'edit') {
|
||||
echo '<input type="hidden" name="id" value="'.$id.'" />';
|
||||
@ -111,8 +117,6 @@ if ($action == 'edit') {
|
||||
echo '<input type="hidden" name="action" value="updateik" />';
|
||||
}
|
||||
|
||||
echo '<input type="hidden" name="token" value="'.newToken().'" />';
|
||||
|
||||
echo '<table class="noborder centpercent">';
|
||||
|
||||
foreach ($rangesbycateg as $fk_c_exp_tax_cat => $Tab) {
|
||||
|
||||
@ -54,7 +54,6 @@ $code_expense_rules_type = GETPOST('code_expense_rules_type');
|
||||
$dates = dol_mktime(12, 0, 0, GETPOST('startmonth'), GETPOST('startday'), GETPOST('startyear'));
|
||||
$datee = dol_mktime(12, 0, 0, GETPOST('endmonth'), GETPOST('endday'), GETPOST('endyear'));
|
||||
$amount = GETPOST('amount');
|
||||
$restrictive = GETPOST('restrictive');
|
||||
|
||||
$object = new ExpenseReportRule($db);
|
||||
if (!empty($id)) {
|
||||
@ -138,7 +137,7 @@ if ($action == 'save') {
|
||||
exit;
|
||||
}
|
||||
|
||||
$rules = ExpenseReportRule::getAllRule();
|
||||
$rules = $object->getAllRule();
|
||||
|
||||
$tab_apply = array(
|
||||
'A' => $langs->trans('All'),
|
||||
|
||||
@ -275,9 +275,9 @@ if ($resql) {
|
||||
print "<td>".$langs->trans("Status")."</td>";
|
||||
print "<td>";
|
||||
if ($result > 0 && empty($rss->error)) {
|
||||
print '<font class="ok">'.$langs->trans("Online").'</div>';
|
||||
print '<span class="ok">'.$langs->trans("Online").'</div>';
|
||||
} else {
|
||||
print '<font class="error">'.$langs->trans("Offline");
|
||||
print '<span class="error">'.$langs->trans("Offline");
|
||||
$langs->load("errors");
|
||||
if ($rssparser->error) {
|
||||
print ' - '.$langs->trans($rssparser->error);
|
||||
|
||||
@ -82,7 +82,7 @@ print '<br><br>';
|
||||
if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) {
|
||||
$setupcompanynotcomplete = 1;
|
||||
}
|
||||
print img_picto('', 'company', 'class="paddingright valignmiddle double"').' '.$langs->trans("SetupDescriptionLink", DOL_URL_ROOT.'/admin/company.php?mainmenu=home'.(empty($setupcompanynotcomplete) ? '' : '&action=edit'), $langs->transnoentities("Setup"), $langs->transnoentities("MenuCompanySetup"));
|
||||
print img_picto('', 'company', 'class="paddingright valignmiddle double"').' '.$langs->trans("SetupDescriptionLink", DOL_URL_ROOT.'/admin/company.php?mainmenu=home'.(empty($setupcompanynotcomplete) ? '' : '&action=edit&token='.newToken()), $langs->transnoentities("Setup"), $langs->transnoentities("MenuCompanySetup"));
|
||||
print '<br><br>'.$langs->trans("SetupDescription3b");
|
||||
if (!empty($setupcompanynotcomplete)) {
|
||||
$langs->load("errors");
|
||||
@ -112,8 +112,8 @@ $reshook = $hookmanager->executeHooks('addHomeSetup', $parameters, $object, $act
|
||||
print $hookmanager->resPrint;
|
||||
if (empty($reshook)) {
|
||||
// Show into other
|
||||
print '<span class="opacitymedium">'.$langs->trans("SetupDescription5")."</span><br>";
|
||||
print "<br>";
|
||||
print '<span class="opacitymedium hideonsmartphone">'.$langs->trans("SetupDescription5")."</span><br>";
|
||||
print '<br class="hideonsmartphone">';
|
||||
|
||||
// Show logo
|
||||
print '<div class="center"><div class="logo_setup"></div></div>';
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file knowledgemanagement/admin/setup.php
|
||||
* \file htdocs/admin/knowledgemanagement.php
|
||||
* \ingroup knowledgemanagement
|
||||
* \brief KnowledgeManagement setup page.
|
||||
*/
|
||||
@ -65,9 +65,7 @@ if (!$user->admin) {
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ((float) DOL_VERSION >= 6) {
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
||||
}
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
||||
|
||||
if ($action == 'updateMask') {
|
||||
$maskconstorder = GETPOST('maskconstorder', 'alpha');
|
||||
@ -324,7 +322,7 @@ if ($action == 'edit') {
|
||||
print '</table>';
|
||||
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>';
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a>';
|
||||
print '</div>';
|
||||
} else {
|
||||
//print '<br>'.$langs->trans("NothingToSetup");
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2006-2020 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2006-2020 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* 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
|
||||
@ -153,7 +153,7 @@ $arraylist['dolibarr2ldap'] = $langs->trans("DolibarrToLDAP");
|
||||
print $form->selectarray('activesynchro', $arraylist, $conf->global->LDAP_SYNCHRO_ACTIVE);
|
||||
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPDnSynchroActiveExample").'</span>';
|
||||
if ($conf->global->LDAP_SYNCHRO_ACTIVE && !$conf->global->LDAP_USER_DN) {
|
||||
print '<br><font class="error">'.$langs->trans("LDAPSetupNotComplete").'</font>';
|
||||
print '<br><span class="error">'.$langs->trans("LDAPSetupNotComplete").'</span>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
@ -297,24 +297,24 @@ if (function_exists("ldap_connect")) {
|
||||
if ($result > 0) {
|
||||
// Test ldap connect and bind
|
||||
print img_picto('', 'info').' ';
|
||||
print '<font class="ok">'.$langs->trans("LDAPTCPConnectOK", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT).'</font>';
|
||||
print '<span class="ok">'.$langs->trans("LDAPTCPConnectOK", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT).'</span>';
|
||||
print '<br>';
|
||||
|
||||
if ($conf->global->LDAP_ADMIN_DN && !empty($conf->global->LDAP_ADMIN_PASS)) {
|
||||
if ($result == 2) {
|
||||
print img_picto('', 'info').' ';
|
||||
print '<font class="ok">'.$langs->trans("LDAPBindOK", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT, $conf->global->LDAP_ADMIN_DN, preg_replace('/./i', '*', $conf->global->LDAP_ADMIN_PASS)).'</font>';
|
||||
print '<span class="ok">'.$langs->trans("LDAPBindOK", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT, $conf->global->LDAP_ADMIN_DN, preg_replace('/./i', '*', $conf->global->LDAP_ADMIN_PASS)).'</span>';
|
||||
print '<br>';
|
||||
} else {
|
||||
print img_picto('', 'error').' ';
|
||||
print '<font class="error">'.$langs->trans("LDAPBindKO", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT, $conf->global->LDAP_ADMIN_DN, preg_replace('/./i', '*', $conf->global->LDAP_ADMIN_PASS)).'</font>';
|
||||
print '<span class="error">'.$langs->trans("LDAPBindKO", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT, $conf->global->LDAP_ADMIN_DN, preg_replace('/./i', '*', $conf->global->LDAP_ADMIN_PASS)).'</span>';
|
||||
print '<br>';
|
||||
print $langs->trans("Error").' '.$ldap->error;
|
||||
print '<br>';
|
||||
}
|
||||
} else {
|
||||
print img_picto('', 'warning').' ';
|
||||
print '<font class="warning">'.$langs->trans("LDAPNoUserOrPasswordProvidedAccessIsReadOnly").'</font>';
|
||||
print '<span class="warning">'.$langs->trans("LDAPNoUserOrPasswordProvidedAccessIsReadOnly").'</span>';
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
@ -322,18 +322,18 @@ if (function_exists("ldap_connect")) {
|
||||
// Test ldap_getversion
|
||||
if (($ldap->getVersion() == 3)) {
|
||||
print img_picto('', 'info').' ';
|
||||
print '<font class="ok">'.$langs->trans("LDAPSetupForVersion3").'</font>';
|
||||
print '<span class="ok">'.$langs->trans("LDAPSetupForVersion3").'</span>';
|
||||
print '<br>';
|
||||
} else {
|
||||
print img_picto('', 'info').' ';
|
||||
print '<font class="ok">'.$langs->trans("LDAPSetupForVersion2").'</font>';
|
||||
print '<span class="ok">'.$langs->trans("LDAPSetupForVersion2").'</span>';
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
$unbind = $ldap->unbind();
|
||||
} else {
|
||||
print img_picto('', 'error').' ';
|
||||
print '<font class="error">'.$langs->trans("LDAPTCPConnectKO", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT).'</font>';
|
||||
print '<span class="error">'.$langs->trans("LDAPTCPConnectKO", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT).'</span>';
|
||||
print '<br>';
|
||||
print $langs->trans("Error").' '.$ldap->error;
|
||||
print '<br>';
|
||||
|
||||
@ -321,12 +321,12 @@ if (function_exists("ldap_connect")) {
|
||||
|
||||
if ($result2 > 0) {
|
||||
print img_picto('', 'info').' ';
|
||||
print '<font class="ok">'.$langs->trans("LDAPSynchroOK").'</font><br>';
|
||||
print '<span class="ok">'.$langs->trans("LDAPSynchroOK").'</span><br>';
|
||||
} else {
|
||||
print img_picto('', 'error').' ';
|
||||
print '<font class="error">'.$langs->trans("LDAPSynchroKOMayBePermissions");
|
||||
print '<span class="error">'.$langs->trans("LDAPSynchroKOMayBePermissions");
|
||||
print ': '.$ldap->error;
|
||||
print '</font><br>';
|
||||
print '</span><br>';
|
||||
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'<br>';
|
||||
}
|
||||
|
||||
@ -336,9 +336,9 @@ if (function_exists("ldap_connect")) {
|
||||
print "\n<br>";
|
||||
} else {
|
||||
print img_picto('', 'error').' ';
|
||||
print '<font class="error">'.$langs->trans("LDAPSynchroKO");
|
||||
print '<span class="error">'.$langs->trans("LDAPSynchroKO");
|
||||
print ': '.$ldap->error;
|
||||
print '</font><br>';
|
||||
print '</span><br>';
|
||||
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'<br>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -260,12 +260,12 @@ if (function_exists("ldap_connect")) {
|
||||
|
||||
if ($result2 > 0) {
|
||||
print img_picto('', 'info').' ';
|
||||
print '<font class="ok">'.$langs->trans("LDAPSynchroOK").'</font><br>';
|
||||
print '<span class="ok">'.$langs->trans("LDAPSynchroOK").'</span><br>';
|
||||
} else {
|
||||
print img_picto('', 'error').' ';
|
||||
print '<font class="error">'.$langs->trans("LDAPSynchroKOMayBePermissions");
|
||||
print '<span class="error">'.$langs->trans("LDAPSynchroKOMayBePermissions");
|
||||
print ': '.$ldap->error;
|
||||
print '</font><br>';
|
||||
print '</span><br>';
|
||||
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'<br>';
|
||||
}
|
||||
|
||||
@ -275,9 +275,9 @@ if (function_exists("ldap_connect")) {
|
||||
print "\n<br>";
|
||||
} else {
|
||||
print img_picto('', 'error').' ';
|
||||
print '<font class="error">'.$langs->trans("LDAPSynchroKO");
|
||||
print '<span class="error">'.$langs->trans("LDAPSynchroKO");
|
||||
print ': '.$ldap->error;
|
||||
print '</font><br>';
|
||||
print '</span><br>';
|
||||
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'<br>';
|
||||
}
|
||||
}
|
||||
@ -331,9 +331,9 @@ if (function_exists("ldap_connect")) {
|
||||
print "\n<br>";
|
||||
} else {
|
||||
print img_picto('', 'error').' ';
|
||||
print '<font class="error">'.$langs->trans("LDAPSynchroKO");
|
||||
print '<span class="error">'.$langs->trans("LDAPSynchroKO");
|
||||
print ': '.$ldap->error;
|
||||
print '</font><br>';
|
||||
print '</span><br>';
|
||||
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'<br>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -472,12 +472,12 @@ if (function_exists("ldap_connect")) {
|
||||
|
||||
if ($result2 > 0) {
|
||||
print img_picto('', 'info').' ';
|
||||
print '<font class="ok">'.$langs->trans("LDAPSynchroOK").'</font><br>';
|
||||
print '<span class="ok">'.$langs->trans("LDAPSynchroOK").'</span><br>';
|
||||
} else {
|
||||
print img_picto('', 'error').' ';
|
||||
print '<font class="error">'.$langs->trans("LDAPSynchroKOMayBePermissions");
|
||||
print '<span class="error">'.$langs->trans("LDAPSynchroKOMayBePermissions");
|
||||
print ': '.$ldap->error;
|
||||
print '</font><br>';
|
||||
print '</span><br>';
|
||||
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'<br>';
|
||||
}
|
||||
|
||||
@ -487,9 +487,9 @@ if (function_exists("ldap_connect")) {
|
||||
print "\n<br>";
|
||||
} else {
|
||||
print img_picto('', 'error').' ';
|
||||
print '<font class="error">'.$langs->trans("LDAPSynchroKO");
|
||||
print '<span class="error">'.$langs->trans("LDAPSynchroKO");
|
||||
print ': '.$ldap->error;
|
||||
print '</font><br>';
|
||||
print '</span><br>';
|
||||
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'<br>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -223,12 +223,12 @@ if (function_exists("ldap_connect")) {
|
||||
|
||||
if ($result2 > 0) {
|
||||
print img_picto('', 'info').' ';
|
||||
print '<font class="ok">'.$langs->trans("LDAPSynchroOK").'</font><br>';
|
||||
print '<span class="ok">'.$langs->trans("LDAPSynchroOK").'</span><br>';
|
||||
} else {
|
||||
print img_picto('', 'error').' ';
|
||||
print '<font class="error">'.$langs->trans("LDAPSynchroKOMayBePermissions");
|
||||
print '<span class="error">'.$langs->trans("LDAPSynchroKOMayBePermissions");
|
||||
print ': '.$ldap->error;
|
||||
print '</font><br>';
|
||||
print '</span><br>';
|
||||
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'<br>';
|
||||
}
|
||||
|
||||
@ -238,9 +238,9 @@ if (function_exists("ldap_connect")) {
|
||||
print "\n<br>";
|
||||
} else {
|
||||
print img_picto('', 'error').' ';
|
||||
print '<font class="error">'.$langs->trans("LDAPSynchroKO");
|
||||
print '<span class="error">'.$langs->trans("LDAPSynchroKO");
|
||||
print ': '.$ldap->error;
|
||||
print '</font><br>';
|
||||
print '</span><br>';
|
||||
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'<br>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -444,12 +444,12 @@ if (function_exists("ldap_connect")) {
|
||||
|
||||
if ($result2 > 0) {
|
||||
print img_picto('', 'info').' ';
|
||||
print '<font class="ok">'.$langs->trans("LDAPSynchroOK").'</font><br>';
|
||||
print '<span class="ok">'.$langs->trans("LDAPSynchroOK").'</span><br>';
|
||||
} else {
|
||||
print img_picto('', 'error').' ';
|
||||
print '<font class="error">'.$langs->trans("LDAPSynchroKOMayBePermissions");
|
||||
print '<span class="error">'.$langs->trans("LDAPSynchroKOMayBePermissions");
|
||||
print ': '.$ldap->error;
|
||||
print '</font><br>';
|
||||
print '</span><br>';
|
||||
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'<br>';
|
||||
}
|
||||
|
||||
@ -459,9 +459,9 @@ if (function_exists("ldap_connect")) {
|
||||
print "\n<br>";
|
||||
} else {
|
||||
print img_picto('', 'error').' ';
|
||||
print '<font class="error">'.$langs->trans("LDAPSynchroKO");
|
||||
print '<span class="error">'.$langs->trans("LDAPSynchroKO");
|
||||
print ': '.$ldap->error;
|
||||
print '</font><br>';
|
||||
print '</span><br>';
|
||||
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'<br>';
|
||||
}
|
||||
}
|
||||
@ -530,9 +530,9 @@ if (function_exists("ldap_connect")) {
|
||||
print "\n<br>";
|
||||
} else {
|
||||
print img_picto('', 'error').' ';
|
||||
print '<font class="error">'.$langs->trans("LDAPSynchroKO");
|
||||
print '<span class="error">'.$langs->trans("LDAPSynchroKO");
|
||||
print ': '.$ldap->error;
|
||||
print '</font><br>';
|
||||
print '</span><br>';
|
||||
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'<br>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -190,7 +190,7 @@ if ($action == 'edit') {
|
||||
print '</div>';
|
||||
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit'.(!empty($currencycode) ? '¤cycode='.$currencycode : '').'">'.$langs->trans("Modify").'</a>';
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().''.(!empty($currencycode) ? '¤cycode='.$currencycode : '').'">'.$langs->trans("Modify").'</a>';
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
|
||||
@ -784,7 +784,7 @@ if ($action == 'edit') {
|
||||
// Actions button
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>';
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a>';
|
||||
|
||||
if (empty($conf->global->MAIN_DISABLE_ALL_MAILS)) {
|
||||
if ($conf->global->MAIN_MAIL_SENDMODE != 'mail' || !$linuxlike) {
|
||||
|
||||
@ -515,7 +515,7 @@ if ($action == 'edit') {
|
||||
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>';
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a>';
|
||||
|
||||
if (!empty($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && $conf->global->MAIN_MAIL_SENDMODE_EMAILING != 'default') {
|
||||
if ($conf->global->MAIN_MAIL_SENDMODE_EMAILING != 'mail' || !$linuxlike) {
|
||||
|
||||
@ -632,7 +632,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
|
||||
if ($sortorder) {
|
||||
$url .= '&page='.urlencode($sortorder);
|
||||
}
|
||||
print '<a class="editfielda reposition marginrightonly marginleftonly" href="'.$url.'&action=edit&rowid='.$obj->rowid.'">'.img_edit().'</a>';
|
||||
print '<a class="editfielda reposition marginrightonly marginleftonly" href="'.$url.'&action=edit&token='.newToken().'&rowid='.$obj->rowid.'">'.img_edit().'</a>';
|
||||
//print ' ';
|
||||
print '<a class=" marginrightonly marginleftonly" href="'.$url.'&action=delete&token='.newToken().'">'.img_delete().'</a> ';
|
||||
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||
|
||||
@ -160,6 +160,7 @@ if (empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) {
|
||||
|
||||
$tabhelp = array();
|
||||
$tabhelp[25] = array(
|
||||
'label'=>$langs->trans('EnterAnyCode'),
|
||||
'topic'=>'<span class="small">'.$helpsubstit.'</span>',
|
||||
'joinfiles'=>$langs->trans('AttachMainDocByDefault'),
|
||||
'content'=>'<span class="small">'.$helpsubstit.'</span>',
|
||||
@ -683,8 +684,8 @@ if ($action == 'view') {
|
||||
|
||||
$tmpaction = 'create';
|
||||
$parameters = array(
|
||||
'fieldlist' => $fieldlist,
|
||||
'tabname' => $tabname[$id]
|
||||
'fieldlist' => $fieldlist,
|
||||
'tabname' => $tabname[$id]
|
||||
);
|
||||
$reshook = $hookmanager->executeHooks('createEmailTemplateFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
||||
$error = $hookmanager->error;
|
||||
@ -822,7 +823,7 @@ if ($resql) {
|
||||
print '</td>';
|
||||
} elseif ($value == 'fk_user') {
|
||||
print '<td class="liste_titre">';
|
||||
print $form->select_dolusers($search_fk_user, 'search_fk_user', 1, null, 0, ($user->admin ? '' : 'hierarchyme'), null, 0, 0, 1, '', 0, '', 'maxwidth150');
|
||||
print $form->select_dolusers($search_fk_user, 'search_fk_user', 1, null, 0, ($user->admin ? '' : 'hierarchyme'), null, 0, 0, 0, '', 0, '', 'maxwidth150');
|
||||
print '</td>';
|
||||
} elseif ($value == 'topic') {
|
||||
print '<td class="liste_titre"><input type="text" name="search_topic" value="'.dol_escape_htmltag($search_topic).'"></td>';
|
||||
@ -1187,7 +1188,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
|
||||
if ($value == 'fk_user') {
|
||||
print '<td>';
|
||||
if ($user->admin) {
|
||||
print $form->select_dolusers(empty($obj->{$value}) ? '' : $obj->{$value}, 'fk_user', 1, null, 0, ($user->admin ? '' : 'hierarchyme'), null, 0, 0, 1, '', 0, '', 'maxwidth200');
|
||||
print $form->select_dolusers(empty($obj->{$value}) ? '' : $obj->{$value}, 'fk_user', 1, null, 0, ($user->admin ? '' : 'hierarchyme'), null, 0, 0, 0, '', 0, '', 'minwidth150 maxwidth300');
|
||||
} else {
|
||||
if ($context == 'add') { // I am not admin and we show the add form
|
||||
print $user->getNomUrl(1); // Me
|
||||
|
||||
@ -479,7 +479,7 @@ if ($action == 'edit') {
|
||||
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>';
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a>';
|
||||
|
||||
if (!empty($conf->global->MAIN_MAIL_SENDMODE_TICKET) && $conf->global->MAIN_MAIL_SENDMODE_TICKET != 'default') {
|
||||
if ($conf->global->MAIN_MAIL_SENDMODE_TICKET != 'mail' || !$linuxlike) {
|
||||
|
||||
@ -281,7 +281,7 @@ if ($action == 'create') {
|
||||
|
||||
print load_fiche_titre($langs->trans("NewMenu"), '', 'title_setup');
|
||||
|
||||
print '<form action="./edit.php?action=add&menuId='.GETPOST('menuId', 'int').'" method="post" name="formmenucreate">';
|
||||
print '<form action="'.DOL_URL_ROOT.'/admin/menus/edit.php?action=add&token='.newToken().'&menuId='.GETPOST('menuId', 'int').'" method="post" name="formmenucreate">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
|
||||
print dol_get_fiche_head();
|
||||
|
||||
@ -133,7 +133,7 @@ if ($action == 'install') {
|
||||
|
||||
// $original_file should match format module_modulename-x.y[.z].zip
|
||||
$original_file = basename($_FILES["fileinstall"]["name"]);
|
||||
$original_file = preg_replace('/\(\d+\)\.zip$/i', '.zip', $original_file);
|
||||
$original_file = preg_replace('/\s*\(\d+\)\.zip$/i', '.zip', $original_file);
|
||||
$newfile = $conf->admin->dir_temp.'/'.$original_file.'/'.$original_file;
|
||||
|
||||
if (!$original_file) {
|
||||
|
||||
@ -138,7 +138,7 @@ if ($action == 'add_currency') {
|
||||
|
||||
|
||||
$TCurrency = array();
|
||||
$sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.'multicurrency WHERE entity = '.$conf->entity;
|
||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."multicurrency WHERE entity = ".((int) $conf->entity);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
while ($obj = $db->fetch_object($resql)) {
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/admin/credtitransfer.php
|
||||
* \file htdocs/admin/paymentbybanktransfer.php
|
||||
* \ingroup paymentbybanktransfer
|
||||
* \brief Page to setup payments by credit transfer
|
||||
*/
|
||||
@ -429,7 +429,7 @@ if (! empty($conf->global->MAIN_MODULE_NOTIFICATION))
|
||||
}
|
||||
|
||||
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?action=addnotif">';
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?action=addnotif&token='.newToken().'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
@ -307,7 +307,7 @@ for ($i = 1; $i <= 6; $i++) {
|
||||
$pid = false;
|
||||
}
|
||||
} else {
|
||||
$pid = img_warning().' <font class="error">'.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).'</font>';
|
||||
$pid = img_warning().' <span class="error">'.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).'</span>';
|
||||
}
|
||||
if ($pid) {
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("ShowProfIdInAddress").' - '.$pid.'</td><td>';
|
||||
|
||||
@ -236,7 +236,7 @@ if ($result) {
|
||||
print '</td>';
|
||||
} else {
|
||||
print '<td class="center">';
|
||||
print '<a class="reposition" href="perms.php?pid='.$obj->id.'&action=add">';
|
||||
print '<a class="reposition" href="perms.php?pid='.$obj->id.'&action=add&token='.newToken().'">';
|
||||
//print img_edit_add();
|
||||
print img_picto('', 'switch_off');
|
||||
print '</a>';
|
||||
|
||||
@ -443,7 +443,7 @@ if (! empty($conf->global->MAIN_MODULE_NOTIFICATION))
|
||||
}
|
||||
|
||||
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?action=addnotif">';
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?action=addnotif&token='.newToken().'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
@ -183,7 +183,7 @@ if ($action == 'edit') {
|
||||
if (count($listofmethods)) {
|
||||
print $form->selectarray('MAIN_SMS_SENDMODE', $listofmethods, $conf->global->MAIN_SMS_SENDMODE, 1);
|
||||
} else {
|
||||
print '<font class="error">'.$langs->trans("None").'</font>';
|
||||
print '<span class="error">'.$langs->trans("None").'</span>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
@ -132,6 +132,8 @@ if ($action == 'updateMask') {
|
||||
if ($ret > 0) {
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
}
|
||||
} elseif ($action == 'unsetdoc') {
|
||||
dolibarr_del_const($db, "COMMANDE_SUPPLIER_ADDON_PDF", $conf->entity);
|
||||
} elseif ($action == 'setmod') {
|
||||
// TODO Verifier si module numerotation choisi peut etre active
|
||||
// par appel methode canBeActivated
|
||||
@ -397,7 +399,8 @@ foreach ($dirmodels as $reldir) {
|
||||
// Default
|
||||
print '<td class="center">';
|
||||
if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF == "$name") {
|
||||
print img_picto($langs->trans("Default"), 'on');
|
||||
// print img_picto($langs->trans("Default"), 'on');
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=unsetdoc&token='.newToken().'&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'&type=order_supplier"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
|
||||
} else {
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'&type=order_supplier" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
||||
}
|
||||
|
||||
@ -89,6 +89,8 @@ if ($action == 'updateMask') {
|
||||
if ($ret > 0) {
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
}
|
||||
} elseif ($action == 'unsetdoc') {
|
||||
dolibarr_del_const($db, "SUPPLIER_PAYMENT_ADDON_PDF", $conf->entity);
|
||||
} elseif ($action == 'specimen') {
|
||||
$modele = GETPOST('module', 'alpha');
|
||||
|
||||
|
||||
@ -51,7 +51,7 @@ if ($action == 'getlastversion') {
|
||||
$result = getURLContent('https://sourceforge.net/projects/dolibarr/rss');
|
||||
//var_dump($result['content']);
|
||||
if (function_exists('simplexml_load_string')) {
|
||||
$sfurl = simplexml_load_string($result['content']);
|
||||
$sfurl = simplexml_load_string($result['content'], 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET);
|
||||
} else {
|
||||
setEventMessages($langs->trans("ErrorPHPDoesNotSupport", "xml"), null, 'errors');
|
||||
}
|
||||
|
||||
@ -171,7 +171,7 @@ if (GETPOST('target') == 'remote') {
|
||||
if (!$xmlarray['curl_error_no'] && $xmlarray['http_code'] != '400' && $xmlarray['http_code'] != '404') {
|
||||
$xmlfile = $xmlarray['content'];
|
||||
//print "xmlfilestart".$xmlfile."xmlfileend";
|
||||
$xml = simplexml_load_string($xmlfile);
|
||||
$xml = simplexml_load_string($xmlfile, 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET);
|
||||
} else {
|
||||
$errormsg = $langs->trans('XmlNotFound').': '.$xmlremote.' - '.$xmlarray['http_code'].(($xmlarray['http_code'] == 400 && $xmlarray['content']) ? ' '.$xmlarray['content'] : '').' '.$xmlarray['curl_error_no'].' '.$xmlarray['curl_error_msg'];
|
||||
setEventMessages($errormsg, null, 'errors');
|
||||
|
||||
@ -91,6 +91,7 @@ $modules_files = array();
|
||||
$modules_fullpath = array();
|
||||
$modulesdir = dolGetModulesDirs();
|
||||
$rights_ids = array();
|
||||
$arrayofpermissions = array();
|
||||
|
||||
foreach ($modulesdir as $dir) {
|
||||
$handle = @opendir(dol_osencode($dir));
|
||||
@ -155,7 +156,7 @@ foreach ($modules as $key => $module) {
|
||||
if (empty($rights[0])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$arrayofpermissions[$rights[0]] = array('label'=> 'user->rights->'.$module->rights_class.'->'.$rights[4].(empty($rights[5]) ? '' : '->'.$rights[5]));
|
||||
$permission[] = $rights[0];
|
||||
|
||||
array_push($rights_ids, $rights[0]);
|
||||
@ -336,8 +337,10 @@ foreach ($moduleList as $module) {
|
||||
$idperms = '';
|
||||
|
||||
foreach ($module->permission as $permission) {
|
||||
$idperms .= ($idperms ? ", " : "").$permission;
|
||||
$translationKey = "Permission".$permission;
|
||||
$labelpermission = $langs->trans($translationKey);
|
||||
$labelpermission .= ' : '.$arrayofpermissions[$permission]['label'];
|
||||
$idperms .= ($idperms ? ", " : "").'<span title="'.$labelpermission.'">'.$permission.'</a>';
|
||||
|
||||
if (!empty($conf->global->MAIN_SHOW_PERMISSION)) {
|
||||
if (empty($langs->tab_translate[$translationKey])) {
|
||||
|
||||
@ -63,7 +63,7 @@ print '<br>';
|
||||
print '<strong>'.$langs->trans("XDebug").'</strong>: ';
|
||||
$test = !function_exists('xdebug_is_enabled');
|
||||
if ($test) {
|
||||
print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled").' - '.$langs->trans("NotSlowedDownByThis");
|
||||
print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled").' <span class="opacitymedium">'.$langs->trans("NotSlowedDownByThis").'</span>';
|
||||
} else {
|
||||
print img_picto('', 'warning').' '.$langs->trans("ModuleActivated", $langs->transnoentities("XDebug"));
|
||||
print ' - '.$langs->trans("MoreInformation").' <a href="'.DOL_URL_ROOT.'/admin/system/xdebug.php">XDebug admin page</a>';
|
||||
|
||||
@ -98,7 +98,7 @@ if (!ini_get('session.cookie_samesite') || ini_get('session.cookie_samesite') ==
|
||||
print ' '.img_warning().' <span class="opacitymedium">'.$langs->trans("WarningPaypalPaymentNotCompatibleWithStrict")."</span>";
|
||||
}
|
||||
print "<br>\n";
|
||||
print "<strong>PHP open_basedir</strong> = ".(ini_get('open_basedir') ? ini_get('open_basedir') : yn(0).' <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("ARestrictedPath").', '.$langs->transnoentitiesnoconv("Example").' '.$_SERVER["DOCUMENT_ROOT"]).')</span>')."<br>\n";
|
||||
print "<strong>PHP open_basedir</strong> = ".(ini_get('open_basedir') ? ini_get('open_basedir') : yn(0).' <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("ARestrictedPath").', '.$langs->transnoentitiesnoconv("Example").': '.$_SERVER["DOCUMENT_ROOT"].','.DOL_DATA_ROOT).')</span>')."<br>\n";
|
||||
print "<strong>PHP allow_url_fopen</strong> = ".(ini_get('allow_url_fopen') ? img_picto($langs->trans("YouShouldSetThisToOff"), 'warning').' '.ini_get('allow_url_fopen') : yn(0)).' <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("No")).")</span><br>\n";
|
||||
print "<strong>PHP allow_url_include</strong> = ".(ini_get('allow_url_include') ? img_picto($langs->trans("YouShouldSetThisToOff"), 'warning').' '.ini_get('allow_url_include') : yn(0)).' <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("No")).")</span><br>\n";
|
||||
//print "<strong>PHP safe_mode</strong> = ".(ini_get('safe_mode') ? ini_get('safe_mode') : yn(0)).' <span class="opacitymedium">'.$langs->trans("Deprecated")." (removed in PHP 5.4)</span><br>\n";
|
||||
@ -258,6 +258,8 @@ print '<br>';
|
||||
print '<strong>$dolibarr_nocsrfcheck</strong>: '.(empty($dolibarr_nocsrfcheck) ? '0' : $dolibarr_nocsrfcheck);
|
||||
if (!empty($dolibarr_nocsrfcheck)) {
|
||||
print ' '.img_picto('', 'warning').' '.$langs->trans("IfYouAreOnAProductionSetThis", 0);
|
||||
} else {
|
||||
print ' <span class="opacitymedium">('.$langs->trans("Recommended").': 0)</span>';
|
||||
}
|
||||
print '<br>';
|
||||
|
||||
@ -391,7 +393,7 @@ if (empty($conf->api->enabled) && empty($conf->webservices->enabled)) {
|
||||
print '<br>';
|
||||
}
|
||||
if (!empty($conf->api->enabled)) {
|
||||
print '<strong>API_ENDPOINT_RULES</strong> = '.(empty($conf->global->API_ENDPOINT_RULES) ? '<span class="opacitymedium">'.$langs->trans("Undefined").' ('.$langs->trans("Example").': endpoint1:1,endpoint2:1,...)</span>' : $conf->global->API_ENDPOINT_RULES)."<br>\n";
|
||||
print '<strong>API_ENDPOINT_RULES</strong> = '.(empty($conf->global->API_ENDPOINT_RULES) ? '<span class="opacitymedium">'.$langs->trans("Undefined").' ('.$langs->trans("Example").': login:0,users:0,setup:1,status:1,tickets:1,...)</span>' : $conf->global->API_ENDPOINT_RULES)."<br>\n";
|
||||
print '<br>';
|
||||
}
|
||||
}
|
||||
@ -442,7 +444,7 @@ print '<br>';
|
||||
print '<strong>MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES</strong> = '.(empty($conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES) ? '<span class="opacitymedium">'.$langs->trans("Undefined").' ('.$langs->trans("Recommended").': 1)</span>' : $conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES)."<br>";
|
||||
print '<br>';
|
||||
|
||||
print '<strong>MAIN_SECURITY_CSRF_WITH_TOKEN</strong> = '.(empty($conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN) ? '<span class="opacitymedium">'.$langs->trans("Undefined").' ('.$langs->trans("Recommended").': 1)</span>' : $conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN)."<br>";
|
||||
print '<strong>MAIN_SECURITY_CSRF_WITH_TOKEN</strong> = '.(empty($conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN) ? '<span class="opacitymedium">'.$langs->trans("Undefined").' ('.$langs->trans("Recommended").': 2)</span>' : $conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN)."<br>";
|
||||
print '<br>';
|
||||
|
||||
print '<strong>MAIN_SECURITY_CSRF_TOKEN_RENEWAL_ON_EACH_CALL</strong> = '.(empty($conf->global->MAIN_SECURITY_CSRF_TOKEN_RENEWAL_ON_EACH_CALL) ? '<span class="opacitymedium">'.$langs->trans("Undefined").' ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or").' 0)</span>' : $conf->global->MAIN_SECURITY_CSRF_TOKEN_RENEWAL_ON_EACH_CALL)."<br>";
|
||||
|
||||
@ -513,7 +513,7 @@ if (!empty($_SESSION["commandbackuplastdone"])) {
|
||||
$_SESSION["commandbackupresult"] = '';
|
||||
}
|
||||
if (!empty($_SESSION["commandbackuptorun"])) {
|
||||
print '<br><font class="warning">'.$langs->trans("YouMustRunCommandFromCommandLineAfterLoginToUser", $dolibarr_main_db_user, $dolibarr_main_db_user).':</font><br>'."\n";
|
||||
print '<br><span class="warning">'.$langs->trans("YouMustRunCommandFromCommandLineAfterLoginToUser", $dolibarr_main_db_user, $dolibarr_main_db_user).':</span><br>'."\n";
|
||||
print '<textarea id="commandbackuptoruntext" rows="'.ROWS_2.'" class="centpercent">'.$_SESSION["commandbackuptorun"].'</textarea><br>'."\n";
|
||||
print ajax_autoselect("commandbackuptoruntext", 0);
|
||||
print '<br>';
|
||||
|
||||
@ -110,7 +110,7 @@ if (!empty($conf->syslog->enabled)) {
|
||||
|
||||
print '<input type="radio" name="choice" id="choicetempfiles" value="tempfiles"';
|
||||
print (!$choice || $choice == 'tempfiles' || $choice == 'allfiles') ? ' checked' : '';
|
||||
print '> <label for="choicetempfiles">'.$langs->trans("PurgeDeleteTemporaryFiles").'</label><br><br>';
|
||||
print '> <label for="choicetempfiles">'.$langs->trans("PurgeDeleteTemporaryFilesShort").'</label><br><br>';
|
||||
|
||||
print '<input type="radio" name="choice" id="choiceallfiles" value="confirm_allfiles"';
|
||||
print ($choice && $choice == 'confirm_allfiles') ? ' checked' : '';
|
||||
|
||||
@ -61,7 +61,7 @@ $version = '0.0';
|
||||
if ($action == 'getlastversion') {
|
||||
$result = getURLContent('https://sourceforge.net/projects/dolibarr/rss');
|
||||
//var_dump($result['content']);
|
||||
$sfurl = simplexml_load_string($result['content']);
|
||||
$sfurl = simplexml_load_string($result['content'], 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -358,7 +358,7 @@ if ($mode == 'overwrite') {
|
||||
print ' ';
|
||||
print '<input type="submit" class="button buttongen button-cancel" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'">';
|
||||
} else {
|
||||
print '<a class="reposition editfielda paddingrightonly" href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$obj->entity.'&mode='.urlencode($mode).'&action=edit'.((empty($user->entity) && $debug) ? '&debug=1' : '').'">'.img_edit().'</a>';
|
||||
print '<a class="reposition editfielda paddingrightonly" href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$obj->entity.'&mode='.urlencode($mode).'&action=edit&token='.newToken().''.((empty($user->entity) && $debug) ? '&debug=1' : '').'">'.img_edit().'</a>';
|
||||
print ' ';
|
||||
print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$obj->entity.'&mode='.urlencode($mode).'&action=delete&token='.newToken().((empty($user->entity) && $debug) ? '&debug=1' : '').'">'.img_delete().'</a>';
|
||||
}
|
||||
@ -545,9 +545,9 @@ if ($mode == 'searchkey') {
|
||||
if ($result) {
|
||||
$obj = $db->fetch_object($result);
|
||||
}
|
||||
print '<a class="editfielda reposition marginrightonly" href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$conf->entity.'&mode=overwrite&action=edit">'.img_edit().'</a>';
|
||||
print '<a class="editfielda reposition marginrightonly" href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$conf->entity.'&mode=overwrite&action=edit&token='.newToken().'">'.img_edit().'</a>';
|
||||
print ' ';
|
||||
print '<a class="marginleftonly marginrightonly" href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$conf->entity.'&mode='.urlencode($mode).'&action=delete&mode='.urlencode($mode).'&token='.newToken().'">'.img_delete().'</a>';
|
||||
print '<a class="marginleftonly marginrightonly" href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$conf->entity.'&mode='.urlencode($mode).'&action=delete&token='.newToken().'&mode='.urlencode($mode).'">'.img_delete().'</a>';
|
||||
print ' ';
|
||||
$htmltext = $langs->trans("OriginalValueWas", '<i>'.$newlangfileonly->tab_translate[$key].'</i>');
|
||||
print $form->textwithpicto('', $htmltext, 1, 'info');
|
||||
@ -574,9 +574,9 @@ if ($mode == 'searchkey') {
|
||||
if ($result) {
|
||||
$obj = $db->fetch_object($result);
|
||||
}
|
||||
print '<a class="editfielda reposition marginrightonly" href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$conf->entity.'&mode=overwrite&action=edit">'.img_edit().'</a>';
|
||||
print '<a class="editfielda reposition marginrightonly" href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$conf->entity.'&mode=overwrite&action=edit&token='.newToken().'">'.img_edit().'</a>';
|
||||
print ' ';
|
||||
print '<a class="marginleftonly marginrightonly" href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$conf->entity.'&mode='.urlencode($mode).'&action=delete&mode='.urlencode($mode).'&token='.newToken().'">'.img_delete().'</a>';
|
||||
print '<a class="marginleftonly marginrightonly" href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$conf->entity.'&mode='.urlencode($mode).'&action=delete&token='.newToken().'&mode='.urlencode($mode).'">'.img_delete().'</a>';
|
||||
print ' ';
|
||||
|
||||
$htmltext = $langs->trans("TransKeyWithoutOriginalValue", $key);
|
||||
|
||||
@ -136,7 +136,7 @@ if ($action == 'edit') {
|
||||
print '</table>';
|
||||
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>';
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a>';
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
|
||||
@ -214,7 +214,7 @@ if ($action == 'edit') {
|
||||
print '</table>';
|
||||
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>';
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a>';
|
||||
print '</div>';
|
||||
}/* else {
|
||||
print '<br>'.$langs->trans("NothingToSetup");
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
* Copyright (C) 2017 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2017 Neil Orley <neil.orley@oeris.fr>
|
||||
* Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2018-2020 Thibault FOUCART <support@ptibogxiv.net>
|
||||
* Copyright (C) 2018-2021 Thibault FOUCART <support@ptibogxiv.net>
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -1239,7 +1239,6 @@ class Setup extends DolibarrApi
|
||||
{
|
||||
$list = array();
|
||||
|
||||
//TODO link with multicurrency module
|
||||
$sql = "SELECT t.rowid, t.code, t.label,t.short_label, t.active, t.scale, t.unit_type";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."c_units as t";
|
||||
$sql .= " WHERE t.active = ".((int) $active);
|
||||
@ -1279,6 +1278,126 @@ class Setup extends DolibarrApi
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of legal form of business.
|
||||
*
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Number of items per page
|
||||
* @param int $page Page number (starting from zero)
|
||||
* @param string $country To filter on country
|
||||
* @param int $active Lega form is active or not {@min 0} {@max 1}
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"
|
||||
* @return array List of legal form
|
||||
*
|
||||
* @url GET dictionary/legal_form
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
public function getListOfLegalForm($sortfield = "rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $country = '', $active = 1, $sqlfilters = '')
|
||||
{
|
||||
$list = array();
|
||||
|
||||
$sql = "SELECT t.rowid, t.code, t.fk_pays, t.libelle, t.isvatexempted, t.active, t.module, t.position";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."c_forme_juridique as t";
|
||||
$sql .= " WHERE t.active = ".((int) $active);
|
||||
if ($country) {
|
||||
$sql .= " AND t.fk_pays = '".$this->db->escape($country)."'";
|
||||
}
|
||||
// Add sql filters
|
||||
if ($sqlfilters) {
|
||||
if (!DolibarrApi::_checkFilters($sqlfilters)) {
|
||||
throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters);
|
||||
}
|
||||
$regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^\(\)]+)\)';
|
||||
$sql .= " AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
|
||||
}
|
||||
|
||||
|
||||
$sql .= $this->db->order($sortfield, $sortorder);
|
||||
|
||||
if ($limit) {
|
||||
if ($page < 0) {
|
||||
$page = 0;
|
||||
}
|
||||
$offset = $limit * $page;
|
||||
|
||||
$sql .= $this->db->plimit($limit, $offset);
|
||||
}
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
|
||||
if ($result) {
|
||||
$num = $this->db->num_rows($result);
|
||||
$min = min($num, ($limit <= 0 ? $num : $limit));
|
||||
for ($i = 0; $i < $min; $i++) {
|
||||
$list[] = $this->db->fetch_object($result);
|
||||
}
|
||||
} else {
|
||||
throw new RestException(503, 'Error when retrieving list of legal form: '.$this->db->lasterror());
|
||||
}
|
||||
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of staff.
|
||||
*
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Number of items per page
|
||||
* @param int $page Page number (starting from zero)
|
||||
* @param int $active Staff is active or not {@min 0} {@max 1}
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"
|
||||
* @return array List of staff
|
||||
*
|
||||
* @url GET dictionary/staff
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
public function getListOfStaff($sortfield = "id", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
|
||||
{
|
||||
$list = array();
|
||||
|
||||
$sql = "SELECT t.id, t.code, t.libelle, t.active, t.module";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."c_effectif as t";
|
||||
$sql .= " WHERE t.active = ".((int) $active);
|
||||
// Add sql filters
|
||||
if ($sqlfilters) {
|
||||
if (!DolibarrApi::_checkFilters($sqlfilters)) {
|
||||
throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters);
|
||||
}
|
||||
$regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^\(\)]+)\)';
|
||||
$sql .= " AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
|
||||
}
|
||||
|
||||
|
||||
$sql .= $this->db->order($sortfield, $sortorder);
|
||||
|
||||
if ($limit) {
|
||||
if ($page < 0) {
|
||||
$page = 0;
|
||||
}
|
||||
$offset = $limit * $page;
|
||||
|
||||
$sql .= $this->db->plimit($limit, $offset);
|
||||
}
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
|
||||
if ($result) {
|
||||
$num = $this->db->num_rows($result);
|
||||
$min = min($num, ($limit <= 0 ? $num : $limit));
|
||||
for ($i = 0; $i < $min; $i++) {
|
||||
$list[] = $this->db->fetch_object($result);
|
||||
}
|
||||
} else {
|
||||
throw new RestException(503, 'Error when retrieving list of staff: '.$this->db->lasterror());
|
||||
}
|
||||
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of social networks.
|
||||
*
|
||||
@ -1683,7 +1802,7 @@ class Setup extends DolibarrApi
|
||||
if (!$xmlarray['curl_error_no'] && $xmlarray['http_code'] != '400' && $xmlarray['http_code'] != '404') {
|
||||
$xmlfile = $xmlarray['content'];
|
||||
//print "xmlfilestart".$xmlfile."endxmlfile";
|
||||
$xml = simplexml_load_string($xmlfile);
|
||||
$xml = simplexml_load_string($xmlfile, 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET);
|
||||
} else {
|
||||
$errormsg = $langs->trans('XmlNotFound').': '.$xmlremote.' - '.$xmlarray['http_code'].(($xmlarray['http_code'] == 400 && $xmlarray['content']) ? ' '.$xmlarray['content'] : '').' '.$xmlarray['curl_error_no'].' '.$xmlarray['curl_error_msg'];
|
||||
throw new RestException(500, $errormsg);
|
||||
|
||||
@ -98,7 +98,7 @@ if ($action == 'edit') {
|
||||
print '</table>';
|
||||
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>';
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a>';
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
|
||||
@ -298,7 +298,7 @@ if (!$rowid && $action != 'create' && $action != 'edit') {
|
||||
print '</td>';
|
||||
|
||||
if ($user->rights->asset->write) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=edit&rowid='.$objp->rowid.'">'.img_edit().'</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'&rowid='.$objp->rowid.'">'.img_edit().'</a></td>';
|
||||
} else {
|
||||
print '<td class="right"> </td>';
|
||||
}
|
||||
@ -503,7 +503,7 @@ if ($rowid > 0) {
|
||||
|
||||
// Edit
|
||||
if ($user->rights->asset->write) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit&rowid='.((int) $object->id).'">'.$langs->trans("Modify").'</a></div>';
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit&token='.newToken().'&rowid='.((int) $object->id).'">'.$langs->trans("Modify").'</a></div>';
|
||||
}
|
||||
|
||||
// Delete
|
||||
|
||||
@ -274,7 +274,7 @@ if ($conf->product->enabled || $conf->product->service) {
|
||||
} else {
|
||||
$disabled = 1;
|
||||
$titleno = $langs->trans("NoBarcodeNumberingTemplateDefined");
|
||||
print '<font class="warning">'.$langs->trans("NoBarcodeNumberingTemplateDefined").'</font> (<a href="'.DOL_URL_ROOT.'/admin/barcode.php">'.$langs->trans("ToGenerateCodeDefineAutomaticRuleFirst").'</a>)<br>';
|
||||
print '<span class="warning">'.$langs->trans("NoBarcodeNumberingTemplateDefined").'</span> (<a href="'.DOL_URL_ROOT.'/admin/barcode.php">'.$langs->trans("ToGenerateCodeDefineAutomaticRuleFirst").'</a>)<br>';
|
||||
}
|
||||
if (empty($nbno)) {
|
||||
$disabled1 = 1;
|
||||
|
||||
@ -75,6 +75,7 @@ if ($object->id > 0) {
|
||||
$object->calculateCosts();
|
||||
}
|
||||
|
||||
|
||||
// Security check - Protection if external user
|
||||
//if ($user->socid > 0) accessforbidden();
|
||||
//if ($user->socid > 0) $socid = $user->socid;
|
||||
@ -115,8 +116,13 @@ if (empty($reshook)) {
|
||||
|
||||
$triggermodname = 'BOM_MODIFY'; // Name of trigger action code to execute when we modify record
|
||||
|
||||
|
||||
// Actions cancel, add, update, delete or clone
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
|
||||
// The fetch/fetch_lines was redone into the inc.php so we must recall the calculateCosts()
|
||||
if ($action == 'confirm_validate' && $object->id > 0) {
|
||||
$object->calculateCosts();
|
||||
}
|
||||
|
||||
// Actions when linking object each other
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php';
|
||||
|
||||
@ -121,7 +121,7 @@ if ($this->status == 0 && ($object_rights->write) && $action != 'selectlines') {
|
||||
$coldisplay++;
|
||||
if (($line->info_bits & 2) == 2 || !empty($disableedit)) {
|
||||
} else {
|
||||
print '<a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$this->id.'&action=editline&lineid='.$line->id.'">'.img_edit().'</a>';
|
||||
print '<a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$this->id.'&action=editline&token='.newToken().'&lineid='.$line->id.'">'.img_edit().'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
@ -231,7 +231,7 @@ if ($object->id) {
|
||||
|
||||
// On propose la generation de la vignette si elle n'existe pas et si la taille est superieure aux limites
|
||||
if (!$obj['photo_vignette'] && preg_match('/(\.bmp|\.gif|\.jpg|\.jpeg|\.png)$/i', $obj['photo']) && ($object->imgWidth > $maxWidth || $object->imgHeight > $maxHeight)) {
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=addthumb&type='.$type.'&file='.urlencode($pdir.$viewfilename).'">'.img_picto($langs->trans('GenerateThumb'), 'refresh').' </a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&token='.newToken().'&action=addthumb&type='.$type.'&file='.urlencode($pdir.$viewfilename).'">'.img_picto($langs->trans('GenerateThumb'), 'refresh').' </a>';
|
||||
}
|
||||
if ($user->rights->categorie->creer) {
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken().'&type='.$type.'&file='.urlencode($pdir.$viewfilename).'">';
|
||||
|
||||
@ -231,9 +231,9 @@ print "\n<div class=\"tabsAction\">\n";
|
||||
|
||||
if ($action == '') {
|
||||
if ($user->rights->produit->creer || $user->rights->service->creer) {
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=add&id='.$object->id.'&type='.$type.'">'.$langs->trans('Add').'</a>';
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=add&token='.newToken().'&id='.$object->id.'&type='.$type.'">'.$langs->trans('Add').'</a>';
|
||||
if ($cnt_trans > 0) {
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit&id='.$object->id.'&type='.$type.'">'.$langs->trans('Update').'</a>';
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit&token='.newToken().'&id='.$object->id.'&type='.$type.'">'.$langs->trans('Update').'</a>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1688,7 +1688,7 @@ if ($id > 0) {
|
||||
print img_picto('', 'project', 'class="paddingrightonly"');
|
||||
$numprojet = $formproject->select_projects(($object->socid > 0 ? $object->socid : -1), $object->fk_project, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, 'maxwidth500');
|
||||
if ($numprojet == 0) {
|
||||
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$object->socid.'&action=create&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit').'"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans("AddProject").'"></span></a>';
|
||||
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$object->socid.'&action=create&token='.newToken().'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit').'"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans("AddProject").'"></span></a>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
@ -2168,7 +2168,7 @@ if ($id > 0) {
|
||||
if ($action != 'edit') {
|
||||
if ($user->rights->agenda->allactions->create ||
|
||||
(($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create)) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?action=edit&id='.$object->id.'">'.$langs->trans("Modify").'</a></div>';
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?action=edit&token='.newToken().'&id='.$object->id.'">'.$langs->trans("Modify").'</a></div>';
|
||||
} else {
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans("Modify").'</a></div>';
|
||||
}
|
||||
|
||||
@ -865,6 +865,7 @@ class ActionComm extends CommonObject
|
||||
$this->fetchResources();
|
||||
}
|
||||
}
|
||||
|
||||
$this->db->free($resql);
|
||||
} else {
|
||||
$this->error = $this->db->lasterror();
|
||||
@ -1245,7 +1246,6 @@ class ActionComm extends CommonObject
|
||||
* Load all objects with filters.
|
||||
* @todo WARNING: This make a fetch on all records instead of making one request with a join.
|
||||
*
|
||||
* @param DoliDb $db Not used
|
||||
* @param int $socid Filter by thirdparty
|
||||
* @param int $fk_element Id of element action is linked to
|
||||
* @param string $elementtype Type of element action is linked to
|
||||
@ -1255,7 +1255,7 @@ class ActionComm extends CommonObject
|
||||
* @param string $limit Limit number of answers
|
||||
* @return array|string Error string if KO, array with actions if OK
|
||||
*/
|
||||
public static function getActions($db, $socid = 0, $fk_element = 0, $elementtype = '', $filter = '', $sortfield = 'a.datep', $sortorder = 'DESC', $limit = 0)
|
||||
public function getActions($socid = 0, $fk_element = 0, $elementtype = '', $filter = '', $sortfield = 'a.datep', $sortorder = 'DESC', $limit = 0)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
@ -1277,33 +1277,33 @@ class ActionComm extends CommonObject
|
||||
$sql .= " (SELECT fk_actioncomm FROM ".MAIN_DB_PREFIX."actioncomm_resources WHERE";
|
||||
$sql .= " element_type = 'socpeople' AND fk_element = ".((int) $fk_element).')';
|
||||
} else {
|
||||
$sql .= " AND a.fk_element = ".((int) $fk_element)." AND a.elementtype = '".$db->escape($elementtype)."'";
|
||||
$sql .= " AND a.fk_element = ".((int) $fk_element)." AND a.elementtype = '".$this->db->escape($elementtype)."'";
|
||||
}
|
||||
}
|
||||
if (!empty($filter)) {
|
||||
$sql .= $filter;
|
||||
}
|
||||
if ($sortorder && $sortfield) {
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
$sql .= $this->db->order($sortfield, $sortorder);
|
||||
}
|
||||
$sql .= $db->plimit($limit, 0);
|
||||
$sql .= $this->db->plimit($limit, 0);
|
||||
|
||||
$resql = $db->query($sql);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $db->num_rows($resql);
|
||||
$num = $this->db->num_rows($resql);
|
||||
|
||||
if ($num) {
|
||||
for ($i = 0; $i < $num; $i++) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
$actioncommstatic = new ActionComm($db);
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
$actioncommstatic = new ActionComm($this->db);
|
||||
$actioncommstatic->fetch($obj->id);
|
||||
$resarray[$i] = $actioncommstatic;
|
||||
}
|
||||
}
|
||||
$db->free($resql);
|
||||
$this->db->free($resql);
|
||||
return $resarray;
|
||||
} else {
|
||||
return $db->lasterror();
|
||||
return $this->db->lasterror();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -351,7 +351,7 @@ if ($object->id > 0) {
|
||||
print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_client));
|
||||
$tmpcheck = $object->check_codeclient();
|
||||
if ($tmpcheck != 0 && $tmpcheck != -5) {
|
||||
print ' <font class="error">('.$langs->trans("WrongCustomerCode").')</font>';
|
||||
print ' <span class="error">('.$langs->trans("WrongCustomerCode").')</span>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
@ -406,7 +406,7 @@ if ($object->id > 0) {
|
||||
print $langs->trans('PaymentConditions');
|
||||
print '<td>';
|
||||
if (($action != 'editconditions') && $user->rights->societe->creer) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editconditions&socid='.$object->id.'">'.img_edit($langs->trans('SetConditions'), 1).'</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editconditions&token='.newToken().'&socid='.$object->id.'">'.img_edit($langs->trans('SetConditions'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
@ -424,7 +424,7 @@ if ($object->id > 0) {
|
||||
print $langs->trans('PaymentMode');
|
||||
print '<td>';
|
||||
if (($action != 'editmode') && $user->rights->societe->creer) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmode&socid='.$object->id.'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmode&token='.newToken().'&socid='.$object->id.'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
@ -443,7 +443,7 @@ if ($object->id > 0) {
|
||||
print $langs->trans('PaymentBankAccount');
|
||||
print '<td>';
|
||||
if (($action != 'editbankaccount') && $user->rights->societe->creer) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&socid='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&token='.newToken().'&socid='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
@ -569,7 +569,7 @@ if ($object->id > 0) {
|
||||
print $langs->trans('SendingMethod');
|
||||
print '<td>';
|
||||
if (($action != 'editshipping') && $user->rights->societe->creer) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editshipping&socid='.$object->id.'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editshipping&token='.newToken().'&socid='.$object->id.'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
@ -589,7 +589,7 @@ if ($object->id > 0) {
|
||||
print $langs->trans('IntracommReportTransportMode');
|
||||
print '<td>';
|
||||
if (($action != 'edittransportmode') && $user->rights->societe->creer) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=edittransportmode&socid='.$object->id.'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=edittransportmode&token='.newToken().'&socid='.$object->id.'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
@ -652,7 +652,7 @@ if ($object->id > 0) {
|
||||
print $langs->trans('ProspectLevel');
|
||||
print '<td>';
|
||||
if ($action != 'editlevel' && $user->rights->societe->creer) {
|
||||
print '<td class="right"><a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=editlevel&socid='.$object->id.'">'.img_edit($langs->trans('Modify'), 1).'</a></td>';
|
||||
print '<td class="right"><a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=editlevel&token='.newToken().'&socid='.$object->id.'">'.img_edit($langs->trans('Modify'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
|
||||
@ -912,7 +912,7 @@ if ($action == 'create') {
|
||||
}
|
||||
}
|
||||
if (empty($nbemail)) {
|
||||
$nbemail .= ' '.img_warning('').' <font class="warning">'.$langs->trans("NoTargetYet").'</font>';
|
||||
$nbemail .= ' '.img_warning('').' <span class="warning">'.$langs->trans("NoTargetYet").'</span>';
|
||||
}
|
||||
if ($text) {
|
||||
print $form->textwithpicto($nbemail, $text, 1, 'warning');
|
||||
@ -1161,7 +1161,7 @@ if ($action == 'create') {
|
||||
}
|
||||
}
|
||||
if (empty($nbemail)) {
|
||||
$nbemail .= ' '.img_warning('').' <font class="warning">'.$langs->trans("NoTargetYet").'</font>';
|
||||
$nbemail .= ' '.img_warning('').' <span class="warning">'.$langs->trans("NoTargetYet").'</span>';
|
||||
}
|
||||
if ($text) {
|
||||
print $form->textwithpicto($nbemail, $text, 1, 'warning');
|
||||
|
||||
@ -284,7 +284,7 @@ if ($object->fetch($id) >= 0) {
|
||||
}
|
||||
}
|
||||
if (empty($nbemail)) {
|
||||
$nbemail .= ' '.img_warning('').' <font class="warning">'.$langs->trans("NoTargetYet").'</font>';
|
||||
$nbemail .= ' '.img_warning('').' <span class="warning">'.$langs->trans("NoTargetYet").'</span>';
|
||||
}
|
||||
if ($text) {
|
||||
print $form->textwithpicto($nbemail, $text, 1, 'warning');
|
||||
@ -378,7 +378,7 @@ if ($object->fetch($id) >= 0) {
|
||||
$var = !$var;
|
||||
|
||||
if ($allowaddtarget) {
|
||||
print '<form '.$bctag[$var].' name="'.$modulename.'" action="'.$_SERVER['PHP_SELF'].'?action=add&id='.$object->id.'&module='.$modulename.'" method="POST" enctype="multipart/form-data">';
|
||||
print '<form '.$bctag[$var].' name="'.$modulename.'" action="'.$_SERVER['PHP_SELF'].'?action=add&token='.newToken().'&id='.$object->id.'&module='.$modulename.'" method="POST" enctype="multipart/form-data">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
} else {
|
||||
print '<div '.$bctag[$var].'>';
|
||||
|
||||
@ -184,7 +184,7 @@ if ($result) {
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
print '<tr><td class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||
print '<tr><td><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
|
||||
}
|
||||
print "</table></div><br>";
|
||||
$db->free($result);
|
||||
|
||||
@ -2093,7 +2093,7 @@ if ($action == 'create') {
|
||||
print $langs->trans('DatePropal');
|
||||
print '</td>';
|
||||
if ($action != 'editdate' && $object->statut == Propal::STATUS_DRAFT && $usercancreate) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editdate&id='.$object->id.'">'.img_edit($langs->trans('SetDate'), 1).'</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editdate&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetDate'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td class="valuefield">';
|
||||
@ -2120,7 +2120,7 @@ if ($action == 'create') {
|
||||
print $langs->trans('DateEndPropal');
|
||||
print '</td>';
|
||||
if ($action != 'editecheance' && $object->statut == Propal::STATUS_DRAFT && $usercancreate) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editecheance&id='.$object->id.'">'.img_edit($langs->trans('SetConditions'), 1).'</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editecheance&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetConditions'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td class="valuefield">';
|
||||
@ -2150,7 +2150,7 @@ if ($action == 'create') {
|
||||
print $langs->trans('PaymentConditionsShort');
|
||||
print '</td>';
|
||||
if ($action != 'editconditions' && $object->statut == Propal::STATUS_DRAFT && $usercancreate) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editconditions&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetConditions'), 1).'</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editconditions&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetConditions'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td class="valuefield">';
|
||||
@ -2169,7 +2169,7 @@ if ($action == 'create') {
|
||||
print $langs->trans('PaymentMode');
|
||||
print '</td>';
|
||||
if ($action != 'editmode' && $object->statut == Propal::STATUS_DRAFT && $usercancreate) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmode&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetMode'), 1).'</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmode&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetMode'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td class="valuefieldcreate">';
|
||||
@ -2198,7 +2198,7 @@ if ($action == 'create') {
|
||||
}
|
||||
print '</td>';
|
||||
if ($action != 'editavailability' && $object->statut == Propal::STATUS_DRAFT && $usercancreate) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editavailability&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetAvailability'), 1).'</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editavailability&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetAvailability'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td class="valuefield">';
|
||||
@ -2218,7 +2218,7 @@ if ($action == 'create') {
|
||||
print $langs->trans('SendingMethod');
|
||||
print '</td>';
|
||||
if ($action != 'editshippingmethod' && $usercancreate) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editshippingmethod&id='.$object->id.'">'.img_edit($langs->trans('SetShippingMode'), 1).'</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editshippingmethod&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetShippingMode'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td class="valuefield">';
|
||||
@ -2255,7 +2255,7 @@ if ($action == 'create') {
|
||||
print $langs->trans('Source');
|
||||
print '</td>';
|
||||
if ($action != 'editdemandreason' && $object->statut == Propal::STATUS_DRAFT && $usercancreate) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editdemandreason&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetDemandReason'), 1).'</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editdemandreason&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetDemandReason'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td class="valuefield">';
|
||||
@ -2276,7 +2276,7 @@ if ($action == 'create') {
|
||||
print $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0);
|
||||
print '</td>';
|
||||
if ($action != 'editmulticurrencycode' && $object->statut == $object::STATUS_DRAFT && $usercancreate) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmulticurrencycode&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).'</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmulticurrencycode&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td class="valuefield">';
|
||||
@ -2296,7 +2296,7 @@ if ($action == 'create') {
|
||||
print $form->editfieldkey('CurrencyRate', 'multicurrency_tx', '', $object, 0);
|
||||
print '</td>';
|
||||
if ($action != 'editmulticurrencyrate' && $object->statut == $object::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency && $usercancreate) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmulticurrencyrate&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).'</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmulticurrencyrate&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td class="valuefield">';
|
||||
@ -2337,7 +2337,7 @@ if ($action == 'create') {
|
||||
print $langs->trans('BankAccount');
|
||||
print '</td>';
|
||||
if ($action != 'editbankaccount' && $usercancreate) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td class="valuefield">';
|
||||
@ -2373,7 +2373,7 @@ if ($action == 'create') {
|
||||
print $langs->trans('IncotermLabel');
|
||||
print '<td><td class="right">';
|
||||
if ($usercancreate) {
|
||||
print '<a class="editfielda" href="'.DOL_URL_ROOT.'/comm/propal/card.php?id='.$object->id.'&action=editincoterm">'.img_edit().'</a>';
|
||||
print '<a class="editfielda" href="'.DOL_URL_ROOT.'/comm/propal/card.php?id='.$object->id.'&action=editincoterm&token='.newToken().'">'.img_edit().'</a>';
|
||||
} else {
|
||||
print ' ';
|
||||
}
|
||||
|
||||
@ -13,9 +13,9 @@
|
||||
* Copyright (C) 2016-2021 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2017-2018 Charlene Benke <charlie@patas-monkey.com>
|
||||
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* Copyright (C) 2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2019-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2021 Anthony Berton <anthony.berton@bb2a.fr>
|
||||
* Copyright (C) 2021 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2021 Frédéric France <frederic.france@netlogic.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
|
||||
@ -88,12 +88,30 @@ $search_zip = GETPOST('search_zip', 'alpha');
|
||||
$search_state = GETPOST("search_state");
|
||||
$search_country = GETPOST("search_country", 'int');
|
||||
$search_type_thirdparty = GETPOST("search_type_thirdparty", 'int');
|
||||
$search_date_start = dol_mktime(0, 0, 0, GETPOST('search_date_startmonth', 'int'), GETPOST('search_date_startday', 'int'), GETPOST('search_date_startyear', 'int'));
|
||||
$search_date_end = dol_mktime(23, 59, 59, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int'));
|
||||
$search_dateend_start = dol_mktime(0, 0, 0, GETPOST('search_dateend_startmonth', 'int'), GETPOST('search_dateend_startday', 'int'), GETPOST('search_dateend_startyear', 'int'));
|
||||
$search_dateend_end = dol_mktime(23, 59, 59, GETPOST('search_dateend_endmonth', 'int'), GETPOST('search_dateend_endday', 'int'), GETPOST('search_dateend_endyear', 'int'));
|
||||
$search_datedelivery_start = dol_mktime(0, 0, 0, GETPOST('search_datedelivery_startmonth', 'int'), GETPOST('search_datedelivery_startday', 'int'), GETPOST('search_datedelivery_startyear', 'int'));
|
||||
$search_datedelivery_end = dol_mktime(23, 59, 59, GETPOST('search_datedelivery_endmonth', 'int'), GETPOST('search_datedelivery_endday', 'int'), GETPOST('search_datedelivery_endyear', 'int'));
|
||||
$search_date_startday = GETPOST('search_date_startday', 'int');
|
||||
$search_date_startmonth = GETPOST('search_date_startmonth', 'int');
|
||||
$search_date_startyear = GETPOST('search_date_startyear', 'int');
|
||||
$search_date_endday = GETPOST('search_date_endday', 'int');
|
||||
$search_date_endmonth = GETPOST('search_date_endmonth', 'int');
|
||||
$search_date_endyear = GETPOST('search_date_endyear', 'int');
|
||||
$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver
|
||||
$search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
|
||||
$search_date_end_startday = GETPOST('search_date_end_startday', 'int');
|
||||
$search_date_end_startmonth = GETPOST('search_date_end_startmonth', 'int');
|
||||
$search_date_end_startyear = GETPOST('search_date_end_startyear', 'int');
|
||||
$search_date_end_endday = GETPOST('search_date_end_endday', 'int');
|
||||
$search_date_end_endmonth = GETPOST('search_date_end_endmonth', 'int');
|
||||
$search_date_end_endyear = GETPOST('search_date_end_endyear', 'int');
|
||||
$search_date_end_start = dol_mktime(0, 0, 0, $search_date_end_startmonth, $search_date_end_startday, $search_date_end_startyear); // Use tzserver
|
||||
$search_date_end_end = dol_mktime(23, 59, 59, $search_date_end_endmonth, $search_date_end_endday, $search_date_end_endyear);
|
||||
$search_date_delivery_startday = GETPOST('search_date_delivery_startday', 'int');
|
||||
$search_date_delivery_startmonth = GETPOST('search_date_delivery_startmonth', 'int');
|
||||
$search_date_delivery_startyear = GETPOST('search_date_delivery_startyear', 'int');
|
||||
$search_date_delivery_endday = GETPOST('search_date_delivery_endday', 'int');
|
||||
$search_date_delivery_endmonth = GETPOST('search_date_delivery_endmonth', 'int');
|
||||
$search_date_delivery_endyear = GETPOST('search_date_delivery_endyear', 'int');
|
||||
$search_date_delivery_start = dol_mktime(0, 0, 0, $search_date_delivery_startmonth, $search_date_delivery_startday, $search_date_delivery_startyear);
|
||||
$search_date_delivery_end = dol_mktime(23, 59, 59, $search_date_delivery_endmonth, $search_date_delivery_endday, $search_date_delivery_endyear);
|
||||
$search_availability = GETPOST('search_availability', 'int');
|
||||
$search_categ_cus = GETPOST("search_categ_cus", 'int');
|
||||
$search_fk_cond_reglement = GETPOST("search_fk_cond_reglement", 'int');
|
||||
@ -278,12 +296,30 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
|
||||
$search_type = '';
|
||||
$search_country = '';
|
||||
$search_type_thirdparty = '';
|
||||
$search_date_startday = '';
|
||||
$search_date_startmonth = '';
|
||||
$search_date_startyear = '';
|
||||
$search_date_endday = '';
|
||||
$search_date_endmonth = '';
|
||||
$search_date_endyear = '';
|
||||
$search_date_start = '';
|
||||
$search_date_end = '';
|
||||
$search_dateend_start = '';
|
||||
$search_dateend_end = '';
|
||||
$search_datedelivery_start = '';
|
||||
$search_datedelivery_end = '';
|
||||
$search_date_end_startday = '';
|
||||
$search_date_end_startmonth = '';
|
||||
$search_date_end_startyear = '';
|
||||
$search_date_end_endday = '';
|
||||
$search_date_end_endmonth = '';
|
||||
$search_date_end_endyear = '';
|
||||
$search_date_end_start = '';
|
||||
$search_date_end_end = '';
|
||||
$search_date_delivery_startday = '';
|
||||
$search_date_delivery_startmonth = '';
|
||||
$search_date_delivery_startyear = '';
|
||||
$search_date_delivery_endday = '';
|
||||
$search_date_delivery_endmonth = '';
|
||||
$search_date_delivery_endyear = '';
|
||||
$search_date_delivery_start = '';
|
||||
$search_date_delivery_end = '';
|
||||
$search_availability = '';
|
||||
$search_status = '';
|
||||
$object_statut = '';
|
||||
@ -472,7 +508,7 @@ $sql .= ' p.datec as date_creation, p.tms as date_update, p.date_cloture as date
|
||||
$sql .= ' p.note_public, p.note_private,';
|
||||
$sql .= ' p.fk_cond_reglement,p.fk_mode_reglement,p.fk_shipping_method,p.fk_input_reason,';
|
||||
$sql .= " pr.rowid as project_id, pr.ref as project_ref, pr.title as project_label,";
|
||||
$sql .= ' u.login, u.lastname, u.firstname, u.email, u.statut, u.entity as user_entity, u.photo, u.office_phone, u.office_fax, u.user_mobile, u.job, u.gender';
|
||||
$sql .= ' u.login, u.lastname, u.firstname, u.email as user_email, u.statut as user_statut, u.entity as user_entity, u.photo, u.office_phone, u.office_fax, u.user_mobile, u.job, u.gender';
|
||||
if (!$user->rights->societe->client->voir && !$socid) {
|
||||
$sql .= ", sc.fk_soc, sc.fk_user";
|
||||
}
|
||||
@ -635,17 +671,17 @@ if ($search_date_start) {
|
||||
if ($search_date_end) {
|
||||
$sql .= " AND p.datep <= '".$db->idate($search_date_end)."'";
|
||||
}
|
||||
if ($search_dateend_start) {
|
||||
$sql .= " AND p.fin_validite >= '".$db->idate($search_dateend_start)."'";
|
||||
if ($search_date_end_start) {
|
||||
$sql .= " AND p.fin_validite >= '".$db->idate($search_date_end_start)."'";
|
||||
}
|
||||
if ($search_dateend_end) {
|
||||
$sql .= " AND p.fin_validite <= '".$db->idate($search_dateend_end)."'";
|
||||
if ($search_date_end_end) {
|
||||
$sql .= " AND p.fin_validite <= '".$db->idate($search_date_end_end)."'";
|
||||
}
|
||||
if ($search_datedelivery_start) {
|
||||
$sql .= " AND p.date_livraison >= '".$db->idate($search_datedelivery_start)."'";
|
||||
if ($search_date_delivery_start) {
|
||||
$sql .= " AND p.date_livraison >= '".$db->idate($search_date_delivery_start)."'";
|
||||
}
|
||||
if ($search_datedelivery_end) {
|
||||
$sql .= " AND p.date_livraison <= '".$db->idate($search_datedelivery_end)."'";
|
||||
if ($search_date_delivery_end) {
|
||||
$sql .= " AND p.date_livraison <= '".$db->idate($search_date_delivery_end)."'";
|
||||
}
|
||||
if ($search_sale > 0) {
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $search_sale);
|
||||
@ -720,12 +756,60 @@ if ($resql) {
|
||||
if ($sall) {
|
||||
$param .= '&sall='.urlencode($sall);
|
||||
}
|
||||
if ($search_date_start) $param .= '&search_date_startday='.urlencode(dol_print_date($search_date_start, '%d')).'&search_date_startmonth='.urlencode(dol_print_date($search_date_start, '%m')).'&search_date_startyear='.urlencode(dol_print_date($search_date_start, '%Y'));
|
||||
if ($search_date_end) $param .= '&search_date_endday='.urlencode(dol_print_date($search_date_end, '%d')).'&search_date_endmonth='.urlencode(dol_print_date($search_date_end, '%m')).'&search_date_endyear='.urlencode(dol_print_date($search_date_end, '%Y'));
|
||||
if ($search_dateend_start) $param .= '&search_dateend_startday='.urlencode(dol_print_date($search_dateend_start, '%d')).'&search_dateend_startmonth='.urlencode(dol_print_date($search_dateend_start, '%m')).'&search_dateend_startyear='.urlencode(dol_print_date($search_dateend_start, '%Y'));
|
||||
if ($search_dateend_end) $param .= '&search_dateend_endday='.urlencode(dol_print_date($search_dateend_end, '%d')).'&search_dateend_endmonth='.urlencode(dol_print_date($search_dateend_end, '%m')).'&search_dateend_endyear='.urlencode(dol_print_date($search_dateend_end, '%Y'));
|
||||
if ($search_datedelivery_start) $param .= '&search_datedelivery_startday='.urlencode(dol_print_date($search_datedelivery_start, '%d')).'&search_datedelivery_startmonth='.urlencode(dol_print_date($search_datedelivery_start, '%m')).'&search_datedelivery_startyear='.urlencode(dol_print_date($search_datedelivery_start, '%Y'));
|
||||
if ($search_datedelivery_end) $param .= '&search_datedelivery_endday='.urlencode(dol_print_date($search_datedelivery_end, '%d')).'&search_datedelivery_endmonth='.urlencode(dol_print_date($search_datedelivery_end, '%m')).'&search_datedelivery_endyear='.urlencode(dol_print_date($search_datedelivery_end, '%Y'));
|
||||
if ($search_date_startday) {
|
||||
$param .= '&search_date_startday='.urlencode($search_date_startday);
|
||||
}
|
||||
if ($search_date_startmonth) {
|
||||
$param .= '&search_date_startmonth='.urlencode($search_date_startmonth);
|
||||
}
|
||||
if ($search_date_startyear) {
|
||||
$param .= '&search_date_startyear='.urlencode($search_date_startyear);
|
||||
}
|
||||
if ($search_date_endday) {
|
||||
$param .= '&search_date_endday='.urlencode($search_date_endday);
|
||||
}
|
||||
if ($search_date_endmonth) {
|
||||
$param .= '&search_date_endmonth='.urlencode($search_date_endmonth);
|
||||
}
|
||||
if ($search_date_endyear) {
|
||||
$param .= '&search_date_endyear='.urlencode($search_date_endyear);
|
||||
}
|
||||
if ($search_date_end_startday) {
|
||||
$param .= '&search_date_end_startday='.urlencode($search_date_end_startday);
|
||||
}
|
||||
if ($search_date_end_startmonth) {
|
||||
$param .= '&search_date_end_startmonth='.urlencode($search_date_end_startmonth);
|
||||
}
|
||||
if ($search_date_end_startyear) {
|
||||
$param .= '&search_date_end_startyear='.urlencode($search_date_end_startyear);
|
||||
}
|
||||
if ($search_date_end_endday) {
|
||||
$param .= '&search_date_end_endday='.urlencode($search_date_end_endday);
|
||||
}
|
||||
if ($search_date_end_endmonth) {
|
||||
$param .= '&search_date_end_endmonth='.urlencode($search_date_end_endmonth);
|
||||
}
|
||||
if ($search_date_end_endyear) {
|
||||
$param .= '&search_date_end_endyear='.urlencode($search_date_end_endyear);
|
||||
}
|
||||
if ($search_date_delivery_startday) {
|
||||
$param .= '&search_date_delivery_startday='.urlencode($search_date_delivery_startday);
|
||||
}
|
||||
if ($search_date_delivery_startmonth) {
|
||||
$param .= '&search_date_delivery_startmonth='.urlencode($search_date_delivery_startmonth);
|
||||
}
|
||||
if ($search_date_delivery_startyear) {
|
||||
$param .= '&search_date_delivery_startyear='.urlencode($search_date_delivery_startyear);
|
||||
}
|
||||
if ($search_date_delivery_endday) {
|
||||
$param .= '&search_date_delivery_endday='.urlencode($search_date_delivery_endday);
|
||||
}
|
||||
if ($search_date_delivery_endmonth) {
|
||||
$param .= '&search_date_delivery_endmonth='.urlencode($search_date_delivery_endmonth);
|
||||
}
|
||||
if ($search_date_delivery_endyear) {
|
||||
$param .= '&search_date_delivery_endyear='.urlencode($search_date_delivery_endyear);
|
||||
}
|
||||
if ($search_ref) {
|
||||
$param .= '&search_ref='.urlencode($search_ref);
|
||||
}
|
||||
@ -1025,10 +1109,10 @@ if ($resql) {
|
||||
if (!empty($arrayfields['p.fin_validite']['checked'])) {
|
||||
print '<td class="liste_titre center">';
|
||||
print '<div class="nowrap">';
|
||||
print $form->selectDate($search_dateend_start ? $search_dateend_start : -1, 'search_dateend_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
|
||||
print $form->selectDate($search_date_end_start ? $search_date_end_start : -1, 'search_date_end_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
|
||||
print '</div>';
|
||||
print '<div class="nowrap">';
|
||||
print $form->selectDate($search_dateend_end ? $search_dateend_end : -1, 'search_dateend_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
|
||||
print $form->selectDate($search_date_end_end ? $search_date_end_end : -1, 'search_date_end_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
|
||||
print '</div>';
|
||||
print '</td>';
|
||||
}
|
||||
@ -1036,10 +1120,10 @@ if ($resql) {
|
||||
if (!empty($arrayfields['p.date_livraison']['checked'])) {
|
||||
print '<td class="liste_titre center">';
|
||||
print '<div class="nowrap">';
|
||||
print $form->selectDate($search_datedelivery_start ? $search_datedelivery_start : -1, 'search_datedelivery_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
|
||||
print $form->selectDate($search_date_delivery_start ? $search_date_delivery_start : -1, 'search_date_delivery_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
|
||||
print '</div>';
|
||||
print '<div class="nowrap">';
|
||||
print $form->selectDate($search_datedelivery_end ? $search_datedelivery_end : -1, 'search_datedelivery_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
|
||||
print $form->selectDate($search_date_delivery_end ? $search_date_delivery_end : -1, 'search_date_delivery_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
|
||||
print '</div>';
|
||||
print '</td>';
|
||||
}
|
||||
@ -1716,8 +1800,8 @@ if ($resql) {
|
||||
$userstatic->login = $obj->login;
|
||||
$userstatic->lastname = $obj->lastname;
|
||||
$userstatic->firstname = $obj->firstname;
|
||||
$userstatic->email = $obj->email;
|
||||
$userstatic->statut = $obj->statut;
|
||||
$userstatic->email = $obj->user_email;
|
||||
$userstatic->statut = $obj->user_statut;
|
||||
$userstatic->entity = $obj->user_entity;
|
||||
$userstatic->photo = $obj->photo;
|
||||
$userstatic->office_phone = $obj->office_phone;
|
||||
|
||||
@ -299,13 +299,9 @@ class Commande extends CommonOrder
|
||||
'ref_client' =>array('type'=>'varchar(255)', 'label'=>'RefCustomer', 'enabled'=>1, 'visible'=>-1, 'position'=>28),
|
||||
'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>20),
|
||||
'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>1, 'visible'=>-1, 'position'=>25),
|
||||
'date_creation' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>55),
|
||||
'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>56),
|
||||
'date_valid' =>array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>60),
|
||||
'date_commande' =>array('type'=>'date', 'label'=>'Date', 'enabled'=>1, 'visible'=>1, 'position'=>60),
|
||||
'date_valid' =>array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>62),
|
||||
'date_cloture' =>array('type'=>'datetime', 'label'=>'DateClosing', 'enabled'=>1, 'visible'=>-1, 'position'=>65),
|
||||
'date_commande' =>array('type'=>'date', 'label'=>'Date', 'enabled'=>1, 'visible'=>-1, 'position'=>70),
|
||||
'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-1, 'position'=>75),
|
||||
'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>80),
|
||||
'fk_user_valid' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>85),
|
||||
'fk_user_cloture' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserClosing', 'enabled'=>1, 'visible'=>-1, 'position'=>90),
|
||||
'source' =>array('type'=>'smallint(6)', 'label'=>'Source', 'enabled'=>1, 'visible'=>-1, 'position'=>95),
|
||||
@ -344,6 +340,10 @@ class Commande extends CommonOrder
|
||||
'last_main_doc' =>array('type'=>'varchar(255)', 'label'=>'LastMainDoc', 'enabled'=>1, 'visible'=>-1, 'position'=>270),
|
||||
'module_source' =>array('type'=>'varchar(32)', 'label'=>'POSModule', 'enabled'=>1, 'visible'=>-1, 'position'=>275),
|
||||
'pos_source' =>array('type'=>'varchar(32)', 'label'=>'POSTerminal', 'enabled'=>1, 'visible'=>-1, 'position'=>280),
|
||||
'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-1, 'position'=>300),
|
||||
'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>302),
|
||||
'date_creation' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>304),
|
||||
'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>306),
|
||||
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>400),
|
||||
'fk_statut' =>array('type'=>'smallint(6)', 'label'=>'Status', 'enabled'=>1, 'visible'=>-1, 'position'=>500),
|
||||
);
|
||||
|
||||
@ -428,7 +428,7 @@ $sql .= ' c.fk_multicurrency, c.multicurrency_code, c.multicurrency_tx, c.multic
|
||||
$sql .= ' c.date_valid, c.date_commande, c.note_public, c.note_private, c.date_livraison as date_delivery, c.fk_statut, c.facture as billed,';
|
||||
$sql .= ' c.date_creation as date_creation, c.tms as date_update, c.date_cloture as date_cloture,';
|
||||
$sql .= ' p.rowid as project_id, p.ref as project_ref, p.title as project_label,';
|
||||
$sql .= ' u.login, u.lastname, u.firstname, u.email, u.statut, u.entity, u.photo, u.office_phone, u.office_fax, u.user_mobile, u.job, u.gender,';
|
||||
$sql .= ' u.login, u.lastname, u.firstname, u.email as user_email, u.statut as user_statut, u.entity, u.photo, u.office_phone, u.office_fax, u.user_mobile, u.job, u.gender,';
|
||||
$sql .= ' c.fk_cond_reglement,c.fk_mode_reglement,c.fk_shipping_method,';
|
||||
$sql .= ' c.fk_input_reason';
|
||||
if (($search_categ_cus > 0) || ($search_categ_cus == -2)) {
|
||||
@ -553,7 +553,7 @@ if ($search_state) {
|
||||
if ($search_country) {
|
||||
$sql .= " AND s.fk_pays IN (".$db->sanitize($search_country).')';
|
||||
}
|
||||
if ($search_type_thirdparty) {
|
||||
if ($search_type_thirdparty && $search_type_thirdparty != '-1') {
|
||||
$sql .= " AND s.fk_typent IN (".$db->sanitize($search_type_thirdparty).')';
|
||||
}
|
||||
if ($search_company) {
|
||||
@ -795,7 +795,7 @@ if ($resql) {
|
||||
if ($search_country != '') {
|
||||
$param .= '&search_country='.urlencode($search_country);
|
||||
}
|
||||
if ($search_type_thirdparty != '' && $search_type_thirdparty > 0) {
|
||||
if ($search_type_thirdparty && $search_type_thirdparty != '-1') {
|
||||
$param .= '&search_type_thirdparty='.urlencode($search_type_thirdparty);
|
||||
}
|
||||
if ($search_product_category != '') {
|
||||
@ -1697,8 +1697,8 @@ if ($resql) {
|
||||
$userstatic->login = $obj->login;
|
||||
$userstatic->lastname = $obj->lastname;
|
||||
$userstatic->firstname = $obj->firstname;
|
||||
$userstatic->email = $obj->email;
|
||||
$userstatic->statut = $obj->statut;
|
||||
$userstatic->email = $obj->user_email;
|
||||
$userstatic->statut = $obj->user_statut;
|
||||
$userstatic->entity = $obj->entity;
|
||||
$userstatic->photo = $obj->photo;
|
||||
$userstatic->office_phone = $obj->office_phone;
|
||||
|
||||
@ -932,10 +932,10 @@ if ($resql) {
|
||||
$newcardbutton = dolGetButtonTitle($langs->trans('AddBankRecord'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/bank/various_payment/card.php?action=create&accountid='.urlencode($search_account).'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.urlencode($search_account)), '', $user->rights->banque->modifier);
|
||||
} else // If direct entries is not done using miscellaneous payments
|
||||
{
|
||||
$newcardbutton = dolGetButtonTitle($langs->trans('AddBankRecord'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?action=addline&page='.$page.$param, '', $user->rights->banque->modifier);
|
||||
$newcardbutton = dolGetButtonTitle($langs->trans('AddBankRecord'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?action=addline&token='.newToken().'&page='.$page.$param, '', $user->rights->banque->modifier);
|
||||
}
|
||||
} else {
|
||||
$newcardbutton = dolGetButtonTitle($langs->trans('AddBankRecord'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?action=addline&page='.$page.$param, '', -1);
|
||||
$newcardbutton = dolGetButtonTitle($langs->trans('AddBankRecord'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?action=addline&token='.newToken().'&page='.$page.$param, '', -1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1503,7 +1503,7 @@ class Account extends CommonObject
|
||||
{
|
||||
$country_code = $this->getCountryCode();
|
||||
|
||||
if (in_array($country_code, array('FR', 'ES', 'GA', 'IT', 'NC'))) {
|
||||
if (in_array($country_code, array('AD', 'FR', 'ES', 'GA', 'IT', 'NC'))) {
|
||||
return 1; // France, Spain, Gabon, ... - Not valid for CH
|
||||
}
|
||||
if (in_array($country_code, array('AU', 'BE', 'CA', 'DE', 'DK', 'GR', 'GB', 'ID', 'IE', 'IR', 'KR', 'NL', 'NZ', 'UK', 'US'))) {
|
||||
@ -1696,21 +1696,21 @@ class Account extends CommonObject
|
||||
/**
|
||||
* Function used to replace a thirdparty id with another one.
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
* @param DoliDB $dbs Database handler
|
||||
* @param int $origin_id Old thirdparty id
|
||||
* @param int $dest_id New thirdparty id
|
||||
* @return bool
|
||||
* @return bool True=SQL success, False=SQL error
|
||||
*/
|
||||
public static function replaceThirdparty($db, $origin_id, $dest_id)
|
||||
public static function replaceThirdparty($dbs, $origin_id, $dest_id)
|
||||
{
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."bank_url SET url_id = ".((int) $dest_id)." WHERE url_id = ".((int) $origin_id)." AND type='company'";
|
||||
|
||||
if (!$db->query($sql)) {
|
||||
//if ($ignoreerrors) return true; // TODO Not enough. If there is A-B on kept thirdarty and B-C on old one, we must get A-B-C after merge. Not A-B.
|
||||
//$this->errors = $db->lasterror();
|
||||
return false;
|
||||
} else {
|
||||
if ($dbs->query($sql)) {
|
||||
return true;
|
||||
} else {
|
||||
//if ($ignoreerrors) return true; // TODO Not enough. If there is A-B on kept thirdarty and B-C on old one, we must get A-B-C after merge. Not A-B.
|
||||
//$this->errors = $dbs->lasterror();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -364,7 +364,7 @@ if (empty($numref)) {
|
||||
|
||||
print '<td class="center">';
|
||||
if ($user->rights->banque->consolidate && $action != 'editbankreceipt') {
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?account='.$object->id.($page > 0 ? '&page='.$page : '').'&action=editbankreceipt&brref='.$objp->numr.'">'.img_edit().'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?account='.$object->id.($page > 0 ? '&page='.$page : '').'&action=editbankreceipt&token='.newToken().'&brref='.urlencode($objp->numr).'">'.img_edit().'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
@ -469,7 +469,7 @@ if ($action == 'create') {
|
||||
|
||||
if ($object->statut < Deplacement::STATUS_REFUNDED) { // if not refunded
|
||||
if ($user->rights->deplacement->creer) {
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&id='.$id.'">'.$langs->trans('Modify').'</a>';
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'&id='.$id.'">'.$langs->trans('Modify').'</a>';
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotAllowed")).'">'.$langs->trans('Modify').'</a>';
|
||||
}
|
||||
|
||||
@ -1269,7 +1269,7 @@ if ($action == 'create') {
|
||||
print $langs->trans('PaymentConditionsShort');
|
||||
print '</td>';
|
||||
if ($action != 'editconditions' && $user->rights->facture->creer) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editconditions&facid='.$object->id.'">'.img_edit($langs->trans('SetConditions'), 1).'</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editconditions&token='.newToken().'&facid='.$object->id.'">'.img_edit($langs->trans('SetConditions'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
@ -1290,7 +1290,7 @@ if ($action == 'create') {
|
||||
print $langs->trans('PaymentMode');
|
||||
print '</td>';
|
||||
if ($action != 'editmode' && $user->rights->facture->creer) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmode&facid='.$object->id.'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmode&token='.newToken().'&facid='.$object->id.'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
@ -1310,7 +1310,7 @@ if ($action == 'create') {
|
||||
print $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0);
|
||||
print '</td>';
|
||||
if ($usercancreate && $action != 'editmulticurrencycode' && !empty($object->brouillon)) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmulticurrencycode&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).'</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmulticurrencycode&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
@ -1326,7 +1326,7 @@ if ($action == 'create') {
|
||||
print $form->editfieldkey('CurrencyRate', 'multicurrency_tx', '', $object, 0);
|
||||
print '</td>';
|
||||
if ($usercancreate && $action != 'editmulticurrencyrate' && !empty($object->brouillon) && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmulticurrencyrate&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).'</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmulticurrencyrate&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
@ -1398,7 +1398,7 @@ if ($action == 'create') {
|
||||
print $langs->trans('BankAccount');
|
||||
print '<td>';
|
||||
if (($action != 'editbankaccount') && $user->rights->facture->creer && $object->statut == FactureRec::STATUS_DRAFT) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
@ -1416,7 +1416,7 @@ if ($action == 'create') {
|
||||
print $langs->trans('Model');
|
||||
print '<td>';
|
||||
if (($action != 'editmodelpdf') && $user->rights->facture->creer && $object->statut == FactureRec::STATUS_DRAFT) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmodelpdf&id='.$object->id.'">'.img_edit($langs->trans('SetModel'), 1).'</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmodelpdf&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetModel'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
@ -1463,7 +1463,7 @@ if ($action == 'create') {
|
||||
print $langs->trans('Frequency');
|
||||
print '</td>';
|
||||
if ($action != 'editfrequency' && $user->rights->facture->creer) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editfrequency&facid='.$object->id.'">'.img_edit($langs->trans('Edit'), 1).'</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editfrequency&token='.newToken().'&facid='.$object->id.'">'.img_edit($langs->trans('Edit'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
|
||||
@ -4336,7 +4336,7 @@ if ($action == 'create') {
|
||||
print $langs->trans('DateInvoice');
|
||||
print '</td>';
|
||||
if ($action != 'editinvoicedate' && !empty($object->brouillon) && $usercancreate && empty($conf->global->FAC_FORCE_DATE_VALIDATION)) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editinvoicedate&facid='.$object->id.'">'.img_edit($langs->trans('SetDate'), 1).'</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editinvoicedate&token='.newToken().'&facid='.$object->id.'">'.img_edit($langs->trans('SetDate'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
@ -4356,7 +4356,7 @@ if ($action == 'create') {
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans('DatePointOfTax');
|
||||
print '</td>';
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editdate_pointoftax&facid='.$object->id.'">'.img_edit($langs->trans('SetDate'), 1).'</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editdate_pointoftax&token='.newToken().'&facid='.$object->id.'">'.img_edit($langs->trans('SetDate'), 1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
if ($action == 'editdate_pointoftax') {
|
||||
@ -4373,7 +4373,7 @@ if ($action == 'create') {
|
||||
print $langs->trans('PaymentConditionsShort');
|
||||
print '</td>';
|
||||
if ($object->type != Facture::TYPE_CREDIT_NOTE && $action != 'editconditions' && $usercancreate) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editconditions&facid='.$object->id.'">'.img_edit($langs->trans('SetConditions'), 1).'</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editconditions&token='.newToken().'&facid='.$object->id.'">'.img_edit($langs->trans('SetConditions'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
@ -4394,7 +4394,7 @@ if ($action == 'create') {
|
||||
print $langs->trans('DateMaxPayment');
|
||||
print '</td>';
|
||||
if ($object->type != Facture::TYPE_CREDIT_NOTE && $action != 'editpaymentterm' && $usercancreate) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editpaymentterm&facid='.$object->id.'">'.img_edit($langs->trans('SetDate'), 1).'</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editpaymentterm&token='.newToken().'&facid='.$object->id.'">'.img_edit($langs->trans('SetDate'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
@ -4418,7 +4418,7 @@ if ($action == 'create') {
|
||||
print $langs->trans('PaymentMode');
|
||||
print '</td>';
|
||||
if ($action != 'editmode' && $usercancreate) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmode&facid='.$object->id.'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmode&token='.newToken().'&facid='.$object->id.'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
@ -4438,7 +4438,7 @@ if ($action == 'create') {
|
||||
print $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0);
|
||||
print '</td>';
|
||||
if ($usercancreate && $action != 'editmulticurrencycode' && !empty($object->brouillon)) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmulticurrencycode&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).'</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmulticurrencycode&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
@ -4454,7 +4454,7 @@ if ($action == 'create') {
|
||||
print $form->editfieldkey('CurrencyRate', 'multicurrency_tx', '', $object, 0);
|
||||
print '</td>';
|
||||
if ($usercancreate && $action != 'editmulticurrencyrate' && !empty($object->brouillon) && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmulticurrencyrate&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).'</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmulticurrencyrate&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
@ -4482,7 +4482,7 @@ if ($action == 'create') {
|
||||
print $langs->trans('BankAccount');
|
||||
print '<td>';
|
||||
if (($action != 'editbankaccount') && $usercancreate) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
@ -4502,7 +4502,7 @@ if ($action == 'create') {
|
||||
print $langs->trans('IncotermLabel');
|
||||
print '<td><td class="right">';
|
||||
if ($usercancreate) {
|
||||
print '<a class="editfielda" href="'.DOL_URL_ROOT.'/compta/facture/card.php?facid='.$object->id.'&action=editincoterm">'.img_edit().'</a>';
|
||||
print '<a class="editfielda" href="'.DOL_URL_ROOT.'/compta/facture/card.php?facid='.$object->id.'&action=editincoterm&token='.newToken().'">'.img_edit().'</a>';
|
||||
} else {
|
||||
print ' ';
|
||||
}
|
||||
@ -4532,7 +4532,7 @@ if ($action == 'create') {
|
||||
print $langs->trans('RetainedWarranty');
|
||||
print '</td>';
|
||||
if ($action != 'editretainedwarranty' && $user->rights->facture->creer) {
|
||||
print '<td align="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editretainedwarranty&facid='.$object->id.'">'.img_edit($langs->trans('setretainedwarranty'), 1).'</a></td>';
|
||||
print '<td align="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editretainedwarranty&token='.newToken().'&facid='.$object->id.'">'.img_edit($langs->trans('setretainedwarranty'), 1).'</a></td>';
|
||||
}
|
||||
|
||||
print '</tr></table>';
|
||||
@ -4555,7 +4555,7 @@ if ($action == 'create') {
|
||||
print $langs->trans('PaymentConditionsShortRetainedWarranty');
|
||||
print '</td>';
|
||||
if ($action != 'editretainedwarrantypaymentterms' && $user->rights->facture->creer) {
|
||||
print '<td align="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editretainedwarrantypaymentterms&facid='.$object->id.'">'.img_edit($langs->trans('setPaymentConditionsShortRetainedWarranty'), 1).'</a></td>';
|
||||
print '<td align="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editretainedwarrantypaymentterms&token='.newToken().'&facid='.$object->id.'">'.img_edit($langs->trans('setPaymentConditionsShortRetainedWarranty'), 1).'</a></td>';
|
||||
}
|
||||
|
||||
print '</tr></table>';
|
||||
@ -4590,7 +4590,7 @@ if ($action == 'create') {
|
||||
print $langs->trans('RetainedWarrantyDateLimit');
|
||||
print '</td>';
|
||||
if ($action != 'editretainedwarrantydatelimit' && $user->rights->facture->creer) {
|
||||
print '<td align="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editretainedwarrantydatelimit&facid='.$object->id.'">'.img_edit($langs->trans('setretainedwarrantyDateLimit'), 1).'</a></td>';
|
||||
print '<td align="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editretainedwarrantydatelimit&token='.newToken().'&facid='.$object->id.'">'.img_edit($langs->trans('setretainedwarrantyDateLimit'), 1).'</a></td>';
|
||||
}
|
||||
|
||||
print '</tr></table>';
|
||||
@ -4676,7 +4676,7 @@ if ($action == 'create') {
|
||||
print $langs->trans('RevenueStamp');
|
||||
print '</td>';
|
||||
if ($action != 'editrevenuestamp' && !empty($object->brouillon) && $usercancreate) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editrevenuestamp&facid='.$object->id.'">'.img_edit($langs->trans('SetRevenuStamp'), 1).'</a></td>';
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editrevenuestamp&token='.newToken().'&facid='.$object->id.'">'.img_edit($langs->trans('SetRevenuStamp'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
|
||||
@ -5783,7 +5783,7 @@ class FactureLigne extends CommonInvoiceLine
|
||||
return 0;
|
||||
}
|
||||
|
||||
$sql = 'SELECT situation_percent FROM '.MAIN_DB_PREFIX.'facturedet WHERE rowid='.((int) $this->fk_prev_id);
|
||||
$sql = "SELECT situation_percent FROM ".MAIN_DB_PREFIX."facturedet WHERE rowid = ".((int) $this->fk_prev_id);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql && $resql->num_rows > 0) {
|
||||
$res = $this->db->fetch_array($resql);
|
||||
@ -5793,9 +5793,9 @@ class FactureLigne extends CommonInvoiceLine
|
||||
if ($include_credit_note) {
|
||||
$sql = 'SELECT fd.situation_percent FROM '.MAIN_DB_PREFIX.'facturedet fd';
|
||||
$sql .= ' JOIN '.MAIN_DB_PREFIX.'facture f ON (f.rowid = fd.fk_facture) ';
|
||||
$sql .= ' WHERE fd.fk_prev_id = '.((int) $this->fk_prev_id);
|
||||
$sql .= ' AND f.situation_cycle_ref = '.((int) $invoicecache[$invoiceid]->situation_cycle_ref); // Prevent cycle outed
|
||||
$sql .= ' AND f.type = '.Facture::TYPE_CREDIT_NOTE;
|
||||
$sql .= " WHERE fd.fk_prev_id = ".((int) $this->fk_prev_id);
|
||||
$sql .= " AND f.situation_cycle_ref = ".((int) $invoicecache[$invoiceid]->situation_cycle_ref); // Prevent cycle outed
|
||||
$sql .= " AND f.type = ".Facture::TYPE_CREDIT_NOTE;
|
||||
|
||||
$res = $this->db->query($sql);
|
||||
if ($res) {
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/compat/facture/index.php
|
||||
* \file htdocs/compta/facture/index.php
|
||||
* \ingroup facture
|
||||
* \brief Home page of customer invoices area
|
||||
*/
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user