aa
This commit is contained in:
@@ -110,6 +110,7 @@ function formatDateToItalian($date_string, $input_format = 'Y-m-d H:i:s.u')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function setPreOrder($sku, $aggiornapreordine, $debug)
|
||||
{
|
||||
try {
|
||||
@@ -481,6 +482,8 @@ function showOrdini()
|
||||
->take(20)
|
||||
->get();
|
||||
|
||||
$sep = "";
|
||||
|
||||
// Show the fields of the orders
|
||||
foreach ($orders as $order) {
|
||||
$product = Product::where('sku', $order->CodArticoloGM)->first();
|
||||
@@ -492,9 +495,9 @@ function showOrdini()
|
||||
|
||||
$str .= getvalstr("", $order->Codice) . " ";
|
||||
$str .= getvalstr("", $order->DataOra);
|
||||
$str .= getvalstr("Titolo", $titolo);
|
||||
$str .= getvalstr("Codice Ordine", $order->IdInternet, true) . " ";
|
||||
$str .= getvalstr("Cod. Articolo", $order->CodArticoloGM, true);
|
||||
$str .= getvalstr("", $titolo);
|
||||
$str .= getvalstr("Ordine", $order->IdInternet, true) . " ";
|
||||
$str .= getvalstr("Articolo", $order->CodArticoloGM, true);
|
||||
$str .= getvalstr("Prezzo", $order->PrezzoLordo);
|
||||
$str .= getvalstr("Quantità", $order->Qta);
|
||||
if ($order->PercSconto)
|
||||
@@ -502,6 +505,8 @@ function showOrdini()
|
||||
if ($order->Descrizione)
|
||||
$str .= getvalstr("Descr", $order->Descrizione);
|
||||
|
||||
$str .= '<a href="' . $product->permalink . '/apimacro/public/setordine/' . $order->IdInternet . '/del/" target="_blank">ELIMINA!</a>' . $sep;
|
||||
|
||||
// $str .= getarraystr($product) . "<br>";
|
||||
// $str .= $product;
|
||||
$str .= '<br>';
|
||||
@@ -513,6 +518,27 @@ function showOrdini()
|
||||
return $str;
|
||||
}
|
||||
|
||||
function setOrdine($idinternet, $mode)
|
||||
{
|
||||
$str = "";
|
||||
$ordine = Orderdetail::where('IdInternet', $idinternet)->get();
|
||||
|
||||
$prodotto = Product::where('sku', $ordine["CodArticoloGM"])->first();
|
||||
|
||||
$str .= getarraystr($prodotto) . "<br>";
|
||||
$str .= getarraystr($ordine) . "<br>";
|
||||
|
||||
if ($mode === 'del' && $ordine) {
|
||||
// delete record $ordine
|
||||
|
||||
$ordine->delete();
|
||||
|
||||
}
|
||||
|
||||
return $str;
|
||||
}
|
||||
|
||||
|
||||
function showDettOrdini()
|
||||
{
|
||||
$str = "Ordini Woocommerce:" . PHP_EOL . '<br>';
|
||||
|
||||
@@ -6105,6 +6105,10 @@ Route::get('/aggiornapreorder/{idarticolo}/{aggiornapreordine}', function ($idar
|
||||
setPreOrder($idarticolo, $aggiornapreordine, true);
|
||||
});
|
||||
|
||||
Route::get('/setordine/{idinternet}/{mode}', function ($idinternet, $mode) {
|
||||
setOrdine($idinternet, $mode);
|
||||
});
|
||||
|
||||
Route::get('/aggiornadatapubblicazione/{idarticolo}', function ($idarticolo) {
|
||||
setDataPubblicazione($idarticolo, true);
|
||||
});
|
||||
@@ -6180,6 +6184,8 @@ Route::get('/handle-article-action-pao/{id}/{action}', function ($id, $action) {
|
||||
return libriInPrevendita();
|
||||
} elseif ($action == 'showOrdini') {
|
||||
return showOrdini();
|
||||
} elseif ($action == 'setOrdine') {
|
||||
return setOrdine($id, '');
|
||||
} elseif ($action == 'showDettOrdini') {
|
||||
return showDettOrdini();
|
||||
} elseif ($action == 'setDataPubblicazione') {
|
||||
|
||||
Reference in New Issue
Block a user