Patch level : 10.0
Files correlati : ps0713 Ricompilazione Demo : [ ] Commento : Modifiche richieste da Roberto per l'inserimento in prima nota delle fatture git-svn-id: svn://10.65.10.50/trunk@20510 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
2c13e629d4
commit
dd48c87c01
@ -7,6 +7,7 @@
|
||||
#include <causali.h>
|
||||
#include <clifo.h>
|
||||
#include <mov.h>
|
||||
#include <rmov.h>
|
||||
#include <rmoviva.h>
|
||||
|
||||
#include "ps0713lib.h"
|
||||
@ -77,8 +78,6 @@ long TImporta_fatacq_app::genera_movcg()
|
||||
mov.put(MOV_NUMREG, numreg);
|
||||
mov.put(MOV_DATACOMP, _msk->get_date(F_DATAREG));
|
||||
mov.put(MOV_DATAREG, _msk->get_date(F_DATAREG));
|
||||
mov.put(MOV_TIPO, 'F');
|
||||
mov.put(MOV_CODCF, _msk->get(F_CODCF));
|
||||
mov.put(MOV_CODCAUS, _msk->get(F_CODCAU));
|
||||
mov.write();
|
||||
|
||||
@ -137,17 +136,38 @@ void TImporta_fatacq_app::genera_analitica(const long numreg, TAssoc_array& righ
|
||||
|
||||
bool TImporta_fatacq_app::transfer(const TFilename& file, const long numreg, TAssoc_array& righean)
|
||||
{
|
||||
TLocalisamfile mov(LF_MOV);
|
||||
mov.put(MOV_NUMREG, numreg);
|
||||
mov.remove();
|
||||
|
||||
TVB_recset 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","MODIFY");
|
||||
_configfile->set("Action","INSERT");
|
||||
_configfile->set("Mode","AUTO");
|
||||
_configfile->set_paragraph("23"); //setto il paragrafo [23] del file ini (testata)
|
||||
_configfile->set(MOV_NUMREG, numreg);
|
||||
_configfile->set("SOLAIVA", "");
|
||||
_configfile->set(MOV_TIPO, 'F');
|
||||
_configfile->set(MOV_CODCF, _msk->get(F_CODCF));
|
||||
|
||||
int nriga = 1;
|
||||
int nriga = 1;
|
||||
int nrigac = 2;
|
||||
real totimponibile = ZERO;
|
||||
real totimposta = ZERO;
|
||||
const TString16 codiva = _msk->get(F_CODIVA);
|
||||
const real iva = cache().get("%IVA", codiva, "R0");
|
||||
const int anno = _msk->get_date(F_DATAREG).year();
|
||||
|
||||
TString caus = _msk->get(F_CODCAU);
|
||||
|
||||
_configfile->set(MOV_CODCAUS, caus);
|
||||
|
||||
TToken_string key(caus);
|
||||
key.add("1");
|
||||
const TRectype& causale = cache().get(LF_RCAUSALI, key);
|
||||
|
||||
for (bool ok = s.move_first(); ok; ok = s.move_next())
|
||||
{
|
||||
@ -155,13 +175,18 @@ bool TImporta_fatacq_app::transfer(const TFilename& file, const long numreg, TAs
|
||||
break;
|
||||
|
||||
TString8 paragraph;
|
||||
paragraph.format("%d,%d",LF_RMOVIVA,nriga++);
|
||||
paragraph.format("%d,%d", LF_RMOVIVA, nriga++);
|
||||
_configfile->set_paragraph(paragraph);
|
||||
|
||||
TString16 codcom = s.get(0).as_string();
|
||||
if(codcom.empty())
|
||||
continue;
|
||||
real imp = s.get(1).as_real();
|
||||
TString16 tmp = s.get(1).as_string();
|
||||
tmp.strip(".");
|
||||
tmp.replace(',', '.');
|
||||
real imp(tmp); imp.round(2);
|
||||
|
||||
totimponibile += imp;
|
||||
|
||||
TCommessa cms(codcom);
|
||||
TCommessa_string ankey = cms.cmsstr();
|
||||
@ -174,10 +199,38 @@ bool TImporta_fatacq_app::transfer(const TFilename& file, const long numreg, TAs
|
||||
else
|
||||
righean.add(ankey, imp);
|
||||
|
||||
real rimposta = imp * iva / CENTO; rimposta.round(2);
|
||||
totimposta += rimposta;
|
||||
|
||||
_configfile->set(RMI_ANNOES, anno);
|
||||
_configfile->set(RMI_IMPONIBILE, imp.string());
|
||||
_configfile->set(RMI_CODIVA, _msk->get(F_CODIVA));
|
||||
_configfile->set(RMI_CODIVA, codiva);
|
||||
_configfile->set(RMI_IMPOSTA, rimposta.string());
|
||||
_configfile->set(RMI_GRUPPO, ankey.gruppo());
|
||||
_configfile->set(RMI_CONTO, ankey.conto());
|
||||
_configfile->set(RMI_SOTTOCONTO, ankey.sotco());
|
||||
_configfile->set(RMI_TIPOATT, 1);
|
||||
}
|
||||
|
||||
const real totdoc = totimponibile + totimposta;
|
||||
TImporto importo(causale.get("SEZIONE")[0], totdoc);
|
||||
|
||||
TString8 paragraph;
|
||||
paragraph.format("%d,%d", LF_RMOV, 1);
|
||||
_configfile->set_paragraph(paragraph);
|
||||
_configfile->set(RMV_NUMRIG, 1);
|
||||
_configfile->set(RMV_ANNOES, anno);
|
||||
_configfile->set(RMV_SEZIONE, causale.get("SEZIONE"));
|
||||
_configfile->set(RMV_IMPORTO, importo.valore().string());
|
||||
_configfile->set(RMV_GRUPPO, causale.get("GRUPPO"));
|
||||
_configfile->set(RMV_CONTO, causale.get("CONTO"));
|
||||
_configfile->set(RMV_SOTTOCONTO, _msk->get_long(F_CODCF));
|
||||
_configfile->set(RMV_TIPOC, "F");
|
||||
_configfile->set(RMV_ROWTYPE, "T");
|
||||
|
||||
_configfile->set_paragraph("23");
|
||||
_configfile->set(MOV_TOTDOC, totdoc.string());
|
||||
|
||||
_configfile->set_paragraph("Transaction");
|
||||
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user