Corretto MI0363 liquidiazione piu' altre cose qua e la'

Altri modificati per cause spurie cvs-related


git-svn-id: svn://10.65.10.50/trunk@801 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
villa 1994-12-29 14:49:03 +00:00
parent f3c7cb1e11
commit 929a349a3c
18 changed files with 1001 additions and 884 deletions

View File

@ -1,13 +1,13 @@
#ifndef __CG0400_H #ifndef __CG0400_H
#define __CG0400_H #define __CG0400_H
/**** /****
#define TCLI "C" #define TCLI "C"
#define N_CODDITTA "CODDITTA" #define N_CODDITTA "CODDITTA"
#define N_CODATTPREV "CODATTPREV" #define N_CODATTPREV "CODATTPREV"
#define N_CODATT "CODATT" #define N_CODATT "CODATT"
#define N_CODCF "CODCF" #define N_CODCF "CODCF"
***/ ***/
#define TAB_REG "REG" #define TAB_REG "REG"
#define TAB_PIM "PIM" #define TAB_PIM "PIM"
@ -25,14 +25,14 @@
#define F_VUOILORDI 111 #define F_VUOILORDI 111
#define F_TIPO1 112 #define F_TIPO1 112
/* /*
#define F_TOTALE1 122 #define F_TOTALE1 122
#define F_TOTALE2 123 #define F_TOTALE2 123
#define F_TOTALE3 124 #define F_TOTALE3 124
#define F_TOTALE4 125 #define F_TOTALE4 125
#define F_TOTALE5 126 #define F_TOTALE5 126
#define F_TOTALE6 127 #define F_TOTALE6 127
#define F_PROMPT 128 #define F_PROMPT 128
*/ */
#endif // __CG0400_H #endif // __CG0400_H

View File

@ -6,7 +6,7 @@ enum stampe {
modulo101=3, modulo101=3,
modulo102=4, modulo102=4,
entrambi=5 entrambi=5
}; };
class desc_campo : public TObject class desc_campo : public TObject
{ {
@ -55,7 +55,7 @@ public:
real ivaesc_real() { return ivaesc; } real ivaesc_real() { return ivaesc; }
const char * tot_str() { return tot.string("@@@@@@@@@@@"); } const char * tot_str() { return tot.string("@@@@@@@@@@@"); }
// const char * esc_str() { return esc.string("@@@@@@@@@@@"); } // const char * esc_str() { return esc.string("@@@@@@@@@@@"); }
const char * impesc_str() { return impesc.string("@@@@@@@@@@@"); } const char * impesc_str() { return impesc.string("@@@@@@@@@@@"); }
const char * ivaesc_str() { return ivaesc.string("@@@@@@@@@@@"); } const char * ivaesc_str() { return ivaesc.string("@@@@@@@@@@@"); }
@ -70,7 +70,7 @@ struct alleg_sort {
char cognome_dic [31]; char cognome_dic [31];
char nome_dic [21]; char nome_dic [21];
char ragsoc_dic[51]; char ragsoc_dic[51];
// char datana_dic[11]; // char datana_dic[11];
TDate datana_dic; TDate datana_dic;
char sesso_dic [2]; char sesso_dic [2];
char comunena_dic [51]; char comunena_dic [51];
@ -127,7 +127,7 @@ class SortRecord {
TTable * _tpd; TTable * _tpd;
struct alleg_sort * _all; struct alleg_sort * _all;
protected: protected:
TRectype& look_com(const char *); TRectype& look_com(const char *);
long cerca_codice_all(TString tipo, long codcf) ; long cerca_codice_all(TString tipo, long codcf) ;
const char * decodifica_desc_att (TString & codatt); const char * decodifica_desc_att (TString & codatt);
@ -153,7 +153,7 @@ public:
struct Totali { struct Totali {
// Totali anno corrente // Totali anno corrente
real _tot_tot_rigac; real _tot_tot_rigac;
int _tot_esc; int _tot_esc;
real _tot_impesc; real _tot_impesc;
@ -161,7 +161,7 @@ struct Totali {
real _tot_niesc; real _tot_niesc;
real _tot_e8esc; real _tot_e8esc;
// Totali anno precedente // Totali anno precedente
real _tot_tot_rigap; real _tot_tot_rigap;
int _tot_esp; int _tot_esp;
real _tot_impesp; real _tot_impesp;
@ -169,7 +169,7 @@ struct Totali {
real _tot_niesp; real _tot_niesp;
real _tot_e8esp; real _tot_e8esp;
// Riporti // Riporti
real _rip_tot_riga; real _rip_tot_riga;
int _rip_tot_es; int _rip_tot_es;
real _rip_tot_impes; real _rip_tot_impes;
@ -211,7 +211,7 @@ enum modi_stampa {
modulo=1, modulo=1,
controllo=2, controllo=2,
dischetto=3 dischetto=3
}; };
enum posizioni { enum posizioni {
PAIVA_DIC = 0, PAIVA_DIC = 0,
@ -298,5 +298,5 @@ enum posizioni {
TOT_E8ESP, TOT_E8ESP,
TOT_SEGNO_TOTALE, TOT_SEGNO_TOTALE,
TOT_TOTALE TOT_TOTALE
}; };

View File

@ -8,6 +8,7 @@
#include <progind.h> #include <progind.h>
#include <sheet.h> #include <sheet.h>
#include <prefix.h> #include <prefix.h>
#include <utility.h>
#include "cg4300.h" #include "cg4300.h"
#include "cg4300a.h" #include "cg4300a.h"
@ -20,11 +21,12 @@ real TLiquidazione_app::CENTO(100.0);
inline TLiquidazione_app& app() inline TLiquidazione_app& app()
{ return (TLiquidazione_app&)main_app(); } { return (TLiquidazione_app&)main_app(); }
TLiquidazione_app::TLiquidazione_app() TLiquidazione_app::TLiquidazione_app() :
: _ditte(NULL), _selected(10000), _year(4), _nomiditte(100) _ditte(NULL), _selected(10000),
_year(4), _nomiditte(100)
{ {
_isprint = _is_interactive = TRUE; _recalc = needed; _isprint = _is_interactive = TRUE; _recalc = needed;
_isplafond = _isfinal = _is_visliq = FALSE; _isplafond = _printonly = _is_visliq = FALSE;
_isvent = _isagricolo = _isbenzinaro = _isviaggio = FALSE; _isvent = _isagricolo = _isbenzinaro = _isviaggio = FALSE;
_row = 1; _what = all; _comp_acconto = FALSE; _row = 1; _what = all; _comp_acconto = FALSE;
_isriepilogo = FALSE; _calcall = FALSE; _isriepilogo = FALSE; _calcall = FALSE;
@ -117,6 +119,7 @@ bool TLiquidazione_app::user_create()
// ACHTUNG: tutti i _codatt (codici attivita') sono // ACHTUNG: tutti i _codatt (codici attivita') sono
// in realta' composti dal codice attivita' piu' il // in realta' composti dal codice attivita' piu' il
// tipo attivita' (1 o 2) // tipo attivita' (1 o 2)
// sarebbe piu' saggio fare 2 campi ma ci vuole 1 vita
_pim_anno = new TRecfield(*_pim_r,"CODTAB",0,3); _pim_anno = new TRecfield(*_pim_r,"CODTAB",0,3);
_pim_codatt = new TRecfield(*_pim_r,"CODTAB",4,9); _pim_codatt = new TRecfield(*_pim_r,"CODTAB",4,9);
@ -154,15 +157,15 @@ bool TLiquidazione_app::user_create()
for (dt.first(); !dt.eof(); dt.next()) for (dt.first(); !dt.eof(); dt.next())
{ {
// no archivi // check no archivi
if (!prefhndl->exist(dt.get_long("CODDITTA"))) bool good = prefhndl->exist(dt.get_long("CODDITTA"));
continue;
if (good)
{
// check no parametri liquidazione
TApplication::set_firm(dt.get_long("CODDITTA")); TApplication::set_firm(dt.get_long("CODDITTA"));
if (!look_lia()) good = FALSE;
// no parametri liquidazione }
if (!look_lia())
continue;
_n_ditte++; _n_ditte++;
@ -171,7 +174,8 @@ bool TLiquidazione_app::user_create()
// add record // add record
d->add(dt.get("CODDITTA")); d->add(dt.get("CODDITTA"));
d->add(dt.get("RAGSOC")); d->add(dt.get("RAGSOC"));
d->add(_lia->get("S7")); if (good) d->add(_lia->get("S7"));
else d->add("??");
_nomiditte.add(d); _nomiditte.add(d);
} }
@ -339,141 +343,240 @@ bool TLiquidazione_app::set_print(int n)
long TLiquidazione_app::select_firm_range(long from, long to, wht freq) long TLiquidazione_app::select_firm_range(long from, long to, wht freq)
{ {
if (to == 0) to = 99999L; if (to == 0l) to = 99999L;
for (int i = 0; i < _nomiditte.items(); i++) for (int i = 0; i < _ditte->items(); i++)
{ {
TToken_string& d = (TToken_string&)_nomiditte[i]; if (_ditte->disabled(i))
const char vers = d.get_char(2);
if ((freq == mnt && vers == 'T') || (freq == quarter && vers == 'M'))
continue; continue;
const long cod = d.get_long(0);
TToken_string& d = _ditte->row(i);
const char vers = d.get_char(3);
if (vers == '?' || (freq == mnt && vers == 'T') || (freq == quarter && vers == 'M'))
continue;
const long cod = d.get_long(1);
if (cod >= from && cod <= to) if (cod >= from && cod <= to)
{
_selected.set(i); _selected.set(i);
_ditte->check(i);
}
else
{
_selected.set(i,FALSE);
_ditte->uncheck(i);
}
} }
return _selected.ones(); return _selected.ones();
} }
// ----------------------------------------------- handlers
bool TLiquidazione_app::to_ditta_handler(TMask_field& f, KEY key) bool TLiquidazione_app::to_ditt_handler(TMask_field& f, KEY key)
{ {
if (key == K_TAB && f.focusdirty() || key == K_ENTER)
{
TMask& m = f.mask(); TMask& m = f.mask();
const long from = m.get_long(CG43_FLD_DFR); if (key == K_F9)
const long to = m.get_long(CG43_FLD_DTO);
const wht freq = (wht)m.get_int(CG43_RDB_VERS);
if (from > 0 || to > 0)
{ {
const long sel = app().select_firm_range(from, to, freq); app().to_butt_handler(m.field(CG43_BUT_DTO), K_SPACE);
m.set(CG43_FLD_SELECTED, sel); }
// m.reset(CG43_FLD_DFR); if (key == K_TAB && f.focusdirty())
// m.reset(CG43_FLD_DTO); {
const long l = app().select_firm_range(m.get_long(CG43_FLD_DFR),
m.get_long(CG43_FLD_DTO),
(wht)m.get_int(CG43_RDB_VERS));
app().set_choice_limits(m);
m.field(CG43_FLD_SELECTED).set(format("%ld", l));
}
return TRUE;
}
bool TLiquidazione_app::fr_ditt_handler(TMask_field& f, KEY key)
{
TMask& m = f.mask();
if (key == K_F9)
{
app().fr_butt_handler(m.field(CG43_BUT_DFR), K_SPACE);
}
else if (key == K_TAB && f.focusdirty())
{
const long l = app().select_firm_range(m.get_long(CG43_FLD_DFR),
m.get_long(CG43_FLD_DTO),
(wht)m.get_int(CG43_RDB_VERS));
app().set_choice_limits(m);
m.field(CG43_FLD_SELECTED).set(format("%ld", l));
}
return TRUE;
}
bool TLiquidazione_app::to_butt_handler(TMask_field& f, KEY key)
{
if (key == K_SPACE)
{
TArray_sheet* sh = app().get_ditte_sheet();
TMask& m = f.mask();
sh->disable_check();
if (sh->run() == K_ENTER)
{
app().select_firm_range(m.get_long(CG43_FLD_DFR),sh->row(sh->selected()).get_long(1),
(wht)m.get_int(CG43_RDB_VERS));
app().set_choice_limits(m);
} }
} }
return TRUE; return TRUE;
} }
bool TLiquidazione_app::fr_butt_handler(TMask_field& f, KEY key)
bool TLiquidazione_app::set_liquidazione()
{ {
TMask m("cg4300a.msk"); if (key == K_SPACE)
m.set_handler(CG43_FLD_DTO, to_ditta_handler);
m.field(CG43_FLD_SELECTED).set("0");
_selected.reset();
KEY k;
// stampa abilitata per default
m.set(CG43_CHK_STAMPA,"X");
do
{ {
k = m.run(); TMask& m = f.mask();
TArray_sheet* sh = ((TLiquidazione_app&)main_app()).get_ditte_sheet();
if (k == K_ESC) break; sh->disable_check();
if (sh->run() == K_ENTER)
_what = (wht)m.get_int(CG43_RDB_VERS);
_month = m.get_int(CG43_LST_MESE);
if (_what == all)
{ {
if (_month != 3 && _month != 6 && _month != 9 && app().select_firm_range(sh->row(sh->selected()).get_long(1), m.get_long(CG43_FLD_DTO),
_month != 12 && _month != 13) (wht)m.get_int(CG43_RDB_VERS));
_what = mnt; app().set_choice_limits(m);
} }
else if (_what == quarter) }
_month = m.get_int(CG43_LST_TRIM); return TRUE;
}
_year = m.get(CG43_FLD_ANNO); bool TLiquidazione_app::what_freq_handler(TMask_field& f, KEY key)
_date = m.get(CG43_FLD_DATA); {
_isprint = m.get_bool(CG43_CHK_STAMPA); if (key == K_SPACE && f.dirty())
_recalc = (recalc)m.get_long(CG43_LST_CALC);
_isfinal = m.get_bool(CG43_CHK_FINAL);
if (_isprint) printer().setdate(_date);
// ------------------------------------------------
m.first_focus(k);
int i;
switch(k)
{ {
case DLG_SELECT: if (*(f.get()) == '3') // trimestre intelligente
{
int month = f.mask().get_int(CG43_LST_MESE);
if (month > 3)
while (!is_trim(month)) month--;
else month = 3;
f.mask().field(CG43_LST_TRIM).set(format("%d",month));
}
app().reset_choices(f.mask());
app().build_ditte_sheet((wht)atoi(f.get()));
}
return TRUE;
}
void TLiquidazione_app::reset_choices(TMask& m)
{
_selected.reset();
m.reset(CG43_FLD_SELECTED);
m.reset(CG43_FLD_DFR);
m.reset(CG43_FLD_DTO);
_ditte->check(-1, FALSE);
}
void TLiquidazione_app::set_choice_limits(TMask& m)
{
long first = -1l, last = -1l;
for (int i = 0; i < _ditte->items(); i++)
{
if (_selected[i])
{
long dit = _ditte->row(i).get_long(1);
if (first == -1l) first = dit;
if (last < dit) last = dit;
}
}
if (first != -1) m.field(CG43_FLD_DFR).set(format("%ld",first));
if (last != -1) m.field(CG43_FLD_DTO).set(format("%ld",last));
m.set(CG43_FLD_SELECTED, _selected.ones());
}
void TLiquidazione_app::build_ditte_sheet(wht what)
{
// build sheet // build sheet
_ditte->destroy(); _ditte->destroy();
for (i = 0; i < _nomiditte.items(); i++) _what = what;
for (int i = 0; i < _nomiditte.items(); i++)
{ {
TToken_string* d = new TToken_string(64); TToken_string* d = new TToken_string(64);
*d = (TToken_string&)_nomiditte[i]; *d = (TToken_string&)_nomiditte[i];
const char vers = d->get_char(2); const char vers = d->get_char(2);
if ((_what == mnt && vers == 'T') || (_what == quarter && vers == 'M')) bool selectable = vers == '?';
if ((what == mnt && vers == 'T') || (what == quarter && vers == 'M'))
continue; continue;
d->insert(" |", 0); d->insert(" |", 0);
const long pos = _ditte->add(d);
if (_selected[i]) _ditte->check(pos);
}
const long pos = _ditte->add(d);
if (selectable) _ditte->disable(pos);
else if (_selected[i]) _ditte->check(pos);
}
}
// ----------------------------------------------------
bool TLiquidazione_app::set_liquidazione()
{
TMask m("cg4300a.msk");
m.set_handler(CG43_FLD_DTO, to_ditt_handler);
m.set_handler(CG43_FLD_DFR, fr_ditt_handler);
m.set_handler(CG43_BUT_DTO, to_butt_handler);
m.set_handler(CG43_BUT_DFR, fr_butt_handler);
m.set_handler(CG43_RDB_VERS, what_freq_handler);
m.field(CG43_FLD_SELECTED).set("0");
KEY k;
// stampa abilitata per default
m.set(CG43_CHK_STAMPA,"X");
_month = m.get_int(CG43_LST_MESE);
build_ditte_sheet(all);
do
{
if ((k = m.run()) == K_ESC) break;
// handlers have set everything
_month = _what == quarter ? m.get_int(CG43_LST_TRIM) :
m.get_int(CG43_LST_MESE);
_year = m.get(CG43_FLD_ANNO);
_date = m.get(CG43_FLD_DATA);
_isprint = m.get_bool(CG43_CHK_STAMPA);
_recalc = (recalc)m.get_long(CG43_LST_CALC);
_printonly = m.get_bool(CG43_CHK_FINAL);
if (_isprint) printer().setdate(_date);
if (_printonly) _recalc = never;
// ------------------------------------------------
m.first_focus(k);
switch(k)
{
case DLG_SELECT:
_ditte->enable_check();
// seleziona e aggiungi alle gia' selezionate // seleziona e aggiungi alle gia' selezionate
if (_ditte->run() == K_ENTER) if (_ditte->run() == K_ENTER)
{ {
for (long j = 0l; j < _ditte->items(); j++) for (long j = 0l; j < _ditte->items(); j++)
{ _selected.set(j, _ditte->checked(j));
const long cod = _ditte->row(j).get_long(1); set_choice_limits(m);
for (int d = 0; d < _nomiditte.items(); d++) }
{
const long firm = ((TToken_string&)_nomiditte[d]).get_long(0);
if (firm == cod)
{
bool minchia = _ditte->checked(j);
_selected.set(d, _ditte->checked(j));
break;
}
}
#ifdef DBG
if (d >= _nomiditte.items())
yesnofatal_box("Non ritrovo piu' la ditta %ld", cod);
#endif
}
}
m.set(CG43_FLD_SELECTED, _selected.ones());
break; break;
case CG43_BUT_ANN: case CG43_BUT_ANN:
_selected.reset(); reset_choices(m);
m.reset(CG43_FLD_SELECTED);
break; break;
} }
} }
while (k != K_ENTER && k != K_ESC); while (k != K_ENTER && k != K_ESC);
return k == K_ENTER; return k == K_ENTER;
} }

View File

@ -160,7 +160,7 @@ class TLiquidazione_app : public TPrint_application
int _month; // mese da calcolare int _month; // mese da calcolare
TDate _date; // data di stampa TDate _date; // data di stampa
bool _isprint; // vuoi stampare o no? bool _isprint; // vuoi stampare o no?
bool _isfinal; // calcolo definitivo bool _printonly; // calcolo definitivo
recalc _recalc; // tipo ricalcolo scelto recalc _recalc; // tipo ricalcolo scelto
bool _isplafond; // plafond importatori abituali bool _isplafond; // plafond importatori abituali
bool _isvent; // ventilazione bool _isvent; // ventilazione
@ -260,8 +260,16 @@ class TLiquidazione_app : public TPrint_application
TRecfield* _lim_mese; TRecfield* _lim_mese;
protected: protected:
long select_firm_range(long from, long to, wht freq); long select_firm_range(long from, long to, wht freq);
static bool to_ditta_handler(TMask_field& f, KEY key);
static bool to_ditt_handler(TMask_field& f, KEY key);
static bool fr_ditt_handler(TMask_field& f, KEY key);
static bool to_butt_handler(TMask_field& f, KEY key);
static bool fr_butt_handler(TMask_field& f, KEY key);
static bool what_freq_handler(TMask_field& f, KEY key);
static TLiquidazione_app& app() { return (TLiquidazione_app&)main_app(); }
public: public:
@ -269,6 +277,13 @@ public:
virtual bool user_destroy(); virtual bool user_destroy();
virtual bool set_print(int i); virtual bool set_print(int i);
// cazzatelle per handlers
TArray_sheet* get_ditte_sheet() { return _ditte; }
TBit_array& get_selected() { return _selected; }
void build_ditte_sheet(wht);
void reset_choices(TMask&);
void set_choice_limits(TMask&);
bool set_liquidazione(); bool set_liquidazione();
bool recalc_all(); bool recalc_all();
@ -362,7 +377,7 @@ public:
_VentItem* look_ventilation(int m, const char* codreg); _VentItem* look_ventilation(int m, const char* codreg);
// tutti i controlli del mondo sui mesi da calcolare // tutti i controlli del mondo sui mesi da calcolare
bool is_trim (int x); static bool is_trim (int x);
bool is_month_ok (int x, int month = -1); bool is_month_ok (int x, int month = -1);
bool is_date_ok (TDate& d, int month); bool is_date_ok (TDate& d, int month);
bool is_first_month (int m); bool is_first_month (int m);

View File

@ -13,3 +13,5 @@
#define CG43_FLD_DTO 114 #define CG43_FLD_DTO 114
#define CG43_LST_CALC 115 #define CG43_LST_CALC 115
#define CG43_CHK_FINAL 116 #define CG43_CHK_FINAL 116
#define CG43_BUT_DFR 117
#define CG43_BUT_DTO 118

View File

@ -19,25 +19,25 @@ END
NUMBER CG43_FLD_DFR 5 NUMBER CG43_FLD_DFR 5
BEGIN BEGIN
PROMPT 24 2 "Da codice " PROMPT 24 2 "Da codice "
FLAGS "UR"
HELP "Codice ditta di partenza per la selezione" HELP "Codice ditta di partenza per la selezione"
USE LF_NDITTE KEY 1 END
DISPLAY "Codice" CODDITTA
DISPLAY "Ragione sociale@50" RAGSOC BUTTON CG43_BUT_DFR 2 1
DISPLAY "Vers" FREQVIVA BEGIN
OUTPUT CG43_FLD_DFR CODDITTA PROMPT 40 2 "*"
PICTURE 109
END END
NUMBER CG43_FLD_DTO 5 NUMBER CG43_FLD_DTO 5
BEGIN BEGIN
PROMPT 24 3 "A codice " PROMPT 24 3 "A codice "
FLAGS "UR"
HELP "Codice ditta di fine selezione" HELP "Codice ditta di fine selezione"
COPY USE CG43_FLD_DFR END
DISPLAY "Codice" CODDITTA
DISPLAY "Ragione sociale@50" RAGSOC BUTTON CG43_BUT_DTO 2 1
DISPLAY "Vers" FREQVIVA BEGIN
OUTPUT CG43_FLD_DTO CODDITTA PROMPT 40 3 "*"
PICTURE 109
END END
STRING CG43_FLD_SELECTED 5 STRING CG43_FLD_SELECTED 5
@ -60,23 +60,14 @@ BEGIN
MESSAGE EXIT,CG43_BUT_ANN MESSAGE EXIT,CG43_BUT_ANN
END END
/*
BUTTON CG43_BUT_CHK 8
BEGIN
PROMPT 50 4 "Verifica"
MESSAGE EXIT,CG43_BUT_CHK
END
*/
NUMBER CG43_FLD_ANNO 4 NUMBER CG43_FLD_ANNO 4
BEGIN BEGIN
PROMPT 30 7 "Anno " PROMPT 31 7 "Anno "
HELP "Anno per cui effettuare il calcolo" HELP "Anno per cui effettuare il calcolo"
FLAGS "A" FLAGS "A"
END END
LIST CG43_LST_MESE 13
LIST CG43_LST_MESE 10
BEGIN BEGIN
PROMPT 4 7 "Periodo " PROMPT 4 7 "Periodo "
HELP "Mese per cui effettuare il calcolo liquidazione" HELP "Mese per cui effettuare il calcolo liquidazione"
@ -84,7 +75,7 @@ BEGIN
FLAGS "AM" FLAGS "AM"
END END
LIST CG43_LST_TRIM 12 LIST CG43_LST_TRIM 13
BEGIN BEGIN
PROMPT 4 7 "Periodo " PROMPT 4 7 "Periodo "
HELP "Trimestre di cui effettuare il calcolo liquidazione" HELP "Trimestre di cui effettuare il calcolo liquidazione"
@ -123,7 +114,7 @@ END
DATE CG43_FLD_DATA DATE CG43_FLD_DATA
BEGIN BEGIN
PROMPT 16 11 "con data " PROMPT 15 11 "con data "
HELP "Data di stampa del prospetto delle liquidazioni" HELP "Data di stampa del prospetto delle liquidazioni"
FLAGS "A" FLAGS "A"
END END
@ -131,8 +122,10 @@ END
BOOLEAN CG43_CHK_FINAL BOOLEAN CG43_CHK_FINAL
BEGIN BEGIN
PROMPT 47 11 "Definitivo" PROMPT 47 11 "Solo stampa"
HELP "Indicare se la liquidazione e' registrata come definitiva" HELP "Indicare se si desidera la sola stampa delle liquidazioni calcolate"
MESSAGE TRUE DISABLE,CG43_LST_CALC
MESSAGE FALSE ENABLE,CG43_LST_CALC
END END

View File

@ -5,35 +5,40 @@
// ------------------------------------------------------------ // ------------------------------------------------------------
#include <progind.h> #include <progind.h>
#include <sheet.h>
#include "cg4300.h" #include "cg4300.h"
// -------------------- QUI comincia l'avventura -------------------------- // -------------------- QUI comincia l'avventura --------------------------
bool TLiquidazione_app::recalc_all() bool TLiquidazione_app::recalc_all()
{ {
_prind = new TProgind(_selected.ones()*2, _prind = new TProgind(_selected.ones()*2, _printonly ?
" Stampa liquidazione... \n"
" Preparazione archivi \n"
" " :
" Calcolo liquidazione... \n" " Calcolo liquidazione... \n"
" Preparazione archivi ", " Preparazione archivi \n"
" ",
TRUE,TRUE,45); TRUE,TRUE,45);
for (int l = 0; l < _nomiditte.items(); l++) for (int l = 0; l < _ditte->items(); l++)
{ {
if (_prind->iscancelled()) if (_prind->iscancelled())
break; break;
if (_selected[(long)l]) if (_selected[(long)l])
{ {
TToken_string& nomeditta = (TToken_string&)_nomiditte[l]; TToken_string& nomeditta = _ditte->row(l);
_nditte->zero(); _nditte->zero();
_nditte->curr().put("CODDITTA",nomeditta.get_long(0)); _nditte->curr().put("CODDITTA",nomeditta.get_long(1));
_nditte->read(); _nditte->read();
TApplication::set_firm(nomeditta.get_long(0)); TApplication::set_firm(nomeditta.get_long(1));
_prind->addstatus(1); _prind->addstatus(1);
// trimestrali impropriamente selezionate per mesi intermedi // trimestrali impropriamente selezionate per mesi intermedi
_freqviva = nomeditta.get(2); _freqviva = nomeditta.get(3);
if (!is_month_ok(_month)) continue; if (!is_month_ok(_month)) continue;
int need_refresh = FALSE; int need_refresh = FALSE;
@ -121,7 +126,8 @@ bool TLiquidazione_app::update_firm(int month, bool recalc)
// se diventa TRUE); // se diventa TRUE);
_mixed = FALSE; _mixed = FALSE;
sprintf (buf,"Calcolo liquidazioni (%d)...\n%s: %s", sprintf (buf, _printonly ? "Stampa liquidazione (%d)...\n%s: %s\n" :
"Calcolo liquidazione (%d)...\n%s: %s\n",
month, month,
(const char*)_nditte_r->get("RAGSOC"), (const char*)_nditte_r->get("RAGSOC"),
(const char*)desatt); (const char*)desatt);
@ -813,8 +819,6 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
_lim->put("R7",ris_cred); _lim->put("R7",ris_cred);
_lim->put("R8",ris_deb); _lim->put("R8",ris_deb);
_lim->put("B0","X"); _lim->put("B0","X");
if (_isfinal) _lim->put("B1","X");
_lim->rewrite(); _lim->rewrite();
if (month == 12) if (month == 12)