Patch level :10.0 258
Files correlati : Ricompilazione Demo : [ ] Commento :stampa movimenti percipienti: sistemata la richiesta 1) della RobbiVezz (aggiungere iva e totdoc alla stampa) git-svn-id: svn://10.65.10.50/trunk@18522 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
13b1ddce03
commit
275613c469
152
m770/772300.cpp
152
m770/772300.cpp
@ -39,13 +39,14 @@ class TStampa_mov : public TPrintapp
|
||||
TLocalisamfile* _rver;
|
||||
TArray _pagver;
|
||||
TPercipiente _curr_perc, _prec_perc;
|
||||
TString _ragsocER,_ragsocPE,_datadoc,_numdoc,_datastampa;
|
||||
TString _ragsocER, _ragsocPE, _datadoc, _numdoc, _datastampa;
|
||||
int _anno, _codcaus, _codtrib, _ind, _nprog;
|
||||
long _codditta,_codanagER,_codanagPE,_cod_da,_cod_a;
|
||||
long _codditta, _codanagER, _codanagPE, _cod_da,_cod_a;
|
||||
char _tipoa,_tipoa_da,_tipoa_a;
|
||||
real _tot_imponpag,_tot_ritenpag,_tot_impvers;
|
||||
real _g_tot_imp, _g_tot_ver, _g_tot_rit;
|
||||
TDate _datada,_dataa;
|
||||
real _tot_imponpag, _tot_ritenpag, _tot_impvers, _iva, _totdoc, _tot_totdoc, _tot_iva;
|
||||
real _g_tot_imp, _g_tot_ver, _g_tot_rit, _g_tot_totdoc, _g_tot_iva;
|
||||
TDate _datada, _dataa;
|
||||
|
||||
protected:
|
||||
friend bool filter_func (const TRelation *);
|
||||
virtual void on_config_change();
|
||||
@ -67,7 +68,8 @@ public:
|
||||
void ragione_sociale();
|
||||
int ricerca_causale();
|
||||
void setta_righe_documento();
|
||||
void setta_righe_pagamenti(const TString&,const real&,const TString&,const real&,int);
|
||||
void setta_righe_pagamenti(const TString& datapag, const real& imponpag, const real& percent,
|
||||
const real& ritenpag, int i);
|
||||
void setta_righe_versamenti(char,char,const TString&,const TString&,const TString&,const real&,int);
|
||||
static bool codditta_hnd(TMask_field& f, KEY k);
|
||||
// D = stampa ditta, S = stampa a livello di studio
|
||||
@ -152,9 +154,11 @@ bool TStampa_mov::preprocess_print(int file, int counter)
|
||||
{
|
||||
if (file == LF_SCPERC)
|
||||
{
|
||||
_tot_imponpag = ZERO;
|
||||
_tot_ritenpag = ZERO;
|
||||
_tot_impvers = ZERO;
|
||||
_tot_imponpag = ZERO;
|
||||
_tot_ritenpag = ZERO;
|
||||
_tot_impvers = ZERO;
|
||||
_tot_totdoc = ZERO;
|
||||
_tot_iva = ZERO;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
@ -183,7 +187,7 @@ void TStampa_mov::ragione_sociale()
|
||||
|
||||
void TStampa_mov::setta_righe_documento()
|
||||
{
|
||||
set_row (_row, "%-4d", _nprog); /* Prima era 2 */
|
||||
set_row (_row, "%-4d", _nprog); /* Prima era 2 */
|
||||
if (_codcaus != 0)
|
||||
set_row (_row, "@5g%02d", _codcaus);
|
||||
if (_codtrib != 0)
|
||||
@ -191,49 +195,61 @@ void TStampa_mov::setta_righe_documento()
|
||||
|
||||
set_row (_row, "@13g%10s", (const char*) _datadoc);
|
||||
set_row (_row, "@24g%-7s", (const char*) _numdoc);
|
||||
set_row (_row, "@30g%r", &_totdoc);
|
||||
set_row (_row, "@44g%r", &_iva);
|
||||
}
|
||||
|
||||
void TStampa_mov::setta_righe_pagamenti(const TString& datapag,const real& imponpag,
|
||||
const TString& percent,const real& ritenpag,int i)
|
||||
void TStampa_mov::setta_righe_pagamenti(const TString& datapag, const real& imponpag, const real& percent,
|
||||
const real& ritenpag, int i)
|
||||
{
|
||||
set_row (i, "@32g%10s", (const char*) datapag);
|
||||
set_row (i, "@43g%r", &imponpag);
|
||||
set_row (i, "@59g%s", (const char*) percent);
|
||||
set_row (i, "@65g%12r", &ritenpag);
|
||||
set_row (i, "@58g%10s", (const char*) datapag);
|
||||
set_row (i, "@69g%r", &imponpag);
|
||||
set_row (i, "@83g%3ld", percent.integer());
|
||||
set_row (i, "@87g%r", &ritenpag);
|
||||
}
|
||||
|
||||
void TStampa_mov::setta_righe_versamenti(char luovers,char tipovers,const TString& dataver,
|
||||
const TString& serie,const TString& numero,const real& impvers,int j)
|
||||
void TStampa_mov::setta_righe_versamenti(char luovers, char tipovers, const TString& dataver,
|
||||
const TString& serie, const TString& numero, const real& impvers, int j)
|
||||
{
|
||||
if (impvers != ZERO)
|
||||
{
|
||||
set_row (j, "@79g%c", luovers);
|
||||
set_row (j, "@82g%c", tipovers);
|
||||
set_row (j, "@84g%10s", (const char*) dataver);
|
||||
set_row (j, "@97g%s", (const char*) serie);
|
||||
set_row (j, "@103g%s", (const char*) numero);
|
||||
set_row (j, "@116g%r", &impvers);
|
||||
set_row (j, "@106g%c", luovers);
|
||||
set_row (j, "@109g%c", tipovers);
|
||||
set_row (j, "@111g%10s", (const char*) dataver);
|
||||
set_row (j, "@124g%s", (const char*) serie);
|
||||
set_row (j, "@130g%s", (const char*) numero);
|
||||
set_row (j, "@143g%r", &impvers);
|
||||
}
|
||||
}
|
||||
|
||||
void TStampa_mov::set_total_perc()
|
||||
{
|
||||
set_row (_row, "@20gTOTALE PERCIPIENTE@43g%r", &_tot_imponpag);
|
||||
set_row (_row, "@62g%r", &_tot_ritenpag);
|
||||
set_row (_row, "@8gTOTALE PERCIPIENTE");
|
||||
set_row (_row, "@30g%r", &_tot_totdoc);
|
||||
set_row (_row, "@44g%r", &_tot_iva);
|
||||
set_row (_row, "@69g%r", &_tot_imponpag);
|
||||
set_row (_row, "@87g%r", &_tot_ritenpag);
|
||||
set_row (_row, "@116g%r", &_tot_impvers);
|
||||
set_row (_row+1, "");
|
||||
|
||||
_g_tot_imp += _tot_imponpag;
|
||||
_g_tot_rit += _tot_ritenpag;
|
||||
_g_tot_ver += _tot_impvers;
|
||||
_g_tot_totdoc += _tot_totdoc;
|
||||
_g_tot_iva += _tot_iva;
|
||||
|
||||
_tot_imponpag = _tot_ritenpag = _tot_impvers = ZERO;
|
||||
_tot_imponpag = _tot_ritenpag = _tot_impvers = _tot_totdoc = _tot_iva = ZERO;
|
||||
}
|
||||
|
||||
void TStampa_mov::set_global_total()
|
||||
{
|
||||
set_row (_row, "@20gTOTALE GENERALE @43g%r", &_g_tot_imp);
|
||||
set_row (_row, "@62g%r", &_g_tot_rit);
|
||||
_row++;
|
||||
_row++;
|
||||
set_row (_row, "@8gTOTALE GENERALE");
|
||||
set_row (_row, "@30g%r", &_g_tot_totdoc);
|
||||
set_row (_row, "@44g%r", &_g_tot_iva);
|
||||
set_row (_row, "@69g%r", &_g_tot_imp);
|
||||
set_row (_row, "@87g%r", &_g_tot_rit);
|
||||
set_row (_row, "@116g%r", &_g_tot_ver);
|
||||
set_row (_row+1, "");
|
||||
}
|
||||
@ -250,11 +266,10 @@ bool TStampa_mov::find(TVersamento& vers)
|
||||
|
||||
bool TStampa_mov::preprocess_page(int file, int counter)
|
||||
{
|
||||
TString datapag,dataver,serie,numero;
|
||||
TString datapag, dataver, serie, numero;
|
||||
TDate datadoc,datav;
|
||||
real imponpag,ritenpag,impvers,dep,dep2;
|
||||
real imponpag, ritenpag, impvers, iva, totdoc, percent, dep, dep2;
|
||||
char luovers,tipovers;
|
||||
real percent;
|
||||
int i,j, numvers;
|
||||
|
||||
i = j = _row = 1;
|
||||
@ -265,22 +280,25 @@ bool TStampa_mov::preprocess_page(int file, int counter)
|
||||
if (file == LF_SCPERC)
|
||||
{
|
||||
reset_print();
|
||||
TRectype sch_curr(current_cursor()->curr(LF_SCPERC));
|
||||
_tipoa = current_cursor()->curr(LF_SCPERC).get (SPR_TIPOA)[0];
|
||||
_codanagPE = current_cursor()->curr(LF_SCPERC).get_long(SPR_CODANAGR);
|
||||
_nprog = current_cursor()->curr(LF_SCPERC).get_int(SPR_NPROG);
|
||||
_codcaus = current_cursor()->curr(LF_SCPERC).get_int (SPR_CODCAUS);
|
||||
const TRectype& sch_curr = current_cursor()->curr(LF_SCPERC);
|
||||
_tipoa = sch_curr.get_char(SPR_TIPOA);
|
||||
_codanagPE = sch_curr.get_long(SPR_CODANAGR);
|
||||
_nprog = sch_curr.get_int(SPR_NPROG);
|
||||
_codcaus = sch_curr.get_int (SPR_CODCAUS);
|
||||
_codtrib = ricerca_causale();
|
||||
datadoc = current_cursor()->curr(LF_SCPERC).get_date(SPR_DATADOC);
|
||||
datadoc = sch_curr.get_date(SPR_DATADOC);
|
||||
_datadoc = datadoc.string();
|
||||
_numdoc = current_cursor()->curr(LF_SCPERC).get (SPR_NUMDOC);
|
||||
_numdoc = sch_curr.get(SPR_NUMDOC);
|
||||
|
||||
_iva = sch_curr.get_real(SPR_IVA);
|
||||
_totdoc = sch_curr.get_real(SPR_TOTALE);
|
||||
|
||||
const int anno_doc = datadoc.year();
|
||||
TSchedaP scheda(sch_curr);
|
||||
bool esiste_pag_anno_in_periodo = esiste_pag_in_periodo(scheda, _datada, _dataa);
|
||||
bool stampa_scheda = (anno_doc == _anno_dic) || esiste_pag_anno_in_periodo;
|
||||
if (!stampa_scheda)
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
_curr_perc.set(_tipoa, _codanagPE);
|
||||
if (_curr_perc != _prec_perc)
|
||||
@ -295,6 +313,10 @@ bool TStampa_mov::preprocess_page(int file, int counter)
|
||||
_row++;
|
||||
}
|
||||
|
||||
_tot_totdoc += _totdoc;
|
||||
_tot_iva += _iva;
|
||||
|
||||
//scrive i valori relativi al documento
|
||||
setta_righe_documento();
|
||||
|
||||
i = j = _row;
|
||||
@ -316,17 +338,16 @@ bool TStampa_mov::preprocess_page(int file, int counter)
|
||||
TDate datap(_rpag->get_date(PAG_DATAPAG));
|
||||
if (datap < _datada || datap > _dataa) continue;
|
||||
|
||||
datapag = datap.string();
|
||||
imponpag = _rpag->get_real(PAG_IMPONIBILE);
|
||||
percent = _rpag->get_real(PAG_PERC);
|
||||
TString16 st_perc(percent.string("###,@@"));
|
||||
ritenpag = _rpag->get_real(PAG_RITENUTA);
|
||||
numvers = _rpag->get_int(PAG_NUMVERS);
|
||||
nriga = _rpag->get_int(PAG_NRIGA);
|
||||
datapag = datap.string();
|
||||
imponpag = _rpag->get_real(PAG_IMPONIBILE);
|
||||
percent = _rpag->get_real(PAG_PERC);
|
||||
ritenpag = _rpag->get_real(PAG_RITENUTA);
|
||||
numvers = _rpag->get_int(PAG_NUMVERS);
|
||||
nriga = _rpag->get_int(PAG_NRIGA);
|
||||
_tot_imponpag += imponpag;
|
||||
_tot_ritenpag += ritenpag;
|
||||
|
||||
setta_righe_pagamenti(datapag,imponpag,st_perc,ritenpag,i++);
|
||||
setta_righe_pagamenti(datapag, imponpag, percent, ritenpag, i++);
|
||||
|
||||
if (numvers < 0) continue;
|
||||
|
||||
@ -388,7 +409,9 @@ print_action TStampa_mov::postprocess_page(int file, int counter)
|
||||
_row = 1;
|
||||
set_total_perc();
|
||||
_row++;
|
||||
|
||||
set_global_total();
|
||||
|
||||
return REPEAT_PAGE;
|
||||
}
|
||||
}
|
||||
@ -414,7 +437,7 @@ bool TStampa_mov::set_print(int)
|
||||
}
|
||||
set_firm_770(codditta_prec);
|
||||
// Non richiamare di nuovo print()!
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return init_print();
|
||||
@ -424,9 +447,10 @@ bool TStampa_mov::init_print()
|
||||
{
|
||||
TMask msk ("772300a");
|
||||
msk.set_handler (F_CODDITTA, codditta_hnd);
|
||||
printer().footerlen(3);
|
||||
printer().footerlen(3);
|
||||
|
||||
set_real_picture("###.###.###.###");
|
||||
printer().set_char_size(8);
|
||||
set_real_picture("#.###.###.###");
|
||||
set_magic_currency(TRUE);
|
||||
|
||||
_g_tot_imp = _g_tot_rit = _g_tot_ver = ZERO;
|
||||
@ -472,7 +496,6 @@ bool TStampa_mov::init_print()
|
||||
current_cursor()->setregion(da, a);
|
||||
|
||||
// viene ordinato per numero pagamento e numero versamento
|
||||
// _pagver.sort(compare_rows);
|
||||
dati_erogante();
|
||||
stampa_dati_erog_perc();
|
||||
//intesta_fissa();
|
||||
@ -523,7 +546,7 @@ void TStampa_mov::dati_erogante()
|
||||
void TStampa_mov::stampa_dati_erog_perc()
|
||||
{
|
||||
TString sep;
|
||||
TString app(132);
|
||||
TString app(198);
|
||||
reset_header();
|
||||
|
||||
// 7.12.95 Numero di pagina qui!
|
||||
@ -537,19 +560,11 @@ void TStampa_mov::stampa_dati_erog_perc()
|
||||
set_header(3,(const char*) sep);
|
||||
app.fill('_');
|
||||
set_header (5, (const char*) app);
|
||||
set_header (6, "Num.@5gCod.@13gDocumento@32gData@78gEstremi versamento@97gSerie@103gNumero");
|
||||
set_header (7, "Reg.@5gCaus.@13gData@24gNumero@48gImponibili@62g%%@69gRitenute@78gLV@81gTV@84gData@97gABI@103gCAB@116gImporto versato");
|
||||
set_header (6, "Num.@5gCod.@13gDOCUMENTO@58gPAGAMENTO@105gVERSAMENTO@124gSerie@130gNumero");
|
||||
set_header (7, "Reg.@5gCaus.@13gData@24gNumero@35gTot.Doc.@53gIVA@58gData@72gImponibili@84g%%Rt@92gRitenute@105gLV@108gTV@111gData@124gABI@130gCAB@143gImporto versato");
|
||||
set_header (8, (const char*) app);
|
||||
}
|
||||
|
||||
/*
|
||||
// Crea l'intestazione per la stampa a 132 e a 198 caratteri
|
||||
void TStampa_mov::intesta_fissa()
|
||||
{
|
||||
set_background();
|
||||
set_background("W4l{1 5 198 5} W4l{1 8 198 8}");
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
bool TStampa_mov::user_create()
|
||||
{
|
||||
@ -557,9 +572,8 @@ bool TStampa_mov::user_create()
|
||||
_section = name();
|
||||
_section.cut(2);
|
||||
_cnf = new TConfig(CONFIG_USER, _section);
|
||||
_rel = new TRelation (LF_SCPERC);
|
||||
_cur = new TCursor(_rel,"",2);
|
||||
// _cur->set_filterfunction (filter_func);
|
||||
_rel = new TRelation (LF_SCPERC);
|
||||
_cur = new TCursor(_rel,"",2);
|
||||
add_cursor(_cur);
|
||||
|
||||
_nditte = new TLocalisamfile (LF_NDITTE);
|
||||
@ -568,7 +582,7 @@ bool TStampa_mov::user_create()
|
||||
_rver = new TLocalisamfile (LF_RVER);
|
||||
_codditta = get_firm_770();
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TStampa_mov::user_destroy()
|
||||
@ -579,7 +593,7 @@ bool TStampa_mov::user_destroy()
|
||||
delete _rpag;
|
||||
delete _rver;
|
||||
delete _cnf;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
int m72300(int argc, char* argv[])
|
||||
|
@ -190,7 +190,7 @@ class TSchedaP
|
||||
int remove();
|
||||
|
||||
TSchedaP (const long codditta=0L, const char tipoa=0, const long codanagr=0L, const int nprog=0);
|
||||
TSchedaP (TRectype& rec);
|
||||
TSchedaP (const TRectype& rec);
|
||||
~TSchedaP();
|
||||
};
|
||||
|
||||
@ -291,7 +291,7 @@ class TVersamento
|
||||
_codditta(codditta), _tipoa(tipoa), _codanagr(codanagr), _nprog(nprog), _nriga(nriga)
|
||||
{}
|
||||
|
||||
TVersamento(TRectype& rec);
|
||||
TVersamento(const TRectype& rec);
|
||||
};
|
||||
|
||||
// per suddividere il versamento sui vari pagamenti
|
||||
|
@ -949,7 +949,7 @@ TSchedaP::TSchedaP (const long codditta, const char tipoa, const long codanagr,
|
||||
_compenso_doc = _spese_doc = ZERO;
|
||||
}
|
||||
|
||||
TSchedaP::TSchedaP(TRectype& rec)
|
||||
TSchedaP::TSchedaP(const TRectype& rec)
|
||||
{
|
||||
_codditta = rec.get_long("CODDITTA");
|
||||
_tipoa = rec.get("TIPOA")[0];
|
||||
@ -957,7 +957,7 @@ TSchedaP::TSchedaP(TRectype& rec)
|
||||
_nprog = rec.get_int("NPROG");
|
||||
}
|
||||
|
||||
TVersamento::TVersamento(TRectype& rec)
|
||||
TVersamento::TVersamento(const TRectype& rec)
|
||||
{
|
||||
_codditta = rec.get_long(VER_CODDITTA);
|
||||
_tipoa = rec.get(VER_TIPOA)[0];
|
||||
|
Loading…
x
Reference in New Issue
Block a user