ArticoliFatturati
This commit is contained in:
@@ -620,8 +620,6 @@ function showOrdiniWeb()
|
||||
|
||||
try {
|
||||
|
||||
// $str = Schema::getColumnListing('Orderdetails');
|
||||
|
||||
$orders = OrderdetailWeb::orderBy('DataOra', 'desc')
|
||||
->take(5)
|
||||
->get();
|
||||
@@ -676,6 +674,64 @@ function showOrdiniWeb()
|
||||
return $str;
|
||||
}
|
||||
|
||||
function showArticoliFatturatiWeb()
|
||||
{
|
||||
$str = "";
|
||||
|
||||
try {
|
||||
|
||||
$orders = ArticoliFatturati::orderBy('DataOra', 'desc')
|
||||
->take(10)
|
||||
->get();
|
||||
|
||||
$sep = "";
|
||||
|
||||
$baseUrl = Request::root(); // URL di base (dominio)
|
||||
|
||||
// Show the fields of the orders
|
||||
foreach ($orders as $order) {
|
||||
$product = Product::where('sku', $order->CodArticolo)->first();
|
||||
|
||||
if (isset($product['permalink'])) {
|
||||
$mylink = "<a href='" . $product['permalink'] . "' target='_blank'>";
|
||||
$finelink = "</a>";
|
||||
} else {
|
||||
$mylink = "";
|
||||
$finelink = "";
|
||||
}
|
||||
|
||||
if ($product && isset($product['name']))
|
||||
$titolo = $mylink . "<span style='font-weigth: bold;'>" . $product['name'] . "</span>" . $finelink;
|
||||
else
|
||||
$titolo = "";
|
||||
|
||||
$str .= getvalstr("", $order->Codice) . " ";
|
||||
$str .= getvalstr("", $order->AnnoDoc) . " ";
|
||||
$str .= getvalstr("", $order->NumeroDoc) . " ";
|
||||
$str .= getvalstr("", $order->TipoDoc) . " ";
|
||||
$str .= getvalstr("Articolo", $order->CodArticolo, true);
|
||||
$str .= getvalstr("Quantità", $order->Qta);
|
||||
$str .= getvalstr("", $order->DataOra);
|
||||
$str .= getvalstr("", $order->Stato);
|
||||
$str .= getvalstr("", $order->Note);
|
||||
$str .= getvalstr("", $titolo);
|
||||
$str .= getvalstr("Ordine", $order->IdInternet, true) . " ";
|
||||
if ($order->PercSconto)
|
||||
$str .= getvalstr("Sconto", $order->PercSconto);
|
||||
if ($order->Descrizione)
|
||||
$str .= getvalstr("Descr", $order->Descrizione);
|
||||
|
||||
// $str .= ' <a href="' . $baseUrl . '/setordine/' . $order->IdInternet . '/idsito/" target="_blank">IMPOSTA IDSITO FDV</a>' . $sep;
|
||||
|
||||
$str .= '<br>';
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
return "Errore: " . $e->getMessage();
|
||||
}
|
||||
|
||||
return $str;
|
||||
}
|
||||
|
||||
function getStructTable($tableName)
|
||||
{
|
||||
$str = '';
|
||||
@@ -929,6 +985,7 @@ function getRigaArticoloByArt($article, $ind, $sep)
|
||||
'<a href="' . $article->permalink . '?id=' . $article->IdArticolo . '" target="_blank">' . $article->IdArticolo . '</a>' . $sep .
|
||||
'<a href="' . $permalink . '" target="_blank"><span style="color:' . $colore . '; font-weight: bold;"> ' . $article->Titolo . '</span></a>' . $sep .
|
||||
' Pubb:' . formatDateToItalian($article->DataPubblicazione) . $sep .
|
||||
$article->DescrizioneCollana . $sep .
|
||||
$article->DescrizioneStatoProdotto . ' (' . $article->DescrizioneFormato . ')' . $sep .
|
||||
'[Qta = <span style="">' . $article->QtaDisponibile . '</span>]' . $sep .
|
||||
' [' . showprice($prezzo) . ' ]' . $sep .
|
||||
@@ -1029,6 +1086,9 @@ function libriInPrevendita()
|
||||
->leftJoin(DB::raw('(SELECT o.Codice, o.QtaDisponibile FROM T_WEB_Disponibile o JOIN (SELECT Codice, MAX(DataOra) as data1 from T_WEB_Disponibile GROUP BY Codice) p ON o.Codice = p.Codice AND o.DataOra = p.data1 ) q'), function ($join) {
|
||||
$join->on('T_WEB_Articoli.IdArticolo', '=', 'q.Codice');
|
||||
})
|
||||
->leftJoin(DB::raw('(SELECT r.IdCollana, r.Descrizione as DescrizioneCollana FROM T_WEB_Collana r JOIN (SELECT IdCollana, MAX(DataOra) as data1 from T_WEB_Collana GROUP BY IdCollana) c ON r.IdCollana = c.IdCollana AND e.DataOra = c.data1 ) s'), function ($join) {
|
||||
$join->on('T_WEB_Articoli.IdCollana', '=', 's.IdCollana');
|
||||
})
|
||||
|
||||
->where('DescrizioneStatoProdotto', 'In prevendita')
|
||||
->where(DB::raw('CONVERT(INT, QtaDisponibile)'), '<', 0)
|
||||
|
||||
Reference in New Issue
Block a user