소스 검색

Debug v19

Laurent Destailleur 1 년 전
부모
커밋
0770ce640e

+ 3 - 1
htdocs/compta/facture/card-rec.php

@@ -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>";
 		}
 

+ 3 - 1
htdocs/compta/facture/card.php

@@ -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>';
 		}

+ 6 - 2
htdocs/compta/facture/list.php

@@ -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']++;

+ 5 - 3
htdocs/core/class/commoninvoice.class.php

@@ -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 '';
 	}
 
 	/**

+ 3 - 1
htdocs/fourn/facture/card.php

@@ -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);

+ 6 - 2
htdocs/fourn/facture/list.php

@@ -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']++;