Răsfoiți Sursa

[200~Számlalista megjelenítése comm/action/card.php?id=655

szollosil 1 an în urmă
părinte
comite
42cb127f79
4 a modificat fișierele cu 77 adăugiri și 6 ștergeri
  1. 64 1
      comm/action/card.php
  2. 3 3
      core/lib/company.lib.php
  3. 5 1
      langs/en_GB/admin.lang
  4. 5 1
      langs/hu_HU/admin.lang

+ 64 - 1
comm/action/card.php

@@ -2542,8 +2542,10 @@ if ($id > 0) {
 			$delallowed = $user->rights->agenda->myactions->create;
 
 
-			print $formfile->showdocuments('actions', $object->id, $filedir, $urlsource, $genallowed, $delallowed, '', 0, 0, 0, 0, 0, '', '', '', $langs->getDefaultLang());
+			//print $formfile->showdocuments('actions', $object->id, $filedir, $urlsource, $genallowed, $delallowed, '', 0, 0, 0, 0, 0, '', '', '', $langs->getDefaultLang());
 
+			print showFactures($id);
+			
 			print '</div><div class="fichehalfright">';
 
 
@@ -2555,3 +2557,64 @@ if ($id > 0) {
 // End of page
 llxFooter();
 $db->close();
+
+function listOfFactures($id)
+{
+	global $db, $langs;
+	$facturesString = '';
+	$resultFactures = getAllFacturesOfThisEvent($id);
+	if ($db->num_rows($resultFactures) > 0) {
+		$facturesString .= '<table>';
+		while ($factures = $db->fetch_object($resultFactures)) {
+			$login = $factures->login == 'curluser' ? $langs->trans('CrossShopping') : $factures->login;
+			$username = $factures->login == 'curluser' ? '' : $factures->firstname . ' ' . $factures->lastname;
+			$facturesString .= '<tr><td style="font-weight: bold;">' . $factures->invoice_number . '</td><td>' . $login . '</td><td>' . $username . '</td></tr>';
+		}
+		$facturesString .= '</table>';
+	} else {
+		$facturesString .= $langs->trans('None');
+	}
+	return $facturesString;
+}
+
+function getAllFacturesOfThisEvent($id){
+	global $db;
+	$sqlFactures = "SELECT bh.invoice_number, usr.login, usr.firstname, usr.lastname 
+		FROM llx_booking_bookinghistory as bh
+		INNER JOIN llx_user as usr ON usr.rowid = bh.fk_user_creat
+		WHERE bh.fk_event = {$id}";
+	return $db->query($sqlFactures);
+}
+
+function showFactures($id){
+	global $db, $langs;
+	$NumberOfFactures = $db->num_rows(getAllFacturesOfThisEvent($id));
+
+	return '
+			<table class="centpercent notopnoleftnoright table-fiche-title">
+				<tbody>
+					<tr class="titre">
+						<td class="nobordernopadding valignmiddle col-title">
+							<div class="titre inline-block">
+								' . $langs->trans('ListOfFactures') . ' (' . $NumberOfFactures . ')
+							</div>
+						</td>
+					</tr>
+				</tbody>
+			</table>
+
+			<div class="div-table-responsive-no-min">
+				<table class="liste formdoc noborder centpercent">
+					<tbody>
+						<tr>
+							<td colspan="4">
+								<span class="opacitymedium">
+									' . listOfFactures($id) . '
+								</span>
+							</td>
+						</tr>
+					</tbody>
+				</table>
+			</div>';
+
+}

+ 3 - 3
core/lib/company.lib.php

@@ -1856,7 +1856,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
 		$out .= getTitleFieldOfList("Label", 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder);
 		$out .= getTitleFieldOfList("Date", 0, $_SERVER["PHP_SELF"], 'a.datep,a.id', '', $param, '', $sortfield, $sortorder, 'center ');
 		$out .= getTitleFieldOfList("RelatedObjects", 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder);
-		$out .= getTitleFieldOfList("ActionOnContact", 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'tdoverflowmax125 ', 0, '', 0);
+		//$out .= getTitleFieldOfList("ActionOnContact", 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'tdoverflowmax125 ', 0, '', 0);
 		$out .= getTitleFieldOfList("Status", 0, $_SERVER["PHP_SELF"], 'a.percent', '', $param, '', $sortfield, $sortorder, 'center ');
 		$out .= getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'maxwidthsearch ');
 		$out .= '</tr>';
@@ -1999,7 +1999,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
 			$out .= '</td>';
 
 			// Contact(s) for action
-			if (isset($histo[$key]['socpeopleassigned']) && is_array($histo[$key]['socpeopleassigned']) && count($histo[$key]['socpeopleassigned']) > 0) {
+			/* if (isset($histo[$key]['socpeopleassigned']) && is_array($histo[$key]['socpeopleassigned']) && count($histo[$key]['socpeopleassigned']) > 0) {
 				$out .= '<td class="valignmiddle">';
 				$contact = new Contact($db);
 				foreach ($histo[$key]['socpeopleassigned'] as $cid => $value) {
@@ -2028,7 +2028,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
 				$out .= '<td width="120">'.$contactstatic->getNomUrl(-1, '', 10).'</td>';
 			} else {
 				$out .= '<td>&nbsp;</td>';
-			}
+			} */
 
 			// Status
 			$out .= '<td class="nowrap center">'.$actionstatic->LibStatut($histo[$key]['percent'], 2, 0, $histo[$key]['datestart']).'</td>';

+ 5 - 1
langs/en_GB/admin.lang

@@ -51,4 +51,8 @@ tax_identification_number=Tax identification number
 minimum_monthly_commission=Minimum monthly commission
 minimum_monthly_commission_hint=The amount must be given in HUF. E.g.: 150000,00
 user_category=Category
-Nickname=Nickname
+Nickname=Nickname
+
+ListOfFactures=List of factures
+None=None
+CrossShopping=Cross-shopping

+ 5 - 1
langs/hu_HU/admin.lang

@@ -2382,4 +2382,8 @@ tax_identification_number=Adóazonosító jel
 minimum_monthly_commission=Havi minimum jutalék
 minimum_monthly_commission_hint=Az összeget Forintban kell megadni. Pl.: 150000,00
 user_category=Kategória
-Nickname=Becenév
+Nickname=Becenév
+Factures=Számlák
+ListOfFactures=Számlák listája
+None=Üres
+CrossShopping=Keresztvásárlás