Patch level : 12.0 892
Files correlati : fp0.exe Commento : Sistemato creazione ddt per fatturazione differita lavanderie
This commit is contained in:
parent
40c91254f9
commit
afa0d40b1d
@ -552,7 +552,7 @@ protected:
|
||||
//void set_rec_clifo(char tipocf, long codcf);
|
||||
|
||||
public:
|
||||
static void fill_buoni(map<TString20, TFPBuono_di_consegna>& buoni, const TString& memo);
|
||||
static void fill_buoni(map<TString20, TFPBuono_di_consegna>& buoni, const TString& memo, bool last = false);
|
||||
bool doc_to_paf(TDocumentoEsteso& doc);
|
||||
bool doc_to_paf(const TRectype& rec);
|
||||
bool doc_to_paf(const TDoc_key& key);
|
||||
|
@ -133,7 +133,7 @@ bool check_tables()
|
||||
s.erase(0, limiter);
|
||||
if(!fp_db().sq_set_exec(query) || !fp_db().sq_commit())
|
||||
{
|
||||
fatal_box("Impossibile eseguire/salvare la query:\n%s\n%s", query.c_str(), fp_db().sq_get_token_text_error(1));
|
||||
fatal_box("Impossibile eseguire/salvare la query:\n%s\n%s", query.c_str(), fp_db().sq_get_token_text_error(0, false));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1427,9 +1427,11 @@ bool TDoc_fp::export_paf3200f()
|
||||
return true;
|
||||
}
|
||||
|
||||
void TDoc_fp::fill_buoni(map<TString20, TFPBuono_di_consegna>& buoni, const TString& memo)
|
||||
void TDoc_fp::fill_buoni(map<TString20, TFPBuono_di_consegna>& buoni, const TString& memo, bool last)
|
||||
{
|
||||
if (memo.full())
|
||||
{
|
||||
if (!last) // Prima riga
|
||||
{
|
||||
TToken_string b(memo, 'n');
|
||||
for (int i = 4; i < b.items(); i++)
|
||||
@ -1443,6 +1445,21 @@ void TDoc_fp::fill_buoni(map<TString20, TFPBuono_di_consegna>& buoni, const TStr
|
||||
buoni.insert({ buono._numdoc, buono });
|
||||
}
|
||||
}
|
||||
else // Ultima riga
|
||||
{
|
||||
TToken_string b(memo, '\n');
|
||||
// "Buono di consegna n. 1997 del 10-10-2019"
|
||||
for (int i = 0; i < b.items(); ++i)
|
||||
{
|
||||
TToken_string str(b.get(i), ' ');
|
||||
str.replace(" ", " ");
|
||||
TString20 ndoc = str.get(4);
|
||||
TDate data(str.get(6));
|
||||
TFPBuono_di_consegna buono(ndoc, data);
|
||||
buoni.insert({ buono._numdoc, buono });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
||||
@ -1712,6 +1729,7 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
||||
TPaf_record& paf3000f = _paf_container.get_paf("PAF3000F");
|
||||
long riga = 1;
|
||||
bool f_buonocons = false;
|
||||
bool first_row = false;
|
||||
map<TString20, TDate> ancestors_s;
|
||||
TString riga_buoni_cons;
|
||||
FOR_EACH_PHYSICAL_FPRDOC(doc, r, rdoc)
|
||||
@ -1727,13 +1745,14 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
||||
const TString& descrizione_riga = descrizione(*rdoc);
|
||||
if (descrizione_riga.empty())
|
||||
continue;
|
||||
if (!f_buonocons && descrizione_riga.starts_with("Buono di consegna n. "))
|
||||
if (!f_buonocons && descrizione_riga.starts_with("Buono di consegna"))
|
||||
{
|
||||
TString memo; memo << rdoc->get(RDOC_DESCR);
|
||||
if (rdoc->get_bool(RDOC_DESCLUNGA))
|
||||
memo << rdoc->get(RDOC_DESCEST);
|
||||
riga_buoni_cons = memo;
|
||||
f_buonocons = true;
|
||||
first_row = r == 0;
|
||||
continue;
|
||||
}
|
||||
reset(paf3000f);
|
||||
@ -1979,7 +1998,7 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
||||
if (memo.full())
|
||||
{
|
||||
map<TString20, TFPBuono_di_consegna> buoni;
|
||||
fill_buoni(buoni, memo);
|
||||
fill_buoni(buoni, memo, !first_row);
|
||||
paf1600f.set("PF_RIFNUMLINEA", "0");
|
||||
FOR_EACH_BUONI(buoni, n, buono)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user