Evito di aggiungere al documento righe con qta di evasione = 0

This commit is contained in:
Luca 2020-02-07 17:35:26 +01:00
parent a10068ecf0
commit 536e9f5bb4
3 changed files with 5 additions and 5 deletions

View File

@ -236,7 +236,7 @@ switch (post('op')) {
case 'add_ordine':
$ordine = \Modules\Ordini\Ordine::find(post('id_documento'));
// Creazione della fattura al volo
// Creazione del ddt al volo
if (post('create_document') == 'on') {
$tipo = Tipo::where('dir', $dir)->first();
@ -256,7 +256,7 @@ switch (post('op')) {
$righe = $ordine->getRighe();
foreach ($righe as $riga) {
if (post('evadere')[$riga->id] == 'on') {
if (post('evadere')[$riga->id] == 'on' and !empty(post('qta_da_evadere')[$riga->id])) {
$qta = post('qta_da_evadere')[$riga->id];
$copia = $riga->copiaIn($ddt, $qta);

View File

@ -656,7 +656,7 @@ switch (post('op')) {
$righe = $fattura->getRighe();
foreach ($righe as $riga) {
if (post('evadere')[$riga->id] == 'on') {
if (post('evadere')[$riga->id] == 'on' and !empty(post('qta_da_evadere')[$riga->id])) {
$qta = post('qta_da_evadere')[$riga->id];
$copia = $riga->copiaIn($nota, -$qta);

View File

@ -286,7 +286,7 @@ $riga = $ordine->getRiga($type, $id_riga);
case 'add_preventivo':
$preventivo = \Modules\Preventivi\Preventivo::find(post('id_documento'));
// Creazione della fattura al volo
// Creazione dell' ordine al volo
if (post('create_document') == 'on') {
$tipo = Tipo::where('dir', $dir)->first();
@ -307,7 +307,7 @@ $riga = $ordine->getRiga($type, $id_riga);
$parziale = false;
$righe = $preventivo->getRighe();
foreach ($righe as $riga) {
if (post('evadere')[$riga->id] == 'on') {
if (post('evadere')[$riga->id] == 'on' and !empty(post('qta_da_evadere')[$riga->id])) {
$qta = post('qta_da_evadere')[$riga->id];
$copia = $riga->copiaIn($ordine, $qta);