Patch level : 12.0
Files correlati : f9 Commento: - corretto bug nel monitor delle fatture passive. il file ini che veniva creato per la contabilizzazione della fattura aveva un nome sbagliato. DA TESTARE LA CONTABILIZZAZIONE MULTIPLA
This commit is contained in:
parent
3638037402
commit
04e332e94c
@ -388,7 +388,7 @@ const char* get_ini_codcaus()
|
||||
|
||||
const char* get_codcaus(const char * tipodoc, long codcf)
|
||||
{
|
||||
TCli_for f = cached_clifor('F', codcf);
|
||||
const TCli_for & f = cached_clifor('F', codcf);
|
||||
const bool nc = TString(tipodoc) == "TD04";
|
||||
|
||||
if (nc)
|
||||
@ -491,8 +491,12 @@ bool check_caus_has_rit(const TString& cod_caus, int year)
|
||||
void run_cont_ini(bool liq)
|
||||
{
|
||||
TString cmd;
|
||||
TFilename ininame;
|
||||
|
||||
cmd.cut(0) << "cg2 -0 -i" << TFilename().temp("cg2CONTAB", "ini") << " -f1" << (liq ? " -liq" : " ") << " /u" << user();
|
||||
ininame.tempdir();
|
||||
ininame.add(F1_INIREGCONT);
|
||||
ininame<< "*.ini";
|
||||
cmd.cut(0) << "cg2 -0 -i" << ininame << " -f1" << (liq ? " -liq" : " ") << " /u" << user();
|
||||
|
||||
TExternal_app app(cmd);
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
#define FILE_CONFIG CONFIG_DITTA
|
||||
#define FILE_SECTION "f1"
|
||||
#define F1_INIREGCONT "cgreg"
|
||||
#define F1_INIREGCONT "cg2_"
|
||||
#define F1_CAUS "caus"
|
||||
#define LOG_MSG 0
|
||||
#define LOG_WARN 1
|
||||
|
@ -622,23 +622,19 @@ void TPassive_mask::salva_for() const
|
||||
|
||||
void TPassive_mask::clean_ini(const TString& filename) const
|
||||
{
|
||||
static TString remove_string;
|
||||
#ifdef DBG
|
||||
remove_string.cut(0) << filename << "*.ini";
|
||||
#else
|
||||
remove_string.cut(0) << _tmp_dir << "\\" << filename << "*.ini";
|
||||
#endif
|
||||
TFilename remove_string;
|
||||
|
||||
remove_string.tempdir();
|
||||
remove_string.add(filename);
|
||||
remove_string << "*.ini";
|
||||
remove_files(remove_string, false);
|
||||
}
|
||||
|
||||
void TPassive_mask::run_cg0(const TString& filename) const
|
||||
{
|
||||
static TString run_string;
|
||||
#ifdef DBG
|
||||
|
||||
run_string.cut(0) << "cg0 -1 -i" << filename << "*.ini" << " /u" << user();
|
||||
#else
|
||||
run_string.cut(0) << "cg0 -1 -i" << _tmp_dir << "\\" << filename << "*.ini" << " /u" << user();
|
||||
#endif
|
||||
TExternal_app(run_string).run();
|
||||
}
|
||||
|
||||
@ -655,19 +651,18 @@ int TPassive_mask::prepara_contab() const
|
||||
|
||||
int n_sel = 0;
|
||||
TSheet_field& sf = sfield(F_DOCS);
|
||||
sf.hide();
|
||||
|
||||
clean_ini(F1_INIREGCONT);
|
||||
|
||||
FOR_EACH_SHEET_ROW(sf, n, row)
|
||||
FOR_EACH_SHEET_ROW_LOOP(sf, row)
|
||||
{
|
||||
if (row->starts_with("X"))
|
||||
if (sf.get_bool_row_cell(row, S_SELECTED))
|
||||
{
|
||||
TString prokeys = row->get(sf.cid2index(S_PROKEY));
|
||||
TString prokeys =sf.get_str_row_cell(row, S_PROKEY);
|
||||
TToken_string keys(prokeys, ';');
|
||||
const TString codcaus(get_codcaus(row->get(cid2index(S_TIPODOCSDI)), row->get_long(cid2index(S_FORNITORE))));
|
||||
const TString codcaus(get_codcaus(sf.get_str_row_cell(row, S_TIPODOCSDI), sf.get_long_row_cell(row, S_FORNITORE)));
|
||||
|
||||
TString tipodoc(row->get(sf.cid2index(S_TIPODOCSDI)));
|
||||
TString tipodoc(sf.get_str_row_cell(row, S_TIPODOCSDI));
|
||||
if (tipodoc == "TD01" && !check_causale(codcaus, "FA", true))
|
||||
if (!yesno_box("Attenzione, per un documento di tipo TD01 e' stata selezionata \nuna causale diversa da Fattura d'Acquisto.\nProcedere lo stesso con l'esportazione?"))
|
||||
continue;
|
||||
@ -677,40 +672,40 @@ int TPassive_mask::prepara_contab() const
|
||||
n_sel++;
|
||||
|
||||
vector<iva>& riva = get_righe_iva(keys);
|
||||
TString num; num.format("%04d", n);
|
||||
TString num; num.format("%04d", row);
|
||||
TFilename newf_ini;
|
||||
#ifndef DBG
|
||||
newf_ini.tempdir() << "\\" << F1_INIREGCONT << num << ".ini";
|
||||
#else
|
||||
newf_ini << F1_INIREGCONT << num << ".ini";
|
||||
#endif
|
||||
TConfig contab_ini(newf_ini, "Transaction");
|
||||
|
||||
newf_ini.temp(F1_INIREGCONT, "ini");
|
||||
|
||||
TConfig contab_ini(newf_ini, "Transaction");
|
||||
contab_ini.set("Action", "INSERT");
|
||||
|
||||
// Esporto dati di testata
|
||||
contab_ini.set_paragraph(LF_MOV); // [23]
|
||||
contab_ini.set("CODCAUS", codcaus);
|
||||
contab_ini.set("CODCF", row->get(sf.cid2index(S_FORNITORE)));
|
||||
contab_ini.set("CODCF", sf.get_long_row_cell(row, S_FORNITORE));
|
||||
|
||||
TDate datareg;
|
||||
|
||||
if (get_bool(F_USEDATARIC))
|
||||
datareg = TDate(row->get(sf.cid2index(S_DATARIC)));
|
||||
datareg = sf.get_date_row_cell(row, S_DATARIC);
|
||||
else
|
||||
datareg = !get(F_DATAREGDIF).empty() ? TDate(get(F_DATAREGDIF)) : TDate(TODAY);
|
||||
datareg = get(F_DATAREGDIF).full() ? get_date(F_DATAREGDIF) : today;
|
||||
contab_ini.set("DATAREG", datareg);
|
||||
contab_ini.set("DATACOMP", datareg);
|
||||
contab_ini.set("DATADOC", row->get(sf.cid2index(S_DATADOC)));
|
||||
contab_ini.set("NUMDOCEXT", row->get(sf.cid2index(S_NDOC)));
|
||||
contab_ini.set("NUMDOC", TString(row->get(sf.cid2index(S_NDOC))).right(7));
|
||||
TString totdoc = row->get(sf.cid2index(S_TOTDOC));
|
||||
if (totdoc.empty())
|
||||
{
|
||||
real imp = calcola_importo(riva);
|
||||
totdoc.cut(0) << imp;
|
||||
}
|
||||
contab_ini.set("DATADOC", sf.get_date_row_cell(row, S_DATADOC));
|
||||
contab_ini.set("NUMDOCEXT", sf.get_str_row_cell(row, S_NDOC));
|
||||
contab_ini.set("NUMDOC", TString(sf.get_str_row_cell(row, S_NDOC)).right(7));
|
||||
|
||||
real totdoc = sf.get_real_row_cell(row, S_TOTDOC);
|
||||
if (totdoc == ZERO)
|
||||
totdoc = calcola_importo(riva);
|
||||
|
||||
real rit = fppro_db().set_keys(keys).get_ritenute();
|
||||
|
||||
if (rit != ZERO)
|
||||
{
|
||||
contab_ini.set("TOTDOC", (abs(real(totdoc)) - rit).string());
|
||||
contab_ini.set("TOTDOC", (abs(totdoc) - rit).string());
|
||||
contab_ini.set("RITFIS", rit.string());
|
||||
}
|
||||
else if (is_doc_split(riva)) // Documento con split
|
||||
@ -719,7 +714,7 @@ int TPassive_mask::prepara_contab() const
|
||||
}
|
||||
else
|
||||
{
|
||||
contab_ini.set("TOTDOC", abs(real(totdoc)).string());
|
||||
contab_ini.set("TOTDOC", abs(totdoc).string());
|
||||
}
|
||||
contab_ini.set("KEYFPPRO", prokeys);
|
||||
|
||||
@ -778,14 +773,12 @@ int TPassive_mask::prepara_contab() const
|
||||
contab_ini.set(TString("DATADOC(") << j << ")", fp_db().sq_get("DATADOC"));
|
||||
}
|
||||
}
|
||||
|
||||
row->add("", 0);
|
||||
sf.set_row_cell(S_SELECTED, false, row);
|
||||
break; // Chiudo subito tanto se ne può selezionare solo una alla volta
|
||||
}
|
||||
}
|
||||
|
||||
sf.force_update();
|
||||
sf.show();
|
||||
|
||||
if (n_sel == 0)
|
||||
return no_selected;
|
||||
@ -860,17 +853,18 @@ void TPassive_mask::log_contab() const
|
||||
int TPassive_mask::check_err() const
|
||||
{
|
||||
TSheet_field& sf = sfield(F_DOCS);
|
||||
FOR_EACH_SHEET_ROW(sf, nr, row)
|
||||
|
||||
FOR_EACH_SHEET_ROW_LOOP(sf,row)
|
||||
{
|
||||
if (row->starts_with("X"))
|
||||
if (sf.get_bool_row_cell(row, S_SELECTED))
|
||||
{
|
||||
TString codcaus(get_codcaus(row->get(cid2index(S_TIPODOCSDI)), row->get_long(cid2index(S_FORNITORE))));
|
||||
if (codcaus.empty())
|
||||
TString codcaus(get_codcaus(sf.get_str_row_cell(row, S_TIPODOCSDI), sf.get_long_row_cell(row, S_FORNITORE)));
|
||||
if (codcaus.blank())
|
||||
return no_codcaus;
|
||||
if (TString(row->get(cid2index(S_FORNITORE))).empty())
|
||||
if (TString(sf.get_str_row_cell(row, S_FORNITORE)).blank())
|
||||
return forn_err;
|
||||
if (!TString(row->get(cid2index(S_NUMREGCONT))).empty())
|
||||
return nr + 1000;
|
||||
if (sf.get_long_row_cell(row, S_NUMREGCONT) != 0L)
|
||||
return row + 1000;
|
||||
}
|
||||
}
|
||||
return no_err;
|
||||
@ -1303,7 +1297,7 @@ void TPassive_mask::check_buttons(const int p) const
|
||||
|
||||
TPassive_mask::TPassive_mask(bool f1) : TAutomask("fp0400a"), _f1(f1), _filter_changed(true)
|
||||
{
|
||||
_tmp_dir = _tmp_dir.tempdir();
|
||||
// _tmp_dir = _tmp_dir.tempdir();
|
||||
TMask::set_handler(F_CAUSFA, causfa_handler);
|
||||
TMask::set_handler(F_FORNITORE, clifo_handler);
|
||||
auto_assoc();
|
||||
|
Loading…
x
Reference in New Issue
Block a user