Patch level : 2.2 320
Files correlati : cg2.exe cg2100b.msk cg2100c.msk cg3.exe Ricompilazione Demo : [ ] Commento : Corretta gestione collegamentro tra righe contabili e mastrini. Corretto inserimento di pagamenti con saldaconto: non calcolava correttamente il residuo in prima nota, impedendo la registrazione di nuovi pagamenti git-svn-id: svn://10.65.10.50/trunk@13719 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
6a9bf22635
commit
a18e2b4500
@ -122,6 +122,7 @@ TMask* TPrimanota_application::load_mask(int n)
|
|||||||
m->set_handler(SK_TOTDOCVAL, totdocval_handler);
|
m->set_handler(SK_TOTDOCVAL, totdocval_handler);
|
||||||
m->set_handler(F_CODPAG, codpag_handler);
|
m->set_handler(F_CODPAG, codpag_handler);
|
||||||
m->set_handler(F_LINKDOC, linkdoc_handler);
|
m->set_handler(F_LINKDOC, linkdoc_handler);
|
||||||
|
m->set_handler(F_MASTRINO, mastrino_handler);
|
||||||
|
|
||||||
TSheet_field& cg = m->sfield(F_SHEETCG);
|
TSheet_field& cg = m->sfield(F_SHEETCG);
|
||||||
cg.set_notify(cg_notify);
|
cg.set_notify(cg_notify);
|
||||||
|
@ -41,6 +41,7 @@
|
|||||||
#define F_ANNORIF 124
|
#define F_ANNORIF 124
|
||||||
#define F_NUMRIF 125
|
#define F_NUMRIF 125
|
||||||
#define F_LINKDOC 126
|
#define F_LINKDOC 126
|
||||||
|
#define F_MASTRINO 127
|
||||||
#define F_PROVVISORIO 129
|
#define F_PROVVISORIO 129
|
||||||
#define F_OCCASEDIT 131
|
#define F_OCCASEDIT 131
|
||||||
#define F_SOLAIVA 132
|
#define F_SOLAIVA 132
|
||||||
@ -76,9 +77,7 @@
|
|||||||
#define CG_SOTTOCONTO 106
|
#define CG_SOTTOCONTO 106
|
||||||
#define CG_DESCR 109
|
#define CG_DESCR 109
|
||||||
#define CG_ROWTYPE 115
|
#define CG_ROWTYPE 115
|
||||||
#define CG_MASTRINO 116
|
#define CG_MASTRINO 199
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Campi ripetuti sulla seconda pagina
|
// Campi ripetuti sulla seconda pagina
|
||||||
#define H_DATAREG 201
|
#define H_DATAREG 201
|
||||||
|
@ -395,22 +395,27 @@ END
|
|||||||
|
|
||||||
NUMBER F_GRUPPO 3
|
NUMBER F_GRUPPO 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 -2 "Conto riga corrente "
|
PROMPT 1 -2 "Conto riga corrente "
|
||||||
FLAGS "D"
|
FLAGS "D"
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_CONTO 3
|
NUMBER F_CONTO 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 31 -2 ""
|
PROMPT 26 -2 ""
|
||||||
FLAGS "D"
|
FLAGS "D"
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_SOTTOCONTO 6
|
NUMBER F_SOTTOCONTO 6
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 36 -2 ""
|
PROMPT 31 -2 ""
|
||||||
FLAGS "D"
|
FLAGS "D"
|
||||||
END
|
END
|
||||||
|
|
||||||
|
BUTTON F_MASTRINO 8
|
||||||
|
BEGIN
|
||||||
|
PROMPT 39 -2 "Mastrino"
|
||||||
|
END
|
||||||
|
|
||||||
STRING F_SALDOCONTO 20
|
STRING F_SALDOCONTO 20
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 51 -2 "Saldo "
|
PROMPT 51 -2 "Saldo "
|
||||||
|
@ -691,22 +691,27 @@ END
|
|||||||
|
|
||||||
NUMBER F_GRUPPO 3
|
NUMBER F_GRUPPO 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 -2 "Conto riga corrente "
|
PROMPT 1 -2 "Conto riga corrente "
|
||||||
FLAGS "D"
|
FLAGS "D"
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_CONTO 3
|
NUMBER F_CONTO 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 31 -2 ""
|
PROMPT 26 -2 ""
|
||||||
FLAGS "D"
|
FLAGS "D"
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_SOTTOCONTO 6
|
NUMBER F_SOTTOCONTO 6
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 36 -2 ""
|
PROMPT 31 -2 ""
|
||||||
FLAGS "D"
|
FLAGS "D"
|
||||||
END
|
END
|
||||||
|
|
||||||
|
BUTTON F_MASTRINO 8
|
||||||
|
BEGIN
|
||||||
|
PROMPT 39 -2 "Mastrino"
|
||||||
|
END
|
||||||
|
|
||||||
STRING F_SALDOCONTO 20
|
STRING F_SALDOCONTO 20
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 51 -2 "Saldo "
|
PROMPT 51 -2 "Saldo "
|
||||||
|
@ -551,7 +551,7 @@ HIDDEN bool imptot_error(const TImporto& imptot, const TImporto& impsal, bool va
|
|||||||
{
|
{
|
||||||
TPrimanota_application& a = app();
|
TPrimanota_application& a = app();
|
||||||
const TMask& m = a.curr_mask();
|
const TMask& m = a.curr_mask();
|
||||||
TString16 codval;
|
TString4 codval;
|
||||||
if (val)
|
if (val)
|
||||||
codval = m.get(SK_VALUTA);
|
codval = m.get(SK_VALUTA);
|
||||||
TCurrency euro(imptot.valore(), codval);
|
TCurrency euro(imptot.valore(), codval);
|
||||||
@ -1822,14 +1822,10 @@ bool TPrimanota_application::sheet_clifo_handler(TMask_field& f, KEY k)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TPrimanota_application::sheet_mastrino_handler(TMask_field& f, KEY k)
|
void TPrimanota_application::link_mastrino(const TBill& bill) const
|
||||||
{
|
{
|
||||||
if (k == K_SPACE)
|
if (bill.ok())
|
||||||
{
|
{
|
||||||
TMask& m = f.mask();
|
|
||||||
const TString& tipo = m.get(CG_TIPO);
|
|
||||||
const short id_sotto = CG_SOTTOCONTO + (tipo.blank() ? 0 : (tipo == "C" ? 100 : 200));
|
|
||||||
|
|
||||||
TPrimanota_application& a = app();
|
TPrimanota_application& a = app();
|
||||||
const TMask& cm = a.curr_mask();
|
const TMask& cm = a.curr_mask();
|
||||||
|
|
||||||
@ -1838,21 +1834,25 @@ bool TPrimanota_application::sheet_mastrino_handler(TMask_field& f, KEY k)
|
|||||||
{
|
{
|
||||||
TDate date = cm.get(F_DATACOMP);
|
TDate date = cm.get(F_DATACOMP);
|
||||||
if (!date.ok())
|
if (!date.ok())
|
||||||
|
{
|
||||||
date = cm.get_date(F_DATAREG);
|
date = cm.get_date(F_DATAREG);
|
||||||
|
if (!date.ok())
|
||||||
|
date = TDate(TODAY);
|
||||||
|
}
|
||||||
anno = a._esercizi.date2esc(date);
|
anno = a._esercizi.date2esc(date);
|
||||||
}
|
}
|
||||||
|
|
||||||
TFilename ininame; ininame.tempdir(); ininame.add("mastrino.ini");
|
TFilename ininame; ininame.tempdir(); ininame.add("mastrino.ini");
|
||||||
if (anno > 0 && !m.field(id_sotto).empty())
|
if (anno > 0)
|
||||||
{
|
{
|
||||||
TConfig ini(ininame, "Transaction");
|
TConfig ini(ininame, "Transaction");
|
||||||
ini.set("Action", "Modify");
|
ini.set("Action", "Modify");
|
||||||
ini.set_paragraph("23");
|
ini.set_paragraph("24");
|
||||||
ini.set(RMV_ANNOES, anno);
|
ini.set(RMV_ANNOES, anno);
|
||||||
ini.set(RMV_TIPOC, tipo);
|
ini.set(RMV_TIPOC, bill.tipo());
|
||||||
ini.set(RMV_GRUPPO, m.get(CG_GRUPPO));
|
ini.set(RMV_GRUPPO, bill.gruppo());
|
||||||
ini.set(RMV_CONTO, m.get(CG_CONTO));
|
ini.set(RMV_CONTO, bill.conto());
|
||||||
ini.set(RMV_SOTTOCONTO, m.get(id_sotto));
|
ini.set(RMV_SOTTOCONTO, bill.sottoconto());
|
||||||
}
|
}
|
||||||
if (ininame.exist())
|
if (ininame.exist())
|
||||||
{
|
{
|
||||||
@ -1860,8 +1860,32 @@ bool TPrimanota_application::sheet_mastrino_handler(TMask_field& f, KEY k)
|
|||||||
cmd << "cg3 -5 -i" << ininame;
|
cmd << "cg3 -5 -i" << ininame;
|
||||||
TExternal_app app(cmd);
|
TExternal_app app(cmd);
|
||||||
app.run();
|
app.run();
|
||||||
|
xvt_fsys_removefile(ininame);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TPrimanota_application::mastrino_handler(TMask_field& f, KEY k)
|
||||||
|
{
|
||||||
|
if (k == K_SPACE)
|
||||||
|
{
|
||||||
|
TMask& m = f.mask();
|
||||||
|
TBill bill; bill.get(m, F_GRUPPO, F_CONTO, F_SOTTOCONTO);
|
||||||
|
app().link_mastrino(bill);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TPrimanota_application::sheet_mastrino_handler(TMask_field& f, KEY k)
|
||||||
|
{
|
||||||
|
if (k == K_SPACE)
|
||||||
|
{
|
||||||
|
TMask& m = f.mask();
|
||||||
|
const char tipo = m.get(CG_TIPO)[0];
|
||||||
|
const short id_sotto = CG_SOTTOCONTO + (tipo <= ' ' ? 0 : (tipo == 'C' ? 100 : 200));
|
||||||
|
TBill bill; bill.get(m, CG_GRUPPO, CG_CONTO, id_sotto, CG_TIPO);
|
||||||
|
app().link_mastrino(bill);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,6 +133,7 @@ class TPrimanota_application : public TRelation_application
|
|||||||
static bool tipopag_handler(TMask_field& f, KEY key);
|
static bool tipopag_handler(TMask_field& f, KEY key);
|
||||||
static bool prorata_handler(TMask_field& f, KEY k);
|
static bool prorata_handler(TMask_field& f, KEY k);
|
||||||
static bool linkdoc_handler(TMask_field& f, KEY k);
|
static bool linkdoc_handler(TMask_field& f, KEY k);
|
||||||
|
static bool mastrino_handler(TMask_field& f, KEY k);
|
||||||
|
|
||||||
static bool ratalit_handler(TMask_field& f, KEY key);
|
static bool ratalit_handler(TMask_field& f, KEY key);
|
||||||
static bool rataval_handler(TMask_field& f, KEY key);
|
static bool rataval_handler(TMask_field& f, KEY key);
|
||||||
@ -148,6 +149,7 @@ class TPrimanota_application : public TRelation_application
|
|||||||
void reset_sheet_row(TSheet_field& s, int n);
|
void reset_sheet_row(TSheet_field& s, int n);
|
||||||
int crea_somma_spese(TImporto& imp);
|
int crea_somma_spese(TImporto& imp);
|
||||||
void update_saldo_riga(int r);
|
void update_saldo_riga(int r);
|
||||||
|
void link_mastrino(const TBill& bill) const;
|
||||||
|
|
||||||
protected: // TApplication
|
protected: // TApplication
|
||||||
virtual void on_firm_change();
|
virtual void on_firm_change();
|
||||||
|
@ -2487,7 +2487,7 @@ bool TMastrini_video::menu(MENU_TAG mt)
|
|||||||
TFilename ininame = argv(2)+2;
|
TFilename ininame = argv(2)+2;
|
||||||
if (ininame.exist())
|
if (ininame.exist())
|
||||||
{
|
{
|
||||||
TConfig ini(ininame, "23");
|
TConfig ini(ininame, "24");
|
||||||
qm.set(F_ESERCIZIO, ini.get(RMV_ANNOES));
|
qm.set(F_ESERCIZIO, ini.get(RMV_ANNOES));
|
||||||
qm.set(F_TIPO, ini.get(RMV_TIPOC));
|
qm.set(F_TIPO, ini.get(RMV_TIPOC));
|
||||||
qm.set(F_GRUPPO, ini.get(RMV_GRUPPO));
|
qm.set(F_GRUPPO, ini.get(RMV_GRUPPO));
|
||||||
@ -2504,7 +2504,6 @@ bool TMastrini_video::menu(MENU_TAG mt)
|
|||||||
if (codesc <= 0)
|
if (codesc <= 0)
|
||||||
codesc = esercizi.last();
|
codesc = esercizi.last();
|
||||||
if (esercizi.exist(codesc))
|
if (esercizi.exist(codesc))
|
||||||
|
|
||||||
{
|
{
|
||||||
const TEsercizio& esercizio = esercizi.esercizio(codesc);
|
const TEsercizio& esercizio = esercizi.esercizio(codesc);
|
||||||
qm.set(F_ESERCIZIO, codesc);
|
qm.set(F_ESERCIZIO, codesc);
|
||||||
|
@ -882,7 +882,12 @@ int TBill::indicatore_bilancio() const
|
|||||||
str.format("%d|%d", gruppo(), conto());
|
str.format("%d|%d", gruppo(), conto());
|
||||||
const int ib = atoi(cache().get(LF_PCON, str, PCN_INDBIL));
|
const int ib = atoi(cache().get(LF_PCON, str, PCN_INDBIL));
|
||||||
if (ib <= 0)
|
if (ib <= 0)
|
||||||
NFCHECK("Impossibile stabilire l'indicatore di bilancio");
|
{
|
||||||
|
TString msg = str;
|
||||||
|
msg.replace('|', '.');
|
||||||
|
msg.insert(TR("Impossibile stabilire l'indicatore di bilancio del conto "));
|
||||||
|
NFCHECK(msg);
|
||||||
|
}
|
||||||
return ib;
|
return ib;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user