mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-02 08:56:48 +01:00
Completamento controlli sulle quantità
This commit is contained in:
parent
59a0c750e4
commit
873f6df9c8
@ -418,14 +418,13 @@ function controllaMagazzino() {
|
|||||||
for(const r of righe) {
|
for(const r of righe) {
|
||||||
let riga = $(r);
|
let riga = $(r);
|
||||||
let id = $(riga).data("local_id");
|
let id = $(riga).data("local_id");
|
||||||
|
let id_articolo = riga.find("[id^=id_articolo_]").text();
|
||||||
|
|
||||||
if (!$("#checked_" + id).is(":checked")) {
|
if (!$("#checked_" + id).is(":checked") || !id_articolo) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
let id_articolo = riga.find("[id^=id_articolo_]").text();
|
|
||||||
let qta = parseFloat(riga.find("input[id^=qta_]").val());
|
let qta = parseFloat(riga.find("input[id^=qta_]").val());
|
||||||
|
|
||||||
richieste[id_articolo] = richieste[id_articolo] ? richieste[id_articolo] + qta : qta;
|
richieste[id_articolo] = richieste[id_articolo] ? richieste[id_articolo] + qta : qta;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,6 +34,7 @@ if (!empty($id_documento)) {
|
|||||||
'button' => tr('Aggiungi'),
|
'button' => tr('Aggiungi'),
|
||||||
'documento' => $documento,
|
'documento' => $documento,
|
||||||
'documento_finale' => $documento_finale,
|
'documento_finale' => $documento_finale,
|
||||||
|
'tipo_documento_finale' => Contratto::class,
|
||||||
];
|
];
|
||||||
|
|
||||||
echo App::load('importa.php', [], $options, true);
|
echo App::load('importa.php', [], $options, true);
|
||||||
|
@ -20,8 +20,10 @@
|
|||||||
include_once __DIR__.'/../../core.php';
|
include_once __DIR__.'/../../core.php';
|
||||||
|
|
||||||
use Modules\Contratti\Contratto;
|
use Modules\Contratti\Contratto;
|
||||||
|
use Modules\Fatture\Fattura;
|
||||||
|
|
||||||
$documento = Contratto::find($id_record);
|
$documento = Contratto::find($id_record);
|
||||||
|
$tipo_documento_finale = Fattura::class;
|
||||||
|
|
||||||
$options = [
|
$options = [
|
||||||
'op' => 'add_documento',
|
'op' => 'add_documento',
|
||||||
@ -30,6 +32,7 @@ $options = [
|
|||||||
'button' => tr('Aggiungi'),
|
'button' => tr('Aggiungi'),
|
||||||
'create_document' => true,
|
'create_document' => true,
|
||||||
'documento' => $documento,
|
'documento' => $documento,
|
||||||
|
'tipo_documento_finale' => $tipo_documento_finale,
|
||||||
];
|
];
|
||||||
|
|
||||||
echo App::load('importa.php', [], $options, true);
|
echo App::load('importa.php', [], $options, true);
|
||||||
|
@ -35,6 +35,7 @@ if (!empty($id_documento)) {
|
|||||||
'serials' => true,
|
'serials' => true,
|
||||||
'documento' => $documento,
|
'documento' => $documento,
|
||||||
'documento_finale' => $documento_finale,
|
'documento_finale' => $documento_finale,
|
||||||
|
'tipo_documento_finale' => DDT::class,
|
||||||
];
|
];
|
||||||
|
|
||||||
echo App::load('importa.php', [], $options, true);
|
echo App::load('importa.php', [], $options, true);
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
include_once __DIR__.'/../../core.php';
|
include_once __DIR__.'/../../core.php';
|
||||||
|
|
||||||
use Modules\DDT\DDT;
|
use Modules\DDT\DDT;
|
||||||
|
use Modules\Fatture\Fattura;
|
||||||
|
|
||||||
$documento = DDT::find($id_record);
|
$documento = DDT::find($id_record);
|
||||||
|
|
||||||
@ -27,6 +28,7 @@ $module = Modules::get($id_module);
|
|||||||
|
|
||||||
$final_module = $module['name'] == 'Ddt di vendita' ? 'Fatture di vendita' : 'Fatture di acquisto';
|
$final_module = $module['name'] == 'Ddt di vendita' ? 'Fatture di vendita' : 'Fatture di acquisto';
|
||||||
$dir = $module['name'] == 'Ddt di vendita' ? 'entrata' : 'uscita';
|
$dir = $module['name'] == 'Ddt di vendita' ? 'entrata' : 'uscita';
|
||||||
|
$tipo_documento_finale = Fattura::class;
|
||||||
|
|
||||||
$options = [
|
$options = [
|
||||||
'op' => 'add_documento',
|
'op' => 'add_documento',
|
||||||
@ -37,6 +39,7 @@ $options = [
|
|||||||
'dir' => $dir,
|
'dir' => $dir,
|
||||||
'create_document' => true,
|
'create_document' => true,
|
||||||
'documento' => $documento,
|
'documento' => $documento,
|
||||||
|
'tipo_documento_finale' => $tipo_documento_finale,
|
||||||
];
|
];
|
||||||
|
|
||||||
echo App::load('importa.php', [], $options, true);
|
echo App::load('importa.php', [], $options, true);
|
||||||
|
@ -35,6 +35,7 @@ if (!empty($id_documento)) {
|
|||||||
'button' => tr('Aggiungi'),
|
'button' => tr('Aggiungi'),
|
||||||
'documento' => $documento,
|
'documento' => $documento,
|
||||||
'documento_finale' => $documento_finale,
|
'documento_finale' => $documento_finale,
|
||||||
|
'tipo_documento_finale' => Fattura::class,
|
||||||
];
|
];
|
||||||
|
|
||||||
echo App::load('importa.php', [], $options, true);
|
echo App::load('importa.php', [], $options, true);
|
||||||
|
@ -36,6 +36,7 @@ if (!empty($id_documento)) {
|
|||||||
'button' => tr('Aggiungi'),
|
'button' => tr('Aggiungi'),
|
||||||
'documento' => $documento,
|
'documento' => $documento,
|
||||||
'documento_finale' => $documento_finale,
|
'documento_finale' => $documento_finale,
|
||||||
|
'tipo_documento_finale' => Fattura::class,
|
||||||
];
|
];
|
||||||
|
|
||||||
echo App::load('importa.php', [], $options, true);
|
echo App::load('importa.php', [], $options, true);
|
||||||
|
@ -36,6 +36,7 @@ if (!empty($id_documento)) {
|
|||||||
'button' => tr('Aggiungi'),
|
'button' => tr('Aggiungi'),
|
||||||
'documento' => $documento,
|
'documento' => $documento,
|
||||||
'documento_finale' => $documento_finale,
|
'documento_finale' => $documento_finale,
|
||||||
|
'tipo_documento_finale' => Fattura::class,
|
||||||
];
|
];
|
||||||
|
|
||||||
echo App::load('importa.php', [], $options, true);
|
echo App::load('importa.php', [], $options, true);
|
||||||
|
@ -22,12 +22,14 @@ include_once __DIR__.'/../../core.php';
|
|||||||
use Modules\Fatture\Fattura;
|
use Modules\Fatture\Fattura;
|
||||||
|
|
||||||
$documento = Fattura::find($id_record);
|
$documento = Fattura::find($id_record);
|
||||||
|
$tipo_documento_finale = Fattura::class;
|
||||||
|
|
||||||
$options = [
|
$options = [
|
||||||
'type' => 'nota_credito',
|
'type' => 'nota_credito',
|
||||||
'op' => 'nota_credito',
|
'op' => 'nota_credito',
|
||||||
'module' => 'Fatture di vendita',
|
'module' => 'Fatture di vendita',
|
||||||
'documento' => $documento,
|
'documento' => $documento,
|
||||||
|
'tipo_documento_finale' => $tipo_documento_finale,
|
||||||
'button' => tr('Aggiungi'),
|
'button' => tr('Aggiungi'),
|
||||||
'create_document' => true,
|
'create_document' => true,
|
||||||
'allow-empty' => true,
|
'allow-empty' => true,
|
||||||
|
@ -19,7 +19,10 @@
|
|||||||
|
|
||||||
include_once __DIR__.'/../../core.php';
|
include_once __DIR__.'/../../core.php';
|
||||||
|
|
||||||
|
use Modules\DDT\DDT;
|
||||||
|
use Modules\Fatture\Fattura;
|
||||||
use Modules\Interventi\Intervento;
|
use Modules\Interventi\Intervento;
|
||||||
|
use Modules\Ordini\Ordine;
|
||||||
|
|
||||||
$documento = Intervento::find($id_record);
|
$documento = Intervento::find($id_record);
|
||||||
|
|
||||||
@ -28,15 +31,19 @@ $module = Modules::get($documento->module);
|
|||||||
if (get('documento') == 'fattura') {
|
if (get('documento') == 'fattura') {
|
||||||
$final_module = 'Fatture di vendita';
|
$final_module = 'Fatture di vendita';
|
||||||
$op = 'add_documento';
|
$op = 'add_documento';
|
||||||
|
$tipo_documento_finale = Fattura::class;
|
||||||
} elseif (get('documento') == 'ordine_fornitore') {
|
} elseif (get('documento') == 'ordine_fornitore') {
|
||||||
$final_module = 'Ordini fornitore';
|
$final_module = 'Ordini fornitore';
|
||||||
$op = 'add_ordine_cliente';
|
$op = 'add_ordine_cliente';
|
||||||
|
$tipo_documento_finale = Ordine::class;
|
||||||
} elseif (get('documento') == 'ordine') {
|
} elseif (get('documento') == 'ordine') {
|
||||||
$final_module = 'Ordini cliente';
|
$final_module = 'Ordini cliente';
|
||||||
$op = 'add_documento';
|
$op = 'add_documento';
|
||||||
|
$tipo_documento_finale = Ordine::class;
|
||||||
} else {
|
} else {
|
||||||
$final_module = 'Ddt di vendita';
|
$final_module = 'Ddt di vendita';
|
||||||
$op = 'add_documento';
|
$op = 'add_documento';
|
||||||
|
$tipo_documento_finale = DDT::class;
|
||||||
}
|
}
|
||||||
|
|
||||||
$options = [
|
$options = [
|
||||||
@ -47,6 +54,7 @@ $options = [
|
|||||||
'create_document' => true,
|
'create_document' => true,
|
||||||
'serials' => true,
|
'serials' => true,
|
||||||
'documento' => $documento,
|
'documento' => $documento,
|
||||||
|
'tipo_documento_finale' => $tipo_documento_finale,
|
||||||
];
|
];
|
||||||
|
|
||||||
echo App::load('importa.php', [], $options, true);
|
echo App::load('importa.php', [], $options, true);
|
||||||
|
@ -19,6 +19,9 @@
|
|||||||
|
|
||||||
include_once __DIR__.'/../../core.php';
|
include_once __DIR__.'/../../core.php';
|
||||||
|
|
||||||
|
use Modules\DDT\DDT;
|
||||||
|
use Modules\Fatture\Fattura;
|
||||||
|
use Modules\Interventi\Intervento;
|
||||||
use Modules\Ordini\Ordine;
|
use Modules\Ordini\Ordine;
|
||||||
|
|
||||||
$documento = Ordine::find($id_record);
|
$documento = Ordine::find($id_record);
|
||||||
@ -28,15 +31,19 @@ $module = Modules::get($documento->module);
|
|||||||
if (get('documento') == 'fattura') {
|
if (get('documento') == 'fattura') {
|
||||||
$final_module = $module['name'] == 'Ordini cliente' ? 'Fatture di vendita' : 'Fatture di acquisto';
|
$final_module = $module['name'] == 'Ordini cliente' ? 'Fatture di vendita' : 'Fatture di acquisto';
|
||||||
$op = 'add_documento';
|
$op = 'add_documento';
|
||||||
|
$tipo_documento_finale = Fattura::class;
|
||||||
} elseif (get('documento') == 'ordine_fornitore') {
|
} elseif (get('documento') == 'ordine_fornitore') {
|
||||||
$final_module = 'Ordini fornitore';
|
$final_module = 'Ordini fornitore';
|
||||||
$op = 'add_ordine_cliente';
|
$op = 'add_ordine_cliente';
|
||||||
|
$tipo_documento_finale = Ordine::class;
|
||||||
} elseif (get('documento') == 'intervento') {
|
} elseif (get('documento') == 'intervento') {
|
||||||
$final_module = 'Interventi';
|
$final_module = 'Interventi';
|
||||||
$op = 'add_documento';
|
$op = 'add_documento';
|
||||||
|
$tipo_documento_finale = Intervento::class;
|
||||||
} else {
|
} else {
|
||||||
$final_module = $module['name'] == 'Ordini cliente' ? 'Ddt di vendita' : 'Ddt di acquisto';
|
$final_module = $module['name'] == 'Ordini cliente' ? 'Ddt di vendita' : 'Ddt di acquisto';
|
||||||
$op = 'add_ordine';
|
$op = 'add_ordine';
|
||||||
|
$tipo_documento_finale = DDT::class;
|
||||||
}
|
}
|
||||||
|
|
||||||
$options = [
|
$options = [
|
||||||
@ -47,6 +54,7 @@ $options = [
|
|||||||
'create_document' => true,
|
'create_document' => true,
|
||||||
'serials' => true,
|
'serials' => true,
|
||||||
'documento' => $documento,
|
'documento' => $documento,
|
||||||
|
'tipo_documento_finale' => $tipo_documento_finale,
|
||||||
];
|
];
|
||||||
|
|
||||||
echo App::load('importa.php', [], $options, true);
|
echo App::load('importa.php', [], $options, true);
|
||||||
|
@ -19,6 +19,10 @@
|
|||||||
|
|
||||||
include_once __DIR__.'/../../core.php';
|
include_once __DIR__.'/../../core.php';
|
||||||
|
|
||||||
|
use Modules\Contratti\Contratto;
|
||||||
|
use Modules\DDT\DDT;
|
||||||
|
use Modules\Fatture\Fattura;
|
||||||
|
use Modules\Ordini\Ordine;
|
||||||
use Modules\Preventivi\Preventivo;
|
use Modules\Preventivi\Preventivo;
|
||||||
|
|
||||||
$documento = Preventivo::find($id_record);
|
$documento = Preventivo::find($id_record);
|
||||||
@ -26,15 +30,19 @@ $documento = Preventivo::find($id_record);
|
|||||||
if (get('documento') == 'fattura') {
|
if (get('documento') == 'fattura') {
|
||||||
$final_module = 'Fatture di vendita';
|
$final_module = 'Fatture di vendita';
|
||||||
$op = 'add_documento';
|
$op = 'add_documento';
|
||||||
|
$tipo_documento_finale = Fattura::class;
|
||||||
} elseif (get('documento') == 'ordine') {
|
} elseif (get('documento') == 'ordine') {
|
||||||
$final_module = 'Ordini cliente';
|
$final_module = 'Ordini cliente';
|
||||||
$op = 'add_preventivo';
|
$op = 'add_preventivo';
|
||||||
|
$tipo_documento_finale = Ordine::class;
|
||||||
} elseif (get('documento') == 'ddt') {
|
} elseif (get('documento') == 'ddt') {
|
||||||
$final_module = 'Ddt di vendita';
|
$final_module = 'Ddt di vendita';
|
||||||
$op = 'add_documento';
|
$op = 'add_documento';
|
||||||
|
$tipo_documento_finale = DDT::class;
|
||||||
} else {
|
} else {
|
||||||
$final_module = 'Contratti';
|
$final_module = 'Contratti';
|
||||||
$op = 'add_preventivo';
|
$op = 'add_preventivo';
|
||||||
|
$tipo_documento_finale = Contratto::class;
|
||||||
}
|
}
|
||||||
|
|
||||||
$options = [
|
$options = [
|
||||||
@ -45,6 +53,7 @@ $options = [
|
|||||||
'dir' => 'entrata',
|
'dir' => 'entrata',
|
||||||
'create_document' => true,
|
'create_document' => true,
|
||||||
'documento' => $documento,
|
'documento' => $documento,
|
||||||
|
'tipo_documento_finale' => $tipo_documento_finale,
|
||||||
];
|
];
|
||||||
|
|
||||||
echo App::load('importa.php', [], $options, true);
|
echo App::load('importa.php', [], $options, true);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user