Patch level : 10.0
Files correlati : ps0713 Ricompilazione Demo : [ ] Commento : Correzioni git-svn-id: svn://10.65.10.50/trunk@20550 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
c3e1c6665b
commit
57a09a50cb
@ -60,7 +60,7 @@ protected:
|
|||||||
public:
|
public:
|
||||||
virtual void main_loop();
|
virtual void main_loop();
|
||||||
long genera_movcg();
|
long genera_movcg();
|
||||||
void genera_movana(const long numreg, TAssoc_array& righean);
|
void genera_movana(const long numreg, const TDate& datareg, TAssoc_array& righean);
|
||||||
bool transfer();
|
bool transfer();
|
||||||
|
|
||||||
TImporta_spese_app() {};
|
TImporta_spese_app() {};
|
||||||
@ -70,7 +70,7 @@ const char* const nomeini = "ps0713500ats.ini";
|
|||||||
|
|
||||||
void TImporta_spese_app::chiudi_movimento(TConfig& configfile, TImporto& tot_doc, TDate& data, const long numreg, TAssoc_array& righean)
|
void TImporta_spese_app::chiudi_movimento(TConfig& configfile, TImporto& tot_doc, TDate& data, const long numreg, TAssoc_array& righean)
|
||||||
{
|
{
|
||||||
genera_movana(numreg, righean);
|
genera_movana(numreg, data, righean);
|
||||||
//aggiungo i campi che mancano in testata
|
//aggiungo i campi che mancano in testata
|
||||||
configfile.set_paragraph("23");
|
configfile.set_paragraph("23");
|
||||||
configfile.set(MOV_DATAREG, data);
|
configfile.set(MOV_DATAREG, data);
|
||||||
@ -84,7 +84,8 @@ void TImporta_spese_app::chiudi_movimento(TConfig& configfile, TImporto& tot_doc
|
|||||||
paragraph.format("%d,%d",LF_RMOV,1);
|
paragraph.format("%d,%d",LF_RMOV,1);
|
||||||
configfile.set_paragraph(paragraph);
|
configfile.set_paragraph(paragraph);
|
||||||
configfile.set(RMV_IMPORTO,tot_doc.valore().string());
|
configfile.set(RMV_IMPORTO,tot_doc.valore().string());
|
||||||
configfile.set(RMV_SEZIONE,tot_doc.sezione());
|
TString4 strsez; strsez << tot_doc.sezione();
|
||||||
|
configfile.set(RMV_SEZIONE, strsez);
|
||||||
|
|
||||||
configfile.set_paragraph("Transaction");
|
configfile.set_paragraph("Transaction");
|
||||||
|
|
||||||
@ -112,11 +113,10 @@ long TImporta_spese_app::genera_movcg()
|
|||||||
return numreg;
|
return numreg;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TImporta_spese_app::genera_movana(const long numreg, TAssoc_array& righean)
|
void TImporta_spese_app::genera_movana(const long numreg, const TDate& datareg, TAssoc_array& righean)
|
||||||
{
|
{
|
||||||
TProgind pi(righean.items(), "Importazione analitica in corso...", true, true);
|
TProgind pi(righean.items(), "Importazione analitica in corso...", true, true);
|
||||||
|
|
||||||
const TDate datareg(TODAY);
|
|
||||||
const int anno = datareg.year();
|
const int anno = datareg.year();
|
||||||
|
|
||||||
TToken_string key;
|
TToken_string key;
|
||||||
@ -135,6 +135,8 @@ void TImporta_spese_app::genera_movana(const long numreg, TAssoc_array& righean)
|
|||||||
anmo.put(MOVANA_CODCAUS, _msk->get(F_CODCAU));
|
anmo.put(MOVANA_CODCAUS, _msk->get(F_CODCAU));
|
||||||
anmo.put(MOVANA_ANNOES, anno);
|
anmo.put(MOVANA_ANNOES, anno);
|
||||||
|
|
||||||
|
real totdoc = ZERO;
|
||||||
|
|
||||||
//per ogni oggetto dell'assoc_array, creo una riga di analitica
|
//per ogni oggetto dell'assoc_array, creo una riga di analitica
|
||||||
FOR_EACH_ASSOC_OBJECT(righean, obj, keyar, itm)
|
FOR_EACH_ASSOC_OBJECT(righean, obj, keyar, itm)
|
||||||
{
|
{
|
||||||
@ -149,6 +151,7 @@ void TImporta_spese_app::genera_movana(const long numreg, TAssoc_array& righean)
|
|||||||
TString80 codconto; codconto << grup << cont << sotc;
|
TString80 codconto; codconto << grup << cont << sotc;
|
||||||
|
|
||||||
real& imp = *(real*)itm; imp.round(2);
|
real& imp = *(real*)itm; imp.round(2);
|
||||||
|
totdoc += imp;
|
||||||
|
|
||||||
if (!imp.is_zero())
|
if (!imp.is_zero())
|
||||||
{
|
{
|
||||||
@ -165,6 +168,10 @@ void TImporta_spese_app::genera_movana(const long numreg, TAssoc_array& righean)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TImporto totale('D', totdoc);
|
||||||
|
anmo.put(MOVANA_TOTDOC, totale.valore().string());
|
||||||
|
anmo.put(MOVANA_SEZIONE, totale.sezione());
|
||||||
|
|
||||||
TLocalisamfile fmov(LF_MOVANA);
|
TLocalisamfile fmov(LF_MOVANA);
|
||||||
anmo.write(fmov);
|
anmo.write(fmov);
|
||||||
}
|
}
|
||||||
@ -180,6 +187,7 @@ bool TImporta_spese_app::transfer()
|
|||||||
|
|
||||||
xvt_fsys_removefile(nomeini);
|
xvt_fsys_removefile(nomeini);
|
||||||
TConfig configfile (nomeini, "Transaction"); //setto il paragrafo [Transaction] del file ini
|
TConfig configfile (nomeini, "Transaction"); //setto il paragrafo [Transaction] del file ini
|
||||||
|
const TConfig conf(nomeini, "Transaction");
|
||||||
|
|
||||||
TDate dataold, data;
|
TDate dataold, data;
|
||||||
|
|
||||||
@ -242,13 +250,14 @@ bool TImporta_spese_app::transfer()
|
|||||||
TFilename filename(nomeini);
|
TFilename filename(nomeini);
|
||||||
filename.fremove();
|
filename.fremove();
|
||||||
|
|
||||||
|
configfile = conf;
|
||||||
configfile.set_paragraph("Transaction");
|
configfile.set_paragraph("Transaction");
|
||||||
configfile.set("Action","MODIFY");
|
configfile.set("Action","INSERT");
|
||||||
configfile.set("Mode","AUTO");
|
configfile.set("Mode","AUTO");
|
||||||
|
|
||||||
configfile.set_paragraph("23"); //setto il paragrafo [23] del file ini (testata)
|
configfile.set_paragraph("23"); //setto il paragrafo [23] del file ini (testata)
|
||||||
configfile.set(MOV_NUMREG, numreg);
|
configfile.set(MOV_NUMREG, numreg);
|
||||||
configfile.set(MOV_CODCAUS, causale.get(RCA_CODCAUS));
|
configfile.set(MOV_CODCAUS, _msk->get(F_CODCAU));
|
||||||
|
|
||||||
configfile.set_paragraph("24,1");
|
configfile.set_paragraph("24,1");
|
||||||
configfile.set(RMV_NUMRIG,1);
|
configfile.set(RMV_NUMRIG,1);
|
||||||
@ -268,10 +277,16 @@ bool TImporta_spese_app::transfer()
|
|||||||
configfile.set_paragraph(paragraph);
|
configfile.set_paragraph(paragraph);
|
||||||
|
|
||||||
configfile.set(RMV_IMPORTO, importo.valore().string());
|
configfile.set(RMV_IMPORTO, importo.valore().string());
|
||||||
configfile.set(RMV_SEZIONE, importo.sezione());
|
|
||||||
|
TString4 strsez; strsez << importo.sezione();
|
||||||
|
configfile.set(RMV_SEZIONE, strsez);
|
||||||
configfile.set(RMV_DATAREG, data);
|
configfile.set(RMV_DATAREG, data);
|
||||||
|
|
||||||
TCommessa_string ankey(cms.cmsstr());
|
TCommessa_string ankey(cms.cmsstr());
|
||||||
|
configfile.set(RMV_GRUPPO, ankey.gruppo());
|
||||||
|
configfile.set(RMV_CONTO, ankey.conto());
|
||||||
|
configfile.set(RMV_SOTTOCONTO, ankey.sotco());
|
||||||
|
|
||||||
if(righean.is_key(ankey))
|
if(righean.is_key(ankey))
|
||||||
{
|
{
|
||||||
real& imponibile = *(real*)righean.objptr(ankey);
|
real& imponibile = *(real*)righean.objptr(ankey);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user