ba3500a.uml Aggiustati allineamenti campi
ba3600.cpp Aggiustati handlers bislacchi libro unico ba3900.cpp Corretta stampa indici libro unico git-svn-id: svn://10.65.10.50/trunk@4050 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
a35b293943
commit
e20c432136
@ -6,7 +6,7 @@ TOOLBAR "" 0 20 0 2
|
||||
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Tabella libro unico pag. 1" -1 -1 78 18
|
||||
PAGE "Tabella libro unico 1/2" -1 -1 78 18
|
||||
|
||||
NUMBER F_ANNO 4
|
||||
BEGIN
|
||||
@ -37,16 +37,15 @@ END
|
||||
|
||||
LIST F_ULT_MESE_STAMP 2 10
|
||||
BEGIN
|
||||
PROMPT 45 1 "Ultimo mese stampa "
|
||||
PROMPT 41 1 "Ultimo mese stampa "
|
||||
FIELD %LBU->I0
|
||||
// NUM_EXPR {(#THIS_FIELD >= 0) && (#THIS_FIELD <= 12)}
|
||||
ITEM " |Nessuno"
|
||||
FLAGS "M"
|
||||
END
|
||||
|
||||
NUMBER F_ULT_PAG 5
|
||||
BEGIN
|
||||
PROMPT 45 2 "Ultima pagina "
|
||||
PROMPT 41 2 "Ultima pagina "
|
||||
FIELD %LBU->I1
|
||||
END
|
||||
|
||||
@ -74,7 +73,7 @@ END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Pag. 2" -1 -1 78 14
|
||||
PAGE "Tabella libro unico 2/2" -1 -1 78 14
|
||||
|
||||
LIST F_TIPOA 10
|
||||
BEGIN
|
||||
|
@ -51,8 +51,10 @@ class TStampa_indici : public TPrint_application
|
||||
TString _cod_lib_stampa, _stamp_bollato_str, _desc_cod_lib,_desc_cod_lib_su;
|
||||
char _tipo_intesta,_tipoa_ditta;
|
||||
bool _stamp_bollato, _pag_ann, _pag_fuori_sequenza,_stampa_intesta,_stampa_ind;
|
||||
TString _ind_dta,_civ_dta,_cap_dta,_com_dta,_prov_dta;
|
||||
|
||||
TString _ind_dta,_civ_dta,_cap_dta,_com_dta,_prov_dta;
|
||||
|
||||
bool _ho_stampato_almeno_un_bollato;
|
||||
|
||||
public: // TPrint_application
|
||||
virtual bool user_create() ;
|
||||
virtual bool user_destroy();
|
||||
@ -107,41 +109,38 @@ void TStampa_indici::init_sort()
|
||||
_sort->init();
|
||||
}
|
||||
|
||||
//Crea sort ordina i record della tabella %INL per mese registrazione, anno
|
||||
//registrazione e numero iniziale pagine registro libro unico
|
||||
// Crea sort ordina i record della tabella %INL per mese registrazione, anno
|
||||
// registrazione e numero iniziale pagine registro libro unico
|
||||
|
||||
void TStampa_indici::crea_sort()
|
||||
{
|
||||
long anno,numini_paglib,numfin_paglib,codditta,numini_pagut,numfin_pagut;
|
||||
TString cod_reg,cod_vidimaz,dep,app;
|
||||
long mese, ultimo_mese;
|
||||
bool stamp_bollato = FALSE;
|
||||
bool pagine_ann = FALSE;
|
||||
bool stampato = FALSE;
|
||||
mese = 0;
|
||||
ultimo_mese = 0;
|
||||
|
||||
int mese = 0;
|
||||
int ultimo_mese = 0;
|
||||
|
||||
init_sort();
|
||||
|
||||
_tab_lbu->zero();
|
||||
// TString dep (format ("%4d%-3s", _anno, (const char*) _cod_lib));
|
||||
// sprintf(__tmp, "%4d", _anno);
|
||||
// strcat (__tmp, _cod_lib);
|
||||
dep.format ("%4d%-3s", _anno, (const char*)_cod_lib);
|
||||
_tab_lbu->put("CODTAB", (const char*) dep);
|
||||
_tab_lbu->put("CODTAB", dep);
|
||||
|
||||
if (_tab_lbu->read(_isequal) == NOERR)
|
||||
{
|
||||
_indlib->setkey(1);
|
||||
_indlib->zero();
|
||||
_indlib->put("ANNO", _anno);
|
||||
_indlib->put("CODLIB", (const char*) _cod_lib);
|
||||
_indlib->put("CODLIB", (const char*)_cod_lib);
|
||||
|
||||
TRectype rec (_indlib->curr());
|
||||
const TRectype rec(_indlib->curr());
|
||||
|
||||
for (_indlib->read(); !_indlib->eof(); _indlib->next())
|
||||
{
|
||||
if (_indlib->curr() > rec) break;
|
||||
if (_indlib->curr() > rec)
|
||||
break;
|
||||
|
||||
mese = _indlib->get_int("MESEREG");
|
||||
|
||||
@ -202,16 +201,26 @@ void TStampa_indici::crea_sort()
|
||||
// l' ultimo mese stampato, l' ultima pagina stampata e il flag che indica se
|
||||
// quel record e' stato stampato su bollato
|
||||
|
||||
if ((_tipo_stampa == 2) && (stampato)) // stampato e' il flag che mi dice
|
||||
{ //se almeno un record, nella stampa
|
||||
_tab_lbu->put("I0", ultimo_mese); //su bollato, va in stampa. In caso
|
||||
if (_cod_lib == _cod_lib_stampa) //contrario non avrebbe senso
|
||||
_tab_lbu->put("I1", numfin_paglib);//aggiornare %LBU. ES:tutti i record
|
||||
_tab_lbu->rewrite(); //di quel mese sono gia stati stampati
|
||||
} //su bollato (flag = TRUE).
|
||||
} //Comunque il numero ultima pagina stampata va aggiornato
|
||||
//con l'ultima pagina dell'ultimo indice solo se il i libri
|
||||
//selezionati sono gli stessi (libro di studio e libro di stampa).
|
||||
if (_tipo_stampa == 2)
|
||||
{
|
||||
if (stampato) // stampato e' il flag che mi dice
|
||||
{ //se almeno un record, nella stampa
|
||||
_tab_lbu->put("I0", ultimo_mese); //su bollato, va in stampa. In caso
|
||||
if (_cod_lib == _cod_lib_stampa) //contrario non avrebbe senso
|
||||
_tab_lbu->put("I1", numfin_paglib);//aggiornare %LBU. ES:tutti i record
|
||||
_tab_lbu->rewrite(); //di quel mese sono gia stati stampati
|
||||
} //su bollato (flag = TRUE).
|
||||
else
|
||||
{
|
||||
error_box("La stampa su bollato e' gia' stata effettuata!");
|
||||
}
|
||||
_ho_stampato_almeno_un_bollato = stampato;
|
||||
}
|
||||
|
||||
// Comunque il numero ultima pagina stampata va aggiornato
|
||||
// con l'ultima pagina dell'ultimo indice solo se i libri
|
||||
// selezionati sono gli stessi (libro di studio e libro di stampa).
|
||||
}
|
||||
|
||||
void TStampa_indici::dati_libro_unico()
|
||||
{
|
||||
@ -239,7 +248,7 @@ void TStampa_indici::descrizione()
|
||||
lbu.put("CODTAB", (const char*) dep);
|
||||
|
||||
if (lbu.read(_isequal) == NOERR)
|
||||
_desc_cod_lib_su = lbu.get ("S0");
|
||||
_desc_cod_lib_su = lbu.get("S0");
|
||||
}
|
||||
|
||||
void TStampa_indici::intestatario(TString& cofi,TString& paiv,TString& ragsoc,TString& ind,
|
||||
@ -317,10 +326,6 @@ bool TStampa_indici::set_print(int)
|
||||
|
||||
crea_sort();
|
||||
|
||||
|
||||
// if (_tipo_stampa == 2)
|
||||
// crea_intestazione_bollato();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
@ -351,7 +356,7 @@ bool TStampa_indici::set_print(int)
|
||||
void TStampa_indici::postclose_print()
|
||||
{ // Se ha stampato in definitiva, aggiorna il numero di pagine stampate sul libro unico.
|
||||
// Viene incrementato del numero di pagine stampate per gli indici
|
||||
if ((_tipo_stampa == 2))
|
||||
if (_tipo_stampa == 2 && _ho_stampato_almeno_un_bollato)
|
||||
{
|
||||
TString dep;
|
||||
dep.format ("%4d%-3s", _anno, (const char*)_cod_lib_stampa); // Va aggiornato il libro sul quale si stampa!
|
||||
|
@ -1,6 +1,8 @@
|
||||
#include <relapp.h>
|
||||
#include <nditte.h>
|
||||
#include <prefix.h>
|
||||
#include <relapp.h>
|
||||
|
||||
#include <nditte.h>
|
||||
|
||||
#include "batbinl.h"
|
||||
|
||||
class TIndici_app : public TRelation_application
|
||||
@ -8,7 +10,7 @@ class TIndici_app : public TRelation_application
|
||||
TRelation* _indici;
|
||||
TMask* _maschera;
|
||||
|
||||
TString80 _tmp;
|
||||
TString _tmp;
|
||||
|
||||
protected:
|
||||
virtual bool user_create();
|
||||
@ -23,32 +25,30 @@ protected:
|
||||
virtual int read(TMask& m);
|
||||
|
||||
static bool ditta_handler(TMask_field& f, KEY key);
|
||||
static bool annullapagine_handler(TMask_field& f, KEY key);
|
||||
static TIndici_app& app() { return (TIndici_app&) main_app(); }
|
||||
|
||||
public:
|
||||
TIndici_app() {}
|
||||
virtual ~TIndici_app() {}
|
||||
TIndici_app() : _tmp(80) { }
|
||||
virtual ~TIndici_app() { }
|
||||
};
|
||||
|
||||
bool TIndici_app::ditta_handler(TMask_field& f, KEY key)
|
||||
{
|
||||
TMask& m = f.mask();
|
||||
if (key == K_TAB && m.is_running())
|
||||
if (key == K_TAB && f.to_check(key, TRUE) && f.empty())
|
||||
{
|
||||
const long ditta = atol(f.get());
|
||||
if (ditta == 0L && m.is_running())
|
||||
{
|
||||
m.reset(F_CODREG);m.reset(F_DESCREG);
|
||||
m.disable(F_CODREG); m.disable(F_DESCREG);
|
||||
return TRUE;
|
||||
}
|
||||
TMask& m = f.mask();
|
||||
m.reset(F_CODREG); m.reset(F_DESCREG);
|
||||
m.disable(F_CODREG); m.disable(F_DESCREG);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if ((key == K_TAB && f.focusdirty()) || key == K_ENTER)
|
||||
{
|
||||
const long ditta = atol(f.get());
|
||||
if (ditta == 0L) return TRUE;
|
||||
if (ditta == 0L)
|
||||
return TRUE;
|
||||
|
||||
TMask& m = f.mask();
|
||||
if (prefix().exist(ditta))
|
||||
{
|
||||
app().set_firm(ditta);
|
||||
@ -56,25 +56,14 @@ bool TIndici_app::ditta_handler(TMask_field& f, KEY key)
|
||||
}
|
||||
else
|
||||
{
|
||||
f.error_box("Ditta %5ld non abilitata in contabilita'",ditta);
|
||||
m.reset(F_CODREG);m.reset(F_DESCREG);
|
||||
m.disable(F_CODREG); m.disable(F_DESCREG);
|
||||
return FALSE;
|
||||
return f.error_box("La ditta %5ld non e' abilitata in contabilita'", ditta);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TIndici_app::annullapagine_handler(TMask_field& f, KEY key)
|
||||
{
|
||||
if (key == K_SPACE && f.focusdirty())
|
||||
{
|
||||
TMask& m = f.mask();
|
||||
m.set(F_DESCREG,"");
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int TIndici_app::read(TMask& m)
|
||||
{
|
||||
int r = TRelation_application::read(m);
|
||||
@ -91,14 +80,14 @@ bool TIndici_app::user_create()
|
||||
{
|
||||
if (get_firm() == 0) // Se e' posizionato nel direttorio comune, setta la prima ditta abilitata in contabilita'
|
||||
{
|
||||
bool found = FALSE;
|
||||
TLocalisamfile ditte(LF_NDITTE);
|
||||
const long items = ditte.items();
|
||||
|
||||
bool found = FALSE;
|
||||
long ditta = 0L;
|
||||
for (ditte.first(); !found && !ditte.eof(); ditte.next())
|
||||
{
|
||||
ditta = ditte.get_long(NDT_CODDITTA);
|
||||
if (prefix().exist(ditta)) found = TRUE;
|
||||
found = prefix().exist(ditta);
|
||||
}
|
||||
|
||||
if (!found)
|
||||
@ -112,7 +101,6 @@ bool TIndici_app::user_create()
|
||||
_indici = new TRelation(LF_INDLIB);
|
||||
_maschera = new TMask("batbinl");
|
||||
_maschera->set_handler(F_DITTA, ditta_handler);
|
||||
_maschera->set_handler(F_PANN_LU, annullapagine_handler);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user