#
Business Cube
#
Tabelle
- distbas Tabella Radice della distinta base
- movdis Tabella figli (MP, FER, IM)
- artico Descrizione degli articoli
- commesse: vedi /Users/filippo/Desktop/PROJECTS/ees-laravel/routes/web.php endopoint: /bcube
- tabmaga.tb_codmaga: Tabella magazzino (destinazioni), il nominativo prenderlo da anagra
- anagra.an_conto = 22054263 Tabella anagrafica
- tabgmer: gruppi
- tabsgme: sotto gruppi
#
Import commesse
Esempio
$anno = '2023';
// $id_ordine = '198';
// $id_commessa = '2023999';
$result = DB::connection('sqlsrv-bcube')
->table('movord') // tabella degli mp
// ->select('mo_numord', 'mo_descr', 'dd_nomdest', 'mo_codart')
->join('testord', 'movord.mo_numord', '=', 'testord.td_numord')
->leftJoin('destdiv', 'testord.td_coddest', '=', 'destdiv.dd_coddest')
->where('mo_tipork', '=', 'O') // Tipo (O = Ordine)
->where('mo_anno', '=', $anno)
->where('mo_flevas', '!=', 'S') // S = ordini inevasi
// ->where('mo_numord', '=', $id_ordine)
// ->where('mo_commeca', '=', $id_commessa)
->where('td_tipork', '=', 'O')
->where('td_anno', '=', $anno)
->where('td_conto', '=', '22054263')
->orderBy('mo_commeca')
->get();