This commit is contained in:
paoloar77
2024-07-22 12:29:29 +02:00
parent e4ddd4eae5
commit 8eb2044cfd
3 changed files with 62 additions and 2 deletions

View File

@@ -706,7 +706,61 @@ function showDettOrdini()
return $str;
}
function showDettOrdiniWeb($idordine)
function showDettSingleOrdine($idordine)
{
$str = "Ordini Woocommerce:" . PHP_EOL . '<br>';
try {
// sort DataOra desc
$orders = AppOrder::where('IdInternet', $idordine)->get();
// Show the fields of the orders
foreach ($orders as $order) {
$str .= getvalstr("IdInternet", $order->IdInternet, true) . " ";
$str .= getvalstr("CodCliente", $order->CodClienteInternet, true);
$str .= getvalstr("IdSito", $order->IdSito, true);
$str .= getvalstr("Note", $order->Note, true);
$str .= getvalstr("Totale", $order->Totale, true);
$str .= getvalstr("DataOra", $order->DataOra, true);
$str .= getvalstr("DataSpedizione", $order->DataSpedizione, true);
$str .= '<br>';
}
} catch (\Exception $e) {
return "Errore showDettOrdini: " . $e->getMessage();
}
return $str;
}
function showDettOrdiniWeb()
{
try {
$str = "Ordini T_WEB_TestateOrdini:" . PHP_EOL . '<br>';
$orders = AppOrderWeb::all()->sortByDesc('DataOra');
// Show the fields of the orders
foreach ($orders as $order) {
$str .= "Ordine: ";
$str .= getvalstr("IdInternet", $order->IdInternet, true) . " ";
$str .= getvalstr("CodCliente", $order->CodClienteInternet, true);
$str .= getvalstr("IdSito", $order->IdSito, true);
$str .= getvalstr("Note", $order->Note, true);
$str .= getvalstr("Totale", $order->Totale, true);
$str .= getvalstr("DataOra", $order->DataOra, true);
$str .= getvalstr("DataSpedizione", $order->DataSpedizione, true);
$str .= '<br>';
}
} catch (\Exception $e) {
return "Errore showDettOrdini: " . $e->getMessage();
}
return $str;
}
function showDettSingleOrdineWeb($idordine)
{
try {

View File

@@ -50,6 +50,8 @@
<button type="button" data-action="checkPrevendita">E' in PreVendita?</button>
<button type="button" data-action="setPreOrder">Impostalo in PreVendita!</button>
<button type="button" data-action="setDataPubblicazione">Aggiorna Data Pubblicazione</button>
<button type="button" data-action="showDettSingleOrdine">Dett. Ordine</button>
<button type="button" data-action="showDettSingleOrdineWeb">Dett. Ordine Web</button>
<br><br>
<button type="button" data-action="inprevendita">Libri in Prevendita</button>

View File

@@ -6200,7 +6200,11 @@ Route::get('/handle-article-action-pao/{id}/{action}', function ($id, $action) {
} elseif ($action == 'showDettOrdini') {
return showDettOrdini();
} elseif ($action == 'showDettOrdiniWeb') {
return showDettOrdiniWeb($id);
return showDettOrdiniWeb();
} elseif ($action == 'showDettSingleOrdine') {
return showDettSingleOrdine($id);
} elseif ($action == 'showDettSingleOrdineWeb') {
return showDettSingleOrdineWeb($id);
} elseif ($action == 'setDataPubblicazione') {
setDataPubblicazione($id, true);
} elseif ($action == 'setPreOrder') {