Debug v19

This commit is contained in:
Laurent Destailleur 2023-11-14 02:42:02 +01:00
parent e861372512
commit 0770ce640e
6 changed files with 26 additions and 10 deletions

View File

@ -1296,7 +1296,9 @@ if ($action == 'create') {
// Invoice subtype
if (getDolGlobalInt('INVOICE_SUBTYPE_ENABLED')) {
print "<tr><td>".$langs->trans("InvoiceSubtype")."</td><td>";
print $object->getSubtypeLabel('facture_rec');
if ($object->subtype > 0) {
print $object->getSubtypeLabel('facture_rec');
}
print "</td></tr>";
}

View File

@ -4542,7 +4542,9 @@ if ($action == 'create') {
// Type
print '<tr><td class="titlefield fieldname_type">'.$langs->trans('Type').'</td><td class="valuefield fieldname_type">';
print $object->getLibType(2);
print $object->getSubtypeLabel('facture');
if ($object->subtype > 0) {
print ' '.$object->getSubtypeLabel('facture');
}
if ($object->module_source) {
print ' <span class="opacitymediumbycolor paddingleft">('.$langs->trans("POS").' '.dol_escape_htmltag(ucfirst($object->module_source)).' - '.$langs->trans("Terminal").' '.dol_escape_htmltag($object->pos_source).')</span>';
}

View File

@ -2131,8 +2131,12 @@ if ($num > 0) {
// Invoice Subtype
if (!empty($arrayfields['f.subtype']['checked'])) {
print '<td class="nowraponall tdoverflowmax300" title="'.$facturestatic->getSubtypeLabel().'">';
print $facturestatic->getSubtypeLabel('facture');
$labeltoshow = '';
if ($facturestatic->subtype > 0) {
$labeltoshow = $facturestatic->getSubtypeLabel('facture');
}
print '<td class="nowraponall tdoverflowmax300" title="'.$labeltoshow.'">';
print $labeltoshow;
print "</td>";
if (!$i) {
$totalarray['nbfield']++;

View File

@ -683,7 +683,7 @@ abstract class CommonInvoice extends CommonObject
* Return label of invoice subtype
*
* @param string $table table of invoice
* @return string Label of invoice subtype
* @return string|int Label of invoice subtype or -1 if error
*/
public function getSubtypeLabel($table = '')
{
@ -702,7 +702,7 @@ abstract class CommonInvoice extends CommonObject
}
if (!empty($subtypeLabel)) {
print ' ' . $subtypeLabel;
return $subtypeLabel;
}
} else {
dol_print_error($this->db);
@ -723,13 +723,15 @@ abstract class CommonInvoice extends CommonObject
}
if (!empty($subtypeLabel)) {
print ' ' . $subtypeLabel;
return $subtypeLabel;
}
} else {
dol_print_error($this->db);
return -1;
}
}
return '';
}
/**

View File

@ -3214,7 +3214,9 @@ if ($action == 'create') {
print '<span class="badgeneutral">';
print $object->getLibType();
print '</span>';
print $object->getSubtypeLabel('facture_fourn');
if ($object->subtype > 0) {
print ' '.$object->getSubtypeLabel('facture_fourn');
}
if ($object->type == FactureFournisseur::TYPE_REPLACEMENT) {
$facreplaced = new FactureFournisseur($db);
$facreplaced->fetch($object->fk_facture_source);

View File

@ -1641,8 +1641,12 @@ while ($i < $imaxinloop) {
// Invoice Subtype
if (!empty($arrayfields['f.subtype']['checked'])) {
print '<td class="nowraponall tdoverflowmax300" title="'.$facturestatic->getSubtypeLabel().'">';
print $facturestatic->getSubtypeLabel('facture_fourn');
$labeltoshow = '';
if ($facturestatic->subtype > 0) {
$labeltoshow = $facturestatic->getSubtypeLabel('facture_fourn');
}
print '<td class="nowraponall tdoverflowmax300" title="'.$labeltoshow.'">';
print $labeltoshow;
print "</td>";
if (!$i) {
$totalarray['nbfield']++;