Corretto controllo di stampato su bollato in prima nota
Corretto ripristino stampa registri git-svn-id: svn://10.65.10.50/trunk@887 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
489a57bf64
commit
5c08bfe0f5
@ -1082,8 +1082,8 @@ bool TPrimanota_application::num_handler(TMask_field& f, KEY key)
|
||||
{
|
||||
const long max = app()._lastreg+1;
|
||||
|
||||
_skip_giornale_check = FALSE;
|
||||
_skip_bollato_check = FALSE;
|
||||
app()._skip_giornale_check = FALSE;
|
||||
app()._skip_bollato_check = FALSE;
|
||||
|
||||
if (num < max)
|
||||
{
|
||||
@ -1094,16 +1094,16 @@ bool TPrimanota_application::num_handler(TMask_field& f, KEY key)
|
||||
|
||||
if (mov.get_bool("STAMPATO"))
|
||||
{
|
||||
ok = yesnobox("Il movimento e' gia' stato stampato sul libro giornale:\n"
|
||||
"si desidera continuare ugualmente");
|
||||
_skip_giornale_check = ok;
|
||||
ok = yesno_box("Il movimento e' gia' stato stampato sul libro giornale:\n"
|
||||
"si desidera continuare ugualmente");
|
||||
app()._skip_giornale_check = ok;
|
||||
}
|
||||
|
||||
if (ok && mov.get_bool("REGST"))
|
||||
{
|
||||
ok = yesnobox("Il movimento e' gia' stato stampato sul bollato:\n"
|
||||
"si desidera continuare ugualmente");
|
||||
_skip_bollato_check = ok;
|
||||
ok = yesno_box("Il movimento e' gia' stato stampato sul bollato:\n"
|
||||
"si desidera continuare ugualmente");
|
||||
app()._skip_bollato_check = ok;
|
||||
}
|
||||
|
||||
if (ok)
|
||||
@ -1207,7 +1207,7 @@ bool TPrimanota_application::datareg_handler(TMask_field& f, KEY key)
|
||||
const long numreg = m.get_long(F_NUMREG);
|
||||
const bool error = numreg == 0 || numreg > app()._lastreg;
|
||||
|
||||
if (!_skip_giornale_check)
|
||||
if (!app()._skip_giornale_check)
|
||||
{
|
||||
const TLibro_giornale& gio = app().giornale();
|
||||
if (dr < gio.last_print())
|
||||
@ -1239,7 +1239,7 @@ bool TPrimanota_application::datareg_handler(TMask_field& f, KEY key)
|
||||
m.field(F_CODREG).on_hit();
|
||||
}
|
||||
|
||||
if (!_skip_bollato_check)
|
||||
if (!app()._skip_bollato_check)
|
||||
{
|
||||
if (dr < reg.last_print())
|
||||
{
|
||||
|
@ -3,11 +3,11 @@
|
||||
#include <config.h>
|
||||
#include <mask.h>
|
||||
#include <printapp.h>
|
||||
#include <progind.h>
|
||||
#include <relation.h>
|
||||
#include <tabutil.h>
|
||||
#include <utility.h>
|
||||
|
||||
#include <progind.h>
|
||||
#include <pconti.h>
|
||||
#include <comuni.h>
|
||||
#include <clifo.h>
|
||||
|
@ -1,5 +1,7 @@
|
||||
#include <xvt.h>
|
||||
#include <checks.h>
|
||||
|
||||
#define __MAIN__
|
||||
#include "cg4.h"
|
||||
|
||||
const char* const usage = "Errore - uso : %s -{0|1|2|3|4|5}";
|
||||
|
14
cg/cg4.h
14
cg/cg4.h
@ -1,6 +1,10 @@
|
||||
#ifndef __CG4_H
|
||||
#define __CG4_H
|
||||
|
||||
#ifndef __STRINGS_H
|
||||
#include <strings.h>
|
||||
#endif
|
||||
|
||||
int cg4100(int argc, char* argv[]);
|
||||
int cg4200(int argc, char* argv[]);
|
||||
int cg4300(int argc, char* argv[]);
|
||||
@ -8,5 +12,15 @@ int cg4400(int argc, char* argv[]);
|
||||
int cg4500(int argc, char* argv[]);
|
||||
int cg4600(int argc, char* argv[]);
|
||||
|
||||
#ifdef __MAIN__
|
||||
#define extern
|
||||
#endif
|
||||
|
||||
extern TString256 TMP;
|
||||
|
||||
#ifdef __MAIN__
|
||||
#undef extern
|
||||
#endif
|
||||
|
||||
#endif // __CG4_H
|
||||
|
||||
|
@ -5,8 +5,6 @@
|
||||
#include "cg4400a.h"
|
||||
#include "cg4400b.h"
|
||||
|
||||
static TString256 TMP;
|
||||
|
||||
inline CG4400_application& app() { return (CG4400_application&)main_app(); }
|
||||
|
||||
bool CG4400_application::filter_func (const TRelation * r)
|
||||
@ -287,14 +285,14 @@ bool CG4400_application::mask_libun (TMask_field& f, KEY k)
|
||||
int last_mese = 13;
|
||||
int mese;
|
||||
|
||||
app().__firm = app().TApplication::get_firm();
|
||||
app().__firm = app().get_firm();
|
||||
|
||||
for (int i = 0; i < app()._ditte->items(); i++)
|
||||
{
|
||||
long ditta = app()._ditte->row(i).get_long(1);
|
||||
if (prefhndl->exist(ditta))
|
||||
{
|
||||
app().TApplication::set_firm(ditta);
|
||||
app().set_firm(ditta);
|
||||
if (cod.not_empty())
|
||||
{
|
||||
ok = app().look_reg(i,anno,codlib,fino_a_mese,cod,&mese,ditta);
|
||||
@ -305,7 +303,7 @@ bool CG4400_application::mask_libun (TMask_field& f, KEY k)
|
||||
}
|
||||
if (mese != 0 && mese < fino_a_mese - 1) //indipendentemente se si tratta di una ditta selezionata oppure no
|
||||
{
|
||||
app().TApplication::set_firm(app().__firm);
|
||||
app().set_firm(app().__firm);
|
||||
return error_box("Ditta %ld: Stampare i registri dei mesi precedenti", ditta);
|
||||
}
|
||||
}
|
||||
|
@ -74,6 +74,9 @@ bool TRipristina_stampa::do_restore(long firm, const char * regist,
|
||||
|
||||
reg.zero();
|
||||
reg.put("CODTAB", s);
|
||||
|
||||
|
||||
TDate inizio_anno(1, 1, year);
|
||||
if (reg.read(_isequal, _lock) == NOERR)
|
||||
{
|
||||
TDate dlast(reg.get_date("D3"));
|
||||
@ -90,11 +93,15 @@ bool TRipristina_stampa::do_restore(long firm, const char * regist,
|
||||
}
|
||||
|
||||
TDate wd(esc.get_date("D0"));
|
||||
|
||||
inizio_anno = wd;
|
||||
|
||||
// Determina il corretto anno solare dell'esercizio: se il giorno di inizio esercizio
|
||||
// e successivo alla data di ripristino allora mi trovo nell'anno solare successivo
|
||||
year = wd.year();
|
||||
if (wd.month() > month)
|
||||
if (wd.month() > month || (wd.month() == month && wd.day() > day))
|
||||
year++;
|
||||
}
|
||||
}
|
||||
|
||||
const int ld = TDate::last_day(month, year);
|
||||
if (day > ld) day = ld;
|
||||
TDate d(day, month, year);
|
||||
@ -126,16 +133,21 @@ bool TRipristina_stampa::do_restore(long firm, const char * regist,
|
||||
{
|
||||
p.addstatus(1);
|
||||
mov.read(_isequal, _lock);
|
||||
mov.zero(fieldname);
|
||||
mov.zero(fieldname); // Azzera flag STAMPATO o REGST
|
||||
ok = (mov.rewrite() == NOERR);
|
||||
if (!ok)
|
||||
error_box("Errore nell'aggiornamento del movimento %ld.\n Errore n. %d",
|
||||
mov.get_long(MOV_NUMREG), mov.status());
|
||||
}
|
||||
|
||||
--d;
|
||||
reg.put("D3", d);
|
||||
if (d > inizio_anno) // Aggiorna data ultima stampa
|
||||
reg.put("D3", d);
|
||||
else
|
||||
reg.zero("D3");
|
||||
|
||||
if (giornale)
|
||||
reg.put("I6", last_num);
|
||||
reg.put("I6", last_num); // Aggiorna ultima pagina giornale
|
||||
ok = (reg.rewrite() == NOERR);
|
||||
if (!ok)
|
||||
error_box("Errore nell'aggiornamento del registro %s.\n Errore n. %d",
|
||||
|
Loading…
x
Reference in New Issue
Block a user