2
0
forked from Wavyzz/dolibarr

Merge branch 'develop' of https://github.com/Dolibarr/dolibarr into develop

This commit is contained in:
Rui Strecht
2017-09-12 16:10:20 +01:00
67 changed files with 1446 additions and 778 deletions

View File

@@ -28,7 +28,9 @@ require '../../main.inc.php';
// Class
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountancyexport.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
@@ -51,9 +53,8 @@ if ($search_accountancy_code_end == - 1) {
$search_accountancy_code_end = '';
}
if (GETPOST("button_export_csv_x") || GETPOST("button_export_csv.x") || GETPOST("button_export_csv")) {
$action = 'export_csv';
}
if (GETPOST("exportcsv")) $action = 'export_csv';
$limit = GETPOST('limit','int')?GETPOST('limit', 'int'):$conf->liste_limit;
@@ -66,8 +67,18 @@ $formother = new FormOther($db);
$form = new Form($db);
if (empty($search_date_start)) {
$search_date_start = dol_mktime(0, 0, 0, 1, 1, dol_print_date(dol_now(), '%Y'));
$search_date_end = dol_mktime(0, 0, 0, 12, 31, dol_print_date(dol_now(), '%Y'));
$month_start= ($conf->global->SOCIETE_FISCAL_MONTH_START?($conf->global->SOCIETE_FISCAL_MONTH_START):1);
$year_start = dol_print_date(dol_now(), '%Y');
$year_end = $year_start + 1;
$month_end = $month_start - 1;
if ($month_end < 1)
{
$month_end = 12;
$year_end--;
}
$search_date_start = dol_mktime(0, 0, 0, $month_start, 1, $year_start);
$search_date_end = dol_get_last_day($year_end, $month_end);
}
if ($sortorder == "")
$sortorder = "ASC";
@@ -136,7 +147,7 @@ if ($action == 'export_csv') {
}
else {
$title_page = $langs->trans("AccountBalance") . (($search_date_start || $search_date_end) ? ' ' . dol_print_date($search_date_start) . '-' . dol_print_date($search_date_end) : '');
$title_page = $langs->trans("AccountBalance");
llxHeader('', $title_page);
@@ -156,7 +167,7 @@ else {
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
$button = '<input type="submit" name="button_export_csv" class="butAction" value="' . $langs->trans("Export") . ' ('.$conf->global->ACCOUNTING_EXPORT_FORMAT.')" />';
$button = '<input type="submit" name="exportcsv" class="butAction" value="' . $langs->trans("Export") . ' ('.$conf->global->ACCOUNTING_EXPORT_FORMAT.')" />';
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $options, $sortfield, $sortorder, '', $result, $result, 'title_accountancy', 0, $button);
$moreforfilter = '';

View File

@@ -108,29 +108,6 @@ if ($action == 'validatehistory') {
$db->commit();
setEventMessages($langs->trans('AutomaticBindingDone'), null, 'mesgs');
}
} elseif ($action == 'fixaccountancycode') {
$error = 0;
$db->begin();
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as fd";
$sql1 .= " SET fk_code_ventilation = 0";
$sql1 .= ' WHERE fd.fk_code_ventilation NOT IN ';
$sql1 .= ' (SELECT accnt.rowid ';
$sql1 .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
$sql1 .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
$sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ')';
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
$resql1 = $db->query($sql1);
if (! $resql1) {
$error ++;
$db->rollback();
setEventMessage($db->lasterror(), 'errors');
} else {
$db->commit();
setEventMessage($langs->trans('Done'), 'mesgs');
}
} elseif ($action == 'cleanaccountancycode') {
$error = 0;
$db->begin();
@@ -144,7 +121,7 @@ if ($action == 'validatehistory') {
$sql1.= " AND f.entity IN (" . getEntity('accountancy') . ")";
$sql1.=")";
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
dol_syslog("htdocs/accountancy/customer/index.php cleanaccountancycode", LOG_DEBUG);
$resql1 = $db->query($sql1);
if (! $resql1) {
@@ -169,13 +146,29 @@ $textnextyear = '&nbsp;<a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_cur
print load_fiche_titre($langs->trans("CustomersVentilation") . " " . $textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear, '', 'title_accountancy');
// Clean database
$db->begin();
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as fd";
$sql1 .= " SET fk_code_ventilation = 0";
$sql1 .= ' WHERE fd.fk_code_ventilation NOT IN ';
$sql1 .= ' (SELECT accnt.rowid ';
$sql1 .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
$sql1 .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
$sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ')';
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
$resql1 = $db->query($sql1);
if (! $resql1) {
$error ++;
$db->rollback();
setEventMessage($db->lasterror(), 'errors');
} else {
$db->commit();
}
// End clean database
print $langs->trans("DescVentilCustomer") . '<br>';
print $langs->trans("DescVentilMore", $langs->transnoentitiesnoconv("ValidateHistory"), $langs->transnoentitiesnoconv("ToBind")) . '<br>';
print '<br>';
//print '<div class="inline-block divButAction">';
// TODO Remove this. Should be done always or into the repair.php script.
if ($conf->global->MAIN_FEATURES_LEVEL > 1) print '<a class="butActionDelete" href="' . $_SERVER['PHP_SELF'] . '?year=' . $year_current . '&action=fixaccountancycode">' . $langs->trans("CleanFixHistory", $year_current) . '</a>';
//print '</div>';
$sql = "SELECT count(*) FROM " . MAIN_DB_PREFIX . "facturedet as fd";
$sql .= " , " . MAIN_DB_PREFIX . "facture as f";
@@ -214,8 +207,8 @@ for($i = 1; $i <= 12; $i ++) {
}
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
$sql = "SELECT " . $db->ifsql('aa.account_number IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.account_number') . " AS codecomptable,";
$sql .= " " . $db->ifsql('aa.label IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.label') . " AS intitule,";
$sql = "SELECT " . $db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number') . " AS codecomptable,";
$sql .= " " . $db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label') . " AS intitule,";
for($i = 1; $i <= 12; $i ++) {
$sql .= " SUM(" . $db->ifsql('MONTH(f.datef)=' . $i, 'fd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
}
@@ -241,8 +234,20 @@ if ($resql) {
while ( $row = $db->fetch_row($resql)) {
print '<tr class="oddeven"><td>' . length_accountg($row[0]) . '</td>';
print '<td align="left">' . $row[1] . '</td>';
print '<tr class="oddeven"><td>';
if ($row[0] == 'tobind')
{
print $langs->trans("Unknown");
}
else print length_accountg($row[0]);
print '</td>';
print '<td align="left">';
if ($row[0] == 'tobind')
{
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/customer/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
}
else print $row[1];
print '</td>';
for($i = 2; $i <= 12; $i ++) {
print '<td align="right">' . price($row[$i]) . '</td>';
}
@@ -271,8 +276,8 @@ for($i = 1; $i <= 12; $i ++) {
}
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
$sql = "SELECT " . $db->ifsql('aa.account_number IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.account_number') . " AS codecomptable,";
$sql .= " " . $db->ifsql('aa.label IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.label') . " AS intitule,";
$sql = "SELECT " . $db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number') . " AS codecomptable,";
$sql .= " " . $db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label') . " AS intitule,";
for($i = 1; $i <= 12; $i ++) {
$sql .= " SUM(" . $db->ifsql('MONTH(f.datef)=' . $i, 'fd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
}
@@ -298,7 +303,20 @@ if ($resql) {
while ( $row = $db->fetch_row($resql)) {
print '<tr class="oddeven"><td>' . length_accountg($row[0]) . '</td>';
print '<tr class="oddeven"><td>';
if ($row[0] == 'tobind')
{
print $langs->trans("Unknown");
}
else print length_accountg($row[0]);
print '</td>';
print '<td align="left">';
if ($row[0] == 'tobind')
{
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/customer/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
}
else print $row[1];
print '</td>';
print '<td align="left">' . $row[1] . '</td>';
for($i = 2; $i <= 12; $i ++) {
print '<td align="right">' . price($row[$i]) . '</td>';
@@ -367,6 +385,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
print "</table>\n";
print '</div>';
if (! empty($conf->margin->enabled)) {
print "<br>\n";
print '<div class="div-table-responsive-no-min">';

View File

@@ -33,6 +33,8 @@ require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
// Langs
$langs->load("compta");
@@ -60,6 +62,10 @@ $search_desc = GETPOST('search_desc', 'alpha');
$search_amount = GETPOST('search_amount', 'alpha');
$search_account = GETPOST('search_account', 'alpha');
$search_vat = GETPOST('search_vat', 'alpha');
$search_day=GETPOST("search_day","int");
$search_month=GETPOST("search_month","int");
$search_year=GETPOST("search_year","int");
$btn_ventil = GETPOST('ventil', 'alpha');
// Load variable for pagination
@@ -109,6 +115,8 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x',
$search_amount = '';
$search_account = '';
$search_vat = '';
$search_month = '';
$search_year = '';
}
// Mass actions
@@ -174,6 +182,7 @@ if ($massaction == 'ventil') {
*/
$form = new Form($db);
$formother = new FormOther($db);
llxHeader('', $langs->trans("Ventilation"));
@@ -216,6 +225,19 @@ if (strlen(trim($search_account))) {
if (strlen(trim($search_vat))) {
$sql .= natural_search("l.tva_tx",$search_vat,1);
}
if ($search_month > 0)
{
if ($search_year > 0 && empty($search_day))
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'";
else if ($search_year > 0 && ! empty($search_day))
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'";
else
$sql.= " AND date_format(f.datef, '%m') = '".$db->escape($search_month)."'";
}
else if ($search_year > 0)
{
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'";
}
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_SITUATION . ")";
} else {
@@ -246,6 +268,15 @@ if ($result) {
$param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($search_lineid) $param.='&search_lineid='.urlencode($search_lineid);
if ($search_day) $param.='&search_day='.urlencode($search_day);
if ($search_month) $param.='&search_month='.urlencode($search_month);
if ($search_year) $param.='&search_year='.urlencode($search_year);
if ($search_invoice) $param.='&search_invoice='.urlencode($search_invoice);
if ($search_ref) $param.='&search_ref='.urlencode($search_ref);
if ($search_desc) $param.='&search_desc='.urlencode($search_desc);
if ($search_amount) $param.='&search_amount='.urlencode($search_amount);
if ($search_vat) $param.='&search_vat='.urlencode($search_vat);
$arrayofmassactions = array(
'ventil'=>$langs->trans("Ventilate")
@@ -280,7 +311,11 @@ if ($result) {
print '<tr class="liste_titre_filter">';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_lineid" value="' . dol_escape_htmltag($search_lineid) . '""></td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="' . dol_escape_htmltag($search_invoice) . '"></td>';
print '<td class="liste_titre"></td>';
print '<td class="liste_titre center">';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="search_day" value="'.$search_day.'">';
print '<input class="flat" type="text" size="1" maxlength="2" name="search_month" value="'.$search_month.'">';
$formother->select_year($search_year,'search_year',1, 20, 5);
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 maxwidthonsmartphone" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';

View File

@@ -104,29 +104,6 @@ if ($action == 'validatehistory') {
$db->commit();
setEventMessages($langs->trans('AutomaticBindingDone'), null, 'mesgs');
}
} elseif ($action == 'fixaccountancycode') {
$error = 0;
$db->begin();
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "expensereport_det as erd";
$sql1 .= " SET fk_code_ventilation = 0";
$sql1 .= ' WHERE erd.fk_code_ventilation NOT IN ';
$sql1 .= ' (SELECT accnt.rowid ';
$sql1 .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
$sql1 .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
$sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ')';
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
$resql1 = $db->query($sql1);
if (! $resql1) {
$error ++;
$db->rollback();
setEventMessage($db->lasterror(), 'errors');
} else {
$db->commit();
setEventMessage($langs->trans('Done'), 'mesgs');
}
} elseif ($action == 'cleanaccountancycode') {
$error = 0;
$db->begin();
@@ -140,7 +117,7 @@ if ($action == 'validatehistory') {
$sql1.= " AND er.entity IN (" . getEntity('accountancy') . ")";
$sql1.=")";
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
dol_syslog("htdocs/accountancy/customer/index.php cleanaccountancycode", LOG_DEBUG);
$resql1 = $db->query($sql1);
if (! $resql1) {
@@ -168,13 +145,25 @@ print $langs->trans("DescVentilExpenseReport") . '<br>';
print $langs->trans("DescVentilExpenseReportMore", $langs->transnoentitiesnoconv("ValidateHistory"), $langs->transnoentitiesnoconv("ToBind")) . '<br>';
print '<br>';
//print '<div class="inline-block divButAction">';
// TODO Remove this. Should be done always or into the repair.php script.
if ($conf->global->MAIN_FEATURES_LEVEL > 1) print '<a class="butActionDelete" href="' . $_SERVER['PHP_SELF'] . '?year=' . $year_current . '&action=fixaccountancycode">' . $langs->trans("CleanFixHistory", $year_current) . '</a>';
//print '</div>';
// Clean database
$db->begin();
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "expensereport_det as erd";
$sql1 .= " SET fk_code_ventilation = 0";
$sql1 .= ' WHERE erd.fk_code_ventilation NOT IN ';
$sql1 .= ' (SELECT accnt.rowid ';
$sql1 .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
$sql1 .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
$sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ')';
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
$resql1 = $db->query($sql1);
if (! $resql1) {
$error ++;
$db->rollback();
setEventMessage($db->lasterror(), 'errors');
} else {
$db->commit();
}
// End clean database
$y = $year_current;
@@ -195,8 +184,8 @@ for($i = 1; $i <= 12; $i ++) {
}
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.account_number') ." AS codecomptable,";
$sql .= " " . $db->ifsql('aa.label IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.label') . " AS intitule,";
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number') ." AS codecomptable,";
$sql .= " " . $db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label') . " AS intitule,";
for($i = 1; $i <= 12; $i ++) {
$sql .= " SUM(" . $db->ifsql('MONTH(er.date_debut)=' . $i, 'erd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
}
@@ -218,9 +207,21 @@ if ($resql) {
while ( $row = $db->fetch_row($resql)) {
print '<tr class="oddeven"><td>' . length_accountg($row[0]) . '</td>';
print '<td align="left">' . $row[1] . '</td>';
for($i = 2; $i <= 12; $i ++) {
print '<tr class="oddeven"><td>';
if ($row[0] == 'tobind')
{
print $langs->trans("Unknown");
}
else print length_accountg($row[0]);
print '</td>';
print '<td align="left">';
if ($row[0] == 'tobind')
{
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/expensereport/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
}
else print $row[1];
print '</td>';
for($i = 2; $i <= 12; $i ++) {
print '<td align="right">' . price($row[$i]) . '</td>';
}
print '<td align="right">' . price($row[13]) . '</td>';
@@ -249,8 +250,8 @@ for($i = 1; $i <= 12; $i ++) {
}
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.account_number') ." AS codecomptable,";
$sql .= " " . $db->ifsql('aa.label IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.label') . " AS intitule,";
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number') ." AS codecomptable,";
$sql .= " " . $db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label') . " AS intitule,";
for($i = 1; $i <= 12; $i ++) {
$sql .= " SUM(" . $db->ifsql('MONTH(er.date_debut)=' . $i, 'erd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
}
@@ -272,9 +273,21 @@ if ($resql) {
while ( $row = $db->fetch_row($resql)) {
print '<tr class="oddeven"><td>' . length_accountg($row[0]) . '</td>';
print '<td align="left">' . $row[1] . '</td>';
for($i = 2; $i <= 12; $i ++) {
print '<tr class="oddeven"><td>';
if ($row[0] == 'tobind')
{
print $langs->trans("Unknown");
}
else print length_accountg($row[0]);
print '</td>';
print '<td align="left">';
if ($row[0] == 'tobind')
{
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/expensereport/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
}
else print $row[1];
print '</td>';
for($i = 2; $i <= 12; $i ++) {
print '<td align="right">' . price($row[$i]) . '</td>';
}
print '<td align="right">' . price($row[13]) . '</td>';

View File

@@ -32,6 +32,8 @@ require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
// Langs
$langs->load("compta");
@@ -58,6 +60,10 @@ $search_desc = GETPOST('search_desc', 'alpha');
$search_amount = GETPOST('search_amount', 'alpha');
$search_account = GETPOST('search_account', 'alpha');
$search_vat = GETPOST('search_vat', 'alpha');
$search_day=GETPOST("search_day","int");
$search_month=GETPOST("search_month","int");
$search_year=GETPOST("search_year","int");
$btn_ventil = GETPOST('ventil', 'alpha');
// Load variable for pagination
@@ -103,6 +109,8 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x',
$search_amount = '';
$search_account = '';
$search_vat = '';
$search_month = '';
$search_year = '';
}
// Mass actions
@@ -169,6 +177,7 @@ if ($massaction == 'ventil') {
*/
$form = new Form($db);
$formother = new FormOther($db);
llxHeader('', $langs->trans("ExpenseReportsVentilation"));
@@ -203,6 +212,19 @@ if (strlen(trim($search_account))) {
if (strlen(trim($search_vat))) {
$sql .= natural_search("erd.tva_tx",$search_vat,1);
}
if ($search_month > 0)
{
if ($search_year > 0 && empty($search_day))
$sql.= " AND erd.date BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'";
else if ($search_year > 0 && ! empty($search_day))
$sql.= " AND erd.date BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'";
else
$sql.= " AND date_format(erd.date, '%m') = '".$db->escape($search_month)."'";
}
else if ($search_year > 0)
{
$sql.= " AND erd.date BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'";
}
$sql .= " AND er.entity IN (" . getEntity('expensereport', 0) . ")"; // We don't share object for accountancy
$sql .= $db->order($sortfield, $sortorder);
@@ -228,6 +250,15 @@ if ($result) {
$param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($search_lineid) $param.='&search_lineid='.urlencode($search_lineid);
if ($search_day) $param.='&search_day='.urlencode($search_day);
if ($search_month) $param.='&search_month='.urlencode($search_month);
if ($search_year) $param.='&search_year='.urlencode($search_year);
if ($search_expensereport) $param.='&search_expensereport='.urlencode($search_expensereport);
if ($search_label) $param.='&search_label='.urlencode($search_label);
if ($search_desc) $param.='&search_desc='.urlencode($search_desc);
if ($search_amount) $param.='&search_amount='.urlencode($search_amount);
if ($search_vat) $param.='&search_vat='.urlencode($search_vat);
$arrayofmassactions = array(
'ventil'=>$langs->trans("Ventilate")
@@ -263,7 +294,11 @@ if ($result) {
print '<tr class="liste_titre_filter">';
print '<td class="liste_titre"></td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_expensereport" value="' . dol_escape_htmltag($search_expensereport) . '"></td>';
print '<td class="liste_titre"></td>';
print '<td class="liste_titre center">';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="search_day" value="'.$search_day.'">';
print '<input class="flat" type="text" size="1" maxlength="2" name="search_month" value="'.$search_month.'">';
$formother->select_year($search_year,'search_year',1, 20, 5);
print '</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 maxwidthonsmartphone" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
print '<td class="liste_titre" align="right"><input type="text" class="right flat maxwidth50" name="search_amount" value="' . dol_escape_htmltag($search_amount) . '"></td>';
@@ -313,6 +348,7 @@ if ($result) {
// Ref Expense report
print '<td>' . $expensereport_static->getNomUrl(1) . '</td>';
// Date
print '<td align="center">' . dol_print_date($db->jdate($objp->date), 'day') . '</td>';
// Fees label

View File

@@ -68,6 +68,7 @@ $in_bookkeeping = GETPOST('in_bookkeeping','aZ09');
if ($in_bookkeeping == '') $in_bookkeeping = 'notyet';
$now = dol_now();
$action = GETPOST('action','aZ09');
// Security check
@@ -102,12 +103,15 @@ $idpays = $mysoc->country_id;
$sql = "SELECT b.rowid, b.dateo as do, b.datev as dv, b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type, b.fk_account,";
$sql .= " ba.courant, ba.ref as baref, ba.account_number, ba.fk_accountancy_journal,";
$sql .= " soc.code_compta, soc.code_compta_fournisseur, soc.rowid as socid, soc.nom as name, bu1.type as typeop,";
$sql .= " u.accountancy_code, u.rowid as userid, u.lastname as lastname, u.firstname as firstname, bu2.type as typeop";
$sql .= " soc.code_compta, soc.code_compta_fournisseur, soc.rowid as socid, soc.nom as name, bu1.type as typeop_company,";
$sql .= " u.accountancy_code, u.rowid as userid, u.lastname as lastname, u.firstname as firstname, bu2.type as typeop_user,";
$sql .= " bu3.type as typeop_payment, bu4.type as typeop_payment_supplier";
$sql .= " FROM " . MAIN_DB_PREFIX . "bank as b";
$sql .= " JOIN " . MAIN_DB_PREFIX . "bank_account as ba on b.fk_account=ba.rowid";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "bank_url as bu1 ON bu1.fk_bank = b.rowid AND bu1.type='company'";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "bank_url as bu2 ON bu2.fk_bank = b.rowid AND bu2.type='user'";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "bank_url as bu3 ON bu3.fk_bank = b.rowid AND bu3.type='payment'";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "bank_url as bu4 ON bu4.fk_bank = b.rowid AND bu4.type='payment_supplier'";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe as soc on bu1.url_id=soc.rowid";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "user as u on bu2.url_id=u.rowid";
$sql .= " WHERE ba.fk_accountancy_journal=" . $id_journal;
@@ -145,6 +149,7 @@ $result = $db->query($sql);
if ($result) {
$num = $db->num_rows($result);
//print $sql;
// Variables
$account_supplier = (! empty($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER) ? $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER : 'NotDefined'); // NotDefined is a reserved word
@@ -170,13 +175,31 @@ if ($result) {
{
$obj = $db->fetch_object($result);
// Set accountancy code (for bank and thirdparty)
$lineisapurchase = -1;
$lineisasale = -1;
// Old method to detect if it's a sale or purchase
if ($obj->label == '(SupplierInvoicePayment)' || $obj->label == '(SupplierInvoicePaymentBack)') $lineisapurchase=1;
if ($obj->label == '(CustomerInvoicePayment)' || $obj->label == '(CustomerInvoicePaymentBack)') $lineisasale=1;
// Try a more reliable method to detect if record is a supplier payment or a customer payment
if ($lineisapurchase < 0)
{
if ($obj->typeop_payment_supplier == 'payment_supplier') $lineisapurchase = 1;
}
if ($lineisasale < 0)
{
if ($obj->typeop_payment == 'payment') $lineisasale = 1;
}
//var_dump($obj->type_payment); var_dump($obj->type_payment_supplier);
//var_dump($lineisapurchase); //var_dump($lineisasale);
// Set accountancy code for bank
$compta_bank = $obj->account_number;
// Set accountancy code for thirdparty
$compta_soc = 'NotDefined';
if ($obj->label == '(SupplierInvoicePayment)' || $obj->label == '(SupplierInvoicePaymentBack)')
if ($lineisapurchase > 0)
$compta_soc = (! empty($obj->code_compta_fournisseur) ? $obj->code_compta_fournisseur : $account_supplier);
if ($obj->label == '(CustomerInvoicePayment)' || $obj->label == '(CustomerInvoicePaymentBack)')
if ($lineisasale > 0)
$compta_soc = (! empty($obj->code_compta) ? $obj->code_compta : $account_customer);
$tabcompany[$obj->rowid] = array (
@@ -185,6 +208,7 @@ if ($result) {
'code_compta' => $compta_soc,
);
// Set accountancy code for user
$compta_user = (! empty($obj->accountancy_code) ? $obj->accountancy_code : $account_employee);
$tabuser[$obj->rowid] = array (
@@ -200,6 +224,7 @@ if ($result) {
$tabpay[$obj->rowid]["type_payment"] = $obj->fk_type; // CHQ, VIR, LIQ, CB, ...
$tabpay[$obj->rowid]["ref"] = $obj->label; // By default. Not unique. May be changed later
$tabpay[$obj->rowid]["fk_bank"] = $obj->rowid;
$tabpay[$obj->rowid]["bank_account_ref"] = $obj->baref;
$tabpay[$obj->rowid]["fk_bank_account"] = $obj->fk_account;
if (preg_match('/^\((.*)\)$/i', $obj->label, $reg)) {
$tabpay[$obj->rowid]["lib"] = $langs->trans($reg[1]);
@@ -212,7 +237,7 @@ if ($result) {
//var_dump($tabpay);
// By default
$tabpay[$obj->rowid]['type'] = 'unknown'; // Can be SOLD, miscellaneous entry, payment of patient, or old record with no links in bank_url.
$tabpay[$obj->rowid]['type'] = 'unknown'; // Can be SOLD, miscellaneous entry, payment of patient, or any old record with no links in bank_url.
$tabtype[$obj->rowid] = 'unknown';
// get_url may return -1 which is not traversable
@@ -602,6 +627,8 @@ if (! $error && $action == 'writebookkeeping') {
}
}
// Export
if ($action == 'exportcsv') { // ISO and not UTF8 !
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
@@ -735,18 +762,34 @@ if (empty($action) || $action == 'view') {
journalHead($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink);
// Test that setup is complete
$sql='SELECT COUNT(rowid) as nb FROM '.MAIN_DB_PREFIX.'bank_account WHERE fk_accountancy_journal IS NULL';
$resql=$db->query($sql);
if ($resql)
{
$obj=$db->fetch_object($resql);
if ($obj->nb > 0)
{
print '<br>'.img_warning().' '.$langs->trans("TheJournalCodeIsNotDefinedOnSomeBankAccount");
print ' : '.$langs->trans("AccountancyAreaDescBank", 9, '<strong>'.$langs->transnoentitiesnoconv("MenuBankCash").'</strong>');
}
}
else dol_print_error($db);
// Button to write into Ledger
if (empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER) || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1'
|| empty($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER) || $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == '-1'
|| empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) || $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT == '-1') {
print img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone");
print '<br>'.img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone");
print ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
}
print '<div class="tabsAction tabsActionNoBottom">';
print '<input type="button" class="butAction" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writebookkeeping();" />';
print '<input type="button" class="butAction" value="' . $langs->trans("ExportDraftJournal") . '" onclick="launch_export();" />';
print '<input type="button" class="butAction" name="writebookkeeping" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writebookkeeping();" />';
print '<input type="button" class="butAction" name="exportcsv" value="' . $langs->trans("ExportDraftJournal") . '" onclick="launch_export();" />';
print '</div>';
// TODO Avoid using js. We can use a direct link with $param
@@ -754,15 +797,15 @@ if (empty($action) || $action == 'view') {
<script type="text/javascript">
function launch_export() {
console.log("Set value into form and submit");
$("div.fiche div.tabBar form input[name=\"action\"]").val("exportcsv");
$("div.fiche div.tabBar form input[type=\"submit\"]").click();
$("div.fiche div.tabBar form input[name=\"action\"]").val("");
$("div.fiche form input[name=\"action\"]").val("exportcsv");
$("div.fiche form input[type=\"submit\"]").click();
$("div.fiche form input[name=\"action\"]").val("");
}
function writebookkeeping() {
console.log("Set value into form and submit");
$("div.fiche div.tabBar form input[name=\"action\"]").val("writebookkeeping");
$("div.fiche div.tabBar form input[type=\"submit\"]").click();
$("div.fiche div.tabBar form input[name=\"action\"]").val("");
$("div.fiche form input[name=\"action\"]").val("writebookkeeping");
$("div.fiche form input[type=\"submit\"]").click();
$("div.fiche form input[name=\"action\"]").val("");
}
</script>';
@@ -796,8 +839,10 @@ if (empty($action) || $action == 'view') {
// Bank
foreach ( $tabbq[$key] as $k => $mt )
{
//var_dump($tabpay[$key]);
print '<!-- Bank bank.rowid='.$key.' type='.$tabpay[$key]['type'].' ref='.$tabpay[$key]['ref'].'-->';
print '<tr class="oddeven">';
print "<td><!-- Bank bank.rowid=".$key."--></td>";
print "<td></td>";
print "<td>" . $date . "</td>";
print "<td>" . $ref . "</td>";
// Ledger account
@@ -818,11 +863,14 @@ if (empty($action) || $action == 'view') {
}
else print $accounttoshow;*/
print "</td>";
if ($val['soclib'] == '') {
print "<td>" . $langs->trans("Bank") . " - " . $reflabel . "</td>";
} else {
print "<td>" . $langs->trans("Bank") . " - " . $val['soclib'] . "</td>";
print "<td>";
//var_dump($tabpay[$key]);
print $langs->trans("Bank");
print ' '.$val['bank_account_ref'];
if (! empty($val['soclib'])) {
print " - " . $val['soclib'];
}
print "</td>";
print "<td>" . $val["type_payment"] . "</td>";
print "<td align='right'>" . ($mt >= 0 ? price($mt) : '') . "</td>";
print "<td align='right'>" . ($mt < 0 ? price(- $mt) : '') . "</td>";
@@ -833,14 +881,15 @@ if (empty($action) || $action == 'view') {
if (is_array($tabtp[$key])) {
foreach ( $tabtp[$key] as $k => $mt ) {
if ($k != 'type') {
print '<!-- Thirdparty bank.rowid='.$key.' -->';
print '<tr class="oddeven">';
print "<td><!-- Thirdparty bank.rowid=".$key." --></td>";
print "<td></td>";
print "<td>" . $date . "</td>";
print "<td>" . $ref . "</td>";
// Ledger account
print "<td>";
$account_ledger = $k;
// Try to force general ledger account depending on type
if ($tabtype[$key] == 'payment') $account_ledger = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER;
if ($tabtype[$key] == 'payment_supplier') $account_ledger = $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER;
if ($tabtype[$key] == 'payment_expensereport') $account_ledger = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT;
@@ -877,7 +926,11 @@ if (empty($action) || $action == 'view') {
{
if (empty($accounttoshowsubledger) || $accounttoshowsubledger == 'NotDefined')
{
print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefined").'</span>';
/*var_dump($tabpay[$key]);
var_dump($tabtype[$key]);
var_dump($tabbq[$key]);*/
//print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefined").'</span>';
print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknown").'</span>';
}
else print $accounttoshowsubledger;
}
@@ -892,8 +945,9 @@ if (empty($action) || $action == 'view') {
}
} else {
foreach ( $tabbq[$key] as $k => $mt ) {
print '<!-- Wait bank.rowid='.$key.' -->';
print '<tr class="oddeven">';
print "<td><!-- Wait bank.rowid=".$key." --></td>";
print "<td></td>";
print "<td>" . $date . "</td>";
print "<td>" . $ref . "</td>";
// Ledger account
@@ -936,7 +990,7 @@ $db->close();
* Return source for doc_ref of a bank transaction
*
* @param string $val Array of val
* @param string $typerecord Type of record
* @param string $typerecord Type of record ('payment', 'payment_supplier', 'payment_expensereport', 'payment_vat', ...)
* @return string|unknown
*/
function getSourceDocRef($val, $typerecord)

View File

@@ -510,7 +510,7 @@ if (empty($action) || $action == 'view') {
// Button to write into Ledger
if (empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) || $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT == '-1') {
print img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone");
print '<br>'.img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone");
print ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
}
print '<div class="tabsAction tabsActionNoBottom">';
@@ -518,11 +518,12 @@ if (empty($action) || $action == 'view') {
print '<input type="button" class="butActionRefused" title="'.dol_escape_htmltag($langs->trans("SomeMandatoryStepsOfSetupWereNotDone")).'" value="' . $langs->trans("WriteBookKeeping") . '" />';
}
else {
print '<input type="button" class="butAction" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writebookkeeping();" />';
print '<input type="button" class="butAction" name="writebookkeeping" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writebookkeeping();" />';
}
//print '<input type="button" class="butAction" value="' . $langs->trans("ExportDraftJournal") . '" onclick="launch_export();" />';
//print '<input type="button" class="butAction" name="exportcsv" value="' . $langs->trans("ExportDraftJournal") . '" onclick="launch_export();" />';
print '</div>';
// TODO Avoid using js. We can use a direct link with $param
print '
<script type="text/javascript">
function launch_export() {

View File

@@ -539,22 +539,23 @@ if (empty($action) || $action == 'view') {
print '<input type="button" class="butActionRefused" title="'.dol_escape_htmltag($langs->trans("SomeMandatoryStepsOfSetupWereNotDone")).'" value="' . $langs->trans("WriteBookKeeping") . '" />';
}
else {
print '<input type="button" class="butAction" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writebookkeeping();" />';
print '<input type="button" class="butAction" name="writebookkeeping" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writebookkeeping();" />';
}
print '<input type="button" class="butAction" value="' . $langs->trans("ExportDraftJournal") . '" onclick="launch_export();" />';
print '<input type="button" class="butAction" name="exportcsv" value="' . $langs->trans("ExportDraftJournal") . '" onclick="launch_export();" />';
print '</div>';
// TODO Avoid using js. We can use a direct link with $param
print '
<script type="text/javascript">
function launch_export() {
$("div.fiche div.tabBar form input[name=\"action\"]").val("exportcsv");
$("div.fiche div.tabBar form input[type=\"submit\"]").click();
$("div.fiche div.tabBar form input[name=\"action\"]").val("");
$("div.fiche form input[name=\"action\"]").val("exportcsv");
$("div.fiche form input[type=\"submit\"]").click();
$("div.fiche form input[name=\"action\"]").val("");
}
function writebookkeeping() {
$("div.fiche div.tabBar form input[name=\"action\"]").val("writebookkeeping");
$("div.fiche div.tabBar form input[type=\"submit\"]").click();
$("div.fiche div.tabBar form input[name=\"action\"]").val("");
$("div.fiche form input[name=\"action\"]").val("writebookkeeping");
$("div.fiche form input[type=\"submit\"]").click();
$("div.fiche form input[name=\"action\"]").val("");
}
</script>';

View File

@@ -559,22 +559,23 @@ if (empty($action) || $action == 'view') {
print '<input type="button" class="butActionRefused" title="'.dol_escape_htmltag($langs->trans("SomeMandatoryStepsOfSetupWereNotDone")).'" value="' . $langs->trans("WriteBookKeeping") . '" />';
}
else {
print '<input type="button" class="butAction" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writebookkeeping();" />';
print '<input type="button" class="butAction" name="writebookkeeping" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writebookkeeping();" />';
}
print '<input type="button" class="butAction" value="' . $langs->trans("ExportDraftJournal") . '" onclick="launch_export();" />';
print '<input type="button" class="butAction" name="exportcsv" value="' . $langs->trans("ExportDraftJournal") . '" onclick="launch_export();" />';
print '</div>';
// TODO Avoid using js. We can use a direct link with $param
print '
<script type="text/javascript">
function launch_export() {
$("div.fiche div.tabBar form input[name=\"action\"]").val("exportcsv");
$("div.fiche div.tabBar form input[type=\"submit\"]").click();
$("div.fiche div.tabBar form input[name=\"action\"]").val("");
$("div.fiche form input[name=\"action\"]").val("exportcsv");
$("div.fiche form input[type=\"submit\"]").click();
$("div.fiche form input[name=\"action\"]").val("");
}
function writebookkeeping() {
$("div.fiche div.tabBar form input[name=\"action\"]").val("writebookkeeping");
$("div.fiche div.tabBar form input[type=\"submit\"]").click();
$("div.fiche div.tabBar form input[name=\"action\"]").val("");
$("div.fiche form input[name=\"action\"]").val("writebookkeeping");
$("div.fiche form input[type=\"submit\"]").click();
$("div.fiche form input[name=\"action\"]").val("");
}
</script>';

View File

@@ -105,29 +105,6 @@ if ($action == 'validatehistory') {
$db->commit();
setEventMessages($langs->trans('AutomaticBindingDone'), null, 'mesgs');
}
} elseif ($action == 'fixaccountancycode') {
$error = 0;
$db->begin();
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det as fd";
$sql1 .= " SET fk_code_ventilation = 0";
$sql1 .= ' WHERE fd.fk_code_ventilation NOT IN ';
$sql1 .= ' (SELECT accnt.rowid ';
$sql1 .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
$sql1 .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
$sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ')';
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
$resql1 = $db->query($sql1);
if (! $resql1) {
$error ++;
$db->rollback();
setEventMessage($db->lasterror(), 'errors');
} else {
$db->commit();
setEventMessage($langs->trans('Done'), 'mesgs');
}
} elseif ($action == 'cleanaccountancycode') {
$error = 0;
$db->begin();
@@ -140,7 +117,7 @@ if ($action == 'validatehistory') {
$sql1.= " AND f.entity IN (" . getEntity('accountancy') . ")";
$sql1.= ")";
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
dol_syslog("htdocs/accountancy/customer/index.php cleanaccountancycode", LOG_DEBUG);
$resql1 = $db->query($sql1);
if (! $resql1) {
@@ -168,10 +145,25 @@ print $langs->trans("DescVentilSupplier") . '<br>';
print $langs->trans("DescVentilMore", $langs->transnoentitiesnoconv("ValidateHistory"), $langs->transnoentitiesnoconv("ToBind")) . '<br>';
print '<br>';
//print '<div class="inline-block divButAction">';
// TODO Remove this. Should be done always or into the repair.php script.
if ($conf->global->MAIN_FEATURES_LEVEL > 1) print '<a class="butActionDelete" href="' . $_SERVER['PHP_SELF'] . '?year=' . $year_current . '&action=fixaccountancycode">' . $langs->trans("CleanFixHistory", $year_current) . '</a>';
//print '</div>';
// Clean database
$db->begin();
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det as fd";
$sql1 .= " SET fk_code_ventilation = 0";
$sql1 .= ' WHERE fd.fk_code_ventilation NOT IN ';
$sql1 .= ' (SELECT accnt.rowid ';
$sql1 .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
$sql1 .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
$sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ')';
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
$resql1 = $db->query($sql1);
if (! $resql1) {
$error ++;
$db->rollback();
setEventMessage($db->lasterror(), 'errors');
} else {
$db->commit();
}
// End clean database
$y = $year_current;
@@ -191,8 +183,8 @@ for($i = 1; $i <= 12; $i ++) {
}
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.account_number') ." AS codecomptable,";
$sql .= " " . $db->ifsql('aa.label IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.label') . " AS intitule,";
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number') ." AS codecomptable,";
$sql .= " " . $db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label') . " AS intitule,";
for($i = 1; $i <= 12; $i ++) {
$sql .= " SUM(" . $db->ifsql('MONTH(ff.datef)=' . $i, 'ffd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
}
@@ -214,8 +206,20 @@ if ($resql) {
while ( $row = $db->fetch_row($resql)) {
print '<tr class="oddeven"><td>' . length_accountg($row[0]) . '</td>';
print '<td align="left">' . $row[1] . '</td>';
print '<tr class="oddeven"><td>';
if ($row[0] == 'tobind')
{
print $langs->trans("Unknown");
}
else print length_accountg($row[0]);
print '</td>';
print '<td align="left">';
if ($row[0] == 'tobind')
{
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/supplier/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
}
else print $row[1];
print '</td>';
for($i = 2; $i <= 12; $i ++) {
print '<td align="right">' . price($row[$i]) . '</td>';
}
@@ -245,8 +249,8 @@ for($i = 1; $i <= 12; $i ++) {
}
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.account_number') ." AS codecomptable,";
$sql .= " " . $db->ifsql('aa.label IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.label') . " AS intitule,";
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number') ." AS codecomptable,";
$sql .= " " . $db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label') . " AS intitule,";
for($i = 1; $i <= 12; $i ++) {
$sql .= " SUM(" . $db->ifsql('MONTH(ff.datef)=' . $i, 'ffd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
}
@@ -268,9 +272,21 @@ if ($resql) {
while ( $row = $db->fetch_row($resql)) {
print '<tr class="oddeven"><td>' . length_accountg($row[0]) . '</td>';
print '<td align="left">' . $row[1] . '</td>';
for($i = 2; $i <= 12; $i ++) {
print '<tr class="oddeven"><td>';
if ($row[0] == 'tobind')
{
print $langs->trans("Unknown");
}
else print length_accountg($row[0]);
print '</td>';
print '<td align="left">';
if ($row[0] == 'tobind')
{
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/supplier/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
}
else print $row[1];
print '</td>';
for($i = 2; $i <= 12; $i ++) {
print '<td align="right">' . price($row[$i]) . '</td>';
}
print '<td align="right">' . price($row[13]) . '</td>';

View File

@@ -33,6 +33,8 @@ require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.product.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
// Langs
$langs->load("compta");
@@ -60,6 +62,10 @@ $search_desc = GETPOST('search_desc', 'alpha');
$search_amount = GETPOST('search_amount', 'alpha');
$search_account = GETPOST('search_account', 'alpha');
$search_vat = GETPOST('search_vat', 'alpha');
$search_day=GETPOST("search_day","int");
$search_month=GETPOST("search_month","int");
$search_year=GETPOST("search_year","int");
$btn_ventil = GETPOST('ventil', 'alpha');
// Load variable for pagination
@@ -110,6 +116,8 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x',
$search_amount = '';
$search_account = '';
$search_vat = '';
$search_month = '';
$search_year = '';
}
// Mass actions
@@ -176,6 +184,7 @@ if ($massaction == 'ventil') {
*/
$form = new Form($db);
$formother = new FormOther($db);
llxHeader('', $langs->trans("SuppliersVentilation"));
@@ -218,6 +227,19 @@ if (strlen(trim($search_account))) {
if (strlen(trim($search_vat))) {
$sql .= natural_search("l.tva_tx",$search_vat,1);
}
if ($search_month > 0)
{
if ($search_year > 0 && empty($search_day))
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'";
else if ($search_year > 0 && ! empty($search_day))
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'";
else
$sql.= " AND date_format(f.datef, '%m') = '".$db->escape($search_month)."'";
}
else if ($search_year > 0)
{
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'";
}
$sql .= " AND f.entity IN (" . getEntity('facture_fourn', 0) . ")"; // We don't share object for accountancy
$sql .= $db->order($sortfield, $sortorder);
@@ -243,6 +265,15 @@ if ($result) {
$param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($search_lineid) $param.='&search_lineid='.urlencode($search_lineid);
if ($search_day) $param.='&search_day='.urlencode($search_day);
if ($search_month) $param.='&search_month='.urlencode($search_month);
if ($search_year) $param.='&search_year='.urlencode($search_year);
if ($search_invoice) $param.='&search_invoice='.urlencode($search_invoice);
if ($search_ref) $param.='&search_ref='.urlencode($search_ref);
if ($search_desc) $param.='&search_desc='.urlencode($search_desc);
if ($search_amount) $param.='&search_amount='.urlencode($search_amount);
if ($search_vat) $param.='&search_vat='.urlencode($search_vat);
$arrayofmassactions = array(
'ventil'=>$langs->trans("Ventilate")
@@ -279,7 +310,11 @@ if ($result) {
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_lineid" value="' . dol_escape_htmltag($search_lineid) . '""></td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="' . dol_escape_htmltag($search_invoice) . '"></td>';
print '<td class="liste_titre"></td>';
print '<td class="liste_titre"></td>';
print '<td class="liste_titre center">';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="search_day" value="'.$search_day.'">';
print '<input class="flat" type="text" size="1" maxlength="2" name="search_month" value="'.$search_month.'">';
$formother->select_year($search_year,'search_year',1, 20, 5);
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 maxwidthonsmartphone" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';

View File

@@ -203,7 +203,7 @@ if ($conf->facture->enabled)
print '</td>';
}
print "</tr>\n";
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled))
{
print '<tr class="oddeven"><td>'.$langs->trans("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS").'</td>';
@@ -263,40 +263,6 @@ $helptext.='%YEAR%, %MONTH%, %DAY%';
form_constantes($constantes, 0, $helptext);
print '<br>';
/*
* Editing global variables not related to a specific theme
*/
$constantes=array(
'ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT',
'ADHERENT_AUTOREGISTER_NOTIF_MAIL',
'ADHERENT_AUTOREGISTER_MAIL_SUBJECT',
'ADHERENT_AUTOREGISTER_MAIL',
'ADHERENT_MAIL_VALID_SUBJECT',
'ADHERENT_MAIL_VALID',
'ADHERENT_MAIL_COTIS_SUBJECT',
'ADHERENT_MAIL_COTIS',
'ADHERENT_MAIL_RESIL_SUBJECT',
'ADHERENT_MAIL_RESIL',
'ADHERENT_MAIL_FROM',
);
print load_fiche_titre($langs->trans("Other"),'','');
$helptext='*'.$langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
$helptext.='%DOL_MAIN_URL_ROOT%, %ID%, %FIRSTNAME%, %LASTNAME%, %FULLNAME%, %LOGIN%, %PASSWORD%, ';
$helptext.='%COMPANY%, %ADDRESS%, %ZIP%, %TOWN%, %COUNTRY%, %EMAIL%, %BIRTH%, %PHOTO%, %TYPE%, ';
$helptext.='%YEAR%, %MONTH%, %DAY%';
$helptext='*'.$langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
$helptext.='%DOL_MAIN_URL_ROOT%, %ID%, %FIRSTNAME%, %LASTNAME%, %FULLNAME%, %LOGIN%, %PASSWORD%, ';
$helptext.='%COMPANY%, %ADDRESS%, %ZIP%, %TOWN%, %COUNTRY%, %EMAIL%, %BIRTH%, %PHOTO%, %TYPE%, ';
//$helptext.='%YEAR%, %MONTH%, %DAY%'; // Not supported
form_constantes($constantes, 0, $helptext);
dol_fiche_end();

View File

@@ -0,0 +1,190 @@
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 J. Fernando Lagrange <fernando@demo-tic.org>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/adherents/admin/adherent.php
* \ingroup member
* \brief Page to setup the module Foundation
*/
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
$langs->load("admin");
$langs->load("members");
if (! $user->admin) accessforbidden();
$type=array('yesno','texte','chaine');
$action = GETPOST('action','alpha');
/*
* Actions
*/
//
if ($action == 'updateall')
{
$db->begin();
$res1=$res2=$res3=$res4=$res5=$res6=0;
$res1=dolibarr_set_const($db, 'ADHERENT_LOGIN_NOT_REQUIRED', GETPOST('ADHERENT_LOGIN_NOT_REQUIRED', 'alpha'), 'chaine', 0, '', $conf->entity);
$res2=dolibarr_set_const($db, 'ADHERENT_MAIL_REQUIRED', GETPOST('ADHERENT_MAIL_REQUIRED', 'alpha'), 'chaine', 0, '', $conf->entity);
$res3=dolibarr_set_const($db, 'ADHERENT_DEFAULT_SENDINFOBYMAIL', GETPOST('ADHERENT_DEFAULT_SENDINFOBYMAIL', 'alpha'), 'chaine', 0, '', $conf->entity);
$res4=dolibarr_set_const($db, 'ADHERENT_BANK_USE', GETPOST('ADHERENT_BANK_USE', 'alpha'), 'chaine', 0, '', $conf->entity);
// Use vat for invoice creation
if ($conf->facture->enabled)
{
$res4=dolibarr_set_const($db, 'ADHERENT_VAT_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_VAT_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity);
$res5=dolibarr_set_const($db, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity);
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled))
{
$res6=dolibarr_set_const($db, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity);
}
}
if ($res1 < 0 || $res2 < 0 || $res3 < 0 || $res4 < 0 || $res5 < 0 || $res6 < 0)
{
setEventMessages('ErrorFailedToSaveDate', null, 'errors');
$db->rollback();
}
else
{
setEventMessages('RecordModifiedSuccessfully', null, 'mesgs');
$db->commit();
}
}
// Action mise a jour ou ajout d'une constante
if ($action == 'update' || $action == 'add')
{
$constname=GETPOST('constname','alpha');
$constvalue=(GETPOST('constvalue_'.$constname) ? GETPOST('constvalue_'.$constname) : GETPOST('constvalue'));
if (($constname=='ADHERENT_CARD_TYPE' || $constname=='ADHERENT_ETIQUETTE_TYPE' || $constname=='ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS') && $constvalue == -1) $constvalue='';
if ($constname=='ADHERENT_LOGIN_NOT_REQUIRED') // Invert choice
{
if ($constvalue) $constvalue=0;
else $constvalue=1;
}
$consttype=GETPOST('consttype','alpha');
$constnote=GETPOST('constnote');
$res=dolibarr_set_const($db,$constname,$constvalue,$type[$consttype],0,$constnote,$conf->entity);
if (! $res > 0) $error++;
if (! $error)
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
// Action activation d'un sous module du module adherent
if ($action == 'set')
{
$result=dolibarr_set_const($db, GETPOST('name','alpha'),GETPOST('value'),'',0,'',$conf->entity);
if ($result < 0)
{
print $db->error();
}
}
// Action desactivation d'un sous module du module adherent
if ($action == 'unset')
{
$result=dolibarr_del_const($db,GETPOST('name','alpha'),$conf->entity);
if ($result < 0)
{
print $db->error();
}
}
/*
* View
*/
$form = new Form($db);
$help_url='EN:Module_Foundations|FR:Module_Adh&eacute;rents|ES:M&oacute;dulo_Miembros';
llxHeader('',$langs->trans("MembersSetup"),$help_url);
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans("MembersSetup"),$linkback,'title_setup');
$head = member_admin_prepare_head();
dol_fiche_head($head, 'emails', $langs->trans("Members"), -1, 'user');
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="updateall">';
/*
* Editing global variables not related to a specific theme
*/
$constantes=array(
'ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT',
'ADHERENT_AUTOREGISTER_NOTIF_MAIL',
'ADHERENT_AUTOREGISTER_MAIL_SUBJECT',
'ADHERENT_AUTOREGISTER_MAIL',
'ADHERENT_MAIL_VALID_SUBJECT',
'ADHERENT_MAIL_VALID',
'ADHERENT_MAIL_COTIS_SUBJECT',
'ADHERENT_MAIL_COTIS',
'ADHERENT_MAIL_RESIL_SUBJECT',
'ADHERENT_MAIL_RESIL',
'ADHERENT_MAIL_FROM',
);
$helptext='*'.$langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
$helptext.='%DOL_MAIN_URL_ROOT%, %ID%, %FIRSTNAME%, %LASTNAME%, %FULLNAME%, %LOGIN%, %PASSWORD%, ';
$helptext.='%COMPANY%, %ADDRESS%, %ZIP%, %TOWN%, %COUNTRY%, %EMAIL%, %BIRTH%, %PHOTO%, %TYPE%, ';
$helptext.='%YEAR%, %MONTH%, %DAY%';
$helptext='*'.$langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
$helptext.='%DOL_MAIN_URL_ROOT%, %ID%, %FIRSTNAME%, %LASTNAME%, %FULLNAME%, %LOGIN%, %PASSWORD%, ';
$helptext.='%COMPANY%, %ADDRESS%, %ZIP%, %TOWN%, %COUNTRY%, %EMAIL%, %BIRTH%, %PHOTO%, %TYPE%, ';
//$helptext.='%YEAR%, %MONTH%, %DAY%'; // Not supported
form_constantes($constantes, 0, $helptext);
dol_fiche_end();
llxFooter();
$db->close();

View File

@@ -43,6 +43,12 @@ if (! $user->admin) accessforbidden();
* Actions
*/
if ($action == 'setMEMBER_ENABLE_PUBLIC')
{
if (GETPOST('value')) dolibarr_set_const($db, 'MEMBER_ENABLE_PUBLIC', 1, 'chaine', 0, '', $conf->entity);
else dolibarr_set_const($db, 'MEMBER_ENABLE_PUBLIC', 0, 'chaine', 0, '', $conf->entity);
}
if ($action == 'update')
{
$public=GETPOST('MEMBER_ENABLE_PUBLIC');
@@ -94,7 +100,7 @@ print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
dol_fiche_head($head, 'public', $langs->trans("Members"), -1, 'user');
dol_fiche_head($head, 'website', $langs->trans("Members"), -1, 'user');
if ($conf->use_javascript_ajax)
{
@@ -135,99 +141,109 @@ if ($conf->use_javascript_ajax)
print $langs->trans("BlankSubscriptionFormDesc").'<br><br>';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td align="right">'.$langs->trans("Value").'</td>';
print "</tr>\n";
// Allow public form
print '<tr class="oddeven"><td>';
print $langs->trans("EnablePublicSubscriptionForm");
print '</td><td align="right">';
print $form->selectyesno("MEMBER_ENABLE_PUBLIC",(! empty($conf->global->MEMBER_ENABLE_PUBLIC)?$conf->global->MEMBER_ENABLE_PUBLIC:0),1);
print "</td></tr>\n";
// Force Type
$adht = new AdherentType($db);
print '<tr class="oddeven drag" id="trforcetype"><td>';
print $langs->trans("ForceMemberType");
print '</td><td width="60" align="right">';
$listofval = array(-1 => $langs->trans("Undefined"));
$listofval += $adht->liste_array();
$forcetype = $conf->global->MEMBER_NEWFORM_FORCETYPE ?: -1;
print $form->selectarray("MEMBER_NEWFORM_FORCETYPE", $listofval, $forcetype, count($listetype)>1?1:0);
print "</td></tr>\n";
// Amount
print '<tr class="oddeven" id="tramount"><td>';
print $langs->trans("DefaultAmount");
print '</td><td align="right">';
print '<input type="text" id="MEMBER_NEWFORM_AMOUNT" name="MEMBER_NEWFORM_AMOUNT" size="5" value="'.(! empty($conf->global->MEMBER_NEWFORM_AMOUNT)?$conf->global->MEMBER_NEWFORM_AMOUNT:'').'">';
print "</td></tr>\n";
// Can edit
print '<tr class="oddeven" id="tredit"><td>';
print $langs->trans("CanEditAmount");
print '</td><td align="right">';
print $form->selectyesno("MEMBER_NEWFORM_EDITAMOUNT",(! empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)?$conf->global->MEMBER_NEWFORM_EDITAMOUNT:0),1);
print "</td></tr>\n";
if (! empty($conf->paybox->enabled) || ! empty($conf->paypal->enabled) || ! empty($conf->stripe->enabled))
$enabledisablehtml = $langs->trans("EnablePublicSubscriptionForm").' ';
if (empty($conf->global->MEMBER_ENABLE_PUBLIC))
{
// Button off, click to enable
$enabledisablehtml.='<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setMEMBER_ENABLE_PUBLIC&value=1'.$param.'">';
$enabledisablehtml.=img_picto($langs->trans("Disabled"),'switch_off');
$enabledisablehtml.='</a>';
}
else
{
// Button on, click to disable
$enabledisablehtml.='<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setMEMBER_ENABLE_PUBLIC&value=0'.$param.'">';
$enabledisablehtml.=img_picto($langs->trans("Activated"),'switch_on');
$enabledisablehtml.='</a>';
}
print $enabledisablehtml;
print '<input type="hidden" id="MEMBER_ENABLE_PUBLIC" name="MEMBER_ENABLE_PUBLIC" value="'.(empty($conf->global->MEMBER_ENABLE_PUBLIC)?0:1).'">';
print '<br>';
if (! empty($conf->global->MEMBER_ENABLE_PUBLIC))
{
print '<br>';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td align="right">'.$langs->trans("Value").'</td>';
print "</tr>\n";
// Force Type
$adht = new AdherentType($db);
print '<tr class="oddeven drag" id="trforcetype"><td>';
print $langs->trans("ForceMemberType");
print '</td><td width="60" align="right">';
$listofval = array(-1 => $langs->trans("Undefined"));
$listofval += $adht->liste_array();
$forcetype = $conf->global->MEMBER_NEWFORM_FORCETYPE ?: -1;
print $form->selectarray("MEMBER_NEWFORM_FORCETYPE", $listofval, $forcetype, count($listetype)>1?1:0);
print "</td></tr>\n";
// Amount
print '<tr class="oddeven" id="tramount"><td>';
print $langs->trans("DefaultAmount");
print '</td><td align="right">';
print '<input type="text" id="MEMBER_NEWFORM_AMOUNT" name="MEMBER_NEWFORM_AMOUNT" size="5" value="'.(! empty($conf->global->MEMBER_NEWFORM_AMOUNT)?$conf->global->MEMBER_NEWFORM_AMOUNT:'').'">';
print "</td></tr>\n";
// Can edit
print '<tr class="oddeven" id="tredit"><td>';
print $langs->trans("CanEditAmount");
print '</td><td align="right">';
print $form->selectyesno("MEMBER_NEWFORM_EDITAMOUNT",(! empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)?$conf->global->MEMBER_NEWFORM_EDITAMOUNT:0),1);
print "</td></tr>\n";
// Jump to an online payment page
print '<tr class="oddeven" id="trpayment"><td>';
print $langs->trans("MEMBER_NEWFORM_PAYONLINE");
print '</td><td align="right">';
$listofval=array();
$listofval['-1']=$langs->trans('No');
$listofval['all']=$langs->trans('Yes').' ('.$langs->trans("VisitorCanChooseItsPaymentMode").')';
if (! empty($conf->paybox->enabled)) $listofval['paybox']='Paybox';
if (! empty($conf->paypal->enabled)) $listofval['paypal']='PayPal';
if (! empty($conf->stripe->enabled)) $listofval['stripe']='Stripe';
print $form->selectarray("MEMBER_NEWFORM_PAYONLINE",$listofval,(! empty($conf->global->MEMBER_NEWFORM_PAYONLINE)?$conf->global->MEMBER_NEWFORM_PAYONLINE:''),1);
print $form->selectarray("MEMBER_NEWFORM_PAYONLINE",$listofval,(! empty($conf->global->MEMBER_NEWFORM_PAYONLINE)?$conf->global->MEMBER_NEWFORM_PAYONLINE:''),0);
print "</td></tr>\n";
// Jump to an online payment page
print '<tr class="oddeven" id="tremail"><td>';
print $langs->trans("MEMBER_PAYONLINE_SENDEMAIL");
print '</td><td align="right">';
print '<input type="text" id="MEMBER_PAYONLINE_SENDEMAIL" name="MEMBER_PAYONLINE_SENDEMAIL" size="24" value="'.(! empty($conf->global->MEMBER_PAYONLINE_SENDEMAIL)?$conf->global->MEMBER_PAYONLINE_SENDEMAIL:'').'">';
print "</td></tr>\n";
print '</table>';
print '<center>';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print '</center>';
}
if (! empty($conf->paybox->enabled) || ! empty($conf->paypal->enabled) || ! empty($conf->stripe->enabled))
{
// Jump to an online payment page
print '<tr class="oddeven" id="tremail"><td>';
print $langs->trans("MEMBER_PAYONLINE_SENDEMAIL");
print '</td><td align="right">';
print '<input type="text" id="MEMBER_PAYONLINE_SENDEMAIL" name="MEMBER_PAYONLINE_SENDEMAIL" size="24" value="'.(! empty($conf->global->MEMBER_PAYONLINE_SENDEMAIL)?$conf->global->MEMBER_PAYONLINE_SENDEMAIL:'').'">';
print "</td></tr>\n";
}
print '</table>';
dol_fiche_end();
print '<center>';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print '</center>';
print '</form>';
print '<br>';
//print $langs->trans('FollowingLinksArePublic').'<br>';
print img_picto('','object_globe.png').' '.$langs->trans('BlankSubscriptionForm').':<br>';
if ($conf->multicompany->enabled) {
$entity_qr='?entity='.$conf->entity;
} else {
$entity_qr='';
if (! empty($conf->global->MEMBER_ENABLE_PUBLIC))
{
print '<br>';
//print $langs->trans('FollowingLinksArePublic').'<br>';
print img_picto('','object_globe.png').' '.$langs->trans('BlankSubscriptionForm').':<br>';
if ($conf->multicompany->enabled) {
$entity_qr='?entity='.$conf->entity;
} else {
$entity_qr='';
}
print '<a target="_blank" href="'.DOL_URL_ROOT.'/public/members/new.php'.$entity_qr.'">'.DOL_MAIN_URL_ROOT.'/public/members/new.php'.$entity_qr.'</a>';
}
print '<a target="_blank" href="'.DOL_URL_ROOT.'/public/members/new.php'.$entity_qr.'">'.DOL_MAIN_URL_ROOT.'/public/members/new.php'.$entity_qr.'</a>';
/*
print '<table class="border" cellspacing="0" cellpadding="3">';
print '<tr class="liste_titre"><td>'.$langs->trans("Description").'</td><td>'.$langs->trans("URL").'</td></tr>';
print '<tr><td>'.$langs->trans("BlankSubscriptionForm").'</td><td>'..'</td></tr>';
print '<tr><td>'.$langs->trans("PublicMemberList").'</td><td>'.img_picto('','object_globe.png').' '.'<a target="_blank" href="'.DOL_URL_ROOT.'/public/members/public_list.php'.'">'.DOL_MAIN_URL_ROOT.'/public/members/public_list.php'.'</a></td></tr>';
print '<tr><td>'.$langs->trans("PublicMemberCard").'</td><td>'.img_picto('','object_globe.png').' '.DOL_MAIN_URL_ROOT.'/public/members/public_card.php?id=xxx'.'</td></tr>';
print '</table>';
*/
llxFooter();

View File

@@ -1743,14 +1743,19 @@ else
// Show links to link elements
/*$linktoelem = $form->showLinkToObjectBlock($object,array('order'));
if ($linktoelem) print ($somethingshown?'':'<br>').$linktoelem;
// Link for paypal payment
/*
if (! empty($conf->paypal->enabled) && $object->statut != 0) {
include_once DOL_DOCUMENT_ROOT . '/paypal/lib/paypal.lib.php';
print showPaypalPaymentUrl('invoice', $object->ref);
}
*/
// Shon online payment link
$useonlinepayment = (! empty($conf->paypal->enabled) || ! empty($conf->stripe->enabled) || ! empty($conf->paybox->enabled));
if ($useonlinepayment)
{
print '<br>';
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
print showOnlinePaymentUrl('membersubscription', $object->ref);
}
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
// List of actions on element

View File

@@ -789,14 +789,10 @@ if ($rowid > 0)
if ($object->statut > 0) print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?rowid='.$rowid.'&action=addsubscription">'.$langs->trans("AddSubscription")."</a></div>";
else print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("ValidateBefore")).'">'.$langs->trans("AddSubscription").'</a></div>';
print "<br>\n";
print '</div>';
print '<br>';
}
}
/*
* List of subscriptions
*/
@@ -882,24 +878,21 @@ if ($rowid > 0)
{
dol_print_error($db);
}
// Link for paypal payment
if (! empty($conf->paypal->enabled))
{
include_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php';
print showPaypalPaymentUrl('membersubscription',$object->ref);
}
// Link for stripe payment
if (! empty($conf->stripe->enabled))
{
include_once DOL_DOCUMENT_ROOT.'/stripe/lib/stripe.lib.php';
print showStripePaymentUrl('membersubscription',$object->ref);
}
}
// Shon online payment link
$useonlinepayment = (! empty($conf->paypal->enabled) || ! empty($conf->stripe->enabled) || ! empty($conf->paybox->enabled));
if ($useonlinepayment)
{
print '<br>';
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
print showOnlinePaymentUrl('membersubscription', $object->ref);
}
/*
* Add new subscription form
*/

View File

@@ -402,14 +402,8 @@ if ($rowid && $action != 'edit')
// Show links to link elements
/*$linktoelem = $form->showLinkToObjectBlock($object,array('order'));
if ($linktoelem) print ($somethingshown?'':'<br>').$linktoelem;
// Link for paypal payment
/*
if (! empty($conf->paypal->enabled) && $object->statut != 0) {
include_once DOL_DOCUMENT_ROOT . '/paypal/lib/paypal.lib.php';
print showPaypalPaymentUrl('invoice', $object->ref);
}
*/
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
// List of actions on element

View File

@@ -157,7 +157,7 @@ if ( ($action == 'update' && ! GETPOST("cancel",'alpha'))
dolibarr_set_const($db, "MAIN_INFO_TVAINTRA", GETPOST("tva",'alpha'),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_OBJECT", GETPOST("object",'nohtml'),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "SOCIETE_FISCAL_MONTH_START", GETPOST("fiscalmonthstart",'alpha'),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "SOCIETE_FISCAL_MONTH_START", GETPOST("SOCIETE_FISCAL_MONTH_START",'alpha'),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "FACTURE_TVAOPTION", GETPOST("optiontva",'alpha'),'chaine',0,'',$conf->entity);
@@ -547,8 +547,8 @@ if ($action == 'edit' || $action == 'updateedit')
print "</tr>\n";
print '<tr class="oddeven"><td><label for="fiscalmonthstart">'.$langs->trans("FiscalMonthStart").'</label></td><td>';
print $formother->select_month($conf->global->SOCIETE_FISCAL_MONTH_START,'fiscalmonthstart',0,1) . '</td></tr>';
print '<tr class="oddeven"><td><label for="SOCIETE_FISCAL_MONTH_START">'.$langs->trans("FiscalMonthStart").'</label></td><td>';
print $formother->select_month($conf->global->SOCIETE_FISCAL_MONTH_START,'SOCIETE_FISCAL_MONTH_START',0,1) . '</td></tr>';
print "</table>";

View File

@@ -1142,7 +1142,7 @@ if ($id)
}
if ($id == 4) print '<td></td>';
print '<td colspan="3" align="right">';
print '<td colspan="3" align="center">';
if ($action != 'edit')
{
print '<input type="submit" class="button" name="actionadd" value="'.$langs->trans("Add").'">';

View File

@@ -70,13 +70,13 @@ if (! empty($conf->global->MAIN_MOTD_SETUPPAGE))
print $langs->trans("SetupDescription1").' ';
print $langs->trans("AreaForAdminOnly").' ';
print $langs->trans("SetupDescription2", $langs->trans("MenuCompanySetup"), $langs->trans("Modules"))."<br><br>";
print $langs->trans("SetupDescription2", $langs->transnoentities("MenuCompanySetup"), $langs->transnoentities("Modules"))."<br><br>";
print '<br>';
// Show info setup company
if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) $setupcompanynotcomplete=1;
print img_picto('','puce').' '.$langs->trans("SetupDescription3", DOL_URL_ROOT.'/admin/company.php?mainmenu=home'.(empty($setupcompanynotcomplete)?'':'&action=edit'), $langs->trans("Setup"), $langs->trans("MenuCompanySetup"));
print img_picto('','puce').' '.$langs->trans("SetupDescription3", DOL_URL_ROOT.'/admin/company.php?mainmenu=home'.(empty($setupcompanynotcomplete)?'':'&action=edit'), $langs->transnoentities("Setup"), $langs->transnoentities("MenuCompanySetup"));
if (! empty($setupcompanynotcomplete))
{
$langs->load("errors");
@@ -88,7 +88,7 @@ print '<br>';
print '<br>';
// Show info setup module
print img_picto('','puce').' '.$langs->trans("SetupDescription4", DOL_URL_ROOT.'/admin/modules.php?mainmenu=home', $langs->trans("Setup"), $langs->trans("Modules"));
print img_picto('','puce').' '.$langs->trans("SetupDescription4", DOL_URL_ROOT.'/admin/modules.php?mainmenu=home', $langs->transnoentities("Setup"), $langs->transnoentities("Modules"));
if (count($conf->modules) <= (empty($conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING)?1:$conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING)) // If only user module enabled
{
$langs->load("errors");

View File

@@ -1548,17 +1548,30 @@ class Categorie extends CommonObject
dol_mkdir($dir);
}
if (file_exists($dir))
{
$originImage = $dir . $file['name'];
if (file_exists($dir)) {
if (is_array($file['name']) && count($file['name']) > 0) {
for($i = 0; $i <= count($file['name']); $i ++) {
// Cree fichier en taille origine
dol_move_uploaded_file($file['tmp_name'], $originImage, 1, 0, 0);
$originImage = $dir . $file['name'][$i];
if (file_exists($originImage))
{
// Create thumbs
$this->addThumbs($originImage);
// Cree fichier en taille origine
dol_move_uploaded_file($file['tmp_name'][$i], $originImage, 1, 0, 0);
if (file_exists($originImage)) {
// Create thumbs
$this->addThumbs($originImage);
}
}
} else {
$originImage = $dir . $file['name'];
// Cree fichier en taille origine
dol_move_uploaded_file($file['tmp_name'], $originImage, 1, 0, 0);
if (file_exists($originImage)) {
// Create thumbs
$this->addThumbs($originImage);
}
}
}
}

View File

@@ -1376,7 +1376,7 @@ if ($action == 'create')
});
</script>';
}
print ' <a href="'.DOL_URL_ROOT.'/societe/card.php?action=create&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'">'.$langs->trans("AddThirdParty").'</a>';
print ' <a href="'.DOL_URL_ROOT.'/societe/card.php?action=create&client=3&fournisseur=0&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'">'.$langs->trans("AddThirdParty").'</a>';
print '</td>';
}
print '</tr>' . "\n";

View File

@@ -73,6 +73,10 @@ $search_zip=GETPOST('search_zip','alpha');
$search_state=trim(GETPOST("search_state"));
$search_country=GETPOST("search_country",'int');
$search_type_thirdparty=GETPOST("search_type_thirdparty",'int');
$search_day=GETPOST("search_day","int");
$search_month=GETPOST("search_month","int");
$search_year=GETPOST("search_year","int");
$viewstatut=GETPOST('viewstatut','alpha');
$optioncss = GETPOST('optioncss','alpha');
$object_statut=GETPOST('propal_statut','alpha');
@@ -80,9 +84,6 @@ $object_statut=GETPOST('propal_statut','alpha');
$sall=GETPOST('sall', 'alphanohtml');
$mesg=(GETPOST("msg") ? GETPOST("msg") : GETPOST("mesg"));
$search_day=GETPOST("search_day","int");
$search_month=GETPOST("search_month","int");
$search_year=GETPOST("search_year","int");
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha');
@@ -371,9 +372,10 @@ if ($resql)
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
if ($sall) $param.='&sall='.urlencode($sall);
if ($search_month) $param.='&search_month='.urlencode($search_month);
if ($search_year) $param.='&search_year='.urlencode($search_year);
if ($search_ref) $param.='&search_ref='.urlencode($search_ref);
if ($search_day) $param.='&search_day='.urlencode($search_day);
if ($search_month) $param.='&search_month='.urlencode($search_month);
if ($search_year) $param.='&search_year='.urlencode($search_year);
if ($search_ref) $param.='&search_ref='.urlencode($search_ref);
if ($search_refcustomer) $param.='&search_refcustomer='.urlencode($search_refcustomer);
if ($search_societe) $param.='&search_societe='.urlencode($search_societe);
if ($search_user > 0) $param.='&search_user='.urlencode($search_user);
@@ -613,7 +615,7 @@ if ($resql)
// Date
if (! empty($arrayfields['p.date']['checked']))
{
print '<td class="liste_titre" colspan="1" align="center">';
print '<td class="liste_titre" align="center">';
//print $langs->trans('Month').': ';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="search_day" value="'.$search_day.'">';
print '<input class="flat" type="text" size="1" maxlength="2" name="search_month" value="'.$search_month.'">';
@@ -624,7 +626,7 @@ if ($resql)
// Date end
if (! empty($arrayfields['p.fin_validite']['checked']))
{
print '<td class="liste_titre" colspan="1">&nbsp;</td>';
print '<td class="liste_titre">&nbsp;</td>';
}
if (! empty($arrayfields['p.total_ht']['checked']))
{

View File

@@ -1492,7 +1492,7 @@ if ($action == 'create' && $user->rights->commande->creer)
});
</script>';
}
print ' <a href="'.DOL_URL_ROOT.'/societe/card.php?action=create&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'">'.$langs->trans("AddThirdParty").'</a>';
print ' <a href="'.DOL_URL_ROOT.'/societe/card.php?action=create&client=3&fournisseur=0&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'">'.$langs->trans("AddThirdParty").'</a>';
print '</td>';
}
print '</tr>' . "\n";

View File

@@ -2256,7 +2256,7 @@ if ($action == 'create')
});
</script>';
}
print ' <a href="'.DOL_URL_ROOT.'/societe/card.php?action=create&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'">'.$langs->trans("AddThirdParty").'</a>';
print ' <a href="'.DOL_URL_ROOT.'/societe/card.php?action=create&client=3&fournisseur=0&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'">'.$langs->trans("AddThirdParty").'</a>';
print '</td>';
}
print '</tr>' . "\n";
@@ -3207,6 +3207,14 @@ else if ($id > 0 || ! empty($ref))
$facthatreplace->fetch($objectidnext);
print ' (' . $langs->transnoentities("ReplacedByInvoice", $facthatreplace->getNomUrl(1)) . ')';
}
if ($object->type == Facture::TYPE_CREDIT_NOTE || $object->type == Facture::TYPE_DEPOSIT) {
$discount = new DiscountAbsolute($db);
$result = $discount->fetch(0, $object->id);
if ($result > 0){
print '. '.$langs->trans("CreditNoteConvertedIntoDiscount", $object->getLibType(), $discount->getNomUrl(1, 'discount')).'<br>';
}
}
print '</td></tr>';
// Relative and absolute discounts
@@ -4307,16 +4315,15 @@ else if ($id > 0 || ! empty($ref))
$linktoelem = $form->showLinkToObjectBlock($object, null, array('invoice'));
$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
// Link for paypal payment
if (! empty($conf->paypal->enabled) && $object->statut != 0) {
include_once DOL_DOCUMENT_ROOT . '/paypal/lib/paypal.lib.php';
print showPaypalPaymentUrl('invoice', $object->ref);
}
// Link for stripe payment
if (! empty($conf->stripe->enabled) && $object->statut != 0) {
include_once DOL_DOCUMENT_ROOT . '/stripe/lib/stripe.lib.php';
print showStripePaymentUrl('invoice', $object->ref);
// Show online payment link
$useonlinepayment = (! empty($conf->paypal->enabled) || ! empty($conf->stripe->enabled) || ! empty($conf->paybox->enabled));
if ($object->statut != 0 && $useonlinepayment)
{
print '<br>';
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
print showOnlinePaymentUrl('invoice', $object->ref);
}
print '</div><div class="fichehalfright"><div class="ficheaddleft">';

View File

@@ -480,7 +480,7 @@ class FactureRec extends CommonInvoice
* @param int $idwarehouse Id warehouse to use for stock change.
* @return int <0 if KO, >0 if OK
*/
function delete($user, $notrigger=0, $idwarehouse=-1)
function delete(User $user, $notrigger=0, $idwarehouse=-1)
{
$rowid=$this->id;
@@ -1355,45 +1355,50 @@ class FactureRec extends CommonInvoice
*/
class FactureLigneRec extends CommonInvoiceLine
{
public $element='facturedetrec';
public $table_element='facturedet_rec';
/**
* Delete line in database
*
* @return int <0 if KO, >0 if OK
* @param User $user Object user
* @param int $notrigger Disable triggers
* @return int <0 if KO, >0 if OK
*/
function delete()
function delete(User $user, $notrigger = false)
{
global $conf,$langs,$user;
$error=0;
$error=0;
$this->db->begin();
$this->db->begin();
if (! $error) {
if (! $notrigger) {
// Call triggers
$result=$this->call_trigger('LINEBILLREC_DELETE', $user);
if ($result < 0) { $error++; } // Do also here what you must do to rollback action if trigger fail
// End call triggers
}
}
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element." WHERE rowid = ".($this->rowid > 0 ? $this->rowid : $this->id);
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
if ($this->db->query($sql) )
{
// Call trigger
$result=$this->call_trigger('LINEBILLREC_DELETE',$user);
if ($result < 0)
{
$this->db->rollback();
return -1;
}
// End call triggers
if (! $error)
{
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.' WHERE rowid='.$this->id;
$this->db->commit();
return 1;
}
else
{
$this->error=$this->db->error()." sql=".$sql;
$this->db->rollback();
return -1;
}
$res = $this->db->query($sql);
if($res===false) {
$error++;
$this->errors[] = $this->db->lasterror();
}
}
// Commit or rollback
if ($error) {
$this->db->rollback();
return -1;
} else {
$this->db->commit();
return 1;
}
}

View File

@@ -439,7 +439,6 @@ class Facture extends CommonInvoice
$sql.= ", ".(double) $this->multicurrency_tx;
$sql.=")";
dol_syslog(get_class($this)."::create", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
@@ -449,7 +448,6 @@ class Facture extends CommonInvoice
$this->ref='(PROV'.$this->id.')';
$sql = 'UPDATE '.MAIN_DB_PREFIX."facture SET facnumber='".$this->db->escape($this->ref)."' WHERE rowid=".$this->id;
dol_syslog(get_class($this)."::create", LOG_DEBUG);
$resql=$this->db->query($sql);
if (! $resql) $error++;

View File

@@ -300,7 +300,7 @@ if (empty($reshook))
// Delete
if ($action == 'confirm_deleteinvoice' && $confirm == 'yes' && $user->rights->facture->supprimer)
{
$object->delete();
$object->delete($user);
header("Location: " . $_SERVER['PHP_SELF'] );
exit;
}

View File

@@ -36,7 +36,7 @@ $var=true;
foreach($linkedObjectBlock as $key => $objectlink)
{
$ilink++;
$trclass=($var?'pair':'impair');
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
?>
@@ -44,13 +44,17 @@ foreach($linkedObjectBlock as $key => $objectlink)
<td><?php echo $langs->trans("RepeatableInvoice"); ?></td>
<td><?php echo $objectlink->getNomUrl(1); ?></td>
<td align="center"></td>
<td align="center"><?php echo dol_print_date($objectlink->date,'day'); ?></td>
<td align="center"><?php echo dol_print_date($objectlink->date_when,'day'); ?></td>
<td align="right"><?php
if ($user->rights->facture->lire) {
$total = $total + $objectlink->total_ht;
echo price($objectlink->total_ht);
} ?></td>
<td align="right"></td>
<td align="right">
<?php
print $objectlink->getLibStatut(3);
?>
</td>
<td align="right"><a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key; ?>"><?php echo img_delete($langs->transnoentitiesnoconv("RemoveLink")); ?></a></td>
</tr>
<?php

View File

@@ -44,7 +44,7 @@ $date_startyear=GETPOST('date_startyear','int');
$date_endmonth=GETPOST('date_endmonth','int');
$date_endday=GETPOST('date_endday','int');
$date_endyear=GETPOST('date_endyear','int');
$showaccountdetail = GETPOST('showaccountdetail','aZ09');
$showaccountdetail = GETPOST('showaccountdetail','aZ09')?GETPOST('showaccountdetail','aZ09'):'no';
// Security check
$socid = GETPOST('socid','int');
@@ -156,7 +156,7 @@ $total_ttc=0;
// Affiche en-tete de rapport
if ($modecompta=="CREANCES-DETTES")
{
$name=$langs->trans("AnnualByCompanies");
$name = $langs->trans("ReportInOut").', '.$langs->trans("ByPredefinedAccountGroups");
$calcmode=$langs->trans("CalcModeDebt");
$calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?date_startyear='.$tmps['year'].'&date_startmonth='.$tmps['mon'].'&date_startday='.$tmps['mday'].'&date_endyear='.$tmpe['year'].'&date_endmonth='.$tmpe['mon'].'&date_endday='.$tmpe['mday'].'&modecompta=RECETTES-DEPENSES">','</a>').')';
$calcmode.='<br>('.$langs->trans("SeeReportInBookkeepingMode",'<a href="'.$_SERVER["PHP_SELF"].'?date_startyear='.$tmps['year'].'&date_startmonth='.$tmps['mon'].'&date_startday='.$tmps['mday'].'&date_endyear='.$tmpe['year'].'&date_endmonth='.$tmpe['mon'].'&date_endday='.$tmpe['mday'].'&modecompta=BOOKKEEPING">','</a>').')';
@@ -170,7 +170,7 @@ if ($modecompta=="CREANCES-DETTES")
}
elseif ($modecompta=="RECETTES-DEPENSES")
{
$name=$langs->trans("AnnualByCompanies");
$name = $langs->trans("ReportInOut").', '.$langs->trans("ByPredefinedAccountGroups");
$calcmode=$langs->trans("CalcModeEngagement");
$calcmode.='<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?date_startyear='.$tmps['year'].'&date_startmonth='.$tmps['mon'].'&date_startday='.$tmps['mday'].'&date_endyear='.$tmpe['year'].'&date_endmonth='.$tmpe['mon'].'&date_endday='.$tmpe['mday'].'&modecompta=CREANCES-DETTES">','</a>').')';
$calcmode.='<br>('.$langs->trans("SeeReportInBookkeepingMode",'<a href="'.$_SERVER["PHP_SELF"].'?date_startyear='.$tmps['year'].'&date_startmonth='.$tmps['mon'].'&date_startday='.$tmps['mday'].'&date_endyear='.$tmpe['year'].'&date_endmonth='.$tmpe['mon'].'&date_endday='.$tmpe['mday'].'&modecompta=BOOKKEEPING">','</a>').')';
@@ -183,13 +183,14 @@ elseif ($modecompta=="RECETTES-DEPENSES")
}
elseif ($modecompta=="BOOKKEEPING")
{
$name=$langs->trans("AnnualByCompanies");
$name = $langs->trans("ReportInOut").', '.$langs->trans("ByPredefinedAccountGroups");
$calcmode=$langs->trans("CalcModeBookkeeping");
$calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?date_startyear='.$tmps['year'].'&date_startmonth='.$tmps['mon'].'&date_startday='.$tmps['mday'].'&date_endyear='.$tmpe['year'].'&date_endmonth='.$tmpe['mon'].'&date_endday='.$tmpe['mday'].'&modecompta=RECETTES-DEPENSES">','</a>').')';
$calcmode.='<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?date_startyear='.$tmps['year'].'&date_startmonth='.$tmps['mon'].'&date_startday='.$tmps['mday'].'&date_endyear='.$tmpe['year'].'&date_endmonth='.$tmpe['mon'].'&date_endday='.$tmpe['mday'].'&modecompta=CREANCES-DETTES">','</a>').')';
//$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',1,1,0,'',1,0,1);
$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
$period.=' &nbsp; &nbsp; '.$langs->trans("DetailByAccount").' '. $form->selectyesno('showaccountdetail',$showaccountdetail,0);
$arraylist=array('no'=>$langs->trans("No"), 'yes'=>$langs->trans("AccountWithNonZeroValues"), 'all'=>$langs->trans("All"));
$period.=' &nbsp; &nbsp; '.$langs->trans("DetailByAccount").' '. $form->selectarray('showaccountdetail', $arraylist, $showaccountdetail, 0);
$periodlink=($year_start?"<a href='".$_SERVER["PHP_SELF"]."?year=".($tmps['year']-1)."&modecompta=".$modecompta."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($tmps['year']+1)."&modecompta=".$modecompta."'>".img_next()."</a>":"");
$description=$langs->trans("RulesResultBookkeepingPredefined");
$description.=' ('.$langs->trans("SeePageForSetup", DOL_URL_ROOT.'/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin', $langs->transnoentitiesnoconv("Accountancy").' / '.$langs->transnoentitiesnoconv("Setup").' / '.$langs->trans("Chartofaccounts")).')';
@@ -291,7 +292,7 @@ if ($modecompta == 'BOOKKEEPING')
// Loop on detail of all accounts
// This make 14 calls for each detail of account (NP, N and month m)
if ($showaccountdetail == 'yes')
if ($showaccountdetail != 'no')
{
$tmppredefinedgroupwhere="pcg_type = '".$db->escape($objp->pcg_type)."' AND pcg_subtype = '".$db->escape($objp->pcg_subtype)."'";
$tmppredefinedgroupwhere.= " AND fk_pcg_version = '".$charofaccountstring."'";
@@ -310,7 +311,8 @@ if ($modecompta == 'BOOKKEEPING')
$resultN=$AccCat->sdc;
}
if ($resultN > 0)
if ($showaccountdetail == 'all' || $resultN > 0)
{
print '<tr>';
print '<td></td>';

View File

@@ -118,7 +118,7 @@ $exportlink='';
// Affiche en-tete du rapport
if ($modecompta == 'CREANCES-DETTES')
{
$name=$langs->trans("AnnualSummaryDueDebtMode");
$name = $langs->trans("ReportInOut").', '.$langs->trans("ByYear");
$calcmode=$langs->trans("CalcModeDebt");
$calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=RECETTES-DEPENSES">','</a>').')';
$calcmode.='<br>('.$langs->trans("SeeReportInBookkeepingMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=BOOKKEEPING">','</a>').')';
@@ -132,7 +132,7 @@ if ($modecompta == 'CREANCES-DETTES')
//$exportlink=$langs->trans("NotYetAvailable");
}
else if ($modecompta=="RECETTES-DEPENSES") {
$name=$langs->trans("AnnualSummaryInputOutputMode");
$name = $langs->trans("ReportInOut").', '.$langs->trans("ByYear");
$calcmode=$langs->trans("CalcModeEngagement");
$calcmode.='<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=CREANCES-DETTES">','</a>').')';
$calcmode.='<br>('.$langs->trans("SeeReportInBookkeepingMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=BOOKKEEPING">','</a>').')';
@@ -145,7 +145,7 @@ else if ($modecompta=="RECETTES-DEPENSES") {
}
else if ($modecompta=="BOOKKEEPING")
{
$name=$langs->trans("AnnualSummaryDueDebtMode");
$name = $langs->trans("ReportInOut").', '.$langs->trans("ByYear");
$calcmode=$langs->trans("CalcModeBookkeeping");
$calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=RECETTES-DEPENSES">','</a>').')';
$calcmode.='<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=CREANCES-DETTES">','</a>').')';
@@ -636,12 +636,12 @@ if (! empty($conf->salaries->enabled) && ($modecompta == 'CREANCES-DETTES' || $m
$subtotal_ht = 0;
$subtotal_ttc = 0;
$sql = "SELECT p.label as nom, date_format($column,'%Y-%m') as dm, sum(p.amount) as amount";
$sql = "SELECT p.label as nom, date_format(".$column.",'%Y-%m') as dm, sum(p.amount) as amount";
$sql .= " FROM " . MAIN_DB_PREFIX . "payment_salary as p";
$sql .= " WHERE p.entity = " . $conf->entity;
$sql .= " GROUP BY p.label, dm";
if (! empty($date_start) && ! empty($date_end))
$sql.= " AND ".$column." >= '".$db->idate($date_start)."' AND ".$column." <= '".$db->idate($date_end)."'";
$sql .= " GROUP BY p.label, dm";
dol_syslog("get social salaries payments");
$result = $db->query($sql);

View File

@@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2016-2017 Jamal Elbaz <jamelbaz@gmail.com>
* Copyright (C) 2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2018 Laurent Destailleur <eldy@destailleur.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
@@ -40,7 +41,7 @@ $selectcpt = GETPOST('cpt_bk');
$id = GETPOST('id', 'int');
$rowid = GETPOST('rowid', 'int');
$cancel = GETPOST('cancel','alpha');
$showaccountdetail = GETPOST('showaccountdetail','aZ09');
$showaccountdetail = GETPOST('showaccountdetail','aZ09')?GETPOST('showaccountdetail','aZ09'):'no';
$date_startmonth=GETPOST('date_startmonth','int');
@@ -56,12 +57,12 @@ $nbofyear=1;
$year=GETPOST('year','int');
if (empty($year))
{
$year_current = strftime("%Y",dol_now());
$month_current = strftime("%m",dol_now());
$year_current = strftime("%Y", dol_now());
$month_current = strftime("%m", dol_now());
$year_start = $year_current - ($nbofyear - 1);
} else {
$year_current = $year;
$month_current = strftime("%m",dol_now());
$month_current = strftime("%m", dol_now());
$year_start = $year - ($nbofyear - 1);
}
$date_start=dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear);
@@ -76,6 +77,7 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end
// We define date_start and date_end
$year_end=$year_start + ($nbofyear - 1);
$month_start=GETPOST("month")?GETPOST("month"):($conf->global->SOCIETE_FISCAL_MONTH_START?($conf->global->SOCIETE_FISCAL_MONTH_START):1);
$date_startmonth = $month_start;
if (! GETPOST('month'))
{
if (! GETPOST("year") && $month_start > $month_current)
@@ -195,7 +197,8 @@ else if ($modecompta=="BOOKKEEPING")
//$calcmode.='<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=CREANCES-DETTES">','</a>').')';
//$calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=RECETTES-DEPENSES">','</a>').')';
$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
$period.=' &nbsp; &nbsp; '.$langs->trans("DetailByAccount").' '. $form->selectyesno('showaccountdetail',$showaccountdetail,0);
$arraylist=array('no'=>$langs->trans("No"), 'yes'=>$langs->trans("AccountWithNonZeroValues"), 'all'=>$langs->trans("All"));
$period.=' &nbsp; &nbsp; '.$langs->trans("DetailByAccount").' '. $form->selectarray('showaccountdetail', $arraylist, $showaccountdetail, 0);
$periodlink = $textprevyear . " " . $langs->trans("Year") . " " . $start_year . " " . $textnextyear ;
$exportlink = '';
$description=$langs->trans("RulesResultBookkeepingPersonalized").
@@ -225,7 +228,16 @@ print '<th class="liste_titre"></th>';
print '<th class="liste_titre" align="right">'.$langs->trans("PreviousPeriod").'</th>';
print '<th class="liste_titre" align="right">'.$langs->trans("SelectedPeriod").'</th>';
foreach($months as $k => $v){
print '<th class="liste_titre width50" align="right" >'.$langs->trans($v).'</th>';
if (($k+1) >= $date_startmonth)
{
print '<th class="liste_titre width50" align="right" >'.$langs->trans($v).'</th>';
}
}
foreach($months as $k => $v){
if (($k+1) < $date_startmonth)
{
print '<th class="liste_titre width50" align="right" >'.$langs->trans($v).'</th>';
}
}
print '</tr>';
@@ -306,16 +318,35 @@ else if ($modecompta=="BOOKKEEPING")
// Detail by month
foreach($months as $k => $v)
{
foreach($sommes as $code => $det){
$vars[$code] = $det['M'][$k];
if (($k+1) >= $date_startmonth)
{
foreach($sommes as $code => $det){
$vars[$code] = $det['M'][$k];
}
$result = strtr($formula, $vars);
//$r = $AccCat->calculate($result);
$r = dol_eval($result, 1);
print '<td class="liste_total right">' . price($r) . '</td>';
$sommes[$code]['M'][$k] += $r;
}
$result = strtr($formula, $vars);
}
foreach($months as $k => $v)
{
if (($k+1) < $date_startmonth)
{
foreach($sommes as $code => $det){
$vars[$code] = $det['M'][$k];
}
$result = strtr($formula, $vars);
//$r = $AccCat->calculate($result);
$r = dol_eval($result, 1);
//$r = $AccCat->calculate($result);
$r = dol_eval($result, 1);
print '<td class="liste_total right">' . price($r) . '</td>';
$sommes[$code]['M'][$k] += $r;
print '<td class="liste_total right">' . price($r) . '</td>';
$sommes[$code]['M'][$k] += $r;
}
}
@@ -418,38 +449,57 @@ else if ($modecompta=="BOOKKEEPING")
print '<td align="right">' . price($totCat['NP']) . '</td>';
print '<td align="right">' . price($totCat['N']) . '</td>';
// Each month
foreach($totCat['M'] as $k => $v){
print '<td align="right">' . price($v) . '</td>';
if (($k+1) >= $date_startmonth) print '<td align="right">' . price($v) . '</td>';
}
foreach($totCat['M'] as $k => $v){
if (($k+1) < $date_startmonth) print '<td align="right">' . price($v) . '</td>';
}
print "</tr>\n";
// Loop on detail of all accounts
// This make 14 calls for each detail of account (NP, N and month m)
if ($showaccountdetail == 'yes')
if ($showaccountdetail != 'no')
{
foreach($cpts as $i => $cpt)
{
$resultNP=$totPerAccount[$cpt['account_number']]['NP'];
$resultN=$totPerAccount[$cpt['account_number']]['N'];
print '<tr>';
print '<td></td>';
print '<td class="tdoverflowmax200">';
print ' &nbsp; &nbsp; ' . length_accountg($cpt['account_number']);
print ' - ';
print $cpt['account_label'];
print '</td>';
print '<td align="right">' . price($resultNP) . '</td>';
print '<td align="right">' . price($resultN) . '</td>';
// Make one call for each month
foreach($months as $k => $v)
if ($showaccountdetail == 'all' || $resultN > 0)
{
$resultM=$totPerAccount[$cpt['account_number']]['M'][$k];
print '<td align="right">' . price($resultM) . '</td>';
}
print '<tr>';
print '<td></td>';
print '<td class="tdoverflowmax200">';
print ' &nbsp; &nbsp; ' . length_accountg($cpt['account_number']);
print ' - ';
print $cpt['account_label'];
print '</td>';
print '<td align="right">' . price($resultNP) . '</td>';
print '<td align="right">' . price($resultN) . '</td>';
print "</tr>\n";
// Make one call for each month
foreach($months as $k => $v)
{
if (($k+1) >= $date_startmonth)
{
$resultM=$totPerAccount[$cpt['account_number']]['M'][$k];
print '<td align="right">' . price($resultM) . '</td>';
}
}
foreach($months as $k => $v)
{
if (($k+1) < $date_startmonth)
{
$resultM=$totPerAccount[$cpt['account_number']]['M'][$k];
print '<td align="right">' . price($resultM) . '</td>';
}
}
print "</tr>\n";
}
}
}
}

View File

@@ -665,7 +665,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
}
}
// Hook fields
$parameters=array('arrayfields'=>$arrayfields);
$parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder);
$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (! empty($arrayfields['p.datec']['checked'])) print_liste_field_titre($arrayfields['p.datec']['label'],$_SERVER["PHP_SELF"],"p.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);

View File

@@ -83,11 +83,12 @@ class Conf
$this->file = new stdClass();
$this->db = new stdClass();
$this->global = new stdClass();
$this->mycompany = new stdClass();
$this->admin = new stdClass();
$this->mycompany = new stdClass();
$this->admin = new stdClass();
$this->user = new stdClass();
$this->syslog = new stdClass();
$this->browser = new stdClass();
$this->medias = new stdClass();
$this->multicompany = new stdClass();
//! Charset for HTML output and for storing data in memory
@@ -96,7 +97,7 @@ class Conf
// First level object
// TODO Remove this part.
$this->expedition_bon = new stdClass();
$this->livraison_bon = new stdClass();
$this->livraison_bon = new stdClass();
$this->fournisseur = new stdClass();
$this->product = new stdClass();
$this->service = new stdClass();
@@ -106,12 +107,12 @@ class Conf
$this->propal = new stdClass();
$this->facture = new stdClass();
$this->contrat = new stdClass();
$this->usergroup = new stdClass();
$this->usergroup = new stdClass();
$this->adherent = new stdClass();
$this->bank = new stdClass();
$this->notification = new stdClass();
$this->mailing = new stdClass();
$this->expensereport = new stdClass();
$this->expensereport = new stdClass();
}
@@ -322,6 +323,10 @@ class Conf
$this->propal->dir_output=$rootfordata."/propale";
$this->propal->dir_temp=$rootfordata."/propale/temp";
// For medias storage
$this->medias->multidir_output = array($this->entity => $rootfordata."/medias");
$this->medias->multidir_temp = array($this->entity => $rootfordata."/medias/temp");
// Exception: Some dir are not the name of module. So we keep exception here for backward compatibility.
// Sous module bons d'expedition

View File

@@ -64,7 +64,7 @@ class DiscountAbsolute
* @param int $fk_facture_source fk_facture_source
* @return int <0 if KO, =0 if not found, >0 if OK
*/
function fetch($rowid,$fk_facture_source=0)
function fetch($rowid, $fk_facture_source=0)
{
global $conf;
@@ -386,7 +386,7 @@ class DiscountAbsolute
function getSumDepositsUsed($invoice, $multicurrency=0)
{
dol_syslog(get_class($this)."::getSumDepositsUsed", LOG_DEBUG);
if ($invoice->element == 'facture' || $invoice->element == 'invoice')
{
$sql = 'SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount';
@@ -407,7 +407,7 @@ class DiscountAbsolute
dol_print_error($this->error);
return -1;
}
$resql=$this->db->query($sql);
if ($resql)
{
@@ -432,7 +432,7 @@ class DiscountAbsolute
function getSumCreditNotesUsed($invoice, $multicurrency=0)
{
dol_syslog(get_class($this)."::getSumCreditNotesUsed", LOG_DEBUG);
if ($invoice->element == 'facture' || $invoice->element == 'invoice')
{
$sql = 'SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount';
@@ -453,7 +453,7 @@ class DiscountAbsolute
dol_print_error($this->error);
return -1;
}
$resql=$this->db->query($sql);
if ($resql)
{

View File

@@ -185,6 +185,9 @@ class DoliDBMysqli extends DoliDB
{
dol_syslog(get_class($this) . "::connect host=$host, port=$port, login=$login, passwd=--hidden--, name=$name", LOG_DEBUG);
// Can also be
// mysqli::init(); mysql::options(MYSQLI_INIT_COMMAND, 'SET AUTOCOMMIT = 0'); mysqli::options(MYSQLI_OPT_CONNECT_TIMEOUT, 5);
// return mysqli::real_connect($host, $user, $pass, $db, $port);
return new mysqli($host, $login, $passwd, $name, $port);
}

View File

@@ -1251,7 +1251,7 @@ function form_constantes($tableau, $strictw3c=0, $helptext='')
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Description").'</td>';
print '<td class="titlefield">'.$langs->trans("Description").'</td>';
print '<td>';
$text = $langs->trans("Value");
print $form->textwithpicto($text, $helptext, 1, 'help', '', 0, 2, 'idhelptext');

View File

@@ -1964,7 +1964,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
if ($modulepart == 'medias' && !empty($dolibarr_main_data_root))
{
$accessallowed=1;
$original_file=$dolibarr_main_data_root.'/medias/'.$original_file;
$original_file=$conf->medias->multidir_output[$entity].'/'.$original_file;
}
// Wrapping for *.log files, like when used with url http://.../document.php?modulepart=logs&file=dolibarr.log
elseif ($modulepart == 'logs' && !empty($dolibarr_main_data_root))

View File

@@ -3593,8 +3593,8 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so
// Right
print '<td class="nobordernopadding valignmiddle" align="right">';
if ($sortfield) $options .= "&amp;sortfield=".$sortfield;
if ($sortorder) $options .= "&amp;sortorder=".$sortorder;
if ($sortfield) $options .= "&sortfield=".$sortfield;
if ($sortorder) $options .= "&sortorder=".$sortorder;
// Show navigation bar
$pagelist = '';
if ($savlimit != 0 && ($page > 0 || $num > $limit))

View File

@@ -100,7 +100,7 @@ function member_prepare_head(Adherent $object)
$head[$h][2] = 'agenda';
$h++;
}
complete_head_from_modules($conf,$langs,$object,$head,$h,'member','remove');
return $head;
@@ -152,6 +152,11 @@ function member_admin_prepare_head()
$head[$h][2] = 'general';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/adherents/admin/adherent_emails.php';
$head[$h][1] = $langs->trans("EMails");
$head[$h][2] = 'emails';
$h++;
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
@@ -168,9 +173,9 @@ function member_admin_prepare_head()
$head[$h][2] = 'attributes_type';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/adherents/admin/public.php';
$head[$h][0] = DOL_URL_ROOT.'/adherents/admin/website.php';
$head[$h][1] = $langs->trans("BlankSubscriptionForm");
$head[$h][2] = 'public';
$head[$h][2] = 'website';
$h++;
complete_head_from_modules($conf,$langs,'',$head,$h,'member_admin','remove');

View File

@@ -88,6 +88,134 @@ function payment_supplier_prepare_head(Paiement $object) {
}
/**
* Return string with full Url
*
* @param string $type Type of URL ('free', 'order', 'invoice', 'contractline', 'membersubscription' ...)
* @param string $ref Ref of object
* @return string Url string
*/
function showOnlinePaymentUrl($type,$ref)
{
global $conf, $langs;
$langs->load("PAYMENT");
$langs->load("paybox");
$servicename='Online';
$out.=img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePayment",$servicename).'<br>';
$url=getOnlinePaymentUrl(0,$type,$ref);
$out.='<input type="text" id="onlinepaymenturl" class="quatrevingtpercent" value="'.$url.'">';
$out.=ajax_autoselect("onlinepaymenturl", 0);
return $out;
}
/**
* Return string with full Url
*
* @param int $mode 0=True url, 1=Url formated with colors
* @param string $type Type of URL ('free', 'order', 'invoice', 'contractline', 'membersubscription' ...)
* @param string $ref Ref of object
* @param int $amount Amount
* @param string $freetag Free tag
* @return string Url string
*/
function getOnlinePaymentUrl($mode,$type,$ref='',$amount='9.99',$freetag='your_free_tag')
{
global $conf;
$ref=str_replace(' ','',$ref);
if ($type == 'free')
{
$out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?amount='.($mode?'<font color="#666666">':'').$amount.($mode?'</font>':'').'&tag='.($mode?'<font color="#666666">':'').$freetag.($mode?'</font>':'');
if (! empty($conf->global->PAYMENT_SECURITY_TOKEN))
{
if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out.='&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN;
else $out.='&securekey='.dol_hash($conf->global->PAYMENT_SECURITY_TOKEN, 2);
}
}
if ($type == 'order')
{
$out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=order&ref='.($mode?'<font color="#666666">':'');
if ($mode == 1) $out.='order_ref';
if ($mode == 0) $out.=urlencode($ref);
$out.=($mode?'</font>':'');
if (! empty($conf->global->PAYMENT_SECURITY_TOKEN))
{
if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out.='&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN;
else
{
$out.='&securekey='.($mode?'<font color="#666666">':'');
if ($mode == 1) $out.="hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + order_ref)";
if ($mode == 0) $out.= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $type . $ref, 2);
$out.=($mode?'</font>':'');
}
}
}
if ($type == 'invoice')
{
$out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=invoice&ref='.($mode?'<font color="#666666">':'');
if ($mode == 1) $out.='invoice_ref';
if ($mode == 0) $out.=urlencode($ref);
$out.=($mode?'</font>':'');
if (! empty($conf->global->PAYMENT_SECURITY_TOKEN))
{
if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out.='&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN;
else
{
$out.='&securekey='.($mode?'<font color="#666666">':'');
if ($mode == 1) $out.="hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + invoice_ref)";
if ($mode == 0) $out.= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $type . $ref, 2);
$out.=($mode?'</font>':'');
}
}
}
if ($type == 'contractline')
{
$out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=contractline&ref='.($mode?'<font color="#666666">':'');
if ($mode == 1) $out.='contractline_ref';
if ($mode == 0) $out.=urlencode($ref);
$out.=($mode?'</font>':'');
if (! empty($conf->global->PAYMENT_SECURITY_TOKEN))
{
if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out.='&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN;
else
{
$out.='&securekey='.($mode?'<font color="#666666">':'');
if ($mode == 1) $out.="hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + contractline_ref)";
if ($mode == 0) $out.= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $type . $ref, 2);
$out.=($mode?'</font>':'');
}
}
}
if ($type == 'membersubscription')
{
$out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=membersubscription&ref='.($mode?'<font color="#666666">':'');
if ($mode == 1) $out.='member_ref';
if ($mode == 0) $out.=urlencode($ref);
$out.=($mode?'</font>':'');
if (! empty($conf->global->PAYMENT_SECURITY_TOKEN))
{
if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out.='&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN;
else
{
$out.='&securekey='.($mode?'<font color="#666666">':'');
if ($mode == 1) $out.="hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + member_ref)";
if ($mode == 0) $out.= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $type . $ref, 2);
$out.=($mode?'</font>':'');
}
}
}
// For multicompany
$out.="&entity=".$conf->entity; // Check the entity because He may be the same reference in several entities
return $out;
}
/**
* Show footer of company in HTML pages

View File

@@ -250,7 +250,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2435__+MAX_llx_menu__, 'accountancy', 'balance', 2400__+MAX_llx_menu__, '/accountancy/bookkeeping/balance.php?mainmenu=accountancy&leftmenu=accountancy_balance', 'AccountBalance', 1, 'accountancy', '$user->rights->accounting->mouvements->lire', '', 0, 16, __ENTITY__);
-- Reports
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2440__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2400__+MAX_llx_menu__, '/compta/resultat/index.php?mainmenu=accountancy&leftmenu=accountancy_report', 'Reportings', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 17, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2441__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2440__+MAX_llx_menu__, '/compta/resultat/index.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ReportInOut', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 18, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2441__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2440__+MAX_llx_menu__, '/compta/resultat/index.php?mainmenu=accountancy&leftmenu=accountancy_report', 'MenuReportInOut', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 18, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2443__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2441__+MAX_llx_menu__, '/compta/resultat/clientfourn.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByPredefinedAccountGroups', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 19, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2442__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2441__+MAX_llx_menu__, '/compta/resultat/result.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByPersonalizedAccountGroups', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 20, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2444__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2440__+MAX_llx_menu__, '/compta/stats/index.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ReportTurnover', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 21, __ENTITY__);
@@ -259,7 +259,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2447__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2444__+MAX_llx_menu__, '/compta/stats/cabyprodserv.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByProductsAndServices', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 24, __ENTITY__);
-- Accounting simple
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled', __HANDLER__, 'left', 2700__+MAX_llx_menu__, 'accountancy', 'ca', 9__+MAX_llx_menu__, '/compta/resultat/index.php?leftmenu=ca&amp;mainmenu=accountancy', 'Reportings', 0, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 11, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2711__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/resultat/index.php?leftmenu=ca', 'ReportInOut', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2711__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/resultat/index.php?leftmenu=ca', 'MenuReportInOut', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2712__+MAX_llx_menu__, 'accountancy', '', 2701__+MAX_llx_menu__, '/compta/resultat/clientfourn.php?leftmenu=ca', 'ByCompanies', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2713__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/stats/index.php?leftmenu=ca', 'ReportTurnover', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2714__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/casoc.php?leftmenu=ca', 'ByCompanies', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 0, __ENTITY__);

View File

@@ -1122,7 +1122,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
$newmenu->add("/compta/resultat/index.php?mainmenu=accountancy&amp;leftmenu=accountancy_report",$langs->trans("Reportings"),1,$user->rights->accounting->comptarapport->lire, '', $mainmenu, 'ca');
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/resultat/index.php?leftmenu=accountancy_report",$langs->trans("ReportInOut"),2,$user->rights->accounting->comptarapport->lire);
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/resultat/index.php?leftmenu=accountancy_report",$langs->trans("MenuReportInOut"),2,$user->rights->accounting->comptarapport->lire);
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/resultat/clientfourn.php?leftmenu=accountancy_report",$langs->trans("ByPredefinedAccountGroups"),3,$user->rights->accounting->comptarapport->lire);
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/resultat/result.php?leftmenu=accountancy_report",$langs->trans("ByPersonalizedAccountGroups"),3,$user->rights->accounting->comptarapport->lire);
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report",$langs->trans("ReportTurnover"),2,$user->rights->accounting->comptarapport->lire);
@@ -1139,7 +1139,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
// Bilan, resultats
$newmenu->add("/compta/resultat/index.php?leftmenu=report&amp;mainmenu=accountancy",$langs->trans("Reportings"),0,$user->rights->compta->resultat->lire, '', $mainmenu, 'ca');
if ($usemenuhider || empty($leftmenu) || preg_match('/report/',$leftmenu)) $newmenu->add("/compta/resultat/index.php?leftmenu=report",$langs->trans("ReportInOut"),1,$user->rights->compta->resultat->lire);
if ($usemenuhider || empty($leftmenu) || preg_match('/report/',$leftmenu)) $newmenu->add("/compta/resultat/index.php?leftmenu=report",$langs->trans("MenuReportInOut"),1,$user->rights->compta->resultat->lire);
if ($usemenuhider || empty($leftmenu) || preg_match('/report/',$leftmenu)) $newmenu->add("/compta/resultat/clientfourn.php?leftmenu=report",$langs->trans("ByCompanies"),2,$user->rights->compta->resultat->lire);
/* On verra ca avec module compabilite expert
if ($usemenuhider || empty($leftmenu) || preg_match('/report/',$leftmenu)) $newmenu->add("/compta/resultat/compteres.php?leftmenu=report","Compte de resultat",2,$user->rights->compta->resultat->lire);

View File

@@ -49,7 +49,7 @@ class mod_syslog_syslog extends LogHandler implements LogHandlerInterface
public function isActive()
{
global $conf;
// This function does not exists on some ISP (Ex: Free in France)
if (!function_exists('openlog')) return 0;
@@ -81,15 +81,15 @@ class mod_syslog_syslog extends LogHandler implements LogHandlerInterface
*/
public function checkConfiguration()
{
global $langs;
global $conf, $langs;
$errors = array();
$facility = SYSLOG_FACILITY;
$facility = constant($conf->global->SYSLOG_FACILITY);
if ($facility)
{
// Only LOG_USER supported on Windows
if (! empty($_SERVER["WINDIR"])) $facility='LOG_USER';
if (! empty($_SERVER["WINDIR"])) $facility=constant('LOG_USER');
dol_syslog("admin/syslog: facility ".$facility);
}

View File

@@ -313,7 +313,7 @@ class doc_generic_user_odt extends ModelePDFUser
{
$socobject=$object->client;
}
// Open and load template
require_once ODTPHP_PATH.'odf.php';
try {
@@ -332,7 +332,7 @@ class doc_generic_user_odt extends ModelePDFUser
$this->error=$e->getMessage();
return -1;
}
// Make substitutions into odt
$array_user=$this->get_substitutionarray_user($object,$outputlangs);
$array_soc=$this->get_substitutionarray_mysoc($mysoc,$outputlangs);
@@ -366,7 +366,7 @@ class doc_generic_user_odt extends ModelePDFUser
{
}
}
// Replace labels translated
$tmparray=$outputlangs->get_translations_for_substitutions();
foreach($tmparray as $key=>$value)
@@ -422,12 +422,13 @@ class doc_generic_user_odt extends ModelePDFUser
return -1;
}
function get_substitutionarray_object($object,$outputlangs) {
function get_substitutionarray_object($object,$outputlangs,$array_key='object') {
$array_other=array();
foreach($object as $key => $value) {
if(!is_array($value) && !is_object($value)) {
$array_other['object_'.$key] = $value;
if (!is_array($value) && !is_object($value)) {
$array_other[$array_key.'_'.$key] = $value;
}
}
}
return $array_other;
}

View File

@@ -35,13 +35,13 @@ elseif ($module == 'project') { $permission=$user->rights->projet->creer; }
elseif ($module == 'action') { $permission=$user->rights->agenda->myactions->create; }
elseif ($module == 'shipping') { $permission=$user->rights->expedition->creer; }
elseif ($module == 'project_task') { $permission=$user->rights->projet->creer; }
elseif (! isset($permission) && isset($user->rights->$module->creer))
{
$permission=$user->rights->$module->creer;
elseif (! isset($permission) && isset($user->rights->$module->creer))
{
$permission=$user->rights->$module->creer;
}
elseif (! isset($permission) && isset($user->rights->$module->write))
{
$permission=$user->rights->$module->write;
$permission=$user->rights->$module->write;
}
$formcompany= new FormCompany($db);
@@ -55,8 +55,8 @@ $userstatic=new User($db);
<div class="div-table-responsive">
<div class="tagtable centpercent noborder allwidth">
<?php
if ($permission) {
<?php
if ($permission) {
?>
<form class="tagtr liste_titre">
<div class="tagtd liste_titre"><?php echo $langs->trans("Nature"); ?></div>
@@ -72,7 +72,7 @@ if ($permission) {
$var=true;
if (empty($hideaddcontactforuser))
{
?>
<form class="tagtr impair" action="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id; ?>" method="POST">
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>" />
@@ -87,10 +87,10 @@ if ($permission) {
<?php
$tmpobject=$object;
if ($object->element == 'shipping' && is_object($objectsrc)) $tmpobject=$objectsrc;
echo $formcompany->selectTypeContact($tmpobject, '', 'type','internal');
echo $formcompany->selectTypeContact($tmpobject, '', 'type','internal');
?></div>
<div class="tagtd">&nbsp;</div>
<div class="tagtd right"><input type="submit" class="button" value="<?php echo $langs->trans("Add"); ?>"></div>
<div class="tagtd center"><input type="submit" class="button" value="<?php echo $langs->trans("Add"); ?>"></div>
</form>
<?php
@@ -98,7 +98,7 @@ if ($permission) {
if (empty($hideaddcontactforthirdparty))
{
?>
<form class="tagtr pair" action="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id; ?>" method="POST">
@@ -110,9 +110,9 @@ if ($permission) {
<div class="tagtd nowrap noborderbottom"><?php echo img_object('','contact').' '.$langs->trans("ThirdPartyContacts"); ?></div>
<div class="tagtd nowrap maxwidthonsmartphone noborderbottom">
<?php $selectedCompany = isset($_GET["newcompany"])?$_GET["newcompany"]:$object->socid; ?>
<?php
// add company icon before select list
if ($selectedCompany)
<?php
// add company icon before select list
if ($selectedCompany)
{
echo img_object('', 'company', 'class="hideonsmartphone"');
}
@@ -129,14 +129,14 @@ if ($permission) {
$formcompany->selectTypeContact($tmpobject, '', 'type','external'); ?>
</div>
<div class="tagtd noborderbottom">&nbsp;</div>
<div class="tagtd right noborderbottom">
<div class="tagtd center noborderbottom">
<input type="submit" id="add-customer-contact" class="button" value="<?php echo $langs->trans("Add"); ?>"<?php if (! $nbofcontacts) echo ' disabled'; ?>>
</div>
</form>
<?php
<?php
}
}
}
?>
<form class="tagtr liste_titre liste_titre_add formnoborder">

View File

@@ -578,7 +578,8 @@ class Fichinter extends CommonObject
return price2num($amount, 'MT');
}
/**
* Create a document onto disk according to template module.
*
@@ -597,12 +598,12 @@ class Fichinter extends CommonObject
if (! dol_strlen($modele)) {
$modele = 'azur';
$modele = 'soleil';
if ($this->modelpdf) {
$modele = $this->modelpdf;
} elseif (! empty($conf->global->PROPALE_ADDON_PDF)) {
$modele = $conf->global->PROPALE_ADDON_PDF;
} elseif (! empty($conf->global->FICHEINTER_ADDON_PDF)) {
$modele = $conf->global->FICHEINTER_ADDON_PDF;
}
}

View File

@@ -1459,7 +1459,7 @@ if ($action=='create')
});
</script>';
}
print ' <a href="'.DOL_URL_ROOT.'/societe/card.php?action=create&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'">'.$langs->trans("AddThirdParty").'</a>';
print ' <a href="'.DOL_URL_ROOT.'/societe/card.php?action=create&client=0&fournisseur=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'">'.$langs->trans("AddThirdParty").'</a>';
}
print '</td>';

View File

@@ -1487,7 +1487,7 @@ if ($action == 'create')
});
</script>';
}
print ' <a href="'.DOL_URL_ROOT.'/societe/card.php?action=create&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'">'.$langs->trans("AddThirdParty").'</a>';
print ' <a href="'.DOL_URL_ROOT.'/societe/card.php?action=create&client=0&fournisseur=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'">'.$langs->trans("AddThirdParty").'</a>';
}
print '</td></tr>';

View File

@@ -42,6 +42,11 @@ ALTER TABLE llx_facture_rec ADD COLUMN suspended integer DEFAULT 0;
ALTER TABLE llx_facture_rec MODIFY COLUMN titre VARCHAR(100);
ALTER TABLE llx_contrat MODIFY COLUMN ref varchar(50);
ALTER TABLE llx_contrat MODIFY COLUMN ref_customer varchar(50);
ALTER TABLE llx_contrat MODIFY COLUMN ref_supplier varchar(50);
ALTER TABLE llx_contrat MODIFY COLUMN ref_ext varchar(50);
UPDATE llx_c_email_templates SET position = 0 WHERE position IS NULL;

View File

@@ -21,10 +21,10 @@
create table llx_contrat
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
ref varchar(30), -- contrat reference
ref_customer varchar(30), -- customer contract ref
ref_supplier varchar(30), -- supplier contract ref
ref_ext varchar(30), -- external contract ref
ref varchar(50), -- contrat reference
ref_customer varchar(50), -- customer contract ref
ref_supplier varchar(50), -- supplier contract ref
ref_ext varchar(50), -- external contract ref
entity integer DEFAULT 1 NOT NULL, -- multi company id
tms timestamp,
datec datetime, -- creation date

View File

@@ -375,39 +375,40 @@ if (! GETPOST('action','aZ09') || preg_match('/upgrade/i',GETPOST('action','aZ09
}
}
// Code executed only if migrate is LAST ONE. Must always be done.
if (versioncompare($versiontoarray,$versionranarray) >= 0 || versioncompare($versiontoarray,$versionranarray) <= -3)
{
// Reload modules (this must be always done and only into last targeted version, because code to reload module may need table structure of last version)
$listofmodule=array(
'MAIN_MODULE_AGENDA'=>'newboxdefonly',
'MAIN_MODULE_BARCODE'=>'newboxdefonly',
'MAIN_MODULE_CRON'=>'newboxdefonly',
'MAIN_MODULE_COMMANDE'=>'newboxdefonly',
'MAIN_MODULE_DEPLACEMENT'=>'newboxdefonly',
'MAIN_MODULE_DON'=>'newboxdefonly',
'MAIN_MODULE_ECM'=>'newboxdefonly',
'MAIN_MODULE_FACTURE'=>'newboxdefonly',
'MAIN_MODULE_FOURNISSEUR'=>'newboxdefonly',
'MAIN_MODULE_HOLIDAY'=>'newboxdefonly',
'MAIN_MODULE_OPENSURVEY'=>'newboxdefonly',
'MAIN_MODULE_PAYBOX'=>'newboxdefonly',
'MAIN_MODULE_PRODUIT'=>'newboxdefonly',
'MAIN_MODULE_SOCIETE'=>'newboxdefonly',
'MAIN_MODULE_SERVICE'=>'newboxdefonly',
'MAIN_MODULE_USER'=>'newboxdefonly',
'MAIN_MODULE_ACCOUNTING'=>'newboxdefonly',
'MAIN_MODULE_BARCODE'=>'newboxdefonly',
'MAIN_MODULE_CRON'=>'newboxdefonly',
'MAIN_MODULE_PRINTING'=>'newboxdefonly',
// Code executed only if migrate is LAST ONE. Must always be done.
if (versioncompare($versiontoarray,$versionranarray) >= 0 || versioncompare($versiontoarray,$versionranarray) <= -3)
{
// Reload modules (this must be always done and only into last targeted version, because code to reload module may need table structure of last version)
$listofmodule=array(
'MAIN_MODULE_AGENDA'=>'newboxdefonly',
'MAIN_MODULE_BARCODE'=>'newboxdefonly',
'MAIN_MODULE_CRON'=>'newboxdefonly',
'MAIN_MODULE_COMMANDE'=>'newboxdefonly',
'MAIN_MODULE_DEPLACEMENT'=>'newboxdefonly',
'MAIN_MODULE_DON'=>'newboxdefonly',
'MAIN_MODULE_ECM'=>'newboxdefonly',
'MAIN_MODULE_FACTURE'=>'newboxdefonly',
'MAIN_MODULE_FOURNISSEUR'=>'newboxdefonly',
'MAIN_MODULE_HOLIDAY'=>'newboxdefonly',
'MAIN_MODULE_OPENSURVEY'=>'newboxdefonly',
'MAIN_MODULE_PAYBOX'=>'newboxdefonly',
'MAIN_MODULE_PRODUIT'=>'newboxdefonly',
'MAIN_MODULE_SOCIETE'=>'newboxdefonly',
'MAIN_MODULE_SERVICE'=>'newboxdefonly',
'MAIN_MODULE_USER'=>'newboxdefonly',
'MAIN_MODULE_ACCOUNTING'=>'newboxdefonly',
'MAIN_MODULE_BARCODE'=>'newboxdefonly',
'MAIN_MODULE_CRON'=>'newboxdefonly',
'MAIN_MODULE_PRINTING'=>'newboxdefonly',
'MAIN_MODULE_SALARIES'=>'newboxdefonly',
'MAIN_MODULE_USER'=>'newboxdefonly', //This one must be always done and only into last targeted version)
);
migrate_reload_modules($db,$langs,$conf,$listofmodule);
'MAIN_MODULE_USER'=>'newboxdefonly', //This one must be always done and only into last targeted version)
);
migrate_reload_modules($db,$langs,$conf,$listofmodule);
// Reload menus (this must be always and only into last targeted version)
migrate_reload_menu($db,$langs,$conf,$versionto);
}
// Reload menus (this must be always and only into last targeted version)
migrate_reload_menu($db,$langs,$conf,$versionto);
}
// Can force activation of some module during migration with paramater 'enablemodules=MAIN_MODULE_XXX,MAIN_MODULE_YYY,...'
if (! $error && $enablemodules)
@@ -4117,216 +4118,227 @@ function migrate_delete_old_dir($db,$langs,$conf)
*/
function migrate_reload_modules($db,$langs,$conf,$listofmodule=array(),$force=0)
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules force=".$force);
dolibarr_install_syslog("upgrade2::migrate_reload_modules force=".$force);
// If no info is provided, we reload all modules with mode newboxdefonly.
if (count($listofmodule) == 0)
{
$listofmodule=array(
'MAIN_MODULE_AGENDA'=>'newboxdefonly',
'MAIN_MODULE_SOCIETE'=>'newboxdefonly',
'MAIN_MODULE_PRODUIT'=>'newboxdefonly',
'MAIN_MODULE_SERVICE'=>'newboxdefonly',
'MAIN_MODULE_COMMANDE'=>'newboxdefonly',
'MAIN_MODULE_FACTURE'=>'newboxdefonly',
'MAIN_MODULE_FOURNISSEUR'=>'newboxdefonly',
'MAIN_MODULE_HOLIDAY'=>'newboxdefonly',
'MAIN_MODULE_USER'=>'newboxdefonly',
'MAIN_MODULE_DEPLACEMENT'=>'newboxdefonly',
'MAIN_MODULE_DON'=>'newboxdefonly',
'MAIN_MODULE_ECM'=>'newboxdefonly',
'MAIN_MODULE_PAYBOX'=>'newboxdefonly',
'MAIN_MODULE_OPENSURVEY'=>'newboxdefonly'
);
}
// If no info is provided, we reload all modules with mode newboxdefonly.
if (count($listofmodule) == 0)
{
$listofmodule=array(
'MAIN_MODULE_AGENDA'=>'newboxdefonly',
'MAIN_MODULE_SOCIETE'=>'newboxdefonly',
'MAIN_MODULE_PRODUIT'=>'newboxdefonly',
'MAIN_MODULE_SERVICE'=>'newboxdefonly',
'MAIN_MODULE_COMMANDE'=>'newboxdefonly',
'MAIN_MODULE_FACTURE'=>'newboxdefonly',
'MAIN_MODULE_FOURNISSEUR'=>'newboxdefonly',
'MAIN_MODULE_HOLIDAY'=>'newboxdefonly',
'MAIN_MODULE_USER'=>'newboxdefonly',
'MAIN_MODULE_DEPLACEMENT'=>'newboxdefonly',
'MAIN_MODULE_DON'=>'newboxdefonly',
'MAIN_MODULE_ECM'=>'newboxdefonly',
'MAIN_MODULE_PAYBOX'=>'newboxdefonly',
'MAIN_MODULE_OPENSURVEY'=>'newboxdefonly',
'MAIN_MODULE_SALARIES'=>'newboxdefonly'
);
}
foreach($listofmodule as $moduletoreload => $reloadmode)
{
if (empty($moduletoreload) || (empty($conf->global->$moduletoreload) && ! $force)) continue; // Discard reload if module not enabled
foreach($listofmodule as $moduletoreload => $reloadmode)
{
if (empty($moduletoreload) || (empty($conf->global->$moduletoreload) && ! $force)) continue; // Discard reload if module not enabled
$mod=null;
$mod=null;
if ($moduletoreload == 'MAIN_MODULE_AGENDA')
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Agenda module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modAgenda.class.php';
if ($res) {
$mod=new modAgenda($db);
$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_API')
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Rest API module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modApi.class.php';
if ($res) {
$mod=new modApi($db);
//$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_BARCODE')
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Barcode module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modBarcode.class.php';
if ($res) {
$mod=new modBarcode($db);
$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_CRON')
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Cron module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modCron.class.php';
if ($res) {
$mod=new modCron($db);
$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_SOCIETE')
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Societe module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modSociete.class.php';
if ($res) {
$mod=new modSociete($db);
$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_PRODUIT') // Permission has changed into 2.7
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Produit module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modProduct.class.php';
if ($res) {
$mod=new modProduct($db);
//$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_SERVICE') // Permission has changed into 2.7
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Service module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modService.class.php';
if ($res) {
$mod=new modService($db);
//$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_COMMANDE') // Permission has changed into 2.9
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Commande module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modCommande.class.php';
if ($res) {
$mod=new modCommande($db);
//$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_FACTURE') // Permission has changed into 2.9
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Facture module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modFacture.class.php';
if ($res) {
$mod=new modFacture($db);
//$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_FOURNISSEUR') // Permission has changed into 2.9
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Fournisseur module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modFournisseur.class.php';
if ($res) {
$mod=new modFournisseur($db);
//$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_HOLIDAY') // Permission and tabs has changed into 3.8
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Leave Request module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modHoliday.class.php';
if ($res) {
$mod=new modHoliday($db);
$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_DEPLACEMENT') // Permission has changed into 3.0
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Deplacement module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modDeplacement.class.php';
if ($res) {
$mod=new modDeplacement($db);
//$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_DON') // Permission has changed into 3.0
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Don module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modDon.class.php';
if ($res) {
$mod=new modDon($db);
//$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_ECM') // Permission has changed into 3.0 and 3.1
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate ECM module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modECM.class.php';
if ($res) {
$mod=new modECM($db);
$mod->remove('noboxes'); // We need to remove because a permission id has been removed
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_PAYBOX') // Permission has changed into 3.0
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Paybox module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modPaybox.class.php';
if ($res) {
$mod=new modPaybox($db);
$mod->remove('noboxes'); // We need to remove because id of module has changed
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_OPENSURVEY') // Permission has changed into 3.0
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Opensurvey module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modOpenSurvey.class.php';
if ($res) {
$mod=new modOpenSurvey($db);
$mod->remove('noboxes'); // We need to remove because menu entries has changed
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_USER') // Permission has changed into 3.0
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate User module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modUser.class.php';
if ($res) {
$mod=new modUser($db);
//$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_AGENDA')
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Agenda module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modAgenda.class.php';
if ($res) {
$mod=new modAgenda($db);
$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_API')
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Rest API module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modApi.class.php';
if ($res) {
$mod=new modApi($db);
//$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_BARCODE')
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Barcode module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modBarcode.class.php';
if ($res) {
$mod=new modBarcode($db);
$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_CRON')
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Cron module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modCron.class.php';
if ($res) {
$mod=new modCron($db);
$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_SOCIETE')
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Societe module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modSociete.class.php';
if ($res) {
$mod=new modSociete($db);
$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_PRODUIT') // Permission has changed into 2.7
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Produit module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modProduct.class.php';
if ($res) {
$mod=new modProduct($db);
//$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_SERVICE') // Permission has changed into 2.7
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Service module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modService.class.php';
if ($res) {
$mod=new modService($db);
//$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_COMMANDE') // Permission has changed into 2.9
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Commande module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modCommande.class.php';
if ($res) {
$mod=new modCommande($db);
//$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_FACTURE') // Permission has changed into 2.9
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Facture module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modFacture.class.php';
if ($res) {
$mod=new modFacture($db);
//$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_FOURNISSEUR') // Permission has changed into 2.9
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Fournisseur module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modFournisseur.class.php';
if ($res) {
$mod=new modFournisseur($db);
//$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_HOLIDAY') // Permission and tabs has changed into 3.8
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Leave Request module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modHoliday.class.php';
if ($res) {
$mod=new modHoliday($db);
$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_DEPLACEMENT') // Permission has changed into 3.0
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Deplacement module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modDeplacement.class.php';
if ($res) {
$mod=new modDeplacement($db);
//$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_DON') // Permission has changed into 3.0
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Don module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modDon.class.php';
if ($res) {
$mod=new modDon($db);
//$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_ECM') // Permission has changed into 3.0 and 3.1
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate ECM module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modECM.class.php';
if ($res) {
$mod=new modECM($db);
$mod->remove('noboxes'); // We need to remove because a permission id has been removed
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_PAYBOX') // Permission has changed into 3.0
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Paybox module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modPaybox.class.php';
if ($res) {
$mod=new modPaybox($db);
$mod->remove('noboxes'); // We need to remove because id of module has changed
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_OPENSURVEY') // Permission has changed into 3.0
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Opensurvey module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modOpenSurvey.class.php';
if ($res) {
$mod=new modOpenSurvey($db);
$mod->remove('noboxes'); // We need to remove because menu entries has changed
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_SALARIES') // Permission has changed into 6.0
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Salaries module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modSalaries.class.php';
if ($res) {
$mod=new modSalaries($db);
//$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_USER') // Permission has changed into 3.0
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate User module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modUser.class.php';
if ($res) {
$mod=new modUser($db);
//$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if (! empty($mod) && is_object($mod))
{
print '<tr><td colspan="4">';
print '<b>'.$langs->trans('Upgrade').'</b>: ';
print $langs->trans('MigrationReloadModule').' '.$mod->getName(); // We keep getName outside of trans because getName is already encoded/translated
print "<!-- (".$reloadmode.") -->";
print "<br>\n";
print '</td></tr>';
print '<tr><td colspan="4">';
print '<b>'.$langs->trans('Upgrade').'</b>: ';
print $langs->trans('MigrationReloadModule').' '.$mod->getName(); // We keep getName outside of trans because getName is already encoded/translated
print "<!-- (".$reloadmode.") -->";
print "<br>\n";
print '</td></tr>';
}
}
}
}

View File

@@ -33,6 +33,7 @@ AlreadyInGeneralLedger=Already journalized in ledgers
NotYetInGeneralLedger=Not yet journalized in ledgers
GroupIsEmptyCheckSetup=Group is empty, check setup of the personalized accounting group
DetailByAccount=Show detail by account
AccountWithNonZeroValues=Accounts with non zero values
MainAccountForCustomersNotDefined=Main accounting account for customers not defined in setup
MainAccountForSuppliersNotDefined=Main accounting account for suppliers not defined in setup
@@ -56,7 +57,7 @@ AccountancyAreaDescContrib=STEP %s: Define default accounting accounts for speci
AccountancyAreaDescDonation=STEP %s: Define default accounting accounts for donation. For this, use the menu entry %s.
AccountancyAreaDescMisc=STEP %s: Define mandatory default account and default accounting accounts for miscellaneous transactions. For this, use the menu entry %s.
AccountancyAreaDescLoan=STEP %s: Define default accounting accounts for loans. For this, use the menu entry %s.
AccountancyAreaDescBank=STEP %s: Define accounting accounts for each bank and financial accounts. For this, go on the card of each financial account. You can start from page %s.
AccountancyAreaDescBank=STEP %s: Define accounting accounts and journal code for each bank and financial accounts. For this, go on the card of each financial account. You can start from page %s.
AccountancyAreaDescProd=STEP %s: Define accounting accounts on your products/services. For this, use the menu entry %s.
AccountancyAreaDescBind=STEP %s: Check the binding between existing %s lines and accounting account is done, so application will be able to journalize transactions in Ledger in one click. Complete missing bindings. For this, use the menu entry %s.
@@ -65,6 +66,7 @@ AccountancyAreaDescAnalyze=STEP %s: Add or edit existing transactions and genera
AccountancyAreaDescClosePeriod=STEP %s: Close period so we can't make modification in a future.
TheJournalCodeIsNotDefinedOnSomeBankAccount=A mandatory step in setup was not complete (accountancy code journal not defined for all bank accounts)
MenuAccountancy=Accountancy
Selectchartofaccounts=Select active chart of accounts
ChangeAndLoad=Change and load
@@ -156,6 +158,7 @@ AccountingAccountGroupsDesc=You can define here some groups of accounting accoun
ByAccounts=By accounts
ByPredefinedAccountGroups=By predefined groups
ByPersonalizedAccountGroups=By personalized groups
ByYear=By year
NotMatch=Not Set
DeleteMvt=Delete Ledger lines
DelYear=Year to delete
@@ -226,7 +229,7 @@ AccountingJournal=Accounting journal
NewAccountingJournal=New accounting journal
ShowAccoutingJournal=Show accounting journal
Nature=Nature
AccountingJournalType1=Various operation
AccountingJournalType1=Miscellaneous operation
AccountingJournalType2=Sales
AccountingJournalType3=Purchases
AccountingJournalType4=Bank
@@ -279,5 +282,6 @@ BookeppingLineAlreayExists=Lines already existing into bookeeping
NoJournalDefined=No journal defined
Binded=Lines bound
ToBind=Lines to bind
UseMenuToSetBindindManualy=Autodection not possible, use menu <a href="%s">%s</a> to make the binding manually
WarningReportNotReliable=Warning, this report is not based on the Ledger, so does not contains transaction modified manualy in the Ledger. If your journalization is up to date, the bookkeeping view is more accurate.

View File

@@ -1243,6 +1243,7 @@ MemberMainOptions=Main options
AdherentLoginRequired= Manage a Login for each member
AdherentMailRequired=EMail required to create a new member
MemberSendInformationByMailByDefault=Checkbox to send mail confirmation to members (validation or new subscription) is on by default
VisitorCanChooseItsPaymentMode=Visitor can choose among available payment modes
##### LDAP setup #####
LDAPSetup=LDAP Setup
LDAPGlobalParameters=Global parameters

View File

@@ -1,8 +1,8 @@
# Dolibarr language file - Source file is en_US - banks
Bank=Bank
MenuBankCash=Bank/Cash
MenuVariousPayment=Various payments
MenuNewVariousPayment=New various payment
MenuVariousPayment=Miscellaneous payments
MenuNewVariousPayment=New Miscellaneous payment
BankName=Bank name
FinancialAccount=Account
BankAccount=Bank account

View File

@@ -17,7 +17,8 @@ Accountparent=Parent account
Accountsparent=Parent accounts
Income=Income
Outcome=Expense
ReportInOut=Income / Expense
MenuReportInOut=Income / Expense
ReportInOut=Balance of income and expenses
ReportTurnover=Turnover
PaymentsNotLinkedToInvoice=Payments not linked to any invoice, so not linked to any third party
PaymentsNotLinkedToUser=Payments not linked to any user
@@ -143,7 +144,7 @@ CalcModeLT2Debt=Mode <b>%sIRPF on customer invoices%s</b>
CalcModeLT2Rec= Mode <b>%sIRPF on suppliers invoices%s</b>
AnnualSummaryDueDebtMode=Balance of income and expenses, annual summary
AnnualSummaryInputOutputMode=Balance of income and expenses, annual summary
AnnualByCompanies=Income / Expenses, By predefined groups of account
AnnualByCompanies=Balance of income and expenses, by predefined groups of account
AnnualByCompaniesDueDebtMode=Balance of income and expenses, detail by predefined groups, mode <b>%sClaims-Debts%s</b> said <b>Commitment accounting</b>.
AnnualByCompaniesInputOutputMode=Balance of income and expenses, detail by predefined groups, mode <b>%sIncomes-Expenses%s</b> said <b>cash accounting</b>.
SeeReportInInputOutputMode=See report <b>%sIncomes-Expenses%s</b> said <b>cash accounting</b> for a calculation on actual payments made

View File

@@ -87,9 +87,9 @@ ValidateMember=Validate a member
ConfirmValidateMember=Are you sure you want to validate this member?
FollowingLinksArePublic=The following links are open pages not protected by any Dolibarr permission. They are not formated pages, provided as example to show how to list members database.
PublicMemberList=Public member list
BlankSubscriptionForm=Public auto-subscription form
BlankSubscriptionFormDesc=Dolibarr can provide you a public URL to allow external visitors to ask to subscribe to the foundation. If an online payment module is enabled, a payment form will also be automatically provided.
EnablePublicSubscriptionForm=Enable the public auto-subscription form
BlankSubscriptionForm=Public self-subscription form
BlankSubscriptionFormDesc=Dolibarr can provide you a public URL/website to allow external visitors to ask to subscribe to the foundation. If an online payment module is enabled, a payment form may also be automatically provided.
EnablePublicSubscriptionForm=Enable the public website with self-subscription form
ForceMemberType=Force the member type
ExportDataset_member_1=Members and subscriptions
ImportDataset_member_1=Members

View File

@@ -26,6 +26,8 @@ MessageKO=Message on canceled payment return page
YearOfInvoice=Year of invoice date
PreviousYearOfInvoice=Previous year of invoice date
NextYearOfInvoice=Following year of invoice date
DateNextInvoiceBeforeGen=Date of next invoice (before generation)
DateNextInvoiceAfterGen=Date of next invoice (after generation)
Notify_FICHINTER_ADD_CONTACT=Added contact to Intervention
Notify_FICHINTER_VALIDATE=Intervention validated

View File

@@ -88,7 +88,7 @@ ListShippingAssociatedProject=List of shippings associated with the project
ListFichinterAssociatedProject=List of interventions associated with the project
ListExpenseReportsAssociatedProject=List of expense reports associated with the project
ListDonationsAssociatedProject=List of donations associated with the project
ListVariousPaymentsAssociatedProject=List of various payments associated with the project
ListVariousPaymentsAssociatedProject=List of miscellaneous payments associated with the project
ListActionsAssociatedProject=List of events associated with the project
ListTaskTimeUserProject=List of time consumed on tasks of project
ActivityOnProjectToday=Activity on project today

View File

@@ -1970,7 +1970,7 @@ if (! function_exists("llxFooter"))
print '<script type="text/javascript">
jQuery(document).ready(function () {
jQuery(".classfortooltip").tipTip({maxWidth: "'.dol_size(($conf->browser->layout == 'phone' ? 400 : 700),'width').'px", edgeOffset: 10, delay: 50, fadeIn: 50, fadeOut: 50});
jQuery(".classfortooltiponclicktext").dialog({ width: 500, autoOpen: false });
jQuery(".classfortooltiponclicktext").dialog({ width: '.($conf->browser->layout == 'phone' ? 400 : 700).', autoOpen: false });
jQuery(".classfortooltiponclick").click(function () {
console.log("We click on tooltip for element with dolid="+$(this).attr(\'dolid\'));
if ($(this).attr(\'dolid\'))

View File

@@ -34,6 +34,13 @@ $langs->load("bills");
$langs->load("products");
$langs->load("margins");
$action = GETPOST('action','alpha');
$massaction = GETPOST('massaction','alpha');
$toselect = GETPOST('toselect', 'array');
$contextpage= GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'margindetail'; // To manage different context of search
$backtopage = GETPOST('backtopage');
$optioncss = GETPOST('optioncss','alpha');
// Load variable for pagination
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST('sortfield','alpha');
@@ -143,13 +150,10 @@ llxHeader('', $title);
$param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if (! empty($startdate)) {
$param .= '&startdatemonth=' . GETPOST('startdatemonth', 'int') . '&startdateday=' . GETPOST('startdateday', 'int') . '&startdateyear=' . GETPOST('startdateyear', 'int');
}
if (! empty($enddate)) {
$param .= '&enddatemonth=' . GETPOST('enddatemonth', 'int') . '&enddateday=' . GETPOST('enddateday', 'int') . '&enddateyear=' . GETPOST('enddateyear', 'int');
}
if ($optioncss != '') $param.='&optioncss='.$optioncss;
if ($search_ref != '') $param.='&search_ref='.urlencode($search_ref);
if (! empty($startdate)) $param .= '&startdatemonth=' . GETPOST('startdatemonth', 'int') . '&startdateday=' . GETPOST('startdateday', 'int') . '&startdateyear=' . GETPOST('startdateyear', 'int');
if (! empty($enddate)) $param .= '&enddatemonth=' . GETPOST('enddatemonth', 'int') . '&enddateday=' . GETPOST('enddateday', 'int') . '&enddateyear=' . GETPOST('enddateyear', 'int');
if ($optioncss != '') $param.='&optioncss='.$optioncss;
// Show tabs
$head = marges_prepare_head($user);

View File

@@ -60,17 +60,17 @@ dol_include_once('/mymodule/class/myobject.class.php');
// Load traductions files requiredby by page
$langs->loadLangs(array("mymodule@mymodule","other"));
$action = GETPOST('action','alpha');
$massaction = GETPOST('massaction','alpha');
$show_files = GETPOST('show_files','int');
$confirm = GETPOST('confirm','alpha');
$cancel = GETPOST('cancel', 'alpha');
$toselect = GETPOST('toselect', 'array');
$action = GETPOST('action','alpha'); // The action 'add', 'create', 'edit', 'update', 'view', ...
$massaction = GETPOST('massaction','alpha'); // The bulk action (combo box choice into lists)
$show_files = GETPOST('show_files','int'); // Show files area generated by bulk actions ?
$confirm = GETPOST('confirm','alpha'); // Result of a confirmation
$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
$contextpage= GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'myobjectlist'; // To manage different context of search
$backtopage = GETPOST('backtopage','alpha'); // Go back to a dedicated page
$optioncss = GETPOST('optioncss','aZ'); // Option for the css output (always '' except when 'print')
$id = GETPOST('id','int');
$backtopage = GETPOST('backtopage');
$optioncss = GETPOST('optioncss','alpha');
// Load variable for pagination
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;

View File

@@ -299,11 +299,39 @@ if ($action == 'add')
if (! empty($conf->global->MEMBER_NEWFORM_PAYONLINE))
{
if ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'paybox')
if ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'all')
{
$urlback=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?from=membernewform&source=membersubscription&ref='.urlencode($adh->ref);
if (price2num(GETPOST('amount'))) $urlback.='&amount='.price2num(GETPOST('amount'));
if (GETPOST('email')) $urlback.='&email='.urlencode(GETPOST('email'));
if (! empty($conf->global->PAYMENT_SECURITY_TOKEN))
{
if (! empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE))
{
$urlback.='&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . 'membersubscription' . $adh->ref, 2));
}
else
{
$urlback.='&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN);
}
}
}
else if ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'paybox')
{
$urlback=DOL_MAIN_URL_ROOT.'/public/paybox/newpayment.php?from=membernewform&source=membersubscription&ref='.urlencode($adh->ref);
if (price2num(GETPOST('amount'))) $urlback.='&amount='.price2num(GETPOST('amount'));
if (GETPOST('email')) $urlback.='&email='.urlencode(GETPOST('email'));
if (! empty($conf->global->PAYBOX_SECURITY_TOKEN))
{
if (! empty($conf->global->PAYBOX_SECURITY_TOKEN_UNIQUE))
{
$urlback.='&securekey='.urlencode(dol_hash($conf->global->PAYBOX_SECURITY_TOKEN . 'membersubscription' . $adh->ref, 2));
}
else
{
$urlback.='&securekey='.urlencode($conf->global->PAYBOX_SECURITY_TOKEN);
}
}
}
else if ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'paypal')
{

View File

@@ -1044,7 +1044,7 @@ else
// Prospect/Customer
print '<tr><td class="titlefieldcreate">'.fieldLabel('ProspectCustomer','customerprospect',1).'</td>';
print '<td class="maxwidthonsmartphone">';
$selected=isset($_POST['client'])?GETPOST('client'):$object->client;
$selected=GETPOST('client','int')!=''?GETPOST('client','int'):$object->client;
print '<select class="flat" name="client" id="customerprospect">';
if (GETPOST("type") == '') print '<option value="-1">&nbsp;</option>';
if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) print '<option value="2"'.($selected==2?' selected':'').'>'.$langs->trans('Prospect').'</option>';
@@ -1071,7 +1071,7 @@ else
print '<td>'.fieldLabel('Supplier','fournisseur',1).'</td><td>';
$default = -1;
if (! empty($conf->global->THIRDPARTY_SUPPLIER_BY_DEFAULT)) $default=1;
print $form->selectyesno("fournisseur", (isset($_POST['fournisseur'])?GETPOST('fournisseur'):(GETPOST("type") == '' ? $default : $object->fournisseur)), 1, 0, (GETPOST("type") == '' ? 1 : 0));
print $form->selectyesno("fournisseur", (GETPOST('fournisseur','int')!=''?GETPOST('fournisseur','int'):(GETPOST("type",'alpha') == '' ? $default : $object->fournisseur)), 1, 0, (GETPOST("type",'alpha') == '' ? 1 : 0));
print '</td>';
print '<td>'.fieldLabel('SupplierCode','supplier_code').'</td><td>';
print '<table class="nobordernopadding"><tr><td>';

View File

@@ -1106,17 +1106,18 @@ class Societe extends CommonObject
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON s.fk_departement = d.rowid';
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_typent as te ON s.fk_typent = te.id';
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON s.fk_incoterms = i.rowid';
if ($rowid) $sql .= ' WHERE s.rowid = '.$rowid;
else if ($ref) $sql .= " WHERE s.nom = '".$this->db->escape($ref)."' AND s.entity IN (".getEntity($this->element, 1).")";
else if ($ref_ext) $sql .= " WHERE s.ref_ext = '".$this->db->escape($ref_ext)."' AND s.entity IN (".getEntity($this->element, 1).")";
else if ($ref_int) $sql .= " WHERE s.ref_int = '".$this->db->escape($ref_int)."' AND s.entity IN (".getEntity($this->element, 1).")";
else if ($idprof1) $sql .= " WHERE s.siren = '".$this->db->escape($idprof1)."' AND s.entity IN (".getEntity($this->element, 1).")";
else if ($idprof2) $sql .= " WHERE s.siret = '".$this->db->escape($idprof2)."' AND s.entity IN (".getEntity($this->element, 1).")";
else if ($idprof3) $sql .= " WHERE s.ape = '".$this->db->escape($idprof3)."' AND s.entity IN (".getEntity($this->element, 1).")";
else if ($idprof4) $sql .= " WHERE s.idprof4 = '".$this->db->escape($idprof4)."' AND s.entity IN (".getEntity($this->element, 1).")";
else if ($idprof5) $sql .= " WHERE s.idprof5 = '".$this->db->escape($idprof5)."' AND s.entity IN (".getEntity($this->element, 1).")";
else if ($idprof6) $sql .= " WHERE s.idprof6 = '".$this->db->escape($idprof6)."' AND s.entity IN (".getEntity($this->element, 1).")";
else if ($email) $sql .= " WHERE email = '".$this->db->escape($email)."' AND s.entity IN (".getEntity($this->element, 1).")";
$sql .= ' WHERE s.entity IN ('.getEntity($this->element, 1).')';
if ($rowid) $sql .= ' AND s.rowid = '.$rowid;
if ($ref) $sql .= " AND s.nom = '".$this->db->escape($ref)."'";
if ($ref_ext) $sql .= " AND s.ref_ext = '".$this->db->escape($ref_ext)."'";
if ($ref_int) $sql .= " AND s.ref_int = '".$this->db->escape($ref_int)."'";
if ($idprof1) $sql .= " AND s.siren = '".$this->db->escape($idprof1)."'";
if ($idprof2) $sql .= " AND s.siret = '".$this->db->escape($idprof2)."'";
if ($idprof3) $sql .= " AND s.ape = '".$this->db->escape($idprof3)."'";
if ($idprof4) $sql .= " AND s.idprof4 = '".$this->db->escape($idprof4)."'";
if ($idprof5) $sql .= " AND s.idprof5 = '".$this->db->escape($idprof5)."'";
if ($idprof6) $sql .= " AND s.idprof6 = '".$this->db->escape($idprof6)."'";
if ($email) $sql .= " AND email = '".$this->db->escape($email)."'";
$resql=$this->db->query($sql);
if ($resql)

View File

@@ -217,8 +217,8 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
if (empty($reshook))
{
// Selection of new fields
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
// Selection of new fields
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
// Did we click on purge search criteria ?
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
@@ -259,24 +259,24 @@ if (empty($reshook))
$search_array_options=array();
}
// Mass actions
$objectclass='Societe';
$objectlabel='ThirdParty';
$permtoread = $user->rights->societe->lire;
$permtodelete = $user->rights->societe->supprimer;
$uploaddir = $conf->societe->dir_output;
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
// Mass actions
$objectclass='Societe';
$objectlabel='ThirdParty';
$permtoread = $user->rights->societe->lire;
$permtodelete = $user->rights->societe->supprimer;
$uploaddir = $conf->societe->dir_output;
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
if ($action == 'setstcomm')
{
$object = new Client($db);
$result=$object->fetch(GETPOST('stcommsocid'));
$object->stcomm_id=dol_getIdFromCode($db, GETPOST('stcomm','alpha'), 'c_stcomm');
$result=$object->update($object->id, $user);
if ($result < 0) setEventMessages($object->error,$object->errors,'errors');
if ($action == 'setstcomm')
{
$object = new Client($db);
$result=$object->fetch(GETPOST('stcommsocid'));
$object->stcomm_id=dol_getIdFromCode($db, GETPOST('stcomm','alpha'), 'c_stcomm');
$result=$object->update($object->id, $user);
if ($result < 0) setEventMessages($object->error,$object->errors,'errors');
$action='';
}
$action='';
}
}
if ($search_status=='') $search_status=1; // always display active thirdparty first
@@ -995,12 +995,12 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
}
}
// Hook fields
$parameters=array('arrayfields'=>$arrayfields);
$parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder);
$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (! empty($arrayfields['s.datec']['checked'])) print_liste_field_titre($arrayfields['s.datec']['label'],$_SERVER["PHP_SELF"],"s.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
if (! empty($arrayfields['s.tms']['checked'])) print_liste_field_titre($arrayfields['s.tms']['label'],$_SERVER["PHP_SELF"],"s.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
if (! empty($arrayfields['s.status']['checked'])) print_liste_field_titre($arrayfields['s.status']['label'],$_SERVER["PHP_SELF"],"s.status","",$param,'align="center"',$sortfield,$sortorder);
if (! empty($arrayfields['s.datec']['checked'])) print_liste_field_titre($arrayfields['s.datec']['label'],$_SERVER["PHP_SELF"],"s.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
if (! empty($arrayfields['s.tms']['checked'])) print_liste_field_titre($arrayfields['s.tms']['label'],$_SERVER["PHP_SELF"],"s.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
if (! empty($arrayfields['s.status']['checked'])) print_liste_field_titre($arrayfields['s.status']['label'],$_SERVER["PHP_SELF"],"s.status","",$param,'align="center"',$sortfield,$sortorder);
if (! empty($arrayfields['s.import_key']['checked'])) print_liste_field_titre($arrayfields['s.import_key']['label'],$_SERVER["PHP_SELF"],"s.import_key","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ');
print "</tr>\n";

View File

@@ -1063,7 +1063,7 @@ if ($action == 'create')
} else {
print '<td colspan="2">';
print $form->select_company('', 'socid', 's.fournisseur = 1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300');
print ' <a href="'.DOL_URL_ROOT.'/societe/card.php?action=create&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'">'.$langs->trans("AddThirdParty").'</a>';
print ' <a href="'.DOL_URL_ROOT.'/societe/card.php?action=create&client=0&fournisseur=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'">'.$langs->trans("AddThirdParty").'</a>';
print '</td>';
}
print '</tr>' . "\n";