Merge branch 'develop' into feature/9429_top_menu_icons

This commit is contained in:
Laurent Destailleur 2019-02-08 10:15:09 +01:00 committed by GitHub
commit 8143acbadf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1562 changed files with 31956 additions and 31806 deletions

View File

@ -7,8 +7,13 @@ root = true
charset = utf-8 charset = utf-8
end_of_line = lf end_of_line = lf
insert_final_newline = true insert_final_newline = true
# PHP PSR-2 Coding Standards
# http://www.php-fig.org/psr/psr-2/
[*.php] [*.php]
indent_style = tab indent_style = space
indent_size = 4
trim_trailing_whitespace = true
[*.js] [*.js]
indent_style = tab indent_style = tab
[*.css] [*.css]

View File

@ -45,8 +45,7 @@ require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php";
$includecustom=0; $includecustom=0;
$includeconstants=array(); $includeconstants=array();
if (empty($argv[1])) if (empty($argv[1])) {
{
print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n"; print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n";
print "Example: ".$script_file." release=6.0.0 includecustom=1 includeconstant=FR:INVOICE_CAN_ALWAYS_BE_REMOVED:0 includeconstant=all:MAILING_NO_USING_PHPMAIL:1\n"; print "Example: ".$script_file." release=6.0.0 includecustom=1 includeconstant=FR:INVOICE_CAN_ALWAYS_BE_REMOVED:0 includeconstant=all:MAILING_NO_USING_PHPMAIL:1\n";
exit -1; exit -1;
@ -54,14 +53,11 @@ if (empty($argv[1]))
parse_str($argv[1]); parse_str($argv[1]);
$i=0; $i=0;
while ($i < $argc) while ($i < $argc) {
{
if (! empty($argv[$i])) parse_str($argv[$i]); if (! empty($argv[$i])) parse_str($argv[$i]);
if (preg_match('/includeconstant=/',$argv[$i])) if (preg_match('/includeconstant=/', $argv[$i])) {
{
$tmp=explode(':', $includeconstant, 3); $tmp=explode(':', $includeconstant, 3);
if (count($tmp) != 3) if (count($tmp) != 3) {
{
print "Error: Bad parameter includeconstant ".$includeconstant."\n"; print "Error: Bad parameter includeconstant ".$includeconstant."\n";
exit -1; exit -1;
} }
@ -70,8 +66,7 @@ while ($i < $argc)
$i++; $i++;
} }
if (empty($release)) if (empty($release)) {
{
print "Error: Missing release paramater\n"; print "Error: Missing release paramater\n";
print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n"; print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n";
exit -1; exit -1;
@ -81,39 +76,29 @@ $savrelease = $release;
// If release is auto, we take current version // If release is auto, we take current version
$tmpver=explode('-', $release, 2); $tmpver=explode('-', $release, 2);
if ($tmpver[0] == 'auto' || $tmpver[0] == 'autostable') if ($tmpver[0] == 'auto' || $tmpver[0] == 'autostable') {
{
$release=DOL_VERSION; $release=DOL_VERSION;
if ($tmpver[1] && $tmpver[0] == 'auto') $release.='-'.$tmpver[1]; if ($tmpver[1] && $tmpver[0] == 'auto') $release.='-'.$tmpver[1];
} }
if (empty($includecustom)) if (empty($includecustom)) {
{
$tmpverbis=explode('-', $release, 2); $tmpverbis=explode('-', $release, 2);
if (empty($tmpverbis[1]) || $tmpver[0] == 'autostable') if (empty($tmpverbis[1]) || $tmpver[0] == 'autostable') {
{ if (DOL_VERSION != $tmpverbis[0] && $savrelease != 'auto') {
if (DOL_VERSION != $tmpverbis[0] && $savrelease != 'auto')
{
print 'Error: When parameter "includecustom" is not set and there is no suffix in release parameter, version declared into filefunc.in.php ('.DOL_VERSION.') must be exact same value than "release" parameter ('.$tmpverbis[0].')'."\n"; print 'Error: When parameter "includecustom" is not set and there is no suffix in release parameter, version declared into filefunc.in.php ('.DOL_VERSION.') must be exact same value than "release" parameter ('.$tmpverbis[0].')'."\n";
print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n"; print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n";
exit -1; exit -1;
} }
} } else {
else
{
$tmpverter=explode('-', DOL_VERSION, 2); $tmpverter=explode('-', DOL_VERSION, 2);
if ($tmpverter[0] != $tmpverbis[0]) if ($tmpverter[0] != $tmpverbis[0]) {
{
print 'Error: When parameter "includecustom" is not set, version declared into filefunc.in.php ('.DOL_VERSION.') must have value without prefix ('.$tmpverter[0].') that is exact same value than "release" parameter ('.$tmpverbis[0].')'."\n"; print 'Error: When parameter "includecustom" is not set, version declared into filefunc.in.php ('.DOL_VERSION.') must have value without prefix ('.$tmpverter[0].') that is exact same value than "release" parameter ('.$tmpverbis[0].')'."\n";
print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n"; print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n";
exit -1; exit -1;
} }
} }
} } else {
else if (! preg_match('/'.preg_quote(DOL_VERSION, '/').'-/', $release)) {
{
if (! preg_match('/'.preg_quote(DOL_VERSION,'/').'-/',$release))
{
print 'Error: When parameter "includecustom" is set, version declared into filefunc.inc.php ('.DOL_VERSION.') must be used with a suffix into "release" parameter (ex: '.DOL_VERSION.'-mydistrib).'."\n"; print 'Error: When parameter "includecustom" is set, version declared into filefunc.inc.php ('.DOL_VERSION.') must be used with a suffix into "release" parameter (ex: '.DOL_VERSION.'-mydistrib).'."\n";
print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n"; print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n";
exit -1; exit -1;
@ -123,10 +108,8 @@ else
print "Release : ".$release."\n"; print "Release : ".$release."\n";
print "Include custom in signature : ".$includecustom."\n"; print "Include custom in signature : ".$includecustom."\n";
print "Include constants in signature : "; print "Include constants in signature : ";
foreach ($includeconstants as $countrycode => $tmp) foreach ($includeconstants as $countrycode => $tmp) {
{ foreach($tmp as $constname => $constvalue) {
foreach($tmp as $constname => $constvalue)
{
print $constname.'='.$constvalue." "; print $constname.'='.$constvalue." ";
} }
} }
@ -144,11 +127,9 @@ $fp = fopen($outputfile,'w');
fputs($fp, '<?xml version="1.0" encoding="UTF-8" ?>'."\n"); fputs($fp, '<?xml version="1.0" encoding="UTF-8" ?>'."\n");
fputs($fp, '<checksum_list version="'.$release.'" date="'.dol_print_date(dol_now(), 'dayhourrfc').'" generator="'.$script_file.'">'."\n"); fputs($fp, '<checksum_list version="'.$release.'" date="'.dol_print_date(dol_now(), 'dayhourrfc').'" generator="'.$script_file.'">'."\n");
foreach ($includeconstants as $countrycode => $tmp) foreach ($includeconstants as $countrycode => $tmp) {
{
fputs($fp, '<dolibarr_constants country="'.$countrycode.'">'."\n"); fputs($fp, '<dolibarr_constants country="'.$countrycode.'">'."\n");
foreach($tmp as $constname => $constvalue) foreach($tmp as $constname => $constvalue) {
{
$valueforchecksum=(empty($constvalue)?'0':$constvalue); $valueforchecksum=(empty($constvalue)?'0':$constvalue);
$checksumconcat[]=$valueforchecksum; $checksumconcat[]=$valueforchecksum;
fputs($fp, ' <constant name="'.$constname.'">'.$valueforchecksum.'</constant>'."\n"); fputs($fp, ' <constant name="'.$constname.'">'.$valueforchecksum.'</constant>'."\n");

View File

@ -140,12 +140,10 @@ else { print "err"; }
$prodids = array(); $prodids = array();
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."product WHERE tosell=1"; $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."product WHERE tosell=1";
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql) if ($resql) {
{
$num_prods = $db->num_rows($resql); $num_prods = $db->num_rows($resql);
$i = 0; $i = 0;
while ($i < $num_prods) while ($i < $num_prods) {
{
$i++; $i++;
$row = $db->fetch_row($resql); $row = $db->fetch_row($resql);
@ -155,7 +153,6 @@ if ($resql)
print "Build ".GEN_NUMBER_COMMANDE." orders\n"; print "Build ".GEN_NUMBER_COMMANDE." orders\n";
for ($s = 0 ; $s < GEN_NUMBER_COMMANDE ; $s++) for ($s = 0 ; $s < GEN_NUMBER_COMMANDE ; $s++)
{ {

View File

@ -112,9 +112,6 @@
<rule ref="Generic.Functions.CallTimePassByReference" /> <rule ref="Generic.Functions.CallTimePassByReference" />
<rule ref="Generic.Functions.FunctionCallArgumentSpacing" /> <rule ref="Generic.Functions.FunctionCallArgumentSpacing" />
<rule ref="Generic.Functions.FunctionCallArgumentSpacing.NoSpaceAfterComma">
<severity>0</severity>
</rule>
<rule ref="Generic.Functions.FunctionCallArgumentSpacing.NoSpaceBeforeEquals"> <rule ref="Generic.Functions.FunctionCallArgumentSpacing.NoSpaceBeforeEquals">
<severity>0</severity> <severity>0</severity>
</rule> </rule>
@ -173,6 +170,8 @@
<!-- Disabled as this does not support tab --> <!-- Disabled as this does not support tab -->
<!-- <rule ref="Generic.WhiteSpace.ScopeIndent" /> --> <!-- <rule ref="Generic.WhiteSpace.ScopeIndent" /> -->
<rule ref="Squiz.WhiteSpace.ScopeClosingBrace.Indent" />
<!-- There MUST NOT be trailing whitespace at the end of non-blank lines. --> <!-- There MUST NOT be trailing whitespace at the end of non-blank lines. -->
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace"> <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace">
<properties> <properties>
@ -190,6 +189,9 @@
</rule> </rule>
<rule ref="Squiz.WhiteSpace.ControlStructureSpacing.SpacingBeforeClose" /> <rule ref="Squiz.WhiteSpace.ControlStructureSpacing.SpacingBeforeClose" />
<rule ref="Squiz.ControlStructures.ForEachLoopDeclaration.SpaceAfterOpen" />
<rule ref="Squiz.ControlStructures.ForEachLoopDeclaration.SpaceBeforeClose" />
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration" /> <rule ref="Squiz.Functions.MultiLineFunctionDeclaration" />
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing"> <rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing">
<properties> <properties>
@ -432,5 +434,5 @@
<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" />
</ruleset> </ruleset>

View File

@ -220,11 +220,13 @@ class autoTranslator
} }
} }
if ($key == 'CHARSET') $val=$this->_outputpagecode; if ($key == 'CHARSET') {
elseif (preg_match('/^Format/',$key)) $val=$value; $val=$this->_outputpagecode;
elseif ($value=='-') $val=$value; } elseif (preg_match('/^Format/', $key)) {
else $val=$value;
{ } elseif ($value=='-') {
$val=$value;
} else {
// If not translated then translate // If not translated then translate
if ($this->_outputpagecode == 'UTF-8') $val=$this->translateTexts(array($value), substr($this->_refLang, 0, 2), substr($my_destlang, 0, 2)); if ($this->_outputpagecode == 'UTF-8') $val=$this->translateTexts(array($value), substr($this->_refLang, 0, 2), substr($my_destlang, 0, 2));
else $val=utf8_decode($this->translateTexts(array($value), substr($this->_refLang, 0, 2), substr($my_destlang, 0, 2))); else $val=utf8_decode($this->translateTexts(array($value), substr($this->_refLang, 0, 2), substr($my_destlang, 0, 2)));

View File

@ -531,12 +531,15 @@ if ($id)
if ($fieldlist[$field]=='country_id') { $valuetoshow=''; } if ($fieldlist[$field]=='country_id') { $valuetoshow=''; }
if ($fieldlist[$field]=='pcg_version' || $fieldlist[$field]=='fk_pcg_version') { $valuetoshow=$langs->trans("Pcg_version"); } if ($fieldlist[$field]=='pcg_version' || $fieldlist[$field]=='fk_pcg_version') { $valuetoshow=$langs->trans("Pcg_version"); }
if ($valuetoshow != '') if ($valuetoshow != '') {
{
print '<td align="'.$align.'">'; print '<td align="'.$align.'">';
if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i',$tabhelp[$id][$value])) print '<a href="'.$tabhelp[$id][$value].'" target="_blank">'.$valuetoshow.' '.img_help(1,$valuetoshow).'</a>'; if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i', $tabhelp[$id][$value])) {
elseif (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow,$tabhelp[$id][$value]); print '<a href="'.$tabhelp[$id][$value].'" target="_blank">'.$valuetoshow.' '.img_help(1, $valuetoshow).'</a>';
else print $valuetoshow; } elseif (! empty($tabhelp[$id][$value])) {
print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value]);
} else {
print $valuetoshow;
}
print '</td>'; print '</td>';
} }
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') $alabelisused=1; if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') $alabelisused=1;

View File

@ -627,11 +627,17 @@ if ($id)
// Can an entry be erased or disabled ? // Can an entry be erased or disabled ?
$iserasable=1;$canbedisabled=1;$canbemodified=1; // true by default $iserasable=1;$canbedisabled=1;$canbemodified=1; // true by default
if (isset($obj->code) && $id != 10) if (isset($obj->code) && $id != 10) {
{ if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i', $obj->code))) {
if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i',$obj->code))) { $iserasable = 0; $canbedisabled = 0; } $iserasable = 0;
elseif ($obj->code == 'RECEP') { $iserasable = 0; $canbedisabled = 0; } $canbedisabled = 0;
elseif ($obj->code == 'EF0') { $iserasable = 0; $canbedisabled = 0; } } elseif ($obj->code == 'RECEP') {
$iserasable = 0;
$canbedisabled = 0;
} elseif ($obj->code == 'EF0') {
$iserasable = 0;
$canbedisabled = 0;
}
} }
$canbemodified=$iserasable; $canbemodified=$iserasable;

View File

@ -94,7 +94,7 @@ if (! GETPOSTISSET('date_startmonth') && (empty($date_start) || empty($date_end)
$idpays = $mysoc->country_id; $idpays = $mysoc->country_id;
$sql = "SELECT f.rowid, f.ref, f.type, f.datef as df, f.libelle,f.ref_supplier, f.date_lim_reglement as dlf, f.close_code,"; $sql = "SELECT f.rowid, f.ref as ref, f.type, f.datef as df, f.libelle,f.ref_supplier, f.date_lim_reglement as dlf, f.close_code,";
$sql .= " fd.rowid as fdid, fd.description, fd.product_type, fd.total_ht, fd.tva as total_tva, fd.total_localtax1, fd.total_localtax2, fd.tva_tx, fd.total_ttc, fd.vat_src_code,"; $sql .= " fd.rowid as fdid, fd.description, fd.product_type, fd.total_ht, fd.tva as total_tva, fd.total_localtax1, fd.total_localtax2, fd.tva_tx, fd.total_ttc, fd.vat_src_code,";
$sql .= " s.rowid as socid, s.nom as name, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,"; $sql .= " s.rowid as socid, s.nom as name, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,";
$sql .= " p.accountancy_code_buy , aa.rowid as fk_compte, aa.account_number as compte, aa.label as label_compte"; $sql .= " p.accountancy_code_buy , aa.rowid as fk_compte, aa.account_number as compte, aa.label as label_compte";

View File

@ -692,7 +692,7 @@ class Adherent extends CommonObject
$lthirdparty=new Societe($this->db); $lthirdparty=new Societe($this->db);
$result=$lthirdparty->fetch($this->fk_soc); $result=$lthirdparty->fetch($this->fk_soc);
if ($result >= 0) if ($result > 0)
{ {
$lthirdparty->address=$this->address; $lthirdparty->address=$this->address;
$lthirdparty->zip=$this->zip; $lthirdparty->zip=$this->zip;
@ -716,7 +716,7 @@ class Adherent extends CommonObject
$error++; $error++;
} }
} }
else elseif ($result < 0)
{ {
$this->error=$lthirdparty->error; $this->error=$lthirdparty->error;
$error++; $error++;
@ -2767,7 +2767,7 @@ class Adherent extends CommonObject
$outputlangs = new Translate('', $conf); $outputlangs = new Translate('', $conf);
$outputlangs->setDefaultLang(empty($adherent->thirdparty->default_lang) ? $mysoc->default_lang : $adherent->thirdparty->default_lang); $outputlangs->setDefaultLang(empty($adherent->thirdparty->default_lang) ? $mysoc->default_lang : $adherent->thirdparty->default_lang);
$outputlangs->loadLangs(array("main", "members")); $outputlangs->loadLangs(array("main", "members"));
dol_syslog("sendReminderForExpiredSubscription Language set to ".$outputlangs->defaultlang); dol_syslog("sendReminderForExpiredSubscription Language for member id ".$adherent->id." set to ".$outputlangs->defaultlang." mysoc->default_lang=".$mysoc->default_lang);
$arraydefaultmessage=null; $arraydefaultmessage=null;
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION; $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION;

View File

@ -159,7 +159,8 @@ if ($mode)
} }
if ($mode == 'memberbyregion') //+ if ($mode == 'memberbyregion') //+
{ {
$data[]=array('label'=>(($obj->code && $langs->trans("Country".$obj->code)!="Country".$obj->code)?$langs->trans("Country".$obj->code):($obj->label?$obj->label:$langs->trans("Unknown"))), $data[]=array(
'label'=>(($obj->code && $langs->trans("Country".$obj->code)!="Country".$obj->code)?$langs->trans("Country".$obj->code):($obj->label?$obj->label:$langs->trans("Unknown"))),
'label_en'=>(($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code)!="Country".$obj->code)?$langsen->transnoentitiesnoconv("Country".$obj->code):($obj->label?$obj->label:$langs->trans("Unknown"))), 'label_en'=>(($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code)!="Country".$obj->code)?$langsen->transnoentitiesnoconv("Country".$obj->code):($obj->label?$obj->label:$langs->trans("Unknown"))),
'label2'=>($obj->label2?$obj->label2:$langs->trans("Unknown")), 'label2'=>($obj->label2?$obj->label2:$langs->trans("Unknown")),
'nb'=>$obj->nb, 'nb'=>$obj->nb,

View File

@ -673,7 +673,7 @@ if ($rowid > 0)
$sql.= " c.datef,"; $sql.= " c.datef,";
$sql.= " c.fk_bank,"; $sql.= " c.fk_bank,";
$sql.= " b.rowid as bid,"; $sql.= " b.rowid as bid,";
$sql.= " ba.rowid as baid, ba.label, ba.bank, ba.ref, ba.account_number, ba.fk_accountancy_journal, ba.number"; $sql.= " ba.rowid as baid, ba.label, ba.bank, ba.ref, ba.account_number, ba.fk_accountancy_journal, ba.number, ba.currency_code";
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."subscription as c"; $sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."subscription as c";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON c.fk_bank = b.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON c.fk_bank = b.rowid";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid";
@ -726,8 +726,9 @@ if ($rowid > 0)
$accountstatic->id=$objp->baid; $accountstatic->id=$objp->baid;
$accountstatic->number=$objp->number; $accountstatic->number=$objp->number;
$accountstatic->account_number=$objp->account_number; $accountstatic->account_number=$objp->account_number;
$accountstatic->currency_code=$objp->currency_code;
if (! empty($conf->accounting->enabled)) if (! empty($conf->accounting->enabled) && $objp->fk_accountancy_journal > 0)
{ {
$accountingjournal = new AccountingJournal($db); $accountingjournal = new AccountingJournal($db);
$accountingjournal->fetch($objp->fk_accountancy_journal); $accountingjournal->fetch($objp->fk_accountancy_journal);

View File

@ -95,15 +95,13 @@ if ($cancel) {
$action=''; $action='';
if (! empty($backtopage)) if (! empty($backtopage)) {
{
header("Location: ".$backtopage); header("Location: ".$backtopage);
exit; exit;
} }
} }
if ($action == 'add' && $user->rights->adherent->configurer) if ($action == 'add' && $user->rights->adherent->configurer) {
{
$object->label = trim($label); $object->label = trim($label);
$object->statut = (int) $statut; $object->statut = (int) $statut;
$object->subscription = (int) $subscription; $object->subscription = (int) $subscription;
@ -266,8 +264,7 @@ if (! $rowid && $action != 'create' && $action != 'edit')
$membertype = new AdherentType($db); $membertype = new AdherentType($db);
while ($i < $num) while ($i < $num) {
{
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
$membertype->id = $objp->rowid; $membertype->id = $objp->rowid;

View File

@ -192,10 +192,8 @@ elseif ($action == 'set_ORDER_FREE_TEXT')
{ {
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} } elseif ($action=="setshippableiconinlist") {
// Activate Set Shippable Icon In List // Activate Set Shippable Icon In List
elseif ($action=="setshippableiconinlist") {
$setshippableiconinlist = GETPOST('value', 'int'); $setshippableiconinlist = GETPOST('value', 'int');
$res = dolibarr_set_const($db, "SHIPPABLE_ORDER_ICON_IN_LIST", $setshippableiconinlist, 'yesno', 0, '', $conf->entity); $res = dolibarr_set_const($db, "SHIPPABLE_ORDER_ICON_IN_LIST", $setshippableiconinlist, 'yesno', 0, '', $conf->entity);
if (! $res > 0) $error++; if (! $res > 0) $error++;

View File

@ -136,9 +136,7 @@ if ( ($action == 'update' && ! GETPOST("cancel",'alpha'))
else dol_syslog($imgThumbMini); else dol_syslog($imgThumbMini);
} }
else dol_syslog("ErrorImageFormatNotSupported", LOG_WARNING); else dol_syslog("ErrorImageFormatNotSupported", LOG_WARNING);
} } elseif (preg_match('/^ErrorFileIsInfectedWithAVirus/', $result)) {
elseif (preg_match('/^ErrorFileIsInfectedWithAVirus/',$result))
{
$error++; $error++;
$langs->load("errors"); $langs->load("errors");
$tmparray=explode(':', $result); $tmparray=explode(':', $result);

View File

@ -1436,8 +1436,7 @@ if ($id)
elseif($valuetoshow == 1) $valuetoshow = $langs->trans('AtEndOfMonth'); elseif($valuetoshow == 1) $valuetoshow = $langs->trans('AtEndOfMonth');
elseif($valuetoshow == 2) $valuetoshow = $langs->trans('CurrentNext'); elseif($valuetoshow == 2) $valuetoshow = $langs->trans('CurrentNext');
$align="center"; $align="center";
} } elseif ($fieldlist[$field]=='price' || preg_match('/^amount/i', $fieldlist[$field])) {
elseif ($fieldlist[$field]=='price' || preg_match('/^amount/i',$fieldlist[$field])) {
$valuetoshow=price($valuetoshow); $valuetoshow=price($valuetoshow);
} }
if ($value == 'private') if ($value == 'private')
@ -1558,9 +1557,7 @@ if ($id)
elseif ($fieldlist[$field]=='taux') { elseif ($fieldlist[$field]=='taux') {
$valuetoshow = price($valuetoshow, 0, $langs, 0, 0); $valuetoshow = price($valuetoshow, 0, $langs, 0, 0);
$align="center"; $align="center";
} } elseif (in_array($fieldlist[$field], array('recuperableonly'))) {
elseif (in_array($fieldlist[$field],array('recuperableonly')))
{
$align="center"; $align="center";
} }
elseif ($fieldlist[$field]=='accountancy_code' || $fieldlist[$field]=='accountancy_code_sell' || $fieldlist[$field]=='accountancy_code_buy') { elseif ($fieldlist[$field]=='accountancy_code' || $fieldlist[$field]=='accountancy_code_sell' || $fieldlist[$field]=='accountancy_code_buy') {
@ -1600,7 +1597,10 @@ if ($id)
} }
// Can an entry be erased or disabled ? // Can an entry be erased or disabled ?
$iserasable=1;$canbedisabled=1;$canbemodified=1; // true by default // all true by default
$iserasable=1;
$canbedisabled=1;
$canbemodified=1;
if (isset($obj->code) && $id != 10) if (isset($obj->code) && $id != 10)
{ {
if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i', $obj->code))) { $iserasable = 0; $canbedisabled = 0; } if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i', $obj->code))) { $iserasable = 0; $canbedisabled = 0; }

View File

@ -545,7 +545,7 @@ foreach ($fieldsforcontent as $tmpfieldlist)
print '<strong>' . $form->textwithpicto($langs->trans("FilesAttachedToEmail"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist) . '</strong> '; print '<strong>' . $form->textwithpicto($langs->trans("FilesAttachedToEmail"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist) . '</strong> ';
} }
if ($tmpfieldlist == 'content') if ($tmpfieldlist == 'content')
print $form->textwithpicto($langs->trans("Content"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist); print $form->textwithpicto($langs->trans("Content"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist).'<br>';
if ($tmpfieldlist == 'content_lines') if ($tmpfieldlist == 'content_lines')
print $form->textwithpicto($langs->trans("ContentForLines"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist) . '<br>'; print $form->textwithpicto($langs->trans("ContentForLines"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist) . '<br>';
// Input field // Input field

View File

@ -68,8 +68,7 @@ if (!function_exists('gzdecode')) {
* Action * Action
*/ */
if ($action == 'addprinter' && $user->admin) if ($action == 'addprinter' && $user->admin) {
{
$error=0; $error=0;
$db->begin(); $db->begin();
if (empty($printername)) { if (empty($printername)) {
@ -81,8 +80,7 @@ if ($action == 'addprinter' && $user->admin)
setEventMessages($langs->trans("PrinterParameterEmpty"), null, 'warnings'); setEventMessages($langs->trans("PrinterParameterEmpty"), null, 'warnings');
} }
if (! $error) if (! $error) {
{
$result= $printer->AddPrinter($printername, GETPOST('printertypeid', 'int'), GETPOST('printerprofileid', 'int'), $parameter); $result= $printer->AddPrinter($printername, GETPOST('printertypeid', 'int'), GETPOST('printerprofileid', 'int'), $parameter);
if ($result > 0) $error++; if ($result > 0) $error++;
@ -100,8 +98,7 @@ if ($action == 'addprinter' && $user->admin)
$action = ''; $action = '';
} }
if ($action == 'deleteprinter' && $user->admin) if ($action == 'deleteprinter' && $user->admin) {
{
$error=0; $error=0;
$db->begin(); $db->begin();
if (empty($printerid)) { if (empty($printerid)) {
@ -109,8 +106,7 @@ if ($action == 'deleteprinter' && $user->admin)
setEventMessages($langs->trans("PrinterIdEmpty"), null, 'errors'); setEventMessages($langs->trans("PrinterIdEmpty"), null, 'errors');
} }
if (! $error) if (! $error) {
{
$result= $printer->DeletePrinter($printerid); $result= $printer->DeletePrinter($printerid);
if ($result > 0) $error++; if ($result > 0) $error++;
@ -128,8 +124,7 @@ if ($action == 'deleteprinter' && $user->admin)
$action = ''; $action = '';
} }
if ($action == 'updateprinter' && $user->admin) if ($action == 'updateprinter' && $user->admin) {
{
$error=0; $error=0;
$db->begin(); $db->begin();
if (empty($printerid)) { if (empty($printerid)) {
@ -137,18 +132,14 @@ if ($action == 'updateprinter' && $user->admin)
setEventMessages($langs->trans("PrinterIdEmpty"), null, 'errors'); setEventMessages($langs->trans("PrinterIdEmpty"), null, 'errors');
} }
if (! $error) if (! $error) {
{
$result= $printer->UpdatePrinter($printername, GETPOST('printertypeid', 'int'), GETPOST('printerprofileid', 'int'), $parameter, $printerid); $result= $printer->UpdatePrinter($printername, GETPOST('printertypeid', 'int'), GETPOST('printerprofileid', 'int'), $parameter, $printerid);
if ($result > 0) $error++; if ($result > 0) $error++;
if (! $error) if (! $error) {
{
$db->commit(); $db->commit();
setEventMessages($langs->trans("PrinterUpdated", $printername), null); setEventMessages($langs->trans("PrinterUpdated", $printername), null);
} } else {
else
{
$db->rollback(); $db->rollback();
dol_print_error($db); dol_print_error($db);
} }
@ -156,24 +147,19 @@ if ($action == 'updateprinter' && $user->admin)
$action = ''; $action = '';
} }
if ($action == 'testprinter' && $user->admin) if ($action == 'testprinter' && $user->admin) {
{
$error=0; $error=0;
if (empty($printerid)) { if (empty($printerid)) {
$error++; $error++;
setEventMessages($langs->trans("PrinterIdEmpty"), null, 'errors'); setEventMessages($langs->trans("PrinterIdEmpty"), null, 'errors');
} }
if (! $error) if (! $error) {
{
// test // test
$ret = $printer->SendTestToPrinter($printerid); $ret = $printer->SendTestToPrinter($printerid);
if ($ret == 0) if ($ret == 0) {
{
setEventMessages($langs->trans("TestSentToPrinter", $printername), null); setEventMessages($langs->trans("TestSentToPrinter", $printername), null);
} } else {
else
{
setEventMessages($printer->error, $printer->errors, 'errors'); setEventMessages($printer->error, $printer->errors, 'errors');
} }
} }
@ -181,8 +167,7 @@ if ($action == 'testprinter' && $user->admin)
} }
if ($action == 'updatetemplate' && $user->admin) if ($action == 'updatetemplate' && $user->admin) {
{
$error=0; $error=0;
$db->begin(); $db->begin();
if (empty($templateid)) { if (empty($templateid)) {
@ -190,18 +175,14 @@ if ($action == 'updatetemplate' && $user->admin)
setEventMessages($langs->trans("TemplateIdEmpty"), null, 'errors'); setEventMessages($langs->trans("TemplateIdEmpty"), null, 'errors');
} }
if (! $error) if (! $error) {
{
$result= $printer->UpdateTemplate($templatename, $template, $templateid); $result= $printer->UpdateTemplate($templatename, $template, $templateid);
if ($result > 0) $error++; if ($result > 0) $error++;
if (! $error) if (! $error) {
{
$db->commit(); $db->commit();
setEventMessages($langs->trans("TemplateUpdated", $templatename), null); setEventMessages($langs->trans("TemplateUpdated", $templatename), null);
} } else {
else
{
$db->rollback(); $db->rollback();
dol_print_error($db); dol_print_error($db);
} }
@ -223,8 +204,7 @@ print load_fiche_titre($langs->trans("ReceiptPrinterSetup"),$linkback,'title_set
$head = receiptprinteradmin_prepare_head($mode); $head = receiptprinteradmin_prepare_head($mode);
if ($mode == 'config' && $user->admin) if ($mode == 'config' && $user->admin) {
{
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?mode=config" autocomplete="off">'; print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?mode=config" autocomplete="off">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
if ($action!='editprinter') { if ($action!='editprinter') {
@ -253,11 +233,9 @@ if ($mode == 'config' && $user->admin)
if ($ret > 0) { if ($ret > 0) {
setEventMessages($printer->error, $printer->errors, 'errors'); setEventMessages($printer->error, $printer->errors, 'errors');
} else { } else {
for ($line=0; $line < $nbofprinters; $line++) for ($line=0; $line < $nbofprinters; $line++) {
{
print '<tr class="oddeven">'; print '<tr class="oddeven">';
if ($action=='editprinter' && $printer->listprinters[$line]['rowid']==$printerid) if ($action=='editprinter' && $printer->listprinters[$line]['rowid']==$printerid) {
{
print '<input type="hidden" name="printerid" value="'.$printer->listprinters[$line]['rowid'].'">'; print '<input type="hidden" name="printerid" value="'.$printer->listprinters[$line]['rowid'].'">';
print '<td><input size="50" type="text" name="printername" value="'.$printer->listprinters[$line]['name'].'"></td>'; print '<td><input size="50" type="text" name="printername" value="'.$printer->listprinters[$line]['name'].'"></td>';
$ret = $printer->selectTypePrinter($printer->listprinters[$line]['fk_type']); $ret = $printer->selectTypePrinter($printer->listprinters[$line]['fk_type']);
@ -291,10 +269,8 @@ if ($mode == 'config' && $user->admin)
} }
} }
if ($action!='editprinter') if ($action!='editprinter') {
{ if ($nbofprinters > 0) {
if ($nbofprinters > 0)
{
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<th>'.$langs->trans("Name").'</th>'; print '<th>'.$langs->trans("Name").'</th>';
print '<th>'.$langs->trans("Type").'</th>'; print '<th>'.$langs->trans("Type").'</th>';
@ -357,8 +333,7 @@ if ($mode == 'config' && $user->admin)
dol_fiche_end(); dol_fiche_end();
} }
if ($mode == 'template' && $user->admin) if ($mode == 'template' && $user->admin) {
{
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?mode=template" autocomplete="off">'; print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?mode=template" autocomplete="off">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
if ($action!='edittemplate') { if ($action!='edittemplate') {
@ -429,8 +404,7 @@ if ($mode == 'template' && $user->admin)
print '<th>'.$langs->trans("Description").'</th>'; print '<th>'.$langs->trans("Description").'</th>';
print "</tr>\n"; print "</tr>\n";
$max = count($printer->tags); $max = count($printer->tags);
for ($tag=0; $tag < $max; $tag++) for ($tag=0; $tag < $max; $tag++) {
{
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>&lt;'.$printer->tags[$tag].'&gt;</td><td>'.$langs->trans(strtoupper($printer->tags[$tag])).'</td>'; print '<td>&lt;'.$printer->tags[$tag].'&gt;</td><td>'.$langs->trans(strtoupper($printer->tags[$tag])).'</td>';
print '</tr>'; print '</tr>';

View File

@ -55,10 +55,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i',$action,$reg))
{ {
dol_print_error($db); dol_print_error($db);
} }
} } elseif (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) {
elseif (preg_match('/del_([a-z0-9_\-]+)/i',$action,$reg))
{
$code=$reg[1]; $code=$reg[1];
if (dolibarr_del_const($db, $code, $conf->entity) > 0) if (dolibarr_del_const($db, $code, $conf->entity) > 0)
{ {

View File

@ -98,8 +98,7 @@ print '<br>';
$arrayofsocialnetworks=array('jabber'=>'Jabber', 'skype'=>'Skype', 'twitter'=>'Twitter', 'facebook'=>'Facebook'); $arrayofsocialnetworks=array('jabber'=>'Jabber', 'skype'=>'Skype', 'twitter'=>'Twitter', 'facebook'=>'Facebook');
foreach($arrayofsocialnetworks as $snkey => $snlabel) foreach($arrayofsocialnetworks as $snkey => $snlabel) {
{
$consttocheck = 'SOCIALNETWORKS_'.strtoupper($snkey); $consttocheck = 'SOCIALNETWORKS_'.strtoupper($snkey);
if ($conf->use_javascript_ajax) { if ($conf->use_javascript_ajax) {
$link = ajax_constantonoff($consttocheck); $link = ajax_constantonoff($consttocheck);

View File

@ -35,14 +35,15 @@ $what=GETPOST('what','alpha');
$export_type=GETPOST('export_type', 'alpha'); $export_type=GETPOST('export_type', 'alpha');
$file=GETPOST('filename_template', 'alpha'); $file=GETPOST('filename_template', 'alpha');
// Load variable for pagination
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
$sortfield = GETPOST('sortfield', 'alpha'); $sortfield = GETPOST('sortfield', 'alpha');
$sortorder = GETPOST('sortorder', 'alpha'); $sortorder = GETPOST('sortorder', 'alpha');
$page = GETPOST("page", 'int'); $page = GETPOST("page", 'int');
if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action
$offset = $limit * $page;
if (! $sortorder) $sortorder="DESC"; if (! $sortorder) $sortorder="DESC";
if (! $sortfield) $sortfield="date"; if (! $sortfield) $sortfield="date";
if ($page < 0) { $page = 0; }
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$offset = $limit * $page;
if (! $user->admin) accessforbidden(); if (! $user->admin) accessforbidden();

View File

@ -96,8 +96,7 @@ foreach ($modulesdir as $dir)
if (empty($conf->$module->enabled)) $enabled=false; if (empty($conf->$module->enabled)) $enabled=false;
if ($enabled) if ($enabled) {
{
/* /*
* If exists, load the API class for enable module * If exists, load the API class for enable module
* *

View File

@ -104,9 +104,7 @@ if ($action === 'downloadblockchain') {
echo $bc; echo $bc;
exit; exit;
} } elseif (GETPOST('downloadcsv', 'alpha')) {
elseif (GETPOST('downloadcsv','alpha'))
{
$error = 0; $error = 0;
$previoushash=''; $previoushash='';
@ -438,8 +436,7 @@ print getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"],'','',$param,'align="cente
print getTitleFieldOfList('<span id="blockchainstatus"></span>', 0, $_SERVER["PHP_SELF"], '', '', $param, 'align="center"', $sortfield, $sortorder, '')."\n"; print getTitleFieldOfList('<span id="blockchainstatus"></span>', 0, $_SERVER["PHP_SELF"], '', '', $param, 'align="center"', $sortfield, $sortorder, '')."\n";
print '</tr>'; print '</tr>';
if (! empty($conf->global->BLOCKEDLOG_SCAN_ALL_FOR_LOWERIDINERROR)) if (! empty($conf->global->BLOCKEDLOG_SCAN_ALL_FOR_LOWERIDINERROR)) {
{
// This is version that is faster but require more memory and report errors that are outside the filter range // This is version that is faster but require more memory and report errors that are outside the filter range
// TODO Make a full scan of table in reverse order of id of $block, so we can use the parameter $previoushash into checkSignature to save requests // TODO Make a full scan of table in reverse order of id of $block, so we can use the parameter $previoushash into checkSignature to save requests

View File

@ -1061,8 +1061,7 @@ class ActionComm extends CommonObject
$this->nb=array(); $this->nb=array();
$sql = "SELECT count(a.id) as nb"; $sql = "SELECT count(a.id) as nb";
} }
$sql.= " FROM (".MAIN_DB_PREFIX."actioncomm as a"; $sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a";
$sql.= ")";
if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc"; if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid";
$sql.= " WHERE 1 = 1"; $sql.= " WHERE 1 = 1";
@ -1292,7 +1291,7 @@ class ActionComm extends CommonObject
if (! empty($this->location)) if (! empty($this->location))
$tooltip .= '<br><b>' . $langs->trans('Location') . ':</b> ' . $this->location; $tooltip .= '<br><b>' . $langs->trans('Location') . ':</b> ' . $this->location;
if (! empty($this->note)) if (! empty($this->note))
$tooltip .= '<br><b>' . $langs->trans('Note') . ':</b> ' . (dol_textishtml($this->note) ? str_replace(array("\r","\n"), "", $this->note) : $this->note); $tooltip .= '<br><b>' . $langs->trans('Note') . ':</b> ' . (dol_textishtml($this->note) ? str_replace(array("\r","\n"), "", $this->note) : str_replace(array("\r","\n"), '<br>', $this->note));
$linkclose=''; $linkclose='';
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE) && $this->type_color) if (! empty($conf->global->AGENDA_USE_EVENT_TYPE) && $this->type_color)
$linkclose = ' style="background-color:#'.$this->type_color.'"'; $linkclose = ' style="background-color:#'.$this->type_color.'"';

View File

@ -1428,9 +1428,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
elseif ($event->type_code == 'ICALEVENT') elseif ($event->type_code == 'ICALEVENT')
{ {
$cssclass.= " unmovable"; $cssclass.= " unmovable";
} } elseif ($event->date_end_in_calendar && date('Ymd', $event->date_start_in_calendar) != date('Ymd', $event->date_end_in_calendar)) {
elseif ($event->date_end_in_calendar && date('Ymd',$event->date_start_in_calendar) != date('Ymd',$event->date_end_in_calendar))
{
$tmpyearend = date('Y', $event->date_end_in_calendar); $tmpyearend = date('Y', $event->date_end_in_calendar);
$tmpmonthend = date('m', $event->date_end_in_calendar); $tmpmonthend = date('m', $event->date_end_in_calendar);
$tmpdayend = date('d', $event->date_end_in_calendar); $tmpdayend = date('d', $event->date_end_in_calendar);

View File

@ -876,7 +876,7 @@ if ($object->id > 0)
print '<td class="right"><b>!!!</b></td>'; print '<td class="right"><b>!!!</b></td>';
} }
print '<td align="right" class="nowrap" width="100" >' . $sendingstatic->LibStatut($objp->statut, 5) . '</td>'; print '<td class="nowrap right" width="100" >' . $sendingstatic->LibStatut($objp->statut, 5) . '</td>';
print "</tr>\n"; print "</tr>\n";
$i++; $i++;
} }
@ -942,7 +942,7 @@ if ($object->id > 0)
print '<td class="right" width="80px">'.dol_print_date($db->jdate($objp->dc), 'day')."</td>\n"; print '<td class="right" width="80px">'.dol_print_date($db->jdate($objp->dc), 'day')."</td>\n";
print '<td class="right" width="80px">'.dol_print_date($db->jdate($objp->dcon), 'day')."</td>\n"; print '<td class="right" width="80px">'.dol_print_date($db->jdate($objp->dcon), 'day')."</td>\n";
print '<td width="20">&nbsp;</td>'; print '<td width="20">&nbsp;</td>';
print '<td align="right" class="nowraponall">'; print '<td class="nowraponall right">';
print $contrat->getLibStatut(4); print $contrat->getLibStatut(4);
print "</td>\n"; print "</td>\n";
print '</tr>'; print '</tr>';
@ -1004,7 +1004,7 @@ if ($object->id > 0)
print '<td class="nowrap"><a href="'.DOL_URL_ROOT.'/fichinter/card.php?id='.$objp->id.'">'.img_object($langs->trans("ShowPropal"), "propal").' '.$objp->ref.'</a></td>'."\n"; print '<td class="nowrap"><a href="'.DOL_URL_ROOT.'/fichinter/card.php?id='.$objp->id.'">'.img_object($langs->trans("ShowPropal"), "propal").' '.$objp->ref.'</a></td>'."\n";
//print '<td class="right" width="80px">'.dol_print_date($db->jdate($objp->startdate)).'</td>'."\n"; //print '<td class="right" width="80px">'.dol_print_date($db->jdate($objp->startdate)).'</td>'."\n";
print '<td class="right" style="min-width: 60px">'.convertSecondToTime($objp->duration).'</td>'."\n"; print '<td class="right" style="min-width: 60px">'.convertSecondToTime($objp->duration).'</td>'."\n";
print '<td align="right" class="nowrap" style="min-width: 60px">'.$fichinter_static->getLibStatut(5).'</td>'."\n"; print '<td class="nowrap right" style="min-width: 60px">'.$fichinter_static->getLibStatut(5).'</td>'."\n";
print '</tr>'; print '</tr>';
$i++; $i++;
@ -1110,7 +1110,7 @@ if ($object->id > 0)
print '</td>'; print '</td>';
} }
print '<td align="right" class="nowrap" style="min-width: 60px">'; print '<td class="nowrap right" style="min-width: 60px">';
print $langs->trans('FrequencyPer_'.$invoicetemplate->unit_frequency, $invoicetemplate->frequency).' - '; print $langs->trans('FrequencyPer_'.$invoicetemplate->unit_frequency, $invoicetemplate->frequency).' - ';
print ($invoicetemplate->LibStatut($invoicetemplate->frequency, $invoicetemplate->suspended, 5, 0)); print ($invoicetemplate->LibStatut($invoicetemplate->frequency, $invoicetemplate->suspended, 5, 0));
print '</td>'; print '</td>';
@ -1205,7 +1205,7 @@ if ($object->id > 0)
print '</td>'; print '</td>';
} }
print '<td align="right" class="nowrap" style="min-width: 60px">'.($facturestatic->LibStatut($objp->paye,$objp->statut,5,$objp->am)).'</td>'; print '<td class="nowrap right" style="min-width: 60px">'.($facturestatic->LibStatut($objp->paye, $objp->statut, 5, $objp->am)).'</td>';
print "</tr>\n"; print "</tr>\n";
$i++; $i++;
} }

View File

@ -142,7 +142,7 @@ if ($resql)
print '<td class="liste_titre"><input class="flat" name="search_firstname" size="12" value="'.$search_firstname.'"></td>'; print '<td class="liste_titre"><input class="flat" name="search_firstname" size="12" value="'.$search_firstname.'"></td>';
print '<td class="liste_titre"><input class="flat" name="search_company" size="12" value="'.$search_company.'"></td>'; print '<td class="liste_titre"><input class="flat" name="search_company" size="12" value="'.$search_company.'"></td>';
print '<td class="liste_titre">&nbsp;</td>'; print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'"></td>'; print '<td class="liste_titre right"><input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"), 'search.png', '', '', 1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'"></td>';
print "</tr>\n"; print "</tr>\n";
$i = 0; $i = 0;

View File

@ -186,7 +186,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
$companystatic->canvas=$obj->canvas; $companystatic->canvas=$obj->canvas;
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_ht).'</td></tr>'; print '<td class="nowrap right">'.price($obj->total_ht).'</td></tr>';
$i++; $i++;
$total += $obj->total_ht; $total += $obj->total_ht;
} }
@ -266,7 +266,7 @@ if (! empty($conf->supplier_proposal->enabled) && $user->rights->supplier_propos
$companystatic->canvas=$obj->canvas; $companystatic->canvas=$obj->canvas;
print $companystatic->getNomUrl(1, 'supplier', 16); print $companystatic->getNomUrl(1, 'supplier', 16);
print '</td>'; print '</td>';
print '<td align="right" class="nowrap">'.price($obj->total_ht).'</td></tr>'; print '<td class="nowrap right">'.price($obj->total_ht).'</td></tr>';
$i++; $i++;
$total += $obj->total_ht; $total += $obj->total_ht;
} }
@ -345,10 +345,10 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire)
print $companystatic->getNomUrl(1, 'customer', 16); print $companystatic->getNomUrl(1, 'customer', 16);
print '</td>'; print '</td>';
if(! empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT)) { if(! empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT)) {
print '<td align="right" class="nowrap">'.price($obj->total_ht).'</td></tr>'; print '<td class="nowrap right">'.price($obj->total_ht).'</td></tr>';
} }
else { else {
print '<td class="right" class="nowrap">'.price($obj->total_ttc).'</td></tr>'; print '<td class="nowrap right">'.price($obj->total_ttc).'</td></tr>';
} }
$i++; $i++;
$total += $obj->total_ttc; $total += $obj->total_ttc;
@ -432,10 +432,10 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande
print $companystatic->getNomUrl(1, 'supplier', 16); print $companystatic->getNomUrl(1, 'supplier', 16);
print '</td>'; print '</td>';
if(! empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT)) { if(! empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT)) {
print '<td align="right" class="nowrap">'.price($obj->total_ht).'</td></tr>'; print '<td class="nowrap right">'.price($obj->total_ht).'</td></tr>';
} }
else { else {
print '<td class="right" class="nowrap">'.price($obj->total_ttc).'</td></tr>'; print '<td class="nowrap right">'.price($obj->total_ttc).'</td></tr>';
} }
$i++; $i++;
$total += $obj->total_ttc; $total += $obj->total_ttc;

View File

@ -527,11 +527,11 @@ if (empty($reshook))
if ($action == 'settitre') $object->titre = trim(GETPOST('titre', 'alpha')); if ($action == 'settitre') $object->titre = trim(GETPOST('titre', 'alpha'));
elseif ($action == 'setemail_from') $object->email_from = trim(GETPOST('email_from', 'alpha')); elseif ($action == 'setemail_from') $object->email_from = trim(GETPOST('email_from', 'alpha'));
elseif ($action == 'setemail_replyto') $object->email_replyto = trim(GETPOST('email_replyto', 'alpha')); elseif ($action == 'setemail_replyto') $object->email_replyto = trim(GETPOST('email_replyto', 'alpha'));
elseif ($action == 'setemail_errorsto') $object->email_errorsto = trim(GETPOST('email_errorsto','alpha')); elseif ($action == 'setemail_errorsto') {
elseif ($action == 'settitre' && empty($object->titre)) { $object->email_errorsto = trim(GETPOST('email_errorsto', 'alpha'));
} elseif ($action == 'settitre' && empty($object->titre)) {
$mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("MailTitle")); $mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("MailTitle"));
} } elseif ($action == 'setfrom' && empty($object->email_from)) {
elseif ($action == 'setfrom' && empty($object->email_from)) {
$mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("MailFrom")); $mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("MailFrom"));
} }

View File

@ -518,8 +518,7 @@ if ($object->fetch($id) >= 0)
print_liste_field_titre("OtherInformations", $_SERVER["PHP_SELF"], "", $param, "", "", $sortfield, $sortorder); print_liste_field_titre("OtherInformations", $_SERVER["PHP_SELF"], "", $param, "", "", $sortfield, $sortorder);
print_liste_field_titre("Source", $_SERVER["PHP_SELF"], "", $param, "", 'align="center"', $sortfield, $sortorder); print_liste_field_titre("Source", $_SERVER["PHP_SELF"], "", $param, "", 'align="center"', $sortfield, $sortorder);
// Date sending // Date sending
if ($object->statut < 2) if ($object->statut < 2) {
{
print_liste_field_titre(''); print_liste_field_titre('');
} }
else else

View File

@ -319,6 +319,7 @@ class Mailing extends CommonObject
if ($result < 0) if ($result < 0)
{ {
$this->error=$object->error; $this->error=$object->error;
$this->errors=array_merge($this->errors, $object->errors);
$error++; $error++;
} }

View File

@ -109,8 +109,7 @@ if (is_resource($handle))
print '<tr class="oddeven">'; print '<tr class="oddeven">';
$result=$db->query($sql); $result=$db->query($sql);
if ($result) if ($result) {
{
$num = $db->num_rows($result); $num = $db->num_rows($result);
$i = 0; $i = 0;
@ -154,8 +153,7 @@ $sql.= " FROM ".MAIN_DB_PREFIX."mailing as m";
$sql.= " ORDER BY m.date_creat DESC"; $sql.= " ORDER BY m.date_creat DESC";
$sql.= " LIMIT ".$limit; $sql.= " LIMIT ".$limit;
$result=$db->query($sql); $result=$db->query($sql);
if ($result) if ($result) {
{
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td colspan="2">'.$langs->trans("LastMailings", $limit).'</td>'; print '<td colspan="2">'.$langs->trans("LastMailings", $limit).'</td>';

View File

@ -193,7 +193,7 @@ if ($result)
if (! $filteremail) print '<td class="liste_titre">&nbsp;</td>'; if (! $filteremail) print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre">&nbsp;</td>'; print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre">&nbsp;</td>'; print '<td class="liste_titre">&nbsp;</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>';
@ -206,8 +206,8 @@ if ($result)
if (! $filteremail) print_liste_field_titre("NbOfEMails", $_SERVER["PHP_SELF"], "m.nbemail", $param, "", 'align="center"', $sortfield, $sortorder); if (! $filteremail) print_liste_field_titre("NbOfEMails", $_SERVER["PHP_SELF"], "m.nbemail", $param, "", 'align="center"', $sortfield, $sortorder);
if (! $filteremail) print_liste_field_titre("DateLastSend", $_SERVER["PHP_SELF"], "m.date_envoi", $param, "", 'align="center"', $sortfield, $sortorder); if (! $filteremail) print_liste_field_titre("DateLastSend", $_SERVER["PHP_SELF"], "m.date_envoi", $param, "", 'align="center"', $sortfield, $sortorder);
else print_liste_field_titre("DateSending", $_SERVER["PHP_SELF"], "mc.date_envoi", $param, "", 'align="center"', $sortfield, $sortorder); else print_liste_field_titre("DateSending", $_SERVER["PHP_SELF"], "mc.date_envoi", $param, "", 'align="center"', $sortfield, $sortorder);
print_liste_field_titre("Status",$_SERVER["PHP_SELF"],($filteremail?"mc.statut":"m.statut"),$param,"",'align="right"',$sortfield,$sortorder); print_liste_field_titre("Status", $_SERVER["PHP_SELF"], ($filteremail?"mc.statut":"m.statut"), $param, "", 'class="right"', $sortfield, $sortorder);
print_liste_field_titre('', $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch '); print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', 'class="right"', $sortfield, $sortorder, 'maxwidthsearch ');
print "</tr>\n"; print "</tr>\n";
@ -256,7 +256,7 @@ if ($result)
print '</td>'; print '</td>';
// Status // Status
print '<td align="right" class="nowrap">'; print '<td class="nowrap right">';
if ($filteremail) if ($filteremail)
{ {
print $email::libStatutDest($obj->sendstatut, 2); print $email::libStatutDest($obj->sendstatut, 2);

View File

@ -641,8 +641,7 @@ if (empty($reshook))
} }
// Close proposal // Close proposal
elseif ($action == 'setstatut' && $usercanclose && ! GETPOST('cancel','alpha')) elseif ($action == 'setstatut' && $usercanclose && ! GETPOST('cancel', 'alpha')) {
{
if (! (GETPOST('statut', 'int') > 0)) { if (! (GETPOST('statut', 'int') > 0)) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CloseAs")), null, 'errors'); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CloseAs")), null, 'errors');
$action = 'statut'; $action = 'statut';
@ -672,8 +671,7 @@ if (empty($reshook))
} }
// Reopen proposal // Reopen proposal
elseif ($action == 'confirm_reopen' && $usercanclose && ! GETPOST('cancel','alpha')) elseif ($action == 'confirm_reopen' && $usercanclose && ! GETPOST('cancel', 'alpha')) {
{
// prevent browser refresh from reopening proposal several times // prevent browser refresh from reopening proposal several times
if ($object->statut == Propal::STATUS_SIGNED || $object->statut == Propal::STATUS_NOTSIGNED || $object->statut == Propal::STATUS_BILLED) if ($object->statut == Propal::STATUS_SIGNED || $object->statut == Propal::STATUS_NOTSIGNED || $object->statut == Propal::STATUS_BILLED)
{ {
@ -1318,16 +1316,13 @@ if (empty($reshook))
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }
} } elseif ($action == 'updateline' && $usercancreate && GETPOST('cancel', 'alpha')) {
elseif ($action == 'updateline' && $usercancreate && GETPOST('cancel','alpha'))
{
header('Location: ' . $_SERVER['PHP_SELF'] . '?id=' . $object->id); // Pour reaffichage de la fiche en cours d'edition header('Location: ' . $_SERVER['PHP_SELF'] . '?id=' . $object->id); // Pour reaffichage de la fiche en cours d'edition
exit(); exit();
} }
// Set project
elseif ($action == 'classin' && $usercancreate) { elseif ($action == 'classin' && $usercancreate) {
// Set project
$object->setProject(GETPOST('projectid', 'int')); $object->setProject(GETPOST('projectid', 'int'));
} }

View File

@ -297,8 +297,7 @@ class Proposals extends DolibarrApi
if ($updateRes > 0) { if ($updateRes > 0) {
return $updateRes; return $updateRes;
} } else {
else {
throw new RestException(400, $this->propal->error); throw new RestException(400, $this->propal->error);
} }
} }

View File

@ -1285,7 +1285,12 @@ class Propal extends CommonObject
// Create clone // Create clone
$object->context['createfromclone']='createfromclone'; $object->context['createfromclone']='createfromclone';
$result=$object->create($user); $result=$object->create($user);
if ($result < 0) $error++; if ($result < 0)
{
$this->error = $object->error;
$this->errors = array_merge($this->errors, $object->errors);
$error++;
}
if (! $error) if (! $error)
{ {

View File

@ -430,7 +430,7 @@ if (! empty($conf->propal->enabled))
print '&nbsp;'; print '&nbsp;';
print '</td>'; print '</td>';
print '<td width="16" align="right" class="nobordernopadding">'; print '<td width="16" class="nobordernopadding 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;
@ -503,7 +503,7 @@ if (! empty($conf->propal->enabled))
print '&nbsp;'; print '&nbsp;';
print '</td>'; print '</td>';
print '<td width="16" align="right" class="nobordernopadding">'; print '<td width="16" class="nobordernopadding 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;
@ -514,7 +514,7 @@ if (! empty($conf->propal->enabled))
print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->name.'</a></td>'; print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->name.'</a></td>';
print '<td align="right">'.$propalstatic->LibStatut($obj->fk_statut,$obj->facture,5).'</td>'; print '<td class="right">'.$propalstatic->LibStatut($obj->fk_statut,$obj->facture,5).'</td>';
print '</tr>'; print '</tr>';
$i++; $i++;

View File

@ -619,21 +619,21 @@ if ($resql)
if (! empty($arrayfields['p.total_ht']['checked'])) if (! empty($arrayfields['p.total_ht']['checked']))
{ {
// Amount // Amount
print '<td class="liste_titre" align="right">'; print '<td class="liste_titre right">';
print '<input class="flat" type="text" size="5" name="search_montant_ht" value="'.dol_escape_htmltag($search_montant_ht).'">'; print '<input class="flat" type="text" size="5" name="search_montant_ht" value="'.dol_escape_htmltag($search_montant_ht).'">';
print '</td>'; print '</td>';
} }
if (! empty($arrayfields['p.total_vat']['checked'])) if (! empty($arrayfields['p.total_vat']['checked']))
{ {
// Amount // Amount
print '<td class="liste_titre" align="right">'; print '<td class="liste_titre right">';
print '<input class="flat" type="text" size="5" name="search_montant_vat" value="'.dol_escape_htmltag($search_montant_vat).'">'; print '<input class="flat" type="text" size="5" name="search_montant_vat" value="'.dol_escape_htmltag($search_montant_vat).'">';
print '</td>'; print '</td>';
} }
if (! empty($arrayfields['p.total_ttc']['checked'])) if (! empty($arrayfields['p.total_ttc']['checked']))
{ {
// Amount // Amount
print '<td class="liste_titre" align="right">'; print '<td class="liste_titre right">';
print '<input class="flat" type="text" size="5" name="search_montant_ttc" value="'.dol_escape_htmltag($search_montant_ttc).'">'; print '<input class="flat" type="text" size="5" name="search_montant_ttc" value="'.dol_escape_htmltag($search_montant_ttc).'">';
print '</td>'; print '</td>';
} }
@ -670,7 +670,7 @@ if ($resql)
// Status // Status
if (! empty($arrayfields['p.fk_statut']['checked'])) if (! empty($arrayfields['p.fk_statut']['checked']))
{ {
print '<td class="liste_titre maxwidthonsmartphone" align="right">'; print '<td class="liste_titre maxwidthonsmartphone right">';
$formpropal->selectProposalStatus($viewstatut, 1, 0, 1, 'customer', 'search_statut'); $formpropal->selectProposalStatus($viewstatut, 1, 0, 1, 'customer', 'search_statut');
print '</td>'; print '</td>';
} }
@ -698,9 +698,9 @@ if ($resql)
if (! empty($arrayfields['p.fin_validite']['checked'])) print_liste_field_titre($arrayfields['p.fin_validite']['label'], $_SERVER["PHP_SELF"], 'dfv', '', $param, 'align="center"', $sortfield, $sortorder); if (! empty($arrayfields['p.fin_validite']['checked'])) print_liste_field_titre($arrayfields['p.fin_validite']['label'], $_SERVER["PHP_SELF"], 'dfv', '', $param, 'align="center"', $sortfield, $sortorder);
if (! empty($arrayfields['p.date_livraison']['checked'])) print_liste_field_titre($arrayfields['p.date_livraison']['label'], $_SERVER["PHP_SELF"], 'ddelivery', '', $param, 'align="center"', $sortfield, $sortorder); if (! empty($arrayfields['p.date_livraison']['checked'])) print_liste_field_titre($arrayfields['p.date_livraison']['label'], $_SERVER["PHP_SELF"], 'ddelivery', '', $param, 'align="center"', $sortfield, $sortorder);
if (! empty($arrayfields['ava.rowid']['checked'])) print_liste_field_titre($arrayfields['ava.rowid']['label'], $_SERVER["PHP_SELF"], 'availability', '', $param, '', $sortfield, $sortorder); if (! empty($arrayfields['ava.rowid']['checked'])) print_liste_field_titre($arrayfields['ava.rowid']['label'], $_SERVER["PHP_SELF"], 'availability', '', $param, '', $sortfield, $sortorder);
if (! empty($arrayfields['p.total_ht']['checked'])) print_liste_field_titre($arrayfields['p.total_ht']['label'],$_SERVER["PHP_SELF"],'p.total_ht','',$param, 'align="right"',$sortfield,$sortorder); if (! empty($arrayfields['p.total_ht']['checked'])) print_liste_field_titre($arrayfields['p.total_ht']['label'], $_SERVER["PHP_SELF"], 'p.total_ht', '', $param, 'class="right"', $sortfield, $sortorder);
if (! empty($arrayfields['p.total_vat']['checked'])) print_liste_field_titre($arrayfields['p.total_vat']['label'],$_SERVER["PHP_SELF"],'p.tva','',$param, 'align="right"',$sortfield,$sortorder); if (! empty($arrayfields['p.total_vat']['checked'])) print_liste_field_titre($arrayfields['p.total_vat']['label'], $_SERVER["PHP_SELF"], 'p.tva', '', $param, 'class="right"', $sortfield, $sortorder);
if (! empty($arrayfields['p.total_ttc']['checked'])) print_liste_field_titre($arrayfields['p.total_ttc']['label'],$_SERVER["PHP_SELF"],'p.total','',$param, 'align="right"',$sortfield,$sortorder); if (! empty($arrayfields['p.total_ttc']['checked'])) print_liste_field_titre($arrayfields['p.total_ttc']['label'], $_SERVER["PHP_SELF"], 'p.total', '', $param, 'class="right"', $sortfield, $sortorder);
if (! empty($arrayfields['u.login']['checked'])) print_liste_field_titre($arrayfields['u.login']['label'], $_SERVER["PHP_SELF"], 'u.login', '', $param, 'align="center"', $sortfield, $sortorder); if (! empty($arrayfields['u.login']['checked'])) print_liste_field_titre($arrayfields['u.login']['label'], $_SERVER["PHP_SELF"], 'u.login', '', $param, 'align="center"', $sortfield, $sortorder);
if (! empty($arrayfields['sale_representative']['checked'])) print_liste_field_titre($arrayfields['sale_representative']['label'], $_SERVER["PHP_SELF"], "", "", "$param", '', $sortfield, $sortorder); if (! empty($arrayfields['sale_representative']['checked'])) print_liste_field_titre($arrayfields['sale_representative']['label'], $_SERVER["PHP_SELF"], "", "", "$param", '', $sortfield, $sortorder);
// Extra fields // Extra fields
@ -711,7 +711,7 @@ if ($resql)
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, 'align="center" class="nowrap"', $sortfield, $sortorder); if (! empty($arrayfields['p.datec']['checked'])) print_liste_field_titre($arrayfields['p.datec']['label'], $_SERVER["PHP_SELF"], "p.datec", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder);
if (! empty($arrayfields['p.tms']['checked'])) print_liste_field_titre($arrayfields['p.tms']['label'], $_SERVER["PHP_SELF"], "p.tms", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder); if (! empty($arrayfields['p.tms']['checked'])) print_liste_field_titre($arrayfields['p.tms']['label'], $_SERVER["PHP_SELF"], "p.tms", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder);
if (! empty($arrayfields['p.fk_statut']['checked'])) print_liste_field_titre($arrayfields['p.fk_statut']['label'],$_SERVER["PHP_SELF"],"p.fk_statut","",$param,'align="right"',$sortfield,$sortorder); if (! empty($arrayfields['p.fk_statut']['checked'])) print_liste_field_titre($arrayfields['p.fk_statut']['label'], $_SERVER["PHP_SELF"], "p.fk_statut", "", $param, 'class="right"', $sortfield, $sortorder);
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";
@ -753,7 +753,7 @@ if ($resql)
print '</td>'; print '</td>';
} }
// Other picto tool // Other picto tool
print '<td width="16" align="right" class="nobordernopadding">'; print '<td width="16" class="nobordernopadding right">';
$filename=dol_sanitizeFileName($obj->ref); $filename=dol_sanitizeFileName($obj->ref);
$filedir=$conf->propal->multidir_output[$obj->entity] . '/' . dol_sanitizeFileName($obj->ref); $filedir=$conf->propal->multidir_output[$obj->entity] . '/' . dol_sanitizeFileName($obj->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;

View File

@ -24,8 +24,7 @@
*/ */
// Protection to avoid direct call of template // Protection to avoid direct call of template
if (empty($conf) || ! is_object($conf)) if (empty($conf) || ! is_object($conf)) {
{
print "Error, template page can't be called as URL"; print "Error, template page can't be called as URL";
exit; exit;
} }
@ -54,7 +53,8 @@ foreach($linkedObjectBlock as $key => $objectlink)
?> ?>
<tr class="<?php echo $trclass; ?>" data-element="<?php echo $objectlink->element; ?>" data-id="<?php echo $objectlink->id; ?>" > <tr class="<?php echo $trclass; ?>" data-element="<?php echo $objectlink->element; ?>" data-id="<?php echo $objectlink->id; ?>" >
<td class="linkedcol-element" ><?php echo $langs->trans("Proposal"); ?> <td class="linkedcol-element" ><?php echo $langs->trans("Proposal"); ?>
<?php if(!empty($showImportButton) && $conf->global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES) <?php
if(!empty($showImportButton) && $conf->global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES)
{ {
$url = DOL_URL_ROOT.'/comm/propal/card.php?id='.$objectlink->id; $url = DOL_URL_ROOT.'/comm/propal/card.php?id='.$objectlink->id;
print '<a class="objectlinked_importbtn" href="'.$url.'&amp;action=selectlines" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" > <i class="fa fa-indent"></i> </a>'; print '<a class="objectlinked_importbtn" href="'.$url.'&amp;action=selectlines" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" > <i class="fa fa-indent"></i> </a>';
@ -64,13 +64,13 @@ foreach($linkedObjectBlock as $key => $objectlink)
<td class="linkedcol-name" ><?php echo $objectlink->getNomUrl(1); ?></td> <td class="linkedcol-name" ><?php echo $objectlink->getNomUrl(1); ?></td>
<td class="linkedcol-ref" ><?php echo $objectlink->ref_client; ?></td> <td class="linkedcol-ref" ><?php echo $objectlink->ref_client; ?></td>
<td class="linkedcol-date" align="center"><?php echo dol_print_date($objectlink->date, 'day'); ?></td> <td class="linkedcol-date" align="center"><?php echo dol_print_date($objectlink->date, 'day'); ?></td>
<td class="linkedcol-amount" align="right"><?php <td class="linkedcol-amount right"><?php
if ($user->rights->propale->lire) { if ($user->rights->propale->lire) {
$total = $total + $objectlink->total_ht; $total = $total + $objectlink->total_ht;
echo price($objectlink->total_ht); echo price($objectlink->total_ht);
} ?></td> } ?></td>
<td class="linkedcol-statut" align="right"><?php echo $objectlink->getLibStatut(3); ?></td> <td class="linkedcol-statut right"><?php echo $objectlink->getLibStatut(3); ?></td>
<td class="linkedcol-action" 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="linkedcol-action 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

@ -220,7 +220,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
} }
if ($total>0) if ($total>0)
{ {
print '<tr class="liste_total"><td colspan="3" align="right">'.$langs->trans("Total")."</td><td align=\"right\">".price($total)."</td></tr>"; print '<tr class="liste_total"><td colspan="3" class="right">'.$langs->trans("Total")."</td><td class=\"right\">".price($total)."</td></tr>";
} }
print "</table><br>"; print "</table><br>";
} }

View File

@ -1132,9 +1132,7 @@ if (empty($reshook))
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }
} } elseif ($action == 'updateline' && $user->rights->commande->creer && GETPOST('cancel', 'alpha') == $langs->trans('Cancel')) {
elseif ($action == 'updateline' && $user->rights->commande->creer && GETPOST('cancel','alpha') == $langs->trans('Cancel')) {
header('Location: ' . $_SERVER['PHP_SELF'] . '?id=' . $object->id); // Pour reaffichage de la fiche en cours d'edition header('Location: ' . $_SERVER['PHP_SELF'] . '?id=' . $object->id); // Pour reaffichage de la fiche en cours d'edition
exit(); exit();
} }

View File

@ -130,7 +130,7 @@ if ($resql)
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", "", "", 'align="left"', $sortfield, $sortorder);
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", "", "", 'align="left"', $sortfield, $sortorder);
print_liste_field_titre("DateCreation",$_SERVER["PHP_SELF"],"datec",$addu,"",'align="right"',$sortfield,$sortorder); print_liste_field_titre("DateCreation", $_SERVER["PHP_SELF"], "datec", $addu, "", 'class="right"', $sortfield, $sortorder);
print "</tr>\n"; print "</tr>\n";
// Lignes des champs de filtre // Lignes des champs de filtre
@ -149,7 +149,7 @@ if ($resql)
print '<input class="flat" type="text" size="10" name="search_compta" value="'.dol_escape_htmltag(GETPOST("search_compta")).'">'; print '<input class="flat" type="text" size="10" name="search_compta" value="'.dol_escape_htmltag(GETPOST("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>';

View File

@ -652,21 +652,21 @@ if ($resql)
if (! empty($arrayfields['c.total_ht']['checked'])) if (! empty($arrayfields['c.total_ht']['checked']))
{ {
// Amount // Amount
print '<td class="liste_titre" align="right">'; print '<td class="liste_titre right">';
print '<input class="flat" type="text" size="4" name="search_total_ht" value="'.$search_total_ht.'">'; print '<input class="flat" type="text" size="4" name="search_total_ht" value="'.$search_total_ht.'">';
print '</td>'; print '</td>';
} }
if (! empty($arrayfields['c.total_vat']['checked'])) if (! empty($arrayfields['c.total_vat']['checked']))
{ {
// Amount // Amount
print '<td class="liste_titre" align="right">'; print '<td class="liste_titre right">';
print '<input class="flat" type="text" size="4" name="search_total_vat" value="'.$search_total_vat.'">'; print '<input class="flat" type="text" size="4" name="search_total_vat" value="'.$search_total_vat.'">';
print '</td>'; print '</td>';
} }
if (! empty($arrayfields['c.total_ttc']['checked'])) if (! empty($arrayfields['c.total_ttc']['checked']))
{ {
// Amount // Amount
print '<td class="liste_titre" align="right">'; print '<td class="liste_titre right">';
print '<input class="flat" type="text" size="5" name="search_total_ttc" value="'.$search_total_ttc.'">'; print '<input class="flat" type="text" size="5" name="search_total_ttc" value="'.$search_total_ttc.'">';
print '</td>'; print '</td>';
} }
@ -691,7 +691,7 @@ if ($resql)
// Status // Status
if (! empty($arrayfields['c.fk_statut']['checked'])) if (! empty($arrayfields['c.fk_statut']['checked']))
{ {
print '<td class="liste_titre maxwidthonsmartphone" align="right">'; print '<td class="liste_titre maxwidthonsmartphone right">';
$liststatus=array( $liststatus=array(
Commande::STATUS_DRAFT=>$langs->trans("StatusOrderDraftShort"), Commande::STATUS_DRAFT=>$langs->trans("StatusOrderDraftShort"),
Commande::STATUS_VALIDATED=>$langs->trans("StatusOrderValidated"), Commande::STATUS_VALIDATED=>$langs->trans("StatusOrderValidated"),
@ -731,9 +731,9 @@ if ($resql)
if (! empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, 'align="center"', $sortfield, $sortorder); if (! empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, 'align="center"', $sortfield, $sortorder);
if (! empty($arrayfields['c.date_commande']['checked'])) print_liste_field_titre($arrayfields['c.date_commande']['label'], $_SERVER["PHP_SELF"], 'c.date_commande', '', $param, 'align="center"', $sortfield, $sortorder); if (! empty($arrayfields['c.date_commande']['checked'])) print_liste_field_titre($arrayfields['c.date_commande']['label'], $_SERVER["PHP_SELF"], 'c.date_commande', '', $param, 'align="center"', $sortfield, $sortorder);
if (! empty($arrayfields['c.date_delivery']['checked'])) print_liste_field_titre($arrayfields['c.date_delivery']['label'], $_SERVER["PHP_SELF"], 'c.date_livraison', '', $param, 'align="center"', $sortfield, $sortorder); if (! empty($arrayfields['c.date_delivery']['checked'])) print_liste_field_titre($arrayfields['c.date_delivery']['label'], $_SERVER["PHP_SELF"], 'c.date_livraison', '', $param, 'align="center"', $sortfield, $sortorder);
if (! empty($arrayfields['c.total_ht']['checked'])) print_liste_field_titre($arrayfields['c.total_ht']['label'],$_SERVER["PHP_SELF"],'c.total_ht','',$param, 'align="right"',$sortfield,$sortorder); if (! empty($arrayfields['c.total_ht']['checked'])) print_liste_field_titre($arrayfields['c.total_ht']['label'], $_SERVER["PHP_SELF"], 'c.total_ht', '', $param, 'class="right"', $sortfield, $sortorder);
if (! empty($arrayfields['c.total_vat']['checked'])) print_liste_field_titre($arrayfields['c.total_vat']['label'],$_SERVER["PHP_SELF"],'c.tva','',$param, 'align="right"',$sortfield,$sortorder); if (! empty($arrayfields['c.total_vat']['checked'])) print_liste_field_titre($arrayfields['c.total_vat']['label'], $_SERVER["PHP_SELF"], 'c.tva', '', $param, 'class="right"', $sortfield, $sortorder);
if (! empty($arrayfields['c.total_ttc']['checked'])) print_liste_field_titre($arrayfields['c.total_ttc']['label'],$_SERVER["PHP_SELF"],'c.total_ttc','',$param, 'align="right"',$sortfield,$sortorder); if (! empty($arrayfields['c.total_ttc']['checked'])) print_liste_field_titre($arrayfields['c.total_ttc']['label'], $_SERVER["PHP_SELF"], 'c.total_ttc', '', $param, 'class="right"', $sortfield, $sortorder);
// 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
@ -742,7 +742,7 @@ if ($resql)
print $hookmanager->resPrint; print $hookmanager->resPrint;
if (! empty($arrayfields['c.datec']['checked'])) print_liste_field_titre($arrayfields['c.datec']['label'], $_SERVER["PHP_SELF"], "c.date_creation", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder); if (! empty($arrayfields['c.datec']['checked'])) print_liste_field_titre($arrayfields['c.datec']['label'], $_SERVER["PHP_SELF"], "c.date_creation", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder);
if (! empty($arrayfields['c.tms']['checked'])) print_liste_field_titre($arrayfields['c.tms']['label'], $_SERVER["PHP_SELF"], "c.tms", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder); if (! empty($arrayfields['c.tms']['checked'])) print_liste_field_titre($arrayfields['c.tms']['label'], $_SERVER["PHP_SELF"], "c.tms", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder);
if (! empty($arrayfields['c.fk_statut']['checked'])) print_liste_field_titre($arrayfields['c.fk_statut']['label'],$_SERVER["PHP_SELF"],"c.fk_statut","",$param,'align="right"',$sortfield,$sortorder); if (! empty($arrayfields['c.fk_statut']['checked'])) print_liste_field_titre($arrayfields['c.fk_statut']['label'], $_SERVER["PHP_SELF"], "c.fk_statut", "", $param, 'class="right"', $sortfield, $sortorder);
if (! empty($arrayfields['c.facture']['checked'])) print_liste_field_titre($arrayfields['c.facture']['label'], $_SERVER["PHP_SELF"], 'c.facture', '', $param, 'align="center"', $sortfield, $sortorder, ''); if (! empty($arrayfields['c.facture']['checked'])) print_liste_field_titre($arrayfields['c.facture']['label'], $_SERVER["PHP_SELF"], 'c.facture', '', $param, 'align="center"', $sortfield, $sortorder, '');
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', $param, 'align="center"', $sortfield, $sortorder, 'maxwidthsearch '); print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', $param, 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ');
print '</tr>'."\n"; print '</tr>'."\n";
@ -914,7 +914,7 @@ if ($resql)
} }
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;

View File

@ -610,7 +610,7 @@ if (($action != 'create' && $action != 'add') || ($action == 'create' && $error)
print_liste_field_titre('RefCustomerOrder', $_SERVER["PHP_SELF"], 'c.ref_client', '', '&amp;socid='.$socid, '', $sortfield, $sortorder); print_liste_field_titre('RefCustomerOrder', $_SERVER["PHP_SELF"], 'c.ref_client', '', '&amp;socid='.$socid, '', $sortfield, $sortorder);
print_liste_field_titre('OrderDate', $_SERVER["PHP_SELF"], 'c.date_commande', '', '&amp;socid='.$socid, 'align="center"', $sortfield, $sortorder); print_liste_field_titre('OrderDate', $_SERVER["PHP_SELF"], 'c.date_commande', '', '&amp;socid='.$socid, 'align="center"', $sortfield, $sortorder);
print_liste_field_titre('DeliveryDate', $_SERVER["PHP_SELF"], 'c.date_livraison', '', '&amp;socid='.$socid, 'align="center"', $sortfield, $sortorder); print_liste_field_titre('DeliveryDate', $_SERVER["PHP_SELF"], 'c.date_livraison', '', '&amp;socid='.$socid, 'align="center"', $sortfield, $sortorder);
print_liste_field_titre('Status','','','','','align="right"'); print_liste_field_titre('Status', '', '', '', '', 'class="right"');
print_liste_field_titre('GenerateBill', '', '', '', '', 'align="center"'); print_liste_field_titre('GenerateBill', '', '', '', '', 'align="center"');
print '</tr>'; print '</tr>';
@ -638,7 +638,7 @@ if (($action != 'create' && $action != 'add') || ($action == 'create' && $error)
print '</td>'; print '</td>';
//SEARCH BUTTON //SEARCH BUTTON
print '<td align="right" class="liste_titre">'; print '<td class="liste_titre right">';
print '<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"), 'search.png', '', '', 1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; print '<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"), 'search.png', '', '', 1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
print '</td>'; print '</td>';
@ -678,7 +678,7 @@ if (($action != 'create' && $action != 'add') || ($action == 'create' && $error)
} }
print '</td>'; print '</td>';
print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">'; print '<td width="16" class="nobordernopadding hideonsmartphone right">';
$filename=dol_sanitizeFileName($objp->ref); $filename=dol_sanitizeFileName($objp->ref);
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($objp->ref); $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($objp->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->rowid; $urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->rowid;
@ -699,7 +699,7 @@ if (($action != 'create' && $action != 'add') || ($action == 'create' && $error)
print '</td>'; print '</td>';
// Statut // Statut
print '<td align="right" class="nowrap">'.$generic_commande->LibStatut($objp->fk_statut,$objp->billed,5).'</td>'; print '<td class="nowrap right">'.$generic_commande->LibStatut($objp->fk_statut, $objp->billed, 5).'</td>';
// Checkbox // Checkbox
print '<td align="center">'; print '<td align="center">';
@ -718,7 +718,7 @@ if (($action != 'create' && $action != 'add') || ($action == 'create' && $error)
* Boutons actions * Boutons actions
*/ */
print '<br><div class="center"><input type="checkbox" '.(empty($conf->global->INVOICE_CLOSE_ORDERS_OFF_BY_DEFAULT_FORMASSINVOICE)?' checked="checked"':'').' name="autocloseorders"> '.$langs->trans("CloseProcessedOrdersAutomatically"); print '<br><div class="center"><input type="checkbox" '.(empty($conf->global->INVOICE_CLOSE_ORDERS_OFF_BY_DEFAULT_FORMASSINVOICE)?' checked="checked"':'').' name="autocloseorders"> '.$langs->trans("CloseProcessedOrdersAutomatically");
print '<div align="right">'; print '<div class="right">';
print '<input type="hidden" name="socid" value="'.$socid.'">'; print '<input type="hidden" name="socid" value="'.$socid.'">';
print '<input type="hidden" name="action" value="create">'; print '<input type="hidden" name="action" value="create">';
print '<input type="hidden" name="origin" value="commande"><br>'; print '<input type="hidden" name="origin" value="commande"><br>';

View File

@ -54,13 +54,13 @@ foreach($linkedObjectBlock as $key => $objectlink)
<td class="linkedcol-name" ><?php echo $objectlink->getNomUrl(1); ?></td> <td class="linkedcol-name" ><?php echo $objectlink->getNomUrl(1); ?></td>
<td class="linkedcol-ref" align="center"><?php echo $objectlink->ref_client; ?></td> <td class="linkedcol-ref" align="center"><?php echo $objectlink->ref_client; ?></td>
<td class="linkedcol-date" align="center"><?php echo dol_print_date($objectlink->date, 'day'); ?></td> <td class="linkedcol-date" align="center"><?php echo dol_print_date($objectlink->date, 'day'); ?></td>
<td class="linkedcol-amount" align="right"><?php <td class="linkedcol-amount right"><?php
if ($user->rights->commande->lire) { if ($user->rights->commande->lire) {
$total = $total + $objectlink->total_ht; $total = $total + $objectlink->total_ht;
echo price($objectlink->total_ht); echo price($objectlink->total_ht);
} ?></td> } ?></td>
<td class="linkedcol-statut" align="right"><?php echo $objectlink->getLibStatut(3); ?></td> <td class="linkedcol-statut right"><?php echo $objectlink->getLibStatut(3); ?></td>
<td class="linkedcol-action" align="right"> <td class="linkedcol-action right">
<?php <?php
// For now, shipments must stay linked to order, so link is not deletable // For now, shipments must stay linked to order, so link is not deletable
if($object->element != 'shipping') { if($object->element != 'shipping') {

View File

@ -209,7 +209,7 @@ for ($mois = 1 ; $mois < 13 ; $mois++)
{ {
$case = sprintf("%04s-%02s", $annee, $mois); $case = sprintf("%04s-%02s", $annee, $mois);
print '<td align="right" width="10%">&nbsp;'; print '<td class="right" width="10%">&nbsp;';
if ($decaiss[$case]>0) if ($decaiss[$case]>0)
{ {
print price($decaiss[$case]); print price($decaiss[$case]);
@ -217,7 +217,7 @@ for ($mois = 1 ; $mois < 13 ; $mois++)
} }
print "</td>"; print "</td>";
print '<td align="right" class="borderrightlight" width="10%">&nbsp;'; print '<td class="right" class="borderrightlight" width="10%">&nbsp;';
if ($encaiss[$case]>0) if ($encaiss[$case]>0)
{ {
print price($encaiss[$case]); print price($encaiss[$case]);
@ -266,7 +266,7 @@ else {
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_total"><td><b>'.$langs->trans("CurrentBalance")."</b></td>"; print '<tr class="liste_total"><td><b>'.$langs->trans("CurrentBalance")."</b></td>";
print '<td colspan="'.($nbcol).'" align="right">'.price($balance).'</td>'; print '<td colspan="'.($nbcol).'" class="right">'.price($balance).'</td>';
print "</tr>\n"; print "</tr>\n";
print "</table>"; print "</table>";

View File

@ -666,10 +666,10 @@ if ($resql)
print '<td>'.$langs->trans("Numero").'</td>'; print '<td>'.$langs->trans("Numero").'</td>';
//if (! $search_account > 0) //if (! $search_account > 0)
//{ //{
print '<td align=right>'.$langs->trans("BankAccount").'</td>'; print '<td class=right>'.$langs->trans("BankAccount").'</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>';
/*if (! empty($conf->accounting->enabled)) /*if (! empty($conf->accounting->enabled))
{ {
print '<td align="center">'; print '<td align="center">';
@ -700,7 +700,7 @@ if ($resql)
print '</td>'; print '</td>';
//if (! $search_account > 0) //if (! $search_account > 0)
//{ //{
print '<td align=right>'; print '<td class=right>';
$form->select_comptes(GETPOST('add_account', 'int')?GETPOST('add_account', 'int'):$search_account, 'add_account', 0, '', 1, ($id > 0 || ! empty($ref)?' disabled="disabled"':'')); $form->select_comptes(GETPOST('add_account', 'int')?GETPOST('add_account', 'int'):$search_account, 'add_account', 0, '', 1, ($id > 0 || ! empty($ref)?' disabled="disabled"':''));
print '</td>'; print '</td>';
//} //}
@ -955,11 +955,11 @@ if ($resql)
if (! empty($arrayfields['type']['checked'])) print_liste_field_titre($arrayfields['type']['label'], $_SERVER['PHP_SELF'], '', '', $param, 'align="center"', $sortfield, $sortorder); if (! empty($arrayfields['type']['checked'])) print_liste_field_titre($arrayfields['type']['label'], $_SERVER['PHP_SELF'], '', '', $param, 'align="center"', $sortfield, $sortorder);
if (! empty($arrayfields['b.num_chq']['checked'])) print_liste_field_titre($arrayfields['b.num_chq']['label'], $_SERVER['PHP_SELF'], 'b.num_chq', '', $param, 'align="center"', $sortfield, $sortorder); if (! empty($arrayfields['b.num_chq']['checked'])) print_liste_field_titre($arrayfields['b.num_chq']['label'], $_SERVER['PHP_SELF'], 'b.num_chq', '', $param, 'align="center"', $sortfield, $sortorder);
if (! empty($arrayfields['bu.label']['checked'])) print_liste_field_titre($arrayfields['bu.label']['label'], $_SERVER['PHP_SELF'], 'bu.label', '', $param, '', $sortfield, $sortorder); if (! empty($arrayfields['bu.label']['checked'])) print_liste_field_titre($arrayfields['bu.label']['label'], $_SERVER['PHP_SELF'], 'bu.label', '', $param, '', $sortfield, $sortorder);
if (! empty($arrayfields['ba.ref']['checked'])) print_liste_field_titre($arrayfields['ba.ref']['label'],$_SERVER['PHP_SELF'],'ba.ref','',$param,'align="right"',$sortfield,$sortorder); if (! empty($arrayfields['ba.ref']['checked'])) print_liste_field_titre($arrayfields['ba.ref']['label'], $_SERVER['PHP_SELF'], 'ba.ref', '', $param, 'class="right"', $sortfield, $sortorder);
if (! empty($arrayfields['b.debit']['checked'])) print_liste_field_titre($arrayfields['b.debit']['label'],$_SERVER['PHP_SELF'],'b.amount','',$param,'align="right"',$sortfield,$sortorder); if (! empty($arrayfields['b.debit']['checked'])) print_liste_field_titre($arrayfields['b.debit']['label'], $_SERVER['PHP_SELF'], 'b.amount', '', $param, 'class="right"', $sortfield, $sortorder);
if (! empty($arrayfields['b.credit']['checked'])) print_liste_field_titre($arrayfields['b.credit']['label'],$_SERVER['PHP_SELF'],'b.amount','',$param,'align="right"',$sortfield,$sortorder); if (! empty($arrayfields['b.credit']['checked'])) print_liste_field_titre($arrayfields['b.credit']['label'], $_SERVER['PHP_SELF'], 'b.amount', '', $param, 'class="right"', $sortfield, $sortorder);
if (! empty($arrayfields['balancebefore']['checked'])) print_liste_field_titre($arrayfields['balancebefore']['label'],$_SERVER['PHP_SELF'],'','',$param,'align="right"',$sortfield,$sortorder); if (! empty($arrayfields['balancebefore']['checked'])) print_liste_field_titre($arrayfields['balancebefore']['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,'align="right"',$sortfield,$sortorder); if (! empty($arrayfields['balance']['checked'])) print_liste_field_titre($arrayfields['balance']['label'], $_SERVER['PHP_SELF'], '', '', $param, 'class="right"', $sortfield, $sortorder);
if (! empty($arrayfields['b.num_releve']['checked'])) print_liste_field_titre($arrayfields['b.num_releve']['label'], $_SERVER['PHP_SELF'], 'b.num_releve', '', $param, 'align="center"', $sortfield, $sortorder); if (! empty($arrayfields['b.num_releve']['checked'])) print_liste_field_titre($arrayfields['b.num_releve']['label'], $_SERVER['PHP_SELF'], 'b.num_releve', '', $param, 'align="center"', $sortfield, $sortorder);
if (! empty($arrayfields['b.conciliated']['checked'])) print_liste_field_titre($arrayfields['b.conciliated']['label'], $_SERVER['PHP_SELF'], 'b.rappro', '', $param, 'align="center"', $sortfield, $sortorder); if (! empty($arrayfields['b.conciliated']['checked'])) print_liste_field_titre($arrayfields['b.conciliated']['label'], $_SERVER['PHP_SELF'], 'b.rappro', '', $param, 'align="center"', $sortfield, $sortorder);
// Extra fields // Extra fields
@ -968,7 +968,7 @@ if ($resql)
$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;
print_liste_field_titre('', $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch '); print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', 'class="right"', $sortfield, $sortorder, 'maxwidthsearch ');
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";
@ -1355,7 +1355,7 @@ if ($resql)
// Debit // Debit
if (! empty($arrayfields['b.debit']['checked'])) if (! empty($arrayfields['b.debit']['checked']))
{ {
print '<td align="right">'; print '<td class="right">';
if ($objp->amount < 0) if ($objp->amount < 0)
{ {
print price($objp->amount * -1); print price($objp->amount * -1);
@ -1396,7 +1396,7 @@ if ($resql)
} }
else else
{ {
print '<td align="right">-</td>'; print '<td class="right">-</td>';
} }
if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['nbfield']++;
} }
@ -1411,12 +1411,12 @@ if ($resql)
} }
else else
{ {
print '<td align="right" class="error nowrap">&nbsp;'.price($balance).'</td>'; print '<td class="error nowrap right">&nbsp;'.price($balance).'</td>';
} }
} }
else else
{ {
print '<td align="right">-</td>'; print '<td class="right">-</td>';
} }
if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['nbfield']++;
} }

View File

@ -394,7 +394,7 @@ 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, '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, '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, 'align="center" class="nowrap"', $sortfield, $sortorder);
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, 'align="center"', $sortfield, $sortorder);
if (! empty($arrayfields['balance']['checked'])) print_liste_field_titre($arrayfields['balance']['label'],$_SERVER["PHP_SELF"],'','',$param,'align="right"',$sortfield,$sortorder); if (! empty($arrayfields['balance']['checked'])) print_liste_field_titre($arrayfields['balance']['label'], $_SERVER["PHP_SELF"], '', '', $param, 'class="right"', $sortfield, $sortorder);
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";
@ -550,7 +550,7 @@ foreach ($accounts as $key=>$type)
// Balance // Balance
if (! empty($arrayfields['balance']['checked'])) if (! empty($arrayfields['balance']['checked']))
{ {
print '<td align="right" class="nowraponall">'; print '<td class="nowraponall right">';
print '<a href="'.DOL_URL_ROOT.'/compta/bank/bankentries_list.php?id='.$obj->id.'">'.price($solde, 0, $langs, 0, -1, -1, $obj->currency_code).'</a>'; print '<a href="'.DOL_URL_ROOT.'/compta/bank/bankentries_list.php?id='.$obj->id.'">'.price($solde, 0, $langs, 0, -1, -1, $obj->currency_code).'</a>';
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['nbfield']++;

View File

@ -766,15 +766,15 @@ else
if ($objp->amount < 0) if ($objp->amount < 0)
{ {
$totald = $totald + abs($objp->amount); $totald = $totald + abs($objp->amount);
print '<td align="right" class="nowrap">'.price($objp->amount * -1)."</td><td>&nbsp;</td>\n"; print '<td class="nowrap right">'.price($objp->amount * -1)."</td><td>&nbsp;</td>\n";
} }
else else
{ {
$totalc = $totalc + abs($objp->amount); $totalc = $totalc + abs($objp->amount);
print '<td>&nbsp;</td><td align="right" class="nowrap">'.price($objp->amount)."</td>\n"; print '<td>&nbsp;</td><td class="nowrap right">'.price($objp->amount)."</td>\n";
} }
print '<td align="right" class="nowrap">'.price(price2num($total, 'MT'))."</td>\n"; print '<td class="nowrap right">'.price(price2num($total, 'MT'))."</td>\n";
if ($user->rights->banque->modifier || $user->rights->banque->consolidate) if ($user->rights->banque->modifier || $user->rights->banque->consolidate)
{ {
@ -793,7 +793,7 @@ else
} }
// Line Total // Line Total
print "\n".'<tr class="liste_total"><td align="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 align=\"right\">".price($totald)."</td><td align=\"right\">".price($totalc)."</td><td>&nbsp;</td><td>&nbsp;</td></tr>";
// Line Balance // Line Balance
print "\n<tr>"; print "\n<tr>";

View File

@ -218,12 +218,12 @@ if ($result)
} }
// Debit // Debit
print '<td class="liste_titre" align="right"><input name="search_amount_deb" class="flat" type="text" size="8" value="'.$search_amount_deb.'"></td>'; print '<td class="liste_titre right"><input name="search_amount_deb" class="flat" type="text" size="8" value="'.$search_amount_deb.'"></td>';
// Credit // Credit
print '<td class="liste_titre" align="right"><input name="search_amount_cred" class="flat" type="text" size="8" value="'.$search_amount_cred.'"></td>'; print '<td class="liste_titre right"><input name="search_amount_cred" class="flat" type="text" size="8" value="'.$search_amount_cred.'"></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>';
@ -238,8 +238,8 @@ if ($result)
print_liste_field_titre("PaymentMode", $_SERVER["PHP_SELF"], "type", "", $param, 'align="left"', $sortfield, $sortorder); print_liste_field_titre("PaymentMode", $_SERVER["PHP_SELF"], "type", "", $param, 'align="left"', $sortfield, $sortorder);
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, 'align="left"', $sortfield, $sortorder);
print_liste_field_titre("Debit",$_SERVER["PHP_SELF"],"v.amount","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre("Debit", $_SERVER["PHP_SELF"], "v.amount", "", $param, 'class="right"', $sortfield, $sortorder);
print_liste_field_titre("Credit",$_SERVER["PHP_SELF"],"v.amount","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre("Credit", $_SERVER["PHP_SELF"], "v.amount", "", $param, 'class="right"', $sortfield, $sortorder);
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";
@ -328,8 +328,8 @@ if ($result)
print '<tr class="liste_total">'; print '<tr class="liste_total">';
print '<td colspan="'.$colspan.'" class="liste_total">'.$langs->trans("Total").'</td>'; print '<td colspan="'.$colspan.'" class="liste_total">'.$langs->trans("Total").'</td>';
print '<td class="liste_total" align="right">'.price($totalarray['totaldeb'])."</td>"; print '<td class="liste_total right">'.price($totalarray['totaldeb'])."</td>";
print '<td class="liste_total" align="right">'.price($totalarray['totalcred'])."</td>"; print '<td class="liste_total right">'.price($totalarray['totalcred'])."</td>";
print '<td></td>'; print '<td></td>';
print '</tr>'; print '</tr>';

View File

@ -401,7 +401,7 @@ $parameters=array('arrayfields'=>$arrayfields);
$reshook=$hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('printFieldListOption', $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="liste_titre" align="right">'; print '<td class="liste_titre right">';
$searchpicto=$form->showFilterButtons(); $searchpicto=$form->showFilterButtons();
print $searchpicto; print $searchpicto;
print '</td>'; print '</td>';

View File

@ -139,10 +139,10 @@ if ($resql)
// Fields title // Fields title
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print_liste_field_titre($arrayfields['b.rowid']['label'], $_SERVER['PHP_SELF'], 'b.rowid', '', $param, '', $sortfield, $sortorder); print_liste_field_titre($arrayfields['b.rowid']['label'], $_SERVER['PHP_SELF'], 'b.rowid', '', $param, '', $sortfield, $sortorder);
print_liste_field_titre($arrayfields['b.dateo']['label'],$_SERVER['PHP_SELF'],'b.dateo','',$param,'align="left"',$sortfield,$sortorder); print_liste_field_titre($arrayfields['b.dateo']['label'], $_SERVER['PHP_SELF'], 'b.dateo', '', $param, 'class="left"', $sortfield, $sortorder);
print_liste_field_titre($arrayfields['ba.ref']['label'],$_SERVER['PHP_SELF'],'ba.ref','',$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($arrayfields['ba.ref']['label'], $_SERVER['PHP_SELF'], 'ba.ref', '', $param, 'class="right"', $sortfield, $sortorder);
print_liste_field_titre($arrayfields['b.debit']['label'],$_SERVER['PHP_SELF'],'b.amount','',$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($arrayfields['b.debit']['label'], $_SERVER['PHP_SELF'], 'b.amount', '', $param, 'class="right"', $sortfield, $sortorder);
print_liste_field_titre($arrayfields['b.credit']['label'],$_SERVER['PHP_SELF'],'b.amount','',$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($arrayfields['b.credit']['label'], $_SERVER['PHP_SELF'], 'b.amount', '', $param, 'class="right"', $sortfield, $sortorder);
print "</tr>\n"; print "</tr>\n";
$posconciliatecol = 0; $posconciliatecol = 0;

View File

@ -123,12 +123,12 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
print_liste_field_titre("PeriodEndDate", $_SERVER["PHP_SELF"], "cs.date_ech", "", $param, 'width="140px"', $sortfield, $sortorder); print_liste_field_titre("PeriodEndDate", $_SERVER["PHP_SELF"], "cs.date_ech", "", $param, 'width="140px"', $sortfield, $sortorder);
print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "c.libelle", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "c.libelle", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "cs.fk_type", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "cs.fk_type", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("ExpectedToPay",$_SERVER["PHP_SELF"],"cs.amount","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre("ExpectedToPay", $_SERVER["PHP_SELF"], "cs.amount", "", $param, 'class="right"', $sortfield, $sortorder);
print_liste_field_titre("RefPayment", $_SERVER["PHP_SELF"], "pc.rowid", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("RefPayment", $_SERVER["PHP_SELF"], "pc.rowid", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "pc.datep", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "pc.datep", "", $param, 'align="center"', $sortfield, $sortorder);
print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "pct.code", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "pct.code", "", $param, '', $sortfield, $sortorder);
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"],"pc.amount","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "pc.amount", "", $param, 'class="right"', $sortfield, $sortorder);
print "</tr>\n"; print "</tr>\n";
$sql = "SELECT c.id, c.libelle as lib,"; $sql = "SELECT c.id, c.libelle as lib,";
@ -226,12 +226,12 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
$i++; $i++;
} }
print '<tr class="liste_total"><td colspan="3" class="liste_total">'.$langs->trans("Total").'</td>'; print '<tr class="liste_total"><td colspan="3" class="liste_total">'.$langs->trans("Total").'</td>';
print '<td align="right" class="liste_total"></td>'; // A total here has no sense print '<td class="liste_total right"></td>'; // A total here has no sense
print '<td align="center" class="liste_total">&nbsp;</td>'; print '<td align="center" class="liste_total">&nbsp;</td>';
print '<td align="center" class="liste_total">&nbsp;</td>'; print '<td align="center" class="liste_total">&nbsp;</td>';
print '<td align="center" class="liste_total">&nbsp;</td>'; print '<td align="center" class="liste_total">&nbsp;</td>';
if (! empty($conf->banque->enabled)) print '<td></td>'; if (! empty($conf->banque->enabled)) print '<td></td>';
print '<td align="right" class="liste_total">'.price($totalpaye)."</td>"; print '<td class="liste_total right">'.price($totalpaye)."</td>";
print "</tr>"; print "</tr>";
} }
else else
@ -283,7 +283,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "pv.datev", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "pv.datev", "", $param, 'align="center"', $sortfield, $sortorder);
print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "pct.code", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "pct.code", "", $param, '', $sortfield, $sortorder);
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"],"pv.amount","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "pv.amount", "", $param, 'class="right"', $sortfield, $sortorder);
print "</tr>\n"; print "</tr>\n";
$var=1; $var=1;
while ($i < $num) while ($i < $num)

View File

@ -483,7 +483,7 @@ elseif ($id)
print '</td>'; print '</td>';
if ($action != 'classify' && $user->rights->deplacement->creer) if ($action != 'classify' && $user->rights->deplacement->creer)
{ {
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=classify&amp;id='.$object->id.'">'; print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=classify&amp;id='.$object->id.'">';
print img_edit($langs->trans('SetProject'), 1); print img_edit($langs->trans('SetProject'), 1);
print '</a></td>'; print '</a></td>';
} }

View File

@ -127,7 +127,7 @@ if ($resql)
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "d.dated", "", "&socid=$socid", 'align="center"', $sortfield, $sortorder); print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "d.dated", "", "&socid=$socid", 'align="center"', $sortfield, $sortorder);
print_liste_field_titre("Person", $_SERVER["PHP_SELF"], "u.lastname", "", "&socid=$socid", '', $sortfield, $sortorder); print_liste_field_titre("Person", $_SERVER["PHP_SELF"], "u.lastname", "", "&socid=$socid", '', $sortfield, $sortorder);
print_liste_field_titre("Company", $_SERVER["PHP_SELF"], "s.nom", "", "&socid=$socid", '', $sortfield, $sortorder); print_liste_field_titre("Company", $_SERVER["PHP_SELF"], "s.nom", "", "&socid=$socid", '', $sortfield, $sortorder);
print_liste_field_titre("FeesKilometersOrAmout",$_SERVER["PHP_SELF"],"d.km","","&socid=$socid",'align="right"',$sortfield,$sortorder); print_liste_field_titre("FeesKilometersOrAmout", $_SERVER["PHP_SELF"], "d.km", "", "&socid=$socid", 'class="right"', $sortfield, $sortorder);
print_liste_field_titre(''); print_liste_field_titre('');
print "</tr>\n"; print "</tr>\n";
@ -150,10 +150,10 @@ if ($resql)
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print '<input class="flat" size="10" type="text" name="search_company" value="'.$search_company.'">'; print '<input class="flat" size="10" type="text" name="search_company" value="'.$search_company.'">';
print '</td>'; print '</td>';
print '<td class="liste_titre" align="right">'; print '<td class="liste_titre right">';
// print '<input class="flat" size="10" type="text" name="search_amount" value="'.$search_amount.'">'; // print '<input class="flat" size="10" type="text" name="search_amount" value="'.$search_amount.'">';
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>';

View File

@ -3735,7 +3735,7 @@ elseif ($id > 0 || ! empty($ref))
print $langs->trans('DateInvoice'); print $langs->trans('DateInvoice');
print '</td>'; print '</td>';
if ($object->type != Facture::TYPE_CREDIT_NOTE && $action != 'editinvoicedate' && ! empty($object->brouillon) && $usercancreate && empty($conf->global->FAC_FORCE_DATE_VALIDATION)) if ($object->type != Facture::TYPE_CREDIT_NOTE && $action != 'editinvoicedate' && ! empty($object->brouillon) && $usercancreate && empty($conf->global->FAC_FORCE_DATE_VALIDATION))
print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editinvoicedate&amp;facid=' . $object->id . '">' . img_edit($langs->trans('SetDate'), 1) . '</a></td>'; print '<td class="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editinvoicedate&amp;facid=' . $object->id . '">' . img_edit($langs->trans('SetDate'), 1) . '</a></td>';
print '</tr></table>'; print '</tr></table>';
print '</td><td>'; print '</td><td>';
@ -3759,7 +3759,7 @@ elseif ($id > 0 || ! empty($ref))
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('DatePointOfTax'); print $langs->trans('DatePointOfTax');
print '</td>'; print '</td>';
print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editdate_pointoftax&amp;facid=' . $object->id . '">' . img_edit($langs->trans('SetDate'), 1) . '</a></td>'; print '<td class="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editdate_pointoftax&amp;facid=' . $object->id . '">' . img_edit($langs->trans('SetDate'), 1) . '</a></td>';
print '</tr></table>'; print '</tr></table>';
print '</td><td>'; print '</td><td>';
if ($action == 'editdate_pointoftax') { if ($action == 'editdate_pointoftax') {
@ -3776,7 +3776,7 @@ elseif ($id > 0 || ! empty($ref))
print $langs->trans('PaymentConditionsShort'); print $langs->trans('PaymentConditionsShort');
print '</td>'; print '</td>';
if ($object->type != Facture::TYPE_CREDIT_NOTE && $action != 'editconditions' && $usercancreate) if ($object->type != Facture::TYPE_CREDIT_NOTE && $action != 'editconditions' && $usercancreate)
print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editconditions&amp;facid=' . $object->id . '">' . img_edit($langs->trans('SetConditions'), 1) . '</a></td>'; print '<td class="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editconditions&amp;facid=' . $object->id . '">' . img_edit($langs->trans('SetConditions'), 1) . '</a></td>';
print '</tr></table>'; print '</tr></table>';
print '</td><td>'; print '</td><td>';
if ($object->type != Facture::TYPE_CREDIT_NOTE) if ($object->type != Facture::TYPE_CREDIT_NOTE)
@ -3797,7 +3797,7 @@ elseif ($id > 0 || ! empty($ref))
print $langs->trans('DateMaxPayment'); print $langs->trans('DateMaxPayment');
print '</td>'; print '</td>';
if ($object->type != Facture::TYPE_CREDIT_NOTE && $action != 'editpaymentterm' && $usercancreate) if ($object->type != Facture::TYPE_CREDIT_NOTE && $action != 'editpaymentterm' && $usercancreate)
print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editpaymentterm&amp;facid=' . $object->id . '">' . img_edit($langs->trans('SetDate'), 1) . '</a></td>'; print '<td class="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editpaymentterm&amp;facid=' . $object->id . '">' . img_edit($langs->trans('SetDate'), 1) . '</a></td>';
print '</tr></table>'; print '</tr></table>';
print '</td><td>'; print '</td><td>';
if ($object->type != Facture::TYPE_CREDIT_NOTE) if ($object->type != Facture::TYPE_CREDIT_NOTE)
@ -3821,7 +3821,7 @@ elseif ($id > 0 || ! empty($ref))
print $langs->trans('PaymentMode'); print $langs->trans('PaymentMode');
print '</td>'; print '</td>';
if ($action != 'editmode' && $usercancreate) if ($action != 'editmode' && $usercancreate)
print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editmode&amp;facid=' . $object->id . '">' . img_edit($langs->trans('SetMode'), 1) . '</a></td>'; print '<td class="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editmode&amp;facid=' . $object->id . '">' . img_edit($langs->trans('SetMode'), 1) . '</a></td>';
print '</tr></table>'; print '</tr></table>';
print '</td><td>'; print '</td><td>';
if ($action == 'editmode') if ($action == 'editmode')
@ -3844,7 +3844,7 @@ elseif ($id > 0 || ! empty($ref))
print $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0); print $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0);
print '</td>'; print '</td>';
if ($usercancreate && $action != 'editmulticurrencycode' && ! empty($object->brouillon)) if ($usercancreate && $action != 'editmulticurrencycode' && ! empty($object->brouillon))
print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencycode&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>'; print '<td class="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencycode&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';
print '</tr></table>'; print '</tr></table>';
print '</td><td>'; print '</td><td>';
$htmlname = (($usercancreate && $action == 'editmulticurrencycode')?'multicurrency_code':'none'); $htmlname = (($usercancreate && $action == 'editmulticurrencycode')?'multicurrency_code':'none');
@ -3857,7 +3857,7 @@ elseif ($id > 0 || ! empty($ref))
print $form->editfieldkey('CurrencyRate', 'multicurrency_tx', '', $object, 0); print $form->editfieldkey('CurrencyRate', 'multicurrency_tx', '', $object, 0);
print '</td>'; print '</td>';
if ($usercancreate && $action != 'editmulticurrencyrate' && ! empty($object->brouillon) && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) if ($usercancreate && $action != 'editmulticurrencyrate' && ! empty($object->brouillon) && $object->multicurrency_code && $object->multicurrency_code != $conf->currency)
print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencyrate&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>'; print '<td class="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencyrate&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';
print '</tr></table>'; print '</tr></table>';
print '</td><td>'; print '</td><td>';
if ($action == 'editmulticurrencyrate' || $action == 'actualizemulticurrencyrate') { if ($action == 'editmulticurrencyrate' || $action == 'actualizemulticurrencyrate') {
@ -3882,7 +3882,7 @@ elseif ($id > 0 || ! empty($ref))
print $langs->trans('BankAccount'); print $langs->trans('BankAccount');
print '<td>'; print '<td>';
if (($action != 'editbankaccount') && $usercancreate) if (($action != 'editbankaccount') && $usercancreate)
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&amp;id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'),1).'</a></td>'; print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&amp;id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'</a></td>';
print '</tr></table>'; print '</tr></table>';
print '</td><td>'; print '</td><td>';
if ($action == 'editbankaccount') if ($action == 'editbankaccount')
@ -3902,7 +3902,7 @@ elseif ($id > 0 || ! empty($ref))
print '<tr><td>'; print '<tr><td>';
print '<table width="100%" class="nobordernopadding"><tr><td>'; print '<table width="100%" class="nobordernopadding"><tr><td>';
print $langs->trans('IncotermLabel'); print $langs->trans('IncotermLabel');
print '<td><td align="right">'; print '<td><td class="right">';
if ($usercancreate) print '<a href="'.DOL_URL_ROOT.'/compta/facture/card.php?facid='.$object->id.'&action=editincoterm">'.img_edit().'</a>'; if ($usercancreate) print '<a href="'.DOL_URL_ROOT.'/compta/facture/card.php?facid='.$object->id.'&action=editincoterm">'.img_edit().'</a>';
else print '&nbsp;'; else print '&nbsp;';
print '</td></tr></table>'; print '</td></tr></table>';
@ -3979,7 +3979,7 @@ elseif ($id > 0 || ! empty($ref))
print '</td>'; print '</td>';
if ($action != 'editrevenuestamp' && ! empty($object->brouillon) && $usercancreate) if ($action != 'editrevenuestamp' && ! empty($object->brouillon) && $usercancreate)
{ {
print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editrevenuestamp&amp;facid=' . $object->id . '">' . img_edit($langs->trans('SetRevenuStamp'), 1) . '</a></td>'; print '<td class="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editrevenuestamp&amp;facid=' . $object->id . '">' . img_edit($langs->trans('SetRevenuStamp'), 1) . '</a></td>';
} }
print '</tr></table>'; print '</tr></table>';
print '</td><td>'; print '</td><td>';
@ -4062,9 +4062,9 @@ elseif ($id > 0 || ! empty($ref))
print '<td>' . $langs->trans('ListOfSituationInvoices') . '</td>'; print '<td>' . $langs->trans('ListOfSituationInvoices') . '</td>';
print '<td></td>'; print '<td></td>';
print '<td align="center">' . $langs->trans('Situation') . '</td>'; print '<td align="center">' . $langs->trans('Situation') . '</td>';
if (! empty($conf->banque->enabled)) print '<td align="right"></td>'; if (! empty($conf->banque->enabled)) print '<td class="right"></td>';
print '<td align="right">' . $langs->trans('AmountHT') . '</td>'; print '<td class="right">' . $langs->trans('AmountHT') . '</td>';
print '<td align="right">' . $langs->trans('AmountTTC') . '</td>'; print '<td class="right">' . $langs->trans('AmountTTC') . '</td>';
print '<td width="18">&nbsp;</td>'; print '<td width="18">&nbsp;</td>';
print '</tr>'; print '</tr>';
@ -4085,10 +4085,10 @@ elseif ($id > 0 || ! empty($ref))
print '<td>' . $prev_invoice->getNomUrl(1) . '</td>'; print '<td>' . $prev_invoice->getNomUrl(1) . '</td>';
print '<td></td>'; print '<td></td>';
print '<td align="center" >'.(($prev_invoice->type == Facture::TYPE_CREDIT_NOTE)?$langs->trans('situationInvoiceShortcode_AS'):$langs->trans('situationInvoiceShortcode_S')) . $prev_invoice->situation_counter.'</td>'; print '<td align="center" >'.(($prev_invoice->type == Facture::TYPE_CREDIT_NOTE)?$langs->trans('situationInvoiceShortcode_AS'):$langs->trans('situationInvoiceShortcode_S')) . $prev_invoice->situation_counter.'</td>';
if (! empty($conf->banque->enabled)) print '<td align="right"></td>'; if (! empty($conf->banque->enabled)) print '<td class="right"></td>';
print '<td align="right">' . price($prev_invoice->total_ht) . '</td>'; print '<td class="right">' . price($prev_invoice->total_ht) . '</td>';
print '<td align="right">' . price($prev_invoice->total_ttc) . '</td>'; print '<td class="right">' . price($prev_invoice->total_ttc) . '</td>';
print '<td align="right">' . $prev_invoice->getLibStatut(3, $totalpaye) . '</td>'; print '<td class="right">' . $prev_invoice->getLibStatut(3, $totalpaye) . '</td>';
print '</tr>'; print '</tr>';
} }
} }
@ -4103,15 +4103,15 @@ elseif ($id > 0 || ! empty($ref))
print '<td>' . $object->getNomUrl(1) . '</td>'; print '<td>' . $object->getNomUrl(1) . '</td>';
print '<td></td>'; print '<td></td>';
print '<td align="center">'.(($object->type == Facture::TYPE_CREDIT_NOTE)?$langs->trans('situationInvoiceShortcode_AS'):$langs->trans('situationInvoiceShortcode_S')) . $object->situation_counter.'</td>'; print '<td align="center">'.(($object->type == Facture::TYPE_CREDIT_NOTE)?$langs->trans('situationInvoiceShortcode_AS'):$langs->trans('situationInvoiceShortcode_S')) . $object->situation_counter.'</td>';
if (! empty($conf->banque->enabled)) print '<td align="right"></td>'; if (! empty($conf->banque->enabled)) print '<td class="right"></td>';
print '<td align="right">' . price($object->total_ht) . '</td>'; print '<td class="right">' . price($object->total_ht) . '</td>';
print '<td align="right">' . price($object->total_ttc) . '</td>'; print '<td class="right">' . price($object->total_ttc) . '</td>';
print '<td align="right">' . $object->getLibStatut(3, $object->getSommePaiement()) . '</td>'; print '<td class="right">' . $object->getLibStatut(3, $object->getSommePaiement()) . '</td>';
print '</tr>'; print '</tr>';
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td colspan="2" align="left"><b>' . $langs->trans('CurrentSituationTotal') . '</b></td>'; print '<td colspan="2" class="left"><b>' . $langs->trans('CurrentSituationTotal') . '</b></td>';
print '<td>'; print '<td>';
$i =0; $i =0;
foreach ($current_situation_counter as $sit) foreach ($current_situation_counter as $sit)
@ -4124,8 +4124,8 @@ elseif ($id > 0 || ! empty($ref))
} }
print '</td>'; print '</td>';
if (! empty($conf->banque->enabled)) print '<td></td>'; if (! empty($conf->banque->enabled)) print '<td></td>';
print '<td align="right"><b>' . price($total_global_ht) . '</b></td>'; print '<td class="right"><b>' . price($total_global_ht) . '</b></td>';
print '<td align="right"><b>' . price($total_global_ttc) . '</b></td>'; print '<td class="right"><b>' . price($total_global_ttc) . '</b></td>';
print '<td width="18">&nbsp;</td>'; print '<td width="18">&nbsp;</td>';
print '</tr>'; print '</tr>';
@ -4136,9 +4136,9 @@ elseif ($id > 0 || ! empty($ref))
print '<td>' . $langs->trans('ListOfNextSituationInvoices') . '</td>'; print '<td>' . $langs->trans('ListOfNextSituationInvoices') . '</td>';
print '<td></td>'; print '<td></td>';
print '<td></td>'; print '<td></td>';
if (! empty($conf->banque->enabled)) print '<td align="right"></td>'; if (! empty($conf->banque->enabled)) print '<td class="right"></td>';
print '<td align="right">' . $langs->trans('AmountHT') . '</td>'; print '<td class="right">' . $langs->trans('AmountHT') . '</td>';
print '<td align="right">' . $langs->trans('AmountTTC') . '</td>'; print '<td class="right">' . $langs->trans('AmountTTC') . '</td>';
print '<td width="18">&nbsp;</td>'; print '<td width="18">&nbsp;</td>';
print '</tr>';*/ print '</tr>';*/
@ -4153,10 +4153,10 @@ elseif ($id > 0 || ! empty($ref))
print '<td>' . $next_invoice->getNomUrl(1) . '</td>'; print '<td>' . $next_invoice->getNomUrl(1) . '</td>';
print '<td></td>'; print '<td></td>';
print '<td align="center">'.(($next_invoice->type == Facture::TYPE_CREDIT_NOTE)?$langs->trans('situationInvoiceShortcode_AS'):$langs->trans('situationInvoiceShortcode_S')) . $next_invoice->situation_counter.'</td>'; print '<td align="center">'.(($next_invoice->type == Facture::TYPE_CREDIT_NOTE)?$langs->trans('situationInvoiceShortcode_AS'):$langs->trans('situationInvoiceShortcode_S')) . $next_invoice->situation_counter.'</td>';
if (! empty($conf->banque->enabled)) print '<td align="right"></td>'; if (! empty($conf->banque->enabled)) print '<td class="right"></td>';
print '<td align="right">' . price($next_invoice->total_ht) . '</td>'; print '<td class="right">' . price($next_invoice->total_ht) . '</td>';
print '<td align="right">' . price($next_invoice->total_ttc) . '</td>'; print '<td class="right">' . price($next_invoice->total_ttc) . '</td>';
print '<td align="right">' . $next_invoice->getLibStatut(3, $totalpaye) . '</td>'; print '<td class="right">' . $next_invoice->getLibStatut(3, $totalpaye) . '</td>';
print '</tr>'; print '</tr>';
} }
@ -4164,10 +4164,10 @@ elseif ($id > 0 || ! empty($ref))
$total_global_ttc += $total_next_ttc; $total_global_ttc += $total_next_ttc;
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td colspan="3" align="right"></td>'; print '<td colspan="3" class="right"></td>';
if (! empty($conf->banque->enabled)) print '<td align="right"></td>'; if (! empty($conf->banque->enabled)) print '<td class="right"></td>';
print '<td align="right"><b>' . price($total_global_ht) . '</b></td>'; print '<td class="right"><b>' . price($total_global_ht) . '</b></td>';
print '<td align="right"><b>' . price($total_global_ttc) . '</b></td>'; print '<td class="right"><b>' . price($total_global_ttc) . '</b></td>';
print '<td width="18">&nbsp;</td>'; print '<td width="18">&nbsp;</td>';
print '</tr>'; print '</tr>';
} }
@ -4186,9 +4186,9 @@ elseif ($id > 0 || ! empty($ref))
print '<td class="liste_titre">' . $langs->trans('Date') . '</td>'; print '<td class="liste_titre">' . $langs->trans('Date') . '</td>';
print '<td class="liste_titre">' . $langs->trans('Type') . '</td>'; print '<td class="liste_titre">' . $langs->trans('Type') . '</td>';
if (! empty($conf->banque->enabled)) { if (! empty($conf->banque->enabled)) {
print '<td class="liste_titre" align="right">' . $langs->trans('BankAccount') . '</td>'; print '<td class="liste_titre right">' . $langs->trans('BankAccount') . '</td>';
} }
print '<td class="liste_titre" align="right">' . $langs->trans('Amount') . '</td>'; print '<td class="liste_titre right">' . $langs->trans('Amount') . '</td>';
print '<td class="liste_titre" width="18">&nbsp;</td>'; print '<td class="liste_titre" width="18">&nbsp;</td>';
print '</tr>'; print '</tr>';
@ -4243,12 +4243,12 @@ elseif ($id > 0 || ! empty($ref))
$bankaccountstatic->accountancy_journal = $accountingjournal->getNomUrl(0, 1, 1, '', 1); $bankaccountstatic->accountancy_journal = $accountingjournal->getNomUrl(0, 1, 1, '', 1);
} }
print '<td align="right">'; print '<td class="right">';
if ($bankaccountstatic->id) if ($bankaccountstatic->id)
print $bankaccountstatic->getNomUrl(1, 'transactions'); print $bankaccountstatic->getNomUrl(1, 'transactions');
print '</td>'; print '</td>';
} }
print '<td align="right">' . price($sign * $objp->amount) . '</td>'; print '<td class="right">' . price($sign * $objp->amount) . '</td>';
print '<td align="center">'; print '<td align="center">';
if ($object->statut == Facture::STATUS_VALIDATED && $object->paye == 0 && $user->societe_id == 0) if ($object->statut == Facture::STATUS_VALIDATED && $object->paye == 0 && $user->societe_id == 0)
{ {
@ -4272,12 +4272,12 @@ elseif ($id > 0 || ! empty($ref))
if ($object->type != Facture::TYPE_CREDIT_NOTE) { if ($object->type != Facture::TYPE_CREDIT_NOTE) {
// Total already paid // Total already paid
print '<tr><td colspan="' . $nbcols . '" align="right">'; print '<tr><td colspan="' . $nbcols . '" class="right">';
if ($object->type != Facture::TYPE_DEPOSIT) if ($object->type != Facture::TYPE_DEPOSIT)
print $langs->trans('AlreadyPaidNoCreditNotesNoDeposits'); print $langs->trans('AlreadyPaidNoCreditNotesNoDeposits');
else else
print $langs->trans('AlreadyPaid'); print $langs->trans('AlreadyPaid');
print ' :</td><td align="right"'.(($totalpaye > 0)?' class="amountalreadypaid"':'').'>' . price($totalpaye) . '</td><td>&nbsp;</td></tr>'; print ' :</td><td class="right"'.(($totalpaye > 0)?' class="amountalreadypaid"':'').'>' . price($totalpaye) . '</td><td>&nbsp;</td></tr>';
$resteapayeraffiche = $resteapayer; $resteapayeraffiche = $resteapayer;
$cssforamountpaymentcomplete = 'amountpaymentcomplete'; $cssforamountpaymentcomplete = 'amountpaymentcomplete';
@ -4297,15 +4297,15 @@ elseif ($id > 0 || ! empty($ref))
while ($i < $num) { while ($i < $num) {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
$invoice->fetch($obj->fk_facture_source); $invoice->fetch($obj->fk_facture_source);
print '<tr><td colspan="' . $nbcols . '" align="right">'; print '<tr><td colspan="' . $nbcols . '" class="right">';
if ($invoice->type == Facture::TYPE_CREDIT_NOTE) if ($invoice->type == Facture::TYPE_CREDIT_NOTE)
print $langs->trans("CreditNote") . ' '; print $langs->trans("CreditNote") . ' ';
if ($invoice->type == Facture::TYPE_DEPOSIT) if ($invoice->type == Facture::TYPE_DEPOSIT)
print $langs->trans("Deposit") . ' '; print $langs->trans("Deposit") . ' ';
print $invoice->getNomUrl(0); print $invoice->getNomUrl(0);
print ' :</td>'; print ' :</td>';
print '<td align="right">' . price($obj->amount_ttc) . '</td>'; print '<td class="right">' . price($obj->amount_ttc) . '</td>';
print '<td align="right">'; print '<td class="right">';
print '<a href="' . $_SERVER["PHP_SELF"] . '?facid=' . $object->id . '&action=unlinkdiscount&discountid=' . $obj->rowid . '">' . img_delete() . '</a>'; print '<a href="' . $_SERVER["PHP_SELF"] . '?facid=' . $object->id . '&action=unlinkdiscount&discountid=' . $obj->rowid . '">' . img_delete() . '</a>';
print '</td></tr>'; print '</td></tr>';
$i ++; $i ++;
@ -4320,51 +4320,51 @@ elseif ($id > 0 || ! empty($ref))
// Paye partiellement 'escompte' // Paye partiellement 'escompte'
if (($object->statut == Facture::STATUS_CLOSED || $object->statut == Facture::STATUS_ABANDONED) && $object->close_code == 'discount_vat') { if (($object->statut == Facture::STATUS_CLOSED || $object->statut == Facture::STATUS_ABANDONED) && $object->close_code == 'discount_vat') {
print '<tr><td colspan="' . $nbcols . '" align="right" class="nowrap">'; print '<tr><td colspan="' . $nbcols . '" class="nowrap right">';
print $form->textwithpicto($langs->trans("Discount") . ':', $langs->trans("HelpEscompte"), - 1); print $form->textwithpicto($langs->trans("Discount") . ':', $langs->trans("HelpEscompte"), - 1);
print '</td><td align="right">' . price(price2num($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye, 'MT')) . '</td><td>&nbsp;</td></tr>'; print '</td><td class="right">' . price(price2num($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye, 'MT')) . '</td><td>&nbsp;</td></tr>';
$resteapayeraffiche = 0; $resteapayeraffiche = 0;
$cssforamountpaymentcomplete = 'amountpaymentneutral'; $cssforamountpaymentcomplete = 'amountpaymentneutral';
} }
// Paye partiellement ou Abandon 'badcustomer' // Paye partiellement ou Abandon 'badcustomer'
if (($object->statut == Facture::STATUS_CLOSED || $object->statut == Facture::STATUS_ABANDONED) && $object->close_code == 'badcustomer') { if (($object->statut == Facture::STATUS_CLOSED || $object->statut == Facture::STATUS_ABANDONED) && $object->close_code == 'badcustomer') {
print '<tr><td colspan="' . $nbcols . '" align="right" class="nowrap">'; print '<tr><td colspan="' . $nbcols . '" class="nowrap right">';
print $form->textwithpicto($langs->trans("Abandoned") . ':', $langs->trans("HelpAbandonBadCustomer"), - 1); print $form->textwithpicto($langs->trans("Abandoned") . ':', $langs->trans("HelpAbandonBadCustomer"), - 1);
print '</td><td align="right">' . price(price2num($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye, 'MT')) . '</td><td>&nbsp;</td></tr>'; print '</td><td class="right">' . price(price2num($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye, 'MT')) . '</td><td>&nbsp;</td></tr>';
// $resteapayeraffiche=0; // $resteapayeraffiche=0;
$cssforamountpaymentcomplete = 'amountpaymentneutral'; $cssforamountpaymentcomplete = 'amountpaymentneutral';
} }
// Paye partiellement ou Abandon 'product_returned' // Paye partiellement ou Abandon 'product_returned'
if (($object->statut == Facture::STATUS_CLOSED || $object->statut == Facture::STATUS_ABANDONED) && $object->close_code == 'product_returned') { if (($object->statut == Facture::STATUS_CLOSED || $object->statut == Facture::STATUS_ABANDONED) && $object->close_code == 'product_returned') {
print '<tr><td colspan="' . $nbcols . '" align="right" class="nowrap">'; print '<tr><td colspan="' . $nbcols . '" class="nowrap right">';
print $form->textwithpicto($langs->trans("ProductReturned") . ':', $langs->trans("HelpAbandonProductReturned"), - 1); print $form->textwithpicto($langs->trans("ProductReturned") . ':', $langs->trans("HelpAbandonProductReturned"), - 1);
print '</td><td align="right">' . price(price2num($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye, 'MT')) . '</td><td>&nbsp;</td></tr>'; print '</td><td class="right">' . price(price2num($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye, 'MT')) . '</td><td>&nbsp;</td></tr>';
$resteapayeraffiche = 0; $resteapayeraffiche = 0;
$cssforamountpaymentcomplete = 'amountpaymentneutral'; $cssforamountpaymentcomplete = 'amountpaymentneutral';
} }
// Paye partiellement ou Abandon 'abandon' // Paye partiellement ou Abandon 'abandon'
if (($object->statut == Facture::STATUS_CLOSED || $object->statut == Facture::STATUS_ABANDONED) && $object->close_code == 'abandon') { if (($object->statut == Facture::STATUS_CLOSED || $object->statut == Facture::STATUS_ABANDONED) && $object->close_code == 'abandon') {
print '<tr><td colspan="' . $nbcols . '" align="right" class="nowrap">'; print '<tr><td colspan="' . $nbcols . '" class="nowrap right">';
$text = $langs->trans("HelpAbandonOther"); $text = $langs->trans("HelpAbandonOther");
if ($object->close_note) if ($object->close_note)
$text .= '<br><br><b>' . $langs->trans("Reason") . '</b>:' . $object->close_note; $text .= '<br><br><b>' . $langs->trans("Reason") . '</b>:' . $object->close_note;
print $form->textwithpicto($langs->trans("Abandoned") . ':', $text, - 1); print $form->textwithpicto($langs->trans("Abandoned") . ':', $text, - 1);
print '</td><td align="right">' . price(price2num($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye, 'MT')) . '</td><td>&nbsp;</td></tr>'; print '</td><td class="right">' . price(price2num($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye, 'MT')) . '</td><td>&nbsp;</td></tr>';
$resteapayeraffiche = 0; $resteapayeraffiche = 0;
$cssforamountpaymentcomplete = 'amountpaymentneutral'; $cssforamountpaymentcomplete = 'amountpaymentneutral';
} }
// Billed // Billed
print '<tr><td colspan="' . $nbcols . '" align="right">' . $langs->trans("Billed") . ' :</td><td align="right">' . price($object->total_ttc) . '</td><td>&nbsp;</td></tr>'; print '<tr><td colspan="' . $nbcols . '" class="right">' . $langs->trans("Billed") . ' :</td><td class="right">' . price($object->total_ttc) . '</td><td>&nbsp;</td></tr>';
// Remainder to pay // Remainder to pay
print '<tr><td colspan="' . $nbcols . '" align="right">'; print '<tr><td colspan="' . $nbcols . '" class="right">';
if ($resteapayeraffiche >= 0) if ($resteapayeraffiche >= 0)
print $langs->trans('RemainderToPay'); print $langs->trans('RemainderToPay');
else else
print $langs->trans('ExcessReceived'); print $langs->trans('ExcessReceived');
print ' :</td>'; print ' :</td>';
print '<td align="right"'.($resteapayeraffiche?' class="amountremaintopay"':(' class="'.$cssforamountpaymentcomplete.'"')).'>' . price($resteapayeraffiche) . '</td>'; print '<td class="right"'.($resteapayeraffiche?' class="amountremaintopay"':(' class="'.$cssforamountpaymentcomplete.'"')).'>' . price($resteapayeraffiche) . '</td>';
print '<td class="nowrap">&nbsp;</td></tr>'; print '<td class="nowrap">&nbsp;</td></tr>';
} }
else // Credit note else // Credit note
@ -4372,26 +4372,26 @@ elseif ($id > 0 || ! empty($ref))
$cssforamountpaymentcomplete='amountpaymentneutral'; $cssforamountpaymentcomplete='amountpaymentneutral';
// Total already paid back // Total already paid back
print '<tr><td colspan="' . $nbcols . '" align="right">'; print '<tr><td colspan="' . $nbcols . '" class="right">';
print $langs->trans('AlreadyPaidBack'); print $langs->trans('AlreadyPaidBack');
print ' :</td><td align="right">' . price($sign * $totalpaye) . '</td><td>&nbsp;</td></tr>'; print ' :</td><td class="right">' . price($sign * $totalpaye) . '</td><td>&nbsp;</td></tr>';
// Billed // Billed
print '<tr><td colspan="' . $nbcols . '" align="right">' . $langs->trans("Billed") . ' :</td><td align="right">' . price($sign * $object->total_ttc) . '</td><td>&nbsp;</td></tr>'; print '<tr><td colspan="' . $nbcols . '" class="right">' . $langs->trans("Billed") . ' :</td><td class="right">' . price($sign * $object->total_ttc) . '</td><td>&nbsp;</td></tr>';
// Remainder to pay back // Remainder to pay back
print '<tr><td colspan="' . $nbcols . '" align="right">'; print '<tr><td colspan="' . $nbcols . '" class="right">';
if ($resteapayeraffiche <= 0) if ($resteapayeraffiche <= 0)
print $langs->trans('RemainderToPayBack'); print $langs->trans('RemainderToPayBack');
else else
print $langs->trans('ExcessPaid'); print $langs->trans('ExcessPaid');
print ' :</td>'; print ' :</td>';
print '<td align="right"'.($resteapayeraffiche?' class="amountremaintopayback"':(' class="'.$cssforamountpaymentcomplete.'"')).'>' . price($sign * $resteapayeraffiche) . '</td>'; print '<td class="right"'.($resteapayeraffiche?' class="amountremaintopayback"':(' class="'.$cssforamountpaymentcomplete.'"')).'>' . price($sign * $resteapayeraffiche) . '</td>';
print '<td class="nowrap">&nbsp;</td></tr>'; print '<td class="nowrap">&nbsp;</td></tr>';
// Sold credit note // Sold credit note
// print '<tr><td colspan="'.$nbcols.'" align="right">'.$langs->trans('TotalTTC').' :</td>'; // print '<tr><td colspan="'.$nbcols.'" class="right">'.$langs->trans('TotalTTC').' :</td>';
// print '<td align="right" style="border: 1px solid;" bgcolor="#f0f0f0"><b>'.price($sign * // print '<td class="right" style="border: 1px solid;" bgcolor="#f0f0f0"><b>'.price($sign *
// $object->total_ttc).'</b></td><td>&nbsp;</td></tr>'; // $object->total_ttc).'</b></td><td>&nbsp;</td></tr>';
} }
@ -4444,20 +4444,20 @@ elseif ($id > 0 || ! empty($ref))
print '<td align="center" width="5">&nbsp;</td>'; print '<td align="center" width="5">&nbsp;</td>';
} }
print '<td>' . $langs->trans('ModifyAllLines') . '</td>'; print '<td>' . $langs->trans('ModifyAllLines') . '</td>';
print '<td align="right" width="50">&nbsp;</td>'; print '<td class="right" width="50">&nbsp;</td>';
print '<td align="right" width="80">&nbsp;</td>'; print '<td class="right" width="80">&nbsp;</td>';
if ($inputalsopricewithtax) print '<td align="right" width="80">&nbsp;</td>'; if ($inputalsopricewithtax) print '<td class="right" width="80">&nbsp;</td>';
print '<td align="right" width="50">&nbsp</td>'; print '<td class="right" width="50">&nbsp</td>';
print '<td align="right" width="50">&nbsp</td>'; print '<td class="right" width="50">&nbsp</td>';
print '<td align="right" width="50">' . $langs->trans('Progress') . '</td>'; print '<td class="right" width="50">' . $langs->trans('Progress') . '</td>';
if (! empty($conf->margin->enabled) && empty($user->societe_id)) if (! empty($conf->margin->enabled) && empty($user->societe_id))
{ {
print '<td align="right" class="margininfos" width="80">&nbsp;</td>'; print '<td class="margininfos right" width="80">&nbsp;</td>';
if ((! empty($conf->global->DISPLAY_MARGIN_RATES) || ! empty($conf->global->DISPLAY_MARK_RATES)) && $usercanreadallmargin) { if ((! empty($conf->global->DISPLAY_MARGIN_RATES) || ! empty($conf->global->DISPLAY_MARK_RATES)) && $usercanreadallmargin) {
print '<td align="right" class="margininfos" width="50">&nbsp;</td>'; print '<td class="margininfos right" width="50">&nbsp;</td>';
} }
} }
print '<td align="right" width="50">&nbsp;</td>'; print '<td class="right" width="50">&nbsp;</td>';
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
print '<td width="10">&nbsp;</td>'; print '<td width="10">&nbsp;</td>';
print '<td width="10">&nbsp;</td>'; print '<td width="10">&nbsp;</td>';
@ -4473,8 +4473,8 @@ elseif ($id > 0 || ! empty($ref))
print '<td width="80">&nbsp;</td>'; print '<td width="80">&nbsp;</td>';
print '<td width="50">&nbsp;</td>'; print '<td width="50">&nbsp;</td>';
print '<td width="50">&nbsp;</td>'; print '<td width="50">&nbsp;</td>';
print '<td align="right" class="nowrap"><input type="text" size="1" value="" name="all_progress">%</td>'; print '<td class="nowrap right"><input type="text" size="1" value="" name="all_progress">%</td>';
print '<td colspan="4" align="right"><input class="button" type="submit" name="all_percent" value="Modifier" /></td>'; print '<td colspan="4" class="right"><input class="button" type="submit" name="all_percent" value="Modifier" /></td>';
print '</tr>'; print '</tr>';
print '</table>'; print '</table>';

View File

@ -284,12 +284,12 @@ 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" height="24">'; print '<tr class="liste_titre" height="24">';
print '<td align="center">'.$langs->trans("Year").'</td>'; print '<td align="center">'.$langs->trans("Year").'</td>';
print '<td align="right">'.$langs->trans("NumberOfBills").'</td>'; print '<td class="right">'.$langs->trans("NumberOfBills").'</td>';
print '<td align="right">%</td>'; print '<td class="right">%</td>';
print '<td align="right">'.$langs->trans("AmountTotal").'</td>'; print '<td class="right">'.$langs->trans("AmountTotal").'</td>';
print '<td align="right">%</td>'; print '<td class="right">%</td>';
print '<td align="right">'.$langs->trans("AmountAverage").'</td>'; print '<td class="right">'.$langs->trans("AmountAverage").'</td>';
print '<td align="right">%</td>'; print '<td class="right">%</td>';
print '</tr>'; print '</tr>';
$oldyear=0; $oldyear=0;
@ -302,23 +302,23 @@ foreach ($data as $val)
print '<tr class="oddeven" height="24">'; print '<tr class="oddeven" height="24">';
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$oldyear.'&amp;mode='.$mode.($socid>0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$oldyear.'</a></td>'; print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$oldyear.'&amp;mode='.$mode.($socid>0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$oldyear.'</a></td>';
print '<td align="right">0</td>'; print '<td class="right">0</td>';
print '<td align="right"></td>'; print '<td class="right"></td>';
print '<td align="right">0</td>'; print '<td class="right">0</td>';
print '<td align="right"></td>'; print '<td class="right"></td>';
print '<td align="right">0</td>'; print '<td class="right">0</td>';
print '<td align="right"></td>'; print '<td class="right"></td>';
print '</tr>'; print '</tr>';
} }
print '<tr class="oddeven" height="24">'; print '<tr class="oddeven" height="24">';
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'&amp;mode='.$mode.($socid>0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$year.'</a></td>'; print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'&amp;mode='.$mode.($socid>0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$year.'</a></td>';
print '<td align="right">'.$val['nb'].'</td>'; print '<td class="right">'.$val['nb'].'</td>';
print '<td align="right" style="'.(($val['nb_diff'] >= 0) ? 'color: green;':'color: red;').'">'.round($val['nb_diff']).'</td>'; print '<td class="right" style="'.(($val['nb_diff'] >= 0) ? 'color: green;':'color: red;').'">'.round($val['nb_diff']).'</td>';
print '<td align="right">'.price(price2num($val['total'],'MT'),1).'</td>'; print '<td class="right">'.price(price2num($val['total'], 'MT'), 1).'</td>';
print '<td align="right" style="'.(($val['total_diff'] >= 0) ? 'color: green;':'color: red;').'">'.round($val['total_diff']).'</td>'; print '<td class="right" style="'.(($val['total_diff'] >= 0) ? 'color: green;':'color: red;').'">'.round($val['total_diff']).'</td>';
print '<td align="right">'.price(price2num($val['avg'],'MT'),1).'</td>'; print '<td class="right">'.price(price2num($val['avg'], 'MT'), 1).'</td>';
print '<td align="right" style="'.(($val['avg_diff'] >= 0) ? 'color: green;':'color: red;').'">'.round($val['avg_diff']).'</td>'; print '<td class="right" style="'.(($val['avg_diff'] >= 0) ? 'color: green;':'color: red;').'">'.round($val['avg_diff']).'</td>';
print '</tr>'; print '</tr>';
$oldyear=$year; $oldyear=$year;
} }

View File

@ -51,7 +51,7 @@ foreach($linkedObjectBlock as $key => $objectlink)
<td class="linkedcol-name"><?php echo $objectlink->getNomUrl(1); ?></td> <td class="linkedcol-name"><?php echo $objectlink->getNomUrl(1); ?></td>
<td class="linkedcol-ref" align="center"><?php echo $objectlink->ref_client; ?></td> <td class="linkedcol-ref" align="center"><?php echo $objectlink->ref_client; ?></td>
<td class="linkedcol-date" align="center"><?php echo dol_print_date($objectlink->date, 'day'); ?></td> <td class="linkedcol-date" align="center"><?php echo dol_print_date($objectlink->date, 'day'); ?></td>
<td class="linkedcol-amount" align="right"><?php <td class="linkedcol-amount right"><?php
if ($user->rights->facture->lire) { if ($user->rights->facture->lire) {
$sign = 1; $sign = 1;
if ($object->type == Facture::TYPE_CREDIT_NOTE) $sign = -1; if ($object->type == Facture::TYPE_CREDIT_NOTE) $sign = -1;
@ -65,8 +65,8 @@ foreach($linkedObjectBlock as $key => $objectlink)
echo '<strike>'.price($objectlink->total_ht).'</strike>'; echo '<strike>'.price($objectlink->total_ht).'</strike>';
} }
} ?></td> } ?></td>
<td class="linkedcol-statut" align="right"><?php echo $objectlink->getLibStatut(3); ?></td> <td class="linkedcol-statut right"><?php echo $objectlink->getLibStatut(3); ?></td>
<td class="linkedcol-action" 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="linkedcol-action 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
} }
@ -78,9 +78,9 @@ if (count($linkedObjectBlock) > 1)
<td></td> <td></td>
<td align="center"></td> <td align="center"></td>
<td align="center"></td> <td align="center"></td>
<td align="right"><?php echo price($total); ?></td> <td class="right"><?php echo price($total); ?></td>
<td align="right"></td> <td class="right"></td>
<td align="right"></td> <td class="right"></td>
</tr> </tr>
<?php <?php
} }

View File

@ -51,13 +51,13 @@ foreach($linkedObjectBlock as $key => $objectlink)
<td class="linkedcol-name"><?php echo $objectlink->getNomUrl(1); ?></td> <td class="linkedcol-name"><?php echo $objectlink->getNomUrl(1); ?></td>
<td class="linkedcol-ref" align="center"></td> <td class="linkedcol-ref" align="center"></td>
<td class="linkedcol-date" align="center"><?php echo dol_print_date($objectlink->date_when, 'day'); ?></td> <td class="linkedcol-date" align="center"><?php echo dol_print_date($objectlink->date_when, 'day'); ?></td>
<td class="linkedcol-amount" align="right"><?php <td class="linkedcol-amount right"><?php
if ($user->rights->facture->lire) { if ($user->rights->facture->lire) {
$total = $total + $objectlink->total_ht; $total = $total + $objectlink->total_ht;
echo price($objectlink->total_ht); echo price($objectlink->total_ht);
} ?></td> } ?></td>
<td class="linkedcol-statut" align="right"><?php echo $objectlink->getLibStatut(3); ?></td> <td class="linkedcol-statut right"><?php echo $objectlink->getLibStatut(3); ?></td>
<td class="linkedcol-action" 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="linkedcol-action 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
} }
@ -69,9 +69,9 @@ if (count($linkedObjectBlock) > 1)
<td></td> <td></td>
<td align="center"></td> <td align="center"></td>
<td align="center"></td> <td align="center"></td>
<td align="right"><?php echo price($total); ?></td> <td class="right"><?php echo price($total); ?></td>
<td align="right"></td> <td class="right"></td>
<td align="right"></td> <td class="right"></td>
</tr> </tr>
<?php <?php
} }

View File

@ -121,7 +121,7 @@ function pt($db, $sql, $date)
if ($obj->mode == 'claimed' && ! empty($previousmode)) if ($obj->mode == 'claimed' && ! empty($previousmode))
{ {
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td class="nowrap">'.$obj->dm."</td>\n"; print '<td class="nowrap">'.$previousmonth."</td>\n";
print '<td class="nowrap" align="right">'.price($amountclaimed)."</td>\n"; print '<td class="nowrap" align="right">'.price($amountclaimed)."</td>\n";
print '<td class="nowrap" align="right">'.price($amountpaid)."</td>\n"; print '<td class="nowrap" align="right">'.price($amountpaid)."</td>\n";
print "</tr>\n"; print "</tr>\n";
@ -271,7 +271,7 @@ $mend = $tmp['mon'];
$total=0; $subtotalcoll=0; $subtotalpaye=0; $subtotal=0; $total=0; $subtotalcoll=0; $subtotalpaye=0; $subtotal=0;
$i=0; $mcursor=0; $i=0; $mcursor=0;
while ((($y < $yend) || ($y == $yend && $m < $mend)) && $mcursor < 1000) // $mcursor is to avoid too large loop while ((($y < $yend) || ($y == $yend && $m <= $mend)) && $mcursor < 1000) // $mcursor is to avoid too large loop
{ {
//$m = $conf->global->SOCIETE_FISCAL_MONTH_START + ($mcursor % 12); //$m = $conf->global->SOCIETE_FISCAL_MONTH_START + ($mcursor % 12);
if ($m == 13) $y++; if ($m == 13) $y++;
@ -536,7 +536,7 @@ while ((($y < $yend) || ($y == $yend && $m < $mend)) && $mcursor < 1000) // $mcu
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='.($m/3).'&year='.$y.'">'.$langs->trans("SubTotal").'</a>:</td>'; 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="nowrap" align="right">'.price(price2num($subtotalcoll, 'MT')).'</td>'; print '<td class="nowrap" align="right">'.price(price2num($subtotalcoll, 'MT')).'</td>';
print '<td class="nowrap" align="right">'.price(price2num($subtotalpaye, 'MT')).'</td>'; print '<td class="nowrap" align="right">'.price(price2num($subtotalpaye, 'MT')).'</td>';
print '<td class="nowrap" align="right">'.price(price2num($subtotal, 'MT')).'</td>'; print '<td class="nowrap" align="right">'.price(price2num($subtotal, 'MT')).'</td>';

View File

@ -40,12 +40,12 @@ require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
$langs->loadLangs(array('companies', 'bills', 'banks', 'multicurrency')); $langs->loadLangs(array('companies', 'bills', 'banks', 'multicurrency'));
$action = GETPOST('action', 'alpha'); $action = GETPOST('action', 'alpha');
$confirm = GETPOST('confirm'); $confirm = GETPOST('confirm', 'alpha');
$facid = GETPOST('facid', 'int'); $facid = GETPOST('facid', 'int');
$socname = GETPOST('socname'); $accountid = GETPOST('accountid', 'int');
$accountid = GETPOST('accountid'); $paymentnum = GETPOST('num_paiement', 'alpha');
$paymentnum = GETPOST('num_paiement'); $socid = GETPOST('socid', 'int');
$sortfield = GETPOST('sortfield', 'alpha'); $sortfield = GETPOST('sortfield', 'alpha');
$sortorder = GETPOST('sortorder', 'alpha'); $sortorder = GETPOST('sortorder', 'alpha');
@ -59,7 +59,6 @@ $multicurrency_amounts=array();
$multicurrency_amountsresttopay=array(); $multicurrency_amountsresttopay=array();
// Security check // Security check
$socid=0;
if ($user->societe_id > 0) if ($user->societe_id > 0)
{ {
$socid = $user->societe_id; $socid = $user->societe_id;
@ -219,6 +218,9 @@ if (empty($reshook))
$db->begin(); $db->begin();
$thirdparty = new Societe($db);
if ($socid > 0) $thirdparty->fetch($socid);
// Clean parameters amount if payment is for a credit note // Clean parameters amount if payment is for a credit note
if (GETPOST('type') == Facture::TYPE_CREDIT_NOTE) if (GETPOST('type') == Facture::TYPE_CREDIT_NOTE)
{ {
@ -238,7 +240,7 @@ if (empty($reshook))
if (! empty($conf->banque->enabled)) if (! empty($conf->banque->enabled))
{ {
// Si module bank actif, un compte est obligatoire lors de la saisie d'un paiement // Si module bank actif, un compte est obligatoire lors de la saisie d'un paiement
if (GETPOST('accountid') <= 0) if (GETPOST('accountid', 'int') <= 0)
{ {
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentities('AccountToCredit')), null, 'errors'); setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentities('AccountToCredit')), null, 'errors');
$error++; $error++;
@ -256,7 +258,7 @@ if (empty($reshook))
if (! $error) if (! $error)
{ {
$paiement_id = $paiement->create($user, (GETPOST('closepaidinvoices')=='on'?1:0)); // This include closing invoices and regenerating documents $paiement_id = $paiement->create($user, (GETPOST('closepaidinvoices')=='on'?1:0), $thirdparty); // This include closing invoices and regenerating documents
if ($paiement_id < 0) if ($paiement_id < 0)
{ {
setEventMessages($paiement->error, $paiement->errors, 'errors'); setEventMessages($paiement->error, $paiement->errors, 'errors');
@ -280,7 +282,7 @@ if (empty($reshook))
{ {
$db->commit(); $db->commit();
// If payment dispatching on more than one invoice, we keep on summary page, otherwise jump on invoice card // If payment dispatching on more than one invoice, we stay on summary page, otherwise jump on invoice card
$invoiceid=0; $invoiceid=0;
foreach ($paiement->amounts as $key => $amount) foreach ($paiement->amounts as $key => $amount)
{ {

View File

@ -66,10 +66,8 @@ print '<tr class="liste_titre">';
print '<th colspan="2">'.$langs->trans("BankChecks")."</th>\n"; print '<th colspan="2">'.$langs->trans("BankChecks")."</th>\n";
print "</tr>\n"; print "</tr>\n";
if ($resql) if ($resql) {
{ if ($row = $db->fetch_row($resql) ) {
if ($row = $db->fetch_row($resql) )
{
$num = $row[0]; $num = $row[0];
} }
print '<tr class="oddeven">'; print '<tr class="oddeven">';

View File

@ -222,9 +222,10 @@ class Paiement extends CommonObject
* *
* @param User $user Object user * @param User $user Object user
* @param int $closepaidinvoices 1=Also close payed invoices to paid, 0=Do nothing more * @param int $closepaidinvoices 1=Also close payed invoices to paid, 0=Do nothing more
* @param Societe $thirdparty Thirdparty
* @return int id of created payment, < 0 if error * @return int id of created payment, < 0 if error
*/ */
function create($user, $closepaidinvoices = 0) function create($user, $closepaidinvoices = 0, $thirdparty = null)
{ {
global $conf, $langs; global $conf, $langs;
@ -274,7 +275,7 @@ class Paiement extends CommonObject
$this->db->begin(); $this->db->begin();
$this->ref = $this->getNextNumRef(''); $this->ref = $this->getNextNumRef(is_object($thirdparty)?$thirdparty:'');
if ($way == 'dolibarr') if ($way == 'dolibarr')
{ {
@ -424,6 +425,7 @@ class Paiement extends CommonObject
// Regenerate documents of invoices // Regenerate documents of invoices
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
{ {
$newlang='';
$outputlangs = $langs; $outputlangs = $langs;
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $invoice->thirdparty->default_lang; if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $invoice->thirdparty->default_lang;
if (! empty($newlang)) { if (! empty($newlang)) {

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2016 Frédéric France <frederic.france@free.fr> * Copyright (C) 2016-2019 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2017 Alexandre Spangaro <aspangaro@open-dsi.fr> * Copyright (C) 2017 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

View File

@ -505,7 +505,7 @@ 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='.($m/3).'&year='.$y.'">'.$langs->trans("SubTotal").'</a>:</td>'; 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="nowrap" align="right">'.price(price2num($subtotalcoll, 'MT')).'</td>'; print '<td class="nowrap" align="right">'.price(price2num($subtotalcoll, 'MT')).'</td>';
print '<td class="nowrap" align="right">'.price(price2num($subtotalpaye, 'MT')).'</td>'; print '<td class="nowrap" align="right">'.price(price2num($subtotalpaye, 'MT')).'</td>';
print '<td class="nowrap" align="right">'.price(price2num($subtotal, 'MT')).'</td>'; print '<td class="nowrap" align="right">'.price(price2num($subtotal, 'MT')).'</td>';

View File

@ -1010,7 +1010,8 @@ class Contact extends CommonObject
} }
// Removed extrafields // Removed extrafields
if ((! $error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) { // For avoid conflicts if trigger used if ((! $error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) {
// For avoid conflicts if trigger used
$result=$this->deleteExtraFields($this); $result=$this->deleteExtraFields($this);
if ($result < 0) $error++; if ($result < 0) $error++;
} }

View File

@ -653,8 +653,7 @@ if (empty($reshook))
} }
} }
elseif ($action == 'updateline' && $user->rights->contrat->creer && ! GETPOST('cancel','alpha')) elseif ($action == 'updateline' && $user->rights->contrat->creer && ! GETPOST('cancel', 'alpha')) {
{
$error = 0; $error = 0;
if (!empty($date_start_update) && !empty($date_end_update) && $date_start_update > $date_end_update) if (!empty($date_start_update) && !empty($date_end_update) && $date_start_update > $date_end_update)
@ -1318,6 +1317,8 @@ else
{ {
$object->fetch_thirdparty(); $object->fetch_thirdparty();
$soc = $object->thirdparty; // $soc is used later
$result=$object->fetch_lines(); // This also init $this->nbofserviceswait, $this->nbofservicesopened, $this->nbofservicesexpired=, $this->nbofservicesclosed $result=$object->fetch_lines(); // This also init $this->nbofserviceswait, $this->nbofservicesopened, $this->nbofservicesexpired=, $this->nbofservicesclosed
if ($result < 0) { if ($result < 0) {
dol_print_error($db, $object->error); dol_print_error($db, $object->error);

View File

@ -58,7 +58,8 @@ if ($action == 'builddoc' && $permissioncreate)
// Special case to force bank account // Special case to force bank account
//if (property_exists($object, 'fk_bank')) //if (property_exists($object, 'fk_bank'))
//{ //{
if (GETPOST('fk_bank','int')) { // this field may come from an external module if (GETPOST('fk_bank', 'int')) {
// this field may come from an external module
$object->fk_bank = GETPOST('fk_bank', 'int'); $object->fk_bank = GETPOST('fk_bank', 'int');
} elseif (! empty($object->fk_account)) { } elseif (! empty($object->fk_account)) {
$object->fk_bank = $object->fk_account; $object->fk_bank = $object->fk_account;

View File

@ -3,6 +3,7 @@
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com> * Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2018 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2018 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2019 Ferran Marcet <fmarcet@2byte.es> * Copyright (C) 2019 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
@ -902,8 +903,7 @@ if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_se
$newlang=''; $newlang='';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang=GETPOST('lang_id', 'aZ09'); if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang=GETPOST('lang_id', 'aZ09');
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$objecttmp->thirdparty->default_lang; if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$objecttmp->thirdparty->default_lang;
if (! empty($newlang)) if (! empty($newlang)) {
{
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }

View File

@ -59,10 +59,8 @@ if ($action == 'setnote_public' && ! empty($permissionnote) && ! GETPOST('cancel
if ($result < 0) dol_print_error($db, $result); if ($result < 0) dol_print_error($db, $result);
} }
} }
} } elseif ($action == 'setnote_private' && ! empty($permissionnote) && ! GETPOST('cancel', 'alpha')) {
// Set public note // Set public note
elseif ($action == 'setnote_private' && ! empty($permissionnote) && ! GETPOST('cancel','alpha'))
{
if (empty($action) || ! is_object($object) || empty($id)) dol_print_error('', 'Include of actions_setnotes.inc.php was done but required variable was not set before'); if (empty($action) || ! is_object($object) || empty($id)) dol_print_error('', 'Include of actions_setnotes.inc.php was done but required variable was not set before');
if (empty($object->id)) $object->fetch($id); // Fetch may not be already done if (empty($object->id)) $object->fetch($id); // Fetch may not be already done
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_private', 'none'), ENT_QUOTES), '_private'); $result=$object->update_note(dol_html_entity_decode(GETPOST('note_private', 'none'), ENT_QUOTES), '_private');

View File

@ -89,8 +89,7 @@ class box_actions extends ModeleBoxes
$sql.= ", s.nom as name"; $sql.= ", s.nom as name";
$sql.= ", s.rowid as socid"; $sql.= ", s.rowid as socid";
$sql.= ", s.code_client"; $sql.= ", s.code_client";
$sql.= " FROM (".MAIN_DB_PREFIX."c_actioncomm AS ta, "; $sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm AS ta, ".MAIN_DB_PREFIX."actioncomm AS a";
$sql.= MAIN_DB_PREFIX."actioncomm AS a)";
if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc"; if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid";
$sql.= " WHERE a.fk_action = ta.id"; $sql.= " WHERE a.fk_action = ta.id";

View File

@ -5015,7 +5015,7 @@ abstract class CommonObject
if ($this->array_options[$key] === '') $mandatorypb=true; if ($this->array_options[$key] === '') $mandatorypb=true;
if ($mandatorypb) if ($mandatorypb)
{ {
dol_syslog($this->error); dol_syslog("Mandatory extra field ".$key." is empty");
$this->errors[]=$langs->trans('ErrorFieldRequired', $attributeLabel); $this->errors[]=$langs->trans('ErrorFieldRequired', $attributeLabel);
return -1; return -1;
} }
@ -5434,8 +5434,7 @@ abstract class CommonObject
elseif (in_array($type, array('int','integer','price')) || preg_match('/^double(\([0-9],[0-9]\)){0,1}/', $type)) elseif (in_array($type, array('int','integer','price')) || preg_match('/^double(\([0-9],[0-9]\)){0,1}/', $type))
{ {
$morecss = 'maxwidth75'; $morecss = 'maxwidth75';
}elseif ($type == 'url') } elseif ($type == 'url') {
{
$morecss='minwidth400'; $morecss='minwidth400';
} }
elseif ($type == 'boolean') elseif ($type == 'boolean')

View File

@ -3830,7 +3830,7 @@ class Form
global $langs,$conf; global $langs,$conf;
global $useglobalvars; global $useglobalvars;
$more=''; $more='<!-- formconfirm -->';
$formconfirm=''; $formconfirm='';
$inputok=array(); $inputok=array();
$inputko=array(); $inputko=array();
@ -3875,7 +3875,7 @@ class Form
elseif ($input['type'] == 'select') elseif ($input['type'] == 'select')
{ {
$more.='<tr><td'.(empty($input['tdclass'])?'':(' class="'.$input['tdclass'].'"')).'>'; $more.='<tr><td'.(empty($input['tdclass'])?'':(' class="'.$input['tdclass'].'"')).'>';
if (! empty($input['label'])) $more.=$input['label'].'</td><td class="tdtop left>'; if (! empty($input['label'])) $more.=$input['label'].'</td><td class="tdtop left">';
$more.=$this->selectarray($input['name'], $input['values'], $input['default'], 1, 0, 0, $moreattr, 0, 0, 0, '', $morecss); $more.=$this->selectarray($input['name'], $input['values'], $input['default'], 1, 0, 0, $moreattr, 0, 0, 0, '', $morecss);
$more.='</td></tr>'."\n"; $more.='</td></tr>'."\n";
} }

View File

@ -888,4 +888,55 @@ class FormCompany
} }
} }
} }
/**
* Return a HTML select for thirdparty type
*
* @param int $selected selected value
* @param string $htmlname HTML select name
* @param string $htmlidname HTML select id
* @param string $typeinput HTML output
* @param string $morecss More css
* @return string HTML string
*/
function selectProspectCustomerType($selected, $htmlname = 'client', $htmlidname = 'customerprospect', $typeinput = 'form', $morecss = '')
{
global $conf,$langs;
$out = '<select class="flat '.$morecss.'" name="'.$htmlname.'" id="'.$htmlidname.'">';
if ($typeinput=='form') {
if ($selected == '') $out .= '<option value="-1">&nbsp;</option>';
if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) {
$out .= '<option value="2"'.($selected==2?' selected':'').'>'.$langs->trans('Prospect').'</option>';
}
if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTSCUSTOMERS)) {
$out .= '<option value="3"'.($selected==3?' selected':'').'>'.$langs->trans('ProspectCustomer').'</option>';
}
if (empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) {
$out .= '<option value="1"'.($selected==1?' selected':'').'>'.$langs->trans('Customer').'</option>';
}
$out .= '<option value="0"'.((string) $selected == '0'?' selected':'').'>'.$langs->trans('NorProspectNorCustomer').'</option>';
} elseif ($typeinput=='list') {
$out .= '<option value="-1"'.($selected==''?' selected':'').'>&nbsp;</option>';
if (empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) {
$out .= '<option value="1,3"'.($selected=='1,3'?' selected':'').'>'.$langs->trans('Customer').'</option>';
}
if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) {
$out .= '<option value="2,3"'.($selected=='2,3'?' selected':'').'>'.$langs->trans('Prospect').'</option>';
}
$out .= '<option value="4"'.($selected=='4'?' selected':'').'>'.$langs->trans('Supplier').'</option>';
$out .= '<option value="0"'.($selected=='0'?' selected':'').'>'.$langs->trans('Others').'</option>';
} elseif ($typeinput=='admin') {
if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTSCUSTOMERS)) {
$out .= '<option value="3"'.($selected==3?' selected':'').'>'.$langs->trans('ProspectCustomer').'</option>';
}
if (empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) {
$out .= '<option value="1"'.($selected==1?' selected':'').'>'.$langs->trans('Customer').'</option>';
}
}
$out .= '</select>';
return $out;
}
} }

View File

@ -634,8 +634,9 @@ class Menubase
$tab_titre = explode("/", $menu['titre']); $tab_titre = explode("/", $menu['titre']);
$title = $langs->trans($tab_titre[0])."/".$langs->trans($tab_titre[1]); $title = $langs->trans($tab_titre[0])."/".$langs->trans($tab_titre[1]);
} }
elseif (preg_match('/\|\|/',$menu['titre'])) // To manage different translation (Title||AltTitle@ConditionForAltTitle) elseif (preg_match('/\|\|/', $menu['titre']))
{ {
// To manage different translation (Title||AltTitle@ConditionForAltTitle)
$tab_title = explode("||", $menu['titre']); $tab_title = explode("||", $menu['titre']);
$alt_title = explode("@", $tab_title[1]); $alt_title = explode("@", $tab_title[1]);
$title_enabled = verifCond($alt_title[1]); $title_enabled = verifCond($alt_title[1]);

View File

@ -1403,8 +1403,7 @@ class DoliDBSqlite3 extends DoliDB
$weekday=self::calc_weekday($first_daynr, !$monday_first); $weekday=self::calc_weekday($first_daynr, !$monday_first);
$calc_year=$year; $calc_year=$year;
if ($month == 1 && $day <= 7-$weekday) if ($month == 1 && $day <= 7-$weekday) {
{
if (!$week_year && (($first_weekday && $weekday != 0) || (!$first_weekday && $weekday >= 4))) if (!$week_year && (($first_weekday && $weekday != 0) || (!$first_weekday && $weekday >= 4)))
return 0; return 0;
$week_year= 1; $week_year= 1;
@ -1415,16 +1414,13 @@ class DoliDBSqlite3 extends DoliDB
if (($first_weekday && $weekday != 0) || (!$first_weekday && $weekday >= 4)) { if (($first_weekday && $weekday != 0) || (!$first_weekday && $weekday >= 4)) {
$days= $daynr - ($first_daynr+ (7-$weekday)); $days= $daynr - ($first_daynr+ (7-$weekday));
} } else {
else {
$days= $daynr - ($first_daynr - $weekday); $days= $daynr - ($first_daynr - $weekday);
} }
if ($week_year && $days >= 52*7) if ($week_year && $days >= 52*7) {
{
$weekday= ($weekday + self::calc_days_in_year($calc_year)) % 7; $weekday= ($weekday + self::calc_days_in_year($calc_year)) % 7;
if ((!$first_weekday && $weekday < 4) || ($first_weekday && $weekday == 0)) if ((!$first_weekday && $weekday < 4) || ($first_weekday && $weekday == 0)) {
{
$calc_year++; $calc_year++;
return 1; return 1;
} }

View File

@ -31,6 +31,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
* *
* @param array $versionarray Tableau de version (vermajeur,vermineur,autre) * @param array $versionarray Tableau de version (vermajeur,vermineur,autre)
* @return string Chaine version * @return string Chaine version
* @see versioncompare
*/ */
function versiontostring($versionarray) function versiontostring($versionarray)
{ {
@ -54,6 +55,7 @@ function versiontostring($versionarray)
* @return int -4,-3,-2,-1 if versionarray1<versionarray2 (value depends on level of difference) * @return int -4,-3,-2,-1 if versionarray1<versionarray2 (value depends on level of difference)
* 0 if same * 0 if same
* 1,2,3,4 if versionarray1>versionarray2 (value depends on level of difference) * 1,2,3,4 if versionarray1>versionarray2 (value depends on level of difference)
* @see versiontostring
*/ */
function versioncompare($versionarray1, $versionarray2) function versioncompare($versionarray1, $versionarray2)
{ {

View File

@ -4,6 +4,7 @@
* Copyright (C) 2012-2016 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2012-2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr> * Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* 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
@ -2654,10 +2655,10 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
if (! empty($conf->productbatch->enabled)) $original_file=$conf->productbatch->multidir_output[$entity].'/'.$original_file; if (! empty($conf->productbatch->enabled)) $original_file=$conf->productbatch->multidir_output[$entity].'/'.$original_file;
} }
// Wrapping pour les mouvements stocks // Wrapping for stock movements
elseif ($modulepart == 'movement' || $modulepart == 'mouvement') elseif ($modulepart == 'movement' || $modulepart == 'mouvement')
{ {
if (empty($entity) || (empty($conf->stock->multidir_output[$entity]) )) return array('accessallowed'=>0, 'error'=>'Value entity must be provided'); if (empty($entity) || empty($conf->stock->multidir_output[$entity])) return array('accessallowed'=>0, 'error'=>'Value entity must be provided');
if (($fuser->rights->stock->{$lire} || $fuser->rights->stock->movement->{$lire} || $fuser->rights->stock->mouvement->{$lire}) || preg_match('/^specimen/i', $original_file)) if (($fuser->rights->stock->{$lire} || $fuser->rights->stock->movement->{$lire} || $fuser->rights->stock->mouvement->{$lire}) || preg_match('/^specimen/i', $original_file))
{ {
$accessallowed=1; $accessallowed=1;

View File

@ -2367,7 +2367,8 @@ function dol_print_phone($phone, $countrycode = '', $cid = 0, $socid = 0, $addli
} }
} }
elseif (strtoupper($countrycode) == "MU") elseif (strtoupper($countrycode) == "MU")
{//Maurice {
//Maurice
if(dol_strlen($phone) == 11) if(dol_strlen($phone) == 11)
{//ex: +230_ABC_DE_FG {//ex: +230_ABC_DE_FG
$newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 2).$separ.substr($newphone, 9, 2); $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 2).$separ.substr($newphone, 9, 2);
@ -2514,9 +2515,11 @@ function dol_print_phone($phone, $countrycode = '', $cid = 0, $socid = 0, $addli
} }
} }
elseif(strtoupper($countrycode) == "AU") elseif(strtoupper($countrycode) == "AU")
{//Australie {
//Australie
if(dol_strlen($phone) == 12) if(dol_strlen($phone) == 12)
{//ex: +61_A_BCDE_FGHI {
//ex: +61_A_BCDE_FGHI
$newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 1).$separ.substr($newphone, 4, 4).$separ.substr($newphone, 8, 4); $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 1).$separ.substr($newphone, 4, 4).$separ.substr($newphone, 8, 4);
} }
} }
@ -3089,7 +3092,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
$fa='fa'; $fa='fa';
if (! empty($conf->global->MAIN_USE_FONT_AWESOME_5)) $fa='fas'; if (! empty($conf->global->MAIN_USE_FONT_AWESOME_5)) $fa='fas';
$enabledisablehtml = '<span class="' . $fa . ' ' . $fakey . ' ' . ($marginleftonlyshort ? ($marginleftonlyshort == 1 ? 'marginleftonlyshort' : 'marginleftonly') : '') . ' valignmiddle' . ($morecss ? ' ' . $morecss : '') . '" style="' . ($fasize ? ('font-size: ' . $fasize . ';') : '') . ($facolor ? (' color: ' . $facolor . ';') : '') . ($morestyle ? ' ' . $morestyle : '') . '"' . (($notitle || empty($titlealt)) ? '' : ' title="' . dol_escape_htmltag($titlealt) . '"') . ($moreatt ? ' ' . $moreatt : '') . '>'; $enabledisablehtml = '<span class="' . $fa . ' ' . $fakey . ' ' . ($marginleftonlyshort ? ($marginleftonlyshort == 1 ? 'marginleftonlyshort' : 'marginleftonly') : '');
$enabledisablehtml .= ' valignmiddle' . ($morecss ? ' ' . $morecss : '') . '" style="' . ($fasize ? ('font-size: ' . $fasize . ';') : '') . ($facolor ? (' color: ' . $facolor . ';') : '') . ($morestyle ? ' ' . $morestyle : '') . '"' . (($notitle || empty($titlealt)) ? '' : ' title="' . dol_escape_htmltag($titlealt) . '"') . ($moreatt ? ' ' . $moreatt : '') . '>';
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
$enabledisablehtml.= $titlealt; $enabledisablehtml.= $titlealt;
} }
@ -7084,7 +7088,7 @@ function complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type,
} }
elseif (count($values) == 5) // deprecated elseif (count($values) == 5) // deprecated
{ {
dol_syslog('Passing 5 values in tabs module_parts is deprecated. Please update to 6 with permissions.', LOG_WARNING); dol_syslog('Passing 5 values in tabs module_parts is deprecated. Please update to 6 with permissions.', LOG_WARNING);
if ($values[0] != $type) continue; if ($values[0] != $type) continue;
if ($values[3]) $langs->load($values[3]); if ($values[3]) $langs->load($values[3]);

View File

@ -667,6 +667,10 @@ function dolSavePageContent($filetpl, $object, $objectpage)
$tplcontent.= "require_once DOL_DOCUMENT_ROOT.'/core/website.inc.php';\n"; $tplcontent.= "require_once DOL_DOCUMENT_ROOT.'/core/website.inc.php';\n";
$tplcontent.= "ob_start();\n"; $tplcontent.= "ob_start();\n";
$tplcontent.= "// END PHP ?>\n"; $tplcontent.= "// END PHP ?>\n";
if (! empty($conf->global->WEBSITE_FORCE_DOCTYPE_HTML5))
{
$tplcontent.= "<!DOCTYPE html>\n";
}
$tplcontent.= '<html'.($shortlangcode ? ' lang="'.$shortlangcode.'"':'').'>'."\n"; $tplcontent.= '<html'.($shortlangcode ? ' lang="'.$shortlangcode.'"':'').'>'."\n";
$tplcontent.= '<head>'."\n"; $tplcontent.= '<head>'."\n";
$tplcontent.= '<title>'.dol_string_nohtmltag($objectpage->title, 0, 'UTF-8').'</title>'."\n"; $tplcontent.= '<title>'.dol_string_nohtmltag($objectpage->title, 0, 'UTF-8').'</title>'."\n";

View File

@ -833,7 +833,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
$newmenu->add("/fichinter/index.php?leftmenu=ficheinter", $langs->trans("Interventions"), 0, $user->rights->ficheinter->lire, '', $mainmenu, 'ficheinter', 2200); $newmenu->add("/fichinter/index.php?leftmenu=ficheinter", $langs->trans("Interventions"), 0, $user->rights->ficheinter->lire, '', $mainmenu, 'ficheinter', 2200);
$newmenu->add("/fichinter/card.php?action=create&amp;leftmenu=ficheinter", $langs->trans("NewIntervention"), 1, $user->rights->ficheinter->creer, '', '', '', 201); $newmenu->add("/fichinter/card.php?action=create&amp;leftmenu=ficheinter", $langs->trans("NewIntervention"), 1, $user->rights->ficheinter->creer, '', '', '', 201);
$newmenu->add("/fichinter/list.php?leftmenu=ficheinter", $langs->trans("List"), 1, $user->rights->ficheinter->lire, '', '', '', 202); $newmenu->add("/fichinter/list.php?leftmenu=ficheinter", $langs->trans("List"), 1, $user->rights->ficheinter->lire, '', '', '', 202);
$newmenu->add("/fichinter/card-rec.php?leftmenu=ficheinter", $langs->trans("ModelList"), 1, $user->rights->ficheinter->lire, '', '', '', 203); if ($conf->global->MAIN_FEATURES_LEVEL >= 2) $newmenu->add("/fichinter/card-rec.php?leftmenu=ficheinter", $langs->trans("ModelList"), 1, $user->rights->ficheinter->lire, '', '', '', 203);
$newmenu->add("/fichinter/stats/index.php?leftmenu=ficheinter", $langs->trans("Statistics"), 1, $user->rights->fournisseur->commande->lire); $newmenu->add("/fichinter/stats/index.php?leftmenu=ficheinter", $langs->trans("Statistics"), 1, $user->rights->fournisseur->commande->lire);
} }
} }

View File

@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
/** /**
* Classe permettant de generer les projets au modele SEPAMandate * Class to generate SEPA mandate
*/ */
class pdf_sepamandate extends ModeleBankAccountDoc class pdf_sepamandate extends ModeleBankAccountDoc

View File

@ -771,8 +771,7 @@ class pdf_einstein extends ModelePDFCommandes
// Show payment mode // Show payment mode
if ($object->mode_reglement_code if ($object->mode_reglement_code
&& $object->mode_reglement_code != 'CHQ' && $object->mode_reglement_code != 'CHQ'
&& $object->mode_reglement_code != 'VIR') && $object->mode_reglement_code != 'VIR') {
{
$pdf->SetFont('', 'B', $default_font_size - 2); $pdf->SetFont('', 'B', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche, $posy); $pdf->SetXY($this->marge_gauche, $posy);
$titre = $outputlangs->transnoentities("PaymentMode").':'; $titre = $outputlangs->transnoentities("PaymentMode").':';

View File

@ -831,8 +831,7 @@ class pdf_eratosthene extends ModelePDFCommandes
// Show payment mode // Show payment mode
if ($object->mode_reglement_code if ($object->mode_reglement_code
&& $object->mode_reglement_code != 'CHQ' && $object->mode_reglement_code != 'CHQ'
&& $object->mode_reglement_code != 'VIR') && $object->mode_reglement_code != 'VIR') {
{
$pdf->SetFont('', 'B', $default_font_size - 2); $pdf->SetFont('', 'B', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche, $posy); $pdf->SetXY($this->marge_gauche, $posy);
$titre = $outputlangs->transnoentities("PaymentMode").':'; $titre = $outputlangs->transnoentities("PaymentMode").':';

View File

@ -294,8 +294,9 @@ class doc_generic_contract_odt extends ModelePDFContract
if (! empty($usecontact)) if (! empty($usecontact))
{ {
// On peut utiliser le nom de la societe du contact // On peut utiliser le nom de la societe du contact
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact; if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
else { $socobject = $object->contact;
} else {
$socobject = $object->thirdparty; $socobject = $object->thirdparty;
// if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use // if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use
$contactobject = $object->contact; $contactobject = $object->contact;

View File

@ -1291,9 +1291,6 @@ class pdf_crabe extends ModelePDFFactures
if (in_array((string) $localtax_type, array('2','4','6'))) continue; if (in_array((string) $localtax_type, array('2','4','6'))) continue;
foreach($localtax_rate as $tvakey => $tvaval) foreach($localtax_rate as $tvakey => $tvaval)
{
// retrieve global local tax
if ($tvakey != 0) // On affiche pas taux 0
{ {
//$this->atleastoneratenotnull++; //$this->atleastoneratenotnull++;
@ -1316,7 +1313,6 @@ class pdf_crabe extends ModelePDFFactures
} }
} }
//} //}
}
// Revenue stamp // Revenue stamp
if (price2num($object->revenuestamp) != 0) if (price2num($object->revenuestamp) != 0)

View File

@ -1377,8 +1377,8 @@ class pdf_sponge extends ModelePDFFactures
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1);
} }
} }
//}
} }
//}
// Revenue stamp // Revenue stamp
if (price2num($object->revenuestamp) != 0) if (price2num($object->revenuestamp) != 0)

View File

@ -130,7 +130,7 @@ class mod_arctic extends ModeleNumRefFicheinter
require_once DOL_DOCUMENT_ROOT .'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT .'/core/lib/functions2.lib.php';
// On d<EFBFBD>fini critere recherche compteur // On défini critere recherche compteur
$mask=$conf->global->FICHINTER_ARTIC_MASK; $mask=$conf->global->FICHINTER_ARTIC_MASK;
if (! $mask) if (! $mask)

View File

@ -577,8 +577,7 @@ class ImportCsv extends ModeleImports
} }
} }
// If test is just a static regex // If test is just a static regex
elseif (! preg_match('/'.$objimport->array_import_regex[0][$val].'/i',$newval)) elseif (! preg_match('/'.$objimport->array_import_regex[0][$val].'/i', $newval)) {
{
//if ($key == 19) print "xxx".$newval."zzz".$objimport->array_import_regex[0][$val]."<br>"; //if ($key == 19) print "xxx".$newval."zzz".$objimport->array_import_regex[0][$val]."<br>";
$this->errors[$error]['lib']=$langs->transnoentitiesnoconv('ErrorWrongValueForField', $key, $newval, $objimport->array_import_regex[0][$val]); $this->errors[$error]['lib']=$langs->transnoentitiesnoconv('ErrorWrongValueForField', $key, $newval, $objimport->array_import_regex[0][$val]);
$this->errors[$error]['type']='REGEX'; $this->errors[$error]['type']='REGEX';

View File

@ -602,10 +602,8 @@ class ImportXlsx extends ModeleImports
$errorforthistable++; $errorforthistable++;
$error++; $error++;
} }
} } elseif (! preg_match('/'.$objimport->array_import_regex[0][$val].'/i', $newval)) {
// If test is just a static regex // If test is just a static regex
elseif (! preg_match('/'.$objimport->array_import_regex[0][$val].'/i',$newval))
{
//if ($key == 19) print "xxx".$newval."zzz".$objimport->array_import_regex[0][$val]."<br>"; //if ($key == 19) print "xxx".$newval."zzz".$objimport->array_import_regex[0][$val]."<br>";
$this->errors[$error]['lib']=$langs->transnoentitiesnoconv('ErrorWrongValueForField', $key, $newval, $objimport->array_import_regex[0][$val]); $this->errors[$error]['lib']=$langs->transnoentitiesnoconv('ErrorWrongValueForField', $key, $newval, $objimport->array_import_regex[0][$val]);
$this->errors[$error]['type']='REGEX'; $this->errors[$error]['type']='REGEX';

View File

@ -210,7 +210,8 @@ class modFacture extends DolibarrModules
$this->export_icon[$r] = 'invoice'; $this->export_icon[$r] = 'invoice';
$this->export_permission[$r] = array(array("facture", "facture", "export", "other")); $this->export_permission[$r] = array(array("facture", "facture", "export", "other"));
$this->export_fields_array[$r] = array( $this->export_fields_array[$r] = array(
's.rowid'=>"IdCompany", 's.nom'=>'CompanyName', 's.code_client'=>'CustomerCode', 's.address'=>'Address', 's.zip'=>'Zip', 's.town'=>'Town', 'c.code'=>'CountryCode', 's.phone'=>'Phone', 's.rowid'=>"IdCompany", 's.nom'=>'CompanyName', 's.code_client'=>'CustomerCode', 's.address'=>'Address', 's.zip'=>'Zip', 's.town'=>'Town', 'c.code'=>'CountryCode', 'cd.nom'=>'State',
's.phone'=>'Phone',
's.siren'=>'ProfId1', 's.siret'=>'ProfId2', 's.ape'=>'ProfId3', 's.idprof4'=>'ProfId4', 's.code_compta'=>'CustomerAccountancyCode', 's.siren'=>'ProfId1', 's.siret'=>'ProfId2', 's.ape'=>'ProfId3', 's.idprof4'=>'ProfId4', 's.code_compta'=>'CustomerAccountancyCode',
's.code_compta_fournisseur'=>'SupplierAccountancyCode', 's.tva_intra'=>'VATIntra', 's.code_compta_fournisseur'=>'SupplierAccountancyCode', 's.tva_intra'=>'VATIntra',
'f.rowid'=>"InvoiceId", 'f.ref'=>"InvoiceRef", 'f.ref_client'=>'RefCustomer', 'f.rowid'=>"InvoiceId", 'f.ref'=>"InvoiceRef", 'f.ref_client'=>'RefCustomer',
@ -232,7 +233,7 @@ class modFacture extends DolibarrModules
$this->export_fields_array[$r]['f.multicurrency_total_ttc'] = 'MulticurrencyAmountTTC'; $this->export_fields_array[$r]['f.multicurrency_total_ttc'] = 'MulticurrencyAmountTTC';
} }
$this->export_TypeFields_array[$r] = array( $this->export_TypeFields_array[$r] = array(
's.rowid'=>'Numeric', 's.nom'=>'Text', 's.code_client'=>'Text', 's.address'=>'Text', 's.zip'=>'Text', 's.town'=>'Text', 'c.code'=>'Text', 's.phone'=>'Text', 's.siren'=>'Text', 's.rowid'=>'Numeric', 's.nom'=>'Text', 's.code_client'=>'Text', 's.address'=>'Text', 's.zip'=>'Text', 's.town'=>'Text', 'c.code'=>'Text', 'cd.nom'=>'Text', 's.phone'=>'Text', 's.siren'=>'Text',
's.siret'=>'Text', 's.ape'=>'Text', 's.idprof4'=>'Text', 's.code_compta'=>'Text', 's.code_compta_fournisseur'=>'Text', 's.tva_intra'=>'Text', 's.siret'=>'Text', 's.ape'=>'Text', 's.idprof4'=>'Text', 's.code_compta'=>'Text', 's.code_compta_fournisseur'=>'Text', 's.tva_intra'=>'Text',
'f.rowid'=>'Numeric', 'f.ref'=>"Text", 'f.ref_client'=>'Text', 'f.type'=>"Numeric", 'f.datec'=>"Date", 'f.datef'=>"Date", 'f.date_lim_reglement'=>"Date", 'f.rowid'=>'Numeric', 'f.ref'=>"Text", 'f.ref_client'=>'Text', 'f.type'=>"Numeric", 'f.datec'=>"Date", 'f.datef'=>"Date", 'f.date_lim_reglement'=>"Date",
'f.total'=>"Numeric", 'f.total_ttc'=>"Numeric", 'f.tva'=>"Numeric", 'f.localtax1'=>'Numeric', 'f.localtax2'=>'Numeric', 'none.rest'=>"NumericCompute", 'f.paye'=>"Boolean", 'f.fk_statut'=>'Numeric', 'f.total'=>"Numeric", 'f.total_ttc'=>"Numeric", 'f.tva'=>"Numeric", 'f.localtax1'=>'Numeric', 'f.localtax2'=>'Numeric', 'none.rest'=>"NumericCompute", 'f.paye'=>"Boolean", 'f.fk_statut'=>'Numeric',
@ -262,7 +263,8 @@ class modFacture extends DolibarrModules
$this->export_sql_start[$r] = 'SELECT DISTINCT '; $this->export_sql_start[$r] = 'SELECT DISTINCT ';
$this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'societe as s'; $this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'societe as s';
if (empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; if (empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid';
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c on s.fk_pays = c.rowid,'; $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c on s.fk_pays = c.rowid';
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as cd on s.fk_departement = cd.rowid,';
$this->export_sql_end[$r] .= ' '.MAIN_DB_PREFIX.'facture as f'; $this->export_sql_end[$r] .= ' '.MAIN_DB_PREFIX.'facture as f';
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'projet as pj ON f.fk_projet = pj.rowid'; $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'projet as pj ON f.fk_projet = pj.rowid';
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user as uc ON f.fk_user_author = uc.rowid'; $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user as uc ON f.fk_user_author = uc.rowid';
@ -282,7 +284,8 @@ class modFacture extends DolibarrModules
$this->export_icon[$r] = 'invoice'; $this->export_icon[$r] = 'invoice';
$this->export_permission[$r] = array(array("facture", "facture", "export")); $this->export_permission[$r] = array(array("facture", "facture", "export"));
$this->export_fields_array[$r] = array( $this->export_fields_array[$r] = array(
's.rowid'=>"IdCompany", 's.nom'=>'CompanyName', 's.code_client'=>'CustomerCode', 's.address'=>'Address', 's.zip'=>'Zip', 's.town'=>'Town', 'c.code'=>'CountryCode', 's.phone'=>'Phone', 's.rowid'=>"IdCompany", 's.nom'=>'CompanyName', 's.code_client'=>'CustomerCode', 's.address'=>'Address', 's.zip'=>'Zip', 's.town'=>'Town', 'c.code'=>'CountryCode', 'cd.nom'=>'State',
's.phone'=>'Phone',
's.siren'=>'ProfId1', 's.siret'=>'ProfId2', 's.ape'=>'ProfId3', 's.idprof4'=>'ProfId4', 's.code_compta'=>'CustomerAccountancyCode', 's.siren'=>'ProfId1', 's.siret'=>'ProfId2', 's.ape'=>'ProfId3', 's.idprof4'=>'ProfId4', 's.code_compta'=>'CustomerAccountancyCode',
's.code_compta_fournisseur'=>'SupplierAccountancyCode', 's.tva_intra'=>'VATIntra', 's.code_compta_fournisseur'=>'SupplierAccountancyCode', 's.tva_intra'=>'VATIntra',
'f.rowid'=>"InvoiceId", 'f.ref'=>"InvoiceRef", 'f.ref_client'=>'RefCustomer', 'f.rowid'=>"InvoiceId", 'f.ref'=>"InvoiceRef", 'f.ref_client'=>'RefCustomer',
@ -302,7 +305,7 @@ class modFacture extends DolibarrModules
$this->export_fields_array[$r]['f.multicurrency_total_ttc'] = 'MulticurrencyAmountTTC'; $this->export_fields_array[$r]['f.multicurrency_total_ttc'] = 'MulticurrencyAmountTTC';
} }
$this->export_TypeFields_array[$r] = array( $this->export_TypeFields_array[$r] = array(
's.rowid'=>'Numeric', 's.nom'=>'Text', 's.code_client'=>'Text', 's.address'=>'Text', 's.zip'=>'Text', 's.town'=>'Text', 'c.code'=>'Text', 's.phone'=>'Text', 's.siren'=>'Text', 's.rowid'=>'Numeric', 's.nom'=>'Text', 's.code_client'=>'Text', 's.address'=>'Text', 's.zip'=>'Text', 's.town'=>'Text', 'c.code'=>'Text', 'cd.nom'=>'Text', 's.phone'=>'Text', 's.siren'=>'Text',
's.siret'=>'Text', 's.ape'=>'Text', 's.idprof4'=>'Text', 's.code_compta'=>'Text', 's.code_compta_fournisseur'=>'Text', 's.tva_intra'=>'Text', 's.siret'=>'Text', 's.ape'=>'Text', 's.idprof4'=>'Text', 's.code_compta'=>'Text', 's.code_compta_fournisseur'=>'Text', 's.tva_intra'=>'Text',
'f.rowid'=>"Numeric", 'f.ref'=>"Text", 'f.ref_client'=>'Text', 'f.type'=>"Numeric", 'f.datec'=>"Date", 'f.datef'=>"Date", 'f.date_lim_reglement'=>"Date", 'f.rowid'=>"Numeric", 'f.ref'=>"Text", 'f.ref_client'=>'Text', 'f.type'=>"Numeric", 'f.datec'=>"Date", 'f.datef'=>"Date", 'f.date_lim_reglement'=>"Date",
'f.total'=>"Numeric", 'f.total_ttc'=>"Numeric", 'f.tva'=>"Numeric", 'f.localtax1'=>'Numeric', 'f.localtax2'=>'Numeric', 'none.rest'=>'NumericCompute', 'f.paye'=>"Boolean", 'f.fk_statut'=>'Status', 'f.total'=>"Numeric", 'f.total_ttc'=>"Numeric", 'f.tva'=>"Numeric", 'f.localtax1'=>'Numeric', 'f.localtax2'=>'Numeric', 'none.rest'=>'NumericCompute', 'f.paye'=>"Boolean", 'f.fk_statut'=>'Status',
@ -324,7 +327,8 @@ class modFacture extends DolibarrModules
$this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_start[$r]='SELECT DISTINCT ';
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s'; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s';
if (empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; if (empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c on s.fk_pays = c.rowid,'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c on s.fk_pays = c.rowid';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as cd on s.fk_departement = cd.rowid,';
$this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'facture as f'; $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'facture as f';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet as pj ON f.fk_projet = pj.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet as pj ON f.fk_projet = pj.rowid';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'user as uc ON f.fk_user_author = uc.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'user as uc ON f.fk_user_author = uc.rowid';

View File

@ -20,11 +20,10 @@
*/ */
/** /**
* \defgroup fournisseur suppliers Module * \defgroup fournisseur Module suppliers
* \brief Module to manage companies and contacts of supplier type
* \file htdocs/core/modules/modFournisseur.class.php * \file htdocs/core/modules/modFournisseur.class.php
* \ingroup fournisseur * \ingroup fournisseur
* \brief Description and activation file for module Fournisseur * \brief Description and activation file for module Supplier
*/ */
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php'; include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';

View File

@ -18,8 +18,7 @@
*/ */
/** /**
* \defgroup ticket Ticket module * \defgroup ticket Module Ticket
* \brief Ticket module descriptor.
* \file core/modules/modTicket.class.php * \file core/modules/modTicket.class.php
* \ingroup ticket * \ingroup ticket
* \brief Description and activation file for module Ticket * \brief Description and activation file for module Ticket

View File

@ -321,8 +321,9 @@ class doc_generic_product_odt extends ModelePDFProduct
if (! empty($usecontact)) if (! empty($usecontact))
{ {
// On peut utiliser le nom de la societe du contact // On peut utiliser le nom de la societe du contact
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact; if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
else { $socobject = $object->contact;
} else {
$socobject = $object->thirdparty; $socobject = $object->thirdparty;
// if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use // if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use
$contactobject = $object->contact; $contactobject = $object->contact;

View File

@ -321,8 +321,9 @@ class doc_generic_stock_odt extends ModelePDFStock
if (! empty($usecontact)) if (! empty($usecontact))
{ {
// On peut utiliser le nom de la societe du contact // On peut utiliser le nom de la societe du contact
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact; if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
else { $socobject = $object->contact;
} else {
$socobject = $object->thirdparty; $socobject = $object->thirdparty;
// if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use // if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use
$contactobject = $object->contact; $contactobject = $object->contact;

View File

@ -27,8 +27,7 @@
*/ */
// Protection to avoid direct call of template // Protection to avoid direct call of template
if (empty($conf) || ! is_object($conf)) if (empty($conf) || ! is_object($conf)) {
{
print "Error, template page can't be called as URL"; print "Error, template page can't be called as URL";
exit; exit;
} }

View File

@ -235,7 +235,10 @@ if ($permission) {
</form> </form>
<?php $i++; ?> <?php $i++; ?>
<?php } } ?> <?php
}
}
?>
</div> </div>
</div> </div>

View File

@ -21,8 +21,7 @@
// Protection to avoid direct call of template // Protection to avoid direct call of template
if (empty($conf) || ! is_object($conf)) if (empty($conf) || ! is_object($conf)) {
{
print "Error, template page can't be called as URL"; print "Error, template page can't be called as URL";
exit; exit;
} }
@ -67,13 +66,18 @@ $colorbackhmenu1=join(',',colorStringToArray($colorbackhmenu1)); // Normalize
?> ?>
<!-- BEGIN PHP TEMPLATE LOGIN.TPL.PHP --> <!-- BEGIN PHP TEMPLATE LOGIN.TPL.PHP -->
<?php if (!empty($conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND)) { <?php
if (!empty($conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND)) {
// For example $conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND = 'https://source.unsplash.com/random' // For example $conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND = 'https://source.unsplash.com/random'
?> ?>
<body class="body bodylogin" style="background-image: url('<?php echo $conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND; ?>'); background-repeat: no-repeat; background-position: center center; background-attachment: fixed; background-size: cover; background-color: #ffffff;"> <body class="body bodylogin" style="background-image: url('<?php echo $conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND; ?>'); background-repeat: no-repeat; background-position: center center; background-attachment: fixed; background-size: cover; background-color: #ffffff;">
<?php } else { ?> <?php
} else {
?>
<body class="body bodylogin"<?php print empty($conf->global->MAIN_LOGIN_BACKGROUND)?'':' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; background-image: url(\''.DOL_URL_ROOT.'/viewimage.php?cache=1&noalt=1&modulepart=mycompany&file=logos/'.urlencode($conf->global->MAIN_LOGIN_BACKGROUND).'\')"'; ?>> <body class="body bodylogin"<?php print empty($conf->global->MAIN_LOGIN_BACKGROUND)?'':' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; background-image: url(\''.DOL_URL_ROOT.'/viewimage.php?cache=1&noalt=1&modulepart=mycompany&file=logos/'.urlencode($conf->global->MAIN_LOGIN_BACKGROUND).'\')"'; ?>>
<?php } ?> <?php
}
?>
<?php if (empty($conf->dol_use_jmobile)) { ?> <?php if (empty($conf->dol_use_jmobile)) { ?>
<script type="text/javascript"> <script type="text/javascript">

View File

@ -145,7 +145,7 @@ $coldisplay=-1; // We remove first td
} }
$coldisplay++; $coldisplay++;
print '<td align="right"><input type="text" class="flat right" size="5" id="price_ht" name="price_ht" value="' . (isset($line->pu_ht)?price($line->pu_ht,0,'',0):price($line->subprice,0,'',0)) . '"'; print '<td class="right"><input type="text" class="flat right" size="5" id="price_ht" name="price_ht" value="' . (isset($line->pu_ht)?price($line->pu_ht, 0, '', 0):price($line->subprice, 0, '', 0)) . '"';
if ($line->fk_prev_id != null) print ' readonly'; if ($line->fk_prev_id != null) print ' readonly';
print '></td>'; print '></td>';
@ -156,7 +156,7 @@ $coldisplay=-1; // We remove first td
if ($inputalsopricewithtax) if ($inputalsopricewithtax)
{ {
$coldisplay++; $coldisplay++;
print '<td align="right"><input type="text" class="flat right" size="5" id="price_ttc" name="price_ttc" value="'.(isset($line->pu_ttc)?price($line->pu_ttc,0,'',0):'').'"'; print '<td class="right"><input type="text" class="flat right" size="5" id="price_ttc" name="price_ttc" value="'.(isset($line->pu_ttc)?price($line->pu_ttc, 0, '', 0):'').'"';
if ($line->fk_prev_id != null) print ' readonly'; if ($line->fk_prev_id != null) print ' readonly';
print '></td>'; print '></td>';
} }
@ -200,9 +200,12 @@ $coldisplay=-1; // We remove first td
} }
if (! empty($usemargins)) if (! empty($usemargins))
{ {
if (!empty($user->rights->margins->creer)) {
?>
<td class="margininfos right">
<?php
$coldisplay++;
?> ?>
<?php if (!empty($user->rights->margins->creer)) { ?>
<td class="margininfos right"><?php $coldisplay++; ?>
<!-- For predef product --> <!-- For predef product -->
<?php if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { ?> <?php if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { ?>
<select id="fournprice_predef" name="fournprice_predef" class="flat right" style="display: none;"></select> <select id="fournprice_predef" name="fournprice_predef" class="flat right" style="display: none;"></select>
@ -211,7 +214,8 @@ $coldisplay=-1; // We remove first td
<input class="flat right" type="text" size="5" id="buying_price" name="buying_price" class="hideobject" value="<?php echo price($line->pa_ht, 0, '', 0); ?>"> <input class="flat right" type="text" size="5" id="buying_price" name="buying_price" class="hideobject" value="<?php echo price($line->pa_ht, 0, '', 0); ?>">
</td> </td>
<?php } ?> <?php } ?>
<?php if ($user->rights->margins->creer) { <?php
if ($user->rights->margins->creer) {
if (! empty($conf->global->DISPLAY_MARGIN_RATES)) if (! empty($conf->global->DISPLAY_MARGIN_RATES))
{ {
$margin_rate = (isset($_POST["np_marginRate"])?GETPOST("np_marginRate", "alpha", 2):(($line->pa_ht == 0)?'':price($line->marge_tx))); $margin_rate = (isset($_POST["np_marginRate"])?GETPOST("np_marginRate", "alpha", 2):(($line->pa_ht == 0)?'':price($line->marge_tx)));

View File

@ -204,13 +204,15 @@ $domData .= ' data-product_type="'.$line->product_type.'"';
<?php } ?> <?php } ?>
<td class="linecolqty nowrap right"><?php $coldisplay++; ?> <td class="linecolqty nowrap right"><?php $coldisplay++; ?>
<?php if ((($line->info_bits & 2) != 2) && $line->special_code != 3) { <?php
if ((($line->info_bits & 2) != 2) && $line->special_code != 3) {
// I comment this because it shows info even when not required // I comment this because it shows info even when not required
// for example always visible on invoice but must be visible only if stock module on and stock decrease option is on invoice validation and status is not validated // for example always visible on invoice but must be visible only if stock module on and stock decrease option is on invoice validation and status is not validated
// must also not be output for most entities (proposal, intervention, ...) // must also not be output for most entities (proposal, intervention, ...)
//if($line->qty > $line->stock) print img_picto($langs->trans("StockTooLow"),"warning", 'style="vertical-align: bottom;"')." "; //if($line->qty > $line->stock) print img_picto($langs->trans("StockTooLow"),"warning", 'style="vertical-align: bottom;"')." ";
echo price($line->qty, 0, '', 0, 0); // Yes, it is a quantity, not a price, but we just want the formating role of function price echo price($line->qty, 0, '', 0, 0); // Yes, it is a quantity, not a price, but we just want the formating role of function price
} else echo '&nbsp;'; ?> } else echo '&nbsp;';
?>
</td> </td>
<?php <?php
@ -308,9 +310,13 @@ $domData .= ' data-product_type="'.$line->product_type.'"';
<?php } else { ?> <?php } else { ?>
<td <?php echo (($conf->browser->layout != 'phone' && empty($disablemove)) ?' class="linecolmove tdlineupdown center"':' class="linecolmove center"'); ?>><?php $coldisplay++; ?></td> <td <?php echo (($conf->browser->layout != 'phone' && empty($disablemove)) ?' class="linecolmove tdlineupdown center"':' class="linecolmove center"'); ?>><?php $coldisplay++; ?></td>
<?php } ?> <?php } ?>
<?php } else { ?> <?php
} else {
?>
<td colspan="3"><?php $coldisplay=$coldisplay+3; ?></td> <td colspan="3"><?php $coldisplay=$coldisplay+3; ?></td>
<?php } ?> <?php
}
?>
<?php if($action == 'selectlines'){ ?> <?php if($action == 'selectlines'){ ?>
<td class="linecolcheck center"><input type="checkbox" class="linecheckbox" name="line_checkbox[<?php echo $i+1; ?>]" value="<?php echo $line->id; ?>" ></td> <td class="linecolcheck center"><input type="checkbox" class="linecheckbox" name="line_checkbox[<?php echo $i+1; ?>]" value="<?php echo $line->id; ?>" ></td>
<?php } ?> <?php } ?>

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2012 Nicolas Villa aka Boyquotes http://informetic.fr /* Copyright (C) 2012 Nicolas Villa aka Boyquotes http://informetic.fr
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2016 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2013-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* 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
@ -28,6 +29,7 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/cron/class/cronjob.class.php'; require_once DOL_DOCUMENT_ROOT.'/cron/class/cronjob.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/cron.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/cron.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array("admin","cron","bills","members")); $langs->loadLangs(array("admin","cron","bills","members"));
@ -444,7 +446,7 @@ if ($num > 0)
print '<tr class="oddeven">'; print '<tr class="oddeven">';
// Ref // Ref
print '<td class="nowrap">'; print '<td class="nowraponall">';
print $object->getNomUrl(1); print $object->getNomUrl(1);
print '</td>'; print '</td>';

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