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

This commit is contained in:
Lionel VESSILLER 2019-02-08 14:20:21 +01:00
commit a207877e2d
160 changed files with 2984 additions and 2542 deletions

View File

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

View File

@ -17,6 +17,26 @@ Following changes may create regressions for some external modules, but were nec
***** ChangeLog for 9.0.1 compared to 9.0.0 *****
FIX: #10381
FIX: #10460 compatibility with MariaDB 10.4
FIX: #10485
FIX: add fk_unit on addline action
FIX: better test on fetch
FIX: Default language of company is not set
FIX: error report not returned
FIX: expedition: reset status on rollback + replace hardcoded status with const
FIX: line edit template: keep fk_parent_line
FIX: Missing province in export of invoice
FIX: must fetch member in current entity
FIX: Price in combo list of service does not use the correct price level
FIX: supplier invoice payment total doesnt care about deposit or credit
FIX: supplier invoice product stats total ht is line total not invoice total
FIX: Translation not loaded by scheduled jobs
FIX: wrong merged conflict
FIX: wrong tests on fetch
NEW: Add protection to avoid packaging if files non indexed exists into
***** ChangeLog for 9.0.0 compared to 8.0.0 *****
For Users:
NEW: Stable module: DAV (WebDAV only for the moment)

View File

@ -387,6 +387,15 @@ if ($nboftargetok) {
#-----------------------
if ($CHOOSEDTARGET{'-CHKSUM'})
{
$ret=`git ls-files . --exclude-standard --others`;
if ($ret)
{
print "Some files exists in source directory and are not indexed neither excluded in .gitignore.\n";
print $ret;
print "Canceled.\n";
exit;
}
print 'Create xml check file with md5 checksum with command php '.$SOURCE.'/build/generate_filelist_xml.php release='.$MAJOR.'.'.$MINOR.'.'.$BUILD."\n";
$ret=`php $SOURCE/build/generate_filelist_xml.php release=$MAJOR.$MINOR.$BUILD`;
print $ret."\n";

View File

@ -20,8 +20,8 @@
*/
/**
* \file dev/initdata/generate-order.php
* \brief Script example to inject random orders (for load tests)
* \file dev/initdata/generate-order.php
* \brief Script example to inject random orders (for load tests)
*/
// Test si mode batch
@ -113,13 +113,13 @@ $societesid = array();
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe where client in (1, 3)";
$resql=$db->query($sql);
if ($resql) {
$num_thirdparties = $db->num_rows($resql);
$i = 0;
while ($i < $num_thirdparties) {
$i++;
$row = $db->fetch_row($resql);
$societesid[$i] = $row[0];
}
$num_thirdparties = $db->num_rows($resql);
$i = 0;
while ($i < $num_thirdparties) {
$i++;
$row = $db->fetch_row($resql);
$societesid[$i] = $row[0];
}
}
else { print "err"; }
@ -127,35 +127,32 @@ $commandesid = array();
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."commande";
$resql=$db->query($sql);
if ($resql) {
$num = $db->num_rows($resql);
$i = 0;
while ($i < $num) {
$i++;
$row = $db->fetch_row($resql);
$commandesid[$i] = $row[0];
}
$num = $db->num_rows($resql);
$i = 0;
while ($i < $num) {
$i++;
$row = $db->fetch_row($resql);
$commandesid[$i] = $row[0];
}
}
else { print "err"; }
$prodids = array();
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."product WHERE tosell=1";
$resql = $db->query($sql);
if ($resql)
{
$num_prods = $db->num_rows($resql);
$i = 0;
while ($i < $num_prods)
{
$i++;
if ($resql) {
$num_prods = $db->num_rows($resql);
$i = 0;
while ($i < $num_prods) {
$i++;
$row = $db->fetch_row($resql);
$prodids[$i] = $row[0];
$row = $db->fetch_row($resql);
$prodids[$i] = $row[0];
}
}
print "Build ".GEN_NUMBER_COMMANDE." orders\n";
for ($s = 0 ; $s < GEN_NUMBER_COMMANDE ; $s++)
{
@ -173,18 +170,18 @@ for ($s = 0 ; $s < GEN_NUMBER_COMMANDE ; $s++)
$object->cond_reglement_id = mt_rand(0, 2);
$object->more_reglement_id = mt_rand(0, 7);
$object->availability_id = mt_rand(0, 1);
$listofuserid=array(12,13,16);
$fuser = new User($db);
$fuser->fetch($listofuserid[mt_rand(0, 2)]);
$fuser->getRights();
$db->begin();
$result=$object->create($fuser);
if ($result >= 0)
{
if ($result >= 0)
{
$nbp = mt_rand(2, 5);
$xnbp = 0;
while ($xnbp < $nbp)
@ -200,23 +197,23 @@ for ($s = 0 ; $s < GEN_NUMBER_COMMANDE ; $s++)
$xnbp++;
}
$result=$object->valid($fuser);
if ($result > 0)
{
$result=$object->valid($fuser);
if ($result > 0)
{
$db->commit();
print " OK with ref ".$object->ref."\n";
}
else
{
}
else
{
print " KO\n";
$db->rollback();
dol_print_error($db, $object->error);
}
}
else
{
$db->rollback();
dol_print_error($db, $object->error);
}
}
else
{
print " KO\n";
$db->rollback();
dol_print_error($db, $object->error);
}
$db->rollback();
dol_print_error($db, $object->error);
}
}

View File

@ -170,6 +170,8 @@
<!-- Disabled as this does not support tab -->
<!-- <rule ref="Generic.WhiteSpace.ScopeIndent" /> -->
<rule ref="Squiz.WhiteSpace.ScopeClosingBrace.Indent" />
<!-- There MUST NOT be trailing whitespace at the end of non-blank lines. -->
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace">
<properties>

View File

@ -541,8 +541,8 @@ if ($id)
print $valuetoshow;
}
print '</td>';
}
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') $alabelisused=1;
}
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') $alabelisused=1;
}
print '<td>';

View File

@ -495,8 +495,8 @@ if ($id)
elseif (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value]);
else print $valuetoshow;
print '</td>';
}
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') $alabelisused=1;
}
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') $alabelisused=1;
}
print '<td>';

View File

@ -444,8 +444,8 @@ if ($id)
elseif (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value]);
else print $valuetoshow;
print '</td>';
}
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') $alabelisused=1;
}
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') $alabelisused=1;
}
print '<td>';

View File

@ -280,7 +280,7 @@ if (! empty($search_credit)) {
if (! empty($search_lettering_code)) {
$filter['t.lettering_code'] = $search_lettering_code;
$param .= '&search_lettering_code=' . urlencode($search_lettering_code);
}
}
if ($action == 'delbookkeeping') {

View File

@ -326,11 +326,11 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
dol_syslog('htdocs/accountancy/expensereport/index.php');
$resql = $db->query($sql);
if ($resql) {
$num = $db->num_rows($resql);
$num = $db->num_rows($resql);
while ($row = $db->fetch_row($resql)) {
print '<tr><td>' . $row[0] . '</td>';
for($i = 1; $i <= 12; $i ++) {
for($i = 1; $i <= 12; $i ++) {
print '<td class="right">' . price($row[$i]) . '</td>';
}
print '<td class="right"><b>' . price($row[13]) . '</b></td>';

View File

@ -328,15 +328,15 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
while ($row = $db->fetch_row($resql)) {
print '<tr><td>' . $row[0] . '</td>';
for($i = 1; $i <= 12; $i ++) {
for($i = 1; $i <= 12; $i ++) {
print '<td class="right">' . price($row[$i]) . '</td>';
}
print '<td class="right"><b>' . price($row[13]) . '</b></td>';
print '</tr>';
}
$db->free($resql);
$db->free($resql);
} else {
print $db->lasterror(); // Show last sql error
print $db->lasterror(); // Show last sql error
}
print "</table>\n";
print '</div>';

View File

@ -2767,7 +2767,7 @@ class Adherent extends CommonObject
$outputlangs = new Translate('', $conf);
$outputlangs->setDefaultLang(empty($adherent->thirdparty->default_lang) ? $mysoc->default_lang : $adherent->thirdparty->default_lang);
$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;
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION;

View File

@ -105,14 +105,14 @@ class Subscription extends CommonObject
$sql = "INSERT INTO ".MAIN_DB_PREFIX."subscription (fk_adherent, fk_type, datec, dateadh, datef, subscription, note)";
if ($this->fk_type == null) {
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
$member=new Adherent($this->db);
$result=$member->fetch($this->fk_adherent);
$type=$member->typeid;
} else {
$type=$this->fk_type;
}
if ($this->fk_type == null) {
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
$member=new Adherent($this->db);
$result=$member->fetch($this->fk_adherent);
$type=$member->typeid;
} else {
$type=$this->fk_type;
}
$sql.= " VALUES (".$this->fk_adherent.", '".$type."', '".$this->db->idate($now)."',";
$sql.= " '".$this->db->idate($this->dateh)."',";
$sql.= " '".$this->db->idate($this->datef)."',";

View File

@ -157,15 +157,16 @@ if ($mode)
'lastdate'=>$db->jdate($obj->lastdate)
);
}
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"))),
'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")),
'nb'=>$obj->nb,
'lastdate'=>$db->jdate($obj->lastdate)
$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"))),
'label2'=>($obj->label2?$obj->label2:$langs->trans("Unknown")),
'nb'=>$obj->nb,
'lastdate'=>$db->jdate($obj->lastdate)
);
}
}
if ($mode == 'memberbystate')
{
$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"))),

View File

@ -673,7 +673,7 @@ if ($rowid > 0)
$sql.= " c.datef,";
$sql.= " c.fk_bank,";
$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.= " 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";
@ -726,8 +726,9 @@ if ($rowid > 0)
$accountstatic->id=$objp->baid;
$accountstatic->number=$objp->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->fetch($objp->fk_accountancy_journal);

View File

@ -308,17 +308,17 @@ if ($rowid && $action != 'edit')
print '<div class="underbanner clearboth"></div>';
print '<table class="border" width="100%">';
// Type
print '<tr>';
print '<td class="titlefield">'.$langs->trans("Type").'</td>';
print '<td class="valeur">';
if ( ! empty($object->fk_type) ) {
$adht->fetch($object->fk_type);
print $adht->getNomUrl(1);
} else {
print $langs->trans("NoType");
}
if (! empty($object->fk_type) ) {
$adht->fetch($object->fk_type);
print $adht->getNomUrl(1);
} else {
print $langs->trans("NoType");
}
print '</td></tr>';
// Member

View File

@ -460,7 +460,7 @@ while ($i < min($num, $limit))
$adherent->login=$obj->login;
$adherent->photo=$obj->photo;
$adht = new AdherentType($db);
$adht = new AdherentType($db);
$adht->fetch($obj->fk_type);
print '<tr class="oddeven">';
@ -471,13 +471,13 @@ while ($i < min($num, $limit))
print '<td>'.$subscription->getNomUrl(1).'</td>';
if (! $i) $totalarray['nbfield']++;
}
// Type
if (! empty($arrayfields['d.fk_type']['checked']))
// Type
if (! empty($arrayfields['d.fk_type']['checked']))
{
print '<td>';
if ( ! empty($obj->fk_type) ) print $adht->getNomUrl(1);
print '</td>';
if (! $i) $totalarray['nbfield']++;
print '<td>';
if ( ! empty($obj->fk_type) ) print $adht->getNomUrl(1);
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
// Lastname

View File

@ -1117,19 +1117,19 @@ if ($id)
if ($id == 2) // Special cas for state page
{
if ($fieldlist[$field]=='region_id') { $valuetoshow='&nbsp;'; $showfield=1; }
if ($fieldlist[$field]=='region') { $valuetoshow=$langs->trans("Country").'/'.$langs->trans("Region"); $showfield=1; }
if ($fieldlist[$field]=='region_id') { $valuetoshow='&nbsp;'; $showfield=1; }
if ($fieldlist[$field]=='region') { $valuetoshow=$langs->trans("Country").'/'.$langs->trans("Region"); $showfield=1; }
}
if ($valuetoshow != '')
{
print '<td'.($class?' class="'.$class.'"':'').'>';
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>';
elseif (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value]);
else print $valuetoshow;
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>';
elseif (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value]);
else print $valuetoshow;
print '</td>';
}
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') $alabelisused=1;
}
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') $alabelisused=1;
}
if ($id == 4) print '<td></td>';

View File

@ -127,7 +127,7 @@ if (($action == 'testsubscribe' || $action == 'testunsubscribe') && ! empty($con
if ($action == 'testunsubscribe')
{
$result=$mailmanspip->del_to_mailman($object);
if ($result < 0)
if ($result < 0)
{
$error++;
setEventMessages($mailmanspip->error, $mailmanspip->errors, 'errors');
@ -160,7 +160,7 @@ if (! empty($conf->global->ADHERENT_USE_MAILMAN))
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
dol_fiche_head($head, 'mailman', $langs->trans("Setup"), 0, 'user');
//$link=img_picto($langs->trans("Active"),'tick').' ';
$link='<a href="'.$_SERVER["PHP_SELF"].'?action=unset&value=0&name=ADHERENT_USE_MAILMAN">';
//$link.=$langs->trans("Disable");
@ -200,10 +200,10 @@ if (! empty($conf->global->ADHERENT_USE_MAILMAN))
</script>';
form_constantes($constantes, 2);
print '*'.$langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
print '%LISTE%, %MAILMAN_ADMINPW%, %EMAIL% <br>';
dol_fiche_end();
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Update").'" name="update"></div>';
@ -213,7 +213,7 @@ if (! empty($conf->global->ADHERENT_USE_MAILMAN))
else
{
dol_fiche_head($head, 'mailman', $langs->trans("Setup"), 0, 'user');
$link='<a href="'.$_SERVER["PHP_SELF"].'?action=set&value=1&name=ADHERENT_USE_MAILMAN">';
//$link.=img_$langs->trans("Activate")
$link.=img_picto($langs->trans("Disabled"), 'switch_off');

View File

@ -219,12 +219,12 @@ if ($action == 'add')
$menu->fk_menu=GETPOST('menuId', 'int');
}
else
{
if (GETPOST('type', 'alpha') == 'top') $menu->fk_menu=0;
else $menu->fk_menu=-1;
$menu->fk_mainmenu=$mainmenu;
$menu->fk_leftmenu=$leftmenu;
}
{
if (GETPOST('type', 'alpha') == 'top') $menu->fk_menu=0;
else $menu->fk_menu=-1;
$menu->fk_mainmenu=$mainmenu;
$menu->fk_leftmenu=$leftmenu;
}
$result=$menu->create($user);
if ($result > 0)

View File

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

View File

@ -98,17 +98,16 @@ print '<br>';
$arrayofsocialnetworks=array('jabber'=>'Jabber', 'skype'=>'Skype', 'twitter'=>'Twitter', 'facebook'=>'Facebook');
foreach($arrayofsocialnetworks as $snkey => $snlabel)
{
$consttocheck = 'SOCIALNETWORKS_'.strtoupper($snkey);
if ($conf->use_javascript_ajax) {
$link = ajax_constantonoff($consttocheck);
} else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
$link = $form->selectarray($consttocheck, $arrval, $conf->global->$consttocheck);
}
print $langs->trans('EnableFeatureFor', $snlabel).' '.$link.'<br><br>';
foreach($arrayofsocialnetworks as $snkey => $snlabel) {
$consttocheck = 'SOCIALNETWORKS_'.strtoupper($snkey);
if ($conf->use_javascript_ajax) {
$link = ajax_constantonoff($consttocheck);
} else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
$link = $form->selectarray($consttocheck, $arrval, $conf->global->$consttocheck);
}
print $langs->trans('EnableFeatureFor', $snlabel).' '.$link.'<br><br>';
}

View File

@ -35,14 +35,15 @@ $what=GETPOST('what', 'alpha');
$export_type=GETPOST('export_type', 'alpha');
$file=GETPOST('filename_template', 'alpha');
// Load variable for pagination
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
$sortfield = GETPOST('sortfield', 'alpha');
$sortorder = GETPOST('sortorder', 'alpha');
$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 (! $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();

View File

@ -478,8 +478,8 @@ if ($id)
}
else print $valuetoshow;
print '</td>';
}
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') $alabelisused=1;
}
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') $alabelisused=1;
}
print '<td colspan="4">';

View File

@ -89,15 +89,14 @@ foreach ($modulesdir as $dir)
$obj = 'facture';
}
if ($module == 'ficheinter') {
$obj = 'fichinter';
$part = 'fichinter';
$module='fichinter';
}
$obj = 'fichinter';
$part = 'fichinter';
$module='fichinter';
}
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
*

View File

@ -921,8 +921,8 @@ class BlockedLog
* @param int $beforeid ID of a record
* @return string Hash of previous record (if beforeid is defined) or hash of last record (if beforeid is 0)
*/
public function getPreviousHash($withlock = 0, $beforeid = 0)
{
public function getPreviousHash($withlock = 0, $beforeid = 0)
{
global $conf;
$previoussignature='';

View File

@ -55,8 +55,8 @@ class Categories extends DolibarrApi
*/
function __construct()
{
global $db, $conf;
$this->db = $db;
global $db, $conf;
$this->db = $db;
$this->category = new Categorie($this->db);
}
@ -67,25 +67,25 @@ class Categories extends DolibarrApi
*
* @param int $id ID of category
* @return array|mixed data without useless information
*
*
* @throws RestException
*/
function get($id)
{
if(! DolibarrApiAccess::$user->rights->categorie->lire) {
throw new RestException(401);
}
if (! DolibarrApiAccess::$user->rights->categorie->lire) {
throw new RestException(401);
}
$result = $this->category->fetch($id);
if( ! $result ) {
if ( ! $result ) {
throw new RestException(404, 'category not found');
}
if( ! DolibarrApi::_checkAccessToResource('category', $this->category->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
if ( ! DolibarrApi::_checkAccessToResource('category', $this->category->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
return $this->_cleanObjectDatas($this->category);
return $this->_cleanObjectDatas($this->category);
}
/**
@ -101,7 +101,7 @@ class Categories extends DolibarrApi
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
* @return array Array of category objects
*
* @throws RestException
* @throws RestException
*/
function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $type = '', $sqlfilters = '')
{
@ -109,9 +109,9 @@ class Categories extends DolibarrApi
$obj_ret = array();
if(! DolibarrApiAccess::$user->rights->categorie->lire) {
throw new RestException(401);
}
if(! DolibarrApiAccess::$user->rights->categorie->lire) {
throw new RestException(401);
}
$sql = "SELECT t.rowid";
$sql.= " FROM ".MAIN_DB_PREFIX."categorie as t";
@ -127,7 +127,7 @@ class Categories extends DolibarrApi
{
throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters);
}
$regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
$regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
$sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
}
@ -145,7 +145,7 @@ class Categories extends DolibarrApi
$result = $db->query($sql);
if ($result)
{
$i=0;
$i=0;
$num = $db->num_rows($result);
$min = min($num, ($limit <= 0 ? $num : $limit));
while ($i < $min)
@ -164,7 +164,7 @@ class Categories extends DolibarrApi
if( ! count($obj_ret)) {
throw new RestException(404, 'No category found');
}
return $obj_ret;
return $obj_ret;
}
/**
@ -176,8 +176,8 @@ class Categories extends DolibarrApi
function post($request_data = null)
{
if(! DolibarrApiAccess::$user->rights->categorie->creer) {
throw new RestException(401);
}
throw new RestException(401);
}
// Check mandatory fields
$result = $this->_validate($request_data);
@ -201,17 +201,17 @@ class Categories extends DolibarrApi
function put($id, $request_data = null)
{
if(! DolibarrApiAccess::$user->rights->categorie->creer) {
throw new RestException(401);
}
throw new RestException(401);
}
$result = $this->category->fetch($id);
if( ! $result ) {
throw new RestException(404, 'category not found');
}
if( ! DolibarrApi::_checkAccessToResource('category', $this->category->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
if ( ! DolibarrApi::_checkAccessToResource('category', $this->category->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
foreach($request_data as $field => $value) {
if ($field == 'id') continue;
@ -224,7 +224,7 @@ class Categories extends DolibarrApi
}
else
{
throw new RestException(500, $this->category->error);
throw new RestException(500, $this->category->error);
}
}
@ -237,16 +237,16 @@ class Categories extends DolibarrApi
function delete($id)
{
if(! DolibarrApiAccess::$user->rights->categorie->supprimer) {
throw new RestException(401);
}
throw new RestException(401);
}
$result = $this->category->fetch($id);
if( ! $result ) {
throw new RestException(404, 'category not found');
}
if( ! DolibarrApi::_checkAccessToResource('category', $this->category->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
if ( ! DolibarrApi::_checkAccessToResource('category', $this->category->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
if (! $this->category->delete(DolibarrApiAccess::$user)) {
throw new RestException(401, 'error when delete category');

View File

@ -1291,7 +1291,7 @@ class ActionComm extends CommonObject
if (! empty($this->location))
$tooltip .= '<br><b>' . $langs->trans('Location') . ':</b> ' . $this->location;
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='';
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE) && $this->type_color)
$linkclose = ' style="background-color:#'.$this->type_color.'"';

View File

@ -58,7 +58,7 @@ class AgendaEvents extends DolibarrApi
*
* @param int $id ID of Agenda Events
* @return array|mixed Data without useless information
*
*
* @throws RestException
*/
function get($id)
@ -83,7 +83,7 @@ class AgendaEvents extends DolibarrApi
$result = $this->actioncomm->fetch_optionals();
$this->actioncomm->fetchObjectLinked();
return $this->_cleanObjectDatas($this->actioncomm);
return $this->_cleanObjectDatas($this->actioncomm);
}
/**
@ -116,7 +116,7 @@ class AgendaEvents extends DolibarrApi
// If the internal user must only see his customers, force searching by him
$search_sale = 0;
if (! DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) $search_sale = DolibarrApiAccess::$user->id;
if (empty($conf->societe->enabled)) $search_sale = 0; // If module thirdparty not enabled, sale representative is something that does not exists
if (empty($conf->societe->enabled)) $search_sale = 0; // If module thirdparty not enabled, sale representative is something that does not exists
$sql = "SELECT t.id as rowid";
if (! empty($conf->societe->enabled))
@ -160,7 +160,7 @@ class AgendaEvents extends DolibarrApi
if ($result)
{
$i=0;
$i=0;
$num = $db->num_rows($result);
$min = min($num, ($limit <= 0 ? $num : $limit));
while ($i < $min)
@ -179,7 +179,7 @@ class AgendaEvents extends DolibarrApi
if ( ! count($obj_ret)) {
throw new RestException(404, 'No Agenda Event found');
}
return $obj_ret;
return $obj_ret;
}
/**
@ -190,12 +190,12 @@ class AgendaEvents extends DolibarrApi
*/
function post($request_data = null)
{
if (! DolibarrApiAccess::$user->rights->agenda->myactions->create) {
throw new RestException(401, "Insuffisant rights to create your Agenda Event");
}
if (! DolibarrApiAccess::$user->rights->agenda->allactions->create && DolibarrApiAccess::$user->id != $request_data['userownerid']) {
throw new RestException(401, "Insuffisant rights to create an Agenda Event for owner id ".$request_data['userownerid'].' Your id is '.DolibarrApiAccess::$user->id);
}
if (! DolibarrApiAccess::$user->rights->agenda->myactions->create) {
throw new RestException(401, "Insuffisant rights to create your Agenda Event");
}
if (! DolibarrApiAccess::$user->rights->agenda->allactions->create && DolibarrApiAccess::$user->id != $request_data['userownerid']) {
throw new RestException(401, "Insuffisant rights to create an Agenda Event for owner id ".$request_data['userownerid'].' Your id is '.DolibarrApiAccess::$user->id);
}
// Check mandatory fields
$result = $this->_validate($request_data);
@ -229,21 +229,21 @@ class AgendaEvents extends DolibarrApi
/*
function put($id, $request_data = null)
{
if (! DolibarrApiAccess::$user->rights->agenda->myactions->create) {
throw new RestException(401, "Insuffisant rights to create your Agenda Event");
}
if (! DolibarrApiAccess::$user->rights->agenda->allactions->create && DolibarrApiAccess::$user->id != $request_data['userownerid']) {
throw new RestException(401, "Insuffisant rights to create an Agenda Event for owner id ".$request_data['userownerid'].' Your id is '.DolibarrApiAccess::$user->id);
}
if (! DolibarrApiAccess::$user->rights->agenda->myactions->create) {
throw new RestException(401, "Insuffisant rights to create your Agenda Event");
}
if (! DolibarrApiAccess::$user->rights->agenda->allactions->create && DolibarrApiAccess::$user->id != $request_data['userownerid']) {
throw new RestException(401, "Insuffisant rights to create an Agenda Event for owner id ".$request_data['userownerid'].' Your id is '.DolibarrApiAccess::$user->id);
}
$result = $this->actioncomm->fetch($id);
if ( ! $result ) {
throw new RestException(404, 'actioncomm not found');
}
if ( ! DolibarrApi::_checkAccessToResource('actioncomm',$this->actioncomm->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
if ( ! DolibarrApi::_checkAccessToResource('actioncomm',$this->actioncomm->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
foreach($request_data as $field => $value) {
if ($field == 'id') continue;
$this->actioncomm->$field = $value;
@ -266,13 +266,13 @@ class AgendaEvents extends DolibarrApi
function delete($id)
{
if(! DolibarrApiAccess::$user->rights->agenda->myactions->delete) {
throw new RestException(401, "Insuffisant rights to delete your Agenda Event");
}
throw new RestException(401, "Insuffisant rights to delete your Agenda Event");
}
$result = $this->actioncomm->fetch($id);
if(! DolibarrApiAccess::$user->rights->agenda->allactions->delete && DolibarrApiAccess::$user->id != $this->actioncomm->userownerid) {
throw new RestException(401, "Insuffisant rights to delete an Agenda Event of owner id ".$request_data['userownerid'].' Your id is '.DolibarrApiAccess::$user->id);
throw new RestException(401, "Insuffisant rights to delete an Agenda Event of owner id ".$request_data['userownerid'].' Your id is '.DolibarrApiAccess::$user->id);
}
if( ! $result ) {

View File

@ -876,7 +876,7 @@ if ($object->id > 0)
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";
$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->dcon), 'day')."</td>\n";
print '<td width="20">&nbsp;</td>';
print '<td align="right" class="nowraponall">';
print '<td class="nowraponall right">';
print $contrat->getLibStatut(4);
print "</td>\n";
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="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 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>';
$i++;
@ -1110,7 +1110,7 @@ if ($object->id > 0)
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 ($invoicetemplate->LibStatut($invoicetemplate->frequency, $invoicetemplate->suspended, 5, 0));
print '</td>';
@ -1205,7 +1205,7 @@ if ($object->id > 0)
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";
$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_company" size="12" value="'.$search_company.'"></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";
$i = 0;

View File

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

View File

@ -876,31 +876,31 @@ class AdvanceTargetingMailing extends CommonObject
foreach($extralabels as $key=>$val) {
if (($extrafields->attribute_type[$key] == 'varchar') ||
($extrafields->attribute_type[$key] == 'text')) {
if (!empty($arrayquery['options_'.$key])) {
$sqlwhere[]= " (tse.".$key." LIKE '".$arrayquery['options_'.$key]."')";
}
} elseif (($extrafields->attribute_type[$key] == 'int') ||
($extrafields->attribute_type[$key] == 'double')) {
if (!empty($arrayquery['options_'.$key.'_max'])) {
$sqlwhere[]= " (tse.".$key." >= ".$arrayquery['options_'.$key.'_max']." AND tse.".$key." <= ".$arrayquery['options_'.$key.'_min'].")";
}
} elseif (($extrafields->attribute_type[$key] == 'date') ||
($extrafields->attribute_type[$key] == 'datetime')) {
if (!empty($arrayquery['options_'.$key.'_end_dt'])){
$sqlwhere[]= " (tse.".$key." >= '".$this->db->idate($arrayquery['options_'.$key.'_st_dt'])."' AND tse.".$key." <= '".$this->db->idate($arrayquery['options_'.$key.'_end_dt'])."')";
}
}elseif ($extrafields->attribute_type[$key] == 'boolean') {
if ($arrayquery['options_'.$key]!=''){
$sqlwhere[]= " (tse.".$key." = ".$arrayquery['options_'.$key].")";
}
}else{
if (is_array($arrayquery['options_'.$key])) {
$sqlwhere[]= " (tse.".$key." IN ('".implode("','", $arrayquery['options_'.$key])."'))";
} elseif (!empty($arrayquery['options_'.$key])) {
$sqlwhere[]= " (tse.".$key." LIKE '".$arrayquery['options_'.$key]."')";
}
}
($extrafields->attribute_type[$key] == 'text')) {
if (!empty($arrayquery['options_'.$key])) {
$sqlwhere[]= " (tse.".$key." LIKE '".$arrayquery['options_'.$key]."')";
}
} elseif (($extrafields->attribute_type[$key] == 'int') ||
($extrafields->attribute_type[$key] == 'double')) {
if (!empty($arrayquery['options_'.$key.'_max'])) {
$sqlwhere[]= " (tse.".$key." >= ".$arrayquery['options_'.$key.'_max']." AND tse.".$key." <= ".$arrayquery['options_'.$key.'_min'].")";
}
} elseif (($extrafields->attribute_type[$key] == 'date') ||
($extrafields->attribute_type[$key] == 'datetime')) {
if (!empty($arrayquery['options_'.$key.'_end_dt'])){
$sqlwhere[]= " (tse.".$key." >= '".$this->db->idate($arrayquery['options_'.$key.'_st_dt'])."' AND tse.".$key." <= '".$this->db->idate($arrayquery['options_'.$key.'_end_dt'])."')";
}
} elseif ($extrafields->attribute_type[$key] == 'boolean') {
if ($arrayquery['options_'.$key]!=''){
$sqlwhere[]= " (tse.".$key." = ".$arrayquery['options_'.$key].")";
}
} else {
if (is_array($arrayquery['options_'.$key])) {
$sqlwhere[]= " (tse.".$key." IN ('".implode("','", $arrayquery['options_'.$key])."'))";
} elseif (!empty($arrayquery['options_'.$key])) {
$sqlwhere[]= " (tse.".$key." LIKE '".$arrayquery['options_'.$key]."')";
}
}
}
}
}

View File

@ -109,20 +109,19 @@ if (is_resource($handle))
print '<tr class="oddeven">';
$result=$db->query($sql);
if ($result)
{
$num = $db->num_rows($result);
if ($result) {
$num = $db->num_rows($result);
$i = 0;
$i = 0;
while ($i < $num )
while ($i < $num )
{
$obj = $db->fetch_object($result);
print '<td>'.img_object('', $mailmodule->picto).' '.$obj->label.'</td><td class="right">'.$obj->nb.'<td>';
$i++;
$obj = $db->fetch_object($result);
print '<td>'.img_object('', $mailmodule->picto).' '.$obj->label.'</td><td class="right">'.$obj->nb.'<td>';
$i++;
}
$db->free($result);
$db->free($result);
}
else
{
@ -154,45 +153,44 @@ $sql.= " FROM ".MAIN_DB_PREFIX."mailing as m";
$sql.= " ORDER BY m.date_creat DESC";
$sql.= " LIMIT ".$limit;
$result=$db->query($sql);
if ($result)
{
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="2">'.$langs->trans("LastMailings", $limit).'</td>';
print '<td align="center">'.$langs->trans("DateCreation").'</td>';
print '<td align="center">'.$langs->trans("NbOfEMails").'</td>';
print '<td class="right"><a href="'.DOL_URL_ROOT.'/comm/mailing/list.php">'.$langs->trans("AllEMailings").'</a></td></tr>';
if ($result) {
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="2">'.$langs->trans("LastMailings", $limit).'</td>';
print '<td align="center">'.$langs->trans("DateCreation").'</td>';
print '<td align="center">'.$langs->trans("NbOfEMails").'</td>';
print '<td class="right"><a href="'.DOL_URL_ROOT.'/comm/mailing/list.php">'.$langs->trans("AllEMailings").'</a></td></tr>';
$num = $db->num_rows($result);
if ($num > 0)
{
$i = 0;
while ($i < $num )
{
$obj = $db->fetch_object($result);
print '<tr class="oddeven">';
print '<td class="nowrap"><a href="card.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowEMail"), "email").' '.$obj->rowid.'</a></td>';
print '<td>'.dol_trunc($obj->titre, 38).'</td>';
print '<td align="center">'.dol_print_date($db->jdate($obj->date_creat), 'day').'</td>';
print '<td align="center">'.($obj->nbemail?$obj->nbemail:"0").'</td>';
$mailstatic=new Mailing($db);
print '<td class="right">'.$mailstatic->LibStatut($obj->statut, 5).'</td>';
print '</tr>';
$i++;
}
}
else
$num = $db->num_rows($result);
if ($num > 0)
{
print '<tr><td class="opacitymedium">'.$langs->trans("None").'</td></tr>';
$i = 0;
while ($i < $num )
{
$obj = $db->fetch_object($result);
print '<tr class="oddeven">';
print '<td class="nowrap"><a href="card.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowEMail"), "email").' '.$obj->rowid.'</a></td>';
print '<td>'.dol_trunc($obj->titre, 38).'</td>';
print '<td align="center">'.dol_print_date($db->jdate($obj->date_creat), 'day').'</td>';
print '<td align="center">'.($obj->nbemail?$obj->nbemail:"0").'</td>';
$mailstatic=new Mailing($db);
print '<td class="right">'.$mailstatic->LibStatut($obj->statut, 5).'</td>';
print '</tr>';
$i++;
}
}
print "</table><br>";
$db->free($result);
else
{
print '<tr><td class="opacitymedium">'.$langs->trans("None").'</td></tr>';
}
print "</table><br>";
$db->free($result);
}
else
{
dol_print_error($db);
dol_print_error($db);
}
@ -207,7 +205,7 @@ if ($langs->file_exists("html/spam.html", 0)) {
print '</div>';
print '<br>';
}
}
// End of page
llxFooter();

View File

@ -193,7 +193,7 @@ if ($result)
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" align="right">';
print '<td class="liste_titre right">';
$searchpicto=$form->showFilterAndCheckAddButtons(0);
print $searchpicto;
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("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);
print_liste_field_titre("Status", $_SERVER["PHP_SELF"], ($filteremail?"mc.statut":"m.statut"), $param, "", 'align="right"', $sortfield, $sortorder);
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', 'align="right"', $sortfield, $sortorder, 'maxwidthsearch ');
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"], "", '', '', 'class="right"', $sortfield, $sortorder, 'maxwidthsearch ');
print "</tr>\n";
@ -256,7 +256,7 @@ if ($result)
print '</td>';
// Status
print '<td align="right" class="nowrap">';
print '<td class="nowrap right">';
if ($filteremail)
{
print $email::libStatutDest($obj->sendstatut, 2);

View File

@ -184,11 +184,11 @@ class Proposals extends DolibarrApi
*/
function post($request_data = null)
{
if(! DolibarrApiAccess::$user->rights->propal->creer) {
throw new RestException(401, "Insuffisant rights");
}
// Check mandatory fields
$result = $this->_validate($request_data);
if(! DolibarrApiAccess::$user->rights->propal->creer) {
throw new RestException(401, "Insuffisant rights");
}
// Check mandatory fields
$result = $this->_validate($request_data);
foreach($request_data as $field => $value) {
$this->propal->$field = $value;
@ -218,24 +218,24 @@ class Proposals extends DolibarrApi
*/
function getLines($id)
{
if(! DolibarrApiAccess::$user->rights->propal->lire) {
throw new RestException(401);
}
if(! DolibarrApiAccess::$user->rights->propal->lire) {
throw new RestException(401);
}
$result = $this->propal->fetch($id);
if( ! $result ) {
throw new RestException(404, 'Commercial Proposal not found');
}
$result = $this->propal->fetch($id);
if( ! $result ) {
throw new RestException(404, 'Commercial Proposal not found');
}
if( ! DolibarrApi::_checkAccessToResource('propal', $this->propal->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
$this->propal->getLinesArray();
$result = array();
foreach ($this->propal->lines as $line) {
array_push($result, $this->_cleanObjectDatas($line));
}
return $result;
if( ! DolibarrApi::_checkAccessToResource('propal', $this->propal->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
$this->propal->getLinesArray();
$result = array();
foreach ($this->propal->lines as $line) {
array_push($result, $this->_cleanObjectDatas($line));
}
return $result;
}
/**
@ -266,7 +266,7 @@ class Proposals extends DolibarrApi
$request_data = (object) $request_data;
$updateRes = $this->propal->addline(
$updateRes = $this->propal->addline(
$request_data->desc,
$request_data->subprice,
$request_data->qty,
@ -293,15 +293,14 @@ class Proposals extends DolibarrApi
$request_data->origin_id,
$request_data->multicurrency_subprice,
$request_data->fk_remise_except
);
);
if ($updateRes > 0) {
return $updateRes;
}
else {
throw new RestException(400, $this->propal->error);
}
}
if ($updateRes > 0) {
return $updateRes;
} else {
throw new RestException(400, $this->propal->error);
}
}
/**
* Update a line of given commercial proposal
@ -360,14 +359,14 @@ class Proposals extends DolibarrApi
isset($request_data->array_options)?$request_data->array_options:$propalline->array_options,
isset($request_data->fk_unit)?$request_data->fk_unit:$propalline->fk_unit,
isset($request_data->multicurrency_subprice)?$request_data->multicurrency_subprice:$propalline->subprice
);
);
if ($updateRes > 0) {
$result = $this->get($id);
unset($result->line);
return $this->_cleanObjectDatas($result);
}
return false;
if ($updateRes > 0) {
$result = $this->get($id);
unset($result->line);
return $this->_cleanObjectDatas($result);
}
return false;
}
/**
@ -386,7 +385,7 @@ class Proposals extends DolibarrApi
function deleteLine($id, $lineid)
{
if(! DolibarrApiAccess::$user->rights->propal->creer) {
throw new RestException(401);
throw new RestException(401);
}
$result = $this->propal->fetch($id);
@ -417,12 +416,12 @@ class Proposals extends DolibarrApi
* @param array $request_data Datas
*
* @return int
*/
*/
function put($id, $request_data = null)
{
if(! DolibarrApiAccess::$user->rights->propal->creer) {
throw new RestException(401);
}
if(! DolibarrApiAccess::$user->rights->propal->creer) {
throw new RestException(401);
}
$result = $this->propal->fetch($id);
if( ! $result ) {
@ -654,35 +653,35 @@ class Proposals extends DolibarrApi
*/
function setinvoiced($id)
{
if(! DolibarrApiAccess::$user->rights->propal->creer) {
throw new RestException(401);
}
$result = $this->propal->fetch($id);
if( ! $result ) {
throw new RestException(404, 'Commercial Proposal not found');
}
if (! DolibarrApiAccess::$user->rights->propal->creer) {
throw new RestException(401);
}
$result = $this->propal->fetch($id);
if ( ! $result ) {
throw new RestException(404, 'Commercial Proposal not found');
}
if( ! DolibarrApi::_checkAccessToResource('propal', $this->propal->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
if ( ! DolibarrApi::_checkAccessToResource('propal', $this->propal->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
$result = $this->propal->classifyBilled(DolibarrApiAccess::$user );
if ($result < 0) {
throw new RestException(500, 'Error : '.$this->propal->error);
}
$result = $this->propal->classifyBilled(DolibarrApiAccess::$user );
if ($result < 0) {
throw new RestException(500, 'Error : '.$this->propal->error);
}
$result = $this->propal->fetch($id);
if( ! $result ) {
throw new RestException(404, 'Proposal not found');
}
$result = $this->propal->fetch($id);
if ( ! $result ) {
throw new RestException(404, 'Proposal not found');
}
if( ! DolibarrApi::_checkAccessToResource('propal', $this->propal->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
if( ! DolibarrApi::_checkAccessToResource('propal', $this->propal->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
$this->propal->fetchObjectLinked();
$this->propal->fetchObjectLinked();
return $this->_cleanObjectDatas($this->propal);
return $this->_cleanObjectDatas($this->propal);
}

View File

@ -1063,13 +1063,13 @@ class Propal extends CommonObject
for ($i=0;$i<$num;$i++)
{
if (! is_object($this->lines[$i])) // If this->lines is not array of objects, coming from REST API
{ // Convert into object this->lines[$i].
$line = (object) $this->lines[$i];
}
else
{
$line = $this->lines[$i];
}
{ // Convert into object this->lines[$i].
$line = (object) $this->lines[$i];
}
else
{
$line = $this->lines[$i];
}
// Reset fk_parent_line for line that are not child lines or special product
if (($line->product_type != 9 && empty($line->fk_parent_line)) || $line->product_type == 9) {
$fk_parent_line = 0;

View File

@ -430,7 +430,7 @@ if (! empty($conf->propal->enabled))
print '&nbsp;';
print '</td>';
print '<td width="16" align="right" class="nobordernopadding">';
print '<td width="16" class="nobordernopadding right">';
$filename=dol_sanitizeFileName($obj->ref);
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
@ -503,7 +503,7 @@ if (! empty($conf->propal->enabled))
print '&nbsp;';
print '</td>';
print '<td width="16" align="right" class="nobordernopadding">';
print '<td width="16" class="nobordernopadding right">';
$filename=dol_sanitizeFileName($obj->ref);
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
$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 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>';
$i++;

View File

@ -619,21 +619,21 @@ if ($resql)
if (! empty($arrayfields['p.total_ht']['checked']))
{
// 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 '</td>';
}
if (! empty($arrayfields['p.total_vat']['checked']))
{
// 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 '</td>';
}
if (! empty($arrayfields['p.total_ttc']['checked']))
{
// 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 '</td>';
}
@ -670,7 +670,7 @@ if ($resql)
// Status
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');
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.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['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_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_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_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, '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, '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['sale_representative']['checked'])) print_liste_field_titre($arrayfields['sale_representative']['label'], $_SERVER["PHP_SELF"], "", "", "$param", '', $sortfield, $sortorder);
// Extra fields
@ -711,7 +711,7 @@ if ($resql)
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.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 '</tr>'."\n";
@ -753,7 +753,7 @@ if ($resql)
print '</td>';
}
// Other picto tool
print '<td width="16" align="right" class="nobordernopadding">';
print '<td width="16" class="nobordernopadding right">';
$filename=dol_sanitizeFileName($obj->ref);
$filedir=$conf->propal->multidir_output[$obj->entity] . '/' . dol_sanitizeFileName($obj->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;

View File

@ -24,10 +24,9 @@
*/
// Protection to avoid direct call of template
if (empty($conf) || ! is_object($conf))
{
print "Error, template page can't be called as URL";
exit;
if (empty($conf) || ! is_object($conf)) {
print "Error, template page can't be called as URL";
exit;
}
?>
@ -54,23 +53,24 @@ foreach($linkedObjectBlock as $key => $objectlink)
?>
<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"); ?>
<?php if(!empty($showImportButton) && $conf->global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES)
{
$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>';
}
?>
<?php
if(!empty($showImportButton) && $conf->global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES)
{
$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>';
}
?>
</td>
<td class="linkedcol-name" ><?php echo $objectlink->getNomUrl(1); ?></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-amount" align="right"><?php
<td class="linkedcol-amount right"><?php
if ($user->rights->propale->lire) {
$total = $total + $objectlink->total_ht;
echo price($objectlink->total_ht);
} ?></td>
<td class="linkedcol-statut" align="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-statut right"><?php echo $objectlink->getLibStatut(3); ?></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>
<?php
}
@ -86,7 +86,7 @@ if (count($linkedObjectBlock) > 1)
<td class="right"></td>
<td class="right"></td>
</tr>
<?php
<?php
}
?>

View File

@ -220,7 +220,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
}
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>";
}

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("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("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";
// 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 '</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 '</td>';

View File

@ -652,21 +652,21 @@ if ($resql)
if (! empty($arrayfields['c.total_ht']['checked']))
{
// 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 '</td>';
}
if (! empty($arrayfields['c.total_vat']['checked']))
{
// 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 '</td>';
}
if (! empty($arrayfields['c.total_ttc']['checked']))
{
// 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 '</td>';
}
@ -691,7 +691,7 @@ if ($resql)
// Status
if (! empty($arrayfields['c.fk_statut']['checked']))
{
print '<td class="liste_titre maxwidthonsmartphone" align="right">';
print '<td class="liste_titre maxwidthonsmartphone right">';
$liststatus=array(
Commande::STATUS_DRAFT=>$langs->trans("StatusOrderDraftShort"),
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['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.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_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_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_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, '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, 'class="right"', $sortfield, $sortorder);
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
// Hook fields
@ -742,7 +742,7 @@ if ($resql)
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.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, '');
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', $param, 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ');
print '</tr>'."\n";
@ -914,7 +914,7 @@ if ($resql)
}
print '</td>';
print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">';
print '<td width="16" class="nobordernopadding hideonsmartphone right">';
$filename=dol_sanitizeFileName($obj->ref);
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
$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('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('Status', '', '', '', '', 'align="right"');
print_liste_field_titre('Status', '', '', '', '', 'class="right"');
print_liste_field_titre('GenerateBill', '', '', '', '', 'align="center"');
print '</tr>';
@ -638,7 +638,7 @@ if (($action != 'create' && $action != 'add') || ($action == 'create' && $error)
print '</td>';
//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 '</td>';
@ -678,7 +678,7 @@ if (($action != 'create' && $action != 'add') || ($action == 'create' && $error)
}
print '</td>';
print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">';
print '<td width="16" class="nobordernopadding hideonsmartphone right">';
$filename=dol_sanitizeFileName($objp->ref);
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($objp->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->rowid;
@ -699,7 +699,7 @@ if (($action != 'create' && $action != 'add') || ($action == 'create' && $error)
print '</td>';
// 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
print '<td align="center">';
@ -718,7 +718,7 @@ if (($action != 'create' && $action != 'add') || ($action == 'create' && $error)
* 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 '<div align="right">';
print '<div class="right">';
print '<input type="hidden" name="socid" value="'.$socid.'">';
print '<input type="hidden" name="action" value="create">';
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-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-amount" align="right"><?php
<td class="linkedcol-amount right"><?php
if ($user->rights->commande->lire) {
$total = $total + $objectlink->total_ht;
echo price($objectlink->total_ht);
} ?></td>
<td class="linkedcol-statut" align="right"><?php echo $objectlink->getLibStatut(3); ?></td>
<td class="linkedcol-action" align="right">
<td class="linkedcol-statut right"><?php echo $objectlink->getLibStatut(3); ?></td>
<td class="linkedcol-action right">
<?php
// For now, shipments must stay linked to order, so link is not deletable
if($object->element != 'shipping') {

View File

@ -209,7 +209,7 @@ for ($mois = 1 ; $mois < 13 ; $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)
{
print price($decaiss[$case]);
@ -217,7 +217,7 @@ for ($mois = 1 ; $mois < 13 ; $mois++)
}
print "</td>";
print '<td align="right" class="borderrightlight" width="10%">&nbsp;';
print '<td class="right" class="borderrightlight" width="10%">&nbsp;';
if ($encaiss[$case]>0)
{
print price($encaiss[$case]);
@ -266,7 +266,7 @@ else {
print '<table class="noborder" width="100%">';
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 "</table>";

View File

@ -666,10 +666,10 @@ if ($resql)
print '<td>'.$langs->trans("Numero").'</td>';
//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 align=right>'.$langs->trans("Credit").'</td>';
print '<td class=right>'.$langs->trans("Debit").'</td>';
print '<td class=right>'.$langs->trans("Credit").'</td>';
/*if (! empty($conf->accounting->enabled))
{
print '<td align="center">';
@ -700,7 +700,7 @@ if ($resql)
print '</td>';
//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"':''));
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['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['ba.ref']['checked'])) print_liste_field_titre($arrayfields['ba.ref']['label'], $_SERVER['PHP_SELF'], 'ba.ref', '', $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, 'align="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['balancebefore']['checked'])) print_liste_field_titre($arrayfields['balancebefore']['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, '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, 'class="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, 'class="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.conciliated']['checked'])) print_liste_field_titre($arrayfields['b.conciliated']['label'], $_SERVER['PHP_SELF'], 'b.rappro', '', $param, 'align="center"', $sortfield, $sortorder);
// Extra fields
@ -968,7 +968,7 @@ if ($resql)
$parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder);
$reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
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 "</tr>\n";
@ -1355,7 +1355,7 @@ if ($resql)
// Debit
if (! empty($arrayfields['b.debit']['checked']))
{
print '<td align="right">';
print '<td class="right">';
if ($objp->amount < 0)
{
print price($objp->amount * -1);
@ -1396,7 +1396,7 @@ if ($resql)
}
else
{
print '<td align="right">-</td>';
print '<td class="right">-</td>';
}
if (! $i) $totalarray['nbfield']++;
}
@ -1411,12 +1411,12 @@ if ($resql)
}
else
{
print '<td align="right" class="error nowrap">&nbsp;'.price($balance).'</td>';
print '<td class="error nowrap right">&nbsp;'.price($balance).'</td>';
}
}
else
{
print '<td align="right">-</td>';
print '<td class="right">-</td>';
}
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.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['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 "</tr>\n";
@ -550,7 +550,7 @@ foreach ($accounts as $key=>$type)
// Balance
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 '</td>';
if (! $i) $totalarray['nbfield']++;

View File

@ -766,15 +766,15 @@ else
if ($objp->amount < 0)
{
$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
{
$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)
{
@ -793,7 +793,7 @@ else
}
// 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
print "\n<tr>";

View File

@ -3,7 +3,7 @@
* Copyright (C) 2008-2009 Laurent Destailleur (Eldy) <eldy@users.sourceforge.net>
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com
* Copyright (C) 2016 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2016 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -183,13 +183,13 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
foreach($sqls as $sql){
$resql = $db->query($sql);
if($resql){
while($sqlobj = $db->fetch_object($resql)){
if ($resql) {
while ($sqlobj = $db->fetch_object($resql)) {
$tab_sqlobj[] = $sqlobj;
$tab_sqlobjOrder[]= $db->jdate($sqlobj->dlr);
}
$db->free($resql);
}else{
} else {
$error++;
}
}

View File

@ -218,12 +218,12 @@ if ($result)
}
// 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
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);
print $searchpicto;
print '</td>';
@ -238,8 +238,8 @@ if ($result)
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->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("Credit", $_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, 'class="right"', $sortfield, $sortorder);
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch ');
print "</tr>\n";
@ -328,8 +328,8 @@ if ($result)
print '<tr class="liste_total">';
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" align="right">'.price($totalarray['totalcred'])."</td>";
print '<td class="liste_total right">'.price($totalarray['totaldeb'])."</td>";
print '<td class="liste_total right">'.price($totalarray['totalcred'])."</td>";
print '<td></td>';
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
print $hookmanager->resPrint;
// Action column
print '<td class="liste_titre" align="right">';
print '<td class="liste_titre right">';
$searchpicto=$form->showFilterButtons();
print $searchpicto;
print '</td>';

View File

@ -139,10 +139,10 @@ if ($resql)
// Fields title
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.dateo']['label'], $_SERVER['PHP_SELF'], 'b.dateo', '', $param, 'align="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['b.debit']['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, 'align="right"', $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, 'class="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, 'class="right"', $sortfield, $sortorder);
print "</tr>\n";
$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("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("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("DatePayment", $_SERVER["PHP_SELF"], "pc.datep", "", $param, 'align="center"', $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);
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";
$sql = "SELECT c.id, c.libelle as lib,";
@ -226,12 +226,12 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
$i++;
}
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>';
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>";
}
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("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);
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";
$var=1;
while ($i < $num)

View File

@ -112,16 +112,16 @@ if(($action=="searchfiles"||$action=="dl" ) && $date_start && $date_stop){
if ($resd)
{
$numd = $db->num_rows($resd);
$numd = $db->num_rows($resd);
$tmpinvoice=new Facture($db);
$tmpinvoicesupplier=new FactureFournisseur($db);
$tmpdonation=new Don($db);
$tmpinvoice=new Facture($db);
$tmpinvoicesupplier=new FactureFournisseur($db);
$tmpdonation=new Don($db);
$upload_dir ='';
$i=0;
while($i<$numd)
{
$upload_dir ='';
$i=0;
while($i<$numd)
{
$objd = $db->fetch_object($resd);
switch($objd->item)
@ -197,14 +197,14 @@ if(($action=="searchfiles"||$action=="dl" ) && $date_start && $date_stop){
}
}
$i++;
}
}
else
{
dol_print_error($db);
}
}
}
else
{
dol_print_error($db);
}
$db->free($resd);
$db->free($resd);
}
/*
@ -315,57 +315,57 @@ if (!empty($date_start) && !empty($date_stop))
if ($result)
{
$TData = dol_sort_array($filesarray, 'date', 'ASC');
if(empty($TData)) {
print '<tr class="oddeven"><td colspan="7">'.$langs->trans("NoItem").'</td></tr>';
} else {
// Sort array by date ASC to calucalte balance
if(empty($TData)) {
print '<tr class="oddeven"><td colspan="7">'.$langs->trans("NoItem").'</td></tr>';
} else {
// Sort array by date ASC to calucalte balance
$totalDebit = 0;
$totalCredit = 0;
// Balance calculation
$balance = 0;
foreach($TData as &$data1) {
if($data1['item']!='Invoice'&& $data1['item']!='Donation' ){
$data1['amount']=-$data1['amount'];
}
if ($data1['amount']>0){
}else{
}
$balance += $data1['amount'];
$data1['balance'] = $balance;
}
// Display array
foreach($TData as $data) {
$html_class = '';
//if (!empty($data['fk_facture'])) $html_class = 'facid-'.$data['fk_facture'];
//elseif (!empty($data['fk_paiement'])) $html_class = 'payid-'.$data['fk_paiement'];
print '<tr class="oddeven '.$html_class.'">';
print "<td align=\"center\">";
print dol_print_date($data['date'], 'day');
print "</td>\n";
print '<td aling="left">'.$data['item'].'</td>';
print '<td aling="left">'.$data['ref'].'</td>';
// File link
print '<td><a href='.DOL_URL_ROOT.'/'.$data['link'].">".$data['name']."</a></td>\n";
print '<td aling="left">'.$data['paid'].'</td>';
print '<td align="right">'.(($data['amount'] > 0) ? price(abs($data['amount'])) : '')."</td>\n";
$totalDebit += ($data['amount'] > 0) ? abs($data['amount']) : 0;
print '<td align="right">'.(($data['amount'] > 0) ? '' : price(abs($data['amount'])))."</td>\n";
$totalCredit += ($data['amount'] > 0) ? 0 : abs($data['amount']);
// Balance
print '<td align="right">'.price($data['balance'])."</td>\n";
print "</tr>\n";
}
print '<tr class="liste_total">';
print '<td colspan="5">&nbsp;</td>';
print '<td align="right">'.price($totalDebit).'</td>';
print '<td align="right">'.price($totalCredit).'</td>';
print '<td align="right">'.price(price2num($totalDebit - $totalCredit, 'MT')).'</td>';
print "</tr>\n";
}
$totalDebit = 0;
$totalCredit = 0;
// Balance calculation
$balance = 0;
foreach($TData as &$data1) {
if($data1['item']!='Invoice'&& $data1['item']!='Donation' ){
$data1['amount']=-$data1['amount'];
}
if ($data1['amount']>0){
}else{
}
$balance += $data1['amount'];
$data1['balance'] = $balance;
}
// Display array
foreach($TData as $data) {
$html_class = '';
//if (!empty($data['fk_facture'])) $html_class = 'facid-'.$data['fk_facture'];
//elseif (!empty($data['fk_paiement'])) $html_class = 'payid-'.$data['fk_paiement'];
print '<tr class="oddeven '.$html_class.'">';
print "<td align=\"center\">";
print dol_print_date($data['date'], 'day');
print "</td>\n";
print '<td aling="left">'.$data['item'].'</td>';
print '<td aling="left">'.$data['ref'].'</td>';
// File link
print '<td><a href='.DOL_URL_ROOT.'/'.$data['link'].">".$data['name']."</a></td>\n";
print '<td aling="left">'.$data['paid'].'</td>';
print '<td align="right">'.(($data['amount'] > 0) ? price(abs($data['amount'])) : '')."</td>\n";
$totalDebit += ($data['amount'] > 0) ? abs($data['amount']) : 0;
print '<td align="right">'.(($data['amount'] > 0) ? '' : price(abs($data['amount'])))."</td>\n";
$totalCredit += ($data['amount'] > 0) ? 0 : abs($data['amount']);
// Balance
print '<td align="right">'.price($data['balance'])."</td>\n";
print "</tr>\n";
}
print '<tr class="liste_total">';
print '<td colspan="5">&nbsp;</td>';
print '<td align="right">'.price($totalDebit).'</td>';
print '<td align="right">'.price($totalCredit).'</td>';
print '<td align="right">'.price(price2num($totalDebit - $totalCredit, 'MT')).'</td>';
print "</tr>\n";
}
}
print "</table>";
print '</div>';
}

View File

@ -483,7 +483,7 @@ elseif ($id)
print '</td>';
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 '</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("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("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 "</tr>\n";
@ -150,10 +150,10 @@ if ($resql)
print '<td class="liste_titre">';
print '<input class="flat" size="10" type="text" name="search_company" value="'.$search_company.'">';
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 '</td>';
print '<td class="liste_titre" align="right">';
print '<td class="liste_titre right">';
$searchpicto=$form->showFilterAndCheckAddButtons(0);
print $searchpicto;
print '</td>';

View File

@ -3735,7 +3735,7 @@ elseif ($id > 0 || ! empty($ref))
print $langs->trans('DateInvoice');
print '</td>';
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 '</td><td>';
@ -3759,7 +3759,7 @@ elseif ($id > 0 || ! empty($ref))
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('DatePointOfTax');
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 '</td><td>';
if ($action == 'editdate_pointoftax') {
@ -3776,7 +3776,7 @@ elseif ($id > 0 || ! empty($ref))
print $langs->trans('PaymentConditionsShort');
print '</td>';
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 '</td><td>';
if ($object->type != Facture::TYPE_CREDIT_NOTE)
@ -3797,7 +3797,7 @@ elseif ($id > 0 || ! empty($ref))
print $langs->trans('DateMaxPayment');
print '</td>';
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 '</td><td>';
if ($object->type != Facture::TYPE_CREDIT_NOTE)
@ -3821,7 +3821,7 @@ elseif ($id > 0 || ! empty($ref))
print $langs->trans('PaymentMode');
print '</td>';
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 '</td><td>';
if ($action == 'editmode')
@ -3844,7 +3844,7 @@ elseif ($id > 0 || ! empty($ref))
print $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0);
print '</td>';
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 '</td><td>';
$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 '</td>';
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 '</td><td>';
if ($action == 'editmulticurrencyrate' || $action == 'actualizemulticurrencyrate') {
@ -3882,7 +3882,7 @@ elseif ($id > 0 || ! empty($ref))
print $langs->trans('BankAccount');
print '<td>';
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 '</td><td>';
if ($action == 'editbankaccount')
@ -3902,7 +3902,7 @@ elseif ($id > 0 || ! empty($ref))
print '<tr><td>';
print '<table width="100%" class="nobordernopadding"><tr><td>';
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>';
else print '&nbsp;';
print '</td></tr></table>';
@ -3979,7 +3979,7 @@ elseif ($id > 0 || ! empty($ref))
print '</td>';
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 '</td><td>';
@ -4062,9 +4062,9 @@ elseif ($id > 0 || ! empty($ref))
print '<td>' . $langs->trans('ListOfSituationInvoices') . '</td>';
print '<td></td>';
print '<td align="center">' . $langs->trans('Situation') . '</td>';
if (! empty($conf->banque->enabled)) print '<td align="right"></td>';
print '<td align="right">' . $langs->trans('AmountHT') . '</td>';
print '<td align="right">' . $langs->trans('AmountTTC') . '</td>';
if (! empty($conf->banque->enabled)) print '<td class="right"></td>';
print '<td class="right">' . $langs->trans('AmountHT') . '</td>';
print '<td class="right">' . $langs->trans('AmountTTC') . '</td>';
print '<td width="18">&nbsp;</td>';
print '</tr>';
@ -4085,10 +4085,10 @@ elseif ($id > 0 || ! empty($ref))
print '<td>' . $prev_invoice->getNomUrl(1) . '</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>';
if (! empty($conf->banque->enabled)) print '<td align="right"></td>';
print '<td align="right">' . price($prev_invoice->total_ht) . '</td>';
print '<td align="right">' . price($prev_invoice->total_ttc) . '</td>';
print '<td align="right">' . $prev_invoice->getLibStatut(3, $totalpaye) . '</td>';
if (! empty($conf->banque->enabled)) print '<td class="right"></td>';
print '<td class="right">' . price($prev_invoice->total_ht) . '</td>';
print '<td class="right">' . price($prev_invoice->total_ttc) . '</td>';
print '<td class="right">' . $prev_invoice->getLibStatut(3, $totalpaye) . '</td>';
print '</tr>';
}
}
@ -4103,15 +4103,15 @@ elseif ($id > 0 || ! empty($ref))
print '<td>' . $object->getNomUrl(1) . '</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>';
if (! empty($conf->banque->enabled)) print '<td align="right"></td>';
print '<td align="right">' . price($object->total_ht) . '</td>';
print '<td align="right">' . price($object->total_ttc) . '</td>';
print '<td align="right">' . $object->getLibStatut(3, $object->getSommePaiement()) . '</td>';
if (! empty($conf->banque->enabled)) print '<td class="right"></td>';
print '<td class="right">' . price($object->total_ht) . '</td>';
print '<td class="right">' . price($object->total_ttc) . '</td>';
print '<td class="right">' . $object->getLibStatut(3, $object->getSommePaiement()) . '</td>';
print '</tr>';
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>';
$i =0;
foreach ($current_situation_counter as $sit)
@ -4124,8 +4124,8 @@ elseif ($id > 0 || ! empty($ref))
}
print '</td>';
if (! empty($conf->banque->enabled)) print '<td></td>';
print '<td align="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_ht) . '</b></td>';
print '<td class="right"><b>' . price($total_global_ttc) . '</b></td>';
print '<td width="18">&nbsp;</td>';
print '</tr>';
@ -4136,9 +4136,9 @@ elseif ($id > 0 || ! empty($ref))
print '<td>' . $langs->trans('ListOfNextSituationInvoices') . '</td>';
print '<td></td>';
print '<td></td>';
if (! empty($conf->banque->enabled)) print '<td align="right"></td>';
print '<td align="right">' . $langs->trans('AmountHT') . '</td>';
print '<td align="right">' . $langs->trans('AmountTTC') . '</td>';
if (! empty($conf->banque->enabled)) print '<td class="right"></td>';
print '<td class="right">' . $langs->trans('AmountHT') . '</td>';
print '<td class="right">' . $langs->trans('AmountTTC') . '</td>';
print '<td width="18">&nbsp;</td>';
print '</tr>';*/
@ -4153,10 +4153,10 @@ elseif ($id > 0 || ! empty($ref))
print '<td>' . $next_invoice->getNomUrl(1) . '</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>';
if (! empty($conf->banque->enabled)) print '<td align="right"></td>';
print '<td align="right">' . price($next_invoice->total_ht) . '</td>';
print '<td align="right">' . price($next_invoice->total_ttc) . '</td>';
print '<td align="right">' . $next_invoice->getLibStatut(3, $totalpaye) . '</td>';
if (! empty($conf->banque->enabled)) print '<td class="right"></td>';
print '<td class="right">' . price($next_invoice->total_ht) . '</td>';
print '<td class="right">' . price($next_invoice->total_ttc) . '</td>';
print '<td class="right">' . $next_invoice->getLibStatut(3, $totalpaye) . '</td>';
print '</tr>';
}
@ -4164,10 +4164,10 @@ elseif ($id > 0 || ! empty($ref))
$total_global_ttc += $total_next_ttc;
print '<tr class="oddeven">';
print '<td colspan="3" align="right"></td>';
if (! empty($conf->banque->enabled)) print '<td align="right"></td>';
print '<td align="right"><b>' . price($total_global_ht) . '</b></td>';
print '<td align="right"><b>' . price($total_global_ttc) . '</b></td>';
print '<td colspan="3" class="right"></td>';
if (! empty($conf->banque->enabled)) print '<td class="right"></td>';
print '<td class="right"><b>' . price($total_global_ht) . '</b></td>';
print '<td class="right"><b>' . price($total_global_ttc) . '</b></td>';
print '<td width="18">&nbsp;</td>';
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('Type') . '</td>';
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 '</tr>';
@ -4243,12 +4243,12 @@ elseif ($id > 0 || ! empty($ref))
$bankaccountstatic->accountancy_journal = $accountingjournal->getNomUrl(0, 1, 1, '', 1);
}
print '<td align="right">';
print '<td class="right">';
if ($bankaccountstatic->id)
print $bankaccountstatic->getNomUrl(1, 'transactions');
print '</td>';
}
print '<td align="right">' . price($sign * $objp->amount) . '</td>';
print '<td class="right">' . price($sign * $objp->amount) . '</td>';
print '<td align="center">';
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) {
// Total already paid
print '<tr><td colspan="' . $nbcols . '" align="right">';
print '<tr><td colspan="' . $nbcols . '" class="right">';
if ($object->type != Facture::TYPE_DEPOSIT)
print $langs->trans('AlreadyPaidNoCreditNotesNoDeposits');
else
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;
$cssforamountpaymentcomplete = 'amountpaymentcomplete';
@ -4297,15 +4297,15 @@ elseif ($id > 0 || ! empty($ref))
while ($i < $num) {
$obj = $db->fetch_object($resql);
$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)
print $langs->trans("CreditNote") . ' ';
if ($invoice->type == Facture::TYPE_DEPOSIT)
print $langs->trans("Deposit") . ' ';
print $invoice->getNomUrl(0);
print ' :</td>';
print '<td align="right">' . price($obj->amount_ttc) . '</td>';
print '<td align="right">';
print '<td class="right">' . price($obj->amount_ttc) . '</td>';
print '<td class="right">';
print '<a href="' . $_SERVER["PHP_SELF"] . '?facid=' . $object->id . '&action=unlinkdiscount&discountid=' . $obj->rowid . '">' . img_delete() . '</a>';
print '</td></tr>';
$i ++;
@ -4320,51 +4320,51 @@ elseif ($id > 0 || ! empty($ref))
// Paye partiellement 'escompte'
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 '</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;
$cssforamountpaymentcomplete = 'amountpaymentneutral';
}
// Paye partiellement ou Abandon '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 '</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;
$cssforamountpaymentcomplete = 'amountpaymentneutral';
}
// Paye partiellement ou Abandon '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 '</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;
$cssforamountpaymentcomplete = 'amountpaymentneutral';
}
// Paye partiellement ou Abandon '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");
if ($object->close_note)
$text .= '<br><br><b>' . $langs->trans("Reason") . '</b>:' . $object->close_note;
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;
$cssforamountpaymentcomplete = 'amountpaymentneutral';
}
// 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
print '<tr><td colspan="' . $nbcols . '" align="right">';
print '<tr><td colspan="' . $nbcols . '" class="right">';
if ($resteapayeraffiche >= 0)
print $langs->trans('RemainderToPay');
else
print $langs->trans('ExcessReceived');
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>';
}
else // Credit note
@ -4372,26 +4372,26 @@ elseif ($id > 0 || ! empty($ref))
$cssforamountpaymentcomplete='amountpaymentneutral';
// Total already paid back
print '<tr><td colspan="' . $nbcols . '" align="right">';
print '<tr><td colspan="' . $nbcols . '" class="right">';
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
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
print '<tr><td colspan="' . $nbcols . '" align="right">';
print '<tr><td colspan="' . $nbcols . '" class="right">';
if ($resteapayeraffiche <= 0)
print $langs->trans('RemainderToPayBack');
else
print $langs->trans('ExcessPaid');
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>';
// Sold credit note
// print '<tr><td colspan="'.$nbcols.'" align="right">'.$langs->trans('TotalTTC').' :</td>';
// print '<td align="right" style="border: 1px solid;" bgcolor="#f0f0f0"><b>'.price($sign *
// print '<tr><td colspan="'.$nbcols.'" class="right">'.$langs->trans('TotalTTC').' :</td>';
// print '<td class="right" style="border: 1px solid;" bgcolor="#f0f0f0"><b>'.price($sign *
// $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>' . $langs->trans('ModifyAllLines') . '</td>';
print '<td align="right" width="50">&nbsp;</td>';
print '<td align="right" width="80">&nbsp;</td>';
if ($inputalsopricewithtax) print '<td align="right" width="80">&nbsp;</td>';
print '<td align="right" width="50">&nbsp</td>';
print '<td align="right" width="50">&nbsp</td>';
print '<td align="right" width="50">' . $langs->trans('Progress') . '</td>';
print '<td class="right" width="50">&nbsp;</td>';
print '<td class="right" width="80">&nbsp;</td>';
if ($inputalsopricewithtax) print '<td class="right" width="80">&nbsp;</td>';
print '<td class="right" width="50">&nbsp</td>';
print '<td class="right" width="50">&nbsp</td>';
print '<td class="right" width="50">' . $langs->trans('Progress') . '</td>';
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) {
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 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="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 colspan="4" align="right"><input class="button" type="submit" name="all_percent" value="Modifier" /></td>';
print '<td class="nowrap right"><input type="text" size="1" value="" name="all_progress">%</td>';
print '<td colspan="4" class="right"><input class="button" type="submit" name="all_percent" value="Modifier" /></td>';
print '</tr>';
print '</table>';

View File

@ -837,12 +837,12 @@ if (empty($reshook))
$type = GETPOST('type');
$label = (GETPOST('product_label') ? GETPOST('product_label') : '');
// Check parameters
if (GETPOST('type') < 0) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors');
$error ++;
}
// Check parameters
if (GETPOST('type') < 0) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors');
$error ++;
}
}
if ($qty < 0) {
$langs->load("errors");
setEventMessages($langs->trans('ErrorQtyForCustomerInvoiceCantBeNegative'), null, 'errors');
@ -1481,13 +1481,13 @@ else
}
else
{
if ($object->frequency > 0)
{
print $langs->trans('FrequencyPer_'.$object->unit_frequency, $object->frequency);
}
else
{
print $langs->trans("NotARecurringInvoiceTemplate");
if ($object->frequency > 0)
{
print $langs->trans('FrequencyPer_'.$object->unit_frequency, $object->frequency);
}
else
{
print $langs->trans("NotARecurringInvoiceTemplate");
}
}
print '</td></tr>';

View File

@ -582,12 +582,12 @@ if ($resql)
}
if ($user->rights->facture->supprimer) {
if (!empty($conf->global->INVOICE_CAN_REMOVE_DRAFT_ONLY)) {
$arrayofmassactions['predeletedraft'] = $langs->trans("Deletedraft");
$arrayofmassactions['predeletedraft'] = $langs->trans("Deletedraft");
}
elseif (!empty($conf->global->INVOICE_CAN_ALWAYS_BE_REMOVED)) { // mass deletion never possible on invoices on such situation
$arrayofmassactions['predelete'] = $langs->trans("Delete");
}
}
elseif (!empty($conf->global->INVOICE_CAN_ALWAYS_BE_REMOVED)) { // mass deletion never possible on invoices on such situation
$arrayofmassactions['predelete'] = $langs->trans("Delete");
}
}
if (in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = array();
$massactionbutton=$form->selectMassAction('', $arrayofmassactions);

View File

@ -284,12 +284,12 @@ print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre" height="24">';
print '<td align="center">'.$langs->trans("Year").'</td>';
print '<td align="right">'.$langs->trans("NumberOfBills").'</td>';
print '<td align="right">%</td>';
print '<td align="right">'.$langs->trans("AmountTotal").'</td>';
print '<td align="right">%</td>';
print '<td align="right">'.$langs->trans("AmountAverage").'</td>';
print '<td align="right">%</td>';
print '<td class="right">'.$langs->trans("NumberOfBills").'</td>';
print '<td class="right">%</td>';
print '<td class="right">'.$langs->trans("AmountTotal").'</td>';
print '<td class="right">%</td>';
print '<td class="right">'.$langs->trans("AmountAverage").'</td>';
print '<td class="right">%</td>';
print '</tr>';
$oldyear=0;
@ -302,23 +302,23 @@ foreach ($data as $val)
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="right">0</td>';
print '<td align="right"></td>';
print '<td align="right">0</td>';
print '<td align="right"></td>';
print '<td align="right">0</td>';
print '<td align="right"></td>';
print '<td class="right">0</td>';
print '<td class="right"></td>';
print '<td class="right">0</td>';
print '<td class="right"></td>';
print '<td class="right">0</td>';
print '<td class="right"></td>';
print '</tr>';
}
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="right">'.$val['nb'].'</td>';
print '<td align="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 align="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 align="right" style="'.(($val['avg_diff'] >= 0) ? 'color: green;':'color: red;').'">'.round($val['avg_diff']).'</td>';
print '<td class="right">'.$val['nb'].'</td>';
print '<td class="right" style="'.(($val['nb_diff'] >= 0) ? 'color: green;':'color: red;').'">'.round($val['nb_diff']).'</td>';
print '<td class="right">'.price(price2num($val['total'], 'MT'), 1).'</td>';
print '<td class="right" style="'.(($val['total_diff'] >= 0) ? 'color: green;':'color: red;').'">'.round($val['total_diff']).'</td>';
print '<td class="right">'.price(price2num($val['avg'], 'MT'), 1).'</td>';
print '<td class="right" style="'.(($val['avg_diff'] >= 0) ? 'color: green;':'color: red;').'">'.round($val['avg_diff']).'</td>';
print '</tr>';
$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-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-amount" align="right"><?php
<td class="linkedcol-amount right"><?php
if ($user->rights->facture->lire) {
$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>';
}
} ?></td>
<td class="linkedcol-statut" align="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-statut right"><?php echo $objectlink->getLibStatut(3); ?></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>
<?php
}
@ -78,9 +78,9 @@ if (count($linkedObjectBlock) > 1)
<td></td>
<td align="center"></td>
<td align="center"></td>
<td align="right"><?php echo price($total); ?></td>
<td align="right"></td>
<td align="right"></td>
<td class="right"><?php echo price($total); ?></td>
<td class="right"></td>
<td class="right"></td>
</tr>
<?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-ref" align="center"></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) {
$total = $total + $objectlink->total_ht;
echo price($objectlink->total_ht);
} ?></td>
<td class="linkedcol-statut" align="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-statut right"><?php echo $objectlink->getLibStatut(3); ?></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>
<?php
}
@ -69,9 +69,9 @@ if (count($linkedObjectBlock) > 1)
<td></td>
<td align="center"></td>
<td align="center"></td>
<td align="right"><?php echo price($total); ?></td>
<td align="right"></td>
<td align="right"></td>
<td class="right"><?php echo price($total); ?></td>
<td class="right"></td>
<td class="right"></td>
</tr>
<?php
}

View File

@ -66,22 +66,20 @@ print '<tr class="liste_titre">';
print '<th colspan="2">'.$langs->trans("BankChecks")."</th>\n";
print "</tr>\n";
if ($resql)
{
if ($row = $db->fetch_row($resql) )
{
$num = $row[0];
if ($resql) {
if ($row = $db->fetch_row($resql) ) {
$num = $row[0];
}
print '<tr class="oddeven">';
print '<td>'.$langs->trans("BankChecksToReceipt").'</td>';
print '<td align="right">';
print '<a href="'.DOL_URL_ROOT.'/compta/paiement/cheque/card.php?leftmenu=customers_bills_checks&action=new">'.$num.'</a>';
print '</td></tr>';
print "</table>\n";
print '<tr class="oddeven">';
print '<td>'.$langs->trans("BankChecksToReceipt").'</td>';
print '<td align="right">';
print '<a href="'.DOL_URL_ROOT.'/compta/paiement/cheque/card.php?leftmenu=customers_bills_checks&action=new">'.$num.'</a>';
print '</td></tr>';
print "</table>\n";
}
else
{
dol_print_error($db);
dol_print_error($db);
}

View File

@ -553,8 +553,8 @@ class Paiement extends CommonObject
{
$this->db->rollback();
return -1;
}
// End call triggers
}
// End call triggers
}
// Delete payment (into paiement_facture and paiement)

View File

@ -88,8 +88,8 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
$nbtotalofrecords = $db->num_rows($result);
if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
{
$page = 0;
$offset = 0;
$page = 0;
$offset = 0;
}
}
@ -98,89 +98,89 @@ $sql.= $db->plimit($limit + 1, $offset);
$result = $db->query($sql);
if ($result)
{
$num = $db->num_rows($result);
$i = 0;
$num = $db->num_rows($result);
$i = 0;
$urladd= "&amp;statut=".$statut;
$urladd= "&amp;statut=".$statut;
$selectedfields='';
$selectedfields='';
$newcardbutton='';
if ($user->rights->prelevement->bons->creer)
{
$newcardbutton = '<a class="butActionNew" href="'.DOL_URL_ROOT.'/compta/prelevement/create.php"><span class="valignmiddle">'.$langs->trans('NewStandingOrder').'</span>';
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
}
// Lines of title fields
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
print_barre_liste($langs->trans("WithdrawalsReceipts"), $page, $_SERVER["PHP_SELF"], $urladd, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_generic', 0, $newcardbutton, '', $limit);
$moreforfilter='';
print '<div class="div-table-responsive">';
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
print '<tr class="liste_titre">';
print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="search_ref" value="'. dol_escape_htmltag($search_ref).'"></td>';
print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre right"><input type="text" class="flat maxwidth100" name="search_amount" value="'. dol_escape_htmltag($search_amount).'"></td>';
print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre" align="right">';
$searchpicto=$form->showFilterButtons();
print $searchpicto;
print '</td>';
print '</tr>';
print '<tr class="liste_titre">';
print_liste_field_titre("WithdrawalsReceipts", $_SERVER["PHP_SELF"], "p.ref", '', '', 'class="liste_titre"', $sortfield, $sortorder);
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "p.datec", "", "", 'class="liste_titre" align="center"', $sortfield, $sortorder);
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "p.amount", "", "", 'align="right"', $sortfield, $sortorder);
print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "", "", "", 'align="right"', $sortfield, $sortorder);
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ')."\n";
print "</tr>\n";
while ($i < min($num, $limit))
{
$obj = $db->fetch_object($result);
print '<tr class="oddeven"><td>';
print '<a href="card.php?id='.$obj->rowid.'">'.$obj->ref."</a></td>\n";
print '<td align="center">'.dol_print_date($db->jdate($obj->datec), 'day')."</td>\n";
print '<td align="right">'.price($obj->amount)."</td>\n";
print '<td align="right">';
print $bon->LibStatut($obj->statut, 3);
print '</td>';
print '<td align="right"></td>'."\n";
print "</tr>\n";
$i++;
$newcardbutton='';
if ($user->rights->prelevement->bons->creer)
{
$newcardbutton = '<a class="butActionNew" href="'.DOL_URL_ROOT.'/compta/prelevement/create.php"><span class="valignmiddle">'.$langs->trans('NewStandingOrder').'</span>';
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
}
print "</table>";
print '</div>';
print '</form>';
// Lines of title fields
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
$db->free($result);
print_barre_liste($langs->trans("WithdrawalsReceipts"), $page, $_SERVER["PHP_SELF"], $urladd, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_generic', 0, $newcardbutton, '', $limit);
$moreforfilter='';
print '<div class="div-table-responsive">';
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
print '<tr class="liste_titre">';
print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="search_ref" value="'. dol_escape_htmltag($search_ref).'"></td>';
print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre right"><input type="text" class="flat maxwidth100" name="search_amount" value="'. dol_escape_htmltag($search_amount).'"></td>';
print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre" align="right">';
$searchpicto=$form->showFilterButtons();
print $searchpicto;
print '</td>';
print '</tr>';
print '<tr class="liste_titre">';
print_liste_field_titre("WithdrawalsReceipts", $_SERVER["PHP_SELF"], "p.ref", '', '', 'class="liste_titre"', $sortfield, $sortorder);
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "p.datec", "", "", 'class="liste_titre" align="center"', $sortfield, $sortorder);
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "p.amount", "", "", 'align="right"', $sortfield, $sortorder);
print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "", "", "", 'align="right"', $sortfield, $sortorder);
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ')."\n";
print "</tr>\n";
while ($i < min($num, $limit))
{
$obj = $db->fetch_object($result);
print '<tr class="oddeven"><td>';
print '<a href="card.php?id='.$obj->rowid.'">'.$obj->ref."</a></td>\n";
print '<td align="center">'.dol_print_date($db->jdate($obj->datec), 'day')."</td>\n";
print '<td align="right">'.price($obj->amount)."</td>\n";
print '<td align="right">';
print $bon->LibStatut($obj->statut, 3);
print '</td>';
print '<td align="right"></td>'."\n";
print "</tr>\n";
$i++;
}
print "</table>";
print '</div>';
print '</form>';
$db->free($result);
}
else
{
dol_print_error($db);
dol_print_error($db);
}
// End of page

View File

@ -162,9 +162,9 @@ if ($nb) {
} else {
print '<a class="butAction" type="submit" href="create.php?action=create&format=ALL">' . $langs->trans("CreateAll") . "</a>\n";
}
}
else
{
}
else
{
if ($mysoc->isInEEC())
{
print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans("CreateForSepaFRST")."</a>\n";
@ -178,7 +178,7 @@ if ($nb) {
}
else
{
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->transnoentitiesnoconv("NoInvoiceToWithdraw", $langs->transnoentitiesnoconv("StandingOrders"))).'">'.$langs->trans("CreateAll")."</a>\n";
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->transnoentitiesnoconv("NoInvoiceToWithdraw", $langs->transnoentitiesnoconv("StandingOrders"))).'">'.$langs->trans("CreateAll")."</a>\n";
}
print "</div>\n";

View File

@ -59,9 +59,9 @@ $date_endmonth = GETPOST("date_endmonth");
$date_endday = GETPOST("date_endday");
if (empty($year))
{
$year_current = strftime("%Y", dol_now());
$month_current = strftime("%m", dol_now());
$year_start = $year_current;
$year_current = strftime("%Y", dol_now());
$month_current = strftime("%m", dol_now());
$year_start = $year_current;
} else {
$year_current = $year;
$month_current = strftime("%m", dol_now());
@ -211,7 +211,7 @@ if ($modecompta == 'CREANCES-DETTES') {
$sql.= " WHERE f.fk_statut in (1,2)";
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
$sql.= " AND f.type IN (0,1,2,5)";
} else {
} else {
$sql.= " AND f.type IN (0,1,2,3,5)";
}
if ($date_start && $date_end) {
@ -243,12 +243,12 @@ if ($result) {
$i=0;
while ($i < $num) {
$obj = $db->fetch_object($result);
$amount_ht[$obj->rowid] = $obj->amount;
$amount[$obj->rowid] = $obj->amount_ttc;
$name[$obj->rowid] = $obj->name.' '.$obj->firstname;
$catotal_ht+=$obj->amount;
$catotal+=$obj->amount_ttc;
$i++;
$amount_ht[$obj->rowid] = $obj->amount;
$amount[$obj->rowid] = $obj->amount_ttc;
$name[$obj->rowid] = $obj->name.' '.$obj->firstname;
$catotal_ht+=$obj->amount;
$catotal+=$obj->amount_ttc;
$i++;
}
} else {
dol_print_error($db);
@ -302,7 +302,7 @@ print_liste_field_titre(
"",
$sortfield,
$sortorder
);
);
if ($modecompta == 'CREANCES-DETTES') {
print_liste_field_titre(
$langs->trans('AmountHT'),
@ -313,8 +313,8 @@ if ($modecompta == 'CREANCES-DETTES') {
'align="right"',
$sortfield,
$sortorder
);
} else {
);
} else {
print_liste_field_titre('');
}
print_liste_field_titre(
@ -326,7 +326,7 @@ print_liste_field_titre(
'align="right"',
$sortfield,
$sortorder
);
);
print_liste_field_titre(
$langs->trans("Percentage"),
$_SERVER["PHP_SELF"], "amount_ttc",
@ -335,7 +335,7 @@ print_liste_field_titre(
'align="right"',
$sortfield,
$sortorder
);
);
print_liste_field_titre(
$langs->trans("OtherStatistics"),
$_SERVER["PHP_SELF"],
@ -343,7 +343,7 @@ print_liste_field_titre(
"",
"",
'align="center" width="20%"'
);
);
print "</tr>\n";
if (count($amount)) {
@ -390,22 +390,22 @@ if (count($amount)) {
}
print "<td>".$linkname."</td>\n";
// Amount w/o VAT
// Amount w/o VAT
print '<td align="right">';
if ($modecompta != 'CREANCES-DETTES')
{
if ($key > 0) {
print '<a href="'.DOL_URL_ROOT.'/compta/paiement/list.php?userid='.$key.'">';
} else {
print '<a href="'.DOL_URL_ROOT.'/compta/paiement/list.php?userid=-1">';
}
print '<a href="'.DOL_URL_ROOT.'/compta/paiement/list.php?userid='.$key.'">';
} else {
print '<a href="'.DOL_URL_ROOT.'/compta/paiement/list.php?userid=-1">';
}
} else {
if ($key > 0) {
print '<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?userid='.$key.'">';
} else {
print '<a href="#">';
}
print price($amount_ht[$key]);
print '<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?userid='.$key.'">';
} else {
print '<a href="#">';
}
print price($amount_ht[$key]);
}
print '</td>';
@ -413,16 +413,16 @@ if (count($amount)) {
print '<td align="right">';
if ($modecompta != 'CREANCES-DETTES') {
if ($key > 0) {
print '<a href="'.DOL_URL_ROOT.'/compta/paiement/list.php?userid='.$key.'">';
} else {
print '<a href="'.DOL_URL_ROOT.'/compta/paiement/list.php?userid=-1">';
}
print '<a href="'.DOL_URL_ROOT.'/compta/paiement/list.php?userid='.$key.'">';
} else {
print '<a href="'.DOL_URL_ROOT.'/compta/paiement/list.php?userid=-1">';
}
} else {
if ($key > 0) {
print '<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?userid='.$key.'">';
} else {
print '<a href="#">';
}
print '<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?userid='.$key.'">';
} else {
print '<a href="#">';
}
}
print price($amount[$key]);
print '</td>';
@ -433,14 +433,14 @@ if (count($amount)) {
// Other stats
print '<td align="center">';
if (! empty($conf->propal->enabled) && $key>0) {
print '&nbsp;<a href="'.DOL_URL_ROOT.'/comm/propal/stats/index.php?userid='.$key.'">'.img_picto($langs->trans("ProposalStats"), "stats").'</a>&nbsp;';
}
print '&nbsp;<a href="'.DOL_URL_ROOT.'/comm/propal/stats/index.php?userid='.$key.'">'.img_picto($langs->trans("ProposalStats"), "stats").'</a>&nbsp;';
}
if (! empty($conf->commande->enabled) && $key>0) {
print '&nbsp;<a href="'.DOL_URL_ROOT.'/commande/stats/index.php?userid='.$key.'">'.img_picto($langs->trans("OrderStats"), "stats").'</a>&nbsp;';
}
print '&nbsp;<a href="'.DOL_URL_ROOT.'/commande/stats/index.php?userid='.$key.'">'.img_picto($langs->trans("OrderStats"), "stats").'</a>&nbsp;';
}
if (! empty($conf->facture->enabled) && $key>0) {
print '&nbsp;<a href="'.DOL_URL_ROOT.'/compta/facture/stats/index.php?userid='.$key.'">'.img_picto($langs->trans("InvoiceStats"), "stats").'</a>&nbsp;';
}
print '&nbsp;<a href="'.DOL_URL_ROOT.'/compta/facture/stats/index.php?userid='.$key.'">'.img_picto($langs->trans("InvoiceStats"), "stats").'</a>&nbsp;';
}
print '</td>';
print "</tr>\n";
$i++;
@ -450,9 +450,9 @@ if (count($amount)) {
print '<tr class="liste_total">';
print '<td>'.$langs->trans("Total").'</td>';
if ($modecompta != 'CREANCES-DETTES') {
print '<td colspan="1"></td>';
print '<td colspan="1"></td>';
} else {
print '<td align="right">'.price($catotal_ht).'</td>';
print '<td align="right">'.price($catotal_ht).'</td>';
}
print '<td align="right">'.price($catotal).'</td>';
print '<td>&nbsp;</td>';

View File

@ -451,9 +451,9 @@ if ($modecompta == 'CREANCES-DETTES') {
'align="right"',
$sortfield,
$sortorder
);
} else {
print_liste_field_titre('');
);
} else {
print_liste_field_titre('');
}
print_liste_field_titre(
$langs->trans("AmountTTC"),
@ -464,7 +464,7 @@ print_liste_field_titre(
'align="right"',
$sortfield,
$sortorder
);
);
print_liste_field_titre(
$langs->trans("Percentage"),
$_SERVER["PHP_SELF"],
@ -474,7 +474,7 @@ print_liste_field_titre(
'align="right"',
$sortfield,
$sortorder
);
);
print_liste_field_titre(
$langs->trans("OtherStatistics"),
$_SERVER["PHP_SELF"],
@ -482,7 +482,7 @@ print_liste_field_titre(
"",
"",
'align="center" width="20%"'
);
);
print "</tr>\n";
@ -569,34 +569,34 @@ if (count($amount)) {
// Amount w/o VAT
print '<td align="right">';
if ($modecompta != 'CREANCES-DETTES') {
if ($key > 0) {
print '<a href="'.DOL_URL_ROOT.'/compta/paiement/list.php?socid='.$key.'">';
if ($key > 0) {
print '<a href="'.DOL_URL_ROOT.'/compta/paiement/list.php?socid='.$key.'">';
} else {
print '<a href="'.DOL_URL_ROOT.'/compta/paiement/list.php?socid=-1">';
}
print '<a href="'.DOL_URL_ROOT.'/compta/paiement/list.php?socid=-1">';
}
} else {
if ($key > 0) {
print '<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?socid='.$key.'">';
print '<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?socid='.$key.'">';
} else {
print '<a href="#">';
print '<a href="#">';
}
print price($amount_ht[$key]);
print price($amount_ht[$key]);
}
print '</td>';
// Amount with VAT
print '<td align="right">';
if ($modecompta != 'CREANCES-DETTES') {
if ($key > 0) {
print '<a href="'.DOL_URL_ROOT.'/compta/paiement/list.php?socid='.$key.'">';
if ($key > 0) {
print '<a href="'.DOL_URL_ROOT.'/compta/paiement/list.php?socid='.$key.'">';
} else {
print '<a href="'.DOL_URL_ROOT.'/compta/paiement/list.php?orphelins=1">';
print '<a href="'.DOL_URL_ROOT.'/compta/paiement/list.php?orphelins=1">';
}
} else {
if ($key > 0) {
print '<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?socid='.$key.'">';
if ($key > 0) {
print '<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?socid='.$key.'">';
} else {
print '<a href="#">';
print '<a href="#">';
}
}
print price($amount[$key]);
@ -609,18 +609,18 @@ if (count($amount)) {
// Other stats
print '<td align="center">';
if (! empty($conf->propal->enabled) && $key>0) {
print '&nbsp;<a href="'.DOL_URL_ROOT.'/comm/propal/stats/index.php?socid='.$key.'">'.img_picto($langs->trans("ProposalStats"), "stats").'</a>&nbsp;';
}
print '&nbsp;<a href="'.DOL_URL_ROOT.'/comm/propal/stats/index.php?socid='.$key.'">'.img_picto($langs->trans("ProposalStats"), "stats").'</a>&nbsp;';
}
if (! empty($conf->commande->enabled) && $key>0) {
print '&nbsp;<a href="'.DOL_URL_ROOT.'/commande/stats/index.php?socid='.$key.'">'.img_picto($langs->trans("OrderStats"), "stats").'</a>&nbsp;';
}
print '&nbsp;<a href="'.DOL_URL_ROOT.'/commande/stats/index.php?socid='.$key.'">'.img_picto($langs->trans("OrderStats"), "stats").'</a>&nbsp;';
}
if (! empty($conf->facture->enabled) && $key>0) {
print '&nbsp;<a href="'.DOL_URL_ROOT.'/compta/facture/stats/index.php?socid='.$key.'">'.img_picto($langs->trans("InvoiceStats"), "stats").'</a>&nbsp;';
}
print '&nbsp;<a href="'.DOL_URL_ROOT.'/compta/facture/stats/index.php?socid='.$key.'">'.img_picto($langs->trans("InvoiceStats"), "stats").'</a>&nbsp;';
}
print '</td>';
print "</tr>\n";
$i++;
}
print "</tr>\n";
$i++;
}
// Total
print '<tr class="liste_total">';

View File

@ -1010,7 +1010,8 @@ class Contact extends CommonObject
}
// 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);
if ($result < 0) $error++;
}

View File

@ -186,9 +186,9 @@ class Contracts extends DolibarrApi
*/
function post($request_data = null)
{
if(! DolibarrApiAccess::$user->rights->contrat->creer) {
throw new RestException(401, "Insuffisant rights");
}
if(! DolibarrApiAccess::$user->rights->contrat->creer) {
throw new RestException(401, "Insuffisant rights");
}
// Check mandatory fields
$result = $this->_validate($request_data);
@ -220,9 +220,9 @@ class Contracts extends DolibarrApi
*/
function getLines($id)
{
if(! DolibarrApiAccess::$user->rights->contrat->lire) {
if (! DolibarrApiAccess::$user->rights->contrat->lire) {
throw new RestException(401);
}
}
$result = $this->contract->fetch($id);
if( ! $result ) {

View File

@ -367,6 +367,8 @@ abstract class CommonDocGenerator
global $conf;
$sumpayed=$sumdeposit=$sumcreditnote='';
$already_payed_all=0;
$remain_to_pay=0;
if ($object->element == 'facture')
{
$invoice_source=new Facture($this->db);
@ -377,6 +379,8 @@ abstract class CommonDocGenerator
$sumpayed = $object->getSommePaiement();
$sumdeposit = $object->getSumDepositsUsed();
$sumcreditnote = $object->getSumCreditNotesUsed();
$already_payed_all=$sumpayed + $sumdeposit + $sumcreditnote;
$remain_to_pay=$sumpayed - $sumdeposit - $sumcreditnote;
}
$date = ($object->element == 'contrat' ? $object->date_contrat : $object->date);
@ -438,12 +442,12 @@ abstract class CommonDocGenerator
$array_key.'_already_creditnote_locale'=>price($sumcreditnote, 0, $outputlangs),
$array_key.'_already_creditnote'=>price2num($sumcreditnote),
$array_key.'_already_payed_all_locale'=>price(price2num($sumpayed + $sumdeposit + $sumcreditnote, 'MT'), 0, $outputlangs),
$array_key.'_already_payed_all'=> price2num(($sumpayed + $sumdeposit + $sumcreditnote), 'MT'),
$array_key.'_already_payed_all_locale'=>price(price2num($already_payed_all, 'MT'), 0, $outputlangs),
$array_key.'_already_payed_all'=> price2num($already_payed_all, 'MT'),
// Remain to pay with all know infrmation (except open direct debit requests)
$array_key.'_remain_to_pay_locale'=>price(price2num($object->total_ttc - $sumpayed - $sumdeposit - $sumcreditnote, 'MT'), 0, $outputlangs),
$array_key.'_remain_to_pay'=>price2num($object->total_ttc - $sumpayed - $sumdeposit - $sumcreditnote, 'MT')
$array_key.'_remain_to_pay_locale'=>price(price2num($object->total_ttc - $remain_to_pay, 'MT'), 0, $outputlangs),
$array_key.'_remain_to_pay'=>price2num($object->total_ttc - $remain_to_pay, 'MT')
);
if (method_exists($object, 'getTotalDiscount')) {

View File

@ -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))
{
$morecss = 'maxwidth75';
}elseif ($type == 'url')
{
} elseif ($type == 'url') {
$morecss='minwidth400';
}
elseif ($type == 'boolean')

View File

@ -1470,43 +1470,43 @@ class Form
$contactstatic->id=$obj->rowid;
$contactstatic->lastname=$obj->lastname;
$contactstatic->firstname=$obj->firstname;
if ($obj->statut == 1){
if ($htmlname != 'none')
{
$disabled=0;
if (is_array($exclude) && count($exclude) && in_array($obj->rowid, $exclude)) $disabled=1;
if (is_array($limitto) && count($limitto) && ! in_array($obj->rowid, $limitto)) $disabled=1;
if (!empty($selected) && in_array($obj->rowid, $selected))
{
$out.= '<option value="'.$obj->rowid.'"';
if ($disabled) $out.= ' disabled';
$out.= ' selected>';
$out.= $contactstatic->getFullName($langs);
if ($showfunction && $obj->poste) $out.= ' ('.$obj->poste.')';
if (($showsoc > 0) && $obj->company) $out.= ' - ('.$obj->company.')';
$out.= '</option>';
}
else
{
$out.= '<option value="'.$obj->rowid.'"';
if ($disabled) $out.= ' disabled';
$out.= '>';
$out.= $contactstatic->getFullName($langs);
if ($showfunction && $obj->poste) $out.= ' ('.$obj->poste.')';
if (($showsoc > 0) && $obj->company) $out.= ' - ('.$obj->company.')';
$out.= '</option>';
}
}
else
{
if (in_array($obj->rowid, $selected))
{
$out.= $contactstatic->getFullName($langs);
if ($showfunction && $obj->poste) $out.= ' ('.$obj->poste.')';
if (($showsoc > 0) && $obj->company) $out.= ' - ('.$obj->company.')';
}
}
}
if ($obj->statut == 1) {
if ($htmlname != 'none')
{
$disabled=0;
if (is_array($exclude) && count($exclude) && in_array($obj->rowid, $exclude)) $disabled=1;
if (is_array($limitto) && count($limitto) && ! in_array($obj->rowid, $limitto)) $disabled=1;
if (!empty($selected) && in_array($obj->rowid, $selected))
{
$out.= '<option value="'.$obj->rowid.'"';
if ($disabled) $out.= ' disabled';
$out.= ' selected>';
$out.= $contactstatic->getFullName($langs);
if ($showfunction && $obj->poste) $out.= ' ('.$obj->poste.')';
if (($showsoc > 0) && $obj->company) $out.= ' - ('.$obj->company.')';
$out.= '</option>';
}
else
{
$out.= '<option value="'.$obj->rowid.'"';
if ($disabled) $out.= ' disabled';
$out.= '>';
$out.= $contactstatic->getFullName($langs);
if ($showfunction && $obj->poste) $out.= ' ('.$obj->poste.')';
if (($showsoc > 0) && $obj->company) $out.= ' - ('.$obj->company.')';
$out.= '</option>';
}
}
else
{
if (in_array($obj->rowid, $selected))
{
$out.= $contactstatic->getFullName($langs);
if ($showfunction && $obj->poste) $out.= ' ('.$obj->poste.')';
if (($showsoc > 0) && $obj->company) $out.= ' - ('.$obj->company.')';
}
}
}
$i++;
}
}

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

@ -1346,7 +1346,7 @@ class FormFile
print '<td'.(($conf->browser->layout != 'phone' && empty($disablemove)) ?' class="linecolmove tdlineupdown center"':' class="linecolmove center"').'>';
print '</td>';
}
}
}
}
else
{

View File

@ -713,5 +713,5 @@ class Menubase
$this->recur($tab, $tab[$x]['rowid'], ($level+1));
}
}
}
}
}

View File

@ -152,6 +152,8 @@ class DoliDBPgsql extends DoliDB
*/
static function convertSQLFromMysql($line, $type = 'auto', $unescapeslashquot = false)
{
global $conf;
// Removed empty line if this is a comment line for SVN tagging
if (preg_match('/^--\s\$Id/i', $line)) {
return '';
@ -311,7 +313,14 @@ class DoliDBPgsql extends DoliDB
}
// To have postgresql case sensitive
$line=str_replace(' LIKE \'', ' ILIKE \'', $line);
$count_like=0;
$line=str_replace(' LIKE \'', ' ILIKE \'', $line, $count_like);
if (!empty($conf->global->PSQL_USE_UNACCENT) && $count_like > 0)
{
// @see https://docs.postgresql.fr/11/unaccent.html : 'unaccent()' function must be installed before
$line=preg_replace('/\s+(\(+\s*)([a-zA-Z0-9\-\_\.]+) ILIKE /', ' \1unaccent(\2) ILIKE ', $line);
}
$line=str_replace(' LIKE BINARY \'', ' LIKE \'', $line);
// Replace INSERT IGNORE into INSERT

View File

@ -1403,32 +1403,28 @@ class DoliDBSqlite3 extends DoliDB
$weekday=self::calc_weekday($first_daynr, !$monday_first);
$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)))
return 0;
$week_year= 1;
$calc_year--;
$first_daynr-= ($days=self::calc_days_in_year($calc_year));
$weekday= ($weekday + 53*7- $days) % 7;
}
if (($first_weekday && $weekday != 0) || (!$first_weekday && $weekday >= 4)) {
$days= $daynr - ($first_daynr+ (7-$weekday));
}
else {
$days= $daynr - ($first_daynr - $weekday);
}
if ($week_year && $days >= 52*7)
{
$weekday= ($weekday + self::calc_days_in_year($calc_year)) % 7;
if ((!$first_weekday && $weekday < 4) || ($first_weekday && $weekday == 0))
{
$calc_year++;
return 1;
}
}
return floor($days/7+1);
if (($first_weekday && $weekday != 0) || (!$first_weekday && $weekday >= 4)) {
$days= $daynr - ($first_daynr+ (7-$weekday));
} else {
$days= $daynr - ($first_daynr - $weekday);
}
if ($week_year && $days >= 52*7) {
$weekday= ($weekday + self::calc_days_in_year($calc_year)) % 7;
if ((!$first_weekday && $weekday < 4) || ($first_weekday && $weekday == 0)) {
$calc_year++;
return 1;
}
}
return floor($days/7+1);
}
}

View File

@ -1469,7 +1469,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
}
// Add also event from emailings. TODO This should be replaced by an automatic event ? May be it's too much for very large emailing.
if (! empty($conf->mailing->enabled) && ! empty($objcon->email) && (empty($actioncode) || $actioncode == 'AC_OTH_AUTO' || $actioncode == 'AC_EMAILING'))
if (! empty($conf->mailing->enabled) && ! empty($objcon->email))
{
$langs->load("mails");

View File

@ -2365,9 +2365,10 @@ function dol_print_phone($phone, $countrycode = '', $cid = 0, $socid = 0, $addli
{//ex: +66_A_BCD_EF_GHI
$newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 1).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 2).$separ.substr($newphone, 9, 3);
}
}
}
elseif (strtoupper($countrycode) == "MU")
{//Maurice
{
//Maurice
if(dol_strlen($phone) == 11)
{//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);
@ -2514,9 +2515,11 @@ function dol_print_phone($phone, $countrycode = '', $cid = 0, $socid = 0, $addli
}
}
elseif(strtoupper($countrycode) == "AU")
{//Australie
if(dol_strlen($phone) == 12)
{//ex: +61_A_BCDE_FGHI
{
//Australie
if(dol_strlen($phone) == 12)
{
//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);
}
}
@ -2593,7 +2596,7 @@ function dol_print_phone($phone, $countrycode = '', $cid = 0, $socid = 0, $addli
$rep.=($withpicto?img_picto($titlealt, 'object_'.$picto.'.png').' ':'').$newphone;
if ($adddivfloat) $rep.='</div>';
else $rep.='</span>';
}
}
return $rep;
}
@ -5887,10 +5890,10 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
$substitutionarray['__REF__'] = $object->ref;
$substitutionarray['__REF_CLIENT__'] = (isset($object->ref_client) ? $object->ref_client : (isset($object->ref_customer) ? $object->ref_customer : null));
$substitutionarray['__REF_SUPPLIER__'] = (isset($object->ref_supplier) ? $object->ref_supplier : null);
$substitutionarray['__SUPPLIER_ORDER_DATE_DELIVERY__'] = (isset($object->date_livraison) ? dol_print_date($object->date_livraison, 'day', 0, $outputlangs): '');
// For backward compatibility
$substitutionarray['__REFCLIENT__'] = (isset($object->ref_client) ? $object->ref_client : (isset($object->ref_customer) ? $object->ref_customer : null));
$substitutionarray['__REFSUPPLIER__'] = (isset($object->ref_supplier) ? $object->ref_supplier : null);
$substitutionarray['__SUPPLIER_ORDER_DATE_DELIVERY__'] = (isset($object->date_livraison) ? dol_print_date($object->date_livraison, 'day', 0, $outputlangs): '');
// TODO Remove this
$msgishtml = 0;
@ -7085,7 +7088,7 @@ function complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type,
}
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[3]) $langs->load($values[3]);

View File

@ -900,7 +900,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
// First line of company infos
$line1=""; $line2=""; $line3=""; $line4="";
if ($showdetails == 1 || $showdetails == 3)
if ($showdetails == 1 || $showdetails == 3)
{
// Company name
if ($fromcompany->name)
@ -1969,9 +1969,9 @@ function pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails = 0)
}
else
$result.=price($sign * $total_ht, 0, $outputlangs);
}
}
}
return $result;
return $result;
}
/**

View File

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

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

View File

@ -768,23 +768,22 @@ class pdf_einstein extends ModelePDFCommandes
$posy=$pdf->GetY()+1;
}
// Show payment mode
// Show payment mode
if ($object->mode_reglement_code
&& $object->mode_reglement_code != 'CHQ'
&& $object->mode_reglement_code != 'VIR')
{
$pdf->SetFont('', 'B', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche, $posy);
$titre = $outputlangs->transnoentities("PaymentMode").':';
$pdf->MultiCell(80, 5, $titre, 0, 'L');
&& $object->mode_reglement_code != 'CHQ'
&& $object->mode_reglement_code != 'VIR') {
$pdf->SetFont('', 'B', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche, $posy);
$titre = $outputlangs->transnoentities("PaymentMode").':';
$pdf->MultiCell(80, 5, $titre, 0, 'L');
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($posxval, $posy);
$lib_mode_reg=$outputlangs->transnoentities("PaymentType".$object->mode_reglement_code)!=('PaymentType'.$object->mode_reglement_code)?$outputlangs->transnoentities("PaymentType".$object->mode_reglement_code):$outputlangs->convToOutputCharset($object->mode_reglement);
$pdf->MultiCell(80, 5, $lib_mode_reg, 0, 'L');
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($posxval, $posy);
$lib_mode_reg=$outputlangs->transnoentities("PaymentType".$object->mode_reglement_code)!=('PaymentType'.$object->mode_reglement_code)?$outputlangs->transnoentities("PaymentType".$object->mode_reglement_code):$outputlangs->convToOutputCharset($object->mode_reglement);
$pdf->MultiCell(80, 5, $lib_mode_reg, 0, 'L');
$posy=$pdf->GetY()+2;
}
$posy=$pdf->GetY()+2;
}
// Show payment mode CHQ
if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ')

View File

@ -828,30 +828,29 @@ class pdf_eratosthene extends ModelePDFCommandes
$posy=$pdf->GetY()+1;
}
// Show payment mode
// Show payment mode
if ($object->mode_reglement_code
&& $object->mode_reglement_code != 'CHQ'
&& $object->mode_reglement_code != 'VIR')
{
$pdf->SetFont('', 'B', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche, $posy);
$titre = $outputlangs->transnoentities("PaymentMode").':';
$pdf->MultiCell(80, 5, $titre, 0, 'L');
&& $object->mode_reglement_code != 'CHQ'
&& $object->mode_reglement_code != 'VIR') {
$pdf->SetFont('', 'B', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche, $posy);
$titre = $outputlangs->transnoentities("PaymentMode").':';
$pdf->MultiCell(80, 5, $titre, 0, 'L');
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($posxval, $posy);
$lib_mode_reg=$outputlangs->transnoentities("PaymentType".$object->mode_reglement_code)!=('PaymentType'.$object->mode_reglement_code)?$outputlangs->transnoentities("PaymentType".$object->mode_reglement_code):$outputlangs->convToOutputCharset($object->mode_reglement);
$pdf->MultiCell(80, 5, $lib_mode_reg, 0, 'L');
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($posxval, $posy);
$lib_mode_reg=$outputlangs->transnoentities("PaymentType".$object->mode_reglement_code)!=('PaymentType'.$object->mode_reglement_code)?$outputlangs->transnoentities("PaymentType".$object->mode_reglement_code):$outputlangs->convToOutputCharset($object->mode_reglement);
$pdf->MultiCell(80, 5, $lib_mode_reg, 0, 'L');
$posy=$pdf->GetY()+2;
}
$posy=$pdf->GetY()+2;
}
// Show payment mode CHQ
if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ')
{
// Si mode reglement non force ou si force a CHQ
if (! empty($conf->global->FACTURE_CHQ_NUMBER))
{
// Si mode reglement non force ou si force a CHQ
if (! empty($conf->global->FACTURE_CHQ_NUMBER))
{
if ($conf->global->FACTURE_CHQ_NUMBER > 0)
{
$account = new Account($this->db);

View File

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

View File

@ -739,7 +739,7 @@ class pdf_crabe extends ModelePDFFactures
// Affiche zone versements
if (($deja_regle || $amount_credit_notes_included || $amount_deposits_included) && empty($conf->global->INVOICE_NO_PAYMENT_DETAILS))
{
$posy=$this->_tableau_versements($pdf, $object, $posy, $outputlangs);
$posy=$this->_tableau_versements($pdf, $object, $posy, $outputlangs, $heightforfooter);
}
// Pied de page
@ -785,9 +785,10 @@ class pdf_crabe extends ModelePDFFactures
* @param Object $object Object invoice
* @param int $posy Position y in PDF
* @param Translate $outputlangs Object langs for output
* @param int $heightforfooter height for footer
* @return int <0 if KO, >0 if OK
*/
function _tableau_versements(&$pdf, $object, $posy, $outputlangs)
function _tableau_versements(&$pdf, $object, $posy, $outputlangs, $heightforfooter = 0)
{
// phpcs:enable
global $conf;
@ -795,6 +796,7 @@ class pdf_crabe extends ModelePDFFactures
$sign=1;
if ($object->type == 2 && ! empty($conf->global->INVOICE_POSITIVE_CREDIT_NOTE)) $sign=-1;
$current_page = $pdf->getPage();
$tab3_posx = 120;
$tab3_top = $posy + 8;
$tab3_width = 80;
@ -806,26 +808,7 @@ class pdf_crabe extends ModelePDFFactures
$default_font_size = pdf_getPDFFontSize($outputlangs);
$title=$outputlangs->transnoentities("PaymentsAlreadyDone");
if ($object->type == 2) $title=$outputlangs->transnoentities("PaymentsBackAlreadyDone");
$pdf->SetFont('', '', $default_font_size - 3);
$pdf->SetXY($tab3_posx, $tab3_top - 4);
$pdf->MultiCell(60, 3, $title, 0, 'L', 0);
$pdf->line($tab3_posx, $tab3_top, $tab3_posx+$tab3_width, $tab3_top);
$pdf->SetFont('', '', $default_font_size - 4);
$pdf->SetXY($tab3_posx, $tab3_top);
$pdf->MultiCell(20, 3, $outputlangs->transnoentities("Payment"), 0, 'L', 0);
$pdf->SetXY($tab3_posx+21, $tab3_top);
$pdf->MultiCell(20, 3, $outputlangs->transnoentities("Amount"), 0, 'L', 0);
$pdf->SetXY($tab3_posx+40, $tab3_top);
$pdf->MultiCell(20, 3, $outputlangs->transnoentities("Type"), 0, 'L', 0);
$pdf->SetXY($tab3_posx+58, $tab3_top);
$pdf->MultiCell(20, 3, $outputlangs->transnoentities("Num"), 0, 'L', 0);
$pdf->line($tab3_posx, $tab3_top-1+$tab3_height, $tab3_posx+$tab3_width, $tab3_top-1+$tab3_height);
$this->_tableau_versements_header($pdf, $object, $outputlangs, $default_font_size, $tab3_posx, $tab3_top, $tab3_width, $tab3_height);
$y=0;
@ -847,6 +830,17 @@ class pdf_crabe extends ModelePDFFactures
while ($i < $num)
{
$y+=3;
if ($tab3_top+$y >= ($this->page_hauteur - $heightforfooter))
{
$y=0;
$current_page++;
$pdf->AddPage('', '', true);
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
$pdf->setPage($current_page);
$this->_tableau_versements_header($pdf, $object, $outputlangs, $default_font_size, $tab3_posx, $tab3_top+$y-3, $tab3_width, $tab3_height);
}
$obj = $this->db->fetch_object($resql);
if ($obj->type == 2) $text=$outputlangs->transnoentities("CreditNote");
@ -893,6 +887,17 @@ class pdf_crabe extends ModelePDFFactures
$i=0;
while ($i < $num) {
$y+=3;
if ($tab3_top+$y >= ($this->page_hauteur - $heightforfooter))
{
$y=0;
$current_page++;
$pdf->AddPage('', '', true);
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
$pdf->setPage($current_page);
$this->_tableau_versements_header($pdf, $object, $outputlangs, $default_font_size, $tab3_posx, $tab3_top+$y-3, $tab3_width, $tab3_height);
}
$row = $this->db->fetch_object($resql);
$pdf->SetXY($tab3_posx, $tab3_top+$y);
@ -918,6 +923,44 @@ class pdf_crabe extends ModelePDFFactures
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Function _tableau_versements_header
*
* @param TCPDF $pdf Object PDF
* @param Facture $object Object invoice
* @param Translate $outputlangs Object langs for output
* @param int $default_font_size Font size
* @param int $tab3_posx pos x
* @param int $tab3_top pos y
* @param int $tab3_width width
* @param int $tab3_height height
* @return void
*/
function _tableau_versements_header($pdf, $object, $outputlangs, $default_font_size, $tab3_posx, $tab3_top, $tab3_width, $tab3_height)
{
// phpcs:enable
$title=$outputlangs->transnoentities("PaymentsAlreadyDone");
if ($object->type == 2) $title=$outputlangs->transnoentities("PaymentsBackAlreadyDone");
$pdf->SetFont('', '', $default_font_size - 3);
$pdf->SetXY($tab3_posx, $tab3_top - 4);
$pdf->MultiCell(60, 3, $title, 0, 'L', 0);
$pdf->line($tab3_posx, $tab3_top, $tab3_posx+$tab3_width, $tab3_top);
$pdf->SetFont('', '', $default_font_size - 4);
$pdf->SetXY($tab3_posx, $tab3_top);
$pdf->MultiCell(20, 3, $outputlangs->transnoentities("Payment"), 0, 'L', 0);
$pdf->SetXY($tab3_posx+21, $tab3_top);
$pdf->MultiCell(20, 3, $outputlangs->transnoentities("Amount"), 0, 'L', 0);
$pdf->SetXY($tab3_posx+40, $tab3_top);
$pdf->MultiCell(20, 3, $outputlangs->transnoentities("Type"), 0, 'L', 0);
$pdf->SetXY($tab3_posx+58, $tab3_top);
$pdf->MultiCell(20, 3, $outputlangs->transnoentities("Num"), 0, 'L', 0);
$pdf->line($tab3_posx, $tab3_top-1+$tab3_height, $tab3_posx+$tab3_width, $tab3_top-1+$tab3_height);
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
@ -1292,31 +1335,27 @@ class pdf_crabe extends ModelePDFFactures
foreach($localtax_rate as $tvakey => $tvaval)
{
// retrieve global local tax
if ($tvakey != 0) // On affiche pas taux 0
//$this->atleastoneratenotnull++;
$index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl='';
if (preg_match('/\*/', $tvakey))
{
//$this->atleastoneratenotnull++;
$index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl='';
if (preg_match('/\*/', $tvakey))
{
$tvakey=str_replace('*', '', $tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
}
$totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).' ';
$totalvat.=vatrate(abs($tvakey), 1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1);
$tvakey=str_replace('*', '', $tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
}
$totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).' ';
$totalvat.=vatrate(abs($tvakey), 1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1);
}
//}
}
}
//}
// Revenue stamp
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);
}
}
//}
}
}
//}
// Revenue stamp
if (price2num($object->revenuestamp) != 0)

View File

@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT .'/core/modules/fichinter/modules_fichinter.php';
*/
class mod_arctic extends ModeleNumRefFicheinter
{
/**
/**
* Dolibarr version of the loaded document
* @public string
*/
@ -130,7 +130,7 @@ class mod_arctic extends ModeleNumRefFicheinter
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;
if (! $mask)
@ -142,14 +142,14 @@ class mod_arctic extends ModeleNumRefFicheinter
$numFinal=get_next_value($db, $mask, 'fichinter', 'ref', '', $objsoc, $object->datec);
return $numFinal;
}
}
/**
* Return next free value
* Return next free value
*
* @param Societe $objsoc Object third party
* @param Object $objforref Object for number to search
* @param Object $objforref Object for number to search
* @return string Next free value
*/
function getNumRef($objsoc, $objforref)

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2010-2012 Laurent Destailleur <eldy@products.sourceforge.net>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
/* Copyright (C) 2010-2012 Laurent Destailleur <eldy@products.sourceforge.net>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -321,12 +321,13 @@ class doc_generic_product_odt extends ModelePDFProduct
if (! empty($usecontact))
{
// On peut utiliser le nom de la societe du contact
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact;
else {
$socobject = $object->thirdparty;
// if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use
$contactobject = $object->contact;
}
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
$socobject = $object->contact;
} else {
$socobject = $object->thirdparty;
// if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use
$contactobject = $object->contact;
}
}
else
{

View File

@ -425,19 +425,19 @@ class pdf_beluga extends ModelePDFProjects
$total_ttc = 0;
$num = count($elementarray);
// Loop on each lines
for ($i = 0; $i < $num; $i ++)
{
$curY = $nexY;
$pdf->SetFont('', '', $default_font_size - 1); // Into loop to work with multipage
$pdf->SetTextColor(0, 0, 0);
// Loop on each lines
for ($i = 0; $i < $num; $i ++)
{
$curY = $nexY;
$pdf->SetFont('', '', $default_font_size - 1); // Into loop to work with multipage
$pdf->SetTextColor(0, 0, 0);
$pdf->setTopMargin($tab_top_newpage);
$pdf->setPageOrientation('', 1, $heightforfooter+$heightforfreetext+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
$pageposbefore=$pdf->getPage();
$pdf->setTopMargin($tab_top_newpage);
$pdf->setPageOrientation('', 1, $heightforfooter+$heightforfreetext+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
$pageposbefore=$pdf->getPage();
// Description of line
$idofelement=$elementarray[$i];
// Description of line
$idofelement=$elementarray[$i];
if ($classname == 'ExpenseReport')
{
// We get id of expense report
@ -457,114 +457,114 @@ class pdf_beluga extends ModelePDFProjects
$qualifiedfortotal = false; // Replacement invoice
}
$showpricebeforepagebreak=1;
$showpricebeforepagebreak=1;
$pdf->startTransaction();
// Label
$pdf->SetXY($this->posxref, $curY);
$pdf->MultiCell($this->posxdate - $this->posxref, 3, $element->ref, 1, 'L');
$pageposafter=$pdf->getPage();
if ($pageposafter > $pageposbefore) // There is a pagebreak
{
$pdf->rollbackTransaction(true);
$pageposafter=$pageposbefore;
//print $pageposafter.'-'.$pageposbefore;exit;
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
// Label
$pdf->SetXY($this->posxref, $curY);
$posybefore=$pdf->GetY();
$pdf->MultiCell($this->posxdate - $this->posxref, 3, $element->ref, 1, 'L');
$pageposafter=$pdf->getPage();
$posyafter=$pdf->GetY();
if ($posyafter > ($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))) // There is no space left for total+free text
{
if ($i == ($num-1)) // No more lines, and no space left to show total, so we create a new page
{
$pdf->AddPage('', '', true);
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
$pdf->setPage($pageposafter+1);
}
}
else
{
// We found a page break
$showpricebeforepagebreak=0;
$forcedesconsamepage=1;
if ($forcedesconsamepage)
{
$pdf->rollbackTransaction(true);
$pageposafter=$pageposbefore;
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
$pdf->startTransaction();
// Label
$pdf->SetXY($this->posxref, $curY);
$pdf->MultiCell($this->posxdate - $this->posxref, 3, $element->ref, 1, 'L');
$pageposafter=$pdf->getPage();
if ($pageposafter > $pageposbefore) // There is a pagebreak
{
$pdf->rollbackTransaction(true);
$pageposafter=$pageposbefore;
//print $pageposafter.'-'.$pageposbefore;exit;
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
// Label
$pdf->SetXY($this->posxref, $curY);
$posybefore=$pdf->GetY();
$pdf->MultiCell($this->posxdate - $this->posxref, 3, $element->ref, 1, 'L');
$pageposafter=$pdf->getPage();
$posyafter=$pdf->GetY();
if ($posyafter > ($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))) // There is no space left for total+free text
{
if ($i == ($num-1)) // No more lines, and no space left to show total, so we create a new page
{
$pdf->AddPage('', '', true);
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
$pdf->setPage($pageposafter+1);
}
}
else
{
// We found a page break
$showpricebeforepagebreak=0;
$forcedesconsamepage=1;
if ($forcedesconsamepage)
{
$pdf->rollbackTransaction(true);
$pageposafter=$pageposbefore;
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
$pdf->AddPage('', '', true);
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
$pdf->setPage($pageposafter+1);
$pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut
$pdf->MultiCell(0, 3, ''); // Set interline to 3
$pdf->SetTextColor(0, 0, 0);
$pdf->AddPage('', '', true);
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
$pdf->setPage($pageposafter+1);
$pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut
$pdf->MultiCell(0, 3, ''); // Set interline to 3
$pdf->SetTextColor(0, 0, 0);
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
$curY = $tab_top_newpage + $heightoftitleline + 1;
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
$curY = $tab_top_newpage + $heightoftitleline + 1;
// Label
$pdf->SetXY($this->posxref, $curY);
$posybefore=$pdf->GetY();
$pdf->MultiCell($this->posxdate - $this->posxref, 3, $element->ref, 1, 'L');
$pageposafter=$pdf->getPage();
$posyafter=$pdf->GetY();
}
}
//var_dump($i.' '.$posybefore.' '.$posyafter.' '.($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot)).' '.$showpricebeforepagebreak);
}
else // No pagebreak
{
$pdf->commitTransaction();
}
$posYAfterDescription=$pdf->GetY();
// Label
$pdf->SetXY($this->posxref, $curY);
$posybefore=$pdf->GetY();
$pdf->MultiCell($this->posxdate - $this->posxref, 3, $element->ref, 1, 'L');
$pageposafter=$pdf->getPage();
$posyafter=$pdf->GetY();
}
}
//var_dump($i.' '.$posybefore.' '.$posyafter.' '.($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot)).' '.$showpricebeforepagebreak);
}
else // No pagebreak
{
$pdf->commitTransaction();
}
$posYAfterDescription=$pdf->GetY();
$nexY = $pdf->GetY();
$pageposafter=$pdf->getPage();
$pdf->setPage($pageposbefore);
$pdf->setTopMargin($this->marge_haute);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
$nexY = $pdf->GetY();
$pageposafter=$pdf->getPage();
$pdf->setPage($pageposbefore);
$pdf->setTopMargin($this->marge_haute);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
// We suppose that a too long description is moved completely on next page
if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) {
//var_dump($pageposbefore.'-'.$pageposafter.'-'.$showpricebeforepagebreak);
$pdf->setPage($pageposafter); $curY = $tab_top_newpage + $heightoftitleline + 1;
}
// We suppose that a too long description is moved completely on next page
if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) {
//var_dump($pageposbefore.'-'.$pageposafter.'-'.$showpricebeforepagebreak);
$pdf->setPage($pageposafter); $curY = $tab_top_newpage + $heightoftitleline + 1;
}
$pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut
$pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut
// Date
if ($tablename == 'commande_fournisseur' || $tablename == 'supplier_order')
$date = $element->date_commande;
else {
$date = $element->date;
if (empty($date))
$date = $element->datep;
if (empty($date))
$date = $element->date_contrat;
if (empty($date))
$date = $element->datev; // Fiche inter
}
// Date
if ($tablename == 'commande_fournisseur' || $tablename == 'supplier_order')
$date = $element->date_commande;
else {
$date = $element->date;
if (empty($date))
$date = $element->datep;
if (empty($date))
$date = $element->date_contrat;
if (empty($date))
$date = $element->datev; // Fiche inter
}
$pdf->SetXY($this->posxdate, $curY);
$pdf->MultiCell($this->posxsociety - $this->posxdate, 3, dol_print_date($date, 'day'), 1, 'C');
$pdf->SetXY($this->posxdate, $curY);
$pdf->MultiCell($this->posxsociety - $this->posxdate, 3, dol_print_date($date, 'day'), 1, 'C');
$pdf->SetXY($this->posxsociety, $curY);
if ($classname == 'ExpenseReport')
{
$fuser=new User($this->db);
$fuser->fetch($element->fk_user_author);
$pdf->MultiCell($this->posxamountht - $this->posxsociety, 3, $fuser->getFullName($outputlangs), 1, 'L');
}
else
{
$pdf->MultiCell($this->posxamountht - $this->posxsociety, 3, (is_object($element->thirdparty)?$element->thirdparty->name:''), 1, 'L');
}
$pdf->SetXY($this->posxsociety, $curY);
if ($classname == 'ExpenseReport')
{
$fuser=new User($this->db);
$fuser->fetch($element->fk_user_author);
$pdf->MultiCell($this->posxamountht - $this->posxsociety, 3, $fuser->getFullName($outputlangs), 1, 'L');
}
else
{
$pdf->MultiCell($this->posxamountht - $this->posxsociety, 3, (is_object($element->thirdparty)?$element->thirdparty->name:''), 1, 'L');
}
// Amount without tax
if (empty($value['disableamount'])) {

View File

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

View File

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

View File

@ -65,7 +65,7 @@ class doc_generic_user_odt extends ModelePDFUser
global $conf, $langs, $mysoc;
// Load translation files required by the page
$langs->loadLangs(array("main","companies"));
$langs->loadLangs(array("main","companies"));
$this->db = $db;
$this->name = "ODT templates";
@ -318,10 +318,10 @@ class doc_generic_user_odt extends ModelePDFUser
// On peut utiliser le nom de la societe du contact
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact;
else {
$socobject = $object->thirdparty;
// if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use
$contactobject = $object->contact;
}
$socobject = $object->thirdparty;
// if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use
$contactobject = $object->contact;
}
}
else
{

View File

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

View File

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

View File

@ -21,10 +21,9 @@
// Protection to avoid direct call of template
if (empty($conf) || ! is_object($conf))
{
print "Error, template page can't be called as URL";
exit;
if (empty($conf) || ! is_object($conf)) {
print "Error, template page can't be called as URL";
exit;
}
@ -61,19 +60,24 @@ print top_htmlhead('', $titleofloginpage, 0, 0, $arrayofjs, array(), 0, $disable
$colorbackhmenu1='60,70,100'; // topmenu
if (! isset($conf->global->THEME_ELDY_TOPMENU_BACK1)) $conf->global->THEME_ELDY_TOPMENU_BACK1=$colorbackhmenu1;
$colorbackhmenu1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TOPMENU_BACK1)?$colorbackhmenu1:$conf->global->THEME_ELDY_TOPMENU_BACK1):(empty($user->conf->THEME_ELDY_TOPMENU_BACK1)?$colorbackhmenu1:$user->conf->THEME_ELDY_TOPMENU_BACK1);
$colorbackhmenu1=join(',', colorStringToArray($colorbackhmenu1)); // Normalize value to 'x,y,z'
$colorbackhmenu1 = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TOPMENU_BACK1)?$colorbackhmenu1:$conf->global->THEME_ELDY_TOPMENU_BACK1):(empty($user->conf->THEME_ELDY_TOPMENU_BACK1)?$colorbackhmenu1:$user->conf->THEME_ELDY_TOPMENU_BACK1);
$colorbackhmenu1 = join(',', colorStringToArray($colorbackhmenu1)); // Normalize value to 'x,y,z'
?>
<!-- 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'
?>
?>
<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).'\')"'; ?>>
<?php } ?>
<?php
}
?>
<?php if (empty($conf->dol_use_jmobile)) { ?>
<script type="text/javascript">

View File

@ -73,9 +73,13 @@ $coldisplay=-1; // We remove first td
<input type="hidden" id="product_type" name="type" value="<?php echo $line->product_type; ?>">
<input type="hidden" id="product_id" name="productid" value="<?php echo (! empty($line->fk_product)?$line->fk_product:0); ?>" />
<input type="hidden" id="special_code" name="special_code" value="<?php echo $line->special_code; ?>">
<input type="hidden" id="fk_parent_line" name="fk_parent_line" value="<?php echo $line->fk_parent_line; ?>">
<?php if ($line->fk_product > 0) { ?>
<?php
if ($line->fk_parent_line > 0) echo img_picto('', 'rightarrow');
?>
<a href="<?php echo DOL_URL_ROOT.'/product/card.php?id='.$line->fk_product; ?>">
<?php
if ($line->product_type==1) echo img_object($langs->trans('ShowService'), 'service');
@ -193,16 +197,19 @@ $coldisplay=-1; // We remove first td
&nbsp;
<?php } ?>
</td>
<?php
<?php
if ($this->situation_cycle_ref) {
$coldisplay++;
print '<td class="nowrap right"><input class="right" type="text" size="1" value="' . $line->situation_percent . '" name="progress">%</td>';
}
if (! empty($usemargins))
{
?>
<?php if (!empty($user->rights->margins->creer)) { ?>
<td class="margininfos right"><?php $coldisplay++; ?>
if (!empty($user->rights->margins->creer)) {
?>
<td class="margininfos right">
<?php
$coldisplay++;
?>
<!-- For predef product -->
<?php if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { ?>
<select id="fournprice_predef" name="fournprice_predef" class="flat right" style="display: none;"></select>
@ -211,30 +218,31 @@ $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); ?>">
</td>
<?php } ?>
<?php if ($user->rights->margins->creer) {
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)));
// if credit note, dont allow to modify margin
if ($line->subprice < 0)
echo '<td class="right nowrap margininfos">'.$margin_rate.'<span class="hideonsmartphone">%</span></td>';
else
echo '<td class="right nowrap margininfos"><input class="right" type="text" size="2" name="np_marginRate" value="'.$margin_rate.'"><span class="hideonsmartphone">%</span></td>';
$coldisplay++;
}
elseif (! empty($conf->global->DISPLAY_MARK_RATES))
{
$mark_rate = (isset($_POST["np_markRate"])?GETPOST("np_markRate", 'alpha', 2):price($line->marque_tx));
// if credit note, dont allow to modify margin
if ($line->subprice < 0)
echo '<td class="right nowrap margininfos">'.$mark_rate.'<span class="hideonsmartphone">%</span></td>';
else
echo '<td class="right nowrap margininfos"><input class="right" type="text" size="2" name="np_markRate" value="'.$mark_rate.'"><span class="hideonsmartphone">%</span></td>';
$coldisplay++;
}
}
<?php
if ($user->rights->margins->creer) {
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)));
// if credit note, dont allow to modify margin
if ($line->subprice < 0)
echo '<td class="right nowrap margininfos">'.$margin_rate.'<span class="hideonsmartphone">%</span></td>';
else
echo '<td class="right nowrap margininfos"><input class="right" type="text" size="2" name="np_marginRate" value="'.$margin_rate.'"><span class="hideonsmartphone">%</span></td>';
$coldisplay++;
}
elseif (! empty($conf->global->DISPLAY_MARK_RATES))
{
$mark_rate = (isset($_POST["np_markRate"])?GETPOST("np_markRate", 'alpha', 2):price($line->marque_tx));
// if credit note, dont allow to modify margin
if ($line->subprice < 0)
echo '<td class="right nowrap margininfos">'.$mark_rate.'<span class="hideonsmartphone">%</span></td>';
else
echo '<td class="right nowrap margininfos"><input class="right" type="text" size="2" name="np_markRate" value="'.$mark_rate.'"><span class="hideonsmartphone">%</span></td>';
$coldisplay++;
}
}
}
?>
?>
<!-- colspan=4 for this td because it replace total_ht+3 td for buttons -->
<td class="center valignmiddle" colspan="<?php echo $colspan; ?>"><?php $coldisplay+=4; ?>

View File

@ -204,13 +204,15 @@ $domData .= ' data-product_type="'.$line->product_type.'"';
<?php } ?>
<td class="linecolqty nowrap right"><?php $coldisplay++; ?>
<?php if ((($line->info_bits & 2) != 2) && $line->special_code != 3) {
// 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
// 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;"')." ";
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;'; ?>
<?php
if ((($line->info_bits & 2) != 2) && $line->special_code != 3) {
// 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
// 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;"')." ";
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;';
?>
</td>
<?php
@ -308,9 +310,13 @@ $domData .= ' data-product_type="'.$line->product_type.'"';
<?php } else { ?>
<td <?php echo (($conf->browser->layout != 'phone' && empty($disablemove)) ?' class="linecolmove tdlineupdown center"':' class="linecolmove center"'); ?>><?php $coldisplay++; ?></td>
<?php } ?>
<?php } else { ?>
<?php
} else {
?>
<td colspan="3"><?php $coldisplay=$coldisplay+3; ?></td>
<?php } ?>
<?php
}
?>
<?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>
<?php } ?>

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