Patch level : 12.0 876
Files correlati : fp0.exe Commento : - Corretta contabilizzazione per note credito (monitor passive) - Pulizia codice
This commit is contained in:
parent
71b865074d
commit
7cfb0e6b29
@ -45,7 +45,7 @@ class TPassive_mask : public TAutomask
|
||||
char esigibilita;
|
||||
};
|
||||
|
||||
TLog_report* _log;
|
||||
TLog_report* _log{};
|
||||
bool _f1;
|
||||
|
||||
protected:
|
||||
@ -61,35 +61,35 @@ protected:
|
||||
|
||||
static bool clifo_handler(TMask_field& f, KEY key);
|
||||
void set_filter_changed();
|
||||
void select_all(int sheet_field);
|
||||
void select_all(int sheet_field) const;
|
||||
|
||||
// Tasto nuovo: apre nuovo fornitore valorizzando già i dati dalla fattura
|
||||
void new_forn();
|
||||
// Tasto aggiorna: aggiorna cliente che non corrisponde.
|
||||
bool aggiorna_forn();
|
||||
void salva_for() const;
|
||||
void clean_ini(const TString& filename) const;
|
||||
void run_cg0(const TString& filename) const;
|
||||
static void clean_ini(const TString& filename);
|
||||
static void run_cg0(const TString& filename);
|
||||
void elenco_prots_sel(TString& string) const;
|
||||
|
||||
static vector<iva>& get_righe_iva(TToken_string& keys);
|
||||
real calcola_importo(vector<iva> riva) const;
|
||||
static real calcola_importo(vector<iva> riva);
|
||||
// Gestione F1
|
||||
int prepara_contab() const;
|
||||
void log_contab();
|
||||
void log_contab() const;
|
||||
int check_err() const;
|
||||
void contabilizza();
|
||||
TDate load_data() const;
|
||||
bool is_doc_split(const vector<iva>& riva) const;
|
||||
static bool is_doc_split(const vector<iva>& riva);
|
||||
const TString& get_tot_imp_riva(const vector<iva>& riva) const;
|
||||
// Handlers
|
||||
static bool causfa_handler(TMask_field& f, KEY k);
|
||||
|
||||
void fattsel(int dlg, TField_event& e);
|
||||
// Non permette la selezione multipla delle righe
|
||||
void sel();
|
||||
void sel() const;
|
||||
bool on_field_event(TOperable_field& o, TField_event e, long jolly) override;
|
||||
void check_buttons(int p);
|
||||
void check_buttons(int p) const;
|
||||
void next_page(int p) override;
|
||||
// Elenco dei protocolli selezionati
|
||||
|
||||
@ -99,12 +99,12 @@ protected:
|
||||
void aggiungi_riga(TLocalisamfile& clifo, TSheet_field& sf, TSheet_field& sf_err);
|
||||
// Aggiunge i protocolli che sono già presenti per le fatture nel db alla tabellina per il filtro
|
||||
void aggiungi_prot() const;
|
||||
void init();
|
||||
void init() const;
|
||||
|
||||
public:
|
||||
TString& get_fattsel() const;
|
||||
|
||||
void auto_assoc();
|
||||
static void auto_assoc();
|
||||
TPassive_mask(bool f1);
|
||||
};
|
||||
|
||||
@ -174,7 +174,7 @@ void TPassive_mask::fill()
|
||||
|
||||
TDate dal;
|
||||
TDate al;
|
||||
const TString& filter_elab = get_fattsel();
|
||||
//const TString& filter_elab = get_fattsel();
|
||||
const TDate reg_dal(get(F_DATAINI));
|
||||
const TDate reg_al(get(F_DATAEND));
|
||||
const TString& ordin = get(F_FATTORD);
|
||||
@ -273,7 +273,7 @@ vector<TPassive_mask::iva>& TPassive_mask::get_righe_iva(TToken_string& keys)
|
||||
return riva;
|
||||
}
|
||||
|
||||
real TPassive_mask::calcola_importo(vector<iva> riva) const
|
||||
real TPassive_mask::calcola_importo(vector<iva> riva)
|
||||
{
|
||||
real tot = ZERO;
|
||||
for(auto it = riva.begin(); it != riva.end(); ++it)
|
||||
@ -452,7 +452,7 @@ void TPassive_mask::auto_assoc()
|
||||
clifo.zero();
|
||||
clifo.put(CLI_TIPOCF, "F");
|
||||
|
||||
int for_cod = find_fornitore(clifo);
|
||||
const int for_cod = find_fornitore(clifo);
|
||||
if(for_cod > 0)
|
||||
{
|
||||
static TString update;
|
||||
@ -466,11 +466,11 @@ void TPassive_mask::auto_assoc()
|
||||
|
||||
int TPassive_mask::find_fornitore(TLocalisamfile& clifo)
|
||||
{
|
||||
TString paa_codfisc = fp_db().sq_get("COD_FISC");
|
||||
const TString paa_codfisc = fp_db().sq_get("COD_FISC");
|
||||
const TString paa_piva = fp_db().sq_get("P_IVA");
|
||||
TString paa_codpaese = fp_db().sq_get("COD_PAESE");
|
||||
const TString paa_codpaese = fp_db().sq_get("COD_PAESE");
|
||||
const TString fppro_tipocf = fp_db().sq_get("TIPO_CF");
|
||||
TString fppro_codcf = fp_db().sq_get("COD_CLIFOR");
|
||||
const TString fppro_codcf = fp_db().sq_get("COD_CLIFOR");
|
||||
|
||||
// Cerco se il fornitore è presente in Campo
|
||||
int found_clifo = -1;
|
||||
@ -538,7 +538,7 @@ int TPassive_mask::find_fornitore(TLocalisamfile& clifo)
|
||||
return found_clifo;
|
||||
}
|
||||
|
||||
void TPassive_mask::init()
|
||||
void TPassive_mask::init() const
|
||||
{
|
||||
aggiungi_prot();
|
||||
}
|
||||
@ -562,7 +562,7 @@ bool TPassive_mask::causfa_handler(TMask_field& f, KEY k)
|
||||
return true;
|
||||
}
|
||||
|
||||
void TPassive_mask::select_all(const int sheet_field)
|
||||
void TPassive_mask::select_all(const int sheet_field) const
|
||||
{
|
||||
TSheet_field& docs = sfield((short)sheet_field);
|
||||
TString_array& sht = docs.rows_array();
|
||||
@ -587,8 +587,6 @@ void TPassive_mask::salva_for() const
|
||||
sf.hide();
|
||||
FOR_EACH_SHEET_ROW(sf, nr, row)
|
||||
{
|
||||
if (row->starts_with("X") && strcmp(clifo.get(CLI_CODCF), "17") == 0)
|
||||
bool simo = true;
|
||||
TString cod_forn = row->get(sf.cid2index(S_FORNITORE));
|
||||
if(row->starts_with("X") && !cod_forn.empty())
|
||||
{
|
||||
@ -618,7 +616,7 @@ void TPassive_mask::salva_for() const
|
||||
}
|
||||
}
|
||||
|
||||
void TPassive_mask::clean_ini(const TString& filename) const
|
||||
void TPassive_mask::clean_ini(const TString& filename)
|
||||
{
|
||||
static TString remove_string;
|
||||
#ifdef DBG
|
||||
@ -629,7 +627,7 @@ void TPassive_mask::clean_ini(const TString& filename) const
|
||||
remove_files(remove_string, false);
|
||||
}
|
||||
|
||||
void TPassive_mask::run_cg0(const TString& filename) const
|
||||
void TPassive_mask::run_cg0(const TString& filename)
|
||||
{
|
||||
static TString run_string;
|
||||
#ifdef DBG
|
||||
@ -714,8 +712,8 @@ int TPassive_mask::prepara_contab() const
|
||||
for (auto it = riva.begin(); it != riva.end(); ++it)
|
||||
{
|
||||
contab_ini.set_paragraph(LF_RMOVIVA, i);
|
||||
contab_ini.set("IMPONIBILE", it->imponibile.string());
|
||||
contab_ini.set("IMPOSTA", it->imposta.string());
|
||||
contab_ini.set("IMPONIBILE", abs(it->imponibile).string());
|
||||
contab_ini.set("IMPOSTA", abs(it->imposta).string());
|
||||
contab_ini.set("PERCIVA", it->aliquota.string());
|
||||
contab_ini.set("NATURA", it->natura);
|
||||
contab_ini.set("NRIGA", i);
|
||||
@ -753,7 +751,7 @@ int TPassive_mask::prepara_contab() const
|
||||
return is_ready;
|
||||
}
|
||||
|
||||
void TPassive_mask::log_contab()
|
||||
void TPassive_mask::log_contab() const
|
||||
{
|
||||
TFilename cg_ini;
|
||||
TString msg;
|
||||
@ -889,7 +887,7 @@ TDate TPassive_mask::load_data() const
|
||||
return start_date;
|
||||
}
|
||||
|
||||
bool TPassive_mask::is_doc_split(const vector<iva>& riva) const
|
||||
bool TPassive_mask::is_doc_split(const vector<iva>& riva)
|
||||
{
|
||||
for (iva const& riga : riva)
|
||||
{
|
||||
@ -1065,7 +1063,7 @@ void TPassive_mask::fattsel(const int dlg, TField_event& e)
|
||||
field(F_DATAENDREG).enable(get_bool(F_CONTABIL));
|
||||
}
|
||||
|
||||
void TPassive_mask::sel()
|
||||
void TPassive_mask::sel() const
|
||||
{
|
||||
TSheet_field& sf = sfield(F_DOCS);
|
||||
FOR_EACH_SHEET_ROW(sf, nr, row)
|
||||
@ -1158,7 +1156,7 @@ bool TPassive_mask::on_field_event(TOperable_field& o, TField_event e, long joll
|
||||
case F_ENABLEFORN:
|
||||
if(e == fe_modify)
|
||||
{
|
||||
bool en = o.get() == "X";
|
||||
const bool en = o.get() == "X";
|
||||
field(F_FORNITORE).enable(en);
|
||||
field(F_RAGSOC).enable(en);
|
||||
field(F_PARIVA).enable(en);
|
||||
@ -1176,7 +1174,7 @@ bool TPassive_mask::on_field_event(TOperable_field& o, TField_event e, long joll
|
||||
return true;
|
||||
}
|
||||
|
||||
void TPassive_mask::check_buttons(const int p)
|
||||
void TPassive_mask::check_buttons(const int p) const
|
||||
{
|
||||
const TString& fattsel = get_fattsel();
|
||||
const bool err_forn = fattsel.empty() || fattsel == FILTER_ALL;
|
||||
@ -1215,7 +1213,7 @@ class TPassive_app : public TSkeleton_application
|
||||
{
|
||||
void load_mask(const TPassive_mask& mask) const;
|
||||
bool check_f1() const;
|
||||
void save_field(const TPassive_mask& mask);
|
||||
void save_field(const TPassive_mask& mask) const;
|
||||
|
||||
public:
|
||||
void main_loop() override;
|
||||
@ -1252,7 +1250,7 @@ bool TPassive_app::check_f1() const
|
||||
return has_module(F1AUT);
|
||||
}
|
||||
|
||||
void TPassive_app::save_field(const TPassive_mask& mask)
|
||||
void TPassive_app::save_field(const TPassive_mask& mask) const
|
||||
{
|
||||
if (check_f1())
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user