simplify function
This commit is contained in:
parent
11a978ca08
commit
3a041eed44
@ -168,12 +168,10 @@ abstract class ModeleThirdPartyCode
|
|||||||
$sql = "";
|
$sql = "";
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql) {
|
||||||
{
|
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while ($i < $num)
|
while ($i < $num) {
|
||||||
{
|
|
||||||
$row = $db->fetch_row($resql);
|
$row = $db->fetch_row($resql);
|
||||||
$liste[$row[0]] = $row[1];
|
$liste[$row[0]] = $row[1];
|
||||||
$i++;
|
$i++;
|
||||||
@ -240,12 +238,16 @@ abstract class ModeleThirdPartyCode
|
|||||||
$s .= '<br>';
|
$s .= '<br>';
|
||||||
if ($type == 0 || $type == -1) {
|
if ($type == 0 || $type == -1) {
|
||||||
$nextval = $this->getNextValue($soc, 0);
|
$nextval = $this->getNextValue($soc, 0);
|
||||||
if (empty($nextval)) $nextval = $langs->trans("Undefined");
|
if (empty($nextval)) {
|
||||||
|
$nextval = $langs->trans("Undefined");
|
||||||
|
}
|
||||||
$s .= $langs->trans("NextValue").($type == -1 ? ' ('.$langs->trans("Customer").')' : '').': <b>'.$nextval.'</b><br>';
|
$s .= $langs->trans("NextValue").($type == -1 ? ' ('.$langs->trans("Customer").')' : '').': <b>'.$nextval.'</b><br>';
|
||||||
}
|
}
|
||||||
if ($type == 1 || $type == -1) {
|
if ($type == 1 || $type == -1) {
|
||||||
$nextval = $this->getNextValue($soc, 1);
|
$nextval = $this->getNextValue($soc, 1);
|
||||||
if (empty($nextval)) $nextval = $langs->trans("Undefined");
|
if (empty($nextval)) {
|
||||||
|
$nextval = $langs->trans("Undefined");
|
||||||
|
}
|
||||||
$s .= $langs->trans("NextValue").($type == -1 ? ' ('.$langs->trans("Supplier").')' : '').': <b>'.$nextval.'</b>';
|
$s .= $langs->trans("NextValue").($type == -1 ? ' ('.$langs->trans("Supplier").')' : '').': <b>'.$nextval.'</b>';
|
||||||
}
|
}
|
||||||
return $s;
|
return $s;
|
||||||
@ -361,13 +363,17 @@ abstract class ModeleAccountancyCode
|
|||||||
if ($type == 0 || $type == -1) {
|
if ($type == 0 || $type == -1) {
|
||||||
$result = $this->get_code($db, $soc, 'customer');
|
$result = $this->get_code($db, $soc, 'customer');
|
||||||
$nextval = $this->code;
|
$nextval = $this->code;
|
||||||
if (empty($nextval)) $nextval = $langs->trans("Undefined");
|
if (empty($nextval)) {
|
||||||
|
$nextval = $langs->trans("Undefined");
|
||||||
|
}
|
||||||
$s .= $langs->trans("NextValue").($type == -1 ? ' ('.$langs->trans("Customer").')' : '').': <b>'.$nextval.'</b><br>';
|
$s .= $langs->trans("NextValue").($type == -1 ? ' ('.$langs->trans("Customer").')' : '').': <b>'.$nextval.'</b><br>';
|
||||||
}
|
}
|
||||||
if ($type == 1 || $type == -1) {
|
if ($type == 1 || $type == -1) {
|
||||||
$result = $this->get_code($db, $soc, 'supplier');
|
$result = $this->get_code($db, $soc, 'supplier');
|
||||||
$nextval = $this->code;
|
$nextval = $this->code;
|
||||||
if (empty($nextval)) $nextval = $langs->trans("Undefined");
|
if (empty($nextval)) {
|
||||||
|
$nextval = $langs->trans("Undefined");
|
||||||
|
}
|
||||||
$s .= $langs->trans("NextValue").($type == -1 ? ' ('.$langs->trans("Supplier").')' : '').': <b>'.$nextval.'</b>';
|
$s .= $langs->trans("NextValue").($type == -1 ? ' ('.$langs->trans("Supplier").')' : '').': <b>'.$nextval.'</b>';
|
||||||
}
|
}
|
||||||
return $s;
|
return $s;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user