Merge branch '16.0' of git@github.com:Dolibarr/dolibarr.git into develop

Conflicts:
	htdocs/accountancy/admin/productaccount.php
	htdocs/accountancy/index.php
	htdocs/product/admin/product.php
This commit is contained in:
Laurent Destailleur 2022-08-25 14:35:08 +02:00
commit 2e905b127a
28 changed files with 175 additions and 94 deletions

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2016 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2016 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2016-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2016-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -40,6 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
$langs->loadLangs(array("accountancy", "compta"));
$action = GETPOST('action', 'aZ09');
$optioncss = GETPOST('optioncss', 'alpha');
$contextpage = GETPOST('contextpage', 'aZ09');
// Load variable for pagination
@ -158,7 +159,8 @@ if (empty($user->rights->accounting->mouvements->lire)) {
* Action
*/
$parameters = array('socid'=>$socid);
$parameters = array();
$arrayfields = array();
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');

View File

@ -212,7 +212,7 @@ if (!empty($conf->global->INVOICE_USE_SITUATION) && $conf->global->INVOICE_USE_S
print $s;
print "<br>\n";
if (isModEnabled('expensereport')|| isModEnabled('deplacement')) {
if (isModEnabled('expensereport') || isModEnabled('deplacement')) {
$step++;
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64 + $step), $langs->transnoentitiesnoconv("ExpenseReports"), '{s}')."\n";
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/accountancy/expensereport/index.php"><strong>'.$langs->transnoentitiesnoconv("TransferInAccounting").' - '.$langs->transnoentitiesnoconv("ExpenseReportsVentilation").'</strong></a>', $s);

View File

@ -496,8 +496,12 @@ class Proposals extends DolibarrApi
$request_data = (object) $request_data;
$request_data->desc = sanitizeVal($request_data->desc, 'restricthtml');
$request_data->label = sanitizeVal($request_data->label);
if (isset($request_data->desc)) {
$request_data->desc = sanitizeVal($request_data->desc, 'restricthtml');
}
if (isset($request_data->label)) {
$request_data->label = sanitizeVal($request_data->label);
}
$propalline = new PropaleLigne($this->db);
$result = $propalline->fetch($lineid);

View File

@ -1,9 +1,10 @@
<?php
/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2019 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2017 Pierre-Henry Favre <support@atm-consulting.fr>
* Copyright (C) 2020 Maxime DEMAREST <maxime@indelog.fr>
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2019 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2017 Pierre-Henry Favre <support@atm-consulting.fr>
* Copyright (C) 2020 Maxime DEMAREST <maxime@indelog.fr>
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.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
@ -626,6 +627,7 @@ print '</form>'."\n";
print dol_get_fiche_end();
$param = '';
if (!empty($date_start) && !empty($date_stop)) {
$param .= '&date_startday='.GETPOST('date_startday', 'int');
$param .= '&date_startmonth='.GETPOST('date_startmonth', 'int');

View File

@ -69,12 +69,12 @@ if (!$sortorder) {
// Date range
$year = GETPOST('year', 'int');
if (empty($year)) {
$year_current = strftime("%Y", dol_now());
$month_current = strftime("%m", dol_now());
$year_current = dol_print_date(dol_now(), "%Y");
$month_current = dol_print_date(dol_now(), "%m");
$year_start = $year_current;
} else {
$year_current = $year;
$month_current = strftime("%m", dol_now());
$month_current = dol_print_date(dol_now(), "%m");
$year_start = $year;
}
$date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear);
@ -1039,7 +1039,7 @@ if ($modecompta == 'BOOKKEEPING') {
if ($modecompta == 'CREANCES-DETTES' || $modecompta == 'RECETTES-DEPENSES') {
$langs->load('trips');
if ($modecompta == 'CREANCES-DETTES') {
$sql = "SELECT p.rowid, p.ref, u.rowid as userid, u.firstname, u.lastname, date_format(date_valid,'%Y-%m') as dm, sum(p.total_ht) as amount_ht,sum(p.total_ttc) as amount_ttc";
$sql = "SELECT p.rowid, p.ref, u.rowid as userid, u.firstname, u.lastname, date_format(date_valid,'%Y-%m') as dm, p.total_ht as amount_ht, p.total_ttc as amount_ttc";
$sql .= " FROM ".MAIN_DB_PREFIX."expensereport as p";
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user_author";
$sql .= " WHERE p.entity IN (".getEntity('expensereport').")";
@ -1047,7 +1047,7 @@ if ($modecompta == 'BOOKKEEPING') {
$column = 'p.date_valid';
} else {
$sql = "SELECT p.rowid, p.ref, u.rowid as userid, u.firstname, u.lastname, date_format(pe.datep,'%Y-%m') as dm, sum(p.total_ht) as amount_ht, sum(p.total_ttc) as amount_ttc";
$sql = "SELECT p.rowid, p.ref, u.rowid as userid, u.firstname, u.lastname, date_format(pe.datep,'%Y-%m') as dm, sum(pe.amount) as amount_ht, sum(pe.amount) as amount_ttc";
$sql .= " FROM ".MAIN_DB_PREFIX."expensereport as p";
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user_author";
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."payment_expensereport as pe ON pe.fk_expensereport = p.rowid";

View File

@ -47,12 +47,12 @@ $nbofyear = 4;
// Date range
$year = GETPOST('year', 'int');
if (empty($year)) {
$year_current = strftime("%Y", dol_now());
$month_current = strftime("%m", dol_now());
$year_current = dol_print_date(dol_now(), "%Y");
$month_current = dol_print_date(dol_now(), "%m");
$year_start = $year_current - ($nbofyear - 1);
} else {
$year_current = $year;
$month_current = strftime("%m", dol_now());
$month_current = dol_print_date(dol_now(), "%m");
$year_start = $year - ($nbofyear - 1);
}
$date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear);

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2016-2017 Jamal Elbaz <jamelbaz@gmail.com>
* Copyright (C) 2016 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2016-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2018-2020 Laurent Destailleur <eldy@destailleur.fr>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
*
@ -228,7 +228,7 @@ if ($modecompta == "CREANCES-DETTES") {
$period .= ' &nbsp; &nbsp; '.$langs->trans("DetailByAccount").' '.$form->selectarray('showaccountdetail', $arraylist, $showaccountdetail, 0);
$periodlink = $textprevyear.$textnextyear;
$exportlink = '';
$description = $langs->trans("RulesResultBookkeepingPersonalized").
$description = $langs->trans("RulesResultBookkeepingPersonalized");
$description .= ' ('.$langs->trans("SeePageForSetup", DOL_URL_ROOT.'/accountancy/admin/categories_list.php?search_country_id='.$mysoc->country_id.'&mainmenu=accountancy&leftmenu=accountancy_admin', $langs->transnoentitiesnoconv("Accountancy").' / '.$langs->transnoentitiesnoconv("Setup").' / '.$langs->transnoentitiesnoconv("AccountingCategory")).')';
//if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.= $langs->trans("DepositsAreNotIncluded");
//else $description.= $langs->trans("DepositsAreIncluded");

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2018 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.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
@ -54,7 +55,9 @@ if (empty($year)) {
}
$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear"), 'tzserver'); // We use timezone of server so report is same from everywhere
$date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzserver'); // We use timezone of server so report is same from everywhere
// Quarter
$q = '';
if (empty($date_start) || empty($date_end)) { // We define date_start and date_end
$q = GETPOST("q", "int");
if (empty($q)) {
@ -155,10 +158,12 @@ foreach ($listofparams as $param) {
llxHeader('', $langs->trans("TurnoverReport"), '', '', 0, 0, '', '', $morequerystring);
$exportlink="";
$namelink="";
//print load_fiche_titre($langs->trans("VAT"),"");
//$fsearch.='<br>';
$fsearch = '';
$fsearch .= ' <input type="hidden" name="year" value="'.$year.'">';
$fsearch .= ' <input type="hidden" name="modetax" value="'.$modetax.'">';
//$fsearch.=' '.$langs->trans("SalesTurnoverMinimum").': ';
@ -198,14 +203,17 @@ if ($nextquarter < 4) {
$nextquarter = 1;
$nextyear++;
}
$description .= $fsearch;
$description = $fsearch;
$builddate = dol_now();
if (!empty($conf->global->MAIN_MODULE_ACCOUNTING)) {
$description .= '<br>'.$langs->trans("ThisIsAnEstimatedValue");
}
if ($conf->global->TAX_MODE_SELL_PRODUCT == 'invoice') {
$description .= $langs->trans("RulesVATDueProducts");
$description .= '<br>'.$langs->trans("RulesVATDueProducts");
}
if ($conf->global->TAX_MODE_SELL_PRODUCT == 'payment') {
$description .= $langs->trans("RulesVATInProducts");
$description .= '<br>'.$langs->trans("RulesVATInProducts");
}
if ($conf->global->TAX_MODE_SELL_SERVICE == 'invoice') {
$description .= '<br>'.$langs->trans("RulesVATDueServices");
@ -216,9 +224,6 @@ if ($conf->global->TAX_MODE_SELL_SERVICE == 'payment') {
if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
$description .= '<br>'.$langs->trans("DepositsAreNotIncluded");
}
if (!empty($conf->global->MAIN_MODULE_ACCOUNTING)) {
$description .= '<br>'.$langs->trans("ThisIsAnEstimatedValue");
}
// Customers invoices
$elementcust = $langs->trans("CustomersInvoices");
@ -229,9 +234,6 @@ $amountcust = $langs->trans("AmountHT");
$elementsup = $langs->trans("SuppliersInvoices");
$productsup = $productcust;
$amountsup = $amountcust;
$namesup = $namecust;
// TODO Report from bookkeeping not yet available, so we switch on report on business events
if ($modecompta == "BOOKKEEPING") {
@ -247,7 +249,7 @@ if ($modecompta == "CREANCES-DETTES") {
$calcmode = $langs->trans("CalcModeDebt");
//$calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modecompta=RECETTES-DEPENSES">','</a>').')';
$description = $langs->trans("RulesCADue");
$description .= '<br>'.$langs->trans("RulesCADue");
if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
$description .= $langs->trans("DepositsAreNotIncluded");
} else {
@ -260,7 +262,7 @@ if ($modecompta == "CREANCES-DETTES") {
$calcmode = $langs->trans("CalcModeEngagement");
//$calcmode.='<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modecompta=CREANCES-DETTES">','</a>').')';
$description = $langs->trans("RulesCAIn");
$description .= $langs->trans("RulesCAIn");
$description .= $langs->trans("DepositsAreIncluded");
$builddate = dol_now();

View File

@ -3,6 +3,7 @@
* Copyright (C) 2013-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.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
@ -186,7 +187,9 @@ if (!empty($year)) {
if (!empty($month)) {
$headerparams['month'] = $month;
}
$headerparams['q'] = $q;
if (!empty($q)) {
$headerparams['q'] = $q;
}
$tableparams = array();
if (!empty($selected_cat)) {
@ -205,6 +208,7 @@ $allparams = array_merge($commonparams, $headerparams, $tableparams);
$headerparams = array_merge($commonparams, $headerparams);
$tableparams = array_merge($commonparams, $tableparams);
$paramslink="";
foreach ($allparams as $key => $value) {
$paramslink .= '&'.$key.'='.$value;
}
@ -227,6 +231,9 @@ if ($modecompta == "BOOKKEEPINGCOLLECTED") {
$modecompta = "RECETTES-DEPENSES";
}
$exportlink="";
$namelink="";
// Show report header
if ($modecompta == "CREANCES-DETTES") {
$name = $langs->trans("Turnover").', '.$langs->trans("ByProductsAndServices");

View File

@ -4,6 +4,7 @@
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2013 Antoine Iauch <aiauch@gpcsolutions.fr>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.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
@ -135,23 +136,36 @@ $commonparams['sortorder'] = $sortorder;
$commonparams['sortfield'] = $sortfield;
$headerparams = array();
$headerparams['date_startyear'] = $date_startyear;
$headerparams['date_startmonth'] = $date_startmonth;
$headerparams['date_startday'] = $date_startday;
$headerparams['date_endyear'] = $date_endyear;
$headerparams['date_endmonth'] = $date_endmonth;
$headerparams['date_endday'] = $date_endday;
$headerparams['q'] = $q;
if (!empty($date_startyear)) {
$headerparams['date_startyear'] = $date_startyear;
}
if (!empty($date_startmonth)) {
$headerparams['date_startmonth'] = $date_startmonth;
}
if (!empty($date_startday)) {
$headerparams['date_startday'] = $date_startday;
}
if (!empty($date_endyear)) {
$headerparams['date_endyear'] = $date_endyear;
}
if (!empty($date_endmonth)) {
$headerparams['date_endmonth'] = $date_endmonth;
}
if (!empty($date_endday)) {
$headerparams['date_endday'] = $date_endday;
}
if (!empty($q)) {
$headerparams['q'] = $q;
}
$tableparams = array();
$tableparams['search_categ'] = $selected_cat;
$tableparams['subcat'] = ($subcat === true) ? 'yes' : '';
// Adding common parameters
$allparams = array_merge($commonparams, $headerparams, $tableparams);
$headerparams = array_merge($commonparams, $headerparams);
$tableparams = array_merge($commonparams, $tableparams);
$paramslink="";
foreach ($allparams as $key => $value) {
$paramslink .= '&'.$key.'='.$value;
}
@ -172,6 +186,9 @@ if ($modecompta == "BOOKKEEPINGCOLLECTED") {
$modecompta = "RECETTES-DEPENSES";
}
$exportlink="";
$namelink="";
// Show report header
if ($modecompta == "CREANCES-DETTES") {
$name = $langs->trans("Turnover").', '.$langs->trans("ByUserAuthorOfInvoice");
@ -230,6 +247,8 @@ foreach ($headerparams as $key => $value) {
}
$catotal = 0;
$catotal_ht = 0;
if ($modecompta == 'CREANCES-DETTES') {
$sql = "SELECT u.rowid as rowid, u.lastname as name, u.firstname as firstname, sum(f.total_ht) as amount, sum(f.total_ttc) as amount_ttc";
$sql .= " FROM ".MAIN_DB_PREFIX."user as u";
@ -245,8 +264,8 @@ if ($modecompta == 'CREANCES-DETTES') {
}
} elseif ($modecompta == "RECETTES-DEPENSES") {
/*
* Liste des paiements (les anciens paiements ne sont pas vus par cette requete car, sur les
* vieilles versions, ils n'etaient pas lies via paiement_facture. On les ajoute plus loin)
* List of payments (old payments are not seen by this query because on older versions,
* they were not linked via the table llx_paiement_facture. They are added later)
*/
$sql = "SELECT u.rowid as rowid, u.lastname as name, u.firstname as firstname, sum(pf.amount) as amount_ttc";
$sql .= " FROM ".MAIN_DB_PREFIX."user as u";
@ -287,7 +306,7 @@ if ($result) {
dol_print_error($db);
}
// Adding old-version payments, non-bound by "paiement_facture" then without User
// Adding old-version payments, non-bound by table llx_paiement_facture then without User
if ($modecompta == 'RECETTES-DEPENSES') {
$sql = "SELECT -1 as rowidx, '' as name, '' as firstname, sum(DISTINCT p.amount) as amount_ttc";
$sql .= " FROM ".MAIN_DB_PREFIX."bank as b";

View File

@ -6,6 +6,7 @@
* Copyright (C) 2013 Antoine Iauch <aiauch@gpcsolutions.fr>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.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
@ -158,13 +159,27 @@ $commonparams['sortorder'] = $sortorder;
$commonparams['sortfield'] = $sortfield;
$headerparams = array();
$headerparams['date_startyear'] = $date_startyear;
$headerparams['date_startmonth'] = $date_startmonth;
$headerparams['date_startday'] = $date_startday;
$headerparams['date_endyear'] = $date_endyear;
$headerparams['date_endmonth'] = $date_endmonth;
$headerparams['date_endday'] = $date_endday;
$headerparams['q'] = $q;
if (!empty($date_startyear)) {
$headerparams['date_startyear'] = $date_startyear;
}
if (!empty($date_startmonth)) {
$headerparams['date_startmonth'] = $date_startmonth;
}
if (!empty($date_startday)) {
$headerparams['date_startday'] = $date_startday;
}
if (!empty($date_endyear)) {
$headerparams['date_endyear'] = $date_endyear;
}
if (!empty($date_endmonth)) {
$headerparams['date_endmonth'] = $date_endmonth;
}
if (!empty($date_endday)) {
$headerparams['date_endday'] = $date_endday;
}
if (!empty($q)) {
$headerparams['q'] = $q;
}
$tableparams = array();
$tableparams['search_categ'] = $selected_cat;
@ -250,8 +265,10 @@ $name = array();
// Show Array
$catotal = 0;
$catotal_ht = 0;
if ($modecompta == 'CREANCES-DETTES') {
$sql = "SELECT DISTINCT s.rowid as socid, s.nom as name, s.zip, s.town, s.fk_pays,";
$sql = "SELECT DISTINCT s.rowid as socid, s.nom as name, s.name_alias, s.zip, s.town, s.fk_pays,";
$sql .= " sum(f.total_ht) as amount, sum(f.total_ttc) as amount_ttc";
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."societe as s";
if ($selected_cat === -2) { // Without any category
@ -281,10 +298,10 @@ if ($modecompta == 'CREANCES-DETTES') {
}
} elseif ($modecompta == "RECETTES-DEPENSES") {
/*
* Liste des paiements (les anciens paiements ne sont pas vus par cette requete car, sur les
* vieilles versions, ils n'etaient pas lies via paiement_facture. On les ajoute plus loin)
* List of payments (old payments are not seen by this query because on older versions,
* they were not linked via the table llx_paiement_facture. They are added later)
*/
$sql = "SELECT s.rowid as socid, s.nom as name, s.zip, s.town, s.fk_pays, sum(pf.amount) as amount_ttc";
$sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias, s.zip, s.town, s.fk_pays, sum(pf.amount) as amount_ttc";
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f";
$sql .= ", ".MAIN_DB_PREFIX."paiement_facture as pf";
$sql .= ", ".MAIN_DB_PREFIX."paiement as p";
@ -329,7 +346,7 @@ $sql .= " AND f.entity IN (".getEntity('invoice').")";
if ($socid) {
$sql .= " AND f.fk_soc = ".((int) $socid);
}
$sql .= " GROUP BY s.rowid, s.nom, s.zip, s.town, s.fk_pays";
$sql .= " GROUP BY s.rowid, s.nom, s.name_alias, s.zip, s.town, s.fk_pays";
$sql .= " ORDER BY s.rowid";
//echo $sql;
@ -344,7 +361,11 @@ if ($result) {
$obj = $db->fetch_object($result);
$amount_ht[$obj->socid] = $obj->amount;
$amount[$obj->socid] = $obj->amount_ttc;
$name[$obj->socid] = $obj->name.' '.$obj->firstname;
$fullname = $obj->name;
if (!empty($obj->name_alias)) {
$fullname .= ' ('.$obj->name_alias.')';
}
$name[$obj->socid] = $fullname;
$address_zip[$obj->socid] = $obj->zip;
$address_town[$obj->socid] = $obj->town;
$address_pays[$obj->socid] = getCountry($obj->fk_pays);
@ -356,7 +377,7 @@ if ($result) {
dol_print_error($db);
}
// On ajoute les paiements anciennes version, non lies par paiement_facture
// We add the old versions of payments, not linked by table llx_paiement_facture
if ($modecompta == "RECETTES-DEPENSES") {
$sql = "SELECT '0' as socid, 'Autres' as name, sum(p.amount) as amount_ttc";
$sql .= " FROM ".MAIN_DB_PREFIX."bank as b";
@ -409,7 +430,7 @@ print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" :
// Category filter
print '<tr class="liste_titre">';
print '<td>';
print '<td class="nowraponall">';
print img_picto('', 'category', 'class="paddingrightonly"');
print $formother->select_categories(Categorie::TYPE_CUSTOMER, $selected_cat, 'search_categ', 0, $langs->trans("Category"));
print ' ';
@ -435,7 +456,7 @@ print '<td class="liste_titre left">';
print '<input class="flat" size="6" type="text" name="search_town" value="'.dol_escape_htmltag($search_town).'">';
print '</td>';
print '<td class="liste_titre left">';
print $form->select_country($search_country, 'search_country');
print $form->select_country($search_country, 'search_country', '', 0, 'minwidth100imp maxwidth100');
//print '<input class="flat" size="6" type="text" name="search_country" value="'.$search_country.'">';
print '</td>';
print '<td class="liste_titre">&nbsp;</td>';

View File

@ -69,6 +69,8 @@ if (empty($date_start) || empty($date_end)) { // We define date_start and date_e
$month_end = $month_start - 1;
if ($month_end < 1) {
$month_end = 12;
} else {
$year_end++;
}
} else {
$month_end = $month_start;

View File

@ -39,12 +39,12 @@ $nbofyear = 4;
// Date range
$year = GETPOST('year', 'int');
if (empty($year)) {
$year_current = strftime("%Y", dol_now());
$month_current = strftime("%m", dol_now());
$year_current = dol_print_date(dol_now(), "%Y");
$month_current = dol_print_date(dol_now(), "%m");
$year_start = $year_current - ($nbofyear - 1);
} else {
$year_current = $year;
$month_current = strftime("%m", dol_now());
$month_current = dol_print_date(dol_now(), "%m");
$year_start = $year - ($nbofyear - 1);
}
$date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear, 'tzserver'); // We use timezone of server so report is same from everywhere
@ -56,7 +56,7 @@ if (empty($date_start) || empty($date_end)) { // We define date_start and date_e
if ($q == 0) {
// We define date_start and date_end
$year_end = $year_start + ($nbofyear - 1);
$month_start = GETPOST("month") ? GETPOST("month", 'int') : ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1);
$month_start = GETPOSTISSET("month") ? GETPOST("month", 'int') : ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1);
if (!GETPOST('month')) {
if (!GETPOST("year") && $month_start > $month_current) {
$year_start--;
@ -65,6 +65,8 @@ if (empty($date_start) || empty($date_end)) { // We define date_start and date_e
$month_end = $month_start - 1;
if ($month_end < 1) {
$month_end = 12;
} else {
$year_end++;
}
} else {
$month_end = $month_start;

View File

@ -1634,7 +1634,7 @@ class ExtraFields
if (!empty($value)) {
//$value=price($value);
$sizeparts = explode(",", $size);
$number_decimals = $sizeparts[1];
$number_decimals = array_key_exists(1, $sizeparts) ? $sizeparts[1] : 0;
$value = price($value, 0, $langs, 0, 0, $number_decimals, '');
}
} elseif ($type == 'boolean') {

View File

@ -6470,11 +6470,15 @@ class Form
} elseif ($usecalendar == 'jquery') {
if (!$disabled) {
// Output javascript for datepicker
$minYear = $conf->global->MIN_YEAR_SELECT_DATE ? $conf->global->MIN_YEAR_SELECT_DATE : (date('Y') - 100);
$maxYear = $conf->global->MAX_YEAR_SELECT_DATE ? $conf->global->MAX_YEAR_SELECT_DATE : (date('Y') + 100);
$retstring .= "<script type='text/javascript'>";
$retstring .= "$(function(){ $('#".$prefix."').datepicker({
dateFormat: '".$langs->trans("FormatDateShortJQueryInput")."',
autoclose: true,
todayHighlight: true,";
todayHighlight: true,
yearRange: '".$minYear.":".$maxYear."',";
if (!empty($conf->dol_use_jmobile)) {
$retstring .= "
beforeShow: function (input, datePicker) {

View File

@ -3207,6 +3207,8 @@ function dol_print_phone($phone, $countrycode = '', $cid = 0, $socid = 0, $addli
$newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 2).$separ.substr($newphone, 5, 2).$separ.substr($newphone, 7, 2).$separ.substr($newphone, 9, 2);
} elseif (dol_strlen($phone) == 12) {
$newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 1).$separ.substr($newphone, 4, 2).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 2).$separ.substr($newphone, 10, 2);
} elseif (dol_strlen($phone) == 13) {
$newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 2).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 3).$separ.substr($newphone, 11, 2);
}
} elseif (strtoupper($countrycode) == "CA") {
if (dol_strlen($phone) == 10) {

View File

@ -54,7 +54,7 @@ class modFTP extends DolibarrModules
// Module description used if translation string 'ModuleXXXDesc' not found (XXX is id value)
$this->description = "FTP Client";
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
$this->version = 'dolibarr';
$this->version = 'dolibarr_deprecated';
// Key used in llx_const table to save module status enabled/disabled (XXX is id value)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Name of png file (without png) used for this module

View File

@ -61,7 +61,7 @@ if ($this->element == 'supplier_proposal' || $this->element == 'order_supplier'
}
// VAT
print '<td class="linecolvat right" style="width: 80px">';
print '<td class="linecolvat right nowraponall">';
if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) || !empty($conf->global->FACTURE_LOCAL_TAX2_OPTION)) {
print $langs->trans('Taxes');
} else {
@ -85,7 +85,7 @@ if (in_array($object->element, array('propal', 'commande', 'facture')) && $objec
print '</td>';
// Price HT
print '<td class="linecoluht right" style="width: 80px">'.$langs->trans('PriceUHT').'</td>';
print '<td class="linecoluht right nowraponall">'.$langs->trans('PriceUHT').'</td>';
// Multicurrency
if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) {
@ -93,7 +93,7 @@ if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf-
}
if ($inputalsopricewithtax) {
print '<td class="right" style="width: 80px">'.$langs->trans('PriceUTTC').'</td>';
print '<td class="right nowraponall">'.$langs->trans('PriceUTTC').'</td>';
}
// Qty
@ -105,7 +105,7 @@ if (!empty($conf->global->PRODUCT_USE_UNITS)) {
}
// Reduction short
print '<td class="linecoldiscount right">';
print '<td class="linecoldiscount right nowraponall">';
print $langs->trans('ReductionShort');
if (in_array($object->element, array('propal', 'commande', 'facture')) && $object->status == $object::STATUS_DRAFT) {

View File

@ -808,7 +808,7 @@ class ProductFournisseur extends Product
$sql .= " ,pfp.multicurrency_price, pfp.multicurrency_unitprice, pfp.multicurrency_tx, pfp.fk_multicurrency, pfp.multicurrency_code";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."product_fournisseur_price as pfp";
$sql .= " WHERE s.entity IN (".getEntity('societe').")";
$sql .= " AND pfp.entity = ".$conf->entity; // only current entity
$sql .= " AND pfp.entity IN (".getEntity('productsupplierprice').")";
$sql .= " AND pfp.fk_product = ".((int) $prodid);
$sql .= " AND pfp.fk_soc = s.rowid";
$sql .= " AND s.status = 1"; // only enabled society

View File

@ -1203,10 +1203,6 @@ if ($id > 0 || !empty($ref)) {
while ($i < $num) {
$objp = $db->fetch_object($resql);
$tmpproduct->id = $objp->fk_product;
$tmpproduct->ref = $objp->ref;
$tmpproduct->label = $objp->label;
if ($action == 'editline' && $lineid == $objp->dispatchlineid) {
print '<form name="editdispatchedlines" id="editdispatchedlines" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'#line_'.GETPOST('lineid', 'int').'" method="POST">
<input type="hidden" name="token" value="'.newToken().'">

View File

@ -498,14 +498,30 @@ if (!function_exists('ftp_connect')) {
//$newsection = '/./';
$newsection = ssh2_sftp_realpath($conn_id, ".").'/./'; // workaround for bug https://bugs.php.net/bug.php?id=64169
}
//$newsection='/';
//$dirHandle = opendir("ssh2.sftp://$conn_id".$newsection);
//$dirHandle = opendir("ssh2.sftp://".intval($conn_id).ssh2_sftp_realpath($conn_id, ".").'/./');
$contents = scandir('ssh2.sftp://'.intval($conn_id).$newsection);
$buff = array();
foreach ($contents as $i => $key) {
$buff[$i] = "---------- - root root 1234 Aug 01 2000 ".$key;
}
//$i = 0;
//$handle = opendir('ssh2.sftp://'.intval($conn_id).$newsection);
//$buff=array();
//while (false !== ($file = readdir($handle))) {
// if (substr("$file", 0, 1) != "."){
// if (is_dir($file)) {
// $buff[$i]="d--------- - root root 1234 Aug 01 2000 ".$file;
// } else {
// $buff[$i]="---------- - root root 1234 Aug 01 2000 ".$file;
// }
// }
// $i++;
//}
} else {
$buff = ftp_rawlist($conn_id, $newsectioniso);
$contents = ftp_nlist($conn_id, $newsectioniso); // Sometimes rawlist fails but never nlist

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2005-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2022 Charlene Benke <charlene@patas-monkey.com>
*
* 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
@ -625,7 +626,7 @@ if ($step == 3 && $datatoimport) {
$maxfilesizearray = getMaxFileSizeArray();
$maxmin = $maxfilesizearray['maxmin'];
if ($maxmin > 0) {
$texte .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
}
print '<input type="file" name="userfile" size="20" maxlength="80"> &nbsp; &nbsp; ';
$out = (empty($conf->global->MAIN_UPLOAD_DOC) ? ' disabled' : '');
@ -635,29 +636,29 @@ if ($step == 3 && $datatoimport) {
$max = $conf->global->MAIN_UPLOAD_DOC; // In Kb
$maxphp = @ini_get('upload_max_filesize'); // In unknown
if (preg_match('/k$/i', $maxphp)) {
$maxphp = $maxphp * 1;
$maxphp = (int) substr($maxphp, 0, -1) * 1;
}
if (preg_match('/m$/i', $maxphp)) {
$maxphp = $maxphp * 1024;
$maxphp = (int) substr($maxphp, 0, -1) * 1024;
}
if (preg_match('/g$/i', $maxphp)) {
$maxphp = $maxphp * 1024 * 1024;
$maxphp = (int) substr($maxphp, 0, -1) * 1024 * 1024;
}
if (preg_match('/t$/i', $maxphp)) {
$maxphp = $maxphp * 1024 * 1024 * 1024;
$maxphp = (int) substr($maxphp, 0, -1) * 1024 * 1024 * 1024;
}
$maxphp2 = @ini_get('post_max_size'); // In unknown
if (preg_match('/k$/i', $maxphp2)) {
$maxphp2 = $maxphp2 * 1;
$maxphp2 = (int) substr($maxphp2, 0, -1) * 1;
}
if (preg_match('/m$/i', $maxphp2)) {
$maxphp2 = $maxphp2 * 1024;
$maxphp2 = (int) substr($maxphp2, 0, -1) * 1024;
}
if (preg_match('/g$/i', $maxphp2)) {
$maxphp2 = $maxphp2 * 1024 * 1024;
$maxphp2 = (int) substr($maxphp2, 0, -1) * 1024 * 1024;
}
if (preg_match('/t$/i', $maxphp2)) {
$maxphp2 = $maxphp2 * 1024 * 1024 * 1024;
$maxphp2 = (int) substr($maxphp2, 0, -1) * 1024 * 1024 * 1024;
}
// Now $max and $maxphp and $maxphp2 are in Kb
$maxmin = $max;

View File

@ -80,7 +80,7 @@ ConfirmDeleteContractLine=Are you sure you want to delete this contract line?
MoveToAnotherContract=Move service into another contract.
ConfirmMoveToAnotherContract=I choosed new target contract and confirm I want to move this service into this contract.
ConfirmMoveToAnotherContractQuestion=Choose in which existing contract (of same third party), you want to move this service to?
PaymentRenewContractId=Renew contract line (number %s)
PaymentRenewContractId=Renew contract %s (service %s)
ExpiredSince=Expiration date
NoExpiredServices=No expired active services
ListOfServicesToExpireWithDuration=List of Services to expire in %s days

View File

@ -345,7 +345,7 @@ PossibleValues=Possible values
GoOnMenuToCreateVairants=Go on menu %s - %s to prepare attribute variants (like colors, size, ...)
UseProductFournDesc=Add a feature to define the product description defined by the vendors (for each vendor reference) in addition to the description for customers
ProductSupplierDescription=Vendor description for the product
UseProductSupplierPackaging=Use packaging on supplier prices (recalculate quantities according to packaging set on supplier price when adding/updating line in supplier documents)
UseProductSupplierPackaging=Use packaging for prices rounded to multiples for purchase prices (recalculate quantities according to multiples set on purchase prices when adding/updating line in a vendor documents)
PackagingForThisProduct=Packaging
PackagingForThisProductDesc=You will automaticaly purchase a multiple of this quantity.
QtyRecalculatedWithPackaging=The quantity of the line were recalculated according to supplier packaging

View File

@ -596,9 +596,10 @@ print $form->selectPriceBaseType($conf->global->PRODUCT_PRICE_BASE_TYPE, "price_
print '</td>';
print '</tr>';
// Use conditionnement in buying
if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) {
print '<tr class="oddeven">';
print '<td>'.$langs->trans("UseProductSupplierPackaging").'</td>';
print '<td>'.$form->textwithpicto($langs->trans("UseProductSupplierPackaging"), $langs->trans("PackagingForThisProductDesc")).'</td>';
print '<td align="right">';
print ajax_constantonoff("PRODUCT_USE_SUPPLIER_PACKAGING", array(), $conf->entity, 0, 0, 0, 0);
//print $form->selectyesno("activate_useProdSupplierPackaging", (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING) ? $conf->global->PRODUCT_USE_SUPPLIER_PACKAGING : 0), 1);

View File

@ -549,7 +549,7 @@ if ($id > 0 || $ref) {
print '</td></tr>';
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
// Packaging
// Packaging/Conditionnement
print '<tr>';
print '<td class="fieldrequired">'.$form->textwithpicto($langs->trans("PackagingForThisProduct"), $langs->trans("PackagingForThisProductDesc")).'</td>';

View File

@ -1353,7 +1353,7 @@ if ($source == 'contractline') {
// Object
$text = '<b>'.$langs->trans("PaymentRenewContractId", $contract->ref, $contractline->ref).'</b>';
if ($contractline->fk_product) {
if ($contractline->fk_product > 0) {
$contractline->fetch_product();
$text .= '<br>'.$contractline->product->ref.($contractline->product->label ? ' - '.$contractline->product->label : '');
}
@ -1364,8 +1364,8 @@ if ($source == 'contractline') {
// $text.='<br>'.$langs->trans("DateEndPlanned").': ';
// $text.=dol_print_date($contractline->date_fin_validite);
//}
if ($contractline->date_fin_validite) {
$text .= '<br>'.$langs->trans("ExpiredSince").': '.dol_print_date($contractline->date_fin_validite);
if ($contractline->date_end) {
$text .= '<br>'.$langs->trans("ExpiredSince").': '.dol_print_date($contractline->date_end);
}
if (GETPOST('desc', 'alpha')) {
$text = '<b>'.$langs->trans(GETPOST('desc', 'alpha')).'</b>';

View File

@ -758,7 +758,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac
$morehtmlright = dolGetButtonTitle($langs->trans('Add'), $langs->trans('NotEnoughPermissions'), 'fa fa-plus-circle', '', '', -2);
}
} else {
$morehtmlright = dolGetButtonTitle($langs->trans('Add'), 'AlreadyOneBankAccount', 'fa fa-plus-circle', '', '', -2);
$morehtmlright = dolGetButtonTitle($langs->trans('Add'), $langs->trans('AlreadyOneBankAccount'), 'fa fa-plus-circle', '', '', -2);
}
print load_fiche_titre($langs->trans("BankAccounts"), $morehtmlright, 'bank_account');