Piotr Labudda 9 лет назад
Родитель
Сommit
709ee76d8d

+ 10 - 19
SE/se-lib/Route/UrlAction/UserProNetMediaZaliczka.php

@@ -177,29 +177,20 @@ class Route_UrlAction_UserProNetMediaZaliczka extends RouteBase {// TODO: UrlAct
 			]),
 			'rows' => array_map(
 				function ($row) use ($idUser) {
-					$instance = DB::getPDO()->fetchValue("select INSTANCE_NAME from `ZALICZKA__#INSTANCE` where PRIMARY_KEY = {$row['ID']}");
-					$editLink = Request::getPathUri() . "index.php?_route=UrlAction_UserProNetMediaZaliczka&idUser={$idUser}&idZaliczka={$row['ID']}";
+					$instance = DB::getPDO()->fetchValue("select INSTANCE_NAME from `ZALICZKA__#INSTANCE` where PRIMARY_KEY = {$row['id']}");
+					$editLink = Request::getPathUri() . "index.php?_route=UrlAction_UserProNetMediaZaliczka&idUser={$idUser}&idZaliczka={$row['id']}";
 					$editLabel = ('ZaliczkaAktywna' == $instance) ? "Rozlicz / Podgląd" : "Podgląd";
-					$histLink = Request::getPathUri() . "index.php?_route=UrlAction_UserProNetMediaZaliczka&_task=hist&idUser={$idUser}&idZaliczka={$row['ID']}";
-					if (V::get('DBG', '', $_GET)) {
-						return [
-							'Nr' => $row['ID'],
-							'Status' => $row['A_STATUS'],
-							'INSTANCE' => $instance,
-							'L_APPOITMENT_USER' => $row['L_APPOITMENT_USER'],
-							'KWOTA' => $row['KWOTA'],
-							'NIEROZLICZONA_KWOTA' => $row['NIEROZLICZONA_KWOTA'],
-							'#' => '<a href="' . $editLink . '">' . $editLabel . '</a>',
-							'DBG' => '<a href="' . $histLink . '">' . "DBG HIST" . '</a>'
-						];
-					}
+					$histLink = Request::getPathUri() . "index.php?_route=UrlAction_UserProNetMediaZaliczka&_task=hist&idUser={$idUser}&idZaliczka={$row['id']}";
 					return [
-						'Nr' => $row['ID'],
+						'Nr' => $row['id'],
 						'Typ' => $instance,
 						'Pracownik' => $row['L_APPOITMENT_USER'],
-						'Kwota' => $row['KWOTA'],
-						'Nierozliczona kwota' => $row['NIEROZLICZONA_KWOTA'],
-						'#' => '<a href="' . $editLink . '">' . $editLabel . '</a>',
+						'Kwota' => $row['kwota'],
+						'Nierozliczona kwota' => $row['nierozliczona_kwota'],
+						'#' => '<a href="' . $editLink . '">' . $editLabel . '</a>' . (V::get('DBG', '', $_GET)
+							? '<a href="' . $histLink . '">' . "DBG HIST" . '</a>'
+							: ''
+						),
 					];
 				},
 				$acl->getItems([

+ 3 - 1
SE/se-lib/Schema/DefaultDb/zaliczka/ZaliczkaStorageAcl.php

@@ -16,7 +16,9 @@ class Schema_DefaultDb_zaliczka_ZaliczkaStorageAcl extends Core_AclSimpleSchemaB
       'kwota' => [ '@type' => 'xsd:decimal', '@totalDigits' => 16, '@fractionDigits' => 2, '@alias' => 'KWOTA' ],
       'nierozliczona_kwota' => [ '@type' => 'xsd:decimal', '@totalDigits' => 16, '@fractionDigits' => 2, '@alias' => 'NIEROZLICZONA_KWOTA' ],
       'korespondencja' => [ '@ref' => 'default_db/IN7_DZIENNIK_KORESP/ZaliczkaKoresp' ],
-      'pozycja' => [ '@ref' => 'default_db/ZALICZKA_POZYCJA/ZaliczkaPozycja', '@maxOccurs' => 'unbounded' ]
+      'pozycja' => [ '@ref' => 'default_db/ZALICZKA_POZYCJA/ZaliczkaPozycja', '@maxOccurs' => 'unbounded' ],
+      'A_STATUS' => [ '@type' => 'xsd:string' ],
+      'L_APPOITMENT_USER' => [ '@type' => 'xsd:string' ],
     ],
   ];