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

This commit is contained in:
markus 2019-02-26 12:31:24 +01:00
commit d38bff6f14
288 changed files with 3524 additions and 2950 deletions

View File

@ -48,7 +48,7 @@ if (! $res && file_exists("../../master.inc.php")) $res=@include "../../master.i
if (! $res && file_exists("../../../master.inc.php")) $res=@include "../../../master.inc.php"; if (! $res && file_exists("../../../master.inc.php")) $res=@include "../../../master.inc.php";
if (! $res && preg_match('/\/nltechno([^\/]*)\//', $_SERVER["PHP_SELF"], $reg)) $res=@include $path."../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only if (! $res && preg_match('/\/nltechno([^\/]*)\//', $_SERVER["PHP_SELF"], $reg)) $res=@include $path."../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only
if (! $res && preg_match('/\/nltechno([^\/]*)\//', $_SERVER["PHP_SELF"], $reg)) $res=@include "../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only if (! $res && preg_match('/\/nltechno([^\/]*)\//', $_SERVER["PHP_SELF"], $reg)) $res=@include "../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only
if (! $res) die ("Failed to include master.inc.php file\n"); if (! $res) die("Failed to include master.inc.php file\n");
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';

View File

@ -43,7 +43,7 @@ if (! $res && file_exists("../../master.inc.php")) $res=@include "../../master.i
if (! $res && file_exists("../../../master.inc.php")) $res=@include "../../../master.inc.php"; if (! $res && file_exists("../../../master.inc.php")) $res=@include "../../../master.inc.php";
if (! $res && preg_match('/\/nltechno([^\/]*)\//', $_SERVER["PHP_SELF"], $reg)) $res=@include $path."../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only if (! $res && preg_match('/\/nltechno([^\/]*)\//', $_SERVER["PHP_SELF"], $reg)) $res=@include $path."../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only
if (! $res && preg_match('/\/nltechno([^\/]*)\//', $_SERVER["PHP_SELF"], $reg)) $res=@include "../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only if (! $res && preg_match('/\/nltechno([^\/]*)\//', $_SERVER["PHP_SELF"], $reg)) $res=@include "../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only
if (! $res) die ("Failed to include master.inc.php file\n"); if (! $res) die("Failed to include master.inc.php file\n");
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';

View File

@ -428,5 +428,6 @@
<rule ref="PSR2.Classes.ClassDeclaration" /> <rule ref="PSR2.Classes.ClassDeclaration" />
<rule ref="PSR2.Methods.FunctionClosingBrace" /> <rule ref="PSR2.Methods.FunctionClosingBrace" />
<rule ref="PSR2.Files.EndFileNewline.TooMany" /> <rule ref="PSR2.Files.EndFileNewline.TooMany" />
<rule ref="PSR2.Files.EndFileNewline.NoneFound" /> <rule ref="PSR2.Files.EndFileNewline.NoneFound" />
<rule ref="PSR2.Methods.FunctionCallSignature.SpaceBeforeOpenBracket" />
</ruleset> </ruleset>

View File

@ -173,17 +173,16 @@ while ($obj = $db->fetch_object($resql)) {
$sql.= $db->plimit($limit+1, $offset); $sql.= $db->plimit($limit+1, $offset);
dol_syslog ("/accountancy/bookkeeping/thirdparty_lettrage_supplier.php", LOG_DEBUG); dol_syslog("/accountancy/bookkeeping/thirdparty_lettrage_supplier.php", LOG_DEBUG);
$resql = $db->query($sql); $resql = $db->query($sql);
if (! $resql) if (! $resql) {
{
dol_print_error($db); dol_print_error($db);
exit; exit;
} }
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
dol_syslog ("/accountancy/bookkeeping/thirdparty_lettrage_supplier.php", LOG_DEBUG); dol_syslog("/accountancy/bookkeeping/thirdparty_lettrage_supplier.php", LOG_DEBUG);
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql) { if ($resql) {
$num = $db->num_rows($resql); $num = $db->num_rows($resql);

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2016 Jamal Elbaz <jamelbaz@gmail.pro> /* Copyright (C) 2016 Jamal Elbaz <jamelbaz@gmail.pro>
* Copyright (C) 2016-2017 Alexandre Spangaro <aspangaro@open-dsi.fr> * Copyright (C) 2016-2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -661,13 +661,11 @@ class AccountancyCategory // extends CommonObject
/** /**
* Function to know all category from accounting account * Function to know all category from accounting account
* *
* @return array Result in table * @return array|integer Result in table (array), -1 if KO
*/ */
public function getCatsCpts() public function getCatsCpts()
{ {
global $mysoc,$conf; global $mysoc, $conf;
$sql = "";
if (empty($mysoc->country_id)) { if (empty($mysoc->country_id)) {
dol_print_error('', 'Call to select_accounting_account with mysoc country not yet defined'); dol_print_error('', 'Call to select_accounting_account with mysoc country not yet defined');
@ -720,7 +718,7 @@ class AccountancyCategory // extends CommonObject
* @param int|array $cpt Accounting account or array of accounting account * @param int|array $cpt Accounting account or array of accounting account
* @param string $date_start Date start * @param string $date_start Date start
* @param string $date_end Date end * @param string $date_end Date end
* @param int $sens Sens of the account: 0: credit - debit, 1: debit - credit * @param int $sens Sens of the account: 0: credit - debit (use this by default), 1: debit - credit
* @param string $thirdparty_code Thirdparty code * @param string $thirdparty_code Thirdparty code
* @param int $month Specifig month - Can be empty * @param int $month Specifig month - Can be empty
* @param int $year Specifig year - Can be empty * @param int $year Specifig year - Can be empty
@ -805,7 +803,7 @@ class AccountancyCategory // extends CommonObject
exit(); exit();
} }
$sql = "SELECT c.rowid, c.code, c.label, c.formula, c.position, c.category_type"; $sql = "SELECT c.rowid, c.code, c.label, c.formula, c.position, c.category_type, c.sens";
$sql .= " FROM " . MAIN_DB_PREFIX . "c_accounting_category as c"; $sql .= " FROM " . MAIN_DB_PREFIX . "c_accounting_category as c";
$sql .= " WHERE c.active = 1"; $sql .= " WHERE c.active = 1";
$sql .= " AND c.entity = " . $conf->entity; $sql .= " AND c.entity = " . $conf->entity;
@ -829,7 +827,8 @@ class AccountancyCategory // extends CommonObject
'label' => $obj->label, 'label' => $obj->label,
'formula' => $obj->formula, 'formula' => $obj->formula,
'position' => $obj->position, 'position' => $obj->position,
'category_type' => $obj->category_type 'category_type' => $obj->category_type,
'bc' => $obj->sens
); );
$i++; $i++;
} }

View File

@ -456,7 +456,7 @@ if ($result) {
if ($objp->country_sell == '1') { if ($objp->country_sell == '1') {
$objp->code_sell_p = $objp->code_sell; $objp->code_sell_p = $objp->code_sell;
$objp->aarowid_suggest = $objp->aarowid; $objp->aarowid_suggest = $objp->aarowid;
} elseif ($isinEEC == true) { } elseif ($isinEEC === true) {
$objp->code_sell_p = $objp->code_sell_intra; $objp->code_sell_p = $objp->code_sell_intra;
$objp->aarowid_suggest = $objp->aarowid_intra; $objp->aarowid_suggest = $objp->aarowid_intra;
} else { } else {

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2016-2018 Alexandre Spangaro <aspangaro@open-dsi.fr> * Copyright (C) 2016-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -33,6 +33,9 @@ $langs->loadLangs(array("compta","bills","other","accountancy","loans","banks","
if ($user->societe_id > 0) if ($user->societe_id > 0)
accessforbidden(); accessforbidden();
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array of hooks
$hookmanager->initHooks(array('accountancyindex'));
/* /*
* Actions * Actions
*/ */
@ -52,10 +55,10 @@ $step = 0;
if ($conf->accounting->enabled) if ($conf->accounting->enabled)
{ {
print $langs->trans("AccountancyAreaDescIntro")."<br>\n"; print '<span class="opacitymedium">'.$langs->trans("AccountancyAreaDescIntro")."</span><br>\n";
print "<br>\n";print "<br>\n"; print "<br>\n";print "<br>\n";
print load_fiche_titre('<span class="fa fa-calendar-check-o"></span> '.$langs->trans("AccountancyAreaDescActionOnce"), '', '')."<br>\n"; print load_fiche_titre('<span class="fa fa-calendar-check-o"></span> '.$langs->trans("AccountancyAreaDescActionOnce"), '', '')."\n";
print '<hr>'; print '<hr>';
print "<br>\n"; print "<br>\n";

View File

@ -633,12 +633,12 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
print '"' . $key . '"' . $sep; print '"' . $key . '"' . $sep;
print '"' . $date . '"' . $sep; print '"' . $date . '"' . $sep;
print '"' . $val["refsologest"] . '"' . $sep; print '"' . $val["refsologest"] . '"' . $sep;
print '"' . utf8_decode (dol_trunc($companystatic->name, 32)). '"' . $sep; print '"' . utf8_decode(dol_trunc($companystatic->name, 32)). '"' . $sep;
print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep; print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
print '"' . $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER . '"' . $sep; print '"' . $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER . '"' . $sep;
print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep; print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
print '"' . $langs->trans("Thirdparty") . '"' . $sep; print '"' . $langs->trans("Thirdparty") . '"' . $sep;
print '"' . utf8_decode (dol_trunc($companystatic->name, 16)) . ' - ' . $val["refsuppliersologest"] . ' - ' . $langs->trans("Thirdparty") . '"' . $sep; print '"' . utf8_decode(dol_trunc($companystatic->name, 16)) . ' - ' . $val["refsuppliersologest"] . ' - ' . $langs->trans("Thirdparty") . '"' . $sep;
print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep; print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep;
print '"' . ($mt >= 0 ? price($mt) : '') . '"'. $sep; print '"' . ($mt >= 0 ? price($mt) : '') . '"'. $sep;
print '"' . $journal . '"' ; print '"' . $journal . '"' ;
@ -654,12 +654,12 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
print '"' . $key . '"' . $sep; print '"' . $key . '"' . $sep;
print '"' . $date . '"' . $sep; print '"' . $date . '"' . $sep;
print '"' . $val["refsologest"] . '"' . $sep; print '"' . $val["refsologest"] . '"' . $sep;
print '"' . utf8_decode (dol_trunc($companystatic->name, 32)) . '"' . $sep; print '"' . utf8_decode(dol_trunc($companystatic->name, 32)) . '"' . $sep;
print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep; print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep;
print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep; print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep;
print '""' . $sep; print '""' . $sep;
print '"' . utf8_decode (dol_trunc($accountingaccount->label, 32)) . '"' . $sep; print '"' . utf8_decode(dol_trunc($accountingaccount->label, 32)) . '"' . $sep;
print '"' . utf8_decode (dol_trunc($companystatic->name, 16)) . ' - ' . $val["refsuppliersologest"] . ' - ' . dol_trunc($accountingaccount->label, 32) . '"' . $sep; print '"' . utf8_decode(dol_trunc($companystatic->name, 16)) . ' - ' . $val["refsuppliersologest"] . ' - ' . dol_trunc($accountingaccount->label, 32) . '"' . $sep;
print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep; print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep;
print '"' . ($mt < 0 ? price(- $mt) : '') . '"'. $sep; print '"' . ($mt < 0 ? price(- $mt) : '') . '"'. $sep;
print '"' . $journal . '"' ; print '"' . $journal . '"' ;
@ -679,7 +679,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
print '"' . $key . '"' . $sep; print '"' . $key . '"' . $sep;
print '"' . $date . '"' . $sep; print '"' . $date . '"' . $sep;
print '"' . $val["refsologest"] . '"' . $sep; print '"' . $val["refsologest"] . '"' . $sep;
print '"' . utf8_decode (dol_trunc($companystatic->name, 32)) . '"' . $sep; print '"' . utf8_decode(dol_trunc($companystatic->name, 32)) . '"' . $sep;
print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep; print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep;
print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep; print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep;
print '""' . $sep; print '""' . $sep;
@ -700,12 +700,12 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
print '"' . $key . '"' . $sep; print '"' . $key . '"' . $sep;
print '"' . $date . '"' . $sep; print '"' . $date . '"' . $sep;
print '"' . $val["refsologest"] . '"' . $sep; print '"' . $val["refsologest"] . '"' . $sep;
print '"' . utf8_decode (dol_trunc($companystatic->name, 32)). '"' . $sep; print '"' . utf8_decode(dol_trunc($companystatic->name, 32)). '"' . $sep;
print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep; print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep; print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep; print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
print '"' . $langs->trans("Thirdparty") . '"' . $sep; print '"' . $langs->trans("Thirdparty") . '"' . $sep;
print '"' . utf8_decode (dol_trunc($companystatic->name, 16)) . ' - ' . $val["refsuppliersologest"] . ' - ' . $langs->trans("VAT") . ' NPR"' . $sep; print '"' . utf8_decode(dol_trunc($companystatic->name, 16)) . ' - ' . $val["refsuppliersologest"] . ' - ' . $langs->trans("VAT") . ' NPR"' . $sep;
print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep; print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep;
print '"' . ($mt >= 0 ? price($mt) : '') . '"'. $sep; print '"' . ($mt >= 0 ? price($mt) : '') . '"'. $sep;
print '"' . $journal . '"' ; print '"' . $journal . '"' ;

View File

@ -151,14 +151,14 @@ print "<table class=\"noborder\" width=\"100%\">";
print "<tr class=\"liste_titre\">"; print "<tr class=\"liste_titre\">";
print '<td>'.$langs->trans("Parameter")."</td>"; print '<td>'.$langs->trans("Parameter")."</td>";
print '<td align="center">'.$langs->trans("Value")."</td>"; print '<td class="center">'.$langs->trans("Value")."</td>";
print "</tr>"; print "</tr>";
// Show external agenda // Show external agenda
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print "<td>".$langs->trans("ExtSitesEnableThisTool")."</td>"; print "<td>".$langs->trans("ExtSitesEnableThisTool")."</td>";
print '<td align="center">'; print '<td class="center">';
if ($conf->use_javascript_ajax) if ($conf->use_javascript_ajax)
{ {
print ajax_constantonoff('AGENDA_DISABLE_EXT', array('enabled'=>array(0=>'.hideifnotset')), null, 1); print ajax_constantonoff('AGENDA_DISABLE_EXT', array('enabled'=>array(0=>'.hideifnotset')), null, 1);
@ -181,7 +181,7 @@ print "</tr>";
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print "<td>".$langs->trans("ExtSitesNbOfAgenda")."</td>"; print "<td>".$langs->trans("ExtSitesNbOfAgenda")."</td>";
print '<td align="center">'; print '<td class="center">';
print '<input class="flat hideifnotset" type="text" size="2" id="AGENDA_EXT_NB" name="AGENDA_EXT_NB" value="'.$conf->global->AGENDA_EXT_NB.'">'; print '<input class="flat hideifnotset" type="text" size="2" id="AGENDA_EXT_NB" name="AGENDA_EXT_NB" value="'.$conf->global->AGENDA_EXT_NB.'">';
print "</td>"; print "</td>";
print "</tr>"; print "</tr>";

View File

@ -225,10 +225,10 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
print '<tr class="liste_titre">'."\n"; print '<tr class="liste_titre">'."\n";
print '<td width="100">'.$langs->trans("Name").'</td>'."\n"; print '<td width="100">'.$langs->trans("Name").'</td>'."\n";
print '<td>'.$langs->trans("Description").'</td>'."\n"; print '<td>'.$langs->trans("Description").'</td>'."\n";
print '<td align="center" width="60">'.$langs->trans("Status").'</td>'."\n"; print '<td class="center" width="60">'.$langs->trans("Status").'</td>'."\n";
print '<td align="center" width="60">'.$langs->trans("Default").'</td>'."\n"; print '<td class="center" width="60">'.$langs->trans("Default").'</td>'."\n";
print '<td align="center" width="40">'.$langs->trans("ShortInfo").'</td>'; print '<td class="center" width="40">'.$langs->trans("ShortInfo").'</td>';
print '<td align="center" width="40">'.$langs->trans("Preview").'</td>'; print '<td class="center" width="40">'.$langs->trans("Preview").'</td>';
print '</tr>'."\n"; print '</tr>'."\n";
clearstatcache(); clearstatcache();
@ -269,7 +269,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
if (in_array($name, $def)) if (in_array($name, $def))
{ {
print '<td align="center">'."\n"; print '<td class="center">'."\n";
if ($conf->global->ACTION_EVENT_ADDON_PDF != "$name") if ($conf->global->ACTION_EVENT_ADDON_PDF != "$name")
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=action">'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=action">';
@ -284,13 +284,13 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
} }
else else
{ {
print '<td align="center">'."\n"; print '<td class="center">'."\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmodel&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=action">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmodel&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=action">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
print "</td>"; print "</td>";
} }
// Default // Default
print '<td align="center">'; print '<td class="center">';
if ($conf->global->ACTION_EVENT_ADDON_PDF == "$name") if ($conf->global->ACTION_EVENT_ADDON_PDF == "$name")
{ {
print img_picto($langs->trans("Default"), 'on'); print img_picto($langs->trans("Default"), 'on');
@ -307,10 +307,10 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
$htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; $htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
$htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>'; $htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
$htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); $htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
print '<td align="center">'; print '<td class="center">';
print $form->textwithpicto('', $htmltooltip, 1, 0); print $form->textwithpicto('', $htmltooltip, 1, 0);
print '</td>'; print '</td>';
print '<td align="center">'; print '<td class="center">';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&amp;module='.$name.'">'.img_object($langs->trans("Preview"), 'order').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&amp;module='.$name.'">'.img_object($langs->trans("Preview"), 'order').'</a>';
print '</td>'; print '</td>';
@ -330,7 +330,7 @@ print '<input type="hidden" name="action" value="set">';
print '<table class="noborder allwidth">'."\n"; print '<table class="noborder allwidth">'."\n";
print '<tr class="liste_titre">'."\n"; print '<tr class="liste_titre">'."\n";
print '<td>'.$langs->trans("Parameters").'</td>'."\n"; print '<td>'.$langs->trans("Parameters").'</td>'."\n";
print '<td align="center">&nbsp;</td>'."\n"; print '<td class="center">&nbsp;</td>'."\n";
print '<td class="right">'.$langs->trans("Value").'</td>'."\n"; print '<td class="right">'.$langs->trans("Value").'</td>'."\n";
print '</tr>'."\n"; print '</tr>'."\n";
@ -338,7 +338,7 @@ print '</tr>'."\n";
print '<tr class="oddeven">'."\n"; print '<tr class="oddeven">'."\n";
print '<td>'.$langs->trans("AGENDA_USE_EVENT_TYPE").'</td>'."\n"; print '<td>'.$langs->trans("AGENDA_USE_EVENT_TYPE").'</td>'."\n";
print '<td align="center">&nbsp;</td>'."\n"; print '<td class="center">&nbsp;</td>'."\n";
print '<td class="right">'."\n"; print '<td class="right">'."\n";
//print ajax_constantonoff('AGENDA_USE_EVENT_TYPE'); Do not use ajax here, we need to reload page to change other combo list //print ajax_constantonoff('AGENDA_USE_EVENT_TYPE'); Do not use ajax here, we need to reload page to change other combo list
if (empty($conf->global->AGENDA_USE_EVENT_TYPE)) if (empty($conf->global->AGENDA_USE_EVENT_TYPE))
@ -355,7 +355,7 @@ print '</td></tr>'."\n";
print '<tr class="oddeven">'."\n"; print '<tr class="oddeven">'."\n";
$htmltext=$langs->trans("ThisValueCanOverwrittenOnUserLevel", $langs->transnoentitiesnoconv("UserGUISetup")); $htmltext=$langs->trans("ThisValueCanOverwrittenOnUserLevel", $langs->transnoentitiesnoconv("UserGUISetup"));
print '<td>'.$form->textwithpicto($langs->trans("AGENDA_DEFAULT_VIEW"), $htmltext).'</td>'."\n"; print '<td>'.$form->textwithpicto($langs->trans("AGENDA_DEFAULT_VIEW"), $htmltext).'</td>'."\n";
print '<td align="center">&nbsp;</td>'."\n"; print '<td class="center">&nbsp;</td>'."\n";
print '<td class="right">'."\n"; print '<td class="right">'."\n";
$tmplist=array(''=>'&nbsp;', 'show_list'=>$langs->trans("ViewList"), 'show_month'=>$langs->trans("ViewCal"), 'show_week'=>$langs->trans("ViewWeek"), 'show_day'=>$langs->trans("ViewDay"), 'show_peruser'=>$langs->trans("ViewPerUser")); $tmplist=array(''=>'&nbsp;', 'show_list'=>$langs->trans("ViewList"), 'show_month'=>$langs->trans("ViewCal"), 'show_week'=>$langs->trans("ViewWeek"), 'show_day'=>$langs->trans("ViewDay"), 'show_peruser'=>$langs->trans("ViewPerUser"));
print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, $conf->global->AGENDA_DEFAULT_VIEW); print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, $conf->global->AGENDA_DEFAULT_VIEW);
@ -367,8 +367,8 @@ if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
print '<!-- AGENDA_USE_EVENT_TYPE_DEFAULT -->'; print '<!-- AGENDA_USE_EVENT_TYPE_DEFAULT -->';
print '<tr class="oddeven">'."\n"; print '<tr class="oddeven">'."\n";
print '<td>'.$langs->trans("AGENDA_USE_EVENT_TYPE_DEFAULT").'</td>'."\n"; print '<td>'.$langs->trans("AGENDA_USE_EVENT_TYPE_DEFAULT").'</td>'."\n";
print '<td align="center">&nbsp;</td>'."\n"; print '<td class="center">&nbsp;</td>'."\n";
print '<td class="right" class="nowrap">'."\n"; print '<td class="right nowrap">'."\n";
$formactions->select_type_actions($conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT, "AGENDA_USE_EVENT_TYPE_DEFAULT", 'systemauto', 0, 1); $formactions->select_type_actions($conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT, "AGENDA_USE_EVENT_TYPE_DEFAULT", 'systemauto', 0, 1);
print '</td></tr>'."\n"; print '</td></tr>'."\n";
} }
@ -376,8 +376,8 @@ if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
// AGENDA_DEFAULT_FILTER_TYPE // AGENDA_DEFAULT_FILTER_TYPE
print '<tr class="oddeven">'."\n"; print '<tr class="oddeven">'."\n";
print '<td>'.$langs->trans("AGENDA_DEFAULT_FILTER_TYPE").'</td>'."\n"; print '<td>'.$langs->trans("AGENDA_DEFAULT_FILTER_TYPE").'</td>'."\n";
print '<td align="center">&nbsp;</td>'."\n"; print '<td class="center">&nbsp;</td>'."\n";
print '<td class="right" class="nowrap">'."\n"; print '<td class="right nowrap">'."\n";
$formactions->select_type_actions($conf->global->AGENDA_DEFAULT_FILTER_TYPE, "AGENDA_DEFAULT_FILTER_TYPE", '', (empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : -1), 1); $formactions->select_type_actions($conf->global->AGENDA_DEFAULT_FILTER_TYPE, "AGENDA_DEFAULT_FILTER_TYPE", '', (empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : -1), 1);
print '</td></tr>'."\n"; print '</td></tr>'."\n";
@ -385,7 +385,7 @@ print '</td></tr>'."\n";
// TODO Remove to use the default generic feature // TODO Remove to use the default generic feature
print '<tr class="oddeven">'."\n"; print '<tr class="oddeven">'."\n";
print '<td>'.$langs->trans("AGENDA_DEFAULT_FILTER_STATUS").'</td>'."\n"; print '<td>'.$langs->trans("AGENDA_DEFAULT_FILTER_STATUS").'</td>'."\n";
print '<td align="center">&nbsp;</td>'."\n"; print '<td class="center">&nbsp;</td>'."\n";
print '<td class="right">'."\n"; print '<td class="right">'."\n";
$formactions->form_select_status_action('agenda', $conf->global->AGENDA_DEFAULT_FILTER_STATUS, 1, 'AGENDA_DEFAULT_FILTER_STATUS', 1, 2, 'minwidth100'); $formactions->form_select_status_action('agenda', $conf->global->AGENDA_DEFAULT_FILTER_STATUS, 1, 'AGENDA_DEFAULT_FILTER_STATUS', 1, 2, 'minwidth100');
print '</td></tr>'."\n"; print '</td></tr>'."\n";

View File

@ -185,17 +185,17 @@ print '<input type="hidden" name="action" value="set">';
print '<table class="noborder allwidth">'."\n"; print '<table class="noborder allwidth">'."\n";
print '<tr class="liste_titre">'."\n"; print '<tr class="liste_titre">'."\n";
print '<td>'.$langs->trans("Parameters").'</td>'."\n"; print '<td>'.$langs->trans("Parameters").'</td>'."\n";
print '<td align="center">&nbsp;</td>'."\n"; print '<td class="center">&nbsp;</td>'."\n";
print '<td class="right">'.$langs->trans("Value").'</td>'."\n"; print '<td class="right">'.$langs->trans("Value").'</td>'."\n";
print '</tr>'."\n"; print '</tr>'."\n";
// AGENDA REMINDER EMAIL // AGENDA REMINDER EMAIL
if ($conf->global->MAIN_FEATURES_LEVEL > 0) if ($conf->global->MAIN_FEATURES_LEVEL == 2)
{ {
print '<tr class="oddeven">'."\n"; print '<tr class="oddeven">'."\n";
print '<td>'.$langs->trans('AGENDA_REMINDER_EMAIL', $langs->transnoentities("Module2300Name")).'</td>'."\n"; print '<td>'.$langs->trans('AGENDA_REMINDER_EMAIL', $langs->transnoentities("Module2300Name")).'</td>'."\n";
print '<td align="center">&nbsp;</td>'."\n"; print '<td class="center">&nbsp;</td>'."\n";
print '<td class="right">'."\n"; print '<td class="right">'."\n";
if (empty($conf->global->AGENDA_REMINDER_EMAIL)) { if (empty($conf->global->AGENDA_REMINDER_EMAIL)) {
@ -208,11 +208,11 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0)
} }
// AGENDA REMINDER BROWSER // AGENDA REMINDER BROWSER
if ($conf->global->MAIN_FEATURES_LEVEL > 0) if ($conf->global->MAIN_FEATURES_LEVEL == 2)
{ {
print '<tr class="oddeven">'."\n"; print '<tr class="oddeven">'."\n";
print '<td>'.$langs->trans('AGENDA_REMINDER_BROWSER').'</td>'."\n"; print '<td>'.$langs->trans('AGENDA_REMINDER_BROWSER').'</td>'."\n";
print '<td align="center">&nbsp;</td>'."\n"; print '<td class="center">&nbsp;</td>'."\n";
print '<td class="right">'."\n"; print '<td class="right">'."\n";
if (empty($conf->global->AGENDA_REMINDER_BROWSER)) { if (empty($conf->global->AGENDA_REMINDER_BROWSER)) {
@ -224,7 +224,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0)
print '<tr class="oddeven">'."\n"; print '<tr class="oddeven">'."\n";
print '<td>'.$langs->trans('AGENDA_REMINDER_BROWSER_SOUND').'</td>'."\n"; print '<td>'.$langs->trans('AGENDA_REMINDER_BROWSER_SOUND').'</td>'."\n";
print '<td align="center">&nbsp;</td>'."\n"; print '<td class="center">&nbsp;</td>'."\n";
print '<td class="right">'."\n"; print '<td class="right">'."\n";
if (empty($conf->global->AGENDA_REMINDER_BROWSER_SOUND)) { if (empty($conf->global->AGENDA_REMINDER_BROWSER_SOUND)) {

View File

@ -183,8 +183,8 @@ print '<tr class="liste_titre">';
print '<td width="140">' . $langs->trans("Name") . '</td>'; print '<td width="140">' . $langs->trans("Name") . '</td>';
print '<td>' . $langs->trans("Description") . '</td>'; print '<td>' . $langs->trans("Description") . '</td>';
print '<td>' . $langs->trans("Example") . '</td>'; print '<td>' . $langs->trans("Example") . '</td>';
print '<td align="center">' . $langs->trans("Status") . '</td>'; print '<td class="center">' . $langs->trans("Status") . '</td>';
print '<td align="center" width="60">&nbsp;</td>'; print '<td class="center" width="60">&nbsp;</td>';
print "</tr>\n"; print "</tr>\n";
$bankorder[0][0] = $langs->trans("BankOrderGlobal"); $bankorder[0][0] = $langs->trans("BankOrderGlobal");
@ -213,12 +213,12 @@ while ($i < $nbofbank) {
print "</td>\n"; print "</td>\n";
if ($conf->global->BANK_SHOW_ORDER_OPTION == $i) { if ($conf->global->BANK_SHOW_ORDER_OPTION == $i) {
print '<td align="center">'; print '<td class="center">';
print img_picto($langs->trans("Activated"), 'on'); print img_picto($langs->trans("Activated"), 'on');
print '</td>'; print '</td>';
} }
else { else {
print '<td align="center"><a href="' . $_SERVER['PHP_SELF'] . '?action=setbankorder&amp;value=' . $i . '">'; print '<td class="center"><a href="' . $_SERVER['PHP_SELF'] . '?action=setbankorder&amp;value=' . $i . '">';
print img_picto($langs->trans("Disabled"), 'off'); print img_picto($langs->trans("Disabled"), 'off');
print '</a></td>'; print '</a></td>';
} }
@ -263,10 +263,10 @@ print "<table class=\"noborder\" width=\"100%\">\n";
print "<tr class=\"liste_titre\">\n"; print "<tr class=\"liste_titre\">\n";
print '<td>' . $langs->trans("Name") . '</td>'; print '<td>' . $langs->trans("Name") . '</td>';
print '<td>' . $langs->trans("Description") . '</td>'; print '<td>' . $langs->trans("Description") . '</td>';
print '<td align="center" width="60">' . $langs->trans("Status") . "</td>\n"; print '<td class="center" width="60">' . $langs->trans("Status") . "</td>\n";
print '<td align="center" width="60">' . $langs->trans("Default") . "</td>\n"; print '<td class="center" width="60">' . $langs->trans("Default") . "</td>\n";
print '<td align="center" width="38">' . $langs->trans("ShortInfo") . '</td>'; print '<td class="center" width="38">' . $langs->trans("ShortInfo") . '</td>';
print '<td align="center" width="38">' . $langs->trans("Preview") . '</td>'; print '<td class="center" width="38">' . $langs->trans("Preview") . '</td>';
print "</tr>\n"; print "</tr>\n";
clearstatcache(); clearstatcache();
@ -315,7 +315,7 @@ foreach ($dirmodels as $reldir) {
// Active // Active
if (in_array($name, $def)) { if (in_array($name, $def)) {
print '<td align="center">' . "\n"; print '<td class="center">' . "\n";
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=del&value=' . $name . '">'; print '<a href="' . $_SERVER["PHP_SELF"] . '?action=del&value=' . $name . '">';
print img_picto($langs->trans("Enabled"), print img_picto($langs->trans("Enabled"),
'switch_on'); 'switch_on');
@ -323,14 +323,14 @@ foreach ($dirmodels as $reldir) {
print '</td>'; print '</td>';
} }
else { else {
print '<td align="center">' . "\n"; print '<td class="center">' . "\n";
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=set&value=' . $name . '&amp;scan_dir=' . $module->scandir . '&amp;label=' . urlencode($module->name) . '">' . img_picto($langs->trans("Disabled"), print '<a href="' . $_SERVER["PHP_SELF"] . '?action=set&value=' . $name . '&amp;scan_dir=' . $module->scandir . '&amp;label=' . urlencode($module->name) . '">' . img_picto($langs->trans("Disabled"),
'switch_off') . '</a>'; 'switch_off') . '</a>';
print "</td>"; print "</td>";
} }
// Default // Default
print '<td align="center">'; print '<td class="center">';
if ($conf->global->BANKADDON_PDF == $name) { if ($conf->global->BANKADDON_PDF == $name) {
print img_picto($langs->trans("Default"), print img_picto($langs->trans("Default"),
'on'); 'on');
@ -358,13 +358,13 @@ foreach ($dirmodels as $reldir) {
// $htmltooltip.='<br>'.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1); // $htmltooltip.='<br>'.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1);
//$htmltooltip .= '<br>' . $langs->trans("WatermarkOnDraftOrders") . ': ' . yn($module->option_draft_watermark, 1, 1); //$htmltooltip .= '<br>' . $langs->trans("WatermarkOnDraftOrders") . ': ' . yn($module->option_draft_watermark, 1, 1);
print '<td align="center">'; print '<td class="center">';
print $form->textwithpicto('', $htmltooltip, 1, print $form->textwithpicto('', $htmltooltip, 1,
0); 0);
print '</td>'; print '</td>';
// Preview // Preview
print '<td align="center">'; print '<td class="center">';
if ($module->type == 'pdf') { if ($module->type == 'pdf') {
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=specimen&module=' . $name . '">' . img_object($langs->trans("Preview"), print '<a href="' . $_SERVER["PHP_SELF"] . '?action=specimen&module=' . $name . '">' . img_object($langs->trans("Preview"),
'bill') . '</a>'; 'bill') . '</a>';
@ -404,7 +404,7 @@ print "<table class=\"noborder\" width=\"100%\">\n";
print "<tr class=\"liste_titre\">\n"; print "<tr class=\"liste_titre\">\n";
print '<td>' . $langs->trans("Name") . '</td>'; print '<td>' . $langs->trans("Name") . '</td>';
print '<td>' . $langs->trans("Description") . '</td>'; print '<td>' . $langs->trans("Description") . '</td>';
print '<td align="center" width="60">' . $langs->trans("Status") . "</td>\n"; print '<td class="center" width="60">' . $langs->trans("Status") . "</td>\n";
print "</tr>\n"; print "</tr>\n";
print '<tr class="oddeven"><td width="100">'; print '<tr class="oddeven"><td width="100">';
@ -414,7 +414,7 @@ print $langs->trans('AutoReportLastAccountStatement');
print '</td>'; print '</td>';
// Active // Active
if ($conf->global->BANK_REPORT_LAST_NUM_RELEVE) { if ($conf->global->BANK_REPORT_LAST_NUM_RELEVE) {
print '<td align="center">' . "\n"; print '<td class="center">' . "\n";
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=unsetreportlastnumreleve">'; print '<a href="' . $_SERVER["PHP_SELF"] . '?action=unsetreportlastnumreleve">';
print img_picto($langs->trans("Enabled"), 'switch_on'); print img_picto($langs->trans("Enabled"), 'switch_on');
print '</a>'; print '</a>';
@ -422,7 +422,7 @@ if ($conf->global->BANK_REPORT_LAST_NUM_RELEVE) {
} }
else else
{ {
print '<td align="center">' . "\n"; print '<td class="center">' . "\n";
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=setreportlastnumreleve">' . img_picto($langs->trans("Disabled"), print '<a href="' . $_SERVER["PHP_SELF"] . '?action=setreportlastnumreleve">' . img_picto($langs->trans("Disabled"),
'switch_off') . '</a>'; 'switch_off') . '</a>';
print "</td>"; print "</td>";

View File

@ -199,8 +199,8 @@ print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Name").'</td>'; print '<td>'.$langs->trans("Name").'</td>';
print '<td>'.$langs->trans("Description").'</td>'; print '<td>'.$langs->trans("Description").'</td>';
print '<td width="200" align="center">'.$langs->trans("Example").'</td>'; print '<td width="200" class="center">'.$langs->trans("Example").'</td>';
print '<td align="center" width="60">'.$langs->trans("CodeBarGenerator").'</td>'; print '<td class="center" width="60">'.$langs->trans("CodeBarGenerator").'</td>';
print "</tr>\n"; print "</tr>\n";
$sql = "SELECT rowid, code as encoding, libelle, coder, example"; $sql = "SELECT rowid, code as encoding, libelle, coder, example";
@ -229,7 +229,7 @@ if ($resql)
print '</td>'; print '</td>';
// Show example // Show example
print '<td align="center">'; print '<td class="center">';
if ($obj->coder && $obj->coder != -1) if ($obj->coder && $obj->coder != -1)
{ {
$result=0; $result=0;
@ -277,7 +277,7 @@ if ($resql)
} }
print '</td>'; print '</td>';
print '<td align="center">'; print '<td class="center">';
print $formbarcode->setBarcodeEncoder($obj->coder, $barcodelist, $obj->rowid, 'form'.$i); print $formbarcode->setBarcodeEncoder($obj->coder, $barcodelist, $obj->rowid, 'form'.$i);
print "</td></tr>\n"; print "</td></tr>\n";
@ -307,7 +307,7 @@ print "<input type=\"hidden\" name=\"action\" value=\"update\">";
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>'; print '<td>'.$langs->trans("Parameter").'</td>';
print '<td width="60" align="center">'.$langs->trans("Value").'</td>'; print '<td width="60" class="center">'.$langs->trans("Value").'</td>';
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
print '</tr>'; print '</tr>';
@ -317,7 +317,7 @@ if (! isset($_SERVER['WINDIR']))
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$langs->trans("GenbarcodeLocation").'</td>'; print '<td>'.$langs->trans("GenbarcodeLocation").'</td>';
print '<td width="60" align="center">'; print '<td width="60" class="center">';
print '<input type="text" size="40" name="GENBARCODE_LOCATION" value="'.$conf->global->GENBARCODE_LOCATION.'">'; print '<input type="text" size="40" name="GENBARCODE_LOCATION" value="'.$conf->global->GENBARCODE_LOCATION.'">';
if (! empty($conf->global->GENBARCODE_LOCATION) && ! @file_exists($conf->global->GENBARCODE_LOCATION)) if (! empty($conf->global->GENBARCODE_LOCATION) && ! @file_exists($conf->global->GENBARCODE_LOCATION))
{ {
@ -369,8 +369,8 @@ if ($conf->produit->enabled)
print '<td width="140">'.$langs->trans("Name").'</td>'; print '<td width="140">'.$langs->trans("Name").'</td>';
print '<td>'.$langs->trans("Description").'</td>'; print '<td>'.$langs->trans("Description").'</td>';
print '<td>'.$langs->trans("Example").'</td>'; print '<td>'.$langs->trans("Example").'</td>';
print '<td align="center" width="80">'.$langs->trans("Status").'</td>'; print '<td class="center" width="80">'.$langs->trans("Status").'</td>';
print '<td align="center" width="60">'.$langs->trans("ShortInfo").'</td>'; print '<td class="center" width="60">'.$langs->trans("ShortInfo").'</td>';
print "</tr>\n"; print "</tr>\n";
$dirbarcodenum=array_merge(array('/core/modules/barcode/'), $conf->modules_parts['barcode']); $dirbarcodenum=array_merge(array('/core/modules/barcode/'), $conf->modules_parts['barcode']);
@ -406,17 +406,17 @@ if ($conf->produit->enabled)
if ($conf->global->BARCODE_PRODUCT_ADDON_NUM == "$file") if ($conf->global->BARCODE_PRODUCT_ADDON_NUM == "$file")
{ {
print '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setbarcodeproductoff&amp;value='.$file.'">'; print '<td class="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setbarcodeproductoff&amp;value='.$file.'">';
print img_picto($langs->trans("Activated"), 'switch_on'); print img_picto($langs->trans("Activated"), 'switch_on');
print '</a></td>'; print '</a></td>';
} }
else else
{ {
print '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setbarcodeproducton&amp;value='.$file.'">'; print '<td class="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setbarcodeproducton&amp;value='.$file.'">';
print img_picto($langs->trans("Disabled"), 'switch_off'); print img_picto($langs->trans("Disabled"), 'switch_off');
print '</a></td>'; print '</a></td>';
} }
print '<td align="center">'; print '<td class="center">';
$s=$modBarCode->getToolTip($langs, null, -1); $s=$modBarCode->getToolTip($langs, null, -1);
print $form->textwithpicto('', $s, 1); print $form->textwithpicto('', $s, 1);
print '</td>'; print '</td>';

View File

@ -337,7 +337,7 @@ print '<tr class="liste_titre">';
print '<td width="300">'.$langs->trans("Box").'</td>'; print '<td width="300">'.$langs->trans("Box").'</td>';
print '<td>'.$langs->trans("Note").'/'.$langs->trans("Parameters").'</td>'; print '<td>'.$langs->trans("Note").'/'.$langs->trans("Parameters").'</td>';
print '<td>'.$langs->trans("SourceFile").'</td>'; print '<td>'.$langs->trans("SourceFile").'</td>';
print '<td width="160" align="center">'.$langs->trans("ActivateOn").'</td>'; print '<td width="160" class="center">'.$langs->trans("ActivateOn").'</td>';
print "</tr>\n"; print "</tr>\n";
foreach($boxtoadd as $box) foreach($boxtoadd as $box)
@ -398,9 +398,9 @@ print '<table class="tagtable liste">'."\n";
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td width="300">'.$langs->trans("Box").'</td>'; print '<td width="300">'.$langs->trans("Box").'</td>';
print '<td>'.$langs->trans("Note").'/'.$langs->trans("Parameters").'</td>'; print '<td>'.$langs->trans("Note").'/'.$langs->trans("Parameters").'</td>';
print '<td align="center" width="160">'.$langs->trans("ActiveOn").'</td>'; print '<td class="center" width="160">'.$langs->trans("ActiveOn").'</td>';
print '<td align="center" width="60" colspan="2">'.$langs->trans("PositionByDefault").'</td>'; print '<td class="center" width="60" colspan="2">'.$langs->trans("PositionByDefault").'</td>';
print '<td align="center" width="80">'.$langs->trans("Disable").'</td>'; print '<td class="center" width="80">'.$langs->trans("Disable").'</td>';
print '</tr>'."\n"; print '</tr>'."\n";
$box_order=1; $box_order=1;
@ -429,15 +429,15 @@ foreach($boxactivated as $key => $box)
} }
else print ($box->note?$box->note:'&nbsp;'); else print ($box->note?$box->note:'&nbsp;');
print '</td>'; print '</td>';
print '<td align="center">' . (empty($pos_name[$box->position])?'':$langs->trans($pos_name[$box->position])) . '</td>'; print '<td class="center">' . (empty($pos_name[$box->position])?'':$langs->trans($pos_name[$box->position])) . '</td>';
$hasnext=($key < (count($boxactivated)-1)); $hasnext=($key < (count($boxactivated)-1));
$hasprevious=($key != 0); $hasprevious=($key != 0);
print '<td align="center">'.($key+1).'</td>'; print '<td class="center">'.($key+1).'</td>';
print '<td align="center">'; print '<td class="center">';
print ($hasnext?'<a href="boxes.php?action=switch&amp;switchfrom='.$box->rowid.'&amp;switchto='.$boxactivated[$key+1]->rowid.'">'.img_down().'</a>&nbsp;':''); print ($hasnext?'<a href="boxes.php?action=switch&amp;switchfrom='.$box->rowid.'&amp;switchto='.$boxactivated[$key+1]->rowid.'">'.img_down().'</a>&nbsp;':'');
print ($hasprevious?'<a href="boxes.php?action=switch&amp;switchfrom='.$box->rowid.'&amp;switchto='.$boxactivated[$key-1]->rowid.'">'.img_up().'</a>':''); print ($hasprevious?'<a href="boxes.php?action=switch&amp;switchfrom='.$box->rowid.'&amp;switchto='.$boxactivated[$key-1]->rowid.'">'.img_up().'</a>':'');
print '</td>'; print '</td>';
print '<td align="center">'; print '<td class="center">';
print '<a href="boxes.php?rowid='.$box->rowid.'&amp;action=delete">'.img_delete().'</a>'; print '<a href="boxes.php?rowid='.$box->rowid.'&amp;action=delete">'.img_delete().'</a>';
print '</td>'; print '</td>';

View File

@ -116,8 +116,8 @@ print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Name").'</td>'; print '<td>'.$langs->trans("Name").'</td>';
print '<td>'.$langs->trans("Description").'</td>'; print '<td>'.$langs->trans("Description").'</td>';
print '<td class="nowrap">'.$langs->trans("Example").'</td>'; print '<td class="nowrap">'.$langs->trans("Example").'</td>';
print '<td align="center" width="60">'.$langs->trans("Status").'</td>'; print '<td class="center" width="60">'.$langs->trans("Status").'</td>';
print '<td align="center" width="16">'.$langs->trans("ShortInfo").'</td>'; print '<td class="center" width="16">'.$langs->trans("ShortInfo").'</td>';
print '</tr>'."\n"; print '</tr>'."\n";
clearstatcache(); clearstatcache();
@ -177,7 +177,7 @@ foreach ($dirmodels as $reldir)
else print $tmp; else print $tmp;
print '</td>'."\n"; print '</td>'."\n";
print '<td align="center">'; print '<td class="center">';
if ($conf->global->CHEQUERECEIPTS_ADDON == $file || $conf->global->CHEQUERECEIPTS_ADDON.'.php' == $file) if ($conf->global->CHEQUERECEIPTS_ADDON == $file || $conf->global->CHEQUERECEIPTS_ADDON.'.php' == $file)
{ {
print img_picto($langs->trans("Activated"), 'switch_on'); print img_picto($langs->trans("Activated"), 'switch_on');
@ -206,7 +206,7 @@ foreach ($dirmodels as $reldir)
} }
} }
print '<td align="center">'; print '<td class="center">';
print $form->textwithpicto('', $htmltooltip, 1, 0); print $form->textwithpicto('', $htmltooltip, 1, 0);
if ($conf->global->CHEQUERECEIPTS_ADDON.'.php' == $file) // If module is the one used, we show existing errors if ($conf->global->CHEQUERECEIPTS_ADDON.'.php' == $file) // If module is the one used, we show existing errors
@ -244,7 +244,7 @@ print '<input type="hidden" name="action" value="set_BANK_CHEQUERECEIPT_FREE_TEX
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameters").'</td>'; print '<td>'.$langs->trans("Parameters").'</td>';
print '<td align="center" width="60">&nbsp;</td>'; print '<td class="center" width="60">&nbsp;</td>';
print '<td width="80">&nbsp;</td>'; print '<td width="80">&nbsp;</td>';
print "</tr>\n"; print "</tr>\n";

View File

@ -267,8 +267,8 @@ print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Name").'</td>'; print '<td>'.$langs->trans("Name").'</td>';
print '<td>'.$langs->trans("Description").'</td>'; print '<td>'.$langs->trans("Description").'</td>';
print '<td class="nowrap">'.$langs->trans("Example").'</td>'; print '<td class="nowrap">'.$langs->trans("Example").'</td>';
print '<td align="center" width="60">'.$langs->trans("Status").'</td>'; print '<td class="center" width="60">'.$langs->trans("Status").'</td>';
print '<td align="center" width="16">'.$langs->trans("ShortInfo").'</td>'; print '<td class="center" width="16">'.$langs->trans("ShortInfo").'</td>';
print '</tr>'."\n"; print '</tr>'."\n";
clearstatcache(); clearstatcache();
@ -312,7 +312,7 @@ foreach ($dirmodels as $reldir)
else print $tmp; else print $tmp;
print '</td>'."\n"; print '</td>'."\n";
print '<td align="center">'; print '<td class="center">';
if ($conf->global->COMMANDE_ADDON == $file) if ($conf->global->COMMANDE_ADDON == $file)
{ {
print img_picto($langs->trans("Activated"), 'switch_on'); print img_picto($langs->trans("Activated"), 'switch_on');
@ -344,7 +344,7 @@ foreach ($dirmodels as $reldir)
} }
} }
print '<td align="center">'; print '<td class="center">';
print $form->textwithpicto('', $htmltooltip, 1, 0); print $form->textwithpicto('', $htmltooltip, 1, 0);
print '</td>'; print '</td>';
@ -393,10 +393,10 @@ print "<table class=\"noborder\" width=\"100%\">\n";
print "<tr class=\"liste_titre\">\n"; print "<tr class=\"liste_titre\">\n";
print '<td>'.$langs->trans("Name").'</td>'; print '<td>'.$langs->trans("Name").'</td>';
print '<td>'.$langs->trans("Description").'</td>'; print '<td>'.$langs->trans("Description").'</td>';
print '<td align="center" width="60">'.$langs->trans("Status")."</td>\n"; print '<td class="center" width="60">'.$langs->trans("Status")."</td>\n";
print '<td align="center" width="60">'.$langs->trans("Default")."</td>\n"; print '<td class="center" width="60">'.$langs->trans("Default")."</td>\n";
print '<td align="center" width="38">'.$langs->trans("ShortInfo").'</td>'; print '<td class="center" width="38">'.$langs->trans("ShortInfo").'</td>';
print '<td align="center" width="38">'.$langs->trans("Preview").'</td>'; print '<td class="center" width="38">'.$langs->trans("Preview").'</td>';
print "</tr>\n"; print "</tr>\n";
clearstatcache(); clearstatcache();
@ -449,7 +449,7 @@ foreach ($dirmodels as $reldir)
// Active // Active
if (in_array($name, $def)) if (in_array($name, $def))
{ {
print '<td align="center">'."\n"; print '<td class="center">'."\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'">'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'">';
print img_picto($langs->trans("Enabled"), 'switch_on'); print img_picto($langs->trans("Enabled"), 'switch_on');
print '</a>'; print '</a>';
@ -457,13 +457,13 @@ foreach ($dirmodels as $reldir)
} }
else else
{ {
print '<td align="center">'."\n"; print '<td class="center">'."\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
print "</td>"; print "</td>";
} }
// Default // Default
print '<td align="center">'; print '<td class="center">';
if ($conf->global->COMMANDE_ADDON_PDF == $name) if ($conf->global->COMMANDE_ADDON_PDF == $name)
{ {
print img_picto($langs->trans("Default"), 'on'); print img_picto($langs->trans("Default"), 'on');
@ -491,12 +491,12 @@ foreach ($dirmodels as $reldir)
$htmltooltip.='<br>'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1); $htmltooltip.='<br>'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1);
print '<td align="center">'; print '<td class="center">';
print $form->textwithpicto('', $htmltooltip, 1, 0); print $form->textwithpicto('', $htmltooltip, 1, 0);
print '</td>'; print '</td>';
// Preview // Preview
print '<td align="center">'; print '<td class="center">';
if ($module->type == 'pdf') if ($module->type == 'pdf')
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'bill').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'bill').'</a>';
@ -528,7 +528,7 @@ print load_fiche_titre($langs->trans("OtherOptions"), '', '');
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>'; print '<td>'.$langs->trans("Parameter").'</td>';
print '<td align="center" width="60">'.$langs->trans("Value").'</td>'; print '<td class="center" width="60">'.$langs->trans("Value").'</td>';
print "<td>&nbsp;</td>\n"; print "<td>&nbsp;</td>\n";
print "</tr>\n"; print "</tr>\n";
@ -580,7 +580,7 @@ Whet is definition of "shippable" according to all different STOCK_CALCULATE_...
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$langs->trans("ShippableOrderIconInList").'</td>'; print '<td>'.$langs->trans("ShippableOrderIconInList").'</td>';
print '<td>&nbsp</td>'; print '<td>&nbsp</td>';
print '<td align="center">'; print '<td class="center">';
if (!empty($conf->global->SHIPPABLE_ORDER_ICON_IN_LIST)) { if (!empty($conf->global->SHIPPABLE_ORDER_ICON_IN_LIST)) {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=setshippableiconinlist&value=0">'; print '<a href="'.$_SERVER['PHP_SELF'].'?action=setshippableiconinlist&value=0">';
print img_picto($langs->trans("Activated"),'switch_on'); print img_picto($langs->trans("Activated"),'switch_on');
@ -598,7 +598,7 @@ if ($conf->banque->enabled)
{ {
print '<tr class="oddeven"><td>'; print '<tr class="oddeven"><td>';
print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_ORDER").'</td><td>&nbsp</td><td align="center">'; print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_ORDER").'</td><td>&nbsp</td><td class="center">';
if (! empty($conf->use_javascript_ajax)) if (! empty($conf->use_javascript_ajax))
{ {
print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_ORDER'); print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_ORDER');
@ -620,7 +620,7 @@ else
{ {
print '<tr class="oddeven"><td>'; print '<tr class="oddeven"><td>';
print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_ORDER").'</td><td>&nbsp;</td><td align="center">'.$langs->trans('NotAvailable').'</td></tr>'; print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_ORDER").'</td><td>&nbsp;</td><td class="center">'.$langs->trans('NotAvailable').'</td></tr>';
} }
// Ask for warehouse during order // Ask for warehouse during order
@ -628,7 +628,7 @@ if ($conf->stock->enabled)
{ {
print '<tr class="oddeven"><td>'; print '<tr class="oddeven"><td>';
print $langs->trans("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER").'</td><td>&nbsp</td><td align="center">'; print $langs->trans("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER").'</td><td>&nbsp</td><td class="center">';
if (! empty($conf->use_javascript_ajax)) if (! empty($conf->use_javascript_ajax))
{ {
print ajax_constantonoff('WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER'); print ajax_constantonoff('WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER');
@ -650,7 +650,7 @@ else
{ {
print '<tr class="oddeven"><td>'; print '<tr class="oddeven"><td>';
print $langs->trans("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER").'</td><td>&nbsp;</td><td align="center">'.$langs->trans('NotAvailable').'</td></tr>'; print $langs->trans("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER").'</td><td>&nbsp;</td><td class="center">'.$langs->trans('NotAvailable').'</td></tr>';
} }
*/ */
@ -666,7 +666,7 @@ print load_fiche_titre($langs->trans("Notifications"), '', '');
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>'; print '<td>'.$langs->trans("Parameter").'</td>';
print '<td align="center" width="60"></td>'; print '<td class="center" width="60"></td>';
print '<td width="80">&nbsp;</td>'; print '<td width="80">&nbsp;</td>';
print "</tr>\n"; print "</tr>\n";

View File

@ -190,7 +190,7 @@ print '<td>'.$langs->trans("Name").'</td>';
print '<td>'.$langs->trans("Value").'</td>'; print '<td>'.$langs->trans("Value").'</td>';
print '<td>'.$langs->trans("Comment").'</td>'; print '<td>'.$langs->trans("Comment").'</td>';
if (! empty($conf->multicompany->enabled) && !$user->entity) print '<td>'.$langs->trans("Entity").'</td>'; if (! empty($conf->multicompany->enabled) && !$user->entity) print '<td>'.$langs->trans("Entity").'</td>';
print '<td align="center">'.$langs->trans("Action").'</td>'; print '<td class="center">'.$langs->trans("Action").'</td>';
print "</tr>\n"; print "</tr>\n";
@ -210,11 +210,11 @@ if (! empty($conf->multicompany->enabled) && !$user->entity)
print '<td>'; print '<td>';
print '<input type="text" class="flat" size="1" name="entity" value="'.$conf->entity.'">'; print '<input type="text" class="flat" size="1" name="entity" value="'.$conf->entity.'">';
print '</td>'; print '</td>';
print '<td align="center">'; print '<td class="center">';
} }
else else
{ {
print '<td align="center">'; print '<td class="center">';
print '<input type="hidden" name="entity" value="'.$conf->entity.'">'; print '<input type="hidden" name="entity" value="'.$conf->entity.'">';
} }
print '<input type="submit" class="button" value="'.$langs->trans("Add").'" name="add">'; print '<input type="submit" class="button" value="'.$langs->trans("Add").'" name="add">';
@ -273,11 +273,11 @@ if ($result)
print '<td>'; print '<td>';
print '<input type="text" class="flat" size="1" name="const['.$i.'][entity]" value="'.$obj->entity.'">'; print '<input type="text" class="flat" size="1" name="const['.$i.'][entity]" value="'.$obj->entity.'">';
print '</td>'; print '</td>';
print '<td align="center">'; print '<td class="center">';
} }
else else
{ {
print '<td align="center">'; print '<td class="center">';
print '<input type="hidden" name="const['.$i.'][entity]" value="'.$obj->entity.'">'; print '<input type="hidden" name="const['.$i.'][entity]" value="'.$obj->entity.'">';
} }

View File

@ -204,8 +204,8 @@ print '<tr class="liste_titre">';
print '<td width="100">'.$langs->trans("Name").'</td>'; print '<td width="100">'.$langs->trans("Name").'</td>';
print '<td>'.$langs->trans("Description").'</td>'; print '<td>'.$langs->trans("Description").'</td>';
print '<td>'.$langs->trans("Example").'</td>'; print '<td>'.$langs->trans("Example").'</td>';
print '<td align="center" width="60">'.$langs->trans("Status").'</td>'; print '<td class="center" width="60">'.$langs->trans("Status").'</td>';
print '<td align="center" width="16">'.$langs->trans("ShortInfo").'</td>'; print '<td class="center" width="16">'.$langs->trans("ShortInfo").'</td>';
print "</tr>\n"; print "</tr>\n";
clearstatcache(); clearstatcache();
@ -249,7 +249,7 @@ foreach ($dirmodels as $reldir)
else print $tmp; else print $tmp;
print '</td>'."\n"; print '</td>'."\n";
print '<td align="center">'; print '<td class="center">';
if ($conf->global->CONTRACT_ADDON == "$file") if ($conf->global->CONTRACT_ADDON == "$file")
{ {
print img_picto($langs->trans("Activated"), 'switch_on'); print img_picto($langs->trans("Activated"), 'switch_on');
@ -280,7 +280,7 @@ foreach ($dirmodels as $reldir)
} }
} }
print '<td align="center">'; print '<td class="center">';
print $form->textwithpicto('', $htmltooltip, 1, 0); print $form->textwithpicto('', $htmltooltip, 1, 0);
print '</td>'; print '</td>';
@ -329,10 +329,10 @@ print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Name").'</td>'; print '<td>'.$langs->trans("Name").'</td>';
print '<td>'.$langs->trans("Description").'</td>'; print '<td>'.$langs->trans("Description").'</td>';
print '<td align="center" width="60">'.$langs->trans("Status")."</td>\n"; print '<td class="center" width="60">'.$langs->trans("Status")."</td>\n";
print '<td align="center" width="60">'.$langs->trans("Default")."</td>\n"; print '<td class="center" width="60">'.$langs->trans("Default")."</td>\n";
print '<td align="center" width="80">'.$langs->trans("ShortInfo").'</td>'; print '<td class="center" width="80">'.$langs->trans("ShortInfo").'</td>';
print '<td align="center" width="80">'.$langs->trans("Preview").'</td>'; print '<td class="center" width="80">'.$langs->trans("Preview").'</td>';
print "</tr>\n"; print "</tr>\n";
clearstatcache(); clearstatcache();
@ -384,7 +384,7 @@ foreach ($dirmodels as $reldir)
// Active // Active
if (in_array($name, $def)) if (in_array($name, $def))
{ {
print '<td align="center">'."\n"; print '<td class="center">'."\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'">'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'">';
print img_picto($langs->trans("Enabled"), 'switch_on'); print img_picto($langs->trans("Enabled"), 'switch_on');
print '</a>'; print '</a>';
@ -392,13 +392,13 @@ foreach ($dirmodels as $reldir)
} }
else else
{ {
print '<td align="center">'."\n"; print '<td class="center">'."\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
print "</td>"; print "</td>";
} }
// Defaut // Defaut
print '<td align="center">'; print '<td class="center">';
if ($conf->global->CONTRACT_ADDON_PDF == $name) if ($conf->global->CONTRACT_ADDON_PDF == $name)
{ {
print img_picto($langs->trans("Default"), 'on'); print img_picto($langs->trans("Default"), 'on');
@ -424,12 +424,12 @@ foreach ($dirmodels as $reldir)
$htmltooltip.='<br>'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1); $htmltooltip.='<br>'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1);
print '<td align="center">'; print '<td class="center">';
print $form->textwithpicto('', $htmltooltip, 1, 0); print $form->textwithpicto('', $htmltooltip, 1, 0);
print '</td>'; print '</td>';
// Preview // Preview
print '<td align="center">'; print '<td class="center">';
if ($module->type == 'pdf') if ($module->type == 'pdf')
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'contract').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'contract').'</a>';
@ -466,7 +466,7 @@ print load_fiche_titre($langs->trans("OtherOptions"), '', '');
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>'; print '<td>'.$langs->trans("Parameter").'</td>';
print '<td align="center" width="60">'.$langs->trans("Value").'</td>'; print '<td class="center" width="60">'.$langs->trans("Value").'</td>';
print "</tr>\n"; print "</tr>\n";
$substitutionarray=pdf_getSubstitutionArray($langs, array('objectamount'), null, 2); $substitutionarray=pdf_getSubstitutionArray($langs, array('objectamount'), null, 2);

View File

@ -322,11 +322,11 @@ if (! empty($conf->multicompany->enabled) && !$user->entity)
} }
else else
{ {
print '<td align="center">'; print '<td class="center">';
print '<input type="hidden" name="entity" value="'.$conf->entity.'">'; print '<input type="hidden" name="entity" value="'.$conf->entity.'">';
print '</td>'; print '</td>';
} }
print '<td align="center">'; print '<td class="center">';
$disabled=''; $disabled='';
if (empty($conf->global->MAIN_ENABLE_DEFAULT_VALUES)) $disabled=' disabled="disabled"'; if (empty($conf->global->MAIN_ENABLE_DEFAULT_VALUES)) $disabled=' disabled="disabled"';
print '<input type="submit" class="button"'.$disabled.' value="'.$langs->trans("Add").'" name="add">'; print '<input type="submit" class="button"'.$disabled.' value="'.$langs->trans("Add").'" name="add">';
@ -385,7 +385,7 @@ if ($result)
print '<td></td>'; print '<td></td>';
// Actions // Actions
print '<td align="center">'; print '<td class="center">';
if ($action != 'edit' || GETPOST('rowid') != $obj->rowid) if ($action != 'edit' || GETPOST('rowid') != $obj->rowid)
{ {
print '<a href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$obj->entity.'&mode='.$mode.'&action=edit'.((empty($user->entity) && $debug)?'&debug=1':'').'">'.img_edit().'</a>'; print '<a href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$obj->entity.'&mode='.$mode.'&action=edit'.((empty($user->entity) && $debug)?'&debug=1':'').'">'.img_edit().'</a>';

View File

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

View File

@ -77,8 +77,8 @@ print '<br>';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Description").'</td>'; print '<td>'.$langs->trans("Description").'</td>';
print '<td align="center" width="20">&nbsp;</td>'; print '<td class="center" width="20">&nbsp;</td>';
print '<td align="center" width="100">'.$langs->trans("Value").'</td>'."\n"; print '<td class="center" width="100">'.$langs->trans("Value").'</td>'."\n";
print '</tr>'; print '</tr>';
$form = new Form($db); $form = new Form($db);
@ -87,9 +87,9 @@ $form = new Form($db);
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$langs->trans("ECMAutoTree").'</td>'; print '<td>'.$langs->trans("ECMAutoTree").'</td>';
print '<td align="center" width="20">&nbsp;</td>'; print '<td class="center" width="20">&nbsp;</td>';
print '<td align="center" width="100">'; print '<td class="center" width="100">';
if ($conf->use_javascript_ajax) if ($conf->use_javascript_ajax)
{ {
print ajax_constantonoff('ECM_AUTO_TREE_ENABLED'); print ajax_constantonoff('ECM_AUTO_TREE_ENABLED');

View File

@ -412,7 +412,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
$parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder); $parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder);
$reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint; print $hookmanager->resPrint;
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ')."\n"; print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
print '</tr>'."\n"; print '</tr>'."\n";
@ -480,7 +480,7 @@ while ($i < min($num, $limit))
$reshook=$hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint; print $hookmanager->resPrint;
// Action column // Action column
print '<td class="nowrap" align="center">'; print '<td class="nowrap center">';
if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
{ {
$selected=0; $selected=0;

View File

@ -154,6 +154,13 @@ if ($mode == 'setup' && $user->admin)
$urltodelete=''; $urltodelete='';
$urltocheckperms=''; $urltocheckperms='';
} }
elseif ($key[0] == 'OAUTH_STRIPE_LIVE_NAME')
{
$OAUTH_SERVICENAME='StripeLive';
$urltorenew=$urlwithroot.'/core/modules/oauth/stripelive_oauthcallback.php?backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php');
$urltodelete='';
$urltocheckperms='';
}
else else
{ {
$urltorenew=''; $urltorenew='';

View File

@ -409,12 +409,12 @@ print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print "<td>".$langs->trans("Other")."</td>\n"; print "<td>".$langs->trans("Other")."</td>\n";
print '<td align="center">'.$langs->trans("Status").'</td>'."\n"; print '<td class="center">'.$langs->trans("Status").'</td>'."\n";
print '</tr>'."\n"; print '</tr>'."\n";
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$langs->trans("UserWarehouseAutoCreate").'</td>'; print '<td>'.$langs->trans("UserWarehouseAutoCreate").'</td>';
print '<td align="center">'; print '<td class="center">';
if ($conf->use_javascript_ajax) { if ($conf->use_javascript_ajax) {
print ajax_constantonoff('STOCK_USERSTOCK_AUTOCREATE'); print ajax_constantonoff('STOCK_USERSTOCK_AUTOCREATE');
} else { } else {
@ -428,7 +428,7 @@ print '<tr class="oddeven">';
print '<td>'; print '<td>';
print $form->textwithpicto($langs->trans("StockSupportServices"), $langs->trans("StockSupportServicesDesc")); print $form->textwithpicto($langs->trans("StockSupportServices"), $langs->trans("StockSupportServicesDesc"));
print '</td>'; print '</td>';
print '<td align="center">'; print '<td class="center">';
if ($conf->use_javascript_ajax) { if ($conf->use_javascript_ajax) {
print ajax_constantonoff('STOCK_SUPPORTS_SERVICES'); print ajax_constantonoff('STOCK_SUPPORTS_SERVICES');
} else { } else {
@ -440,7 +440,7 @@ print "</tr>\n";
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$langs->trans("AllowAddLimitStockByWarehouse").'</td>'; print '<td>'.$langs->trans("AllowAddLimitStockByWarehouse").'</td>';
print '<td align="center">'; print '<td class="center">';
if ($conf->use_javascript_ajax) { if ($conf->use_javascript_ajax) {
print ajax_constantonoff('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE'); print ajax_constantonoff('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE');
} else { } else {
@ -451,10 +451,9 @@ print "</td>\n";
print "</tr>\n"; print "</tr>\n";
if (! empty($conf->fournisseur->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)) { if (! empty($conf->fournisseur->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)) {
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$langs->trans("UseDispatchStatus").'</td>'; print '<td>'.$langs->trans("UseDispatchStatus").'</td>';
print '<td class="right">'; print '<td class="center">';
if ($conf->use_javascript_ajax) { if ($conf->use_javascript_ajax) {
print ajax_constantonoff('SUPPLIER_ORDER_USE_DISPATCH_STATUS'); print ajax_constantonoff('SUPPLIER_ORDER_USE_DISPATCH_STATUS');
} else { } else {

View File

@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
$action = GETPOST('action', 'alpha'); $action = GETPOST('action', 'alpha');
$obj_facturation = unserialize($_SESSION['serObjFacturation']); $obj_facturation = unserialize($_SESSION['serObjFacturation']);
unset ($_SESSION['serObjFacturation']); unset($_SESSION['serObjFacturation']);
switch($action) switch($action)

View File

@ -359,7 +359,7 @@ switch ($action)
// End of case: valide_facture // End of case: valide_facture
} }
unset ($_SESSION['serObjFacturation']); unset($_SESSION['serObjFacturation']);
$_SESSION['serObjFacturation'] = serialize($obj_facturation); $_SESSION['serObjFacturation'] = serialize($obj_facturation);

View File

@ -220,7 +220,7 @@ class Categories extends DolibarrApi
if ($this->category->update(DolibarrApiAccess::$user) > 0) if ($this->category->update(DolibarrApiAccess::$user) > 0)
{ {
return $this->get ($id); return $this->get($id);
} }
else else
{ {

View File

@ -1472,8 +1472,7 @@ class Categorie extends CommonObject
// We want to reverse lookup // We want to reverse lookup
$map_type = array_flip($this->MAP_ID); $map_type = array_flip($this->MAP_ID);
$type = $map_type[$type]; $type = $map_type[$type];
dol_syslog( get_class($this) . "::rechercher(): numeric types are deprecated, please use string instead", dol_syslog(get_class($this) . "::rechercher(): numeric types are deprecated, please use string instead", LOG_WARNING);
LOG_WARNING );
} }
// Generation requete recherche // Generation requete recherche

View File

@ -423,12 +423,15 @@ class AdvanceTargetingMailing extends CommonObject
$this->db->begin(); $this->db->begin();
dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG); dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG);
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } if (! $resql) {
$error++;
$this->errors[]="Error ".$this->db->lasterror();
}
if (! $error) //if (! $error)
{ //{
if (! $notrigger) // if (! $notrigger)
{ // {
// Uncomment this and change MYOBJECT to your own tag if you // Uncomment this and change MYOBJECT to your own tag if you
// want this action calls a trigger. // want this action calls a trigger.
@ -438,8 +441,8 @@ class AdvanceTargetingMailing extends CommonObject
//$result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf); //$result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf);
//if ($result < 0) { $error++; $this->errors=$interface->errors; } //if ($result < 0) { $error++; $this->errors=$interface->errors; }
//// End call triggers //// End call triggers
} // }
} //}
// Commit or rollback // Commit or rollback
if ($error) if ($error)
@ -790,15 +793,15 @@ class AdvanceTargetingMailing extends CommonObject
if (!empty($arrayquery['options_'.$key.'_end_dt'.'_cnct'])){ if (!empty($arrayquery['options_'.$key.'_end_dt'.'_cnct'])){
$sqlwhere[]= " (te.".$key." >= '".$this->db->idate($arrayquery['options_'.$key.'_st_dt'.'_cnct'])."' AND te.".$key." <= '".$this->db->idate($arrayquery['options_'.$key.'_end_dt'.'_cnct'])."')"; $sqlwhere[]= " (te.".$key." >= '".$this->db->idate($arrayquery['options_'.$key.'_st_dt'.'_cnct'])."' AND te.".$key." <= '".$this->db->idate($arrayquery['options_'.$key.'_end_dt'.'_cnct'])."')";
} }
}elseif ($extrafields->attribute_type[$key] == 'boolean') { } elseif ($extrafields->attribute_type[$key] == 'boolean') {
if ($arrayquery['options_'.$key.'_cnct']!=''){ if ($arrayquery['options_'.$key.'_cnct']!=''){
if ($arrayquery['options_'.$key.'_cnct']==0) { if ($arrayquery['options_'.$key.'_cnct']==0) {
$sqlwhere[]= " (te.".$key." = ".$arrayquery['options_'.$key.'_cnct']." OR ((te.".$key." IS NULL) AND (te.fk_object IS NOT NULL)))"; $sqlwhere[]= " (te.".$key." = ".$arrayquery['options_'.$key.'_cnct']." OR ((te.".$key." IS NULL) AND (te.fk_object IS NOT NULL)))";
}else { } else {
$sqlwhere[]= " (te.".$key." = ".$arrayquery['options_'.$key.'_cnct'].")"; $sqlwhere[]= " (te.".$key." = ".$arrayquery['options_'.$key.'_cnct'].")";
} }
} }
}else{ } else {
if (is_array($arrayquery['options_'.$key.'_cnct'])) { if (is_array($arrayquery['options_'.$key.'_cnct'])) {
$sqlwhere[]= " (te.".$key." IN ('".implode("','", $arrayquery['options_'.$key.'_cnct'])."'))"; $sqlwhere[]= " (te.".$key." IN ('".implode("','", $arrayquery['options_'.$key.'_cnct'])."'))";
} elseif (!empty($arrayquery['options_'.$key.'_cnct'])) { } elseif (!empty($arrayquery['options_'.$key.'_cnct'])) {
@ -965,12 +968,12 @@ class AdvanceTargetingMailing extends CommonObject
} }
if (count($return_sql_like)>0) { if (count($return_sql_like)>0) {
$return_sql_criteria .= '(' . implode (' OR ', $return_sql_like) .')'; $return_sql_criteria .= '(' . implode(' OR ', $return_sql_like) .')';
} }
if (count($return_sql_not_like)>0) { if (count($return_sql_not_like)>0) {
$return_sql_criteria .= ' AND (' . implode (' AND ', $return_sql_not_like).')'; $return_sql_criteria .= ' AND (' . implode(' AND ', $return_sql_not_like).')';
} }
}else { } else {
$return_sql_criteria .= $column_to_test . ' LIKE \''.$this->db->escape($criteria).'\''; $return_sql_criteria .= $column_to_test . ' LIKE \''.$this->db->escape($criteria).'\'';
} }

View File

@ -1,5 +1,6 @@
<?php <?php
/* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro> /* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -43,10 +44,10 @@ class FormAdvTargetEmailing extends Form
*/ */
function __construct($db) function __construct($db)
{ {
global $langs; global $langs;
$this->db = $db; $this->db = $db;
} }
/** /**
* Affiche un champs select contenant une liste * Affiche un champs select contenant une liste
@ -64,7 +65,7 @@ class FormAdvTargetEmailing extends Form
$sql .= " FROM " . MAIN_DB_PREFIX . "c_prospectlevel"; $sql .= " FROM " . MAIN_DB_PREFIX . "c_prospectlevel";
$sql .= " WHERE active > 0"; $sql .= " WHERE active > 0";
$sql .= " ORDER BY sortorder"; $sql .= " ORDER BY sortorder";
dol_syslog (get_class($this) . '::multiselectProspectionStatus sql=' . $sql, LOG_DEBUG); dol_syslog(get_class($this) . '::multiselectProspectionStatus sql=' . $sql, LOG_DEBUG);
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) { if ($resql) {
$num = $this->db->num_rows($resql); $num = $this->db->num_rows($resql);
@ -83,7 +84,7 @@ class FormAdvTargetEmailing extends Form
dol_print_error($this->db); dol_print_error($this->db);
} }
return $this->advMultiselectarray($htmlname, $options_array, $selected_array); return $this->advMultiselectarray($htmlname, $options_array, $selected_array);
} }
/** /**
* Return combo list of activated countries, into language of user * Return combo list of activated countries, into language of user
@ -120,10 +121,10 @@ class FormAdvTargetEmailing extends Form
$foundselected = false; $foundselected = false;
while ($i < $num) { while ($i < $num) {
$obj = $this->db->fetch_object ($resql); $obj = $this->db->fetch_object($resql);
$countryArray [$i] ['rowid'] = $obj->rowid; $countryArray [$i] ['rowid'] = $obj->rowid;
$countryArray [$i] ['code_iso'] = $obj->code_iso; $countryArray [$i] ['code_iso'] = $obj->code_iso;
$countryArray [$i] ['label'] = ($obj->code_iso && $langs->transnoentitiesnoconv("Country" . $obj->code_iso) != "Country" . $obj->code_iso ? $langs->transnoentitiesnoconv ("Country" . $obj->code_iso) : ($obj->label != '-' ? $obj->label : '')); $countryArray [$i] ['label'] = ($obj->code_iso && $langs->transnoentitiesnoconv("Country" . $obj->code_iso) != "Country" . $obj->code_iso ? $langs->transnoentitiesnoconv("Country" . $obj->code_iso) : ($obj->label != '-' ? $obj->label : ''));
$label[$i] = $countryArray[$i]['label']; $label[$i] = $countryArray[$i]['label'];
$i ++; $i ++;
} }
@ -143,7 +144,7 @@ class FormAdvTargetEmailing extends Form
} }
return $this->advMultiselectarray($htmlname, $options_array, $selected_array); return $this->advMultiselectarray($htmlname, $options_array, $selected_array);
} }
/** /**
* Return select list for categories (to use in form search selectors) * Return select list for categories (to use in form search selectors)
@ -166,26 +167,26 @@ class FormAdvTargetEmailing extends Form
$sql_usr .= " WHERE u2.entity IN (0," . $conf->entity . ")"; $sql_usr .= " WHERE u2.entity IN (0," . $conf->entity . ")";
$sql_usr .= " AND u2.rowid = sc.fk_user "; $sql_usr .= " AND u2.rowid = sc.fk_user ";
if (! empty ($conf->global->USER_HIDE_INACTIVE_IN_COMBOBOX)) if (! empty($conf->global->USER_HIDE_INACTIVE_IN_COMBOBOX))
$sql_usr .= " AND u2.statut<>0 "; $sql_usr .= " AND u2.statut<>0 ";
$sql_usr .= " ORDER BY name ASC"; $sql_usr .= " ORDER BY name ASC";
// print $sql_usr;exit; // print $sql_usr;exit;
$resql_usr = $this->db->query ($sql_usr); $resql_usr = $this->db->query($sql_usr);
if ($resql_usr) { if ($resql_usr) {
while ( $obj_usr = $this->db->fetch_object ($resql_usr) ) { while ( $obj_usr = $this->db->fetch_object($resql_usr) ) {
$label = $obj_usr->firstname . " " . $obj_usr->name . " (" . $obj_usr->login . ')'; $label = $obj_usr->firstname . " " . $obj_usr->name . " (" . $obj_usr->login . ')';
$options_array [$obj_usr->rowid] = $label; $options_array [$obj_usr->rowid] = $label;
} }
$this->db->free ($resql_usr); $this->db->free($resql_usr);
} else { } else {
dol_print_error ($this->db); dol_print_error($this->db);
} }
return $this->advMultiselectarray ($htmlname, $options_array, $selected_array); return $this->advMultiselectarray($htmlname, $options_array, $selected_array);
} }
/** /**
* Return select list for categories (to use in form search selectors) * Return select list for categories (to use in form search selectors)
@ -210,7 +211,7 @@ class FormAdvTargetEmailing extends Form
} }
asort($options_array); asort($options_array);
return $this->advMultiselectarray($htmlname, $options_array, $selected_array); return $this->advMultiselectarray($htmlname, $options_array, $selected_array);
} }
/** /**
* Return multiselect list of entities for extrafeild type sellist * Return multiselect list of entities for extrafeild type sellist
@ -227,8 +228,8 @@ class FormAdvTargetEmailing extends Form
if (is_array($sqlqueryparam)) if (is_array($sqlqueryparam))
{ {
$param_list = array_keys ($sqlqueryparam); $param_list = array_keys($sqlqueryparam);
$InfoFieldList = explode (":", $param_list [0]); $InfoFieldList = explode(":", $param_list [0]);
// 0 1 : tableName // 0 1 : tableName
// 1 2 : label field name Nom du champ contenant le libelle // 1 2 : label field name Nom du champ contenant le libelle
@ -237,8 +238,8 @@ class FormAdvTargetEmailing extends Form
$keyList = 'rowid'; $keyList = 'rowid';
if (count ($InfoFieldList) >= 3) { if (count($InfoFieldList) >= 3) {
if (strpos ($InfoFieldList [3], 'extra.') !== false) { if (strpos($InfoFieldList [3], 'extra.') !== false) {
$keyList = 'main.' . $InfoFieldList [2] . ' as rowid'; $keyList = 'main.' . $InfoFieldList [2] . ' as rowid';
} else { } else {
$keyList = $InfoFieldList [2] . ' as rowid'; $keyList = $InfoFieldList [2] . ' as rowid';
@ -247,10 +248,10 @@ class FormAdvTargetEmailing extends Form
$sql = 'SELECT ' . $keyList . ', ' . $InfoFieldList [1]; $sql = 'SELECT ' . $keyList . ', ' . $InfoFieldList [1];
$sql .= ' FROM ' . MAIN_DB_PREFIX . $InfoFieldList [0]; $sql .= ' FROM ' . MAIN_DB_PREFIX . $InfoFieldList [0];
if (! empty ($InfoFieldList [3])) { if (! empty($InfoFieldList [3])) {
// We have to join on extrafield table // We have to join on extrafield table
if (strpos ($InfoFieldList [3], 'extra') !== false) { if (strpos($InfoFieldList [3], 'extra') !== false) {
$sql .= ' as main, ' . MAIN_DB_PREFIX . $InfoFieldList [0] . '_extrafields as extra'; $sql .= ' as main, ' . MAIN_DB_PREFIX . $InfoFieldList [0] . '_extrafields as extra';
$sql .= ' WHERE extra.fk_object=main.' . $InfoFieldList [2] . ' AND ' . $InfoFieldList [3]; $sql .= ' WHERE extra.fk_object=main.' . $InfoFieldList [2] . ' AND ' . $InfoFieldList [3];
} else { } else {
@ -270,13 +271,13 @@ class FormAdvTargetEmailing extends Form
$i = 0; $i = 0;
if ($num) { if ($num) {
while ( $i < $num ) { while ( $i < $num ) {
$obj = $this->db->fetch_object ($resql); $obj = $this->db->fetch_object($resql);
$labeltoshow = dol_trunc ($obj->$InfoFieldList [1], 90); $labeltoshow = dol_trunc($obj->$InfoFieldList [1], 90);
$options_array[$obj->rowid]=$labeltoshow; $options_array[$obj->rowid]=$labeltoshow;
$i ++; $i ++;
} }
} }
$this->db->free ($resql); $this->db->free($resql);
} }
} }
@ -328,7 +329,7 @@ class FormAdvTargetEmailing extends Form
dol_print_error($this->db); dol_print_error($this->db);
} }
return $this->advMultiselectarray ($htmlname, $options_array, $selected_array); return $this->advMultiselectarray($htmlname, $options_array, $selected_array);
} }
/** /**
@ -347,7 +348,7 @@ class FormAdvTargetEmailing extends Form
$form=new Form($this->db); $form=new Form($this->db);
$return = $form->multiselectarray($htmlname, $options_array, $selected_array, 0, 0, '', 0, 295); $return = $form->multiselectarray($htmlname, $options_array, $selected_array, 0, 0, '', 0, 295);
return $return; return $return;
} }
/** /**
* Return combo list with customer categories * Return combo list with customer categories
@ -438,19 +439,19 @@ class FormAdvTargetEmailing extends Form
$sql .= " WHERE type_element='$type_element'"; $sql .= " WHERE type_element='$type_element'";
$sql .= " ORDER BY c.name"; $sql .= " ORDER BY c.name";
dol_syslog (get_class ($this) . "::".__METHOD__, LOG_DEBUG); dol_syslog(get_class($this) . "::".__METHOD__, LOG_DEBUG);
$resql = $this->db->query ($sql); $resql = $this->db->query($sql);
if ($resql) { if ($resql) {
$out .= '<select id="' . $htmlname . '" class="flat" name="' . $htmlname . '">'; $out .= '<select id="' . $htmlname . '" class="flat" name="' . $htmlname . '">';
if ($showempty) if ($showempty)
$out .= '<option value=""></option>'; $out .= '<option value=""></option>';
$num = $this->db->num_rows ($resql); $num = $this->db->num_rows($resql);
$i = 0; $i = 0;
if ($num) { if ($num) {
while ( $i < $num ) { while ( $i < $num ) {
$obj = $this->db->fetch_object ($resql); $obj = $this->db->fetch_object($resql);
$label = $obj->name; $label = $obj->name;
if (empty($label)) { if (empty($label)) {
$label=$obj->fk_element; $label=$obj->fk_element;
@ -466,9 +467,9 @@ class FormAdvTargetEmailing extends Form
} }
$out .= '</select>'; $out .= '</select>';
} else { } else {
dol_print_error ($this->db); dol_print_error($this->db);
} }
$this->db->free ($resql); $this->db->free($resql);
return $out; return $out;
} }
} }

View File

@ -204,6 +204,11 @@ class Commande extends CommonOrder
public $oldcopy; public $oldcopy;
//! key of module source when order generated from a dedicated module ('cashdesk', 'takepos', ...)
public $module_source;
//! key of pos source ('0', '1', ...)
public $pos_source;
/** /**
* ERR Not enough stock * ERR Not enough stock
*/ */
@ -820,7 +825,7 @@ class Commande extends CommonOrder
$sql.= ", fk_warehouse"; $sql.= ", fk_warehouse";
$sql.= ", remise_absolue, remise_percent"; $sql.= ", remise_absolue, remise_percent";
$sql.= ", fk_incoterms, location_incoterms"; $sql.= ", fk_incoterms, location_incoterms";
$sql.= ", entity"; $sql.= ", entity, module_source, pos_source";
$sql.= ", fk_multicurrency"; $sql.= ", fk_multicurrency";
$sql.= ", multicurrency_code"; $sql.= ", multicurrency_code";
$sql.= ", multicurrency_tx"; $sql.= ", multicurrency_tx";
@ -849,6 +854,8 @@ class Commande extends CommonOrder
$sql.= ", ".(int) $this->fk_incoterms; $sql.= ", ".(int) $this->fk_incoterms;
$sql.= ", '".$this->db->escape($this->location_incoterms)."'"; $sql.= ", '".$this->db->escape($this->location_incoterms)."'";
$sql.= ", ".$conf->entity; $sql.= ", ".$conf->entity;
$sql.= ", ".($this->module_source ? "'".$this->db->escape($this->module_source)."'" : "null");
$sql.= ", ".($this->pos_source != '' ? "'".$this->db->escape($this->pos_source)."'" : "null");
$sql.= ", ".(int) $this->fk_multicurrency; $sql.= ", ".(int) $this->fk_multicurrency;
$sql.= ", '".$this->db->escape($this->multicurrency_code)."'"; $sql.= ", '".$this->db->escape($this->multicurrency_code)."'";
$sql.= ", ".(double) $this->multicurrency_tx; $sql.= ", ".(double) $this->multicurrency_tx;
@ -1633,7 +1640,8 @@ class Commande extends CommonOrder
$sql.= ', c.note_private, c.note_public, c.ref_client, c.ref_ext, c.ref_int, c.model_pdf, c.last_main_doc, c.fk_delivery_address, c.extraparams'; $sql.= ', c.note_private, c.note_public, c.ref_client, c.ref_ext, c.ref_int, c.model_pdf, c.last_main_doc, c.fk_delivery_address, c.extraparams';
$sql.= ', c.fk_incoterms, c.location_incoterms'; $sql.= ', c.fk_incoterms, c.location_incoterms';
$sql.= ", c.fk_multicurrency, c.multicurrency_code, c.multicurrency_tx, c.multicurrency_total_ht, c.multicurrency_total_tva, c.multicurrency_total_ttc"; $sql.= ", c.fk_multicurrency, c.multicurrency_code, c.multicurrency_tx, c.multicurrency_total_ht, c.multicurrency_total_tva, c.multicurrency_total_ttc";
$sql.= ", i.libelle as libelle_incoterms"; $sql.= ", c.module_source, c.pos_source";
$sql.= ", i.libelle as libelle_incoterms";
$sql.= ', p.code as mode_reglement_code, p.libelle as mode_reglement_libelle'; $sql.= ', p.code as mode_reglement_code, p.libelle as mode_reglement_libelle';
$sql.= ', cr.code as cond_reglement_code, cr.libelle as cond_reglement_libelle, cr.libelle_facture as cond_reglement_libelle_doc'; $sql.= ', cr.code as cond_reglement_code, cr.libelle as cond_reglement_libelle, cr.libelle_facture as cond_reglement_libelle_doc';
$sql.= ', ca.code as availability_code, ca.label as availability_label'; $sql.= ', ca.code as availability_code, ca.label as availability_label';
@ -1680,7 +1688,7 @@ class Commande extends CommonOrder
$this->date_commande = $this->db->jdate($obj->date_commande); $this->date_commande = $this->db->jdate($obj->date_commande);
$this->date_creation = $this->db->jdate($obj->date_creation); $this->date_creation = $this->db->jdate($obj->date_creation);
$this->date_validation = $this->db->jdate($obj->date_valid); $this->date_validation = $this->db->jdate($obj->date_valid);
$this->date_modification = $this->db->jdate($obj->tms); $this->date_modification = $this->db->jdate($obj->tms);
$this->remise = $obj->remise; $this->remise = $obj->remise;
$this->remise_percent = $obj->remise_percent; $this->remise_percent = $obj->remise_percent;
$this->remise_absolue = $obj->remise_absolue; $this->remise_absolue = $obj->remise_absolue;
@ -1707,13 +1715,15 @@ class Commande extends CommonOrder
$this->demand_reason_code = $obj->demand_reason_code; $this->demand_reason_code = $obj->demand_reason_code;
$this->date_livraison = $this->db->jdate($obj->date_livraison); $this->date_livraison = $this->db->jdate($obj->date_livraison);
$this->shipping_method_id = ($obj->fk_shipping_method>0)?$obj->fk_shipping_method:null; $this->shipping_method_id = ($obj->fk_shipping_method>0)?$obj->fk_shipping_method:null;
$this->warehouse_id = ($obj->fk_warehouse>0)?$obj->fk_warehouse:null; $this->warehouse_id = ($obj->fk_warehouse>0)?$obj->fk_warehouse:null;
$this->fk_delivery_address = $obj->fk_delivery_address; $this->fk_delivery_address = $obj->fk_delivery_address;
$this->module_source = $obj->module_source;
$this->pos_source = $obj->pos_source;
//Incoterms //Incoterms
$this->fk_incoterms = $obj->fk_incoterms; $this->fk_incoterms = $obj->fk_incoterms;
$this->location_incoterms = $obj->location_incoterms; $this->location_incoterms = $obj->location_incoterms;
$this->libelle_incoterms = $obj->libelle_incoterms; $this->libelle_incoterms = $obj->libelle_incoterms;
// Multicurrency // Multicurrency
$this->fk_multicurrency = $obj->fk_multicurrency; $this->fk_multicurrency = $obj->fk_multicurrency;

View File

@ -106,7 +106,7 @@ if ($action != 'edit')
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>&nbsp;</td><td><input name="label" type="text" size="45"></td>'; print '<td>&nbsp;</td><td><input name="label" type="text" size="45"></td>';
print '<td align="center"><input type="submit" name="add" class="button" value="'.$langs->trans("Add").'"></td>'; print '<td class="center"><input type="submit" name="add" class="button" value="'.$langs->trans("Add").'"></td>';
print '</tr>'; print '</tr>';
} }

View File

@ -832,12 +832,12 @@ if ($mode == 'standard')
$link="<a href='".$_SERVER["PHP_SELF"]."?account=".$account.($_GET["option"]!='all'?'':'&option=all')."&year=".$prevyear."&month=".$prevmonth."'>".img_previous('', 'class="valignbottom"')."</a> ".$langs->trans("Month")." <a href='".$_SERVER["PHP_SELF"]."?account=".$account."&year=".$nextyear."&month=".$nextmonth."'>".img_next('', 'class="valignbottom"')."</a>"; $link="<a href='".$_SERVER["PHP_SELF"]."?account=".$account.($_GET["option"]!='all'?'':'&option=all')."&year=".$prevyear."&month=".$prevmonth."'>".img_previous('', 'class="valignbottom"')."</a> ".$langs->trans("Month")." <a href='".$_SERVER["PHP_SELF"]."?account=".$account."&year=".$nextyear."&month=".$nextmonth."'>".img_next('', 'class="valignbottom"')."</a>";
print '<tr><td class="right">'.$link.'</td></tr>'; print '<tr><td class="right">'.$link.'</td></tr>';
print '<tr><td align="center">'; print '<tr><td class="center">';
$file = "movement".$account."-".$year.$month.".png"; $file = "movement".$account."-".$year.$month.".png";
print $show4; print $show4;
print '</td></tr>'; print '</td></tr>';
print '<tr><td align="center">'; print '<tr><td class="center">';
print $show1; print $show1;
print '</td></tr>'; print '</td></tr>';
@ -846,18 +846,18 @@ if ($mode == 'standard')
$link="<a href='".$_SERVER["PHP_SELF"]."?account=".$account.($_GET["option"]!='all'?'':'&option=all')."&year=".($prevyear)."'>".img_previous('', 'class="valignbottom"')."</a> ".$langs->trans("Year")." <a href='".$_SERVER["PHP_SELF"]."?account=".$account."&year=".($nextyear)."'>".img_next('', 'class="valignbottom"')."</a>"; $link="<a href='".$_SERVER["PHP_SELF"]."?account=".$account.($_GET["option"]!='all'?'':'&option=all')."&year=".($prevyear)."'>".img_previous('', 'class="valignbottom"')."</a> ".$langs->trans("Year")." <a href='".$_SERVER["PHP_SELF"]."?account=".$account."&year=".($nextyear)."'>".img_next('', 'class="valignbottom"')."</a>";
print '<tr><td class="right">'.$link.'</td></tr>'; print '<tr><td class="right">'.$link.'</td></tr>';
print '<tr><td align="center">'; print '<tr><td class="center">';
print $show5; print $show5;
print '</td></tr>'; print '</td></tr>';
print '<tr><td align="center">'; print '<tr><td class="center">';
print $show2; print $show2;
print '</td></tr>'; print '</td></tr>';
} }
if ($mode == 'showalltime') if ($mode == 'showalltime')
{ {
print '<tr><td align="center">'; print '<tr><td class="center">';
print $show3; print $show3;
print '</td></tr>'; print '</td></tr>';
} }

View File

@ -369,7 +369,7 @@ if (! empty($arrayfields['balance']['checked']))
print '<td class="liste_titre"></td>'; print '<td class="liste_titre"></td>';
} }
// Action column // Action column
print '<td class="liste_titre" align="middle">'; print '<td class="liste_titre valignmiddle">';
$searchpicto=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1); $searchpicto=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1);
print $searchpicto; print $searchpicto;
print '</td>'; print '</td>';
@ -383,19 +383,19 @@ if (! empty($arrayfields['accountype']['checked'])) print_liste_field_titr
if (! empty($arrayfields['b.number']['checked'])) print_liste_field_titre($arrayfields['b.number']['label'], $_SERVER["PHP_SELF"], 'b.number', '', $param, '', $sortfield, $sortorder); if (! empty($arrayfields['b.number']['checked'])) print_liste_field_titre($arrayfields['b.number']['label'], $_SERVER["PHP_SELF"], 'b.number', '', $param, '', $sortfield, $sortorder);
if (! empty($arrayfields['b.account_number']['checked'])) print_liste_field_titre($arrayfields['b.account_number']['label'], $_SERVER["PHP_SELF"], 'b.account_number', '', $param, '', $sortfield, $sortorder); if (! empty($arrayfields['b.account_number']['checked'])) print_liste_field_titre($arrayfields['b.account_number']['label'], $_SERVER["PHP_SELF"], 'b.account_number', '', $param, '', $sortfield, $sortorder);
if (! empty($arrayfields['b.fk_accountancy_journal']['checked'])) print_liste_field_titre($arrayfields['b.fk_accountancy_journal']['label'], $_SERVER["PHP_SELF"], 'b.fk_accountancy_journal', '', $param, '', $sortfield, $sortorder); if (! empty($arrayfields['b.fk_accountancy_journal']['checked'])) print_liste_field_titre($arrayfields['b.fk_accountancy_journal']['label'], $_SERVER["PHP_SELF"], 'b.fk_accountancy_journal', '', $param, '', $sortfield, $sortorder);
if (! empty($arrayfields['b.currency_code']['checked'])) print_liste_field_titre($arrayfields['b.currency_code']['label'], $_SERVER["PHP_SELF"], 'b.currency_code', '', $param, 'align="center"', $sortfield, $sortorder); if (! empty($arrayfields['b.currency_code']['checked'])) print_liste_field_titre($arrayfields['b.currency_code']['label'], $_SERVER["PHP_SELF"], 'b.currency_code', '', $param, '', $sortfield, $sortorder, 'center ');
if (! empty($arrayfields['toreconcile']['checked'])) print_liste_field_titre($arrayfields['toreconcile']['label'], $_SERVER["PHP_SELF"], '', '', $param, 'align="center"', $sortfield, $sortorder); if (! empty($arrayfields['toreconcile']['checked'])) print_liste_field_titre($arrayfields['toreconcile']['label'], $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center ');
// Extra fields // Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
// Hook fields // Hook fields
$parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder); $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 $reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint; print $hookmanager->resPrint;
if (! empty($arrayfields['b.datec']['checked'])) print_liste_field_titre($arrayfields['b.datec']['label'], $_SERVER["PHP_SELF"], "b.datec", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder); if (! empty($arrayfields['b.datec']['checked'])) print_liste_field_titre($arrayfields['b.datec']['label'], $_SERVER["PHP_SELF"], "b.datec", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
if (! empty($arrayfields['b.tms']['checked'])) print_liste_field_titre($arrayfields['b.tms']['label'], $_SERVER["PHP_SELF"], "b.tms", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder); if (! empty($arrayfields['b.tms']['checked'])) print_liste_field_titre($arrayfields['b.tms']['label'], $_SERVER["PHP_SELF"], "b.tms", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
if (! empty($arrayfields['b.clos']['checked'])) print_liste_field_titre($arrayfields['b.clos']['label'], $_SERVER["PHP_SELF"], 'b.clos', '', $param, 'align="center"', $sortfield, $sortorder); if (! empty($arrayfields['b.clos']['checked'])) print_liste_field_titre($arrayfields['b.clos']['label'], $_SERVER["PHP_SELF"], 'b.clos', '', $param, '', $sortfield, $sortorder, 'center ');
if (! empty($arrayfields['balance']['checked'])) print_liste_field_titre($arrayfields['balance']['label'], $_SERVER["PHP_SELF"], '', '', $param, 'class="right"', $sortfield, $sortorder); if (! empty($arrayfields['balance']['checked'])) print_liste_field_titre($arrayfields['balance']['label'], $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right ');
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch '); print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
print "</tr>\n"; print "</tr>\n";
@ -492,7 +492,7 @@ foreach ($accounts as $key=>$type)
// Currency // Currency
if (! empty($arrayfields['b.currency_code']['checked'])) if (! empty($arrayfields['b.currency_code']['checked']))
{ {
print '<td align="center">'; print '<td class="center">';
print $obj->currency_code; print $obj->currency_code;
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['nbfield']++;
@ -501,7 +501,7 @@ foreach ($accounts as $key=>$type)
// Transactions to reconcile // Transactions to reconcile
if (! empty($arrayfields['toreconcile']['checked'])) if (! empty($arrayfields['toreconcile']['checked']))
{ {
print '<td align="center">'; print '<td class="center">';
if ($obj->rappro) if ($obj->rappro)
{ {
$result=$obj->load_board($user, $obj->id); $result=$obj->load_board($user, $obj->id);
@ -526,7 +526,7 @@ foreach ($accounts as $key=>$type)
// Date creation // Date creation
if (! empty($arrayfields['b.datec']['checked'])) if (! empty($arrayfields['b.datec']['checked']))
{ {
print '<td align="center">'; print '<td class="center">';
print dol_print_date($obj->date_creation, 'dayhour'); print dol_print_date($obj->date_creation, 'dayhour');
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['nbfield']++;
@ -534,7 +534,7 @@ foreach ($accounts as $key=>$type)
// Date modification // Date modification
if (! empty($arrayfields['b.tms']['checked'])) if (! empty($arrayfields['b.tms']['checked']))
{ {
print '<td align="center">'; print '<td class="center">';
print dol_print_date($obj->date_update, 'dayhour'); print dol_print_date($obj->date_update, 'dayhour');
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['nbfield']++;
@ -543,7 +543,7 @@ foreach ($accounts as $key=>$type)
// Status // Status
if (! empty($arrayfields['b.clos']['checked'])) if (! empty($arrayfields['b.clos']['checked']))
{ {
print '<td align="center">'.$obj->getLibStatut(5).'</td>'; print '<td class="center">'.$obj->getLibStatut(5).'</td>';
if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['nbfield']++;
} }
@ -559,7 +559,7 @@ foreach ($accounts as $key=>$type)
} }
// Action column // Action column
print '<td class="nowrap" align="center">'; print '<td class="nowrap center">';
if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
{ {
$selected=0; $selected=0;

View File

@ -496,7 +496,7 @@ if (empty($numref))
} }
print '<td class="right">'.price(($balancestart[$objp->numr]+$content[$objp->numr]), '', $langs, 1, -1, -1, $conf->currency).'</td>'; print '<td class="right">'.price(($balancestart[$objp->numr]+$content[$objp->numr]), '', $langs, 1, -1, -1, $conf->currency).'</td>';
print '<td align="center">'; print '<td class="center">';
if ($user->rights->banque->consolidate && $action != 'editbankreceipt') { if ($user->rights->banque->consolidate && $action != 'editbankreceipt') {
print '<a href="'.$_SERVER["PHP_SELF"].'?account='.$object->id.'&action=editbankreceipt&brref='.$objp->numr.'">'.img_edit().'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?account='.$object->id.'&action=editbankreceipt&brref='.$objp->numr.'">'.img_edit().'</a>';
} }
@ -540,10 +540,10 @@ else
print '<input type="hidden" name="action" value="add">'; print '<input type="hidden" name="action" value="add">';
print '<div class="div-table-responsive">'; print '<div class="div-table-responsive">';
print '<table class="noborder" width="100%">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td align="center">'.$langs->trans("DateOperationShort").'</td>'; print '<td class="center">'.$langs->trans("DateOperationShort").'</td>';
print '<td align="center">'.$langs->trans("DateValueShort").'</td>'; print '<td class="center">'.$langs->trans("DateValueShort").'</td>';
print '<td>'.$langs->trans("Type").'</td>'; print '<td>'.$langs->trans("Type").'</td>';
print '<td>'.$langs->trans("Description").'</td>'; print '<td>'.$langs->trans("Description").'</td>';
print '<td class="right" width="60">'.$langs->trans("Debit").'</td>'; print '<td class="right" width="60">'.$langs->trans("Debit").'</td>';
@ -589,10 +589,10 @@ else
print '<tr class="oddeven">'; print '<tr class="oddeven">';
// Date operation // Date operation
print '<td class="nowrap" align="center">'.dol_print_date($db->jdate($objp->do), "day").'</td>'; print '<td class="nowrap center">'.dol_print_date($db->jdate($objp->do), "day").'</td>';
// Date de valeur // Date de valeur
print '<td align="center" valign="center" class="nowrap">'; print '<td valign="center" class="center nowrap">';
print dol_print_date($db->jdate($objp->dv), "day") .' '; print dol_print_date($db->jdate($objp->dv), "day") .' ';
print '<a href="releve.php?action=dvprev&amp;num='.$numref.'&amp;account='.$object->id.'&amp;dvid='.$objp->rowid.'">'; print '<a href="releve.php?action=dvprev&amp;num='.$numref.'&amp;account='.$object->id.'&amp;dvid='.$objp->rowid.'">';
print img_edit_remove() . "</a> "; print img_edit_remove() . "</a> ";
@ -778,13 +778,13 @@ else
if ($user->rights->banque->modifier || $user->rights->banque->consolidate) if ($user->rights->banque->modifier || $user->rights->banque->consolidate)
{ {
print '<td align="center"><a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$objp->rowid.'&account='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?account='.$object->id.'&num='.$numref).'">'; print '<td class="center"><a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$objp->rowid.'&account='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?account='.$object->id.'&num='.$numref).'">';
print img_edit(); print img_edit();
print "</a></td>"; print "</a></td>";
} }
else else
{ {
print "<td align=\"center\">&nbsp;</td>"; print "<td class=\"center\">&nbsp;</td>";
} }
print "</tr>"; print "</tr>";
$i++; $i++;
@ -793,11 +793,11 @@ else
} }
// Line Total // Line Total
print "\n".'<tr class="liste_total"><td class="right" colspan="4">'.$langs->trans("Total")." :</td><td align=\"right\">".price($totald)."</td><td align=\"right\">".price($totalc)."</td><td>&nbsp;</td><td>&nbsp;</td></tr>"; print "\n".'<tr class="liste_total"><td class="right" colspan="4">'.$langs->trans("Total")." :</td><td class=\"right\">".price($totald)."</td><td class=\"right\">".price($totalc)."</td><td>&nbsp;</td><td>&nbsp;</td></tr>";
// Line Balance // Line Balance
print "\n<tr>"; print "\n<tr>";
print "<td align=\"right\" colspan=\"3\">&nbsp;</td><td colspan=\"3\"><b>".$langs->trans("EndBankBalance")." :</b></td>"; print "<td class=\"right\" colspan=\"3\">&nbsp;</td><td colspan=\"3\"><b>".$langs->trans("EndBankBalance")." :</b></td>";
print '<td class="right"><b>'.price(price2num($total, 'MT'))."</b></td><td>&nbsp;</td>"; print '<td class="right"><b>'.price(price2num($total, 'MT'))."</b></td><td>&nbsp;</td>";
print "</tr>\n"; print "</tr>\n";
print "</table>"; print "</table>";

View File

@ -180,7 +180,7 @@ if ($result)
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
// Ref // Ref
print '<td class="liste_titre" align="left">'; print '<td class="liste_titre left">';
print '<input class="flat" type="text" size="3" name="search_ref" value="'.dol_escape_htmltag($search_ref).'">'; print '<input class="flat" type="text" size="3" name="search_ref" value="'.dol_escape_htmltag($search_ref).'">';
print '</td>'; print '</td>';
@ -195,7 +195,7 @@ if ($result)
print '</td>'; print '</td>';
// Type // Type
print '<td class="liste_titre" align="left">'; print '<td class="liste_titre left">';
$form->select_types_paiements($typeid, 'typeid', '', 0, 1, 1, 16); $form->select_types_paiements($typeid, 'typeid', '', 0, 1, 1, 16);
print '</td>'; print '</td>';
@ -233,13 +233,13 @@ if ($result)
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "v.rowid", "", $param, "", $sortfield, $sortorder); print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "v.rowid", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "v.label", "", $param, 'align="left"', $sortfield, $sortorder); print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "v.label", "", $param, '', $sortfield, $sortorder, 'left ');
print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "v.datep", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "v.datep", "", $param, '', $sortfield, $sortorder, 'center ');
print_liste_field_titre("PaymentMode", $_SERVER["PHP_SELF"], "type", "", $param, 'align="left"', $sortfield, $sortorder); print_liste_field_titre("PaymentMode", $_SERVER["PHP_SELF"], "type", "", $param, '', $sortfield, $sortorder, 'left ');
if (! empty($conf->banque->enabled)) print_liste_field_titre("BankAccount", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder); if (! empty($conf->banque->enabled)) print_liste_field_titre("BankAccount", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder);
if (! empty($conf->accounting->enabled)) print_liste_field_titre("AccountAccounting", $_SERVER["PHP_SELF"], "v.accountancy_code", "", $param, 'align="left"', $sortfield, $sortorder); if (! empty($conf->accounting->enabled)) print_liste_field_titre("AccountAccounting", $_SERVER["PHP_SELF"], "v.accountancy_code", "", $param, '', $sortfield, $sortorder, 'left ');
print_liste_field_titre("Debit", $_SERVER["PHP_SELF"], "v.amount", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre("Debit", $_SERVER["PHP_SELF"], "v.amount", "", $param, '', $sortfield, $sortorder, 'right ');
print_liste_field_titre("Credit", $_SERVER["PHP_SELF"], "v.amount", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre("Credit", $_SERVER["PHP_SELF"], "v.amount", "", $param, '', $sortfield, $sortorder, 'right ');
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch '); print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch ');
print "</tr>\n"; print "</tr>\n";
@ -300,7 +300,7 @@ if ($result)
} }
// Debit // Debit
print "<td align=\"right\">"; print "<td class=\"right\">";
if ($obj->sens == 0) if ($obj->sens == 0)
{ {
print price($obj->amount); print price($obj->amount);
@ -309,7 +309,7 @@ if ($result)
print "</td>"; print "</td>";
// Credit // Credit
print "<td align=\"right\">"; print "<td class=\"right\">";
if ($obj->sens == 1) if ($obj->sens == 1)
{ {
print price($obj->amount); print price($obj->amount);

View File

@ -146,28 +146,28 @@ if ($resql)
print_liste_field_titre("Company", $_SERVER["PHP_SELF"], "s.nom", "", "", 'valign="center"', $sortfield, $sortorder); print_liste_field_titre("Company", $_SERVER["PHP_SELF"], "s.nom", "", "", 'valign="center"', $sortfield, $sortorder);
print_liste_field_titre("Town", $_SERVER["PHP_SELF"], "s.town", "", "", 'valign="center"', $sortfield, $sortorder); print_liste_field_titre("Town", $_SERVER["PHP_SELF"], "s.town", "", "", 'valign="center"', $sortfield, $sortorder);
print_liste_field_titre("CustomerCode", $_SERVER["PHP_SELF"], "s.code_client", "", "", 'align="left"', $sortfield, $sortorder); print_liste_field_titre("CustomerCode", $_SERVER["PHP_SELF"], "s.code_client", "", "", '', $sortfield, $sortorder, 'left ');
print_liste_field_titre("AccountancyCode", $_SERVER["PHP_SELF"], "s.code_compta", "", "", 'align="left"', $sortfield, $sortorder); print_liste_field_titre("AccountancyCode", $_SERVER["PHP_SELF"], "s.code_compta", "", "", '', $sortfield, $sortorder, 'left ');
print_liste_field_titre("DateCreation", $_SERVER["PHP_SELF"], "datec", $addu, "", 'align="right"', $sortfield, $sortorder); print_liste_field_titre("DateCreation", $_SERVER["PHP_SELF"], "datec", $addu, "", '', $sortfield, $sortorder, 'right ');
print "</tr>\n"; print "</tr>\n";
// Lignes des champs de filtre // Lignes des champs de filtre
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td align="left" class="liste_titre">'; print '<td class="liste_titre left">';
print '<input class="flat" type="text" name="search_nom" value="'.$_GET["search_nom"].'"></td>'; print '<input class="flat" type="text" name="search_nom" value="'.$_GET["search_nom"].'"></td>';
print '<td class="liste_titre">&nbsp;</td>'; print '<td class="liste_titre">&nbsp;</td>';
print '<td align="left" class="liste_titre">'; print '<td class="liste_titre left">';
print '<input class="flat" type="text" size="10" name="search_code_client" value="'.$_GET["search_code_client"].'">'; print '<input class="flat" type="text" size="10" name="search_code_client" value="'.$_GET["search_code_client"].'">';
print '</td>'; print '</td>';
print '<td align="left" class="liste_titre">'; print '<td class="liste_titre left">';
print '<input class="flat" type="text" size="10" name="search_compta" value="'.$_GET["search_compta"].'">'; print '<input class="flat" type="text" size="10" name="search_compta" value="'.$_GET["search_compta"].'">';
print '</td>'; print '</td>';
print '<td align="right" colspan="2" class="liste_titre">'; print '<td colspan="2" class="liste_titre right">';
print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"), 'search.png', '', '', 1).'" name="button_search" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"), 'search.png', '', '', 1).'" name="button_search" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
print '</td>'; print '</td>';
print "</tr>\n"; print "</tr>\n";
@ -186,7 +186,7 @@ if ($resql)
print '<td>'.$obj->town.'&nbsp;</td>'; print '<td>'.$obj->town.'&nbsp;</td>';
print '<td class="left">'.$obj->code_client.'&nbsp;</td>'; print '<td class="left">'.$obj->code_client.'&nbsp;</td>';
print '<td class="left">'.$obj->code_compta.'&nbsp;</td>'; print '<td class="left">'.$obj->code_compta.'&nbsp;</td>';
print '<td align="right">'.dol_print_date($db->jdate($obj->datec)).'</td>'; print '<td class="right">'.dol_print_date($db->jdate($obj->datec)).'</td>';
print "</tr>\n"; print "</tr>\n";
$i++; $i++;
} }

View File

@ -283,7 +283,7 @@ llxHeader('', $title, $help_url);
$h=0; $h=0;
$head[$h][0] = $_SERVER["PHP_SELF"].$varlink; $head[$h][0] = $_SERVER["PHP_SELF"].$varlink;
$head[$h][1] = $langs->trans("AccountancyFiles"); $head[$h][1] = $langs->trans("AccountantFiles");
$head[$h][2] = 'AccountancyFiles'; $head[$h][2] = 'AccountancyFiles';
dol_fiche_head($head, 'AccountancyFiles'); dol_fiche_head($head, 'AccountancyFiles');
@ -374,9 +374,9 @@ if (!empty($date_start) && !empty($date_stop))
print '<td>'.$langs->trans("Ref").'</td>'; print '<td>'.$langs->trans("Ref").'</td>';
print '<td>'.$langs->trans("Link").'</td>'; print '<td>'.$langs->trans("Link").'</td>';
print '<td>'.$langs->trans("Paid").'</td>'; print '<td>'.$langs->trans("Paid").'</td>';
print '<td align="right">'.$langs->trans("Debit").'</td>'; print '<td class="right">'.$langs->trans("Debit").'</td>';
print '<td align="right">'.$langs->trans("Credit").'</td>'; print '<td class="right">'.$langs->trans("Credit").'</td>';
print '<td align="right">'.$langs->trans("Balance").'</td>'; print '<td class="right">'.$langs->trans("Balance").'</td>';
print '</tr>'; print '</tr>';
if ($result) if ($result)
{ {
@ -421,21 +421,21 @@ if (!empty($date_start) && !empty($date_stop))
// File link // File link
print '<td><a href='.DOL_URL_ROOT.'/'.$data['link'].">".$data['name']."</a></td>\n"; print '<td><a href='.DOL_URL_ROOT.'/'.$data['link'].">".$data['name']."</a></td>\n";
print '<td aling="left">'.$data['paid'].'</td>'; print '<td class="left">'.$data['paid'].'</td>';
print '<td align="right">'.(($data['amount'] > 0) ? price(abs($data['amount'])) : '')."</td>\n"; print '<td class="right">'.(($data['amount'] > 0) ? price(abs($data['amount'])) : '')."</td>\n";
$totalDebit += ($data['amount'] > 0) ? abs($data['amount']) : 0; $totalDebit += ($data['amount'] > 0) ? abs($data['amount']) : 0;
print '<td align="right">'.(($data['amount'] > 0) ? '' : price(abs($data['amount'])))."</td>\n"; print '<td class="right">'.(($data['amount'] > 0) ? '' : price(abs($data['amount'])))."</td>\n";
$totalCredit += ($data['amount'] > 0) ? 0 : abs($data['amount']); $totalCredit += ($data['amount'] > 0) ? 0 : abs($data['amount']);
// Balance // Balance
print '<td align="right">'.price($data['balance'])."</td>\n"; print '<td class="right">'.price($data['balance'])."</td>\n";
print "</tr>\n"; print "</tr>\n";
} }
print '<tr class="liste_total">'; print '<tr class="liste_total">';
print '<td colspan="5">&nbsp;</td>'; print '<td colspan="5">&nbsp;</td>';
print '<td align="right">'.price($totalDebit).'</td>'; print '<td class="right">'.price($totalDebit).'</td>';
print '<td align="right">'.price($totalCredit).'</td>'; print '<td class="right">'.price($totalCredit).'</td>';
print '<td align="right">'.price(price2num($totalDebit - $totalCredit, 'MT')).'</td>'; print '<td class="right">'.price(price2num($totalDebit - $totalCredit, 'MT')).'</td>';
print "</tr>\n"; print "</tr>\n";
} }
} }

View File

@ -920,6 +920,123 @@ class Invoices extends DolibarrApi
return $this->_cleanObjectDatas($this->invoice); return $this->_cleanObjectDatas($this->invoice);
} }
/**
* Create a discount (credit available) for a credit note or a deposit.
*
* @param int $id Invoice ID
* @url POST {id}/markAsCreditAvailable
*
* @return array An invoice object
*
* @throws 200
* @throws 304
* @throws 401
* @throws 404
* @throws 500
*/
function markAsCreditAvailable($id)
{
if(! DolibarrApiAccess::$user->rights->facture->creer) {
throw new RestException(401);
}
$result = $this->invoice->fetch($id);
if( ! $result ) {
throw new RestException(404, 'Invoice not found');
}
if( ! DolibarrApi::_checkAccessToResource('facture', $this->invoice->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
$result = $this->invoice->fetch_thirdparty();
if( ! $result ) {
throw new RestException(404, 'Thirdparty not found');
}
if (! $this->invoice->paye) // protection against multiple submit
{
$this->db->begin();
$this->invoice->fetch_lines();
$amount_ht = $amount_tva = $amount_ttc = array();
// Loop on each vat rate
$i=0;
$amount_ht = array();
$amount_tva = array();
$amount_ttc = array();
foreach($this->invoice->lines as $line)
{
$amount_ht[$line->tva_tx]+=$line->total_ht;
$amount_tva[$line->tva_tx]+=$line->total_tva;
$amount_ttc[$line->tva_tx]+=$line->total_ttc;
$i++;
}
// Insert one discount by VAT rate category
$discount = new DiscountAbsolute($this->db);
if ($this->invoice->type == 2) $discount->description='(CREDIT_NOTE)';
elseif ($this->invoice->type == 3) $discount->description='(DEPOSIT)';
else {
$this->error="CantConvertToReducAnInvoiceOfThisType";
return -1;
}
$discount->tva_tx=abs($this->invoice->total_ttc);
$discount->fk_soc=$this->invoice->socid;
$discount->fk_facture_source=$this->invoice->id;
$error=0;
foreach($amount_ht as $tva_tx => $xxx)
{
$discount->amount_ht=abs($amount_ht[$tva_tx]);
$discount->amount_tva=abs($amount_tva[$tva_tx]);
$discount->amount_ttc=abs($amount_ttc[$tva_tx]);
$discount->tva_tx=abs($tva_tx);
$result=$discount->create(DolibarrApiAccess::$user);
if ($result < 0)
{
$error++;
break;
}
}
if (! $error)
{
// Classe facture
$result=$this->invoice->set_paid(DolibarrApiAccess::$user);
if ($result > 0)
{
//$mesg='OK'.$discount->id;
$this->db->commit();
}
else
{
$this->db->rollback();
throw new RestException(500, 'Could not set paid');
}
}
else
{
$this->db->rollback();
throw new RestException(500, 'Discount creation error');
}
}
$result = $this->invoice->fetch($id);
if( ! $result ) {
throw new RestException(404, 'Invoice not found');
}
if( ! DolibarrApi::_checkAccessToResource('facture', $this->invoice->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
return $this->_cleanObjectDatas($this->invoice);
}
/** /**
* Add a discount line into an invoice (as an invoice line) using an existing absolute discount * Add a discount line into an invoice (as an invoice line) using an existing absolute discount
* *

View File

@ -1120,6 +1120,9 @@ class Facture extends CommonInvoice
$this->note_private = $object->note_private; $this->note_private = $object->note_private;
$this->note_public = $object->note_public; $this->note_public = $object->note_public;
$this->module_source = $object->module_source;
$this->pos_source = $object->pos_source;
$this->origin = $object->element; $this->origin = $object->element;
$this->origin_id = $object->id; $this->origin_id = $object->id;
@ -1324,6 +1327,7 @@ class Facture extends CommonInvoice
$sql.= ', p.code as mode_reglement_code, p.libelle as mode_reglement_libelle'; $sql.= ', p.code as mode_reglement_code, p.libelle as mode_reglement_libelle';
$sql.= ', c.code as cond_reglement_code, c.libelle as cond_reglement_libelle, c.libelle_facture as cond_reglement_libelle_doc'; $sql.= ', c.code as cond_reglement_code, c.libelle as cond_reglement_libelle, c.libelle_facture as cond_reglement_libelle_doc';
$sql.= ', f.fk_incoterms, f.location_incoterms'; $sql.= ', f.fk_incoterms, f.location_incoterms';
$sql.= ', f.module_source, f.pos_source';
$sql.= ", i.libelle as libelle_incoterms"; $sql.= ", i.libelle as libelle_incoterms";
$sql.= ' FROM '.MAIN_DB_PREFIX.'facture as f'; $sql.= ' FROM '.MAIN_DB_PREFIX.'facture as f';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_payment_term as c ON f.fk_cond_reglement = c.rowid'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_payment_term as c ON f.fk_cond_reglement = c.rowid';
@ -1357,7 +1361,7 @@ class Facture extends CommonInvoice
$this->date_pointoftax = $this->db->jdate($obj->date_pointoftax); $this->date_pointoftax = $this->db->jdate($obj->date_pointoftax);
$this->date_creation = $this->db->jdate($obj->datec); $this->date_creation = $this->db->jdate($obj->datec);
$this->date_validation = $this->db->jdate($obj->datev); $this->date_validation = $this->db->jdate($obj->datev);
$this->date_modification = $this->db->jdate($obj->datem); $this->date_modification = $this->db->jdate($obj->datem);
$this->datem = $this->db->jdate($obj->datem); $this->datem = $this->db->jdate($obj->datem);
$this->remise_percent = $obj->remise_percent; $this->remise_percent = $obj->remise_percent;
$this->remise_absolue = $obj->remise_absolue; $this->remise_absolue = $obj->remise_absolue;
@ -1396,9 +1400,12 @@ class Facture extends CommonInvoice
$this->extraparams = (array) json_decode($obj->extraparams, true); $this->extraparams = (array) json_decode($obj->extraparams, true);
//Incoterms //Incoterms
$this->fk_incoterms = $obj->fk_incoterms; $this->fk_incoterms = $obj->fk_incoterms;
$this->location_incoterms = $obj->location_incoterms; $this->location_incoterms = $obj->location_incoterms;
$this->libelle_incoterms = $obj->libelle_incoterms; $this->libelle_incoterms = $obj->libelle_incoterms;
$this->module_source = $obj->module_source;
$this->pos_source = $obj->pos_source;
// Multicurrency // Multicurrency
$this->fk_multicurrency = $obj->fk_multicurrency; $this->fk_multicurrency = $obj->fk_multicurrency;
@ -2650,7 +2657,7 @@ class Facture extends CommonInvoice
* @return int <0 if KO, Id of line if OK * @return int <0 if KO, Id of line if OK
*/ */
function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $fk_product = 0, $remise_percent = 0, $date_start = '', $date_end = '', $ventil = 0, $info_bits = 0, $fk_remise_except = '', $price_base_type = 'HT', $pu_ttc = 0, $type = self::TYPE_STANDARD, $rang = -1, $special_code = 0, $origin = '', $origin_id = 0, $fk_parent_line = 0, $fk_fournprice = null, $pa_ht = 0, $label = '', $array_options = 0, $situation_percent = 100, $fk_prev_id = 0, $fk_unit = null, $pu_ht_devise = 0) function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $fk_product = 0, $remise_percent = 0, $date_start = '', $date_end = '', $ventil = 0, $info_bits = 0, $fk_remise_except = '', $price_base_type = 'HT', $pu_ttc = 0, $type = self::TYPE_STANDARD, $rang = -1, $special_code = 0, $origin = '', $origin_id = 0, $fk_parent_line = 0, $fk_fournprice = null, $pa_ht = 0, $label = '', $array_options = 0, $situation_percent = 100, $fk_prev_id = 0, $fk_unit = null, $pu_ht_devise = 0)
{ {
// Deprecation warning // Deprecation warning
if ($label) { if ($label) {
dol_syslog(__METHOD__ . ": using line label is deprecated", LOG_WARNING); dol_syslog(__METHOD__ . ": using line label is deprecated", LOG_WARNING);

View File

@ -200,14 +200,14 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
print '<td class="nowrap">'; print '<td class="nowrap">';
print $companystatic->getNomUrl(1, 'customer', 16); print $companystatic->getNomUrl(1, 'customer', 16);
print '</td>'; print '</td>';
print '<td align="right" class="nowrap">'.price($obj->total_ttc).'</td>'; print '<td class="nowrap right">'.price($obj->total_ttc).'</td>';
print '</tr>'; print '</tr>';
$tot_ttc+=$obj->total_ttc; $tot_ttc+=$obj->total_ttc;
$i++; $i++;
} }
print '<tr class="liste_total"><td class="left">'.$langs->trans("Total").'</td>'; print '<tr class="liste_total"><td class="left">'.$langs->trans("Total").'</td>';
print '<td colspan="2" align="right">'.price($tot_ttc).'</td>'; print '<td colspan="2" class="right">'.price($tot_ttc).'</td>';
print '</tr>'; print '</tr>';
} }
else else
@ -287,14 +287,14 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
print '<td>'; print '<td>';
print $companystatic->getNomUrl(1, 'supplier', 16); print $companystatic->getNomUrl(1, 'supplier', 16);
print '</td>'; print '</td>';
print '<td align="right">'.price($obj->total_ttc).'</td>'; print '<td class="right">'.price($obj->total_ttc).'</td>';
print '</tr>'; print '</tr>';
$tot_ttc+=$obj->total_ttc; $tot_ttc+=$obj->total_ttc;
$i++; $i++;
} }
print '<tr class="liste_total"><td class="left">'.$langs->trans("Total").'</td>'; print '<tr class="liste_total"><td class="left">'.$langs->trans("Total").'</td>';
print '<td colspan="2" align="right">'.price($tot_ttc).'</td>'; print '<td colspan="2" class="right">'.price($tot_ttc).'</td>';
print '</tr>'; print '</tr>';
} }
else else
@ -353,9 +353,9 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("BoxTitleLastCustomerBills", $max).'</th>'; print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("BoxTitleLastCustomerBills", $max).'</th>';
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<th align="right">'.$langs->trans("AmountHT").'</th>'; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<th class="right">'.$langs->trans("AmountHT").'</th>';
print '<th align="right">'.$langs->trans("AmountTTC").'</th>'; print '<th class="right">'.$langs->trans("AmountTTC").'</th>';
print '<th align="right">'.$langs->trans("DateModificationShort").'</th>'; print '<th class="right">'.$langs->trans("DateModificationShort").'</th>';
print '<th width="16">&nbsp;</th>'; print '<th width="16">&nbsp;</th>';
print '</tr>'; print '</tr>';
if ($num) if ($num)
@ -398,7 +398,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
print img_warning($langs->trans("Late")); print img_warning($langs->trans("Late"));
} }
print '</td>'; print '</td>';
print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">'; print '<td width="16" class="nobordernopadding hideonsmartphone right">';
$filename=dol_sanitizeFileName($obj->ref); $filename=dol_sanitizeFileName($obj->ref);
$filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($obj->ref); $filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($obj->ref);
$urlsource=$_SERVER['PHP_SELF'].'?facid='.$obj->rowid; $urlsource=$_SERVER['PHP_SELF'].'?facid='.$obj->rowid;
@ -409,9 +409,9 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
print '<td class="left">'; print '<td class="left">';
print $thirdpartystatic->getNomUrl(1, 'customer', 44); print $thirdpartystatic->getNomUrl(1, 'customer', 44);
print '</td>'; print '</td>';
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($obj->total_ht).'</td>'; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td class="right">'.price($obj->total_ht).'</td>';
print '<td align="right">'.price($obj->total_ttc).'</td>'; print '<td class="right">'.price($obj->total_ttc).'</td>';
print '<td align="right">'.dol_print_date($db->jdate($obj->tms), 'day').'</td>'; print '<td class="right">'.dol_print_date($db->jdate($obj->tms), 'day').'</td>';
print '<td>'.$facstatic->LibStatut($obj->paye, $obj->fk_statut, 3, $obj->am).'</td>'; print '<td>'.$facstatic->LibStatut($obj->paye, $obj->fk_statut, 3, $obj->am).'</td>';
print '</tr>'; print '</tr>';
@ -474,9 +474,9 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("BoxTitleLastSupplierBills", $max).'</th>'; print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("BoxTitleLastSupplierBills", $max).'</th>';
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<th align="right">'.$langs->trans("AmountHT").'</th>'; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<th class="right">'.$langs->trans("AmountHT").'</th>';
print '<th align="right">'.$langs->trans("AmountTTC").'</th>'; print '<th class="right">'.$langs->trans("AmountTTC").'</th>';
print '<th align="right">'.$langs->trans("DateModificationShort").'</th>'; print '<th class="right">'.$langs->trans("DateModificationShort").'</th>';
print '<th width="16">&nbsp;</th>'; print '<th width="16">&nbsp;</th>';
print "</tr>\n"; print "</tr>\n";
if ($num) if ($num)
@ -507,9 +507,9 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
print '<td>'; print '<td>';
print $thirdpartystatic->getNomUrl(1, 'supplier', 44); print $thirdpartystatic->getNomUrl(1, 'supplier', 44);
print '</td>'; print '</td>';
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($obj->total_ht).'</td>'; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td class="right">'.price($obj->total_ht).'</td>';
print '<td align="right">'.price($obj->total_ttc).'</td>'; print '<td class="right">'.price($obj->total_ttc).'</td>';
print '<td align="right">'.dol_print_date($db->jdate($obj->tms), 'day').'</td>'; print '<td class="right">'.dol_print_date($db->jdate($obj->tms), 'day').'</td>';
print '<td>'.$facstatic->LibStatut($obj->paye, $obj->fk_statut, 3).'</td>'; print '<td>'.$facstatic->LibStatut($obj->paye, $obj->fk_statut, 3).'</td>';
print '</tr>'; print '</tr>';
$total += $obj->total_ht; $total += $obj->total_ht;
@ -565,8 +565,8 @@ if (! empty($conf->don->enabled) && $user->rights->societe->lire)
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<th>'.$langs->trans("BoxTitleLastModifiedDonations", $max).'</th>'; print '<th>'.$langs->trans("BoxTitleLastModifiedDonations", $max).'</th>';
print '<th></th>'; print '<th></th>';
print '<th align="right">'.$langs->trans("AmountTTC").'</th>'; print '<th class="right">'.$langs->trans("AmountTTC").'</th>';
print '<th align="right">'.$langs->trans("DateModificationShort").'</th>'; print '<th class="right">'.$langs->trans("DateModificationShort").'</th>';
print '<th width="16">&nbsp;</th>'; print '<th width="16">&nbsp;</th>';
print '</tr>'; print '</tr>';
if ($num) if ($num)
@ -588,8 +588,8 @@ if (! empty($conf->don->enabled) && $user->rights->societe->lire)
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$donationstatic->getNomUrl(1).'</td>'; print '<td>'.$donationstatic->getNomUrl(1).'</td>';
print '<td>'.$label.'</td>'; print '<td>'.$label.'</td>';
print '<td align="right">'.price($objp->amount).'</td>'; print '<td class="right">'.price($objp->amount).'</td>';
print '<td align="right">'.dol_print_date($db->jdate($objp->dm), 'day').'</td>'; print '<td class="right">'.dol_print_date($db->jdate($objp->dm), 'day').'</td>';
print '<td>'.$donationstatic->LibStatut($objp->fk_statut, 3).'</td>'; print '<td>'.$donationstatic->LibStatut($objp->fk_statut, 3).'</td>';
print '</tr>'; print '</tr>';
@ -638,8 +638,8 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<th>'.$langs->trans("ContributionsToPay").($num?' <a href="'.DOL_URL_ROOT.'/compta/sociales/list.php?status=0"><span class="badge">'.$num.'</span></a>':'').'</th>'; print '<th>'.$langs->trans("ContributionsToPay").($num?' <a href="'.DOL_URL_ROOT.'/compta/sociales/list.php?status=0"><span class="badge">'.$num.'</span></a>':'').'</th>';
print '<th align="center">'.$langs->trans("DateDue").'</th>'; print '<th align="center">'.$langs->trans("DateDue").'</th>';
print '<th align="right">'.$langs->trans("AmountTTC").'</th>'; print '<th class="right">'.$langs->trans("AmountTTC").'</th>';
print '<th align="right">'.$langs->trans("Paid").'</th>'; print '<th class="right">'.$langs->trans("Paid").'</th>';
print '<th align="center" width="16">&nbsp;</th>'; print '<th align="center" width="16">&nbsp;</th>';
print '</tr>'; print '</tr>';
if ($num) if ($num)
@ -658,18 +658,18 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$chargestatic->getNomUrl(1).'</td>'; print '<td>'.$chargestatic->getNomUrl(1).'</td>';
print '<td align="center">'.dol_print_date($db->jdate($obj->date_ech), 'day').'</td>'; print '<td align="center">'.dol_print_date($db->jdate($obj->date_ech), 'day').'</td>';
print '<td align="right">'.price($obj->amount).'</td>'; print '<td class="right">'.price($obj->amount).'</td>';
print '<td align="right">'.price($obj->sumpaid).'</td>'; print '<td class="right">'.price($obj->sumpaid).'</td>';
print '<td align="center">'.$chargestatic->getLibStatut(3).'</td>'; print '<td align="center">'.$chargestatic->getLibStatut(3).'</td>';
print '</tr>'; print '</tr>';
$tot_ttc+=$obj->amount; $tot_ttc+=$obj->amount;
$i++; $i++;
} }
print '<tr class="liste_total"><td align="left" colspan="2">'.$langs->trans("Total").'</td>'; print '<tr class="liste_total"><td class="left" colspan="2">'.$langs->trans("Total").'</td>';
print '<td align="right">'.price($tot_ttc).'</td>'; print '<td class="right">'.price($tot_ttc).'</td>';
print '<td align="right"></td>'; print '<td class="right"></td>';
print '<td align="right">&nbsp;</td>'; print '<td class="right">&nbsp;</td>';
print '</tr>'; print '</tr>';
} }
else else
@ -729,9 +729,9 @@ if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $us
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print "<tr class=\"liste_titre\">"; print "<tr class=\"liste_titre\">";
print '<th colspan="2">'.$langs->trans("OrdersDeliveredToBill").' <a href="'.DOL_URL_ROOT.'/commande/list.php?viewstatut=3&amp;billed=0"><span class="badge">'.$num.'</span></a></th>'; print '<th colspan="2">'.$langs->trans("OrdersDeliveredToBill").' <a href="'.DOL_URL_ROOT.'/commande/list.php?viewstatut=3&amp;billed=0"><span class="badge">'.$num.'</span></a></th>';
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<th align="right">'.$langs->trans("AmountHT").'</th>'; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<th class="right">'.$langs->trans("AmountHT").'</th>';
print '<th align="right">'.$langs->trans("AmountTTC").'</th>'; print '<th class="right">'.$langs->trans("AmountTTC").'</th>';
print '<th align="right">'.$langs->trans("ToBill").'</th>'; print '<th class="right">'.$langs->trans("ToBill").'</th>';
print '<th align="center" width="16">&nbsp;</th>'; print '<th align="center" width="16">&nbsp;</th>';
print '</tr>'; print '</tr>';
@ -765,7 +765,7 @@ if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $us
print '<td width="20" class="nobordernopadding nowrap">'; print '<td width="20" class="nobordernopadding nowrap">';
print '&nbsp;'; print '&nbsp;';
print '</td>'; print '</td>';
print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">'; print '<td width="16" class="nobordernopadding hideonsmartphone right">';
$filename=dol_sanitizeFileName($obj->ref); $filename=dol_sanitizeFileName($obj->ref);
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref); $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
@ -777,9 +777,9 @@ if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $us
print '<td class="left">'; print '<td class="left">';
print $societestatic->getNomUrl(1, 'customer', 44); print $societestatic->getNomUrl(1, 'customer', 44);
print '</td>'; print '</td>';
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($obj->total_ht).'</td>'; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td class="right">'.price($obj->total_ht).'</td>';
print '<td align="right">'.price($obj->total_ttc).'</td>'; print '<td class="right">'.price($obj->total_ttc).'</td>';
print '<td align="right">'.price($obj->total_ttc-$obj->tot_fttc).'</td>'; print '<td class="right">'.price($obj->total_ttc-$obj->tot_fttc).'</td>';
print '<td>'.$commandestatic->LibStatut($obj->fk_statut, $obj->facture, 3).'</td>'; print '<td>'.$commandestatic->LibStatut($obj->fk_statut, $obj->facture, 3).'</td>';
print '</tr>'; print '</tr>';
$tot_ht += $obj->total_ht; $tot_ht += $obj->total_ht;
@ -790,9 +790,9 @@ if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $us
} }
print '<tr class="liste_total"><td colspan="2">'.$langs->trans("Total").' &nbsp; <font style="font-weight: normal">('.$langs->trans("RemainderToBill").': '.price($tot_tobill).')</font> </td>'; print '<tr class="liste_total"><td colspan="2">'.$langs->trans("Total").' &nbsp; <font style="font-weight: normal">('.$langs->trans("RemainderToBill").': '.price($tot_tobill).')</font> </td>';
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($tot_ht).'</td>'; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td class="right">'.price($tot_ht).'</td>';
print '<td align="right">'.price($tot_ttc).'</td>'; print '<td class="right">'.price($tot_ttc).'</td>';
print '<td align="right">'.price($tot_tobill).'</td>'; print '<td class="right">'.price($tot_tobill).'</td>';
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
print '</tr>'; print '</tr>';
print '</table><br>'; print '</table><br>';
@ -844,10 +844,10 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("BillsCustomersUnpaid", $num).' <a href="'.DOL_URL_ROOT.'/compta/facture/list.php?search_status=1"><span class="badge">'.$num.'</span></a></th>'; print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("BillsCustomersUnpaid", $num).' <a href="'.DOL_URL_ROOT.'/compta/facture/list.php?search_status=1"><span class="badge">'.$num.'</span></a></th>';
print '<th align="right">'.$langs->trans("DateDue").'</th>'; print '<th class="right">'.$langs->trans("DateDue").'</th>';
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<th align="right">'.$langs->trans("AmountHT").'</th>'; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<th class="right">'.$langs->trans("AmountHT").'</th>';
print '<th align="right">'.$langs->trans("AmountTTC").'</th>'; print '<th class="right">'.$langs->trans("AmountTTC").'</th>';
print '<th align="right">'.$langs->trans("Received").'</th>'; print '<th class="right">'.$langs->trans("Received").'</th>';
print '<th width="16">&nbsp;</th>'; print '<th width="16">&nbsp;</th>';
print '</tr>'; print '</tr>';
if ($num) if ($num)
@ -890,7 +890,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
print img_warning($langs->trans("Late")); print img_warning($langs->trans("Late"));
} }
print '</td>'; print '</td>';
print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">'; print '<td width="16" class="nobordernopadding hideonsmartphone right">';
$filename=dol_sanitizeFileName($obj->ref); $filename=dol_sanitizeFileName($obj->ref);
$filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($obj->ref); $filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($obj->ref);
$urlsource=$_SERVER['PHP_SELF'].'?facid='.$obj->rowid; $urlsource=$_SERVER['PHP_SELF'].'?facid='.$obj->rowid;
@ -901,10 +901,10 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
print '<td class="left">' ; print '<td class="left">' ;
print $societestatic->getNomUrl(1, 'customer', 44); print $societestatic->getNomUrl(1, 'customer', 44);
print '</td>'; print '</td>';
print '<td align="right">'.dol_print_date($db->jdate($obj->datelimite), 'day').'</td>'; print '<td class="right">'.dol_print_date($db->jdate($obj->datelimite), 'day').'</td>';
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($obj->total_ht).'</td>'; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td class="right">'.price($obj->total_ht).'</td>';
print '<td align="right">'.price($obj->total_ttc).'</td>'; print '<td class="right">'.price($obj->total_ttc).'</td>';
print '<td align="right">'.price($obj->am).'</td>'; print '<td class="right">'.price($obj->am).'</td>';
print '<td>'.$facstatic->LibStatut($obj->paye, $obj->fk_statut, 3, $obj->am).'</td>'; print '<td>'.$facstatic->LibStatut($obj->paye, $obj->fk_statut, 3, $obj->am).'</td>';
print '</tr>'; print '</tr>';
@ -917,9 +917,9 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
print '<tr class="liste_total"><td colspan="2">'.$langs->trans("Total").' &nbsp; <font style="font-weight: normal">('.$langs->trans("RemainderToTake").': '.price($total_ttc-$totalam).')</font> </td>'; print '<tr class="liste_total"><td colspan="2">'.$langs->trans("Total").' &nbsp; <font style="font-weight: normal">('.$langs->trans("RemainderToTake").': '.price($total_ttc-$totalam).')</font> </td>';
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($total).'</td>'; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td class="right">'.price($total).'</td>';
print '<td align="right">'.price($total_ttc).'</td>'; print '<td class="right">'.price($total_ttc).'</td>';
print '<td align="right">'.price($totalam).'</td>'; print '<td class="right">'.price($totalam).'</td>';
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
print '</tr>'; print '</tr>';
} }
@ -978,10 +978,10 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("BillsSuppliersUnpaid", $num).' <a href="'.DOL_URL_ROOT.'/fourn/facture/impayees.php"><span class="badge">'.$num.'</span></a></th>'; print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("BillsSuppliersUnpaid", $num).' <a href="'.DOL_URL_ROOT.'/fourn/facture/impayees.php"><span class="badge">'.$num.'</span></a></th>';
print '<th align="right">'.$langs->trans("DateDue").'</th>'; print '<th class="right">'.$langs->trans("DateDue").'</th>';
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<th align="right">'.$langs->trans("AmountHT").'</th>'; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<th class="right">'.$langs->trans("AmountHT").'</th>';
print '<th align="right">'.$langs->trans("AmountTTC").'</th>'; print '<th class="right">'.$langs->trans("AmountTTC").'</th>';
print '<th align="right">'.$langs->trans("Paid").'</th>'; print '<th class="right">'.$langs->trans("Paid").'</th>';
print '<th width="16">&nbsp;</th>'; print '<th width="16">&nbsp;</th>';
print "</tr>\n"; print "</tr>\n";
$societestatic = new Societe($db); $societestatic = new Societe($db);
@ -1013,10 +1013,10 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
print $facstatic->getNomUrl(1, ''); print $facstatic->getNomUrl(1, '');
print '</td>'; print '</td>';
print '<td>'.$societestatic->getNomUrl(1, 'supplier', 44).'</td>'; print '<td>'.$societestatic->getNomUrl(1, 'supplier', 44).'</td>';
print '<td align="right">'.dol_print_date($db->jdate($obj->date_lim_reglement), 'day').'</td>'; print '<td class="right">'.dol_print_date($db->jdate($obj->date_lim_reglement), 'day').'</td>';
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($obj->total_ht).'</td>'; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td class="right">'.price($obj->total_ht).'</td>';
print '<td align="right">'.price($obj->total_ttc).'</td>'; print '<td class="right">'.price($obj->total_ttc).'</td>';
print '<td align="right">'.price($obj->am).'</td>'; print '<td class="right">'.price($obj->am).'</td>';
print '<td>'.$facstatic->LibStatut($obj->paye, $obj->fk_statut, 3).'</td>'; print '<td>'.$facstatic->LibStatut($obj->paye, $obj->fk_statut, 3).'</td>';
print '</tr>'; print '</tr>';
$total += $obj->total_ht; $total += $obj->total_ht;
@ -1027,9 +1027,9 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
print '<tr class="liste_total"><td colspan="2">'.$langs->trans("Total").' &nbsp; <font style="font-weight: normal">('.$langs->trans("RemainderToPay").': '.price($total_ttc-$totalam).')</font> </td>'; print '<tr class="liste_total"><td colspan="2">'.$langs->trans("Total").' &nbsp; <font style="font-weight: normal">('.$langs->trans("RemainderToPay").': '.price($total_ttc-$totalam).')</font> </td>';
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($total).'</td>'; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td class="right">'.price($total).'</td>';
print '<td align="right">'.price($total_ttc).'</td>'; print '<td class="right">'.price($total_ttc).'</td>';
print '<td align="right">'.price($totalam).'</td>'; print '<td class="right">'.price($totalam).'</td>';
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
print '</tr>'; print '</tr>';
} }

View File

@ -585,16 +585,16 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
print '<td align="center">'.$langs->trans('DateMaxPayment').'</td>'; print '<td align="center">'.$langs->trans('DateMaxPayment').'</td>';
if (!empty($conf->multicurrency->enabled)) { if (!empty($conf->multicurrency->enabled)) {
print '<td>'.$langs->trans('Currency').'</td>'; print '<td>'.$langs->trans('Currency').'</td>';
print '<td align="right">'.$langs->trans('MulticurrencyAmountTTC').'</td>'; print '<td class="right">'.$langs->trans('MulticurrencyAmountTTC').'</td>';
print '<td align="right">'.$multicurrencyalreadypayedlabel.'</td>'; print '<td class="right">'.$multicurrencyalreadypayedlabel.'</td>';
print '<td align="right">'.$multicurrencyremaindertopay.'</td>'; print '<td class="right">'.$multicurrencyremaindertopay.'</td>';
print '<td align="right">'.$langs->trans('MulticurrencyPaymentAmount').'</td>'; print '<td class="right">'.$langs->trans('MulticurrencyPaymentAmount').'</td>';
} }
print '<td align="right">'.$langs->trans('AmountTTC').'</td>'; print '<td class="right">'.$langs->trans('AmountTTC').'</td>';
print '<td align="right">'.$alreadypayedlabel.'</td>'; print '<td class="right">'.$alreadypayedlabel.'</td>';
print '<td align="right">'.$remaindertopay.'</td>'; print '<td class="right">'.$remaindertopay.'</td>';
print '<td align="right">'.$langs->trans('PaymentAmount').'</td>'; print '<td class="right">'.$langs->trans('PaymentAmount').'</td>';
print '<td align="right">&nbsp;</td>'; print '<td class="right">&nbsp;</td>';
print "</tr>\n"; print "</tr>\n";
$total=0; $total=0;
@ -661,12 +661,12 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
// Multicurrency Price // Multicurrency Price
if (!empty($conf->multicurrency->enabled)) if (!empty($conf->multicurrency->enabled))
{ {
print '<td align="right">'; print '<td class="right">';
if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) print price($sign * $objp->multicurrency_total_ttc); if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) print price($sign * $objp->multicurrency_total_ttc);
print '</td>'; print '</td>';
// Multicurrency Price // Multicurrency Price
print '<td align="right">'; print '<td class="right">';
if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency)
{ {
print price($sign * $multicurrency_payment); print price($sign * $multicurrency_payment);
@ -676,7 +676,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
print '</td>'; print '</td>';
// Multicurrency remain to pay // Multicurrency remain to pay
print '<td align="right">'; print '<td class="right">';
if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) print price($sign * $multicurrency_remaintopay); if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) print price($sign * $multicurrency_remaintopay);
print '</td>'; print '</td>';
@ -705,16 +705,16 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
} }
// Price // Price
print '<td align="right" '.(($invoice->id==$facid)?' style="font-weight: bold" ':'').'>'.price($sign * $objp->total_ttc).'</td>'; print '<td class="right" '.(($invoice->id==$facid)?' style="font-weight: bold" ':'').'>'.price($sign * $objp->total_ttc).'</td>';
// Received or paid back // Received or paid back
print '<td align="right">'.price($sign * $paiement); print '<td class="right">'.price($sign * $paiement);
if ($creditnotes) print '+'.price($creditnotes); if ($creditnotes) print '+'.price($creditnotes);
if ($deposits) print '+'.price($deposits); if ($deposits) print '+'.price($deposits);
print '</td>'; print '</td>';
// Remain to take or to pay back // Remain to take or to pay back
print '<td align="right">'.price($sign * $remaintopay).'</td>'; print '<td class="right">'.price($sign * $remaintopay).'</td>';
//$test= price(price2num($objp->total_ttc - $paiement - $creditnotes - $deposits)); //$test= price(price2num($objp->total_ttc - $paiement - $creditnotes - $deposits));
// Amount // Amount
@ -765,21 +765,21 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
{ {
// Print total // Print total
print '<tr class="liste_total">'; print '<tr class="liste_total">';
print '<td colspan="3" align="left">'.$langs->trans('TotalTTC').'</td>'; print '<td colspan="3" class="left">'.$langs->trans('TotalTTC').'</td>';
if (!empty($conf->multicurrency->enabled)) { if (!empty($conf->multicurrency->enabled)) {
print '<td></td>'; print '<td></td>';
print '<td></td>'; print '<td></td>';
print '<td></td>'; print '<td></td>';
print '<td></td>'; print '<td></td>';
print '<td align="right" id="multicurrency_result" style="font-weight: bold;"></td>'; print '<td class="right" id="multicurrency_result" style="font-weight: bold;"></td>';
} }
print '<td align="right"><b>'.price($sign * $total_ttc).'</b></td>'; print '<td class="right"><b>'.price($sign * $total_ttc).'</b></td>';
print '<td align="right"><b>'.price($sign * $totalrecu); print '<td class="right"><b>'.price($sign * $totalrecu);
if ($totalrecucreditnote) print '+'.price($totalrecucreditnote); if ($totalrecucreditnote) print '+'.price($totalrecucreditnote);
if ($totalrecudeposits) print '+'.price($totalrecudeposits); if ($totalrecudeposits) print '+'.price($totalrecudeposits);
print '</b></td>'; print '</b></td>';
print '<td align="right"><b>'.price($sign * price2num($total_ttc - $totalrecu - $totalrecucreditnote - $totalrecudeposits, 'MT')).'</b></td>'; print '<td class="right"><b>'.price($sign * price2num($total_ttc - $totalrecu - $totalrecucreditnote - $totalrecudeposits, 'MT')).'</b></td>';
print '<td align="right" id="result" style="font-weight: bold;"></td>'; // Autofilled print '<td class="right" id="result" style="font-weight: bold;"></td>'; // Autofilled
print '<td align="center">&nbsp;</td>'; print '<td align="center">&nbsp;</td>';
print "</tr>\n"; print "</tr>\n";
} }
@ -875,7 +875,7 @@ if (! GETPOST('action', 'aZ09'))
print_liste_field_titre('Invoice', $_SERVER["PHP_SELF"], 'ref', '', '', '', $sortfield, $sortorder); print_liste_field_titre('Invoice', $_SERVER["PHP_SELF"], 'ref', '', '', '', $sortfield, $sortorder);
print_liste_field_titre('Date', $_SERVER["PHP_SELF"], 'dp', '', '', '', $sortfield, $sortorder); print_liste_field_titre('Date', $_SERVER["PHP_SELF"], 'dp', '', '', '', $sortfield, $sortorder);
print_liste_field_titre('Type', $_SERVER["PHP_SELF"], 'libelle', '', '', '', $sortfield, $sortorder); print_liste_field_titre('Type', $_SERVER["PHP_SELF"], 'libelle', '', '', '', $sortfield, $sortorder);
print_liste_field_titre('Amount', $_SERVER["PHP_SELF"], 'fa_amount', '', '', 'align="right"', $sortfield, $sortorder); print_liste_field_titre('Amount', $_SERVER["PHP_SELF"], 'fa_amount', '', '', '', $sortfield, $sortorder, 'right ');
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch '); print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch ');
print "</tr>\n"; print "</tr>\n";
@ -887,7 +887,7 @@ if (! GETPOST('action', 'aZ09'))
print '<td><a href="'.DOL_URL_ROOT.'/compta/facture/card.php?facid='.$objp->facid.'">'.$objp->ref."</a></td>\n"; print '<td><a href="'.DOL_URL_ROOT.'/compta/facture/card.php?facid='.$objp->facid.'">'.$objp->ref."</a></td>\n";
print '<td>'.dol_print_date($db->jdate($objp->dp))."</td>\n"; print '<td>'.dol_print_date($db->jdate($objp->dp))."</td>\n";
print '<td>'.$objp->paiement_type.' '.$objp->num_paiement."</td>\n"; print '<td>'.$objp->paiement_type.' '.$objp->num_paiement."</td>\n";
print '<td align="right">'.price($objp->amount).'</td><td>&nbsp;</td>'; print '<td class="right">'.price($objp->amount).'</td><td>&nbsp;</td>';
$parameters=array(); $parameters=array();
$reshook=$hookmanager->executeHooks('printObjectLine', $parameters, $objp, $action); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('printObjectLine', $parameters, $objp, $action); // Note that $action and $object may have been modified by hook

View File

@ -265,9 +265,9 @@ if ($action == 'create')
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
//print '<td>'.$langs->trans("SocialContribution").'</td>'; //print '<td>'.$langs->trans("SocialContribution").'</td>';
print '<td class="left">'.$langs->trans("DateDue").'</td>'; print '<td class="left">'.$langs->trans("DateDue").'</td>';
print '<td align="right">'.$langs->trans("Amount").'</td>'; print '<td class="right">'.$langs->trans("Amount").'</td>';
print '<td align="right">'.$langs->trans("AlreadyPaid").'</td>'; print '<td class="right">'.$langs->trans("AlreadyPaid").'</td>';
print '<td align="right">'.$langs->trans("RemainderToPay").'</td>'; print '<td class="right">'.$langs->trans("RemainderToPay").'</td>';
print '<td align="center">'.$langs->trans("Amount").'</td>'; print '<td align="center">'.$langs->trans("Amount").'</td>';
print "</tr>\n"; print "</tr>\n";
@ -282,18 +282,18 @@ if ($action == 'create')
if ($objp->date_ech > 0) if ($objp->date_ech > 0)
{ {
print "<td align=\"left\">".dol_print_date($objp->date_ech, 'day')."</td>\n"; print '<td class="left">'.dol_print_date($objp->date_ech, 'day').'</td>'."\n";
} }
else else
{ {
print "<td align=\"center\"><b>!!!</b></td>\n"; print "<td align=\"center\"><b>!!!</b></td>\n";
} }
print '<td align="right">'.price($objp->amount)."</td>"; print '<td class="right">'.price($objp->amount)."</td>";
print '<td align="right">'.price($sumpaid)."</td>"; print '<td class="right">'.price($sumpaid)."</td>";
print '<td align="right">'.price($objp->amount - $sumpaid)."</td>"; print '<td class="right">'.price($objp->amount - $sumpaid)."</td>";
print '<td align="center">'; print '<td align="center">';
if ($sumpaid < $objp->amount) if ($sumpaid < $objp->amount)
@ -322,10 +322,10 @@ if ($action == 'create')
{ {
// Print total // Print total
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td colspan="2" align="left">'.$langs->trans("Total").':</td>'; print '<td colspan="2" class="left">'.$langs->trans("Total").':</td>';
print "<td align=\"right\"><b>".price($total_ttc)."</b></td>"; print '<td class="right"><b>'.price($total_ttc).'</b></td>';
print "<td align=\"right\"><b>".price($totalrecu)."</b></td>"; print '<td class="right"><b>'.price($totalrecu).'</b></td>';
print "<td align=\"right\"><b>".price($total_ttc - $totalrecu)."</b></td>"; print '<td class="right"><b>'.price($total_ttc - $totalrecu).'</b></td>';
print '<td align="center">&nbsp;</td>'; print '<td align="center">&nbsp;</td>';
print "</tr>\n"; print "</tr>\n";
} }

View File

@ -109,10 +109,10 @@ if ($id > 0)
if (! empty($arrayfields['f.datef']['checked'])) print_liste_field_titre($arrayfields['f.datef']['label'], $_SERVER["PHP_SELF"], "f.datef", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder); if (! empty($arrayfields['f.datef']['checked'])) print_liste_field_titre($arrayfields['f.datef']['label'], $_SERVER["PHP_SELF"], "f.datef", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder);
print '<td>'.$langs->trans("Element").'</td>'; print '<td>'.$langs->trans("Element").'</td>';
print '<td>'.$langs->trans("Status").'</td>'; print '<td>'.$langs->trans("Status").'</td>';
print '<td align="right">'.$langs->trans("Debit").'</td>'; print '<td class="right">'.$langs->trans("Debit").'</td>';
print '<td align="right">'.$langs->trans("Credit").'</td>'; print '<td class="right">'.$langs->trans("Credit").'</td>';
print '<td align="right">'.$langs->trans("Balance").'</td>'; print '<td class="right">'.$langs->trans("Balance").'</td>';
print '<td align="right">'.$langs->trans("Author").'</td>'; print '<td class="right">'.$langs->trans("Author").'</td>';
print '</tr>'; print '</tr>';
$TData = array(); $TData = array();
@ -261,18 +261,18 @@ if ($id > 0)
print '<td aling="left">'.$data['status'].'</td>'; print '<td aling="left">'.$data['status'].'</td>';
print '<td align="right">'.(($data['amount'] > 0) ? price(abs($data['amount'])) : '')."</td>\n"; print '<td class="right">'.(($data['amount'] > 0) ? price(abs($data['amount'])) : '')."</td>\n";
$totalDebit += ($data['amount'] > 0) ? abs($data['amount']) : 0; $totalDebit += ($data['amount'] > 0) ? abs($data['amount']) : 0;
print '<td align="right">'.(($data['amount'] > 0) ? '' : price(abs($data['amount'])))."</td>\n"; print '<td class="right">'.(($data['amount'] > 0) ? '' : price(abs($data['amount'])))."</td>\n";
$totalCredit += ($data['amount'] > 0) ? 0 : abs($data['amount']); $totalCredit += ($data['amount'] > 0) ? 0 : abs($data['amount']);
// Balance // Balance
print '<td align="right">'.price($data['balance'])."</td>\n"; print '<td class="right">'.price($data['balance'])."</td>\n";
// Author // Author
print '<td class="nowrap" align="right">'; print '<td class="nowrap right">';
print $data['author']; print $data['author'];
print '</td>'; print '</td>';
@ -281,9 +281,9 @@ if ($id > 0)
print '<tr class="liste_total">'; print '<tr class="liste_total">';
print '<td colspan="3">&nbsp;</td>'; print '<td colspan="3">&nbsp;</td>';
print '<td align="right">'.price($totalDebit).'</td>'; print '<td class="right">'.price($totalDebit).'</td>';
print '<td align="right">'.price($totalCredit).'</td>'; print '<td class="right">'.price($totalCredit).'</td>';
print '<td align="right">'.price(price2num($totalDebit - $totalCredit, 'MT')).'</td>'; print '<td class="right">'.price(price2num($totalDebit - $totalCredit, 'MT')).'</td>';
print '<td></td>'; print '<td></td>';
print "</tr>\n"; print "</tr>\n";
} }

View File

@ -301,7 +301,7 @@ if ($modecompta == 'BOOKKEEPING')
// Get cpts of category/group // Get cpts of category/group
$cpts = $AccCat->getCptsCat(0, $tmppredefinedgroupwhere); $cpts = $AccCat->getCptsCat(0, $tmppredefinedgroupwhere);
foreach($cpts as $i => $cpt) foreach($cpts as $j => $cpt)
{ {
$return = $AccCat->getSumDebitCredit($cpt['account_number'], $date_start, $date_end, $cpt['dc']); $return = $AccCat->getSumDebitCredit($cpt['account_number'], $date_start, $date_end, $cpt['dc']);
if ($return < 0) { if ($return < 0) {

View File

@ -405,7 +405,7 @@ elseif ($modecompta=="BOOKKEEPING")
// N-1 // N-1
if (! empty($arrayofaccountforfilter)) if (! empty($arrayofaccountforfilter))
{ {
$return = $AccCat->getSumDebitCredit($arrayofaccountforfilter, $date_start_previous, $date_end_previous, $cpt['dc']?$cpt['dc']:0); $return = $AccCat->getSumDebitCredit($arrayofaccountforfilter, $date_start_previous, $date_end_previous, $cat['dc']?$cat['dc']:0);
if ($return < 0) { if ($return < 0) {
setEventMessages(null, $AccCat->errors, 'errors'); setEventMessages(null, $AccCat->errors, 'errors');
@ -438,7 +438,7 @@ elseif ($modecompta=="BOOKKEEPING")
if (($k+1) < $start_month) $yeartoprocess++; if (($k+1) < $start_month) $yeartoprocess++;
//var_dump($monthtoprocess.'_'.$yeartoprocess); //var_dump($monthtoprocess.'_'.$yeartoprocess);
$return = $AccCat->getSumDebitCredit($cpt['account_number'], $date_start, $date_end, $cpt['dc']?$cpt['dc']:0, 'nofilter', $monthtoprocess, $yeartoprocess); $return = $AccCat->getSumDebitCredit($cpt['account_number'], $date_start, $date_end, $cat['dc']?$cat['dc']:0, 'nofilter', $monthtoprocess, $yeartoprocess);
if ($return < 0) { if ($return < 0) {
setEventMessages(null, $AccCat->errors, 'errors'); setEventMessages(null, $AccCat->errors, 'errors');
$resultM=0; $resultM=0;

View File

@ -101,8 +101,8 @@ function pt($db, $sql, $date)
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td class="nowrap">'.$date.'</td>'; print '<td class="nowrap">'.$date.'</td>';
print '<td align="right">'.$langs->trans("ClaimedForThisPeriod").'</td>'; print '<td class="right">'.$langs->trans("ClaimedForThisPeriod").'</td>';
print '<td align="right">'.$langs->trans("PaidDuringThisPeriod").'</td>'; print '<td class="right">'.$langs->trans("PaidDuringThisPeriod").'</td>';
print "</tr>\n"; print "</tr>\n";
$totalclaimed = 0; $totalclaimed = 0;
@ -122,8 +122,8 @@ function pt($db, $sql, $date)
{ {
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td class="nowrap">'.$previousmonth."</td>\n"; print '<td class="nowrap">'.$previousmonth."</td>\n";
print '<td class="nowrap" align="right">'.price($amountclaimed)."</td>\n"; print '<td class="nowrap right">'.price($amountclaimed)."</td>\n";
print '<td class="nowrap" align="right">'.price($amountpaid)."</td>\n"; print '<td class="nowrap right">'.price($amountpaid)."</td>\n";
print "</tr>\n"; print "</tr>\n";
$amountclaimed = 0; $amountclaimed = 0;
@ -145,8 +145,8 @@ function pt($db, $sql, $date)
{ {
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td class="nowrap">'.$obj->dm."</td>\n"; print '<td class="nowrap">'.$obj->dm."</td>\n";
print '<td class="nowrap" align="right">'.price($amountclaimed)."</td>\n"; print '<td class="nowrap right">'.price($amountclaimed)."</td>\n";
print '<td class="nowrap" align="right">'.price($amountpaid)."</td>\n"; print '<td class="nowrap right">'.price($amountpaid)."</td>\n";
print "</tr>\n"; print "</tr>\n";
$amountclaimed = 0; $amountclaimed = 0;
$amountpaid = 0; $amountpaid = 0;
@ -166,8 +166,8 @@ function pt($db, $sql, $date)
{ {
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td class="nowrap">'.$previousmonth."</td>\n"; print '<td class="nowrap">'.$previousmonth."</td>\n";
print '<td class="nowrap" align="right">'.price($amountclaimed)."</td>\n"; print '<td class="nowrap right">'.price($amountclaimed)."</td>\n";
print '<td class="nowrap" align="right">'.price($amountpaid)."</td>\n"; print '<td class="nowrap right">'.price($amountpaid)."</td>\n";
print "</tr>\n"; print "</tr>\n";
$amountclaimed = 0; $amountclaimed = 0;
@ -175,9 +175,9 @@ function pt($db, $sql, $date)
} }
print '<tr class="liste_total">'; print '<tr class="liste_total">';
print '<td align="right">'.$langs->trans("Total").'</td>'; print '<td class="right">'.$langs->trans("Total").'</td>';
print '<td class="nowrap" align="right">'.price($totalclaimed).'</td>'; print '<td class="nowrap right">'.price($totalclaimed).'</td>';
print '<td class="nowrap" align="right">'.price($totalpaid).'</td>'; print '<td class="nowrap right">'.price($totalpaid).'</td>';
print "</tr>"; print "</tr>";
print "</table>"; print "</table>";
@ -242,9 +242,9 @@ print load_fiche_titre($langs->trans("VATSummary"), '', '');
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td width="30%">'.$langs->trans("Year")." ".$y.'</td>'; print '<td width="30%">'.$langs->trans("Year")." ".$y.'</td>';
print '<td align="right">'.$langs->trans("VATToPay").'</td>'; print '<td class="right">'.$langs->trans("VATToPay").'</td>';
print '<td align="right">'.$langs->trans("VATToCollect").'</td>'; print '<td class="right">'.$langs->trans("VATToCollect").'</td>';
print '<td align="right">'.$langs->trans("Balance").'</td>'; print '<td class="right">'.$langs->trans("Balance").'</td>';
print '<td>&nbsp;</td>'."\n"; print '<td>&nbsp;</td>'."\n";
print '</tr>'."\n"; print '</tr>'."\n";
@ -444,7 +444,7 @@ while ((($y < $yend) || ($y == $yend && $m <= $mend)) && $mcursor < 1000) // $mc
$x_coll_sum += $temp_vat; $x_coll_sum += $temp_vat;
} }
} }
print "<td class=\"nowrap\" align=\"right\">".price(price2num($x_coll_sum, 'MT'))."</td>"; print '<td class="nowrap right">'.price(price2num($x_coll_sum, 'MT')).'</td>';
$x_paye_sum = 0; $x_paye_sum = 0;
foreach (array_keys($x_paye) as $rate) foreach (array_keys($x_paye) as $rate)
@ -488,7 +488,7 @@ while ((($y < $yend) || ($y == $yend && $m <= $mend)) && $mcursor < 1000) // $mc
$x_paye_sum += $temp_vat; $x_paye_sum += $temp_vat;
} }
} }
print "<td class=\"nowrap\" align=\"right\">".price(price2num($x_paye_sum, 'MT'))."</td>"; print '<td class="nowrap right">'.price(price2num($x_paye_sum, 'MT')).'</td>';
$subtotalcoll = $subtotalcoll + $x_coll_sum; $subtotalcoll = $subtotalcoll + $x_coll_sum;
$subtotalpaye = $subtotalpaye + $x_paye_sum; $subtotalpaye = $subtotalpaye + $x_paye_sum;
@ -497,7 +497,7 @@ while ((($y < $yend) || ($y == $yend && $m <= $mend)) && $mcursor < 1000) // $mc
$total = $total + $diff; $total = $total + $diff;
$subtotal = price2num($subtotal + $diff, 'MT'); $subtotal = price2num($subtotal + $diff, 'MT');
print "<td class=\"nowrap\" align=\"right\">".price(price2num($diff, 'MT'))."</td>\n"; print '<td class="nowrap right">'.price(price2num($diff, 'MT')).'</td>'."\n";
print "<td>&nbsp;</td>\n"; print "<td>&nbsp;</td>\n";
print "</tr>\n"; print "</tr>\n";
@ -505,16 +505,16 @@ while ((($y < $yend) || ($y == $yend && $m <= $mend)) && $mcursor < 1000) // $mc
if ($i > 2) if ($i > 2)
{ {
print '<tr class="liste_total">'; print '<tr class="liste_total">';
print '<td align="right"><a href="quadri_detail.php?leftmenu=tax_vat&q='.round($m/3).'&year='.$y.'">'.$langs->trans("SubTotal").'</a>:</td>'; print '<td class="right"><a href="quadri_detail.php?leftmenu=tax_vat&q='.round($m/3).'&year='.$y.'">'.$langs->trans("SubTotal").'</a>:</td>';
print '<td class="nowrap" align="right">'.price(price2num($subtotalcoll, 'MT')).'</td>'; print '<td class="nowrap right">'.price(price2num($subtotalcoll, 'MT')).'</td>';
print '<td class="nowrap" align="right">'.price(price2num($subtotalpaye, 'MT')).'</td>'; print '<td class="nowrap right">'.price(price2num($subtotalpaye, 'MT')).'</td>';
print '<td class="nowrap" align="right">'.price(price2num($subtotal, 'MT')).'</td>'; print '<td class="nowrap right">'.price(price2num($subtotal, 'MT')).'</td>';
print '<td>&nbsp;</td></tr>'; print '<td>&nbsp;</td></tr>';
$i = 0; $i = 0;
$subtotalcoll=0; $subtotalpaye=0; $subtotal=0; $subtotalcoll=0; $subtotalpaye=0; $subtotal=0;
} }
} }
print '<tr class="liste_total"><td align="right" colspan="3">'.$langs->trans("TotalToPay").':</td><td class="nowrap" align="right">'.price(price2num($total, 'MT')).'</td>'; print '<tr class="liste_total"><td class="right" colspan="3">'.$langs->trans("TotalToPay").':</td><td class="nowrap right">'.price(price2num($total, 'MT')).'</td>';
print "<td>&nbsp;</td>\n"; print "<td>&nbsp;</td>\n";
print '</tr>'; print '</tr>';
@ -575,19 +575,19 @@ if (! empty($conf->global->MAIN_FEATURES_LEVEL))
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print "<tr>"; print "<tr>";
print '<td align="right">' . $langs->trans("VATDue") . '</td>'; print '<td class="right">' . $langs->trans("VATDue") . '</td>';
print '<td class="nowrap" align="right">' . price(price2num($total, 'MT')) . '</td>'; print '<td class="nowrap right">' . price(price2num($total, 'MT')) . '</td>';
print "</tr>\n"; print "</tr>\n";
print "<tr>"; print "<tr>";
print '<td align="right">' . $langs->trans("VATPaid") . '</td>'; print '<td class="right">' . $langs->trans("VATPaid") . '</td>';
print '<td class="nowrap" align="right">' . price(price2num($obj->mm, 'MT')) . "</td>\n"; print '<td class="nowrap right">' . price(price2num($obj->mm, 'MT')) . "</td>\n";
print "</tr>\n"; print "</tr>\n";
$restopay = $total - $obj->mm; $restopay = $total - $obj->mm;
print "<tr>"; print "<tr>";
print '<td align="right">' . $langs->trans("RemainToPay") . '</td>'; print '<td class="right">' . $langs->trans("RemainToPay") . '</td>';
print '<td class="nowrap" align="right">' . price(price2num($restopay, 'MT')) . '</td>'; print '<td class="nowrap right">' . price(price2num($restopay, 'MT')) . '</td>';
print "</tr>\n"; print "</tr>\n";
print '</table>'; print '</table>';

View File

@ -188,8 +188,8 @@ if ($result)
$form->select_comptes($search_account, 'search_account', 0, '', 1); $form->select_comptes($search_account, 'search_account', 0, '', 1);
print '</td>'; print '</td>';
} }
print '<td class="liste_titre" align="right"><input name="search_amount" class="flat" type="text" size="8" value="'.$search_amount.'"></td>'; print '<td class="liste_titre right"><input name="search_amount" class="flat" type="text" size="8" value="'.$search_amount.'"></td>';
print '<td class="liste_titre" align="right">'; print '<td class="liste_titre right">';
$searchpicto=$form->showFilterAndCheckAddButtons(0); $searchpicto=$form->showFilterAndCheckAddButtons(0);
print $searchpicto; print $searchpicto;
print '</td>'; print '</td>';
@ -200,9 +200,9 @@ if ($result)
print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "t.label", "", $param, 'align="left"', $sortfield, $sortorder); print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "t.label", "", $param, 'align="left"', $sortfield, $sortorder);
print_liste_field_titre("PeriodEndDate", $_SERVER["PHP_SELF"], "t.datev", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre("PeriodEndDate", $_SERVER["PHP_SELF"], "t.datev", "", $param, 'align="center"', $sortfield, $sortorder);
print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "t.datep", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "t.datep", "", $param, 'align="center"', $sortfield, $sortorder);
print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "type", "", $param, 'align="left"', $sortfield, $sortorder); print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "type", "", $param, '', $sortfield, $sortorder, 'left ');
if (! empty($conf->banque->enabled)) print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder); if (! empty($conf->banque->enabled)) print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "t.amount", "", $param, 'align="right"', $sortfield, $sortorder); print_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "t.amount", "", $param, '', $sortfield, $sortorder, 'right ');
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch '); print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch ');
print "</tr>\n"; print "</tr>\n";
@ -265,7 +265,7 @@ if ($result)
$colspan=5; $colspan=5;
if (! empty($conf->banque->enabled)) $colspan++; if (! empty($conf->banque->enabled)) $colspan++;
print '<tr class="liste_total"><td colspan="'.$colspan.'">'.$langs->trans("Total").'</td>'; print '<tr class="liste_total"><td colspan="'.$colspan.'">'.$langs->trans("Total").'</td>';
print '<td align="right">'.price($total).'</td>'; print '<td class="right">'.price($total).'</td>';
print "<td>&nbsp;</td></tr>"; print "<td>&nbsp;</td></tr>";
print "</table>"; print "</table>";
@ -280,7 +280,6 @@ else
dol_print_error($db); dol_print_error($db);
} }
// End of page
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -344,11 +344,11 @@ if (! is_array($x_coll) || ! is_array($x_paye))
print '<td class="left">'.$productcust.'</td>'; print '<td class="left">'.$productcust.'</td>';
if ($modetax != 1) if ($modetax != 1)
{ {
print '<td align="right">'.$amountcust.'</td>'; print '<td class="right">'.$amountcust.'</td>';
print '<td align="right">'.$langs->trans("Payment").' ('.$langs->trans("PercentOfInvoice").')</td>'; print '<td class="right">'.$langs->trans("Payment").' ('.$langs->trans("PercentOfInvoice").')</td>';
} }
print '<td align="right">'.$langs->trans("AmountHTVATRealReceived").'</td>'; print '<td class="right">'.$langs->trans("AmountHTVATRealReceived").'</td>';
print '<td align="right">'.$vatcust.'</td>'; print '<td class="right">'.$vatcust.'</td>';
print '</tr>'; print '</tr>';
$action = "tvadetail"; $action = "tvadetail";
@ -390,7 +390,7 @@ if (! is_array($x_coll) || ! is_array($x_paye))
print '<tr class="oddeven">'; print '<tr class="oddeven">';
// Ref // Ref
print '<td class="nowrap" align="left">'.$fields['link'].'</td>'; print '<td class="nowrap left">'.$fields['link'].'</td>';
// Invoice date // Invoice date
print '<td class="left">' . dol_print_date($fields['datef'], 'day') . '</td>'; print '<td class="left">' . dol_print_date($fields['datef'], 'day') . '</td>';
@ -440,7 +440,7 @@ if (! is_array($x_coll) || ! is_array($x_paye))
// Total HT // Total HT
if ($modetax != 1) if ($modetax != 1)
{ {
print '<td class="nowrap" align="right">'; print '<td class="nowrap right">';
print price($fields['totalht']); print price($fields['totalht']);
if (price2num($fields['ftotal_ttc'])) if (price2num($fields['ftotal_ttc']))
{ {
@ -455,7 +455,7 @@ if (! is_array($x_coll) || ! is_array($x_paye))
$ratiopaymentinvoice=1; $ratiopaymentinvoice=1;
if ($modetax != 1) if ($modetax != 1)
{ {
print '<td class="nowrap" align="right">'; print '<td class="nowrap right">';
//print $fields['totalht']."-".$fields['payment_amount']."-".$fields['ftotal_ttc']; //print $fields['totalht']."-".$fields['payment_amount']."-".$fields['ftotal_ttc'];
if ($fields['payment_amount'] && $fields['ftotal_ttc']) if ($fields['payment_amount'] && $fields['ftotal_ttc'])
{ {
@ -479,13 +479,13 @@ if (! is_array($x_coll) || ! is_array($x_paye))
} }
// Total collected // Total collected
print '<td class="nowrap" align="right">'; print '<td class="nowrap right">';
$temp_ht=$fields['totalht']*$ratiopaymentinvoice; $temp_ht=$fields['totalht']*$ratiopaymentinvoice;
print price(price2num($temp_ht, 'MT'), 1); print price(price2num($temp_ht, 'MT'), 1);
print '</td>'; print '</td>';
// VAT // VAT
print '<td class="nowrap" align="right">'; print '<td class="nowrap right">';
$temp_vat=$fields['vat']*$ratiopaymentinvoice; $temp_vat=$fields['vat']*$ratiopaymentinvoice;
print price(price2num($temp_vat, 'MT'), 1); print price(price2num($temp_vat, 'MT'), 1);
//print price($fields['vat']); //print price($fields['vat']);
@ -500,13 +500,13 @@ if (! is_array($x_coll) || ! is_array($x_paye))
// Total customers for this vat rate // Total customers for this vat rate
print '<tr class="liste_total">'; print '<tr class="liste_total">';
print '<td colspan="4"></td>'; print '<td colspan="4"></td>';
print '<td align="right">'.$langs->trans("Total").':</td>'; print '<td class="right">'.$langs->trans("Total").':</td>';
if ($modetax != 1) { if ($modetax != 1) {
print '<td class="nowrap" align="right">&nbsp;</td>'; print '<td class="nowrap right">&nbsp;</td>';
print '<td align="right">&nbsp;</td>'; print '<td class="right">&nbsp;</td>';
} }
print '<td align="right">'.price(price2num($subtot_coll_total_ht, 'MT')).'</td>'; print '<td class="right">'.price(price2num($subtot_coll_total_ht, 'MT')).'</td>';
print '<td class="nowrap" align="right">'.price(price2num($subtot_coll_vat, 'MT')).'</td>'; print '<td class="nowrap right">'.price(price2num($subtot_coll_vat, 'MT')).'</td>';
print '</tr>'; print '</tr>';
} }
@ -514,13 +514,13 @@ if (! is_array($x_coll) || ! is_array($x_paye))
{ {
print '<tr class="liste_total">'; print '<tr class="liste_total">';
print '<td colspan="4"></td>'; print '<td colspan="4"></td>';
print '<td align="right">'.$langs->trans("Total").':</td>'; print '<td class="right">'.$langs->trans("Total").':</td>';
if ($modetax != 1) { if ($modetax != 1) {
print '<td class="nowrap" align="right">&nbsp;</td>'; print '<td class="nowrap right">&nbsp;</td>';
print '<td align="right">&nbsp;</td>'; print '<td class="right">&nbsp;</td>';
} }
print '<td align="right">'.price(price2num(0, 'MT')).'</td>'; print '<td class="right">'.price(price2num(0, 'MT')).'</td>';
print '<td class="nowrap" align="right">'.price(price2num(0, 'MT')).'</td>'; print '<td class="nowrap right">'.price(price2num(0, 'MT')).'</td>';
print '</tr>'; print '</tr>';
} }
@ -536,11 +536,11 @@ if (! is_array($x_coll) || ! is_array($x_paye))
print '<td class="left">'.$namesup.'</td>'; print '<td class="left">'.$namesup.'</td>';
print '<td class="left">'.$productsup.'</td>'; print '<td class="left">'.$productsup.'</td>';
if ($modetax != 1) { if ($modetax != 1) {
print '<td align="right">'.$amountsup.'</td>'; print '<td class="right">'.$amountsup.'</td>';
print '<td align="right">'.$langs->trans("Payment").' ('.$langs->trans("PercentOfInvoice").')</td>'; print '<td class="right">'.$langs->trans("Payment").' ('.$langs->trans("PercentOfInvoice").')</td>';
} }
print '<td align="right">'.$langs->trans("AmountHTVATRealPaid").'</td>'; print '<td class="right">'.$langs->trans("AmountHTVATRealPaid").'</td>';
print '<td align="right">'.$vatsup.'</td>'; print '<td class="right">'.$vatsup.'</td>';
print '</tr>'."\n"; print '</tr>'."\n";
foreach (array_keys($x_paye) as $rate) foreach (array_keys($x_paye) as $rate)
@ -571,7 +571,7 @@ if (! is_array($x_coll) || ! is_array($x_paye))
print '<tr class="oddeven">'; print '<tr class="oddeven">';
// Ref // Ref
print '<td class="nowrap" align="left">'.$fields['link'].'</td>'; print '<td class="nowrap left">'.$fields['link'].'</td>';
// Invoice date // Invoice date
print '<td class="left">' . dol_print_date($fields['datef'], 'day') . '</td>'; print '<td class="left">' . dol_print_date($fields['datef'], 'day') . '</td>';
@ -621,7 +621,7 @@ if (! is_array($x_coll) || ! is_array($x_paye))
// Total HT // Total HT
if ($modetax != 1) if ($modetax != 1)
{ {
print '<td class="nowrap" align="right">'; print '<td class="nowrap right">';
print price($fields['totalht']); print price($fields['totalht']);
if (price2num($fields['ftotal_ttc'])) if (price2num($fields['ftotal_ttc']))
{ {
@ -636,7 +636,7 @@ if (! is_array($x_coll) || ! is_array($x_paye))
$ratiopaymentinvoice=1; $ratiopaymentinvoice=1;
if ($modetax != 1) if ($modetax != 1)
{ {
print '<td class="nowrap" align="right">'; print '<td class="nowrap right">';
if ($fields['payment_amount'] && $fields['ftotal_ttc']) if ($fields['payment_amount'] && $fields['ftotal_ttc'])
{ {
$paymentfourn_static->id=$fields['payment_id']; $paymentfourn_static->id=$fields['payment_id'];
@ -662,13 +662,13 @@ if (! is_array($x_coll) || ! is_array($x_paye))
} }
// VAT paid // VAT paid
print '<td class="nowrap" align="right">'; print '<td class="nowrap right">';
$temp_ht=$fields['totalht']*$ratiopaymentinvoice; $temp_ht=$fields['totalht']*$ratiopaymentinvoice;
print price(price2num($temp_ht, 'MT'), 1); print price(price2num($temp_ht, 'MT'), 1);
print '</td>'; print '</td>';
// VAT // VAT
print '<td class="nowrap" align="right">'; print '<td class="nowrap right">';
$temp_vat=$fields['vat']*$ratiopaymentinvoice; $temp_vat=$fields['vat']*$ratiopaymentinvoice;
print price(price2num($temp_vat, 'MT'), 1); print price(price2num($temp_vat, 'MT'), 1);
//print price($fields['vat']); //print price($fields['vat']);
@ -683,26 +683,26 @@ if (! is_array($x_coll) || ! is_array($x_paye))
// Total suppliers for this vat rate // Total suppliers for this vat rate
print '<tr class="liste_total">'; print '<tr class="liste_total">';
print '<td colspan="4"></td>'; print '<td colspan="4"></td>';
print '<td align="right">'.$langs->trans("Total").':</td>'; print '<td class="right">'.$langs->trans("Total").':</td>';
if ($modetax != 1) { if ($modetax != 1) {
print '<td class="nowrap" align="right">&nbsp;</td>'; print '<td class="nowrap right">&nbsp;</td>';
print '<td align="right">&nbsp;</td>'; print '<td class="right">&nbsp;</td>';
} }
print '<td align="right">'.price(price2num($subtot_paye_total_ht, 'MT')).'</td>'; print '<td class="right">'.price(price2num($subtot_paye_total_ht, 'MT')).'</td>';
print '<td class="nowrap" align="right">'.price(price2num($subtot_paye_vat, 'MT')).'</td>'; print '<td class="nowrap right">'.price(price2num($subtot_paye_vat, 'MT')).'</td>';
print '</tr>'; print '</tr>';
} }
if (count($x_paye) == 0) { // Show a total line if nothing shown if (count($x_paye) == 0) { // Show a total line if nothing shown
print '<tr class="liste_total">'; print '<tr class="liste_total">';
print '<td colspan="4"></td>'; print '<td colspan="4"></td>';
print '<td align="right">'.$langs->trans("Total").':</td>'; print '<td class="right">'.$langs->trans("Total").':</td>';
if ($modetax != 1) { if ($modetax != 1) {
print '<td class="nowrap" align="right">&nbsp;</td>'; print '<td class="nowrap right">&nbsp;</td>';
print '<td align="right">&nbsp;</td>'; print '<td class="right">&nbsp;</td>';
} }
print '<td align="right">'.price(price2num(0, 'MT')).'</td>'; print '<td class="right">'.price(price2num(0, 'MT')).'</td>';
print '<td class="nowrap" align="right">'.price(price2num(0, 'MT')).'</td>'; print '<td class="nowrap right">'.price(price2num(0, 'MT')).'</td>';
print '</tr>'; print '</tr>';
} }
@ -714,7 +714,7 @@ if (! is_array($x_coll) || ! is_array($x_paye))
$diff = $x_coll_sum - $x_paye_sum; $diff = $x_coll_sum - $x_paye_sum;
print '<tr class="liste_total">'; print '<tr class="liste_total">';
print '<td class="liste_total" colspan="'.$span.'">'.$langs->trans("TotalToPay").($q?', '.$langs->trans("Quadri").' '.$q:'').'</td>'; print '<td class="liste_total" colspan="'.$span.'">'.$langs->trans("TotalToPay").($q?', '.$langs->trans("Quadri").' '.$q:'').'</td>';
print '<td class="liste_total nowrap" align="right"><b>'.price(price2num($diff, 'MT'))."</b></td>\n"; print '<td class="liste_total nowrap right"><b>'.price(price2num($diff, 'MT'))."</b></td>\n";
print "</tr>\n"; print "</tr>\n";
$i++; $i++;

View File

@ -126,7 +126,7 @@ echo $this->control->tpl['ajax_selectcountry']; ?>
</tr> </tr>
<tr> <tr>
<td align="center" colspan="4"><input type="submit" class="button" value="<?php echo $langs->trans("Add"); ?>"></td> <td class="center" colspan="4"><input type="submit" class="button" value="<?php echo $langs->trans("Add"); ?>"></td>
</tr> </tr>
</table><br> </table><br>

View File

@ -149,7 +149,7 @@ echo $this->control->tpl['ajax_selectcountry'];
</tr> </tr>
<tr> <tr>
<td colspan="4" align="center"> <td colspan="4" class="center">
<input type="submit" class="button" name="save" value="<?php echo $langs->trans("Save"); ?>">&nbsp; <input type="submit" class="button" name="save" value="<?php echo $langs->trans("Save"); ?>">&nbsp;
<input type="submit" class="button" name="cancel" value="<?php echo $langs->trans("Cancel"); ?>"> <input type="submit" class="button" name="cancel" value="<?php echo $langs->trans("Cancel"); ?>">
</td> </td>

View File

@ -588,7 +588,7 @@ else
$rowspan=3; $rowspan=3;
if (empty($conf->global->SOCIETE_DISABLE_STATE)) $rowspan++; if (empty($conf->global->SOCIETE_DISABLE_STATE)) $rowspan++;
print '<td valign="middle" align="center" rowspan="'.$rowspan.'">'; print '<td class="valignmiddle center" rowspan="'.$rowspan.'">';
print '<a href="#" id="copyaddressfromsoc">'.$langs->trans('CopyAddressFromSoc').'</a>'; print '<a href="#" id="copyaddressfromsoc">'.$langs->trans('CopyAddressFromSoc').'</a>';
print '</td>'; print '</td>';
} }
@ -1225,7 +1225,7 @@ else
// Other attributes // Other attributes
$cols = 3; $cols = 3;
$parameyers=array('socid'=>$socid); $parameters=array('socid'=>$socid);
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
$object->load_ref_elements(); $object->load_ref_elements();

View File

@ -372,25 +372,25 @@ if ($sql_select)
// Filters // Filters
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td class="liste_titre" align="left">'; print '<td class="liste_titre left">';
print '<input class="flat" type="text" name="sref" size="8" value="'.$sref.'">'; print '<input class="flat" type="text" name="sref" size="8" value="'.$sref.'">';
print '</td>'; print '</td>';
print '<td class="liste_titre nowrap center">'; // date print '<td class="liste_titre nowrap center">'; // date
print $formother->select_month($month?$month:-1, 'month', 1, 0, 'valignmiddle'); print $formother->select_month($month?$month:-1, 'month', 1, 0, 'valignmiddle');
$formother->select_year($year?$year:-1, 'year', 1, 20, 1); $formother->select_year($year?$year:-1, 'year', 1, 20, 1);
print '</td>'; print '</td>';
print '<td class="liste_titre" align="center">'; print '<td class="liste_titre center">';
print '</td>'; print '</td>';
print '<td class="liste_titre" align="left">'; print '<td class="liste_titre left">';
print '<input class="flat" type="text" name="sprod_fulldescr" size="15" value="'.dol_escape_htmltag($sprod_fulldescr).'">'; print '<input class="flat" type="text" name="sprod_fulldescr" size="15" value="'.dol_escape_htmltag($sprod_fulldescr).'">';
print '</td>'; print '</td>';
print '<td class="liste_titre" align="center">'; // TODO: Add filters ! print '<td class="liste_titre center">'; // TODO: Add filters !
print '</td>'; print '</td>';
print '<td class="liste_titre" align="center">'; print '<td class="liste_titre center">';
print '</td>'; print '</td>';
print '<td class="liste_titre" align="center">'; print '<td class="liste_titre center">';
print '</td>'; print '</td>';
print '<td class="liste_titre" align="right">'; print '<td class="liste_titre right">';
$searchpicto=$form->showFilterAndCheckAddButtons(0); $searchpicto=$form->showFilterAndCheckAddButtons(0);
print $searchpicto; print $searchpicto;
print '</td>'; print '</td>';
@ -398,14 +398,14 @@ if ($sql_select)
// Titles with sort buttons // Titles with sort buttons
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print_liste_field_titre('Ref', $_SERVER['PHP_SELF'], 'doc_number', '', $param, 'align="left"', $sortfield, $sortorder); print_liste_field_titre('Ref', $_SERVER['PHP_SELF'], 'doc_number', '', $param, '', $sortfield, $sortorder, 'left ');
print_liste_field_titre('Date', $_SERVER['PHP_SELF'], 'dateprint', '', $param, 'align="center" width="150"', $sortfield, $sortorder); print_liste_field_titre('Date', $_SERVER['PHP_SELF'], 'dateprint', '', $param, 'width="150"', $sortfield, $sortorder, 'center ');
print_liste_field_titre('Status', $_SERVER['PHP_SELF'], 'fk_statut', '', $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre('Status', $_SERVER['PHP_SELF'], 'fk_statut', '', $param, '', $sortfield, $sortorder, 'center ');
print_liste_field_titre('Product', $_SERVER['PHP_SELF'], '', '', $param, 'align="left"', $sortfield, $sortorder); print_liste_field_titre('Product', $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'left ');
print_liste_field_titre('ContactType', $_SERVER['PHP_SELF'], '', '', $param, 'align="left"', $sortfield, $sortorder); print_liste_field_titre('ContactType', $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'left ');
print_liste_field_titre('Quantity', $_SERVER['PHP_SELF'], 'prod_qty', '', $param, 'align="right"', $sortfield, $sortorder); print_liste_field_titre('Quantity', $_SERVER['PHP_SELF'], 'prod_qty', '', $param, '', $sortfield, $sortorder, 'right ');
print_liste_field_titre('TotalHT', $_SERVER['PHP_SELF'], 'total_ht', '', $param, 'align="right"', $sortfield, $sortorder); print_liste_field_titre('TotalHT', $_SERVER['PHP_SELF'], 'total_ht', '', $param, '', $sortfield, $sortorder, 'right ');
print_liste_field_titre('UnitPrice', $_SERVER['PHP_SELF'], '', '', $param, 'align="right"', $sortfield, $sortorder); print_liste_field_titre('UnitPrice', $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'right ');
print "</tr>\n"; print "</tr>\n";
@ -427,10 +427,10 @@ if ($sql_select)
print '<td class="nobordernopadding nowrap" width="100">'; print '<td class="nobordernopadding nowrap" width="100">';
print $documentstatic->getNomUrl(1); print $documentstatic->getNomUrl(1);
print '</td>'; print '</td>';
print '<td align="center" width="80">'.dol_print_date($db->jdate($objp->dateprint), 'day').'</td>'; print '<td class="center" width="80">'.dol_print_date($db->jdate($objp->dateprint), 'day').'</td>';
// Status // Status
print '<td align="center">'; print '<td class="center">';
if ($type_element == 'contract') if ($type_element == 'contract')
{ {
print $documentstaticline->getLibStatut(2); print $documentstaticline->getLibStatut(2);
@ -590,13 +590,13 @@ if ($sql_select)
//print '<td class="left">'.$prodreftxt.'</td>'; //print '<td class="left">'.$prodreftxt.'</td>';
print '<td>'.$objp->libelle.'</td>'; print '<td>'.$objp->libelle.'</td>';
print '<td align="right">'.$objp->prod_qty.'</td>'; print '<td class="right">'.$objp->prod_qty.'</td>';
$total_qty+=$objp->prod_qty; $total_qty+=$objp->prod_qty;
print '<td align="right">'.price($objp->total_ht).'</td>'; print '<td class="right">'.price($objp->total_ht).'</td>';
$total_ht+=$objp->total_ht; $total_ht+=$objp->total_ht;
print '<td align="right">'.price($objp->total_ht/(empty($objp->prod_qty)?1:$objp->prod_qty)).'</td>'; print '<td class="right">'.price($objp->total_ht/(empty($objp->prod_qty)?1:$objp->prod_qty)).'</td>';
print "</tr>\n"; print "</tr>\n";
$i++; $i++;
@ -606,9 +606,9 @@ if ($sql_select)
print '<td>' . $langs->trans('Total') . '</td>'; print '<td>' . $langs->trans('Total') . '</td>';
print '<td colspan="3"></td>'; print '<td colspan="3"></td>';
print '<td></td>'; print '<td></td>';
print '<td align="right">' . $total_qty . '</td>'; print '<td class="right">' . $total_qty . '</td>';
print '<td align="right">' . price($total_ht) . '</td>'; print '<td class="right">' . price($total_ht) . '</td>';
print '<td align="right">' . price($total_ht/(empty($total_qty)?1:$total_qty)) . '</td>'; print '<td class="right">' . price($total_ht/(empty($total_qty)?1:$total_qty)) . '</td>';
print "</table>"; print "</table>";
print '</div>'; print '</div>';
@ -616,26 +616,23 @@ if ($sql_select)
print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num); print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num);
} }
$db->free($resql); $db->free($resql);
} } elseif (empty($type_element) || $type_element == -1) {
elseif (empty($type_element) || $type_element == -1)
{
print_barre_liste($langs->trans('ProductsIntoElements').' '.$typeElementString.' '.$button, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, '', ''); print_barre_liste($langs->trans('ProductsIntoElements').' '.$typeElementString.' '.$button, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, '', '');
print '<table class="liste" width="100%">'."\n"; print '<table class="liste" width="100%">'."\n";
// Titles with sort buttons // Titles with sort buttons
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print_liste_field_titre('Ref', $_SERVER['PHP_SELF'], 'doc_number', '', $param, 'align="left"', $sortfield, $sortorder); print_liste_field_titre('Ref', $_SERVER['PHP_SELF'], 'doc_number', '', $param, '', $sortfield, $sortorder, 'left ');
print_liste_field_titre('Date', $_SERVER['PHP_SELF'], 'dateprint', '', $param, 'align="center" width="150"', $sortfield, $sortorder); print_liste_field_titre('Date', $_SERVER['PHP_SELF'], 'dateprint', '', $param, 'width="150"', $sortfield, $sortorder, 'center ');
print_liste_field_titre('Status', $_SERVER['PHP_SELF'], 'fk_status', '', $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre('Status', $_SERVER['PHP_SELF'], 'fk_status', '', $param, '', $sortfield, $sortorder, 'center ');
print_liste_field_titre('Product', $_SERVER['PHP_SELF'], '', '', $param, 'align="left"', $sortfield, $sortorder); print_liste_field_titre('Product', $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'left ');
print_liste_field_titre('Quantity', $_SERVER['PHP_SELF'], 'prod_qty', '', $param, 'align="right"', $sortfield, $sortorder); print_liste_field_titre('Quantity', $_SERVER['PHP_SELF'], 'prod_qty', '', $param, '', $sortfield, $sortorder, 'right ');
print "</tr>\n"; print "</tr>\n";
print '<tr class="oddeven"><td class="opacitymedium" colspan="5">'.$langs->trans("SelectElementAndClick", $langs->transnoentitiesnoconv("Search")).'</td></tr>'; print '<tr class="oddeven"><td class="opacitymedium" colspan="5">'.$langs->trans("SelectElementAndClick", $langs->transnoentitiesnoconv("Search")).'</td></tr>';
print "</table>"; print "</table>";
} } else {
else {
print_barre_liste($langs->trans('ProductsIntoElements').' '.$typeElementString.' '.$button, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, '', ''); print_barre_liste($langs->trans('ProductsIntoElements').' '.$typeElementString.' '.$button, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, '', '');
print '<table class="liste" width="100%">'."\n"; print '<table class="liste" width="100%">'."\n";

View File

@ -688,7 +688,9 @@ if (! empty($arrayfields['p.zip']['checked'])) print_liste_field
if (! empty($arrayfields['p.town']['checked'])) print_liste_field_titre($arrayfields['p.town']['label'], $_SERVER["PHP_SELF"], "p.town", $begin, $param, '', $sortfield, $sortorder); if (! empty($arrayfields['p.town']['checked'])) print_liste_field_titre($arrayfields['p.town']['label'], $_SERVER["PHP_SELF"], "p.town", $begin, $param, '', $sortfield, $sortorder);
//if (! empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'],$_SERVER["PHP_SELF"],"state.nom","",$param,'',$sortfield,$sortorder); //if (! empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'],$_SERVER["PHP_SELF"],"state.nom","",$param,'',$sortfield,$sortorder);
//if (! empty($arrayfields['region.nom']['checked'])) print_liste_field_titre($arrayfields['region.nom']['label'],$_SERVER["PHP_SELF"],"region.nom","",$param,'',$sortfield,$sortorder); //if (! empty($arrayfields['region.nom']['checked'])) print_liste_field_titre($arrayfields['region.nom']['label'],$_SERVER["PHP_SELF"],"region.nom","",$param,'',$sortfield,$sortorder);
if (! empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "co.code_iso", "", $param, 'align="center"', $sortfield, $sortorder); if (! empty($arrayfields['country.code_iso']['checked'])) {
print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "co.code_iso", "", $param, '', $sortfield, $sortorder, 'center ');
}
if (! empty($arrayfields['p.phone']['checked'])) print_liste_field_titre($arrayfields['p.phone']['label'], $_SERVER["PHP_SELF"], "p.phone", $begin, $param, '', $sortfield, $sortorder); if (! empty($arrayfields['p.phone']['checked'])) print_liste_field_titre($arrayfields['p.phone']['label'], $_SERVER["PHP_SELF"], "p.phone", $begin, $param, '', $sortfield, $sortorder);
if (! empty($arrayfields['p.phone_perso']['checked'])) print_liste_field_titre($arrayfields['p.phone_perso']['label'], $_SERVER["PHP_SELF"], "p.phone_perso", $begin, $param, '', $sortfield, $sortorder); if (! empty($arrayfields['p.phone_perso']['checked'])) print_liste_field_titre($arrayfields['p.phone_perso']['label'], $_SERVER["PHP_SELF"], "p.phone_perso", $begin, $param, '', $sortfield, $sortorder);
if (! empty($arrayfields['p.phone_mobile']['checked'])) print_liste_field_titre($arrayfields['p.phone_mobile']['label'], $_SERVER["PHP_SELF"], "p.phone_mobile", $begin, $param, '', $sortfield, $sortorder); if (! empty($arrayfields['p.phone_mobile']['checked'])) print_liste_field_titre($arrayfields['p.phone_mobile']['label'], $_SERVER["PHP_SELF"], "p.phone_mobile", $begin, $param, '', $sortfield, $sortorder);
@ -702,14 +704,27 @@ if (! empty($arrayfields['p.priv']['checked'])) print_liste_field
// Extra fields // Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
// Hook fields // Hook fields
$parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder); $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 $reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint; print $hookmanager->resPrint;
if (! empty($arrayfields['p.datec']['checked'])) print_liste_field_titre($arrayfields['p.datec']['label'], $_SERVER["PHP_SELF"], "p.datec", "", $param, '', $sortfield, $sortorder, 'center nowrap '); if (! empty($arrayfields['p.datec']['checked'])) {
if (! empty($arrayfields['p.tms']['checked'])) print_liste_field_titre($arrayfields['p.tms']['label'], $_SERVER["PHP_SELF"], "p.tms", "", $param, '', $sortfield, $sortorder, 'center nowrap '); print_liste_field_titre($arrayfields['p.datec']['label'], $_SERVER["PHP_SELF"], "p.datec", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
if (! empty($arrayfields['p.statut']['checked'])) print_liste_field_titre($arrayfields['p.statut']['label'], $_SERVER["PHP_SELF"], "p.statut", "", $param, '', $sortfield, $sortorder, 'center '); }
if (! empty($arrayfields['p.import_key']['checked'])) print_liste_field_titre($arrayfields['p.import_key']['label'], $_SERVER["PHP_SELF"], "p.import_key", "", $param, '', $sortfield, $sortorder, 'center '); if (! empty($arrayfields['p.tms']['checked'])) {
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch '); print_liste_field_titre($arrayfields['p.tms']['label'], $_SERVER["PHP_SELF"], "p.tms", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
}
if (! empty($arrayfields['p.statut']['checked'])) {
print_liste_field_titre($arrayfields['p.statut']['label'], $_SERVER["PHP_SELF"], "p.statut", "", $param, '', $sortfield, $sortorder, 'center ');
}
if (! empty($arrayfields['p.import_key']['checked'])) {
print_liste_field_titre($arrayfields['p.import_key']['label'], $_SERVER["PHP_SELF"], "p.import_key", "", $param, '', $sortfield, $sortorder, 'center ');
}
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
print "</tr>\n"; print "</tr>\n";

View File

@ -157,13 +157,13 @@ if ($action == 'edit')
print '</td>'; print '</td>';
// Photo // Photo
print '<td align="center" class="hideonsmartphone" valign="middle" rowspan="6">'; print '<td class="center hideonsmartphone valignmiddle" rowspan="6">';
print $form->showphoto('contact', $object)."\n"; print $form->showphoto('contact', $object)."\n";
if ($object->photo) print "<br>\n"; if ($object->photo) print "<br>\n";
print '<table class="nobordernopadding">'; print '<table class="nobordernopadding">';
if ($object->photo) print '<tr><td align="center"><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> '.$langs->trans("Delete").'<br><br></td></tr>'; if ($object->photo) print '<tr><td class="center"><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> '.$langs->trans("Delete").'<br><br></td></tr>';
print '<tr><td>'.$langs->trans("PhotoFile").'</td></tr>'; print '<tr><td>'.$langs->trans("PhotoFile").'</td></tr>';
print '<tr><td><input type="file" class="flat" name="photo" id="photoinput"></td></tr>'; print '<tr><td><input type="file" class="flat" name="photo" id="photoinput"></td></tr>';
print '</table>'; print '</table>';

View File

@ -1563,14 +1563,14 @@ else
print '<tr class="liste_titre'.($cursorline?' liste_titre_add':'').'">'; print '<tr class="liste_titre'.($cursorline?' liste_titre_add':'').'">';
print '<td>'.$langs->trans("ServiceNb", $cursorline).'</td>'; print '<td>'.$langs->trans("ServiceNb", $cursorline).'</td>';
print '<td width="80" align="center">'.$langs->trans("VAT").'</td>'; print '<td width="80" align="center">'.$langs->trans("VAT").'</td>';
print '<td width="80" align="right">'.$langs->trans("PriceUHT").'</td>'; print '<td width="80" class="right">'.$langs->trans("PriceUHT").'</td>';
if (!empty($conf->multicurrency->enabled)) { if (!empty($conf->multicurrency->enabled)) {
print '<td width="80" align="right">'.$langs->trans("PriceUHTCurrency").'</td>'; print '<td width="80" class="right">'.$langs->trans("PriceUHTCurrency").'</td>';
} }
print '<td width="30" align="center">'.$langs->trans("Qty").'</td>'; print '<td width="30" align="center">'.$langs->trans("Qty").'</td>';
if ($conf->global->PRODUCT_USE_UNITS) print '<td width="30" align="left">'.$langs->trans("Unit").'</td>'; if ($conf->global->PRODUCT_USE_UNITS) print '<td width="30" class="left">'.$langs->trans("Unit").'</td>';
print '<td width="50" align="right">'.$langs->trans("ReductionShort").'</td>'; print '<td width="50" class="right">'.$langs->trans("ReductionShort").'</td>';
if (! empty($conf->margin->enabled) && ! empty($conf->global->MARGIN_SHOW_ON_CONTRACT)) print '<td width="50" align="right">'.$langs->trans("BuyingPrice").'</td>'; if (! empty($conf->margin->enabled) && ! empty($conf->global->MARGIN_SHOW_ON_CONTRACT)) print '<td width="50" class="right">'.$langs->trans("BuyingPrice").'</td>';
print '<td width="30">&nbsp;</td>'; print '<td width="30">&nbsp;</td>';
print "</tr>\n"; print "</tr>\n";
@ -1618,10 +1618,10 @@ else
print vatrate($objp->tva_tx.($objp->vat_src_code?(' ('.$objp->vat_src_code.')'):''), '%', $objp->info_bits); print vatrate($objp->tva_tx.($objp->vat_src_code?(' ('.$objp->vat_src_code.')'):''), '%', $objp->info_bits);
print '</td>'; print '</td>';
// Price // Price
print '<td align="right">'.($objp->subprice != '' ? price($objp->subprice) : '')."</td>\n"; print '<td class="right">'.($objp->subprice != '' ? price($objp->subprice) : '')."</td>\n";
// Price multicurrency // Price multicurrency
if (!empty($conf->multicurrency->enabled)) { if (!empty($conf->multicurrency->enabled)) {
print '<td align="right" class="linecoluht_currency nowrap">'.price($objp->multicurrency_subprice).'</td>'; print '<td class="linecoluht_currency nowrap right">'.price($objp->multicurrency_subprice).'</td>';
} }
// Quantite // Quantite
print '<td align="center">'.$objp->qty.'</td>'; print '<td align="center">'.$objp->qty.'</td>';
@ -1630,7 +1630,7 @@ else
// Remise // Remise
if ($objp->remise_percent > 0) if ($objp->remise_percent > 0)
{ {
print '<td align="right">'.$objp->remise_percent."%</td>\n"; print '<td class="right">'.$objp->remise_percent."%</td>\n";
} }
else else
{ {
@ -1641,7 +1641,7 @@ else
if (! empty($conf->margin->enabled) && ! empty($conf->global->MARGIN_SHOW_ON_CONTRACT)) print '<td align="right" class="nowrap">'.price($objp->pa_ht).'</td>'; if (! empty($conf->margin->enabled) && ! empty($conf->global->MARGIN_SHOW_ON_CONTRACT)) print '<td align="right" class="nowrap">'.price($objp->pa_ht).'</td>';
// Icon move, update et delete (statut contrat 0=brouillon,1=valide,2=ferme) // Icon move, update et delete (statut contrat 0=brouillon,1=valide,2=ferme)
print '<td align="right" class="nowrap">'; print '<td class="nowrap right">';
if ($user->rights->contrat->creer && count($arrayothercontracts) && ($object->statut >= 0)) if ($user->rights->contrat->creer && count($arrayothercontracts) && ($object->statut >= 0))
{ {
print '<!-- link to move service line into another contract -->'; print '<!-- link to move service line into another contract -->';
@ -1746,10 +1746,10 @@ else
$doleditor->Create(); $doleditor->Create();
print '</td>'; print '</td>';
print '<td align="right">'; print '<td class="right">';
print $form->load_tva("eltva_tx", $objp->tva_tx.($objp->vat_src_code?(' ('.$objp->vat_src_code.')'):''), $mysoc, $object->thirdparty, $objp->fk_product, $objp->info_bits, $objp->product_type, 0, 1); print $form->load_tva("eltva_tx", $objp->tva_tx.($objp->vat_src_code?(' ('.$objp->vat_src_code.')'):''), $mysoc, $object->thirdparty, $objp->fk_product, $objp->info_bits, $objp->product_type, 0, 1);
print '</td>'; print '</td>';
print '<td align="right"><input size="5" type="text" name="elprice" value="'.price($objp->subprice).'"></td>'; print '<td class="right"><input size="5" type="text" name="elprice" value="'.price($objp->subprice).'"></td>';
print '<td align="center"><input size="2" type="text" name="elqty" value="'.$objp->qty.'"></td>'; print '<td align="center"><input size="2" type="text" name="elqty" value="'.$objp->qty.'"></td>';
if ($conf->global->PRODUCT_USE_UNITS) if ($conf->global->PRODUCT_USE_UNITS)
{ {
@ -1757,10 +1757,10 @@ else
print $form->selectUnits($objp->fk_unit, "unit"); print $form->selectUnits($objp->fk_unit, "unit");
print '</td>'; print '</td>';
} }
print '<td align="right" class="nowrap"><input size="1" type="text" name="elremise_percent" value="'.$objp->remise_percent.'">%</td>'; print '<td class="nowrap right"><input size="1" type="text" name="elremise_percent" value="'.$objp->remise_percent.'">%</td>';
if (! empty($usemargins)) if (! empty($usemargins))
{ {
print '<td align="right">'; print '<td class="right">';
if ($objp->fk_product) print '<select id="fournprice" name="fournprice"></select>'; if ($objp->fk_product) print '<select id="fournprice" name="fournprice"></select>';
print '<input id="buying_price" type="text" size="5" name="buying_price" value="'.price($objp->pa_ht, 0, '', 0).'"></td>'; print '<input id="buying_price" type="text" size="5" name="buying_price" value="'.price($objp->pa_ht, 0, '', 0).'"></td>';
} }
@ -1880,7 +1880,7 @@ else
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$langs->trans("ServiceStatus").': '.$object->lines[$cursorline-1]->getLibStatut(4).'</td>'; print '<td>'.$langs->trans("ServiceStatus").': '.$object->lines[$cursorline-1]->getLibStatut(4).'</td>';
print '<td width="30" align="right">'; print '<td width="30" class="right">';
if ($user->societe_id == 0) if ($user->societe_id == 0)
{ {
if ($object->statut > 0 && $action != 'activateline' && $action != 'unactivateline') if ($object->statut > 0 && $action != 'activateline' && $action != 'unactivateline')

View File

@ -156,11 +156,11 @@ if ($id > 0 || ! empty($ref))
$morehtmlref.='<div class="refidno">'; $morehtmlref.='<div class="refidno">';
// Ref customer // Ref customer
$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_customer', $object->ref_customer, $object, 0, 'string', '', 0, 1); $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_customer', $object->ref_customer, $object, 0, 'string', '', 0, 1);
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, 0, 'string', '', null, null, '', 1); $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, 0, 'string', '', null, null, '', 1, 'getFormatedCustomerRef');
// Ref supplier // Ref supplier
$morehtmlref.='<br>'; $morehtmlref.='<br>';
$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1); $morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1);
$morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1); $morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1, 'getFormatedSupplierRef');
// Thirdparty // Thirdparty
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); $morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
// Project // Project

View File

@ -128,11 +128,11 @@ if ($object->id)
$morehtmlref.='<div class="refidno">'; $morehtmlref.='<div class="refidno">';
// Ref customer // Ref customer
$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_customer', $object->ref_customer, $object, 0, 'string', '', 0, 1); $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_customer', $object->ref_customer, $object, 0, 'string', '', 0, 1);
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, 0, 'string', '', null, null, '', 1); $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, 0, 'string', '', null, null, '', 1, 'getFormatedCustomerRef');
// Ref supplier // Ref supplier
$morehtmlref.='<br>'; $morehtmlref.='<br>';
$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1); $morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1);
$morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1); $morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1, 'getFormatedSupplierRef');
// Thirdparty // Thirdparty
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); $morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
// Project // Project

View File

@ -189,7 +189,7 @@ foreach($listofstatus as $status)
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$staticcontratligne->LibStatut($status, 0, ($bool?1:0)).'</td>'; print '<td>'.$staticcontratligne->LibStatut($status, 0, ($bool?1:0)).'</td>';
print '<td align="right"><a href="services_list.php?mode='.$status.($bool?'&filter=expired':'').'">'.($nb[$status.$bool]?$nb[$status.$bool]:0).' '.$staticcontratligne->LibStatut($status, 3, ($bool?1:0)).'</a></td>'; print '<td class="right"><a href="services_list.php?mode='.$status.($bool?'&filter=expired':'').'">'.($nb[$status.$bool]?$nb[$status.$bool]:0).' '.$staticcontratligne->LibStatut($status, 3, ($bool?1:0)).'</a></td>';
print "</tr>\n"; print "</tr>\n";
} }
if ($status==4 && ! $bool) $bool=true; if ($status==4 && ! $bool) $bool=true;
@ -218,15 +218,15 @@ foreach($listofstatus as $status)
{ {
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$staticcontratligne->LibStatut($status, 0, ($bool?1:0)).'</td>'; print '<td>'.$staticcontratligne->LibStatut($status, 0, ($bool?1:0)).'</td>';
print '<td align="right"><a href="services_list.php?mode='.$status.($bool?'&filter=expired':'').'">'.($nb[$status.$bool]?$nb[$status.$bool]:0).' '.$staticcontratligne->LibStatut($status, 3, ($bool?1:0)).'</a></td>'; print '<td class="right"><a href="services_list.php?mode='.$status.($bool?'&filter=expired':'').'">'.($nb[$status.$bool]?$nb[$status.$bool]:0).' '.$staticcontratligne->LibStatut($status, 3, ($bool?1:0)).'</a></td>';
if ($status==4 && ! $bool) $bool=true; if ($status==4 && ! $bool) $bool=true;
else $bool=false; else $bool=false;
print "</tr>\n"; print "</tr>\n";
} }
} }
//if ($totalinprocess != $total) //if ($totalinprocess != $total)
//print '<tr class="liste_total"><td>'.$langs->trans("Total").' ('.$langs->trans("ServicesRunning").')</td><td align="right">'.$totalinprocess.'</td></tr>'; //print '<tr class="liste_total"><td>'.$langs->trans("Total").' ('.$langs->trans("ServicesRunning").')</td><td class="right">'.$totalinprocess.'</td></tr>';
print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td align="right">'.$total.'</td></tr>'; print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td class="right">'.$total.'</td></tr>';
print "</table><br>"; print "</table><br>";
@ -332,7 +332,7 @@ if ($result)
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("LastContracts", 5).'</th>'; print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("LastContracts", 5).'</th>';
print '<th align="center">'.$langs->trans("DateModification").'</th>'; print '<th align="center">'.$langs->trans("DateModification").'</th>';
//print '<th align="left">'.$langs->trans("Status").'</th>'; //print '<th class="left">'.$langs->trans("Status").'</th>';
print '<th align="center" width="80" colspan="4">'.$langs->trans("Services").'</th>'; print '<th align="center" width="80" colspan="4">'.$langs->trans("Services").'</th>';
print "</tr>\n"; print "</tr>\n";
@ -354,10 +354,10 @@ if ($result)
print '</td>'; print '</td>';
print '<td align="center">'.dol_print_date($db->jdate($obj->tms), 'dayhour').'</td>'; print '<td align="center">'.dol_print_date($db->jdate($obj->tms), 'dayhour').'</td>';
//print '<td class="left">'.$staticcontrat->LibStatut($obj->statut,2).'</td>'; //print '<td class="left">'.$staticcontrat->LibStatut($obj->statut,2).'</td>';
print '<td align="right" width="32">'.($obj->nb_initial>0 ? $obj->nb_initial.$staticcontratligne->LibStatut(0, 3):'').'</td>'; print '<td class="right" width="32">'.($obj->nb_initial>0 ? $obj->nb_initial.$staticcontratligne->LibStatut(0, 3):'').'</td>';
print '<td align="right" width="32">'.($obj->nb_running>0 ? $obj->nb_running.$staticcontratligne->LibStatut(4, 3, 0):'').'</td>'; print '<td class="right" width="32">'.($obj->nb_running>0 ? $obj->nb_running.$staticcontratligne->LibStatut(4, 3, 0):'').'</td>';
print '<td align="right" width="32">'.($obj->nb_expired>0 ? $obj->nb_expired.$staticcontratligne->LibStatut(4, 3, 1):'').'</td>'; print '<td class="right" width="32">'.($obj->nb_expired>0 ? $obj->nb_expired.$staticcontratligne->LibStatut(4, 3, 1):'').'</td>';
print '<td align="right" width="32">'.($obj->nb_closed>0 ? $obj->nb_closed.$staticcontratligne->LibStatut(5, 3):'').'</td>'; print '<td class="right" width="32">'.($obj->nb_closed>0 ? $obj->nb_closed.$staticcontratligne->LibStatut(5, 3):'').'</td>';
print "</tr>\n"; print "</tr>\n";
$i++; $i++;
} }
@ -432,7 +432,7 @@ if ($resql)
$staticcompany->name=$obj->name; $staticcompany->name=$obj->name;
print $staticcompany->getNomUrl(1, '', 20); print $staticcompany->getNomUrl(1, '', 20);
print '</td>'; print '</td>';
print '<td class="nowrap" align="right"><a href="'.DOL_URL_ROOT.'/contrat/card.php?id='.$obj->fk_contrat.'&ligne='.$obj->cid.'">'; print '<td class="nowrap right"><a href="'.DOL_URL_ROOT.'/contrat/card.php?id='.$obj->fk_contrat.'&ligne='.$obj->cid.'">';
$dateend=$db->jdate($obj->date_fin_validite); $dateend=$db->jdate($obj->date_fin_validite);
print $staticcontratligne->LibStatut($obj->statut, 3, ($dateend && $dateend < $now)?1:0); print $staticcontratligne->LibStatut($obj->statut, 3, ($dateend && $dateend < $now)?1:0);
print '</a></td>'; print '</a></td>';
@ -511,7 +511,7 @@ if ($resql)
$staticcompany->name=$obj->name; $staticcompany->name=$obj->name;
print $staticcompany->getNomUrl(1, '', 20); print $staticcompany->getNomUrl(1, '', 20);
print '</td>'; print '</td>';
print '<td width="16" align="right"><a href="ligne.php?id='.$obj->fk_contrat.'&ligne='.$obj->cid.'">'; print '<td width="16" class="right"><a href="ligne.php?id='.$obj->fk_contrat.'&ligne='.$obj->cid.'">';
print $staticcontratligne->LibStatut($obj->statut, 3); print $staticcontratligne->LibStatut($obj->statut, 3);
print '</a></td>'; print '</a></td>';
print "</tr>\n"; print "</tr>\n";
@ -590,7 +590,7 @@ if ($resql)
$staticcompany->name=$obj->name; $staticcompany->name=$obj->name;
print $staticcompany->getNomUrl(1, '', 20); print $staticcompany->getNomUrl(1, '', 20);
print '</td>'; print '</td>';
print '<td width="16" align="right"><a href="ligne.php?id='.$obj->fk_contrat.'&ligne='.$obj->cid.'">'; print '<td width="16" class="right"><a href="ligne.php?id='.$obj->fk_contrat.'&ligne='.$obj->cid.'">';
print $staticcontratligne->LibStatut($obj->statut, 3, 1); print $staticcontratligne->LibStatut($obj->statut, 3, 1);
print '</a></td>'; print '</a></td>';
print "</tr>\n"; print "</tr>\n";

View File

@ -92,11 +92,11 @@ $morehtmlref.=$form->editfieldval("",'ref',$object->ref,0,'string','',0,2);
$morehtmlref.='<div class="refidno">'; $morehtmlref.='<div class="refidno">';
// Ref customer // Ref customer
$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_customer', $object->ref_customer, $object, 0, 'string', '', 0, 1); $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_customer', $object->ref_customer, $object, 0, 'string', '', 0, 1);
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, 0, 'string', '', null, null, '', 1); $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, 0, 'string', '', null, null, '', 1, 'getFormatedCustomerRef');
// Ref supplier // Ref supplier
$morehtmlref.='<br>'; $morehtmlref.='<br>';
$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1); $morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1);
$morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1); $morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1, 'getFormatedSupplierRef');
// Thirdparty // Thirdparty
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); $morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
// Project // Project

View File

@ -559,7 +559,7 @@ if (! empty($arrayfields['lower_planned_end_date']['checked']))
// Status // Status
if (! empty($arrayfields['status']['checked'])) if (! empty($arrayfields['status']['checked']))
{ {
print '<td class="liste_titre" colspan="4" align="right"></td>'; print '<td class="liste_titre right" colspan="4"></td>';
} }
print '<td class="liste_titre" align="middle">'; print '<td class="liste_titre" align="middle">';
$searchpicto=$form->showFilterButtons(); $searchpicto=$form->showFilterButtons();

View File

@ -96,11 +96,11 @@ if ($id > 0 || ! empty($ref))
$morehtmlref.='<div class="refidno">'; $morehtmlref.='<div class="refidno">';
// Ref customer // Ref customer
$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_customer', $object->ref_customer, $object, 0, 'string', '', 0, 1); $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_customer', $object->ref_customer, $object, 0, 'string', '', 0, 1);
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, 0, 'string', '', null, null, '', 1); $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, 0, 'string', '', null, null, '', 1, 'getFormatedCustomerRef');
// Ref supplier // Ref supplier
$morehtmlref.='<br>'; $morehtmlref.='<br>';
$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1); $morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1);
$morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1); $morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1, 'getFormatedSupplierRef');
// Thirdparty // Thirdparty
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); $morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
// Project // Project

View File

@ -394,7 +394,7 @@ $reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters); // N
print $hookmanager->resPrint; print $hookmanager->resPrint;
if (! empty($arrayfields['cd.datec']['checked'])) print_liste_field_titre($arrayfields['cd.datec']['label'], $_SERVER["PHP_SELF"], "cd.datec", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder); if (! empty($arrayfields['cd.datec']['checked'])) print_liste_field_titre($arrayfields['cd.datec']['label'], $_SERVER["PHP_SELF"], "cd.datec", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder);
if (! empty($arrayfields['cd.tms']['checked'])) print_liste_field_titre($arrayfields['cd.tms']['label'], $_SERVER["PHP_SELF"], "cd.tms", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder); if (! empty($arrayfields['cd.tms']['checked'])) print_liste_field_titre($arrayfields['cd.tms']['label'], $_SERVER["PHP_SELF"], "cd.tms", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder);
if (! empty($arrayfields['status']['checked'])) print_liste_field_titre($arrayfields['status']['label'], $_SERVER["PHP_SELF"], "cd.statut,c.statut", "", $param, 'align="right"', $sortfield, $sortorder); if (! empty($arrayfields['status']['checked'])) print_liste_field_titre($arrayfields['status']['label'], $_SERVER["PHP_SELF"], "cd.statut,c.statut", "", $param, '', $sortfield, $sortorder, 'right ');
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch '); print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ');
print "</tr>\n"; print "</tr>\n";
@ -511,7 +511,7 @@ if (! empty($arrayfields['cd.tms']['checked']))
if (! empty($arrayfields['status']['checked'])) if (! empty($arrayfields['status']['checked']))
{ {
// Status // Status
print '<td class="liste_titre" align="right">'; print '<td class="liste_titre right">';
$arrayofstatus=array( $arrayofstatus=array(
'0'=>$langs->trans("ServiceStatusInitial"), '0'=>$langs->trans("ServiceStatusInitial"),
'4'=>$langs->trans("ServiceStatusRunning"), '4'=>$langs->trans("ServiceStatusRunning"),
@ -523,7 +523,7 @@ if (! empty($arrayfields['status']['checked']))
print '</td>'; print '</td>';
} }
// Action column // Action column
print '<td class="liste_titre" align="right">'; print '<td class="liste_titre right">';
$searchpicto=$form->showFilterAndCheckAddButtons(0); $searchpicto=$form->showFilterAndCheckAddButtons(0);
print $searchpicto; print $searchpicto;
print '</td>'; print '</td>';
@ -589,7 +589,7 @@ while ($i < min($num, $limit))
} }
if (! empty($arrayfields['cd.total_ht']['checked'])) if (! empty($arrayfields['cd.total_ht']['checked']))
{ {
print '<td align="right">'; print '<td class="right">';
print price($obj->total_ht); print price($obj->total_ht);
print '</td>'; print '</td>';
$totalarray['totalht'] += $obj->total_ht; $totalarray['totalht'] += $obj->total_ht;
@ -601,7 +601,7 @@ while ($i < min($num, $limit))
} }
if (! empty($arrayfields['cd.total_tva']['checked'])) if (! empty($arrayfields['cd.total_tva']['checked']))
{ {
print '<td align="right">'; print '<td class="right">';
print price($obj->total_tva); print price($obj->total_tva);
print '</td>'; print '</td>';
$totalarray['totalvat'] += $obj->total_tva; $totalarray['totalvat'] += $obj->total_tva;
@ -613,14 +613,14 @@ while ($i < min($num, $limit))
} }
if (! empty($arrayfields['cd.tva_tx']['checked'])) if (! empty($arrayfields['cd.tva_tx']['checked']))
{ {
print '<td align="right">'; print '<td class="right">';
print price2num($obj->tva_tx).'%'; print price2num($obj->tva_tx).'%';
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['nbfield']++;
} }
if (! empty($arrayfields['cd.subprice']['checked'])) if (! empty($arrayfields['cd.subprice']['checked']))
{ {
print '<td align="right">'; print '<td class="right">';
print price($obj->subprice); print price($obj->subprice);
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['nbfield']++;
@ -698,7 +698,7 @@ while ($i < min($num, $limit))
// Status // Status
if (! empty($arrayfields['status']['checked'])) if (! empty($arrayfields['status']['checked']))
{ {
print '<td align="right">'; print '<td class="right">';
if ($obj->cstatut == 0) // If contract is draft, we say line is also draft if ($obj->cstatut == 0) // If contract is draft, we say line is also draft
{ {
print $contractstatic->LibStatut(0, 5, ($obj->date_fin_validite && $db->jdate($obj->date_fin_validite) < $now)); print $contractstatic->LibStatut(0, 5, ($obj->date_fin_validite && $db->jdate($obj->date_fin_validite) < $now));
@ -735,9 +735,9 @@ if (isset($totalarray['displaytotalline'])) {
if ($num < $limit && empty($offset)) print '<td class="left">'.$langs->trans("Total").'</td>'; if ($num < $limit && empty($offset)) print '<td class="left">'.$langs->trans("Total").'</td>';
else print '<td class="left">'.$langs->trans("Totalforthispage").'</td>'; else print '<td class="left">'.$langs->trans("Totalforthispage").'</td>';
} }
elseif ($totalarray['totalhtfield'] == $i) print '<td align="right">'.price($totalarray['totalht']).'</td>'; elseif ($totalarray['totalhtfield'] == $i) print '<td class="right">'.price($totalarray['totalht']).'</td>';
elseif ($totalarray['totalvatfield'] == $i) print '<td align="right">'.price($totalarray['totalvat']).'</td>'; elseif ($totalarray['totalvatfield'] == $i) print '<td class="right">'.price($totalarray['totalvat']).'</td>';
elseif ($totalarray['totalttcfield'] == $i) print '<td align="right">'.price($totalarray['totalttc']).'</td>'; elseif ($totalarray['totalttcfield'] == $i) print '<td class="right">'.price($totalarray['totalttc']).'</td>';
else print '<td></td>'; else print '<td></td>';
} }
print '</tr>'; print '</tr>';

View File

@ -51,7 +51,7 @@ foreach($linkedObjectBlock as $key => $objectlink)
<td><?php echo $objectlink->getNomUrl(1); ?></td> <td><?php echo $objectlink->getNomUrl(1); ?></td>
<td></td> <td></td>
<td align="center"><?php echo dol_print_date($objectlink->date_contrat, 'day'); ?></td> <td align="center"><?php echo dol_print_date($objectlink->date_contrat, 'day'); ?></td>
<td align="right"><?php <td class="right"><?php
// Price of contract is not shown by default because a contract is a list of service with // Price of contract is not shown by default because a contract is a list of service with
// start and end date that change with time andd that may be different that the period of reference for price. // start and end date that change with time andd that may be different that the period of reference for price.
// So price of a contract does often means nothing. Prices is on the different invoices done on same contract. // So price of a contract does often means nothing. Prices is on the different invoices done on same contract.
@ -64,8 +64,8 @@ foreach($linkedObjectBlock as $key => $objectlink)
} }
echo price($totalcontrat); echo price($totalcontrat);
} ?></td> } ?></td>
<td align="right"><?php echo $objectlink->getLibStatut(7); ?></td> <td class="right"><?php echo $objectlink->getLibStatut(7); ?></td>
<td align="right"><a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key; ?>"><?php echo img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink'); ?></a></td> <td class="right"><a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key; ?>"><?php echo img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink'); ?></a></td>
</tr> </tr>
<?php } ?> <?php } ?>

View File

@ -425,7 +425,7 @@ function treeOutputForAbsoluteDir($sqltree, $selecteddir, $fullpathselecteddir,
print '</td>';*/ print '</td>';*/
// Nb of docs // Nb of docs
print '<td align="right">'; print '<td class="right">';
print (isset($val['cachenbofdoc']) && $val['cachenbofdoc'] >= 0)?$val['cachenbofdoc']:'&nbsp;'; print (isset($val['cachenbofdoc']) && $val['cachenbofdoc'] >= 0)?$val['cachenbofdoc']:'&nbsp;';
print '</td>'; print '</td>';
print '<td class="left">'; print '<td class="left">';
@ -433,19 +433,19 @@ function treeOutputForAbsoluteDir($sqltree, $selecteddir, $fullpathselecteddir,
print '</td>'; print '</td>';
// Edit link // Edit link
print '<td align="right" width="18"><a href="'; print '<td class="right" width="18"><a href="';
print DOL_URL_ROOT.'/ecm/dir_card.php?module='.urlencode($modulepart).'&section='.$val['id'].'&relativedir='.urlencode($val['fullrelativename']); print DOL_URL_ROOT.'/ecm/dir_card.php?module='.urlencode($modulepart).'&section='.$val['id'].'&relativedir='.urlencode($val['fullrelativename']);
print '&backtopage='.urlencode($_SERVER["PHP_SELF"].'?file_manager=1&website='.$websitekey.'&pageid='.$pageid); print '&backtopage='.urlencode($_SERVER["PHP_SELF"].'?file_manager=1&website='.$websitekey.'&pageid='.$pageid);
print '">'.img_edit($langs->trans("Edit").' - '.$langs->trans("View"), 0, 'class="valignmiddle opacitymedium"').'</a></td>'; print '">'.img_edit($langs->trans("Edit").' - '.$langs->trans("View"), 0, 'class="valignmiddle opacitymedium"').'</a></td>';
// Add link // Add link
//print '<td align="right"><a href="'.DOL_URL_ROOT.'/ecm/dir_add_card.php?action=create&amp;catParent='.$val['id'].'">'.img_edit_add().'</a></td>'; //print '<td class="right"><a href="'.DOL_URL_ROOT.'/ecm/dir_add_card.php?action=create&amp;catParent='.$val['id'].'">'.img_edit_add().'</a></td>';
//print '<td align="right" width="14">&nbsp;</td>'; //print '<td class="right" width="14">&nbsp;</td>';
// Info // Info
if ($modulepart == 'ecm') if ($modulepart == 'ecm')
{ {
print '<td align="right" width="18">'; print '<td class="right" width="18">';
$userstatic->id=isset($val['fk_user_c'])?$val['fk_user_c']:0; $userstatic->id=isset($val['fk_user_c'])?$val['fk_user_c']:0;
$userstatic->lastname=isset($val['login_c'])?$val['login_c']:0; $userstatic->lastname=isset($val['login_c'])?$val['login_c']:0;
$htmltooltip='<b>'.$langs->trans("ECMSection").'</b>: '.$val['label'].'<br>'; $htmltooltip='<b>'.$langs->trans("ECMSection").'</b>: '.$val['label'].'<br>';

View File

@ -28,18 +28,18 @@ include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php';
*/ */
class box_graph_orders_supplier_permonth extends ModeleBoxes class box_graph_orders_supplier_permonth extends ModeleBoxes
{ {
var $boxcode="orderssupplierpermonth"; public $boxcode="orderssupplierpermonth";
var $boximg="object_order"; public $boximg="object_order";
var $boxlabel="BoxSuppliersOrdersPerMonth"; public $boxlabel="BoxSuppliersOrdersPerMonth";
var $depends = array("fournisseur"); public $depends = array("fournisseur");
/** /**
* @var DoliDB Database handler. * @var DoliDB Database handler.
*/ */
public $db; public $db;
var $info_box_head = array(); public $info_box_head = array();
var $info_box_contents = array(); public $info_box_contents = array();
/** /**

View File

@ -3,7 +3,7 @@
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2005-2012 Maxime Kohlhaas <mko@atm-consulting.fr> * Copyright (C) 2005-2012 Maxime Kohlhaas <mko@atm-consulting.fr>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr> * Copyright (C) 2015-2019 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -117,6 +117,8 @@ class box_produits_alerte_stock extends ModeleBoxes
while ($line < $num) { while ($line < $num) {
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
$datem=$db->jdate($objp->tms); $datem=$db->jdate($objp->tms);
$price = '';
$price_base_type = '';
// Multilangs // Multilangs
if (! empty($conf->global->MAIN_MULTILANGS)) // si l'option est active if (! empty($conf->global->MAIN_MULTILANGS)) // si l'option est active

View File

@ -59,7 +59,7 @@ class box_project extends ModeleBoxes
$langs->loadLangs(array('boxes', 'projects')); $langs->loadLangs(array('boxes', 'projects'));
$this->db = $db; $this->db = $db;
$this->boxlabel="Projects"; $this->boxlabel="OpenedProjects";
$this->hidden=! ($user->rights->projet->lire); $this->hidden=! ($user->rights->projet->lire);
} }

View File

@ -570,7 +570,7 @@ abstract class CommonDocGenerator
'line_multicurrency_total_ttc_locale' => price($line->multicurrency_total_ttc, 0, $outputlangs), 'line_multicurrency_total_ttc_locale' => price($line->multicurrency_total_ttc, 0, $outputlangs),
); );
// Units // Units
if ($conf->global->PRODUCT_USE_UNITS) if ($conf->global->PRODUCT_USE_UNITS)
{ {
$resarray['line_unit']=$outputlangs->trans($line->getLabelOfUnit('long')); $resarray['line_unit']=$outputlangs->trans($line->getLabelOfUnit('long'));
@ -882,7 +882,7 @@ abstract class CommonDocGenerator
// Sorting // Sorting
uasort ($this->cols, array( $this, 'columnSort' )); uasort($this->cols, array($this, 'columnSort'));
// Positionning // Positionning
$curX = $this->page_largeur-$this->marge_droite; // start from right $curX = $this->page_largeur-$this->marge_droite; // start from right
@ -945,10 +945,10 @@ abstract class CommonDocGenerator
} }
/** /**
* get column content width from column key * get column content width from column key
* *
* @param string $colKey the column key * @param string $colKey the column key
* @return float width in mm * @return float width in mm
*/ */
function getColumnContentWidth($colKey) function getColumnContentWidth($colKey)
{ {
@ -1025,13 +1025,13 @@ abstract class CommonDocGenerator
/** /**
* print standard column content * print standard column content
* *
* @param PDF $pdf pdf object * @param PDF $pdf pdf object
* @param float $curY curent Y position * @param float $curY curent Y position
* @param string $colKey the column key * @param string $colKey the column key
* @param string $columnText column text * @param string $columnText column text
* @return int new rank on success and -1 on error * @return int new rank on success and -1 on error
*/ */
function printStdColumnContent($pdf, &$curY, $colKey, $columnText = '') function printStdColumnContent($pdf, &$curY, $colKey, $columnText = '')
{ {

View File

@ -936,14 +936,14 @@ class DolGraph
$tag=dol_escape_htmltag(dol_string_unaccent(dol_string_nospecial(basename($file), '_', array('-','.')))); $tag=dol_escape_htmltag(dol_string_unaccent(dol_string_nospecial(basename($file), '_', array('-','.'))));
$this->stringtoshow ='<!-- Build using '.$this->_library.' -->'."\n"; $this->stringtoshow ='<!-- Build using '.$this->_library.' -->'."\n";
if (! empty($this->title)) $this->stringtoshow.='<div align="center" class="dolgraphtitle'.(empty($this->cssprefix)?'':' dolgraphtitle'.$this->cssprefix).'">'.$this->title.'</div>'; if (! empty($this->title)) $this->stringtoshow.='<div class="center" class="dolgraphtitle'.(empty($this->cssprefix)?'':' dolgraphtitle'.$this->cssprefix).'">'.$this->title.'</div>';
if (! empty($this->shownographyet)) if (! empty($this->shownographyet))
{ {
$this->stringtoshow.='<div style="width:'.$this->width.'px;height:'.$this->height.'px;" class="nographyet"></div>'; $this->stringtoshow.='<div style="width:'.$this->width.'px;height:'.$this->height.'px;" class="nographyet"></div>';
$this->stringtoshow.='<div class="nographyettext">'.$langs->trans("NotEnoughDataYet").'</div>'; $this->stringtoshow.='<div class="nographyettext">'.$langs->trans("NotEnoughDataYet").'</div>';
return; return;
} }
$this->stringtoshow.='<div id="placeholder_'.$tag.'" style="width:'.$this->width.'px;height:'.$this->height.'px;" class="dolgraph'.(empty($this->cssprefix)?'':' dolgraph'.$this->cssprefix).'"></div>'."\n"; $this->stringtoshow.='<div id="placeholder_'.$tag.'" style="width:'.$this->width.'px;height:'.$this->height.'px;" class="dolgraph'.(empty($this->cssprefix)?'':' dolgraph'.$this->cssprefix).' center"></div>'."\n";
$this->stringtoshow.='<script id="'.$tag.'">'."\n"; $this->stringtoshow.='<script id="'.$tag.'">'."\n";
$this->stringtoshow.='$(function () {'."\n"; $this->stringtoshow.='$(function () {'."\n";

View File

@ -9,7 +9,7 @@
* Copyright (C) 2015 Charles-Fr BENKE <charles.fr@benke.fr> * Copyright (C) 2015 Charles-Fr BENKE <charles.fr@benke.fr>
* Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr> * Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2017 Nicolas ZABOURI <info@inovea-conseil.com> * Copyright (C) 2017 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -42,84 +42,138 @@ class ExtraFields
*/ */
public $db; public $db;
// type of element (for what object is the extrafield) /**
// @deprecated * @var string type of element (for what object is the extrafield)
var $attribute_elementtype; * @deprecated
// Array with type of the extra field */
// @deprecated public $attribute_elementtype;
var $attribute_type;
// Array with label of extra field
// @deprecated
var $attribute_label;
// Array with size of extra field
// @deprecated
var $attribute_size;
// array with list of possible values for some types of extra fields
// @deprecated
var $attribute_choice;
// Array to store compute formula for computed fields
// @deprecated
var $attribute_computed;
// Array to store default value
// @deprecated
var $attribute_default;
// Array to store if attribute is unique or not
// @deprecated
var $attribute_unique;
// Array to store if attribute is required or not
// @deprecated
var $attribute_required;
// Array to store parameters of attribute (used in select type)
// @deprecated
var $attribute_param;
// Array to store position of attribute
// @deprecated
var $attribute_pos;
// Array to store if attribute is editable regardless of the document status
// @deprecated
var $attribute_alwayseditable;
// Array to store permission to check
// @deprecated
var $attribute_perms;
// Array to store language file to translate label of values
// @deprecated
var $attribute_langfile;
// Array to store if field is visible by default on list
// @deprecated
var $attribute_list;
// New array to store extrafields definition /**
var $attributes; * @var array Array with type of the extra field
* @deprecated
*/
public $attribute_type;
/**
* @var array Array with label of extra field
* @deprecated
*/
public $attribute_label;
/**
* @var array Array with size of extra field
* @deprecated
*/
public $attribute_size;
/**
* @var array Array with list of possible values for some types of extra fields
* @deprecated
*/
public $attribute_choice;
/**
* @var array Array to store compute formula for computed fields
* @deprecated
*/
public $attribute_computed;
/**
* @var array Array to store default value
* @deprecated
*/
public $attribute_default;
/**
* @var array Array to store if attribute is unique or not
* @deprecated
*/
public $attribute_unique;
/**
* @var array Array to store if attribute is required or not
* @deprecated
*/
public $attribute_required;
/**
* @var array Array to store parameters of attribute (used in select type)
* @deprecated
*/
public $attribute_param;
/**
* @var array Array to store position of attribute
* @deprecated
*/
public $attribute_pos;
/**
* @var array Array to store if attribute is editable regardless of the document status
* @deprecated
*/
public $attribute_alwayseditable;
/**
* @var array Array to store permission to check
* @deprecated
*/
public $attribute_perms;
/**
* @var array Array to store language file to translate label of values
* @deprecated
*/
public $attribute_langfile;
/**
* @var array Array to store if field is visible by default on list
* @deprecated
*/
public $attribute_list;
/**
* @var array New array to store extrafields definition
*/
public $attributes;
/** /**
* @var string Error code (or message) * @var string Error code (or message)
*/ */
public $error=''; public $error='';
var $errno; /**
* @var string[] Array of Error code (or message)
*/
public $errors = array();
/**
* @var integer DB Error number
*/
public $errno;
public static $type2label=array( public static $type2label=array(
'varchar'=>'String', 'varchar'=>'String',
'text'=>'TextLong', 'text'=>'TextLong',
'html'=>'HtmlText', 'html'=>'HtmlText',
'int'=>'Int', 'int'=>'Int',
'double'=>'Float', 'double'=>'Float',
'date'=>'Date', 'date'=>'Date',
'datetime'=>'DateAndTime', 'datetime'=>'DateAndTime',
'boolean'=>'Boolean', 'boolean'=>'Boolean',
'price'=>'ExtrafieldPrice', 'price'=>'ExtrafieldPrice',
'phone'=>'ExtrafieldPhone', 'phone'=>'ExtrafieldPhone',
'mail'=>'ExtrafieldMail', 'mail'=>'ExtrafieldMail',
'url'=>'ExtrafieldUrl', 'url'=>'ExtrafieldUrl',
'password' => 'ExtrafieldPassword', 'password' => 'ExtrafieldPassword',
'select' => 'ExtrafieldSelect', 'select' => 'ExtrafieldSelect',
'sellist' => 'ExtrafieldSelectList', 'sellist' => 'ExtrafieldSelectList',
'radio' => 'ExtrafieldRadio', 'radio' => 'ExtrafieldRadio',
'checkbox' => 'ExtrafieldCheckBox', 'checkbox' => 'ExtrafieldCheckBox',
'chkbxlst' => 'ExtrafieldCheckBoxFromList', 'chkbxlst' => 'ExtrafieldCheckBoxFromList',
'link' => 'ExtrafieldLink', 'link' => 'ExtrafieldLink',
'separate' => 'ExtrafieldSeparator', 'separate' => 'ExtrafieldSeparator',
); );
@ -131,7 +185,8 @@ class ExtraFields
function __construct($db) function __construct($db)
{ {
$this->db = $db; $this->db = $db;
$this->error = array(); $this->error = '';
$this->errors = array();
$this->attributes = array(); $this->attributes = array();
// For old usage // For old usage
@ -430,6 +485,7 @@ class ExtraFields
if ($result < 0) if ($result < 0)
{ {
$this->error=$this->db->lasterror(); $this->error=$this->db->lasterror();
$this->errors[]=$this->db->lasterror();
$error++; $error++;
} }
@ -450,6 +506,7 @@ class ExtraFields
if ($result < 0) if ($result < 0)
{ {
$this->error=$this->db->lasterror(); $this->error=$this->db->lasterror();
$this->errors[]=$this->db->lasterror();
$error++; $error++;
} }
} }
@ -1885,7 +1942,7 @@ class ExtraFields
/** /**
* Fill array_options property of object by extrafields value (using for data sent by forms) * Fill array_options property of object by extrafields value (using for data sent by forms)
* *
* @param array $extralabels $array of extrafields (@deprecated) * @param array $extralabels Deprecated $array of extrafields
* @param object $object Object * @param object $object Object
* @param string $onlykey Only following key is filled. When we make update of only one extrafield ($action = 'update_extras'), calling page must must set this to avoid to have other extrafields being reset. * @param string $onlykey Only following key is filled. When we make update of only one extrafield ($action = 'update_extras'), calling page must must set this to avoid to have other extrafields being reset.
* @return int 1 if array_options set, 0 if no value, -1 if error (field required missing for example) * @return int 1 if array_options set, 0 if no value, -1 if error (field required missing for example)

View File

@ -2266,7 +2266,7 @@ class Form
$objp->remise_percent = $objp2->remise_percent; $objp->remise_percent = $objp2->remise_percent;
$objp->remise = $objp2->remise; $objp->remise = $objp2->remise;
$this->constructProductListOption($objp, $opt, $optJson, 0, $selected, $hidepriceinlabel); $this->constructProductListOption($objp, $opt, $optJson, 0, $selected, $hidepriceinlabel, $filterkey);
$j++; $j++;
@ -2293,7 +2293,7 @@ class Form
$objp->price_ttc = price2num($objp->price_ttc, 'MU'); $objp->price_ttc = price2num($objp->price_ttc, 'MU');
} }
} }
$this->constructProductListOption($objp, $opt, $optJson, $price_level, $selected, $hidepriceinlabel); $this->constructProductListOption($objp, $opt, $optJson, $price_level, $selected, $hidepriceinlabel, $filterkey);
// Add new entry // Add new entry
// "key" value of json key array is used by jQuery automatically as selected value // "key" value of json key array is used by jQuery automatically as selected value
// "label" value of json key array is used by jQuery automatically as text for combo box // "label" value of json key array is used by jQuery automatically as text for combo box
@ -2318,7 +2318,8 @@ class Form
} }
/** /**
* constructProductListOption * constructProductListOption.
* This define value for &$opt and &$optJson.
* *
* @param resultset $objp Resultset of fetch * @param resultset $objp Resultset of fetch
* @param string $opt Option (var used for returned value in string option format) * @param string $opt Option (var used for returned value in string option format)
@ -2326,11 +2327,12 @@ class Form
* @param int $price_level Price level * @param int $price_level Price level
* @param string $selected Preselected value * @param string $selected Preselected value
* @param int $hidepriceinlabel Hide price in label * @param int $hidepriceinlabel Hide price in label
* @param string $filterkey Filter key to highlight
* @return void * @return void
*/ */
private function constructProductListOption(&$objp, &$opt, &$optJson, $price_level, $selected, $hidepriceinlabel = 0) private function constructProductListOption(&$objp, &$opt, &$optJson, $price_level, $selected, $hidepriceinlabel = 0, $filterkey = '')
{ {
global $langs,$conf,$user,$db; global $langs, $conf, $user, $db;
$outkey=''; $outkey='';
$outval=''; $outval='';
@ -2368,7 +2370,7 @@ class Form
{ {
$opt.= ' pbq="'.$objp->price_by_qty_rowid.'" data-pbq="'.$objp->price_by_qty_rowid.'" data-pbqqty="'.$objp->price_by_qty_quantity.'" data-pbqpercent="'.$objp->price_by_qty_remise_percent.'"'; $opt.= ' pbq="'.$objp->price_by_qty_rowid.'" data-pbq="'.$objp->price_by_qty_rowid.'" data-pbqqty="'.$objp->price_by_qty_quantity.'" data-pbqpercent="'.$objp->price_by_qty_remise_percent.'"';
} }
if (! empty($conf->stock->enabled) && $objp->fk_product_type == 0 && isset($objp->stock)) if (! empty($conf->stock->enabled) && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || ! empty($conf->global->STOCK_SUPPORTS_SERVICES)))
{ {
if ($objp->stock > 0) $opt.= ' class="product_line_stock_ok"'; if ($objp->stock > 0) $opt.= ' class="product_line_stock_ok"';
elseif ($objp->stock <= 0) $opt.= ' class="product_line_stock_too_low"'; elseif ($objp->stock <= 0) $opt.= ' class="product_line_stock_too_low"';
@ -2509,14 +2511,38 @@ class Form
$outtva_tx=$objp->tva_tx; $outtva_tx=$objp->tva_tx;
} }
if (! empty($conf->stock->enabled) && isset($objp->stock) && $objp->fk_product_type == 0) if (! empty($conf->stock->enabled) && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || ! empty($conf->global->STOCK_SUPPORTS_SERVICES)))
{ {
$opt.= ' - '.$langs->trans("Stock").':'.$objp->stock; $opt.= ' - '.$langs->trans("Stock").':'.$objp->stock;
if ($objp->stock > 0) { if ($objp->stock > 0) {
$outval.= ' - <span class="product_line_stock_ok">'.$langs->transnoentities("Stock").':'.$objp->stock.'</span>'; $outval.= ' - <span class="product_line_stock_ok">';
}elseif ($objp->stock <= 0) { }elseif ($objp->stock <= 0) {
$outval.= ' - <span class="product_line_stock_too_low">'.$langs->transnoentities("Stock").':'.$objp->stock.'</span>'; $outval.= ' - <span class="product_line_stock_too_low">';
}
$outval.= $langs->transnoentities("Stock").':'.$objp->stock;
$outval.= '</span>';
if (! empty($conf->global->STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO)) // Warning, this option may slow down combo list generation
{
$langs->load("stocks");
$tmpproduct=new Product($this->db);
$tmpproduct->fetch($objp->rowid);
$tmpproduct->load_virtual_stock();
$virtualstock = $tmpproduct->stock_theorique;
$opt.= ' - '.$langs->trans("VirtualStock").':'.$virtualstock;
$outval.=' - '.$langs->transnoentities("VirtualStock").':';
if ($virtualstock > 0) {
$outval.= ' - <span class="product_line_stock_ok">';
}elseif ($virtualstock <= 0) {
$outval.= ' - <span class="product_line_stock_too_low">';
}
$outval.=$virtualstock;
$outval.='</span>';
unset($tmpproduct);
} }
} }
@ -6152,7 +6178,7 @@ class Form
foreach ($array as $key => $value) foreach ($array as $key => $value)
{ {
$out.= '<option value="'.$key.'"'; $out.= '<option value="'.$key.'"';
if (is_array($selected) && ! empty($selected) && in_array($key, $selected) && !empty($key)) if (is_array($selected) && ! empty($selected) && in_array($key, $selected) && ((string) $key != ''))
{ {
$out.= ' selected'; $out.= ' selected';
} }

View File

@ -188,11 +188,10 @@ class FormCompany
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Retourne la liste deroulante des departements/province/cantons tout pays confondu ou pour un pays donne. * Returns the drop-down list of departments/provinces/cantons for all countries or for a given country.
* Dans le cas d'une liste tout pays confondus, l'affichage fait une rupture sur le pays. * In the case of an all-country list, the display breaks on the country.
* La cle de la liste est le code (il peut y avoir plusieurs entree pour * The key of the list is the code (there can be several entries for a given code but in this case, the country field differs).
* un code donnee mais dans ce cas, le champ pays differe). * Thus the links with the departments are done on a department independently of its name.
* Ainsi les liens avec les departements se font sur un departement independemment de son nom.
* *
* @param string $selected Code state preselected * @param string $selected Code state preselected
* @param int $country_codeid 0=list for all countries, otherwise country code or country rowid to show * @param int $country_codeid 0=list for all countries, otherwise country code or country rowid to show
@ -207,11 +206,10 @@ class FormCompany
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Retourne la liste deroulante des departements/province/cantons tout pays confondu ou pour un pays donne. * Returns the drop-down list of departments/provinces/cantons for all countries or for a given country.
* Dans le cas d'une liste tout pays confondus, l'affichage fait une rupture sur le pays. * In the case of an all-country list, the display breaks on the country.
* La cle de la liste est le code (il peut y avoir plusieurs entree pour * The key of the list is the code (there can be several entries for a given code but in this case, the country field differs).
* un code donnee mais dans ce cas, le champ pays differe). * Thus the links with the departments are done on a department independently of its name.
* Ainsi les liens avec les departements se font sur un departement independemment de son nom.
* *
* @param string $selected Code state preselected (mus be state id) * @param string $selected Code state preselected (mus be state id)
* @param integer $country_codeid Country code or id: 0=list for all countries, otherwise country code or country rowid to show * @param integer $country_codeid Country code or id: 0=list for all countries, otherwise country code or country rowid to show

View File

@ -7,7 +7,8 @@
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Bahfir Abbes <bafbes@gmail.com> * Copyright (C) 2015 Bahfir Abbes <bafbes@gmail.com>
* Copyright (C) 2016-2017 Ferran Marcet <fmarcet@2byte.es> * Copyright (C) 2016-2017 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or
@ -66,11 +67,12 @@ class FormFile
* @param int $addcancel 1=Add 'Cancel' button * @param int $addcancel 1=Add 'Cancel' button
* @param int $sectionid If upload must be done inside a particular ECM section (is sectionid defined, sectiondir must not be) * @param int $sectionid If upload must be done inside a particular ECM section (is sectionid defined, sectiondir must not be)
* @param int $perm Value of permission to allow upload * @param int $perm Value of permission to allow upload
* @param int $size Length of input file area. Deprecated. * @param int $size Length of input file area. Deprecated.
* @param Object $object Object to use (when attachment is done on an element) * @param Object $object Object to use (when attachment is done on an element)
* @param string $options Add an option column * @param string $options Add an option column
* @param integer $useajax Use fileupload ajax (0=never, 1=if enabled, 2=always whatever is option). @deprecated 2 should never be used and if 1 is used, option should no be enabled. * @param integer $useajax Use fileupload ajax (0=never, 1=if enabled, 2=always whatever is option).
* @param string $savingdocmask Mask to use to define output filename. For example 'XXXXX-__YYYYMMDD__-__file__' * Deprecated 2 should never be used and if 1 is used, option should no be enabled.
* @param string $savingdocmask Mask to use to define output filename. For example 'XXXXX-__YYYYMMDD__-__file__'
* @param integer $linkfiles 1=Also add form to link files, 0=Do not show form to link files * @param integer $linkfiles 1=Also add form to link files, 0=Do not show form to link files
* @param string $htmlname Name and id of HTML form ('formuserfile' by default, 'formuserfileecm' when used to upload a file in ECM) * @param string $htmlname Name and id of HTML form ('formuserfile' by default, 'formuserfileecm' when used to upload a file in ECM)
* @param string $accept Specifies the types of files accepted (This is not a security check but an user interface facility. eg '.pdf,image/*' or '.png,.jpg' or 'video/*') * @param string $accept Specifies the types of files accepted (This is not a security check but an user interface facility. eg '.pdf,image/*' or '.png,.jpg' or 'video/*')
@ -83,6 +85,10 @@ class FormFile
global $conf,$langs, $hookmanager; global $conf,$langs, $hookmanager;
$hookmanager->initHooks(array('formfile')); $hookmanager->initHooks(array('formfile'));
// Deprecation warning
if ($useajax == 2) {
dol_syslog(__METHOD__ . ": using 2 for useajax is deprecated and should be not used", LOG_WARNING);
}
if (! empty($conf->browser->layout) && $conf->browser->layout != 'classic') $useajax=0; if (! empty($conf->browser->layout) && $conf->browser->layout != 'classic') $useajax=0;
@ -271,7 +277,7 @@ class FormFile
* @param string $modulesubdir Existing (so sanitized) sub-directory to scan (Example: '0/1/10', 'FA/DD/MM/YY/9999'). Use '' if file is not into subdir of module. * @param string $modulesubdir Existing (so sanitized) sub-directory to scan (Example: '0/1/10', 'FA/DD/MM/YY/9999'). Use '' if file is not into subdir of module.
* @param string $filedir Directory to scan * @param string $filedir Directory to scan
* @param string $urlsource Url of origin page (for return) * @param string $urlsource Url of origin page (for return)
* @param int $genallowed Generation is allowed (1/0 or array list of templates) * @param int|string[] $genallowed Generation is allowed (1/0 or array list of templates)
* @param int $delallowed Remove is allowed (1/0) * @param int $delallowed Remove is allowed (1/0)
* @param string $modelselected Model to preselect by default * @param string $modelselected Model to preselect by default
* @param integer $allowgenifempty Allow generation even if list of template ($genallowed) is empty (show however a warning) * @param integer $allowgenifempty Allow generation even if list of template ($genallowed) is empty (show however a warning)
@ -1202,8 +1208,6 @@ class FormFile
} }
// Preview link // Preview link
if (! $editline) print $this->showPreview($file, $modulepart, $filepath); if (! $editline) print $this->showPreview($file, $modulepart, $filepath);
// Public share link
//if (! $editline && ! empty($filearray[$key]['hashp'])) print pictowithlinktodirectdownload;
print "</td>\n"; print "</td>\n";
@ -1280,7 +1284,7 @@ class FormFile
$fulllink=$urlwithroot.'/document.php'.($paramlink?'?'.$paramlink:''); $fulllink=$urlwithroot.'/document.php'.($paramlink?'?'.$paramlink:'');
print img_picto($langs->trans("FileSharedViaALink"), 'object_globe.png').' '; print img_picto($langs->trans("FileSharedViaALink"), 'object_globe.png').' ';
print '<input type="text" class="quatrevingtpercent" id="downloadlink" name="downloadexternallink" value="'.dol_escape_htmltag($fulllink).'">'; print '<input type="text" class="quatrevingtpercent minwidth200imp" id="downloadlink" name="downloadexternallink" value="'.dol_escape_htmltag($fulllink).'">';
} }
else else
{ {
@ -1552,20 +1556,20 @@ class FormFile
// To show ref or specific information according to view to show (defined by $module) // To show ref or specific information according to view to show (defined by $module)
if ($modulepart == 'company') { preg_match('/(\d+)\/[^\/]+$/', $relativefile, $reg); $id=(isset($reg[1])?$reg[1]:''); } if ($modulepart == 'company') { preg_match('/(\d+)\/[^\/]+$/', $relativefile, $reg); $id=(isset($reg[1])?$reg[1]:''); }
if ($modulepart == 'invoice') { preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); $ref=(isset($reg[1])?$reg[1]:''); } elseif ($modulepart == 'invoice') { preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); $ref=(isset($reg[1])?$reg[1]:''); }
if ($modulepart == 'invoice_supplier') { preg_match('/([^\/]+)\/[^\/]+$/', $relativefile, $reg); $ref=(isset($reg[1])?$reg[1]:''); if (is_numeric($ref)) { $id=$ref; $ref=''; } } // $ref may be also id with old supplier invoices elseif ($modulepart == 'invoice_supplier') { preg_match('/([^\/]+)\/[^\/]+$/', $relativefile, $reg); $ref=(isset($reg[1])?$reg[1]:''); if (is_numeric($ref)) { $id=$ref; $ref=''; } } // $ref may be also id with old supplier invoices
if ($modulepart == 'propal') { preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); $ref=(isset($reg[1])?$reg[1]:''); } elseif ($modulepart == 'propal') { preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); $ref=(isset($reg[1])?$reg[1]:''); }
if ($modulepart == 'supplier_proposal') { preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); $ref=(isset($reg[1])?$reg[1]:''); } elseif ($modulepart == 'supplier_proposal') { preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); $ref=(isset($reg[1])?$reg[1]:''); }
if ($modulepart == 'order') { preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); $ref=(isset($reg[1])?$reg[1]:''); } elseif ($modulepart == 'order') { preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); $ref=(isset($reg[1])?$reg[1]:''); }
if ($modulepart == 'order_supplier') { preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); $ref=(isset($reg[1])?$reg[1]:''); } elseif ($modulepart == 'order_supplier') { preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); $ref=(isset($reg[1])?$reg[1]:''); }
if ($modulepart == 'contract') { preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); $ref=(isset($reg[1])?$reg[1]:''); } elseif ($modulepart == 'contract') { preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); $ref=(isset($reg[1])?$reg[1]:''); }
if ($modulepart == 'product') { preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); $ref=(isset($reg[1])?$reg[1]:''); } elseif ($modulepart == 'product') { preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); $ref=(isset($reg[1])?$reg[1]:''); }
if ($modulepart == 'tax') { preg_match('/(\d+)\/[^\/]+$/', $relativefile, $reg); $id=(isset($reg[1])?$reg[1]:''); } elseif ($modulepart == 'tax') { preg_match('/(\d+)\/[^\/]+$/', $relativefile, $reg); $id=(isset($reg[1])?$reg[1]:''); }
if ($modulepart == 'project') { preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); $ref=(isset($reg[1])?$reg[1]:'');} elseif ($modulepart == 'project') { preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); $ref=(isset($reg[1])?$reg[1]:'');}
if ($modulepart == 'fichinter') { preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); $ref=(isset($reg[1])?$reg[1]:'');} elseif ($modulepart == 'fichinter') { preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); $ref=(isset($reg[1])?$reg[1]:'');}
if ($modulepart == 'user') { preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); $id=(isset($reg[1])?$reg[1]:'');} elseif ($modulepart == 'user') { preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); $id=(isset($reg[1])?$reg[1]:'');}
if ($modulepart == 'expensereport') { preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); $ref=(isset($reg[1])?$reg[1]:'');} elseif ($modulepart == 'expensereport') { preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); $ref=(isset($reg[1])?$reg[1]:'');}
if ($modulepart == 'holiday') { preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); $id=(isset($reg[1])?$reg[1]:'');} elseif ($modulepart == 'holiday') { preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); $id=(isset($reg[1])?$reg[1]:'');}
if (! $id && ! $ref) continue; if (! $id && ! $ref) continue;
$found=0; $found=0;
@ -1722,7 +1726,7 @@ class FormFile
print '<table width="100%" class="liste">'; print '<table width="100%" class="liste">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print_liste_field_titre( print_liste_field_titre(
$langs->trans("Links"), $langs->trans("Links"),
$_SERVER['PHP_SELF'], $_SERVER['PHP_SELF'],
"name", "name",
@ -1732,7 +1736,7 @@ print_liste_field_titre(
$sortfield, $sortfield,
$sortorder $sortorder
); );
print_liste_field_titre( print_liste_field_titre(
"", "",
"", "",
"", "",
@ -1740,7 +1744,7 @@ print_liste_field_titre(
"", "",
'class="right"' 'class="right"'
); );
print_liste_field_titre( print_liste_field_titre(
$langs->trans("Date"), $langs->trans("Date"),
$_SERVER['PHP_SELF'], $_SERVER['PHP_SELF'],
"date", "date",
@ -1750,7 +1754,7 @@ print_liste_field_titre(
$sortfield, $sortfield,
$sortorder $sortorder
); );
print_liste_field_titre( print_liste_field_titre(
'', '',
$_SERVER['PHP_SELF'], $_SERVER['PHP_SELF'],
"", "",
@ -1827,7 +1831,7 @@ print_liste_field_titre(
* @param array $file Array with data of file. Example: array('name'=>...) * @param array $file Array with data of file. Example: array('name'=>...)
* @param string $modulepart propal, facture, facture_fourn, ... * @param string $modulepart propal, facture, facture_fourn, ...
* @param string $relativepath Relative path of docs * @param string $relativepath Relative path of docs
* @param string $ruleforpicto Rule for picto: 0=Use the generic preview picto, 1=Use the picto of mime type of file) * @param integer $ruleforpicto Rule for picto: 0=Use the generic preview picto, 1=Use the picto of mime type of file)
* @param string $param More param on http links * @param string $param More param on http links
* @return string $out Output string with HTML * @return string $out Output string with HTML
*/ */

View File

@ -4,7 +4,7 @@
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015-2017 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2015-2017 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015-2017 Nicolas ZABOURI <info@inovea-conseil.com> * Copyright (C) 2015-2017 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -228,9 +228,9 @@ class FormMail extends Form
if (! empty($_SESSION["listofmimes".$keytoavoidconflict])) $listofmimes=explode(';', $_SESSION["listofmimes".$keytoavoidconflict]); if (! empty($_SESSION["listofmimes".$keytoavoidconflict])) $listofmimes=explode(';', $_SESSION["listofmimes".$keytoavoidconflict]);
if ($keytodelete >= 0) if ($keytodelete >= 0)
{ {
unset ($listofpaths[$keytodelete]); unset($listofpaths[$keytodelete]);
unset ($listofnames[$keytodelete]); unset($listofnames[$keytodelete]);
unset ($listofmimes[$keytodelete]); unset($listofmimes[$keytodelete]);
$_SESSION["listofpaths".$keytoavoidconflict]=join(';', $listofpaths); $_SESSION["listofpaths".$keytoavoidconflict]=join(';', $listofpaths);
$_SESSION["listofnames".$keytoavoidconflict]=join(';', $listofnames); $_SESSION["listofnames".$keytoavoidconflict]=join(';', $listofnames);
$_SESSION["listofmimes".$keytoavoidconflict]=join(';', $listofmimes); $_SESSION["listofmimes".$keytoavoidconflict]=join(';', $listofmimes);
@ -455,7 +455,7 @@ class FormMail extends Form
} }
if (! empty($this->withsubstit)) // Unset or set ->withsubstit=0 to disable this. if (! empty($this->withsubstit)) // Unset or set ->withsubstit=0 to disable this.
{ {
$out.= '<tr><td colspan="2" align="right">'; $out.= '<tr><td colspan="2" class="right">';
//$out.='<div class="floatright">'; //$out.='<div class="floatright">';
if (is_numeric($this->withsubstit)) $out.= $form->textwithpicto($langs->trans("EMailTestSubstitutionReplacedByGenericValues"), $helpforsubstitution, 1, 'help', '', 0, 2, 'substittooltip'); // Old usage if (is_numeric($this->withsubstit)) $out.= $form->textwithpicto($langs->trans("EMailTestSubstitutionReplacedByGenericValues"), $helpforsubstitution, 1, 'help', '', 0, 2, 'substittooltip'); // Old usage
else $out.= $form->textwithpicto($langs->trans('AvailableVariables'), $helpforsubstitution, 1, 'help', '', 0, 2, 'substittooltip'); // New usage else $out.= $form->textwithpicto($langs->trans('AvailableVariables'), $helpforsubstitution, 1, 'help', '', 0, 2, 'substittooltip'); // New usage
@ -1140,7 +1140,7 @@ class FormMail extends Form
* @param int $id Id of template to find, or -1 for first found with position 0, or 0 for first found whatever is position (priority order depends on lang provided or not) or -2 for exact match with label (no answer if not found) * @param int $id Id of template to find, or -1 for first found with position 0, or 0 for first found whatever is position (priority order depends on lang provided or not) or -2 for exact match with label (no answer if not found)
* @param int $active 1=Only active template, 0=Only disabled, -1=All * @param int $active 1=Only active template, 0=Only disabled, -1=All
* @param string $label Label of template * @param string $label Label of template
* @return ModelMail One instance of ModelMail * @return ModelMail|integer One instance of ModelMail or -1 if error
*/ */
public function getEMailTemplate($db, $type_template, $user, $outputlangs, $id = 0, $active = 1, $label = '') public function getEMailTemplate($db, $type_template, $user, $outputlangs, $id = 0, $active = 1, $label = '')
{ {

View File

@ -223,16 +223,16 @@ class FormMargin
print '<table class="noborder margintable centpercent">'; print '<table class="noborder margintable centpercent">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td class="liste_titre">'.$langs->trans('Margins').'</td>'; print '<td class="liste_titre">'.$langs->trans('Margins').'</td>';
print '<td class="liste_titre" align="right">'.$langs->trans('SellingPrice').'</td>'; print '<td class="liste_titre right">'.$langs->trans('SellingPrice').'</td>';
if ($conf->global->MARGIN_TYPE == "1") if ($conf->global->MARGIN_TYPE == "1")
print '<td class="liste_titre" align="right">'.$langs->trans('BuyingPrice').'</td>'; print '<td class="liste_titre right">'.$langs->trans('BuyingPrice').'</td>';
else else
print '<td class="liste_titre" align="right">'.$langs->trans('CostPrice').'</td>'; print '<td class="liste_titre right">'.$langs->trans('CostPrice').'</td>';
print '<td class="liste_titre" align="right">'.$langs->trans('Margin').'</td>'; print '<td class="liste_titre right">'.$langs->trans('Margin').'</td>';
if (! empty($conf->global->DISPLAY_MARGIN_RATES)) if (! empty($conf->global->DISPLAY_MARGIN_RATES))
print '<td class="liste_titre" align="right">'.$langs->trans('MarginRate').'</td>'; print '<td class="liste_titre right">'.$langs->trans('MarginRate').'</td>';
if (! empty($conf->global->DISPLAY_MARK_RATES)) if (! empty($conf->global->DISPLAY_MARK_RATES))
print '<td class="liste_titre" align="right">'.$langs->trans('MarkRate').'</td>'; print '<td class="liste_titre right">'.$langs->trans('MarkRate').'</td>';
print '</tr>'; print '</tr>';
if (! empty($conf->product->enabled)) if (! empty($conf->product->enabled))
@ -240,13 +240,13 @@ class FormMargin
//if ($marginInfo['margin_on_products'] != 0 && $marginInfo['margin_on_services'] != 0) { //if ($marginInfo['margin_on_products'] != 0 && $marginInfo['margin_on_services'] != 0) {
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$langs->trans('MarginOnProducts').'</td>'; print '<td>'.$langs->trans('MarginOnProducts').'</td>';
print '<td align="right">'.price($marginInfo['pv_products'], null, null, null, null, $rounding).'</td>'; print '<td class="right">'.price($marginInfo['pv_products'], null, null, null, null, $rounding).'</td>';
print '<td align="right">'.price($marginInfo['pa_products'], null, null, null, null, $rounding).'</td>'; print '<td class="right">'.price($marginInfo['pa_products'], null, null, null, null, $rounding).'</td>';
print '<td align="right">'.price($marginInfo['margin_on_products'], null, null, null, null, $rounding).'</td>'; print '<td class="right">'.price($marginInfo['margin_on_products'], null, null, null, null, $rounding).'</td>';
if (! empty($conf->global->DISPLAY_MARGIN_RATES)) if (! empty($conf->global->DISPLAY_MARGIN_RATES))
print '<td align="right">'.(($marginInfo['margin_rate_products'] == '')?'':price($marginInfo['margin_rate_products'], null, null, null, null, $rounding).'%').'</td>'; print '<td class="right">'.(($marginInfo['margin_rate_products'] == '')?'':price($marginInfo['margin_rate_products'], null, null, null, null, $rounding).'%').'</td>';
if (! empty($conf->global->DISPLAY_MARK_RATES)) if (! empty($conf->global->DISPLAY_MARK_RATES))
print '<td align="right">'.(($marginInfo['mark_rate_products'] == '')?'':price($marginInfo['mark_rate_products'], null, null, null, null, $rounding).'%').'</td>'; print '<td class="right">'.(($marginInfo['mark_rate_products'] == '')?'':price($marginInfo['mark_rate_products'], null, null, null, null, $rounding).'%').'</td>';
print '</tr>'; print '</tr>';
} }
@ -254,13 +254,13 @@ class FormMargin
{ {
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$langs->trans('MarginOnServices').'</td>'; print '<td>'.$langs->trans('MarginOnServices').'</td>';
print '<td align="right">'.price($marginInfo['pv_services'], null, null, null, null, $rounding).'</td>'; print '<td class="right">'.price($marginInfo['pv_services'], null, null, null, null, $rounding).'</td>';
print '<td align="right">'.price($marginInfo['pa_services'], null, null, null, null, $rounding).'</td>'; print '<td class="right">'.price($marginInfo['pa_services'], null, null, null, null, $rounding).'</td>';
print '<td align="right">'.price($marginInfo['margin_on_services'], null, null, null, null, $rounding).'</td>'; print '<td class="right">'.price($marginInfo['margin_on_services'], null, null, null, null, $rounding).'</td>';
if (! empty($conf->global->DISPLAY_MARGIN_RATES)) if (! empty($conf->global->DISPLAY_MARGIN_RATES))
print '<td align="right">'.(($marginInfo['margin_rate_services'] == '')?'':price($marginInfo['margin_rate_services'], null, null, null, null, $rounding).'%').'</td>'; print '<td class="right">'.(($marginInfo['margin_rate_services'] == '')?'':price($marginInfo['margin_rate_services'], null, null, null, null, $rounding).'%').'</td>';
if (! empty($conf->global->DISPLAY_MARK_RATES)) if (! empty($conf->global->DISPLAY_MARK_RATES))
print '<td align="right">'.(($marginInfo['mark_rate_services'] == '')?'':price($marginInfo['mark_rate_services'], null, null, null, null, $rounding).'%').'</td>'; print '<td class="right">'.(($marginInfo['mark_rate_services'] == '')?'':price($marginInfo['mark_rate_services'], null, null, null, null, $rounding).'%').'</td>';
print '</tr>'; print '</tr>';
} }
@ -268,13 +268,13 @@ class FormMargin
{ {
print '<tr class="liste_total">'; print '<tr class="liste_total">';
print '<td>'.$langs->trans('TotalMargin').'</td>'; print '<td>'.$langs->trans('TotalMargin').'</td>';
print '<td align="right">'.price($marginInfo['pv_total'], null, null, null, null, $rounding).'</td>'; print '<td class="right">'.price($marginInfo['pv_total'], null, null, null, null, $rounding).'</td>';
print '<td align="right">'.price($marginInfo['pa_total'], null, null, null, null, $rounding).'</td>'; print '<td class="right">'.price($marginInfo['pa_total'], null, null, null, null, $rounding).'</td>';
print '<td align="right">'.price($marginInfo['total_margin'], null, null, null, null, $rounding).'</td>'; print '<td class="right">'.price($marginInfo['total_margin'], null, null, null, null, $rounding).'</td>';
if (! empty($conf->global->DISPLAY_MARGIN_RATES)) if (! empty($conf->global->DISPLAY_MARGIN_RATES))
print '<td align="right">'.(($marginInfo['total_margin_rate'] == '')?'':price($marginInfo['total_margin_rate'], null, null, null, null, $rounding).'%').'</td>'; print '<td class="right">'.(($marginInfo['total_margin_rate'] == '')?'':price($marginInfo['total_margin_rate'], null, null, null, null, $rounding).'%').'</td>';
if (! empty($conf->global->DISPLAY_MARK_RATES)) if (! empty($conf->global->DISPLAY_MARK_RATES))
print '<td align="right">'.(($marginInfo['total_mark_rate'] == '')?'':price($marginInfo['total_mark_rate'], null, null, null, null, $rounding).'%').'</td>'; print '<td class="right">'.(($marginInfo['total_mark_rate'] == '')?'':price($marginInfo['total_mark_rate'], null, null, null, null, $rounding).'%').'</td>';
print '</tr>'; print '</tr>';
} }
print '</table>'; print '</table>';

View File

@ -655,7 +655,7 @@ class SMTPs
$_retVal = true; $_retVal = true;
// if we have a path... // if we have a path...
if ( ! empty ($_strConfigPath) ) if ( ! empty($_strConfigPath) )
{ {
// If the path is not valid, this will NOT generate an error, // If the path is not valid, this will NOT generate an error,
// it will simply return false. // it will simply return false.
@ -989,7 +989,7 @@ class SMTPs
$aryHost = $this->_msgRecipients; $aryHost = $this->_msgRecipients;
// Only run this if we have something // Only run this if we have something
if ( !empty ($_addrList)) if ( !empty($_addrList))
{ {
// $_addrList can be a STRING or an array // $_addrList can be a STRING or an array
if ( is_string($_addrList) ) if ( is_string($_addrList) )
@ -1409,7 +1409,7 @@ class SMTPs
// If we have ZERO, we have a problem // If we have ZERO, we have a problem
if( $keyCount === 0 ) if( $keyCount === 0 )
die ("Sorry, no content"); die("Sorry, no content");
// If we have ONE, we can use the simple format // If we have ONE, we can use the simple format
elseif( $keyCount === 1 && empty($conf->global->MAIN_MAIL_USE_MULTI_PART)) elseif( $keyCount === 1 && empty($conf->global->MAIN_MAIL_USE_MULTI_PART))

View File

@ -101,7 +101,7 @@ oListManager.GetFileRowHtml = function( fileName, fileUrl, fileSize )
sLink + sLink +
fileName + fileName +
'<\/a>' + '<\/a>' +
'<\/td><td align="right" class="nowrap">&nbsp;' + '<\/td><td class="nowrap right">&nbsp;' +
fileSize + fileSize +
' KB' + ' KB' +
'<\/td><\/tr>' ; '<\/td><\/tr>' ;

View File

@ -126,7 +126,7 @@ print '
display: block; display: block;
} }
li.lilevel3 a { li.lilevel3 a {
padding: 0.2em 15px 0.2em 60px; padding: 0.6em 15px 0.6em 60px;
color: #000; color: #000;
cursor: pointer; cursor: pointer;
display: block; display: block;

View File

@ -367,7 +367,7 @@ function run_sql($sqlfile, $silent = 1, $entity = '', $usesavepoint = 1, $handle
$listofinsertedrowid[$cursorinsert]=$insertedrowid; $listofinsertedrowid[$cursorinsert]=$insertedrowid;
dol_syslog('Admin.lib::run_sql Insert nb '.$cursorinsert.', done in table '.$table.', rowid is '.$listofinsertedrowid[$cursorinsert], LOG_DEBUG); dol_syslog('Admin.lib::run_sql Insert nb '.$cursorinsert.', done in table '.$table.', rowid is '.$listofinsertedrowid[$cursorinsert], LOG_DEBUG);
} }
// print '<td align="right">OK</td>'; // print '<td class="right">OK</td>';
} }
else else
{ {
@ -410,13 +410,13 @@ function run_sql($sqlfile, $silent = 1, $entity = '', $usesavepoint = 1, $handle
if ($error == 0) if ($error == 0)
{ {
if (! $silent) print '<tr><td>'.$langs->trans("ProcessMigrateScript").'</td>'; if (! $silent) print '<tr><td>'.$langs->trans("ProcessMigrateScript").'</td>';
if (! $silent) print '<td align="right">'.$langs->trans("OK").'</td></tr>'."\n"; if (! $silent) print '<td class="right">'.$langs->trans("OK").'</td></tr>'."\n";
$ok = 1; $ok = 1;
} }
else else
{ {
if (! $silent) print '<tr><td>'.$langs->trans("ProcessMigrateScript").'</td>'; if (! $silent) print '<tr><td>'.$langs->trans("ProcessMigrateScript").'</td>';
if (! $silent) print '<td align="right"><font class="error">'.$langs->trans("KO").'</font></td></tr>'."\n"; if (! $silent) print '<td class="right"><font class="error">'.$langs->trans("KO").'</font></td></tr>'."\n";
$ok = 0; $ok = 0;
} }

View File

@ -239,7 +239,7 @@ function show_array_actions_to_do($max = 5)
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("LastActionsToDo", $max).'</th>'; print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("LastActionsToDo", $max).'</th>';
print '<th colspan="2" align="right"><a class="commonlink" href="'.DOL_URL_ROOT.'/comm/action/list.php?status=todo">'.$langs->trans("FullList").'</a></th>'; print '<th colspan="2" class="right"><a class="commonlink" href="'.DOL_URL_ROOT.'/comm/action/list.php?status=todo">'.$langs->trans("FullList").'</a></th>';
print '</tr>'; print '</tr>';
$var = true; $var = true;
@ -276,7 +276,7 @@ function show_array_actions_to_do($max = 5)
$datep2=$db->jdate($obj->dp2); $datep2=$db->jdate($obj->dp2);
// Date // Date
print '<td width="100" align="right">'.dol_print_date($datep, 'day').'&nbsp;'; print '<td width="100" class="right">'.dol_print_date($datep, 'day').'&nbsp;';
$late=0; $late=0;
if ($obj->percent == 0 && $datep && $datep < time()) $late=1; if ($obj->percent == 0 && $datep && $datep < time()) $late=1;
if ($obj->percent == 0 && ! $datep && $datep2 && $datep2 < time()) $late=1; if ($obj->percent == 0 && ! $datep && $datep2 && $datep2 < time()) $late=1;
@ -286,7 +286,7 @@ function show_array_actions_to_do($max = 5)
print "</td>"; print "</td>";
// Statut // Statut
print "<td align=\"right\" width=\"14\">".$staticaction->LibStatut($obj->percent, 3)."</td>\n"; print '<td class="right" width="14">'.$staticaction->LibStatut($obj->percent, 3)."</td>\n";
print "</tr>\n"; print "</tr>\n";
@ -336,7 +336,7 @@ function show_array_last_actions_done($max = 5)
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("LastDoneTasks", $max).'</th>'; print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("LastDoneTasks", $max).'</th>';
print '<th colspan="2" align="right"><a class="commonlink" href="'.DOL_URL_ROOT.'/comm/action/list.php?status=done">'.$langs->trans("FullList").'</a></th>'; print '<th colspan="2" class="right"><a class="commonlink" href="'.DOL_URL_ROOT.'/comm/action/list.php?status=done">'.$langs->trans("FullList").'</a></th>';
print '</tr>'; print '</tr>';
$var = true; $var = true;
$i = 0; $i = 0;
@ -369,11 +369,11 @@ function show_array_last_actions_done($max = 5)
print '</td>'; print '</td>';
// Date // Date
print '<td width="100" align="right">'.dol_print_date($db->jdate($obj->da2), 'day'); print '<td width="100" class="right">'.dol_print_date($db->jdate($obj->da2), 'day');
print "</td>"; print "</td>";
// Statut // Statut
print "<td align=\"right\" width=\"14\">".$staticaction->LibStatut($obj->percent, 3)."</td>\n"; print "<td class=\"right\" width=\"14\">".$staticaction->LibStatut($obj->percent, 3)."</td>\n";
print "</tr>\n"; print "</tr>\n";
$i++; $i++;

View File

@ -541,7 +541,7 @@ function ajax_constantonoff($code, $input = array(), $entity = null, $revertonof
/** /**
* On/off button for object * On/off button for object
* *
* @param int $object Id product to set * @param Object $object Object to set
* @param string $code Name of constant : status or status_buy for product by example * @param string $code Name of constant : status or status_buy for product by example
* @param string $field Name of database field : tosell or tobuy for product by example * @param string $field Name of database field : tosell or tobuy for product by example
* @param string $text_on Text if on * @param string $text_on Text if on

View File

@ -1266,27 +1266,31 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
elseif (is_object($filterobj) && get_class($filterobj) == 'Ticket') $sql.= ", ".MAIN_DB_PREFIX."ticket as o"; elseif (is_object($filterobj) && get_class($filterobj) == 'Ticket') $sql.= ", ".MAIN_DB_PREFIX."ticket as o";
$sql.= " WHERE a.entity IN (".getEntity('agenda').")"; $sql.= " WHERE a.entity IN (".getEntity('agenda').")";
if (is_object($filterobj) && in_array(get_class($filterobj), array('Societe', 'Client', 'Fournisseur')) && $filterobj->id) $sql.= " AND a.fk_soc = ".$filterobj->id; if (is_object($objcon) && $objcon->id) {
elseif (is_object($filterobj) && get_class($filterobj) == 'Project' && $filterobj->id) $sql.= " AND a.fk_project = ".$filterobj->id; $sql.= " AND a.fk_contact = ".$objcon->id;
elseif (is_object($filterobj) && get_class($filterobj) == 'Adherent') } else {
{ if (is_object($filterobj) && in_array(get_class($filterobj), array('Societe', 'Client', 'Fournisseur')) && $filterobj->id) $sql.= " AND a.fk_soc = ".$filterobj->id;
$sql.= " AND a.fk_element = m.rowid AND a.elementtype = 'member'"; elseif (is_object($filterobj) && get_class($filterobj) == 'Project' && $filterobj->id) $sql.= " AND a.fk_project = ".$filterobj->id;
if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id; elseif (is_object($filterobj) && get_class($filterobj) == 'Adherent')
} {
elseif (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') $sql.= " AND a.fk_element = m.rowid AND a.elementtype = 'member'";
{ if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id;
$sql.= " AND a.fk_element = o.rowid AND a.elementtype = 'order_supplier'"; }
if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id; elseif (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur')
} {
elseif (is_object($filterobj) && get_class($filterobj) == 'Product') $sql.= " AND a.fk_element = o.rowid AND a.elementtype = 'order_supplier'";
{ if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id;
$sql.= " AND a.fk_element = o.rowid AND a.elementtype = 'product'"; }
if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id; elseif (is_object($filterobj) && get_class($filterobj) == 'Product')
} {
elseif (is_object($filterobj) && get_class($filterobj) == 'Ticket') $sql.= " AND a.fk_element = o.rowid AND a.elementtype = 'product'";
{ if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id;
$sql.= " AND a.fk_element = o.rowid AND a.elementtype = 'ticket'"; }
if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id; elseif (is_object($filterobj) && get_class($filterobj) == 'Ticket')
{
$sql.= " AND a.fk_element = o.rowid AND a.elementtype = 'ticket'";
if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id;
}
} }
// Condition on actioncode // Condition on actioncode
@ -1378,7 +1382,8 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
} }
// Add also event from emailings. TODO This should be replaced by an automatic event ? May be it's too much for very large emailing. // Add also event from emailings. TODO This should be replaced by an automatic event ? May be it's too much for very large emailing.
if (! empty($conf->mailing->enabled) && ! empty($objcon->email)) if (! empty($conf->mailing->enabled) && ! empty($objcon->email)
&& (empty($actioncode) || $actioncode == 'AC_OTH_AUTO' || $actioncode == 'AC_EMAILING'))
{ {
$langs->load("mails"); $langs->load("mails");
@ -1528,7 +1533,13 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
// Ref // Ref
$out.='<td class="nowrap">'; $out.='<td class="nowrap">';
$out.=$actionstatic->getNomUrl(1, -1); if (isset($histo[$key]['type']) && $histo[$key]['type']=='mailing') {
$out.='<a href="'.DOL_URL_ROOT.'/comm/mailing/card.php?id='.$histo[$key]['id'].'">'.img_object($langs->trans("ShowEMailing"), "email").' ';
$out.=$histo[$key]['id'];
$out.='</a>';
} else {
$out.=$actionstatic->getNomUrl(1, -1);
}
$out.='</td>'; $out.='</td>';
// Author of event // Author of event

View File

@ -2969,6 +2969,11 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
$picto .= '.png'; $picto .= '.png';
} }
$fullpathpicto = $picto; $fullpathpicto = $picto;
$reg=array();
if (preg_match('/class="([^"]+)"/', $moreatt, $reg)) {
$morecss .= ($morecss ? ' ' : '') . $reg[1];
$moreatt = str_replace('class="'.$reg[1].'"', '', $moreatt);
}
} else { } else {
$pictowithoutext = preg_replace('/(\.png|\.gif|\.svg)$/', '', $picto); $pictowithoutext = preg_replace('/(\.png|\.gif|\.svg)$/', '', $picto);
@ -3152,7 +3157,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
return $fullpathpicto; return $fullpathpicto;
} }
// tag title is used for tooltip on <a>, tag alt can be used with very simple text on image for blind people // tag title is used for tooltip on <a>, tag alt can be used with very simple text on image for blind people
return '<img src="'.$fullpathpicto.'" alt="'.dol_escape_htmltag($alt).'"'.(($notitle || empty($titlealt))?'':' title="'.dol_escape_htmltag($titlealt).'"').($moreatt?' '.$moreatt:' class="inline-block'.($morecss?' '.$morecss:'').'"').'>'; // Alt is used for accessibility, title for popup return '<img src="'.$fullpathpicto.'" alt="'.dol_escape_htmltag($alt).'"'.(($notitle || empty($titlealt))?'':' title="'.dol_escape_htmltag($titlealt).'"').($moreatt?' '.$moreatt.($morecss?' class="'.$morecss.'"':''):' class="inline-block'.($morecss?' '.$morecss:'').'"').'>'; // Alt is used for accessibility, title for popup
} }
/** /**
@ -3180,10 +3185,11 @@ function img_object($titlealt, $picto, $moreatt = '', $pictoisfullpath = false,
* @param string $picto Name of image file to show (If no extension provided, we use '.png'). Image must be stored into htdocs/theme/common directory. * @param string $picto Name of image file to show (If no extension provided, we use '.png'). Image must be stored into htdocs/theme/common directory.
* @param string $moreatt Add more attribute on img tag * @param string $moreatt Add more attribute on img tag
* @param int $pictoisfullpath If 1, image path is a full path * @param int $pictoisfullpath If 1, image path is a full path
* @param string $morecss More CSS
* @return string Return img tag * @return string Return img tag
* @see #img_object, #img_picto * @see #img_object, #img_picto
*/ */
function img_weather($titlealt, $picto, $moreatt = '', $pictoisfullpath = 0) function img_weather($titlealt, $picto, $moreatt = '', $pictoisfullpath = 0, $morecss = '')
{ {
global $conf; global $conf;
@ -3191,7 +3197,7 @@ function img_weather($titlealt, $picto, $moreatt = '', $pictoisfullpath = 0)
$path = DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/weather/'.$picto; $path = DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/weather/'.$picto;
return img_picto($titlealt, $path, $moreatt, 1); return img_picto($titlealt, $path, $moreatt, 1, 0, 0, '', $morecss);
} }
/** /**
@ -4059,7 +4065,7 @@ function load_fiche_titre($titre, $morehtmlright = '', $picto = 'title_generic.p
$return.= '</td>'; $return.= '</td>';
if (dol_strlen($morehtmlcenter)) if (dol_strlen($morehtmlcenter))
{ {
$return.= '<td class="nobordernopadding center valignmiddle>'.$morehtmlcenter.'</td>'; $return.= '<td class="nobordernopadding center valignmiddle">'.$morehtmlcenter.'</td>';
} }
if (dol_strlen($morehtmlright)) if (dol_strlen($morehtmlright))
{ {
@ -6604,12 +6610,12 @@ function dol_sort_array(&$array, $index, $order = 'asc', $natsort = 0, $case_sen
$temp = array(); $temp = array();
foreach(array_keys($array) as $key) $temp[$key]=$array[$key][$index]; foreach(array_keys($array) as $key) $temp[$key]=$array[$key][$index];
if (!$natsort) ($order=='asc') ? asort($temp) : arsort($temp); if (! $natsort) {
else ($order=='asc') ? asort($temp) : arsort($temp);
{ } else {
($case_sensitive) ? natsort($temp) : natcasesort($temp); ($case_sensitive) ? natsort($temp) : natcasesort($temp);
if($order!='asc') $temp=array_reverse($temp, true); if($order!='asc') $temp=array_reverse($temp, true);
} }
$sorted = array(); $sorted = array();

View File

@ -2017,30 +2017,30 @@ function cleanCorruptedTree($db, $tabletocleantree, $fieldfkparent)
/** /**
* Get an array with properties of an element * Get an array with properties of an element
* *
* @param string $element_type Element type: 'action', 'facture', 'project_task' or 'object@modulext'... * @param string $element_type Element type: 'action', 'facture', 'project_task' or 'object@modulext'...
* @return array (module, classpath, element, subelement, classfile, classname) * @return array (module, classpath, element, subelement, classfile, classname)
*/ */
function getElementProperties($element_type) function getElementProperties($element_type)
{ {
// Parse element/subelement (ex: project_task) // Parse element/subelement (ex: project_task)
$module = $element = $subelement = $element_type; $module = $element_type;
$element = $element_type;
$subelement = $element_type;
// If we ask an resource form external module (instead of default path) // If we ask an resource form external module (instead of default path)
if (preg_match('/^([^@]+)@([^@]+)$/i', $element_type, $regs)) if (preg_match('/^([^@]+)@([^@]+)$/i', $element_type, $regs)) {
{
$element = $subelement = $regs[1]; $element = $subelement = $regs[1];
$module = $regs[2]; $module = $regs[2];
} }
//print '<br>1. element : '.$element.' - module : '.$module .'<br>'; //print '<br>1. element : '.$element.' - module : '.$module .'<br>';
if ( preg_match('/^([^_]+)_([^_]+)/i', $element, $regs)) if ( preg_match('/^([^_]+)_([^_]+)/i', $element, $regs)) {
{
$module = $element = $regs[1]; $module = $element = $regs[1];
$subelement = $regs[2]; $subelement = $regs[2];
} }
// For compat // For compat
if($element_type == "action") { if ($element_type == "action") {
$classpath = 'comm/action/class'; $classpath = 'comm/action/class';
$subelement = 'Actioncomm'; $subelement = 'Actioncomm';
$module = 'agenda'; $module = 'agenda';
@ -2049,13 +2049,13 @@ function getElementProperties($element_type)
// To work with non standard path // To work with non standard path
if ($element_type == 'facture' || $element_type == 'invoice') { if ($element_type == 'facture' || $element_type == 'invoice') {
$classpath = 'compta/facture/class'; $classpath = 'compta/facture/class';
$module='facture'; $module ='facture';
$subelement='facture'; $subelement = 'facture';
} }
if ($element_type == 'commande' || $element_type == 'order') { if ($element_type == 'commande' || $element_type == 'order') {
$classpath = 'commande/class'; $classpath = 'commande/class';
$module='commande'; $module = 'commande';
$subelement='commande'; $subelement = 'commande';
} }
if ($element_type == 'propal') { if ($element_type == 'propal') {
$classpath = 'comm/propal/class'; $classpath = 'comm/propal/class';
@ -2142,8 +2142,7 @@ function getElementProperties($element_type)
*/ */
function fetchObjectByElement($element_id, $element_type, $element_ref = '') function fetchObjectByElement($element_id, $element_type, $element_ref = '')
{ {
global $conf; global $conf, $db;
global $db,$conf;
$element_prop = getElementProperties($element_type); $element_prop = getElementProperties($element_type);
if (is_array($element_prop) && $conf->{$element_prop['module']}->enabled) if (is_array($element_prop) && $conf->{$element_prop['module']}->enabled)
@ -2260,6 +2259,9 @@ function getModuleDirForApiClass($module)
elseif ($module == 'adherent' || $module == 'members' || $module == 'memberstypes' || $module == 'subscriptions') { elseif ($module == 'adherent' || $module == 'members' || $module == 'memberstypes' || $module == 'subscriptions') {
$moduledirforclass = 'adherents'; $moduledirforclass = 'adherents';
} }
elseif ($module == 'don' || $module == 'donations') {
$moduledirforclass = 'don';
}
elseif ($module == 'banque' || $module == 'bankaccounts') { elseif ($module == 'banque' || $module == 'bankaccounts') {
$moduledirforclass = 'compta/bank'; $moduledirforclass = 'compta/bank';
} }
@ -2270,7 +2272,7 @@ function getModuleDirForApiClass($module)
$moduledirforclass = 'commande'; $moduledirforclass = 'commande';
} }
elseif ($module == 'shipments') { elseif ($module == 'shipments') {
$moduledirforclass = 'expedition'; $moduledirforclass = 'expedition';
} }
elseif ($module == 'facture' || $module == 'invoice' || $module == 'invoices') { elseif ($module == 'facture' || $module == 'invoice' || $module == 'invoices') {
$moduledirforclass = 'compta/facture'; $moduledirforclass = 'compta/facture';

View File

@ -38,10 +38,10 @@ function dol_convertToWord($num, $langs, $currency = false, $centimes = false)
global $conf; global $conf;
$num = str_replace(array(',', ' '), '', trim($num)); $num = str_replace(array(',', ' '), '', trim($num));
if(! $num) { if (! $num) {
return false; return false;
} }
if($centimes && strlen($num) == 1) { if ($centimes && strlen($num) == 1) {
$num = $num*10; $num = $num*10;
} }
$TNum = explode('.', $num); $TNum = explode('.', $num);
@ -151,7 +151,7 @@ function dolNumberToWord($numero, $langs, $numorcurrency = 'number')
if ($numero >= 1000000000001) if ($numero >= 1000000000001)
return -1; return -1;
// Get 2 decimals to cents, another functions round or truncate // Get 2 decimals to cents, another functions round or truncate
$strnumber = number_format ($numero, 10); $strnumber = number_format($numero, 10);
$len=strlen($strnumber); $len=strlen($strnumber);
for ($i=0; $i<$len; $i++) for ($i=0; $i<$len; $i++)
{ {
@ -187,7 +187,7 @@ function dolNumberToWord($numero, $langs, $numorcurrency = 'number')
$numero = $numero - $DdMMillon * 10000000000; $numero = $numero - $DdMMillon * 10000000000;
$UdMMillon = (int) ($numero / 1000000000); $UdMMillon = (int) ($numero / 1000000000);
$numero = $numero - $UdMMillon * 1000000000; $numero = $numero - $UdMMillon * 1000000000;
$entexto .= hundreds2text ($CdMMillon, $DdMMillon, $UdMMillon); $entexto .= hundreds2text($CdMMillon, $DdMMillon, $UdMMillon);
$entexto .= " MIL "; $entexto .= " MIL ";
} }
if ($number >= 1000000){ if ($number >= 1000000){
@ -197,7 +197,7 @@ function dolNumberToWord($numero, $langs, $numorcurrency = 'number')
$numero = $numero - $DdMILLON * 10000000; $numero = $numero - $DdMILLON * 10000000;
$udMILLON = (int) ($numero / 1000000); $udMILLON = (int) ($numero / 1000000);
$numero = $numero - $udMILLON * 1000000; $numero = $numero - $udMILLON * 1000000;
$entexto .= hundreds2text ($CdMILLON, $DdMILLON, $udMILLON); $entexto .= hundreds2text($CdMILLON, $DdMILLON, $udMILLON);
if (!$CdMMillon && !$DdMMillon && !$UdMMillon && !$CdMILLON && !$DdMILLON && $udMILLON==1) if (!$CdMMillon && !$DdMMillon && !$UdMMillon && !$CdMILLON && !$DdMILLON && $udMILLON==1)
$entexto .= " MILL&OacuteN "; $entexto .= " MILL&OacuteN ";
else else
@ -210,7 +210,7 @@ function dolNumberToWord($numero, $langs, $numorcurrency = 'number')
$numero = $numero - $ddm * 10000; $numero = $numero - $ddm * 10000;
$udm = (int) ($numero / 1000); $udm = (int) ($numero / 1000);
$numero = $numero - $udm * 1000; $numero = $numero - $udm * 1000;
$entexto .= hundreds2text ($cdm, $ddm, $udm); $entexto .= hundreds2text($cdm, $ddm, $udm);
if ($cdm || $ddm || $udm) if ($cdm || $ddm || $udm)
$entexto .= " MIL "; $entexto .= " MIL ";
} }
@ -218,7 +218,7 @@ function dolNumberToWord($numero, $langs, $numorcurrency = 'number')
$numero = $numero - $c * 100; $numero = $numero - $c * 100;
$d = (int) ($numero / 10); $d = (int) ($numero / 10);
$u = (int) $numero - $d * 10; $u = (int) $numero - $d * 10;
$entexto .= hundreds2text ($c, $d, $u); $entexto .= hundreds2text($c, $d, $u);
if (!$cdm && !$ddm && !$udm && !$c && !$d && !$u && $number>1000000) if (!$cdm && !$ddm && !$udm && !$c && !$d && !$u && $number>1000000)
$entexto .= " DE"; $entexto .= " DE";
$entexto .= " PESOS ".$parte_decimal." / 100 M.N."; $entexto .= " PESOS ".$parte_decimal." / 100 M.N.";

View File

@ -162,8 +162,16 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
-- Commercial - Supplier's orders -- Commercial - Supplier's orders
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->supplier_order->enabled', __HANDLER__, 'left', 5100__+MAX_llx_menu__, 'commercial', 'orders_suppliers', 5__+MAX_llx_menu__, '/fourn/commande/index.php?mainmenu=commercial&amp;leftmenu=orders_suppliers', 'SuppliersOrders', 0, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 6, __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->supplier_order->enabled', __HANDLER__, 'left', 5100__+MAX_llx_menu__, 'commercial', 'orders_suppliers', 5__+MAX_llx_menu__, '/fourn/commande/index.php?mainmenu=commercial&amp;leftmenu=orders_suppliers', 'SuppliersOrders', 0, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 6, __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->supplier_order->enabled', __HANDLER__, 'left', 5101__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/fourn/commande/card.php?mainmenu=commercial&amp;action=create&amp;leftmenu=orders_suppliers', 'NewOrder', 1, 'orders', '$user->rights->fournisseur->commande->creer', '', 2, 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->supplier_order->enabled', __HANDLER__, 'left', 5101__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/fourn/commande/card.php?mainmenu=commercial&amp;action=create&amp;leftmenu=orders_suppliers', 'NewOrder', 1, 'orders', '$user->rights->fournisseur->commande->creer', '', 2, 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->supplier_order->enabled', __HANDLER__, 'left', 5102__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&amp;leftmenu=orders_suppliers&amp;viewstatut=0', 'List', 1, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 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->supplier_order->enabled', __HANDLER__, 'left', 5102__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&amp;leftmenu=orders_suppliers', 'List', 1, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 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->supplier_order->enabled', __HANDLER__, 'left', 5108__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/commande/stats/index.php?mainmenu=commercial&amp;leftmenu=orders_suppliers&amp;mode=supplier', 'Statistics', 1, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 7, __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->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5103__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&amp;leftmenu=orders_suppliers&amp;statut=0', 'StatusOrderDraftShort', 1, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 2, __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->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5104__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&amp;leftmenu=orders_suppliers&amp;statut=1', 'StatusOrderValidated', 1, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 3, __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->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5105__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&amp;leftmenu=orders_suppliers&amp;statut=2', 'StatusOrderApprovedShort', 1, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 4, __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->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5106__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&amp;leftmenu=orders_suppliers&amp;statut=3', 'StatusOrderOnProcessShort', 1, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 5, __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->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5107__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&amp;leftmenu=orders_suppliers&amp;statut=4', 'StatusOrderReceivedPartiallyShort', 1, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 6, __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->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5108__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&amp;leftmenu=orders_suppliers&amp;statut=5', 'StatusOrderReceivedAll', 1, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 7, __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->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5109__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&amp;leftmenu=orders_suppliers&amp;statut=6,7', 'StatusOrderCanceled', 1, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 8, __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->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5110__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&amp;leftmenu=orders_suppliers&amp;statut=9', 'StatusOrderRefused', 1, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 9, __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->supplier_order->enabled', __HANDLER__, 'left', 5111__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/commande/stats/index.php?mainmenu=commercial&amp;leftmenu=orders_suppliers&amp;mode=supplier', 'Statistics', 1, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 7, __ENTITY__);
-- Commercial - Contracts -- Commercial - Contracts
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->contrat->enabled', __HANDLER__, 'left', 1400__+MAX_llx_menu__, 'commercial', 'contracts', 5__+MAX_llx_menu__, '/contrat/index.php?mainmenu=commercial&amp;leftmenu=contracts', 'Contracts', 0, 'contracts', '$user->rights->contrat->lire', '', 2, 7, __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->contrat->enabled', __HANDLER__, 'left', 1400__+MAX_llx_menu__, 'commercial', 'contracts', 5__+MAX_llx_menu__, '/contrat/index.php?mainmenu=commercial&amp;leftmenu=contracts', 'Contracts', 0, 'contracts', '$user->rights->contrat->lire', '', 2, 7, __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->contrat->enabled', __HANDLER__, 'left', 1401__+MAX_llx_menu__, 'commercial', '', 1400__+MAX_llx_menu__, '/contrat/card.php?mainmenu=commercial&amp;action=create&amp;leftmenu=contracts', 'NewContract', 1, 'contracts', '$user->rights->contrat->creer', '', 2, 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->contrat->enabled', __HANDLER__, 'left', 1401__+MAX_llx_menu__, 'commercial', '', 1400__+MAX_llx_menu__, '/contrat/card.php?mainmenu=commercial&amp;action=create&amp;leftmenu=contracts', 'NewContract', 1, 'contracts', '$user->rights->contrat->creer', '', 2, 0, __ENTITY__);

View File

@ -1033,41 +1033,42 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
$langs->load("accountancy"); $langs->load("accountancy");
$permtoshowmenu=(! empty($conf->accounting->enabled) || $user->rights->accounting->bind->write || $user->rights->compta->resultat->lire); $permtoshowmenu=(! empty($conf->accounting->enabled) || $user->rights->accounting->bind->write || $user->rights->compta->resultat->lire);
$newmenu->add("/accountancy/index.php?leftmenu=accountancy", $langs->trans("MenuAccountancy"), 0, $permtoshowmenu, '', $mainmenu, 'accountancy'); //$newmenu->add("/accountancy/index.php?leftmenu=accountancy", $langs->trans("MenuAccountancy"), 0, $permtoshowmenu, '', $mainmenu, 'accountancy');
// Chart of account // Chart of account
$newmenu->add("/accountancy/index.php?leftmenu=accountancy_admin", $langs->trans("Setup"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin', 1); $newmenu->add("/accountancy/index.php?leftmenu=accountancy_admin", $langs->trans("Setup"), 0, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin', 1);
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/', $leftmenu)) { if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/', $leftmenu)) {
$newmenu->add("/accountancy/admin/index.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("General"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_general', 10); $newmenu->add("/accountancy/admin/index.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("General"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_general', 10);
$newmenu->add("/accountancy/admin/journals_list.php?id=35&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingJournals"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_journal', 20); $newmenu->add("/accountancy/admin/journals_list.php?id=35&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingJournals"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_journal', 20);
$newmenu->add("/accountancy/admin/accountmodel.php?id=31&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Pcg_version"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chartmodel', 30); $newmenu->add("/accountancy/admin/accountmodel.php?id=31&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Pcg_version"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chartmodel', 30);
$newmenu->add("/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Chartofaccounts"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chart', 40); $newmenu->add("/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Chartofaccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chart', 40);
$newmenu->add("/accountancy/admin/categories_list.php?id=32&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingCategory"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chart', 41); $newmenu->add("/accountancy/admin/categories_list.php?id=32&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingCategory"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chart', 41);
$newmenu->add("/accountancy/admin/defaultaccounts.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuDefaultAccounts"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 50); $newmenu->add("/accountancy/admin/defaultaccounts.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuDefaultAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 50);
if (! empty($conf->banque->enabled)) { if (! empty($conf->banque->enabled)) {
$newmenu->add("/compta/bank/list.php?mainmenu=accountancy&leftmenu=accountancy_admin&search_status=-1", $langs->trans("MenuBankAccounts"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_bank', 51); $newmenu->add("/compta/bank/list.php?mainmenu=accountancy&leftmenu=accountancy_admin&search_status=-1", $langs->trans("MenuBankAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_bank', 51);
} }
if (! empty($conf->facture->enabled) || ! empty($conf->fournisseur->enabled)) { if (! empty($conf->facture->enabled) || ! empty($conf->fournisseur->enabled)) {
$newmenu->add("/admin/dict.php?id=10&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuVatAccounts"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 52); $newmenu->add("/admin/dict.php?id=10&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuVatAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 52);
} }
if (! empty($conf->tax->enabled)) { if (! empty($conf->tax->enabled)) {
$newmenu->add("/admin/dict.php?id=7&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuTaxAccounts"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 53); $newmenu->add("/admin/dict.php?id=7&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuTaxAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 53);
} }
if (! empty($conf->expensereport->enabled)) { if (! empty($conf->expensereport->enabled)) {
$newmenu->add("/admin/dict.php?id=17&from=accountancy&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuExpenseReportAccounts"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 54); $newmenu->add("/admin/dict.php?id=17&from=accountancy&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuExpenseReportAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 54);
} }
$newmenu->add("/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuProductsAccounts"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_product', 55); $newmenu->add("/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuProductsAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_product', 55);
$newmenu->add("/accountancy/admin/export.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("ExportOptions"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_export', 60); $newmenu->add("/accountancy/admin/export.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("ExportOptions"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_export', 60);
// Fiscal year // Fiscal year
if ($conf->global->MAIN_FEATURES_LEVEL > 1) { if ($conf->global->MAIN_FEATURES_LEVEL > 1) {
// Not yet used. In a future will lock some periods. // Not yet used. In a future will lock some periods.
$newmenu->add("/accountancy/admin/fiscalyear.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("FiscalPeriod"), 2, $user->rights->accounting->fiscalyear, '', $mainmenu, 'fiscalyear'); $newmenu->add("/accountancy/admin/fiscalyear.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("FiscalPeriod"), 1, $user->rights->accounting->fiscalyear, '', $mainmenu, 'fiscalyear');
} }
} }
// Binding // Binding
if (! empty($conf->facture->enabled)) $newmenu->add("", $langs->trans("Binding"), 0, $user->rights->accounting->bind->write, '', $mainmenu, 'dispatch');
if (! empty($conf->facture->enabled))
{ {
$newmenu->add("/accountancy/customer/index.php?leftmenu=accountancy_dispatch_customer&amp;mainmenu=accountancy", $langs->trans("CustomersVentilation"), 1, $user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_customer'); $newmenu->add("/accountancy/customer/index.php?leftmenu=accountancy_dispatch_customer&amp;mainmenu=accountancy", $langs->trans("CustomersVentilation"), 1, $user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_customer');
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_customer/', $leftmenu)) { if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_customer/', $leftmenu)) {
@ -1083,7 +1084,6 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
$newmenu->add("/accountancy/supplier/lines.php?mainmenu=accountancy&amp;leftmenu=accountancy_dispatch_supplier", $langs->trans("Binded"), 2, $user->rights->accounting->bind->write); $newmenu->add("/accountancy/supplier/lines.php?mainmenu=accountancy&amp;leftmenu=accountancy_dispatch_supplier", $langs->trans("Binded"), 2, $user->rights->accounting->bind->write);
} }
} }
if (! empty($conf->expensereport->enabled)) if (! empty($conf->expensereport->enabled))
{ {
$newmenu->add("/accountancy/expensereport/index.php?leftmenu=accountancy_dispatch_expensereport&amp;mainmenu=accountancy", $langs->trans("ExpenseReportsVentilation"), 1, $user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_expensereport'); $newmenu->add("/accountancy/expensereport/index.php?leftmenu=accountancy_dispatch_expensereport&amp;mainmenu=accountancy", $langs->trans("ExpenseReportsVentilation"), 1, $user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_expensereport');
@ -1096,7 +1096,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
// Journals // Journals
if(! empty($conf->accounting->enabled) && ! empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') if(! empty($conf->accounting->enabled) && ! empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy')
{ {
$newmenu->add('', $langs->trans("Journalization"), 1, $user->rights->accounting->comptarapport->lire); $newmenu->add('', $langs->trans("Journalization"), 0, $user->rights->accounting->comptarapport->lire);
// Multi journal // Multi journal
$sql = "SELECT rowid, code, label, nature"; $sql = "SELECT rowid, code, label, nature";
@ -1138,7 +1138,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
{ {
$langs->load('accountancy'); $langs->load('accountancy');
$journallabel=$langs->transnoentities($objp->label); // Labels in this table are set by loading llx_accounting_abc.sql. Label can be 'ACCOUNTING_SELL_JOURNAL', 'InventoryJournal', ... $journallabel=$langs->transnoentities($objp->label); // Labels in this table are set by loading llx_accounting_abc.sql. Label can be 'ACCOUNTING_SELL_JOURNAL', 'InventoryJournal', ...
$newmenu->add('/accountancy/journal/'.$nature.'journal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal='.$objp->rowid, $journallabel, 2, $user->rights->accounting->comptarapport->lire); $newmenu->add('/accountancy/journal/'.$nature.'journal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal='.$objp->rowid, $journallabel, 1, $user->rights->accounting->comptarapport->lire);
} }
$i++; $i++;
} }
@ -1154,21 +1154,21 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
} }
// General Ledger // General Ledger
$newmenu->add("/accountancy/bookkeeping/list.php?mainmenu=accountancy&amp;leftmenu=accountancy_generalledger", $langs->trans("Bookkeeping"), 1, $user->rights->accounting->mouvements->lire); $newmenu->add("/accountancy/bookkeeping/list.php?mainmenu=accountancy&amp;leftmenu=accountancy_generalledger", $langs->trans("Bookkeeping"), 0, $user->rights->accounting->mouvements->lire);
// Balance // Balance
$newmenu->add("/accountancy/bookkeeping/balance.php?mainmenu=accountancy&amp;leftmenu=accountancy_balance", $langs->trans("AccountBalance"), 1, $user->rights->accounting->mouvements->lire); $newmenu->add("/accountancy/bookkeeping/balance.php?mainmenu=accountancy&amp;leftmenu=accountancy_balance", $langs->trans("AccountBalance"), 0, $user->rights->accounting->mouvements->lire);
// Files // Files
if (! empty($conf->global->MAIN_FEATURES_LEVEL) && $conf->global->MAIN_FEATURES_LEVEL >= 2) if (! empty($conf->global->MAIN_FEATURES_LEVEL) && $conf->global->MAIN_FEATURES_LEVEL >= 2)
{ {
$newmenu->add("/compta/compta-files.php?mainmenu=accountancy&amp;leftmenu=accountancy_files", $langs->trans("AccountantFiles"), 1, $user->rights->accounting->mouvements->lire); $newmenu->add("/compta/compta-files.php?mainmenu=accountancy&amp;leftmenu=accountancy_files", $langs->trans("AccountantFiles"), 0, $user->rights->accounting->mouvements->lire);
} }
// Reports // Reports
$langs->load("compta"); $langs->load("compta");
$newmenu->add("/compta/resultat/index.php?mainmenu=accountancy&amp;leftmenu=accountancy_report", $langs->trans("Reportings"), 1, $user->rights->accounting->comptarapport->lire, '', $mainmenu, 'ca'); $newmenu->add("/compta/resultat/index.php?mainmenu=accountancy&amp;leftmenu=accountancy_report", $langs->trans("Reportings"), 0, $user->rights->accounting->comptarapport->lire, '', $mainmenu, 'ca');
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) { 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); $newmenu->add("/compta/resultat/index.php?leftmenu=accountancy_report", $langs->trans("MenuReportInOut"), 2, $user->rights->accounting->comptarapport->lire);

View File

@ -36,14 +36,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
class pdf_ban extends ModeleBankAccountDoc class pdf_ban extends ModeleBankAccountDoc
{ {
/** /**
* Issuer * @var Societe Issuer
* @var Societe
*/ */
public $emetteur; public $emetteur;
/** /**
* Dolibarr version of the loaded document * @var string Dolibarr version of the loaded document
* @public string
*/ */
public $version = 'development'; public $version = 'development';

View File

@ -53,8 +53,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
public $phpmin = array(5, 4); public $phpmin = array(5, 4);
/** /**
* Dolibarr version of the loaded document * @var string Dolibarr version of the loaded document
* @public string
*/ */
public $version = 'dolibarr'; public $version = 'dolibarr';

View File

@ -45,14 +45,14 @@ class doc_generic_contract_odt extends ModelePDFContract
public $emetteur; public $emetteur;
/** /**
* @var array() Minimum version of PHP required by module. * @var array Minimum version of PHP required by module.
* e.g.: PHP ≥ 5.4 = array(5, 4) * e.g.: PHP ≥ 5.4 = array(5, 4)
*/ */
public $phpmin = array(5, 4); public $phpmin = array(5, 4);
/** /**
* Dolibarr version of the loaded document * Dolibarr version of the loaded document
* @public string * @var string
*/ */
public $version = 'dolibarr'; public $version = 'dolibarr';

View File

@ -47,14 +47,14 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
public $emetteur; public $emetteur;
/** /**
* @var array() Minimum version of PHP required by module. * @var array Minimum version of PHP required by module.
* e.g.: PHP ≥ 5.4 = array(5, 4) * e.g.: PHP ≥ 5.4 = array(5, 4)
*/ */
public $phpmin = array(5, 4); public $phpmin = array(5, 4);
/** /**
* Dolibarr version of the loaded document * Dolibarr version of the loaded document
* @public string * @var string
*/ */
public $version = 'dolibarr'; public $version = 'dolibarr';

View File

@ -61,14 +61,14 @@ class pdf_standard extends ModeleExpenseReport
public $type; public $type;
/** /**
* @var array() Minimum version of PHP required by module. * @var array Minimum version of PHP required by module.
* e.g.: PHP ≥ 5.4 = array(5, 4) * e.g.: PHP ≥ 5.4 = array(5, 4)
*/ */
public $phpmin = array(5, 4); public $phpmin = array(5, 4);
/** /**
* Dolibarr version of the loaded document * Dolibarr version of the loaded document
* @public string * @var string
*/ */
public $version = 'dolibarr'; public $version = 'dolibarr';

View File

@ -46,14 +46,14 @@ class doc_generic_invoice_odt extends ModelePDFFactures
public $emetteur; public $emetteur;
/** /**
* @var array() Minimum version of PHP required by module. * @var array Minimum version of PHP required by module.
* e.g.: PHP ≥ 5.4 = array(5, 4) * e.g.: PHP ≥ 5.4 = array(5, 4)
*/ */
public $phpmin = array(5, 4); public $phpmin = array(5, 4);
/** /**
* Dolibarr version of the loaded document * Dolibarr version of the loaded document
* @public string * @var string
*/ */
public $version = 'dolibarr'; public $version = 'dolibarr';

View File

@ -69,14 +69,14 @@ class pdf_crabe extends ModelePDFFactures
public $type; public $type;
/** /**
* @var array() Minimum version of PHP required by module. * @var array Minimum version of PHP required by module.
* e.g.: PHP ≥ 5.4 = array(5, 4) * e.g.: PHP ≥ 5.4 = array(5, 4)
*/ */
public $phpmin = array(5, 4); public $phpmin = array(5, 4);
/** /**
* Dolibarr version of the loaded document * Dolibarr version of the loaded document
* @public string * @var string
*/ */
public $version = 'dolibarr'; public $version = 'dolibarr';

View File

@ -76,7 +76,7 @@ class pdf_sponge extends ModelePDFFactures
/** /**
* Dolibarr version of the loaded document * Dolibarr version of the loaded document
* @public string * @var string
*/ */
public $version = 'development'; public $version = 'development';

View File

@ -59,14 +59,14 @@ class pdf_soleil extends ModelePDFFicheinter
public $type; public $type;
/** /**
* @var array() Minimum version of PHP required by module. * @var array Minimum version of PHP required by module.
* e.g.: PHP ≥ 5.4 = array(5, 4) * e.g.: PHP ≥ 5.4 = array(5, 4)
*/ */
public $phpmin = array(5, 4); public $phpmin = array(5, 4);
/** /**
* Dolibarr version of the loaded document * Dolibarr version of the loaded document
* @public string * @var string
*/ */
public $version = 'dolibarr'; public $version = 'dolibarr';

View File

@ -60,14 +60,14 @@ class pdf_typhon extends ModelePDFDeliveryOrder
public $type; public $type;
/** /**
* @var array() Minimum version of PHP required by module. * @var array Minimum version of PHP required by module.
* e.g.: PHP ≥ 5.4 = array(5, 4) * e.g.: PHP ≥ 5.4 = array(5, 4)
*/ */
public $phpmin = array(5, 4); public $phpmin = array(5, 4);
/** /**
* Dolibarr version of the loaded document * Dolibarr version of the loaded document
* @public string * @var string
*/ */
public $version = 'dolibarr'; public $version = 'dolibarr';

View File

@ -418,6 +418,6 @@ class modAgenda extends DolibarrModules
$this->export_sql_end[$r] .=' WHERE ac.entity IN ('.getEntity('agenda').')'; $this->export_sql_end[$r] .=' WHERE ac.entity IN ('.getEntity('agenda').')';
if (empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .=' AND (sc.fk_user = '.(empty($user)?0:$user->id).' OR ac.fk_soc IS NULL)'; if (empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .=' AND (sc.fk_user = '.(empty($user)?0:$user->id).' OR ac.fk_soc IS NULL)';
if (empty($user->rights->agenda->allactions->read)) $this->export_sql_end[$r] .=' AND acr.fk_element = '.(empty($user)?0:$user->id); if (empty($user->rights->agenda->allactions->read)) $this->export_sql_end[$r] .=' AND acr.fk_element = '.(empty($user)?0:$user->id);
$this->export_sql_end[$r] .=' ORDER BY ac.datep'; $this->export_sql_order[$r] .=' ORDER BY ac.datep';
} }
} }

View File

@ -0,0 +1,179 @@
<?php
/*
* Copyright (C) 2019 Thibault FOUCART <support@ptibogxiv.net>
*
* 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/core/modules/oauth/stripe_oauthcallback.php
* \ingroup oauth
* \brief Page to get oauth callback
*/
require '../../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/includes/OAuth/bootstrap.php';
use OAuth\Common\Storage\DoliStorage;
use OAuth\Common\Consumer\Credentials;
use OAuth\OAuth2\Service\GitHub;
// Define $urlwithroot
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
$action = GETPOST('action', 'alpha');
$backtourl = GETPOST('backtourl', 'alpha');
/**
* Create a new instance of the URI class with the current URI, stripping the query string
*/
$uriFactory = new \OAuth\Common\Http\Uri\UriFactory();
//$currentUri = $uriFactory->createFromSuperGlobalArray($_SERVER);
//$currentUri->setQuery('');
$currentUri = $uriFactory->createFromAbsolute($urlwithroot.'/core/modules/oauth/stripe_oauthcallback.php');
/**
* Load the credential for the service
*/
/** @var $serviceFactory \OAuth\ServiceFactory An OAuth service factory. */
$serviceFactory = new \OAuth\ServiceFactory();
$httpClient = new \OAuth\Common\Http\Client\CurlClient();
// TODO Set options for proxy and timeout
// $params=array('CURLXXX'=>value, ...)
//$httpClient->setCurlParameters($params);
$serviceFactory->setHttpClient($httpClient);
// Dolibarr storage
$storage = new DoliStorage($db, $conf);
// Setup the credentials for the requests
$credentials = new Credentials(
$conf->global->OAUTH_STRIPE_TEST_ID,
$conf->global->STRIPE_LIVE_SECRET_KEY,
$currentUri->getAbsoluteUri()
);
$requestedpermissionsarray=array();
if (GETPOST('state')) $requestedpermissionsarray=explode(',', GETPOST('state')); // Example: 'userinfo_email,userinfo_profile,cloud_print'. 'state' parameter is standard to retrieve some parameters back
/*if ($action != 'delete' && empty($requestedpermissionsarray))
{
print 'Error, parameter state is not defined';
exit;
}*/
//var_dump($requestedpermissionsarray);exit;
// Instantiate the Api service using the credentials, http client and storage mechanism for the token
/** @var $apiService Service */
//$apiService = $serviceFactory->createService('StripeTest', $credentials, $storage, $requestedpermissionsarray);
$sql="INSERT INTO ".MAIN_DB_PREFIX."oauth_token set service='StripeLive', entity=".$conf->entity;
$db->query($sql);
// access type needed to have oauth provider refreshing token
//$apiService->setAccessType('offline');
$langs->load("oauth");
/*
* Actions
*/
if ($action == 'delete')
{
$storage->clearToken('StripeLive');
setEventMessages($langs->trans('TokenDeleted'), null, 'mesgs');
header('Location: ' . $backtourl);
exit();
}
if (! empty($_GET['code'])) // We are coming from oauth provider page
{
// We should have
//$_GET=array('code' => string 'aaaaaaaaaaaaaa' (length=20), 'state' => string 'user,public_repo' (length=16))
dol_syslog("We are coming from the oauth provider page");
//llxHeader('',$langs->trans("OAuthSetup"));
//$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
//print load_fiche_titre($langs->trans("OAuthSetup"),$linkback,'title_setup');
//dol_fiche_head();
// retrieve the CSRF state parameter
$state = isset($_GET['state']) ? $_GET['state'] : null;
//print '<table>';
// This was a callback request from service, get the token
try {
//var_dump($_GET['code']);
//var_dump($state);
//var_dump($apiService); // OAuth\OAuth2\Service\GitHub
//$token = $apiService->requestAccessToken($_GET['code'], $state);
$token = $apiService->requestAccessToken($_GET['code']);
// Github is a service that does not need state to be stored.
// Into constructor of GitHub, the call
// parent::__construct($credentials, $httpClient, $storage, $scopes, $baseApiUri)
// has not the ending parameter to true like the Google class constructor.
setEventMessages($langs->trans('NewTokenStored'), null, 'mesgs'); // Stored into object managed by class DoliStorage so into table oauth_token
$backtourl = $_SESSION["backtourlsavedbeforeoauthjump"];
unset($_SESSION["backtourlsavedbeforeoauthjump"]);
header('Location: ' . $backtourl);
exit();
} catch (Exception $e) {
print $e->getMessage();
}
}
else // If entry on page with no parameter, we arrive here
{
$_SESSION["backtourlsavedbeforeoauthjump"]=$backtourl;
// This may create record into oauth_state before the header redirect.
// Creation of record with state in this tables depend on the Provider used (see its constructor).
if (GETPOST('state'))
{
$url = $apiService->getAuthorizationUri(array('state'=>GETPOST('state')));
}
else
{
//$url = $apiService->getAuthorizationUri(); // Parameter state will be randomly generated
//https://connect.stripe.com/oauth/authorize?response_type=code&client_id=ca_AX27ut70tJ1j6eyFCV3ObEXhNOo2jY6V&scope=read_write
$url = 'https://connect.stripe.com/oauth/authorize?response_type=code&client_id='.$conf->global->OAUTH_STRIPE_LIVE_ID.'&scope=read_write';
}
// we go on oauth provider authorization page
header('Location: ' . $url);
exit();
}
/*
* View
*/
// No view at all, just actions
$db->close();

Some files were not shown because too many files have changed in this diff Show More