Patch level : 12.0

Files correlati     : fplib01.cpp, fp0700.cpp
Commento:

Aggiunte:
- Sistemati alcuni campi nel PAFW300, nello specifico: PW_TIPODOC, PW_TIPONUM
- Corretto un bug nell'invio integrazioni che stampava il rapportino di Campo anche se l'esportazione dell'integrazione non andava a buon fine

- (Fatto un po' di ordine in fplib01.cpp. nessuna logica modificata)
This commit is contained in:
smen 2022-07-26 12:00:32 +02:00
parent 554c93fc23
commit 38e125cfa9
2 changed files with 24 additions and 29 deletions

View File

@ -443,6 +443,7 @@ void TPAR_mask::export_paf()
const bool diagn = get_bool(F_DIAGN);
TReg_fp elab(EMPTY_STRING, !diagn);
TReport_book book;
bool err = false;
const TString8& reg_fisc = get(F_REG_FISC);
@ -475,7 +476,8 @@ void TPAR_mask::export_paf()
{
TString msg;
msg.format("La registrazione numero %ld non è stata esportata, continuare?", nreg);
msg.format("La registrazione numero %ld non e' stata esportata, continuare?", nreg);
err = true;
elab.log().log(2, msg);
if (!yesno_box(msg))
break;
@ -488,12 +490,13 @@ void TPAR_mask::export_paf()
TString msg;
msg.format("Errore durante il cambiamento di stato finale, potrebbero esser rimaste delle fatture in Pronto");
err = true;
elab.log().log(2, msg);
error_box(msg);
}
}
elab.show_log();
if (diagn)
if (diagn && !err)
{
print_reg();
}

View File

@ -701,12 +701,7 @@ TPaf_record::TPaf_record(const char* table) : _table(table), _key(15, ',')
constraint.rtrim(1);
constraint << 'Q';
// q << "SELECT col.[name] FROM sys.columns AS col \
// inner JOIN sys.index_columns AS idx on col.[object_id] = idx.[object_id] AND col.[column_id] = idx.[column_id] \
// inner join sys.indexes as K on idx.[index_id] = K.[index_id] \
// where K.[name] = '" << table << "_KEY' \
// AND idx.[object_id] = object_id('" << table << "') \
// ORDER BY index_column_id ASC";
q << "SELECT col.[name] FROM sys.columns AS col \
inner JOIN sys.index_columns AS idx on col.[object_id] = idx.[object_id] AND col.[column_id] = idx.[column_id] \
inner join sys.indexes as K on idx.[index_id] = K.[index_id] \
@ -2985,9 +2980,9 @@ TDoc_fp::~TDoc_fp()
| $$ | $$ \ $$| $$_____/| $$ | $$
| $$ | $$ | $$| $$$$$$$| $$$$$$$
|__/ |__/ |__/ \_______/ \____ $$
/$$ \ $$
| $$$$$$/
\______/
/$$ \ $$
| $$$$$$/
\______/
*/
bool TReg_fp::insert(TPaf_record& p, bool force)
@ -3564,11 +3559,6 @@ bool TReg_fp::reg_to_paf(const TMovimento_contabile& mov)
const TCodiceIVA& cod_iva = cached_codIVA(cod_aliquota);
const real aliquota = cod_iva.percentuale();
paf1800f.set("PI_NUMEROLINEA", (long)i);
//PI_TIPOCESSPREST CHAR(2) NOT NULL DEFAULT '', ci va?
//PI_DESCRIZIONE CHAR(100) NOT NULL DEFAULT '',
//PI_RIFAMMINISTR CHAR(20) NOT NULL DEFAULT '',
paf1800f.set("PI_DESCRIZIONE", descr);
paf1800f.set("PI_QUANTITA", 1l);
paf1800f.set("PI_PREZZOUNIT", rec_iva.get(RMI_IMPONIBILE));
@ -3595,8 +3585,8 @@ bool TReg_fp::reg_to_paf(const TMovimento_contabile& mov)
TPaf_record& pafw300f = _paf_container.get_paf("PAFW300F");
reset(pafw300f);
pafw300f.set("PW_TIPODOC", ""); //TODO PASSARE IL TIPO DOCUMENTO DELLA MASK NEL COSTRUTTORE
pafw300f.set("PW_TIPONUM", ""); //TODO COSA CI METTIAMO NEL TIPO NUM
pafw300f.set("PW_TIPODOC", _tipo_doc_sdi);
pafw300f.set("PW_TIPONUM", caus.reg().name()); //TODO COSA CI METTIAMO NEL TIPO NUM ava
pafw300f.set("PW_NUMERO", mov.get(MOV_NUMDOC));
pafw300f.set("PW_DATA", mov.get_date(MOV_DATADOC));
pafw300f.set("PW_CDEST", _coddest);
@ -3613,6 +3603,8 @@ bool TReg_fp::reg_to_paf(const TMovimento_contabile& mov)
else
pafw300f.set("PW_RAGSOC", fornitore.ragione_sociale().left(35));
pafw300f.set("PW_IMPO", mov.get_real(MOV_TOTDOC)); //TODO controllare ?????
pafw300f.set("PW_CXML", "");
pafw300f.set("PW_CXMLP", "");
pafw300f.set("PW_UPAG", "");
ok &= insert(pafw300f);
return _to_commit = (ok && save_paf());
@ -3625,7 +3617,17 @@ bool TReg_fp::reg_to_paf(long n_mov)
return reg_to_paf(mov);
}
//NON LE CAPISCO
bool TReg_fp::show_log()
{
TReport_book b;
TFilename name = "fp_err.log";
b.add(_log);
b.export_text(name);
return _log.preview();
}
//COSTRUTTORI E DISTRUTTORI
TReg_fp::TReg_fp(const char* tipo_doc_sdi, bool definitivo) : _cache_insert(false) , _tipo_doc_sdi(tipo_doc_sdi), _definitivo(definitivo)
{
@ -3656,13 +3658,3 @@ TReg_fp::~TReg_fp()
{
commit();
}
bool TReg_fp::show_log()
{
TReport_book b;
TFilename name = "fp_err.log";
b.add(_log);
b.export_text(name);
return _log.preview();
}