Aggiunto l'utilizzo della tabella %VER al posto dei parametri

fissi memorizzati dentro al programma.


git-svn-id: svn://10.65.10.50/trunk@2771 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
angelo 1996-04-24 17:00:19 +00:00
parent e5f198e5a0
commit 23faa6f8a6
2 changed files with 24 additions and 11 deletions

View File

@ -10,10 +10,12 @@
#include <progind.h> #include <progind.h>
#include <utility.h> #include <utility.h>
#include <config.h> #include <config.h>
#ifndef __CGLIB03_H
#include "cglib03.h"
#endif
#include "cg4800a.h" #include "cg4800a.h"
#include "cg4800b.h" #include "cg4800b.h"
#define ACCONTO_SENZA_CREDITO real(200000)
#define ROUND_MILLELIRE (-3) #define ROUND_MILLELIRE (-3)
class VersAcc_app : public TApplication class VersAcc_app : public TApplication
@ -23,16 +25,16 @@ class VersAcc_app : public TApplication
TArray _nomiditte, _desc; TArray _nomiditte, _desc;
TBit_array _selected; TBit_array _selected;
TInteressi_IVA_table* _ver;
TTable* _lim; TTable* _lim;
TTable* _lia; TTable* _lia;
TTable* _del; TTable* _del;
TTable* _ban; TTable* _ban;
TTable* _ucc; TTable* _ucc;
TProgind* _prind; TProgind* _prind;
int _year; int _year;
real _acconto, _credito, _diff, _impver; real _acconto, _credito, _diff, _impver, _acconto_senza_credito;
bool _calcall, _da_stampare, _print; bool _calcall, _da_stampare, _print;
TDate _dataver; TDate _dataver;
TString16 _abi, _cab, _con; TString16 _abi, _cab, _con;
@ -101,6 +103,7 @@ bool VersAcc_app::create()
_ditte = new TArray_sheet(-1, -1, 0, 0, "Selezione Ditte", _ditte = new TArray_sheet(-1, -1, 0, 0, "Selezione Ditte",
"@1|Cod.@5R|Ragione Sociale@50|Vers."); "@1|Cod.@5R|Ragione Sociale@50|Vers.");
_ver = new TInteressi_IVA_table();
_del = new TTable("%DEL"); _del = new TTable("%DEL");
_lia = new TTable("%LIA"); _lia = new TTable("%LIA");
_ban = new TTable("%BAN"); _ban = new TTable("%BAN");
@ -126,6 +129,7 @@ bool VersAcc_app::create()
bool VersAcc_app::destroy() bool VersAcc_app::destroy()
{ {
delete _ver;
delete _lim; delete _lim;
delete _lia; delete _lia;
delete _del; delete _del;
@ -273,7 +277,10 @@ void VersAcc_app::vers_acc()
" preparazione archivi \n" " preparazione archivi \n"
" \n", " \n",
TRUE,TRUE,30); TRUE,TRUE,30);
if (_ver->read(_year,12)!=NOERR)
warning_box("Errore %d in lettura tabella versamenti ed interessi.",_ver->status());
_acconto_senza_credito = _ver->get(I_ACCONTOIVA);
for (int l = 0; l < _ditte->items(); l++) for (int l = 0; l < _ditte->items(); l++)
{ {
if (_prind->iscancelled()) if (_prind->iscancelled())
@ -391,14 +398,14 @@ void VersAcc_app::lettura_delega()
if (_del->read() == NOERR) if (_del->read() == NOERR)
{ {
if (_diff < ACCONTO_SENZA_CREDITO) //l'importo non e' dovuto if (_diff < _acconto_senza_credito) //l'importo non e' dovuto
{ {
//cancello la delega //cancello la delega
_del->remove(); _del->remove();
return; return;
} }
// se sono qui e' perche' l'importo e' dovuto (_diff >= ACCONTO_SENZA_CREDITO) // se sono qui e' perche' l'importo e' dovuto (_diff >= _acconto_senza_credito)
bool stampata = _del->get_bool("B0"); bool stampata = _del->get_bool("B0");
_impver = _del->get_real("R0"); _impver = _del->get_real("R0");
@ -421,7 +428,7 @@ void VersAcc_app::lettura_delega()
} }
else //non esiste la delega else //non esiste la delega
{ {
if (_diff >= ACCONTO_SENZA_CREDITO) if (_diff >= _acconto_senza_credito)
//creo record delega //creo record delega
{ {
crea_delega(); crea_delega();

View File

@ -10,9 +10,11 @@
#include <progind.h> #include <progind.h>
#include <utility.h> #include <utility.h>
#include <config.h> #include <config.h>
#ifndef __CGLIB03_H
#include "cglib03.h"
#endif
#include "cg4900.h" #include "cg4900.h"
#define ACCONTO_MIN_DA_VERSARE real(200000.0)
class LiqAcc_app : public TApplication class LiqAcc_app : public TApplication
{ {
@ -376,6 +378,10 @@ bool LiqAcc_app::video_vis()
bool liqdiff = cnf.get_bool("GeLiDi"); bool liqdiff = cnf.get_bool("GeLiDi");
_tipo_acc = lia.get("S8"); _tipo_acc = lia.get("S8");
TString16 freqviva = lia.get("S7"); TString16 freqviva = lia.get("S7");
TInteressi_IVA_table ver;
if (ver.read(_year,12)!=NOERR)
warning_box("Errore %d in lettura tabella versamenti ed interessi.",ver.status());
real acconto_min_da_versare = ver.get(I_ACCONTOIVA);
real acconto = ZERO; real acconto = ZERO;
real iva_ven = ZERO; real iva_ven = ZERO;
real iva_acq = ZERO; real iva_acq = ZERO;
@ -399,7 +405,7 @@ bool LiqAcc_app::video_vis()
non_fat = lia.get_real("R13"); non_fat = lia.get_real("R13");
non_ann = lia.get_real("R14"); non_ann = lia.get_real("R14");
TToken_string ff(lia.get("S1")); TToken_string ff(lia.get("S1"),'!');
real cre_pre (ff.get(0)); real cre_pre (ff.get(0));
real acq_intr (ff.get(1)); real acq_intr (ff.get(1));
@ -479,14 +485,14 @@ if (acconto.sign() < 0)
m.hide(F_ACCVER); m.hide(F_ACCVER);
m.hide(F_ACCNVER); m.hide(F_ACCNVER);
} }
else if (acconto.sign() > 0 && acconto > ACCONTO_MIN_DA_VERSARE) else if (acconto.sign() > 0 && acconto > acconto_min_da_versare)
{ {
m.hide(F_CREEVI); m.hide(F_CREEVI);
m.hide(F_ACCNVER); m.hide(F_ACCNVER);
m.show(F_ACCVER); m.show(F_ACCVER);
m.field(F_ACCVER).set(acconto.string()); m.field(F_ACCVER).set(acconto.string());
} }
else if (acconto.sign() > 0 && acconto <= ACCONTO_MIN_DA_VERSARE) else if (acconto.sign() > 0 && acconto <= acconto_min_da_versare)
{ {
m.hide(F_CREEVI); m.hide(F_CREEVI);
m.show(F_ACCNVER); m.show(F_ACCNVER);