Patch level : 10.0 patch ???
Files correlati : ps0713 e tutte le maschere Ricompilazione Demo : [ ] Commento : Portato sulla 10.0 il ps dell'ATS con prevista l'analitica git-svn-id: svn://10.65.10.50/trunk@20447 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
a6de1757cc
commit
574082a69d
@ -9,11 +9,11 @@ int main(int argc, char** argv)
|
||||
{
|
||||
case 0: ps0713100(argc, argv); break; //Esportazione righe IVA
|
||||
case 1: ps0713200(argc, argv); break; //Importazione commesse
|
||||
//case 2: ps0713300(argc, argv); break; //Importazione fatture di acquisto per ATS
|
||||
case 2: ps0713300(argc, argv); break; //Importazione fatture di acquisto
|
||||
case 3: ps0713400(argc, argv); break; //Importazione fatture di vendita
|
||||
//case 4: ps0713500(argc, argv); break; //Importazione spese per ATS
|
||||
case 4: ps0713500(argc, argv); break; //Importazione spese
|
||||
case 5: ps0713600(argc, argv); break; //Importazione fatture fornitori / fatture da ricevere
|
||||
default: ps0713100(argc, argv); break; //Esportazione righe IVA
|
||||
default: ps0713100(argc, argv); break; //Esportazione righe IVA
|
||||
}
|
||||
exit(0);
|
||||
return 0;
|
||||
|
287
ps/ps0713300.cpp
287
ps/ps0713300.cpp
@ -2,142 +2,223 @@
|
||||
#include <automask.h>
|
||||
#include <execp.h>
|
||||
#include <progind.h>
|
||||
#include <reputils.h>
|
||||
#include <utility.h>
|
||||
#include <relation.h>
|
||||
#include <reprint.h>
|
||||
#include <tabutil.h>
|
||||
#include <textset.h>
|
||||
|
||||
#include "tabutil.h"
|
||||
|
||||
#include "ps0713.h"
|
||||
#include "ps0713300a.h"
|
||||
|
||||
#include <causali.h>
|
||||
#include <clifo.h>
|
||||
#include <mov.h>
|
||||
#include <rmoviva.h>
|
||||
|
||||
#include "../ca/calib01.h"
|
||||
#include "../ca/calib02.h"
|
||||
#include "../ca/movana.h"
|
||||
#include "../ca/rmovana.h"
|
||||
|
||||
#include "ps0713300a.h"
|
||||
|
||||
//////////////////////////////////////
|
||||
//// TIMPORTA_FATACQ_ANROW ////
|
||||
//////////////////////////////////////
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// TAutomask
|
||||
///////////////////////////////////////////////////////////
|
||||
//classe TImporta_fatacq_anrow
|
||||
class TImporta_fatacq_anrow: public TToken_string
|
||||
{
|
||||
public:
|
||||
const long idlavoro();
|
||||
const int gruppo();
|
||||
const int conto();
|
||||
const int sotco();
|
||||
|
||||
TImporta_fatacq_anrow& operator= (const char* key){ set(key); return *this; }
|
||||
|
||||
class TImportaFat_mask : public TAutomask
|
||||
TImporta_fatacq_anrow(const long idlavoro, const int gruppo, const int conto, const int sotco);
|
||||
TImporta_fatacq_anrow(const char* key):TToken_string(key){}
|
||||
TImporta_fatacq_anrow(const TToken_string& key):TToken_string(key){}
|
||||
TImporta_fatacq_anrow(const TImporta_fatacq_anrow& key):TToken_string(key){}
|
||||
TImporta_fatacq_anrow():TToken_string(){}
|
||||
};
|
||||
|
||||
//IDLAVORO: metodo che restituisce l'Idlavoro
|
||||
const long TImporta_fatacq_anrow::idlavoro()
|
||||
{
|
||||
return get_long(0);
|
||||
}
|
||||
|
||||
//GRUPPO: metodo che restituisce il gruppo
|
||||
const int TImporta_fatacq_anrow::gruppo()
|
||||
{
|
||||
return get_int(1);
|
||||
}
|
||||
|
||||
//CONTO: metodo che restituisce il conto
|
||||
const int TImporta_fatacq_anrow::conto()
|
||||
{
|
||||
return get_int(2);
|
||||
}
|
||||
|
||||
//SOTCO: metodo che restituisce il sottoconto
|
||||
const int TImporta_fatacq_anrow::sotco()
|
||||
{
|
||||
return get_int(3);
|
||||
}
|
||||
|
||||
//metodo costruttore
|
||||
TImporta_fatacq_anrow::TImporta_fatacq_anrow(const long idlavoro, const int gruppo, const int conto, const int sotco)
|
||||
{
|
||||
add(idlavoro);
|
||||
add(gruppo);
|
||||
add(conto);
|
||||
add(sotco);
|
||||
}
|
||||
|
||||
///////////////////////////////////
|
||||
//// TIMPORTA_FATACQ_MSK ////
|
||||
///////////////////////////////////
|
||||
|
||||
//Classe TImporta_fatacq_msk
|
||||
class TImporta_fatacq_msk : public TAutomask
|
||||
{
|
||||
protected:
|
||||
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
|
||||
|
||||
public:
|
||||
TImportaFat_mask();
|
||||
TImporta_fatacq_msk();
|
||||
};
|
||||
|
||||
TImportaFat_mask::TImportaFat_mask() :TAutomask ("ps0713300a")
|
||||
TImporta_fatacq_msk::TImporta_fatacq_msk() :TAutomask ("ps0713300a")
|
||||
{
|
||||
}
|
||||
|
||||
bool TImportaFat_mask::on_field_event(TOperable_field& f, TField_event e, long jolly)
|
||||
{
|
||||
switch (f.dlg())
|
||||
{
|
||||
//giochetto per avere la lista dei files validi nella directory di trasferimento!
|
||||
case F_NAME:
|
||||
if (e == fe_button)
|
||||
{
|
||||
TArray_sheet as(-1, -1, 72, 20, TR("Selezione file"),
|
||||
"File@32");
|
||||
TFilename path = get(F_PATH);
|
||||
path.add("*.csv"); //files delle testate
|
||||
list_files(path, as.rows_array());
|
||||
TFilename name;
|
||||
FOR_EACH_ARRAY_ROW(as.rows_array(), i, row)
|
||||
{
|
||||
name = *row;
|
||||
*row = name.name();
|
||||
}
|
||||
if (as.run() == K_ENTER)
|
||||
{
|
||||
f.set(as.row(as.selected()));
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
//ON_FIELD_EVENT: metodo che gestisce i comportamenti dei vari campi della maschera
|
||||
//(per adesso segnaposto)
|
||||
bool TImporta_fatacq_msk::on_field_event(TOperable_field& f, TField_event e, long jolly)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////
|
||||
//// CLASSI DERIVATE PER IMPORTAZIONE DATI ////
|
||||
///////////////////////////////////////////////
|
||||
///////////////////////////////////
|
||||
//// TIMPORTA_FATACQ_REC ////
|
||||
///////////////////////////////////
|
||||
|
||||
/////////////////////////////////////////////////////////////
|
||||
// Recordset specifici per i dati da trasferire
|
||||
/////////////////////////////////////////////////////////////
|
||||
|
||||
//Piano dei conti
|
||||
class TImporta_fatt_recordset : public TCSV_recordset
|
||||
//Classe TImporta_fatacq_rec
|
||||
class TImporta_fatacq_rec : public TCSV_recordset
|
||||
{
|
||||
public:
|
||||
TImporta_fatt_recordset(const char * fileName);
|
||||
TImporta_fatacq_rec(const char * fileName);
|
||||
};
|
||||
|
||||
TImporta_fatt_recordset::TImporta_fatt_recordset(const char * fileName)
|
||||
: TCSV_recordset("CSV(\",\")")
|
||||
TImporta_fatacq_rec::TImporta_fatacq_rec(const char * fileName)
|
||||
: TCSV_recordset("CSV(\",\")")
|
||||
{
|
||||
load_file(fileName);
|
||||
}
|
||||
|
||||
///////////////////////////////////////
|
||||
// TSkeleton_application
|
||||
///////////////////////////////////////
|
||||
class TFattCSV : public TSkeleton_application
|
||||
///////////////////////////////////
|
||||
//// TIMPORTA_FATACQ_APP ////
|
||||
///////////////////////////////////
|
||||
|
||||
//Classe TImporta_fatacq_app
|
||||
class TImporta_fatacq_app : public TSkeleton_application
|
||||
{
|
||||
virtual bool check_autorization() const {return false;}
|
||||
TImporta_fatacq_msk* _msk;
|
||||
TConfig* _configfile;
|
||||
|
||||
protected:
|
||||
virtual bool check_autorization() const {return false;}
|
||||
virtual const char * extra_modules() const {return "ve";}
|
||||
|
||||
TImportaFat_mask* _msk;
|
||||
TConfig* _configfile;
|
||||
|
||||
|
||||
//protected:
|
||||
|
||||
|
||||
public:
|
||||
virtual bool create();
|
||||
virtual bool destroy();
|
||||
virtual void main_loop();
|
||||
bool transfer(const TFilename& file);
|
||||
long genera_movcg();
|
||||
void genera_analitica(const long numreg, TAssoc_array& righean);
|
||||
bool transfer(const TFilename& file, const long numreg, TAssoc_array& righean);
|
||||
|
||||
TFattCSV() {};
|
||||
TImporta_fatacq_app() {};
|
||||
};
|
||||
|
||||
bool TFattCSV::transfer(const TFilename& file)
|
||||
long TImporta_fatacq_app::genera_movcg()
|
||||
{
|
||||
TImporta_fatt_recordset s(file);
|
||||
TISAM_recordset movrec("USE MOV");
|
||||
movrec.move_last();
|
||||
long numreg = movrec.get(MOV_NUMREG).as_int(); numreg++;
|
||||
|
||||
TLocalisamfile mov(LF_MOV);
|
||||
mov.put(MOV_NUMREG, numreg);
|
||||
mov.rewrite();
|
||||
|
||||
return numreg;
|
||||
}
|
||||
|
||||
void TImporta_fatacq_app::genera_analitica(const long numreg, TAssoc_array& righean)
|
||||
{
|
||||
TProgind pi(righean.items(), "Importazione analitica in corso...", true, true);
|
||||
|
||||
const TDate datareg = _msk->get_date(F_DATAREG);
|
||||
const int anno = _msk->get_date(F_DATAREG).year();
|
||||
|
||||
TToken_string key;
|
||||
key.add(_msk->get(F_CODCAU));
|
||||
key.add(1);
|
||||
key.add(1);
|
||||
const TRectype& causale = cache().get(LF_RCAUSALI, key);
|
||||
|
||||
//instanzio il movimento di analitica
|
||||
TAnal_mov anmo(0);
|
||||
anmo.put(MOVANA_NUMREGCG, numreg);
|
||||
anmo.put(MOVANA_DATACOMP, datareg);
|
||||
anmo.put(MOVANA_DATAREG, datareg);
|
||||
anmo.put(MOVANA_CODCAUS, _msk->get(F_CODCAU));
|
||||
anmo.put(MOVANA_ANNOES, anno);
|
||||
|
||||
//per ogni oggetto dell'assoc_array, creo una riga di analitica
|
||||
FOR_EACH_ASSOC_OBJECT(righean, obj, keyar, itm)
|
||||
{
|
||||
if (!pi.addstatus(1))
|
||||
break;
|
||||
|
||||
TImporta_fatacq_anrow& row = (TImporta_fatacq_anrow)keyar;
|
||||
const long idlav = row.idlavoro();
|
||||
const int gruppo = row.gruppo(); TString8 grup; grup.format("%03d", gruppo);
|
||||
const int conto = row.conto(); TString8 cont; cont.format("%03d", conto);
|
||||
const int sotco = row.sotco(); TString16 sotc; sotc.format("%06ld", sotco);
|
||||
TString80 codconto; codconto << grup << cont << sotc;
|
||||
|
||||
real& imp = *(real*)itm; imp.round(2);
|
||||
|
||||
if (!imp.is_zero())
|
||||
{
|
||||
TRectype& ranmo = anmo.new_row();
|
||||
ranmo.put(RMOVANA_ANNOES, anno);
|
||||
ranmo.put(RMOVANA_SEZIONE, causale.get("SEZIONE"));
|
||||
ranmo.put(RMOVANA_CODCONTO, codconto);
|
||||
ranmo.put(RMOVANA_CODCMS, idlav);
|
||||
ranmo.put(RMOVANA_IMPORTO, imp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool TImporta_fatacq_app::transfer(const TFilename& file, const long numreg, TAssoc_array& righean)
|
||||
{
|
||||
TImporta_fatacq_rec s(file);
|
||||
|
||||
TProgind pi(s.items(),"Importazione fatture in corso ...",true,true);
|
||||
|
||||
_configfile->set_paragraph("Transaction"); //setto il paragrafo [Transaction] del file ini
|
||||
|
||||
_configfile->set("Action","INSERT");
|
||||
_configfile->set_paragraph("Transaction"); //setto il paragrafo [Transaction] del file ini
|
||||
_configfile->set("Action","MODIFY");
|
||||
_configfile->set("Mode","AUTO");
|
||||
|
||||
_configfile->set_paragraph("23"); //setto il paragrafo [23] del file ini (testata)
|
||||
|
||||
_configfile->set(MOV_NUMREG, numreg);
|
||||
_configfile->set(MOV_TIPO,"F");
|
||||
_configfile->set(MOV_CODCF, _msk->get(F_CODCF));
|
||||
|
||||
_configfile->set(MOV_CODCAUS, _msk->get(F_CODCAU));
|
||||
|
||||
_configfile->set(MOV_CODCAUS, _msk->get(F_CODCAU));
|
||||
_configfile->set(MOV_DATAREG, _msk->get(F_DATAREG));
|
||||
|
||||
|
||||
int nriga = 1;
|
||||
|
||||
for (bool ok=s.move_first();ok;ok=s.move_next())
|
||||
for (bool ok = s.move_first(); ok; ok = s.move_next())
|
||||
{
|
||||
if (!pi.addstatus(1))
|
||||
break;
|
||||
@ -147,12 +228,28 @@ bool TFattCSV::transfer(const TFilename& file)
|
||||
_configfile->set_paragraph(paragraph);
|
||||
|
||||
TString16 codcom = s.get(0).as_string();
|
||||
real imp = s.get(1).as_real();
|
||||
real imp = s.get(1).as_real();
|
||||
|
||||
_configfile->set(RMI_IMPONIBILE,imp.string());
|
||||
_configfile->set(RMI_CODIVA,_msk->get(F_CODIVA));
|
||||
_configfile->set(RMI_CODCMS,codcom);
|
||||
TTable cms("CMS");
|
||||
cms.put("CODTAB", codcom);
|
||||
int err = cms.read();
|
||||
const int gruppo = err == NOERR ? cms.get_int("I1") : 0;
|
||||
const int conto = err == NOERR ? cms.get_int("I2") : 0;
|
||||
const long sotco = err == NOERR ? cms.get_int("I3") : 0;
|
||||
|
||||
TImporta_fatacq_anrow ankey(atol(codcom), gruppo, conto, sotco);
|
||||
|
||||
if(righean.is_key(ankey))
|
||||
{
|
||||
real& imponibile = *(real*)righean.objptr(ankey);
|
||||
imponibile += imp;
|
||||
}
|
||||
else
|
||||
righean.add(ankey, imp);
|
||||
|
||||
_configfile->set(RMI_IMPONIBILE, imp.string());
|
||||
_configfile->set(RMI_CODIVA, _msk->get(F_CODIVA));
|
||||
_configfile->set(RMI_CODCMS, codcom);
|
||||
}
|
||||
|
||||
_configfile->set_paragraph("Transaction");
|
||||
@ -162,24 +259,24 @@ bool TFattCSV::transfer(const TFilename& file)
|
||||
|
||||
const char* nomeini = "ps0713300fatt.ini";
|
||||
|
||||
bool TFattCSV::create()
|
||||
bool TImporta_fatacq_app::create()
|
||||
{
|
||||
xvt_fsys_removefile(nomeini);
|
||||
_configfile = new TConfig(nomeini);
|
||||
|
||||
_msk = new TImportaFat_mask();
|
||||
_msk = new TImporta_fatacq_msk();
|
||||
|
||||
return TSkeleton_application::create();
|
||||
}
|
||||
|
||||
bool TFattCSV::destroy()
|
||||
bool TImporta_fatacq_app::destroy()
|
||||
{
|
||||
delete _msk;
|
||||
delete _configfile;
|
||||
return TApplication::destroy();
|
||||
}
|
||||
|
||||
void TFattCSV::main_loop()
|
||||
void TImporta_fatacq_app::main_loop()
|
||||
{
|
||||
KEY tasto;
|
||||
tasto = _msk->run();
|
||||
@ -189,9 +286,12 @@ void TFattCSV::main_loop()
|
||||
//genero il nome del file da caricare
|
||||
TFilename name = _msk->get(F_PATH);
|
||||
name.add(_msk->get(F_NAME));
|
||||
if (transfer(name))
|
||||
TAssoc_array righean;
|
||||
const long numreg = genera_movcg();
|
||||
if (transfer(name, numreg, righean))
|
||||
{
|
||||
|
||||
genera_analitica(numreg, righean);
|
||||
|
||||
TString app;
|
||||
app << "cg2 -0 -i" << nomeini;
|
||||
TExternal_app primanota(app);
|
||||
@ -202,13 +302,12 @@ void TFattCSV::main_loop()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
TFattCSV& app() { return (TFattCSV&) main_app(); }
|
||||
TImporta_fatacq_app& app() { return (TImporta_fatacq_app&) main_app(); }
|
||||
|
||||
|
||||
int ps0713300 (int argc, char* argv[])
|
||||
{
|
||||
TFattCSV main_app;
|
||||
TImporta_fatacq_app main_app;
|
||||
main_app.run(argc, argv, TR("Importazione Fatture"));
|
||||
return true;
|
||||
}
|
@ -1,13 +1,10 @@
|
||||
//campi maschera ps0713300a
|
||||
|
||||
#define F_CODITTA 101
|
||||
#define F_RAGSOC 102
|
||||
#define F_PATH 103
|
||||
#define F_NAME 104
|
||||
#define F_CODIVA 105
|
||||
#define F_DESIVA 106
|
||||
#define F_CODCAU 107
|
||||
#define F_DESCAU 108
|
||||
#define F_CODCF 109
|
||||
#define F_FRAGSOC 110
|
||||
#define F_DATAREG 111
|
||||
#define F_PATH 101
|
||||
#define F_NAME 102
|
||||
#define F_CODIVA 103
|
||||
#define F_DESIVA 104
|
||||
#define F_CODCAU 105
|
||||
#define F_DESCAU 106
|
||||
#define F_CODCF 107
|
||||
#define F_FRAGSOC 108
|
||||
#define F_DATAREG 109
|
||||
|
@ -100,13 +100,12 @@ TImporta_fatven_rec::TImporta_fatven_rec(const char * fileName)
|
||||
//Classe TImporta_fatven_app
|
||||
class TImporta_fatven_app : public TSkeleton_application
|
||||
{
|
||||
virtual bool check_autorization() const {return false;}
|
||||
virtual const char * extra_modules() const {return "ve";}
|
||||
|
||||
TImporta_fatven_msk* _msk;
|
||||
|
||||
TImporta_fatven_msk* _msk;
|
||||
|
||||
protected:
|
||||
virtual bool check_autorization() const {return false;}
|
||||
virtual const char * extra_modules() const {return "ve";}
|
||||
|
||||
long togli_apici_numero(TImporta_fatven_rec& s, int i);
|
||||
const TString& togli_apici(TImporta_fatven_rec& s, int i);
|
||||
bool find_clifo(long& codcf, TString& paiv, long& abi, long& cab, TString& codpag);
|
||||
|
306
ps/ps0713500.cpp
306
ps/ps0713500.cpp
@ -2,92 +2,120 @@
|
||||
#include <automask.h>
|
||||
#include <execp.h>
|
||||
#include <progind.h>
|
||||
#include <reputils.h>
|
||||
#include <utility.h>
|
||||
#include <relation.h>
|
||||
#include <reprint.h>
|
||||
#include <textset.h>
|
||||
#include <recarray.h>
|
||||
|
||||
|
||||
#include "tabutil.h"
|
||||
|
||||
#include "ps0713.h"
|
||||
#include "ps0713500a.h"
|
||||
|
||||
#include <rcausali.h>
|
||||
#include <clifo.h>
|
||||
#include <mov.h>
|
||||
#include <rmov.h>
|
||||
|
||||
#include "tabutil.h"
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// TAutomask
|
||||
///////////////////////////////////////////////////////////
|
||||
#include "../ca/calib01.h"
|
||||
#include "../ca/calib02.h"
|
||||
#include "../ca/movana.h"
|
||||
#include "../ca/rmovana.h"
|
||||
|
||||
class TImportaSpese_mask : public TAutomask
|
||||
#include "ps0713500a.h"
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////
|
||||
//// TIMPORTA_SPESE_ANROW ////
|
||||
//////////////////////////////////////
|
||||
|
||||
//classe TImporta_spese_anrow
|
||||
class TImporta_spese_anrow: public TToken_string
|
||||
{
|
||||
public:
|
||||
const long idlavoro();
|
||||
const int gruppo();
|
||||
const int conto();
|
||||
const int sotco();
|
||||
|
||||
TImporta_spese_anrow& operator= (const char* key){ set(key); return *this; }
|
||||
|
||||
TImporta_spese_anrow(const long idlavoro, const int gruppo, const int conto, const int sotco);
|
||||
TImporta_spese_anrow(const char* key):TToken_string(key){}
|
||||
TImporta_spese_anrow(const TToken_string& key):TToken_string(key){}
|
||||
TImporta_spese_anrow(const TImporta_spese_anrow& key):TToken_string(key){}
|
||||
TImporta_spese_anrow():TToken_string(){}
|
||||
};
|
||||
|
||||
//IDLAVORO: metodo che restituisce l'Idlavoro
|
||||
const long TImporta_spese_anrow::idlavoro()
|
||||
{
|
||||
return get_long(0);
|
||||
}
|
||||
|
||||
//GRUPPO: metodo che restituisce il gruppo
|
||||
const int TImporta_spese_anrow::gruppo()
|
||||
{
|
||||
return get_int(1);
|
||||
}
|
||||
|
||||
//CONTO: metodo che restituisce il conto
|
||||
const int TImporta_spese_anrow::conto()
|
||||
{
|
||||
return get_int(2);
|
||||
}
|
||||
|
||||
//SOTCO: metodo che restituisce il sottoconto
|
||||
const int TImporta_spese_anrow::sotco()
|
||||
{
|
||||
return get_int(3);
|
||||
}
|
||||
|
||||
//metodo costruttore
|
||||
TImporta_spese_anrow::TImporta_spese_anrow(const long idlavoro, const int gruppo, const int conto, const int sotco)
|
||||
{
|
||||
add(idlavoro);
|
||||
add(gruppo);
|
||||
add(conto);
|
||||
add(sotco);
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////
|
||||
//// TIMPORTA_SPESE_MSK ////
|
||||
//////////////////////////////////
|
||||
|
||||
//Clase TImporta_spese_msk
|
||||
class TImporta_spese_msk : public TAutomask
|
||||
{
|
||||
protected:
|
||||
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
|
||||
|
||||
public:
|
||||
TImportaSpese_mask();
|
||||
TImporta_spese_msk(const char* name);
|
||||
};
|
||||
|
||||
TImportaSpese_mask::TImportaSpese_mask() :TAutomask ("ps0713500a")
|
||||
{
|
||||
}
|
||||
TImporta_spese_msk::TImporta_spese_msk(const char* name)
|
||||
:TAutomask (name) {}
|
||||
|
||||
bool TImportaSpese_mask::on_field_event(TOperable_field& f, TField_event e, long jolly)
|
||||
{
|
||||
switch (f.dlg())
|
||||
{
|
||||
//giochetto per avere la lista dei files validi nella directory di trasferimento!
|
||||
case F_NAME:
|
||||
if (e == fe_button)
|
||||
{
|
||||
TArray_sheet as(-1, -1, 72, 20, TR("Selezione file"),
|
||||
"File@32");
|
||||
TFilename path = get(F_PATH);
|
||||
path.add("*.csv"); //files delle testate
|
||||
list_files(path, as.rows_array());
|
||||
TFilename name;
|
||||
FOR_EACH_ARRAY_ROW(as.rows_array(), i, row)
|
||||
{
|
||||
name = *row;
|
||||
*row = name.name();
|
||||
}
|
||||
if (as.run() == K_ENTER)
|
||||
{
|
||||
f.set(as.row(as.selected()));
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
//ON_FIELD_EVENT: metodo che gestisce i comportamenti dei vari campi della maschera
|
||||
//(per adesso segnaposto)
|
||||
bool TImporta_spese_msk::on_field_event(TOperable_field& f, TField_event e, long jolly)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////
|
||||
//// CLASSI DERIVATE PER IMPORTAZIONE DATI ////
|
||||
///////////////////////////////////////////////
|
||||
//////////////////////////////////
|
||||
//// TIMPORTA_SPESE_REC ////
|
||||
//////////////////////////////////
|
||||
|
||||
/////////////////////////////////////////////////////////////
|
||||
// Recordset specifici per i dati da trasferire
|
||||
/////////////////////////////////////////////////////////////
|
||||
|
||||
//Piano dei conti
|
||||
class TImporta_spese_recordset : public TCSV_recordset
|
||||
//Clase TImporta_spese_rec
|
||||
class TImporta_spese_rec : public TCSV_recordset
|
||||
{
|
||||
protected:
|
||||
virtual TRecnotype new_rec(const char* buf = NULL);
|
||||
|
||||
public:
|
||||
TImporta_spese_recordset(const char * fileName);
|
||||
TImporta_spese_rec(const char * fileName);
|
||||
};
|
||||
|
||||
TRecnotype TImporta_spese_recordset::new_rec(const char* buf)
|
||||
TRecnotype TImporta_spese_rec::new_rec(const char* buf)
|
||||
{
|
||||
TToken_string str(256,'\t'); //nuovo record tab separator
|
||||
|
||||
@ -126,34 +154,40 @@ TRecnotype TImporta_spese_recordset::new_rec(const char* buf)
|
||||
}
|
||||
|
||||
|
||||
TImporta_spese_recordset::TImporta_spese_recordset(const char * fileName)
|
||||
TImporta_spese_rec::TImporta_spese_rec(const char * fileName)
|
||||
: TCSV_recordset("CSV(,)")
|
||||
{
|
||||
load_file(fileName);
|
||||
}
|
||||
|
||||
///////////////////////////////////////
|
||||
// TSkeleton_application
|
||||
///////////////////////////////////////
|
||||
class TSpeseCSV : public TSkeleton_application
|
||||
//////////////////////////////////
|
||||
//// TIMPORTA_SPESE_APP ////
|
||||
//////////////////////////////////
|
||||
|
||||
//Classe TImporta_spese_app
|
||||
class TImporta_spese_app : public TSkeleton_application
|
||||
{
|
||||
virtual bool check_autorization() const {return false;}
|
||||
TImporta_spese_msk* _msk;
|
||||
protected:
|
||||
virtual bool check_autorization() const {return false;}
|
||||
virtual const char * extra_modules() const {return "ve";}
|
||||
|
||||
protected:
|
||||
void chiudi_movimento(TConfig& configfile, TImporto& tot_doc, TDate& data);
|
||||
void chiudi_movimento(TConfig& configfile, TImporto& tot_doc, TDate& data, const long numreg, TAssoc_array& righean);
|
||||
|
||||
public:
|
||||
virtual void main_loop();
|
||||
bool transfer(const TMask& msk);
|
||||
long genera_movcg();
|
||||
void genera_movana(const long numreg, TAssoc_array& righean);
|
||||
bool transfer();
|
||||
|
||||
TSpeseCSV() {};
|
||||
TImporta_spese_app() {};
|
||||
};
|
||||
|
||||
const char* const nomeini = "ps0713500ats.ini"; //non si conosce il perchè
|
||||
const char* const nomeini = "ps0713500ats.ini";
|
||||
|
||||
void TSpeseCSV::chiudi_movimento(TConfig& configfile, TImporto& tot_doc, TDate& data)
|
||||
void TImporta_spese_app::chiudi_movimento(TConfig& configfile, TImporto& tot_doc, TDate& data, const long numreg, TAssoc_array& righean)
|
||||
{
|
||||
genera_movana(numreg, righean);
|
||||
//aggiungo i campi che mancano in testata
|
||||
configfile.set_paragraph("23");
|
||||
configfile.set(MOV_DATAREG, data);
|
||||
@ -177,12 +211,77 @@ void TSpeseCSV::chiudi_movimento(TConfig& configfile, TImporto& tot_doc, TDate&
|
||||
primanota.run();
|
||||
}
|
||||
|
||||
bool TSpeseCSV::transfer(const TMask& msk)
|
||||
long TImporta_spese_app::genera_movcg()
|
||||
{
|
||||
TISAM_recordset movrec("USE MOV");
|
||||
movrec.move_last();
|
||||
long numreg = movrec.get(MOV_NUMREG).as_int(); numreg++;
|
||||
|
||||
TLocalisamfile mov(LF_MOV);
|
||||
mov.put(MOV_NUMREG, numreg);
|
||||
mov.rewrite();
|
||||
|
||||
return numreg;
|
||||
}
|
||||
|
||||
void TImporta_spese_app::genera_movana(const long numreg, TAssoc_array& righean)
|
||||
{
|
||||
TProgind pi(righean.items(), "Importazione analitica in corso...", true, true);
|
||||
|
||||
const TDate datareg(TODAY);
|
||||
const int anno = datareg.year();
|
||||
|
||||
TToken_string key;
|
||||
key.add(_msk->get(F_CODCAU));
|
||||
key.add(1);
|
||||
key.add(1);
|
||||
const TRectype& causale = cache().get(LF_RCAUSALI, key);
|
||||
|
||||
//instanzio il movimento di analitica
|
||||
TAnal_mov anmo(0);
|
||||
anmo.put(MOVANA_NUMREGCG, numreg);
|
||||
anmo.put(MOVANA_DATACOMP, datareg);
|
||||
anmo.put(MOVANA_DATAREG, datareg);
|
||||
anmo.put(MOVANA_CODCAUS, _msk->get(F_CODCAU));
|
||||
anmo.put(MOVANA_ANNOES, anno);
|
||||
|
||||
//per ogni oggetto dell'assoc_array, creo una riga di analitica
|
||||
FOR_EACH_ASSOC_OBJECT(righean, obj, keyar, itm)
|
||||
{
|
||||
if (!pi.addstatus(1))
|
||||
break;
|
||||
|
||||
TImporta_spese_anrow& row = (TImporta_spese_anrow)keyar;
|
||||
const long idlav = row.idlavoro();
|
||||
const int gruppo = row.gruppo(); TString8 grup; grup.format("%03d", gruppo);
|
||||
const int conto = row.conto(); TString8 cont; cont.format("%03d", conto);
|
||||
const int sotco = row.sotco(); TString16 sotc; sotc.format("%06ld", sotco);
|
||||
TString80 codconto; codconto << grup << cont << sotc;
|
||||
|
||||
real& imp = *(real*)itm; imp.round(2);
|
||||
|
||||
if (!imp.is_zero())
|
||||
{
|
||||
TImporto importo('D', imp);
|
||||
importo.normalize();
|
||||
|
||||
TRectype& ranmo = anmo.new_row();
|
||||
ranmo.put(RMOVANA_ANNOES, anno);
|
||||
ranmo.put(RMOVANA_SEZIONE, causale.get("SEZIONE"));
|
||||
ranmo.put(RMOVANA_CODCONTO, codconto);
|
||||
ranmo.put(RMOVANA_CODCMS, idlav);
|
||||
ranmo.put(RMOVANA_IMPORTO, importo.valore().string());
|
||||
ranmo.put(RMOVANA_SEZIONE, importo.sezione());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool TImporta_spese_app::transfer()
|
||||
{
|
||||
//genero il nome del file da caricare
|
||||
TFilename name = msk.get(F_PATH);
|
||||
name.add(msk.get(F_NAME));
|
||||
TImporta_spese_recordset s(name);
|
||||
TFilename name = _msk->get(F_PATH);
|
||||
name.add(_msk->get(F_NAME));
|
||||
TImporta_spese_rec s(name);
|
||||
|
||||
TProgind pi(s.items(),"Importazione spese in corso ...",true,true);
|
||||
|
||||
@ -193,17 +292,17 @@ bool TSpeseCSV::transfer(const TMask& msk)
|
||||
|
||||
int nriga = 2;
|
||||
TImporto tot_doc;
|
||||
TAssoc_array righean;
|
||||
long numreg;
|
||||
|
||||
const TRectype& causale = cache().get(LF_RCAUSALI, msk.get(F_CODCAU));
|
||||
const TRectype& causale = cache().get(LF_RCAUSALI, _msk->get(F_CODCAU));
|
||||
|
||||
|
||||
for (bool ok=s.move_first();ok;ok=s.move_next())
|
||||
for (bool ok = s.move_first(); ok; ok = s.move_next())
|
||||
{
|
||||
if (!pi.addstatus(1))
|
||||
break;
|
||||
|
||||
|
||||
TString80 tmp;
|
||||
TString80 tmp;
|
||||
|
||||
//importo
|
||||
tmp = s.get(2).as_string();
|
||||
@ -222,7 +321,7 @@ bool TSpeseCSV::transfer(const TMask& msk)
|
||||
//codice commessa
|
||||
tmp = s.get(0).as_string();
|
||||
tmp.strip("\"");
|
||||
|
||||
const TString80 codcms = tmp;
|
||||
const TRectype& commessa = cache().get("CMS", tmp);
|
||||
|
||||
//data
|
||||
@ -240,16 +339,19 @@ bool TSpeseCSV::transfer(const TMask& msk)
|
||||
if(data != dataold)
|
||||
{
|
||||
if (dataold.ok())
|
||||
chiudi_movimento(configfile, tot_doc, data);
|
||||
chiudi_movimento(configfile, tot_doc, data, numreg, righean);
|
||||
|
||||
numreg = genera_movcg();
|
||||
|
||||
TFilename filename(nomeini);
|
||||
filename.fremove();
|
||||
|
||||
configfile.set_paragraph("Transaction");
|
||||
configfile.set("Action","INSERT");
|
||||
configfile.set("Action","MODIFY");
|
||||
configfile.set("Mode","AUTO");
|
||||
|
||||
configfile.set_paragraph("23"); //setto il paragrafo [23] del file ini (testata)
|
||||
configfile.set(MOV_NUMREG, numreg);
|
||||
configfile.set(MOV_CODCAUS, causale.get(RCA_CODCAUS));
|
||||
|
||||
configfile.set_paragraph("24,1");
|
||||
@ -258,7 +360,8 @@ bool TSpeseCSV::transfer(const TMask& msk)
|
||||
configfile.set(RMV_CONTO, causale.get(RCA_CONTO));
|
||||
configfile.set(RMV_SOTTOCONTO, causale.get(RCA_SOTTOCONTO));
|
||||
|
||||
tot_doc.reset();
|
||||
righean.destroy();
|
||||
tot_doc.reset();
|
||||
nriga = 2;
|
||||
dataold = data;
|
||||
}
|
||||
@ -271,30 +374,37 @@ bool TSpeseCSV::transfer(const TMask& msk)
|
||||
paragraph.format("%d,%d",LF_RMOV,nriga++);
|
||||
configfile.set_paragraph(paragraph);
|
||||
|
||||
configfile.set(RMV_IMPORTO,importo.valore().string());
|
||||
configfile.set(RMV_SEZIONE,importo.sezione());
|
||||
configfile.set(RMV_CODCMS,commessa.get("CODTAB"));
|
||||
configfile.set(RMV_DATAREG,data);
|
||||
configfile.set(RMV_GRUPPO,commessa.get("I1"));
|
||||
configfile.set(RMV_CONTO,commessa.get("I2"));
|
||||
configfile.set(RMV_SOTTOCONTO,commessa.get("I3"));
|
||||
configfile.set(RMV_IMPORTO, importo.valore().string());
|
||||
configfile.set(RMV_SEZIONE, importo.sezione());
|
||||
configfile.set(RMV_CODCMS, commessa.get("CODTAB"));
|
||||
configfile.set(RMV_DATAREG, data);
|
||||
configfile.set(RMV_GRUPPO, commessa.get("I1"));
|
||||
configfile.set(RMV_CONTO, commessa.get("I2"));
|
||||
configfile.set(RMV_SOTTOCONTO, commessa.get("I3"));
|
||||
|
||||
TImporta_spese_anrow ankey(commessa.get_long("CODTAB"), commessa.get_int("I1"), commessa.get_int("I2"), commessa.get_int("I3"));
|
||||
if(righean.is_key(ankey))
|
||||
{
|
||||
real& imponibile = *(real*)righean.objptr(ankey);
|
||||
imponibile += importo.valore();
|
||||
}
|
||||
else
|
||||
righean.add(ankey, importo.valore());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
chiudi_movimento(configfile, tot_doc, data);
|
||||
chiudi_movimento(configfile, tot_doc, data, numreg, righean);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void TSpeseCSV::main_loop()
|
||||
void TImporta_spese_app::main_loop()
|
||||
{
|
||||
TImportaSpese_mask msk;
|
||||
_msk = new TImporta_spese_msk("ps0713500a");
|
||||
|
||||
if (msk.run() == K_ENTER)
|
||||
if (_msk->run() == K_ENTER)
|
||||
{
|
||||
if (transfer(msk))
|
||||
if (transfer())
|
||||
{
|
||||
message_box(TR("Importazione spese completata"));
|
||||
xvt_fsys_removefile(nomeini);
|
||||
@ -303,12 +413,12 @@ void TSpeseCSV::main_loop()
|
||||
}
|
||||
|
||||
|
||||
TSpeseCSV& app() { return (TSpeseCSV&) main_app(); }
|
||||
TImporta_spese_app& app() { return (TImporta_spese_app&) main_app(); }
|
||||
|
||||
|
||||
int ps0713500 (int argc, char* argv[])
|
||||
{
|
||||
TSpeseCSV main_app;
|
||||
TImporta_spese_app main_app;
|
||||
main_app.run(argc, argv, TR("Importazione Spese"));
|
||||
return true;
|
||||
}
|
@ -1,8 +1,5 @@
|
||||
//campi maschera ps0713400a
|
||||
|
||||
#define F_CODITTA 101
|
||||
#define F_RAGSOC 102
|
||||
#define F_PATH 103
|
||||
#define F_NAME 104
|
||||
#define F_CODCAU 105
|
||||
//campi maschera ps0713500a
|
||||
#define F_PATH 101
|
||||
#define F_NAME 102
|
||||
#define F_CODCAU 103
|
||||
#define F_DESCAU 106
|
@ -1,68 +1,38 @@
|
||||
#include "ps0713500a.h"
|
||||
|
||||
TOOLBAR "" 0 20 0 2
|
||||
TOOLBAR "" 0 0 0 2
|
||||
|
||||
BUTTON DLG_ELABORA 10 2
|
||||
BEGIN
|
||||
PICTURE BMP_ELABORA
|
||||
MESSAGE EXIT,K_ENTER
|
||||
PROMPT -12 -1 ""
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 10 2
|
||||
BEGIN
|
||||
PROMPT -22 -1 ""
|
||||
END
|
||||
|
||||
STRING DLG_PROFILE 50
|
||||
BEGIN
|
||||
PROMPT 9 -12 "Profilo "
|
||||
PSELECT
|
||||
FLAGS "H"
|
||||
END
|
||||
#include <elabar.h>
|
||||
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Inserimento fatture" 0 0 0 -3
|
||||
|
||||
GROUPBOX DLG_NULL 90 3
|
||||
STRING DLG_PROFILE 50
|
||||
BEGIN
|
||||
PROMPT 2 1 "@bDitta corrente"
|
||||
PROMPT 1 -1 "Profilo "
|
||||
PSELECT
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
NUMBER F_CODITTA 5
|
||||
GROUPBOX DLG_NULL 78 4
|
||||
BEGIN
|
||||
PROMPT 3 2 "Codice "
|
||||
FLAGS "FD"
|
||||
USE LF_NDITTE
|
||||
INPUT CODDITTA F_CODITTA
|
||||
OUTPUT F_RAGSOC RAGSOC
|
||||
CHECKTYPE REQUIRED
|
||||
PROMPT 1 1 "@bSorgente"
|
||||
END
|
||||
|
||||
STRING F_RAGSOC 50
|
||||
STRING F_PATH 256 50
|
||||
BEGIN
|
||||
PROMPT 23 2 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 90 4
|
||||
BEGIN
|
||||
PROMPT 2 4 "@bSorgente"
|
||||
END
|
||||
|
||||
STRING F_PATH 256 39
|
||||
BEGIN
|
||||
PROMPT 3 5 "Cartella "
|
||||
DSELECT
|
||||
CHECKTYPE REQUIRED
|
||||
PROMPT 2 2 "Cartella "
|
||||
DSELECT
|
||||
FIELD ComInPath
|
||||
FLAGS "M"
|
||||
CHECKTYPE REQUIRED
|
||||
END
|
||||
|
||||
STRING F_NAME 18
|
||||
BEGIN
|
||||
PROMPT 3 6 "File (*.csv) "
|
||||
PROMPT 2 3 "File (*.csv) "
|
||||
FSELECT "*.csv"
|
||||
FIELD ComInFile
|
||||
FLAGS "B"
|
||||
CHECKTYPE REQUIRED
|
||||
@ -70,12 +40,12 @@ END
|
||||
|
||||
GROUPBOX DLG_NULL 90 3
|
||||
BEGIN
|
||||
PROMPT 2 8 "@bCausale"
|
||||
PROMPT 1 5 "@bCausale"
|
||||
END
|
||||
|
||||
STRING F_CODCAU 3
|
||||
BEGIN
|
||||
PROMPT 3 9 "Causale "
|
||||
PROMPT 2 6 "Causale "
|
||||
FIELD CODCAU
|
||||
FLAGS "UZ"
|
||||
USE LF_CAUSALI
|
||||
@ -92,7 +62,7 @@ END
|
||||
|
||||
STRING F_DESCAU 50
|
||||
BEGIN
|
||||
PROMPT 25 9 "Descrizione "
|
||||
PROMPT 25 6 "Descrizione "
|
||||
FIELD DESCR
|
||||
USE LF_CAUSALI KEY 2
|
||||
INPUT DESCR F_DESCAU
|
||||
@ -104,8 +74,5 @@ BEGIN
|
||||
COPY OUTPUT F_CODCAU
|
||||
END
|
||||
|
||||
|
||||
|
||||
ENDPAGE
|
||||
|
||||
ENDMASK
|
@ -161,6 +161,7 @@ TImporta_fat_for_anrow::TImporta_fat_for_anrow(const long idlavoro, const int gr
|
||||
class TImporta_fat_for_app : public TSkeleton_application
|
||||
{
|
||||
TImporta_fat_for_msk* _msk;
|
||||
|
||||
protected:
|
||||
virtual bool check_autorization() const { return false; }
|
||||
virtual const char * extra_modules() const { return "ve"; }
|
||||
@ -302,9 +303,10 @@ bool TImporta_fat_for_app::importa(const TFilename& name, TAssoc_array& righean,
|
||||
return true;
|
||||
}
|
||||
|
||||
//GENERA_MOVCG: metodo che genera la testata del movimento di prima nota
|
||||
long TImporta_fat_for_app::genera_movcg()
|
||||
{
|
||||
TISAM_recordset movrec(TR("USE MOV"));
|
||||
TISAM_recordset movrec("USE MOV");
|
||||
movrec.move_last();
|
||||
long numreg = movrec.get(MOV_NUMREG).as_int(); numreg++;
|
||||
|
||||
@ -315,9 +317,10 @@ long TImporta_fat_for_app::genera_movcg()
|
||||
return numreg;
|
||||
}
|
||||
|
||||
//GENERA_ANALITICA: metodo che genera il movimento di contabilità analitica
|
||||
void TImporta_fat_for_app::genera_analitica(TAssoc_array& righean, TImporta_fat_for_anrow& kmax, const real& quad, const long numregcg)
|
||||
{
|
||||
TProgind pi(righean.items(), "Importazione in corso...", true, true);
|
||||
TProgind pi(righean.items(), "Importazione analitica in corso...", true, true);
|
||||
|
||||
TToken_string key;
|
||||
key.add(_msk->get(F_CODCAU));
|
||||
@ -326,12 +329,15 @@ void TImporta_fat_for_app::genera_analitica(TAssoc_array& righean, TImporta_fat_
|
||||
const TRectype& causale = cache().get(LF_RCAUSALI, key);
|
||||
const int anno = _msk->get_date(F_DATADOC).year();
|
||||
|
||||
//instanzio il movimento di analitica
|
||||
TAnal_mov anmo(0);
|
||||
anmo.put(MOVANA_NUMREGCG, numregcg);
|
||||
anmo.put(MOVANA_DATACOMP, _msk->get_date(F_DATAREG));
|
||||
anmo.put(MOVANA_DATAREG, _msk->get_date(F_DATAREG));
|
||||
anmo.put(MOVANA_CODCAUS, _msk->get(F_CODCAU));
|
||||
anmo.put(MOVANA_ANNOES, anno);
|
||||
|
||||
//aggiungo i campi relativi ai documenti solo quando li ho a disposizione
|
||||
if(_msk->get_int(F_TIPOFAT) == 1)
|
||||
{
|
||||
const real iva = cache().get("%IVA", _msk->get(F_CODIVA), "R0");
|
||||
@ -360,6 +366,7 @@ void TImporta_fat_for_app::genera_analitica(TAssoc_array& righean, TImporta_fat_
|
||||
anmo.put(MOVANA_TOTDOC, totdoc.string());
|
||||
}
|
||||
|
||||
//per ogni oggetto dell'assoc_array, creo una riga di analitica
|
||||
FOR_EACH_ASSOC_OBJECT(righean, obj, keyar, itm)
|
||||
{
|
||||
if (!pi.addstatus(1))
|
||||
@ -402,6 +409,7 @@ void TImporta_fat_for_app::genera_analitica(TAssoc_array& righean, TImporta_fat_
|
||||
}
|
||||
}
|
||||
|
||||
//IMPORTA_FAT: metodo che genera l'ini per l'importazione delle fatture a fornitore
|
||||
void TImporta_fat_for_app::importa_fat(TAssoc_array& righecg, TImporta_fat_for_anrow& kmax, const real& quad, TConfig* configfile, const long numregcg)
|
||||
{
|
||||
const TDate datareg = _msk->get_date(F_DATAREG);
|
||||
@ -453,6 +461,7 @@ void TImporta_fat_for_app::importa_fat(TAssoc_array& righecg, TImporta_fat_for_a
|
||||
|
||||
int nrigaiv = 0;
|
||||
|
||||
//per ogni riga dell'assoc_array, creo un paragrafo riga
|
||||
FOR_EACH_ASSOC_OBJECT(righecg, obj, keyar1, itm1)
|
||||
{
|
||||
if (!pi.addstatus(1))
|
||||
@ -482,6 +491,7 @@ void TImporta_fat_for_app::importa_fat(TAssoc_array& righecg, TImporta_fat_for_a
|
||||
}
|
||||
}
|
||||
|
||||
//se c'è bisogno, faccio una riga in più
|
||||
if(quad > ZERO)
|
||||
{
|
||||
TString8 paragraph;
|
||||
@ -506,6 +516,8 @@ void TImporta_fat_for_app::importa_fat(TAssoc_array& righecg, TImporta_fat_for_a
|
||||
configfile->set_paragraph(paragraph);
|
||||
}
|
||||
|
||||
//IMPORTA_FAT_RIC: metodo che genera l'ini per l'importazione delle fatture da ricevere
|
||||
//(attenzione: genero righe IVA)
|
||||
void TImporta_fat_for_app::importa_fat_ric(TAssoc_array& righecg, TImporta_fat_for_anrow& kmax, const real& quad, TConfig* configfile, const long numregcg)
|
||||
{
|
||||
const TDate datareg = _msk->get_date(F_DATAREG);
|
||||
@ -534,6 +546,7 @@ void TImporta_fat_for_app::importa_fat_ric(TAssoc_array& righecg, TImporta_fat_f
|
||||
|
||||
int nrigaco = 1;
|
||||
|
||||
//prima riga: serve a bilanaciare le altre
|
||||
TString8 paragraph;
|
||||
paragraph.format("%d,%d", LF_RMOV, 1);
|
||||
configfile->set_paragraph(paragraph);
|
||||
@ -550,6 +563,7 @@ void TImporta_fat_for_app::importa_fat_ric(TAssoc_array& righecg, TImporta_fat_f
|
||||
key.add(2,1);
|
||||
const TRectype& causale2 = cache().get(LF_RCAUSALI, key);
|
||||
|
||||
//per ogni oggetto dell'assoc_array, preparo un paragrafo riga
|
||||
FOR_EACH_ASSOC_OBJECT(righecg, obj, keyar, itm)
|
||||
{
|
||||
if (!pi.addstatus(1))
|
||||
@ -576,6 +590,7 @@ void TImporta_fat_for_app::importa_fat_ric(TAssoc_array& righecg, TImporta_fat_f
|
||||
}
|
||||
}
|
||||
|
||||
//se serve, faccio una riga in più
|
||||
if(quad > ZERO)
|
||||
{
|
||||
TString8 paragraph;
|
||||
|
Loading…
x
Reference in New Issue
Block a user