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

This commit is contained in:
Laurent Destailleur 2020-01-01 11:24:10 +01:00
commit eae0800021
23 changed files with 255 additions and 374 deletions

View File

@ -152,6 +152,7 @@ NEW: #4301
For Developers or integrators:
NEW: Compatible with PHP 7.4
NEW: Code for extrafields uses the new array $extrafields->attributes
NEW: Can set a filter on object linked in modulebuilder.
NEW: Can defined a position of numbering submodules for thirdparties

View File

@ -691,14 +691,14 @@ if ($rowid > 0)
print '<tr class="liste_titre">';
print_liste_field_titre('Ref', $_SERVER["PHP_SELF"], 'c.rowid', '', $param, '', $sortfield, $sortorder);
print_liste_field_titre('DateCreation', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder);
print_liste_field_titre('Type', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder);
print_liste_field_titre('DateStart', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder);
print_liste_field_titre('DateEnd', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder);
print_liste_field_titre('Amount', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder);
print_liste_field_titre('DateCreation', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center ');
print_liste_field_titre('Type', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center ');
print_liste_field_titre('DateStart', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center ');
print_liste_field_titre('DateEnd', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center ');
print_liste_field_titre('Amount', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right ');
if (!empty($conf->banque->enabled))
{
print_liste_field_titre('Account', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder);
print_liste_field_titre('Account', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right ');
}
print "</tr>\n";

View File

@ -1,129 +0,0 @@
<?php
/* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2019 Maxime Kohlhaas <maxime@atm-consulting.fr>
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/**
* \file bom/admin/setup.php
* \ingroup bom
* \brief Bom setup page.
*/
// Load Dolibarr environment
require '../../main.inc.php';
// Libraries
require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php";
require_once '../lib/bom.lib.php';
//require_once "../class/myclass.class.php";
// Translations
$langs->loadLangs(array("admin", "mrp"));
// Access control
if (!$user->admin) accessforbidden();
// Parameters
$action = GETPOST('action', 'alpha');
$backtopage = GETPOST('backtopage', 'alpha');
$arrayofparameters = array(
'BILLOFMATERIALS_MYPARAM1'=>array('css'=>'minwidth200', 'enabled'=>1),
'BILLOFMATERIALS_MYPARAM2'=>array('css'=>'minwidth500', 'enabled'=>1)
);
/*
* Actions
*/
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
/*
* View
*/
$page_name = "BomSetup";
llxHeader('', $langs->trans($page_name));
// Subheader
$linkback = '<a href="'.($backtopage ? $backtopage : DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1').'">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans($page_name), $linkback, 'object_bom');
// Configuration header
$head = bomAdminPrepareHead();
dol_fiche_head($head, 'settings', '', -1, "bom");
// Setup page goes here
echo $langs->trans("BomSetupPage").'<br><br>';
if ($action == 'edit')
{
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="update">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
foreach ($arrayofparameters as $key => $val)
{
print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans($key), $langs->trans($key.'Tooltip'));
print '</td><td><input name="'.$key.'" class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'" value="'.$conf->global->$key.'"></td></tr>';
}
print '</table>';
print '<br><div class="center">';
print '<input class="button" type="submit" value="'.$langs->trans("Save").'">';
print '</div>';
print '</form>';
print '<br>';
}
else
{
if (!empty($arrayofparameters))
{
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
foreach ($arrayofparameters as $key => $val)
{
print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans($key), $langs->trans($key.'Tooltip'));
print '</td><td>'.$conf->global->$key.'</td></tr>';
}
print '</table>';
print '<div class="tabsAction">';
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>';
print '</div>';
}
else
{
print '<br>'.$langs->trans("NothingToSetup");
}
}
// Page end
dol_fiche_end();
llxFooter();
$db->close();

View File

@ -48,9 +48,9 @@ $langs->loadLangs(array("main","bills"));
</script>
<p><a class="lien1" href="<?php echo DOL_URL_ROOT ?>/compta/facture/card.php?action=builddoc&facid=<?php echo $_GET['facid']; ?>" target="_blank"><?php echo $langs->trans("ShowInvoice"); ?></a></p>
<p><a class="lien1" href="<?php echo DOL_URL_ROOT ?>/compta/facture/card.php?action=builddoc&facid=<?php echo GETPOST('facid', 'int'); ?>" target="_blank"><?php echo $langs->trans("ShowInvoice"); ?></a></p>
<br>
<p><a class="lien1" href="#" onclick="Javascript: popupTicket(); return(false);"><?php echo $langs->trans("PrintTicket"); ?></a></p>
<p><a class="lien1" href="#" onclick="Javascript: popupTicket(<?php echo GETPOST('facid', 'int'); ?>,'<?php echo $langs->trans('PrintTicket') ?>'); return(false);"><?php echo $langs->trans("PrintTicket"); ?></a></p>
</div>
</div>

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2019 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
@ -238,6 +238,7 @@ print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="add">';
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("TransferFrom").'</td><td>'.$langs->trans("TransferTo").'</td><td>'.$langs->trans("Date").'</td><td>'.$langs->trans("Description").'</td><td>'.$langs->trans("Amount").'</td>';
@ -261,6 +262,7 @@ print '<td><input name="amount" class="flat" type="text" size="6" value="'.dol_e
print '<td style="display:none" class="multicurrency"><input name="amountto" class="flat" type="text" size="6" value="'.dol_escape_htmltag($amountto).'"></td>';
print "</table>";
print '</div>';
print '<br><div class="center"><input type="submit" class="button" value="'.$langs->trans("Add").'"></div>';

View File

@ -456,7 +456,7 @@ if ($id)
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border centpercent">';
print '<table class="border centpercent tableforfield">';
// Label
print '<tr><td class="titlefield">'.$langs->trans("Label").'</td><td>'.$object->label.'</td></tr>';

View File

@ -134,7 +134,7 @@ if ($object->id)
print '<table class="border tableforfield centpercent">';
print '<tr><td>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>';
print '<tr><td class="titlefield">'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>';
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>';
print '</table>';

View File

@ -49,10 +49,10 @@ class BonPrelevement extends CommonObject
*/
public $table_element = 'prelevement_bons';
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto = 'payment';
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto = 'payment';
public $date_echeance;
public $raison_sociale;
@ -116,7 +116,7 @@ class BonPrelevement extends CommonObject
$this->fetched = 0;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Add invoice to withdrawal
*
@ -132,7 +132,7 @@ class BonPrelevement extends CommonObject
*/
public function AddFacture($facture_id, $client_id, $client_nom, $amount, $code_banque, $code_guichet, $number, $number_key)
{
// phpcs:enable
// phpcs:enable
$result = 0;
$line_id = 0;
@ -196,8 +196,8 @@ class BonPrelevement extends CommonObject
if ($concat == 1)
{
/*
* We aggregate the lines
*/
* We aggregate the lines
*/
$sql = "SELECT rowid";
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_lignes";
$sql .= " WHERE fk_prelevement_bons = ".$this->id;
@ -219,8 +219,8 @@ class BonPrelevement extends CommonObject
else
{
/*
* No aggregate
*/
* No aggregate
*/
$sql = "INSERT INTO ".MAIN_DB_PREFIX."prelevement_lignes (";
$sql .= "fk_prelevement_bons";
$sql .= ", fk_soc";
@ -335,7 +335,7 @@ class BonPrelevement extends CommonObject
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Set credite and set status of linked invoices. Still used ??
*
@ -343,7 +343,7 @@ class BonPrelevement extends CommonObject
*/
public function set_credite()
{
// phpcs:enable
// phpcs:enable
global $user, $conf;
$error = 0;
@ -351,7 +351,7 @@ class BonPrelevement extends CommonObject
if ($this->db->begin())
{
$sql = " UPDATE ".MAIN_DB_PREFIX."prelevement_bons";
$sql .= " SET statut = 1";
$sql .= " SET statut = ".self::STATUS_TRANSFERED;
$sql .= " WHERE rowid = ".$this->id;
$sql .= " AND entity = ".$conf->entity;
@ -392,8 +392,8 @@ class BonPrelevement extends CommonObject
}
/*
* End of procedure
*/
* End of procedure
*/
if (!$error)
{
$this->db->commit();
@ -414,7 +414,7 @@ class BonPrelevement extends CommonObject
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Set direct debit order to "credited" status.
*
@ -424,7 +424,7 @@ class BonPrelevement extends CommonObject
*/
public function set_infocredit($user, $date)
{
// phpcs:enable
// phpcs:enable
global $conf, $langs;
$error = 0;
@ -437,11 +437,11 @@ class BonPrelevement extends CommonObject
{
$sql = " UPDATE ".MAIN_DB_PREFIX."prelevement_bons ";
$sql .= " SET fk_user_credit = ".$user->id;
$sql .= ", statut = 2";
$sql .= ", statut = ".self::STATUS_CREDITED;
$sql .= ", date_credit = '".$this->db->idate($date)."'";
$sql .= " WHERE rowid=".$this->id;
$sql .= " AND entity = ".$conf->entity;
$sql .= " AND statut = 1";
$sql .= " AND statut = ".self::STATUS_TRANSFERED;
if ($this->db->query($sql))
{
@ -483,7 +483,8 @@ class BonPrelevement extends CommonObject
$paiement->datepaye = $date;
$paiement->amounts = $cursoramounts; // Array with detail of dispatching of payments for each invoice
$paiement->paiementid = 3; //
$paiement->num_paiement = $this->ref; // Set ref of direct debit note
$paiement->num_payment = $this->ref; // Set ref of direct debit note
$paiement->num_paiement = $this->ref; // For bacward compatibility
$paiement->id_prelevement = $this->id;
$paiement_id = $paiement->create($user);
@ -525,12 +526,12 @@ class BonPrelevement extends CommonObject
}
/*
* End of procedure
*/
* End of procedure
*/
if ($error == 0)
{
$this->date_credit = $date;
$this->statut = 1;
$this->statut = self::STATUS_CREDITED;
$this->db->commit();
return 0;
@ -560,7 +561,7 @@ class BonPrelevement extends CommonObject
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Set withdrawal to transmited status
*
@ -571,7 +572,7 @@ class BonPrelevement extends CommonObject
*/
public function set_infotrans($user, $date, $method)
{
// phpcs:enable
// phpcs:enable
global $conf, $langs;
$error = 0;
@ -639,9 +640,9 @@ class BonPrelevement extends CommonObject
$arr = array();
/*
* Returns all invoices presented
* within a withdrawal receipt
*/
* Returns all invoices presented
* within a withdrawal receipt
*/
$sql = "SELECT fk_facture";
if ($amounts) $sql .= ", SUM(pl.amount)";
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
@ -685,7 +686,7 @@ class BonPrelevement extends CommonObject
return $arr;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Returns amount of withdrawal
*
@ -693,7 +694,7 @@ class BonPrelevement extends CommonObject
*/
public function SommeAPrelever()
{
// phpcs:enable
// phpcs:enable
global $conf;
$sql = "SELECT sum(pfd.amount) as nb";
@ -724,7 +725,7 @@ class BonPrelevement extends CommonObject
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Get number of invoices to withdrawal
* TODO delete params banque and agence when not necesary
@ -735,7 +736,7 @@ class BonPrelevement extends CommonObject
*/
public function NbFactureAPrelever($banque = 0, $agence = 0)
{
// phpcs:enable
// phpcs:enable
global $conf;
$sql = "SELECT count(f.rowid) as nb";
@ -769,7 +770,7 @@ class BonPrelevement extends CommonObject
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Create a withdraw
* TODO delete params banque and agence when not necesary
@ -784,7 +785,7 @@ class BonPrelevement extends CommonObject
*/
public function Create($banque = 0, $agence = 0, $mode = 'real', $format = 'ALL', $executiondate = '', $notrigger = 0)
{
// phpcs:enable
// phpcs:enable
global $conf, $langs, $user;
dol_syslog(__METHOD__."::Bank=".$banque." Office=".$agence." mode=".$mode." format=".$format, LOG_DEBUG);
@ -797,8 +798,8 @@ class BonPrelevement extends CommonObject
$error = 0;
$datetimeprev = time();
//Choice the date of the execution direct debit
if (!empty($executiondate)) $datetimeprev = $executiondate;
//Choice the date of the execution direct debit
if (!empty($executiondate)) $datetimeprev = $executiondate;
$month = strftime("%m", $datetimeprev);
$year = strftime("%Y", $datetimeprev);
@ -929,12 +930,12 @@ class BonPrelevement extends CommonObject
// Return warning
/*$i=0;
foreach ($this->thirdparty_in_error as $key => $val)
{
if ($i < 10) setEventMessages($val, null, 'warnings');
else setEventMessages('More error were discarded...', null, 'warnings');
$i++;
}*/
foreach ($this->thirdparty_in_error as $key => $val)
{
if ($i < 10) setEventMessages($val, null, 'warnings');
else setEventMessages('More error were discarded...', null, 'warnings');
$i++;
}*/
if (count($factures_prev) > 0)
{
@ -952,16 +953,16 @@ class BonPrelevement extends CommonObject
if ($ok)
{
/*
* We are in real mode.
* We create withdraw receipt and build withdraw into disk
*/
* We are in real mode.
* We create withdraw receipt and build withdraw into disk
*/
$this->db->begin();
$now = dol_now();
/*
* Traitements
*/
* Traitements
*/
if (!$error)
{
$ref = substr($year, -2).$month;
@ -1017,8 +1018,8 @@ class BonPrelevement extends CommonObject
if (!$error)
{
/*
* Create withdrawal receipt in database
*/
* Create withdrawal receipt in database
*/
if (count($factures_prev) > 0)
{
foreach ($factures_prev as $fac) // Add a link in database for each invoice
@ -1027,17 +1028,17 @@ class BonPrelevement extends CommonObject
$fact = new Facture($this->db);
$fact->fetch($fac[0]);
/*
* Add standing order
*
*
* $fac[3] : banque
* $fac[4] : guichet
* $fac[5] : number
* $fac[6] : cle rib
* $fac[7] : amount
* $fac[8] : client nom
* $fac[2] : client id
*/
* Add standing order
*
*
* $fac[3] : banque
* $fac[4] : guichet
* $fac[5] : number
* $fac[6] : cle rib
* $fac[7] : amount
* $fac[8] : client nom
* $fac[2] : client id
*/
$ri = $this->AddFacture($fac[0], $fac[2], $fac[8], $fac[7], $fac[3], $fac[4], $fac[5], $fac[6]);
if ($ri <> 0)
{
@ -1066,8 +1067,8 @@ class BonPrelevement extends CommonObject
if (!$error)
{
/*
* Create direct debit order in a XML file
*/
* Create direct debit order in a XML file
*/
dol_syslog(__METHOD__."::Init withdraw receipt for ".count($factures_prev)." invoices", LOG_DEBUG);
@ -1104,8 +1105,8 @@ class BonPrelevement extends CommonObject
//var_dump($factures_prev);exit;
/*
* Update total
*/
* Update total
*/
$sql = "UPDATE ".MAIN_DB_PREFIX."prelevement_bons";
$sql .= " SET amount = ".price2num($this->total);
$sql .= " WHERE rowid = ".$this->id;
@ -1118,13 +1119,13 @@ class BonPrelevement extends CommonObject
dol_syslog(__METHOD__."::Error update total: ".$this->db->error(), LOG_ERR);
}
if (!$error && !$notrigger)
{
// Call trigger
$result = $this->call_trigger('DIRECT_DEBIT_ORDER_CREATE', $user);
if ($result < 0) $error++;
// End call triggers
}
if (!$error && !$notrigger)
{
// Call trigger
$result = $this->call_trigger('DIRECT_DEBIT_ORDER_CREATE', $user);
if ($result < 0) $error++;
// End call triggers
}
if (!$error)
{
@ -1160,10 +1161,10 @@ class BonPrelevement extends CommonObject
if (!$notrigger)
{
// Call trigger
$result = $this->call_trigger('DIRECT_DEBIT_ORDER_DELETE', $user);
if ($result < 0) $error++;
// End call triggers
// Call trigger
$result = $this->call_trigger('DIRECT_DEBIT_ORDER_DELETE', $user);
if ($result < 0) $error++;
// End call triggers
}
if (!$error)
@ -1210,11 +1211,11 @@ class BonPrelevement extends CommonObject
/**
* Returns clickable name (with picto)
*
* @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto)
* @param string $option On what the link point to ('nolink', ...)
* @param int $notooltip 1=Disable tooltip
* @param string $morecss Add more css on link
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
* @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto)
* @param string $option On what the link point to ('nolink', ...)
* @param int $notooltip 1=Disable tooltip
* @param string $morecss Add more css on link
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
* @return string URL of target
*/
public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1)
@ -1280,7 +1281,7 @@ class BonPrelevement extends CommonObject
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Delete a notification def by id
*
@ -1289,7 +1290,7 @@ class BonPrelevement extends CommonObject
*/
public function DeleteNotificationById($rowid)
{
// phpcs:enable
// phpcs:enable
$result = 0;
$sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def";
@ -1305,7 +1306,7 @@ class BonPrelevement extends CommonObject
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Delete a notification
*
@ -1315,7 +1316,7 @@ class BonPrelevement extends CommonObject
*/
public function DeleteNotification($user, $action)
{
// phpcs:enable
// phpcs:enable
$result = 0;
$sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def";
@ -1331,7 +1332,7 @@ class BonPrelevement extends CommonObject
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Add a notification
*
@ -1342,7 +1343,7 @@ class BonPrelevement extends CommonObject
*/
public function AddNotification($db, $user, $action)
{
// phpcs:enable
// phpcs:enable
$result = 0;
if ($this->DeleteNotification($user, $action) == 0)
@ -1376,7 +1377,7 @@ class BonPrelevement extends CommonObject
* File is generated with name this->filename
*
* @param string $format FRST, RCUR or ALL
* @param string $executiondate Date to execute transfer
* @param string $executiondate Date to execute transfer
* @return int 0 if OK, <0 if KO
*/
public function generate($format = 'ALL', $executiondate = '')
@ -1414,7 +1415,7 @@ class BonPrelevement extends CommonObject
$dateTime_ECMA = dol_print_date($now, '%Y-%m-%dT%H:%M:%S');
$date_actu = $now;
if (!empty($executiondate)) $date_actu = $executiondate;
if (!empty($executiondate)) $date_actu = $executiondate;
$dateTime_YMD = dol_print_date($date_actu, '%Y%m%d');
$dateTime_YMDHMS = dol_print_date($date_actu, '%Y%m%d%H%M%S');
@ -1554,12 +1555,12 @@ class BonPrelevement extends CommonObject
fclose($this->file);
if (!empty($conf->global->MAIN_UMASK))
@chmod($this->file, octdec($conf->global->MAIN_UMASK));
return $result;
@chmod($this->file, octdec($conf->global->MAIN_UMASK));
return $result;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Write recipient of request (customer)
*
@ -1576,7 +1577,7 @@ class BonPrelevement extends CommonObject
*/
public function EnregDestinataire($rowid, $client_nom, $rib_banque, $rib_guichet, $rib_number, $amount, $ref, $facid, $rib_dom = '')
{
// phpcs:enable
// phpcs:enable
fputs($this->file, "06");
fputs($this->file, "08"); // Prelevement ordinaire
@ -1647,7 +1648,7 @@ class BonPrelevement extends CommonObject
return $pre.'-'.$row_code_client.'-'.$row_drum.'-'.date('U', $row_datec);
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Write recipient of request (customer)
*
@ -1667,15 +1668,15 @@ class BonPrelevement extends CommonObject
* @param string $row_bic rib.bic AS bic,
* @param string $row_datec rib.datec,
* @param string $row_drum rib.rowid used to generate rum
* @param string $row_rum rib.rum Rum defined on company bank account
* @param string $row_rum rib.rum Rum defined on company bank account
* @return string Return string with SEPA part DrctDbtTxInf
*/
public function EnregDestinataireSEPA($row_code_client, $row_nom, $row_address, $row_zip, $row_town, $row_country_code, $row_cb, $row_cg, $row_cc, $row_somme, $row_ref, $row_idfac, $row_iban, $row_bic, $row_datec, $row_drum, $row_rum)
{
// phpcs:enable
global $conf;
// phpcs:enable
global $conf;
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
$CrLf = "\n";
$Rowing = sprintf("%06d", $row_idfac);
@ -1690,7 +1691,7 @@ class BonPrelevement extends CommonObject
$XML_DEBITOR = '';
$XML_DEBITOR .= ' <DrctDbtTxInf>'.$CrLf;
$XML_DEBITOR .= ' <PmtId>'.$CrLf;
// $XML_DEBITOR .=' <EndToEndId>'.('AS-'.dol_trunc($row_ref,20).'-'.$Rowing).'</EndToEndId>'.$CrLf; // ISO20022 states that EndToEndId has a MaxLength of 35 characters
// $XML_DEBITOR .=' <EndToEndId>'.('AS-'.dol_trunc($row_ref,20).'-'.$Rowing).'</EndToEndId>'.$CrLf; // ISO20022 states that EndToEndId has a MaxLength of 35 characters
$XML_DEBITOR .= ' <EndToEndId>'.(($conf->global->PRELEVEMENT_END_TO_END != "") ? $conf->global->PRELEVEMENT_END_TO_END : ('AS-'.dol_trunc($row_ref, 20)).'-'.$Rowing).'</EndToEndId>'.$CrLf; // ISO20022 states that EndToEndId has a MaxLength of 35 characters
$XML_DEBITOR .= ' </PmtId>'.$CrLf;
$XML_DEBITOR .= ' <InstdAmt Ccy="EUR">'.round($row_somme, 2).'</InstdAmt>'.$CrLf;
@ -1722,8 +1723,8 @@ class BonPrelevement extends CommonObject
$XML_DEBITOR .= ' </Id>'.$CrLf;
$XML_DEBITOR .= ' </DbtrAcct>'.$CrLf;
$XML_DEBITOR .= ' <RmtInf>'.$CrLf;
// $XML_DEBITOR .=' <Ustrd>'.($row_ref.'/'.$Rowing.'/'.$Rum).'</Ustrd>'.$CrLf;
// $XML_DEBITOR .=' <Ustrd>'.dol_trunc($row_ref, 135).'</Ustrd>'.$CrLf; // 140 max
// $XML_DEBITOR .=' <Ustrd>'.($row_ref.'/'.$Rowing.'/'.$Rum).'</Ustrd>'.$CrLf;
// $XML_DEBITOR .=' <Ustrd>'.dol_trunc($row_ref, 135).'</Ustrd>'.$CrLf; // 140 max
$XML_DEBITOR .= ' <Ustrd>'.(($conf->global->PRELEVEMENT_USTRD != "") ? $conf->global->PRELEVEMENT_USTRD : dol_trunc($row_ref, 135)).'</Ustrd>'.$CrLf; // 140 max
$XML_DEBITOR .= ' </RmtInf>'.$CrLf;
$XML_DEBITOR .= ' </DrctDbtTxInf>'.$CrLf;
@ -1731,7 +1732,7 @@ class BonPrelevement extends CommonObject
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Write sender of request (me)
*
@ -1739,7 +1740,7 @@ class BonPrelevement extends CommonObject
*/
public function EnregEmetteur()
{
// phpcs:enable
// phpcs:enable
fputs($this->file, "03");
fputs($this->file, "08"); // Prelevement ordinaire
@ -1798,7 +1799,7 @@ class BonPrelevement extends CommonObject
fputs($this->file, "\n");
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Write sender of request (me).
* Note: The tag PmtInf is opened here but closed into caller
@ -1813,7 +1814,7 @@ class BonPrelevement extends CommonObject
*/
public function EnregEmetteurSEPA($configuration, $ladate, $nombre, $total, $CrLf = '\n', $format = 'FRST')
{
// phpcs:enable
// phpcs:enable
// SEPA INITIALISATION
global $conf;
@ -1892,13 +1893,13 @@ class BonPrelevement extends CommonObject
$XML_SEPA_INFO .= ' </FinInstnId>'.$CrLf;
$XML_SEPA_INFO .= ' </CdtrAgt>'.$CrLf;
/* $XML_SEPA_INFO .= ' <UltmtCdtr>'.$CrLf;
$XML_SEPA_INFO .= ' <Nm>'.$this->raison_sociale.'</Nm>'.$CrLf;
$XML_SEPA_INFO .= ' <PstlAdr>'.$CrLf;
$XML_SEPA_INFO .= ' <Ctry>'.$country[1].'</Ctry>'.$CrLf;
$XML_SEPA_INFO .= ' <AdrLine>'.$conf->global->MAIN_INFO_SOCIETE_ADDRESS.'</AdrLine>'.$CrLf;
$XML_SEPA_INFO .= ' <AdrLine>'.$conf->global->MAIN_INFO_SOCIETE_ZIP.' '.$conf->global->MAIN_INFO_SOCIETE_TOWN.'</AdrLine>'.$CrLf;
$XML_SEPA_INFO .= ' </PstlAdr>'.$CrLf;
$XML_SEPA_INFO .= ' </UltmtCdtr>'.$CrLf;*/
$XML_SEPA_INFO .= ' <Nm>'.$this->raison_sociale.'</Nm>'.$CrLf;
$XML_SEPA_INFO .= ' <PstlAdr>'.$CrLf;
$XML_SEPA_INFO .= ' <Ctry>'.$country[1].'</Ctry>'.$CrLf;
$XML_SEPA_INFO .= ' <AdrLine>'.$conf->global->MAIN_INFO_SOCIETE_ADDRESS.'</AdrLine>'.$CrLf;
$XML_SEPA_INFO .= ' <AdrLine>'.$conf->global->MAIN_INFO_SOCIETE_ZIP.' '.$conf->global->MAIN_INFO_SOCIETE_TOWN.'</AdrLine>'.$CrLf;
$XML_SEPA_INFO .= ' </PstlAdr>'.$CrLf;
$XML_SEPA_INFO .= ' </UltmtCdtr>'.$CrLf;*/
$XML_SEPA_INFO .= ' <ChrgBr>SLEV</ChrgBr>'.$CrLf;
$XML_SEPA_INFO .= ' <CdtrSchmeId>'.$CrLf;
$XML_SEPA_INFO .= ' <Id>'.$CrLf;
@ -1921,7 +1922,7 @@ class BonPrelevement extends CommonObject
return $XML_SEPA_INFO;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Write end
*
@ -1930,7 +1931,7 @@ class BonPrelevement extends CommonObject
*/
public function EnregTotal($total)
{
// phpcs:enable
// phpcs:enable
fputs($this->file, "08");
fputs($this->file, "08"); // Prelevement ordinaire
@ -1995,7 +1996,7 @@ class BonPrelevement extends CommonObject
return $this->LibStatut($this->statut, $mode);
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Return status label for a status
*

View File

@ -108,6 +108,10 @@ class ChargeSociales extends CommonObject
public $fk_project;
const STATUS_UNPAID = 0;
const STATUS_PAID = 1;
/**
* Constructor
*
@ -495,43 +499,23 @@ class ChargeSociales extends CommonObject
// Load translation files required by the page
$langs->loadLangs(array("customers","bills"));
if ($mode == 0 || $mode == 1)
if (empty($this->labelStatus) || empty($this->labelStatusShort))
{
if ($status == 0) return $langs->trans("Unpaid");
elseif ($status == 1) return $langs->trans("Paid");
}
elseif ($mode == 2)
{
if ($status == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1').' '.$langs->trans("Unpaid");
elseif ($status == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3').' '.$langs->trans("BillStatusStarted");
elseif ($status == 1) return img_picto($langs->trans("Paid"), 'statut6').' '.$langs->trans("Paid");
}
elseif ($mode == 3)
{
if ($status == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1');
elseif ($status == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3');
elseif ($status == 1) return img_picto($langs->trans("Paid"), 'statut6');
}
elseif ($mode == 4)
{
if ($status == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1').' '.$langs->trans("Unpaid");
elseif ($status == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3').' '.$langs->trans("BillStatusStarted");
elseif ($status == 1) return img_picto($langs->trans("Paid"), 'statut6').' '.$langs->trans("Paid");
}
elseif ($mode == 5)
{
if ($status == 0 && $alreadypaid <= 0) return $langs->trans("Unpaid").' '.img_picto($langs->trans("Unpaid"), 'statut1');
elseif ($status == 0 && $alreadypaid > 0) return $langs->trans("BillStatusStarted").' '.img_picto($langs->trans("BillStatusStarted"), 'statut3');
elseif ($status == 1) return $langs->trans("Paid").' '.img_picto($langs->trans("Paid"), 'statut6');
}
elseif ($mode == 6)
{
if ($status == 0 && $alreadypaid <= 0) return $langs->trans("Unpaid").' '.img_picto($langs->trans("Unpaid"), 'statut1');
elseif ($status == 0 && $alreadypaid > 0) return $langs->trans("BillStatusStarted").' '.img_picto($langs->trans("BillStatusStarted"), 'statut3');
elseif ($status == 1) return $langs->trans("Paid").' '.img_picto($langs->trans("Paid"), 'statut6');
global $langs;
//$langs->load("mymodule");
$this->labelStatus[self::STATUS_UNPAID] = $langs->trans('Unpaid');
$this->labelStatus[self::STATUS_PAID] = $langs->trans('Paid');
if ($status == 0 && $alreadypaid > 0) $this->labelStatus[self::STATUS_UNPAID] = $langs->trans("BillStatusStarted");
$this->labelStatusShort[self::STATUS_UNPAID] = $langs->trans('Draft');
$this->labelStatusShort[self::STATUS_PAID] = $langs->trans('Enabled');
if ($status == 0 && $alreadypaid > 0) $this->labelStatusShort[self::STATUS_UNPAID] = $langs->trans("BillStatusStarted");
}
else return "Error, mode/status not found";
$statusType = 'status1';
if ($status == 0 && $alreadypaid > 0) $statusType = 'status3';
if ($status == 1) $statusType = 'status6';
return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode);
}

View File

@ -1260,12 +1260,14 @@ class pdf_einstein extends ModelePDFCommandes
{
if ($this->emetteur->logo)
{
$logodir = $conf->mycompany->dir_output;
if (! empty($conf->mycompany->multidir_output[$object->entity])) $logodir = $conf->mycompany->multidir_output[$object->entity];
if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO))
{
$logo=$conf->mycompany->multidir_output[$object->entity].'/logos/thumbs/'.$this->emetteur->logo_small;
$logo = $logodir.'/logos/thumbs/'.$this->emetteur->logo_small;
}
else {
$logo=$conf->mycompany->multidir_output[$object->entity].'/logos/'.$this->emetteur->logo;
$logo = $logodir.'/logos/'.$this->emetteur->logo;
}
if (is_readable($logo))
{

View File

@ -1393,12 +1393,14 @@ class pdf_eratosthene extends ModelePDFCommandes
{
if ($this->emetteur->logo)
{
$logodir = $conf->mycompany->dir_output;
if (! empty($conf->mycompany->multidir_output[$object->entity])) $logodir = $conf->mycompany->multidir_output[$object->entity];
if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO))
{
$logo=$conf->mycompany->multidir_output[$object->entity].'/logos/thumbs/'.$this->emetteur->logo_small;
$logo = $logodir.'/logos/thumbs/'.$this->emetteur->logo_small;
}
else {
$logo=$conf->mycompany->multidir_output[$object->entity].'/logos/'.$this->emetteur->logo;
$logo = $logodir.'/logos/'.$this->emetteur->logo;
}
if (is_readable($logo))
{

View File

@ -1618,12 +1618,14 @@ class pdf_crabe extends ModelePDFFactures
{
if ($this->emetteur->logo)
{
$logodir = $conf->mycompany->dir_output;
if (! empty($conf->mycompany->multidir_output[$object->entity])) $logodir = $conf->mycompany->multidir_output[$object->entity];
if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO))
{
$logo=$conf->mycompany->multidir_output[$object->entity].'/logos/thumbs/'.$this->emetteur->logo_small;
$logo = $logodir.'/logos/thumbs/'.$this->emetteur->logo_small;
}
else {
$logo=$conf->mycompany->multidir_output[$object->entity].'/logos/'.$this->emetteur->logo;
$logo = $logodir.'/logos/'.$this->emetteur->logo;
}
if (is_readable($logo))
{

View File

@ -1834,12 +1834,14 @@ class pdf_sponge extends ModelePDFFactures
{
if ($this->emetteur->logo)
{
$logodir = $conf->mycompany->dir_output;
if (! empty($conf->mycompany->multidir_output[$object->entity])) $logodir = $conf->mycompany->multidir_output[$object->entity];
if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO))
{
$logo=$conf->mycompany->multidir_output[$object->entity].'/logos/thumbs/'.$this->emetteur->logo_small;
$logo = $logodir.'/logos/thumbs/'.$this->emetteur->logo_small;
}
else {
$logo=$conf->mycompany->multidir_output[$object->entity].'/logos/'.$this->emetteur->logo;
$logo = $logodir.'/logos/'.$this->emetteur->logo;
}
if (is_readable($logo))
{

View File

@ -1467,12 +1467,14 @@ class pdf_azur extends ModelePDFPropales
{
if ($this->emetteur->logo)
{
$logodir = $conf->mycompany->dir_output;
if (! empty($conf->mycompany->multidir_output[$object->entity])) $logodir = $conf->mycompany->multidir_output[$object->entity];
if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO))
{
$logo=$conf->mycompany->multidir_output[$object->entity].'/logos/thumbs/'.$this->emetteur->logo_small;
$logo = $logodir.'/logos/thumbs/'.$this->emetteur->logo_small;
}
else {
$logo=$conf->mycompany->multidir_output[$object->entity].'/logos/'.$this->emetteur->logo;
$logo = $logodir.'/logos/'.$this->emetteur->logo;
}
if (is_readable($logo))
{

View File

@ -1503,12 +1503,14 @@ class pdf_cyan extends ModelePDFPropales
{
if ($this->emetteur->logo)
{
$logodir = $conf->mycompany->dir_output;
if (! empty($conf->mycompany->multidir_output[$object->entity])) $logodir = $conf->mycompany->multidir_output[$object->entity];
if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO))
{
$logo=$conf->mycompany->multidir_output[$object->entity].'/logos/thumbs/'.$this->emetteur->logo_small;
$logo = $logodir.'/logos/thumbs/'.$this->emetteur->logo_small;
}
else {
$logo=$conf->mycompany->multidir_output[$object->entity].'/logos/'.$this->emetteur->logo;
$logo = $logodir.'/logos/'.$this->emetteur->logo;
}
if (is_readable($logo))
{

View File

@ -251,9 +251,9 @@ ShowListTicketWithTrackId=Display ticket list from track ID
ShowTicketWithTrackId=Display ticket from track ID
TicketPublicDesc=You can create a support ticket or check from an existing ID.
YourTicketSuccessfullySaved=Ticket has been successfully saved!
MesgInfosPublicTicketCreatedWithTrackId=A new ticket has been created with ID %s.
MesgInfosPublicTicketCreatedWithTrackId=A new ticket has been created with ID %s and Ref %s.
PleaseRememberThisId=Please keep the tracking number that we might ask you later.
TicketNewEmailSubject=Ticket creation confirmation
TicketNewEmailSubject=Ticket creation confirmation - Ref %s
TicketNewEmailSubjectCustomer=New support ticket
TicketNewEmailBody=This is an automatic email to confirm you have registered a new ticket.
TicketNewEmailBodyCustomer=This is an automatic email to confirm a new ticket has just been created into your account.
@ -272,7 +272,7 @@ Subject=Subject
ViewTicket=View ticket
ViewMyTicketList=View my ticket list
ErrorEmailMustExistToCreateTicket=Error: email address not found in our database
TicketNewEmailSubjectAdmin=New ticket created
TicketNewEmailSubjectAdmin=New ticket created - Ref %s
TicketNewEmailBodyAdmin=<p>Ticket has just been created with ID #%s, see information:</p>
SeeThisTicketIntomanagementInterface=See ticket in management interface
TicketPublicInterfaceForbidden=The public interface for the tickets was not enabled

View File

@ -105,6 +105,10 @@ class Loan extends CommonObject
public $fk_project;
const STATUS_UNPAID = 0;
const STATUS_PAID = 1;
/**
* Constructor
*
@ -425,47 +429,29 @@ class Loan extends CommonObject
*/
public function LibStatut($status, $mode = 0, $alreadypaid = -1)
{
// phpcs:enable
// phpcs:enable
global $langs;
$langs->loadLangs(array("customers", "bills"));
if ($mode == 0 || $mode == 1)
// Load translation files required by the page
$langs->loadLangs(array("customers","bills"));
if (empty($this->labelStatus) || empty($this->labelStatusShort))
{
if ($status == 0) return $langs->trans("Unpaid");
elseif ($status == 1) return $langs->trans("Paid");
}
elseif ($mode == 2)
{
if ($status == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1').' '.$langs->trans("Unpaid");
elseif ($status == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3').' '.$langs->trans("BillStatusStarted");
elseif ($status == 1) return img_picto($langs->trans("Paid"), 'statut6').' '.$langs->trans("Paid");
}
elseif ($mode == 3)
{
if ($status == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1');
elseif ($status == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3');
elseif ($status == 1) return img_picto($langs->trans("Paid"), 'statut6');
}
elseif ($mode == 4)
{
if ($status == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1').' '.$langs->trans("Unpaid");
elseif ($status == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3').' '.$langs->trans("BillStatusStarted");
elseif ($status == 1) return img_picto($langs->trans("Paid"), 'statut6').' '.$langs->trans("Paid");
}
elseif ($mode == 5)
{
if ($status == 0 && $alreadypaid <= 0) return $langs->trans("Unpaid").' '.img_picto($langs->trans("Unpaid"), 'statut1');
elseif ($status == 0 && $alreadypaid > 0) return $langs->trans("BillStatusStarted").' '.img_picto($langs->trans("BillStatusStarted"), 'statut3');
elseif ($status == 1) return $langs->trans("Paid").' '.img_picto($langs->trans("Paid"), 'statut6');
}
elseif ($mode == 6)
{
if ($status == 0 && $alreadypaid <= 0) return $langs->trans("Unpaid").' '.img_picto($langs->trans("Unpaid"), 'statut1');
elseif ($status == 0 && $alreadypaid > 0) return $langs->trans("BillStatusStarted").' '.img_picto($langs->trans("BillStatusStarted"), 'statut3');
elseif ($status == 1) return $langs->trans("Paid").' '.img_picto($langs->trans("Paid"), 'statut6');
global $langs;
//$langs->load("mymodule");
$this->labelStatus[self::STATUS_UNPAID] = $langs->trans('Unpaid');
$this->labelStatus[self::STATUS_PAID] = $langs->trans('Paid');
if ($status == 0 && $alreadypaid > 0) $this->labelStatus[self::STATUS_UNPAID] = $langs->trans("BillStatusStarted");
$this->labelStatusShort[self::STATUS_UNPAID] = $langs->trans('Draft');
$this->labelStatusShort[self::STATUS_PAID] = $langs->trans('Enabled');
if ($status == 0 && $alreadypaid > 0) $this->labelStatusShort[self::STATUS_UNPAID] = $langs->trans("BillStatusStarted");
}
else return "Error, mode/status not found";
$statusType = 'status1';
if ($status == 0 && $alreadypaid > 0) $statusType = 'status3';
if ($status == 1) $statusType = 'status6';
return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode);
}

View File

@ -49,7 +49,8 @@ if (!$sortorder) $sortorder = "DESC";
$search_ref = GETPOST('search_ref', 'int');
$search_label = GETPOST('search_label', 'alpha');
$search_amount = GETPOST('search_amount', 'alpha');
$filtre = GETPOST("filtre");
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'myobjectlist'; // To manage different context of search
$optioncss = GETPOST('optioncss', 'alpha');
// Purge search criteria
@ -77,10 +78,6 @@ $sql .= " WHERE l.entity = ".$conf->entity;
if ($search_amount) $sql .= natural_search("l.capital", $search_amount, 1);
if ($search_ref) $sql .= " AND l.rowid = ".$db->escape($search_ref);
if ($search_label) $sql .= natural_search("l.label", $search_label);
if ($filtre) {
$filtre = str_replace(":", "=", $filtre);
$sql .= " AND ".$filtre;
}
$sql .= " GROUP BY l.rowid, l.label, l.capital, l.paid, l.datestart, l.dateend";
$sql .= $db->order($sortfield, $sortorder);
@ -108,10 +105,10 @@ if ($resql)
$param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
if ($search_ref) $param.="&amp;search_ref=".urlencode($search_ref);
if ($search_label) $param.="&amp;search_label=".urlencode($search_user);
if ($search_amount) $param.="&amp;search_amount=".urlencode($search_amount_ht);
if ($optioncss != '') $param.='&amp;optioncss='.urlencode($optioncss);
if ($search_ref) $param.="&search_ref=".urlencode($search_ref);
if ($search_label) $param.="&search_label=".urlencode($search_label);
if ($search_amount) $param.="&search_amount=".urlencode($search_amount);
if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
$newcardbutton='';
if ($user->rights->loan->write)
@ -130,6 +127,8 @@ if ($resql)
print_barre_liste($langs->trans("Loans"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy.png', 0, $newcardbutton, '', $limit);
$moreforfilter = '';
print '<div class="div-table-responsive">';
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
@ -157,7 +156,7 @@ if ($resql)
print_liste_field_titre('');
print "</tr>\n";
while ($i < min($num, $limit))
while ($i < ($limit ? min($num, $limit) : $num))
{
$obj = $db->fetch_object($resql);
$loan_static->id = $obj->rowid;
@ -190,6 +189,14 @@ if ($resql)
$i++;
}
// If no record found
if ($num == 0)
{
$colspan = 7;
//foreach ($arrayfields as $key => $val) { if (!empty($val['checked'])) $colspan++; }
print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoRecordFound").'</td></tr>';
}
print "</table>";
print '</div>';
print "</form>\n";

View File

@ -48,17 +48,17 @@ $linkback = '<a href="'.DOL_URL_ROOT.'/loan/list.php?restore_lastsearch_values=1
$morehtmlref = '<div class="refidno">';
// Ref loan
$morehtmlref .= $form->editfieldkey("Label", 'label', $object->label, $object, $user->rights->loan->write, 'string', '', 0, 1);
$morehtmlref .= $form->editfieldval("Label", 'label', $object->label, $object, $user->rights->loan->write, 'string', '', null, null, '', 1);
$morehtmlref .= $form->editfieldkey("Label", 'label', $object->label, $object, 0, 'string', '', 0, 1);
$morehtmlref .= $form->editfieldval("Label", 'label', $object->label, $object, 0, 'string', '', null, null, '', 1);
// Project
if (!empty($conf->projet->enabled))
{
$langs->loadLangs(array("projects"));
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
$morehtmlref .= '<br>'.$langs->trans('Project').' : ';
if ($user->rights->loan->write)
{
if ($action != 'classify')
$morehtmlref .= '<a href="'.$_SERVER['PHP_SELF'].'?action=classify&amp;id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> : ';
//$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
@ -83,6 +83,9 @@ if (!empty($conf->projet->enabled))
}
}
$morehtmlref .= '</div>';
$morehtmlright = '';
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright);
if ($action == 'createecheancier') {
@ -140,8 +143,6 @@ if ($action == 'updateecheancier') {
$echeance = new LoanSchedule($db);
$echeance->fetchAll($object->id);
$var = !$var;
?>
<script type="text/javascript" language="javascript">
@ -187,6 +188,8 @@ if (count($echeance->lines) > 0)
} else {
print '<input type="hidden" name="action" value="createecheancier">';
}
print '<div class="div-table-responsive-no-min">';
print '<table class="border centpercent">';
print '<tr class="liste_titre">';
$colspan = 6;
@ -197,12 +200,12 @@ print '</th>';
print '</tr>';
print '<tr class="liste_titre">';
print '<th width="5%" class="center">'.$langs->trans("Term").'</th>';
print '<th width="5%" class="center">'.$langs->trans("Date").'</th>';
print '<th width="15%" class="center">'.$langs->trans("Insurance");
print '<th width="15%" class="center">'.$langs->trans("InterestAmount").'</th>';
print '<th width="10%" class="center">'.$langs->trans("Amount").'</th>';
print '<th width="40%" class="center">'.$langs->trans("CapitalRemain");
print '<th class="center">'.$langs->trans("Term").'</th>';
print '<th class="center">'.$langs->trans("Date").'</th>';
print '<th class="center">'.$langs->trans("Insurance");
print '<th class="center">'.$langs->trans("InterestAmount").'</th>';
print '<th class="center">'.$langs->trans("Amount").'</th>';
print '<th class="center">'.$langs->trans("CapitalRemain");
print '<br>('.price($object->capital, 0, '', 1, -1, -1, $conf->currency).')';
print '<input type="hidden" name="hi_capital0" id ="hi_capital0" value="'.$object->capital.'">';
print '</th>';
@ -276,8 +279,11 @@ elseif (count($echeance->lines) > 0)
}
print '</table>';
print '</div>';
print '</br>';
print '</br>';
if (count($echeance->lines) == 0) $label = $langs->trans("Create");
else $label = $langs->trans("Save");
print '<div class="center"><input class="button" type="submit" value="'.$label.'"></div>';

View File

@ -1877,6 +1877,9 @@ class Product extends CommonObject
if (empty($newnpr)) {
$newnpr = 0;
}
if (empty($newminprice)) {
$newminprice = 0;
}
// Check parameters
if ($newvat == '') {

View File

@ -471,18 +471,26 @@ if ($ispaymentok)
if (! $customer && $TRANSACTIONID) // Not linked to a stripe customer, we make the link
{
dol_syslog("No stripe profile found, so we add it", LOG_DEBUG, 0, '_payment');
dol_syslog("No stripe profile found, so we add it for TRANSACTIONID = ".$TRANSACTIONID, LOG_DEBUG, 0, '_payment');
$ch = \Stripe\Charge::retrieve($TRANSACTIONID); // contains the charge id
$stripecu = $ch->customer; // value 'cus_....'
try {
$ch = \Stripe\Charge::retrieve($TRANSACTIONID); // contains the charge id
$stripecu = $ch->customer; // value 'cus_....'
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "societe_account (fk_soc, login, key_account, site, status, entity, date_creation, fk_user_creat)";
$sql .= " VALUES (".$object->fk_soc.", '', '".$db->escape($stripecu)."', 'stripe', " . $servicestatus . ", " . $conf->entity . ", '".$db->idate(dol_now())."', 0)";
$resql = $db->query($sql);
if (! $resql)
{
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "societe_account (fk_soc, login, key_account, site, status, entity, date_creation, fk_user_creat)";
$sql .= " VALUES (".$object->fk_soc.", '', '".$db->escape($stripecu)."', 'stripe', " . $servicestatus . ", " . $conf->entity . ", '".$db->idate(dol_now())."', 0)";
$resql = $db->query($sql);
if (! $resql)
{
$error++;
$errmsg='Failed to save customer stripe id in database ; '.$db->lasterror();
$postactionmessages[] = $errmsg;
$ispostactionok = -1;
}
}
catch(Exception $e) {
$error++;
$errmsg='Failed to save customer stripe id in database ; '.$db->lasterror();
$errmsg='Failed to save customer stripe id in database ; '.$e->getMessage();
$postactionmessages[] = $errmsg;
$ispostactionok = -1;
}

View File

@ -203,7 +203,7 @@ if ($action == 'create_ticket' && GETPOST('add', 'alpha')) {
// Send email to customer
$subject = '['.$conf->global->MAIN_INFO_SOCIETE_NOM.'] '.$langs->transnoentities('TicketNewEmailSubject');
$subject = '['.$conf->global->MAIN_INFO_SOCIETE_NOM.'] '.$langs->transnoentities('TicketNewEmailSubject', $object->ref);
$message .= ($conf->global->TICKET_MESSAGE_MAIL_NEW ? $conf->global->TICKET_MESSAGE_MAIL_NEW : $langs->transnoentities('TicketNewEmailBody'))."\n\n";
$message .= $langs->transnoentities('TicketNewEmailBodyInfosTicket')."\n";
@ -245,7 +245,7 @@ if ($action == 'create_ticket' && GETPOST('add', 'alpha')) {
if ($sendto)
{
$subject = '['.$conf->global->MAIN_INFO_SOCIETE_NOM.'] '.$langs->transnoentities('TicketNewEmailSubjectAdmin');
$subject = '['.$conf->global->MAIN_INFO_SOCIETE_NOM.'] '.$langs->transnoentities('TicketNewEmailSubjectAdmin', $object->ref);
$message_admin = $langs->transnoentities('TicketNewEmailBodyAdmin', $object->track_id)."\n\n";
$message_admin .= '<ul><li>'.$langs->trans('Title').' : '.$object->subject.'</li>';
$message_admin .= '<li>'.$langs->trans('Type').' : '.$object->type_label.'</li>';
@ -314,7 +314,7 @@ if ($action == 'create_ticket' && GETPOST('add', 'alpha')) {
//setEventMessages($langs->trans('YourTicketSuccessfullySaved'), null, 'mesgs');
// Make a redirect to avoid to have ticket submitted twice if we make back
setEventMessages($langs->trans('MesgInfosPublicTicketCreatedWithTrackId', '<strong>'.$object->track_id.'</strong>'), null, 'warnings');
setEventMessages($langs->trans('MesgInfosPublicTicketCreatedWithTrackId', '<strong>'.$object->track_id.'</strong>', '<strong>' . $object->ref . '</strong>'), null, 'warnings');
setEventMessages($langs->trans('PleaseRememberThisId'), null, 'warnings');
header("Location: index.php");
exit;