diff --git a/app/CustomFuncPao.php b/app/CustomFuncPao.php
index 254ab105..40ead42f 100644
--- a/app/CustomFuncPao.php
+++ b/app/CustomFuncPao.php
@@ -525,18 +525,25 @@ function showOrdini()
function setOrdine($idinternet, $mode)
{
- $str = "";
- $ordine = Orderdetail::where('IdInternet', $idinternet)->get();
+ try {
+ $str = "";
+ $ordine = Orderdetail::where('IdInternet', $idinternet)->get();
- $prodotto = Product::where('sku', $ordine["CodArticoloGM"])->first();
+ if ($ordine)
+ $str .= getarraystr($ordine) . "
";
- $str .= getarraystr($prodotto) . "
";
- $str .= getarraystr($ordine) . "
";
+ $prodotto = Product::where('sku', $ordine["CodArticoloGM"])->first();
- if ($mode === 'del' && $ordine) {
- // delete record $ordine
- $deletedCount = Orderdetail::where('IdInternet', $idinternet)->delete();
- $str = "
Numero di record eliminati: " . $deletedCount . "";
+ if ($prodotto)
+ $str .= getarraystr($prodotto) . "
";
+
+ if ($mode === 'AAAdel' && $ordine) {
+ // delete record $ordine
+ $deletedCount = Orderdetail::where('IdInternet', $idinternet)->delete();
+ $str = "
Numero di record eliminati: " . $deletedCount . "";
+ }
+ } catch (\Exception $e) {
+ $str .= "Errore: " . $e->getMessage();
}
return $str;
@@ -1760,7 +1767,6 @@ function getClienteByIdInternet_Ordine($idInternet)
try {
$clienteinGM = Clientegm::where('IdInternet', $idInternet)->first();
-
} catch (\Exception $e) {
return null;
}
@@ -1773,7 +1779,6 @@ function getClienteByIdCodClienteInternet($codClienteInternet)
try {
$clienteinGM = Clientegm::where('codClienteInternet', $codClienteInternet)->first();
-
} catch (\Exception $e) {
return null;
}
@@ -1781,13 +1786,13 @@ function getClienteByIdCodClienteInternet($codClienteInternet)
return $clienteinGM;
}
-function getClienti() {
+function getClienti()
+{
try {
$clienti = Clientegm::all();
dd($clienti);
-
} catch (\Exception $e) {
return null;
}
-}
\ No newline at end of file
+}