Correzioni a mastrini e chiusure e bilanci
git-svn-id: svn://10.65.10.50/trunk@1407 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
7409d3be97
commit
f631dc637c
@ -62,7 +62,6 @@ HIDDEN const char* err_msg[] = {"La data operazione non appartiene a nessun eser
|
|||||||
"Indicato codice C/F per allegato non presente in anagrafica",
|
"Indicato codice C/F per allegato non presente in anagrafica",
|
||||||
"Codice cliente/fornitore non presente in anagrafica"};
|
"Codice cliente/fornitore non presente in anagrafica"};
|
||||||
|
|
||||||
|
|
||||||
class TListaMov_application : public TPrintapp
|
class TListaMov_application : public TPrintapp
|
||||||
{
|
{
|
||||||
friend bool filter_func (const TRelation *);
|
friend bool filter_func (const TRelation *);
|
||||||
@ -98,6 +97,7 @@ class TListaMov_application : public TPrintapp
|
|||||||
bool _settata_prima_riga, _causale_gia_stampata,_mov_di_sola_iva;
|
bool _settata_prima_riga, _causale_gia_stampata,_mov_di_sola_iva;
|
||||||
int _cur1,_cur2,_cur2b,_cur3,_cur4,_decidi,_tipod,_controllo_mov_errati;
|
int _cur1,_cur2,_cur2b,_cur3,_cur4,_decidi,_tipod,_controllo_mov_errati;
|
||||||
int _numero_riga, _alleg, _tiporegistro, _tipocr, _scelta_stampa, _nr, _n;
|
int _numero_riga, _alleg, _tiporegistro, _tipocr, _scelta_stampa, _nr, _n;
|
||||||
|
int _provvis;
|
||||||
liste _tipo_lista;
|
liste _tipo_lista;
|
||||||
word _flags;
|
word _flags;
|
||||||
|
|
||||||
@ -112,7 +112,7 @@ protected:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
bool user_create() ;
|
bool user_create();
|
||||||
bool user_destroy();
|
bool user_destroy();
|
||||||
bool segnala_errori_primariga();
|
bool segnala_errori_primariga();
|
||||||
bool segnala_errori_ogniriga();
|
bool segnala_errori_ogniriga();
|
||||||
@ -825,7 +825,8 @@ void TListaMov_application::set_page(int file, int count)
|
|||||||
set_row (_n, "@103greg @3s",FLD(LF_MOV,MOV_REG));
|
set_row (_n, "@103greg @3s",FLD(LF_MOV,MOV_REG));
|
||||||
set_row (_n, "@111gpr @5n",FLD(LF_MOV,MOV_PROTIVA));
|
set_row (_n, "@111gpr @5n",FLD(LF_MOV,MOV_PROTIVA));
|
||||||
}
|
}
|
||||||
else set_row (_n, "@103gMov.Provvisorio");
|
else if (_provvis == 2 && (prov == 'P' || prov == 'N'))
|
||||||
|
set_row (_n, "@103gMov.Provvisorio");
|
||||||
if (ae != annoese)
|
if (ae != annoese)
|
||||||
if (_annoes == 0) //se non indicato l'anno nella maschera
|
if (_annoes == 0) //se non indicato l'anno nella maschera
|
||||||
set_row (_n, "@120gcomp @4n", FLD(LF_MOV,MOV_ANNOES));
|
set_row (_n, "@120gcomp @4n", FLD(LF_MOV,MOV_ANNOES));
|
||||||
@ -876,7 +877,6 @@ void TListaMov_application::stampa_intestazione()
|
|||||||
|
|
||||||
bool TListaMov_application::preprocess_page(int file,int counter)
|
bool TListaMov_application::preprocess_page(int file,int counter)
|
||||||
{
|
{
|
||||||
|
|
||||||
TCursor* cur = current_cursor();
|
TCursor* cur = current_cursor();
|
||||||
|
|
||||||
if (counter) return TRUE;
|
if (counter) return TRUE;
|
||||||
@ -2070,8 +2070,7 @@ bool TListaMov_application::set_print(int m)
|
|||||||
_data_ini = msk.get(F_DATAINI);
|
_data_ini = msk.get(F_DATAINI);
|
||||||
_data_fin = msk.get(F_DATAFIN);
|
_data_fin = msk.get(F_DATAFIN);
|
||||||
_numreg_fin = atoi(msk.get(F_NUMEROFIN));
|
_numreg_fin = atoi(msk.get(F_NUMEROFIN));
|
||||||
//bool provvis = msk.get_bool(F_STAMPAMOVP);
|
_provvis = msk.get_int(F_STAMPAMOVP);
|
||||||
int provvis = msk.get_int(F_STAMPAMOVP);
|
|
||||||
if (_decidi == 1)
|
if (_decidi == 1)
|
||||||
{
|
{
|
||||||
select_cursor(_cur1);
|
select_cursor(_cur1);
|
||||||
@ -2080,9 +2079,9 @@ bool TListaMov_application::set_print(int m)
|
|||||||
_curr1->setfilter("(PROVVIS=\"\")");
|
_curr1->setfilter("(PROVVIS=\"\")");
|
||||||
else _curr1->setfilter("");
|
else _curr1->setfilter("");
|
||||||
*/
|
*/
|
||||||
if (provvis == 1) //normale
|
if (_provvis == 1) //normale
|
||||||
_curr1->setfilter("(PROVVIS=\"\")");
|
_curr1->setfilter("(PROVVIS=\"\")");
|
||||||
else if (provvis == 2) //globale
|
else if (_provvis == 2) //globale
|
||||||
_curr1->setfilter("");
|
_curr1->setfilter("");
|
||||||
else _curr1->setfilter("(PROVVIS!=\"\")"); //solo provvisori
|
else _curr1->setfilter("(PROVVIS!=\"\")"); //solo provvisori
|
||||||
fl = &(current_cursor()->file(LF_MOV));
|
fl = &(current_cursor()->file(LF_MOV));
|
||||||
@ -2106,9 +2105,9 @@ bool TListaMov_application::set_print(int m)
|
|||||||
else
|
else
|
||||||
_curr2->setfilter("");
|
_curr2->setfilter("");
|
||||||
*/
|
*/
|
||||||
if (provvis == 1) //normale
|
if (_provvis == 1) //normale
|
||||||
_curr2->setfilter("(PROVVIS=\"\")");
|
_curr2->setfilter("(PROVVIS=\"\")");
|
||||||
else if (provvis == 2) //globale
|
else if (_provvis == 2) //globale
|
||||||
_curr2->setfilter("");
|
_curr2->setfilter("");
|
||||||
else _curr2->setfilter("(PROVVIS!=\"\")"); //solo provvisori
|
else _curr2->setfilter("(PROVVIS!=\"\")"); //solo provvisori
|
||||||
fl = &(current_cursor()->file(LF_MOV));
|
fl = &(current_cursor()->file(LF_MOV));
|
||||||
|
@ -90,24 +90,36 @@ bool mask_datac (TMask_field& f, KEY k)
|
|||||||
TabEs.prev();
|
TabEs.prev();
|
||||||
TDate iniziop = TabEs.get_date("D0");
|
TDate iniziop = TabEs.get_date("D0");
|
||||||
TDate finep = TabEs.get_date("D1");
|
TDate finep = TabEs.get_date("D1");
|
||||||
if (f.get() < finep)
|
TDate data = f.get();
|
||||||
|
|
||||||
|
TString istr = inizio.string();
|
||||||
|
TString fstr = fine.string();
|
||||||
|
|
||||||
|
TString ipstr = iniziop.string();
|
||||||
|
TString fpstr = finep.string();
|
||||||
|
|
||||||
|
TString scastr = scarico.string();
|
||||||
|
|
||||||
|
TString datastr = f.get();
|
||||||
|
|
||||||
|
if (data < finep)
|
||||||
{
|
{
|
||||||
f.warning_box ("La data di chiusura non puo' essere inferiore alla data di fine esercizio precedente");
|
f.warning_box ("La data di chiusura non puo' essere inferiore alla data di fine esercizio precedente");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (f.get() > fine)
|
if (data > fine)
|
||||||
{
|
{
|
||||||
f.warning_box ("La data di chiusura non puo' essere superiore alla data di fine esercizio in corso");
|
f.warning_box ("La data di chiusura non puo' essere superiore alla data di fine esercizio in corso");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if ( scarico.ok() && (f.get() <= scarico) )
|
if ( scarico.ok() && (data <= scarico) )
|
||||||
{
|
{
|
||||||
f.warning_box ("La data di chiusura non puo' essere inferiore o uguale alla data di scarico");
|
f.warning_box ("La data di chiusura non puo' essere inferiore o uguale alla data di scarico");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if ( (f.get() >= inizio) && (f.get() <= fine) ) //la data di chiusura e' cioe' relativa all'esercizio in corso
|
if ( (data >= inizio) && (data <= fine) ) //la data di chiusura e' cioe' relativa all'esercizio in corso
|
||||||
anno = fine.year();
|
anno = fine.year();
|
||||||
else if ( (f.get() >= iniziop) && (f.get() <= finep) ) //la data di chiusura e' cioe' relativa all'esercizio precedente
|
else if ( (data >= iniziop) && (data <= finep) ) //la data di chiusura e' cioe' relativa all'esercizio precedente
|
||||||
anno = finep.year();
|
anno = finep.year();
|
||||||
|
|
||||||
TabReg.zero();
|
TabReg.zero();
|
||||||
@ -123,7 +135,7 @@ else if ( (f.get() >= iniziop) && (f.get() <= finep) ) //la data di chiusura e'
|
|||||||
if (tiporeg == 5)
|
if (tiporeg == 5)
|
||||||
{
|
{
|
||||||
TDate datast = TabReg.get_date("D3");
|
TDate datast = TabReg.get_date("D3");
|
||||||
if (f.get() < datast.string())
|
if (data < datast.string())
|
||||||
{
|
{
|
||||||
ok = FALSE;
|
ok = FALSE;
|
||||||
break;
|
break;
|
||||||
@ -156,25 +168,37 @@ bool mask_dataap (TMask_field& f, KEY k)
|
|||||||
TabEs.prev();
|
TabEs.prev();
|
||||||
TDate iniziop = TabEs.get_date("D0");
|
TDate iniziop = TabEs.get_date("D0");
|
||||||
TDate finep = TabEs.get_date("D1");
|
TDate finep = TabEs.get_date("D1");
|
||||||
if (f.get() < inizio)
|
TDate data = f.get();
|
||||||
|
|
||||||
|
TString istr = inizio.string();
|
||||||
|
TString fstr = fine.string();
|
||||||
|
|
||||||
|
TString ipstr = iniziop.string();
|
||||||
|
TString fpstr = finep.string();
|
||||||
|
|
||||||
|
TString scastr = scarico.string();
|
||||||
|
|
||||||
|
TString datastr = f.get();
|
||||||
|
|
||||||
|
if (data < inizio)
|
||||||
{
|
{
|
||||||
f.warning_box ("La data di apertura non puo' essere inferiore alla data di inizio esercizio in corso");
|
f.warning_box ("La data di apertura non puo' essere inferiore alla data di inizio esercizio in corso");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (f.get() > fine)
|
if (data > fine)
|
||||||
{
|
{
|
||||||
f.warning_box ("La data di apertura non puo' essere superiore alla data di fine esercizio in corso");
|
f.warning_box ("La data di apertura non puo' essere superiore alla data di fine esercizio in corso");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if ( scarico.ok() && (f.get() <= scarico) )
|
if ( scarico.ok() && (data <= scarico) )
|
||||||
{
|
{
|
||||||
f.warning_box ("La data di apertura non puo' essere inferiore o uguale alla data di scarico");
|
f.warning_box ("La data di apertura non puo' essere inferiore o uguale alla data di scarico");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( (f.get() >= inizio) && (f.get() <= fine) ) //la data di apertura e' cioe' relativa all'esercizio in corso
|
if ( (data >= inizio) && (data <= fine) ) //la data di apertura e' cioe' relativa all'esercizio in corso
|
||||||
anno = fine.year();
|
anno = fine.year();
|
||||||
else if( (f.get() >= iniziop) && (f.get() <= finep) ) //la data di apertura e' cioe' relativa all'esercizio precedente
|
else if( (data >= iniziop) && (data <= finep) ) //la data di apertura e' cioe' relativa all'esercizio precedente
|
||||||
anno = finep.year();
|
anno = finep.year();
|
||||||
|
|
||||||
TabReg.zero();
|
TabReg.zero();
|
||||||
@ -190,7 +214,7 @@ else if( (f.get() >= iniziop) && (f.get() <= finep) ) //la data di apertura e' c
|
|||||||
if (tiporeg == 5)
|
if (tiporeg == 5)
|
||||||
{
|
{
|
||||||
TDate datast = TabReg.get_date("D3");
|
TDate datast = TabReg.get_date("D3");
|
||||||
if (f.get() < datast)
|
if (data < datast)
|
||||||
{
|
{
|
||||||
ok = FALSE;
|
ok = FALSE;
|
||||||
break;
|
break;
|
||||||
@ -547,6 +571,8 @@ void CG4600_application::rmov_proper(int anno,long numrig,TDate& datareg,TRectyp
|
|||||||
char sezione = ' ';
|
char sezione = ' ';
|
||||||
real totale = tot_saldo;
|
real totale = tot_saldo;
|
||||||
|
|
||||||
|
if (totale != ZERO)
|
||||||
|
{
|
||||||
rmov.zero();
|
rmov.zero();
|
||||||
rmov.put(RMV_ANNOES, anno);
|
rmov.put(RMV_ANNOES, anno);
|
||||||
rmov.put(RMV_NUMREG, _numreg);
|
rmov.put(RMV_NUMREG, _numreg);
|
||||||
@ -575,13 +601,14 @@ void CG4600_application::rmov_proper(int anno,long numrig,TDate& datareg,TRectyp
|
|||||||
_sld->aggiorna(tc,TImporto(sez_rmov,totale)); //Aggiorno anche i saldi con
|
_sld->aggiorna(tc,TImporto(sez_rmov,totale)); //Aggiorno anche i saldi con
|
||||||
// l'oggetto TSaldo_agg
|
// l'oggetto TSaldo_agg
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
rmov.put(RMV_SEZIONE, sezione);
|
rmov.put(RMV_SEZIONE, sezione);
|
||||||
_sld->aggiorna(tc,TImporto(sezione,totale)); //Aggiorno anche i saldi con
|
_sld->aggiorna(tc,TImporto(sezione,totale)); //Aggiorno anche i saldi con
|
||||||
//l'oggetto TSaldo_agg
|
//l'oggetto TSaldo_agg
|
||||||
}
|
}
|
||||||
rmov.put(RMV_IMPORTO, totale);
|
rmov.put(RMV_IMPORTO, totale);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CG4600_application::costi()
|
void CG4600_application::costi()
|
||||||
@ -1041,6 +1068,8 @@ void CG4600_application::chiudi_attivita()
|
|||||||
sale.ultima_immissione_bilancio(_annoesch,g,c,s,indbil, 1);
|
sale.ultima_immissione_bilancio(_annoesch,g,c,s,indbil, 1);
|
||||||
_saldo = sale.saldo();
|
_saldo = sale.saldo();
|
||||||
|
|
||||||
|
TString sldstr = _saldo.string();
|
||||||
|
|
||||||
if (_saldo == ZERO) continue;
|
if (_saldo == ZERO) continue;
|
||||||
|
|
||||||
if (j >= MAX || _saldi->eof())
|
if (j >= MAX || _saldi->eof())
|
||||||
|
@ -341,7 +341,7 @@ bool TSaldo::data_limite_bilancio(int bilancio, int g, int c, long s, const TDat
|
|||||||
TCaus cau(_codcaus);
|
TCaus cau(_codcaus);
|
||||||
|
|
||||||
if (_codcaus.not_empty())
|
if (_codcaus.not_empty())
|
||||||
if (cau.chiusura() || cau.apertura())
|
if (cau.chiusura()) //|| cau.apertura())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user