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