Un insieme di modifiche al saldaconto della prima nota, piu' una neceesaria
depurazione di pagament.cpp onde evitare conflitti con Guido git-svn-id: svn://10.65.10.50/trunk@1732 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
4f99dae39a
commit
79ff0b8518
@ -66,6 +66,7 @@ TMask* TPrimanota_application::load_mask(int n)
|
|||||||
{
|
{
|
||||||
m->set_handler(F_DATADOC, doc_handler);
|
m->set_handler(F_DATADOC, doc_handler);
|
||||||
m->set_handler(F_NUMDOC, doc_handler);
|
m->set_handler(F_NUMDOC, doc_handler);
|
||||||
|
m->set_handler(F_NUMRIF, numrif_handler);
|
||||||
m->set_handler(F_DATA74TER, data74ter_handler);
|
m->set_handler(F_DATA74TER, data74ter_handler);
|
||||||
m->set_handler(F_PROTIVA, protiva_handler);
|
m->set_handler(F_PROTIVA, protiva_handler);
|
||||||
m->set_handler(F_CLIENTE, clifo_handler);
|
m->set_handler(F_CLIENTE, clifo_handler);
|
||||||
@ -95,7 +96,7 @@ TMask* TPrimanota_application::load_mask(int n)
|
|||||||
// add saldaconto
|
// add saldaconto
|
||||||
TSheet_field& ps = (TSheet_field&)m->field(FS_RATESHEET);
|
TSheet_field& ps = (TSheet_field&)m->field(FS_RATESHEET);
|
||||||
ps.set_notify(pag_notify);
|
ps.set_notify(pag_notify);
|
||||||
|
m->set_handler(FS_RESET, reset_handler);
|
||||||
}
|
}
|
||||||
_iva_showed = FALSE;
|
_iva_showed = FALSE;
|
||||||
case 1:
|
case 1:
|
||||||
@ -167,7 +168,7 @@ bool TPrimanota_application::user_create()
|
|||||||
|
|
||||||
_pag = NULL;
|
_pag = NULL;
|
||||||
_pag_rows = NULL;
|
_pag_rows = NULL;
|
||||||
_is_saldaconto = FALSE;
|
_is_saldaconto = FALSE;
|
||||||
|
|
||||||
load_mask(0);
|
load_mask(0);
|
||||||
|
|
||||||
@ -415,10 +416,11 @@ void TPrimanota_application::on_firm_change()
|
|||||||
void TPrimanota_application::on_config_change()
|
void TPrimanota_application::on_config_change()
|
||||||
{
|
{
|
||||||
TConfig cnf(CONFIG_DITTA);
|
TConfig cnf(CONFIG_DITTA);
|
||||||
_ges_val = cnf.get_bool("GesVal");
|
_ges_val = cnf.get_bool("GesVal");
|
||||||
_ges_sal = cnf.get_bool("GesSal");
|
_ges_sal = cnf.get_bool("GesSal");
|
||||||
_num_cli = cnf.get_bool("NrCliDx");
|
_num_cli = cnf.get_bool("NrCliDx");
|
||||||
_num_for = cnf.get_bool("NrForDx");
|
_num_for = cnf.get_bool("NrForDx");
|
||||||
|
_npart_is_prot = cnf.get_bool("RifPro");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -509,8 +509,8 @@ STRING F_NUMRIF 7
|
|||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 68 15 "/ "
|
PROMPT 68 15 "/ "
|
||||||
FIELD LF_PARTITE->NUMPART
|
FIELD LF_PARTITE->NUMPART
|
||||||
FLAGS "D"
|
FLAGS "U"
|
||||||
HELP "Numero documento di riferimento"
|
HELP "Numero di riferimento partita (documento o protocollo)"
|
||||||
WARNING "E' richiesto il numero di riferimento partita"
|
WARNING "E' richiesto il numero di riferimento partita"
|
||||||
CHECKTYPE REQUIRED
|
CHECKTYPE REQUIRED
|
||||||
END
|
END
|
||||||
|
@ -1514,7 +1514,7 @@ bool TPrimanota_application::doc_handler(TMask_field& f, KEY key)
|
|||||||
if (key == K_TAB)
|
if (key == K_TAB)
|
||||||
{
|
{
|
||||||
TMask& m = f.mask();
|
TMask& m = f.mask();
|
||||||
const TString& val = f.get();
|
const TString16 val(f.get());
|
||||||
|
|
||||||
if (!val.empty() && m.field(F_ANNORIF).active())
|
if (!val.empty() && m.field(F_ANNORIF).active())
|
||||||
{ // Se c'e' gestione saldaconto
|
{ // Se c'e' gestione saldaconto
|
||||||
@ -1523,9 +1523,13 @@ bool TPrimanota_application::doc_handler(TMask_field& f, KEY key)
|
|||||||
const TDate dd(val);
|
const TDate dd(val);
|
||||||
m.set(F_ANNORIF, dd.year()); // copia data documento
|
m.set(F_ANNORIF, dd.year()); // copia data documento
|
||||||
}
|
}
|
||||||
else
|
else if (!app().npart_is_prot())
|
||||||
{
|
{
|
||||||
m.set(F_NUMRIF, val); // copia numero documento
|
if (m.get(F_NUMRIF).empty())
|
||||||
|
{
|
||||||
|
m.set(F_NUMRIF, val); // copia numero documento
|
||||||
|
app().set_numrif(val);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1533,6 +1537,52 @@ bool TPrimanota_application::doc_handler(TMask_field& f, KEY key)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool TPrimanota_application::numrif_handler(TMask_field& f, KEY key)
|
||||||
|
{
|
||||||
|
if (key == K_TAB)
|
||||||
|
{
|
||||||
|
TMask& m = f.mask();
|
||||||
|
const TString& val = f.get();
|
||||||
|
|
||||||
|
if (f.focusdirty())
|
||||||
|
{
|
||||||
|
// se cambiato chiedo conferma:
|
||||||
|
// se svuotato, azzero il cazzoconto
|
||||||
|
if (val.empty())
|
||||||
|
{
|
||||||
|
if (yesno_box("Si desidera l'azzeramento delle scadenze?"))
|
||||||
|
{
|
||||||
|
// sbraga giu' il saldaconto: andra' tutto kancellato
|
||||||
|
// se c'era
|
||||||
|
app().remove_scadenze(f.mask(), app().get_numrif());
|
||||||
|
f.mask().disable_page(2);
|
||||||
|
}
|
||||||
|
else f.set(app().get_numrif());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (yesno_box("Si desidera la ridefinizione delle scadenze?"))
|
||||||
|
{
|
||||||
|
// lo ridefinisco da capo
|
||||||
|
// con il nuovo porcodio, riabilitando se
|
||||||
|
// non c'era
|
||||||
|
app().remove_scadenze(f.mask(), app().get_numrif());
|
||||||
|
|
||||||
|
app().reset_pagamento();
|
||||||
|
app().set_scadenze(m);
|
||||||
|
f.mask().enable_page(2);
|
||||||
|
|
||||||
|
}
|
||||||
|
else f.set(app().get_numrif());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
app().set_numrif(f.get());
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool TPrimanota_application::occas_code_handler(TMask_field& f, KEY key)
|
bool TPrimanota_application::occas_code_handler(TMask_field& f, KEY key)
|
||||||
{
|
{
|
||||||
if (key == K_TAB)
|
if (key == K_TAB)
|
||||||
@ -1805,13 +1855,23 @@ void TPrimanota_application::add_cgs_rit(bool fiscali)
|
|||||||
bool TPrimanota_application::protiva_handler(TMask_field& f, KEY key)
|
bool TPrimanota_application::protiva_handler(TMask_field& f, KEY key)
|
||||||
{
|
{
|
||||||
bool ok = TRUE;
|
bool ok = TRUE;
|
||||||
|
const TString16 piva(f.get());
|
||||||
if (key == K_ENTER && f.dirty() && f.mask().mode() == MODE_INS)
|
if (key == K_ENTER && f.dirty() && f.mask().mode() == MODE_INS)
|
||||||
{
|
{
|
||||||
const long protiva = atol(f.get());
|
const long protiva = atol(f.get());
|
||||||
const long protocol = app().causale().reg().protocol() + 1;
|
const long protocol = app().causale().reg().protocol() + 1;
|
||||||
if (protiva != protocol)
|
if (protiva != protocol)
|
||||||
ok = f.yesno_box("Accettare il protocollo IVA fuori sequenza: %ld invece di %ld",
|
ok = f.yesno_box("Accettare il protocollo IVA fuori sequenza: %ld invece di %ld",
|
||||||
protiva, protocol);
|
protiva, protocol);
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (key == K_TAB && app().is_saldaconto() && f.mask().get(F_NUMRIF).empty())
|
||||||
|
{
|
||||||
|
if (app().npart_is_prot())
|
||||||
|
{
|
||||||
|
f.mask().set(F_NUMRIF, piva);
|
||||||
|
app().set_numrif(piva);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
11
cg/cg2102.h
11
cg/cg2102.h
@ -45,6 +45,7 @@ class TPrimanota_application : public TRelation_application
|
|||||||
TipoIVA _iva; // Tipo di IVA corrente
|
TipoIVA _iva; // Tipo di IVA corrente
|
||||||
bool _ges_val, _ges_sal; // Gestione valuta e saldaconto
|
bool _ges_val, _ges_sal; // Gestione valuta e saldaconto
|
||||||
bool _num_cli, _num_for; // Riferimento partita allineato a destra
|
bool _num_cli, _num_for; // Riferimento partita allineato a destra
|
||||||
|
bool _npart_is_prot; // Riferimento partita = n. prot. IVA anziche' doc
|
||||||
|
|
||||||
bool _skip_giornale_check; // Ignora controllo data stampa libro giornale
|
bool _skip_giornale_check; // Ignora controllo data stampa libro giornale
|
||||||
bool _skip_bollato_check; // Ignora controllo data stampa bollato
|
bool _skip_bollato_check; // Ignora controllo data stampa bollato
|
||||||
@ -65,6 +66,7 @@ class TPrimanota_application : public TRelation_application
|
|||||||
|
|
||||||
TBill _conto_ricavo; // Conto di ricavo del clifo
|
TBill _conto_ricavo; // Conto di ricavo del clifo
|
||||||
TString_array _pag_rows;
|
TString_array _pag_rows;
|
||||||
|
TString16 _numrif; // memorizza numrif per undo
|
||||||
|
|
||||||
static bool showpartite_handler(TMask_field& f, KEY k);
|
static bool showpartite_handler(TMask_field& f, KEY k);
|
||||||
static bool speserimb_handler(TMask_field& f, KEY k);
|
static bool speserimb_handler(TMask_field& f, KEY k);
|
||||||
@ -81,6 +83,7 @@ class TPrimanota_application : public TRelation_application
|
|||||||
static bool datacomp_handler(TMask_field& f, KEY key);
|
static bool datacomp_handler(TMask_field& f, KEY key);
|
||||||
static bool data74ter_handler(TMask_field& f, KEY key);
|
static bool data74ter_handler(TMask_field& f, KEY key);
|
||||||
static bool doc_handler(TMask_field& f, KEY key);
|
static bool doc_handler(TMask_field& f, KEY key);
|
||||||
|
static bool numrif_handler(TMask_field& f, KEY key);
|
||||||
static bool protiva_handler(TMask_field& f, KEY key);
|
static bool protiva_handler(TMask_field& f, KEY key);
|
||||||
static bool clifo_handler(TMask_field& f, KEY key);
|
static bool clifo_handler(TMask_field& f, KEY key);
|
||||||
static bool totale_handler(TMask_field& f, KEY key);
|
static bool totale_handler(TMask_field& f, KEY key);
|
||||||
@ -104,6 +107,7 @@ class TPrimanota_application : public TRelation_application
|
|||||||
static bool dareavere_handler(TMask_field& f, KEY k);
|
static bool dareavere_handler(TMask_field& f, KEY k);
|
||||||
static bool cg_conto_handler(TMask_field& f, KEY key);
|
static bool cg_conto_handler(TMask_field& f, KEY key);
|
||||||
static bool codpag_handler(TMask_field& f, KEY key);
|
static bool codpag_handler(TMask_field& f, KEY key);
|
||||||
|
static bool reset_handler(TMask_field& f, KEY key);
|
||||||
|
|
||||||
static bool iva_notify(TSheet_field& s, int r, KEY key);
|
static bool iva_notify(TSheet_field& s, int r, KEY key);
|
||||||
static bool iva_handler(TMask_field& f, KEY key);
|
static bool iva_handler(TMask_field& f, KEY key);
|
||||||
@ -112,7 +116,10 @@ class TPrimanota_application : public TRelation_application
|
|||||||
static bool pag_notify(TSheet_field& s, int r, KEY key);
|
static bool pag_notify(TSheet_field& s, int r, KEY key);
|
||||||
|
|
||||||
void reset_sheet_row(TSheet_field& s, int n);
|
void reset_sheet_row(TSheet_field& s, int n);
|
||||||
|
|
||||||
|
void set_numrif(const char* s) { _numrif = s; }
|
||||||
|
const char* get_numrif() { return _numrif; }
|
||||||
|
|
||||||
protected: // TApplication
|
protected: // TApplication
|
||||||
virtual void on_firm_change();
|
virtual void on_firm_change();
|
||||||
virtual void on_config_change();
|
virtual void on_config_change();
|
||||||
@ -150,6 +157,7 @@ protected:
|
|||||||
bool gestione_saldaconto() const { return _ges_sal; }
|
bool gestione_saldaconto() const { return _ges_sal; }
|
||||||
bool is_saldaconto() const { return _is_saldaconto; }
|
bool is_saldaconto() const { return _is_saldaconto; }
|
||||||
void set_saldaconto(bool b) { _is_saldaconto = b; }
|
void set_saldaconto(bool b) { _is_saldaconto = b; }
|
||||||
|
bool npart_is_prot() { return _npart_is_prot; }
|
||||||
|
|
||||||
void fill_sheet(TMask& m) const;
|
void fill_sheet(TMask& m) const;
|
||||||
void init_mask(TMask& m);
|
void init_mask(TMask& m);
|
||||||
@ -202,6 +210,7 @@ protected:
|
|||||||
void set_scadenze(TMask& m);
|
void set_scadenze(TMask& m);
|
||||||
bool read_scadenze(TMask& m);
|
bool read_scadenze(TMask& m);
|
||||||
void write_scadenze(const TMask& m);
|
void write_scadenze(const TMask& m);
|
||||||
|
void remove_scadenze(const TMask& m, const char* rif);
|
||||||
|
|
||||||
bool edit_partite(int riga);
|
bool edit_partite(int riga);
|
||||||
|
|
||||||
|
@ -44,8 +44,8 @@ bool TPrimanota_application::pag_notify(TSheet_field&, int r, KEY k)
|
|||||||
ts = rws.row(r);
|
ts = rws.row(r);
|
||||||
|
|
||||||
news = ns.get(0);
|
news = ns.get(0);
|
||||||
newp = ns.get(1);
|
newp = ns.get(2);
|
||||||
newi = ns.get(2);
|
newi = ns.get(1);
|
||||||
newt = ns.get(3);
|
newt = ns.get(3);
|
||||||
|
|
||||||
// qui viene il bello, si fa per dire
|
// qui viene il bello, si fa per dire
|
||||||
@ -53,11 +53,11 @@ bool TPrimanota_application::pag_notify(TSheet_field&, int r, KEY k)
|
|||||||
{
|
{
|
||||||
mod = m_scad = TRUE;
|
mod = m_scad = TRUE;
|
||||||
}
|
}
|
||||||
if (newp != ts.get(1)) // modificata percentuale
|
if (newp != ts.get(2)) // modificata percentuale
|
||||||
{
|
{
|
||||||
mod = m_perc = TRUE;
|
mod = m_perc = TRUE;
|
||||||
}
|
}
|
||||||
if (newi != ts.get(2)) // modificato importo
|
if (newi != ts.get(1)) // modificato importo
|
||||||
{
|
{
|
||||||
// se si modifica la percentuale l'importo non viene cagato
|
// se si modifica la percentuale l'importo non viene cagato
|
||||||
if ((recalc && !m_perc) || (!recalc))
|
if ((recalc && !m_perc) || (!recalc))
|
||||||
@ -152,6 +152,29 @@ bool TPrimanota_application::codpag_handler(TMask_field& f, KEY key)
|
|||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool TPrimanota_application::reset_handler(TMask_field& f, KEY key)
|
||||||
|
{
|
||||||
|
TMask& m = f.mask();
|
||||||
|
|
||||||
|
if (key == K_SPACE && m.is_running() && app().is_saldaconto())
|
||||||
|
{
|
||||||
|
app().reset_pagamento();
|
||||||
|
app().set_scadenze(m);
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void TPrimanota_application::reset_pagamento()
|
||||||
|
{
|
||||||
|
if (_pag != NULL)
|
||||||
|
{
|
||||||
|
_pag->read();
|
||||||
|
_pag->set_rate_auto();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void TPrimanota_application::set_pagamento(const char* c, const char* d)
|
void TPrimanota_application::set_pagamento(const char* c, const char* d)
|
||||||
{
|
{
|
||||||
@ -254,7 +277,7 @@ bool TPrimanota_application::read_scadenze(TMask& m)
|
|||||||
if (pag.code() != partita.get("CODPAG"))
|
if (pag.code() != partita.get("CODPAG"))
|
||||||
fromscratch = TRUE;
|
fromscratch = TRUE;
|
||||||
// se invece la maschera contiene importi diversi da quelli
|
// se invece la maschera contiene importi diversi da quelli
|
||||||
// registrati si passa la palla al culano
|
// registrati si passa la palla al culano/a
|
||||||
else if (imponibile != partita.get_real(PART_IMPORTO) ||
|
else if (imponibile != partita.get_real(PART_IMPORTO) ||
|
||||||
imposta != partita.get_real(PART_IMPOSTA) ||
|
imposta != partita.get_real(PART_IMPOSTA) ||
|
||||||
spese != partita.get_real(PART_SPESE))
|
spese != partita.get_real(PART_SPESE))
|
||||||
@ -262,7 +285,7 @@ bool TPrimanota_application::read_scadenze(TMask& m)
|
|||||||
fromscratch = !yesno_box("Gli importi totali delle scadenze sono stati modificati rispetto"
|
fromscratch = !yesno_box("Gli importi totali delle scadenze sono stati modificati rispetto"
|
||||||
" all'ultima registrazione. Si desidera mantenere"
|
" all'ultima registrazione. Si desidera mantenere"
|
||||||
" comunque la rateazione precedente");
|
" comunque la rateazione precedente");
|
||||||
// nel caso, of course, si disabilitano gli automatismi
|
// nel qual caso, of course, si disabilitano gli automatismi
|
||||||
if(!fromscratch) m.field(FS_RECALC).set("");
|
if(!fromscratch) m.field(FS_RECALC).set("");
|
||||||
}
|
}
|
||||||
if (fromscratch)
|
if (fromscratch)
|
||||||
@ -305,12 +328,23 @@ bool TPrimanota_application::read_scadenze(TMask& m)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TPrimanota_application::remove_scadenze(const TMask& m, const char* nr)
|
||||||
|
{
|
||||||
|
// TBI se _erase_sld == TRUE occorre cancellare tutte le scadenze
|
||||||
|
// eventualmente presenti; attenzione a riferimenti cambiati
|
||||||
|
TString numrif(nr);
|
||||||
|
if (numrif.empty()) return;
|
||||||
|
|
||||||
|
// rimuovi se ci sono
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void TPrimanota_application::write_scadenze(const TMask& m)
|
void TPrimanota_application::write_scadenze(const TMask& m)
|
||||||
{
|
{
|
||||||
real imponibile(0.0);
|
real imponibile(0.0);
|
||||||
real imposta(0.0);
|
real imposta(0.0);
|
||||||
real spese(0.0);
|
real spese(0.0);
|
||||||
|
|
||||||
// should never happen but it doesn't hurt
|
// should never happen but it doesn't hurt
|
||||||
CHECK(!_rel->cg(0).empty(), "Missing first line");
|
CHECK(!_rel->cg(0).empty(), "Missing first line");
|
||||||
|
|
||||||
@ -340,6 +374,8 @@ void TPrimanota_application::write_scadenze(const TMask& m)
|
|||||||
int gruppo = (tipocf == 'C' || tipocf == 'F') ? 0 : _rel->cg(0).get_char("GRUPPO");
|
int gruppo = (tipocf == 'C' || tipocf == 'F') ? 0 : _rel->cg(0).get_char("GRUPPO");
|
||||||
int conto = (tipocf == 'C' || tipocf == 'F') ? 0 : _rel->cg(0).get_char("CONTO");
|
int conto = (tipocf == 'C' || tipocf == 'F') ? 0 : _rel->cg(0).get_char("CONTO");
|
||||||
long sottoconto = _rel->cg(0).get_long("SOTTOCONTO");
|
long sottoconto = _rel->cg(0).get_long("SOTTOCONTO");
|
||||||
|
|
||||||
|
// TBI deve essere riga iniziale scadenze (puo' essere != 1 sul file)
|
||||||
const int nriga = 1;
|
const int nriga = 1;
|
||||||
int numrig = 1;
|
int numrig = 1;
|
||||||
|
|
||||||
@ -406,7 +442,9 @@ void TPrimanota_application::write_scadenze(const TMask& m)
|
|||||||
scadenza.put(SCAD_SOTTOCONTO, sottoconto);
|
scadenza.put(SCAD_SOTTOCONTO, sottoconto);
|
||||||
scadenza.put(SCAD_ANNO, anno);
|
scadenza.put(SCAD_ANNO, anno);
|
||||||
scadenza.put(SCAD_NUMPART, numpart);
|
scadenza.put(SCAD_NUMPART, numpart);
|
||||||
scadenza.put(SCAD_NRIGA, nriga);
|
scadenza.put(SCAD_NRIGA, nriga);
|
||||||
|
// TBI NO! Va visto se ce ne sono altre, con gestione riga
|
||||||
|
// iniziale nella partita
|
||||||
scadenza.put(SCAD_NRATA, i+1);
|
scadenza.put(SCAD_NRATA, i+1);
|
||||||
|
|
||||||
if (scadenza.read() != NOERR)
|
if (scadenza.read() != NOERR)
|
||||||
|
@ -73,8 +73,8 @@ SPREADSHEET F_RATESHEET 80 8
|
|||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 10 "Rate"
|
PROMPT 1 10 "Rate"
|
||||||
ITEM "Scadenza@10"
|
ITEM "Scadenza@10"
|
||||||
ITEM "Percentuale@12"
|
|
||||||
ITEM "Importo@15"
|
ITEM "Importo@15"
|
||||||
|
ITEM "Percentuale@12"
|
||||||
ITEM "Tipo"
|
ITEM "Tipo"
|
||||||
ITEM "Pagamento@32"
|
ITEM "Pagamento@32"
|
||||||
END
|
END
|
||||||
@ -89,14 +89,14 @@ BEGIN
|
|||||||
PROMPT 1 2 "Scadenza "
|
PROMPT 1 2 "Scadenza "
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER 102 3 0
|
NUMBER 102 15 0
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 3 "Percentuale "
|
PROMPT 1 3 "Importo "
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER 103 15 0
|
NUMBER 103 3 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 4 "Importo "
|
PROMPT 1 4 "Percentuale "
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER 104 2 0
|
NUMBER 104 2 0
|
||||||
|
@ -5,20 +5,20 @@ BEGIN
|
|||||||
PROMPT 1 1 "Scadenza "
|
PROMPT 1 1 "Scadenza "
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER 102 8 3
|
NUMBER 102 15
|
||||||
BEGIN
|
|
||||||
PROMPT 1 2 "Percentuale "
|
|
||||||
PICTURE ".3"
|
|
||||||
FLAGS "R"
|
|
||||||
END
|
|
||||||
|
|
||||||
NUMBER 103 15
|
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 3 "Importo "
|
PROMPT 1 3 "Importo "
|
||||||
PICTURE "."
|
PICTURE "."
|
||||||
FLAGS "R"
|
FLAGS "R"
|
||||||
END
|
END
|
||||||
|
|
||||||
|
NUMBER 103 8 3
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 2 "Percentuale "
|
||||||
|
PICTURE ".3"
|
||||||
|
FLAGS "R"
|
||||||
|
END
|
||||||
|
|
||||||
NUMBER 104 2 0
|
NUMBER 104 2 0
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 4 "Tipo pagamento "
|
PROMPT 1 4 "Tipo pagamento "
|
||||||
|
@ -7,4 +7,5 @@
|
|||||||
#define FS_RECALC 507
|
#define FS_RECALC 507
|
||||||
#define FS_NAMEPAG 508
|
#define FS_NAMEPAG 508
|
||||||
#define FS_TIPOPR 509
|
#define FS_TIPOPR 509
|
||||||
#define FS_MCOMM 510
|
#define FS_MCOMM 510
|
||||||
|
#define FS_RESET 511
|
||||||
|
@ -65,11 +65,16 @@ SPREADSHEET FS_RATESHEET 0 8
|
|||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 10 "Rate"
|
PROMPT 1 10 "Rate"
|
||||||
ITEM "Scadenza@10"
|
ITEM "Scadenza@10"
|
||||||
ITEM "Percentuale@12"
|
|
||||||
ITEM "Importo@15"
|
ITEM "Importo@15"
|
||||||
|
ITEM "Percentuale@12"
|
||||||
ITEM "Tipo"
|
ITEM "Tipo"
|
||||||
ITEM "Pagamento@32"
|
ITEM "Pagamento@32"
|
||||||
END
|
END
|
||||||
|
|
||||||
|
BUTTON FS_RESET 7 1
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 -1 "Reset"
|
||||||
|
END
|
||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
|
|
||||||
|
@ -156,8 +156,8 @@ END
|
|||||||
|
|
||||||
BOOLEAN CHK_RIFPRO
|
BOOLEAN CHK_RIFPRO
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 4 17 "Riferimento numero protocollo o documento"
|
PROMPT 4 17 "Riferimento partita con numero protocollo"
|
||||||
HELP "Indicare se si desidera il numero protocollo/documento come riferimento"
|
HELP "Indicare se si desidera il numero protocollo IVA anziche' il numero documento come riferimento partita"
|
||||||
FIELD RifPro
|
FIELD RifPro
|
||||||
GROUP GROUP_SALDACONTO
|
GROUP GROUP_SALDACONTO
|
||||||
END
|
END
|
||||||
|
2913
cg/pagament.cpp
2913
cg/pagament.cpp
File diff suppressed because it is too large
Load Diff
191
cg/pagament.h
191
cg/pagament.h
@ -1,10 +1,6 @@
|
|||||||
#ifndef __PAGAMENT_H
|
#ifndef __PAGAMENT_H
|
||||||
#define __PAGAMENT_H
|
#define __PAGAMENT_H
|
||||||
|
|
||||||
#ifndef __ASSOC_H
|
|
||||||
#include <assoc.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef __MSKSHEET_H
|
#ifndef __MSKSHEET_H
|
||||||
#include <msksheet.h>
|
#include <msksheet.h>
|
||||||
#endif
|
#endif
|
||||||
@ -17,10 +13,6 @@
|
|||||||
#include <tabutil.h>
|
#include <tabutil.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __CONTO_H
|
|
||||||
#include "conto.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Error codes for pagation
|
// Error codes for pagation
|
||||||
const word P_OK = 0x0000; // ok
|
const word P_OK = 0x0000; // ok
|
||||||
const word P_RSUM = 0x0001; // percentages do not sum up to 100
|
const word P_RSUM = 0x0001; // percentages do not sum up to 100
|
||||||
@ -165,187 +157,4 @@ public:
|
|||||||
virtual ~TPagamento() {}
|
virtual ~TPagamento() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#ifndef __PARTITE_H
|
|
||||||
#include <partite.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
class TTree_rectype : public TRectype
|
|
||||||
{
|
|
||||||
protected:
|
|
||||||
TRecord_array _recarr;
|
|
||||||
|
|
||||||
void copy_key_to_row(TRectype& row) const;
|
|
||||||
int fill_array();
|
|
||||||
|
|
||||||
protected: // TRectype
|
|
||||||
virtual TObject* dup() const;
|
|
||||||
|
|
||||||
virtual int read(TBaseisamfile& f, word op = _isequal);
|
|
||||||
virtual int next(TBaseisamfile& f);
|
|
||||||
virtual int write(TBaseisamfile& f) const;
|
|
||||||
virtual int rewrite(TBaseisamfile& f) const;
|
|
||||||
virtual int remove(TBaseisamfile& f);
|
|
||||||
|
|
||||||
public:
|
|
||||||
const TRecord_array& rows_array() const { return _recarr; }
|
|
||||||
TRecord_array& rows_array() { return _recarr; }
|
|
||||||
const TRectype& row(int r) const { return ((TRecord_array&)_recarr).row(r, FALSE); }
|
|
||||||
TRectype& row(int r, bool create) { return _recarr.row(r, create); }
|
|
||||||
|
|
||||||
int last() const { return _recarr.last_row(); }
|
|
||||||
int pred(int r) const { return _recarr.pred_row(r); }
|
|
||||||
|
|
||||||
TTree_rectype(const TRectype& testata, const TRectype& riga, const char* num);
|
|
||||||
TTree_rectype(int testata, int riga, const char* num);
|
|
||||||
TTree_rectype(const TTree_rectype& t);
|
|
||||||
virtual ~TTree_rectype() {}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
class TRiga_scadenze : public TTree_rectype
|
|
||||||
{
|
|
||||||
friend class TPartita;
|
|
||||||
friend class TRiga_partite;
|
|
||||||
|
|
||||||
TRiga_partite* _riga;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
char calcola_abbuono(TImporto& abbuono, bool val) const;
|
|
||||||
TImporto calcola_differenza_cambio(bool update);
|
|
||||||
|
|
||||||
bool modifica_pagamento(const TRectype& new_pag,
|
|
||||||
char& old_ap, TImporto& old_abb, TImporto& old_diffcam,
|
|
||||||
char& new_ap, TImporto& new_abb, TImporto& new_diffcam);
|
|
||||||
|
|
||||||
protected: // TRecord_tree
|
|
||||||
virtual TObject* dup() const { return new TRiga_scadenze(*this); }
|
|
||||||
|
|
||||||
public:
|
|
||||||
int pagata() const; // Riga che chiude la rata o 0 se non pagata completamente
|
|
||||||
|
|
||||||
real residuo() const;
|
|
||||||
|
|
||||||
bool in_valuta() const;
|
|
||||||
|
|
||||||
TPartita& partita() const;
|
|
||||||
TRiga_partite& riga() const { CHECK(_riga, "Riga nulla"); return *_riga; } // Riga partite
|
|
||||||
|
|
||||||
TImporto importo_pagato(bool val) const;
|
|
||||||
TImporto importo_da_pagare(bool val) const;
|
|
||||||
|
|
||||||
TRiga_scadenze(TRiga_partite* riga);
|
|
||||||
TRiga_scadenze(const TRiga_scadenze& s);
|
|
||||||
virtual ~TRiga_scadenze() {}
|
|
||||||
};
|
|
||||||
|
|
||||||
class TRiga_partite : public TTree_rectype
|
|
||||||
{
|
|
||||||
friend class TPartita;
|
|
||||||
friend class TRiga_scadenze;
|
|
||||||
TPartita* _partita;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
bool update(const TRectype& vec, const TRectype& nuo, const char* field);
|
|
||||||
bool update(const TImporto& vec, const TImporto& nuo, const char* sez, const char* val);
|
|
||||||
|
|
||||||
public: // TTree_rectype
|
|
||||||
virtual TObject* dup() const { return new TRiga_partite(*this); }
|
|
||||||
virtual int read(TBaseisamfile& f, word op);
|
|
||||||
|
|
||||||
public:
|
|
||||||
int rate() const { return _recarr.rows(); }
|
|
||||||
TRiga_scadenze& rata(int r) const { return (TRiga_scadenze&)_recarr.row(r); }
|
|
||||||
|
|
||||||
int ultimo_pagamento(int rata) const;
|
|
||||||
char sezione() const { return get_char("SEZ"); }
|
|
||||||
|
|
||||||
TPartita& partita() const { CHECK(_partita, "Partita nulla"); return *_partita; }
|
|
||||||
|
|
||||||
TRiga_partite(TPartita* game);
|
|
||||||
TRiga_partite(const TRiga_partite& r);
|
|
||||||
virtual ~TRiga_partite() {}
|
|
||||||
};
|
|
||||||
|
|
||||||
class TPartita : public TObject
|
|
||||||
{
|
|
||||||
TRecord_array _part;
|
|
||||||
TRecord_array _unassigned;
|
|
||||||
|
|
||||||
public: // TObject
|
|
||||||
virtual bool ok() const { return _part.rows() > 0; }
|
|
||||||
|
|
||||||
public:
|
|
||||||
TRiga_partite& riga(int r) const { return (TRiga_partite&)_part.row(r); }
|
|
||||||
TRiga_partite& nuova_riga() { return (TRiga_partite&)_part.row(last()+1, TRUE); }
|
|
||||||
|
|
||||||
int succ(int r) const { return _part.succ_row(r); }
|
|
||||||
int pred(int r) const { return _part.pred_row(r); }
|
|
||||||
int first() const { return _part.first_row(); }
|
|
||||||
int last() const { return _part.last_row(); }
|
|
||||||
|
|
||||||
bool reread();
|
|
||||||
bool read(const TBill& clifo, int anno, const char* num);
|
|
||||||
bool write(bool re = FALSE);
|
|
||||||
bool rewrite() { return write(TRUE); }
|
|
||||||
|
|
||||||
int mov2rig(long nreg, int rmov) const;
|
|
||||||
int rig2mov(int rmov) const;
|
|
||||||
int prima_fattura() const;
|
|
||||||
bool utilizzata(int r) const; // Controlla se esistono pagamenti sommati alla riga r
|
|
||||||
|
|
||||||
void conto(TBill& c) const { c.get(_part.key()); }
|
|
||||||
int anno() const { return _part.key().get_int(PART_ANNO); }
|
|
||||||
const TString& numero() const { return _part.key().get(PART_NUMPART); }
|
|
||||||
const TString& descrizione() const { return _part.key().get(PART_DESCR); }
|
|
||||||
|
|
||||||
TImporto importo_speso(long numreg, int numrig) const;
|
|
||||||
void update_reg_num(long nreg, const TRectype& mov);
|
|
||||||
void calcola_saldo(TImporto& saldo, TImporto& doc, TImporto& pag, TImporto& imp) const;
|
|
||||||
|
|
||||||
bool modifica_pagamento(const TRectype& new_pag,
|
|
||||||
char& old_ap, TImporto& old_abb, TImporto& old_diffcam,
|
|
||||||
char& new_ap, TImporto& new_abb, TImporto& new_diffcam);
|
|
||||||
|
|
||||||
TPartita(const TBill& clifo, int anno, const char* num);
|
|
||||||
TPartita();
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
class TPartite_array : private TAssoc_array
|
|
||||||
{
|
|
||||||
TString80 _key; // Work string
|
|
||||||
|
|
||||||
protected:
|
|
||||||
const TString& key(const TBill& clifo, int anno, const char* num); // Build key for TAssoc_array
|
|
||||||
TPartita* find(const TBill& clifo, int anno, const char* numero, bool create);
|
|
||||||
TPartita* find(const TRectype& part, bool create);
|
|
||||||
|
|
||||||
public: // TAssoc_array
|
|
||||||
virtual void destroy() { TAssoc_array::destroy(); }
|
|
||||||
|
|
||||||
public:
|
|
||||||
TPartita& partita(const TBill& clifo, int anno, const char* numero);
|
|
||||||
TPartita& partita(const TRectype& r);
|
|
||||||
|
|
||||||
TPartita* exist(const TBill& clifo, int anno, const char* numero) const
|
|
||||||
{ return ((TPartite_array*)this)->find(clifo, anno, numero, FALSE); }
|
|
||||||
|
|
||||||
TPartita* exist(const TRectype& part) const
|
|
||||||
{ return ((TPartite_array*)this)->find(part, FALSE); }
|
|
||||||
|
|
||||||
bool write(bool re = FALSE);
|
|
||||||
bool rewrite() { return write(TRUE); }
|
|
||||||
|
|
||||||
int add_reg_num(long numreg, int numrig);
|
|
||||||
TImporto importo_speso(long numreg, int numrig);
|
|
||||||
void update_reg_num(long nreg, const TRectype& mov);
|
|
||||||
|
|
||||||
TPartita* first() { restart(); return next(); }
|
|
||||||
TPartita* next() { return (TPartita*)get(); }
|
|
||||||
|
|
||||||
TPartite_array() {}
|
|
||||||
virtual ~TPartite_array() {}
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user