mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-16 19:40:44 +01:00
Evito di aggiungere al documento righe con qta di evasione = 0
This commit is contained in:
parent
a10068ecf0
commit
536e9f5bb4
@ -236,7 +236,7 @@ switch (post('op')) {
|
|||||||
case 'add_ordine':
|
case 'add_ordine':
|
||||||
$ordine = \Modules\Ordini\Ordine::find(post('id_documento'));
|
$ordine = \Modules\Ordini\Ordine::find(post('id_documento'));
|
||||||
|
|
||||||
// Creazione della fattura al volo
|
// Creazione del ddt al volo
|
||||||
if (post('create_document') == 'on') {
|
if (post('create_document') == 'on') {
|
||||||
$tipo = Tipo::where('dir', $dir)->first();
|
$tipo = Tipo::where('dir', $dir)->first();
|
||||||
|
|
||||||
@ -256,7 +256,7 @@ switch (post('op')) {
|
|||||||
|
|
||||||
$righe = $ordine->getRighe();
|
$righe = $ordine->getRighe();
|
||||||
foreach ($righe as $riga) {
|
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];
|
$qta = post('qta_da_evadere')[$riga->id];
|
||||||
|
|
||||||
$copia = $riga->copiaIn($ddt, $qta);
|
$copia = $riga->copiaIn($ddt, $qta);
|
||||||
|
@ -656,7 +656,7 @@ switch (post('op')) {
|
|||||||
|
|
||||||
$righe = $fattura->getRighe();
|
$righe = $fattura->getRighe();
|
||||||
foreach ($righe as $riga) {
|
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];
|
$qta = post('qta_da_evadere')[$riga->id];
|
||||||
|
|
||||||
$copia = $riga->copiaIn($nota, -$qta);
|
$copia = $riga->copiaIn($nota, -$qta);
|
||||||
|
@ -286,7 +286,7 @@ $riga = $ordine->getRiga($type, $id_riga);
|
|||||||
case 'add_preventivo':
|
case 'add_preventivo':
|
||||||
$preventivo = \Modules\Preventivi\Preventivo::find(post('id_documento'));
|
$preventivo = \Modules\Preventivi\Preventivo::find(post('id_documento'));
|
||||||
|
|
||||||
// Creazione della fattura al volo
|
// Creazione dell' ordine al volo
|
||||||
if (post('create_document') == 'on') {
|
if (post('create_document') == 'on') {
|
||||||
$tipo = Tipo::where('dir', $dir)->first();
|
$tipo = Tipo::where('dir', $dir)->first();
|
||||||
|
|
||||||
@ -307,7 +307,7 @@ $riga = $ordine->getRiga($type, $id_riga);
|
|||||||
$parziale = false;
|
$parziale = false;
|
||||||
$righe = $preventivo->getRighe();
|
$righe = $preventivo->getRighe();
|
||||||
foreach ($righe as $riga) {
|
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];
|
$qta = post('qta_da_evadere')[$riga->id];
|
||||||
|
|
||||||
$copia = $riga->copiaIn($ordine, $qta);
|
$copia = $riga->copiaIn($ordine, $qta);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user