campo-sirio/ba/baeur08.cpp
alex 8a05210c2d Patch level : xx.7.054
Files correlati     :
Ricompilazione Demo : [ ]
Commento            :
Riportata la version 1.7 patch 054 aga sul main trunk


git-svn-id: svn://10.65.10.50/trunk@9655 c028cbd2-c16b-5b4b-a496-9718f37d4682
2001-04-30 14:22:43 +00:00

77 lines
1.7 KiB
C++
Executable File

#include <applicat.h>
#include <prefix.h>
#include <utility.h>
#include "baeur.h"
#include "../mg/mglib.h"
#include "../mg/mg3500a.h"
///////////////////////////////////////////////////////////
// Main app
///////////////////////////////////////////////////////////
class TStampa_storico_euro : public TStampa_storgiac
{
bool get_aree_dati(TFilename& lit, TFilename& eur) const;
bool goto_lire(long ditta = -1);
virtual bool create();
virtual void set_def_valuta(TForm_storgiac & f);
public:
TStampa_storico_euro() {}
};
bool TStampa_storico_euro::get_aree_dati(TFilename& lit, TFilename& eur) const
{
TConfig prassis(CONFIG_STUDIO, "Euro");
lit = prassis.get("DatiLire");
eur = prassis.get("DatiEuro");
if (lit.blank())
{
lit = prefix().get_studio();
lit.rtrim(1);
}
bool ok = eur.exist();
return ok;
}
bool TStampa_storico_euro::goto_lire(long ditta)
{
TFilename lit, eur;
get_aree_dati(lit, eur);
bool ok = !lit.blank() && fexist(lit);
if (ok)
{
TFilename cur = prefix().get_studio(); cur.rtrim(1);
if (ditta < 0)
ditta = get_firm();
if (!dir_equal(cur, lit))
ok = prefix().set_studio(lit, ditta);
else
prefix().set_codditta(ditta);
}
if (!ok)
error_box("Impossibile utilizzare lo studio in lire '%s'", (const char*)lit);
return ok;
}
bool TStampa_storico_euro::create()
{
goto_lire();
return TStampa_storgiac:: create();
}
void TStampa_storico_euro::set_def_valuta(TForm_storgiac & f)
{
f.set_output_exchange("EUR", EURO, _exchange_base);
}
int baeur08(int argc, char* argv[])
{
TStampa_storico_euro ma;
ma.run(argc, argv, "Stampa storico in Euro");
return 0;
}