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
|
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
|
NUMBER F_ANNO 4
|
||||||
BEGIN
|
BEGIN
|
||||||
@ -37,16 +37,15 @@ END
|
|||||||
|
|
||||||
LIST F_ULT_MESE_STAMP 2 10
|
LIST F_ULT_MESE_STAMP 2 10
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 45 1 "Ultimo mese stampa "
|
PROMPT 41 1 "Ultimo mese stampa "
|
||||||
FIELD %LBU->I0
|
FIELD %LBU->I0
|
||||||
// NUM_EXPR {(#THIS_FIELD >= 0) && (#THIS_FIELD <= 12)}
|
|
||||||
ITEM " |Nessuno"
|
ITEM " |Nessuno"
|
||||||
FLAGS "M"
|
FLAGS "M"
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_ULT_PAG 5
|
NUMBER F_ULT_PAG 5
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 45 2 "Ultima pagina "
|
PROMPT 41 2 "Ultima pagina "
|
||||||
FIELD %LBU->I1
|
FIELD %LBU->I1
|
||||||
END
|
END
|
||||||
|
|
||||||
@ -74,7 +73,7 @@ END
|
|||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
|
|
||||||
PAGE "Pag. 2" -1 -1 78 14
|
PAGE "Tabella libro unico 2/2" -1 -1 78 14
|
||||||
|
|
||||||
LIST F_TIPOA 10
|
LIST F_TIPOA 10
|
||||||
BEGIN
|
BEGIN
|
||||||
|
@ -53,6 +53,8 @@ class TStampa_indici : public TPrint_application
|
|||||||
bool _stamp_bollato, _pag_ann, _pag_fuori_sequenza,_stampa_intesta,_stampa_ind;
|
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
|
public: // TPrint_application
|
||||||
virtual bool user_create() ;
|
virtual bool user_create() ;
|
||||||
virtual bool user_destroy();
|
virtual bool user_destroy();
|
||||||
@ -114,21 +116,17 @@ void TStampa_indici::crea_sort()
|
|||||||
{
|
{
|
||||||
long anno,numini_paglib,numfin_paglib,codditta,numini_pagut,numfin_pagut;
|
long anno,numini_paglib,numfin_paglib,codditta,numini_pagut,numfin_pagut;
|
||||||
TString cod_reg,cod_vidimaz,dep,app;
|
TString cod_reg,cod_vidimaz,dep,app;
|
||||||
long mese, ultimo_mese;
|
|
||||||
bool stamp_bollato = FALSE;
|
bool stamp_bollato = FALSE;
|
||||||
bool pagine_ann = FALSE;
|
bool pagine_ann = FALSE;
|
||||||
bool stampato = FALSE;
|
bool stampato = FALSE;
|
||||||
mese = 0;
|
int mese = 0;
|
||||||
ultimo_mese = 0;
|
int ultimo_mese = 0;
|
||||||
|
|
||||||
init_sort();
|
init_sort();
|
||||||
|
|
||||||
_tab_lbu->zero();
|
_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);
|
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)
|
if (_tab_lbu->read(_isequal) == NOERR)
|
||||||
{
|
{
|
||||||
@ -137,11 +135,12 @@ void TStampa_indici::crea_sort()
|
|||||||
_indlib->put("ANNO", _anno);
|
_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())
|
for (_indlib->read(); !_indlib->eof(); _indlib->next())
|
||||||
{
|
{
|
||||||
if (_indlib->curr() > rec) break;
|
if (_indlib->curr() > rec)
|
||||||
|
break;
|
||||||
|
|
||||||
mese = _indlib->get_int("MESEREG");
|
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
|
// l' ultimo mese stampato, l' ultima pagina stampata e il flag che indica se
|
||||||
// quel record e' stato stampato su bollato
|
// quel record e' stato stampato su bollato
|
||||||
|
|
||||||
if ((_tipo_stampa == 2) && (stampato)) // stampato e' il flag che mi dice
|
if (_tipo_stampa == 2)
|
||||||
|
{
|
||||||
|
if (stampato) // stampato e' il flag che mi dice
|
||||||
{ //se almeno un record, nella stampa
|
{ //se almeno un record, nella stampa
|
||||||
_tab_lbu->put("I0", ultimo_mese); //su bollato, va in stampa. In caso
|
_tab_lbu->put("I0", ultimo_mese); //su bollato, va in stampa. In caso
|
||||||
if (_cod_lib == _cod_lib_stampa) //contrario non avrebbe senso
|
if (_cod_lib == _cod_lib_stampa) //contrario non avrebbe senso
|
||||||
_tab_lbu->put("I1", numfin_paglib);//aggiornare %LBU. ES:tutti i record
|
_tab_lbu->put("I1", numfin_paglib);//aggiornare %LBU. ES:tutti i record
|
||||||
_tab_lbu->rewrite(); //di quel mese sono gia stati stampati
|
_tab_lbu->rewrite(); //di quel mese sono gia stati stampati
|
||||||
} //su bollato (flag = TRUE).
|
} //su bollato (flag = TRUE).
|
||||||
} //Comunque il numero ultima pagina stampata va aggiornato
|
else
|
||||||
//con l'ultima pagina dell'ultimo indice solo se il i libri
|
{
|
||||||
|
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).
|
// selezionati sono gli stessi (libro di studio e libro di stampa).
|
||||||
|
}
|
||||||
|
|
||||||
void TStampa_indici::dati_libro_unico()
|
void TStampa_indici::dati_libro_unico()
|
||||||
{
|
{
|
||||||
@ -317,10 +326,6 @@ bool TStampa_indici::set_print(int)
|
|||||||
|
|
||||||
crea_sort();
|
crea_sort();
|
||||||
|
|
||||||
|
|
||||||
// if (_tipo_stampa == 2)
|
|
||||||
// crea_intestazione_bollato();
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -351,7 +356,7 @@ bool TStampa_indici::set_print(int)
|
|||||||
void TStampa_indici::postclose_print()
|
void TStampa_indici::postclose_print()
|
||||||
{ // Se ha stampato in definitiva, aggiorna il numero di pagine stampate sul libro unico.
|
{ // Se ha stampato in definitiva, aggiorna il numero di pagine stampate sul libro unico.
|
||||||
// Viene incrementato del numero di pagine stampate per gli indici
|
// 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;
|
TString dep;
|
||||||
dep.format ("%4d%-3s", _anno, (const char*)_cod_lib_stampa); // Va aggiornato il libro sul quale si stampa!
|
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 <prefix.h>
|
||||||
|
#include <relapp.h>
|
||||||
|
|
||||||
|
#include <nditte.h>
|
||||||
|
|
||||||
#include "batbinl.h"
|
#include "batbinl.h"
|
||||||
|
|
||||||
class TIndici_app : public TRelation_application
|
class TIndici_app : public TRelation_application
|
||||||
@ -8,7 +10,7 @@ class TIndici_app : public TRelation_application
|
|||||||
TRelation* _indici;
|
TRelation* _indici;
|
||||||
TMask* _maschera;
|
TMask* _maschera;
|
||||||
|
|
||||||
TString80 _tmp;
|
TString _tmp;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool user_create();
|
virtual bool user_create();
|
||||||
@ -23,32 +25,30 @@ protected:
|
|||||||
virtual int read(TMask& m);
|
virtual int read(TMask& m);
|
||||||
|
|
||||||
static bool ditta_handler(TMask_field& f, KEY key);
|
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(); }
|
static TIndici_app& app() { return (TIndici_app&) main_app(); }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TIndici_app() {}
|
TIndici_app() : _tmp(80) { }
|
||||||
virtual ~TIndici_app() { }
|
virtual ~TIndici_app() { }
|
||||||
};
|
};
|
||||||
|
|
||||||
bool TIndici_app::ditta_handler(TMask_field& f, KEY key)
|
bool TIndici_app::ditta_handler(TMask_field& f, KEY key)
|
||||||
|
{
|
||||||
|
if (key == K_TAB && f.to_check(key, TRUE) && f.empty())
|
||||||
{
|
{
|
||||||
TMask& m = f.mask();
|
TMask& m = f.mask();
|
||||||
if (key == K_TAB && m.is_running())
|
|
||||||
{
|
|
||||||
const long ditta = atol(f.get());
|
|
||||||
if (ditta == 0L && m.is_running())
|
|
||||||
{
|
|
||||||
m.reset(F_CODREG); m.reset(F_DESCREG);
|
m.reset(F_CODREG); m.reset(F_DESCREG);
|
||||||
m.disable(F_CODREG); m.disable(F_DESCREG);
|
m.disable(F_CODREG); m.disable(F_DESCREG);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if ((key == K_TAB && f.focusdirty()) || key == K_ENTER)
|
if ((key == K_TAB && f.focusdirty()) || key == K_ENTER)
|
||||||
{
|
{
|
||||||
const long ditta = atol(f.get());
|
const long ditta = atol(f.get());
|
||||||
if (ditta == 0L) return TRUE;
|
if (ditta == 0L)
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
TMask& m = f.mask();
|
||||||
if (prefix().exist(ditta))
|
if (prefix().exist(ditta))
|
||||||
{
|
{
|
||||||
app().set_firm(ditta);
|
app().set_firm(ditta);
|
||||||
@ -56,25 +56,14 @@ bool TIndici_app::ditta_handler(TMask_field& f, KEY key)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
f.error_box("Ditta %5ld non abilitata in contabilita'",ditta);
|
|
||||||
m.reset(F_CODREG);m.reset(F_DESCREG);
|
m.reset(F_CODREG);m.reset(F_DESCREG);
|
||||||
m.disable(F_CODREG); m.disable(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;
|
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 TIndici_app::read(TMask& m)
|
||||||
{
|
{
|
||||||
int r = TRelation_application::read(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'
|
if (get_firm() == 0) // Se e' posizionato nel direttorio comune, setta la prima ditta abilitata in contabilita'
|
||||||
{
|
{
|
||||||
bool found = FALSE;
|
|
||||||
TLocalisamfile ditte(LF_NDITTE);
|
TLocalisamfile ditte(LF_NDITTE);
|
||||||
const long items = ditte.items();
|
|
||||||
|
bool found = FALSE;
|
||||||
long ditta = 0L;
|
long ditta = 0L;
|
||||||
for (ditte.first(); !found && !ditte.eof(); ditte.next())
|
for (ditte.first(); !found && !ditte.eof(); ditte.next())
|
||||||
{
|
{
|
||||||
ditta = ditte.get_long(NDT_CODDITTA);
|
ditta = ditte.get_long(NDT_CODDITTA);
|
||||||
if (prefix().exist(ditta)) found = TRUE;
|
found = prefix().exist(ditta);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!found)
|
if (!found)
|
||||||
@ -112,7 +101,6 @@ bool TIndici_app::user_create()
|
|||||||
_indici = new TRelation(LF_INDLIB);
|
_indici = new TRelation(LF_INDLIB);
|
||||||
_maschera = new TMask("batbinl");
|
_maschera = new TMask("batbinl");
|
||||||
_maschera->set_handler(F_DITTA, ditta_handler);
|
_maschera->set_handler(F_DITTA, ditta_handler);
|
||||||
_maschera->set_handler(F_PANN_LU, annullapagine_handler);
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user