ArticoliFatturati
This commit is contained in:
16
app/ArticoliFatturati.php
Executable file
16
app/ArticoliFatturati.php
Executable file
@@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class ArticoliFatturati extends Model
|
||||||
|
{
|
||||||
|
protected $connection = 'sqlsrv_test';
|
||||||
|
protected $table = 'T_WEB_ArticoliFatturati';
|
||||||
|
|
||||||
|
public $timestamps = false;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -620,8 +620,6 @@ function showOrdiniWeb()
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
// $str = Schema::getColumnListing('Orderdetails');
|
|
||||||
|
|
||||||
$orders = OrderdetailWeb::orderBy('DataOra', 'desc')
|
$orders = OrderdetailWeb::orderBy('DataOra', 'desc')
|
||||||
->take(5)
|
->take(5)
|
||||||
->get();
|
->get();
|
||||||
@@ -676,6 +674,64 @@ function showOrdiniWeb()
|
|||||||
return $str;
|
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)
|
function getStructTable($tableName)
|
||||||
{
|
{
|
||||||
$str = '';
|
$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="' . $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 .
|
'<a href="' . $permalink . '" target="_blank"><span style="color:' . $colore . '; font-weight: bold;"> ' . $article->Titolo . '</span></a>' . $sep .
|
||||||
' Pubb:' . formatDateToItalian($article->DataPubblicazione) . $sep .
|
' Pubb:' . formatDateToItalian($article->DataPubblicazione) . $sep .
|
||||||
|
$article->DescrizioneCollana . $sep .
|
||||||
$article->DescrizioneStatoProdotto . ' (' . $article->DescrizioneFormato . ')' . $sep .
|
$article->DescrizioneStatoProdotto . ' (' . $article->DescrizioneFormato . ')' . $sep .
|
||||||
'[Qta = <span style="">' . $article->QtaDisponibile . '</span>]' . $sep .
|
'[Qta = <span style="">' . $article->QtaDisponibile . '</span>]' . $sep .
|
||||||
' [' . showprice($prezzo) . ' ]' . $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) {
|
->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');
|
$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('DescrizioneStatoProdotto', 'In prevendita')
|
||||||
->where(DB::raw('CONVERT(INT, QtaDisponibile)'), '<', 0)
|
->where(DB::raw('CONVERT(INT, QtaDisponibile)'), '<', 0)
|
||||||
|
|||||||
@@ -61,11 +61,17 @@
|
|||||||
<button type="button" data-action="riviste">Riviste</button>
|
<button type="button" data-action="riviste">Riviste</button>
|
||||||
<button type="button" data-action="showOrdini">Mostra Ordini</button>
|
<button type="button" data-action="showOrdini">Mostra Ordini</button>
|
||||||
<button type="button" data-action="showOrdiniWeb">Mostra Ordini Web</button>
|
<button type="button" data-action="showOrdiniWeb">Mostra Ordini Web</button>
|
||||||
|
<button type="button" data-action="showArticoliFatturatiWeb">Mostra Fatturati</button>
|
||||||
<button type="button" data-action="Vendite">Vendite</button>
|
<button type="button" data-action="Vendite">Vendite</button>
|
||||||
|
|
||||||
<button type="button" data-action="showDettOrdini">Dettaglio Ordini</button>
|
<button type="button" data-action="showDettOrdini">Dettaglio Ordini</button>
|
||||||
<button type="button" data-action="showDettOrdiniWeb">Dettaglio Ordini Web</button>
|
<button type="button" data-action="showDettOrdiniWeb">Dettaglio Ordini Web</button>
|
||||||
</form>
|
</form>
|
||||||
|
<div>
|
||||||
|
<a href="http://vps-88271abb.vps.ovh.net/apimacro/public/view-articles-sales" target="_blank">Articoli
|
||||||
|
Venduti</a><br>
|
||||||
|
|
||||||
|
</div>
|
||||||
<div id="result"></div>
|
<div id="result"></div>
|
||||||
<div id="loading"></div>
|
<div id="loading"></div>
|
||||||
|
|
||||||
|
|||||||
@@ -6430,6 +6430,8 @@ Route::get('/handle-article-action-pao/{id}/{action}', function ($id, $action) {
|
|||||||
return showTest();
|
return showTest();
|
||||||
} elseif ($action == 'showOrdiniWeb') {
|
} elseif ($action == 'showOrdiniWeb') {
|
||||||
return showOrdiniWeb();
|
return showOrdiniWeb();
|
||||||
|
} elseif ($action == 'showArticoliFatturatiWeb') {
|
||||||
|
return showArticoliFatturatiWeb();
|
||||||
} elseif ($action == 'setOrdine') {
|
} elseif ($action == 'setOrdine') {
|
||||||
return setOrdine($id, '');
|
return setOrdine($id, '');
|
||||||
} elseif ($action == 'showDettOrdini') {
|
} elseif ($action == 'showDettOrdini') {
|
||||||
|
|||||||
Reference in New Issue
Block a user