Corretti parametri liquidazione
git-svn-id: svn://10.65.10.50/trunk@1001 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
7b4320cec7
commit
148956c90c
@ -311,7 +311,7 @@ END
|
|||||||
|
|
||||||
BOOLEAN FLD_CM2_STSOTTBIL
|
BOOLEAN FLD_CM2_STSOTTBIL
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 14 "Non stampare dettaglio sottoconti su bilanci "
|
PROMPT 1 14 "Non stampare dettaglio sottoconti su bilanci a sezioni"
|
||||||
HELP "Indicare se stampare il dettaglio dei sottoconti nei bilanci di verifica"
|
HELP "Indicare se stampare il dettaglio dei sottoconti nei bilanci di verifica"
|
||||||
FIELD LF_PCON->STSOTTBIL
|
FIELD LF_PCON->STSOTTBIL
|
||||||
GROUP 1 3
|
GROUP 1 3
|
||||||
@ -319,7 +319,7 @@ END
|
|||||||
|
|
||||||
BOOLEAN FLD_CM2_COMPENS
|
BOOLEAN FLD_CM2_COMPENS
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 50 14 "Compensazione saldi "
|
PROMPT 50 14 "Compensazione saldi"
|
||||||
HELP "Indicare se e' ammessa la compensazione dei saldi"
|
HELP "Indicare se e' ammessa la compensazione dei saldi"
|
||||||
FIELD LF_PCON->COMPENS
|
FIELD LF_PCON->COMPENS
|
||||||
GROUP 1 3
|
GROUP 1 3
|
||||||
@ -327,7 +327,7 @@ END
|
|||||||
|
|
||||||
BOOLEAN FLD_CM2_STSOTTAB
|
BOOLEAN FLD_CM2_STSOTTAB
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 15 "Stampa dettaglio sottoconti su analisi "
|
PROMPT 1 15 "Stampa dettaglio sottoconti su analisi"
|
||||||
HELP "Indicare se stampare il dettaglio dei sottoconti nell'analisi di bilancio"
|
HELP "Indicare se stampare il dettaglio dei sottoconti nell'analisi di bilancio"
|
||||||
FIELD LF_PCON->STSOTTAB
|
FIELD LF_PCON->STSOTTAB
|
||||||
GROUP 1 3
|
GROUP 1 3
|
||||||
|
@ -55,7 +55,7 @@ END
|
|||||||
|
|
||||||
STRING F_RAGSOC 30
|
STRING F_RAGSOC 30
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 23 1 "Ragione sociale "
|
PROMPT 23 1 "Cognome / Rag. Soc."
|
||||||
FIELD LF_CLIFO->RAGSOC[1,30]
|
FIELD LF_CLIFO->RAGSOC[1,30]
|
||||||
KEY 2
|
KEY 2
|
||||||
USE LF_CLIFO KEY 2
|
USE LF_CLIFO KEY 2
|
||||||
@ -75,7 +75,7 @@ END
|
|||||||
|
|
||||||
STRING F_RAGSOCA 20
|
STRING F_RAGSOCA 20
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 23 2 "Nome o seconda parte rag. soc. "
|
PROMPT 23 2 "Nome / Seconda parte Rag. Soc. "
|
||||||
FIELD LF_CLIFO->RAGSOC[31,]
|
FIELD LF_CLIFO->RAGSOC[31,]
|
||||||
KEY 2
|
KEY 2
|
||||||
HELP "Seconda parte della ragione sociale o nome"
|
HELP "Seconda parte della ragione sociale o nome"
|
||||||
@ -360,14 +360,14 @@ END
|
|||||||
|
|
||||||
STRING DLG_NULL 30
|
STRING DLG_NULL 30
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 23 1 "Ragione sociale "
|
PROMPT 23 1 "Cognome / Rag. Soc. "
|
||||||
FLAGS "D"
|
FLAGS "D"
|
||||||
GROUP 3
|
GROUP 3
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING DLG_NULL 20
|
STRING DLG_NULL 20
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 23 2 "Nome o seconda parte rag. soc. "
|
PROMPT 23 2 "Nome / Seconda parte Rag. Soc. "
|
||||||
FLAGS "D"
|
FLAGS "D"
|
||||||
GROUP 6
|
GROUP 6
|
||||||
END
|
END
|
||||||
@ -583,14 +583,14 @@ END
|
|||||||
|
|
||||||
STRING DLG_NULL 30
|
STRING DLG_NULL 30
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 23 1 "Ragione sociale "
|
PROMPT 23 1 "Cognome / Rag. Soc. "
|
||||||
FLAGS "D"
|
FLAGS "D"
|
||||||
GROUP 3
|
GROUP 3
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING DLG_NULL 20
|
STRING DLG_NULL 20
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 23 2 "Nome o seconda parte rag. soc. "
|
PROMPT 23 2 "Nome / Seconda parte Rag. Soc. "
|
||||||
FLAGS "D"
|
FLAGS "D"
|
||||||
GROUP 6
|
GROUP 6
|
||||||
END
|
END
|
||||||
@ -831,14 +831,14 @@ END
|
|||||||
|
|
||||||
STRING DLG_NULL 30
|
STRING DLG_NULL 30
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 23 1 "Ragione sociale "
|
PROMPT 23 1 "Cognome / Rag. Soc. "
|
||||||
FLAGS "D"
|
FLAGS "D"
|
||||||
GROUP 3
|
GROUP 3
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING DLG_NULL 20
|
STRING DLG_NULL 20
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 23 2 "Nome o seconda parte rag. soc. "
|
PROMPT 23 2 "Nome / Seconda parte Rag. Soc. "
|
||||||
FLAGS "D"
|
FLAGS "D"
|
||||||
GROUP 6
|
GROUP 6
|
||||||
END
|
END
|
||||||
@ -890,14 +890,14 @@ END
|
|||||||
|
|
||||||
STRING DLG_NULL 30
|
STRING DLG_NULL 30
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 23 1 "Ragione sociale "
|
PROMPT 23 1 "Cognome / Rag. Soc. "
|
||||||
FLAGS "D"
|
FLAGS "D"
|
||||||
GROUP 3
|
GROUP 3
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING DLG_NULL 20
|
STRING DLG_NULL 20
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 23 2 "Nome o seconda parte rag. soc. "
|
PROMPT 23 2 "Nome / seconda parte Rag. Soc. "
|
||||||
FLAGS "D"
|
FLAGS "D"
|
||||||
GROUP 6
|
GROUP 6
|
||||||
END
|
END
|
||||||
@ -1048,14 +1048,14 @@ END
|
|||||||
|
|
||||||
STRING DLG_NULL 30
|
STRING DLG_NULL 30
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 23 1 "Ragione sociale "
|
PROMPT 23 1 "Cognome / Rag. Soc. "
|
||||||
FLAGS "D"
|
FLAGS "D"
|
||||||
GROUP 3
|
GROUP 3
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING DLG_NULL 20
|
STRING DLG_NULL 20
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 23 2 "Nome o seconda parte rag. soc. "
|
PROMPT 23 2 "Nome / Seconda parte Rag. Soc. "
|
||||||
FLAGS "D"
|
FLAGS "D"
|
||||||
GROUP 6
|
GROUP 6
|
||||||
END
|
END
|
||||||
@ -1305,14 +1305,14 @@ END
|
|||||||
|
|
||||||
STRING DLG_NULL 30
|
STRING DLG_NULL 30
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 23 1 "Ragione sociale "
|
PROMPT 23 1 "Cognome / Rag. Soc. "
|
||||||
FLAGS "D"
|
FLAGS "D"
|
||||||
GROUP 3
|
GROUP 3
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING DLG_NULL 20
|
STRING DLG_NULL 20
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 23 2 "Nome o seconda parte rag. soc. "
|
PROMPT 23 2 "Nome / Seconda Parte Rag. Soc. "
|
||||||
FLAGS "D"
|
FLAGS "D"
|
||||||
GROUP 6
|
GROUP 6
|
||||||
END
|
END
|
||||||
@ -1480,14 +1480,14 @@ END
|
|||||||
|
|
||||||
STRING DLG_NULL 30
|
STRING DLG_NULL 30
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 23 1 "Ragione sociale "
|
PROMPT 23 1 "Cognome / Rag. Soc. "
|
||||||
FLAGS "D"
|
FLAGS "D"
|
||||||
GROUP 3
|
GROUP 3
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING DLG_NULL 20
|
STRING DLG_NULL 20
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 23 2 "Nome o seconda parte rag. soc. "
|
PROMPT 23 2 "Nome / Seconda parte Rag. Soc. "
|
||||||
FLAGS "D"
|
FLAGS "D"
|
||||||
GROUP 6
|
GROUP 6
|
||||||
END
|
END
|
||||||
@ -1646,7 +1646,7 @@ BEGIN
|
|||||||
HELP "Codice del titolo onorifico"
|
HELP "Codice del titolo onorifico"
|
||||||
END
|
END
|
||||||
|
|
||||||
LIST F_RAGGOR 1 14
|
LIST F_RAGGOR 1 16
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 15 "Raggruppamento ordine "
|
PROMPT 2 15 "Raggruppamento ordine "
|
||||||
FIELD LF_CFVEN->RAGGOR
|
FIELD LF_CFVEN->RAGGOR
|
||||||
|
@ -89,7 +89,7 @@ BEGIN
|
|||||||
OUTPUT F_CODCAUS CODCAUS
|
OUTPUT F_CODCAUS CODCAUS
|
||||||
OUTPUT F_DESCRCAUS DESCR
|
OUTPUT F_DESCRCAUS DESCR
|
||||||
ADD RUN cg0 -4
|
ADD RUN cg0 -4
|
||||||
CHECKTYPE REQUIRED
|
CHECKTYPE NORMAL
|
||||||
WARNING "Causale assente"
|
WARNING "Causale assente"
|
||||||
END
|
END
|
||||||
|
|
||||||
|
@ -1184,8 +1184,9 @@ bool TPrimanota_application::caus_query_handler(TMask_field& f, KEY key)
|
|||||||
if (ok)
|
if (ok)
|
||||||
f.mask().stop_run(K_INS); // Entra in modo inserimento
|
f.mask().stop_run(K_INS); // Entra in modo inserimento
|
||||||
}
|
}
|
||||||
else return FALSE;
|
else
|
||||||
}
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -146,7 +146,7 @@ bool TRegistro::read_att()
|
|||||||
_att.zero();
|
_att.zero();
|
||||||
|
|
||||||
TString16 chiave; // Ditta - Anno - Attivita' - Tipo Attivita' (fissata a 1)
|
TString16 chiave; // Ditta - Anno - Attivita' - Tipo Attivita' (fissata a 1)
|
||||||
chiave.format("%5ld", main_app().get_firm());
|
chiave.format("%05ld", main_app().get_firm());
|
||||||
chiave << year(); // non fare << year() << attivita()
|
chiave << year(); // non fare << year() << attivita()
|
||||||
chiave << attivita() << "1";
|
chiave << attivita() << "1";
|
||||||
|
|
||||||
|
@ -29,6 +29,7 @@ BEGIN
|
|||||||
WARNIG "Codice ABI errato"
|
WARNIG "Codice ABI errato"
|
||||||
USE %BAN
|
USE %BAN
|
||||||
INPUT CODTAB[1,5] FLD_CODABI
|
INPUT CODTAB[1,5] FLD_CODABI
|
||||||
|
INPUT CODTAB[6,10] FLD_CODCAB
|
||||||
DISPLAY "ABI@5" CODTAB[1,5]
|
DISPLAY "ABI@5" CODTAB[1,5]
|
||||||
DISPLAY "CAB@5" CODTAB[6,10]
|
DISPLAY "CAB@5" CODTAB[6,10]
|
||||||
DISPLAY "Denominazione@50" S0
|
DISPLAY "Denominazione@50" S0
|
||||||
@ -46,10 +47,10 @@ BEGIN
|
|||||||
HELP "Codice CAB banca di appoggio per deleghe IVA"
|
HELP "Codice CAB banca di appoggio per deleghe IVA"
|
||||||
WARNIG "Codice CAB errato"
|
WARNIG "Codice CAB errato"
|
||||||
COPY ALL FLD_CODABI
|
COPY ALL FLD_CODABI
|
||||||
INPUT CODTAB[6,10] FLD_CODCAB
|
|
||||||
CHECKTYPE NORMAL
|
CHECKTYPE NORMAL
|
||||||
FIELD CodCAB
|
FIELD CodCAB
|
||||||
FLAGS "Z"
|
FLAGS "Z"
|
||||||
|
VALIDATE REQUIF_FUNC 1 FLD_CODABI
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING FLD_RAGSOCB 50
|
STRING FLD_RAGSOCB 50
|
||||||
|
246
cg/cg5300.cpp
246
cg/cg5300.cpp
@ -13,10 +13,10 @@
|
|||||||
|
|
||||||
#include <attiv.h>
|
#include <attiv.h>
|
||||||
#include <nditte.h>
|
#include <nditte.h>
|
||||||
|
|
||||||
#define TAB_LIA "%LIA"
|
#define TAB_LIA "%LIA"
|
||||||
#define TAB_PLA "%PLA"
|
#define TAB_PLA "%PLA"
|
||||||
|
|
||||||
class TParaliq_app : public TRelation_application
|
class TParaliq_app : public TRelation_application
|
||||||
{
|
{
|
||||||
TRelation * _rel;
|
TRelation * _rel;
|
||||||
@ -28,16 +28,16 @@ class TParaliq_app : public TRelation_application
|
|||||||
TString_array _atts; // array di stringhe con i codici attivita'
|
TString_array _atts; // array di stringhe con i codici attivita'
|
||||||
TString_array _tips; // array di stringhe con i tipi attivita'
|
TString_array _tips; // array di stringhe con i tipi attivita'
|
||||||
long _lastditta;
|
long _lastditta;
|
||||||
TString16 _freqiva;
|
|
||||||
|
|
||||||
void check_registers(int year);
|
void check_registers(int year);
|
||||||
|
|
||||||
protected:
|
protected: // Applicat
|
||||||
|
virtual void on_config_change();
|
||||||
|
|
||||||
|
protected: // Relapp
|
||||||
virtual bool user_create();
|
virtual bool user_create();
|
||||||
virtual bool user_destroy();
|
virtual bool user_destroy();
|
||||||
|
|
||||||
// minchia di cristo
|
|
||||||
virtual TRelation* get_relation() const { return _rel; }
|
virtual TRelation* get_relation() const { return _rel; }
|
||||||
virtual TMask* get_mask(int mode) { return _msk; }
|
virtual TMask* get_mask(int mode) { return _msk; }
|
||||||
virtual bool changing_mask(int mode) { return FALSE; }
|
virtual bool changing_mask(int mode) { return FALSE; }
|
||||||
@ -53,75 +53,74 @@ protected:
|
|||||||
virtual int write(const TMask& m) { return rewrite(m);}
|
virtual int write(const TMask& m) { return rewrite(m);}
|
||||||
virtual int read(TMask& m);
|
virtual int read(TMask& m);
|
||||||
|
|
||||||
|
protected:
|
||||||
void init_array(TMask& m);
|
void init_array(TMask& m);
|
||||||
|
|
||||||
// notifier
|
|
||||||
static bool sheet_action(int r, KEY k);
|
static bool sheet_action(int r, KEY k);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
TParaliq_app() { _lastditta = 0L;}
|
TParaliq_app() { _lastditta = 0L; }
|
||||||
virtual ~TParaliq_app() {}
|
virtual ~TParaliq_app() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
void TParaliq_app::check_registers(int year)
|
void TParaliq_app::check_registers(int year)
|
||||||
{
|
{
|
||||||
// controlla che per ogni data attivita' esistano almeno un registro
|
// controlla che per ogni data attivita' esistano almeno un registro
|
||||||
// acquisti, vendite e giornale; warning appropriato in caso negativo
|
// acquisti, vendite e giornale; warning appropriato in caso negativo
|
||||||
TTable reg("REG");
|
TTable reg("REG");
|
||||||
TRecfield reg_year(reg.curr(), "CODTAB", 0,3);
|
TRecfield reg_year(reg.curr(), "CODTAB", 0,3);
|
||||||
|
|
||||||
const byte R_ACQ = 0x01;
|
const byte R_ACQ = 0x01;
|
||||||
const byte R_VEN = 0x02;
|
const byte R_VEN = 0x02;
|
||||||
const byte R_ALL = R_ACQ | R_VEN;
|
const byte R_ALL = R_ACQ | R_VEN;
|
||||||
|
|
||||||
bool is_giornale = FALSE;
|
bool is_giornale = FALSE;
|
||||||
byte flags = 0x00;
|
byte flags = 0x00;
|
||||||
|
|
||||||
for (int i = 0; i < _atts.items(); i++)
|
for (int i = 0; i < _atts.items(); i++)
|
||||||
{
|
{
|
||||||
TString& att = (TString&)_atts[i];
|
TString& att = (TString&)_atts[i];
|
||||||
for (reg.first(); !reg.eof(); reg.next())
|
for (reg.first(); !reg.eof(); reg.next())
|
||||||
{
|
{
|
||||||
if (atoi(reg_year) == year && reg.get_int("I0") == 5)
|
if (atoi(reg_year) == year && reg.get_int("I0") == 5)
|
||||||
{
|
{
|
||||||
is_giornale = TRUE;
|
is_giornale = TRUE;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (atoi(reg_year) != year || att != reg.get("S8"))
|
if (atoi(reg_year) != year || att != reg.get("S8"))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
switch (reg.get_int("I0"))
|
switch (reg.get_int("I0"))
|
||||||
{
|
{
|
||||||
case 1: // vendite
|
case 1: // vendite
|
||||||
flags |= R_VEN;
|
flags |= R_VEN;
|
||||||
break;
|
break;
|
||||||
case 2: // acquisti
|
case 2: // acquisti
|
||||||
flags |= R_ACQ;
|
flags |= R_ACQ;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (flags == R_ALL && is_giornale) break;
|
if (flags == R_ALL && is_giornale) break;
|
||||||
}
|
|
||||||
if (flags < R_ALL)
|
|
||||||
{
|
|
||||||
TString wrn("I seguenti registri non esistono per l'attivita' ");
|
|
||||||
wrn << att << "(" << year << "):";
|
|
||||||
if ((flags & R_VEN) == 0x00) wrn << "\n\tregistro vendite";
|
|
||||||
if ((flags & R_ACQ) == 0x00) wrn << "\n\tregistro acquisti";
|
|
||||||
warning_box(wrn);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
if (flags < R_ALL)
|
||||||
|
{
|
||||||
|
TString wrn("I seguenti registri non esistono per l'attivita' ");
|
||||||
|
wrn << att << "(" << year << "):";
|
||||||
|
if ((flags & R_VEN) == 0x00) wrn << "\n\tregistro vendite";
|
||||||
|
if ((flags & R_ACQ) == 0x00) wrn << "\n\tregistro acquisti";
|
||||||
|
warning_box(wrn);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// libro giornale non si controlla per attivita'
|
// libro giornale non si controlla per attivita'
|
||||||
if(!is_giornale)
|
if(!is_giornale)
|
||||||
warning_box("Non esiste probabilmente nessun "
|
warning_box("Non esiste probabilmente nessun "
|
||||||
"libro giornale per l'anno %d", year);
|
"libro giornale per l'anno %d", year);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TParaliq_app::init_array(TMask& m)
|
void TParaliq_app::init_array(TMask& m)
|
||||||
{
|
{
|
||||||
const long newditta = m.get_long(F_CODDITTA);
|
const long newditta = m.get_long(F_CODDITTA);
|
||||||
|
|
||||||
if (newditta != _lastditta)
|
if (newditta != _lastditta)
|
||||||
@ -136,25 +135,30 @@ void TParaliq_app::init_array(TMask& m)
|
|||||||
|
|
||||||
for(_attiv->read(_isgteq);
|
for(_attiv->read(_isgteq);
|
||||||
_attiv->status() == NOERR && _attiv->curr() == r;
|
_attiv->status() == NOERR && _attiv->curr() == r;
|
||||||
_attiv->next())
|
_attiv->next())
|
||||||
{
|
{
|
||||||
// istanzia array _atts on le attivita' della ditta corrente
|
// istanzia array _atts on le attivita' della ditta corrente
|
||||||
_atts.add(_attiv->get(ATT_CODATT));
|
_atts.add(_attiv->get(ATT_CODATT));
|
||||||
_tips.add(_attiv->get(ATT_TIPOATT));
|
_tips.add(_attiv->get(ATT_TIPOATT));
|
||||||
}
|
}
|
||||||
_ditte->put(NDT_CODDITTA, _lastditta);
|
|
||||||
|
TString16 freq;
|
||||||
|
_ditte->put(NDT_CODDITTA, newditta);
|
||||||
if (_ditte->read() == NOERR)
|
if (_ditte->read() == NOERR)
|
||||||
_freqiva = _ditte->get(NDT_FREQVIVA);
|
freq = _ditte->get(NDT_FREQVIVA);
|
||||||
else
|
m.set(F_FREQ_VERS, freq);
|
||||||
_freqiva = "";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void TParaliq_app::on_config_change()
|
||||||
|
{
|
||||||
|
TConfig d(CONFIG_DITTA);
|
||||||
|
_yearliq = (int)d.get_long("AnLiIv");
|
||||||
|
}
|
||||||
|
|
||||||
bool TParaliq_app::user_create()
|
bool TParaliq_app::user_create()
|
||||||
{
|
{
|
||||||
TConfig d(CONFIG_DITTA);
|
|
||||||
|
|
||||||
_yearliq = (int)d.get_long("AnLiIv");
|
|
||||||
_rel = new TRelation(TAB_LIA);
|
_rel = new TRelation(TAB_LIA);
|
||||||
_pla = new TTable(TAB_PLA);
|
_pla = new TTable(TAB_PLA);
|
||||||
_attiv = new TLocalisamfile(LF_ATTIV);
|
_attiv = new TLocalisamfile(LF_ATTIV);
|
||||||
@ -192,28 +196,26 @@ void TParaliq_app::init_insert_mode(TMask& m)
|
|||||||
{
|
{
|
||||||
TSheet_field& sf = (TSheet_field&)m.field(F_SHEET_PLA);
|
TSheet_field& sf = (TSheet_field&)m.field(F_SHEET_PLA);
|
||||||
TToken_string tt(60);
|
TToken_string tt(60);
|
||||||
|
|
||||||
init_array(m);
|
|
||||||
|
|
||||||
m.set(F_FREQ_VERS, _freqiva);
|
|
||||||
|
|
||||||
|
// Inizializza array delle attivita'
|
||||||
|
init_array(m);
|
||||||
|
|
||||||
|
// Inizializza array delle attivita'
|
||||||
for (int i = 0; i < _atts.items(); i++)
|
for (int i = 0; i < _atts.items(); i++)
|
||||||
{
|
{
|
||||||
TString& att = _atts.row(i);
|
const TString& tips = _tips.row(i);
|
||||||
TString& tips = _tips.row(i);
|
tt = _atts.row(i);
|
||||||
|
|
||||||
// cerca l'attivita' in pla
|
|
||||||
tt = "";
|
|
||||||
tt.add(att);
|
|
||||||
tt.add(tips);
|
tt.add(tips);
|
||||||
tt.add("");
|
tt.add("");
|
||||||
tt.add("");
|
tt.add("");
|
||||||
tt.add("");
|
tt.add("");
|
||||||
tt.add("");
|
tt.add("");
|
||||||
sf.row(-1) = tt;
|
sf.row(i) = tt;
|
||||||
}
|
}
|
||||||
|
sf.force_update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int TParaliq_app::rewrite(const TMask& m)
|
int TParaliq_app::rewrite(const TMask& m)
|
||||||
{
|
{
|
||||||
// scrive %LIA
|
// scrive %LIA
|
||||||
@ -225,28 +227,28 @@ int TParaliq_app::rewrite(const TMask& m)
|
|||||||
const int year = m.get_int(F_YEAR);
|
const int year = m.get_int(F_YEAR);
|
||||||
|
|
||||||
int err = NOERR;
|
int err = NOERR;
|
||||||
bool was = FALSE;
|
bool was = FALSE;
|
||||||
|
|
||||||
for (int i = 0; err == NOERR && i < _atts.items(); i++)
|
for (int i = 0; err == NOERR && i < _atts.items(); i++)
|
||||||
{
|
{
|
||||||
TToken_string& tt = sf.row(i);
|
TToken_string& tt = sf.row(i);
|
||||||
const TString& att = (TString&) _atts[i];
|
const TString& att = _atts.row(i);
|
||||||
const TString16 tips(tt.get(1));
|
const TString16 tips(tt.get(1));
|
||||||
const TString16 codtab(format("%05ld%4d%s1", firm, year, (const char *)att));
|
const TString16 codtab(format("%05ld%4d%s1", firm, year, (const char *)att));
|
||||||
|
|
||||||
_pla->zero();
|
_pla->zero();
|
||||||
_pla->put("CODTAB", codtab);
|
_pla->put("CODTAB", codtab);
|
||||||
was =_pla->read() == NOERR;
|
was =_pla->read() == NOERR;
|
||||||
if (!was) _pla->zero();
|
if (!was) _pla->zero();
|
||||||
|
|
||||||
real prorata = _pla->get_real("R8");
|
real prorata = _pla->get_real("R8");
|
||||||
real es_a8 = _pla->get_real("R5");
|
real es_a8 = _pla->get_real("R5");
|
||||||
real es_a8b = _pla->get_real("R6");
|
real es_a8b = _pla->get_real("R6");
|
||||||
real es_a9 = _pla->get_real("R7");
|
real es_a9 = _pla->get_real("R7");
|
||||||
|
|
||||||
_pla->put("CODTAB", codtab);
|
_pla->put("CODTAB", codtab);
|
||||||
// scrive i campi (vedi a read() per i nomi)
|
// scrive i campi (vedi a read() per i nomi)
|
||||||
// in base alla riga sheet
|
// in base alla riga sheet
|
||||||
_pla->put("S7", tips); // tipo attivita'
|
_pla->put("S7", tips); // tipo attivita'
|
||||||
_pla->put("R8", tt.get()); // prorata
|
_pla->put("R8", tt.get()); // prorata
|
||||||
_pla->put("R5", tt.get()); // plafond art. 8
|
_pla->put("R5", tt.get()); // plafond art. 8
|
||||||
@ -257,25 +259,25 @@ int TParaliq_app::rewrite(const TMask& m)
|
|||||||
|
|
||||||
// se si e' cambiato qualcosa..
|
// se si e' cambiato qualcosa..
|
||||||
if (prorata != _pla->get_real("R8") ||
|
if (prorata != _pla->get_real("R8") ||
|
||||||
es_a8 != _pla->get_real("R5") ||
|
es_a8 != _pla->get_real("R5") ||
|
||||||
es_a8b != _pla->get_real("R6") ||
|
es_a8b != _pla->get_real("R6") ||
|
||||||
es_a9 != _pla->get_real("R7") ||
|
es_a9 != _pla->get_real("R7") ||
|
||||||
m.field(F_CRED_PREC).dirty())
|
m.field(F_CRED_PREC).dirty())
|
||||||
{
|
{
|
||||||
// invalida la prima liquidazione calcolata se ce n'e'
|
// invalida la prima liquidazione calcolata se ce n'e'
|
||||||
TTable lim("LIM");
|
TTable lim("LIM");
|
||||||
|
|
||||||
TRecfield lim_anno(lim.curr(),"CODTAB",0,3);
|
TRecfield lim_anno(lim.curr(),"CODTAB",0,3);
|
||||||
|
|
||||||
for (lim.first(); !lim.eof(); lim.next())
|
for (lim.first(); !lim.eof(); lim.next())
|
||||||
{
|
{
|
||||||
if (year == atoi(lim_anno))
|
if (year == atoi(lim_anno))
|
||||||
{
|
{
|
||||||
lim.put("B0","");
|
lim.put("B0","");
|
||||||
lim.rewrite();
|
lim.rewrite();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -287,18 +289,18 @@ int TParaliq_app::rewrite(const TMask& m)
|
|||||||
if (err == NOERR) err = (was ? lia.rewrite() : lia.write());
|
if (err == NOERR) err = (was ? lia.rewrite() : lia.write());
|
||||||
if (err == NOERR && year == _yearliq)
|
if (err == NOERR && year == _yearliq)
|
||||||
{
|
{
|
||||||
_ditte->put(NDT_CODDITTA, _lastditta);
|
_ditte->put(NDT_CODDITTA, firm);
|
||||||
if (_ditte->read() == NOERR)
|
if (_ditte->read() == NOERR)
|
||||||
{
|
{
|
||||||
_ditte->put(NDT_FREQVIVA, m.get(F_FREQ_VERS));
|
_ditte->put(NDT_FREQVIVA, m.get(F_FREQ_VERS));
|
||||||
_ditte->rewrite();
|
_ditte->rewrite();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// per ogni anno liquidazione controlla (una volta) l'esistenza
|
// per ogni anno liquidazione controlla (una volta) l'esistenza
|
||||||
// dei registri fondamentali
|
// dei registri fondamentali
|
||||||
if (year != oldyear && err == NOERR)
|
if (year != oldyear && err == NOERR)
|
||||||
check_registers(year);
|
check_registers(year);
|
||||||
oldyear = year;
|
oldyear = year;
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
@ -310,31 +312,33 @@ int TParaliq_app::read(TMask& m)
|
|||||||
// prende le attivita' una per una da _atts e
|
// prende le attivita' una per una da _atts e
|
||||||
// crea le righe sheet
|
// crea le righe sheet
|
||||||
m.autoload(get_relation());
|
m.autoload(get_relation());
|
||||||
TSheet_field& sf = (TSheet_field&)m.field(F_SHEET_PLA);
|
|
||||||
TToken_string tt(60);
|
|
||||||
const long firm = m.get_long(F_CODDITTA);
|
const long firm = m.get_long(F_CODDITTA);
|
||||||
const int year = m.get_int(F_YEAR);
|
const int year = m.get_int(F_YEAR);
|
||||||
|
|
||||||
|
TSheet_field& sf = (TSheet_field&)m.field(F_SHEET_PLA);
|
||||||
sf.reset();
|
sf.reset();
|
||||||
|
|
||||||
const TString16 ctab = format("%05ld%d", firm, year);
|
const TString16 ctab = format("%05ld%d", firm, year);
|
||||||
_pla->zero();
|
|
||||||
_pla->put("CODTAB", ctab);
|
_pla->put("CODTAB", ctab);
|
||||||
|
TToken_string tt(60);
|
||||||
|
|
||||||
for (int err = _pla->read(_isgteq); err == NOERR; _pla->next())
|
for (_pla->read(_isgteq); _pla->good(); _pla->next())
|
||||||
{
|
{
|
||||||
if (ctab == _pla->get("CODTAB").left(9))
|
if (strncmp(ctab, _pla->get("CODTAB"), 9) == 0)
|
||||||
{
|
{
|
||||||
tt = "";
|
tt = "";
|
||||||
tt.add(ctab.mid(9,5));
|
tt.add(_pla->get("CODTAB").mid(9,5)); // codice attivita'
|
||||||
tt.add(_pla->get("S7")); // tipo attivita'
|
tt.add(_pla->get("S7")); // tipo attivita'
|
||||||
tt.add(_pla->get("R8")); // prorata
|
tt.add(_pla->get("R8")); // prorata
|
||||||
tt.add(_pla->get("R5")); // plafond art. 8
|
tt.add(_pla->get("R5")); // plafond art. 8
|
||||||
tt.add(_pla->get("R6")); // plafond art. 8bis
|
tt.add(_pla->get("R6")); // plafond art. 8bis
|
||||||
tt.add(_pla->get("R7")); // plafond art. 9
|
tt.add(_pla->get("R7")); // plafond art. 9
|
||||||
|
sf.row(-1) = tt;
|
||||||
}
|
}
|
||||||
else break;
|
else break;
|
||||||
sf.row(-1) = tt;
|
|
||||||
}
|
}
|
||||||
|
sf.force_update();
|
||||||
|
|
||||||
return NOERR;
|
return NOERR;
|
||||||
}
|
}
|
||||||
@ -362,4 +366,4 @@ int cg5300(int argc, char* argv[])
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ BEGIN
|
|||||||
DISPLAY "Codice" CODDITTA
|
DISPLAY "Codice" CODDITTA
|
||||||
COPY OUTPUT F_CODDITTA
|
COPY OUTPUT F_CODDITTA
|
||||||
CHECKTYPE REQUIRED
|
CHECKTYPE REQUIRED
|
||||||
KEY 2
|
KEY 1
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_YEAR 4
|
NUMBER F_YEAR 4
|
||||||
@ -49,7 +49,7 @@ BEGIN
|
|||||||
INPUT CODTAB[1,5] F_CODDITTA
|
INPUT CODTAB[1,5] F_CODDITTA
|
||||||
INPUT CODTAB[6,9] F_YEAR
|
INPUT CODTAB[6,9] F_YEAR
|
||||||
DISPLAY "Codice Ditta" CODTAB[1,5]
|
DISPLAY "Codice Ditta" CODTAB[1,5]
|
||||||
DISPLAY "Anno IVA" CODTAB[6,9]
|
DISPLAY "Anno Liquidazione IVA" CODTAB[6,9]
|
||||||
OUTPUT F_YEAR CODTAB[6,9]
|
OUTPUT F_YEAR CODTAB[6,9]
|
||||||
KEY 1
|
KEY 1
|
||||||
CHECKTYPE REQUIRED
|
CHECKTYPE REQUIRED
|
||||||
|
@ -113,7 +113,7 @@ bool TRipristina_stampa::do_restore(long firm, const char * regist,
|
|||||||
cursor = 0L;
|
cursor = 0L;
|
||||||
const long nitems = cursor.items();
|
const long nitems = cursor.items();
|
||||||
|
|
||||||
TProgind p(nitems ? nitems : 1, format("Ripristino stampa del registro %s", (const char *) regist) , TRUE, TRUE, 70);
|
TProgind p(nitems ? nitems : 1, format("Ripristino stampa del registro %s", (const char*)regist) , TRUE, TRUE, 70);
|
||||||
|
|
||||||
if (giornale)
|
if (giornale)
|
||||||
{
|
{
|
||||||
@ -125,7 +125,7 @@ bool TRipristina_stampa::do_restore(long firm, const char * regist,
|
|||||||
{
|
{
|
||||||
p.addstatus(1);
|
p.addstatus(1);
|
||||||
mov.read(_isequal, _lock);
|
mov.read(_isequal, _lock);
|
||||||
mov.zero(fieldname); // Azzera flag STAMPATO o REGST
|
mov.zero(fieldname); // Azzera flag STAMPATO o REGST
|
||||||
ok = (mov.rewrite() == NOERR);
|
ok = (mov.rewrite() == NOERR);
|
||||||
if (!ok)
|
if (!ok)
|
||||||
error_box("Errore nell'aggiornamento del movimento %ld.\n Errore n. %d",
|
error_box("Errore nell'aggiornamento del movimento %ld.\n Errore n. %d",
|
||||||
@ -137,20 +137,24 @@ bool TRipristina_stampa::do_restore(long firm, const char * regist,
|
|||||||
{
|
{
|
||||||
reg.put("D3", d); // Data ultima stampa
|
reg.put("D3", d); // Data ultima stampa
|
||||||
reg.put("I4", d.month()-1); // Ultimo mese di stampa liquidazione
|
reg.put("I4", d.month()-1); // Ultimo mese di stampa liquidazione
|
||||||
|
if (reg.get_int("I8") >= d.month())
|
||||||
|
reg.zero("I8"); // Mese di ultima stampa credito precedente
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
reg.zero("D3");
|
reg.zero("D3");
|
||||||
reg.zero("I4");
|
reg.zero("I4");
|
||||||
|
reg.zero("I8");
|
||||||
}
|
}
|
||||||
|
|
||||||
ok = (reg.rewrite() == NOERR);
|
ok = (reg.rewrite() == NOERR);
|
||||||
if (!ok)
|
if (!ok)
|
||||||
error_box("Errore nell'aggiornamento del registro %s.\n Errore n. %d",
|
error_box("Errore nell'aggiornamento del registro %s.\n Errore n. %d",
|
||||||
(const char * ) regist, mov.status());
|
(const char*)regist, mov.status());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ok = error_box("Impossibile leggere il registro %s anno %s", (const char *) regist, (const char *) year);
|
ok = error_box("Impossibile leggere il registro %s anno %s",
|
||||||
|
(const char*)regist, (const char*)year);
|
||||||
|
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user