Files correlati : Ricompilazione Demo : [ ] Commento : Riportata la versione 1.7 aga patch 102 sul main trunk git-svn-id: svn://10.65.10.50/trunk@9769 c028cbd2-c16b-5b4b-a496-9718f37d4682
		
			
				
	
	
		
			77 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			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/mg4200a.h"  
 | 
						|
 | 
						|
 | 
						|
///////////////////////////////////////////////////////////
 | 
						|
// Main app
 | 
						|
///////////////////////////////////////////////////////////
 | 
						|
 | 
						|
class TInventario_euro : public TStampa_inventario
 | 
						|
{          
 | 
						|
  bool get_aree_dati(TFilename& lit, TFilename& eur) const;
 | 
						|
  bool goto_lire(long ditta = -1);
 | 
						|
  virtual bool create();
 | 
						|
  virtual void set_def_valuta(TForm_inventario & f);
 | 
						|
public:                                                       
 | 
						|
  TInventario_euro() {}
 | 
						|
};
 | 
						|
  
 | 
						|
bool TInventario_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 TInventario_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 TInventario_euro::create()
 | 
						|
{
 | 
						|
  goto_lire();
 | 
						|
  return TStampa_inventario::create();
 | 
						|
}
 | 
						|
 | 
						|
void TInventario_euro::set_def_valuta(TForm_inventario & f)
 | 
						|
{
 | 
						|
  f.set_output_exchange("EUR", EURO, _exchange_base);
 | 
						|
}
 | 
						|
 | 
						|
int baeur07(int argc, char* argv[])
 | 
						|
{  
 | 
						|
  TInventario_euro ma;
 | 
						|
  ma.run(argc, argv, "Stampa inventario in Euro");
 | 
						|
  
 | 
						|
  return 0;
 | 
						|
}
 |