Patch level : 10.0 no patch
Files correlati :pe0001.exe Ricompilazione Demo : [ ] Commento : Conversione movimenti partite e cespiti GALILEO git-svn-id: svn://10.65.10.50/trunk@19857 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
efbe3bc066
commit
d54d44ed34
@ -158,7 +158,7 @@ bool TImporta_mov_mask::on_field_event(TOperable_field& f, TField_event e, long
|
||||
class TImporta_mov : public TSkeleton_application
|
||||
{
|
||||
virtual bool check_autorization() const {return false;}
|
||||
virtual const char * extra_modules() const {return "ve";}
|
||||
virtual const char * extra_modules() const {return "ba";}
|
||||
|
||||
TImporta_mov_mask* _msk;
|
||||
|
||||
@ -249,6 +249,7 @@ void TImporta_mov::transfer(const TFilename& file)
|
||||
TString4 gruppo;
|
||||
TString4 conto;
|
||||
TString8 sottoconto;
|
||||
TString descr(50);
|
||||
const int codes = _msk->get_int(F_ANNOES);
|
||||
const long ditta = _msk->get_long(F_CODITTA);
|
||||
const TEsercizi_contabili esc;
|
||||
@ -286,6 +287,7 @@ void TImporta_mov::transfer(const TFilename& file)
|
||||
dataop = d;
|
||||
nmov = n;
|
||||
|
||||
|
||||
if (conf != NULL)
|
||||
delete conf;
|
||||
conf = NULL;
|
||||
@ -321,12 +323,21 @@ void TImporta_mov::transfer(const TFilename& file)
|
||||
conf->set(MOV_NUMDOC, ndoc);
|
||||
conf->set(MOV_STAMPATO, "X");
|
||||
conf->set(MOV_REGST, "X");
|
||||
|
||||
descr == s.get(DSUPCM).as_string();
|
||||
iva = s.get(TPMVCM).as_string() == "I";
|
||||
|
||||
if (iva)
|
||||
{
|
||||
TToken_string key(25, ',');
|
||||
|
||||
key.add(s.get(NPARCM).as_int());
|
||||
key.add(s.get(AAOPCM).as_int());
|
||||
descr << " Part. " << key;
|
||||
conf->set(MOV_REG, s.get(TPGICM).as_string());
|
||||
conf->set(MOV_PROTIVA, n);
|
||||
}
|
||||
conf->set(MOV_DESCR, descr);
|
||||
nrigac = 1;
|
||||
rows.destroy();
|
||||
impcg.destroy();
|
||||
|
472
ps/pe0001200.cpp
472
ps/pe0001200.cpp
@ -13,6 +13,9 @@
|
||||
#include <tabutil.h>
|
||||
|
||||
#include "../cg/cglib01.h"
|
||||
#include "../cg/cg2103.h"
|
||||
#include "../cg/cgsaldac.h"
|
||||
#include "../cg/cgpagame.h"
|
||||
|
||||
#include "pe0001.h"
|
||||
#include "pe0001200a.h"
|
||||
@ -22,61 +25,88 @@
|
||||
#include <rmov.h>
|
||||
#include <rmoviva.h>
|
||||
|
||||
#define AT01CM 0 // Record attivo/sospeso/annullato DIZSMAS - ATTI
|
||||
#define DT01CM 1 // Data stampa per G.Gen.le DIZSMAS - DATS
|
||||
#define NR01CM 2 // Numero azione di aggiornamento DIZSMAS - NRAZ
|
||||
#define TPMVCM 3 // Flag IVA I=IVA =no IVA DIZSMAS - TPMV
|
||||
#define CDDTCM 4 // Codice Ditta DIZSMAS - CDDT
|
||||
#define AAPRCM 5 // Anno Operazione DIZSMAS - AAPR
|
||||
#define ANNPCM 6 // Anno Reg.DA GESTIRE DIZSMAS - ANNP
|
||||
#define TPGICM 7 // Giornale IVA TB=GI DIZSMAS - TPGI
|
||||
#define DTOPCM 8 // Data operazione DIZSMAS - DATS
|
||||
#define NONPCM 9 // Nr. Operaz./Nr. Prot. DIZSMAS - NONP
|
||||
#define NRRGCM 10 // Numero Riga 2 DIZSMAS - NRR2
|
||||
#define NRGICM 11 // Nr Riga Giornale DIZSMAS - NRGI
|
||||
#define CONTCM 12 // Gr. Conto Sottoconto DIZSMAS - CONT
|
||||
#define DIVICM 13 // Divisione TB=DI DIZSMAS - DIVI
|
||||
#define NPARCM 14 // Nr Partita DIZSMAS - NPAR
|
||||
#define AAOPCM 15 // Anno partita DIZSMAS - ANNO
|
||||
#define DTRGCM 16 // Data registrazione DIZSMAS - DATS
|
||||
#define CAUSCM 17 // Causale TB=CA DIZSMAS - CAUS
|
||||
#define DSUPCM 18 // Descrizione Supplementare DIZSMAS - DSUP
|
||||
#define IMPOCM 19 // Importo "-"=Avere DIZSMAS - IMPO
|
||||
#define CDVACM 20 // Codice Valuta TB=VA DIZSMAS - CDVA
|
||||
#define CAMBCM 21 // Cambio DIZSMAS - CAMB
|
||||
#define IMVACM 22 // Importo Valuta DIZSMAS - IMVA
|
||||
#define CDPGCM 23 // Codice di Pagamento TB=CP DIZSMAS - CDPG
|
||||
#define DT1SCM 24 // Data I^ scadenza DIZSMAS - DATS
|
||||
#define DTDOCM 25 // Data documento DIZSMAS - DATS
|
||||
#define NRDOCM 26 // N° Documento DIZSMAS - NUDO
|
||||
#define CCTPCM 27 // Centri Costo Tipico TB=CC DIZSMAS - CCTP
|
||||
#define NCOMCM 28 // Numero Commessa DIZSMAS - NCOM
|
||||
#define CDSCCM 29 // Codice Sottocommessa DIZSMAS - CDSC
|
||||
#define INDECM 30 // Indetraibilità % DIZSMAS - INDE
|
||||
#define CDIVCM 31 // Codice IVA DIZSMAS - CDIV
|
||||
#define IMPSCM 32 // Imposta DIZSMAS - IMPS
|
||||
#define CDAGCM 33 // Codice Agente DIZSMAS - CDAG
|
||||
#define DTVBCM 34 // Data Liquidazione Iva Sospesa DIZSMAS - DATS
|
||||
#define FLSBCM 35 // Flag *=Stampato Bollato DIZSMAS - FLSB
|
||||
#define FSBICM 36 // Flag *=Stampato Boll.IVA DIZSMAS - FSBI
|
||||
#define FLVZCM 37 // V=Var.S=Storno P=Liq.prec. E=Esig.Sosp. DIZSMAS - FLVZ
|
||||
#define FLIICM 38 // Flag IVA Irrecup. " "=I irr. DIZSMAS - FLII
|
||||
#define FLTSCM 39 // Flag Tipo Sollecito DIZSMAS - FLTS
|
||||
#define FLEPCM 40 // *=Est.EP Non è più usato DIZSMAS - FLEP
|
||||
#define DPERCM 41 // Dati Personalizzabili DIZSMAS - DPER
|
||||
#define CONSCM 42 // Gr.Co.Sottoc.Sostitutivo DIZSMAS - CONS
|
||||
#define DTSTCM 43 // Nr.progr. rateo/risconto -
|
||||
#define USERCM 44 // Utente DIZSMAS - NOMU
|
||||
#define DTUMCM 45 // Data ultima manutenzione DIZSMAS - DATS
|
||||
#define TPUMCM 46 // Tipo ultima manutenzione DIZSMAS - FLAG
|
||||
#define FL01CM 47 // Flag Generico DIZSMAS - FLAG
|
||||
#define FL02CM 48 // Flag Generico DIZSMAS - FLAG
|
||||
#define FL03CM 49 // Flag Generico DIZSMAS - FLAG
|
||||
#define FL04CM 50 // Flag Generico DIZSMAS - FLAG
|
||||
#define FL05CM 51 // Flag Generico DIZSMAS - FLAG
|
||||
#define CMBECM 52 // Cambio EURO DIZSMAS - CAME
|
||||
#define IMVACM2 53 // Importo Val 2 DIZSMAS - IMPO
|
||||
#define IMPSCM2 54 // Imposta 2 DIZSMAS - IMPS
|
||||
// Tracciato File: FGA5DAT/CGSCA00F - CGSCA : Scadenze INDEX 9/12/09 17:43:05 Pag. 1
|
||||
#define TR01CD 0 // A=Att./Sosp./Ann/Estr.ant.ft DIZSMAS - ATTI
|
||||
#define DT01CD 1 // Data ult.manut. DIZSMAS - DATS
|
||||
#define NR01CD 2 // Numero azione di aggiornamento DIZSMAS - NRAZ
|
||||
#define CDDTCD 3 // Codice Ditta DIZSMAS - CDDT
|
||||
#define AAPRCD 4 // Anno Operazione DIZSMAS - AAPR Key 1
|
||||
#define ANNPCD 5 // Anno Reg.DA GESTIRE DIZSMAS - ANNP
|
||||
#define TPGICD 6 // Giornale IVA TB=GI DIZSMAS - TPGI Key 2
|
||||
#define DTOPCD 7 // Data operazione DIZSMAS - DATS Key 3
|
||||
#define NONPCD 8 // Nr. Operaz./Nr. Prot. DIZSMAS - NONP Key 4
|
||||
#define NRRGCD 9 // Numero Riga 2 DIZSMAS - NRR2 Key 5
|
||||
#define PROGCD 10 // Progressivo DIZSMAS - PROG Key 6
|
||||
#define IMPOCD 11 // Importo "-"=Avere DIZSMAS - IMPO
|
||||
#define CDVACD 12 // Codice Valuta TB=VA DIZSMAS - CDVA
|
||||
#define CAMBCD 13 // Cambio DIZSMAS - CAMB
|
||||
#define IMVACD 14 // Importo Valuta DIZSMAS - IMVA
|
||||
#define SCADCD 15 // Data scadenza DIZSMAS - DATS
|
||||
#define TIPOCD 16 // Tipo Effetto DIZSMAS - TIPO
|
||||
#define GEINCD 17 // * = Generato RCD su Insoluti DIZSMAS - FLAG
|
||||
#define CAMBCD2 18 // Cambio EURO DIZSMAS - CAME
|
||||
#define IMVACD2 19 // Importo val2 DIZSMAS - IMPO
|
||||
|
||||
// Tracciato File: FGA5DAT/CGSPA00F - CGSPA : Scadenze partite aperte 9/12/09 17:43:12 Pag. 1
|
||||
#define AT01PA 0 // Tipo provvisorio DIZSMAS - ATTI
|
||||
#define CONTPA 1 // Gr. Conto Sottoconto DIZSMAS - CONT1
|
||||
#define DIVIPA 2 // Divisione TB=DI DIZSMAS - DIVI
|
||||
#define AAOPPA 3 // Anno partita DIZSMAS - ANNO
|
||||
#define NPARPA 4 // Nr Partita DIZSMAS - NPAR
|
||||
#define NONPPA 5 // Nr. Operaz./Nr. Prot. DIZSMAS - NONP
|
||||
#define DTRGPA 6 // Data registrazione DIZSMAS - DATS
|
||||
#define IMPOPA 7 // Importo "-"=Avere DIZSMAS - IMPO
|
||||
#define CDVAPA 8 // Codice Valuta TB=VA DIZSMAS - CDVA
|
||||
#define CAMBPA 9 // Cambio DIZSMAS - CAMB
|
||||
#define IMVAPA 10 // Importo Valuta DIZSMAS - IMVA
|
||||
#define DTSCPA 11 // Data scadenza DIZSMAS - DATS
|
||||
#define DTDOPA 12 // Data documento DIZSMAS - DATS
|
||||
#define NRDOPA 13 // N° Documento DIZSMAS - NUDO
|
||||
#define CDRAPA 14 // Codice rata Tab.ET DIZSMAS - TIPO
|
||||
#define TIPOPA 15 // Tipo Effetto DIZSMAS - TIPO
|
||||
#define DSTIPA 16 // Descr.tipo rata -
|
||||
#define NREFPA 17 // Nr.effetto attivo DIZSMAS - NREF
|
||||
#define NREPPA 18 // Nr.effetto passivo DIZSMAS - NREF
|
||||
#define FL01PA 19 // Flag Generico DIZSMAS - FLAG
|
||||
#define FL02PA 20 // Flag Generico DIZSMAS - FLAG
|
||||
#define FL03PA 21 // Flag Generico DIZSMAS - FLAG
|
||||
#define FL04PA 22 // Flag Generico DIZSMAS - FLAG
|
||||
#define FL05PA 23 // Flag Generico DIZSMAS - FLAG
|
||||
#define FL06PA 24 // Flag Generico DIZSMAS - FLAG
|
||||
#define FL07PA 25 // Flag Generico DIZSMAS - FLAG
|
||||
#define FL08PA 26 // Flag Generico DIZSMAS - FLAG
|
||||
#define FL09PA 27 // Flag Generico DIZSMAS - FLAG
|
||||
#define FL10PA 28 // Flag Generico DIZSMAS - FLAG
|
||||
#define CAMBPA2 29 // Cambio EURO DIZSMAS - CAME
|
||||
#define IMPOPA2 30 // Importo val 2 DIZSMAS - IMPO
|
||||
|
||||
class TCausali_cache : public TCache
|
||||
{
|
||||
protected:
|
||||
virtual TObject* key2obj(const char* key);
|
||||
|
||||
public:
|
||||
const TCausale& causale(const char* codice, int annoiva);
|
||||
};
|
||||
|
||||
TObject* TCausali_cache::key2obj(const char* key)
|
||||
{
|
||||
// Metodo bastardo per evitare TToken_string temporanee "a randa"
|
||||
// sfrutto chiave a lunghezza fissa
|
||||
const int anno = atoi(key);
|
||||
const char* codice = key+5;
|
||||
TCausale* pcaus = new TCausale(codice, anno);
|
||||
return pcaus;
|
||||
}
|
||||
|
||||
const TCausale& TCausali_cache::causale(const char* codice, int annoiva)
|
||||
{
|
||||
// Metodo bastardo per evitare TToken_string temporanee "a randa"
|
||||
// creo chiave a lunghezza fissa anno+codice = 9999|AAA
|
||||
TString8 key;
|
||||
key.format("%04d|%s", annoiva, codice);
|
||||
return *(const TCausale*)objptr(key);
|
||||
}
|
||||
|
||||
class TImporta_sc_recset : public TCSV_recordset
|
||||
{
|
||||
@ -158,7 +188,7 @@ bool TImporta_sc_mask::on_field_event(TOperable_field& f, TField_event e, long j
|
||||
class TImporta_sc : public TSkeleton_application
|
||||
{
|
||||
virtual bool check_autorization() const {return false;}
|
||||
virtual const char * extra_modules() const {return "ve";}
|
||||
virtual const char * extra_modules() const {return "ba";}
|
||||
|
||||
TImporta_sc_mask* _msk;
|
||||
|
||||
@ -169,288 +199,152 @@ public:
|
||||
virtual bool create();
|
||||
virtual bool destroy();
|
||||
virtual void main_loop();
|
||||
void build_IVA(TConfig & conf, TArray & rows, TString_array & concg, TArray & impcg);
|
||||
void build_table();
|
||||
void transfer(const TFilename& file);
|
||||
|
||||
TImporta_sc() {};
|
||||
};
|
||||
|
||||
void TImporta_sc::build_IVA(TConfig & conf, TArray & rows, TString_array & concg, TArray & impcg)
|
||||
bool build_rec(const TRelation& rel, void* pJolly)
|
||||
{
|
||||
const int items = rows.items();
|
||||
TString paragraph;
|
||||
CHECK(pJolly != NULL, "Null Table");
|
||||
|
||||
if (items > 0)
|
||||
TTable * gmm = (TTable * ) pJolly;
|
||||
long nmov = rel.lfile().get_long(MOV_NUMREG);
|
||||
TString key = rel.lfile().get(MOV_DESCR);
|
||||
int p = key.find("Part. ");
|
||||
|
||||
if (p >= 0)
|
||||
{
|
||||
int nrigai = 1;
|
||||
int i = 0;
|
||||
TString *gcs = (TString *)concg.first_item();
|
||||
real imptot = *((real *) impcg.first_item());
|
||||
TString4 gruppo = gcs->left(2);
|
||||
TString4 conto = gcs->mid(2, 2);
|
||||
TString8 sottoconto = gcs->right(6);
|
||||
p += 6;
|
||||
|
||||
while (i < items)
|
||||
{
|
||||
TRectype & rec = (TRectype &)rows[i];
|
||||
real imp = rec.get(RMI_IMPONIBILE);
|
||||
real iva = rec.get(RMI_IMPOSTA);
|
||||
if (imp <= imptot)
|
||||
i++;
|
||||
else
|
||||
{
|
||||
TCodiceIVA codiva(rec.get(RMI_CODIVA));
|
||||
|
||||
imp -= imptot;
|
||||
rec.put(RMI_IMPONIBILE, imp);
|
||||
imp = imptot;
|
||||
real iv = codiva.imposta(imptot);
|
||||
iva -= iv;
|
||||
rec.put(RMI_IMPOSTA, iva);
|
||||
iva = iv;
|
||||
}
|
||||
imptot -= imp;
|
||||
paragraph.format("%d,%d",LF_RMOVIVA,nrigai++);
|
||||
conf.set_paragraph(paragraph);
|
||||
conf.set(RMI_CODIVA, rec.get(RMI_CODIVA));
|
||||
conf.set(RMI_TIPODET, rec.get(RMI_TIPODET));
|
||||
conf.set(RMI_IMPONIBILE, imp.string());
|
||||
conf.set(RMI_IMPOSTA, iva.string());
|
||||
conf.set(RMI_GRUPPO, gruppo);
|
||||
conf.set(RMI_CONTO, conto);
|
||||
conf.set(RMI_SOTTOCONTO, sottoconto);
|
||||
if (imptot <= 0)
|
||||
{
|
||||
gcs = (TString *)concg.succ_item();
|
||||
if (gcs == NULL)
|
||||
break;
|
||||
imptot = *((real *) impcg.succ_item());
|
||||
gruppo = gcs->left(2);
|
||||
conto = gcs->mid(2, 2);
|
||||
sottoconto = gcs->right(6);
|
||||
}
|
||||
}
|
||||
const int p1 = key.find(" ", p);
|
||||
|
||||
gmm->zero();
|
||||
key.cut(p1);
|
||||
key = key.mid(p);
|
||||
gmm->put("CODTAB", key);
|
||||
gmm->put("I0", nmov);
|
||||
gmm->write_rewrite();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void TImporta_sc::build_table()
|
||||
{
|
||||
TTable gmm("GMM");
|
||||
TCursor mov(new TRelation(LF_MOV));
|
||||
|
||||
if (gmm.items() != mov.items())
|
||||
mov.scan(build_rec, &gmm, "Costruzione tabella di correlazione movimenti");
|
||||
}
|
||||
|
||||
void TImporta_sc::transfer(const TFilename& file)
|
||||
{
|
||||
TFilename outdir(_msk->get(F_PATHOUT));
|
||||
TImporta_sc_recset s(file);
|
||||
TProgind pi(s.items(),"Importazione saldaconto in corso ...",true,true);
|
||||
TConfig * conf = NULL;
|
||||
long nmov = - 1;
|
||||
int anno = 0;
|
||||
TString8 reg;
|
||||
TDate dataop;
|
||||
int nrigac = 1;
|
||||
long ntran = 1L;
|
||||
bool iva = false;
|
||||
int part;
|
||||
TString4 gruppo;
|
||||
TString4 conto;
|
||||
TString8 sottoconto;
|
||||
const int codes = _msk->get_int(F_ANNOES);
|
||||
const long ditta = _msk->get_long(F_CODITTA);
|
||||
const TEsercizi_contabili esc;
|
||||
TArray rows;
|
||||
TArray impcg;
|
||||
TString_array concg;
|
||||
TString descr(50);
|
||||
TPartita * game;
|
||||
long nreg;
|
||||
TCausali_cache cache_causali;
|
||||
|
||||
for (bool ok=s.move_first();ok;ok=s.move_next())
|
||||
{
|
||||
if (!pi.addstatus(1))
|
||||
break;
|
||||
|
||||
const long dt = s.get(CDDTCM).as_int();
|
||||
const int a = s.get(AAOPPA).as_int();
|
||||
const long p = s.get(NPARPA).as_int();
|
||||
|
||||
if (ditta != dt)
|
||||
continue;
|
||||
const TDate datareg(s.get(DTRGCM).as_int());
|
||||
if (datareg.year() == 2009)
|
||||
int i = 1;
|
||||
const int es = esc.date2esc(datareg);
|
||||
|
||||
if (codes != es)
|
||||
continue;
|
||||
const int a = s.get(AAPRCM).as_int();
|
||||
const TString8 r = s.get(TPGICM).as_string();
|
||||
const TDate d(s.get(DTOPCM).as_int());
|
||||
const long n = s.get(NONPCM).as_int();
|
||||
|
||||
if (anno != a || reg != r || dataop != d || n != nmov )
|
||||
if (anno != a || p != part )
|
||||
{
|
||||
if (iva && conf != NULL)
|
||||
build_IVA(*conf, rows, concg, impcg);
|
||||
anno = a;
|
||||
reg = r;
|
||||
dataop = d;
|
||||
nmov = n;
|
||||
part = p;
|
||||
|
||||
if (conf != NULL)
|
||||
delete conf;
|
||||
conf = NULL;
|
||||
TFilename temp(outdir);
|
||||
const TString8 reg = s.get(DIVIPA).as_string();
|
||||
const TDate dataop(s.get(DTRGPA).as_int());
|
||||
const long nmov = s.get(NONPPA).as_int();
|
||||
TToken_string key(25, ',');
|
||||
|
||||
temp << '/' << format("%05ld", ntran++);
|
||||
temp.ext("ini");
|
||||
if (fexist(temp))
|
||||
remove_file(temp);
|
||||
conf = new TConfig(temp);
|
||||
conf->set_paragraph("Transaction"); //setto il paragrafo [Transaction] del file ini
|
||||
conf->set("Action","INSERT");
|
||||
conf->set("Mode","AUTO");
|
||||
key.add(anno);
|
||||
key.add(reg);
|
||||
key.add(dataop.string());
|
||||
key.add(nmov);
|
||||
|
||||
conf->set_paragraph("23"); //setto il paragrafo [23] del file ini (testata)
|
||||
TString8 codcaus = s.get(CAUSCM).as_string();
|
||||
if (atoi(codcaus) != 0)
|
||||
codcaus << '0';
|
||||
conf->set(MOV_CODCAUS, codcaus);
|
||||
conf->set(MOV_DATAREG, datareg.string());
|
||||
const int codpag = s.get(CDPGCM).as_int();
|
||||
if (codpag != 0)
|
||||
conf->set(MOV_CODPAG, format("%03d", codpag));
|
||||
|
||||
TDate datadoc(s.get(DTDOCM).as_int());
|
||||
|
||||
conf->set(MOV_DATADOC, datadoc.string());
|
||||
nreg = cache().get("GMM", key).get_long("I0");
|
||||
|
||||
TString16 ndoc = s.get(NRDOCM).as_string();
|
||||
|
||||
if (ndoc == "0")
|
||||
ndoc.cut(0);
|
||||
conf->set(MOV_NUMDOC, ndoc);
|
||||
conf->set(MOV_STAMPATO, "X");
|
||||
conf->set(MOV_REGST, "X");
|
||||
iva = s.get(TPMVCM).as_string() == "I";
|
||||
if (iva)
|
||||
if (game != NULL)
|
||||
{
|
||||
conf->set(MOV_REG, s.get(TPGICM).as_string());
|
||||
conf->set(MOV_PROTIVA, n);
|
||||
game->write();
|
||||
delete game;
|
||||
}
|
||||
nrigac = 1;
|
||||
rows.destroy();
|
||||
impcg.destroy();
|
||||
concg.destroy();
|
||||
game = NULL;
|
||||
}
|
||||
|
||||
const TString gcs = s.get(CONTCM).as_string();
|
||||
TString4 sez("D");
|
||||
|
||||
if (gcs.full())
|
||||
{
|
||||
TString8 paragraph;
|
||||
real importo = s.get(IMPOCM).as_real();
|
||||
TToken_string keymov;
|
||||
|
||||
if (importo < ZERO)
|
||||
{
|
||||
importo = -importo;
|
||||
sez = "A";
|
||||
}
|
||||
gruppo = gcs.left(2);
|
||||
conto = gcs.mid(2, 2);
|
||||
sottoconto = gcs.right(6);
|
||||
if (iva)
|
||||
{
|
||||
TToken_string key;
|
||||
keymov.add(nreg);
|
||||
const TRectype & mov = cache().get(LF_MOV, keymov);
|
||||
|
||||
key.add(gruppo);
|
||||
key.add(conto);
|
||||
const TString4 tipocf = cache().get(LF_PCON, key, PCN_TMCF);
|
||||
keymov.add(1);
|
||||
|
||||
if (tipocf.full())
|
||||
{
|
||||
conf->set_paragraph("23"); //setto il paragrafo [23] del file ini (testata)
|
||||
conf->set(MOV_TIPO, tipocf);
|
||||
conf->set(MOV_CODCF, sottoconto);
|
||||
conf->set(MOV_TOTDOC, importo.string());
|
||||
paragraph.format("%d,%d",LF_RMOV,nrigac++);
|
||||
conf->set_paragraph(paragraph);
|
||||
conf->set(RMV_SEZIONE, sez);
|
||||
conf->set(RMV_TIPOC, tipocf);
|
||||
conf->set(RMV_IMPORTO, importo.string());
|
||||
conf->set(RMV_GRUPPO, gruppo);
|
||||
conf->set(RMV_CONTO, conto);
|
||||
conf->set(RMV_SOTTOCONTO, sottoconto);
|
||||
conf->set(RMV_ROWTYPE, "T");
|
||||
}
|
||||
else
|
||||
{
|
||||
concg.add(gcs);
|
||||
impcg.add(importo);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
paragraph.format("%d,%d",LF_RMOV,nrigac++);
|
||||
conf->set_paragraph(paragraph);
|
||||
conf->set(RMV_SEZIONE, sez);
|
||||
conf->set(RMV_IMPORTO, importo.string());
|
||||
conf->set(RMV_GRUPPO, gruppo);
|
||||
conf->set(RMV_CONTO, conto);
|
||||
conf->set(RMV_SOTTOCONTO, sottoconto);
|
||||
}
|
||||
}
|
||||
else
|
||||
if (iva)
|
||||
{
|
||||
TString8 paragraph;
|
||||
real importo = s.get(IMPOCM).as_real();
|
||||
real imposta = s.get(IMPSCM).as_real();
|
||||
const TRectype & rmov = cache().get(LF_RMOV, keymov);
|
||||
TBill clifo(rmov);
|
||||
|
||||
if (importo < ZERO)
|
||||
{
|
||||
importo = -importo;
|
||||
sez = "A";
|
||||
}
|
||||
if (imposta < ZERO) // giusto ?
|
||||
imposta = -imposta;
|
||||
const TCausale & c = cache_causali.causale(mov.get(MOV_CODCAUS), mov.get_int(MOV_ANNOIVA));
|
||||
|
||||
if (game == NULL)
|
||||
game = new TPartita(clifo, anno, format("%7d", part));
|
||||
|
||||
const real ind = s.get(INDECM).as_real();
|
||||
const TString4 codiva = s.get(CDIVCM).as_string();
|
||||
TRiga_partite& partita = game->new_row();
|
||||
|
||||
if (ind > ZERO && ind < CENTO)
|
||||
{
|
||||
TRectype rec(LF_RMOVIVA);
|
||||
partita.put(PART_TIPOMOV, c.tipomov());
|
||||
partita.put(PART_DATAREG, mov.get(MOV_DATAREG));
|
||||
partita.put(PART_DATADOC, mov.get(MOV_DATADOC));
|
||||
partita.put(PART_NUMDOC, mov.get(MOV_NUMDOC));
|
||||
descr = s.get(DSTIPA).as_string();
|
||||
if (descr.blank())
|
||||
descr = mov.get(MOV_DESCR);
|
||||
partita.put(PART_DESCR, descr);
|
||||
partita.put(PART_CODCAUS, c.codice());
|
||||
partita.put(PART_REG, c.reg().name());
|
||||
partita.put(PART_SEZ, c.sezione(1));
|
||||
|
||||
real impind = importo * ind / 100;
|
||||
real ivaind = importo * ind / 100;
|
||||
impind.round(2);
|
||||
ivaind.round(2);
|
||||
importo -= impind;
|
||||
imposta -= ivaind;
|
||||
rec.put(RMI_CODIVA, codiva);
|
||||
rec.put(RMI_TIPODET, "9");
|
||||
rec.put(RMI_IMPONIBILE, impind.string());
|
||||
rec.put(RMI_IMPOSTA, ivaind.string());
|
||||
rec.put(RMI_GRUPPO, gruppo);
|
||||
rec.put(RMI_CONTO, conto);
|
||||
rec.put(RMI_SOTTOCONTO, sottoconto);
|
||||
rows.add(rec);
|
||||
}
|
||||
TRectype rec(LF_RMOVIVA);
|
||||
partita.put(PART_SOTTOCONTO, clifo.sottoconto());
|
||||
const TString8 codpag(mov.get(MOV_CODPAG));
|
||||
TPagamento pag(codpag);
|
||||
partita.put(PART_CODPAG, codpag);
|
||||
partita.put(PART_TIPOPAG, pag.tipo_rata(0));
|
||||
|
||||
rec.put(RMI_CODIVA, codiva);
|
||||
if (ind >= CENTO)
|
||||
rec.put(RMI_TIPODET, "9");
|
||||
rec.put(RMI_IMPONIBILE, importo.string());
|
||||
rec.put(RMI_IMPOSTA, imposta.string());
|
||||
rec.put(RMI_GRUPPO, gruppo);
|
||||
rec.put(RMI_CONTO, conto);
|
||||
rec.put(RMI_SOTTOCONTO, sottoconto);
|
||||
rows.add(rec);
|
||||
}
|
||||
}
|
||||
if (conf != NULL)
|
||||
delete conf;
|
||||
partita.put(PART_GRUPPOCL, clifo.gruppo());
|
||||
partita.put(PART_CONTOCL, clifo.conto());
|
||||
partita.put(PART_PROTIVA, mov.get(MOV_PROTIVA));
|
||||
|
||||
real residuo = s.get(IMPOPA).as_real();
|
||||
TImporto importo(residuo.sign() < 0 ? 'A' : 'D', abs(residuo));
|
||||
importo.normalize(c.sezione(1));
|
||||
partita.add(PART_IMPTOTDOC, importo.valore());
|
||||
partita.put(PART_IMPORTO, importo.valore());
|
||||
|
||||
TRiga_scadenze& scadenza = partita.new_row();
|
||||
|
||||
if (yesno_box(FR("Si desidera confermare l'importazione di %ld record di saldaconto"), ntran -1))
|
||||
scadenza.put(SCAD_CODPAG, mov.get(MOV_CODPAG));
|
||||
scadenza.put(SCAD_DATASCAD, s.get(DTSCPA).as_string());
|
||||
scadenza.put(SCAD_IMPORTO, importo.valore());
|
||||
scadenza.put(SCAD_TIPOPAG, partita.get(PART_TIPOPAG));
|
||||
}
|
||||
if (game != NULL)
|
||||
{
|
||||
TString app;
|
||||
|
||||
app << "cg2 -0 -i" << outdir << "/*.ini";
|
||||
TExternal_app primanota(app);
|
||||
primanota.run(true);
|
||||
game->write();
|
||||
delete game;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -4,5 +4,3 @@
|
||||
#define F_RAGSOC 102
|
||||
#define F_PATH 103
|
||||
#define F_NAME 104
|
||||
#define F_ANNOES 105
|
||||
#define F_PATHOUT 106
|
||||
|
@ -49,7 +49,7 @@ BEGIN
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 90 5
|
||||
GROUPBOX DLG_NULL 90 4
|
||||
BEGIN
|
||||
PROMPT 2 4 "@bSorgente"
|
||||
END
|
||||
@ -69,33 +69,6 @@ BEGIN
|
||||
CHECKTYPE REQUIRED
|
||||
END
|
||||
|
||||
NUMBER F_ANNOES 4
|
||||
BEGIN
|
||||
PROMPT 3 7 "Esercizio "
|
||||
USE ESC
|
||||
INPUT CODTAB F_ANNOES
|
||||
DISPLAY "Codice Esercizio" CODTAB
|
||||
DISPLAY "Data inizio esercizio" D0
|
||||
DISPLAY "Data fine esercizio " D1
|
||||
OUTPUT F_ANNOES CODTAB
|
||||
FIELD AnnoEs
|
||||
CHECKTYPE REQUIRED
|
||||
END
|
||||
|
||||
|
||||
GROUPBOX DLG_NULL 90 4
|
||||
BEGIN
|
||||
PROMPT 2 9 "@bDestinazione"
|
||||
END
|
||||
|
||||
STRING F_PATHOUT 256 39
|
||||
BEGIN
|
||||
PROMPT 3 10 "Cartella "
|
||||
DSELECT
|
||||
CHECKTYPE REQUIRED
|
||||
FIELD ComOutPath
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
ENDMASK
|
607
ps/pe0001300.cpp
607
ps/pe0001300.cpp
@ -12,6 +12,10 @@
|
||||
#include <textset.h>
|
||||
#include <tabutil.h>
|
||||
|
||||
#include "../ce/ammce.h"
|
||||
#include "../ce/cespi.h"
|
||||
#include "../ce/salce.h"
|
||||
|
||||
#include "../cg/cglib01.h"
|
||||
|
||||
#include "pe0001.h"
|
||||
@ -22,61 +26,133 @@
|
||||
#include <rmov.h>
|
||||
#include <rmoviva.h>
|
||||
|
||||
#define AT01CM 0 // Record attivo/sospeso/annullato DIZSMAS - ATTI
|
||||
#define DT01CM 1 // Data stampa per G.Gen.le DIZSMAS - DATS
|
||||
#define NR01CM 2 // Numero azione di aggiornamento DIZSMAS - NRAZ
|
||||
#define TPMVCM 3 // Flag IVA I=IVA =no IVA DIZSMAS - TPMV
|
||||
#define CDDTCM 4 // Codice Ditta DIZSMAS - CDDT
|
||||
#define AAPRCM 5 // Anno Operazione DIZSMAS - AAPR
|
||||
#define ANNPCM 6 // Anno Reg.DA GESTIRE DIZSMAS - ANNP
|
||||
#define TPGICM 7 // Giornale IVA TB=GI DIZSMAS - TPGI
|
||||
#define DTOPCM 8 // Data operazione DIZSMAS - DATS
|
||||
#define NONPCM 9 // Nr. Operaz./Nr. Prot. DIZSMAS - NONP
|
||||
#define NRRGCM 10 // Numero Riga 2 DIZSMAS - NRR2
|
||||
#define NRGICM 11 // Nr Riga Giornale DIZSMAS - NRGI
|
||||
#define CONTCM 12 // Gr. Conto Sottoconto DIZSMAS - CONT
|
||||
#define DIVICM 13 // Divisione TB=DI DIZSMAS - DIVI
|
||||
#define NPARCM 14 // Nr Partita DIZSMAS - NPAR
|
||||
#define AAOPCM 15 // Anno partita DIZSMAS - ANNO
|
||||
#define DTRGCM 16 // Data registrazione DIZSMAS - DATS
|
||||
#define CAUSCM 17 // Causale TB=CA DIZSMAS - CAUS
|
||||
#define DSUPCM 18 // Descrizione Supplementare DIZSMAS - DSUP
|
||||
#define IMPOCM 19 // Importo "-"=Avere DIZSMAS - IMPO
|
||||
#define CDVACM 20 // Codice Valuta TB=VA DIZSMAS - CDVA
|
||||
#define CAMBCM 21 // Cambio DIZSMAS - CAMB
|
||||
#define IMVACM 22 // Importo Valuta DIZSMAS - IMVA
|
||||
#define CDPGCM 23 // Codice di Pagamento TB=CP DIZSMAS - CDPG
|
||||
#define DT1SCM 24 // Data I^ scadenza DIZSMAS - DATS
|
||||
#define DTDOCM 25 // Data documento DIZSMAS - DATS
|
||||
#define NRDOCM 26 // N° Documento DIZSMAS - NUDO
|
||||
#define CCTPCM 27 // Centri Costo Tipico TB=CC DIZSMAS - CCTP
|
||||
#define NCOMCM 28 // Numero Commessa DIZSMAS - NCOM
|
||||
#define CDSCCM 29 // Codice Sottocommessa DIZSMAS - CDSC
|
||||
#define INDECM 30 // Indetraibilità % DIZSMAS - INDE
|
||||
#define CDIVCM 31 // Codice IVA DIZSMAS - CDIV
|
||||
#define IMPSCM 32 // Imposta DIZSMAS - IMPS
|
||||
#define CDAGCM 33 // Codice Agente DIZSMAS - CDAG
|
||||
#define DTVBCM 34 // Data Liquidazione Iva Sospesa DIZSMAS - DATS
|
||||
#define FLSBCM 35 // Flag *=Stampato Bollato DIZSMAS - FLSB
|
||||
#define FSBICM 36 // Flag *=Stampato Boll.IVA DIZSMAS - FSBI
|
||||
#define FLVZCM 37 // V=Var.S=Storno P=Liq.prec. E=Esig.Sosp. DIZSMAS - FLVZ
|
||||
#define FLIICM 38 // Flag IVA Irrecup. " "=I irr. DIZSMAS - FLII
|
||||
#define FLTSCM 39 // Flag Tipo Sollecito DIZSMAS - FLTS
|
||||
#define FLEPCM 40 // *=Est.EP Non è più usato DIZSMAS - FLEP
|
||||
#define DPERCM 41 // Dati Personalizzabili DIZSMAS - DPER
|
||||
#define CONSCM 42 // Gr.Co.Sottoc.Sostitutivo DIZSMAS - CONS
|
||||
#define DTSTCM 43 // Nr.progr. rateo/risconto -
|
||||
#define USERCM 44 // Utente DIZSMAS - NOMU
|
||||
#define DTUMCM 45 // Data ultima manutenzione DIZSMAS - DATS
|
||||
#define TPUMCM 46 // Tipo ultima manutenzione DIZSMAS - FLAG
|
||||
#define FL01CM 47 // Flag Generico DIZSMAS - FLAG
|
||||
#define FL02CM 48 // Flag Generico DIZSMAS - FLAG
|
||||
#define FL03CM 49 // Flag Generico DIZSMAS - FLAG
|
||||
#define FL04CM 50 // Flag Generico DIZSMAS - FLAG
|
||||
#define FL05CM 51 // Flag Generico DIZSMAS - FLAG
|
||||
#define CMBECM 52 // Cambio EURO DIZSMAS - CAME
|
||||
#define IMVACM2 53 // Importo Val 2 DIZSMAS - IMPO
|
||||
#define IMPSCM2 54 // Imposta 2 DIZSMAS - IMPS
|
||||
// Tracciato File: FGA5DAT/AMANA00F - AMANA : Anagrafico Cespiti INDEX UNIQUE 26/11/09 12:15:29 Pag. 1
|
||||
|
||||
#define AT01AA 0 // Record attivo/sospeso/annullato DIZSMAS - ATTI
|
||||
#define DT01AA 1 // Data ult.manut. DIZSMAS - DATS
|
||||
#define NR01AA 2 // Numero azione di aggiornamento DIZSMAS - NRAZ
|
||||
#define CDDTAA 3 // Codice Ditta DIZSMAS - CDDT
|
||||
#define CCESAA 4 // Codice Cespite DIZSMAS - CCES Key 1
|
||||
#define DCESAA 5 // Descr. Cespite DIZSMAS - DCES
|
||||
#define SIGLAA 6 // Sigla DIZSMAS - SIGL
|
||||
#define DACEAA 7 // Descr. Aggiun. Cespite DIZSMAS - DACE
|
||||
#define MATRAA 8 // Matricola DIZSMAS - MATR
|
||||
#define UMBAAA 9 // Unita' Misura Base DIZSMAS - UMBA
|
||||
#define UBMAAA 10 // Ubicazione Magazzino DIZSMAS - UBMA
|
||||
#define CDNAAA 11 // Cod.Natura del Bene DIZSMAS - CDNA
|
||||
#define CDAFAA 12 // Codice Ammortamento Fiscale DIZSMAS - CDAF
|
||||
#define CDACAA 13 // Codice Ammortamento Civilis. DIZSMAS - CDAC
|
||||
#define CDATAA 14 // Codice Ammortamento Tecnico DIZSMAS - CDAT
|
||||
#define CCTPAA 15 // Centri Costo Tipico TB=CC DIZSMAS - CCTP
|
||||
#define NCOMAA 16 // Numero Commessa DIZSMAS - NCOM
|
||||
#define CDSCAA 17 // Codice Sottocommessa DIZSMAS - CDSC
|
||||
#define CLA1AA 18 // Classe 1 DIZSMAS - CLA1
|
||||
#define CLA2AA 19 // Classe 2 DIZSMAS - CLA2
|
||||
#define CLA3AA 20 // Classe 3 DIZSMAS - CLA3
|
||||
#define CLA4AA 21 // Classe 4 DIZSMAS - CLA4
|
||||
#define CLA5AA 22 // Classe 5 DIZSMAS - CLA5
|
||||
#define DTIAAA 23 // Data Inizio Ammort. DIZSMAS - DATS
|
||||
#define DTITAA 24 // Data Inizio Ammort.Tecnico DIZSMAS - DATS
|
||||
#define DTFAAA 25 // Data Fine Ammort. DIZSMAS - DATS
|
||||
#define FLSMAA 26 // Flag Soggetto a Manut. S/ DIZSMAS - FLSM
|
||||
#define CCEPAA 27 // Codice Cespite DIZSMAS - CCES
|
||||
|
||||
// Tracciato File: FGA5DAT/AMANI00F - AMANI : Anagrafico Cespiti: Valori iniziali INDEX UNIQUE 26/11/09 12:16:06 Pag. 1
|
||||
|
||||
#define DT01AAS 0 // Data ult.manut. DIZSMAS - DATS
|
||||
#define CDDTAAS 1 // Codice Ditta DIZSMAS - CDDT
|
||||
#define CCESAAS 2 // Codice Cespite DIZSMAS - CCES Key 1
|
||||
#define CCERAA 3 // Cesp. Rif. DIZSMAS - CCES
|
||||
#define VLIFAA 4 // Val.iniziale Fiscale DIZSMAS - $PRO
|
||||
#define DTIFAA 5 // Data Inizio Ammort.Fiscale DIZSMAS - DATS
|
||||
#define VLICAA 6 // Val.iniziale Civilistico DIZSMAS - $PRO
|
||||
#define DTICAA 7 // Data Inizio Ammort.Civilistico DIZSMAS - DATS
|
||||
#define VLG1AA 8 // Valore iniziale Gestion.1 DIZSMAS - $PRO
|
||||
#define DTG1AA 9 // Data Inizio Ammort.Gestion.1 DIZSMAS - DATS
|
||||
#define VLG2AA 10 // Valore iniziale Gestion.2 DIZSMAS - $PRO
|
||||
#define DTG2AA 11 // Data Inizio Ammort.Gestion.2 DIZSMAS - DATS
|
||||
#define VLG3AA 12 // Valore iniziale Gestion.3 DIZSMAS - $PRO
|
||||
#define DTG3AA 13 // Data Inizio Ammort.Gestion.3 DIZSMAS - DATS
|
||||
#define VLG4AA 14 // Valore iniziale Gestion.4 DIZSMAS - $PRO
|
||||
#define DTG4AA 15 // Data Inizio Ammort.Gestion.4 DIZSMAS - DATS
|
||||
#define VLG5AA 16 // Valore iniziale Gestion.5 DIZSMAS - $PRO
|
||||
#define DTG5AA 17 // Data Inizio Ammort.Gestion.5 DIZSMAS - DATS
|
||||
#define CAMBAA 18 // Cambio EURO DIZSMAS - CAME
|
||||
#define VLIFAA2 19 // Val.iniz.Fisc. 2 DIZSMAS - $PRO
|
||||
#define VLICAA2 20 // Val.iniz. Civil. 2 DIZSMAS - $PRO
|
||||
#define VLG1AA2 21 // Val. iniz. Gest.1/2 DIZSMAS - $PRO
|
||||
#define VLG2AA2 22 // Val. iniz. Gest.2/2 DIZSMAS - $PRO
|
||||
#define VLG3AA2 23 // Val. iniz. Gest.3/2 DIZSMAS - $PRO
|
||||
#define VLG4AA2 24 // Val. iniz. Gest.4/2 DIZSMAS - $PRO
|
||||
#define VLG5AA2 25 // Val. iniz. Gest.5/2 DIZSMAS - $PRO
|
||||
#define FLG1AA 26 // Amm. inf. Gest.1/2 DIZSMAS - $FLG
|
||||
#define FLG2AA 27 // Amm. inf. Gest.2/2 DIZSMAS - $FLG
|
||||
#define FLG3AA 28 // Amm. inf. Gest.3/2 DIZSMAS - $FLG
|
||||
#define FLG4AA 29 // Amm. inf. Gest.4/2 DIZSMAS - $FLG
|
||||
#define FLG5AA 30 // Amm. inf. Gest.5/2 DIZSMAS - $FLG
|
||||
#define DTAQAA 31 // Data Acquisizione Cespite DIZSMAS - DATS
|
||||
#define CDCLAA 32 // Codice Centro Lavoro -
|
||||
#define CDMUAA 33 // Codice Macchina Utensile -
|
||||
#define DPERAA 34 // Dati personalizzabili
|
||||
|
||||
// Tracciato File: FGA5DAT/AMSTO00F - AMSTO : Storico Movimenti Cespiti *NOMAX IN 26/11/09 12:16:29 Pag. 1
|
||||
|
||||
#define AT01AS 0 // Record attivo/sospeso/annullato DIZSMAS - ATTI
|
||||
#define DT01AS 1 // Data ult.manut. DIZSMAS - DATS
|
||||
#define NR01AS 2 // Numero azione di aggiornamento DIZSMAS - NRAZ
|
||||
#define CDDTAS 3 // Codice Ditta DIZSMAS - CDDT
|
||||
#define CCESAS 4 // Codice Cespite DIZSMAS - CCES Key 1
|
||||
#define ANNOAS 5 // Anno Competenza DIZSMAS - ANNO
|
||||
#define DTIAAS 6 // Data Inizio Ammort. DIZSMAS - DATS
|
||||
#define DTFAAS 7 // Data Fine Ammort. DIZSMAS - DATS Key 2
|
||||
#define VLINAS 8 // Valore Iniziale DIZSMAS - VLIN
|
||||
#define VAVIAS 9 // Variazione Valore Iniziale DIZSMAS - VAVI
|
||||
#define PAGNAS 10 // % Ammort. Normale DIZSMAS - PAGN
|
||||
#define VAMNAS 11 // Valore Ammortamento Normale DIZSMAS - VAMN
|
||||
#define PAGAAS 12 // % Ammort. Anticipato DIZSMAS - PAGA
|
||||
#define VAMAAS 13 // Valore Ammortamento Anticip. DIZSMAS - VAMA
|
||||
#define PFANAS 14 // Progr.Fondo Ammort.Normale DIZSMAS - PFAN
|
||||
#define VAFNAS 15 // Variaz. Fondo Ammort.Norm. DIZSMAS - VAFN
|
||||
#define PFAAAS 16 // Progr.Fondo Ammort.Anticip. DIZSMAS - PFAA
|
||||
#define VAFAAS 17 // Variaz. Fondo Ammort.Antic. DIZSMAS - VAFA
|
||||
#define RESAAS 18 // Residuo da Ammortizzare DIZSMAS - RESA
|
||||
#define VAREAS 19 // Variazione Residuo da Amm. DIZSMAS - VARE
|
||||
#define PALFAS 20 // % Amm. Accelerato Fiscale DIZSMAS - PAGN
|
||||
#define VALFAS 21 // Valore Ammort.Accelerato Fiscale DIZSMAS - VAMN
|
||||
#define M1LFAS 22 // Mese Iniziale Accelerato Fiscale DIZSMAS - MMOP
|
||||
#define M2LFAS 23 // Mese Finale Accelerato Fiscale DIZSMAS - MMOP
|
||||
#define VLICAS 24 // Valore Iniziale Civilistico DIZSMAS - VLIN
|
||||
#define VVICAS 25 // Variaz. Valore Iniz. Civil. DIZSMAS - VAVI
|
||||
#define PANCAS 26 // % Ammort.Normale Civilistico DIZSMAS - PAGN
|
||||
#define VANCAS 27 // Valore Ammort.Normale Civil. DIZSMAS - VAMN
|
||||
#define PAACAS 28 // % Ammort.Anticipato Civilis. DIZSMAS - PAGA
|
||||
#define VAACAS 29 // Valore Ammort.Anticip.Civil. DIZSMAS - VAMA
|
||||
#define FANCAS 30 // Progr.Fondo Amm.Normale Civ. DIZSMAS - PFAN
|
||||
#define VFNCAS 31 // Variaz. Fondo Amm.Norm. Civ. DIZSMAS - VAFN
|
||||
#define FAACAS 32 // Progr.Fondo Amm.Anticip.Civ. DIZSMAS - PFAA
|
||||
#define VFACAS 33 // Variaz. Fondo Amm.Antic.Civ. DIZSMAS - VAFA
|
||||
#define RESCAS 34 // Residuo da Ammortizzare Civ. DIZSMAS - RESA
|
||||
#define VRECAS 35 // Variaz. Residuo da Amm. Civ. DIZSMAS - VARE
|
||||
#define PALCAS 36 // % Amm. Accelerato Civilistico DIZSMAS - PAGN
|
||||
#define VALCAS 37 // Valore Ammort.Accelerato Civilistico DIZSMAS - VAMN
|
||||
#define M1LCAS 38 // Mese Iniziale Accelerato Civilistico DIZSMAS - MMOP
|
||||
#define M2LCAS 39 // Mese Finale Accelerato Civilistico DIZSMAS - MMOP
|
||||
#define CAMBAS 40 // Cambio EURO DIZSMAS - CAME
|
||||
#define VLINAS2 41 // Val.iniz.2 DIZSMAS - VLIN
|
||||
#define VAVIAS2 42 // Var.iniz.2 DIZSMAS - VAVI
|
||||
#define VAMNAS2 43 // Val.Amm.Nor.2 DIZSMAS - VAMN
|
||||
#define VAMAAS2 44 // Val.Amm.Ant.2 DIZSMAS - VAMA
|
||||
#define PFANAS2 45 // Prg.Fondo Nor.2 DIZSMAS - PFAN
|
||||
#define VAFNAS2 46 // Var.Fondo Nor.2 DIZSMAS - VAFN
|
||||
#define PFAAAS2 47 // Prg.Fondo Ant.2 DIZSMAS - PFAA
|
||||
#define VAFAAS2 48 // Var.Fondo Ant.2 DIZSMAS - VAFA
|
||||
#define RESAAS2 49 // Residuo.2 DIZSMAS - RESA
|
||||
#define VAREAS2 50 // Var.Res.2 DIZSMAS - VARE
|
||||
#define VLICAS2 51 // Valore Iniziale Civil.2 DIZSMAS - VLIN
|
||||
#define VVICAS2 52 // Variaz. Valore Iniz. Civ.2 DIZSMAS - VAVI
|
||||
#define VANCAS2 53 // Valore Ammort.Normale Civ.2 DIZSMAS - VAMN
|
||||
#define VAACAS2 54 // Valore Ammort.Anti.Civil.2 DIZSMAS - VAMA
|
||||
#define FANCAS2 55 // Progr.Fondo Amm.Norm Civ.2 DIZSMAS - PFAN
|
||||
|
||||
class TImporta_cesp_recset : public TCSV_recordset
|
||||
{
|
||||
@ -169,285 +245,202 @@ public:
|
||||
virtual bool create();
|
||||
virtual bool destroy();
|
||||
virtual void main_loop();
|
||||
void build_IVA(TConfig & conf, TArray & rows, TString_array & concg, TArray & impcg);
|
||||
void transfer(const TFilename& file);
|
||||
void transfer(const TFilename& file, const TFilename& filesto);
|
||||
|
||||
TImporta_cesp() {};
|
||||
};
|
||||
|
||||
void TImporta_cesp::build_IVA(TConfig & conf, TArray & rows, TString_array & concg, TArray & impcg)
|
||||
{
|
||||
const int items = rows.items();
|
||||
TString paragraph;
|
||||
|
||||
if (items > 0)
|
||||
{
|
||||
int nrigai = 1;
|
||||
int i = 0;
|
||||
TString *gcs = (TString *)concg.first_item();
|
||||
real imptot = *((real *) impcg.first_item());
|
||||
TString4 gruppo = gcs->left(2);
|
||||
TString4 conto = gcs->mid(2, 2);
|
||||
TString8 sottoconto = gcs->right(6);
|
||||
|
||||
while (i < items)
|
||||
{
|
||||
TRectype & rec = (TRectype &)rows[i];
|
||||
real imp = rec.get(RMI_IMPONIBILE);
|
||||
real iva = rec.get(RMI_IMPOSTA);
|
||||
if (imp <= imptot)
|
||||
i++;
|
||||
else
|
||||
{
|
||||
TCodiceIVA codiva(rec.get(RMI_CODIVA));
|
||||
|
||||
imp -= imptot;
|
||||
rec.put(RMI_IMPONIBILE, imp);
|
||||
imp = imptot;
|
||||
real iv = codiva.imposta(imptot);
|
||||
iva -= iv;
|
||||
rec.put(RMI_IMPOSTA, iva);
|
||||
iva = iv;
|
||||
}
|
||||
imptot -= imp;
|
||||
paragraph.format("%d,%d",LF_RMOVIVA,nrigai++);
|
||||
conf.set_paragraph(paragraph);
|
||||
conf.set(RMI_CODIVA, rec.get(RMI_CODIVA));
|
||||
conf.set(RMI_TIPODET, rec.get(RMI_TIPODET));
|
||||
conf.set(RMI_IMPONIBILE, imp.string());
|
||||
conf.set(RMI_IMPOSTA, iva.string());
|
||||
conf.set(RMI_GRUPPO, gruppo);
|
||||
conf.set(RMI_CONTO, conto);
|
||||
conf.set(RMI_SOTTOCONTO, sottoconto);
|
||||
if (imptot <= 0)
|
||||
{
|
||||
gcs = (TString *)concg.succ_item();
|
||||
if (gcs == NULL)
|
||||
break;
|
||||
imptot = *((real *) impcg.succ_item());
|
||||
gruppo = gcs->left(2);
|
||||
conto = gcs->mid(2, 2);
|
||||
sottoconto = gcs->right(6);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void TImporta_cesp::transfer(const TFilename& file)
|
||||
void TImporta_cesp::transfer(const TFilename& file, const TFilename& filesto)
|
||||
{
|
||||
TFilename outdir(_msk->get(F_PATHOUT));
|
||||
TImporta_cesp_recset s(file);
|
||||
TImporta_cesp_recset st(fileSTO);
|
||||
TProgind pi(s.items(),"Importazione cespiti in corso ...",true,true);
|
||||
TConfig * conf = NULL;
|
||||
long nmov = - 1;
|
||||
int anno = 0;
|
||||
TString8 reg;
|
||||
TDate dataop;
|
||||
int nrigac = 1;
|
||||
long ntran = 1L;
|
||||
bool iva = false;
|
||||
TString4 gruppo;
|
||||
TString4 conto;
|
||||
TString8 sottoconto;
|
||||
const int codes = _msk->get_int(F_ANNOES);
|
||||
const long ditta = _msk->get_long(F_CODITTA);
|
||||
long ntran = 1;
|
||||
TString str(50);
|
||||
const TEsercizi_contabili esc;
|
||||
TArray rows;
|
||||
TArray impcg;
|
||||
TString_array concg;
|
||||
int lastes = esc.last();
|
||||
|
||||
for (bool ok=s.move_first();ok;ok=s.move_next())
|
||||
for (bool ok = s.move_first() && st.move_first(); ok ; ok = s.move_next() && st.move_next())
|
||||
{
|
||||
if (!pi.addstatus(1))
|
||||
break;
|
||||
|
||||
const long dt = s.get(CDDTCM).as_int();
|
||||
const long dt = s.get(CDDTAA).as_int();
|
||||
|
||||
if (ditta != dt)
|
||||
continue;
|
||||
const TDate datareg(s.get(DTRGCM).as_int());
|
||||
if (datareg.year() == 2009)
|
||||
int i = 1;
|
||||
const int es = esc.date2esc(datareg);
|
||||
|
||||
if (codes != es)
|
||||
continue;
|
||||
const int a = s.get(AAPRCM).as_int();
|
||||
const TString8 r = s.get(TPGICM).as_string();
|
||||
const TDate d(s.get(DTOPCM).as_int());
|
||||
const long n = s.get(NONPCM).as_int();
|
||||
TFilename temp(outdir);
|
||||
|
||||
if (anno != a || reg != r || dataop != d || n != nmov )
|
||||
temp << '/' << format("%05ld", ntran++);
|
||||
temp.ext("ini");
|
||||
if (fexist(temp))
|
||||
remove_file(temp);
|
||||
TConfig conf(temp);
|
||||
conf.set_paragraph("Transaction"); //setto il paragrafo [Transaction] del file ini
|
||||
conf.set("Action","INSERT");
|
||||
conf.set("Mode","AUTO");
|
||||
|
||||
conf.set_paragraph("139"); // setto il paragrafo cespi
|
||||
const long codces = s.get(CCESAA).as_int();
|
||||
|
||||
conf.set(CESPI_IDCESPITE, format("%010ld", codces));
|
||||
str = s.get(DCESAA).as_string();
|
||||
str << ' ' << s.get(SIGLAA).as_string();
|
||||
str << ' ' << s.get(DACEAA).as_string();
|
||||
str << ' ' << s.get(MATRAA).as_string();
|
||||
str.left(60);
|
||||
conf.set(CESPI_DESC, str);
|
||||
conf.set(CESPI_DTFUNZ, s.get(DTIAAA).as_string());
|
||||
conf.set(CESPI_DTALIEN, s.get(DTFAAA).as_string());
|
||||
conf.set(CESPI_TPSPEMAN, s.get(FLSMAA).as_bool() ? 2 : 1);
|
||||
/*
|
||||
#define CESPI_CODCGRA "CODCGRA"
|
||||
#define CESPI_CODSPA "CODSPA"
|
||||
#define CESPI_CODCGR "CODCGR"
|
||||
#define CESPI_CODSP "CODSP"
|
||||
#define CESPI_CODCAT "CODCAT"
|
||||
#define CESPI_CODIMP "CODIMP"
|
||||
#define CESPI_CODLOC "CODLOC"
|
||||
#define CESPI_CODORIG "CODORIG"
|
||||
#define CESPI_DTCOMP "DTCOMP"
|
||||
#define CESPI_AMMPROP "AMMPROP"
|
||||
#define CESPI_ESCLPR "ESCLPR"
|
||||
#define CESPI_USOPROM "USOPROM"
|
||||
#define CESPI_LEASING "LEASING"
|
||||
#define CESPI_TUIR "TUIR"
|
||||
#define CESPI_USATO "USATO"
|
||||
#define CESPI_ANNIRIC "ANNIRIC"
|
||||
#define CESPI_PMAT "PMAT"
|
||||
#define CESPI_PIMM "PIMM"
|
||||
#define CESPI_VINCOLO "VINCOLO"
|
||||
#define CESPI_PMINP "PMINP"
|
||||
#define CESPI_PMAXP "PMAXP"
|
||||
#define CESPI_CODVAL "CODVAL"
|
||||
#define CESPI_FLGTPVEI "FLGTPVEI"
|
||||
#define CESPI_VEIDIP "VEIDIP"
|
||||
#define CESPI_STABILIM "STABILIM"
|
||||
#define CESPI_REPARTO "REPARTO"
|
||||
#define CESPI_IDIMP "IDIMP"
|
||||
#define CESPI_PERCIMP "PERCIMP"
|
||||
#define CESPI_FABBR06 "FABBR06"
|
||||
|
||||
*/
|
||||
long dtst = st.get(CDDTAS).as_int();
|
||||
long codcesst = st.get(CCESAS).as_int();
|
||||
|
||||
if (ditta == dtst && codces == codcesst)
|
||||
{
|
||||
if (iva && conf != NULL)
|
||||
build_IVA(*conf, rows, concg, impcg);
|
||||
anno = a;
|
||||
reg = r;
|
||||
dataop = d;
|
||||
nmov = n;
|
||||
|
||||
if (conf != NULL)
|
||||
delete conf;
|
||||
conf = NULL;
|
||||
TFilename temp(outdir);
|
||||
|
||||
temp << '/' << format("%05ld", ntran++);
|
||||
temp.ext("ini");
|
||||
if (fexist(temp))
|
||||
remove_file(temp);
|
||||
conf = new TConfig(temp);
|
||||
conf->set_paragraph("Transaction"); //setto il paragrafo [Transaction] del file ini
|
||||
conf->set("Action","INSERT");
|
||||
conf->set("Mode","AUTO");
|
||||
|
||||
conf->set_paragraph("23"); //setto il paragrafo [23] del file ini (testata)
|
||||
TString8 codcaus = s.get(CAUSCM).as_string();
|
||||
if (atoi(codcaus) != 0)
|
||||
codcaus << '0';
|
||||
conf->set(MOV_CODCAUS, codcaus);
|
||||
conf->set(MOV_DATAREG, datareg.string());
|
||||
const int codpag = s.get(CDPGCM).as_int();
|
||||
if (codpag != 0)
|
||||
conf->set(MOV_CODPAG, format("%03d", codpag));
|
||||
int annoes = st.get(ANNOAS).as_bool();
|
||||
|
||||
TDate datadoc(s.get(DTDOCM).as_int());
|
||||
|
||||
conf->set(MOV_DATADOC, datadoc.string());
|
||||
|
||||
TString16 ndoc = s.get(NRDOCM).as_string();
|
||||
|
||||
if (ndoc == "0")
|
||||
ndoc.cut(0);
|
||||
conf->set(MOV_NUMDOC, ndoc);
|
||||
conf->set(MOV_STAMPATO, "X");
|
||||
conf->set(MOV_REGST, "X");
|
||||
iva = s.get(TPMVCM).as_string() == "I";
|
||||
if (iva)
|
||||
while (annoes != lastes)
|
||||
{
|
||||
conf->set(MOV_REG, s.get(TPGICM).as_string());
|
||||
conf->set(MOV_PROTIVA, n);
|
||||
ok = st.move_next();
|
||||
if (ok)
|
||||
{
|
||||
dtst = st.get(CDDTAS).as_int();
|
||||
codcesst = st.get(CCESAS).as_int();
|
||||
annoes = st.get(ANNOAS).as_bool();
|
||||
|
||||
if (ditta != dtst || codces != codcesst)
|
||||
break;
|
||||
}
|
||||
}
|
||||
nrigac = 1;
|
||||
rows.destroy();
|
||||
impcg.destroy();
|
||||
concg.destroy();
|
||||
conf.set_paragraph("143"); // setto il paragrafo del file salce
|
||||
conf.set(SALCE_NUMELE, 1);
|
||||
real val = s.get(VLINAS).as_real() + s.get(VAVIAS).as_real();
|
||||
conf.set(SALCE_CSTO, val.string());
|
||||
/*
|
||||
#define SALCE_IDCESPITE "IDCESPITE"
|
||||
#define SALCE_CODES "CODES"
|
||||
#define SALCE_TPSALDO "TPSALDO"
|
||||
#define SALCE_NUMELE "NUMELE"
|
||||
#define SALCE_VNONAMM "VNONAMM"
|
||||
#define SALCE_VNONAMM06 "VNONAMM06"
|
||||
#define SALCE_VNONAMMC "VNONAMMC"
|
||||
#define SALCE_PLUSREIN "PLUSREIN"
|
||||
#define SALCE_RIV75 "RIV75"
|
||||
#define SALCE_RIV83 "RIV83"
|
||||
#define SALCE_RIV90 "RIV90"
|
||||
#define SALCE_ANNIPOST90 "ANNIPOST90"
|
||||
#define SALCE_ANNIPOST91 "ANNIPOST91"
|
||||
#define SALCE_RIV91 "RIV91"
|
||||
#define SALCE_RIVGF "RIVGF"
|
||||
#define SALCE_RIVGC "RIVGC"
|
||||
#define SALCE_VSPMANU "VSPMANU"
|
||||
#define SALCE_ANNIAMM "ANNIAMM"
|
||||
#define SALCE_DTSTBOLL "DTSTBOLL"
|
||||
|
||||
val = s.get(VLICAS).as_real() + s.get(VVICAS).as_real(); // civ
|
||||
val = s.get(VLINAS2).as_real() + s.get(VAVIAS2).as_real(); // gest
|
||||
*/
|
||||
conf.set_paragraph("136"); // setto il paragrafo del file ammce
|
||||
/*
|
||||
|
||||
#define AMMCE_IDCESPITE "IDCESPITE"
|
||||
#define AMMCE_CODES "CODES"
|
||||
#define AMMCE_TPSALDO "TPSALDO"
|
||||
#define AMMCE_TPAMM "TPAMM"
|
||||
#define AMMCE_SCELTE "SCELTE"
|
||||
#define AMMCE_AMMRIT "AMMRIT"
|
||||
#define AMMCE_CSCEN "CSCEN"
|
||||
#define AMMCE_FZPER "FZPER"
|
||||
#define AMMCE_PNOR "PNOR"
|
||||
#define AMMCE_PACC "PACC"
|
||||
#define AMMCE_PANT "PANT"
|
||||
#define AMMCE_FZQUO "FZQUO"
|
||||
#define AMMCE_QNOR "QNOR"
|
||||
#define AMMCE_QACC "QACC"
|
||||
#define AMMCE_QANT "QANT"
|
||||
#define AMMCE_QPERSE "QPERSE"
|
||||
#define AMMCE_FPRIVATO "FPRIVATO"
|
||||
#define AMMCE_QPPRIVATE "QPPRIVATE"
|
||||
#define AMMCE_QNORP "QNORP"
|
||||
#define AMMCE_QACCP "QACCP"
|
||||
#define AMMCE_QANTP "QANTP"
|
||||
#define AMMCE_QPERSEP "QPERSEP"
|
||||
#define AMMCE_FPRIVATOP "FPRIVATOP"
|
||||
#define AMMCE_QPPRIVATEP "QPPRIVATEP"
|
||||
#define AMMCE_MSG01 "MSG01"
|
||||
#define AMMCE_MSG02 "MSG02"
|
||||
#define AMMCE_MSG03 "MSG03"
|
||||
#define AMMCE_MSG04 "MSG04"
|
||||
#define AMMCE_MSG05 "MSG05"
|
||||
#define AMMCE_MSGD05 "MSGD05"
|
||||
#define AMMCE_MSG06 "MSG06"
|
||||
#define AMMCE_FRINGEBEN "FRINGEBEN"
|
||||
|
||||
val = s.get(VAMNAS).as_real(); val amm norm fisc
|
||||
val = s.get(PFANAS).as_real() + s.get(VAFNAS).as_real(); prog amm norm fisc
|
||||
val = s.get(VAMAAS).as_real(); val amm ant fisc
|
||||
val = s.get(PFAAAS).as_real() + s.get(VAFAAS).as_real(); prog amm ant fisc
|
||||
val = s.get(VALFAS).as_real(); val amm acc fisc
|
||||
|
||||
val = s.get(VANCAS).as_real(); val amm norm civ
|
||||
val = s.get(FANCAS).as_real() + s.get(VFNCAS).as_real(); prog amm norm civ
|
||||
val = s.get(VAACAS).as_real(); val amm ant civ
|
||||
val = s.get(FAACAS).as_real() + s.get(VFACAS).as_real(); prog amm ant civ
|
||||
val = s.get(VALCAS).as_real(); val amm acc civ
|
||||
|
||||
val = s.get(VAMNAS2).as_real(); val amm norm gest
|
||||
val = s.get(PFANAS2).as_real() + s.get(VAFNAS2).as_real(); prog amm norm gest
|
||||
val = s.get(VAMAAS2).as_real(); val amm ant gest
|
||||
val = s.get(PFAAAS2).as_real() + s.get(VAFAAS2).as_real(); prog amm ant gest
|
||||
val = s.get(VALCAS).as_real(); val amm acc gest
|
||||
??? conf.set(, s.get(VLICAS2 51 // Valore Iniziale Civil.2 DIZSMAS - VLIN
|
||||
conf.set(, s.get(VVICAS2 52 // Variaz. Valore Iniz. Civ.2 DIZSMAS - VAVI
|
||||
conf.set(, s.get(VANCAS2 53 // Valore Ammort.Normale Civ.2 DIZSMAS - VAMN
|
||||
conf.set(, s.get(VAACAS2 54 // Valore Ammort.Anti.Civil.2 DIZSMAS - VAMA
|
||||
conf.set(, s.get(FANCAS2 55 // Progr.Fondo Amm.Norm Civ.2 DIZSMAS - PFAN */
|
||||
}
|
||||
|
||||
const TString gcs = s.get(CONTCM).as_string();
|
||||
TString4 sez("D");
|
||||
|
||||
if (gcs.full())
|
||||
{
|
||||
TString8 paragraph;
|
||||
real importo = s.get(IMPOCM).as_real();
|
||||
|
||||
if (importo < ZERO)
|
||||
{
|
||||
importo = -importo;
|
||||
sez = "A";
|
||||
}
|
||||
gruppo = gcs.left(2);
|
||||
conto = gcs.mid(2, 2);
|
||||
sottoconto = gcs.right(6);
|
||||
if (iva)
|
||||
{
|
||||
TToken_string key;
|
||||
|
||||
key.add(gruppo);
|
||||
key.add(conto);
|
||||
const TString4 tipocf = cache().get(LF_PCON, key, PCN_TMCF);
|
||||
|
||||
if (tipocf.full())
|
||||
{
|
||||
conf->set_paragraph("23"); //setto il paragrafo [23] del file ini (testata)
|
||||
conf->set(MOV_TIPO, tipocf);
|
||||
conf->set(MOV_CODCF, sottoconto);
|
||||
conf->set(MOV_TOTDOC, importo.string());
|
||||
paragraph.format("%d,%d",LF_RMOV,nrigac++);
|
||||
conf->set_paragraph(paragraph);
|
||||
conf->set(RMV_SEZIONE, sez);
|
||||
conf->set(RMV_TIPOC, tipocf);
|
||||
conf->set(RMV_IMPORTO, importo.string());
|
||||
conf->set(RMV_GRUPPO, gruppo);
|
||||
conf->set(RMV_CONTO, conto);
|
||||
conf->set(RMV_SOTTOCONTO, sottoconto);
|
||||
conf->set(RMV_ROWTYPE, "T");
|
||||
}
|
||||
else
|
||||
{
|
||||
concg.add(gcs);
|
||||
impcg.add(importo);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
paragraph.format("%d,%d",LF_RMOV,nrigac++);
|
||||
conf->set_paragraph(paragraph);
|
||||
conf->set(RMV_SEZIONE, sez);
|
||||
conf->set(RMV_IMPORTO, importo.string());
|
||||
conf->set(RMV_GRUPPO, gruppo);
|
||||
conf->set(RMV_CONTO, conto);
|
||||
conf->set(RMV_SOTTOCONTO, sottoconto);
|
||||
}
|
||||
}
|
||||
else
|
||||
if (iva)
|
||||
{
|
||||
TString8 paragraph;
|
||||
real importo = s.get(IMPOCM).as_real();
|
||||
real imposta = s.get(IMPSCM).as_real();
|
||||
|
||||
if (importo < ZERO)
|
||||
{
|
||||
importo = -importo;
|
||||
sez = "A";
|
||||
}
|
||||
if (imposta < ZERO) // giusto ?
|
||||
imposta = -imposta;
|
||||
|
||||
const real ind = s.get(INDECM).as_real();
|
||||
const TString4 codiva = s.get(CDIVCM).as_string();
|
||||
|
||||
if (ind > ZERO && ind < CENTO)
|
||||
{
|
||||
TRectype rec(LF_RMOVIVA);
|
||||
|
||||
real impind = importo * ind / 100;
|
||||
real ivaind = importo * ind / 100;
|
||||
impind.round(2);
|
||||
ivaind.round(2);
|
||||
importo -= impind;
|
||||
imposta -= ivaind;
|
||||
rec.put(RMI_CODIVA, codiva);
|
||||
rec.put(RMI_TIPODET, "9");
|
||||
rec.put(RMI_IMPONIBILE, impind.string());
|
||||
rec.put(RMI_IMPOSTA, ivaind.string());
|
||||
rec.put(RMI_GRUPPO, gruppo);
|
||||
rec.put(RMI_CONTO, conto);
|
||||
rec.put(RMI_SOTTOCONTO, sottoconto);
|
||||
rows.add(rec);
|
||||
}
|
||||
TRectype rec(LF_RMOVIVA);
|
||||
|
||||
rec.put(RMI_CODIVA, codiva);
|
||||
if (ind >= CENTO)
|
||||
rec.put(RMI_TIPODET, "9");
|
||||
rec.put(RMI_IMPONIBILE, importo.string());
|
||||
rec.put(RMI_IMPOSTA, imposta.string());
|
||||
rec.put(RMI_GRUPPO, gruppo);
|
||||
rec.put(RMI_CONTO, conto);
|
||||
rec.put(RMI_SOTTOCONTO, sottoconto);
|
||||
rows.add(rec);
|
||||
}
|
||||
}
|
||||
if (conf != NULL)
|
||||
delete conf;
|
||||
|
||||
if (yesno_box(FR("Si desidera confermare l'importazione di %ld record di cespiti"), ntran -1))
|
||||
if (yesno_box(FR("Si desidera confermare l'importazione di %ld record di cespiti"), ntran - 1))
|
||||
{
|
||||
TString app;
|
||||
|
||||
app << "cg2 -0 -i" << outdir << "/*.ini";
|
||||
app << "ce0 -4 -i" << outdir << "/*.ini";
|
||||
TExternal_app primanota(app);
|
||||
primanota.run(true);
|
||||
}
|
||||
@ -476,7 +469,9 @@ void TImporta_cesp::main_loop()
|
||||
//genero il nome del file da caricare
|
||||
TFilename name = _msk->get(F_PATH);
|
||||
name.add(_msk->get(F_NAME));
|
||||
transfer(name);
|
||||
TFilename namesto = _msk->get(F_PATH);
|
||||
name.add(_msk->get(F_NAME_STO));
|
||||
transfer(name, namesto);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4,5 +4,5 @@
|
||||
#define F_RAGSOC 102
|
||||
#define F_PATH 103
|
||||
#define F_NAME 104
|
||||
#define F_ANNOES 105
|
||||
#define F_NAME_STO 105
|
||||
#define F_PATHOUT 106
|
||||
|
@ -69,20 +69,13 @@ BEGIN
|
||||
CHECKTYPE REQUIRED
|
||||
END
|
||||
|
||||
NUMBER F_ANNOES 4
|
||||
STRING F_NAME_STO 18
|
||||
BEGIN
|
||||
PROMPT 3 7 "Esercizio "
|
||||
USE ESC
|
||||
INPUT CODTAB F_ANNOES
|
||||
DISPLAY "Codice Esercizio" CODTAB
|
||||
DISPLAY "Data inizio esercizio" D0
|
||||
DISPLAY "Data fine esercizio " D1
|
||||
OUTPUT F_ANNOES CODTAB
|
||||
FIELD AnnoEs
|
||||
PROMPT 3 7 "File Sto. "
|
||||
FIELD ComInFileSto
|
||||
CHECKTYPE REQUIRED
|
||||
END
|
||||
|
||||
|
||||
GROUPBOX DLG_NULL 90 4
|
||||
BEGIN
|
||||
PROMPT 2 9 "@bDestinazione"
|
||||
|
Loading…
x
Reference in New Issue
Block a user