Ultime cose pagamenti

git-svn-id: svn://10.65.10.50/trunk@2438 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
villa 1996-01-12 11:28:43 +00:00
parent c27648c433
commit 1b0596fb89
3 changed files with 21 additions and 11 deletions

View File

@ -246,10 +246,17 @@ bool TPrimanota_application::tipopag_handler(TMask_field& f, KEY key)
if ((key == K_TAB || key == K_ENTER) && f.dirty())
{
TMask& m = f.mask();
const int t = m.get_int(105);
int t = m.get_int(105);
if (t <= 0)
{
t = 1;
f.set("1");
}
const char u = m.get(106)[0];
const TPagamento& pag = app().pagamento();
const char* s = pag.desc_tipo(t, u);
const TPagamento& pag = app().pagamento();
bool ok;
const char* s = pag.desc_tipo(t, u, &ok);
if (!ok) m.reset(106);
m.set(107, s);
}

View File

@ -744,9 +744,10 @@ const char* TPagamento::desc_tpr() const
return o;
}
const char* TPagamento::desc_tipo(int tipo, char ulc) const
const char* TPagamento::desc_tipo(int tipo, char ulc, bool* ok) const
{
const char* o = "";
const char* o = "";
if (ok != NULL) *ok = TRUE;
if (ulc > ' ')
{
const char key[] = { tipo+'0', ulc, '\0' };
@ -754,10 +755,12 @@ const char* TPagamento::desc_tipo(int tipo, char ulc) const
clr.put("CODTAB", key);
const int err = clr.read();
if (err == NOERR)
o = clr.get("S0");
if (err == NOERR)
o = clr.get("S0");
else if (ok != NULL)
*ok = FALSE;
}
else
if (*o == '\0')
{
switch (tipo)
{
@ -771,7 +774,7 @@ const char* TPagamento::desc_tipo(int tipo, char ulc) const
case 7: o = "Tratta accettata"; break;
case 8: o = "Rapporti interban. diretti"; break;
case 9: o = "Bonifici"; break;
default: o = ""; break;
default: o = ""; if (ok != NULL) *ok = FALSE; break;
}
}
return o;
@ -1322,7 +1325,7 @@ bool TPagamento::read(TTable* t, TTable* r)
_int_rate = t->get_int("I3");
#ifdef USE_DEFAULT_INT_RATE
if (_int_rate == 0) _int_rate = 30;
// if (_int_rate == 0) _int_rate = 30;
#endif
// aggiusta _inizio secondo INSCAD; vedi mese commerciale etc.

View File

@ -105,7 +105,7 @@ public:
const TString& name() const { return _name; }
const TString& code() const { return _code; }
const char* desc_tpr() const;
const char* desc_tipo(int tipo, char ulc) const;
const char* desc_tipo(int tipo, char ulc, bool* ok = NULL) const;
// giorni scadenza fissi, aggiunti poi
void set_fixed_scad(int a, int ind) { _fixd[ind] = a; }