Adeguamento al nuovo modo di notificare i cambiamenti dei parametri
git-svn-id: svn://10.65.10.50/trunk@704 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
f73c265e42
commit
5f3e554116
@ -1,7 +1,7 @@
|
|||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <defmask.h>
|
#include <defmask.h>
|
||||||
#include <relapp.h>
|
|
||||||
#include <msksheet.h>
|
#include <msksheet.h>
|
||||||
|
#include <relapp.h>
|
||||||
#include <sheet.h>
|
#include <sheet.h>
|
||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
#include <validate.h>
|
#include <validate.h>
|
||||||
@ -44,7 +44,7 @@ protected:
|
|||||||
virtual void init_query_mode(TMask& m);
|
virtual void init_query_mode(TMask& m);
|
||||||
virtual void init_query_insert_mode(TMask& m) {init_query_mode(m);}
|
virtual void init_query_insert_mode(TMask& m) {init_query_mode(m);}
|
||||||
virtual void init_insert_mode(TMask& m) {init_query_mode(m);}
|
virtual void init_insert_mode(TMask& m) {init_query_mode(m);}
|
||||||
virtual bool change_config(const char* val, const char* old, const char* nuo);
|
virtual void on_config_change();
|
||||||
|
|
||||||
////////////
|
////////////
|
||||||
static bool indsp_notify(int r, KEY key);
|
static bool indsp_notify(int r, KEY key);
|
||||||
@ -350,29 +350,12 @@ HIDDEN bool codalleg_handler(TMask_field& f, KEY key)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TClifo_application::change_config(const char* val, const char* old, const char* nuo)
|
void TClifo_application::on_config_change()
|
||||||
{
|
{
|
||||||
bool init = FALSE;
|
TConfig cnf(CONFIG_DITTA);
|
||||||
|
_gesven = _ignoreven ? FALSE : cnf.get_bool("GesVen");
|
||||||
const TFixed_string var(val);
|
_lbcn = cnf.get_bool("GsLbCn");
|
||||||
if (var == "GesVen")
|
init_pages(*_msk);
|
||||||
{
|
|
||||||
if (!_ignoreven)
|
|
||||||
{
|
|
||||||
_gesven = *nuo > ' ';
|
|
||||||
init = TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
if (var == "GsLbCn")
|
|
||||||
{
|
|
||||||
_lbcn = *nuo > ' ';
|
|
||||||
init = TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (init) init_pages(*_msk);
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -627,11 +610,6 @@ bool TClifo_application::user_create() // initvar e arrmask
|
|||||||
TConfig config(CONFIG_STUDIO);
|
TConfig config(CONFIG_STUDIO);
|
||||||
_savenew = !config.get_bool("Cg02SN");
|
_savenew = !config.get_bool("Cg02SN");
|
||||||
|
|
||||||
TConfig conf(CONFIG_DITTA, "cg");
|
|
||||||
_lbcn = conf.get_bool("GsLbCn");
|
|
||||||
_gesven = _ignoreven ? FALSE : conf.get_bool("GesVen");
|
|
||||||
init_pages(*_msk);
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
typedef enum { no_descr, acquisto, vendita, incasso_pagamento,
|
typedef enum { no_descr, acquisto, vendita, incasso_pagamento,
|
||||||
ritenuta_occas, incasso_pagamento_gesval } tipo_descr;
|
ritenuta_occas, incasso_pagamento_gesval } tipo_descr;
|
||||||
|
|
||||||
|
|
||||||
class TCaus_app : public TRelation_application
|
class TCaus_app : public TRelation_application
|
||||||
{
|
{
|
||||||
TRelation* _rel; // Relazione principale
|
TRelation* _rel; // Relazione principale
|
||||||
@ -79,15 +78,14 @@ protected:
|
|||||||
virtual bool changing_mask(int mode) {return FALSE; }
|
virtual bool changing_mask(int mode) {return FALSE; }
|
||||||
virtual bool remove();
|
virtual bool remove();
|
||||||
|
|
||||||
void read_firm_params();
|
|
||||||
void init_mask(TMask&);
|
void init_mask(TMask&);
|
||||||
virtual bool change_config(const char* var, const char* old, const char* nuo);
|
virtual void on_config_change();
|
||||||
virtual void init_query_mode(TMask&);
|
virtual void init_query_mode(TMask&);
|
||||||
virtual void init_insert_mode(TMask&);
|
virtual void init_insert_mode(TMask&);
|
||||||
virtual void init_modify_mode(TMask&);
|
virtual void init_modify_mode(TMask&);
|
||||||
virtual int rewrite(const TMask& m);
|
virtual int rewrite(const TMask& m);
|
||||||
virtual int write(const TMask& m);
|
virtual int write(const TMask& m);
|
||||||
int re_write (const TMask& m, bool rewrite=FALSE);
|
int re_write (const TMask& m, bool rewrite);
|
||||||
virtual int read(TMask& m);
|
virtual int read(TMask& m);
|
||||||
// int cancella(long items);
|
// int cancella(long items);
|
||||||
|
|
||||||
@ -307,18 +305,20 @@ bool TCaus_app::tipodoc_hndl (TMask_field& f, KEY k)
|
|||||||
const TipoIVA i = (TipoIVA)tabtpd.get_int("I0"); // IVA acquisti, vendite, generica
|
const TipoIVA i = (TipoIVA)tabtpd.get_int("I0"); // IVA acquisti, vendite, generica
|
||||||
const bool corrisp = tabtpd.get_bool("B0");
|
const bool corrisp = tabtpd.get_bool("B0");
|
||||||
|
|
||||||
if (i == 1) // vendite
|
if (i == 1) // vendite
|
||||||
{
|
{
|
||||||
if (corrisp) { // vendite con corrispettivi
|
if (corrisp) // vendite con corrispettivi
|
||||||
|
{
|
||||||
app()._filtro = 2;
|
app()._filtro = 2;
|
||||||
field_reg.browse()->cursor()->set_filterfunction(filtra_reg);
|
field_reg.browse()->cursor()->set_filterfunction(filtra_reg);
|
||||||
}
|
}
|
||||||
else { // vendite senza corrispettivi
|
else // vendite senza corrispettivi
|
||||||
|
{
|
||||||
app()._filtro = 1;
|
app()._filtro = 1;
|
||||||
field_reg.browse()->cursor()->set_filterfunction(filtra_reg);
|
field_reg.browse()->cursor()->set_filterfunction(filtra_reg);
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
if ( i == 2 ) // acquisti
|
if ( i == 2 ) // acquisti
|
||||||
{
|
{
|
||||||
app()._filtro = 3;
|
app()._filtro = 3;
|
||||||
field_reg.browse()->cursor()->set_filterfunction(filtra_reg);
|
field_reg.browse()->cursor()->set_filterfunction(filtra_reg);
|
||||||
@ -849,6 +849,7 @@ bool TCaus_app::remove()
|
|||||||
void TCaus_app::init_mask(TMask& m)
|
void TCaus_app::init_mask(TMask& m)
|
||||||
{
|
{
|
||||||
m.set(F_ANNOES, _anno_iva);
|
m.set(F_ANNOES, _anno_iva);
|
||||||
|
carica_righe_libere();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TCaus_app::init_query_mode(TMask& m)
|
void TCaus_app::init_query_mode(TMask& m)
|
||||||
@ -870,24 +871,13 @@ void TCaus_app::init_modify_mode(TMask& m)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool TCaus_app::change_config(const char* var, const char* old, const char* nuo)
|
void TCaus_app::on_config_change()
|
||||||
{
|
{
|
||||||
const TFixed_string v(var);
|
|
||||||
|
|
||||||
if (v == "GesSal") _saldaconto = *nuo > ' '; else
|
|
||||||
if (v == "GesVal") _valuta = *nuo > ' '; else
|
|
||||||
if (v == "AnLiIv") _anno_iva = atoi(nuo);
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
void TCaus_app::read_firm_params()
|
|
||||||
{
|
|
||||||
TConfig conf(CONFIG_DITTA);
|
TConfig conf(CONFIG_DITTA);
|
||||||
|
|
||||||
_saldaconto = conf.get_bool("GesSal");
|
_saldaconto = conf.get_bool("GesSal");
|
||||||
_valuta = conf.get_bool("GesVal");
|
_valuta = conf.get_bool("GesVal");
|
||||||
_anno_iva = (int)conf.get_long("AnLiIv", "cg");
|
_anno_iva = (int)conf.get_long("AnLiIv");
|
||||||
if (_anno_iva < 1800)
|
if (_anno_iva < 1800)
|
||||||
{
|
{
|
||||||
_anno_iva = TDate(TODAY).year();
|
_anno_iva = TDate(TODAY).year();
|
||||||
@ -896,6 +886,7 @@ void TCaus_app::read_firm_params()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool TCaus_app::user_create()
|
bool TCaus_app::user_create()
|
||||||
{
|
{
|
||||||
_rel = new TRelation (LF_CAUSALI);
|
_rel = new TRelation (LF_CAUSALI);
|
||||||
@ -904,8 +895,6 @@ bool TCaus_app::user_create()
|
|||||||
_msk = new TMask("cg0500a");
|
_msk = new TMask("cg0500a");
|
||||||
_sheet = &(TSheet_field&)_msk->field(F_SHEET_GCS);
|
_sheet = &(TSheet_field&)_msk->field(F_SHEET_GCS);
|
||||||
|
|
||||||
read_firm_params();
|
|
||||||
|
|
||||||
_msk->show(F_TIPO_MOV_1, saldaconto());
|
_msk->show(F_TIPO_MOV_1, saldaconto());
|
||||||
_msk->show(F_TIPO_MOV_2, saldaconto());
|
_msk->show(F_TIPO_MOV_2, saldaconto());
|
||||||
_msk->show (F_MOV_SEZ, saldaconto());
|
_msk->show (F_MOV_SEZ, saldaconto());
|
||||||
|
@ -137,13 +137,8 @@ bool TPrimanota_application::user_create()
|
|||||||
_rel = new TMovimentoPN;
|
_rel = new TMovimentoPN;
|
||||||
_rel->add(LF_PARTITE, "NREG=NUMREG", 2);
|
_rel->add(LF_PARTITE, "NREG=NUMREG", 2);
|
||||||
|
|
||||||
_rel->lfile().last();
|
|
||||||
_lastreg = _rel->lfile().get_long(MOV_NUMREG); // Init last registration number
|
|
||||||
|
|
||||||
set_search_field(F_NUMREG); // Set field for default search
|
set_search_field(F_NUMREG); // Set field for default search
|
||||||
|
|
||||||
read_firm_params();
|
|
||||||
|
|
||||||
load_mask(0);
|
load_mask(0);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -334,19 +329,17 @@ TMask* TPrimanota_application::get_mask(int mode)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TPrimanota_application::read_firm_params()
|
void TPrimanota_application::on_firm_change()
|
||||||
{
|
{
|
||||||
TConfig c(CONFIG_DITTA, "cg");
|
_rel->lfile().last();
|
||||||
_ges_val = c.get_bool("GesVal");
|
_lastreg = _rel->lfile().get_long(MOV_NUMREG); // Init last registration number
|
||||||
_ges_sal = c.get_bool("GesSal");
|
}
|
||||||
}
|
|
||||||
|
|
||||||
bool TPrimanota_application::change_config(const char* var, const char* old, const char* val)
|
void TPrimanota_application::on_config_change()
|
||||||
{
|
{
|
||||||
const TFixed_string v(var);
|
TConfig cnf(CONFIG_DITTA);
|
||||||
if (v == "GesVal") _ges_val = *val > ' '; else
|
_ges_val = cnf.get_bool("GesVal");
|
||||||
if (v == "GesSal") _ges_sal = *val > ' ';
|
_ges_sal = cnf.get_bool("GesSal");
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -377,14 +370,15 @@ void TPrimanota_application::init_mask(TMask& m)
|
|||||||
m.send_key(K_SHIFT+K_CTRL+forg, -2); // GROUP 2 (fornitori)
|
m.send_key(K_SHIFT+K_CTRL+forg, -2); // GROUP 2 (fornitori)
|
||||||
if (corrisp) m.hide(F_STATOPAIV);
|
if (corrisp) m.hide(F_STATOPAIV);
|
||||||
|
|
||||||
m.show(F_CORRLIRE, valintra);
|
// Show/Hide campi valuta: F_VALUTAINTRA, F_CAMBIOINTRA, F_CORRLIRE, F_CORRVAL (GROUP 4)
|
||||||
m.show(F_CORRVALUTA, valintra);
|
m.show(-4, valintra);
|
||||||
m.show(F_CODIVA, m.mode() == MODE_INS);
|
|
||||||
|
m.show(F_CODIVA, m.mode() == MODE_INS); // Codice IVA standard
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show/Hide campi valuta: F_VALUTA, F_CAMBIO, F_VISVAL (GROUP 3)
|
// Show/Hide campi valuta: F_VALUTA, F_CAMBIO, F_VISVAL (GROUP 3)
|
||||||
const bool valuta = valintra || (_ges_val && _causale.valuta());
|
const bool valuta = _ges_val && _causale.valuta();
|
||||||
m.send_key(K_SHIFT+K_CTRL+(valuta ? 's' : 'h'), -3);
|
m.show(-3, valuta);
|
||||||
if (valuta)
|
if (valuta)
|
||||||
{
|
{
|
||||||
const bool ok = m.get(F_VALUTA).not_empty();
|
const bool ok = m.get(F_VALUTA).not_empty();
|
||||||
@ -407,7 +401,8 @@ void TPrimanota_application::fill_sheet(TMask& m) const
|
|||||||
{
|
{
|
||||||
TSheet_field& ivas = (TSheet_field&)m.field(F_SHEETIVA);
|
TSheet_field& ivas = (TSheet_field&)m.field(F_SHEETIVA);
|
||||||
for (r = ivas.items(); r < 16; r++) ivas.row(r);
|
for (r = ivas.items(); r < 16; r++) ivas.row(r);
|
||||||
ivas.enable_column(4, _iva == iva_acquisti);
|
ivas.enable_column(2, _iva == iva_acquisti); // Tipo detrazione
|
||||||
|
ivas.enable_column(4, _iva == iva_acquisti); // Tipo costo ricavo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -512,7 +512,7 @@ BEGIN
|
|||||||
HELP "Codice della valuta per operazione intracomunitaria"
|
HELP "Codice della valuta per operazione intracomunitaria"
|
||||||
FIELD CODVALI
|
FIELD CODVALI
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
GROUP 3
|
GROUP 4
|
||||||
USE %VAL
|
USE %VAL
|
||||||
INPUT CODTAB F_VALUTAINTRA
|
INPUT CODTAB F_VALUTAINTRA
|
||||||
DISPLAY "Codice" CODTAB
|
DISPLAY "Codice" CODTAB
|
||||||
@ -520,7 +520,7 @@ BEGIN
|
|||||||
DISPLAY "Cambio@15" R10
|
DISPLAY "Cambio@15" R10
|
||||||
DISPLAY "Ultimo aggiornamento" D0
|
DISPLAY "Ultimo aggiornamento" D0
|
||||||
OUTPUT F_VALUTAINTRA CODTAB
|
OUTPUT F_VALUTAINTRA CODTAB
|
||||||
OUTPUT F_CAMBIOINTRA R10
|
// OUTPUT F_CAMBIOINTRA R10
|
||||||
CHECKTYPE NORMAL
|
CHECKTYPE NORMAL
|
||||||
WARNING "Codice valuta assente"
|
WARNING "Codice valuta assente"
|
||||||
END
|
END
|
||||||
@ -531,7 +531,7 @@ BEGIN
|
|||||||
HELP "Cambio della valuta per operazione intracomunitaria"
|
HELP "Cambio della valuta per operazione intracomunitaria"
|
||||||
FIELD CAMBIOI
|
FIELD CAMBIOI
|
||||||
FLAGS "RU"
|
FLAGS "RU"
|
||||||
GROUP 3
|
GROUP 4
|
||||||
PICTURE ".5"
|
PICTURE ".5"
|
||||||
END
|
END
|
||||||
|
|
||||||
@ -542,6 +542,7 @@ BEGIN
|
|||||||
FIELD LF_MOV->CORRLIRE
|
FIELD LF_MOV->CORRLIRE
|
||||||
FLAGS "R"
|
FLAGS "R"
|
||||||
PICTURE "."
|
PICTURE "."
|
||||||
|
GROUP 4
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_CORRVALUTA 15 2
|
NUMBER F_CORRVALUTA 15 2
|
||||||
@ -551,6 +552,7 @@ BEGIN
|
|||||||
FIELD LF_MOV->CORRVALUTA
|
FIELD LF_MOV->CORRVALUTA
|
||||||
FLAGS "R"
|
FLAGS "R"
|
||||||
PICTURE ".2"
|
PICTURE ".2"
|
||||||
|
GROUP 4
|
||||||
END
|
END
|
||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
|
@ -100,22 +100,20 @@ int TMovimentoPN::read_mov_rows()
|
|||||||
int TMovimentoPN::read(TIsamop op, TReclock lockop, TDate& atdate)
|
int TMovimentoPN::read(TIsamop op, TReclock lockop, TDate& atdate)
|
||||||
{
|
{
|
||||||
int err = file().read(op, lockop, atdate);
|
int err = file().read(op, lockop, atdate);
|
||||||
if (err == NOERR) err = read_mov_rows();
|
if (err == NOERR)
|
||||||
|
{
|
||||||
|
_olddate = file().get("DATAREG");
|
||||||
|
err = read_mov_rows();
|
||||||
|
}
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int TMovimentoPN::write_rec(bool re, const TRectype& rec, TLocalisamfile& f)
|
int TMovimentoPN::write_rec(bool re, const TRectype& rec, TLocalisamfile& f)
|
||||||
{
|
{
|
||||||
if (re)
|
const bool scrivi = re ? (f.rewrite(rec) != NOERR) : TRUE;
|
||||||
{
|
if (scrivi)
|
||||||
const bool scrivi = f.rewrite(rec) != NOERR;
|
|
||||||
if (scrivi) f.write(rec);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
f.write(rec);
|
f.write(rec);
|
||||||
}
|
|
||||||
|
|
||||||
return f.status();
|
return f.status();
|
||||||
}
|
}
|
||||||
@ -155,23 +153,30 @@ char TMovimentoPN::frequenza_versamenti(int year) const
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
last_freq = lia.get_char("S7");
|
last_freq = lia.get_char("S7");
|
||||||
CHECK(last_freq == 'M' || last_freq == 'T', "Frequenza versamento IVA assurda");
|
CHECK(last_freq == 'M' || last_freq == 'T', "Frequenza versamenti IVA assurda");
|
||||||
}
|
}
|
||||||
|
|
||||||
return last_freq;
|
return last_freq;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int TMovimentoPN::date2liq(const TDate& data) const
|
||||||
|
{
|
||||||
|
const int anno = data.year();
|
||||||
|
int mese = data.month();
|
||||||
|
if (frequenza_versamenti(anno) == 'T')
|
||||||
|
mese += 2 - ((mese-1) % 3);
|
||||||
|
return mese;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool TMovimentoPN::controlla_liquidazione(const TDate& data, bool reset) const
|
bool TMovimentoPN::controlla_liquidazione(const TDate& data, bool reset) const
|
||||||
{
|
{
|
||||||
bool calcolata = FALSE;
|
bool calcolata = FALSE;
|
||||||
|
|
||||||
const int anno = data.year();
|
const int anno = data.year();
|
||||||
int mese = data.month();
|
const int mese = date2liq(data);
|
||||||
if (frequenza_versamenti(anno) == 'T')
|
|
||||||
mese += 2 - ((mese-1) % 3);
|
|
||||||
|
|
||||||
// Chiave di LIM: Anno (1-4), Mese (5-6)
|
// Chiave di LIM: Anno (1-4), Mese (5-6)
|
||||||
|
|
||||||
TTable lim("LIM");
|
TTable lim("LIM");
|
||||||
TString16 key;
|
TString16 key;
|
||||||
key << anno << mese;
|
key << anno << mese;
|
||||||
@ -246,16 +251,19 @@ int TMovimentoPN::registra(bool re, bool force)
|
|||||||
_oldiva = iva_items();
|
_oldiva = iva_items();
|
||||||
|
|
||||||
// Aggiorna data registrazione e protocollo IVA sul registro
|
// Aggiorna data registrazione e protocollo IVA sul registro
|
||||||
|
const TDate datareg(m.get("DATAREG"));
|
||||||
if (reg.not_empty())
|
if (reg.not_empty())
|
||||||
{
|
{
|
||||||
const long protiva = m.get_long("PROTIVA");
|
const long protiva = m.get_long("PROTIVA");
|
||||||
const long uprotiva = m.get_long("UPROTIVA");
|
const long uprotiva = m.get_long("UPROTIVA");
|
||||||
const TDate datareg = m.get_date("DATAREG");
|
|
||||||
registro.update(max(protiva, uprotiva), datareg);
|
registro.update(max(protiva, uprotiva), datareg);
|
||||||
}
|
}
|
||||||
|
|
||||||
const TDate d(m.get("DATAREG"));
|
// Aggiorna flags di ricalcolo liquidazione
|
||||||
controlla_liquidazione(d, TRUE);
|
|
||||||
|
controlla_liquidazione(datareg, TRUE);
|
||||||
|
if (re && datareg != _olddate)
|
||||||
|
controlla_liquidazione(_olddate, TRUE);
|
||||||
|
|
||||||
const int att = att_mista ? 2 : 1;
|
const int att = att_mista ? 2 : 1;
|
||||||
// Chiave di PLM: Anno (1-4), Cod. Att. (5-9), Tipo att. (10-10), Mese (11-12)
|
// Chiave di PLM: Anno (1-4), Cod. Att. (5-9), Tipo att. (10-10), Mese (11-12)
|
||||||
@ -263,7 +271,7 @@ int TMovimentoPN::registra(bool re, bool force)
|
|||||||
for (int a = 1; a <= att; a++)
|
for (int a = 1; a <= att; a++)
|
||||||
{
|
{
|
||||||
TString16 chiave;
|
TString16 chiave;
|
||||||
chiave << d.year() << registro.attivita() << a << d.month();
|
chiave << annoiva << registro.attivita() << a << date2liq(datareg);
|
||||||
plm.put("CODTAB", chiave);
|
plm.put("CODTAB", chiave);
|
||||||
if (plm.read() == NOERR)
|
if (plm.read() == NOERR)
|
||||||
{
|
{
|
||||||
|
@ -15,7 +15,7 @@ class TMovimentoPN : public TRelation
|
|||||||
// @DPRIV
|
// @DPRIV
|
||||||
TArray _cg, _iva;
|
TArray _cg, _iva;
|
||||||
int _oldcg, _oldiva;
|
int _oldcg, _oldiva;
|
||||||
real _balance;
|
TDate _olddate;
|
||||||
// @END
|
// @END
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -44,6 +44,7 @@ public:
|
|||||||
int iva_items() const { return _iva.items(); }
|
int iva_items() const { return _iva.items(); }
|
||||||
void destroy_rows();
|
void destroy_rows();
|
||||||
|
|
||||||
|
int date2liq(const TDate& data) const; // Estrae dalla data il mese di liquidazione
|
||||||
char frequenza_versamenti(int year) const; // Ritorna 'M'ensile o 'T'rimestrale
|
char frequenza_versamenti(int year) const; // Ritorna 'M'ensile o 'T'rimestrale
|
||||||
bool controlla_liquidazione(const TDate& data, bool reset = FALSE) const;
|
bool controlla_liquidazione(const TDate& data, bool reset = FALSE) const;
|
||||||
|
|
||||||
|
@ -747,7 +747,7 @@ bool TPrimanota_application::imposta_handler(TMask_field& f, KEY key)
|
|||||||
if (key == K_ENTER)
|
if (key == K_ENTER)
|
||||||
{
|
{
|
||||||
const real imponibile(f.mask().get(101));
|
const real imponibile(f.mask().get(101));
|
||||||
const real& percent = cod2IVA(f.mask());
|
const real& percent = app().causale().corrispettivi() ? ZERO : cod2IVA(f.mask());
|
||||||
real imposta = abs(imponibile) * percent / 100.0;
|
real imposta = abs(imponibile) * percent / 100.0;
|
||||||
imposta.ceil();
|
imposta.ceil();
|
||||||
if (imponibile.sign() < 0) imposta = -imposta;
|
if (imponibile.sign() < 0) imposta = -imposta;
|
||||||
@ -755,13 +755,8 @@ bool TPrimanota_application::imposta_handler(TMask_field& f, KEY key)
|
|||||||
const real val(f.get());
|
const real val(f.get());
|
||||||
if (val != imposta)
|
if (val != imposta)
|
||||||
{
|
{
|
||||||
if (val != 0.0 || !app().causale().corrispettivi())
|
f.warning_box("L'imposta dovrebbe essere %s", (const char*)imposta.string("."));
|
||||||
{
|
if (val.is_zero()) f.set(imposta.string());
|
||||||
const TString16 wrong(val.string("."));
|
|
||||||
const TString16 right(imposta.string("."));
|
|
||||||
f.warning_box("Imposta di '%s' errata: dovrebbe essere '%s'",
|
|
||||||
(const char*)wrong, (const char*)right);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
if (key == K_F8)
|
if (key == K_F8)
|
||||||
@ -993,7 +988,7 @@ bool TPrimanota_application::iva_handler(TMask_field& f, KEY k)
|
|||||||
|
|
||||||
bool TPrimanota_application::cg_conto_handler(TMask_field& f, KEY key)
|
bool TPrimanota_application::cg_conto_handler(TMask_field& f, KEY key)
|
||||||
{
|
{
|
||||||
if (key == K_TAB || key == K_ENTER)
|
if (key == K_ENTER)
|
||||||
{
|
{
|
||||||
TMask& m = f.mask();
|
TMask& m = f.mask();
|
||||||
if (m.get(115)[0] == 'T') // Se riga totale documento
|
if (m.get(115)[0] == 'T') // Se riga totale documento
|
||||||
@ -1604,7 +1599,7 @@ bool TPrimanota_application::corrlire_handler(TMask_field& f, KEY key)
|
|||||||
if (m.get(F_CORRVALUTA).not_empty())
|
if (m.get(F_CORRVALUTA).not_empty())
|
||||||
m.field(F_CORRVALUTA).on_hit();
|
m.field(F_CORRVALUTA).on_hit();
|
||||||
else
|
else
|
||||||
key == K_F8;
|
key = K_F8;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (key == K_F8)
|
if (key == K_F8)
|
||||||
|
@ -93,7 +93,8 @@ protected:
|
|||||||
virtual bool user_create();
|
virtual bool user_create();
|
||||||
virtual bool user_destroy();
|
virtual bool user_destroy();
|
||||||
virtual void print();
|
virtual void print();
|
||||||
virtual bool change_config(const char* var, const char* old, const char* val);
|
virtual void on_firm_change();
|
||||||
|
virtual void on_config_change();
|
||||||
virtual bool changing_mask(int mode);
|
virtual bool changing_mask(int mode);
|
||||||
virtual TMask* get_mask(int mode);
|
virtual TMask* get_mask(int mode);
|
||||||
virtual TRelation* get_relation() const { return _rel; }
|
virtual TRelation* get_relation() const { return _rel; }
|
||||||
@ -125,7 +126,6 @@ protected:
|
|||||||
|
|
||||||
void fill_sheet(TMask& m) const;
|
void fill_sheet(TMask& m) const;
|
||||||
|
|
||||||
void read_firm_params();
|
|
||||||
void init_mask(TMask& m);
|
void init_mask(TMask& m);
|
||||||
|
|
||||||
TSheet_field& cgs() const;
|
TSheet_field& cgs() const;
|
||||||
|
@ -249,25 +249,6 @@ bool TLibro_giornale::read(int y)
|
|||||||
return found;
|
return found;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now obsolete
|
|
||||||
TDate TLibro_giornale::global_last_print() const
|
|
||||||
{
|
|
||||||
TTable reg("REG");
|
|
||||||
reg.setkey(1);
|
|
||||||
|
|
||||||
TDate last(botime);
|
|
||||||
for (int err = reg.first(); err == NOERR; err = reg.next())
|
|
||||||
{
|
|
||||||
if (reg.get_int("I0") == libro_giornale)
|
|
||||||
{
|
|
||||||
const TDate l(reg.get("D3"));
|
|
||||||
if (l > last) last = l;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return last;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
TLibro_giornale::TLibro_giornale(int y)
|
TLibro_giornale::TLibro_giornale(int y)
|
||||||
{
|
{
|
||||||
read(y);
|
read(y);
|
||||||
|
@ -14,7 +14,8 @@ enum TipoIVA
|
|||||||
iva_errata = -1,
|
iva_errata = -1,
|
||||||
nessuna_iva = 0,
|
nessuna_iva = 0,
|
||||||
iva_vendite = 1,
|
iva_vendite = 1,
|
||||||
iva_acquisti = 2,
|
iva_acquisti = 2,
|
||||||
|
libro_giornale = 5,
|
||||||
iva_generica = 9
|
iva_generica = 9
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -25,7 +26,6 @@ class TRegistro : public TObject
|
|||||||
bool read_att();
|
bool read_att();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
enum TipoRegistro { libro_giornale = 5 };
|
|
||||||
TRectype _rec, _att;
|
TRectype _rec, _att;
|
||||||
real _prorata;
|
real _prorata;
|
||||||
|
|
||||||
@ -49,7 +49,7 @@ public:
|
|||||||
|
|
||||||
bool agenzia_viaggi();
|
bool agenzia_viaggi();
|
||||||
const TString& tipo_attivita();
|
const TString& tipo_attivita();
|
||||||
bool attivita_mista() { const char a = tipo_attivita()[0]; return a == 'M' || a == 'E'; }
|
bool attivita_mista() { const char a = tipo_attivita()[0]; return a == 'E'; }
|
||||||
const real& prorata();
|
const real& prorata();
|
||||||
bool update(long uprotiva, const TDate& lastreg);
|
bool update(long uprotiva, const TDate& lastreg);
|
||||||
|
|
||||||
|
@ -83,7 +83,6 @@ BEGIN
|
|||||||
OUTPUT 104 GRUPPO
|
OUTPUT 104 GRUPPO
|
||||||
OUTPUT 105 CONTO
|
OUTPUT 105 CONTO
|
||||||
OUTPUT 107 DESCR
|
OUTPUT 107 DESCR
|
||||||
ADD RUN CG0 -0
|
|
||||||
CHECKTYPE NORMAL
|
CHECKTYPE NORMAL
|
||||||
MESSAGE DIRTY,106|DIRTY,206|DIRTY,306
|
MESSAGE DIRTY,106|DIRTY,206|DIRTY,306
|
||||||
WARNING "Conto inesistente o mancante sulla riga contabile"
|
WARNING "Conto inesistente o mancante sulla riga contabile"
|
||||||
|
@ -85,7 +85,7 @@ END
|
|||||||
SPREADSHEET F_SHEET_PLA 78 6
|
SPREADSHEET F_SHEET_PLA 78 6
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 10 "Parametri attivita'"
|
PROMPT 1 10 "Parametri attivita'"
|
||||||
ITEM "Attivita'@5"
|
ITEM "Attivita'@5F"
|
||||||
ITEM "Tipo@1"
|
ITEM "Tipo@1"
|
||||||
ITEM "% Pro-rata@6"
|
ITEM "% Pro-rata@6"
|
||||||
ITEM "Plafond art.8@15"
|
ITEM "Plafond art.8@15"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user