diff --git a/cg/cg1500.cpp b/cg/cg1500.cpp index d79397705..7838fdd35 100755 --- a/cg/cg1500.cpp +++ b/cg/cg1500.cpp @@ -2539,21 +2539,21 @@ void CG1500_application::set_page(int file, int counter) if (_stampa_width == 132) { set_row(r,"%3d",_conto_succ); - set_row(r," @8g%s@49g!@50g%r@67g%r@82g!@83g%r@99g%r@114g!@115g%r %c", + set_row(r," @8g%-.40s@49g!@50g%r@67g%r@82g!@83g%r@99g%r@114g!@115g%r %c", (const char*)_descr_succ,&_saldoini_dare_succ,&_saldoini_avere_succ, &_mov_dare_succ,&_mov_avere_succ,&_saldofinale_succ,app); } else if (app == 'D') { set_row(r,"%3d",_conto_succ); - set_row(r," @8g%s@49g!@50g%r@67g%r@82g!@83g%r@100g%r@115g!@116g%r@148g!", + set_row(r," @8g%-.40s@49g!@50g%r@67g%r@82g!@83g%r@100g%r@115g!@116g%r@148g!", (const char*)_descr_succ,&_saldoini_dare_succ,&_saldoini_avere_succ, &_mov_dare_succ,&_mov_avere_succ,&_saldofinale_succ); } else { set_row(r,"%3d",_conto_succ); - set_row(r," @8g%s@49g!@50g%r@67g%r@82g!@83g%r@100g%r@115g!@132g%r@148g!", + set_row(r," @8g%-.40s@49g!@50g%r@67g%r@82g!@83g%r@100g%r@115g!@132g%r@148g!", (const char*)_descr_succ,&_saldoini_dare_succ,&_saldoini_avere_succ, &_mov_dare_succ,&_mov_avere_succ,&_saldofinale_succ); } @@ -2634,7 +2634,7 @@ int CG1500_application::stampa_record_conto(int g,int c,const TString& d, { // set_row(r++,"%3d-@8g%s@49g|@50g%r@67g%r@82g|@83g%r@100g%r@115g|@116g%r%s",g,d,&r1,&r2,&r3,&r4,&r5,(const char*)app); set_row(r,"%3d-",g); - set_row(r,"@8g%s",(const char*)d); + set_row(r,"@8g%-.40s",(const char*)d); set_row(r++,"@49g!@50g%r@67g%r@82g!@83g%r@99g%r@114g!@115g%r %c",&r1,&r2,&r3,&r4,&r5,app); } else @@ -2642,14 +2642,14 @@ int CG1500_application::stampa_record_conto(int g,int c,const TString& d, { // set_row(r++,"%3d-@8g%s@49g|@50g%r@67g%r@82g|@83g%r@100g%r@115g|@116g%r@148g|",g,d,&r1,&r2,&r3,&r4,&r5); set_row(r,"%3d-",g); - set_row(r,"@8g%s",(const char*)d); + set_row(r,"@8g%-.40s",(const char*)d); set_row(r++,"@49g!@50g%r@67g%r@82g!@83g%r@100g%r@115g!@116g%r@148g!",&r1,&r2,&r3,&r4,&r5); } else { // set_row(r++,"%3d-@8g%s@49g|@50g%r@67g%r@82g|@83g%r@100g%r@115g|@132g%r@148g|",g,d,&r1,&r2,&r3,&r4,&r5); set_row(r,"%3d-",g); - set_row(r,"@8g%s",(const char*)d); + set_row(r,"@8g%-.40s",(const char*)d); set_row(r++,"@49g!@50g%r@67g%r@82g!@83g%r@100g%r@115g!@132g%r@148g!",&r1,&r2,&r3,&r4,&r5); } } @@ -2817,19 +2817,19 @@ void CG1500_application::stampa_totali() set_row(_i++, (const char*)dep); set_row(_i++, (const char*)dep); set_row(_i++, (const char*)dep); - set_row(_i++, "@35gTOTALE@45g%r@103gTOTALE@113g%r", + set_row(_i++, "@39gTOTALE@49g%r@107gTOTALE@117g%r", &_tot_dare, &_tot_avere); if (_tot_dare > _tot_avere) { - set_row(_i++, "@81gSBILANCIO ESERCIZIO IN CORSO@113g%r", + set_row(_i++, "@85gSBILANCIO ESERCIZIO IN CORSO@117g%r", &sbilancio); - set_row(_i++, "@92gTOTALE A PAREGGIO@113g%r",&pareggio); + set_row(_i++, "@96gTOTALE A PAREGGIO@117g%r",&pareggio); } if (_tot_dare < _tot_avere) { - set_row(_i++, "@13gSBILANCIO ESERCIZIO IN CORSO@45g%r", + set_row(_i++, "@17gSBILANCIO ESERCIZIO IN CORSO@49g%r", &sbilancio); - set_row(_i++, "@24gTOTALE A PAREGGIO@45g%r", &pareggio); + set_row(_i++, "@28gTOTALE A PAREGGIO@49g%r", &pareggio); } _tot_dare = ZERO; _tot_avere = ZERO; @@ -2866,29 +2866,29 @@ void CG1500_application::stampa_totali_uno(const real& r1,const real& r2) set_row(_i++, (const char*)dep); set_row(_i++, (const char*)dep); set_row(_i++, (const char*)dep); - set_row(_i++, "@35gTOTALE@45g%r@103gTOTALE@113g%r", + set_row(_i++, "@39gTOTALE@49g%r@107gTOTALE@117g%r", &_tot_dare, &_tot_avere); if (sbilancio > ZERO) //ho un utile => va stampato tra le passivita' { sbilprec = -sbilprec; pareggio = _tot_avere + sbilancio + sbilprec; if (sbilprec != ZERO) - set_row(_i++, "@79gSBILANCIO ESERCIZIO PRECEDENTE@113g%r", + set_row(_i++, "@83gSBILANCIO ESERCIZIO PRECEDENTE@117g%r", &sbilprec); - set_row(_i++, "@81gSBILANCIO ESERCIZIO IN CORSO@113g%r", + set_row(_i++, "@85gSBILANCIO ESERCIZIO IN CORSO@117g%r", &sbilancio); - set_row(_i++, "@92gTOTALE A PAREGGIO@113g%r",&pareggio); + set_row(_i++, "@96gTOTALE A PAREGGIO@117g%r",&pareggio); } else if (sbilancio < ZERO) //ho una perdita => va stampato tra le attivita' { sbilancio = -sbilancio; pareggio = _tot_dare + sbilancio + sbilprec; if (sbilprec != ZERO) - set_row(_i++, "@11gSBILANCIO ESERCIZIO PRECEDENTE@45g%r", + set_row(_i++, "@15gSBILANCIO ESERCIZIO PRECEDENTE@49g%r", &sbilprec); - set_row(_i++, "@13gSBILANCIO ESERCIZIO IN CORSO@45g%r", + set_row(_i++, "@17gSBILANCIO ESERCIZIO IN CORSO@49g%r", &sbilancio); - set_row(_i++, "@24gTOTALE A PAREGGIO@45g%r", &pareggio); + set_row(_i++, "@28gTOTALE A PAREGGIO@49g%r", &pareggio); } else //sbilancio es. in corso == 0 { @@ -2896,17 +2896,17 @@ void CG1500_application::stampa_totali_uno(const real& r1,const real& r2) if (sbilprec > ZERO) //va stampato sotto le passivita' { pareggio = _tot_avere + sbilprec; - set_row(_i++, "@79gSBILANCIO ESERCIZIO PRECEDENTE@113g%r", + set_row(_i++, "@83gSBILANCIO ESERCIZIO PRECEDENTE@117g%r", &sbilprec); - set_row(_i++, "@92gTOTALE A PAREGGIO@113g%r", &pareggio); + set_row(_i++, "@96gTOTALE A PAREGGIO@117g%r", &pareggio); } else if (sbilprec < ZERO) { sbilprec = -sbilprec; pareggio = _tot_dare + sbilprec; - set_row(_i++, "@11gSBILANCIO ESERCIZIO PRECEDENTE@45g%r", + set_row(_i++, "@15gSBILANCIO ESERCIZIO PRECEDENTE@49g%r", &sbilprec); - set_row(_i++, "@24gTOTALE A PAREGGIO@45g%r",&pareggio); + set_row(_i++, "@28gTOTALE A PAREGGIO@49g%r",&pareggio); } } _tot_dare = ZERO; @@ -2921,37 +2921,45 @@ void CG1500_application::stampa_prima_colonna(int g, int c, long s, if (_codici) //sono stampate solo le descrizioni dei conti { if (!_totali) - set_row(_i, "%s @45g%r @66g%c", desc, &saldo, dep); - else if ( !(c == 0 && s == 0) ) - set_row(_i, "%s @45g%r @66g%c", desc, &saldo, dep); + { + if (c != 0 && s == 0) + set_row(_i, "%-.44s @44g *** @49g%r @66g%c", desc, &saldo, dep); + else set_row(_i, "%-.48s @49g%r @66g%c", desc, &saldo, dep); + } + else if ( !(c == 0 && s == 0) ) //se cioe' non e' un gruppo + { + if (s == 0) //se e' un conto + set_row(_i, "%-.44s @44g *** @49g%r @66g%c", desc, &saldo, dep); +else set_row(_i, "%-.48s @49g%r @66g%c", desc, &saldo, dep); + } + } +else +{ + if (_totali && c == 0 && s == 0l) + return; + else if ( c == 0 && s == 0l ) + { + set_row(_i, "%3d ", g); + set_row(_i, "@17g%-.31s @49g%r @66g%c", desc, &saldo, dep); + } + else if (s == 0l) + { + set_row(_i, "%3d ", g); + set_row(_i, "%3d ", c); + set_row(_i, "@17g%-.31s @49g%r @66g%c", desc, &saldo, dep); } else { - if (_totali && c == 0 && s == 0l) - return; - else if ( c == 0 && s == 0l ) - { - set_row(_i, "%3d ", g); - set_row(_i, "@18g%s @45g%r @66g%c", desc, &saldo, dep); - } - else if (s == 0l) - { - set_row(_i, "%3d ", g); - set_row(_i, "%3d ", c); - set_row(_i, "@18g%s @45g%r @66g%c", desc, &saldo, dep); - } - else - { - set_row(_i, "%3d ", g); - set_row(_i, "%3d ", c); - set_row(_i, "%6ld ",(const char*) s); - set_row(_i, "@18g%s @45g%r @66g%c", desc, &saldo, dep); - } + set_row(_i, "%3d ", g); + set_row(_i, "%3d ", c); + set_row(_i, "%6ld ", s); + set_row(_i, "@17g%-.31s @49g%r @66g%c", desc, &saldo, dep); } } +} void CG1500_application::stampa_seconda_colonna(int g, int c, long s, - const char* desc, const real& saldo) +const char* desc, const real& saldo) { char dep = '*'; @@ -2959,37 +2967,41 @@ void CG1500_application::stampa_seconda_colonna(int g, int c, long s, { if (!_totali) { - set_row(_i, "@66g%c", dep); - set_row(_i, "@69g%s", desc); - set_row(_i, "@113g%r", &saldo); + if (c != 0 && s == 0) + set_row(_i, "@66g%c@69g%-.43s @112g ***@117g%r", dep, desc, &saldo); + else set_row(_i, "@66g%c@69g%-.47s @117g%r", dep, desc, &saldo); } - else if ( !(c == 0 && s == 0) ) - set_row(_i, "@66g%c @69g%s @113g%r", dep, desc, &saldo); + else if ( !(c == 0 && s == 0) ) + { + if (s == 0) //se e' un conto + set_row(_i, "@66g%c @69g%-.43s @112g *** @117g%r", dep, desc, &saldo); +else set_row(_i, "@66g%c @69g%-.47s @117g%r", dep, desc, &saldo); + } } +else +{ + if (_totali && c == 0 && s == 0l) + return; + else if ( c == 0 && s == 0l ) + { + set_row(_i, "@66g%c@69g%3d ", dep, g); + set_row(_i, "@86g%-.30s @117g%r", desc, &saldo); + } + else if (s == 0l) + { + set_row(_i, "@66g%c@69g%3d ", dep, g); + set_row(_i, "%3d", c); + set_row(_i, "@86g%-.30s @117g%r", desc, &saldo); + } else { - if (_totali && c == 0 && s == 0l) - return; - else if ( c == 0 && s == 0l ) - { - set_row(_i, "@66g%c@69g%3d ", dep, g); - set_row(_i, "@86g%s @113g%r", desc, &saldo); - } - else if (s == 0l) - { - set_row(_i, "@66g%c@69g%3d ", dep, g); - set_row(_i, "%3d", c); - set_row(_i, "@86g%s @113g%r", desc, &saldo); - } - else - { - set_row(_i, "@66g%c@69g%3d ", dep, g); - set_row(_i, "%3d ", c); - set_row(_i, "%6ld ",(const char*) s); - set_row(_i, "@86g%s @113g%r", desc, &saldo); - } + set_row(_i, "@66g%c@69g%3d ", dep, g); + set_row(_i, "%3d ", c); + set_row(_i, "%6ld ",s); + set_row(_i, "@86g%-.30s @117g%r", desc, &saldo); } } +} print_action CG1500_application::postprocess_page(int file, int counter) { @@ -3172,7 +3184,6 @@ bool CG1500_application::set_print(int) _causale_chi = conf.get("CoCaCh"); } */ - m.set_handler (F_VERIFICA, my_handler); m.set_handler (F_BILANCIO, mask_bilancio); m.set_handler (F_STAMPA1, mask_bilancio); @@ -3353,7 +3364,7 @@ void CG1500_application::preprocess_header() reset_header(); r = stampa_intestazione_ditta(); - if (_bilancio == 1) + if (_bilancio == 1) //bilancio a sezioni contrapposte { TString riga (132); TDate data_da; @@ -3363,19 +3374,18 @@ void CG1500_application::preprocess_header() set_header(r, "STAMPA BILANCIO A SEZIONI CONTRAPPOSTE"); if (_tipo_stampa == 1) { - //data_da = Controllo_data_limite(_datalim,_annoes,_annoes-1); - //data = data_da.string(); data_da = _dataini.string(); data = _datalim.string(); set_header(r,"@41gdalla data %s alla data %s", (const char*) data_da, (const char*) data); - //if (_competenza) - // set_header(r,"@88g(con controllo competenza)"); } else if (_tipo_stampa == 2) set_header(r,"@41gall'ultima immissione Es. %d", _annoes); //else set_header(r, "@41gall'ultima immissione Es. Precedente"); - + + //modifica del 20/04/1995 + set_header(r,"@85gAnno comp. %d", _annoes); + r++; riga.fill('-'); set_header(r, (const char*)riga); @@ -3402,31 +3412,33 @@ void CG1500_application::preprocess_header() } if (_tipo_stampa1 == 1) + { set_header(r,"@42gdalla data %s alla data %s", (const char*)datada, - (const char*) dataa); + (const char*) dataa); + //modifica del 20/04/1995 + if (_annoes != 0) //se l'anno e' 0 non si considera la competenza + set_header(r,"@86gAnno comp. %d", _annoes); + } else if (_tipo_stampa1 == 2) + { set_header(r,"@42gall'ultima immissione Es. %d", _annoes); - //else set_header(r, "@42gall'ultima immissione Es. preced."); + //modifica del 20/04/1995 + set_header(r,"@86gAnno comp. %d", _annoes); + } if ( (_verifica == 1)||(_verifica == 2) ) { if (_stampav == 1) - set_header(r,"@86gTutti i conti movimentati"); + set_header(r,"@103gTutti i conti movimentati"); else if (_stampav == 2) - set_header(r,"@86gConti con saldo <> 0"); - else set_header(r,"@86gTutti i conti"); - //if (_tipo_stampa1 == 1) - //if (_competenza) - // set_header(r,"@112gControllo competenza"); + set_header(r,"@103gConti con saldo <> 0"); + else set_header(r,"@103gTutti i conti"); } else { if (_stampac == 1) - set_header(r,"@86gTutti i conti movimentati"); - else set_header(r,"@86gConti con saldo <> 0"); - // if (_tipo_stampa1 == 1) - //if (_competenza) - // set_header(r,"@112gControllo competenza"); + set_header(r,"@103gTutti i conti movimentati"); + else set_header(r,"@103gConti con saldo <> 0"); } r++; diff --git a/cg/cg4300.cpp b/cg/cg4300.cpp index 9d6537805..368ff60be 100755 --- a/cg/cg4300.cpp +++ b/cg/cg4300.cpp @@ -45,6 +45,7 @@ bool TLiquidazione_app::user_create() _is_interactive = msg == NULL; bool recalc_only = FALSE; bool is_header = TRUE; + int headerlen; TDate printdate; TString filename; long ditta; @@ -95,7 +96,8 @@ bool TLiquidazione_app::user_create() nocalc = rcl == 'S' || rcl == 's'; printdate = subj.get(4); filename = subj.get(5); - is_header = subj.items() == 6; + headerlen = subj.get_int(6); + is_header = subj.items() == 7; } if(pnd) pnd->addstatus(1); @@ -211,7 +213,7 @@ bool TLiquidazione_app::user_create() TTemp_window w(TASK_WIN); if (recalc_only) _isprint = FALSE; - else printer().set_export_file(filename, is_header); + else printer().set_export_file(filename, is_header, headerlen); // calcola liquidazione printer().setdate(printdate); diff --git a/cg/cg4400.cpp b/cg/cg4400.cpp index 54b0d6635..571c469bc 100755 --- a/cg/cg4400.cpp +++ b/cg/cg4400.cpp @@ -295,11 +295,11 @@ bool CG4400_application::mask_libun (TMask_field& f, KEY k) ok = app().look_reg(i,anno,codlib,fino_a_mese,cod,&mese,ditta); if (!ok) { - if (app()._selected[i]) f.message_box("Ditta %ld: il registro %s non soddisfa i parametri indicati", ditta, (const char*)cod); - //if (app()._selected.last_one() == i) - // break; - else - continue; + //modifica del 21/04/1995 suggerita da Cinzia!!! + if (app()._selected.ones() == 1L) //solo se ho selezionato 1 ditta devo dare il messaggio + //if (app()._selected[i]) f.message_box("Ditta %ld: il registro %s non soddisfa i parametri indicati", ditta, (const char*)cod); + f.message_box("Ditta %ld: il registro %s non soddisfa i parametri indicati", ditta, (const char*)cod); + else continue; } if (mese != 0 && mese < fino_a_mese - 1) //indipendentemente se si tratta di una ditta selezionata oppure no { @@ -316,7 +316,8 @@ bool CG4400_application::mask_libun (TMask_field& f, KEY k) { if (!can_print) return FALSE; - if ( app()._selected[i]) + //if ( app()._selected[i]) + if (app()._selected.ones() == 1L) //solo se ho selezionato 1 ditta devo dare il messaggio f.message_box("Ditta %ld: nessun registro soddisfa i parametri indicati", ditta); continue; } @@ -2918,9 +2919,10 @@ bool CG4400_application::stampa_registri_IVA(const TMask& m) } } //for if (msg) - if ( (_tipo_stampa != 3) || (_tipo_stampa == 3 && _fino_a_mese == 1) ) //il messaggio seguente, nel caso di stampa su libro unico, - message_box("Ditta %ld: nessun registro soddisfa i parametri indicati", _ditta); //viene gia' dato nell'handler (che scatta pero' se il mese di - } //stampa e' diverso da gennaio + //if ( (_tipo_stampa != 3) || (_tipo_stampa == 3 && _fino_a_mese == 1) ) //il messaggio seguente, nel caso di stampa su libro unico, + if ( (_tipo_stampa != 3) || (_tipo_stampa == 3 && _fino_a_mese == 1 && _selected.ones() == 1L) ) //il messaggio seguente, nel caso di stampa su libro unico, + message_box("Ditta %ld: nessun registro soddisfa i parametri indicati", _ditta); //viene gia' dato nell'handler (che scatta pero' se il mese di + } //stampa e' diverso da gennaio } } TApplication::set_firm(__firm);