Browse Source

Debug v15

Laurent Destailleur 3 years ago
parent
commit
adec35d4b1

+ 1 - 1
htdocs/core/class/translate.class.php

@@ -579,7 +579,7 @@ class Translate
 			$newstr = $this->getLabelFromKey($db, $reg[1], 'c_currencies', 'code_iso', 'label');
 		} elseif (preg_match('/^SendingMethod([0-9A-Z]+)$/i', $key, $reg)) {
 			$newstr = $this->getLabelFromKey($db, $reg[1], 'c_shipment_mode', 'code', 'libelle');
-		} elseif (preg_match('/^PaymentTypeShort([0-9A-Z]+)$/i', $key, $reg)) {
+		} elseif (preg_match('/^PaymentType(?:Short)?([0-9A-Z]+)$/i', $key, $reg)) {
 			$newstr = $this->getLabelFromKey($db, $reg[1], 'c_paiement', 'code', 'libelle', '', 1);
 		} elseif (preg_match('/^OppStatus([0-9A-Z]+)$/i', $key, $reg)) {
 			$newstr = $this->getLabelFromKey($db, $reg[1], 'c_lead_status', 'code', 'label');

+ 7 - 4
htdocs/core/lib/invoice.lib.php

@@ -509,12 +509,14 @@ function getNumberInvoicesPieChart($mode)
 
 			while ($i < $num) {
 				$obj = $db->fetch_object($resql);
-				/*$dataseries = array(array($langs->trans('InvoiceLate30Days'), $obj->nblate30)
+				/*
+				$dataseries = array(array($langs->trans('InvoiceLate30Days'), $obj->nblate30)
 									,array($langs->trans('InvoiceLate15Days'), $obj->nblate15 - $obj->nblate30)
 									,array($langs->trans('InvoiceLateMinus15Days'), $obj->nblatenow - $obj->nblate15)
 									,array($langs->trans('InvoiceNotLate'), $obj->nbnotlatenow - $obj->nbnotlate15)
 									,array($langs->trans('InvoiceNotLate15Days'), $obj->nbnotlate15 - $obj->nbnotlate30)
-									,array($langs->trans('InvoiceNotLate30Days'), $obj->nbnotlate30));*/
+									,array($langs->trans('InvoiceNotLate30Days'), $obj->nbnotlate30));
+				*/
 				$dataseries[$i]=array($langs->trans('NbOfOpenInvoices'), $obj->nblate30, $obj->nblate15 - $obj->nblate30, $obj->nblatenow - $obj->nblate15, $obj->nbnotlatenow - $obj->nbnotlate15, $obj->nbnotlate15 - $obj->nbnotlate30, $obj->nbnotlate30);
 				$i++;
 			}
@@ -561,8 +563,9 @@ function getNumberInvoicesPieChart($mode)
 				$dolgraph->setShowLegend(2);
 				$dolgraph->setShowPercent(1);
 				$dolgraph->SetType(array('bars', 'bars', 'bars', 'bars', 'bars', 'bars'));
-				$dolgraph->setHeight('160');
-				$dolgraph->setWidth('400');
+				//$dolgraph->SetType(array('pie'));
+				$dolgraph->setHeight('160');	/* 160 min is required to show the 6 lines of legend */
+				$dolgraph->setWidth('450');
 				$dolgraph->setHideXValues(true);
 				if ($mode == 'customers') {
 					$dolgraph->draw('idgraphcustomerinvoices');

+ 2 - 2
htdocs/langs/en_US/bills.lang

@@ -84,8 +84,6 @@ PaymentRule=Payment rule
 PaymentMode=Payment Type
 DefaultPaymentMode=Default Payment Type
 DefaultBankAccount=Default Bank Account
-PaymentTypeDC=Debit/Credit Card
-PaymentTypePP=PayPal
 IdPaymentMode=Payment Type (id)
 CodePaymentMode=Payment Type (code)
 LabelPaymentMode=Payment Type (label)
@@ -450,6 +448,8 @@ PaymentTypeTRA=Bank draft
 PaymentTypeShortTRA=Draft
 PaymentTypeFAC=Factor
 PaymentTypeShortFAC=Factor
+PaymentTypeDC=Debit/Credit Card
+PaymentTypePP=PayPal
 BankDetails=Bank details
 BankCode=Bank code
 DeskCode=Branch code

+ 3 - 1
htdocs/salaries/payment_salary/card.php

@@ -138,7 +138,9 @@ print '</td></tr>';*/
 print '<tr><td>'.$langs->trans('Date').'</td><td colspan="3">'.dol_print_date($object->datep, 'day').'</td></tr>';
 
 // Mode
-print '<tr><td>'.$langs->trans('Mode').'</td><td colspan="3">'.$langs->trans("PaymentType".$object->type_code).'</td></tr>';
+print '<tr><td>'.$langs->trans('Mode').'</td><td colspan="3">';
+print $langs->trans("PaymentType".$object->type_code);
+print '</td></tr>';
 
 // Numero
 print '<tr><td>'.$langs->trans('Numero').'</td><td colspan="3">'.$object->num_payment.'</td></tr>';

+ 5 - 2
htdocs/salaries/payments.php

@@ -178,7 +178,7 @@ if (empty($reshook)) {
 		$search_date_start = '';
 		$search_date_end = '';
 		$search_dateep_start = '';
-				$search_dateep_end = '';
+		$search_dateep_end = '';
 		$search_amount = "";
 		$search_account = '';
 		$search_fk_bank = '';
@@ -553,6 +553,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
 		$totalarray['nbfield']++;
 	}
 
+	// Ref salary
 	print "<td>".$salstatic->getNomUrl(1)."</td>\n";
 	if (!$i) {
 		$totalarray['nbfield']++;
@@ -587,7 +588,9 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
 	}
 
 	// Type
-	print '<td>'.$langs->trans("PaymentTypeShort".$obj->payment_code).'</td>';
+	print '<td>';
+	print $langs->trans("PaymentTypeShort".$obj->payment_code);
+	print '</td>';
 	if (!$i) {
 		$totalarray['nbfield']++;
 	}

+ 3 - 1
htdocs/theme/eldy/global.inc.php

@@ -4486,7 +4486,9 @@ table.titlemodulehelp tr td img.widthpictotitle { width: 80px; }
 
 .dolgraphtitle { margin-top: 6px; margin-bottom: 4px; }
 .dolgraphtitlecssboxes { /* margin: 0px; */ }
-.dolgraphchart canvas { width: calc(100% - 20px) !important; }
+.dolgraphchart canvas {
+	/* width: calc(100% - 20px) !important; */
+}
 .legendColorBox, .legendLabel { border: none !important; }
 div.dolgraph div.legend, div.dolgraph div.legend div { background-color: var(--dolgraphbg) !important; }
 div.dolgraph div.legend table tbody tr { height: auto; }

+ 3 - 1
htdocs/theme/md/style.css.php

@@ -4442,7 +4442,9 @@ table.titlemodulehelp tr td img.widthpictotitle { width: 80px; }
 
 .dolgraphtitle { margin-top: 6px; margin-bottom: 4px; }
 .dolgraphtitlecssboxes { /* margin: 0px; */ }
-.dolgraphchart canvas { width: calc(100% - 20px) !important; }
+.dolgraphchart canvas { 
+	/* width: calc(100% - 20px) !important; */
+}
 .legendColorBox, .legendLabel { border: none !important; }
 div.dolgraph div.legend, div.dolgraph div.legend div { background-color: rgba(255,255,255,0) !important; }
 div.dolgraph div.legend table tbody tr { height: auto; }