Patch level : 2.0 468
Files correlati : cg0.exe cg3.exe Ricompilazione Demo : [ ] Commento : CM600167 Richiedo la stampa dei progressivi IVA. Deve calcolare la liquidazione se nei lim manca il flag. CM600392 Visualizzazione con indicazione del codice di esercizio, dove sono presenti movimenti provvisori. Nei progressivi precedenti non vengono inclusi i progressivi precedenti dei movimenti provvisori. CM600393 Visualizzazione senza indicazione del codice di esercizio, dove sono presenti movimenti provvisori. Nei progressivi precedenti non vengono inclusi i progressivi precedenti dei movimenti provvisori. git-svn-id: svn://10.65.10.50/trunk@11086 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
ba8900cf74
commit
be28bb1345
@ -6,6 +6,7 @@
|
|||||||
#include <mailbox.h>
|
#include <mailbox.h>
|
||||||
#include <mask.h>
|
#include <mask.h>
|
||||||
#include <printapp.h>
|
#include <printapp.h>
|
||||||
|
#include <progind.h>
|
||||||
#include <recarray.h>
|
#include <recarray.h>
|
||||||
#include <tabutil.h>
|
#include <tabutil.h>
|
||||||
|
|
||||||
@ -161,7 +162,7 @@ public:
|
|||||||
const char* desc_iva(const TString&);
|
const char* desc_iva(const TString&);
|
||||||
char frequenza_versamenti(long ditta, int anno);
|
char frequenza_versamenti(long ditta, int anno);
|
||||||
void look_pim();
|
void look_pim();
|
||||||
void ricalcola_liquidazione_se_necessario();
|
void ricalcola_liquidazione_se_necessario(int anno, int ultimo_mese);
|
||||||
|
|
||||||
TProgressivi_iva(){};
|
TProgressivi_iva(){};
|
||||||
};
|
};
|
||||||
@ -445,12 +446,12 @@ void TProgressivi_iva::look_pim()
|
|||||||
_gen1_array.sort(compare_rows); // ordinamento per codice iva
|
_gen1_array.sort(compare_rows); // ordinamento per codice iva
|
||||||
}
|
}
|
||||||
|
|
||||||
void TProgressivi_iva::ricalcola_liquidazione_se_necessario()
|
void TProgressivi_iva::ricalcola_liquidazione_se_necessario(int ultimo_anno, int ultimo_mese)
|
||||||
{
|
{
|
||||||
TRelation rel("LIM");
|
TRelation rel("LIM");
|
||||||
TRectype& rec = rel.curr();
|
TRectype& rec = rel.curr();
|
||||||
|
|
||||||
TString8 anno; anno.format("%04d", _annoiva);
|
TString8 anno; anno.format("%04d", ultimo_anno);
|
||||||
rec.put("CODTAB", anno);
|
rec.put("CODTAB", anno);
|
||||||
|
|
||||||
TCursor cur(&rel, "", 1, &rec, &rec);
|
TCursor cur(&rel, "", 1, &rec, &rec);
|
||||||
@ -462,7 +463,7 @@ void TProgressivi_iva::ricalcola_liquidazione_se_necessario()
|
|||||||
for (cur = 0l; cur.pos() < items; ++cur)
|
for (cur = 0l; cur.pos() < items; ++cur)
|
||||||
{
|
{
|
||||||
const int mese = atoi(rec.get("CODTAB").mid(4, 2));
|
const int mese = atoi(rec.get("CODTAB").mid(4, 2));
|
||||||
if (mese >= 1 && mese <= 12)
|
if (mese >= 1 && mese <= ultimo_mese)
|
||||||
{
|
{
|
||||||
if (rec.get_bool("B0"))
|
if (rec.get_bool("B0"))
|
||||||
computed.set(mese); // Mese calcolato!
|
computed.set(mese); // Mese calcolato!
|
||||||
@ -471,19 +472,24 @@ void TProgressivi_iva::ricalcola_liquidazione_se_necessario()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const char freq = frequenza_versamenti(0, _annoiva);
|
const char freq = frequenza_versamenti(0, ultimo_anno);
|
||||||
const int periods = freq == 'M' ? 12 : 4;
|
const int periods = freq == 'M' ? ultimo_mese : (ultimo_mese/3);
|
||||||
const bool ok = computed.ones() == periods;
|
const bool ok = computed.ones() == periods;
|
||||||
|
|
||||||
if (!ok && yesno_box(FR("Alcuni mesi precedenti non risultano ricalcolati:\n"
|
if (!ok && yesno_box(FR("Alcuni periodi non risultano ricalcolati:\n"
|
||||||
"è consigliabile il ricalcolo. Si desidera eseguirlo?")))
|
"è consigliabile il ricalcolo. Si desidera eseguirlo?")))
|
||||||
{
|
{
|
||||||
for (int mese = (freq == 'M') ? 1 : 3; mese <= 12; mese += (freq == 'M') ? 1 : 3)
|
const int recalc = (freq == 'M') ? ultimo_mese : ultimo_mese/3;
|
||||||
|
TProgind pi(recalc, "Ricalcolo liquidazione in corso...", TRUE, TRUE);
|
||||||
|
for (int mese = (freq == 'M') ? 1 : 3; mese <= ultimo_mese; mese += (freq == 'M') ? 1 : 3)
|
||||||
{
|
{
|
||||||
|
pi.addstatus(1);
|
||||||
|
if (pi.iscancelled())
|
||||||
|
break;
|
||||||
if (!computed[mese])
|
if (!computed[mese])
|
||||||
{
|
{
|
||||||
TToken_string body(36);
|
TToken_string body(36);
|
||||||
body.add(_annoiva);
|
body.add(ultimo_anno);
|
||||||
body.add(mese);
|
body.add(mese);
|
||||||
body.add(get_firm());
|
body.add(get_firm());
|
||||||
body.add("V"); // visualizzazione: no ff alla fine, zeri stampati
|
body.add("V"); // visualizzazione: no ff alla fine, zeri stampati
|
||||||
@ -813,7 +819,7 @@ bool TProgressivi_iva::set_print(int m)
|
|||||||
if (_tipoprog == 1 && _livelloprog == 1)
|
if (_tipoprog == 1 && _livelloprog == 1)
|
||||||
_sospmsk = msk.get_int(F_TIPOTAB); //vendite in genere; vendite in sospensione d'imposta
|
_sospmsk = msk.get_int(F_TIPOTAB); //vendite in genere; vendite in sospensione d'imposta
|
||||||
|
|
||||||
ricalcola_liquidazione_se_necessario();
|
ricalcola_liquidazione_se_necessario(_annoiva, 12);
|
||||||
setta_intestazione();
|
setta_intestazione();
|
||||||
azzera_mesi();
|
azzera_mesi();
|
||||||
cerca_i_pim();
|
cerca_i_pim();
|
||||||
@ -829,6 +835,8 @@ bool TProgressivi_iva::set_print(int m)
|
|||||||
_tipo_prog_reg = *msk.get(F_TIPOPROGREG); // L <=> Solo liquidazione, V <=> Solo volume d'affari
|
_tipo_prog_reg = *msk.get(F_TIPOPROGREG); // L <=> Solo liquidazione, V <=> Solo volume d'affari
|
||||||
prefix().set_codditta(_codditta);
|
prefix().set_codditta(_codditta);
|
||||||
|
|
||||||
|
ricalcola_liquidazione_se_necessario(_anno, _mese);
|
||||||
|
|
||||||
TLocalisamfile attiv(LF_ATTIV);
|
TLocalisamfile attiv(LF_ATTIV);
|
||||||
attiv.zero();
|
attiv.zero();
|
||||||
attiv.put(ATT_CODDITTA, _codditta);
|
attiv.put(ATT_CODDITTA, _codditta);
|
||||||
|
@ -27,6 +27,8 @@
|
|||||||
// TList
|
// TList
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifdef USE_OBSOLETE_LIST
|
||||||
|
|
||||||
class TList : public TContainer
|
class TList : public TContainer
|
||||||
{
|
{
|
||||||
enum { MAX_SKIP = 8192 };
|
enum { MAX_SKIP = 8192 };
|
||||||
@ -309,6 +311,48 @@ bool TList::remove(long index)
|
|||||||
return o != NULL;
|
return o != NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
// Simpler and faster 32 bit implemetation
|
||||||
|
|
||||||
|
class TList : public TContainer
|
||||||
|
{
|
||||||
|
TArray _data;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// @cmember Ritorna un puntatore al primo oggetto del contenitore
|
||||||
|
virtual TObject* first_item( ) { return _data.first_item(); }
|
||||||
|
// @cmember Ritorna un puntatore all'ultimo oggetto del contenitore
|
||||||
|
virtual TObject* last_item( ) { return _data.last_item(); }
|
||||||
|
// @cmember Ritorna un puntatore all'oggetto successivo all'oggetto corrente
|
||||||
|
virtual TObject* succ_item( ) { return _data.succ_item(); }
|
||||||
|
// @cmember Ritorna un puntatore all'oggetto che precede l'oggetto corrente
|
||||||
|
virtual TObject* pred_item( ) { return _data.pred_item(); }
|
||||||
|
// @cmember Ritorna il numero di oggetti nel contenitore
|
||||||
|
virtual long objects( ) { return _data.objects(); }
|
||||||
|
|
||||||
|
public:
|
||||||
|
long items() const { return _data.items(); }
|
||||||
|
void destroy() { _data.destroy(); }
|
||||||
|
long insert(TObject* obj, long pos) { return _data.insert(obj, pos); }
|
||||||
|
long append(TObject* obj, long pos = -1);
|
||||||
|
bool remove(long pos) { _data.remove(pos, TRUE); return TRUE; }
|
||||||
|
|
||||||
|
const TObject& obj(long index) const
|
||||||
|
{ const TObject* o = _data.objptr(index); CHECK(o, "Null list item"); return *o; }
|
||||||
|
};
|
||||||
|
|
||||||
|
long TList::append(TObject* obj, long index)
|
||||||
|
{
|
||||||
|
if (index < 0 || index >= items())
|
||||||
|
index = items();
|
||||||
|
else
|
||||||
|
index++;
|
||||||
|
return insert(obj, index);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// TBalance
|
// TBalance
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
@ -372,7 +416,7 @@ bool TBalance::find(const TBill& b, int esercizio,
|
|||||||
av.set('A', saldi.get_real(SLD_PAVERE));
|
av.set('A', saldi.get_real(SLD_PAVERE));
|
||||||
sf.set(saldi.get_char(SLD_FLAGSALFIN), saldi.get_real(SLD_SALDOFIN));
|
sf.set(saldi.get_char(SLD_FLAGSALFIN), saldi.get_real(SLD_SALDOFIN));
|
||||||
pd.set('D', saldi.get_real(SLD_PDAREPRO));
|
pd.set('D', saldi.get_real(SLD_PDAREPRO));
|
||||||
pd.set('A', saldi.get_real(SLD_PAVEREPRO));
|
pa.set('A', saldi.get_real(SLD_PAVEREPRO));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -712,9 +756,11 @@ void TMastrino::read(const TBill& conto,
|
|||||||
else
|
else
|
||||||
max_data_reg = esercizi[ae].fine();
|
max_data_reg = esercizi[ae].fine();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef USE_OBSOLETE_LIST
|
||||||
// Stima dimensione mastrino
|
// Stima dimensione mastrino
|
||||||
_riga.choose_step(num_giorni);
|
_riga.choose_step(num_giorni);
|
||||||
|
#endif
|
||||||
|
|
||||||
// Valori dei saldi fino alla data di inizio stampa:
|
// Valori dei saldi fino alla data di inizio stampa:
|
||||||
// Vengono inizializzati con i saldi iniziali dell'esercizio,
|
// Vengono inizializzati con i saldi iniziali dell'esercizio,
|
||||||
|
@ -884,10 +884,10 @@ char TBill::sezione() const
|
|||||||
return _sezione;
|
return _sezione;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Certified 99% (uses __tmp_string)
|
// Certified 100%
|
||||||
const char* TBill::string(int mode) const
|
const char* TBill::string(int mode) const
|
||||||
{
|
{
|
||||||
TString& s = get_tmp_string(80);
|
TString& s = get_tmp_string();
|
||||||
|
|
||||||
if (mode & 0x4)
|
if (mode & 0x4)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user