diff --git a/app/ArticoliFatturati.php b/app/ArticoliFatturati.php
new file mode 100755
index 00000000..bb64b770
--- /dev/null
+++ b/app/ArticoliFatturati.php
@@ -0,0 +1,16 @@
+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 = "";
+ $finelink = "";
+ } else {
+ $mylink = "";
+ $finelink = "";
+ }
+
+ if ($product && isset($product['name']))
+ $titolo = $mylink . "" . $product['name'] . "" . $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 .= ' IMPOSTA IDSITO FDV' . $sep;
+
+ $str .= '
';
+ }
+ } catch (\Exception $e) {
+ return "Errore: " . $e->getMessage();
+ }
+
+ return $str;
+}
+
function getStructTable($tableName)
{
$str = '';
@@ -929,6 +985,7 @@ function getRigaArticoloByArt($article, $ind, $sep)
'' . $article->IdArticolo . '' . $sep .
' ' . $article->Titolo . '' . $sep .
' Pubb:' . formatDateToItalian($article->DataPubblicazione) . $sep .
+ $article->DescrizioneCollana . $sep .
$article->DescrizioneStatoProdotto . ' (' . $article->DescrizioneFormato . ')' . $sep .
'[Qta = ' . $article->QtaDisponibile . ']' . $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)
diff --git a/resources/views/mylinkspao.blade.php b/resources/views/mylinkspao.blade.php
index aeff6196..7613c95f 100644
--- a/resources/views/mylinkspao.blade.php
+++ b/resources/views/mylinkspao.blade.php
@@ -61,11 +61,17 @@
+
+