Patch level : 2.0 496

Files correlati     : or1.exe or1100a.msk
Ricompilazione Demo : [ ]
Commento            :

GF20030
La stampa ordini per cliente-fornitore/agente/articolo restituisce il
messaggio d'errore:"FATAL ERROR can't find item with id 10 RUN TIME ERROR.

GF20031
La stampa ordini col dettaglio articoli per data di consegna oltre a
mostrare gli ordini col dettaglio del o degli articoli con data consegna
indicata in fase di interrogazione mostra anche la testata (e non il
dettaglio degli articoli giustamente) anche di quegli ordini con data di
consegna non rientrante nel range inserito in fase di interrogazione.
Esempio inserire due ordini uno con data consegna documento e righe
documento 20/05/03 e l'altro con data di consegna documento 20/05/03 e un
articolo con data di consegna 30/06/06, fare  l'interrogazione con
dettaglio righe e data di consegna dal 30/06/03 al 30/06/03.

GF20032
La stampa disponibilità articoli non evidenzia nulla.

GF20040
Se stampo con il dettaglio articoli solo per gli ordini evasi con la spunta
STAMPA RIGHE EVASE CON RESIDUO  mi elenca anche quegli ordini che sono stati
evasi per la quantità ordinata.


git-svn-id: svn://10.65.10.50/trunk@11232 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2003-06-12 09:02:18 +00:00
parent e8b8a20bc2
commit 51dad27c7d
2 changed files with 55 additions and 14 deletions

View File

@ -54,7 +54,9 @@ class TStampa_ordini : public TSkeleton_application
protected:
static bool stato_handler(TMask_field& f, KEY k);
static bool detail_handler(TMask_field& f, KEY k);
static bool datacons_filter(const TRelation* rel);
bool document_row_filter(const TRectype& row) const;
static bool document_filter(const TRelation* rel);
virtual bool create();
virtual bool destroy();
@ -180,7 +182,49 @@ void TStampa_ordini::set_totvaluta_items()
}
}
bool TStampa_ordini::datacons_filter(const TRelation* rel)
bool TStampa_ordini::document_row_filter(const TRectype& row) const
{
if (_from_cons.ok() || _to_cons.ok())
{
const TDate datacons = row.get(RDOC_DATACONS);
if (_from_cons.ok() && datacons < _from_cons)
return FALSE;
if (_to_cons.ok() && datacons > _from_cons)
return FALSE;
}
if (_TEA_rord > ' ')
{
const bool evasa = row.get_bool(RDOC_RIGAEVASA);
if (_TEA_rord == 'E')
{
if (!evasa)
return FALSE;
if (_force_evase) // Controlla se evasa con residuo
{
const real qta = row.get(RDOC_QTA);
const real qta_evasa = row.get(RDOC_QTAEVASA);
if (qta_evasa >= qta)
return FALSE; // Non c'e' residuo
}
}
if (_TEA_rord == 'A' && evasa)
return FALSE;
}
if (_from_art.not_empty() || _to_art.not_empty())
{
const TString& codart = row.get(RDOC_CODART);
if (_from_art.not_empty() && codart < _from_art)
return FALSE;
if (_to_art.not_empty() && codart > _to_art)
return FALSE;
}
return TRUE;
}
bool TStampa_ordini::document_filter(const TRelation* rel)
{
const TRectype& doc = rel->curr(LF_DOC);
TRectype rdoc(LF_RIGHEDOC);
@ -190,12 +234,9 @@ bool TStampa_ordini::datacons_filter(const TRelation* rel)
rdoc.put(RDOC_NDOC, doc.get(DOC_NDOC));
TRecord_array righe(LF_RIGHEDOC, RDOC_NRIGA);
righe.read(rdoc);
const TDate fc = app()._from_cons;
const TDate tc = app()._to_cons;
for (int r = righe.rows(); r > 0; r--)
{
const TDate datacons = righe.row(r).get(RDOC_DATACONS);
if (datacons >= fc && datacons <= tc)
if (app().document_row_filter(righe.row(r)))
return TRUE;
}
return FALSE;
@ -296,9 +337,9 @@ void TStampa_ordini::filter_for_number()
cur->setfilter(filter_expr);
// Filtro aggiuntivo per eliminare testate di documenti in cui tutte
// le righe hanno data di consegna fuori range
if (_detail_rows && _detail_doc)
cur->set_filterfunction(datacons_filter);
// le righe hanno data di consegna fuori range.
if (_detail_doc) // Era if (_detail_rows && _detail_doc)
cur->set_filterfunction(document_filter);
if (_detail_rows)
{
@ -361,7 +402,7 @@ void TStampa_ordini::filter_for_number()
s = "";
if (_force_evase)
s.format("&&(%d->QTAEVASA != %d->QTA)", LF_RIGHEDOC, LF_RIGHEDOC);
s.format("&&(STR(%d->QTAEVASA<%d->QTA))", LF_RIGHEDOC, LF_RIGHEDOC);
cond << s;
// Setta i range per la data di consegna
@ -650,7 +691,7 @@ void TStampa_ordini::filter_for_clifo_agent()
s.format("&&(%d->RIGAEVASA!=\"X\")",LF_RIGHEDOC);
if (_force_evase)
s << "&&(" << LF_RIGHEDOC << ">QTAEVASA != " << LF_RIGHEDOC << "->QTA)";
s << "&&(STR(" << LF_RIGHEDOC << "->QTAEVASA<" << LF_RIGHEDOC << "->QTA))";
}
if (s.not_empty())

View File

@ -1,15 +1,15 @@
#include "or1100a.h"
TOOLBAR "" 0 20 0 4
TOOLBAR "" 0 -3 0 3
BUTTON DLG_PRINT 10 2
BEGIN
PROMPT -12 -1 ""
PROMPT -12 -11 ""
END
BUTTON DLG_QUIT 10 2
BEGIN
PROMPT -22 -1 ""
PROMPT -22 -11 ""
END
ENDPAGE