Sfoglia il codice sorgente

Fix view FV if BUG in hist_contacts

Piotr Labudda 4 anni fa
parent
commit
20c6e54628
1 ha cambiato i file con 18 aggiunte e 0 eliminazioni
  1. 18 0
      tools/ViewFV.php

+ 18 - 0
tools/ViewFV.php

@@ -26,6 +26,24 @@ class RouteTool_ViewFV extends RouteToolBase {
 				':id_user' => $idUser,
 				':nr' => $nr,
 			]);
+			// `- 7769215` dla dużych numerów - błędnie wprowadzonych np. 9880 klient(13374) BUG nr 8635412
+			// 8635412 - BUG ID_BILLING_NUMBERS in HIST_CONTACTS
+			//  866197 - correct ID_BILLING_NUMBERS
+			// MAX BILLING_NUMBERS.ID =  874100
+			if (empty($body)) {
+				$body = DB::getPDO(931)->fetchValue("
+					select BODY_HTML
+					from HIST_CONTACTS
+					where ID_BILLING_USERS = :id_user
+						and ID_BILLING_NUMBERS = :nr
+					order by ID DESC
+					limit 1
+				", [
+					':id_user' => $idUser,
+					':nr' => $nr + 7769215,
+				]);
+			}
+
 			if (empty($body)) throw new Exception("Brak faktury");
 
 			die($body);