Corretta gestione delle causali contabili.
git-svn-id: svn://10.65.10.50/trunk@25 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
10852c6b02
commit
fe15049eab
@ -383,6 +383,7 @@ END
|
||||
STRING F_CODIVA 4
|
||||
BEGIN
|
||||
PROMPT 1 12 "Codice IVA "
|
||||
FLAGS "U"
|
||||
USE %IVA
|
||||
INPUT CODTAB F_CODIVA
|
||||
DISPLAY "Codice" CODTAB
|
||||
@ -531,9 +532,9 @@ BEGIN
|
||||
PROMPT 3 4 ""
|
||||
ITEM "Imponibile@14"
|
||||
ITEM "Iva@4"
|
||||
ITEM "Det@1"
|
||||
ITEM "Imposta@14"
|
||||
ITEM "C/R@1"
|
||||
ITEM "Det@1"
|
||||
ITEM " @1"
|
||||
ITEM "Gr."
|
||||
ITEM "Co."
|
||||
|
@ -40,20 +40,19 @@ bool TRegistro::read(const char* cod, int year)
|
||||
|
||||
int err = ~NOERR;
|
||||
|
||||
TTable reg("REG");
|
||||
if (cod && *cod > ' ')
|
||||
{
|
||||
TTable reg("REG");
|
||||
TString16 chiave;
|
||||
chiave << year << cod;
|
||||
reg.put("CODTAB", chiave);
|
||||
err = reg.read();
|
||||
if (err == NOERR)
|
||||
_rec = reg.curr();
|
||||
}
|
||||
_rec = reg.curr();
|
||||
|
||||
if (_att.ok())
|
||||
_att.zero();
|
||||
if (err != NOERR && _rec.ok())
|
||||
if (err != NOERR)
|
||||
_rec.zero();
|
||||
return err == NOERR;
|
||||
}
|
||||
@ -84,8 +83,8 @@ TipoIVA TRegistro::iva() const
|
||||
TipoIVA i = (TipoIVA)tipo();
|
||||
if (i != nessuna_iva && i != iva_vendite && i != iva_acquisti)
|
||||
{
|
||||
error_box("Il registro '%s' non e' un registro iva, tipo: %d",
|
||||
(const char*)_rec.get("CODTAB"), i);
|
||||
error_box("Il registro '%s' non e' un registro IVA o contabile: tipo %d",
|
||||
(const char*)name(), i);
|
||||
i = nessuna_iva;
|
||||
}
|
||||
return i;
|
||||
@ -96,12 +95,11 @@ bool TRegistro::read_att()
|
||||
if (!_att.empty())
|
||||
return TRUE;
|
||||
|
||||
TLocalisamfile attivita(LF_ATTIV);
|
||||
attivita.put("CODDITTA", MainApp()->get_firm());
|
||||
const char* a = _rec.get("S8");
|
||||
attivita.put("CODATT", a);
|
||||
const int err = attivita.read();
|
||||
_att = attivita.curr();
|
||||
TLocalisamfile attiv(LF_ATTIV);
|
||||
attiv.put("CODDITTA", MainApp()->get_firm());
|
||||
attiv.put("CODATT", attivita());
|
||||
const int err = attiv.read();
|
||||
_att = attiv.curr();
|
||||
if (err != NOERR)
|
||||
_att.zero();
|
||||
|
||||
@ -141,7 +139,6 @@ bool TRegistro::update(long protiva, const TDate& datareg)
|
||||
_rec.put("D2", datareg);
|
||||
updated = FALSE;
|
||||
}
|
||||
|
||||
if (!updated)
|
||||
{
|
||||
TTable reg("REG");
|
||||
@ -164,13 +161,12 @@ bool TLibro_giornale::read(int y)
|
||||
y = oggi.year();
|
||||
}
|
||||
|
||||
// if (ok() && y == year()) return TRUE; // Gia' letto!
|
||||
|
||||
TTable reg("REG");
|
||||
bool found = FALSE;
|
||||
|
||||
TString16 anno; anno.format("%4d", y);
|
||||
|
||||
reg.setkey(1);
|
||||
reg.put("CODTAB", anno); // Cerca il primo registro dell'anno y
|
||||
|
||||
for (int err = reg.read(_isgteq); err == NOERR; err = reg.next())
|
||||
@ -246,7 +242,7 @@ bool TCausale::read(const char* cod, int year)
|
||||
{
|
||||
TString16 codreg(caus.get("REG"));
|
||||
const bool ok = _reg.read(codreg, year); // Read register
|
||||
if (!ok)
|
||||
if (!ok && codreg.not_empty())
|
||||
return error_box("Non esiste il registro '%s' per l'anno %d",
|
||||
(const char*)codreg, year);
|
||||
}
|
||||
|
@ -41,6 +41,7 @@ public:
|
||||
TDate last_reg() const { return _rec.get_date("D2"); }
|
||||
TDate last_print() const { return _rec.get_date("D3"); }
|
||||
long protocol() const { return _rec.get_long("I5"); }
|
||||
const TString& attivita() const { return _rec.get("S8"); }
|
||||
|
||||
bool agenzia_viaggi();
|
||||
const TString& tipo_attivita();
|
||||
|
@ -119,6 +119,7 @@ END
|
||||
STRING 102 4
|
||||
BEGIN
|
||||
PROMPT 2 6 "IVA "
|
||||
FLAGS "U"
|
||||
USE %IVA
|
||||
INPUT CODTAB 102
|
||||
DISPLAY "Codice" CODTAB
|
||||
@ -136,16 +137,16 @@ BEGIN
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
NUMBER 105 1
|
||||
NUMBER 103 1
|
||||
BEGIN
|
||||
PROMPT 2 7 "Detraz. "
|
||||
SHEET "Codice|Descrizione@60"
|
||||
INPUT 105
|
||||
INPUT 103
|
||||
ITEM " |Regime normale"
|
||||
ITEM "1|IVA indetraibile su acquisti riferiti a ricavi esenti"
|
||||
ITEM "3|IVA indicata per il solo calcolo di ventilazione"
|
||||
ITEM "9|IVA non detraibile per l'articolo 19"
|
||||
OUTPUT 105
|
||||
OUTPUT 103
|
||||
OUTPUT 213
|
||||
END
|
||||
|
||||
@ -163,7 +164,7 @@ BEGIN
|
||||
PICTURE "."
|
||||
END
|
||||
|
||||
NUMBER 103 14
|
||||
NUMBER 104 14
|
||||
BEGIN
|
||||
PROMPT 41 8 "Imposta "
|
||||
FLAGS "RV"
|
||||
@ -176,13 +177,13 @@ BEGIN
|
||||
PROMPT 1 10 "Costo/Ricavo"
|
||||
END
|
||||
|
||||
STRING 104 1
|
||||
STRING 105 1
|
||||
BEGIN
|
||||
PROMPT 2 11 "Tipo "
|
||||
FLAGS "D"
|
||||
HELP "Specifica il tipo Costo/Ricavo"
|
||||
SHEET "Codice|Descrizione@50"
|
||||
INPUT 104
|
||||
INPUT 105
|
||||
ITEM " |Acquisti o vendite in genere"
|
||||
ITEM "1|Acquisti beni per rivendita"
|
||||
ITEM "2|Acquisti beni ammortizzabili"
|
||||
@ -190,7 +191,7 @@ BEGIN
|
||||
ITEM "4|Vendita beni strumentali art. 17"
|
||||
ITEM "5|Beni per rivendita da non ventilare"
|
||||
ITEM "8|Altri beni strumentali acquistati in leasing"
|
||||
OUTPUT 104
|
||||
OUTPUT 105
|
||||
OUTPUT 212
|
||||
END
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// $Id: maskfld.cpp,v 1.1.1.1 1994-08-12 10:52:00 alex Exp $
|
||||
// $Id: maskfld.cpp,v 1.2 1994-08-17 14:05:45 guy Exp $
|
||||
#include <xvt.h>
|
||||
|
||||
#include <applicat.h>
|
||||
@ -685,10 +685,18 @@ HIDDEN char* const _msg = &__tmp_string[512];
|
||||
|
||||
bool TMask_field::error_box(const char* fmt, ...) const
|
||||
{
|
||||
set_focus();
|
||||
build_msg();
|
||||
if (mask().is_running())
|
||||
{
|
||||
set_focus();
|
||||
::error_box("%s", _msg);
|
||||
set_focus();
|
||||
}
|
||||
else
|
||||
{
|
||||
xvt_statbar_set(_msg);
|
||||
beep();
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -703,10 +711,19 @@ bool TMask_field::message_box(const char* fmt, ...) const
|
||||
|
||||
bool TMask_field::warning_box(const char* fmt, ...) const
|
||||
{
|
||||
set_focus();
|
||||
build_msg();
|
||||
|
||||
if (mask().is_running())
|
||||
{
|
||||
set_focus();
|
||||
::warning_box("%s", _msg);
|
||||
set_focus();
|
||||
}
|
||||
else
|
||||
{
|
||||
xvt_statbar_set(_msg);
|
||||
beep();
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user