Merge remote-tracking branch 'upstream/develop' into 15a30
This commit is contained in:
commit
15115a133d
12
SECURITY.md
12
SECURITY.md
@ -12,8 +12,7 @@ This file contains some policies about the security reports on Dolibarr ERP CRM
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
To report a vulnerability, please use GitHub security advisory at https://github.com/Dolibarr/dolibarr/security/advisories/new (if you have permissions) or alternatively send an email to security@dolibarr.org (for everybody)
|
||||
|
||||
To report a vulnerability, please use GitHub security advisory at [https://github.com/Dolibarr/dolibarr/security/advisories/new](https://github.com/Dolibarr/dolibarr/security/advisories/new) (if you have permissions) or alternatively send an email to security@dolibarr.org (for everybody)
|
||||
|
||||
## Hunting vulnerabilities on Dolibarr
|
||||
|
||||
@ -23,7 +22,7 @@ If you believe you've found a security bug in our service, we are happy to work
|
||||
|
||||
Any type of denial of service attacks is strictly forbidden, as well as any interference with network equipment and Dolibarr infrastructure.
|
||||
|
||||
We recommand to install Dolibarr ERP CRM on your own server (as most Open Source software, download and use is free: https://www.dolibarr.org/download) to get access on every side of application.
|
||||
We recommand to install Dolibarr ERP CRM on your own server (as most Open Source software, download and use is free: [https://www.dolibarr.org/download](https://www.dolibarr.org/download)) to get access on every side of application.
|
||||
|
||||
### User Agent
|
||||
|
||||
@ -31,8 +30,7 @@ If you try to find bug on Dolibarr, we recommend to append to your user-agent he
|
||||
|
||||
### Account access
|
||||
|
||||
You can install the web application yourself on your own platform/server so you get full access to application and sources. Download the zip of the files to put into your own web server virtual host from https://www.dolibarr.org/download
|
||||
|
||||
You can install the web application yourself on your own platform/server so you get full access to application and sources. Download the zip of the files to put into your own web server virtual host from [https://www.dolibarr.org/download](https://www.dolibarr.org/download)
|
||||
|
||||
## Eligibility and Responsible Disclosure
|
||||
|
||||
@ -46,7 +44,6 @@ You must avoid tests that could cause degradation or interruption of our service
|
||||
|
||||
You must not leak, manipulate, or destroy any user data of third parties to find your vulnerability.
|
||||
|
||||
|
||||
## Scope for qualified vulnerabilities
|
||||
|
||||
ONLY vulnerabilities discovered, when the following setup on test platform is used, are "valid":
|
||||
@ -64,7 +61,6 @@ ONLY vulnerabilities discovered, when the following setup on test platform is us
|
||||
|
||||
Scope is the web application (back office) and the APIs.
|
||||
|
||||
|
||||
## Qualifying vulnerabilities for reporting
|
||||
|
||||
* Remote code execution (RCE)
|
||||
@ -81,7 +77,6 @@ Scope is the web application (back office) and the APIs.
|
||||
* Software version disclosure (for non admin users only)
|
||||
* Stack traces or path disclosure (for non admin users only)
|
||||
|
||||
|
||||
## Non-qualifying vulnerabilities for reporting
|
||||
|
||||
* "Self" XSS
|
||||
@ -99,4 +94,3 @@ Scope is the web application (back office) and the APIs.
|
||||
* Software version or private IP disclosure when logged user is admin
|
||||
* Stack traces or path disclosure when logged user is admin
|
||||
* Any vulnerabilities due to a configuration different than the one defined into chapter "Scope for qualified vulnerabilities".
|
||||
|
||||
|
||||
@ -732,17 +732,16 @@ class AccountingAccount extends CommonObject
|
||||
/**
|
||||
* 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
|
||||
* @param string $type Customer / Supplier
|
||||
*
|
||||
* @return array Accounting accounts suggested
|
||||
* @param Societe $buyer Object buyer
|
||||
* @param Societe $seller 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
|
||||
* @param string $type Customer / Supplier
|
||||
* @return array Accounting accounts suggested
|
||||
*/
|
||||
public function getAccountingCodeToBind(Societe $buyer, $seller, Product $product, Facture $facture, FactureLigne $factureDet, $accountingAccount = array(), $type = '')
|
||||
public function getAccountingCodeToBind(Societe $buyer, Societe $seller, Product $product, Facture $facture, FactureLigne $factureDet, $accountingAccount = array(), $type = '')
|
||||
{
|
||||
global $conf;
|
||||
global $hookmanager;
|
||||
@ -755,21 +754,21 @@ class AccountingAccount extends CommonObject
|
||||
$reshook = $hookmanager->executeHooks('accoutancyBindingCalculation', $parameters); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
if (empty($reshook)) {
|
||||
if ($type=='customer') {
|
||||
if ($type == 'customer') {
|
||||
$const_name = "SOLD";
|
||||
} elseif ($type=='supplier') {
|
||||
} elseif ($type == 'supplier') {
|
||||
$const_name = "BUY";
|
||||
}
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
|
||||
$isBuyerInEEC = isInEEC($buyer);
|
||||
$isSellerInEEC = isInEEC($seller);
|
||||
$code_l = '';
|
||||
$code_p = '';
|
||||
$code_t = '';
|
||||
$code_l = ''; // Default value for generic product/service
|
||||
$code_p = ''; // Value for the product/service in parameter ($product)
|
||||
$code_t = ''; // Default value of product account for the thirdparty
|
||||
$suggestedid = '';
|
||||
|
||||
// Level 1: Search suggested default account for product/service
|
||||
// Level 1 (define $code_l): 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)
|
||||
@ -814,7 +813,7 @@ class AccountingAccount extends CommonObject
|
||||
$code_l = '';
|
||||
}
|
||||
|
||||
// Level 2: Search suggested account for product/service (similar code exists in page index.php to make automatic binding)
|
||||
// Level 2 (define $code_p): 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))) {
|
||||
// If buyer in same country than seller (if not defined, we assume it is same country)
|
||||
@ -866,7 +865,7 @@ class AccountingAccount extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// Level 3: Search suggested account for this thirdparty (similar code exists in page index.php to make automatic binding)
|
||||
// Level 3 (define $code_t): 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_t = $buyer->code_compta;
|
||||
@ -888,6 +887,7 @@ class AccountingAccount extends CommonObject
|
||||
$suggestedaccountingaccountfor = 'deposit';
|
||||
}
|
||||
|
||||
// If $suggestedid could not be guessed yet, we set it from the generic default accounting code $code_l
|
||||
if (empty($suggestedid) && empty($code_p) && !empty($code_l) && empty($conf->global->ACCOUNTANCY_DO_NOT_AUTOFILL_ACCOUNT_WITH_GENERIC)) {
|
||||
if (empty($this->accountingaccount_codetotid_cache[$code_l])) {
|
||||
$tmpaccount = new self($this->db);
|
||||
|
||||
@ -478,7 +478,6 @@ if ($result) {
|
||||
print '</div>';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="'.dol_escape_htmltag($search_ref).'"></td>';
|
||||
//print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="search_desc" value="'.dol_escape_htmltag($search_desc).'"></td>';
|
||||
print '<td class="liste_titre right"><input type="text" class="flat maxwidth50 right" name="search_amount" value="'.dol_escape_htmltag($search_amount).'"></td>';
|
||||
print '<td class="liste_titre right"><input type="text" class="flat maxwidth50 right" name="search_vat" placeholder="%" size="1" value="'.dol_escape_htmltag($search_vat).'"></td>';
|
||||
@ -528,6 +527,9 @@ if ($result) {
|
||||
while ($i < min($num_lines, $limit)) {
|
||||
$objp = $db->fetch_object($result);
|
||||
|
||||
// product_type: 0 = service, 1 = product
|
||||
// if product does not exist we use the value of product_type provided in facturedet to define if this is a product or service
|
||||
// issue : if we change product_type value in product DB it should differ from the value stored in facturedet DB !
|
||||
$code_sell_l = '';
|
||||
$code_sell_p = '';
|
||||
|
||||
@ -586,9 +588,9 @@ if ($result) {
|
||||
$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'];
|
||||
$code_sell_l=$return['code_l'];
|
||||
$code_sell_p=$return['code_p'];
|
||||
$code_sell_t=$return['code_t'];
|
||||
}
|
||||
//var_dump($return);
|
||||
|
||||
@ -661,11 +663,11 @@ if ($result) {
|
||||
print '</td>';
|
||||
|
||||
// Vat rate
|
||||
$code_vat_differ='';
|
||||
if ($product_static->tva_tx !== $facture_static_det->tva_tx && ! empty($facture_static_det->tva_tx)) { // Note: having a vat rate of 0 is often the normal case when sells is intra b2b or to export
|
||||
$code_vat_differ = 'font-weight:bold; text-decoration:blink; color:red';
|
||||
$code_vat_differ = '';
|
||||
if ($product_static->tva_tx !== $facture_static_det->tva_tx && price2num($product_static->tva_tx) && price2num($facture_static_det->tva_tx)) { // Note: having a vat rate of 0 is often the normal case when sells is intra b2b or to export
|
||||
$code_vat_differ = 'warning bold';
|
||||
}
|
||||
print '<td style="'.$code_vat_differ.'" class="right">';
|
||||
print '<td class="right'.($code_vat_differ?' '.$code_vat_differ:'').'">';
|
||||
print vatrate($facture_static_det->tva_tx.($facture_static_det->vat_src_code ? ' ('.$facture_static_det->vat_src_code.')' : ''));
|
||||
print '</td>';
|
||||
|
||||
@ -731,12 +733,13 @@ if ($result) {
|
||||
|
||||
// Column with checkbox
|
||||
print '<td class="center">';
|
||||
$ischecked = 0;
|
||||
if (!empty($suggestedid) && $suggestedaccountingaccountfor <> '') {
|
||||
$ischecked=1;
|
||||
$ischecked = 1;
|
||||
} elseif ($suggestedaccountingaccountfor == 'eecwithoutvatnumber') {
|
||||
$ischecked = 0;
|
||||
}
|
||||
print '<input type="checkbox" class="flat checkforselect checkforselect'.$facture_static_det->id.'" name="toselect[]" value="'.$facture_static_det->id."_".$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>';
|
||||
|
||||
@ -529,11 +529,12 @@ if ($result) {
|
||||
while ($i < min($num_lines, $limit)) {
|
||||
$objp = $db->fetch_object($result);
|
||||
|
||||
// product_type: 0 = service ? 1 = product
|
||||
// product_type: 0 = service, 1 = product
|
||||
// if product does not exist we use the value of product_type provided in facturedet to define if this is a product or service
|
||||
// issue : if we change product_type value in product DB it should differ from the value stored in facturedet DB !
|
||||
$objp->code_buy_l = '';
|
||||
$objp->code_buy_p = '';
|
||||
$objp->aarowid_suggest = ''; // Will be set later
|
||||
|
||||
$thirdpartystatic->id = $objp->socid;
|
||||
$thirdpartystatic->name = $objp->name;
|
||||
@ -575,10 +576,6 @@ if ($result) {
|
||||
$facturefourn_static_det->product_type = $objp->type_l;
|
||||
$facturefourn_static_det->desc = $objp->description;
|
||||
|
||||
$code_buy_p_notset = '';
|
||||
$code_buy_t_notset = '';
|
||||
$objp->aarowid_suggest = ''; // Will be set later
|
||||
|
||||
$accountingAccountArray = array(
|
||||
'dom'=>$objp->aarowid,
|
||||
'intra'=>$objp->aarowid_intra,
|
||||
@ -595,12 +592,15 @@ if ($result) {
|
||||
$suggestedid=$return['suggestedid'];
|
||||
$suggestedaccountingaccountfor=$return['suggestedaccountingaccountfor'];
|
||||
$suggestedaccountingaccountbydefaultfor=$return['suggestedaccountingaccountbydefaultfor'];
|
||||
$code_buy_l=$return['code_buy_l'];
|
||||
$code_buy_p=$return['code_buy_p'];
|
||||
$code_buy_t=$return['code_buy_t'];
|
||||
$code_buy_l=$return['code_l'];
|
||||
$code_buy_p=$return['code_p'];
|
||||
$code_buy_t=$return['code_t'];
|
||||
}
|
||||
//var_dump($return);
|
||||
|
||||
// Level 3: Search suggested account for this thirdparty (similar code exists in page index.php to make automatic binding)
|
||||
// Not supported for suppliers
|
||||
|
||||
if (!empty($code_buy_p)) {
|
||||
// Value was defined previously
|
||||
} else {
|
||||
@ -654,11 +654,11 @@ if ($result) {
|
||||
print '</td>';
|
||||
|
||||
// Vat rate
|
||||
$code_vat_differ='';
|
||||
if ($objp->vat_tx_l != $objp->vat_tx_p && ! empty($objp->vat_tx_l)) { // Note: having a vat rate of 0 is often the normal case when sells is intra b2b or to export
|
||||
$code_vat_differ = 'font-weight:bold; text-decoration:blink; color:red';
|
||||
$code_vat_differ = '';
|
||||
if ($objp->vat_tx_l != $objp->vat_tx_p && price2num($objp->vat_tx_p) && price2num($objp->vat_tx_l)) { // Note: having a vat rate of 0 is often the normal case when sells is intra b2b or to export
|
||||
$code_vat_differ = 'warning bold';
|
||||
}
|
||||
print '<td style="'.$code_vat_differ.'" class="right">';
|
||||
print '<td class="right'.($code_vat_differ?' '.$code_vat_differ:'').'">';
|
||||
print vatrate($facturefourn_static_det->tva_tx.($facturefourn_static_det->vat_src_code ? ' ('.$facturefourn_static_det->vat_src_code.')' : ''));
|
||||
print '</td>';
|
||||
|
||||
@ -691,6 +691,11 @@ if ($result) {
|
||||
$shelp = ''; $ttype = 'help';
|
||||
if ($suggestedaccountingaccountfor == 'eec') {
|
||||
$shelp = $langs->trans("SaleEEC");
|
||||
} elseif ($suggestedaccountingaccountfor == 'eecwithvat') {
|
||||
$shelp = $langs->trans("SaleEECWithVAT");
|
||||
} elseif ($suggestedaccountingaccountfor == 'eecwithoutvatnumber') {
|
||||
$shelp = $langs->trans("SaleEECWithoutVATNumber");
|
||||
$ttype = 'warning';
|
||||
} elseif ($suggestedaccountingaccountfor == 'export') {
|
||||
$shelp = $langs->trans("SaleExport");
|
||||
}
|
||||
@ -719,12 +724,13 @@ if ($result) {
|
||||
|
||||
// Column with checkbox
|
||||
print '<td class="center">';
|
||||
if (!empty($suggestedid)) {
|
||||
$ischecked = 0;
|
||||
if (!empty($suggestedid) && $suggestedaccountingaccountfor <> '') {
|
||||
$ischecked = 1;
|
||||
} else {
|
||||
} elseif ($suggestedaccountingaccountfor == 'eecwithoutvatnumber') {
|
||||
$ischecked = 0;
|
||||
}
|
||||
print '<input type="checkbox" class="flat checkforselect checkforselect'.$facturefourn_static_det->id.'" name="toselect[]" value="'.$facturefourn_static_det->id."_".$i.'"'.($ischecked ? "checked" : "").'/>';
|
||||
print '<input type="checkbox" class="flat checkforselect checkforselect'.$facturefourn_static_det->id.'" name="toselect[]" value="'.$facturefourn_static_det->id."_".$i.'"'.($ischecked ? " checked" : "").'/>';
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
|
||||
@ -943,7 +943,7 @@ if ($rowid > 0) {
|
||||
}
|
||||
if (!$datefrom) {
|
||||
$datefrom = $object->datevalid;
|
||||
if ($object->datefin > 0 && dol_time_plus_duree($object->datefin, $defaultdelay, $defaultdelayunit) < dol_now()) {
|
||||
if ($object->datefin > 0 && dol_time_plus_duree($object->datefin, $defaultdelay, $defaultdelayunit) > dol_now()) {
|
||||
$datefrom = dol_time_plus_duree($object->datefin, 1, 'd');
|
||||
} else {
|
||||
$datefrom = dol_get_first_day(dol_print_date(time(), "%Y"));
|
||||
|
||||
@ -70,6 +70,9 @@ print '<!-- Force style container -->'."\n".'<style>
|
||||
.id-container {
|
||||
width: 100%;
|
||||
}
|
||||
#id-right {
|
||||
padding-left: unset;
|
||||
}
|
||||
</style>';
|
||||
|
||||
$arrayofnatures = array('core'=>$langs->transnoentitiesnoconv("Core"), 'external'=>$langs->transnoentitiesnoconv("External").' - '.$langs->trans("AllPublishers"));
|
||||
|
||||
@ -98,7 +98,9 @@ if (!empty($ExecTimeLimit)) {
|
||||
@set_time_limit($ExecTimeLimit); // Need more than 240 on Windows 7/64
|
||||
error_reporting($err);
|
||||
}
|
||||
$MemoryLimit = 0;
|
||||
|
||||
/* If value has been forced with a php_admin_value, this has no effect. Example of value: '512M' */
|
||||
$MemoryLimit = getDolGlobalString('MAIN_MEMORY_LIMIT_ARCHIVE_DATAROOT');
|
||||
if (!empty($MemoryLimit)) {
|
||||
@ini_set('memory_limit', $MemoryLimit);
|
||||
}
|
||||
|
||||
@ -737,14 +737,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
|
||||
$MAXEVENT = 10;
|
||||
|
||||
$morehtmlright = '<a href="'.DOL_URL_ROOT.'/bom/bom_agenda.php?id='.$object->id.'">';
|
||||
$morehtmlright .= $langs->trans("SeeAll");
|
||||
$morehtmlright .= '</a>';
|
||||
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/bom/bom_agenda.php?id='.$object->id);
|
||||
|
||||
// List of actions on element
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
|
||||
$formactions = new FormActions($db);
|
||||
$somethingshown = $formactions->showactions($object, $object->element, $socid, 1, '', $MAXEVENT, '', $morehtmlright);
|
||||
$somethingshown = $formactions->showactions($object, $object->element, 0, 1, '', $MAXEVENT, '', $morehtmlcenter);
|
||||
|
||||
print '</div></div>';
|
||||
}
|
||||
|
||||
@ -57,12 +57,12 @@ $date_start = GETPOST('date_start', 'alpha');
|
||||
$date_startDay = GETPOST('date_startday', 'int');
|
||||
$date_startMonth = GETPOST('date_startmonth', 'int');
|
||||
$date_startYear = GETPOST('date_startyear', 'int');
|
||||
$date_start = ($date_startDay ? dol_mktime(0, 0, 0, $date_startMonth, $date_startDay, $date_startYear, 'tzuserrel') : dol_stringtotime($date_start));
|
||||
$date_start = dol_mktime(0, 0, 0, $date_startMonth, $date_startDay, $date_startYear, 'tzuserrel');
|
||||
$date_stop = GETPOST('date_stop', 'alpha');
|
||||
$date_stopDay = GETPOST('date_stopday', 'int');
|
||||
$date_stopMonth = GETPOST('date_stopmonth', 'int');
|
||||
$date_stopYear = GETPOST('date_stopyear', 'int');
|
||||
$date_stop = ($date_stopDay ? dol_mktime(23, 59, 59, $date_stopMonth, $date_stopDay, $date_stopYear, 'tzuserrel') : dol_stringtotime($date_stop));
|
||||
$date_stop = dol_mktime(23, 59, 59, $date_stopMonth, $date_stopDay, $date_stopYear, 'tzuserrel');
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
@ -348,8 +348,8 @@ if (($action == 'searchfiles' || $action == 'dl')) {
|
||||
$nofile = array();
|
||||
$nofile['id'] = $objd->id;
|
||||
$nofile['entity'] = $objd->entity;
|
||||
$nofile['date'] = $db->idate($objd->date);
|
||||
$nofile['date_due'] = $db->idate($objd->date_due);
|
||||
$nofile['date'] = $db->jdate($objd->date);
|
||||
$nofile['date_due'] = $db->jdate($objd->date_due);
|
||||
$nofile['paid'] = $objd->paid;
|
||||
$nofile['amount_ht'] = $objd->total_ht;
|
||||
$nofile['amount_ttc'] = $objd->total_ttc;
|
||||
@ -368,8 +368,8 @@ if (($action == 'searchfiles' || $action == 'dl')) {
|
||||
foreach ($files as $key => $file) {
|
||||
$file['id'] = $objd->id;
|
||||
$file['entity'] = $objd->entity;
|
||||
$file['date'] = $db->idate($objd->date);
|
||||
$file['date_due'] = $db->idate($objd->date_due);
|
||||
$file['date'] = $db->jdate($objd->date);
|
||||
$file['date_due'] = $db->jdate($objd->date_due);
|
||||
$file['paid'] = $objd->paid;
|
||||
$file['amount_ht'] = $objd->total_ht;
|
||||
$file['amount_ttc'] = $objd->total_ttc;
|
||||
@ -460,7 +460,7 @@ if ($result && $action == "dl" && !$error) {
|
||||
$log .= ','.$langs->transnoentitiesnoconv("Country");
|
||||
$log .= ','.$langs->transnoentitiesnoconv("VATIntra");
|
||||
$log .= ','.$langs->transnoentitiesnoconv("Sens")."\n";
|
||||
$zipname = $dirfortmpfile.'/'.dol_print_date($date_start, 'dayrfc')."-".dol_print_date($date_stop, 'dayrfc').'_export.zip';
|
||||
$zipname = $dirfortmpfile.'/'.dol_print_date($date_start, 'dayrfc', 'tzuserrel')."-".dol_print_date($date_stop, 'dayrfc', 'tzuserrel').'_export.zip';
|
||||
|
||||
dol_delete_file($zipname);
|
||||
|
||||
@ -608,10 +608,14 @@ if (!empty($date_start) && !empty($date_stop)) {
|
||||
print '<form name="dl" action="'.$_SERVER["PHP_SELF"].'?action=dl" method="POST">'."\n";
|
||||
print '<input type="hidden" name="token" value="'.currentToken().'">';
|
||||
|
||||
echo dol_print_date($date_start, 'day')." - ".dol_print_date($date_stop, 'day');
|
||||
echo dol_print_date($date_start, 'day', 'tzuserrel')." - ".dol_print_date($date_stop, 'day', 'tzuserrel');
|
||||
|
||||
print '<input type="hidden" name="date_start" value="'.dol_print_date($date_start, 'dayxcard').'" />';
|
||||
print '<input type="hidden" name="date_stop" value="'.dol_print_date($date_stop, 'dayxcard').'" />';
|
||||
print '<input type="hidden" name="date_startday" value="'.GETPOST('date_startday', 'int').'" />';
|
||||
print '<input type="hidden" name="date_startmonth" value="'.GETPOST('date_startmonth', 'int').'" />';
|
||||
print '<input type="hidden" name="date_startyear" value="'.GETPOST('date_startyear', 'int').'" />';
|
||||
print '<input type="hidden" name="date_stopday" value="'.GETPOST('date_stopday', 'int').'" />';
|
||||
print '<input type="hidden" name="date_stopmonth" value="'.GETPOST('date_stopmonth', 'int').'" />';
|
||||
print '<input type="hidden" name="date_stopyear" value="'.GETPOST('date_stopyear', 'int').'" />';
|
||||
foreach ($listofchoices as $choice => $val) {
|
||||
print '<input type="hidden" name="'.$choice.'" value="'.GETPOST($choice).'">';
|
||||
}
|
||||
@ -741,19 +745,19 @@ if (!empty($date_start) && !empty($date_stop)) {
|
||||
print '<td aling="left">'.$data['paid'].'</td>';
|
||||
|
||||
// Total ET
|
||||
print '<td align="right">'.price($data['sens'] ? $data['amount_ht'] : -$data['amount_ht'])."</td>\n";
|
||||
print '<td align="right">'.price(price2num($data['sens'] ? $data['amount_ht'] : -$data['amount_ht'], 'MT'))."</td>\n";
|
||||
// Total IT
|
||||
print '<td align="right">'.price($data['sens'] ? $data['amount_ttc'] : -$data['amount_ttc'])."</td>\n";
|
||||
print '<td align="right">'.price(price2num($data['sens'] ? $data['amount_ttc'] : -$data['amount_ttc'], 'MT'))."</td>\n";
|
||||
// Total VAT
|
||||
print '<td align="right">'.price($data['sens'] ? $data['amount_vat'] : -$data['amount_vat'])."</td>\n";
|
||||
print '<td align="right">'.price(price2num($data['sens'] ? $data['amount_vat'] : -$data['amount_vat'], 'MT'))."</td>\n";
|
||||
|
||||
print '<td class="tdoverflowmax150" title="'.$data['thirdparty_name'].'">'.$data['thirdparty_name']."</td>\n";
|
||||
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($data['thirdparty_name']).'">'.dol_escape_htmltag($data['thirdparty_name'])."</td>\n";
|
||||
|
||||
print '<td class="center">'.$data['thirdparty_code']."</td>\n";
|
||||
|
||||
print '<td class="center">'.$data['country_code']."</td>\n";
|
||||
|
||||
print '<td align="right">'.$data['vatnum']."</td>\n";
|
||||
print '<td class="tdoverflowmax150 right" title="'.dol_escape_htmltag($data['vatnum']).'">'.dol_escape_htmltag($data['vatnum'])."</td>\n";
|
||||
|
||||
if ($data['sens']) {
|
||||
$totalET_credit += $data['amount_ht'];
|
||||
|
||||
@ -178,7 +178,6 @@ $object->fields = dol_sort_array($object->fields, 'position');
|
||||
$arrayfields = dol_sort_array($arrayfields, 'position');
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
@ -270,13 +269,15 @@ if ((GETPOST('confirm_savestatement', 'alpha') || GETPOST('confirm_reconcile', '
|
||||
|
||||
if (!$error) {
|
||||
$param = 'action=reconcile&contextpage=banktransactionlist&id='.$id.'&search_account='.$id;
|
||||
$param .= '&search_conciliated='.urlencode($search_conciliated);
|
||||
if ($page) {
|
||||
$param .= '&page='.urlencode($page);
|
||||
}
|
||||
if ($offset) {
|
||||
$param .= '&offset='.urlencode($offset);
|
||||
}
|
||||
if ($search_conciliated != '' && $search_conciliated != '-1') {
|
||||
$param .= '&search_conciliated='.urlencode($search_conciliated);
|
||||
}
|
||||
if ($search_thirdparty_user) {
|
||||
$param .= '&search_thirdparty='.urlencode($search_thirdparty_user);
|
||||
}
|
||||
@ -419,7 +420,6 @@ $banklinestatic = new AccountLine($db);
|
||||
|
||||
$now = dol_now();
|
||||
|
||||
|
||||
// Must be before button action
|
||||
$param = '';
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||
@ -757,7 +757,7 @@ if ($resql) {
|
||||
// Confirmation delete
|
||||
if ($action == 'delete') {
|
||||
$text = $langs->trans('ConfirmDeleteTransaction');
|
||||
print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id.'&rowid='.GETPOST("rowid"), $langs->trans('DeleteTransaction'), $text, 'confirm_delete', null, '', 1);
|
||||
print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id.'&rowid='.GETPOST("rowid", 'int'), $langs->trans('DeleteTransaction'), $text, 'confirm_delete', null, '', 1);
|
||||
}
|
||||
|
||||
// Lines of title fields
|
||||
@ -1200,7 +1200,7 @@ if ($resql) {
|
||||
$objforbalance = $db->fetch_object($resqlforbalance);
|
||||
if ($objforbalance) {
|
||||
// If sort is desc,desc,desc then total of previous date + amount is the balancebefore of the previous line before the line to show
|
||||
if ($sortfield == 'b.datev,b.dateo,b.rowid' && $sortorder == 'desc,desc,desc') {
|
||||
if ($sortfield == 'b.datev,b.dateo,b.rowid' && ($sortorder == 'desc' || $sortorder == 'desc,desc' || $sortorder == 'desc,desc,desc')) {
|
||||
$balancebefore = $objforbalance->previoustotal + ($sign * $objp->amount);
|
||||
} else {
|
||||
// If sort is asc,asc,asc then total of previous date is balance of line before the next line to show
|
||||
@ -1285,8 +1285,7 @@ if ($resql) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($sortfield == 'b.datev,b.dateo,b.rowid' && $sortorder == 'desc,desc,desc') {
|
||||
if ($sortfield == 'b.datev,b.dateo,b.rowid' && ($sortorder == 'desc' || $sortorder == 'desc,desc' || $sortorder == 'desc,desc,desc')) {
|
||||
$balance = price2num($balancebefore, 'MT'); // balance = balancebefore of previous line (sort is desc)
|
||||
$balancebefore = price2num($balancebefore - ($sign * $objp->amount), 'MT');
|
||||
} else {
|
||||
|
||||
@ -46,7 +46,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("banks", "categories", "companies", "bills", "trips", "donations", "loan"));
|
||||
$langs->loadLangs(array("banks", "categories", "companies", "bills", "trips", "donations", "loan", "salaries"));
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$id = GETPOST('account', 'int') ? GETPOST('account', 'int') : GETPOST('id', 'int');
|
||||
@ -481,7 +481,7 @@ if (empty($numref)) {
|
||||
|
||||
// Description
|
||||
print '<td valign="center">';
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/bank/line.php?rowid='.$objp->rowid.'&account='.$object->id.'">';
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/bank/line.php?rowid='.$objp->rowid.'&account='.$object->id.'">';
|
||||
$reg = array();
|
||||
preg_match('/\((.+)\)/i', $objp->label, $reg); // Si texte entoure de parenthese on tente recherche de traduction
|
||||
if ($reg[1] && $langs->trans($reg[1]) != $reg[1]) {
|
||||
@ -492,7 +492,7 @@ if (empty($numref)) {
|
||||
print '</a>';
|
||||
|
||||
/*
|
||||
* Ajout les liens (societe, company...)
|
||||
* Add links under the label (link to payment, company, user, social contribution...)
|
||||
*/
|
||||
$newline = 1;
|
||||
$links = $object->get_url($objp->rowid);
|
||||
|
||||
@ -61,8 +61,8 @@ if ($action == 'add') {
|
||||
|
||||
$dateo = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
|
||||
$label = GETPOST('label', 'alpha');
|
||||
$amount = price2num(GETPOST('amount', 'alpha'), 'MT');
|
||||
$amountto = price2num(GETPOST('amountto', 'alpha'), 'MT');
|
||||
$amount = price2num(GETPOST('amount', 'alpha'), 'MT', 2);
|
||||
$amountto = price2num(GETPOST('amountto', 'alpha'), 'MT', 2);
|
||||
|
||||
if (!$label) {
|
||||
$error++;
|
||||
|
||||
@ -128,7 +128,7 @@ if (GETPOST('cancel', 'alpha')) {
|
||||
if ($action == "reopen") {
|
||||
$result = $object->setStatut($object::STATUS_DRAFT, null, '', 'CASHFENCE_REOPEN');
|
||||
if ($result < 0) {
|
||||
dol_print_error($db, $object->error, $object->error);
|
||||
setEventMessages($object->error, $object->error, 'errors');
|
||||
}
|
||||
|
||||
$action = 'view';
|
||||
@ -312,7 +312,7 @@ if ($action == "create" || $action == "start" || $action == 'close') {
|
||||
} elseif ($syear && $smonth && $sday) {
|
||||
$sql .= " AND dateo < '".$db->idate(dol_mktime(0, 0, 0, $smonth, $sday, $syear))."'";
|
||||
} else {
|
||||
dol_print_error('', 'Year not defined');
|
||||
setEventMessages($langs->trans('YearNotDefined'), null, 'errors');
|
||||
}
|
||||
|
||||
$resql = $db->query($sql);
|
||||
@ -356,7 +356,7 @@ if ($action == "create" || $action == "start" || $action == 'close') {
|
||||
} elseif ($syear && $smonth && $sday) {
|
||||
$sql .= " AND datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $smonth, $sday, $syear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $smonth, $sday, $syear))."'";
|
||||
} else {
|
||||
dol_print_error('', 'Year not defined');
|
||||
setEventMessages($langs->trans('YearNotDefined'), null, 'errors');
|
||||
}
|
||||
|
||||
$resql = $db->query($sql);
|
||||
|
||||
@ -1295,7 +1295,14 @@ if (!$error && ($massaction == 'delete' || ($action == 'delete' && $confirm == '
|
||||
if ($objectclass == 'Facture' && empty($conf->global->INVOICE_CAN_ALWAYS_BE_REMOVED) && $objecttmp->status != Facture::STATUS_DRAFT) {
|
||||
$langs->load("errors");
|
||||
$nbignored++;
|
||||
$resaction .= '<div class="error">'.$langs->trans('ErrorOnlyDraftStatusCanBeDeletedInMassAction', $objecttmp->ref).'</div><br>';
|
||||
$TMsg[] = '<div class="error">'.$langs->trans('ErrorOnlyDraftStatusCanBeDeletedInMassAction', $objecttmp->ref).'</div><br>';
|
||||
continue;
|
||||
}
|
||||
|
||||
if (method_exists($objecttmp, 'is_erasable') && $objecttmp->is_erasable() <= 0) {
|
||||
$langs->load("errors");
|
||||
$nbignored++;
|
||||
$TMsg[] = '<div class="error">'.$langs->trans('ErrorRecordHasChildren').' '.$objecttmp->ref.'</div><br>';
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@ -492,7 +492,7 @@ abstract class CommonDocGenerator
|
||||
$array_key.'_remain_to_pay'=>price2num($object->total_ttc - $already_payed_all, 'MT')
|
||||
);
|
||||
|
||||
if (method_exists($object, 'getTotalDiscount') && in_array(get_class($object), array('Proposal', 'Commande', 'Facture', 'SupplierProposal', 'CommandeFournisseur', 'FactureFournisseur'))) {
|
||||
if (method_exists($object, 'getTotalDiscount') && in_array(get_class($object), array('Propal', 'Proposal', 'Commande', 'Facture', 'SupplierProposal', 'CommandeFournisseur', 'FactureFournisseur'))) {
|
||||
$resarray[$array_key.'_total_discount_ht_locale'] = price($object->getTotalDiscount(), 0, $outputlangs);
|
||||
$resarray[$array_key.'_total_discount_ht'] = price2num($object->getTotalDiscount());
|
||||
} else {
|
||||
@ -516,8 +516,9 @@ abstract class CommonDocGenerator
|
||||
// Add vat by rates
|
||||
if (is_array($object->lines) && count($object->lines) > 0) {
|
||||
$totalUp = 0;
|
||||
// Set substitution keys for different VAT rates
|
||||
foreach ($object->lines as $line) {
|
||||
// $line->tva_tx format depends on database field accuraty, no reliable. This is kept for backward compatibility
|
||||
// $line->tva_tx format depends on database field accuracy, no reliable. This is kept for backward compatibility
|
||||
if (empty($resarray[$array_key.'_total_vat_'.$line->tva_tx])) {
|
||||
$resarray[$array_key.'_total_vat_'.$line->tva_tx] = 0;
|
||||
}
|
||||
@ -538,7 +539,7 @@ abstract class CommonDocGenerator
|
||||
// Note that this added fields does not match a field into database in Dolibarr (Dolibarr manage discount on lines not as a global property of object)
|
||||
$resarray['object_total_up'] = $totalUp;
|
||||
$resarray['object_total_up_locale'] = price($resarray['object_total_up'], 0, $outputlangs);
|
||||
if (method_exists($object, 'getTotalDiscount') && in_array(get_class($object), array('Proposal', 'Commande', 'Facture', 'SupplierProposal', 'CommandeFournisseur', 'FactureFournisseur'))) {
|
||||
if (method_exists($object, 'getTotalDiscount') && in_array(get_class($object), array('Propal', 'Proposal', 'Commande', 'Facture', 'SupplierProposal', 'CommandeFournisseur', 'FactureFournisseur'))) {
|
||||
$totalDiscount = $object->getTotalDiscount();
|
||||
} else {
|
||||
$totalDiscount = 0;
|
||||
|
||||
@ -1926,7 +1926,7 @@ class Form
|
||||
$sql .= " WHERE u.entity IS NOT NULL";
|
||||
}
|
||||
} else {
|
||||
if (!empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
|
||||
if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ug";
|
||||
$sql .= " ON ug.fk_user = u.rowid";
|
||||
$sql .= " WHERE ug.entity = ".$conf->entity;
|
||||
@ -4905,8 +4905,9 @@ class Form
|
||||
$formconfirm .= ($question ? '<div class="confirmmessage">'.img_help('', '').' '.$question.'</div>' : '');
|
||||
$formconfirm .= '</div>'."\n";
|
||||
|
||||
$formconfirm .= "\n<!-- begin ajax formconfirm page=".$page." -->\n";
|
||||
$formconfirm .= "\n<!-- begin code of popup for formconfirm page=".$page." -->\n";
|
||||
$formconfirm .= '<script type="text/javascript">'."\n";
|
||||
$formconfirm .= "/* Code for the jQuery('#dialogforpopup').dialog() */\n";
|
||||
$formconfirm .= 'jQuery(document).ready(function() {
|
||||
$(function() {
|
||||
$( "#'.$dialogconfirm.'" ).dialog(
|
||||
|
||||
@ -358,10 +358,19 @@ class Utils
|
||||
|
||||
dol_syslog("Utils::dumpDatabase execmethod=".$execmethod." command:".$fullcommandcrypted, LOG_INFO);
|
||||
|
||||
|
||||
/* If value has been forced with a php_admin_value, this has no effect. Example of value: '512M' */
|
||||
$MemoryLimit = getDolGlobalString('MAIN_MEMORY_LIMIT_DUMP');
|
||||
if (!empty($MemoryLimit)) {
|
||||
@ini_set('memory_limit', $MemoryLimit);
|
||||
}
|
||||
|
||||
|
||||
// TODO Replace with executeCLI function
|
||||
if ($execmethod == 1) {
|
||||
$output_arr = array();
|
||||
$retval = null;
|
||||
|
||||
exec($fullcommandclear, $output_arr, $retval);
|
||||
|
||||
if ($retval != 0) {
|
||||
|
||||
@ -233,7 +233,7 @@ abstract class DoliDB implements Database
|
||||
* Define sort criteria of request
|
||||
*
|
||||
* @param string $sortfield List of sort fields, separated by comma. Example: 't1.fielda,t2.fieldb'
|
||||
* @param string $sortorder Sort order, separated by comma. Example: 'ASC,DESC';
|
||||
* @param string $sortorder Sort order, separated by comma. Example: 'ASC,DESC'. Note: If the quantity fo sortorder values is lower than sortfield, we used the last value for missing values.
|
||||
* @return string String to provide syntax of a sort sql string
|
||||
*/
|
||||
public function order($sortfield = null, $sortorder = null)
|
||||
|
||||
@ -663,9 +663,13 @@ class DoliDBMysqli extends DoliDB
|
||||
|
||||
$like = '';
|
||||
if ($table) {
|
||||
$like = "LIKE '".$table."'";
|
||||
$tmptable = preg_replace('/[^a-z0-9\.\-\_%]/i', '', $table);
|
||||
|
||||
$like = "LIKE '".$this->escape($tmptable)."'";
|
||||
}
|
||||
$sql = "SHOW TABLES FROM ".$database." ".$like.";";
|
||||
$tmpdatabase = preg_replace('/[^a-z0-9\.\-\_]/i', '', $database);
|
||||
|
||||
$sql = "SHOW TABLES FROM ".$tmpdatabase." ".$like.";";
|
||||
//print $sql;
|
||||
$result = $this->query($sql);
|
||||
if ($result) {
|
||||
@ -688,7 +692,9 @@ class DoliDBMysqli extends DoliDB
|
||||
// phpcs:enable
|
||||
$infotables = array();
|
||||
|
||||
$sql = "SHOW FULL COLUMNS FROM ".$table.";";
|
||||
$tmptable = preg_replace('/[^a-z0-9\.\-\_]/i', '', $table);
|
||||
|
||||
$sql = "SHOW FULL COLUMNS FROM ".$tmptable.";";
|
||||
|
||||
dol_syslog($sql, LOG_DEBUG);
|
||||
$result = $this->query($sql);
|
||||
@ -794,7 +800,9 @@ class DoliDBMysqli extends DoliDB
|
||||
public function DDLDropTable($table)
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql = "DROP TABLE ".$table;
|
||||
$tmptable = preg_replace('/[^a-z0-9\.\-\_]/i', '', $table);
|
||||
|
||||
$sql = "DROP TABLE ".$tmptable;
|
||||
|
||||
if (!$this->query($sql)) {
|
||||
return -1;
|
||||
@ -925,8 +933,9 @@ class DoliDBMysqli extends DoliDB
|
||||
public function DDLDropField($table, $field_name)
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql = "ALTER TABLE ".$table." DROP COLUMN `".$field_name."`";
|
||||
dol_syslog(get_class($this)."::DDLDropField ".$sql, LOG_DEBUG);
|
||||
$tmp_field_name = preg_replace('/[^a-z0-9\.\-\_]/i', '', $field_name);
|
||||
|
||||
$sql = "ALTER TABLE ".$table." DROP COLUMN `".$tmp_field_name."`";
|
||||
if ($this->query($sql)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -937,7 +937,9 @@ class DoliDBPgsql extends DoliDB
|
||||
|
||||
$escapedlike = '';
|
||||
if ($table) {
|
||||
$escapedlike = " AND table_name LIKE '".$this->escape($table)."'";
|
||||
$tmptable = preg_replace('/[^a-z0-9\.\-\_%]/i', '', $table);
|
||||
|
||||
$escapedlike = " AND table_name LIKE '".$this->escape($tmptable)."'";
|
||||
}
|
||||
$result = pg_query($this->db, "SELECT table_name FROM information_schema.tables WHERE table_schema = 'public'".$escapedlike." ORDER BY table_name");
|
||||
if ($result) {
|
||||
@ -973,8 +975,8 @@ class DoliDBPgsql extends DoliDB
|
||||
$sql .= " '' as \"Extra\",";
|
||||
$sql .= " '' as \"Privileges\"";
|
||||
$sql .= " FROM information_schema.columns infcol";
|
||||
$sql .= " WHERE table_schema='public' ";
|
||||
$sql .= " AND table_name='".$this->escape($table)."'";
|
||||
$sql .= " WHERE table_schema = 'public' ";
|
||||
$sql .= " AND table_name = '".$this->escape($table)."'";
|
||||
$sql .= " ORDER BY ordinal_position;";
|
||||
|
||||
dol_syslog($sql, LOG_DEBUG);
|
||||
@ -1078,7 +1080,9 @@ class DoliDBPgsql extends DoliDB
|
||||
public function DDLDropTable($table)
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql = "DROP TABLE ".$table;
|
||||
$tmptable = preg_replace('/[^a-z0-9\.\-\_]/i', '', $table);
|
||||
|
||||
$sql = "DROP TABLE ".$tmptable;
|
||||
|
||||
if (!$this->query($sql)) {
|
||||
return -1;
|
||||
@ -1236,8 +1240,9 @@ class DoliDBPgsql extends DoliDB
|
||||
public function DDLDropField($table, $field_name)
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql = "ALTER TABLE ".$table." DROP COLUMN ".$field_name;
|
||||
dol_syslog($sql, LOG_DEBUG);
|
||||
$tmp_field_name = preg_replace('/[^a-z0-9\.\-\_]/i', '', $field_name);
|
||||
|
||||
$sql = "ALTER TABLE ".$table." DROP COLUMN ".$tmp_field_name;
|
||||
if (!$this->query($sql)) {
|
||||
$this->error = $this->lasterror();
|
||||
return -1;
|
||||
|
||||
@ -875,9 +875,13 @@ class DoliDBSqlite3 extends DoliDB
|
||||
|
||||
$like = '';
|
||||
if ($table) {
|
||||
$like = "LIKE '".$table."'";
|
||||
$tmptable = preg_replace('/[^a-z0-9\.\-\_%]/i', '', $table);
|
||||
|
||||
$like = "LIKE '".$this->escape($tmptable)."'";
|
||||
}
|
||||
$sql = "SHOW TABLES FROM ".$database." ".$like.";";
|
||||
$tmpdatabase = preg_replace('/[^a-z0-9\.\-\_]/i', '', $database);
|
||||
|
||||
$sql = "SHOW TABLES FROM ".$tmpdatabase." ".$like.";";
|
||||
//print $sql;
|
||||
$result = $this->query($sql);
|
||||
if ($result) {
|
||||
@ -901,7 +905,9 @@ class DoliDBSqlite3 extends DoliDB
|
||||
// phpcs:enable
|
||||
$infotables = array();
|
||||
|
||||
$sql = "SHOW FULL COLUMNS FROM ".$table.";";
|
||||
$tmptable = preg_replace('/[^a-z0-9\.\-\_]/i', '', $table);
|
||||
|
||||
$sql = "SHOW FULL COLUMNS FROM ".$tmptable.";";
|
||||
|
||||
dol_syslog($sql, LOG_DEBUG);
|
||||
$result = $this->query($sql);
|
||||
@ -1002,7 +1008,9 @@ class DoliDBSqlite3 extends DoliDB
|
||||
public function DDLDropTable($table)
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql = "DROP TABLE ".$table;
|
||||
$tmptable = preg_replace('/[^a-z0-9\.\-\_]/i', '', $table);
|
||||
|
||||
$sql = "DROP TABLE ".$tmptable;
|
||||
|
||||
if (!$this->query($sql)) {
|
||||
return -1;
|
||||
@ -1112,8 +1120,9 @@ class DoliDBSqlite3 extends DoliDB
|
||||
public function DDLDropField($table, $field_name)
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql = "ALTER TABLE ".$table." DROP COLUMN `".$field_name."`";
|
||||
dol_syslog(get_class($this)."::DDLDropField ".$sql, LOG_DEBUG);
|
||||
$tmp_field_name = preg_replace('/[^a-z0-9\.\-\_]/i', '', $field_name);
|
||||
|
||||
$sql = "ALTER TABLE ".$table." DROP COLUMN `".$tmp_field_name."`";
|
||||
if (!$this->query($sql)) {
|
||||
$this->error = $this->lasterror();
|
||||
return -1;
|
||||
|
||||
@ -5378,13 +5378,16 @@ function price2num($amount, $rounding = '', $option = 0)
|
||||
if ($thousand != ',' && $thousand != '.') {
|
||||
$amount = str_replace(',', '.', $amount); // To accept 2 notations for french users
|
||||
}
|
||||
|
||||
$amount = str_replace(' ', '', $amount); // To avoid spaces
|
||||
$amount = str_replace($thousand, '', $amount); // Replace of thousand before replace of dec to avoid pb if thousand is .
|
||||
$amount = str_replace($dec, '.', $amount);
|
||||
|
||||
$amount = preg_replace('/[^0-9\-\.]/', '', $amount); // Clean non numeric chars (so it clean some UTF8 spaces for example.
|
||||
}
|
||||
//print ' XX'.$amount.' '.$rounding;
|
||||
|
||||
// Now, make a rounding if required
|
||||
// Now, $amount is a real PHP float number. We make a rounding if required.
|
||||
if ($rounding) {
|
||||
$nbofdectoround = '';
|
||||
if ($rounding == 'MU') {
|
||||
@ -5424,9 +5427,12 @@ function price2num($amount, $rounding = '', $option = 0)
|
||||
if ($thousand != ',' && $thousand != '.') {
|
||||
$amount = str_replace(',', '.', $amount); // To accept 2 notations for french users
|
||||
}
|
||||
|
||||
$amount = str_replace(' ', '', $amount); // To avoid spaces
|
||||
$amount = str_replace($thousand, '', $amount); // Replace of thousand before replace of dec to avoid pb if thousand is .
|
||||
$amount = str_replace($dec, '.', $amount);
|
||||
|
||||
$amount = preg_replace('/[^0-9\-\.]/', '', $amount); // Clean non numeric chars (so it clean some UTF8 spaces for example.
|
||||
}
|
||||
|
||||
return $amount;
|
||||
|
||||
@ -2247,13 +2247,11 @@ function pdf_getLinkedObjects(&$object, $outputlangs)
|
||||
} elseif ($objecttype == 'commande' || $objecttype == 'supplier_order') {
|
||||
$outputlangs->load('orders');
|
||||
|
||||
if (count($objects) > 1) {
|
||||
$object->note_public .= dol_concatdesc($object->note_public, '<br>'.$outputlangs->transnoentities("RefOrder").' : <br>');
|
||||
if (count($objects) > 1 && count($objects) <= (getDolGlobalInt("MAXREFONDOC") ? getDolGlobalInt("MAXREFONDOC") : 10)) {
|
||||
$object->note_public = dol_concatdesc($object->note_public, '<br>'.$outputlangs->transnoentities("RefOrder").' : <br>');
|
||||
foreach ($objects as $elementobject) {
|
||||
$object->note_public .= dol_concatdesc($object->note_public, $outputlangs->transnoentities($elementobject->ref).($elementobject->ref_client ? ' ('.$elementobject->ref_client.')' : '').($elementobject->ref_supplier ? ' ('.$elementobject->ref_supplier.')' : '').' ');
|
||||
$object->note_public .= dol_concatdesc($object->note_public, $outputlangs->transnoentities("OrderDate").' : ');
|
||||
$object->note_public .= dol_concatdesc($object->note_public, dol_print_date($elementobject->date, 'day', '', $outputlangs));
|
||||
$object->note_public .= dol_concatdesc($object->note_public, '<br>');
|
||||
$object->note_public = dol_concatdesc($object->note_public, $outputlangs->transnoentities($elementobject->ref).($elementobject->ref_client ? ' ('.$elementobject->ref_client.')' : '').($elementobject->ref_supplier ? ' ('.$elementobject->ref_supplier.')' : '').' ');
|
||||
$object->note_public = dol_concatdesc($object->note_public, $outputlangs->transnoentities("OrderDate").' : '.dol_print_date($elementobject->date, 'day', '', $outputlangs).'<br>');
|
||||
}
|
||||
} elseif (count($objects) == 1) {
|
||||
$elementobject = array_shift($objects);
|
||||
@ -2283,8 +2281,11 @@ function pdf_getLinkedObjects(&$object, $outputlangs)
|
||||
|
||||
if (count($objects) > 1) {
|
||||
$order = null;
|
||||
if (empty($object->linkedObjects['commande']) && $object->element != 'commande') $object->note_public .= dol_concatdesc($object->note_public, '<br>'.$outputlangs->transnoentities("RefOrder").' / '.$outputlangs->transnoentities("RefSending").' : <br>');
|
||||
else $object->note_public .= dol_concatdesc($object->note_public, '<br>'.$outputlangs->transnoentities("RefSending").' : <br>');
|
||||
if (empty($object->linkedObjects['commande']) && $object->element != 'commande') {
|
||||
$object->note_public = dol_concatdesc($object->note_public, '<br>'.$outputlangs->transnoentities("RefOrder").' / '.$outputlangs->transnoentities("RefSending").' : <br>');
|
||||
} else {
|
||||
$object->note_public = dol_concatdesc($object->note_public, '<br>'.$outputlangs->transnoentities("RefSending").' : <br>');
|
||||
}
|
||||
// We concat this record info into fields xxx_value. title is overwrote.
|
||||
foreach ($objects as $elementobject) {
|
||||
if (empty($object->linkedObjects['commande']) && $object->element != 'commande') { // There is not already a link to order and object is not the order, so we show also info with order
|
||||
@ -2300,12 +2301,12 @@ function pdf_getLinkedObjects(&$object, $outputlangs)
|
||||
}
|
||||
|
||||
if (! is_object($order)) {
|
||||
$object->note_public .= dol_concatdesc($object->note_public, $outputlangs->transnoentities($elementobject->ref));
|
||||
$object->note_public .= dol_concatdesc($object->note_public, '<br>');
|
||||
$object->note_public = dol_concatdesc($object->note_public, $outputlangs->transnoentities($elementobject->ref));
|
||||
$object->note_public = dol_concatdesc($object->note_public, '<br>');
|
||||
} else {
|
||||
$object->note_public .= dol_concatdesc($object->note_public, $outputlangs->convToOutputCharset($order->ref).($order->ref_client ? ' ('.$order->ref_client.')' : ''));
|
||||
$object->note_public .= dol_concatdesc($object->note_public, ' / '.$outputlangs->transnoentities($elementobject->ref));
|
||||
$object->note_public .= dol_concatdesc($object->note_public, '<br>');
|
||||
$object->note_public = dol_concatdesc($object->note_public, $outputlangs->convToOutputCharset($order->ref).($order->ref_client ? ' ('.$order->ref_client.')' : ''));
|
||||
$object->note_public = dol_concatdesc($object->note_public, ' / '.$outputlangs->transnoentities($elementobject->ref));
|
||||
$object->note_public = dol_concatdesc($object->note_public, '<br>');
|
||||
}
|
||||
}
|
||||
} elseif (count($objects) == 1) {
|
||||
|
||||
@ -269,11 +269,11 @@ class DataPolicy
|
||||
$actionmsg = $langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto;
|
||||
if ($message) {
|
||||
if ($sendtocc) {
|
||||
$actionmsg .= dol_concatdesc($actionmsg, $langs->transnoentities('Bcc').": ".$sendtocc);
|
||||
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc').": ".$sendtocc);
|
||||
}
|
||||
$actionmsg .= dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic').": ".$subject);
|
||||
$actionmsg .= dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody').":");
|
||||
$actionmsg .= dol_concatdesc($actionmsg, $message);
|
||||
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic').": ".$subject);
|
||||
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody').":");
|
||||
$actionmsg = dol_concatdesc($actionmsg, $message);
|
||||
}
|
||||
|
||||
// Send mail
|
||||
@ -311,7 +311,6 @@ class DataPolicy
|
||||
|
||||
$sendto = $adherent->email;
|
||||
|
||||
|
||||
$code = md5($adherent->email);
|
||||
if (!empty($adherent->default_lang)) {
|
||||
$l = $adherent->default_lang;
|
||||
@ -343,11 +342,11 @@ class DataPolicy
|
||||
$actionmsg = $langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto;
|
||||
if ($message) {
|
||||
if ($sendtocc) {
|
||||
$actionmsg .= dol_concatdesc($actionmsg, $langs->transnoentities('Bcc').": ".$sendtocc);
|
||||
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc').": ".$sendtocc);
|
||||
}
|
||||
$actionmsg .= dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic').": ".$subject);
|
||||
$actionmsg .= dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody').":");
|
||||
$actionmsg .= dol_concatdesc($actionmsg, $message);
|
||||
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic').": ".$subject);
|
||||
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody').":");
|
||||
$actionmsg = dol_concatdesc($actionmsg, $message);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -686,14 +686,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
|
||||
$MAXEVENT = 10;
|
||||
|
||||
$morehtmlright = '<a href="'.dol_buildpath('/hrm/evaluation_agenda.php', 1).'?id='.$object->id.'">';
|
||||
$morehtmlright .= $langs->trans("SeeAll");
|
||||
$morehtmlright .= '</a>';
|
||||
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/hrm/evaluation_agenda.php?id='.$object->id);
|
||||
|
||||
// List of actions on element
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
|
||||
$formactions = new FormActions($db);
|
||||
$somethingshown = $formactions->showactions($object, $object->element.'@'.$object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlright);
|
||||
$somethingshown = $formactions->showactions($object, $object->element.'@'.$object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter);
|
||||
|
||||
print '</div></div>';
|
||||
}
|
||||
|
||||
@ -454,14 +454,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
|
||||
$MAXEVENT = 10;
|
||||
|
||||
$morehtmlright = '<a href="' . dol_buildpath('/hrm/job_agenda.php', 1) . '?id=' . $object->id . '">';
|
||||
$morehtmlright .= $langs->trans("SeeAll");
|
||||
$morehtmlright .= '</a>';
|
||||
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/hrm/job_agenda.php?id='.$object->id);
|
||||
|
||||
// List of actions on element
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
|
||||
$formactions = new FormActions($db);
|
||||
$somethingshown = $formactions->showactions($object, $object->element . '@' . $object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlright);
|
||||
$somethingshown = $formactions->showactions($object, $object->element . '@' . $object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter);
|
||||
|
||||
print '</div></div>';
|
||||
}
|
||||
|
||||
@ -377,13 +377,12 @@ if ($action !== 'edit' && $action !== 'create') {
|
||||
|
||||
$MAXEVENT = 10;
|
||||
|
||||
$morehtmlright = '<a href="' . dol_buildpath('/hrm/position_agenda.php', 1) . '?id=' . $object->id . '">';
|
||||
$morehtmlright .= $langs->trans("SeeAll");
|
||||
$morehtmlright .= '</a>';
|
||||
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/hrm/position_agenda.php?id='.$object->id);
|
||||
|
||||
// List of actions on element
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
|
||||
$formactions = new FormActions($db);
|
||||
$somethingshown = $formactions->showactions($object, $object->element . '@' . $object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlright);
|
||||
$somethingshown = $formactions->showactions($object, $object->element . '@' . $object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter);
|
||||
|
||||
print '</div></div>';
|
||||
}
|
||||
|
||||
@ -840,13 +840,12 @@ if ($action != "create" && $action != "edit") {
|
||||
|
||||
$MAXEVENT = 10;
|
||||
|
||||
$morehtmlright = '<a href="' . dol_buildpath('/hrm/skill_agenda.php', 1) . '?id=' . $object->id . '">';
|
||||
$morehtmlright .= $langs->trans("SeeAll");
|
||||
$morehtmlright .= '</a>';
|
||||
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/hrm/skill_agenda.php?id='.$object->id);
|
||||
|
||||
// List of actions on element
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
|
||||
$formactions = new FormActions($db);
|
||||
$somethingshown = $formactions->showactions($object, $object->element . '@' . $object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlright);
|
||||
$somethingshown = $formactions->showactions($object, $object->element . '@' . $object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter);
|
||||
|
||||
print '</div></div>';
|
||||
}
|
||||
|
||||
@ -260,6 +260,7 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ
|
||||
);
|
||||
|
||||
$listtables = $db->DDLListTables($conf->db->name, '');
|
||||
|
||||
foreach ($listtables as $val) {
|
||||
// Database prefix filter
|
||||
if (preg_match('/^'.MAIN_DB_PREFIX.'/', $val)) {
|
||||
|
||||
@ -475,14 +475,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
|
||||
$MAXEVENT = 10;
|
||||
|
||||
$morehtmlright = '<a href="'.DOL_URL_ROOT.'/knowledgemanagement/knowledgerecord_agenda.php?id='.$object->id.'">';
|
||||
$morehtmlright .= $langs->trans("SeeAll");
|
||||
$morehtmlright .= '</a>';
|
||||
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/knowledgemanagement/knowledgerecord_agenda.php?id='.$object->id);
|
||||
|
||||
// List of actions on element
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
|
||||
$formactions = new FormActions($db);
|
||||
$somethingshown = $formactions->showactions($object, $object->element.'@'.$object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlright);
|
||||
$somethingshown = $formactions->showactions($object, $object->element.'@'.$object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter);
|
||||
|
||||
print '</div></div>';
|
||||
}
|
||||
|
||||
@ -133,3 +133,4 @@ SplitSale=Split sale
|
||||
PrintWithoutDetailsButton=Add "Print without details" button
|
||||
PrintWithoutDetailsLabelDefault=Line label by default on printing without details
|
||||
PrintWithoutDetails=Print without details
|
||||
YearNotDefined=Year is not defined
|
||||
|
||||
@ -114,7 +114,7 @@ ReturnCodeLastAccessInError=Return code for latest database access request error
|
||||
InformationLastAccessInError=Information for latest database access request error
|
||||
DolibarrHasDetectedError=Dolibarr has detected a technical error
|
||||
YouCanSetOptionDolibarrMainProdToZero=You can read log file or set option $dolibarr_main_prod to '0' in your config file to get more information.
|
||||
InformationToHelpDiagnose=This information can be useful for diagnostic purposes (you can set option $dolibarr_main_prod to '1' to remove such notices)
|
||||
InformationToHelpDiagnose=This information can be useful for diagnostic purposes (you can set option $dolibarr_main_prod to '1' to hide sensitive information)
|
||||
MoreInformation=More information
|
||||
TechnicalInformation=Technical information
|
||||
TechnicalID=Technical ID
|
||||
|
||||
@ -5,7 +5,7 @@ ProposalShort=Proposal
|
||||
ProposalsDraft=Draft commercial proposals
|
||||
ProposalsOpened=Open commercial proposals
|
||||
CommercialProposal=Commercial proposal
|
||||
PdfCommercialProposalTitle=Commercial proposal
|
||||
PdfCommercialProposalTitle=Proposal
|
||||
ProposalCard=Proposal card
|
||||
NewProp=New commercial proposal
|
||||
NewPropal=New proposal
|
||||
|
||||
@ -96,7 +96,7 @@ RealStock=Real Stock
|
||||
RealStockDesc=Physical/real stock is the stock currently in the warehouses.
|
||||
RealStockWillAutomaticallyWhen=The real stock will be modified according to this rule (as defined in the Stock module):
|
||||
VirtualStock=Virtual stock
|
||||
VirtualStockAtDate=Virtual stock at date
|
||||
VirtualStockAtDate=Virtual stock at a future date
|
||||
VirtualStockAtDateDesc=Virtual stock once all the pending orders that are planned to be processed before the chosen date will be finished
|
||||
VirtualStockDesc=Virtual stock is the calculated stock available once all open/pending actions (that affect stocks) are closed (purchase orders received, sales orders shipped, manufacturing orders produced, etc)
|
||||
AtDate=At date
|
||||
|
||||
@ -3208,7 +3208,7 @@ if (!function_exists("llxFooter")) {
|
||||
}
|
||||
|
||||
// A div for the address popup
|
||||
print "\n<!-- A div to allow dialog popup -->\n";
|
||||
print "\n<!-- A div to allow dialog popup by jQuery('#dialogforpopup').dialog() -->\n";
|
||||
print '<div id="dialogforpopup" style="display: none;"></div>'."\n";
|
||||
|
||||
// Add code for the asynchronous anonymous first ping (for telemetry)
|
||||
|
||||
@ -1 +1 @@
|
||||
Directory where widgets files are stored.
|
||||
# Directory where widgets files are stored
|
||||
|
||||
@ -55,9 +55,9 @@ class mailing_mailinglist_mymodule_myobject extends MailingTargets
|
||||
|
||||
|
||||
/**
|
||||
* Affiche formulaire de filtre qui apparait dans page de selection des destinataires de mailings
|
||||
* Displays the filter form that appears in the mailing recipient selection page
|
||||
*
|
||||
* @return string Retourne zone select
|
||||
* @return string Return select zone
|
||||
*/
|
||||
public function formFilter()
|
||||
{
|
||||
@ -83,7 +83,7 @@ class mailing_mailinglist_mymodule_myobject extends MailingTargets
|
||||
|
||||
|
||||
/**
|
||||
* Renvoie url lien vers fiche de la source du destinataire du mailing
|
||||
* Returns url link to file of the source of the recipient of the mailing
|
||||
*
|
||||
* @param int $id ID
|
||||
* @return string Url lien
|
||||
@ -115,7 +115,7 @@ class mailing_mailinglist_mymodule_myobject extends MailingTargets
|
||||
}
|
||||
$sql .= " ORDER BY email";
|
||||
|
||||
// Stocke destinataires dans target
|
||||
// Store recipients in target
|
||||
$result = $this->db->query($sql);
|
||||
if ($result) {
|
||||
$num = $this->db->num_rows($result);
|
||||
|
||||
@ -148,8 +148,8 @@ class modMyModule extends DolibarrModules
|
||||
$this->need_dolibarr_version = array(11, -3); // Minimum version of Dolibarr required by module
|
||||
|
||||
// Messages at activation
|
||||
$this->warnings_activation = array(); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','ES'='textes'...)
|
||||
$this->warnings_activation_ext = array(); // Warning to show when we activate an external module. array('always'='text') or array('FR'='textfr','ES'='textes'...)
|
||||
$this->warnings_activation = array(); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','MX'='textmx'...)
|
||||
$this->warnings_activation_ext = array(); // Warning to show when we activate an external module. array('always'='text') or array('FR'='textfr','MX'='textmx'...)
|
||||
//$this->automatic_activation = array('FR'=>'MyModuleWasAutomaticallyActivatedBecauseOfYourCountryChoice');
|
||||
//$this->always_enabled = true; // If true, can't be disabled
|
||||
|
||||
|
||||
@ -562,14 +562,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
|
||||
$MAXEVENT = 10;
|
||||
|
||||
$morehtmlright = '<a href="'.dol_buildpath('/mymodule/myobject_agenda.php', 1).'?id='.$object->id.'">';
|
||||
$morehtmlright .= $langs->trans("SeeAll");
|
||||
$morehtmlright .= '</a>';
|
||||
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', dol_buildpath('/mymodule/myobject_agenda.php', 1).'?id='.$object->id);
|
||||
|
||||
// List of actions on element
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
|
||||
$formactions = new FormActions($db);
|
||||
$somethingshown = $formactions->showactions($object, $object->element.'@'.$object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlright);
|
||||
$somethingshown = $formactions->showactions($object, $object->element.'@'.$object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter);
|
||||
|
||||
print '</div></div>';
|
||||
}
|
||||
|
||||
@ -692,14 +692,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
|
||||
$MAXEVENT = 10;
|
||||
|
||||
$morehtmlright = '<a href="'.dol_buildpath('/mrp/mo_agenda.php', 1).'?id='.$object->id.'">';
|
||||
$morehtmlright .= $langs->trans("SeeAll");
|
||||
$morehtmlright .= '</a>';
|
||||
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/mrp/mo_agenda.php?id='.$object->id);
|
||||
|
||||
// List of actions on element
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
|
||||
$formactions = new FormActions($db);
|
||||
$somethingshown = $formactions->showactions($object, $object->element, $socid, 1, '', $MAXEVENT, '', $morehtmlright);
|
||||
$somethingshown = $formactions->showactions($object, $object->element, $socid, 1, '', $MAXEVENT, '', $morehtmlcenter);
|
||||
|
||||
print '</div></div>';
|
||||
}
|
||||
|
||||
@ -121,10 +121,10 @@ function partnershipPrepareHead($object)
|
||||
$head[$h][2] = 'document';
|
||||
$h++;
|
||||
|
||||
// $head[$h][0] = dol_buildpath("/partnership/partnership_agenda.php", 1).'?id='.$object->id;
|
||||
// $head[$h][1] = $langs->trans("Events");
|
||||
// $head[$h][2] = 'agenda';
|
||||
// $h++;
|
||||
$head[$h][0] = dol_buildpath("/partnership/partnership_agenda.php", 1).'?id='.$object->id;
|
||||
$head[$h][1] = $langs->trans("Events");
|
||||
$head[$h][2] = 'agenda';
|
||||
$h++;
|
||||
|
||||
// Show more tabs from modules
|
||||
// Entries must be declared in modules descriptor with line
|
||||
|
||||
@ -643,14 +643,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
|
||||
$MAXEVENT = 10;
|
||||
|
||||
$morehtmlright = '<a href="'.DOL_URL_ROOT.'/partnership/partnership_agenda.php?id='.$object->id.'">';
|
||||
$morehtmlright .= $langs->trans("SeeAll");
|
||||
$morehtmlright .= '</a>';
|
||||
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/partnership/partnership_agenda.php?id='.$object->id);
|
||||
|
||||
// List of actions on element
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
|
||||
$formactions = new FormActions($db);
|
||||
$somethingshown = $formactions->showactions($object, $object->element, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlright);
|
||||
$somethingshown = $formactions->showactions($object, $object->element, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter);
|
||||
|
||||
print '</div></div>';
|
||||
}
|
||||
|
||||
@ -2705,14 +2705,12 @@ if ($action != 'create' && $action != 'edit' && $action != 'delete') {
|
||||
|
||||
$MAXEVENT = 10;
|
||||
|
||||
$morehtmlright = '<a href="'.DOL_URL_ROOT.'/product/agenda.php?id='.$object->id.'">';
|
||||
$morehtmlright .= $langs->trans("SeeAll");
|
||||
$morehtmlright .= '</a>';
|
||||
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/product/agenda.php?id='.$object->id);
|
||||
|
||||
// List of actions on element
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
|
||||
$formactions = new FormActions($db);
|
||||
$somethingshown = $formactions->showactions($object, 'product', 0, 1, '', $MAXEVENT, '', $morehtmlright); // Show all action for product
|
||||
$somethingshown = $formactions->showactions($object, 'product', 0, 1, '', $MAXEVENT, '', $morehtmlcenter); // Show all action for product
|
||||
|
||||
print '</div></div>';
|
||||
}
|
||||
|
||||
@ -455,14 +455,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
|
||||
$MAXEVENT = 10;
|
||||
|
||||
$morehtmlright = '<a href="'.dol_buildpath('/product/inventory/inventory_info.php', 1).'?id='.$object->id.'">';
|
||||
$morehtmlright .= $langs->trans("SeeAll");
|
||||
$morehtmlright .= '</a>';
|
||||
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/product/inventory/inventory_info.php?id='.$object->id);
|
||||
|
||||
// List of actions on element
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
|
||||
$formactions = new FormActions($db);
|
||||
$somethingshown = $formactions->showactions($object, $object->element, 0, 1, '', $MAXEVENT, '', $morehtmlright);
|
||||
$somethingshown = $formactions->showactions($object, $object->element, 0, 1, '', $MAXEVENT, '', $morehtmlcenter);
|
||||
|
||||
print '</div></div>';
|
||||
}
|
||||
|
||||
@ -966,14 +966,13 @@ if ($action != 'create' && $action != 'edit' && $action != 'delete') {
|
||||
|
||||
$MAXEVENT = 10;
|
||||
|
||||
$morehtmlright = '<a href="'.DOL_URL_ROOT.'/product/agenda.php?id='.$object->id.'">';
|
||||
$morehtmlright .= $langs->trans("SeeAll");
|
||||
$morehtmlright .= '</a>';
|
||||
$morehtmlcenter = '';
|
||||
//$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/product/stock/agenda.php?id='.$object->id);
|
||||
|
||||
// List of actions on element
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
|
||||
$formactions = new FormActions($db);
|
||||
$somethingshown = $formactions->showactions($object, 'stock', 0, 1, '', $MAXEVENT, '', $morehtmlright); // Show all action for product
|
||||
$somethingshown = $formactions->showactions($object, 'stock', 0, 1, '', $MAXEVENT, '', $morehtmlcenter); // Show all action for product
|
||||
|
||||
print '</div></div>';
|
||||
}
|
||||
|
||||
@ -1207,14 +1207,12 @@ if ($action != 'create' && $action != 'edit' && $action != 'delete' && $id > 0)
|
||||
|
||||
$MAXEVENT = 10;
|
||||
|
||||
$morehtmlright = '<a href="'.DOL_URL_ROOT.'/product/agenda.php?id='.$object->id.'">';
|
||||
$morehtmlright .= $langs->trans("SeeAll");
|
||||
$morehtmlright .= '</a>';
|
||||
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/product/agenda.php?id='.$object->id);
|
||||
|
||||
// List of actions on element
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
|
||||
$formactions = new FormActions($db);
|
||||
$somethingshown = $formactions->showactions($object, 'mouvement', 0, 1, '', $MAXEVENT, '', $morehtmlright); // Show all action for product
|
||||
$somethingshown = $formactions->showactions($object, 'mouvement', 0, 1, '', $MAXEVENT, '', $morehtmlcenter); // Show all action for product
|
||||
|
||||
print '</div></div>';
|
||||
}
|
||||
|
||||
@ -763,7 +763,7 @@ if ($id > 0 || $ref) {
|
||||
if ($result < 0) {
|
||||
dol_print_error($db, $object->error);
|
||||
}
|
||||
$helpondiff .= ' ('.$langs->trans("ProductQtyInDraft").': '.$object->stats_commande['qty'].')';
|
||||
$helpondiff .= ' <span class="opacitymedium">('.$langs->trans("ProductQtyInDraft").': '.$object->stats_commande['qty'].')</span>';
|
||||
}
|
||||
|
||||
// Number of product from customer order already sent (partial shipping)
|
||||
@ -797,7 +797,7 @@ if ($id > 0 || $ref) {
|
||||
if ($result < 0) {
|
||||
dol_print_error($db, $object->error);
|
||||
}
|
||||
$helpondiff .= ' ('.$langs->trans("ProductQtyInDraftOrWaitingApproved").': '.$object->stats_commande_fournisseur['qty'].')';
|
||||
$helpondiff .= ' <span class="opacitymedium">('.$langs->trans("ProductQtyInDraftOrWaitingApproved").': '.$object->stats_commande_fournisseur['qty'].')</span>';
|
||||
}
|
||||
|
||||
// Number of product from supplier order already received (partial receipt)
|
||||
@ -983,6 +983,7 @@ if (!$variants) {
|
||||
$entrepotstatic = new Entrepot($db);
|
||||
$product_lot_static = new Productlot($db);
|
||||
|
||||
$num = 0;
|
||||
$total = 0;
|
||||
$totalvalue = $totalvaluesell = 0;
|
||||
|
||||
@ -1025,18 +1026,45 @@ if (!$variants) {
|
||||
print '<td class="right amount nowraponall">'.(price2num($object->pmp) ? price(price2num($object->pmp * $obj->reel, 'MT')) : '').'</td>';
|
||||
|
||||
// Sell price
|
||||
$minsellprice = null; $maxsellprice = null;
|
||||
print '<td class="right">';
|
||||
print price(price2num($object->price, 'MU'), 1);
|
||||
if (!empty($conf->global->PRODUIT_MULTIPRICES)) {
|
||||
foreach ($object->multiprices as $priceforlevel) {
|
||||
if (is_numeric($priceforlevel)) {
|
||||
if (is_null($maxsellprice) || $priceforlevel > $maxsellprice) {
|
||||
$maxsellprice = $priceforlevel;
|
||||
}
|
||||
if (is_null($minsellprice) || $priceforlevel < $minsellprice) {
|
||||
$minsellprice = $priceforlevel;
|
||||
}
|
||||
}
|
||||
}
|
||||
print '<span class="valignmiddle">';
|
||||
if ($minsellprice != $maxsellprice) {
|
||||
print price(price2num($minsellprice, 'MU'), 1).' - '.price(price2num($maxsellprice, 'MU'), 1);
|
||||
} else {
|
||||
print price(price2num($minsellprice, 'MU'), 1);
|
||||
}
|
||||
print '</span>';
|
||||
print $form->textwithpicto('', $langs->trans("Variable"));
|
||||
} else {
|
||||
print price(price2num($object->price, 'MU'), 1);
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Value sell
|
||||
print '<td class="right amount nowraponall">';
|
||||
print price(price2num($object->price * $obj->reel, 'MT'), 1);
|
||||
if (!empty($conf->global->PRODUIT_MULTIPRICES)) {
|
||||
print '<span class="valignmiddle">';
|
||||
if ($minsellprice != $maxsellprice) {
|
||||
print price(price2num($minsellprice * $obj->reel, 'MT'), 1).' - '.price(price2num($maxsellprice * $obj->reel, 'MT'), 1);
|
||||
} else {
|
||||
print price(price2num($minsellprice * $obj->reel, 'MT'), 1);
|
||||
}
|
||||
print '</span>';
|
||||
print $form->textwithpicto('', $langs->trans("Variable"));
|
||||
} else {
|
||||
print price(price2num($object->price * $obj->reel, 'MT'), 1);
|
||||
}
|
||||
print '</td>';
|
||||
print '<td></td>';
|
||||
@ -1148,17 +1176,28 @@ if (!$variants) {
|
||||
print $totalvalue ? price(price2num($totalvalue, 'MT'), 1) : ' ';
|
||||
print '</td>';
|
||||
print '<td class="liste_total right">';
|
||||
print ($total ? price($totalvaluesell / $total, 1) : ' ');
|
||||
if (!empty($conf->global->PRODUIT_MULTIPRICES)) {
|
||||
print $form->textwithpicto('', $langs->trans("Variable"));
|
||||
if ($num) {
|
||||
if ($total) {
|
||||
print '<span class="valignmiddle">';
|
||||
if (!empty($conf->global->PRODUIT_MULTIPRICES)) {
|
||||
print $form->textwithpicto('', $langs->trans("Variable"));
|
||||
} else {
|
||||
print price($totalvaluesell / $total, 1);
|
||||
}
|
||||
print '</span>';
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
// Value to sell
|
||||
print '<td class="liste_total right">';
|
||||
if (empty($conf->global->PRODUIT_MULTIPRICES)) {
|
||||
print price(price2num($totalvaluesell, 'MT'), 1);
|
||||
} else {
|
||||
print $langs->trans("Variable");
|
||||
print '<td class="liste_total right amount">';
|
||||
if ($num) {
|
||||
print '<span class="valignmiddle">';
|
||||
if (empty($conf->global->PRODUIT_MULTIPRICES)) {
|
||||
print price(price2num($totalvaluesell, 'MT'), 1);
|
||||
} else {
|
||||
print $form->textwithpicto('', $langs->trans("Variable"));
|
||||
}
|
||||
print '</span>';
|
||||
}
|
||||
print '</td>';
|
||||
print '<td></td>';
|
||||
@ -1180,13 +1219,13 @@ if (!$variants) {
|
||||
}
|
||||
print '<table class="noborder centpercent">';
|
||||
if (!empty($user->rights->produit->creer)) {
|
||||
print '<tr class="liste_titre"><td width="40%">'.$formproduct->selectWarehouses('', 'fk_entrepot').'</td>';
|
||||
print '<tr class="liste_titre"><td>'.$formproduct->selectWarehouses('', 'fk_entrepot').'</td>';
|
||||
print '<td class="right"><input name="seuil_stock_alerte" type="text" placeholder="'.$langs->trans("StockLimit").'" /></td>';
|
||||
print '<td class="right"><input name="desiredstock" type="text" placeholder="'.$langs->trans("DesiredStock").'" /></td>';
|
||||
print '<td class="right"><input type="submit" value="'.$langs->trans("Save").'" class="button button-save" /></td>';
|
||||
print '</tr>';
|
||||
} else {
|
||||
print '<tr class="liste_titre"><td width="40%">'.$langs->trans("Warehouse").'</td>';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Warehouse").'</td>';
|
||||
print '<td class="right">'.$langs->trans("StockLimit").'</td>';
|
||||
print '<td class="right">'.$langs->trans("DesiredStock").'</td>';
|
||||
print '</tr>';
|
||||
@ -1200,7 +1239,7 @@ if (!$variants) {
|
||||
foreach ($lines as $line) {
|
||||
$ent = new Entrepot($db);
|
||||
$ent->fetch($line['fk_entrepot']);
|
||||
print '<tr class="oddeven"><td width="40%">'.$ent->getNomUrl(3).'</td>';
|
||||
print '<tr class="oddeven"><td>'.$ent->getNomUrl(3).'</td>';
|
||||
print '<td class="right">'.$line['seuil_stock_alerte'].'</td>';
|
||||
print '<td class="right">'.$line['desiredstock'].'</td>';
|
||||
if (!empty($user->rights->produit->creer)) {
|
||||
|
||||
@ -171,6 +171,7 @@ if ($object->usage_bill_time) {
|
||||
}
|
||||
|
||||
// Extra fields
|
||||
$extrafieldsobjectkey = $taskstatic->table_element;
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
|
||||
|
||||
$arrayfields = dol_sort_array($arrayfields, 'position');
|
||||
@ -969,7 +970,6 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
$extrafieldsobjectkey = $taskstatic->table_element;
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
|
||||
|
||||
// Action column
|
||||
|
||||
@ -660,14 +660,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
|
||||
$MAXEVENT = 10;
|
||||
|
||||
$morehtmlright = '<a href="'.dol_buildpath('/recruitment/recruitmentcandidature_agenda.php', 1).'?id='.$object->id.'">';
|
||||
$morehtmlright .= $langs->trans("SeeAll");
|
||||
$morehtmlright .= '</a>';
|
||||
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/recruitment/recruitmentcandidature_agenda.php?id='.$object->id);
|
||||
|
||||
// List of actions on element
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
|
||||
$formactions = new FormActions($db);
|
||||
$somethingshown = $formactions->showactions($object, $object->element.'@recruitment', (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlright);
|
||||
$somethingshown = $formactions->showactions($object, $object->element.'@recruitment', (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter);
|
||||
|
||||
print '</div></div>';
|
||||
}
|
||||
|
||||
@ -560,14 +560,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
|
||||
$MAXEVENT = 10;
|
||||
|
||||
$morehtmlright = '<a href="'.dol_buildpath('/recruitment/recruitmentjobposition_agenda.php', 1).'?id='.$object->id.'">';
|
||||
$morehtmlright .= $langs->trans("SeeAll");
|
||||
$morehtmlright .= '</a>';
|
||||
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/recruitment/recruitmentjobposition_agenda.php?id='.$object->id);
|
||||
|
||||
// List of actions on element
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
|
||||
$formactions = new FormActions($db);
|
||||
$somethingshown = $formactions->showactions($object, $object->element.'@recruitment', (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlright);
|
||||
$somethingshown = $formactions->showactions($object, $object->element.'@recruitment', (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter);
|
||||
|
||||
print '</div></div>';
|
||||
}
|
||||
|
||||
@ -1235,7 +1235,7 @@ if (!empty($arrayfields['s.import_key']['checked'])) {
|
||||
print '</td>';
|
||||
}
|
||||
// Action column
|
||||
print '<td class="liste_titre center">';
|
||||
print '<td class="liste_titre center actioncolumn">';
|
||||
$searchpicto = $form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
@ -1243,10 +1243,10 @@ print '</td>';
|
||||
print "</tr>\n";
|
||||
print '<tr class="liste_titre">';
|
||||
if (!empty($arrayfields['s.rowid']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['s.rowid']['label'], $_SERVER["PHP_SELF"], "s.rowid", "", $param, ' data-key="id"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($arrayfields['s.rowid']['label'], $_SERVER["PHP_SELF"], "s.rowid", "", $param, ' data-key="id"', $sortfield, $sortorder, 'actioncolumn ');
|
||||
}
|
||||
if (!empty($arrayfields['s.nom']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], "s.nom", "", $param, ' data-key="ref"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], "s.nom", "", $param, ' data-key="ref"', $sortfield, $sortorder, 'actioncolumn ');
|
||||
}
|
||||
if (!empty($arrayfields['s.name_alias']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['s.name_alias']['label'], $_SERVER["PHP_SELF"], "s.name_alias", "", $param, "", $sortfield, $sortorder);
|
||||
@ -1357,7 +1357,7 @@ if (!empty($arrayfields['s.status']['checked'])) {
|
||||
if (!empty($arrayfields['s.import_key']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['s.import_key']['label'], $_SERVER["PHP_SELF"], "s.import_key", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
}
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch actioncolumn ');
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
@ -1703,7 +1703,7 @@ while ($i < min($num, $limit)) {
|
||||
}
|
||||
|
||||
// Action column (Show the massaction button only when this page is not opend from the Extended POS)
|
||||
print '<td class="nowrap center">';
|
||||
print '<td class="nowrap center actioncolumn">';
|
||||
if (($massactionbutton || $massaction) && $contextpage != 'poslist') { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||
$selected = 0;
|
||||
if (in_array($obj->rowid, $arrayofselected)) {
|
||||
|
||||
@ -75,7 +75,7 @@ if ($object->id > 0) {
|
||||
$upload_dir = $conf->supplier_proposal->dir_output.'/'.dol_sanitizeFileName($object->ref);
|
||||
}
|
||||
|
||||
|
||||
$permissiontoadd = $user->rights->supplier_proposal->creer;
|
||||
|
||||
/*
|
||||
* Actions
|
||||
|
||||
@ -820,10 +820,11 @@ $( document ).ready(function() {
|
||||
if ($_SESSION["takeposterminal"] == "") {
|
||||
print "ModalBox('ModalTerminal');";
|
||||
}
|
||||
|
||||
if (getDolGlobalString('TAKEPOS_CONTROL_CASH_OPENING')) {
|
||||
$sql = "SELECT rowid, status FROM ".MAIN_DB_PREFIX."pos_cash_fence WHERE";
|
||||
$sql .= " entity = ".$conf->entity." AND ";
|
||||
$sql .= " posnumber = ".$_SESSION["takeposterminal"]." AND ";
|
||||
$sql .= " entity = ".((int) $conf->entity)." AND ";
|
||||
$sql .= " posnumber = ".((int) $_SESSION["takeposterminal"])." AND ";
|
||||
$sql .= " date_creation > '".$db->idate(dol_get_first_hour(dol_now()))."'";
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
@ -1105,9 +1106,10 @@ if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter") {
|
||||
}
|
||||
|
||||
$sql = "SELECT rowid, status, entity FROM ".MAIN_DB_PREFIX."pos_cash_fence WHERE";
|
||||
$sql .= " entity = ".$conf->entity." AND ";
|
||||
$sql .= " posnumber = ".$_SESSION["takeposterminal"]." AND ";
|
||||
$sql .= " entity = ".((int) $conf->entity)." AND ";
|
||||
$sql .= " posnumber = ".((int) $_SESSION["takeposterminal"])." AND ";
|
||||
$sql .= " date_creation > '".$db->idate(dol_get_first_hour(dol_now()))."'";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
@ -3385,12 +3385,27 @@ td.border, div.tagtable div div.border {
|
||||
width:auto;
|
||||
}
|
||||
|
||||
/* To have left column sticky
|
||||
.tagtable td[data-key="ref"] {
|
||||
/* To have left column sticky */
|
||||
/*.tagtable td[data-key="ref"], .tagtable th[data-key="ref"] {
|
||||
position: sticky;
|
||||
left: 0;
|
||||
top: 0;
|
||||
max-width: 150px !important;
|
||||
//background-color: inherit;
|
||||
background-color: gainsboro;
|
||||
z-index: 2;
|
||||
}
|
||||
*/
|
||||
|
||||
/* To have right column sticky */
|
||||
/*.tagtable td.actioncolumn, .tagtable th.actioncolumn {
|
||||
position: sticky-right;
|
||||
right: 0;
|
||||
top: 0;
|
||||
max-width: 150px !important;
|
||||
//background-color: inherit;
|
||||
background-color: gainsboro;
|
||||
z-index: 2;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
@ -1407,6 +1407,10 @@ table[summary="list_of_modules"] .fa-cog {
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
tr.nobottom td {
|
||||
border-bottom: 0px !important;
|
||||
}
|
||||
|
||||
|
||||
/* ============================================================================== */
|
||||
/* Styles to hide objects */
|
||||
@ -2266,6 +2270,19 @@ div#tmenu_tooltip {
|
||||
<?php } ?>
|
||||
}
|
||||
|
||||
li.tmenusel::after, li.tmenu:hover::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
bottom: 0px;
|
||||
left: 50%;
|
||||
left: calc(50% - 6px);
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-style: solid;
|
||||
border-width: 0px 6px 5px 6px;
|
||||
border-color: transparent transparent #ffffff transparent;
|
||||
}
|
||||
|
||||
div.tmenusep {
|
||||
<?php if ($disableimages) { ?>
|
||||
display: none;
|
||||
@ -2359,9 +2376,7 @@ li.tmenu, li.tmenusel {
|
||||
li.tmenu:hover {
|
||||
opacity: .50; /* show only a slight shadow */
|
||||
}
|
||||
li.tmenusel a.tmenusel {
|
||||
text-decoration: underline !important;
|
||||
}
|
||||
|
||||
.tmenuend .tmenuleft { width: 0px; }
|
||||
.tmenuend { display: none; }
|
||||
|
||||
@ -3382,6 +3397,33 @@ td.border, div.tagtable div div.border {
|
||||
width:auto;
|
||||
}
|
||||
|
||||
<?php if (!empty($conf->global->THEME_ENABLE_STICKY_COLUMN_REF)) { ?>
|
||||
/* To have left column sticky */
|
||||
.tagtable td[data-key="ref"], .tagtable th[data-key="ref"] {
|
||||
position: sticky;
|
||||
left: 0;
|
||||
top: 0;
|
||||
max-width: 150px !important;
|
||||
//background-color: inherit;
|
||||
background-color: gainsboro;
|
||||
z-index: 2;
|
||||
}
|
||||
<?php } ?>
|
||||
|
||||
<?php if (!empty($conf->global->THEME_ENABLE_STICKY_COLUMN_ACTION)) { ?>
|
||||
/* To have right column sticky */
|
||||
.tagtable td.actioncolumn, .tagtable th.actioncolumn {
|
||||
position: sticky;
|
||||
right: 0;
|
||||
top: 0;
|
||||
max-width: 150px !important;
|
||||
//background-color: inherit;
|
||||
background-color: gainsboro;
|
||||
z-index: 2;
|
||||
}
|
||||
<?php } ?>
|
||||
|
||||
|
||||
|
||||
/* Main boxes */
|
||||
.nobordertop, .nobordertop tr:first-of-type td {
|
||||
@ -4487,6 +4529,11 @@ div#card-errors {
|
||||
z-index: 1002 !important; /* Default 101 with jquery, top menu have a z-index of 1000 */
|
||||
}
|
||||
|
||||
div#dialogforpopup {
|
||||
background-color: #f8f8f8 !important;
|
||||
}
|
||||
|
||||
|
||||
/* ============================================================================== */
|
||||
/* For content of image preview */
|
||||
/* ============================================================================== */
|
||||
@ -5577,6 +5624,10 @@ input.select2-input {
|
||||
color: #FFF !important;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--multiple .select2-selection__choice {
|
||||
border: 1px solid #e4e4e4;
|
||||
}
|
||||
|
||||
.blockvmenusearch .select2-container--default .select2-selection--single,
|
||||
.blockvmenubookmarks .select2-container--default .select2-selection--single
|
||||
{
|
||||
|
||||
@ -100,7 +100,7 @@ $badgeStatus0 = '#cbd3d3';
|
||||
$badgeStatus1 = '#bc9526';
|
||||
$badgeStatus2 = '#e6f0f0';
|
||||
$badgeStatus3 = '#bca52b';
|
||||
$badgeStatus4 = '#277d1e';
|
||||
$badgeStatus4 = '#25a580';
|
||||
$badgeStatus5 = '#cad2d2';
|
||||
$badgeStatus6 = '#cad2d2';
|
||||
$badgeStatus7 = '#277d1e';
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file test/phpunit/SqlTest.php
|
||||
* \file test/phpunit/CodingPhpTest.php
|
||||
* \ingroup test
|
||||
* \brief PHPUnit test
|
||||
* \remarks To run this script as CLI: phpunit filename.php
|
||||
@ -363,7 +363,7 @@ class CodingPhpTest extends PHPUnit\Framework\TestCase
|
||||
// Check string sql|set|WHERE|...'".$yyy->xxx with xxx that is not 'escape', 'idate', .... It means we forget a db->escape when forging sql request.
|
||||
$ok=true;
|
||||
$matches=array();
|
||||
preg_match_all('/(sql|SET|WHERE|INSERT|VALUES).+\s*\'"\s*\.\s*\$(.......)/', $filecontent, $matches, PREG_SET_ORDER);
|
||||
preg_match_all('/(sql|SET|WHERE|INSERT|VALUES|LIKE).+\s*\'"\s*\.\s*\$(.......)/', $filecontent, $matches, PREG_SET_ORDER);
|
||||
foreach ($matches as $key => $val) {
|
||||
if (! in_array($val[2], array('this->d', 'this->e', 'db->esc', 'dbs->es', 'mydb->e', 'dbsessi', 'db->ida', 'escaped', 'exclude', 'include'))) {
|
||||
$ok=false; // This will generate error
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file test/phpunit/SqlTest.php
|
||||
* \file test/phpunit/CodingSqlTest.php
|
||||
* \ingroup test
|
||||
* \brief PHPUnit test
|
||||
* \remarks To run this script as CLI: phpunit filename.php
|
||||
|
||||
@ -1321,8 +1321,8 @@ class FunctionsLibTest extends PHPUnit\Framework\TestCase
|
||||
$this->assertEquals(1, price2num('1.000'), 'Test 1.000 give 1 with english language');
|
||||
|
||||
// Text can't be converted
|
||||
$this->assertEquals('12.4$', price2num('12.4$'));
|
||||
$this->assertEquals('12.4$', price2num('12r.4$'));
|
||||
$this->assertEquals('12.4', price2num('12.4$'));
|
||||
$this->assertEquals('12.4', price2num('12r.4$'));
|
||||
|
||||
// For spanish language
|
||||
$newlangs2 = new Translate('', $conf);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user