se già esiste l'ordine, non crearne uno nuovo
This commit is contained in:
@@ -514,8 +514,8 @@ function showOrdini()
|
|||||||
if ($order->Descrizione)
|
if ($order->Descrizione)
|
||||||
$str .= getvalstr("Descr", $order->Descrizione);
|
$str .= getvalstr("Descr", $order->Descrizione);
|
||||||
|
|
||||||
$str .= ' <a href="' . $baseUrl . '/setordine/' . $order->IdInternet . '/idsito/" target="_blank">IMPOSTA IDSITO FDV</a>' . $sep;
|
$str .= ' <a href="' . $baseUrl . '/setordine/' . $order->IdInternet . '/idsito/" target="_blank">[IMPOSTA IDSITO FDV]</a> ' . $sep;
|
||||||
$str .= ' <a href="' . $baseUrl . '/setordine/' . $order->IdInternet . '/del/" target="_blank">ELIMINA!</a>' . $sep;
|
$str .= ' <a href="' . $baseUrl . '/setordine/' . $order->IdInternet . '/del/" target="_blank">ELIMINA!</a> ' . $sep;
|
||||||
|
|
||||||
// $str .= getarraystr($product) . "<br>";
|
// $str .= getarraystr($product) . "<br>";
|
||||||
// $str .= $product;
|
// $str .= $product;
|
||||||
@@ -682,7 +682,7 @@ function setOrdine($idinternet, $mode)
|
|||||||
->update([
|
->update([
|
||||||
'IdSito' => "7"
|
'IdSito' => "7"
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$str .= "<br><span style='color: red;'>record Aggiornati: " . $updatedCount . "</span>";
|
$str .= "<br><span style='color: red;'>record Aggiornati: " . $updatedCount . "</span>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -775,7 +775,6 @@ function showDettSingleOrdineWeb($idordine)
|
|||||||
$orders = AppOrderWeb::where('IdInternet', $idordine)->get();
|
$orders = AppOrderWeb::where('IdInternet', $idordine)->get();
|
||||||
|
|
||||||
$str .= showRecordOrder($orders);
|
$str .= showRecordOrder($orders);
|
||||||
|
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
return "Errore showDettOrdini: " . $e->getMessage();
|
return "Errore showDettOrdini: " . $e->getMessage();
|
||||||
}
|
}
|
||||||
@@ -1995,6 +1994,18 @@ function getClienteByIdCodClienteInternet($codClienteInternet)
|
|||||||
return $clienteinGM;
|
return $clienteinGM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getOrderByIdInternet($idInternet)
|
||||||
|
{
|
||||||
|
|
||||||
|
try {
|
||||||
|
$ordergm = AppOrder::where('IdInternet', $idInternet)->first();
|
||||||
|
|
||||||
|
return $ordergm;
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function getClienti()
|
function getClienti()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -11,7 +11,6 @@
|
|||||||
"php": "^7.2.5|^8.0",
|
"php": "^7.2.5|^8.0",
|
||||||
"codexshaper/laravel-woocommerce": "^3.0",
|
"codexshaper/laravel-woocommerce": "^3.0",
|
||||||
"fideloper/proxy": "^4.4",
|
"fideloper/proxy": "^4.4",
|
||||||
"fruitcake/laravel-cors": "^2.0",
|
|
||||||
"guzzlehttp/guzzle": "^6.3.1|^7.0.1",
|
"guzzlehttp/guzzle": "^6.3.1|^7.0.1",
|
||||||
"laravel/framework": "^7.29",
|
"laravel/framework": "^7.29",
|
||||||
"laravel/tinker": "^2.5",
|
"laravel/tinker": "^2.5",
|
||||||
|
|||||||
@@ -2183,7 +2183,6 @@ Route::get('/testcli', function () {
|
|||||||
} catch (\Throwable $th) {
|
} catch (\Throwable $th) {
|
||||||
dd($th);
|
dd($th);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Route::post('/updatecreate', function (Request $request) {
|
Route::post('/updatecreate', function (Request $request) {
|
||||||
@@ -2208,6 +2207,13 @@ Route::post('/updatecreate', function (Request $request) {
|
|||||||
$myidInternet = (int) $request->id;
|
$myidInternet = (int) $request->id;
|
||||||
$CodClienteInternet = (int) $request->customer_id;
|
$CodClienteInternet = (int) $request->customer_id;
|
||||||
|
|
||||||
|
$myexistorder = getOrderByIdInternet($myidInternet);
|
||||||
|
if ($myexistorder) {
|
||||||
|
// Se questo ordine è stato già creato, allora ESCO.
|
||||||
|
$productLogger->addLog('', 'ORDINE GIA ESISTENTE ! ' . $myidInternet);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
$clienteinGM = null;
|
$clienteinGM = null;
|
||||||
|
|
||||||
$codClienteGM = '';
|
$codClienteGM = '';
|
||||||
|
|||||||
Reference in New Issue
Block a user