Patch level : 10.0 nopatch

Files correlati     : ps0713.exe
Ricompilazione Demo : [ ]
Commento            :

Aggiunto importo spese da distribuire sull' importazione fatture


git-svn-id: svn://10.65.10.50/trunk@20628 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 2010-06-24 19:21:47 +00:00
parent 8d91494a26
commit 9c9f5ab956
3 changed files with 46 additions and 10 deletions

View File

@ -172,6 +172,30 @@ bool TImporta_fatacq_app::transfer(const TFilename& file, const long numreg, TAs
key.add("1"); key.add("1");
const TRectype& causale = cache().get(LF_RCAUSALI, key); const TRectype& causale = cache().get(LF_RCAUSALI, key);
const real spese = _msk->get_real(F_SPESE);
bool has_spese = ! spese.is_zero();
TGeneric_distrib d(spese);
if (has_spese)
{
for (bool ok = s.move_first(); ok; ok = s.move_next())
{
if (!pi.addstatus(1))
break;
TString16 codcom = s.get(0).as_string();
if(codcom.empty())
continue;
TString16 tmp = s.get(1).as_string();
tmp.strip(".");
tmp.replace(',', '.');
real imp(tmp); imp.round(2);
d.add(imp);
}
}
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)) if (!pi.addstatus(1))
@ -189,11 +213,16 @@ bool TImporta_fatacq_app::transfer(const TFilename& file, const long numreg, TAs
tmp.replace(',', '.'); tmp.replace(',', '.');
real imp(tmp); imp.round(2); real imp(tmp); imp.round(2);
if (has_spese)
imp += d.get();
totimponibile += imp; totimponibile += imp;
TCommessa cms(codcom); TCommessa cms(codcom);
TCommessa_string ankey = cms.cmsstr(); TCommessa_string ankey = cms.cmsstr();
TBill co(ankey.gruppo(), ankey.conto(), ankey.sotco());
if(co.is_analitico())
{
if(righean.is_key(ankey)) if(righean.is_key(ankey))
{ {
real& imponibile = *(real*)righean.objptr(ankey); real& imponibile = *(real*)righean.objptr(ankey);
@ -201,6 +230,7 @@ bool TImporta_fatacq_app::transfer(const TFilename& file, const long numreg, TAs
} }
else else
righean.add(ankey, imp); righean.add(ankey, imp);
}
real rimposta = imp * iva / CENTO; rimposta.round(2); real rimposta = imp * iva / CENTO; rimposta.round(2);
totimposta += rimposta; totimposta += rimposta;

View File

@ -8,3 +8,4 @@
#define F_CODCF 107 #define F_CODCF 107
#define F_FRAGSOC 108 #define F_FRAGSOC 108
#define F_DATAREG 109 #define F_DATAREG 109
#define F_SPESE 110

View File

@ -36,7 +36,7 @@ BEGIN
CHECKTYPE REQUIRED CHECKTYPE REQUIRED
END END
GROUPBOX DLG_NULL 90 6 GROUPBOX DLG_NULL 90 7
BEGIN BEGIN
PROMPT 1 5 "@bParametri per l'importazione" PROMPT 1 5 "@bParametri per l'importazione"
END END
@ -126,6 +126,11 @@ BEGIN
CHECKTYPE REQUIRED CHECKTYPE REQUIRED
END END
CURRENCY F_SPESE
BEGIN
PROMPT 2 10 "Spese "
END
ENDPAGE ENDPAGE
ENDMASK ENDMASK