Patch level : 12.0 no-patch
Files correlati : fp Commento : - Spostato codice trasmittente nel programma di configurazione - Svuotato file fp0200 che dava solo problemi - Portato tutto il procedimento di esportazione in fplib così da poter utilizzare il tutto anche da altre applicazioni
This commit is contained in:
parent
12eb61daa5
commit
b3b982eb70
@ -12,8 +12,8 @@
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{9C91BACF-9A70-4973-B8CC-FA3D2AF9867C}</ProjectGuid>
|
||||
<RootNamespace>tf0</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
|
||||
<RootNamespace>fp</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
@ -186,7 +186,6 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\fp\fp0300.cpp" />
|
||||
<ClCompile Include="..\src\fp\fplib01.cpp" />
|
||||
<ClCompile Include="..\src\tf\tfutility.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@ -197,7 +196,6 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\fp\fp0300a.h" />
|
||||
<ClInclude Include="..\src\fp\fplib01.h" />
|
||||
<ClInclude Include="..\src\tf\tfutility.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@ -216,6 +214,12 @@
|
||||
<FileType>Document</FileType>
|
||||
</SqlCompiler>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\src\fp\sql\fp0102.sql" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Library Include="..\lib\fplib.lib" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
<Import Project="CampoRules.targets" />
|
||||
|
21
build/fplib.vcxproj.filters
Normal file
21
build/fplib.vcxproj.filters
Normal file
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Headers">
|
||||
<UniqueIdentifier>{72a9ea2f-8fbe-4546-96f3-21a4de35bf0e}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Sources">
|
||||
<UniqueIdentifier>{afa0f493-bfe6-4bd2-add2-3256306ed9c5}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\src\fp\fplib01.h">
|
||||
<Filter>Headers</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\src\fp\fplib01.cpp">
|
||||
<Filter>Sources</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -14,6 +14,8 @@
|
||||
|
||||
class TParametri_mask : public TAutomask
|
||||
{
|
||||
private:
|
||||
void load_all();
|
||||
protected:
|
||||
void tipi_import();
|
||||
static TMask& get_tmp_msk(const char* title);
|
||||
@ -22,18 +24,34 @@ protected:
|
||||
|
||||
public:
|
||||
TParametri_mask(const char* n);
|
||||
void save_all() const;
|
||||
};
|
||||
|
||||
TParametri_mask::TParametri_mask(const char * n) : TAutomask(n)
|
||||
{
|
||||
load_all();
|
||||
}
|
||||
|
||||
void TParametri_mask::save_all() const
|
||||
{
|
||||
ini_set_string(CONFIG_DITTA, "fp", "ip", get(F_INDIRIZZO));
|
||||
ini_set_string(CONFIG_DITTA, "fp", "db", get(F_DATABASE));
|
||||
ini_set_string(CONFIG_DITTA, "fp", "usr", get(F_USER));
|
||||
ini_set_string(CONFIG_DITTA, "fp", "psw", encode(get(F_PASSWORD)));
|
||||
ini_set_string(CONFIG_DITTA, "fp", "flddest", get(F_FLDDEST));
|
||||
ini_set_string(CONFIG_DITTA, "fp", "fldusrdest", get(F_FLDUSRDEST));
|
||||
ini_set_string(CONFIG_DITTA, "fp", "cofitras", get(F_COFI));
|
||||
}
|
||||
|
||||
void TParametri_mask::load_all()
|
||||
{
|
||||
set(F_INDIRIZZO, ini_get_string(CONFIG_DITTA, "fp", "ip"));
|
||||
set(F_DATABASE, ini_get_string(CONFIG_DITTA, "fp", "db"));
|
||||
set(F_USER, ini_get_string(CONFIG_DITTA, "fp", "usr"));
|
||||
set(F_PASSWORD, decode(ini_get_string(CONFIG_DITTA, "fp", "psw") ));
|
||||
set(F_PASSWORD, decode(ini_get_string(CONFIG_DITTA, "fp", "psw")));
|
||||
set(F_FLDDEST, ini_get_string(CONFIG_DITTA, "fp", "flddest"));
|
||||
set(F_FLDUSRDEST, ini_get_string(CONFIG_DITTA, "fp", "fldusrdest"));
|
||||
|
||||
|
||||
set(F_COFI, ini_get_string(CONFIG_DITTA, "fp", "cofitras"));
|
||||
}
|
||||
|
||||
void TParametri_mask::tipi_import()
|
||||
@ -210,13 +228,7 @@ void TParametri_ditta::main_loop()
|
||||
SSimple_query s(ad, usr, psw, TSDB_MSSQL);
|
||||
if (s.sq_is_connect())
|
||||
{
|
||||
|
||||
ini_set_string(CONFIG_DITTA, "fp", "ip", ip);
|
||||
ini_set_string(CONFIG_DITTA, "fp", "db", db);
|
||||
ini_set_string(CONFIG_DITTA, "fp", "usr", usr);
|
||||
ini_set_string(CONFIG_DITTA, "fp", "psw", encode(psw));
|
||||
ini_set_string(CONFIG_DITTA, "fp", "flddest", pm.get(F_FLDDEST));
|
||||
ini_set_string(CONFIG_DITTA, "fp", "fldusrdest", pm.get(F_FLDUSRDEST));
|
||||
pm.save_all();
|
||||
message_box("Dati salvati correttamente!");
|
||||
}
|
||||
else
|
||||
|
@ -4,6 +4,7 @@
|
||||
#define F_PASSWORD 104
|
||||
#define F_FLDDEST 105
|
||||
#define F_FLDUSRDEST 106
|
||||
#define F_COFI 107
|
||||
|
||||
#define F_SETPATCH 201
|
||||
#define F_ENPTYTABLE 202
|
||||
|
@ -13,7 +13,7 @@ ENDPAGE
|
||||
|
||||
PAGE "Configurazione FP" 0 2 0 0
|
||||
|
||||
GROUPBOX DLG_NULL 78 10
|
||||
GROUPBOX DLG_NULL 78 8
|
||||
BEGIN
|
||||
PROMPT 1 1 "@BDatabase"
|
||||
END
|
||||
@ -47,19 +47,28 @@ BEGIN
|
||||
CHECKTYPE REQUIRED
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 78 3
|
||||
BEGIN
|
||||
PROMPT 1 9 "@BTrasmittente"
|
||||
END
|
||||
|
||||
STRING F_COFI 16
|
||||
BEGIN
|
||||
PROMPT 2 10 "Codice fiscale trasmittente "
|
||||
CHECKTYPE REQUIRED
|
||||
END
|
||||
|
||||
STRING F_FLDDEST 300 50
|
||||
BEGIN
|
||||
PROMPT 2 6 "Destinazione Server "
|
||||
CHECKTYPE REQUIRED
|
||||
FLAGS "M"
|
||||
FLAGS ""
|
||||
END
|
||||
|
||||
STRING F_FLDUSRDEST 300 50
|
||||
BEGIN
|
||||
PROMPT 2 7 "Destinazione User "
|
||||
DSELECT
|
||||
CHECKTYPE REQUIRED
|
||||
FLAGS "M"
|
||||
FLAGS ""
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
1751
src/fp/fp0200.cpp
1751
src/fp/fp0200.cpp
File diff suppressed because it is too large
Load Diff
1472
src/fp/fp0300.cpp
1472
src/fp/fp0300.cpp
File diff suppressed because it is too large
Load Diff
@ -2,9 +2,8 @@
|
||||
#define F_DATAINI 301
|
||||
#define F_DATAEND 302
|
||||
#define F_FATTSEL 303
|
||||
#define F_COFI 304
|
||||
#define F_DATIPODOC 305
|
||||
#define F_ATIPODOC 306
|
||||
#define F_DATIPODOC 304
|
||||
#define F_ATIPODOC 305
|
||||
#define END_MASK 399
|
||||
|
||||
#define F_DOCS 201
|
||||
|
@ -32,12 +32,6 @@ BEGIN
|
||||
ITEM "N|Accettate"
|
||||
END
|
||||
|
||||
STRING F_COFI 16
|
||||
BEGIN
|
||||
PROMPT 30 1 "Codice fiscale trasmittente "
|
||||
CHECKTYPE REQUIRED
|
||||
END
|
||||
|
||||
STRING F_DATIPODOC 4
|
||||
BEGIN
|
||||
PROMPT 30 2 "Da tipo doc "
|
||||
|
1366
src/fp/fplib01.cpp
1366
src/fp/fplib01.cpp
File diff suppressed because it is too large
Load Diff
105
src/fp/fplib01.h
105
src/fp/fplib01.h
@ -5,9 +5,114 @@
|
||||
#include <utility.h>
|
||||
#include <config.h>
|
||||
|
||||
#include "../ve/velib05.h"
|
||||
#include "../fe/felib.h"
|
||||
#include <reputils.h>
|
||||
|
||||
#define SQL_FLD "sql/"
|
||||
|
||||
// Ritorna la connessione al DB paf secondo i parametri impostati nel programma di configurazione
|
||||
SSimple_query& db();
|
||||
// Controlla il livello di patch installato e aggiorna le tabelle se necessario
|
||||
bool check_tables();
|
||||
// Genera la chiave per i paf
|
||||
bool chiave_paf(const TDocumento& doc, TString& hfatt, TString& bfatt);
|
||||
bool chiave_paf(const TRectype& doc, TString& hfatt, TString& bfatt);
|
||||
|
||||
|
||||
// Contenitore di campi di un record di database MSSQLServer
|
||||
class TPaf_record : public TObject
|
||||
{
|
||||
TString8 _table;
|
||||
TToken_string _key;
|
||||
TAssoc_array _fields;
|
||||
|
||||
protected:
|
||||
void copy(const TPaf_record& rec)
|
||||
{
|
||||
_table = rec._table;
|
||||
_key = rec._key;
|
||||
_fields = rec._fields;
|
||||
}
|
||||
|
||||
const TString& var2str(const TString& fld, const TVariant& var) const;
|
||||
const TVariant& get(const char* fld) const;
|
||||
|
||||
public:
|
||||
void reset() { _fields.destroy(); }
|
||||
void set(const char* fld, const TVariant& var);
|
||||
void set(const char* fld, long var);
|
||||
void set(const char* fld, const char* var);
|
||||
void set(const char* fld, const real& var);
|
||||
void set(const char* fld, const TString& var);
|
||||
void set(const char* fld, const TDate& var);
|
||||
void set(const char* fld, bool var);
|
||||
const TString sq_get(const char* fld) const;
|
||||
|
||||
bool insert();
|
||||
bool remove();
|
||||
bool search();
|
||||
bool search(const char* k1, const char* k2, const char* k3 = NULL);
|
||||
|
||||
virtual TObject* dup() const { return new TPaf_record(*this); }
|
||||
virtual bool ok() const { return _table.not_empty(); }
|
||||
|
||||
TPaf_record& operator=(const TPaf_record& rec)
|
||||
{
|
||||
copy(rec);
|
||||
return *this;
|
||||
}
|
||||
|
||||
TPaf_record(const TPaf_record& rec) { copy(rec); }
|
||||
TPaf_record(const char* table);
|
||||
};
|
||||
|
||||
// Gestione PAF
|
||||
class TDoc_fp
|
||||
{
|
||||
private:
|
||||
TAnagrafica _ditta;
|
||||
TString16 _cofi;
|
||||
TFilename _dbname;
|
||||
TLog_report* _log;
|
||||
TString _logpaf;
|
||||
TString _def_fld;
|
||||
TString _def_usr_fld;
|
||||
bool _to_commit;
|
||||
|
||||
int parse_line(const TString& line, TString& var, TString& val) const;
|
||||
bool create_table(TScanner& paf, const TString& table);
|
||||
|
||||
const TRectype* find_parent_row(const TRectype& rdoc) const;
|
||||
int find_ancestors(const TRiga_documento& rdoc, TArray& ancestors) const;
|
||||
|
||||
protected:
|
||||
bool parse_sconto(const TString& formula, TToken_string& sconti) const;
|
||||
static bool get_bnp_iban(const TString& abi, const TString& cab, int prg, TString& iban);
|
||||
bool get_bank(const TDocumento& doc, TString& iban, TString& abi, TString& cab,
|
||||
TString& istituto) const;
|
||||
const char* descrizione(const TRiga_documento& rdoc) const;
|
||||
const TRectype& cco(const TRectype& doc) const; // Contratto/Convenzione/Offerta
|
||||
|
||||
void log(int severity, const char* msg);
|
||||
const char* natura(const TString& codiva) const;
|
||||
static void set_IVA(const TString& codiva, TPaf_record& paf);
|
||||
static void set_IVA(const TRiga_documento& rdoc, TPaf_record& paf);
|
||||
static bool add_row_art(const TString codice_tipo, const TString& codice_valore, TPaf_record& paf);
|
||||
|
||||
public:
|
||||
bool doc_to_paf(TDocumentoEsteso& doc);
|
||||
bool doc_to_paf(const TRectype& rec);
|
||||
bool doc_to_paf(const TDoc_key& key);
|
||||
bool doc_to_paf(const TFilename& ini);
|
||||
// Mostra il log a fine esecuzione
|
||||
bool show_log();
|
||||
const int commit();
|
||||
|
||||
TDoc_fp();
|
||||
~TDoc_fp();
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif // __FPLIB01_H
|
||||
|
Loading…
x
Reference in New Issue
Block a user