- Correzione errore MI2185 su lista controllo movimenti in ricezione. Non va bene controllare il tipo pagamento sulla testata se la partita e' stata generata in automatico.

git-svn-id: svn://10.65.10.50/trunk@3763 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
ale 1996-10-11 16:03:10 +00:00
parent e5299d8b37
commit 833c0905bc

View File

@ -160,7 +160,8 @@ public:
void calcola_importo(char tipo,int g,int c,long s,int anno,TString& numpart,int nriga);
void aggiorna_partita(real& importo,real& importoval,real& abbuoni,real& diffcam,real& ritenute,TString& sez,TString& sezabb,TString& sezdc);
void azzera_impdocval();
int cerca_anno_solare_esercizio(int codice_esercizio);
int cerca_anno_solare_esercizio(int codice_esercizio);
bool esiste_rata();
void apri_file_SC();
void chiudi_file_SC();
@ -1210,6 +1211,39 @@ bool TRic_ListaMov::controlla_anagrafica(char tipo, int gruppo, int conto)
return FALSE;
}
bool TRic_ListaMov::esiste_rata()
{
TLocalisamfile& scad = current_cursor()->file(LF_SCADENZE);
TRecnotype record = scad.recno();
scad.zero();
scad.put(SCAD_TIPOCF, _tipocf);
if (_gruppo != 0)
scad.put(SCAD_GRUPPO, _gruppo);
if (_conto != 0)
scad.put(SCAD_CONTO, _conto);
if (_codcf != 0)
scad.put(SCAD_SOTTOCONTO, _codcf);
scad.put(SCAD_ANNO, _anno);
scad.put(SCAD_NUMPART, _numpart);
scad.put(SCAD_NRIGA, _nriga);
TRectype recscad (scad.curr());
for (scad.read(_isgteq); !scad.eof(); scad.next())
{
TString rec = recscad.get(SCAD_NUMPART);
TString file = scad.get(SCAD_NUMPART);
if (scad.curr() != recscad || file != rec) break;
return TRUE;
}
scad.readat(record);
return FALSE;
}
bool TRic_ListaMov::controlla_partite()
{
if (_tipocf != 'C' && _tipocf != 'F' && _tipocf != '\0')
@ -1297,17 +1331,20 @@ bool TRic_ListaMov::controlla_partite()
}
if (_tipomov != 1)
{
if (_tipopag < 1 || _tipopag > 9)
{
if (esiste_rata())
{
_errore_grave_SC = TRUE;
_err.set(19);
}
TString datapag_str = _datapag.string();
if ( datapag_str.empty() || !TDate::isdate(_datapag.string()) )
{
_errore_grave_SC = TRUE;
_err.set(18);
if (_tipopag < 1 || _tipopag > 9)
{
_errore_grave_SC = TRUE;
_err.set(19);
}
TString datapag_str = _datapag.string();
if ( datapag_str.empty() || !TDate::isdate(_datapag.string()) )
{
_errore_grave_SC = TRUE;
_err.set(18);
}
}
}