Patch level : 2.2 291
Files correlati : Ricompilazione Demo : [ ] Commento : Riportate le patch fino alla 2.1 490 Controllare velib.h. il merge era impossibile Controllare modaut.h e campo.aut. pack DT Contabilità industriale conflittano git-svn-id: svn://10.65.10.50/trunk@13668 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
ac5d36ee3b
commit
df66240d22
@ -1242,8 +1242,7 @@ bool TGestioneSoggetti::user_create()
|
||||
_sttess2 = config.get_bool("StTess2");
|
||||
_dataisc = config.get_bool("DataIsc");
|
||||
_ctrlpass = config.get_bool("CtrlPass");
|
||||
if (_ctrlpass)
|
||||
_permesso = richiesta_password();
|
||||
_permesso = richiesta_password();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -1365,6 +1364,7 @@ int TGestioneSoggetti::read(TMask& m)
|
||||
row.add(riga.get(DON_PROTIDEMIA)); // 14
|
||||
s.check_row(r-1);
|
||||
}
|
||||
s.force_update();
|
||||
}
|
||||
else
|
||||
if (err == _iseof || err == _isemptyfile)
|
||||
@ -1397,6 +1397,7 @@ int TGestioneSoggetti::read(TMask& m)
|
||||
row.add(riga.get(CON_RESPONSAB));
|
||||
}
|
||||
TGestioneSoggetti::tipocon_set_sheet(s);
|
||||
s.force_update();
|
||||
}
|
||||
else
|
||||
if (err == _iseof || err == _isemptyfile)
|
||||
@ -1424,6 +1425,7 @@ int TGestioneSoggetti::read(TMask& m)
|
||||
row.add(riga.get(IDO_RESPONSAB));
|
||||
}
|
||||
TGestioneSoggetti::idosos_set_sheet(s);
|
||||
s.force_update();
|
||||
}
|
||||
else
|
||||
if (err == _iseof || err == _isemptyfile)
|
||||
@ -1458,6 +1460,7 @@ int TGestioneSoggetti::read(TMask& m)
|
||||
row.add(""); // denominazione gruppo aziendale
|
||||
s.check_row(r-1);
|
||||
}
|
||||
s.force_update();
|
||||
}
|
||||
else
|
||||
if (err == _iseof || err == _isemptyfile)
|
||||
@ -1483,6 +1486,7 @@ int TGestioneSoggetti::read(TMask& m)
|
||||
row.add(riga.get(STO_CATISC));
|
||||
row.add(riga.get(STO_MOTDIM));
|
||||
}
|
||||
s.force_update();
|
||||
}
|
||||
else
|
||||
if (err == _iseof || err == _isemptyfile)
|
||||
@ -2398,23 +2402,28 @@ bool TGestioneSoggetti::storico_notify(TSheet_field& s, int r, KEY k)
|
||||
|
||||
bool TGestioneSoggetti::richiesta_password()
|
||||
{
|
||||
TMask& mask = *(app().get_mask());
|
||||
TMask msk("at0100e");
|
||||
if (msk.run() == K_ENTER)
|
||||
{
|
||||
if (msk.get(F_PASSWORD) == "BAMP")
|
||||
{
|
||||
mask.enable(F_CONTROLLI);
|
||||
mask.enable(F_IDONEITA);
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
if (_ctrlpass)
|
||||
{
|
||||
TMask& mask = *(app().get_mask());
|
||||
TMask msk("at0100e");
|
||||
if (msk.run() == K_ENTER)
|
||||
{
|
||||
error_box("Password errata! Non e' possibile modificare la situazione sanitaria");
|
||||
mask.disable(F_CONTROLLI);
|
||||
mask.disable(F_IDONEITA);
|
||||
}
|
||||
if (msk.get(F_PASSWORD) == "BAMP")
|
||||
{
|
||||
mask.enable(F_CONTROLLI);
|
||||
mask.enable(F_IDONEITA);
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
error_box("Password errata! Non e' possibile modificare la situazione sanitaria");
|
||||
mask.disable(F_CONTROLLI);
|
||||
mask.disable(F_IDONEITA);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -431,11 +431,11 @@ void TProv2com::agg_donazione(const TRectype& recsog, const TRectype& recdon)
|
||||
{
|
||||
const TDate& datadon = recdon.get_date(DON_DATADON);
|
||||
const TDate& dataultdon = rec.get_date(SOG_DATAULTDON);
|
||||
if (datadon > dataultdon)
|
||||
TRectype* key = new TRectype(LF_DONAZ);
|
||||
key->put(DON_CODICE, rec.get(SOG_CODICE));
|
||||
int err = _sdonazioni->read(key);
|
||||
if (datadon > dataultdon || _sdonazioni->rows() == 0)
|
||||
{
|
||||
TRectype* key = new TRectype(LF_DONAZ);
|
||||
key->put(DON_CODICE, rec.get(SOG_CODICE));
|
||||
int err = _sdonazioni->read(key);
|
||||
TRectype recnew(recdon);
|
||||
recnew.put(DON_CODICE, rec.get_long(SOG_CODICE));
|
||||
recnew.put(DON_PROGDON, _sdonazioni->rows()+1);
|
||||
|
257
ba/autorun.cpp
257
ba/autorun.cpp
@ -14,6 +14,9 @@ extern "C"
|
||||
#include "../xvaga/skeylink.h"
|
||||
}
|
||||
|
||||
static HINSTANCE _hInstance = NULL;
|
||||
static int _dongle_type = 0;
|
||||
|
||||
void ErrorBox(LPCSTR str)
|
||||
{
|
||||
MessageBox(GetFocus(), str, "Installazione", MB_ICONSTOP|MB_OK);
|
||||
@ -28,22 +31,22 @@ void WarningBox(LPCSTR str)
|
||||
/* Gestione chiave Hardlock */
|
||||
/****************************/
|
||||
|
||||
bool HardlockGarble(unsigned int* data)
|
||||
bool HardlockGarble(unsigned short* data)
|
||||
{
|
||||
HL_CODE(data, 1);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
unsigned int HardlockLogin(int& year)
|
||||
unsigned short HardlockLogin(int& year)
|
||||
{
|
||||
unsigned int serno = 0xFFFF;
|
||||
unsigned short serno = 0xFFFF;
|
||||
unsigned char REFKEY[16] = "CAMPOKEY";
|
||||
unsigned char VERKEY[16] = "ìpÙˆ¬cê<";
|
||||
if (HL_LOGIN(26952, LOCAL_DEVICE, REFKEY, VERKEY) == STATUS_OK)
|
||||
{
|
||||
unsigned int eprom[64]; memset(eprom, 0, sizeof(eprom));
|
||||
unsigned short eprom[64]; memset(eprom, 0, sizeof(eprom));
|
||||
HL_READBL((unsigned char*)eprom);
|
||||
unsigned int data[4];
|
||||
unsigned short data[4];
|
||||
memcpy(data, eprom, sizeof(data));
|
||||
HardlockGarble(data);
|
||||
if (data[0] == 0xFAE8)
|
||||
@ -72,9 +75,9 @@ void EncodeEutronPassword(char* str)
|
||||
strcpy(str, tmp);
|
||||
}
|
||||
|
||||
unsigned int EutronLogin(int& year)
|
||||
unsigned short EutronLogin(int& year)
|
||||
{
|
||||
unsigned int serno = 0xFFFF;
|
||||
unsigned short serno = 0xFFFF;
|
||||
|
||||
KEY_NET eutron_key;
|
||||
memset(&eutron_key, 0, sizeof(KEY_NET));
|
||||
@ -103,7 +106,7 @@ unsigned int EutronLogin(int& year)
|
||||
smartlink(&eutron_key);
|
||||
if (eutron_key.status == ST_OK)
|
||||
{
|
||||
serno = (unsigned int)atol((const char*)eutron_key.data+4);
|
||||
serno = (unsigned short)atol((const char*)eutron_key.data+4);
|
||||
const unsigned short y = *(unsigned short*)(eutron_key.data+12);
|
||||
if (y > 2000 && y < 3000)
|
||||
year = y;
|
||||
@ -172,62 +175,141 @@ void ProgramName(char* name)
|
||||
strcpy(name, "Campo");
|
||||
}
|
||||
|
||||
bool DongleTest()
|
||||
int DongleTest()
|
||||
{
|
||||
_dongle_type = 0;
|
||||
int yearKey = 0;
|
||||
|
||||
unsigned int serno = HardlockLogin(yearKey);
|
||||
if (serno == 0xFFFF)
|
||||
{
|
||||
serno = EutronLogin(yearKey);
|
||||
if (serno != 0xFFFF)
|
||||
_dongle_type = 2; //chiave eutron
|
||||
}
|
||||
else
|
||||
_dongle_type = 1; //chiave hardlock
|
||||
|
||||
if (serno == 0 || serno == 0xFFFF)
|
||||
return TRUE; // Chiave inesistente o invisibile = Prima installazione
|
||||
if (serno == 0) // Chiave di sviluppo
|
||||
return _dongle_type;
|
||||
if (serno == 0xFFFF) // Chiave inesistente o invisibile = Prima installazione o demo
|
||||
return _dongle_type;
|
||||
|
||||
const int verYear = VersionYear();
|
||||
if (yearKey >= verYear) // Chiave già programmata con assistenza pagata
|
||||
return TRUE;
|
||||
|
||||
bool ok = FALSE;
|
||||
ifstream keys("./program/zip/dninst.zip", ios::in | ios::nocreate);
|
||||
if (keys.good())
|
||||
{
|
||||
char line[256];
|
||||
keys.getline(line, sizeof(line));
|
||||
srand(883);
|
||||
DecodeString(line);
|
||||
const int ass_year = atoi(line);
|
||||
if (ass_year > yearKey) // Non devo abbassare l'anno di assistenza!
|
||||
{
|
||||
srand(ass_year);
|
||||
while (!keys.eof())
|
||||
{
|
||||
keys.getline(line, sizeof(line));
|
||||
DecodeString(line);
|
||||
unsigned int sn = (unsigned int)atol(line);
|
||||
if (sn == serno || line[0] == '*')
|
||||
{
|
||||
ok = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (ok)
|
||||
{
|
||||
wsprintf(line, "Il contratto di manutenzione %d verrà attivato automaticamente", ass_year);
|
||||
WarningBox(line);
|
||||
}
|
||||
else
|
||||
{
|
||||
wsprintf(line, "È necessario contattare l'assistenza tecnica\n"
|
||||
"per l'abilitazione del contratto di manutenzione %d", verYear);
|
||||
WarningBox(line);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ErrorBox("Impossibile verificare il contratto di manutenzione");
|
||||
}
|
||||
return ok;
|
||||
if (yearKey < verYear) // Chiave già programmata con assistenza pagata
|
||||
{
|
||||
bool ok = FALSE;
|
||||
ifstream keys("./program/zip/dninst.zip", ios::in | ios::nocreate);
|
||||
if (keys.good())
|
||||
{
|
||||
char line[256];
|
||||
keys.getline(line, sizeof(line));
|
||||
srand(883);
|
||||
DecodeString(line);
|
||||
const int ass_year = atoi(line);
|
||||
if (ass_year > yearKey) // Non devo abbassare l'anno di assistenza!
|
||||
{
|
||||
srand(ass_year);
|
||||
while (!keys.eof())
|
||||
{
|
||||
keys.getline(line, sizeof(line));
|
||||
DecodeString(line);
|
||||
unsigned int sn = (unsigned int)atol(line);
|
||||
if (sn == serno || line[0] == '*')
|
||||
{
|
||||
ok = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (ok)
|
||||
{
|
||||
wsprintf(line, "Il contratto di manutenzione %d verrà attivato automaticamente", ass_year);
|
||||
WarningBox(line);
|
||||
}
|
||||
else
|
||||
{
|
||||
wsprintf(line, "È necessario contattare l'assistenza tecnica\n"
|
||||
"per l'abilitazione del contratto di manutenzione %d", verYear);
|
||||
WarningBox(line);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ErrorBox("Impossibile verificare il contratto di manutenzione");
|
||||
}
|
||||
}
|
||||
return _dongle_type;
|
||||
}
|
||||
|
||||
//allah!
|
||||
int __stdcall DongleProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (uMsg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
::CheckRadioButton(hDlg, 100, 101, 100);
|
||||
break;
|
||||
case WM_COMMAND:
|
||||
switch (LOWORD(wParam))
|
||||
{
|
||||
case IDOK:
|
||||
_dongle_type = ::IsDlgButtonChecked(hDlg, 100) ? 2 : 1;
|
||||
case IDCANCEL:
|
||||
::EndDialog(hDlg, LOWORD(wParam));
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool InstallDongle()
|
||||
{
|
||||
//metodo per richiedere il tipo di chiave e lanciare l'installazione dei servizi
|
||||
int ret = ::DialogBox(_hInstance, "DONGLE", NULL, DongleProc);
|
||||
if (ret != IDOK)
|
||||
return false;
|
||||
|
||||
char path[256] = "";
|
||||
if (_dongle_type == 1)
|
||||
strcpy(path, "./chiavi/hardlock/hldrv32.exe");
|
||||
else
|
||||
strcpy(path, "./chiavi/eutron/sdi.exe");
|
||||
|
||||
STARTUPINFO si;
|
||||
PROCESS_INFORMATION pi;
|
||||
|
||||
ZeroMemory( &si, sizeof(si) );
|
||||
si.cb = sizeof(si);
|
||||
ZeroMemory( &pi, sizeof(pi) );
|
||||
|
||||
// Start the child process.
|
||||
if( !CreateProcess( NULL, // No module name (use command line).
|
||||
path, // Command line.
|
||||
NULL, // Process handle not inheritable.
|
||||
NULL, // Thread handle not inheritable.
|
||||
FALSE, // Set handle inheritance to FALSE.
|
||||
0, // No creation flags.
|
||||
NULL, // Use parent's environment block.
|
||||
NULL, // Use parent's starting directory.
|
||||
&si, // Pointer to STARTUPINFO structure.
|
||||
&pi ) // Pointer to PROCESS_INFORMATION structure.
|
||||
)
|
||||
return false;
|
||||
// Wait until child process exits.
|
||||
WaitForSingleObject( pi.hProcess, INFINITE );
|
||||
|
||||
// Close process and thread handles.
|
||||
CloseHandle( pi.hProcess );
|
||||
CloseHandle( pi.hThread );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
unsigned int Run(LPCSTR app)
|
||||
@ -286,8 +368,8 @@ LRESULT CALLBACK MainWndProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
PAINTSTRUCT ps;
|
||||
RECT rct;
|
||||
const char* s1 = "Installa la versione commerciale protetta. E' necessario disporre di una chiave di protezione hardware.";
|
||||
const char* s2 = "Installa la versione Demo. La versione Demo è priva di protezione hardware ma soggetta ad alcune limitazioni.";
|
||||
const char* s1 = "Installa la versione normale";
|
||||
const char* s2 = "Installa la versione dimostrativa";
|
||||
const char* s4 = "Termina installazione";
|
||||
const char* s5 = "Scelta installazione";
|
||||
|
||||
@ -327,19 +409,36 @@ LRESULT CALLBACK MainWndProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
break;
|
||||
case WM_COMMAND:
|
||||
{
|
||||
if (wParam == 1000)
|
||||
{
|
||||
if (DongleTest())
|
||||
Run("program\\disk1\\setup.exe");
|
||||
}
|
||||
else if (wParam == 1001)
|
||||
{
|
||||
Run("demo\\disk1\\setup.exe");
|
||||
}
|
||||
else if (wParam != 2)
|
||||
return 0;
|
||||
|
||||
PostQuitMessage(0);
|
||||
bool quit_program = false;
|
||||
switch (LOWORD(wParam))
|
||||
{
|
||||
case 2:
|
||||
quit_program = true;
|
||||
break;
|
||||
case 1000: //installazione normale con chiave
|
||||
if (_dongle_type == 0) //non trova una chiave funzionante...
|
||||
{
|
||||
InstallDongle(); //chiede di installare la chiave...
|
||||
DongleTest(); //verifica l'installazione della chiave..
|
||||
if (_dongle_type == 0) //la chiave non c'e' proprio!
|
||||
{ //forza l'installazione del modulo SY con chiave Eutron (finta)
|
||||
int ret = ::MessageBox(hwnd, "ATTENZIONE! Chiave di protezione NON rilevata:\n"
|
||||
"Si desidera installare ugualmente il modulo base ?",
|
||||
"Installazione", MB_YESNO | MB_ICONQUESTION);
|
||||
_dongle_type = ret == IDYES ? 2 : 0;
|
||||
}
|
||||
}
|
||||
if (_dongle_type != 0)
|
||||
quit_program = Run("program\\disk1\\setup.exe") > 32;
|
||||
break;
|
||||
case 1001:
|
||||
quit_program = Run("demo\\disk1\\setup.exe") > 32;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (quit_program) //esce dal programma di installazione
|
||||
PostQuitMessage(0);
|
||||
}
|
||||
break;
|
||||
case WM_CHAR:
|
||||
@ -378,7 +477,7 @@ BOOL InitApplication (HINSTANCE hinst)
|
||||
wc.cbClsExtra = 0;
|
||||
wc.cbWndExtra = DLGWINDOWEXTRA;
|
||||
wc.hInstance = hinst;
|
||||
wc.hIcon = LoadIcon(hinst, MAKEINTRESOURCE(103));
|
||||
wc.hIcon = LoadIcon(hinst, MAKEINTRESOURCE(9012));
|
||||
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
|
||||
wc.hbrBackground = HBRUSH(COLOR_WINDOW + 1);
|
||||
wc.lpszMenuName = NULL;
|
||||
@ -400,9 +499,12 @@ int PASCAL WinMain (HINSTANCE hInst, HINSTANCE hinstPrev, LPSTR pCmdLine, int nC
|
||||
{
|
||||
MSG msg;
|
||||
|
||||
if (!hinstPrev)
|
||||
if (!InitApplication(hInst)) // Register window class
|
||||
return FALSE;
|
||||
if (!InitApplication(hInst)) // Register window class
|
||||
return 0;
|
||||
|
||||
_hInstance = hInst;
|
||||
|
||||
_dongle_type = DongleTest(); //controlla se la chiave c'e' ed eventualmente quale e'
|
||||
|
||||
RECT rect;
|
||||
GetWindowRect(GetDesktopWindow(),&rect);
|
||||
@ -418,13 +520,16 @@ int PASCAL WinMain (HINSTANCE hInst, HINSTANCE hinstPrev, LPSTR pCmdLine, int nC
|
||||
char prompt[128];
|
||||
strcpy(prompt, name);
|
||||
|
||||
UINT dwFlags = WS_CHILD | WS_VISIBLE;
|
||||
/* Disegna i pulsanti */
|
||||
CreateWindow("BUTTON",prompt, WS_CHILD | WS_VISIBLE,
|
||||
CreateWindow("BUTTON",prompt, dwFlags,
|
||||
offx, offy, 300, 32, hwndDlg , (HMENU)1000, hInst, NULL );
|
||||
|
||||
|
||||
if (_dongle_type != 0) //se la chiave e' presente e funzionante non si puo' installare la DEMO
|
||||
dwFlags |= WS_DISABLED;
|
||||
strcat(prompt, " DEMO");
|
||||
CreateWindow("BUTTON", prompt, WS_CHILD | WS_VISIBLE,
|
||||
CreateWindow("BUTTON", prompt, dwFlags,
|
||||
offx, offy+80, 300, 32, hwndDlg , (HMENU)1001, hInst, NULL );
|
||||
|
||||
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include "batbver.h"
|
||||
#include "batbnoc.h"
|
||||
#include "batbnot.h"
|
||||
#define F_PREZZO 107
|
||||
|
||||
#define REG_JOURNAL 5
|
||||
#define REG_DICHINT 10
|
||||
@ -28,6 +29,8 @@
|
||||
#define TAB_GRMERC "GMC"
|
||||
#define TAB_NOMENCOMB "%NOC"
|
||||
#define TAB_NOTECLI "%NOT"
|
||||
#define TAB_PREST "PRS"
|
||||
#define TAB_SPESE "SPP"
|
||||
|
||||
class TGeneric_table_app : public TTable_application
|
||||
{
|
||||
@ -736,22 +739,36 @@ bool TGeneric_table_app::user_destroy()
|
||||
int TGeneric_table_app::read(TMask& m)
|
||||
{
|
||||
int err = Tab_application::read(m);
|
||||
if (get_tabname() == TAB_NOTECLI)
|
||||
const TString & table_name = get_tabname();
|
||||
if (table_name == TAB_NOTECLI)
|
||||
glue_string();
|
||||
else
|
||||
if (table_name == TAB_SPESE || table_name == TAB_PREST)
|
||||
{
|
||||
if (get_relation()->lfile().get_real("R10") == ZERO)
|
||||
m.set(F_PREZZO, get_relation()->lfile().get("R0"));
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
int TGeneric_table_app::write(const TMask& m)
|
||||
{
|
||||
if (get_tabname() == TAB_NOTECLI)
|
||||
const TString & table_name = get_tabname();
|
||||
|
||||
if (table_name == TAB_NOTECLI)
|
||||
fragment_string();
|
||||
else
|
||||
if (table_name == TAB_SPESE || table_name == TAB_PREST)
|
||||
get_relation()->lfile().put("R0", m.get(F_PREZZO));
|
||||
|
||||
return Tab_application::write(m);
|
||||
}
|
||||
|
||||
int TGeneric_table_app::rewrite(const TMask& m)
|
||||
{
|
||||
if (get_tabname() == TAB_REGISTRI && !m.get_bool(F_CONFIG))
|
||||
const TString & table_name = get_tabname();
|
||||
|
||||
if (table_name == TAB_REGISTRI && !m.get_bool(F_CONFIG))
|
||||
{
|
||||
TString16 config;
|
||||
config.format("REG%05ld", m.get_long(F_CODDITTA));
|
||||
@ -762,8 +779,11 @@ int TGeneric_table_app::rewrite(const TMask& m)
|
||||
ini.set("Type", -1);
|
||||
}
|
||||
|
||||
if (get_tabname() == TAB_NOTECLI)
|
||||
if (table_name == TAB_NOTECLI)
|
||||
fragment_string();
|
||||
else
|
||||
if (table_name == TAB_SPESE || table_name == TAB_PREST)
|
||||
get_relation()->lfile().put("R0", m.get(F_PREZZO));
|
||||
|
||||
return Tab_application::rewrite(m);
|
||||
}
|
||||
|
@ -69,7 +69,10 @@ Descrizione = Provvigioni Agenti
|
||||
Descrizione = Statistiche di Vendita
|
||||
|
||||
[dt]
|
||||
Descrizione = Importazione documenti STORE
|
||||
Descrizione = Importazione documenti DI.TECH
|
||||
|
||||
[tp]
|
||||
Descrizione = Trasferimento PACK
|
||||
|
||||
[_area_magazzino_produzione]
|
||||
Descrizione=AREA MAGAZZINO E PRODUZIONE
|
||||
|
@ -239,8 +239,12 @@ void TCalc_cesp_cms::utilizzo_per_cms(const TRectype& ammce_rec)
|
||||
if (!doc_exist)
|
||||
{
|
||||
doc_cesp.put(DOC_TIPODOC, _mask->get(F_TIPODOC));
|
||||
doc_cesp.put(DOC_DATADOC, TDate(TODAY));
|
||||
doc_cesp.put(DOC_DATADOC, _mask->get(F_GENERA_DOC));
|
||||
}
|
||||
//completa la testata con i dati della maschera
|
||||
doc_cesp.put(DOC_TIPOCF, 'F');
|
||||
doc_cesp.put(DOC_CODCF, _mask->get(F_CODCF));
|
||||
doc_cesp.put(DOC_NUMDOCRIF, _mask->get(F_NUMDOCRIF));
|
||||
|
||||
|
||||
//ciclo su SALCECMS data una chiave idcespite + esercizio (si fa solo se salcecms non e' vuoto,
|
||||
@ -324,7 +328,7 @@ void TCalc_cesp_cms::delete_cespi_docs()
|
||||
cur_doc.freeze();
|
||||
TProgind progind(items, "Eliminazione vecchi documenti in corso...", false, true);
|
||||
|
||||
for (cur_doc=0; cur_doc.pos()<items; ++cur_doc)
|
||||
for (cur_doc = 0; cur_doc.pos() < items; ++cur_doc)
|
||||
{
|
||||
progind.addstatus(1);
|
||||
TDocumento doc(rec);
|
||||
@ -412,6 +416,8 @@ bool TCalc_cesp_cms::create()
|
||||
_mask->set(F_TIPODOC, config_doc.get("TIPODOC"));
|
||||
_mask->set(F_TIPORIGA, config_doc.get("TIPORIGA"));
|
||||
_mask->set(F_CODIVA, config_doc.get("CODIVA"));
|
||||
_mask->set(F_CODCF, config_doc.get("CODCF"));
|
||||
_mask->set(F_NUMDOCRIF, config_doc.get("NUMDOCRIF"));
|
||||
_mask->set(F_CMSGEN, config_doc.get("CMSGEN"));
|
||||
|
||||
return TSkeleton_application::create();
|
||||
|
@ -21,3 +21,7 @@
|
||||
#define F_CMSGEN 220
|
||||
#define F_DESCMSGEN 221
|
||||
#define F_CMSGROUP 222
|
||||
#define F_CODCF 223
|
||||
#define F_DESCF 224
|
||||
#define F_NUMDOCRIF 225
|
||||
#define F_GENERA_DOC 226
|
||||
|
@ -2,6 +2,8 @@
|
||||
CODNUM=
|
||||
TIPODOC=
|
||||
TIPORIGA=
|
||||
CODIVA=
|
||||
CODIVA=
|
||||
CODCF=
|
||||
NUMDOCRIF=
|
||||
CMSGEN=
|
||||
|
||||
|
@ -79,9 +79,15 @@ BEGIN
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
DATE F_GENERA_DOC
|
||||
BEGIN
|
||||
PROMPT 1 4 "Data generazione documenti "
|
||||
CHECKTYPE REQUIRED
|
||||
END
|
||||
|
||||
STRING F_DA_IDCESPITE 10
|
||||
BEGIN
|
||||
PROMPT 1 5 "Dal cespite "
|
||||
PROMPT 1 6 "Dal cespite "
|
||||
FLAGS "UZ"
|
||||
USE LF_SALCECMS SELECT NRIGA==1
|
||||
JOIN LF_CESPI INTO IDCESPITE==IDCESPITE
|
||||
@ -102,13 +108,13 @@ END
|
||||
|
||||
STRING F_DA_DESC 60 50
|
||||
BEGIN
|
||||
PROMPT 26 5 ""
|
||||
PROMPT 26 6 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_A_IDCESPITE 10
|
||||
BEGIN
|
||||
PROMPT 1 6 "Al cespite "
|
||||
PROMPT 1 7 "Al cespite "
|
||||
FLAGS "UZ"
|
||||
COPY USE F_DA_IDCESPITE
|
||||
INPUT IDCESPITE F_A_IDCESPITE
|
||||
@ -123,10 +129,15 @@ END
|
||||
|
||||
STRING F_A_DESC 60 50
|
||||
BEGIN
|
||||
PROMPT 26 6 ""
|
||||
PROMPT 26 7 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 78 8
|
||||
BEGIN
|
||||
PROMPT 0 8 "@bEstremi documento generato"
|
||||
END
|
||||
|
||||
STRING F_CODNUM 4
|
||||
BEGIN
|
||||
PROMPT 1 9 "Numerazione "
|
||||
@ -192,14 +203,37 @@ BEGIN
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
NUMBER F_CODCF 6
|
||||
BEGIN
|
||||
PROMPT 1 13 "Fornitore "
|
||||
USE LF_CLIFO
|
||||
INPUT TIPOCF "F"
|
||||
INPUT CODCF F_CODCF
|
||||
OUTPUT F_DESCF RAGSOC
|
||||
CHECKTYPE NORMAL
|
||||
FLAGS "DG"
|
||||
END
|
||||
|
||||
STRING F_DESCF 50
|
||||
BEGIN
|
||||
PROMPT 24 13 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_NUMDOCRIF 7
|
||||
BEGIN
|
||||
PROMPT 1 14 "Doc. rif. "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 78 4
|
||||
BEGIN
|
||||
PROMPT 0 14 "@bCommessa spese generali"
|
||||
PROMPT 0 16 "@bCommessa spese generali"
|
||||
END
|
||||
|
||||
STRING F_CMSGEN 20
|
||||
BEGIN
|
||||
PROMPT 1 15 "Codice Commessa "
|
||||
PROMPT 1 17 "Codice Commessa "
|
||||
FLAGS "DUZ"
|
||||
KEY 1
|
||||
USE CMS
|
||||
@ -213,7 +247,7 @@ END
|
||||
|
||||
STRING F_DESCMSGEN 50
|
||||
BEGIN
|
||||
PROMPT 1 16 "Descrizione "
|
||||
PROMPT 1 18 "Descrizione "
|
||||
FLAGS "D"
|
||||
KEY 2
|
||||
USE CMS KEY 2
|
||||
@ -226,12 +260,12 @@ END
|
||||
|
||||
BOOLEAN F_SOLOPERC
|
||||
BEGIN
|
||||
PROMPT 1 18 "Utilizza solo le percentuali nel calcolo"
|
||||
PROMPT 35 20 "Utilizza solo le percentuali nel calcolo"
|
||||
END
|
||||
|
||||
BOOLEAN F_CMSGROUP
|
||||
BEGIN
|
||||
PROMPT 1 19 "Raggruppamento per commessa"
|
||||
PROMPT 1 20 "Raggruppamento per commessa"
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
@ -158,6 +158,7 @@
|
||||
#define F_CODVALINTRA 247
|
||||
#define F_DESVALINTRA 248
|
||||
#define F_CODCAUSNC 249
|
||||
#define F_DATAECONAI 250
|
||||
|
||||
#define DLG_RIC 300
|
||||
#define DLG_CST 301
|
||||
|
@ -1325,12 +1325,20 @@ END
|
||||
|
||||
BOOLEAN F_ADDCONAI
|
||||
BEGIN
|
||||
PROMPT 2 12 "Addebito CONAI"
|
||||
PROMPT 2 11 "Addebito CONAI"
|
||||
FIELD LF_CFVEN->ADDCONAI
|
||||
MESSAGE FALSE CLEAR,8@|ENABLE,F_CONAIASS
|
||||
MESSAGE TRUE ENABLE,8@|CLEAR,F_CONAIASS
|
||||
END
|
||||
|
||||
DATE F_DATAECONAI
|
||||
BEGIN
|
||||
PROMPT 2 12 "Data fine esenz.CONAI "
|
||||
FIELD LF_CFVEN->DATAECONAI
|
||||
GROUP 8
|
||||
MESSAGE TRUE ENABLE,8@|CLEAR,F_CONAIASS
|
||||
END
|
||||
|
||||
BOOLEAN F_CONAIASS
|
||||
BEGIN
|
||||
PROMPT 43 12 "Stampa contributo CONAI assolto"
|
||||
|
127
cg/cg2100.cpp
127
cg/cg2100.cpp
@ -121,6 +121,7 @@ TMask* TPrimanota_application::load_mask(int n)
|
||||
m->set_handler(SK_CAMBIO, cambio_handler);
|
||||
m->set_handler(SK_TOTDOCVAL, totdocval_handler);
|
||||
m->set_handler(F_CODPAG, codpag_handler);
|
||||
m->set_handler(F_LINKDOC, linkdoc_handler);
|
||||
|
||||
TSheet_field& cg = m->sfield(F_SHEETCG);
|
||||
cg.set_notify(cg_notify);
|
||||
@ -138,6 +139,7 @@ TMask* TPrimanota_application::load_mask(int n)
|
||||
cgm.set_handler(113, suspended_handler); // Contropartita
|
||||
cgm.set_handler(213, sheet_clifo_handler);
|
||||
cgm.set_handler(313, sheet_clifo_handler);
|
||||
cgm.set_handler(CG_MASTRINO, sheet_mastrino_handler);
|
||||
|
||||
// Se esiste lo sheet delle rate
|
||||
if (is_fattura())
|
||||
@ -176,7 +178,8 @@ TMask* TPrimanota_application::load_mask(int n)
|
||||
bool TPrimanota_application::user_create()
|
||||
{
|
||||
open_files(LF_TABCOM, LF_TAB, LF_CAUSALI, LF_RCAUSALI, LF_CLIFO, LF_PCON, 0);
|
||||
open_files(LF_ATTIV, LF_SALDI, LF_COMUNI, LF_OCCAS, LF_NDITTE, 0);
|
||||
open_files(LF_ATTIV, LF_COMUNI, LF_OCCAS, LF_NDITTE, 0);
|
||||
open_files(LF_MOV, LF_RMOV, LF_RMOVIVA, LF_SALDI, 0);
|
||||
open_files(LF_PARTITE, LF_SCADENZE, LF_PAGSCA, LF_AGENTI, 0);
|
||||
|
||||
_incasso = new TDati_incasso;
|
||||
@ -191,9 +194,12 @@ bool TPrimanota_application::user_create()
|
||||
|
||||
_pag = NULL;
|
||||
_is_saldaconto = false;
|
||||
|
||||
|
||||
TFilename tmp;
|
||||
if (get_mask_swap_file(tmp))
|
||||
xvt_fsys_removefile(tmp);
|
||||
|
||||
load_mask(0);
|
||||
|
||||
load_colors();
|
||||
|
||||
return true;
|
||||
@ -392,7 +398,7 @@ bool TPrimanota_application::changing_mask(int mode)
|
||||
TMask* TPrimanota_application::get_mask(int mode)
|
||||
{
|
||||
int annoiva = 0;
|
||||
TString16 caus;
|
||||
TString4 caus;
|
||||
|
||||
_mode = mode;
|
||||
|
||||
@ -421,12 +427,54 @@ TMask* TPrimanota_application::get_mask(int mode)
|
||||
return load_mask(_iva == nessuna_iva ? 1 : 2);
|
||||
}
|
||||
|
||||
bool TPrimanota_application::get_mask_swap_file(TFilename& name) const
|
||||
{
|
||||
name.tempdir(); name.add("cg2100.ini");
|
||||
return name.exist();
|
||||
}
|
||||
|
||||
bool TPrimanota_application::force_mask_swap(const TCausale& old_caus, const TCausale& new_caus)
|
||||
{
|
||||
TMask& old = curr_mask();
|
||||
|
||||
// Resetto il flag di dirty per non chiedere di salvare cose inutili
|
||||
for (int i = old.fields()-1; i >= 0; i--)
|
||||
{
|
||||
TMask_field& f = old.fld(i);
|
||||
f.set_dirty(false);
|
||||
}
|
||||
if (old.dirty())
|
||||
return false;
|
||||
|
||||
// Salvo la maschera corrente in un apposito file temporaneo "cg2100.ini"
|
||||
TFilename tmp; get_mask_swap_file(tmp);
|
||||
TConfig ini(tmp);
|
||||
mask2ini(old, ini);
|
||||
|
||||
ini.set_paragraph("23");
|
||||
ini.remove(MOV_NUMREG); // Tolgo numero di registrazione provvisorio
|
||||
|
||||
if (old_caus.iva() != nessuna_iva && new_caus.iva() != nessuna_iva)
|
||||
{
|
||||
// Salvo un campo virtuale col codice IVA
|
||||
ini.set("CODIVA", old.get(F_CODIVA));
|
||||
}
|
||||
if (old_caus.iva() != new_caus.iva() || old_caus.corrispettivi() != new_caus.corrispettivi())
|
||||
{
|
||||
ini.remove(MOV_CODCF); // Tolgo il codice cliente, che potrebbe infornitorirsi
|
||||
}
|
||||
|
||||
old.stop_run(K_ESC);
|
||||
return true;
|
||||
}
|
||||
|
||||
void TPrimanota_application::on_firm_change()
|
||||
{
|
||||
TRelation_application::on_firm_change(); // May be useful, who knows?
|
||||
|
||||
_rel->lfile().last();
|
||||
_lastreg = _rel->lfile().get_long(MOV_NUMREG); // Init last registration number
|
||||
_lastreg = 0;
|
||||
if (_rel->lfile().last() == NOERR)
|
||||
_lastreg = _rel->curr().get_long(MOV_NUMREG); // Init last registration number
|
||||
|
||||
_esercizi.update(); // Init exercises
|
||||
}
|
||||
@ -512,8 +560,11 @@ void TPrimanota_application::init_mask(TMask& m)
|
||||
// Show/Hide campi valuta: F_VALUTA, F_CAMBIO, F_DATACAMBIO (GROUP 3)
|
||||
const bool valuta = _ges_val && is_saldaconto() && causale().valuta();
|
||||
m.show(-3, valuta);
|
||||
_sal_dirty = false; // Azzero il flag di modifica del saldaconto
|
||||
|
||||
fill_sheet(m); // Riempe righe contabili coi conti della causale
|
||||
|
||||
m.hide(F_LINKDOC);
|
||||
}
|
||||
|
||||
void TPrimanota_application::init_query_mode(TMask& m)
|
||||
@ -531,6 +582,15 @@ void TPrimanota_application::init_query_mode(TMask& m)
|
||||
}
|
||||
|
||||
_incasso->_step = 0; // Azzera flag di incasso immediato
|
||||
|
||||
TFilename tmp;
|
||||
if (get_mask_swap_file(tmp))
|
||||
{
|
||||
TConfig ini(tmp, "23");
|
||||
m.set(F_DATAREG, ini.get(MOV_DATAREG));
|
||||
m.set(F_CODCAUS, ini.get(MOV_CODCAUS));
|
||||
m.send_key(K_SPACE, DLG_NEWREC);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -648,6 +708,21 @@ void TPrimanota_application::init_insert_mode(TMask& m)
|
||||
// La preservo solo per l'incasso immediato
|
||||
|
||||
_as400 = false; // Un movimento nuovo non puo' essere trasferito da AS400
|
||||
|
||||
TFilename tmp;
|
||||
if (get_mask_swap_file(tmp))
|
||||
{
|
||||
TConfig ini(tmp, "23");
|
||||
ini2mask(ini, m, false);
|
||||
|
||||
// Controllo se e' stato salvato il campo virtuale col codice IVA
|
||||
const TString& codiva = ini.get("CODIVA", "23");
|
||||
if (!codiva.empty())
|
||||
m.set(F_CODIVA, codiva, 3);
|
||||
|
||||
xvt_fsys_removefile(tmp);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -703,10 +778,10 @@ void TPrimanota_application::init_modify_mode(TMask& m)
|
||||
}
|
||||
}
|
||||
|
||||
if (navigating())
|
||||
const TRectype& mov = get_relation()->curr();
|
||||
if (!mov.empty())
|
||||
{
|
||||
const TRectype& mov = get_relation()->curr();
|
||||
if (!mov.empty())
|
||||
if (navigating())
|
||||
{
|
||||
TString msg;
|
||||
if (mov.get_bool(MOV_STAMPATO))
|
||||
@ -721,6 +796,10 @@ void TPrimanota_application::init_modify_mode(TMask& m)
|
||||
warning_box(msg);
|
||||
}
|
||||
}
|
||||
|
||||
// Abilito il bottone di collegamento ai documenti se possibile
|
||||
const long numdoc = mov.get_long(MOV_DNDOC);
|
||||
m.show(F_LINKDOC, numdoc > 0 && has_module(VEAUT));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1102,7 +1181,7 @@ int TPrimanota_application::write(const TMask& m)
|
||||
// Genera incasso immediato se e' una fattura e non c'e' gestione saldaconto
|
||||
if (!m.get_bool(F_SOLAIVA) && !gestione_saldaconto())
|
||||
{
|
||||
const TString causimm(causale().causale_inc_imm());
|
||||
const TString4 causimm(causale().causale_inc_imm());
|
||||
if (causimm.not_empty())
|
||||
genera_incasso(causimm);
|
||||
}
|
||||
@ -1230,7 +1309,7 @@ void TPrimanota_application::genera_incasso(const char* causimm)
|
||||
}
|
||||
else
|
||||
{
|
||||
TCausale& caus = causale();
|
||||
const TCausale& caus = causale();
|
||||
m.set(F_DATADOC, _incasso->_datadoc);
|
||||
m.set(F_NUMDOC, _incasso->_numdoc);
|
||||
TBill contro; caus.bill(2, contro);
|
||||
@ -1262,12 +1341,10 @@ void TPrimanota_application::genera_incasso(const char* causimm)
|
||||
|
||||
bool TPrimanota_application::is_percipient(long forn, char& tipper, long& codper) const
|
||||
{
|
||||
TLocalisamfile fornitori(LF_CLIFO);
|
||||
fornitori.put("TIPOCF", "F");
|
||||
fornitori.put("CODCF", forn);
|
||||
fornitori.read();
|
||||
tipper = fornitori.get_char(CLI_TIPOAPER);
|
||||
codper = fornitori.get_long(CLI_CODANAGPER);
|
||||
TString16 key; key.format("F|%ld", forn);
|
||||
const TRectype& fornitore = cache().get(LF_CLIFO, key);
|
||||
tipper = fornitore.get_char(CLI_TIPOAPER);
|
||||
codper = fornitore.get_long(CLI_CODANAGPER);
|
||||
return codper > 0;
|
||||
}
|
||||
|
||||
@ -1317,7 +1394,6 @@ long TPrimanota_application::calcola_m770(int tipo_coll, real& spese, real& comp
|
||||
TImporto imp; imp = cgs().row(i);
|
||||
ritfis += imp.valore();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (tipo_coll == 3 || tipo_coll == 7)
|
||||
@ -1461,10 +1537,10 @@ bool TPrimanota_application::link_m770()
|
||||
|
||||
HIDDEN void ini2bill(TConfig& ini, TBill& bil, bool contro)
|
||||
{
|
||||
char tipo = ini.get_char(contro ? "TIPOC" : "TIPO");
|
||||
int gruppo = ini.get_int(contro ? "GRUPPOC" : "GRUPPO");
|
||||
int conto = ini.get_int(contro ? "CONTOC" : "CONTO");
|
||||
long sottoconto = ini.get_long(contro ? "SOTTOCONTC" : "SOTTOCONTO");
|
||||
const char tipo = ini.get_char(contro ? "TIPOC" : "TIPO");
|
||||
const int gruppo = ini.get_int(contro ? "GRUPPOC" : "GRUPPO");
|
||||
const int conto = ini.get_int(contro ? "CONTOC" : "CONTO");
|
||||
const long sottoconto = ini.get_long(contro ? "SOTTOCONTC" : "SOTTOCONTO");
|
||||
bil.set(gruppo, conto, sottoconto, tipo);
|
||||
}
|
||||
|
||||
@ -1493,7 +1569,7 @@ void TPrimanota_application::ini2mask(TConfig& ini, TMask& msk, bool query)
|
||||
{
|
||||
set_not_empty(msk, F_CODCAUS, ini, MOV_CODCAUS);
|
||||
TString16 val = ini.get(MOV_DATAREG);
|
||||
if (val.empty())
|
||||
if (val.blank())
|
||||
val = TDate(TODAY).string();
|
||||
msk.set(F_DATAREG, val);
|
||||
}
|
||||
@ -1784,8 +1860,7 @@ bool TPrimanota_application::link_intra(const TMask& m, const char* action)
|
||||
}
|
||||
|
||||
intro.set("Action", "Insert");
|
||||
TString str; // Stringa jolly di lavoro
|
||||
str.format("%d", LF_RIEPRETT);
|
||||
TString4 str; str.format("%d", LF_RIEPRETT);
|
||||
intro.set_paragraph(str);
|
||||
intro.set("TIPO", tipo == 'B' ? "B" : "D");
|
||||
intro.set("ANNO", datareg.year());
|
||||
@ -1984,4 +2059,4 @@ int cg2100 (int argc, char** argv)
|
||||
a->run(argc, argv, TR("Prima nota"));
|
||||
delete a;
|
||||
return 0;
|
||||
}
|
||||
}
|
@ -40,6 +40,7 @@
|
||||
#define F_DESPAG 123
|
||||
#define F_ANNORIF 124
|
||||
#define F_NUMRIF 125
|
||||
#define F_LINKDOC 126
|
||||
#define F_PROVVISORIO 129
|
||||
#define F_OCCASEDIT 131
|
||||
#define F_SOLAIVA 132
|
||||
@ -75,6 +76,8 @@
|
||||
#define CG_SOTTOCONTO 106
|
||||
#define CG_DESCR 109
|
||||
#define CG_ROWTYPE 115
|
||||
#define CG_MASTRINO 116
|
||||
|
||||
|
||||
|
||||
// Campi ripetuti sulla seconda pagina
|
||||
@ -148,4 +151,4 @@
|
||||
#define K_ANNOES 415
|
||||
#define K_DATACOMP 416
|
||||
|
||||
#endif
|
||||
#endif
|
@ -124,13 +124,18 @@ END
|
||||
|
||||
STRING F_NUMDOC 7
|
||||
BEGIN
|
||||
PROMPT 56 7 "Documento n. "
|
||||
PROMPT 50 7 "Documento n. "
|
||||
FIELD NUMDOC
|
||||
FLAGS "U"
|
||||
WARNING "La causale impone di specificare il numero documento"
|
||||
MESSAGE COPY,K_NUMDOC
|
||||
END
|
||||
|
||||
BUTTON F_LINKDOC 3 1
|
||||
BEGIN
|
||||
PROMPT 73 7 "Doc."
|
||||
END
|
||||
|
||||
NUMBER F_ANNOIVA 4
|
||||
BEGIN
|
||||
FLAGS "H"
|
||||
|
@ -139,12 +139,17 @@ END
|
||||
|
||||
STRING F_NUMDOC 7
|
||||
BEGIN
|
||||
PROMPT 57 6 "Documento n. "
|
||||
PROMPT 50 6 "Documento n. "
|
||||
FIELD NUMDOC
|
||||
FLAGS "U"
|
||||
WARNING "La causale o il saldaconto richiedono il numero documento"
|
||||
END
|
||||
|
||||
BUTTON F_LINKDOC 3 1
|
||||
BEGIN
|
||||
PROMPT 73 6 "Doc."
|
||||
END
|
||||
|
||||
LIST F_SOLAIVA 1 3
|
||||
BEGIN
|
||||
PROMPT 1 7 "Movimento di sola IVA "
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <colors.h>
|
||||
#include <execp.h>
|
||||
#include <msksheet.h>
|
||||
#include <progind.h>
|
||||
#include <tabutil.h>
|
||||
@ -12,6 +13,8 @@
|
||||
#include <clifo.h>
|
||||
#include <cfven.h>
|
||||
#include <pconti.h>
|
||||
#include <doc.h>
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Funzioni di decodifica/calcolo
|
||||
@ -37,7 +40,7 @@ TipoIVA TPrimanota_application::cau2IVA(const char* cod, int annoiva)
|
||||
// Certified 99%
|
||||
const real& TPrimanota_application::cod2IVA(const TMask& m)
|
||||
{
|
||||
static TString16 _codiva; // Ultimo codice iva decodificato
|
||||
static TString4 _codiva; // Ultimo codice iva decodificato
|
||||
static real _percent; // Percentuale dell'ultimo codice iva
|
||||
// Tipo Costo Ricavo
|
||||
if (app().iva() == iva_acquisti && m.get_int(103) == 3)
|
||||
@ -47,7 +50,7 @@ const real& TPrimanota_application::cod2IVA(const TMask& m)
|
||||
if (_codiva != codiva)
|
||||
{
|
||||
_codiva = codiva;
|
||||
TCodiceIVA c(_codiva);
|
||||
const TCodiceIVA c(_codiva);
|
||||
_percent = c.percentuale();
|
||||
}
|
||||
|
||||
@ -1462,7 +1465,7 @@ bool TPrimanota_application::iva_notify(TSheet_field& iva, int r, KEY k)
|
||||
if (c.ok())
|
||||
{
|
||||
const TString80 d(cau.desc_agg(ri));
|
||||
oldposiva = a.set_cgs_row(-1, a.real2imp(ZERO, 'I'), c, d, tipod);
|
||||
oldposiva = a.set_cgs_row(-1, a.real2imp(ZERO, 'I'), c, d, tipod);
|
||||
}
|
||||
else
|
||||
if (ri == 4) // Se non esiste il conto IVA indetraibile ...
|
||||
@ -1819,6 +1822,49 @@ bool TPrimanota_application::sheet_clifo_handler(TMask_field& f, KEY k)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TPrimanota_application::sheet_mastrino_handler(TMask_field& f, KEY k)
|
||||
{
|
||||
if (k == K_SPACE)
|
||||
{
|
||||
TMask& m = f.mask();
|
||||
const TString& tipo = m.get(CG_TIPO);
|
||||
const short id_sotto = CG_SOTTOCONTO + (tipo.blank() ? 0 : (tipo == "C" ? 100 : 200));
|
||||
|
||||
TPrimanota_application& a = app();
|
||||
const TMask& cm = a.curr_mask();
|
||||
|
||||
int anno = cm.get_int(F_ANNOES);
|
||||
if (anno <= 0)
|
||||
{
|
||||
TDate date = cm.get(F_DATACOMP);
|
||||
if (!date.ok())
|
||||
date = cm.get_date(F_DATAREG);
|
||||
anno = a._esercizi.date2esc(date);
|
||||
}
|
||||
|
||||
TFilename ininame; ininame.tempdir(); ininame.add("mastrino.ini");
|
||||
if (anno > 0 && !m.field(id_sotto).empty())
|
||||
{
|
||||
TConfig ini(ininame, "Transaction");
|
||||
ini.set("Action", "Modify");
|
||||
ini.set_paragraph("23");
|
||||
ini.set(RMV_ANNOES, anno);
|
||||
ini.set(RMV_TIPOC, tipo);
|
||||
ini.set(RMV_GRUPPO, m.get(CG_GRUPPO));
|
||||
ini.set(RMV_CONTO, m.get(CG_CONTO));
|
||||
ini.set(RMV_SOTTOCONTO, m.get(id_sotto));
|
||||
}
|
||||
if (ininame.exist())
|
||||
{
|
||||
TString cmd;
|
||||
cmd << "cg3 -5 -i" << ininame;
|
||||
TExternal_app app(cmd);
|
||||
app.run();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Handlers dei campi della testata
|
||||
///////////////////////////////////////////////////////////
|
||||
@ -1895,7 +1941,7 @@ bool TPrimanota_application::caus_query_handler(TMask_field& f, KEY key)
|
||||
|
||||
if (f.to_check(key))
|
||||
{
|
||||
const TString cau = f.get();
|
||||
const TString& cau = f.get();
|
||||
const int ann = m.get_int(F_ANNOIVA);
|
||||
|
||||
const TipoIVA i = app().cau2IVA(cau, ann); // Cerca causale e suo tipo
|
||||
@ -1917,15 +1963,27 @@ bool TPrimanota_application::caus_modify_handler(TMask_field& f, KEY key)
|
||||
bool ok = suspended_handler(f, key);
|
||||
if (!ok) return false;
|
||||
|
||||
const int ann = f.mask().get_int(F_ANNOIVA);
|
||||
const TString cau(f.get());
|
||||
|
||||
const TMask& m = f.mask();
|
||||
const int ann = m.get_int(F_ANNOIVA);
|
||||
const TString& cau = f.get();
|
||||
const TCausale c(cau, ann);
|
||||
if (!c.ok()) return false;
|
||||
|
||||
ok = app().causale().similar(c);
|
||||
if (!ok)
|
||||
return false; // L'errore viene gia' segnalato dalla similar
|
||||
|
||||
|
||||
const TString& msg = c.compatible(k);
|
||||
if (msg.not_empty()) // La causale non e' compatibile
|
||||
{
|
||||
if (m.insert_mode() && !app()._sal_dirty)
|
||||
{
|
||||
// Cambio la maschera al volo
|
||||
if (app().force_mask_swap(k, c))
|
||||
return true;
|
||||
}
|
||||
return error_box(msg);
|
||||
}
|
||||
|
||||
if (key == K_TAB)
|
||||
{
|
||||
app().read_caus(cau, ann);
|
||||
@ -3003,3 +3061,19 @@ bool TPrimanota_application::solaiva_handler(TMask_field& f, KEY key)
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// Handler del bottone di collegamento ai documenti
|
||||
bool TPrimanota_application::linkdoc_handler(TMask_field& f, KEY key)
|
||||
{
|
||||
if (key == K_SPACE)
|
||||
{
|
||||
const TRectype& mov = app().get_relation()->curr();
|
||||
TRectype doc(LF_DOC);
|
||||
doc.put(DOC_PROVV, mov.get(MOV_DPROVV));
|
||||
doc.put(DOC_ANNO, mov.get(MOV_DANNO));
|
||||
doc.put(DOC_CODNUM,mov.get(MOV_DCODNUM));
|
||||
doc.put(DOC_NDOC, mov.get(MOV_DNDOC));
|
||||
doc.edit();
|
||||
}
|
||||
return true;
|
||||
}
|
@ -54,6 +54,7 @@ class TPrimanota_application : public TRelation_application
|
||||
TMask* _msk[4]; // Maschere di query, cg, iva, occasionali
|
||||
int _mode; // Modo maschera corrente
|
||||
bool _as400; // Movimento trasferito da as400?
|
||||
bool _sal_dirty; // Il saldaconto e' stato "toccato"?
|
||||
|
||||
TipoIVA _iva; // Tipo di IVA corrente
|
||||
TCausale* _causale; // Causale corrente
|
||||
@ -108,6 +109,7 @@ class TPrimanota_application : public TRelation_application
|
||||
static bool descr_handler(TMask_field& f, KEY k);
|
||||
|
||||
static bool sheet_clifo_handler(TMask_field& f, KEY k);
|
||||
static bool sheet_mastrino_handler(TMask_field& f, KEY k);
|
||||
static bool iva_sottoconto_handler(TMask_field& f, KEY k);
|
||||
static bool imponibile_handler(TMask_field& f, KEY key);
|
||||
static bool detrazione_handler(TMask_field& f, KEY key);
|
||||
@ -130,6 +132,7 @@ class TPrimanota_application : public TRelation_application
|
||||
static bool codcab_handler(TMask_field& f, KEY key);
|
||||
static bool tipopag_handler(TMask_field& f, KEY key);
|
||||
static bool prorata_handler(TMask_field& f, KEY k);
|
||||
static bool linkdoc_handler(TMask_field& f, KEY k);
|
||||
|
||||
static bool ratalit_handler(TMask_field& f, KEY key);
|
||||
static bool rataval_handler(TMask_field& f, KEY key);
|
||||
@ -154,6 +157,9 @@ protected: // TApplication
|
||||
virtual void ini2mask(TConfig& ini, TMask& msk, bool query);
|
||||
virtual void mask2ini(const TMask& msk, TConfig& ini);
|
||||
|
||||
bool get_mask_swap_file(TFilename& name) const;
|
||||
bool force_mask_swap(const TCausale& old_caus, const TCausale& new_caus);
|
||||
|
||||
protected: // TRelation_application
|
||||
virtual bool user_create();
|
||||
virtual bool user_destroy();
|
||||
|
@ -10,7 +10,6 @@
|
||||
#include <causali.h>
|
||||
#include <rcausali.h>
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Causale
|
||||
///////////////////////////////////////////////////////////
|
||||
@ -23,6 +22,7 @@ TCausale::TCausale(const char* cod, int year)
|
||||
{
|
||||
if (*cod)
|
||||
read(cod, year);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -35,7 +35,7 @@ bool TCausale::read(const char* cod, int year)
|
||||
_sezione_clifo = _sezione_ritsoc = ' ';
|
||||
_corrisp = false;
|
||||
|
||||
if (*cod > ' ')
|
||||
if (cod && *cod > ' ')
|
||||
{
|
||||
_rec = cache().get(LF_CAUSALI, cod);
|
||||
if (_rec.empty())
|
||||
@ -187,21 +187,20 @@ char TCausale::sezione(int riga) const
|
||||
return sez;
|
||||
}
|
||||
|
||||
char TCausale::sezione_clifo()
|
||||
char TCausale::sezione_clifo() const
|
||||
{
|
||||
if (_sezione_clifo == ' ')
|
||||
_sezione_clifo = sezione(1);
|
||||
if (_sezione_clifo <= ' ')
|
||||
(char&)_sezione_clifo = sezione(1);
|
||||
return _sezione_clifo;
|
||||
}
|
||||
|
||||
char TCausale::sezione_ritsoc()
|
||||
char TCausale::sezione_ritsoc() const
|
||||
{
|
||||
if (_sezione_ritsoc == ' ')
|
||||
if (_sezione_ritsoc <= ' ')
|
||||
{
|
||||
if (_rec.get_int(CAU_TIPOMOV) <= 2)
|
||||
_sezione_ritsoc = sezione(9); // Fatture
|
||||
else
|
||||
_sezione_ritsoc = sezione(14); // Pagamenti
|
||||
// Fatture o Pagamenti?
|
||||
const int tm = _rec.get_int(CAU_TIPOMOV);
|
||||
(char&)_sezione_ritsoc = sezione(tm <= 2 ? 9 : 14);
|
||||
}
|
||||
return _sezione_ritsoc;
|
||||
}
|
||||
@ -247,21 +246,34 @@ void TCausale::calcIVA()
|
||||
_corrisp = c;
|
||||
}
|
||||
|
||||
bool TCausale::similar(const TCausale& c) const
|
||||
const TString& TCausale::compatible(const TCausale& c) const
|
||||
{
|
||||
const char* err = "";
|
||||
if (sezionale() != c.sezionale()) err = TR("il segnale di sezionale");
|
||||
if (intra() != c.intra()) err = TR("la gestione dei movimenti intra");
|
||||
if (valuta() != c.valuta()) err = TR("la gestione valuta");
|
||||
if (valintra() != c.valintra()) err = TR("la gestione valuta intracomunitaria");
|
||||
if (corrispettivi() != c.corrispettivi()) err = TR("la gestione dei corrispettivi");
|
||||
if (iva() != c.iva()) err = TR("il tipo di IVA");
|
||||
if (tipomov() != c.tipomov()) err = TR("il tipo di movimento");
|
||||
const char* err = NULL;
|
||||
if (sezionale() != c.sezionale())
|
||||
err = TR("il segnale di sezionale");
|
||||
if (intra() != c.intra())
|
||||
err = TR("la gestione dei movimenti intra");
|
||||
if (valuta() != c.valuta())
|
||||
err = TR("la gestione valuta");
|
||||
if (valintra() != c.valintra())
|
||||
err = TR("la gestione valuta intracomunitaria");
|
||||
if (corrispettivi() != c.corrispettivi())
|
||||
err = TR("la gestione dei corrispettivi");
|
||||
if (iva() != c.iva())
|
||||
err = TR("il tipo di IVA");
|
||||
if (tipomov() != c.tipomov())
|
||||
err = TR("il tipo di movimento");
|
||||
|
||||
if (*err)
|
||||
return error_box(FR("La causale e' diversa per %s"), err);
|
||||
if (err != NULL)
|
||||
{
|
||||
TString& msg = get_tmp_string();
|
||||
msg.format(FR("La causale e' incompatibile per %s"), err);
|
||||
return msg;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
return EMPTY_STRING;
|
||||
|
||||
}
|
||||
|
||||
bool TCausale::IVA2bill(const TCodiceIVA& iva, TBill& c) const
|
||||
@ -287,7 +299,4 @@ bool TCausale::IVA2bill(const TCodiceIVA& iva, TBill& c) const
|
||||
}
|
||||
|
||||
return c.ok();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
11
cg/cg2103.h
11
cg/cg2103.h
@ -54,12 +54,13 @@ public:
|
||||
char link_cespiti() const;
|
||||
bool link_analitica() const;
|
||||
|
||||
bool similar(const TCausale& c) const;
|
||||
const TString& compatible(const TCausale& c) const;
|
||||
|
||||
char sezione(int riga) const;
|
||||
char sezione_clifo();
|
||||
char sezione_ritsoc();
|
||||
char sezione_ritfis();
|
||||
char sezione_clifo() const;
|
||||
char sezione_ritsoc() const ;
|
||||
char sezione_ritfis();
|
||||
|
||||
|
||||
virtual bool read(const char* cod, int year);
|
||||
|
||||
@ -82,4 +83,4 @@ public:
|
||||
#define RIGA_DIFFCAM 13
|
||||
#define RIGA_PAG_RITSOC 14
|
||||
|
||||
#endif
|
||||
#endif
|
@ -1997,6 +1997,7 @@ bool TPrimanota_application::edit_partite(const TMask& m, int riga)
|
||||
{
|
||||
cgs().force_update(); // Aggiornamento righe contabili
|
||||
calcola_saldo();
|
||||
_sal_dirty = true;
|
||||
}
|
||||
return changed;
|
||||
}
|
||||
|
@ -41,7 +41,12 @@ END
|
||||
|
||||
CURRENCY CG_AVERE 18
|
||||
BEGIN
|
||||
PROMPT 38 4 "Avere "
|
||||
PROMPT 27 4 "Avere "
|
||||
END
|
||||
|
||||
BUTTON CG_MASTRINO 8 1
|
||||
BEGIN
|
||||
PROMPT 56 4 "Mastrino"
|
||||
END
|
||||
|
||||
LIST CG_TIPO 1 10
|
||||
|
@ -2725,20 +2725,20 @@ void TMastrini_application::ricerca_dati_ditta()
|
||||
if (len <= 31)
|
||||
{
|
||||
if (len <= 26)
|
||||
_indulc << " " << _civulc;
|
||||
_indulc << ' ' << _civulc;
|
||||
else
|
||||
_indulc << " " << _civulc.mid(0,5);
|
||||
_indulc << ' ' << _civulc.mid(0,5);
|
||||
}
|
||||
else
|
||||
{
|
||||
_indulc = _indulc.mid(0,31);
|
||||
_indulc << " " << _civulc.mid(0,5);
|
||||
_indulc << ' ' << _civulc.mid(0,5);
|
||||
}
|
||||
_capulc= unloc.get(ULC_CAPULC);
|
||||
_comulc= unloc.get(ULC_COMULC);
|
||||
|
||||
key.format("|%s", (const char *) _comulc);
|
||||
const TRectype & comuni = cache().get(LF_COMUNI, key);
|
||||
const TRectype& comuni = cache().get(LF_COMUNI, key);
|
||||
|
||||
_com = comuni.get(COM_DENCOM);
|
||||
_prov = comuni.get(COM_PROVCOM);
|
||||
|
173
cg/cg3600.cpp
173
cg/cg3600.cpp
@ -48,7 +48,7 @@ public:
|
||||
void destroy() { _data.destroy(); }
|
||||
long insert(TObject* obj, long pos) { return _data.insert(obj, pos); }
|
||||
long append(TObject* obj, long pos = -1);
|
||||
bool remove(long pos) { _data.remove(pos, TRUE); return TRUE; }
|
||||
bool remove(long pos) { _data.remove(pos, true); return true; }
|
||||
|
||||
const TObject& obj(long index) const
|
||||
{ const TObject* o = _data.objptr(index); CHECK(o, "Null list item"); return *o; }
|
||||
@ -300,13 +300,13 @@ void TMastrino::read(const TBill& conto,
|
||||
// vanno dall'inizio dell'esercizio al giorno precedente
|
||||
// la data di inizio stampa
|
||||
|
||||
TBalance saldo(_conto, ae, TRUE, provvis);
|
||||
TBalance saldo(_conto, ae, true, provvis);
|
||||
_pdare_ini = saldo.progressivo_dare_iniziale();
|
||||
_pavere_ini = saldo.progressivo_avere_iniziale();
|
||||
|
||||
// Valori dei saldi finali:
|
||||
// Comprendono i movimenti di apertura, chiusura ed i progressivi attuali
|
||||
saldo.read(_conto, ae, FALSE, provvis);
|
||||
saldo.read(_conto, ae, false, provvis);
|
||||
_pdare_fin = saldo.progressivo_dare_finale();
|
||||
_pavere_fin = saldo.progressivo_avere_finale();
|
||||
|
||||
@ -342,10 +342,11 @@ void TMastrino::read(const TBill& conto,
|
||||
const TRecnotype totrows = cur.items();
|
||||
cur.freeze();
|
||||
|
||||
TString caption;
|
||||
caption = FR("Caricamento mastrino");
|
||||
caption << ' ' << _conto.gruppo() << '.' << _conto.conto() << '.' << _conto.sottoconto();
|
||||
TProgind pi(totrows, caption, FALSE, TRUE);
|
||||
TString caption(80);
|
||||
caption.format(FR("Caricamento mastrino %03d.%03d.%06ld"),
|
||||
_conto.gruppo(), _conto.conto(), _conto.sottoconto());
|
||||
TProgind pi(totrows, caption, false, true);
|
||||
|
||||
|
||||
for (cur = 0L; cur.pos() < totrows; ++cur)
|
||||
{
|
||||
@ -462,7 +463,7 @@ TImporto TMastrino::saldo_periodo() const
|
||||
|
||||
bool TMastrino::expandable(long rec) const
|
||||
{
|
||||
bool e = FALSE;
|
||||
bool e = false;
|
||||
if (rec >= 0 && rec < items())
|
||||
{
|
||||
if (row(rec).tipo() == riga_mastrino)
|
||||
@ -470,7 +471,7 @@ bool TMastrino::expandable(long rec) const
|
||||
if (rec < items()-1)
|
||||
e = row(rec+1).tipo() != riga_contropartita;
|
||||
else
|
||||
e = TRUE;
|
||||
e = true;
|
||||
}
|
||||
}
|
||||
return e;
|
||||
@ -528,7 +529,7 @@ bool TMastrino::expand(long rec)
|
||||
// Elimina le righe di contropartita di una riga del mastrino
|
||||
bool TMastrino::collapse(long rec)
|
||||
{
|
||||
bool ok = TRUE; // Posso eliminare?
|
||||
bool ok = true; // Posso eliminare?
|
||||
if (row(rec).tipo() != riga_mastrino) // Se non sono su una riga mastrino ...
|
||||
rec = pred(rec, riga_mastrino); // ... mi sposto sulla precedente riga mastrino
|
||||
else
|
||||
@ -558,8 +559,8 @@ public:
|
||||
TString& set(const char* txt);
|
||||
TString& set(long num);
|
||||
void set_icon(int id);
|
||||
void show_button(bool on = TRUE);
|
||||
void hide_button() { show_button(FALSE); }
|
||||
void show_button(bool on = true);
|
||||
void hide_button() { show_button(false); }
|
||||
void set_back_color(COLOR col);
|
||||
void set_fore_color(COLOR col);
|
||||
void set_colors(COLOR back, COLOR fore);
|
||||
@ -588,9 +589,9 @@ public:
|
||||
virtual long items() const;
|
||||
virtual void cell_request(long rec, short id, TGrid_cell& cell);
|
||||
|
||||
virtual bool on_record(long rec) { return TRUE; }
|
||||
virtual bool off_record(long rec) { return TRUE; }
|
||||
virtual bool on_resize_column(short cid, int new_size) { return TRUE; }
|
||||
virtual bool on_record(long rec) { return true; }
|
||||
virtual bool off_record(long rec) { return true; }
|
||||
virtual bool on_resize_column(short cid, int new_size) { return true; }
|
||||
virtual void on_dbl_cell(long rec, short id) { }
|
||||
virtual void on_grid_button() { }
|
||||
virtual void on_record_button(long rec) { }
|
||||
@ -685,9 +686,9 @@ TGrid_control::TGrid_control(
|
||||
TGrid_field* owner)
|
||||
: _grid(owner), _cur_rec(-1), _columns_order(0)
|
||||
{
|
||||
_read_only = FALSE;
|
||||
bool auto_num = FALSE;
|
||||
bool multi_line = FALSE;
|
||||
_read_only = false;
|
||||
bool auto_num = false;
|
||||
bool multi_line = false;
|
||||
int lines_in_cell = 1;
|
||||
|
||||
for (const char* f = flags; *f; f++)
|
||||
@ -695,13 +696,13 @@ TGrid_control::TGrid_control(
|
||||
switch(*f)
|
||||
{
|
||||
case 'A':
|
||||
auto_num = TRUE;
|
||||
auto_num = true;
|
||||
break;
|
||||
case 'D':
|
||||
_read_only = TRUE;
|
||||
_read_only = true;
|
||||
break;
|
||||
case 'M':
|
||||
multi_line = TRUE;
|
||||
multi_line = true;
|
||||
lines_in_cell = (int)xi_get_pref(XI_PREF_DEFAULT_MAX_LINES_IN_CELL);
|
||||
break;
|
||||
case '2':
|
||||
@ -796,18 +797,18 @@ TGrid_control::TGrid_control(
|
||||
#else
|
||||
l->min_heading_height = xi_button_calc_height_font_id(xvt_default_font()) * lines_in_header;
|
||||
#endif
|
||||
l->sizable_columns = TRUE;
|
||||
l->movable_columns = TRUE;
|
||||
l->sizable_columns = true;
|
||||
l->movable_columns = true;
|
||||
l->fixed_columns = fixed_columns;
|
||||
l->max_lines_in_cell = lines_in_cell;
|
||||
l->scroll_bar = TRUE;
|
||||
l->scroll_bar_button = TRUE;
|
||||
l->scroll_bar = true;
|
||||
l->scroll_bar_button = true;
|
||||
l->white_space_color = MASK_DARK_COLOR;
|
||||
l->rule_color = MASK_DARK_COLOR;
|
||||
|
||||
if (_read_only)
|
||||
{
|
||||
l->single_select = TRUE;
|
||||
l->single_select = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -821,8 +822,8 @@ TGrid_control::TGrid_control(
|
||||
|
||||
coldef->app_data = (long)this;
|
||||
XI_COLUMN_DEF* cd = coldef->v.column;
|
||||
cd->heading_platform = TRUE;
|
||||
cd->column_platform = TRUE;
|
||||
cd->heading_platform = true;
|
||||
cd->column_platform = true;
|
||||
|
||||
for (h = new_header.get(0), i = 0; h; h = new_header.get(), i++)
|
||||
{
|
||||
@ -836,8 +837,8 @@ TGrid_control::TGrid_control(
|
||||
|
||||
coldef->app_data = (long)this;
|
||||
cd = coldef->v.column;
|
||||
cd->heading_platform = TRUE;
|
||||
cd->center_heading = TRUE;
|
||||
cd->heading_platform = true;
|
||||
cd->center_heading = true;
|
||||
if (multi_line)
|
||||
cd->wrap_text = _type[i] != 'R';
|
||||
}
|
||||
@ -960,7 +961,7 @@ bool TGrid_control::select(long rec)
|
||||
else
|
||||
{
|
||||
ok = _cur_rec >= 0 && _cur_rec < items() && _grid->off_record(_cur_rec);
|
||||
sel = FALSE;
|
||||
sel = false;
|
||||
}
|
||||
|
||||
if (ok)
|
||||
@ -1077,7 +1078,7 @@ bool TGrid_control::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
||||
update_selection(xiev);
|
||||
}
|
||||
else
|
||||
refused = TRUE;
|
||||
refused = true;
|
||||
break;
|
||||
case XIE_GET_LAST:
|
||||
xiev->v.rec_request.data_rec = items()-1;
|
||||
@ -1093,7 +1094,7 @@ bool TGrid_control::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
||||
update_selection(xiev);
|
||||
}
|
||||
else
|
||||
refused = TRUE;
|
||||
refused = true;
|
||||
}
|
||||
break;
|
||||
case XIE_GET_PERCENT:
|
||||
@ -1107,7 +1108,7 @@ bool TGrid_control::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
||||
// Rifiuta di spostare una colonna nelle o dalle colonne fisse
|
||||
if (xiev->v.column.in_fixed ||
|
||||
xiev->v.column.col_nbr < xi_get_fixed_columns(xiev->v.column.list))
|
||||
refused = TRUE;
|
||||
refused = true;
|
||||
else
|
||||
_columns_order = 1;
|
||||
break;
|
||||
@ -1117,7 +1118,7 @@ bool TGrid_control::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
||||
if (_grid->on_resize_column(cid, xiev->v.column.new_col_width))
|
||||
_columns_order = 1;
|
||||
else
|
||||
refused = TRUE;
|
||||
refused = true;
|
||||
}
|
||||
break;
|
||||
case XIE_SELECT:
|
||||
@ -1134,7 +1135,7 @@ bool TGrid_control::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
||||
if (rec == _cur_rec) // Aggiunto a 32 bit
|
||||
_grid->on_record_button(rec);
|
||||
if (_read_only)
|
||||
refused = TRUE;
|
||||
refused = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1142,13 +1143,13 @@ bool TGrid_control::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
||||
{
|
||||
const short cid = col2cid(xiev->v.select.column);
|
||||
_grid->on_dbl_cell(rec, cid);
|
||||
refused = TRUE;
|
||||
refused = true;
|
||||
}
|
||||
_cur_rec = rec; // Assegno solo ora il record corrente
|
||||
}
|
||||
}
|
||||
else
|
||||
refused = TRUE;
|
||||
refused = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -1175,7 +1176,7 @@ bool TGrid_control::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
||||
}
|
||||
}
|
||||
else
|
||||
refused = TRUE; // Ogni tanto succede
|
||||
refused = true; // Ogni tanto succede
|
||||
}
|
||||
break;
|
||||
case XIE_ON_ROW:
|
||||
@ -1186,12 +1187,12 @@ bool TGrid_control::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
||||
if (_grid->on_record(rec))
|
||||
_cur_rec = rec;
|
||||
else
|
||||
refused = TRUE;
|
||||
refused = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
NFCHECK("You are entering an invalid row: %d", xiev->v.xi_obj->v.row);
|
||||
refused = TRUE;
|
||||
refused = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -1371,7 +1372,7 @@ void TGrid_control::save_columns_order() const
|
||||
RCT rct; xi_get_rect(column[i], (XinRect*)&rct);
|
||||
order << ',' << rct.right - rct.left;
|
||||
}
|
||||
config.set("Browse", order, NULL, TRUE, id());
|
||||
config.set("Browse", order, NULL, true, id());
|
||||
}
|
||||
else
|
||||
config.remove("Browse", id());
|
||||
@ -1483,7 +1484,7 @@ bool TGrid_field::parse_item(TScanner& scanner)
|
||||
if (scanner.key() == "IT")
|
||||
{
|
||||
_ctl_data._park.add(scanner.string());
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
return TMask_field::parse_item(scanner);
|
||||
}
|
||||
@ -1491,7 +1492,7 @@ bool TGrid_field::parse_item(TScanner& scanner)
|
||||
|
||||
bool TGrid_field::handler(XI_EVENT* xiev)
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
long TGrid_field::items() const
|
||||
@ -1584,7 +1585,7 @@ void TRow_mask::update()
|
||||
COLOR back, fore;
|
||||
m.get_cur_colors(back, fore);
|
||||
|
||||
_pixmap = TRUE;
|
||||
_pixmap = true;
|
||||
set_pen(COLOR_BLACK);
|
||||
|
||||
RCT rct; field(100).get_rect(rct);
|
||||
@ -1595,7 +1596,7 @@ void TRow_mask::update()
|
||||
set_brush(fore);
|
||||
frame(rct.left, 2*rct.top - rct.bottom - CHARY/2, rct.right, rct.top - CHARY/2, 0);
|
||||
|
||||
_pixmap = FALSE;
|
||||
_pixmap = false;
|
||||
|
||||
}
|
||||
|
||||
@ -1668,7 +1669,7 @@ bool TColor_mask::color_handler(TMask_field& f, KEY k)
|
||||
m.set_focus();
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TColor_mask::reset_handler(TMask_field& f, KEY k)
|
||||
@ -1685,7 +1686,7 @@ bool TColor_mask::reset_handler(TMask_field& f, KEY k)
|
||||
s.set_back_and_fore_color(NORMAL_BACK_COLOR, NORMAL_COLOR, -1);
|
||||
s.force_update();
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void TColor_mask::get_colors(COLOR& mb, COLOR& mf, COLOR& cb, COLOR& cf) const
|
||||
@ -1786,7 +1787,7 @@ void TMastrini_grid::destroy()
|
||||
HIDDEN const char* real2string(const real& r)
|
||||
{
|
||||
TCurrency cur(r);
|
||||
return cur.string(TRUE);
|
||||
return cur.string(true);
|
||||
}
|
||||
|
||||
HIDDEN void set_imp(TMask_field& f, const TImporto& imp)
|
||||
@ -1859,7 +1860,7 @@ void TMastrini_grid::cell_request(long rec, short id, TGrid_cell& cell)
|
||||
cell.set(mov.get(MOV_DESCR));
|
||||
if (cell.empty())
|
||||
{
|
||||
TBill uncle(rmov,TRUE);
|
||||
TBill uncle(rmov,true);
|
||||
cell.set(uncle.descrizione());
|
||||
}
|
||||
}
|
||||
@ -1947,7 +1948,7 @@ bool TMastrini_grid::on_record(long rec)
|
||||
gm.set(F_TOTRIG_DAR, riga.dare());
|
||||
gm.set(F_TOTRIG_AVE, riga.avere());
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void TMastrini_grid::on_dbl_cell(long rec, short id)
|
||||
@ -1970,7 +1971,7 @@ void TMastrini_grid::on_grid_button()
|
||||
TProgind* pi = NULL;
|
||||
|
||||
if (total > 50)
|
||||
pi = new TProgind(total, TR("Aggiornamento contropartite ..."), FALSE, TRUE, 48);
|
||||
pi = new TProgind(total, TR("Aggiornamento contropartite ..."), false, true, 48);
|
||||
else
|
||||
begin_wait();
|
||||
|
||||
@ -2086,7 +2087,9 @@ void TMastrini_grid::update_mask() const
|
||||
gm.set(F_TOTATT_DAR, _mastrino.progressivo_dare_finale());
|
||||
gm.set(F_TOTATT_AVE, _mastrino.progressivo_avere_finale());
|
||||
|
||||
gm.enable(DLG_LINK, _mastrino.items() > 0);
|
||||
const bool can_link = main_app().argc() <= 2; // NON sono stato chiamato dalla prima nota
|
||||
gm.enable(DLG_LINK, can_link && _mastrino.items() > 0);
|
||||
gm.enable(DLG_NEWREC, can_link);
|
||||
}
|
||||
|
||||
void TMastrini_grid::load_colors()
|
||||
@ -2168,7 +2171,7 @@ bool TGrid_mask::link_handler(TMask_field& f, KEY k)
|
||||
if (rec >= 0 && rec < grid.items())
|
||||
grid.on_record_button(rec);
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TGrid_mask::new_handler(TMask_field& f, KEY k)
|
||||
@ -2184,7 +2187,7 @@ bool TGrid_mask::new_handler(TMask_field& f, KEY k)
|
||||
grid.reread();
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TGrid_mask::on_key(KEY k)
|
||||
@ -2227,7 +2230,7 @@ bool TGrid_mask::on_key(KEY k)
|
||||
if (rec != grid().selected())
|
||||
{
|
||||
grid().select(rec);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
return TMask::on_key(k);
|
||||
@ -2348,12 +2351,12 @@ bool TQuery_mask::esercizio_handler(TMask_field& f, KEY k)
|
||||
return error_box(FR("Esercizio inesistente: %d"), anno);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TQuery_mask::data_handler(TMask_field& f, KEY k)
|
||||
{
|
||||
bool ok = TRUE;
|
||||
bool ok = true;
|
||||
if (k == K_ENTER)
|
||||
{
|
||||
const TQuery_mask& qm = (const TQuery_mask&)f.mask();
|
||||
@ -2372,7 +2375,7 @@ bool TQuery_mask::data_handler(TMask_field& f, KEY k)
|
||||
{
|
||||
if (codice_esercizio == 0)
|
||||
return error_box(TR("E' necessario specificare almeno una data."));
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
const TDate d = f.get();
|
||||
@ -2405,7 +2408,7 @@ bool TQuery_mask::find_handler(TMask_field& f, KEY k)
|
||||
}
|
||||
qm.field(id).on_key(K_F9);
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void TQuery_mask::do_query(TGrid_mask& gm)
|
||||
@ -2441,8 +2444,6 @@ class TMastrini_video : public TApplication
|
||||
TQuery_mask* _qm;
|
||||
TGrid_mask* _gm;
|
||||
|
||||
TArray _file;
|
||||
|
||||
protected:
|
||||
virtual bool create();
|
||||
virtual bool destroy();
|
||||
@ -2456,6 +2457,7 @@ bool TMastrini_video::create()
|
||||
{
|
||||
xvtil_statbar_set("", TRUE);
|
||||
|
||||
|
||||
open_files(LF_RMOV, LF_MOV, LF_CAUSALI, 0);
|
||||
open_files(LF_SALDI, LF_PCON, 0);
|
||||
|
||||
@ -2463,7 +2465,7 @@ bool TMastrini_video::create()
|
||||
_gm = new TGrid_mask;
|
||||
|
||||
dispatch_e_menu(BAR_ITEM(1));
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TMastrini_video::destroy()
|
||||
@ -2471,9 +2473,7 @@ bool TMastrini_video::destroy()
|
||||
delete _gm;
|
||||
delete _qm;
|
||||
|
||||
_file.destroy();
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TMastrini_video::menu(MENU_TAG mt)
|
||||
@ -2481,21 +2481,43 @@ bool TMastrini_video::menu(MENU_TAG mt)
|
||||
if (mt == BAR_ITEM(1))
|
||||
{
|
||||
TQuery_mask& qm = *_qm;
|
||||
|
||||
const TEsercizi_contabili esercizi;
|
||||
const int codice_esercizio = esercizi.date2esc(TDate(TODAY));
|
||||
if (codice_esercizio > 0)
|
||||
|
||||
if (argc() > 2)
|
||||
{
|
||||
const TEsercizio& esercizio = esercizi.esercizio(codice_esercizio);
|
||||
qm.set(F_ESERCIZIO, codice_esercizio);
|
||||
TFilename ininame = argv(2)+2;
|
||||
if (ininame.exist())
|
||||
{
|
||||
TConfig ini(ininame, "23");
|
||||
qm.set(F_ESERCIZIO, ini.get(RMV_ANNOES));
|
||||
qm.set(F_TIPO, ini.get(RMV_TIPOC));
|
||||
qm.set(F_GRUPPO, ini.get(RMV_GRUPPO));
|
||||
qm.set(F_CONTO, ini.get(RMV_CONTO));
|
||||
qm.set(F_SOTTOCONTO, ini.get(RMV_SOTTOCONTO));
|
||||
qm.set(F_CLIENTE, ini.get(RMV_SOTTOCONTO));
|
||||
qm.set(F_FORNITORE, ini.get(RMV_SOTTOCONTO));
|
||||
qm.send_key(K_SPACE, DLG_OK);
|
||||
}
|
||||
}
|
||||
|
||||
const TEsercizi_contabili esercizi;
|
||||
int codesc = qm.get_int(F_ESERCIZIO);
|
||||
if (codesc <= 0)
|
||||
codesc = esercizi.last();
|
||||
if (esercizi.exist(codesc))
|
||||
|
||||
{
|
||||
const TEsercizio& esercizio = esercizi.esercizio(codesc);
|
||||
qm.set(F_ESERCIZIO, codesc);
|
||||
|
||||
qm.set(F_DADATA, esercizio.inizio());
|
||||
qm.set(F_ADATA, esercizio.fine());
|
||||
}
|
||||
|
||||
|
||||
KEY key = 0;
|
||||
while (key != K_QUIT)
|
||||
{
|
||||
/* Ca$$ata tipica della Prassi
|
||||
|
||||
qm.reset(F_SOTTOCONTO); // Azzera sottoconto
|
||||
qm.reset(F_CLIENTE); // Azzera cliente
|
||||
qm.reset(F_FORNITORE); // Azzera fornitore
|
||||
@ -2514,14 +2536,14 @@ bool TMastrini_video::menu(MENU_TAG mt)
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
_gm->grid().set_colors();
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
@ -2535,4 +2557,3 @@ int cg3600(int argc, char* argv[])
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -902,7 +902,7 @@ int cg4300(int argc, char* argv[])
|
||||
const char* title = TR("Liquidazione IVA");
|
||||
int menu = 1;
|
||||
|
||||
if (argc > 2)
|
||||
if (argc > 2)
|
||||
{
|
||||
const char mode = argv[2][1];
|
||||
switch (mode)
|
||||
|
@ -201,7 +201,7 @@ bool TLiquidazione_app::update_firm(int month, bool recalc)
|
||||
TString buf(256);
|
||||
do
|
||||
{
|
||||
TString16 codatt = _nditte->curr(LF_ATTIV).get("CODATT");
|
||||
const TString8 codatt = _nditte->curr(LF_ATTIV).get("CODATT");
|
||||
TString80 desatt = _nditte->curr(LF_ATTIV).get("DESCR");
|
||||
quater = _nditte->curr().get_bool("FLIVA11Q");
|
||||
|
||||
@ -245,7 +245,7 @@ bool TLiquidazione_app::update_firm(int month, bool recalc)
|
||||
_isservizio = _pla->get("S7") == "S";
|
||||
_mixed = _pla->get("S7") == "M" || _pla->get("S7") == "E";
|
||||
|
||||
TString yr(_year);
|
||||
const TString4 yr(_year);
|
||||
TAssoc_array& pa = _prorata.perc_array();
|
||||
|
||||
pa.destroy();
|
||||
|
@ -40,23 +40,23 @@ inline TStampa_registri_app& app() { return (TStampa_registri_app&)main_app(); }
|
||||
bool TStampa_registri_app::filter_func (const TRelation * r)
|
||||
{
|
||||
const TRectype& mov = r->curr(LF_MOV);
|
||||
TString16 codreg = mov.get(MOV_REG);
|
||||
TDate datareg = mov.get_date(MOV_DATAREG);
|
||||
int annoiva = mov.get_int(MOV_ANNOIVA);
|
||||
bool regst = mov.get_bool(MOV_REGST);
|
||||
const TString4 codreg = mov.get(MOV_REG);
|
||||
const int annoiva = mov.get_int(MOV_ANNOIVA);
|
||||
|
||||
if (codreg != (app()._codreg) || annoiva != (app()._annoes))
|
||||
return FALSE;
|
||||
|
||||
if (app()._tipo_stampa != prova) //stampa di bollato
|
||||
{
|
||||
const bool regst = mov.get_bool(MOV_REGST);
|
||||
if (regst) //il movimento e' gia'
|
||||
return FALSE; //stato stampato in forma definitiva
|
||||
const tipo_sospensione ts = (tipo_sospensione) r->lfile("REG").get_int("I9");
|
||||
if (ts == liquidazione) // Movimento valido solo ai fini della liquidazione
|
||||
return FALSE;
|
||||
if (regst) //il movimento e' gia'
|
||||
return FALSE; //stato stampato in forma definitiva
|
||||
}
|
||||
|
||||
const TDate datareg = mov.get_date(MOV_DATAREG);
|
||||
if (datareg.month() < app()._stampa_mese)
|
||||
app()._stampa_mese = datareg.month();
|
||||
return TRUE;
|
||||
|
@ -210,7 +210,7 @@ void TParaliq_app::check_registers(int year)
|
||||
{
|
||||
// controlla che per ogni data attivita' esistano almeno un registro
|
||||
// acquisti, vendite e giornale; warning appropriato in caso negativo
|
||||
TSheet_field& sf = (TSheet_field&)_msk->field(F_SHEET_PLA);
|
||||
TSheet_field& sf = _msk->sfield(F_SHEET_PLA);
|
||||
const byte R_ACQ = 0x01;
|
||||
const byte R_VEN = 0x02;
|
||||
const byte R_ALL = R_ACQ | R_VEN;
|
||||
@ -256,7 +256,7 @@ void TParaliq_app::check_registers(int year)
|
||||
|
||||
void TParaliq_app::init_array(TMask& m, bool update)
|
||||
{
|
||||
TSheet_field& sf = (TSheet_field&)m.field(F_SHEET_PLA);
|
||||
TSheet_field& sf = m.sfield(F_SHEET_PLA);
|
||||
const long newditta = m.get_long(F_CODDITTA);
|
||||
TRelation att(LF_ATTIV);
|
||||
TRectype & r = att.curr();
|
||||
@ -310,7 +310,7 @@ bool TParaliq_app::user_create()
|
||||
_msk->set_handler(F_CRED_COST,credpreccost_handler);
|
||||
_msk->set_handler(F_CODDITTA,ditta_handler);
|
||||
_msk->set_handler(F_UTCR_IVA,utcred_handler);
|
||||
((TSheet_field&)_msk->field(F_SHEET_PLA)).set_notify(sheet_action);
|
||||
_msk->sfield(F_SHEET_PLA).set_notify(sheet_action);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -330,7 +330,6 @@ bool TParaliq_app::sheet_action(TSheet_field& s, int r, KEY k)
|
||||
void TParaliq_app::init_query_mode(TMask& m)
|
||||
{
|
||||
// svuota tutto
|
||||
TSheet_field& sh = (TSheet_field&)m.field(F_SHEET_PLA);
|
||||
m.disable(DLG_DELREC);
|
||||
}
|
||||
|
||||
@ -369,7 +368,7 @@ int TParaliq_app::rewrite(const TMask& m)
|
||||
// scrive tutte le righe di %PLA a partire dalle righe sheet
|
||||
static int oldyear;
|
||||
|
||||
TSheet_field& sf = (TSheet_field&)m.field(F_SHEET_PLA);
|
||||
TSheet_field& sf = m.sfield(F_SHEET_PLA);
|
||||
const long firm = m.get_long(F_CODDITTA);
|
||||
const int year = m.get_int(F_YEAR);
|
||||
const char freq = m.get(F_FREQ_VERS)[0];
|
||||
@ -477,7 +476,7 @@ int TParaliq_app::read(TMask& m)
|
||||
|
||||
const long firm = m.get_long(F_CODDITTA);
|
||||
const int year = m.get_int(F_YEAR);
|
||||
TSheet_field& sf = (TSheet_field&)m.field(F_SHEET_PLA);
|
||||
TSheet_field& sf = m.sfield(F_SHEET_PLA);
|
||||
TString16 ctab;
|
||||
TToken_string tt(80);
|
||||
TRelation relpla(TAB_PLA);
|
||||
|
@ -318,11 +318,12 @@ void TInv_cont::main_loop()
|
||||
break;
|
||||
}
|
||||
floppy = mask->get(F_FLOPPY);
|
||||
floppy << ':';
|
||||
num_disk = calcola_numero_dischi(*mask,floppy);
|
||||
percorso = mask->get(F_PATH);
|
||||
if (percorso.not_empty())
|
||||
{
|
||||
floppy << ":/" << percorso;
|
||||
floppy << SLASH << percorso;
|
||||
if (floppy.exist())
|
||||
ok = TRUE;
|
||||
else
|
||||
@ -340,11 +341,8 @@ void TInv_cont::main_loop()
|
||||
|
||||
const TFilename from(_trasf); // File da splittare
|
||||
|
||||
TFilename work;
|
||||
if (percorso.not_empty())
|
||||
work << floppy << "/" << from.name(); // File su dischetto
|
||||
else
|
||||
work << floppy << ":/" << from.name(); // File su dischetto
|
||||
TFilename work = floppy;
|
||||
work.add(from.name()); // File su dischetto
|
||||
|
||||
FILE* i = fopen(from, "rb");
|
||||
|
||||
|
173
cg/cg7100.cpp
173
cg/cg7100.cpp
@ -13,6 +13,7 @@
|
||||
#include "cg7.h"
|
||||
#include "cg7100a.h"
|
||||
|
||||
#include <clifo.h>
|
||||
#include <mov.h>
|
||||
#include <rmov.h>
|
||||
#include <rmoviva.h>
|
||||
@ -25,12 +26,12 @@ protected:
|
||||
virtual void validate(TCursor& cur,TRecord_text &rec, TToken_string &val, TString& str);
|
||||
|
||||
public:
|
||||
TInvio_file(const TString& file_name, const TString& config_name);
|
||||
TInvio_file(const TString& file_name);
|
||||
virtual ~TInvio_file() { }
|
||||
};
|
||||
|
||||
TInvio_file::TInvio_file(const TString& file_name, const TString& config_name)
|
||||
: TFile_text(file_name, config_name)
|
||||
TInvio_file::TInvio_file(const TString& file_name)
|
||||
: TFile_text(file_name, "zucchett.ini")
|
||||
{
|
||||
}
|
||||
|
||||
@ -145,7 +146,7 @@ void TInvio_file::validate(TCursor& cur,TRecord_text &rec, TToken_string &s, TSt
|
||||
}
|
||||
else if (code == "_CAUSALE")
|
||||
{
|
||||
TFilename configname = "zucchett.ini";
|
||||
TFilename configname = "cg7100a.ini";
|
||||
TConfig configfile(configname);
|
||||
TToken_string causali = configfile.get("STANDARD", "CAUSALI");
|
||||
const char sezione = cur.curr(LF_RMOV).get_char(RMV_SEZIONE);
|
||||
@ -176,7 +177,7 @@ void TInvio_file::validate(TCursor& cur,TRecord_text &rec, TToken_string &s, TSt
|
||||
else if (code == "_OPZIONI")
|
||||
{
|
||||
TString in(s.get());
|
||||
TFilename configname = "zucchett.ini";
|
||||
TFilename configname = "cg7100a.ini";
|
||||
TConfig configfile(configname);
|
||||
valore = configfile.get(in, "OPZIONI");
|
||||
}
|
||||
@ -254,81 +255,20 @@ void TInvio_file::validate(TCursor& cur,TRecord_text &rec, TToken_string &s, TSt
|
||||
if (valore[0] != '-' && valore[0] != '+')
|
||||
valore = "+";
|
||||
}
|
||||
else if (code == "_GIUFIS")
|
||||
{
|
||||
const char tipopers = cur.curr(LF_CLIFO).get_char(CLI_TIPOPERS);
|
||||
valore = (tipopers == 'F') ? " " : "S";
|
||||
}
|
||||
else if (code == "_BLACKLIST")
|
||||
{
|
||||
const bool sospeso = cur.curr(LF_CLIFO).get_bool(CLI_SOSPESO);
|
||||
valore = (sospeso == true) ? "S" : " ";
|
||||
}
|
||||
else NFCHECK("Macro non definita: %s", (const char *)code);
|
||||
str = valore;
|
||||
}
|
||||
|
||||
bool TInvio::create()
|
||||
{
|
||||
open_files(LF_CAUSALI, LF_CLIFO, LF_PCON, LF_MOV, LF_RMOV, LF_RMOVIVA, 0);
|
||||
_msk = new TInvio_mask();
|
||||
_trasfile = NULL;
|
||||
return TSkeleton_application::create();
|
||||
}
|
||||
|
||||
bool TInvio::destroy()
|
||||
{
|
||||
if (_trasfile)
|
||||
delete _trasfile;
|
||||
delete _msk;
|
||||
|
||||
return TSkeleton_application::destroy();
|
||||
}
|
||||
|
||||
void TInvio::main_loop()
|
||||
{
|
||||
TFilename configname = "zucchett.ini";
|
||||
TConfig configfile(configname);
|
||||
_msk->set(F_NUMEROINVIO, configfile.get_int("NUMEROINVIO","OPZIONI")+1);
|
||||
_msk->set(F_DATAINI, configfile.get("DATA","OPZIONI"));
|
||||
_msk->set(F_DESTINAZIONE, configfile.get("PERCORSO","OPZIONI"));
|
||||
|
||||
while (_msk->run()!=K_QUIT)
|
||||
{
|
||||
_totale = FALSE;
|
||||
_finemov = FALSE;
|
||||
configfile.set("NUMEROINVIO", _msk->get(F_NUMEROINVIO),"OPZIONI");
|
||||
configfile.set("DATA", _msk->get_date(F_DATAFIN),"OPZIONI");
|
||||
configfile.set("PERCORSO", _msk->get(F_DESTINAZIONE),"OPZIONI");
|
||||
configfile.set_paragraph("CAUSALI");
|
||||
_dataini = _msk->get_date(F_DATAINI);
|
||||
_datafin = _msk->get_date(F_DATAFIN);
|
||||
const char tipoinvio = _msk->get(F_TIPOINVIO)[0];
|
||||
if (tipoinvio == 'Z')
|
||||
invio_zucchetti();
|
||||
}
|
||||
}
|
||||
|
||||
void TInvio::invio_zucchetti()
|
||||
{
|
||||
TFilename configname = "zucchett.ini";
|
||||
TConfig configfile(configname);
|
||||
TFilename filename = _msk->get(F_DESTINAZIONE);
|
||||
filename.add(configfile.get("NOMEFILE", "OPZIONI"));
|
||||
if (fexist(filename))
|
||||
remove(filename);
|
||||
_trasfile = new TInvio_file(filename, configname);
|
||||
_trasfile->open(filename,'w');
|
||||
i_zucchetti_testa();
|
||||
if (_msk->get_bool(F_CAUSALI))
|
||||
i_zucchetti_causali();
|
||||
if (_msk->get_bool(F_CLIFOR))
|
||||
i_zucchetti_clifor();
|
||||
if (_msk->get_bool(F_CONTI))
|
||||
i_zucchetti_conti();
|
||||
if (_msk->get_bool(F_MOVCONT))
|
||||
i_zucchetti_movcont();
|
||||
if (_msk->get_bool(F_MOVIVA))
|
||||
{
|
||||
i_zucchetti_moviva('V');
|
||||
i_zucchetti_moviva('A');
|
||||
}
|
||||
i_zucchetti_coda();
|
||||
_trasfile->close();
|
||||
delete _trasfile;
|
||||
_trasfile = NULL;
|
||||
}
|
||||
|
||||
void TInvio::i_zucchetti_testa()
|
||||
{
|
||||
// cursore fittizio
|
||||
@ -376,7 +316,7 @@ void TInvio::i_zucchetti_testa()
|
||||
}
|
||||
}
|
||||
TRecord_text rec;
|
||||
rec.set_type("T");
|
||||
rec.set_type("I");
|
||||
_trasfile->autoload(rec, cur);
|
||||
_trasfile->write(rec);
|
||||
}
|
||||
@ -600,10 +540,87 @@ long TInvio::i_zucchetti_clifor(const bool invio)
|
||||
return cur_items+cur_items;
|
||||
}
|
||||
|
||||
//metodone globale che chiama, come un menu, i vari sottometodi in base alle scelte sulla maschera
|
||||
void TInvio::invio_zucchetti()
|
||||
{
|
||||
//prende i parametri dal file di configurazione dell'applicazione
|
||||
TFilename configname = "cg7100a.ini";
|
||||
TConfig configfile(configname);
|
||||
//prepara il file su cui scrivere, ovvero il _trasfile
|
||||
TFilename filename = _msk->get(F_DESTINAZIONE);
|
||||
filename.add(configfile.get("NOMEFILE", "OPZIONI"));
|
||||
if (fexist(filename))
|
||||
remove(filename);
|
||||
|
||||
_trasfile = new TInvio_file(filename);
|
||||
_trasfile->open(filename,'w');
|
||||
|
||||
i_zucchetti_testa();
|
||||
|
||||
if (_msk->get_bool(F_CAUSALI))
|
||||
i_zucchetti_causali();
|
||||
if (_msk->get_bool(F_CLIFOR))
|
||||
i_zucchetti_clifor();
|
||||
if (_msk->get_bool(F_CONTI))
|
||||
i_zucchetti_conti();
|
||||
if (_msk->get_bool(F_MOVCONT))
|
||||
i_zucchetti_movcont();
|
||||
if (_msk->get_bool(F_MOVIVA))
|
||||
{
|
||||
i_zucchetti_moviva('V');
|
||||
i_zucchetti_moviva('A');
|
||||
}
|
||||
i_zucchetti_coda();
|
||||
_trasfile->close();
|
||||
delete _trasfile;
|
||||
_trasfile = NULL;
|
||||
}
|
||||
|
||||
bool TInvio::create()
|
||||
{
|
||||
_msk = new TInvio_mask();
|
||||
_trasfile = NULL;
|
||||
return TSkeleton_application::create();
|
||||
}
|
||||
|
||||
bool TInvio::destroy()
|
||||
{
|
||||
if (_trasfile)
|
||||
delete _trasfile;
|
||||
delete _msk;
|
||||
|
||||
return TSkeleton_application::destroy();
|
||||
}
|
||||
|
||||
void TInvio::main_loop()
|
||||
{
|
||||
TFilename configname = "cg7100a.ini";
|
||||
configname.custom_path();
|
||||
TConfig configfile(configname);
|
||||
_msk->set(F_NUMEROINVIO, configfile.get_int("NUMEROINVIO","OPZIONI")+1);
|
||||
_msk->set(F_DATAINI, configfile.get("DATA","OPZIONI"));
|
||||
_msk->set(F_DESTINAZIONE, configfile.get("PERCORSO","OPZIONI"));
|
||||
|
||||
while (_msk->run() != K_QUIT)
|
||||
{
|
||||
_totale = false;
|
||||
_finemov = false;
|
||||
configfile.set("NUMEROINVIO", _msk->get(F_NUMEROINVIO),"OPZIONI");
|
||||
configfile.set("DATA", _msk->get_date(F_DATAFIN),"OPZIONI");
|
||||
configfile.set("PERCORSO", _msk->get(F_DESTINAZIONE),"OPZIONI");
|
||||
configfile.set_paragraph("CAUSALI");
|
||||
_dataini = _msk->get_date(F_DATAINI);
|
||||
_datafin = _msk->get_date(F_DATAFIN);
|
||||
const char tipoinvio = _msk->get(F_TIPOINVIO)[0];
|
||||
if (tipoinvio == 'Z')
|
||||
invio_zucchetti();
|
||||
}
|
||||
}
|
||||
|
||||
int cg7100(int argc, char **argv)
|
||||
{
|
||||
TInvio a;
|
||||
a.run(argc, argv, "Invio dati contabilità");
|
||||
a.run(argc, argv, "Invio dati contabilità Zucchetti");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
10
cg/cg7100a.ini
Executable file
10
cg/cg7100a.ini
Executable file
@ -0,0 +1,10 @@
|
||||
[OPZIONI]
|
||||
CODICEDITTA = 000106
|
||||
DATA =
|
||||
NOMEFILE = im000000
|
||||
NUMEROINVIO =
|
||||
PERCORSO =
|
||||
|
||||
[CAUSALI]
|
||||
STANDARD=021|020
|
||||
|
@ -2,13 +2,6 @@
|
||||
|
||||
PAGE "Invio dati contabilita'" -1 -1 78 20
|
||||
|
||||
//STRING 30 70 50
|
||||
// BEGIN
|
||||
// FLAGS "G"
|
||||
// PROMPT 10 -5 "Profilo "
|
||||
// PSELECT
|
||||
//END
|
||||
|
||||
GROUPBOX DLG_NULL 76 3
|
||||
BEGIN
|
||||
PROMPT 2 1 "@bDitta corrente"
|
||||
@ -37,80 +30,80 @@ END
|
||||
|
||||
BOOLEAN F_CAUSALI
|
||||
BEGIN
|
||||
PROMPT 3 5 "Causali"
|
||||
FLAGS "D"
|
||||
PROMPT 3 5 "Causali"
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
BOOLEAN F_CONTI
|
||||
BEGIN
|
||||
PROMPT 3 6 "Conti"
|
||||
PROMPT 3 6 "Conti"
|
||||
END
|
||||
|
||||
BOOLEAN F_CLIFOR
|
||||
BEGIN
|
||||
PROMPT 3 7 "Clienti/Fornitori"
|
||||
PROMPT 3 7 "Clienti/Fornitori"
|
||||
END
|
||||
|
||||
BOOLEAN F_MOVCONT
|
||||
BEGIN
|
||||
PROMPT 3 8 "Movimenti contabili"
|
||||
MESSAGE TRUE,ENABLE F_DATAFIN
|
||||
PROMPT 3 8 "Movimenti contabili"
|
||||
MESSAGE TRUE,ENABLE F_DATAFIN
|
||||
END
|
||||
|
||||
BOOLEAN F_MOVIVA
|
||||
BEGIN
|
||||
PROMPT 40 5 "Movimenti IVA"
|
||||
MESSAGE TRUE,ENABLE F_DATAFIN
|
||||
PROMPT 40 5 "Movimenti IVA"
|
||||
MESSAGE TRUE,ENABLE F_DATAFIN
|
||||
END
|
||||
|
||||
BOOLEAN F_CORRISP
|
||||
BEGIN
|
||||
PROMPT 40 6 "Corrispettivi"
|
||||
MESSAGE TRUE,ENABLE F_DATAFIN
|
||||
PROMPT 40 6 "Corrispettivi"
|
||||
MESSAGE TRUE,ENABLE F_DATAFIN
|
||||
END
|
||||
|
||||
BOOLEAN F_SALDACONTO
|
||||
BEGIN
|
||||
PROMPT 40 7 "Saldaconto"
|
||||
FLAGS "D"
|
||||
PROMPT 40 7 "Saldaconto"
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
LISTBOX F_TIPOINVIO 20
|
||||
BEGIN
|
||||
PROMPT 2 10 "Invio a "
|
||||
ITEM "Z|Zucchetti"
|
||||
PROMPT 2 10 "Invio a "
|
||||
ITEM "Z|Zucchetti"
|
||||
END
|
||||
|
||||
STRING F_DESTINAZIONE 20
|
||||
BEGIN
|
||||
PROMPT 2 11 "Destinazione "
|
||||
PROMPT 2 11 "Destinazione "
|
||||
END
|
||||
|
||||
NUMBER F_NUMEROINVIO 2
|
||||
BEGIN
|
||||
PROMPT 2 12 "Numero invio "
|
||||
PROMPT 2 12 "Numero invio "
|
||||
END
|
||||
|
||||
DATE F_DATAINI
|
||||
BEGIN
|
||||
PROMPT 20 12 "Data iniz. "
|
||||
PROMPT 20 12 "Data iniz. "
|
||||
END
|
||||
|
||||
DATE F_DATAFIN
|
||||
BEGIN
|
||||
PROMPT 44 12 "Data fin. "
|
||||
PROMPT 44 12 "Data fin. "
|
||||
END
|
||||
|
||||
BUTTON F_RIPRISTINA 20
|
||||
BEGIN
|
||||
PROMPT 2 14 "Annulla invio"
|
||||
MESSAGE SHOW,F_DATARIPRISTINO|ENABLE,F_DATARIPRISTINO
|
||||
PROMPT 2 14 "Annulla invio"
|
||||
MESSAGE SHOW,F_DATARIPRISTINO|ENABLE,F_DATARIPRISTINO
|
||||
END
|
||||
|
||||
DATE F_DATARIPRISTINO
|
||||
BEGIN
|
||||
PROMPT 25 14 "Annulla invio fino al "
|
||||
FLAGS "HD"
|
||||
PROMPT 25 14 "Annulla invio fino al "
|
||||
FLAGS "HD"
|
||||
END
|
||||
|
||||
BUTTON DLG_OK 9 2
|
||||
|
@ -1191,5 +1191,6 @@ int cg7200(int argc, char **argv)
|
||||
{
|
||||
TInvioP a;
|
||||
a.run(argc, argv, "Invio dati contabilità a Proforma");
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
@ -802,7 +802,7 @@ void TSaldo_agg::registra()
|
||||
if (saldi.read(_isequal, _lock) != NOERR)
|
||||
{
|
||||
saldi.zero();
|
||||
saldi.put(SLD_ANNOES, atoi(hobj->key().left(4)));
|
||||
saldi.put(SLD_ANNOES, annoes);
|
||||
saldi.put(SLD_GRUPPO, tcon.gruppo());
|
||||
saldi.put(SLD_CONTO, tcon.conto());
|
||||
saldi.put(SLD_SOTTOCONTO, tcon.sottoconto());
|
||||
|
@ -466,6 +466,41 @@ TImporto TRiga_scadenze::residuo(bool val, int mode) const
|
||||
return residuo;
|
||||
}
|
||||
|
||||
TImporto TRiga_scadenze::esposto(bool valuta, const TDate & data_scad, const TDate & data_rischio, bool & sbf) const
|
||||
{
|
||||
TImporto esposto;
|
||||
const bool rischio = data_scad != data_rischio;
|
||||
TDate data(get(SCAD_DATASCAD));
|
||||
const int lasts = last();
|
||||
|
||||
sbf = false;
|
||||
for (int p = first(); p <= lasts; p = succ(p))
|
||||
{
|
||||
const TRiga_partite & pag = riga().partita().riga(p);
|
||||
const int tp = pag.get_int(PART_TIPOPAG);
|
||||
|
||||
if (tp >= 2 && tp <= 7)
|
||||
{
|
||||
const char sez = pag.sezione();
|
||||
const TImporto imp(sez, pag.get_real(valuta ? PAGSCA_IMPORTOVAL : PAGSCA_IMPORTO));
|
||||
TDate datapag(pag.get(PART_DATAPAG));
|
||||
|
||||
if (data.ok() && datapag > data)
|
||||
datapag = datapag;
|
||||
if (rischio && datapag > data_rischio && datapag <= data_scad)
|
||||
{
|
||||
esposto += imp;
|
||||
sbf = true;
|
||||
}
|
||||
else
|
||||
if (datapag > data_scad)
|
||||
esposto += imp;
|
||||
}
|
||||
}
|
||||
|
||||
return esposto;
|
||||
}
|
||||
|
||||
|
||||
bool TRiga_scadenze::modifica_pagamento(const TRectype& new_pag, const TValuta& valuta,
|
||||
char& old_ap, TImporto& old_abb, TImporto& old_diffcam,
|
||||
|
@ -150,7 +150,8 @@ public:
|
||||
TImporto importo_pagato(bool val, int mode = 0xF) const;
|
||||
TImporto importo(bool val) const;
|
||||
TImporto residuo(bool val, int mode = 0xF) const; // Differenza delle due funzioni precedenti
|
||||
|
||||
TImporto esposto(bool valuta, const TDate & data_scad, const TDate & data_rischio, bool & sbf) const ;
|
||||
|
||||
bool esistono_abbuoni_diffcam() const;
|
||||
|
||||
TRiga_scadenze(TRiga_partite* riga);
|
||||
|
@ -1,3 +1,3 @@
|
||||
17
|
||||
0
|
||||
$cfven|0|0|428|0|Clienti/Fornitori per vendite|||
|
||||
$cfven|0|0|436|0|Clienti/Fornitori per vendite|||
|
||||
|
@ -1,5 +1,5 @@
|
||||
17
|
||||
73
|
||||
74
|
||||
TIPOCF|1|1|0|Tipo <C>liente, <F>ornitore
|
||||
CODCF|3|6|0|Codice
|
||||
CODINDDOC|2|3|0|Codice indirizzo documenti
|
||||
@ -69,6 +69,7 @@ ESCAR|4|6|2|Percentuale di esenzione CONAI carta
|
||||
ESPLA|4|6|2|Percentuale di esenzione CONAI plastica
|
||||
ESLEG|4|6|2|Percentuale di esenzione CONAI legno
|
||||
ESVET|4|6|2|Percentuale di esenzione CONAI vetro
|
||||
DATAECONAI|5|8|0|Data di fine esnzion CONAI
|
||||
CONAIASS|8|1|0|Stampa contributo CONAI assolto
|
||||
TIPODOCFAT|1|4|0|Tipo documento
|
||||
CODCAUS|1|3|0|Causale Contabile
|
||||
|
978
cg/zucchett.ini
978
cg/zucchett.ini
File diff suppressed because it is too large
Load Diff
@ -57,6 +57,7 @@ public:
|
||||
virtual long objects( ) const pure;
|
||||
// @cmember Ritorna true se il contenitore e' vuoto
|
||||
virtual bool empty() const
|
||||
|
||||
{ return objects( ) == 0; }
|
||||
|
||||
// @cmember Cerca il successivo elemento che soddisfa la <t OPERATION_FUNCTION>
|
||||
@ -325,4 +326,4 @@ public:
|
||||
void set(const char* numbers);
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
@ -9,6 +9,7 @@ cg Contabilita' Generale
|
||||
ci Contabilita' Industriale
|
||||
mi Modello IVA 11
|
||||
dt Importazione documenti STORE
|
||||
tp Trasferimento Pack
|
||||
ce Cespiti
|
||||
rs Report di Stampa
|
||||
sc Saldaconto
|
||||
|
@ -74,4 +74,6 @@
|
||||
#define CFV_CODCAUS "CODCAUS"
|
||||
#define CFV_CODCAUSNC "CODCAUSNC"
|
||||
#define CFV_CONAIASS "CONAIASS"
|
||||
#define CFV_DATAECONAI "DATAECONAI"
|
||||
#define CFV_ADDCONAI "ADDCONAI"
|
||||
#endif
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
#include <cfiles.h>
|
||||
#include <csort.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define MOSTMEM 51200
|
||||
#define LEASTMEM 10240
|
||||
@ -383,16 +384,15 @@ static void dumpbuff()
|
||||
|
||||
static FILE *wopen(char* name) /* nome del file temporaneo */
|
||||
{
|
||||
FILE *fp;
|
||||
|
||||
/*
|
||||
char s[42];
|
||||
static int n = 0;
|
||||
sprintf(s, "srt%02d", ++n);
|
||||
TMPFNAME(name,s);
|
||||
*/
|
||||
tmpnam(name);
|
||||
|
||||
FILE* fp = NULL;
|
||||
char* tmp = _tempnam(".", "srt");
|
||||
if (tmp != NULL)
|
||||
{
|
||||
strcpy(name, tmp);
|
||||
free(tmp);
|
||||
}
|
||||
else
|
||||
tmpnam(name);
|
||||
fp = fopen(name, "wb+");
|
||||
if (fp == NULL)
|
||||
xvt_dm_post_fatal_exit("Can't open SORT file");
|
||||
|
@ -215,6 +215,7 @@ void TMask::read_mask(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -2076,10 +2077,11 @@ bool TMask::load(
|
||||
TToken_string t(256);
|
||||
char* buffer = t.get_buffer();
|
||||
while (fgets(buffer, t.size(), f) != NULL && t != "[EOM]")
|
||||
|
||||
{
|
||||
if (t.not_empty())
|
||||
{
|
||||
t.cut(t.len() - 1);
|
||||
t.rtrim();
|
||||
const int pos = id2pos(t.get_int(0));
|
||||
if (pos >= 0) fld(pos).set(t.get());
|
||||
}
|
||||
@ -2233,6 +2235,23 @@ int TMask::load_profile(int num, bool reset)
|
||||
return num;
|
||||
}
|
||||
|
||||
bool TMask::kill_profile(int num)
|
||||
{
|
||||
TFilename prof;
|
||||
make_profile_name(prof);
|
||||
|
||||
TConfig ini(prof, "Main");
|
||||
if (num <= 0)
|
||||
num = ini.get_int(user());
|
||||
|
||||
TString16 name; name << num;
|
||||
const bool ok = ini.set_paragraph(name);
|
||||
if (ok)
|
||||
ini.remove_all();
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
const char* TMask::get_caption(TString& str) const
|
||||
{
|
||||
char* title = str.get_buffer(128);
|
||||
@ -2351,4 +2370,4 @@ TYesnoallnone_box::TYesnoallnone_box(const char * message, int default_key)
|
||||
}
|
||||
|
||||
TYesnoallnone_box::~TYesnoallnone_box()
|
||||
{}
|
||||
{}
|
@ -399,6 +399,8 @@ public:
|
||||
int save_profile(int num = 0, const char* desc = NULL) const;
|
||||
// @cmember Carica il profilo <p num>
|
||||
int load_profile(int num = 0, bool reset = TRUE);
|
||||
// @cmember Elimina il profilo <p num>
|
||||
bool kill_profile(int num);
|
||||
|
||||
// @cmember Ritorna il primo campo dirty
|
||||
short dirty() const;
|
||||
|
@ -12,6 +12,8 @@
|
||||
#define CIAUT 8
|
||||
#define MIAUT 9
|
||||
#define DTAUT 10
|
||||
#define TPAUT 10
|
||||
|
||||
#define CEAUT 11
|
||||
#define RSAUT 12
|
||||
#define SCAUT 13
|
||||
|
@ -520,6 +520,7 @@ protected:
|
||||
bool connect();
|
||||
|
||||
public:
|
||||
const TString & Server() const { return _server; }
|
||||
virtual bool Execute(const char* cmd);
|
||||
|
||||
bool WriteLine(const char* cmd);
|
||||
@ -729,17 +730,17 @@ bool TSocketClient::HttpGetFile(CONNID id, const char* remote, const char* local
|
||||
|
||||
{
|
||||
bool ok = FALSE;
|
||||
TSocket_connection* conn = (TSocket_connection*)GetConnection(id);
|
||||
|
||||
TString buf(4096);
|
||||
buf << "GET " << remote << " HTTP/1.0\r\n"
|
||||
<< "User-Agent: Campo\r\n";
|
||||
TString buf(8*1024);
|
||||
buf << "GET " << remote << " HTTP/1.1\r\n"
|
||||
<< "User-Agent: Campo\r\n"
|
||||
<< "Host: " << conn->Server() << "\r\n";
|
||||
if (authorization && *authorization)
|
||||
buf << "Authorization: " << authorization << "\r\n";
|
||||
buf << "\r\n";
|
||||
|
||||
if (WriteLine(id, buf))
|
||||
|
||||
|
||||
{
|
||||
long size = 0;
|
||||
for (int r = 0; ; r++)
|
||||
@ -760,24 +761,29 @@ bool TSocketClient::HttpGetFile(CONNID id, const char* remote, const char* local
|
||||
{
|
||||
buf.cut(0) << remote << " - " << (size / 1024 + 1) << " KBytes";
|
||||
TProgind pi(size, buf, TRUE, TRUE);
|
||||
|
||||
long total = 0;
|
||||
|
||||
skstream* cur_socket = ((TSocket_connection*)GetConnection(id))->GetSocket();
|
||||
skstream* cur_socket = conn->GetSocket();
|
||||
|
||||
while (!cur_socket->eof())
|
||||
{
|
||||
cur_socket->read(buf.get_buffer(), buf.size());
|
||||
int nchars = buf.size();
|
||||
|
||||
if (size >0 && nchars > size - total)
|
||||
nchars = size - total;
|
||||
cur_socket->read(buf.get_buffer(), nchars);
|
||||
const int count = cur_socket->gcount();
|
||||
if (count > 0)
|
||||
{
|
||||
outfile.write(buf, count);
|
||||
total += count;
|
||||
pi.setstatus(total);
|
||||
if (pi.iscancelled())
|
||||
break;
|
||||
pi.setstatus(total);
|
||||
if (pi.iscancelled())
|
||||
break;
|
||||
if (size > 0 && total >= size)
|
||||
break;
|
||||
}
|
||||
}
|
||||
ok = pi.isfinished();
|
||||
ok = size = 0 ? cur_socket->eof() != 0 : total >= size;
|
||||
}
|
||||
else
|
||||
error_box("Impossibile scrivere il file %s", local);
|
||||
|
@ -1290,35 +1290,35 @@ const char *real::ita2eng (const char *s)
|
||||
bool real::is_null(const char *s)
|
||||
{
|
||||
bool z = TRUE;
|
||||
if (s != NULL) for (const char* n = s; *n; n++)
|
||||
if (s && *s)
|
||||
{
|
||||
if (strchr("123456789", *n) != NULL)
|
||||
for (const char* n = s; *n; n++)
|
||||
{
|
||||
z = FALSE;
|
||||
break;
|
||||
if (strchr("123456789", *n) != NULL)
|
||||
{
|
||||
z = FALSE;
|
||||
break;
|
||||
}
|
||||
if (strchr(" ,-.0", *n) == NULL)
|
||||
break;
|
||||
}
|
||||
if (strchr(" ,-.0", *n) == NULL)
|
||||
break;
|
||||
}
|
||||
return z;
|
||||
}
|
||||
|
||||
bool real::is_natural (const char *s)
|
||||
{
|
||||
bool ok = s && *s != '\0';
|
||||
if (ok)
|
||||
bool ok = false;
|
||||
if (s && *s)
|
||||
{
|
||||
while (*s == ' ')
|
||||
s++; // Remove leading spaces before
|
||||
|
||||
if (*s)
|
||||
{
|
||||
while (isdigit(*s))
|
||||
s++;
|
||||
ok = *s == '\0';
|
||||
}
|
||||
else
|
||||
ok = FALSE;
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
@ -180,5 +180,5 @@ const TString& logic2table(int logic_num);
|
||||
int table2logic(const TString& name);
|
||||
TRecordset* create_recordset(const TString& sql);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -956,7 +956,7 @@ bool TRelation_application::save(bool check_dirty)
|
||||
const int mode = _mask->mode();
|
||||
if (check_dirty)
|
||||
{
|
||||
const int dirty = _mask->dirty();
|
||||
const short dirty = _mask->dirty();
|
||||
|
||||
if (mode == MODE_QUERY)
|
||||
{
|
||||
|
@ -23,6 +23,7 @@ CODFISC|1|16|0|Codice Fiscale
|
||||
MATRICOLA|1|8|0|Matricola
|
||||
PLURIMAND|8|1|0|Plurimandatario
|
||||
DATACESS|5|8|0|Data cessazione rapporto
|
||||
2
|
||||
3
|
||||
CODAGE|
|
||||
UPPER(RAGSOC)|X
|
||||
CODFORN|X
|
||||
|
@ -19,6 +19,8 @@ int main(int argc,char** argv)
|
||||
pr0600(argc,argv); break; // gestione archivi percentuali di provvigione
|
||||
case 6:
|
||||
pr0700(argc,argv); break; // gestione provvigioni agenti
|
||||
case 7:
|
||||
pr0800(argc,argv); break; // aggiornamento maturato
|
||||
default:
|
||||
pr0100(argc,argv); break; // gestione tabelle
|
||||
}
|
||||
|
1
pr/pr0.h
1
pr/pr0.h
@ -8,6 +8,7 @@ int pr0400(int argc, char** argv);
|
||||
int pr0500(int argc, char** argv);
|
||||
int pr0600(int argc, char** argv);
|
||||
int pr0700(int argc, char** argv);
|
||||
int pr0800(int argc, char** argv);
|
||||
|
||||
#endif // __PR0_H
|
||||
|
||||
|
225
pr/pr0800.cpp
Executable file
225
pr/pr0800.cpp
Executable file
@ -0,0 +1,225 @@
|
||||
// Programma di gestione provvigioni
|
||||
#include <applicat.h>
|
||||
#include <automask.h>
|
||||
#include <msksheet.h>
|
||||
#include <recset.h>
|
||||
|
||||
#include "../cg/cgsaldac.h"
|
||||
#include "../ve/velib.h"
|
||||
#include "prlib.h"
|
||||
#include <modaut.h>
|
||||
#include <mov.h>
|
||||
#include <doc.h>
|
||||
#include "provv.h"
|
||||
#include "pr0800a.h"
|
||||
#include "pr0.h"
|
||||
|
||||
class TAggiornamento_maturato_mask : public TAutomask
|
||||
{
|
||||
protected:
|
||||
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
|
||||
|
||||
public:
|
||||
void load_params();
|
||||
void save_params();
|
||||
|
||||
TAggiornamento_maturato_mask() : TAutomask("pr0800a") {}
|
||||
virtual ~TAggiornamento_maturato_mask() {}
|
||||
};
|
||||
|
||||
bool TAggiornamento_maturato_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
||||
{
|
||||
switch (o.dlg())
|
||||
{
|
||||
case F_A_CODAGE:
|
||||
if (e == fe_close)
|
||||
{
|
||||
const long a_cod = atol(o.get());
|
||||
const long da_cod = get_long(F_DA_CODAGE);
|
||||
if (a_cod > 0L && da_cod > a_cod)
|
||||
return error_box("Codice agente finale minore del codice agente iniziale");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
class TAggiornamento_maturato_app : public TSkeleton_application
|
||||
{
|
||||
|
||||
protected:
|
||||
virtual bool create();
|
||||
virtual bool destroy();
|
||||
void aggiorna_maturato(TAggiornamento_maturato_mask &m);
|
||||
virtual void main_loop();
|
||||
|
||||
};
|
||||
|
||||
static inline TAggiornamento_maturato_app& app() { return (TAggiornamento_maturato_app&) main_app(); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Da fare :
|
||||
// - Quando si elimina l'ultima riga dello spreadsheet si posiziona sulla prima senza
|
||||
// mandare un K_TAB per aggiornare le rate
|
||||
// - Browse dei documenti in ricerca, quando si seleziona setta giustamente focusdirty() e manda
|
||||
// un K_TAB. Quando si tenta di uscire dal campo si ha ancora il campo focusdirty()
|
||||
// - Cercare di implementare scarico/saldo righe provvigionali per agente in base ad una
|
||||
// impostata
|
||||
// - Ultimo ma non meno importante (da ritenersi visualmente valido) lo riempimento fisso
|
||||
// degli sheet (documenti e rate) in modo da evitare il fastidiosissimo sfarfallio in
|
||||
// inserimento righe con elementi vuoti
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
bool TAggiornamento_maturato_app::create()
|
||||
{
|
||||
const bool saldaconto = has_module(SCAUT, CHK_DONGLE);
|
||||
|
||||
if (!saldaconto)
|
||||
return error_box("Questo programma necessita del saldaconto");
|
||||
|
||||
open_files(LF_PROVV, LF_TABCOM, LF_DOC, LF_PARTITE, LF_SCADENZE, LF_PAGSCA, LF_TAB, 0);
|
||||
|
||||
return TSkeleton_application::create();
|
||||
}
|
||||
|
||||
bool TAggiornamento_maturato_app::destroy()
|
||||
{
|
||||
return TSkeleton_application::destroy();
|
||||
}
|
||||
|
||||
bool filter_func(const TRelation* rel)
|
||||
{
|
||||
const real importo_rata = rel->curr().get(PROV_IMPRATA);
|
||||
const real importo_pagato = rel->curr().get(PROV_PAGATO);
|
||||
|
||||
if ((importo_rata > ZERO) && (importo_rata <= importo_pagato))
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
}
|
||||
bool scan_func(const TRelation& rel, void* pJolly)
|
||||
{
|
||||
TAggiornamento_maturato_mask * m = (TAggiornamento_maturato_mask *) pJolly;
|
||||
const TDate data_scad(m->get(F_DATA_SCAD));
|
||||
TDate data_rischio(data_scad); data_rischio -= m->get_long(F_GIORNI_RISCHIO);
|
||||
bool sbf = false;
|
||||
TRectype & rec = rel.curr();
|
||||
const int anno = rec.get_int(PROV_ANNO);
|
||||
const TString16 codnum(rec.get(PROV_CODNUM)) ;
|
||||
const long ndoc = rec.get_long(PROV_NDOC);
|
||||
TString key;
|
||||
|
||||
key.format("D|%d|%s|%ld", anno, (const char *) codnum, ndoc);
|
||||
const long nreg = atol(cache().get(LF_DOC, key, DOC_NUMREG));
|
||||
|
||||
if (nreg > 0)
|
||||
{
|
||||
TPartite_array p;
|
||||
p.add_numreg(nreg);
|
||||
if (p.items() > 0)
|
||||
{
|
||||
const TPartita & part = *(p.first());
|
||||
const int nriga = part.prima_fattura(nreg);
|
||||
if (nriga >= 0)
|
||||
{
|
||||
bool changed_record = false;
|
||||
TRiga_partite & r = part.riga(nriga);
|
||||
const int nrata = rec.get_int(PROV_NRATA);
|
||||
const real importo_rata(rec.get_real(PROV_IMPRATA));
|
||||
const real importo_pagato(rec.get_real(PROV_PAGATO));
|
||||
const real provvigione_rata(rec.get_real(PROV_IMPPROVV));
|
||||
const real provvigione_pagata(rec.get_real(PROV_PROVVPAG));
|
||||
|
||||
if (nrata > 0)
|
||||
{
|
||||
TRiga_scadenze & s = r.rata(nrata);
|
||||
TImporto pagato(s.importo_pagato(false));
|
||||
|
||||
pagato -= s.esposto(false, data_scad, data_rischio, sbf);
|
||||
pagato.normalize('A');
|
||||
if (pagato.valore() >= importo_rata)
|
||||
{
|
||||
const real importo_maturato = importo_rata - importo_pagato;
|
||||
const real provvigione_maturata = provvigione_rata - provvigione_pagata;
|
||||
|
||||
rec.put(PROV_SALDATA, "X");
|
||||
rec.put(PROV_PAGMAT, importo_maturato);
|
||||
rec.put(PROV_PROVVMAT, provvigione_maturata);
|
||||
|
||||
changed_record = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
const real importo_maturato = pagato.valore() - importo_pagato;
|
||||
|
||||
if (importo_maturato > ZERO)
|
||||
{
|
||||
real provvigione_maturata = provvigione_rata * (importo_maturato / importo_rata);
|
||||
|
||||
rec.put(PROV_PAGMAT, importo_maturato);
|
||||
rec.put(PROV_PROVVMAT, provvigione_maturata);
|
||||
changed_record = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
const TDate data_mat = rec.get_date(PROV_DATASCAD);
|
||||
|
||||
if (data_mat <= data_scad)
|
||||
{
|
||||
changed_record = true;
|
||||
rec.put(PROV_SALDATA, "X");
|
||||
rec.put(PROV_PAGMAT, importo_rata);
|
||||
rec.put(PROV_PROVVMAT, provvigione_rata);
|
||||
}
|
||||
}
|
||||
|
||||
if (changed_record)
|
||||
{
|
||||
TLocalisamfile provv(LF_PROVV);
|
||||
provv.curr() = rec;
|
||||
int err = provv.read(_isequal, _lock);
|
||||
if (err == NOERR)
|
||||
err = rec.rewrite(provv);
|
||||
if (err != NOERR)
|
||||
return yesno_box("Errore %d nell' aggioramento agente %ld, Continuare ugualmente", err, rec.get_long(PROV_CODAGE));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void TAggiornamento_maturato_app::aggiorna_maturato(TAggiornamento_maturato_mask &m)
|
||||
{
|
||||
TCursor c(new TRelation(LF_PROVV), "(ANNO!=\"\")&&(CODNUM!=\"\")&&(NDOC!=\"\")&&(SALDATA!=\"X\")");
|
||||
TRectype from(LF_PROVV);
|
||||
TRectype to(LF_PROVV);
|
||||
const TString16 da_cod(m.get(F_DA_CODAGE));
|
||||
const TString16 a_cod(m.get(F_A_CODAGE));
|
||||
|
||||
if (da_cod > 0)
|
||||
from.put(PROV_CODAGE, da_cod);
|
||||
if (a_cod > 0)
|
||||
to.put(PROV_CODAGE, a_cod);
|
||||
c.setregion(from, to);
|
||||
c.set_filterfunction(filter_func);
|
||||
c.scan(scan_func, &m, TR("Aggiornamento provvigioni maturate"));
|
||||
}
|
||||
|
||||
void TAggiornamento_maturato_app::main_loop()
|
||||
{
|
||||
TAggiornamento_maturato_mask m;
|
||||
while (m.run() == K_ENTER)
|
||||
aggiorna_maturato(m);
|
||||
}
|
||||
|
||||
int pr0800(int argc, char** argv)
|
||||
{
|
||||
TAggiornamento_maturato_app a;
|
||||
a.run(argc, argv, TR("Aggiornamento provvigioni maturate"));
|
||||
return 0;
|
||||
}
|
8
pr/pr0800a.h
Executable file
8
pr/pr0800a.h
Executable file
@ -0,0 +1,8 @@
|
||||
// campi maschera pr0800a.uml
|
||||
|
||||
#define F_DA_CODAGE 201
|
||||
#define F_DA_RAGSOC 202
|
||||
#define F_A_CODAGE 203
|
||||
#define F_A_RAGSOC 204
|
||||
#define F_DATA_SCAD 205
|
||||
#define F_GIORNI_RISCHIO 206
|
89
pr/pr0800a.uml
Executable file
89
pr/pr0800a.uml
Executable file
@ -0,0 +1,89 @@
|
||||
#include "pr0800a.h"
|
||||
|
||||
TOOLBAR "" 0 20 0 2
|
||||
|
||||
BUTTON DLG_OK 10 2
|
||||
BEGIN
|
||||
PROMPT -12 -11 ""
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 10 2
|
||||
BEGIN
|
||||
PROMPT -22 -11 ""
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Aggiornamento Maturato" -1 -1 78 8
|
||||
|
||||
GROUPBOX DLG_NULL 80 6
|
||||
BEGIN
|
||||
PROMPT 1 1 "Agente"
|
||||
FLAGS "R"
|
||||
END
|
||||
|
||||
STRING F_DA_CODAGE 5
|
||||
BEGIN
|
||||
PROMPT 2 2 "Da Codice "
|
||||
FLAGS "UZ"
|
||||
USE LF_AGENTI
|
||||
INPUT CODAGE F_DA_CODAGE
|
||||
DISPLAY "Codice@8R" CODAGE
|
||||
DISPLAY "Descrizione@60" RAGSOC
|
||||
OUTPUT F_DA_CODAGE CODAGE
|
||||
OUTPUT F_DA_RAGSOC RAGSOC
|
||||
CHECKTYPE NOPRMAL
|
||||
ADD RUN PR0 -4
|
||||
END
|
||||
|
||||
STRING F_DA_RAGSOC 50
|
||||
BEGIN
|
||||
PROMPT 2 3 "Da Ragione sociale "
|
||||
USE LF_AGENTI KEY 2
|
||||
INPUT RAGSOC F_DA_RAGSOC
|
||||
DISPLAY "Descrizione@60" RAGSOC
|
||||
DISPLAY "Codice@8R" CODAGE
|
||||
COPY OUTPUT F_DA_CODAGE
|
||||
CHECKTYPE NORMAL
|
||||
ADD RUN PR0 -4
|
||||
END
|
||||
|
||||
STRING F_A_CODAGE 5
|
||||
BEGIN
|
||||
PROMPT 2 4 "A Codice "
|
||||
FLAGS "UZ"
|
||||
COPY USE F_DA_CODAGE
|
||||
INPUT CODAGE F_A_CODAGE
|
||||
COPY DISPLAY F_DA_CODAGE
|
||||
OUTPUT F_A_CODAGE CODAGE
|
||||
OUTPUT F_A_RAGSOC RAGSOC
|
||||
CHECKTYPE NORMAL
|
||||
ADD RUN PR0 -4
|
||||
END
|
||||
|
||||
STRING F_A_RAGSOC 50
|
||||
BEGIN
|
||||
PROMPT 2 5 "A Ragione sociale "
|
||||
COPY USE F_DA_RAGSOC
|
||||
INPUT RAGSOC F_A_RAGSOC
|
||||
COPY DISPLAY F_DA_RAGSOC
|
||||
COPY OUTPUT F_A_CODAGE
|
||||
CHECKTYPE NORMAL
|
||||
ADD RUN PR0 -4
|
||||
END
|
||||
|
||||
DATE F_DATA_SCAD
|
||||
BEGIN
|
||||
PROMPT 2 8 "Data scadenza "
|
||||
CHECKTYPE REQUIRED
|
||||
END
|
||||
|
||||
NUMBER F_GIORNI_RISCHIO 2
|
||||
BEGIN
|
||||
PROMPT 2 10 "Giorni rischio "
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
ENDMASK
|
||||
|
@ -6,8 +6,9 @@ Flags = ""
|
||||
Item_01 = "Archivi e tabelle", [PRMENU_002]
|
||||
Item_02 = "Stampa archivi e tabelle", [PRMENU_003]
|
||||
Item_03 = "Provvigioni", "pr0 -6", "F"
|
||||
Item_04 = "Stampa provvigioni", [PRMENU_004]
|
||||
Item_05 = "Configurazione modulo", [PRMENU_010]
|
||||
Item_04 = "Aggiornamento maturato", "pr0 -7", "F"
|
||||
Item_05 = "Stampa provvigioni", [PRMENU_004]
|
||||
Item_06 = "Configurazione modulo", [PRMENU_010]
|
||||
|
||||
[PRMENU_002]
|
||||
Caption = "Archivi e tabelle"
|
||||
|
320
sc/sc2600.cpp
320
sc/sc2600.cpp
@ -20,7 +20,7 @@
|
||||
#define NUMERO_FASCE 5
|
||||
#define LIMITI {30,60,90,120,150,30,60,90,120,150}
|
||||
|
||||
enum tipo_st {clienti=0, fornitori=1, altri=2};
|
||||
enum tipo_st {clienti=0, fornitori=1};
|
||||
|
||||
class TLineTotal : public TObject //Oggetto di base per i TAssoc_array dei totali
|
||||
{
|
||||
@ -121,10 +121,11 @@ public:
|
||||
virtual bool user_destroy();
|
||||
virtual bool set_print(int);
|
||||
virtual void set_page (int file, int counter);
|
||||
void print_totali_rows(int& nriga, bool what);
|
||||
void print_totali_rows(int nriga, bool what);
|
||||
void print_totali(int& nriga);
|
||||
void print_header();
|
||||
void update_totals(bool what, real& esp,
|
||||
int calc_last_column();
|
||||
void update_totals(bool what, real& esp,
|
||||
real& s1,real& s2,real& s3,real& s4,real& s5, real& s6,
|
||||
real& ns1,real& ns2,real& ns3,real& ns4,real& ns5, real& ns6);
|
||||
void compute_unassigned(TPartita& p);
|
||||
@ -145,7 +146,7 @@ void TProspettoScadenze::print_real(TString& dest, const real& num)
|
||||
const TString& val = stampa_in_valuta ? _codval : EMPTY_STRING;
|
||||
const TCurrency cur(num, val);
|
||||
dest = cur.string(TRUE);
|
||||
dest.right_just(13);
|
||||
dest.right_just(10);
|
||||
}
|
||||
|
||||
bool TProspettoScadenze::fil_function(const TRelation *r)
|
||||
@ -280,9 +281,6 @@ void TProspettoScadenze::compute_all(TPartita& p, TBill& bill)
|
||||
char norm='D';
|
||||
if (_tipost == fornitori)
|
||||
norm = 'A';
|
||||
else
|
||||
if (_tipost == altri && bill.find())
|
||||
norm = bill.sezione();
|
||||
pag.normalize((norm=='D') ? 'A' : 'D'); scd.normalize(norm); bf.normalize((norm=='D') ? 'A' : 'D');
|
||||
real res,a,b; a = pag.valore(); b = scd.valore(); //buonf += bf.valore();
|
||||
res = b - a;
|
||||
@ -349,10 +347,10 @@ void TProspettoScadenze::compute_all(TPartita& p, TBill& bill)
|
||||
if (d <= (TDate&)_s_date[4])
|
||||
s6 += res;
|
||||
residuo += res;
|
||||
bool sbf;
|
||||
TImporto esp = rs.esposto(_stvaluta, _limscad, _limbf, sbf);
|
||||
esposto += esp.valore();
|
||||
}
|
||||
bool sbf;
|
||||
TImporto esp = rp.esposto(_stvaluta, _limscad, _limbf, sbf);
|
||||
esposto += esp.valore();
|
||||
}
|
||||
|
||||
// Aggiorna i totali...
|
||||
@ -370,36 +368,30 @@ void TProspettoScadenze::calcola_saldo()
|
||||
TLineTotal *ll = (TLineTotal *) a.objptr(_codval);
|
||||
TSaldo saldo;
|
||||
int g,c;
|
||||
long s;
|
||||
if (_tipost == altri)
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
s = atol(_cod_pre);
|
||||
for (int i = 0; i < _conti_cf.items(); i++)
|
||||
{
|
||||
TToken_string& cf = (TToken_string&)_conti_cf[i];
|
||||
g = cf.get_int(0);
|
||||
c = cf.get_int(1);
|
||||
TToken_string key;
|
||||
key.add(g); key.add(c); key.add(s);
|
||||
const TRectype& pc = cache().get(LF_PCON, key);
|
||||
int indbil_conto = pc.get_int (PCN_INDBIL);
|
||||
TDate dataini = TDate(1, 1, _limop.year());
|
||||
saldo.data_limite_bilancio( 1, g, c, s, dataini, _limop, indbil_conto, FALSE);
|
||||
ll->_sl += saldo.saldo();
|
||||
}
|
||||
// aggiorno il totale generale
|
||||
TAssoc_array& at = (TAssoc_array&) _t[1];
|
||||
TLineTotal *lt = (TLineTotal *) at.objptr(_codval);
|
||||
if (lt == NULL)
|
||||
{
|
||||
lt = new TLineTotal;
|
||||
at.add(_codval, lt);
|
||||
}
|
||||
lt->_sl += ll->_sl;
|
||||
const long s = atol(_cod_pre);
|
||||
|
||||
for (int i = 0; i < _conti_cf.items(); i++)
|
||||
{
|
||||
TToken_string& cf = (TToken_string&)_conti_cf[i];
|
||||
g = cf.get_int(0);
|
||||
c = cf.get_int(1);
|
||||
TToken_string key;
|
||||
key.add(g); key.add(c); key.add(s);
|
||||
const TRectype& pc = cache().get(LF_PCON, key);
|
||||
int indbil_conto = pc.get_int (PCN_INDBIL);
|
||||
TDate dataini = TDate(1, 1, _limop.year());
|
||||
saldo.data_limite_bilancio( 1, g, c, s, dataini, _limop, indbil_conto, FALSE);
|
||||
ll->_sl += saldo.saldo();
|
||||
}
|
||||
// aggiorno il totale generale
|
||||
TAssoc_array& at = (TAssoc_array&) _t[1];
|
||||
TLineTotal *lt = (TLineTotal *) at.objptr(_codval);
|
||||
if (lt == NULL)
|
||||
{
|
||||
lt = new TLineTotal;
|
||||
at.add(_codval, lt);
|
||||
}
|
||||
lt->_sl += ll->_sl;
|
||||
}
|
||||
|
||||
bool TProspettoScadenze::preprocess_page(int file, int counter)
|
||||
@ -440,18 +432,8 @@ bool TProspettoScadenze::preprocess_page(int file, int counter)
|
||||
if (sin_tot.items() > 0)
|
||||
{
|
||||
print_totali(nriga);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
//if (_end_printed)
|
||||
//{
|
||||
// TAssoc_array& gen_tot = (TAssoc_array&) _t[1];
|
||||
// if (gen_tot.items() > 0)
|
||||
// {
|
||||
// nriga++;
|
||||
// print_totali_rows(nriga,1);
|
||||
// }
|
||||
// return TRUE; // Go back, print and exit!
|
||||
//}
|
||||
}
|
||||
_des.trim();
|
||||
_cod_pre = _cod;
|
||||
@ -494,22 +476,23 @@ print_action TProspettoScadenze::postprocess_print(int file, int counter)
|
||||
{
|
||||
print_action rt = NEXT_PAGE;
|
||||
if (!_end_printed)
|
||||
{
|
||||
if ((file == LF_PARTITE))
|
||||
{
|
||||
rt = REPEAT_PAGE;
|
||||
_end_printed = TRUE;
|
||||
_end_printed = true;
|
||||
}
|
||||
if (_end_printed)
|
||||
{
|
||||
TAssoc_array& gen_tot = (TAssoc_array&) _t[1];
|
||||
if (gen_tot.items() > 0)
|
||||
{
|
||||
int nriga = 1;
|
||||
print_totali_rows(nriga,1);
|
||||
}
|
||||
//return REPEAT_PAGE; // Go back, print and exit!
|
||||
}
|
||||
|
||||
if (gen_tot.items() > 0)
|
||||
{
|
||||
print_totali_rows(1,1);
|
||||
print_one(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
return rt;
|
||||
}
|
||||
|
||||
@ -586,16 +569,11 @@ bool TProspettoScadenze::set_print(int)
|
||||
{
|
||||
reset_files();
|
||||
reset_print();
|
||||
if (_m->get_who() == 'P')
|
||||
_tipost = altri;
|
||||
else
|
||||
{
|
||||
if (_m->get_who() == 'C')
|
||||
_tipost = clienti;
|
||||
else
|
||||
_tipost = fornitori;
|
||||
riempi_conti_mastro(_m->get_who());
|
||||
}
|
||||
if (_m->get_who() == 'C')
|
||||
_tipost = clienti;
|
||||
else
|
||||
_tipost = fornitori;
|
||||
riempi_conti_mastro(_m->get_who());
|
||||
if (_m->get_key() == 1)
|
||||
_ordcod = TRUE;
|
||||
else
|
||||
@ -646,21 +624,6 @@ bool TProspettoScadenze::set_print(int)
|
||||
add_file(LF_PARTITE);
|
||||
add_file(LF_CLIFO,LF_PARTITE);
|
||||
break;
|
||||
case altri:
|
||||
filter_to.put("TIPOC", "A"); // Sporco trucco per selezionare solo i conti
|
||||
if (_ordcod) // Per codice...
|
||||
{
|
||||
select_cursor(_cur3);
|
||||
get_cursor(_cur3)->setregion(filter_from, filter_to); // Filtro per i conti normali!
|
||||
}
|
||||
else // ... e descrizione
|
||||
{
|
||||
select_cursor(_cur4);
|
||||
get_cursor(_cur4)->setregion(filter_from, filter_to); // Filtro per i conti normali!
|
||||
}
|
||||
add_file(LF_PARTITE);
|
||||
add_file(LF_PCON,LF_PARTITE);
|
||||
break;
|
||||
default: break;
|
||||
} // End of inner switch
|
||||
|
||||
@ -687,7 +650,7 @@ bool TProspettoScadenze::set_print(int)
|
||||
return rt;
|
||||
}
|
||||
|
||||
void TProspettoScadenze::print_totali_rows(int& nriga, bool what)
|
||||
void TProspettoScadenze::print_totali_rows(int nriga, bool what)
|
||||
// If what is 0 prints single total... else prints also general total
|
||||
{
|
||||
reset_print();
|
||||
@ -704,7 +667,7 @@ void TProspettoScadenze::print_totali_rows(int& nriga, bool what)
|
||||
TString value;
|
||||
TLineTotal& v = (TLineTotal&)xassoc[k];
|
||||
|
||||
int pos = 60;
|
||||
int pos = 40;
|
||||
TString rw(255);
|
||||
rw = "";
|
||||
|
||||
@ -713,134 +676,141 @@ void TProspettoScadenze::print_totali_rows(int& nriga, bool what)
|
||||
if (v._s6 != ZERO)
|
||||
{
|
||||
print_real(value, v._s6);
|
||||
rw << format("@%dg%15s", pos, (const char*) value);
|
||||
rw << format("@%dg%10s", pos, (const char*) value);
|
||||
}
|
||||
if (_sfasce >= 5)
|
||||
pos = pos + 16;
|
||||
pos = pos + 11;
|
||||
|
||||
if (v._s5 != ZERO)
|
||||
{
|
||||
print_real(value, v._s5);
|
||||
rw << format("@%dg%15s", pos, (const char*) value);
|
||||
rw << format("@%dg%10s", pos, (const char*) value);
|
||||
}
|
||||
if (_sfasce >= 4)
|
||||
pos = pos + 16;
|
||||
pos = pos + 11;
|
||||
|
||||
if (v._s4 != ZERO)
|
||||
{
|
||||
print_real(value, v._s4);
|
||||
rw << format("@%dg%15s", pos, (const char*) value);
|
||||
rw << format("@%dg%10s", pos, (const char*) value);
|
||||
}
|
||||
if (_sfasce >= 3)
|
||||
pos = pos + 16;
|
||||
pos = pos + 11;
|
||||
|
||||
if (v._s3 != ZERO)
|
||||
{
|
||||
print_real(value, v._s3);
|
||||
rw << format("@%dg%15s", pos, (const char*) value);
|
||||
rw << format("@%dg%10s", pos, (const char*) value);
|
||||
}
|
||||
if (_sfasce >= 2)
|
||||
pos = pos + 16;
|
||||
pos = pos + 11;
|
||||
|
||||
if (v._s2 != ZERO)
|
||||
{
|
||||
print_real(value, v._s2);
|
||||
rw << format("@%dg%15s", pos, (const char*) value);
|
||||
rw << format("@%dg%10s", pos, (const char*) value);
|
||||
}
|
||||
if (_sfasce >= 1)
|
||||
pos = pos + 16;
|
||||
pos = pos + 11;
|
||||
}
|
||||
if (v._s1 != ZERO)
|
||||
{
|
||||
print_real(value, v._s1);
|
||||
rw << format("@%dg%15s", pos, (const char*) value);
|
||||
rw << format("@%dg%10s", pos, (const char*) value);
|
||||
}
|
||||
pos = pos + 16;
|
||||
pos = pos + 11;
|
||||
|
||||
if (_nsinfasce)
|
||||
{
|
||||
if (v._ns1 != ZERO)
|
||||
{
|
||||
print_real(value, v._ns1);
|
||||
rw << format("@%dg%15s", pos, (const char*) value);
|
||||
rw << format("@%dg%10s", pos, (const char*) value);
|
||||
}
|
||||
if (_nsfasce >= 1)
|
||||
pos = pos + 16;
|
||||
pos = pos + 11;
|
||||
|
||||
if (v._ns2 != ZERO)
|
||||
{
|
||||
print_real(value, v._ns2);
|
||||
rw << format("@%dg%15s", pos, (const char*) value);
|
||||
rw << format("@%dg%10s", pos, (const char*) value);
|
||||
}
|
||||
if (_nsfasce >= 2)
|
||||
pos = pos + 16;
|
||||
pos = pos + 11;
|
||||
|
||||
if (v._ns3 != ZERO)
|
||||
{
|
||||
print_real(value, v._ns3);
|
||||
rw << format("@%dg%15s", pos, (const char*) value);
|
||||
rw << format("@%dg%10s", pos, (const char*) value);
|
||||
}
|
||||
if (_nsfasce >= 3)
|
||||
pos = pos + 16;
|
||||
pos = pos + 11;
|
||||
|
||||
if (v._ns4 != ZERO)
|
||||
{
|
||||
print_real(value, v._ns4);
|
||||
rw << format("@%dg%15s", pos, (const char*) value);
|
||||
rw << format("@%dg%10s", pos, (const char*) value);
|
||||
}
|
||||
if (_nsfasce >= 4)
|
||||
pos = pos + 16;
|
||||
pos = pos + 11;
|
||||
|
||||
if (v._ns5 != ZERO)
|
||||
{
|
||||
print_real(value, v._ns5);
|
||||
rw << format("@%dg%15s", pos, (const char*) value);
|
||||
rw << format("@%dg%10s", pos, (const char*) value);
|
||||
}
|
||||
if (_nsfasce >= 5)
|
||||
pos = pos + 16;
|
||||
pos = pos + 11;
|
||||
}
|
||||
if (v._ns6 != ZERO)
|
||||
{
|
||||
print_real(value, v._ns6);
|
||||
rw << format("@%dg%15s", pos, (const char*) value);
|
||||
rw << format("@%dg%10s", pos, (const char*) value);
|
||||
}
|
||||
pos = pos + 16;
|
||||
pos = pos + 11;
|
||||
const real tot = v._s1+v._s2+v._s3+v._s4+v._s5+v._s6+v._ns1+v._ns2+v._ns3+v._ns4+v._ns5+v._ns6;
|
||||
if (tot != ZERO)
|
||||
{
|
||||
print_real(value, tot);
|
||||
rw << format("@%dg%15s", pos, (const char*) value);
|
||||
rw << format("@%dg%10s", pos, (const char*) value);
|
||||
}
|
||||
pos = pos + 16;
|
||||
//if (v._es != ZERO)
|
||||
//{
|
||||
// print_real(value, v._es);
|
||||
// rw << format("@%dg%15s", pos, (const char*) value);
|
||||
//}
|
||||
//pos = pos + 16;
|
||||
pos = pos + 11;
|
||||
if (v._es != ZERO)
|
||||
{
|
||||
print_real(value, v._es);
|
||||
rw << format("@%dg%10s", pos, (const char*) value);
|
||||
}
|
||||
pos = pos + 11;
|
||||
if (v._sl != ZERO)
|
||||
{
|
||||
print_real(value, v._sl);
|
||||
rw << format("@%dg%15s", pos, (const char*) value);
|
||||
rw << format("@%dg%10s", pos, (const char*) value);
|
||||
}
|
||||
pos = pos + 16;
|
||||
pos = pos + 13;
|
||||
|
||||
if (!what)
|
||||
{
|
||||
const real diff = tot - v._sl;
|
||||
if (diff != ZERO)
|
||||
{
|
||||
print_real(value, diff);
|
||||
rw << format("@%dg%15s", pos, (const char*) value);
|
||||
}
|
||||
}
|
||||
const real diff = v._sl + v._es - tot;
|
||||
if (diff != ZERO)
|
||||
{
|
||||
print_real(value, diff);
|
||||
rw << format("@%dg%10s", pos, (const char*) value);
|
||||
}
|
||||
|
||||
if (rw.not_empty())
|
||||
{
|
||||
if (!what)
|
||||
rw.insert(format("%6s@8g%s", (const char*) _cod_pre, (const char*) _des_pre));
|
||||
{
|
||||
TString s = _des_pre.left(25);
|
||||
rw.insert(format("%6s@8g%-25s", (const char*) _cod_pre, (const char*) s));
|
||||
}
|
||||
else
|
||||
rw.insert("TOTALE GENERALE");
|
||||
{
|
||||
TString meno;
|
||||
const int last_column = calc_last_column();
|
||||
|
||||
meno.fill('-', last_column);
|
||||
set_row(nriga++, meno);
|
||||
rw.insert("@8gTOTALE GENERALE");
|
||||
}
|
||||
set_row(nriga, rw);
|
||||
}
|
||||
}
|
||||
@ -857,8 +827,10 @@ void TProspettoScadenze::print_header()
|
||||
// Setta le righe dell'intestazione
|
||||
{
|
||||
int soh = 1;
|
||||
const int last_column = calc_last_column();
|
||||
const long firm = get_firm();
|
||||
TString rw(255);
|
||||
TString rw(last_column);
|
||||
TString meno(last_column);
|
||||
|
||||
reset_header ();
|
||||
TLocalisamfile ditte(LF_NDITTE);
|
||||
@ -873,8 +845,8 @@ void TProspettoScadenze::print_header()
|
||||
TString limop = _limop.string();
|
||||
TString limscad = _limscad.string();
|
||||
|
||||
set_header (soh++, "Ditta : %ld %s@158gData@163g%s @190gPag. @#",
|
||||
firm, (const char *)s, (const char *)datas);
|
||||
set_header (soh++, "Ditta : %ld %s@%ldgData %s @%ldgPag. @#",
|
||||
firm, (const char *)s, last_column - 30, (const char *)datas, last_column - 10);
|
||||
|
||||
switch (_tipost)
|
||||
{
|
||||
@ -883,71 +855,77 @@ void TProspettoScadenze::print_header()
|
||||
{
|
||||
TString s1,s2, s3;
|
||||
int o = 0; // Offset per scaglioni.
|
||||
|
||||
|
||||
if (_tipost==fornitori)
|
||||
set_header(soh++,"@72g** PROSPETTO SCADENZE FORNITORI **");
|
||||
set_header(soh++,"@%ldg** PROSPETTO SCADENZE FORNITORI **", (last_column - 35) / 2);
|
||||
else
|
||||
set_header(soh++,"@73g** PROSPETTO SCADENZE CLIENTI **");
|
||||
set_header (soh++,"@68gAl %s - Operazioni al %s",(const char*)limscad, (const char*)limop);
|
||||
rw.cut(0);
|
||||
rw.fill('-');
|
||||
set_header(soh++, (const char *) rw);
|
||||
set_header(soh++,"@%ldg** PROSPETTO SCADENZE CLIENTI **", (last_column - 34) / 2);
|
||||
set_header (soh++,"@%ldgAl %s - Operazioni al %s", (last_column - 40) / 2, (const char*)limscad, (const char*)limop);
|
||||
meno.fill('-', last_column);
|
||||
set_header(soh++,(const char *)meno);
|
||||
set_header(soh,"CODICE@8gC O G N O M E E N O M E ");
|
||||
int limiti[2][NUMERO_FASCE] = LIMITI;
|
||||
int row = 0;
|
||||
if (_tipost==fornitori)
|
||||
row = 1;
|
||||
int pos = 60;
|
||||
rw = "";
|
||||
int pos = 40;
|
||||
|
||||
rw.cut(0);
|
||||
if (_sinfasce)
|
||||
{
|
||||
for (int i = _sfasce-1; i >= 0; i--)
|
||||
{
|
||||
rw << format("@%dg%12d gg", pos, limiti[row][i]);
|
||||
pos = pos + 16;
|
||||
rw << format("@%dg%7d gg", pos, limiti[row][i] + 30);
|
||||
pos = pos + 11;
|
||||
}
|
||||
rw << format("@%dg%15s", pos, "0 gg");
|
||||
set_header(soh, format("@%dg%15s", 60+((pos-60)/2), "SCADUTO"));
|
||||
rw << format("@%dg%10s", pos, "30 gg");
|
||||
set_header(soh, format("@%dg%10s", 40+((pos-40)/2), "SCADUTO"));
|
||||
}
|
||||
else
|
||||
set_header(soh, format("@%dg%15s", pos, "SCADUTO"));
|
||||
pos = pos + 16;
|
||||
set_header(soh, format("@%dg%10s", pos, "SCADUTO"));
|
||||
pos = pos + 11;
|
||||
const int pos_ascad = pos;
|
||||
if (_nsinfasce)
|
||||
{
|
||||
for (int i = 0; i < _nsfasce; i++)
|
||||
{
|
||||
rw << format("@%dg%12d gg", pos, limiti[row][i]);
|
||||
pos = pos + 16;
|
||||
rw << format("@%dg%7d gg", pos, limiti[row][i]);
|
||||
pos = pos + 11;
|
||||
}
|
||||
set_header(soh, format("@%dg%15s", pos_ascad+((pos-pos_ascad)/2)-5, "A SCADERE"));
|
||||
set_header(soh, format("@%dg%11s", pos_ascad+((pos-pos_ascad)/2)-5, " A SCADERE"));
|
||||
}
|
||||
else
|
||||
set_header(soh, format("@%dg%15s", pos, "A SCADERE"));
|
||||
pos = pos + 16;
|
||||
set_header(soh, format("@%dg%15s", pos, "TOTALE"));
|
||||
pos = pos + 16;
|
||||
//set_header(soh, format("@%dg%15s", pos, "ESPOSTO"));
|
||||
//pos = pos + 16;
|
||||
set_header(soh, format("@%dg%15s", pos, "SALDO"));
|
||||
pos = pos + 16;
|
||||
set_header(soh, format("@%dg%15s", pos, "DIFFERENZA"));
|
||||
set_header(soh, format("@%dg%11s", pos, " A SCADERE"));
|
||||
pos = pos + 11;
|
||||
set_header(soh, format("@%dg%11s", pos, " TOTALE"));
|
||||
pos = pos + 11;
|
||||
set_header(soh, format("@%dg%11s", pos, " ESPOSTO"));
|
||||
pos = pos + 11;
|
||||
set_header(soh, format("@%dg%11s", pos, " SALDO"));
|
||||
pos = pos + 13;
|
||||
set_header(soh, format("@%dg%11s", pos, "DIFFERENZA"));
|
||||
set_header(++soh,(const char *)rw);
|
||||
break;
|
||||
}
|
||||
case altri: // Piano dei conti
|
||||
{
|
||||
set_header(soh++,"@79g** SCADENZE **");
|
||||
set_header (soh++,"@68gAl %s - Operazioni al %s",(const char*)limscad, (const char*)limop);
|
||||
rw.fill('-');
|
||||
set_header(soh++, (const char *) rw);
|
||||
set_header(soh++,"CONTO@16gD E S C R I Z I O N E");
|
||||
set_header(soh++,(const char *)rw);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
set_header(soh,"");
|
||||
set_header(++soh, (const char *) meno);
|
||||
}
|
||||
|
||||
int TProspettoScadenze::calc_last_column()
|
||||
// Setta le righe dell'intestazione
|
||||
{
|
||||
int pos = 110;
|
||||
|
||||
if (_sinfasce)
|
||||
for (int i = _sfasce-1; i >= 0; i--)
|
||||
pos = pos + 11;
|
||||
if (_nsinfasce)
|
||||
for (int i = 0; i < _nsfasce; i++)
|
||||
pos = pos + 11;
|
||||
return pos;
|
||||
}
|
||||
|
||||
void TProspettoScadenze::set_page(int file, int counter)
|
||||
@ -957,7 +935,7 @@ void TProspettoScadenze::set_page(int file, int counter)
|
||||
|
||||
TProspettoScadenze::TProspettoScadenze()
|
||||
{
|
||||
_rel1=_rel2=NULL;
|
||||
_rel1 = _rel2 = NULL;
|
||||
}
|
||||
|
||||
int sc2600(int argc, char** argv)
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include <colmask.h>
|
||||
#include <execp.h>
|
||||
#include <tabutil.h>
|
||||
#include <utility.h>
|
||||
|
@ -14,7 +14,6 @@ JOIN %ABE TO 33 ALIAS 206 INTO CODTAB==ASPBENI1
|
||||
JOIN %CTR TO 33 ALIAS 207 INTO CODTAB==CAUSTRASP
|
||||
JOIN %TIP TO 33 ALIAS 208 INTO CODTAB==TIPODOC
|
||||
JOIN %BAN TO 33 ALIAS 209 INTO CODTAB==CODABIA
|
||||
JOIN %NDO TO 33 ALIAS 210 INTO CODTAB==CODNOTESP1
|
||||
|
||||
END
|
||||
|
||||
@ -1184,7 +1183,7 @@ STRING 167 40 2
|
||||
BEGIN
|
||||
KEY "note documento"
|
||||
PROMPT 2 22 ""
|
||||
FIELD 210@->S0
|
||||
FIELD NOTE
|
||||
END
|
||||
|
||||
END
|
||||
|
@ -14,7 +14,6 @@ JOIN %ABE TO 33 ALIAS 206 INTO CODTAB==ASPBENI1
|
||||
JOIN %CTR TO 33 ALIAS 207 INTO CODTAB==CAUSTRASP
|
||||
JOIN %BAN TO 33 ALIAS 208 INTO CODTAB==CODABIA
|
||||
JOIN %TIP TO 33 ALIAS 210 INTO CODTAB==TIPODOC
|
||||
JOIN %NDO TO 33 ALIAS 211 INTO CODTAB==CODNOTESP1
|
||||
|
||||
END
|
||||
|
||||
@ -37,7 +36,6 @@ BEGIN
|
||||
208@->* "Tabella banche agenzia"
|
||||
209@->* "Tabella valute"
|
||||
210@->* "Tabella tipo documento"
|
||||
211@->* "Tabella note documento"
|
||||
END
|
||||
|
||||
GENERAL
|
||||
@ -1208,7 +1206,7 @@ STRING 172 50 1
|
||||
BEGIN
|
||||
KEY "note documento"
|
||||
PROMPT 2 23 ""
|
||||
FIELD 211@->S0
|
||||
FIELD NOTE
|
||||
END
|
||||
|
||||
|
||||
|
@ -13,6 +13,8 @@ Item_07 = "Statistiche di vendita", <svmenu.men>
|
||||
Item_08 = "Servizi", [ACQVEN_021]
|
||||
Item_09 = "Configurazione", [ACQVEN_020]
|
||||
Item_10 = "Importazione documenti STORE", <dtmenu.men>
|
||||
Item_11 = "Trasferimento PACK", <tpmenu.men>
|
||||
|
||||
|
||||
[ACQVEN_001]
|
||||
Caption = "Archivi e tabelle di base"
|
||||
@ -264,4 +266,4 @@ Item_08 = "Visualiz. stato ricezione", "cg6 -7 V", "F"
|
||||
Item_09 = "Variazione p.n. da ricevere", "cg6 -7 P", "F"
|
||||
Item_10 = "Variazione iva da ricevere", "cg6 -7 I", "F"
|
||||
Item_11 = "Annul. movimenti da ricevere", "cg6 -7 A", "F"
|
||||
Item_12 = "Variazione saldaconto da ricevere", "cg6 -7 B", "F"
|
||||
Item_12 = "Variazione saldaconto da ricevere", "cg6 -7 B", "F"
|
@ -11,7 +11,6 @@ JOIN %VET TO 33 ALIAS 205 INTO CODTAB==CODVETT1
|
||||
JOIN %ABE TO 33 ALIAS 206 INTO CODTAB==ASPBENI1
|
||||
JOIN %CTR TO 33 ALIAS 207 INTO CODTAB==CAUSTRASP
|
||||
JOIN %BAN TO 33 ALIAS 208 INTO CODTAB==CODABIA
|
||||
JOIN %NDO TO 33 ALIAS 209 INTO CODTAB==CODNOTESP1
|
||||
|
||||
END
|
||||
DESCRIPTION
|
||||
@ -28,7 +27,6 @@ BEGIN
|
||||
206@->* "Tabella aspetto beni"
|
||||
207@->* "Tabella causali di trasporto"
|
||||
208@->* "Tabella banche agenzia"
|
||||
209@->* "Tabella note documento"
|
||||
END
|
||||
|
||||
GENERAL
|
||||
@ -722,7 +720,7 @@ STRING 123 50 1
|
||||
BEGIN
|
||||
KEY "note documento"
|
||||
PROMPT 2 10 ""
|
||||
FIELD 209@->S0
|
||||
FIELD NOTE
|
||||
END
|
||||
|
||||
END
|
||||
|
@ -11,7 +11,6 @@ JOIN %VET TO 33 ALIAS 205 INTO CODTAB==CODVETT1
|
||||
JOIN %ABE TO 33 ALIAS 206 INTO CODTAB==ASPBENI1
|
||||
JOIN %CTR TO 33 ALIAS 207 INTO CODTAB==CAUSTRASP
|
||||
JOIN %BAN TO 33 ALIAS 208 INTO CODTAB==CODABIA
|
||||
JOIN %NDO TO 33 ALIAS 209 INTO CODTAB==CODNOTESP1
|
||||
|
||||
END
|
||||
DESCRIPTION
|
||||
@ -28,7 +27,6 @@ BEGIN
|
||||
206@->* "Tabella aspetto beni"
|
||||
207@->* "Tabella causali di trasporto"
|
||||
208@->* "Tabella banche agenzia"
|
||||
209@->* "Tabella note documento"
|
||||
END
|
||||
|
||||
GENERAL
|
||||
@ -724,7 +722,7 @@ STRING 123 50 1
|
||||
BEGIN
|
||||
KEY "note documento"
|
||||
PROMPT 2 9 ""
|
||||
FIELD 209@->S0
|
||||
FIELD NOTE
|
||||
END
|
||||
|
||||
END
|
||||
|
@ -55,6 +55,7 @@ class TViswin;
|
||||
#define RIGA_SCONTI 'C'
|
||||
#define RIGA_OMAGGI 'O'
|
||||
#define RIGA_DESCRIZIONI 'D'
|
||||
#define RIGA_RETTIFICHE 'T'
|
||||
|
||||
#define MAX_IVA_SLICES 5
|
||||
|
||||
|
@ -19,8 +19,7 @@ TCodice_numerazione::TCodice_numerazione(const TRectype& rec)
|
||||
{ }
|
||||
|
||||
TCodice_numerazione::~TCodice_numerazione()
|
||||
{
|
||||
}
|
||||
{ }
|
||||
|
||||
const TString& TCodice_numerazione::tipo_doc(int i) const
|
||||
{
|
||||
@ -210,7 +209,7 @@ bool scontoexpr2perc(const char * exp, bool signal , TString & goodexp, real & v
|
||||
{
|
||||
if (signal) // Se richiesto segnala l'errore
|
||||
warning_box( "Espressione di sconto non valida. Errore sul carattere %c.", errorchar);
|
||||
val_perc = 1.0; // Azzera la sequenza di percentuali
|
||||
val_perc = UNO; // Azzera la sequenza di percentuali
|
||||
goodexp = "";
|
||||
}
|
||||
}
|
||||
@ -220,14 +219,12 @@ bool scontoexpr2perc(const char * exp, bool signal , TString & goodexp, real & v
|
||||
real prezzo_scontato(const real& prezzo, const char * sconto)
|
||||
{
|
||||
real scontato = prezzo;
|
||||
|
||||
if (sconto && *sconto)
|
||||
{
|
||||
TString80 exp;
|
||||
real val_sconto;
|
||||
scontoexpr2perc(sconto, FALSE , exp, val_sconto);
|
||||
|
||||
scontato = val_sconto * prezzo;
|
||||
scontato *= val_sconto;
|
||||
}
|
||||
return scontato;
|
||||
}
|
||||
|
@ -143,13 +143,14 @@ void TTipo_riga_documento::read_formule()
|
||||
_field_provv = profile.get("PROVV");
|
||||
_field_qta = profile.get("QTA"); // Non dare un default: ingannerebbe il tipo documento
|
||||
_field_qtaevasa = profile.get("QTAEVASA"); // Non dare un default: ingannerebbe il tipo documento
|
||||
_field_imposta = profile.get("IMPOSTA");
|
||||
_incrp = profile.get_int("VARP+");
|
||||
_decrp = profile.get_int("VARP-");
|
||||
|
||||
add_formula_if_needed(profile, _imponibile, "IMPONIBILE", "IMPORTO(1)");
|
||||
add_formula_if_needed(profile, _quant, "QUANT", "QUANT()");
|
||||
add_formula_if_needed(profile, _quant, "QUANT", "QUANT()");
|
||||
add_formula_if_needed(profile, _quantevasa, "QUANTEVASA", "QUANTEVASA()");
|
||||
add_formula_if_needed(profile, _qtares, "QTARES", "QTARES()");
|
||||
add_formula_if_needed(profile, _qtares, "QTARES", "QTARES()");
|
||||
}
|
||||
|
||||
TFormula_documento * TTipo_riga_documento::succ_formula(bool restart)
|
||||
@ -160,13 +161,13 @@ TFormula_documento * TTipo_riga_documento::succ_formula(bool restart)
|
||||
if (formula.not_empty())
|
||||
{
|
||||
char *expr = NULL;
|
||||
const int p = formula.find("=");
|
||||
const int p = formula.find('=');
|
||||
if (p > 0)
|
||||
{
|
||||
expr = (char *) (const char *) formula + p;
|
||||
expr = (char*)(const char*)formula + p;
|
||||
*expr = '\0'; expr++;
|
||||
}
|
||||
TFormula_documento * o = (TFormula_documento*)_formule_riga.objptr(formula);
|
||||
TFormula_documento* o = (TFormula_documento*)_formule_riga.objptr(formula);
|
||||
if (o == NULL)
|
||||
{
|
||||
o = new TFormula_documento(_riga, formula, expr);
|
||||
@ -262,7 +263,7 @@ const TSpesa_prest & TRiga_documento::spesa() const
|
||||
|
||||
const TCodiceIVA & TRiga_documento::iva(const char *codice)
|
||||
{
|
||||
TCodiceIVA * v = (TCodiceIVA *) _ive.objptr(codice);
|
||||
TCodiceIVA * v = (TCodiceIVA *)_ive.objptr(codice);
|
||||
if (v == NULL)
|
||||
{
|
||||
v = new TCodiceIVA(codice);
|
||||
@ -582,9 +583,23 @@ real TRiga_documento::iva(int ndec) const
|
||||
real zanicchi;
|
||||
if (!is_sconto())
|
||||
{
|
||||
if (ndec == AUTO_DECIMALS)
|
||||
ndec = doc().decimals();
|
||||
zanicchi = is_omaggio() ? iva_omaggio(ndec) : iva().imposta(imponibile(), ndec);
|
||||
if (is_omaggio())
|
||||
zanicchi = iva_omaggio(ndec);
|
||||
else
|
||||
{
|
||||
if (ndec == AUTO_DECIMALS)
|
||||
ndec = doc().decimals();
|
||||
const TString& field = tipo().imposta();
|
||||
if (field.not_empty())
|
||||
{
|
||||
zanicchi = get_real(field);
|
||||
zanicchi.round(ndec);
|
||||
}
|
||||
else
|
||||
{
|
||||
zanicchi = iva().imposta(imponibile(), ndec);
|
||||
}
|
||||
}
|
||||
}
|
||||
return zanicchi;
|
||||
}
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "vepriv.h"
|
||||
#include "veuml.h"
|
||||
|
||||
#include <cfven.h>
|
||||
#include "../cg/cg2103.h"
|
||||
#include "../cg/cglib01.h"
|
||||
#include "../mg/mglib.h"
|
||||
@ -106,20 +107,17 @@ TRiepilogo_iva& TRiepilogo_iva::copy(const TRiepilogo_iva& a)
|
||||
|
||||
TRiepilogo_iva::TRiepilogo_iva(const TCodiceIVA & codiva) : _codiva(codiva)
|
||||
{
|
||||
const TString & t =_codiva.tipo();
|
||||
const TString& t =_codiva.tipo();
|
||||
if (t == "VE")
|
||||
_tipo = 2;
|
||||
_tipo = 2; else
|
||||
if (t == "ES")
|
||||
_tipo = 4; else
|
||||
if (t == "NI")
|
||||
_tipo = 8; else
|
||||
if (t == "NS")
|
||||
_tipo = 16;
|
||||
else
|
||||
if (t == "ES")
|
||||
_tipo = 4;
|
||||
else
|
||||
if (t == "NI")
|
||||
_tipo = 8;
|
||||
else
|
||||
if (t == "NS")
|
||||
_tipo = 16;
|
||||
else
|
||||
_tipo = 1;
|
||||
_tipo = 1;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
@ -146,8 +144,8 @@ HIDDEN TAgenti_cache * _agenti = NULL;
|
||||
long TDocumento::_firm = -1;
|
||||
TAssoc_array TDocumento::_tipi;
|
||||
TAssoc_array TDocumento::_numerazioni;
|
||||
TString16 TDocumento::_codiva_spese;
|
||||
TString16 TDocumento::_codiva_bolli;
|
||||
TString4 TDocumento::_codiva_spese;
|
||||
TString4 TDocumento::_codiva_bolli;
|
||||
short TDocumento::_has_mag = 3;
|
||||
short TDocumento::_has_stat_ven = 3;
|
||||
short TDocumento::_has_provv = 3;
|
||||
@ -616,7 +614,7 @@ void TDocumento::copy_contents(const TDocumento& src)
|
||||
TRiga_documento& TDocumento::insert_row(int row, const char *tipo)
|
||||
{
|
||||
TRiga_documento & r = (TRiga_documento &) TMultiple_rectype::insert_row(row); // ok
|
||||
if (tipo)
|
||||
if (tipo && *tipo)
|
||||
r.set_tipo(tipo);
|
||||
return r;
|
||||
}
|
||||
@ -624,7 +622,7 @@ TRiga_documento& TDocumento::insert_row(int row, const char *tipo)
|
||||
TRiga_documento& TDocumento::new_row(const char *tipo)
|
||||
{
|
||||
TRiga_documento & r = (TRiga_documento&)TMultiple_rectype::new_row(); // ok
|
||||
if (tipo)
|
||||
if (tipo && *tipo)
|
||||
r.set_tipo(tipo);
|
||||
return r;
|
||||
}
|
||||
@ -796,10 +794,12 @@ void TDocumento::dirty_fields()
|
||||
f != NULL; f = (TDocumento_variable_field *) succ_variable_field())
|
||||
f->set_dirty();
|
||||
dirty_tabella_iva();
|
||||
for (int i = loaded_rows(); i > 0; i--)
|
||||
TRecord_array& righe = body(LF_RIGHEDOC);
|
||||
for (int i = righe.last_row(); i > 0; i = righe.pred_row(i))
|
||||
{
|
||||
TRiga_documento & r = (TRiga_documento &) row(i);
|
||||
r.dirty_fields(false);
|
||||
|
||||
}
|
||||
_dirty_deny = true;
|
||||
}
|
||||
@ -1681,9 +1681,9 @@ void TDocumento::update_tabella_iva()
|
||||
|
||||
if (table.items() > 0 || items == 0)
|
||||
{
|
||||
if (items == 0)
|
||||
table.destroy();
|
||||
return;
|
||||
if (items == 0)
|
||||
table.destroy();
|
||||
return;
|
||||
}
|
||||
|
||||
real tot_doc;
|
||||
@ -1692,8 +1692,8 @@ void TDocumento::update_tabella_iva()
|
||||
const bool doc_al_lordo = tipo().calcolo_lordo();
|
||||
const int ndec = decimals();
|
||||
const bool fatt_comm = tipo().fattura_commerciale();
|
||||
TString4 codiva_es;
|
||||
|
||||
|
||||
TString4 codiva_es;
|
||||
iva_esente(codiva_es);
|
||||
for (int i = items; i > 0; i--)
|
||||
{
|
||||
@ -1713,7 +1713,7 @@ void TDocumento::update_tabella_iva()
|
||||
const real imposta = doc_al_lordo ? ZERO :r.imposta(FALSE);
|
||||
// Aggiorna o aggiunge l'elemento se non esiste
|
||||
const TCodiceIVA & iva = r.iva();
|
||||
const TString16 cod(iva.codice());
|
||||
const TString4 cod(iva.codice());
|
||||
if (cod.not_empty())
|
||||
{
|
||||
TRiepilogo_iva * aliquota = (TRiepilogo_iva *) table.objptr(cod);
|
||||
@ -1889,6 +1889,7 @@ real TDocumento::imposta(bool spese, int ndec) const
|
||||
|
||||
real TDocumento::totale_doc() const
|
||||
{
|
||||
/* A pag.1 c'e' scritto di non fare cosi'
|
||||
const TString16 field(tipo().totale_doc());
|
||||
|
||||
if (field.not_empty())
|
||||
@ -1902,6 +1903,21 @@ real TDocumento::totale_doc() const
|
||||
r += bolli(real(r - ritenute()), ndec);
|
||||
return r;
|
||||
}
|
||||
*/
|
||||
// Cosi' e' piu' ordinato, strutturato e veloce
|
||||
real r;
|
||||
const TString& field = tipo().totale_doc();
|
||||
if (field.blank())
|
||||
{
|
||||
const int ndec = decimals();
|
||||
r = imponibile() + imposta();
|
||||
r += spese_incasso(ndec);
|
||||
r += bolli(real(r - ritenute()), ndec);
|
||||
}
|
||||
else
|
||||
r = get_real(field);
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
real TDocumento::totale_netto() const
|
||||
@ -2128,7 +2144,8 @@ TRecord_array& TDocumento::body(int logicnum) const
|
||||
const TString80 codcos(get(DOC_CODCOSTO));
|
||||
const bool order = is_ordine();
|
||||
|
||||
for (int i = r.rows(); i > 0; i--)
|
||||
for (int i = r.last_row(); i > 0; i = r.pred_row(i))
|
||||
|
||||
{
|
||||
TRectype& rec = r[i];
|
||||
TRecfield dcons(rec, RDOC_DATACONS);
|
||||
@ -2176,7 +2193,7 @@ void TDocumento::update_spese_aut(TString_array & spese_aut, bool preserve_old,
|
||||
sh->destroy(i - 1);
|
||||
}
|
||||
}
|
||||
TString16 cod_iva_cli;
|
||||
TString4 cod_iva_cli;
|
||||
const int nspese = spese_aut.items();
|
||||
if (nspese > 0)
|
||||
{
|
||||
@ -2247,9 +2264,14 @@ real TDocumento::calc_conai_qta(int type)
|
||||
{
|
||||
const char * const __conai_art_names[] = {"CONACC", "CONALL", "CONCAR", "CONPLA", "CONLEG", "CONVET"};
|
||||
const char * const __conai_cf_names[] = {"ESACC", "ESALL", "ESCAR", "ESPLA", "ESLEG", "ESVET"};
|
||||
const real perc_esenz = clifor().vendite().get_real(__conai_cf_names[type]);
|
||||
real perc_esenz = clifor().vendite().get_real(__conai_cf_names[type]);
|
||||
real qta = ZERO;
|
||||
|
||||
const TDate datadoc = get_date(DOC_DATADOC);
|
||||
const TDate dataes = clifor().vendite().get_date(CFV_DATAECONAI);
|
||||
|
||||
if (dataes.ok() && datadoc > dataes)
|
||||
perc_esenz = ZERO;
|
||||
|
||||
if (perc_esenz < 100.0)
|
||||
{
|
||||
const int nrows = physical_rows();
|
||||
@ -2259,15 +2281,14 @@ real TDocumento::calc_conai_qta(int type)
|
||||
TArticolo_giacenza * art = r.articolo();
|
||||
if (art != NULL)
|
||||
{
|
||||
const real row_qta = r.get_real(RDOC_QTA);
|
||||
qta += row_qta*art->get_real(__conai_art_names[type]);
|
||||
const TString16 um = r.get(RDOC_UMQTA);
|
||||
const real row_qta = art->convert_to_um(r.get_real(RDOC_QTA), NULL, um);
|
||||
|
||||
qta += row_qta*art->get_real(__conai_art_names[type]);
|
||||
}
|
||||
}
|
||||
if (qta > ZERO)
|
||||
{
|
||||
// qta *= (1 - perc_esenz/100.0);
|
||||
qta = qta * (100 - perc_esenz) / 100.0; // More precise!
|
||||
}
|
||||
}
|
||||
return qta;
|
||||
}
|
||||
@ -2322,7 +2343,7 @@ void TDocumento::update_conai()
|
||||
// Genera nuove righe
|
||||
if (cli_add_conai)
|
||||
{
|
||||
const TString16 cod_iva_cli = clifor().vendite().get("ASSFIS");
|
||||
const TString4 cod_iva_cli = clifor().vendite().get("ASSFIS");
|
||||
TSpesa_prest sp;
|
||||
|
||||
for (i = 0; i < 6; i++)
|
||||
@ -2389,7 +2410,7 @@ bool TDocumento::is_nota_credito() const
|
||||
swap = TRUE;
|
||||
else
|
||||
{
|
||||
const TString16 codcaus(tipo().causale());
|
||||
const TString4 codcaus(tipo().causale());
|
||||
if (codcaus.not_empty())
|
||||
{
|
||||
TLocalisamfile caus(LF_CAUSALI);
|
||||
@ -2464,4 +2485,4 @@ int TDocumento::tipo_riclassificato() const
|
||||
tipo_riclassificato = TTipo_documento::_fattura;
|
||||
}
|
||||
return tipo_riclassificato;
|
||||
}
|
||||
}
|
@ -806,25 +806,27 @@ TObject* TExpr_documento::dup() const
|
||||
TFormula_documento::TFormula_documento(TTipo_formula tipo, const char* codice, const char * expr, bool numexpr)
|
||||
: TRectype(LF_TABCOM), _expr(NULL)
|
||||
{
|
||||
_tab = tipo == _documento ? "FRD" : "FRR";
|
||||
settab(_tab);
|
||||
_tab.insert("%");
|
||||
settab(tipo == _documento ? "FRD" : "FRR");
|
||||
if (codice && *codice)
|
||||
read(codice, expr, numexpr);
|
||||
}
|
||||
|
||||
TFormula_documento::TFormula_documento(const TRectype& rec)
|
||||
: TRectype(rec), _expr(NULL)
|
||||
: TRectype(rec), _expr(NULL)
|
||||
{
|
||||
_tab = "%";
|
||||
_tab << rec.get("COD");
|
||||
const TTypeexp et = expr_type();
|
||||
_expr = new TExpr_documento(expr_string(), et);
|
||||
}
|
||||
|
||||
TObject* TFormula_documento::dup() const
|
||||
{
|
||||
return new TFormula_documento(*this);
|
||||
}
|
||||
|
||||
TFormula_documento::~TFormula_documento()
|
||||
{
|
||||
if (_expr) delete _expr;
|
||||
if (_expr)
|
||||
delete _expr;
|
||||
}
|
||||
|
||||
int TFormula_documento::read(const char* codice, const char * expr, bool numexpr)
|
||||
@ -846,7 +848,8 @@ int TFormula_documento::read(const char* codice, const char * expr, bool numexpr
|
||||
}
|
||||
else
|
||||
{
|
||||
TTable t(_tab);
|
||||
TString4 cod; cod << '%' << get("COD");
|
||||
TTable t(cod);
|
||||
err = TRectype::read(t);
|
||||
}
|
||||
|
||||
|
102
ve/velib04b.cpp
102
ve/velib04b.cpp
@ -8,6 +8,7 @@
|
||||
|
||||
#include "velib04.h"
|
||||
#include "../ca/calib01.h"
|
||||
|
||||
#include "../cg/cg2103.h"
|
||||
#include "../cg/cglib02.h"
|
||||
#include "../cg/cgsaldac.h"
|
||||
@ -64,6 +65,7 @@ bool TMovimentoPN_VE::detraibile(TRectype& rec) const
|
||||
int TMovimentoPN_VE::bill2pos(const TBill& conto, char tipo)
|
||||
{
|
||||
const int items = cg_items();
|
||||
|
||||
for (int i = 0; i < items; i++)
|
||||
{
|
||||
TRectype& s = cg(i);
|
||||
@ -442,7 +444,7 @@ bool TMovimentoPN_VE::movement_ok()
|
||||
int TMovimentoPN_VE::recalc_cg_rows(const TString & descr_cr, TCausale & caus)
|
||||
{
|
||||
const int righe = iva_items();
|
||||
TRectype& head = lfile().curr();
|
||||
const TRectype& head = curr();
|
||||
|
||||
set_caus(&caus);
|
||||
for (int i=0; i<righe; i++)
|
||||
@ -1114,8 +1116,8 @@ error_type TContabilizzazione::compile_head_mov(TDocumento& doc)
|
||||
key.add(doc.get(DOC_TIPOCF));
|
||||
key.add(doc.get(DOC_CODCF));
|
||||
const TRectype& cfven = cache().get(LF_CFVEN, key);
|
||||
|
||||
const TString& caus_cli = cfven.get(doc.is_nota_credito() ? CFV_CODCAUSNC : CFV_CODCAUS);
|
||||
|
||||
if (caus_cli.not_empty())
|
||||
codcaus = caus_cli; // La causale del cliente prevale su quella del tipo documento
|
||||
|
||||
@ -1192,6 +1194,9 @@ error_type TContabilizzazione::compile_head_mov(TDocumento& doc)
|
||||
TDate datacam(doc.get_date(DOC_DATACAMBIO));
|
||||
real cambio(doc.cambio());
|
||||
TString4 codval(doc.valuta()); codval.trim();
|
||||
|
||||
codval.trim();
|
||||
|
||||
if (!doc.in_valuta())
|
||||
{
|
||||
codval = "";
|
||||
@ -1249,6 +1254,7 @@ error_type TContabilizzazione::compile_head_mov(TDocumento& doc)
|
||||
const TString4 codpag(doc.get(DOC_CODPAG));
|
||||
if (sc_enabled(data_reg) || codpag.not_empty()) // La condizione di pagamento va controllata
|
||||
{ // se e' abilitato il saldaconto o se e' stata inserita
|
||||
|
||||
_cpg->put("CODTAB",codpag);
|
||||
if (_cpg->read() != NOERR)
|
||||
{
|
||||
@ -1296,7 +1302,7 @@ error_type TContabilizzazione::compile_head_mov(TDocumento& doc)
|
||||
|
||||
if (_caus->iva() == iva_acquisti)
|
||||
{
|
||||
const TString16 tdoc_cont(doc.tipo().totale_doc_cont());
|
||||
const TString& tdoc_cont = doc.tipo().totale_doc_cont();
|
||||
if (tdoc_cont.not_empty())
|
||||
totdocval.set_num(doc.get_real(tdoc_cont));
|
||||
|
||||
@ -1324,10 +1330,9 @@ error_type TContabilizzazione::compile_head_mov(TDocumento& doc)
|
||||
if (_caus->valintra() && codvali.empty())
|
||||
{
|
||||
codvali = TCurrency::get_firm_val();
|
||||
|
||||
if (codvali.empty())
|
||||
codvali = TCurrency::get_euro_val();
|
||||
cambioi = 1.00;
|
||||
codvali = TCurrency::get_euro_val();
|
||||
cambioi = UNO;
|
||||
}
|
||||
|
||||
mov_rec.put(MOV_CODVALI,codval);
|
||||
@ -1528,8 +1533,8 @@ error_type TContabilizzazione::compile_head_mov_re(TDocumento& doc)
|
||||
}
|
||||
|
||||
// Dati del cliente...
|
||||
TString16 tipocf(doc.get(DOC_TIPOCF));
|
||||
long codcf = doc.get_long(DOC_CODCF);
|
||||
const TString4 tipocf(doc.get(DOC_TIPOCF));
|
||||
const long codcf = doc.get_long(DOC_CODCF);
|
||||
TString80 occas;
|
||||
{
|
||||
TLocalisamfile& cli_file = _clifo->lfile();
|
||||
@ -1817,22 +1822,24 @@ error_type TContabilizzazione::add_spese_inbo(TDocumento& doc, const int ndec)
|
||||
real tot_netto, sp_incasso, sp_bolli;
|
||||
real iva_sp_incasso, iva_sp_bolli;
|
||||
const real rit = doc.ritenute();
|
||||
bool is_cli = doc.get_char(DOC_TIPOCF) == 'C';
|
||||
const bool is_cli = doc.get_char(DOC_TIPOCF) == 'C';
|
||||
// Aggiunge le spese d'incasso
|
||||
tot_netto = doc.totale_netto();
|
||||
sp_incasso = doc.spese_incasso(ndec, _netto);
|
||||
TString16 codiva_es;
|
||||
TString4 codiva_es;
|
||||
|
||||
doc.iva_esente(codiva_es);
|
||||
|
||||
if (sp_incasso != 0.0)
|
||||
if (!sp_incasso.is_zero())
|
||||
calculate_spese(sp_incasso,iva_sp_incasso,ndec,true,is_cli, codiva_es.not_empty() ? codiva_es : doc.codiva_spese(), doc);
|
||||
|
||||
|
||||
// Aggiunge le spese bolli
|
||||
tot_netto += sp_incasso + iva_sp_incasso - rit;
|
||||
sp_bolli = doc.bolli(tot_netto, ndec, _netto);
|
||||
if (sp_bolli != 0)
|
||||
if (!sp_bolli.is_zero())
|
||||
calculate_spese(sp_bolli, iva_sp_bolli, ndec, false, is_cli, codiva_es.not_empty() ? codiva_es : doc.codiva_bolli(), doc);
|
||||
|
||||
|
||||
return _error;
|
||||
}
|
||||
@ -1840,22 +1847,22 @@ error_type TContabilizzazione::add_spese_inbo(TDocumento& doc, const int ndec)
|
||||
// Aggiorna le righe di sconto (importo o a percentuale)
|
||||
error_type TContabilizzazione::adjust_sconto_rows(TDocumento& doc)
|
||||
{
|
||||
TAssoc_array aa = doc.tabella_iva(); // no reference
|
||||
const TRiepilogo_iva* riep;
|
||||
TString16 cod; // Codice IVA corrente
|
||||
real sconto;
|
||||
const int ndec = doc.decimals();
|
||||
|
||||
if (!_sco_imp_bill.ok() || !_sco_perc_bill.ok())
|
||||
{
|
||||
_error = sconto_error;
|
||||
return _error;
|
||||
}
|
||||
|
||||
TAssoc_array aa = doc.tabella_iva(); // no reference
|
||||
|
||||
real sconto;
|
||||
const int ndec = doc.decimals();
|
||||
|
||||
// Scorre tutti gli elementi della tabella IVA del documento (elementi per codice iva)
|
||||
for (riep = (TRiepilogo_iva*) aa.first_item(); riep != NULL; riep = (TRiepilogo_iva*) aa.succ_item())
|
||||
for (const TRiepilogo_iva* riep = (const TRiepilogo_iva*) aa.first_item();
|
||||
riep != NULL; riep = (const TRiepilogo_iva*) aa.succ_item())
|
||||
{
|
||||
cod = riep->cod_iva().codice(); // Codice IVA
|
||||
const TString4 cod = riep->cod_iva().codice(); // Codice IVA corrente
|
||||
for (int i = 0; i < 2; i++) // Ciclo per sconto a percentuale (i == 0) e ad importo (i == 1)
|
||||
{
|
||||
//Importo sconto (sconto_perc() o sconto_imp())
|
||||
@ -1863,7 +1870,7 @@ error_type TContabilizzazione::adjust_sconto_rows(TDocumento& doc)
|
||||
//Somma alla riga corrispondente o la crea se non esiste gia'
|
||||
//I conti per aggiustare l'iva vengono fatti in adjust_iva_rows()
|
||||
const bool perc = i == 0;
|
||||
TBill& conto = perc ? _sco_perc_bill : _sco_imp_bill;
|
||||
const TBill& conto = perc ? _sco_perc_bill : _sco_imp_bill;
|
||||
sconto = perc ? -riep->sconto_perc() : -riep->sconto_imp();
|
||||
if (sconto != ZERO)
|
||||
{
|
||||
@ -1967,7 +1974,7 @@ error_type TContabilizzazione::adjust_iva_rows(TDocumento& doc)
|
||||
|
||||
for (i = 0; i < items; i++)
|
||||
{
|
||||
TRectype& ie = _movimento->iva(i);
|
||||
const TRectype& ie = _movimento->iva(i);
|
||||
if (ie.get(RMI_CODIVA) == codiva) // Se il codice IVA e' uguale
|
||||
{
|
||||
gd_iva.add(ie.get_real(RMI_IMPOSTA)); // Aggiunge al TGeneric_distrib l'imposta corrente
|
||||
@ -2003,7 +2010,7 @@ error_type TContabilizzazione::adjust_iva_rows(TDocumento& doc)
|
||||
{
|
||||
TRectype& rigaiva = _movimento->iva(0);
|
||||
|
||||
TCodiceIVA iva(rigaiva.get(RMI_CODIVA));
|
||||
const TCodiceIVA iva(rigaiva.get(RMI_CODIVA));
|
||||
|
||||
if (_caus->intra())
|
||||
{
|
||||
@ -2020,10 +2027,9 @@ error_type TContabilizzazione::adjust_iva_rows(TDocumento& doc)
|
||||
}
|
||||
if (_caus->intra())
|
||||
{
|
||||
real ritfis = ZERO;
|
||||
real ritfis;
|
||||
for (int i = 0; i < items; i++)
|
||||
ritfis += _movimento->iva(i).get_real(RMI_IMPOSTA);
|
||||
|
||||
_movimento->curr().put(MOV_RITFIS, ritfis);
|
||||
}
|
||||
}
|
||||
@ -2039,7 +2045,7 @@ error_type TContabilizzazione::create_iva_rows(TDocumento& doc)
|
||||
TRectype& head = _movimento->curr();
|
||||
TToken_string key;
|
||||
TString_array key_arr;
|
||||
TString16 codiva;
|
||||
TString4 codiva;
|
||||
TBill cur_conto;
|
||||
char tipo;
|
||||
int gruppo;
|
||||
@ -2049,17 +2055,15 @@ error_type TContabilizzazione::create_iva_rows(TDocumento& doc)
|
||||
const long numreg = head.get_long(MOV_NUMREG);
|
||||
real cambio = head.get_real(MOV_CAMBIO);
|
||||
real imponibile,imposta;
|
||||
TString16 valuta(doc.valuta());
|
||||
const TString4 valuta(doc.valuta());
|
||||
|
||||
_righe_iva->get_keys(key_arr);
|
||||
key_arr.sort();
|
||||
|
||||
TRectype & cur = (TRectype &) (*_righe_iva)[key_arr.row(0)];
|
||||
|
||||
for (int i = 0, nr = 0; i < items; i++)
|
||||
{
|
||||
key = key_arr.row(i);
|
||||
cur = (TRectype &) (*_righe_iva)[key];
|
||||
const TRectype& cur = (const TRectype &)(*_righe_iva)[key];
|
||||
codiva = cur.get(RMI_CODIVA);
|
||||
tipo = cur.get_char(RMI_TIPOC);
|
||||
gruppo = cur.get_int(RMI_GRUPPO);
|
||||
@ -2107,14 +2111,14 @@ error_type TContabilizzazione::create_total_doc_row(TDocumento& doc)
|
||||
// Crea la riga contabile di totale documento
|
||||
{
|
||||
TRectype& rec_cg = _movimento->cg(0);
|
||||
TRectype& head = _movimento->lfile().curr();
|
||||
TRectype& head = _movimento->curr();
|
||||
const int annoes = head.get_int(MOV_ANNOES);
|
||||
const long numreg = head.get_long(MOV_NUMREG);
|
||||
TDate datareg(head.get_date(MOV_DATAREG));
|
||||
const TDate datareg(head.get_date(MOV_DATAREG));
|
||||
real totdoc(head.get_real(MOV_TOTDOC));
|
||||
|
||||
TLocalisamfile& cli_file = _clifo->lfile();
|
||||
TString16 tipocf(cli_file.get(CLI_TIPOCF));
|
||||
const TRectype& cli_file = _clifo->curr();
|
||||
char tipocf = cli_file.get_char(CLI_TIPOCF);
|
||||
long codcf = cli_file.get_long(CLI_CODCF);
|
||||
int gruppo = 0, conto = 0;
|
||||
|
||||
@ -2122,7 +2126,7 @@ error_type TContabilizzazione::create_total_doc_row(TDocumento& doc)
|
||||
|
||||
if (search_clifo_bill(catven) == no_error)
|
||||
{
|
||||
tipocf[0] = _co_cliente.tipo();
|
||||
tipocf = _co_cliente.tipo();
|
||||
gruppo = _co_cliente.gruppo();
|
||||
conto = _co_cliente.conto();
|
||||
codcf = _co_cliente.sottoconto();
|
||||
@ -2136,7 +2140,7 @@ error_type TContabilizzazione::create_total_doc_row(TDocumento& doc)
|
||||
TConto contro;
|
||||
if (_movimento->iva_items() > 0)
|
||||
{
|
||||
TRectype& first_iva_row = _movimento->iva(0);
|
||||
const TRectype& first_iva_row = _movimento->iva(0);
|
||||
contro.get(first_iva_row);
|
||||
}
|
||||
|
||||
@ -2149,7 +2153,7 @@ error_type TContabilizzazione::create_total_doc_row(TDocumento& doc)
|
||||
contro.put(rec_cg, true);
|
||||
|
||||
rec_cg.put(RMV_IMPORTO,totdoc); rec_cg.put(RMV_ROWTYPE,"T");
|
||||
if (tipocf == " ")
|
||||
if (tipocf <= ' ')
|
||||
{
|
||||
head.zero(MOV_TIPO);
|
||||
head.zero(MOV_CODCF);
|
||||
@ -2197,8 +2201,9 @@ error_type TContabilizzazione::compile_rows_mov(TDocumento& doc)
|
||||
{
|
||||
const char tipo = r.tipo().tipo();
|
||||
// Le righe omaggio senza addebito IVA vanno saltate
|
||||
const bool riga_omaggio = tipo == 'O' && r.get_bool(RDOC_ADDIVA);
|
||||
if ((tipo != RIGA_DESCRIZIONI && tipo != RIGA_SCONTI) || riga_omaggio)
|
||||
const bool riga_omaggio = tipo == RIGA_OMAGGI && r.get_bool(RDOC_ADDIVA);
|
||||
if ((tipo != RIGA_DESCRIZIONI && tipo != RIGA_SCONTI && tipo != RIGA_RETTIFICHE) || riga_omaggio)
|
||||
|
||||
{
|
||||
const bool spesa = r.tipo().tipo() == RIGA_SPESEDOC;
|
||||
char tipo_rit = '\0';
|
||||
@ -2328,7 +2333,7 @@ error_type TContabilizzazione::compile_rows_mov(TDocumento& doc)
|
||||
}
|
||||
}
|
||||
|
||||
TRegistro & registro = _caus->reg();
|
||||
const TRegistro& registro = _caus->reg();
|
||||
const bool iva_mov = registro.ok();
|
||||
|
||||
if (!iva_mov)
|
||||
@ -2336,7 +2341,7 @@ error_type TContabilizzazione::compile_rows_mov(TDocumento& doc)
|
||||
const int cgitems = _movimento->cg_items();
|
||||
for (int i = cgitems - 1 ; i >= 0; i--)
|
||||
{
|
||||
TRectype & rec_cg = _movimento->cg(i);
|
||||
TRectype& rec_cg = _movimento->cg(i);
|
||||
rec_cg.zero(RMV_ROWTYPE);
|
||||
}
|
||||
_movimento->destroy_iva_row();
|
||||
@ -2344,9 +2349,10 @@ error_type TContabilizzazione::compile_rows_mov(TDocumento& doc)
|
||||
return _error;
|
||||
}
|
||||
|
||||
error_type TContabilizzazione::compile_rows_mov_re(TDocumento& doc)
|
||||
// Compila le righe
|
||||
error_type TContabilizzazione::compile_rows_mov_re(TDocumento& doc)
|
||||
{
|
||||
|
||||
const int rows = doc.rows();
|
||||
const int ndec = doc.decimals();
|
||||
|
||||
@ -2357,12 +2363,13 @@ error_type TContabilizzazione::compile_rows_mov_re(TDocumento& doc)
|
||||
const TString4 tiporiga = r.get(RDOC_TIPORIGA);
|
||||
if (valid_row_type(tiporiga)) // controlla l'esistenza della riga
|
||||
{
|
||||
TBill conto;
|
||||
const char tipo = r.tipo().tipo();
|
||||
// Le righe omaggio senza addebito IVA vanno saltate
|
||||
const bool riga_omaggio = tipo == 'O' && r.get_bool(RDOC_ADDIVA);
|
||||
if ((tipo != 'D' && tipo != 'C') && !riga_omaggio)
|
||||
const bool riga_omaggio = tipo == RIGA_OMAGGI && r.get_bool(RDOC_ADDIVA);
|
||||
if ((tipo != RIGA_DESCRIZIONI && tipo != RIGA_SCONTI && tipo != RIGA_RETTIFICHE) && !riga_omaggio)
|
||||
|
||||
{
|
||||
TBill conto;
|
||||
search_costo_ricavo(conto,r); // l'errore eventuale viene settato qui dentro
|
||||
if (good())
|
||||
_righe_iva->add(r, conto);
|
||||
@ -2415,7 +2422,7 @@ error_type TContabilizzazione::change_doc_status(TDocumento& doc)
|
||||
error_type TContabilizzazione::write_scadenze(TDocumento& doc)
|
||||
// Scrive le scadenze. Liberamente tratto da cg2104.cpp.
|
||||
{
|
||||
TRectype& head = _movimento->curr();
|
||||
const TRectype& head = _movimento->curr();
|
||||
const long nreg = head.get_long(MOV_NUMREG);
|
||||
|
||||
// const real change(head.get_real(MOV_CAMBIO));
|
||||
@ -3561,7 +3568,7 @@ void TContabilizzazione::aggiorna_saldi(TSaldo_agg& saldo, TMovimentoPN& mv, boo
|
||||
for (int i = 0; i < cgitems; i++)
|
||||
{
|
||||
const TRectype& r = mv.cg(i);
|
||||
TBill conto; conto.get(r);
|
||||
const TBill conto(r);
|
||||
TImporto import(r.get_char(RMV_SEZIONE), r.get_real(RMV_IMPORTO));
|
||||
saldo.aggiorna(conto, import, save);
|
||||
}
|
||||
@ -3827,6 +3834,7 @@ bool TContabilizzazione::elabora(TLista_documenti& doc_in, TLista_documenti& doc
|
||||
p.links().add("Movimento Analitico |r|w", 1);
|
||||
p.setlinkhandler(link_handler);
|
||||
_viswin = new TViswin(NULL, TR("Contabilizzazione documenti"), false, true, true);
|
||||
|
||||
_viswin->open_modal();
|
||||
|
||||
const clock_t start_time = clock();
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <automask.h>
|
||||
#include <colmask.h>
|
||||
#include <dongle.h>
|
||||
#include <execp.h>
|
||||
#include <modaut.h>
|
||||
@ -27,6 +28,7 @@
|
||||
#include "doc.h"
|
||||
#include "rdoc.h"
|
||||
|
||||
|
||||
class TOriginal_row_mask : public TAutomask
|
||||
{
|
||||
|
||||
@ -999,6 +1001,7 @@ void TDocumento_mask::mask2doc()
|
||||
if (fr)
|
||||
fr->write(f.get(), doc());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
TVariable_mask* TDocumento_mask::riga_mask(int numriga)
|
||||
@ -3106,4 +3109,4 @@ bool TDocumento_mask::codval_handler( TMask_field& f, KEY key )
|
||||
m.sfield(F_SHEET).force_update(); // Aggiorna punti decimali degli importi
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
}
|
@ -466,7 +466,6 @@ ENDIF
|
||||
DISPLAY "Descrizione@50" S0
|
||||
OUTPUT FR_CODPRS CODTAB
|
||||
OUTPUT FR_DESCRPRS S0
|
||||
OUTPUT FR_PREZZO R0
|
||||
OUTPUT FR_QTA R1
|
||||
OUTPUT FR_PERCSP R2
|
||||
OUTPUT FR_UMQTASP S7
|
||||
|
10
ve/verig15.ini
Executable file
10
ve/verig15.ini
Executable file
@ -0,0 +1,10 @@
|
||||
#Profilo di riga tipo spese imballo
|
||||
[MAIN]
|
||||
CALCOLI=*
|
||||
CAMPICALC=
|
||||
IMPONIBILE=0
|
||||
IMPOSTA=PREZZO
|
||||
|
||||
[HANDLERS]
|
||||
NHANDLER = 0
|
||||
|
17
ve/verig15.uml
Executable file
17
ve/verig15.uml
Executable file
@ -0,0 +1,17 @@
|
||||
#include "verigdef.h"
|
||||
|
||||
#define FULL_SCREEN
|
||||
|
||||
#define MASK_TITLE1 "Rettifiche IVA"
|
||||
#define PAGE_2
|
||||
|
||||
DEFINE_FIELD(DESCR)
|
||||
DEFINE_FIELD(VALORE)
|
||||
DEFINE_FIELD(CODIVA)
|
||||
F_POS(CODIVA, 2, 13,"Cod. IVA " )
|
||||
DEFINE_FIELD(DESIVA)
|
||||
F_POS(DESIVA, 22, 13,"" )
|
||||
DEFINE_FIELD(CODCMS)
|
||||
|
||||
#include "verig.uml"
|
||||
|
@ -85,3 +85,4 @@ TRI|10|Risorse|||||||R||||||||||||||||||||||||||||||||||||||||||||| | | | | | |
|
||||
TRI|11|Attrezzature|||||||A||||||||||||||||||||||||||||||||||||||||||||| | | | | | | | | | |
|
||||
TRI|13|Merce con provvigione fissa|||||||M||||||||||||||||||||||||||||||||||||||||||||| | | | | | | | | | |
|
||||
TRI|14|Merce con ricerca per codice corrispondente|||||||M||||||||||||||||||||||||||||||||||||||||||||| | | | | | | | | | |
|
||||
TRI|15|Rettifica IVA|||||||T||||||||||||||||||||||||||||||||||||||||||||| | | | | | | | | | |
|
||||
|
@ -10,7 +10,7 @@ declare
|
||||
|
||||
NUMBER nHandle, nResult, nReinstall, nNewInstall;
|
||||
STRING szText, szModifiedPath, szDongle, szInstType,szReinstallPath,szCampoIni;
|
||||
BOOL bSetupStandard, bInstallModules, bInstallEnv, bInstallFirm, bInstallDemo, bInstallDemoData, bInstallNetWrk, bInstallNetWrkChk;
|
||||
BOOL bSetupStandard, bInstallModules, bInstallEnv, bInstallFirm, bInstallDemo, bInstallDemoData, bInstallNetWrkChk;
|
||||
BOOL bInstallData, bInstallPrg, bUseDongleServer, bInstallServer, bXPServicesInstalled;
|
||||
// Function declarations.
|
||||
prototype _SetupScreen();
|
||||
@ -40,16 +40,17 @@ Step_start:
|
||||
|
||||
#define SPACE_REQUIRED 120000 // Disk space in bytes.
|
||||
#ifdef __DEMO__
|
||||
#define APP_NAME "OneRed Demo"
|
||||
#define PROGRAM_FOLDER_NAME "OneRed Demo"
|
||||
#define APP_NAME "Campo Demo"
|
||||
#define PROGRAM_FOLDER_NAME "Campo Demo"
|
||||
#else
|
||||
#define APP_NAME "OneRed"
|
||||
#define PROGRAM_FOLDER_NAME "OneRed"
|
||||
#define APP_NAME "Campo"
|
||||
#define PROGRAM_FOLDER_NAME "Campo"
|
||||
#endif
|
||||
#define APPBASE_PATH "\\"
|
||||
#define COMPANY_NAME "A.G.A. Informatica srl"
|
||||
#define PRODUCT_NAME "OneRed"
|
||||
#define PRODUCT_NAME "Campo"
|
||||
#define PRODUCT_VERSION "2.2 "
|
||||
|
||||
#define DEINSTALL_KEY "SampleDeinstKey"
|
||||
#define PRODUCT_KEY "ba0.exe"
|
||||
#define DATATYPE_FILE "datatype."
|
||||
@ -124,23 +125,17 @@ Step_chooseDongleServer:
|
||||
goto Step_choosedata;
|
||||
endif;
|
||||
|
||||
Step_chooseNTDongle:
|
||||
_SelectDongleXP(nDirection);
|
||||
if nDirection=BACK then
|
||||
goto Step_chooseDongleServer;
|
||||
endif;
|
||||
//Step_chooseNTDongle:
|
||||
// _SelectDongleXP(nDirection);
|
||||
// if nDirection=BACK then
|
||||
// goto Step_chooseDongleServer;
|
||||
// endif;
|
||||
|
||||
Step_whereDongleServer:
|
||||
_FindAutoStartFolder(nDirection);
|
||||
_SelectDongleServerDestination(nDirection);
|
||||
if nDirection=BACK then
|
||||
goto Step_chooseNTDongle;
|
||||
endif;
|
||||
|
||||
if nDirection=NEXT then
|
||||
if bInstallNetWrk then
|
||||
goto Step_installnet;
|
||||
endif;
|
||||
goto Step_chooseDongleServer;
|
||||
endif;
|
||||
|
||||
// ***********************************
|
||||
@ -194,34 +189,34 @@ Step_LaunchServer:
|
||||
exit;
|
||||
|
||||
// ***********************************
|
||||
// * network installation (OneRed WST)
|
||||
// * network installation
|
||||
|
||||
Step_installnet:
|
||||
_ConfirmInstallation(nDirection);
|
||||
if nDirection=BACK then
|
||||
goto Step_whereDongleServer;
|
||||
endif;
|
||||
//Step_installnet:
|
||||
// _ConfirmInstallation(nDirection);
|
||||
// if nDirection=BACK then
|
||||
// goto Step_whereDongleServer;
|
||||
// endif;
|
||||
|
||||
Step_installKeyServices:
|
||||
_InstallDongleXP(nDirection);
|
||||
if nDirection=BACK then
|
||||
goto Step_whereDongleServer;
|
||||
endif;
|
||||
//Step_installKeyServices:
|
||||
// _InstallDongleXP(nDirection);
|
||||
// if nDirection=BACK then
|
||||
// goto Step_whereDongleServer;
|
||||
// endif;
|
||||
|
||||
nStep_installData:
|
||||
_InstallData(nDirection);
|
||||
if (nDirection=BACK) then
|
||||
goto Step_whereDongleServer;
|
||||
endif;
|
||||
//nStep_installData:
|
||||
// _InstallData(nDirection);
|
||||
// if (nDirection=BACK) then
|
||||
// goto Step_whereDongleServer;
|
||||
// endif;
|
||||
|
||||
Step_installwrkst:
|
||||
_NewNetWorkPlace(nDirection);
|
||||
if (nDirection=BACK) then
|
||||
goto Step_whereDongleServer;
|
||||
endif;
|
||||
//Step_installwrkst:
|
||||
// _NewNetWorkPlace(nDirection);
|
||||
// if (nDirection=BACK) then
|
||||
// goto Step_whereDongleServer;
|
||||
// endif;
|
||||
|
||||
_ProgramEpilogue();
|
||||
exit;
|
||||
// _ProgramEpilogue();
|
||||
// exit;
|
||||
|
||||
#include "setup1.rul"
|
||||
#include "setup2.rul"
|
||||
@ -229,4 +224,3 @@ Step_installwrkst:
|
||||
#include "setup4.rul"
|
||||
#include "winsub.rul"
|
||||
#include "sddialog.rul"
|
||||
|
||||
|
@ -41,11 +41,10 @@ end;
|
||||
function _SelectSetupMode(nRetv )
|
||||
|
||||
STRING szMsg[512];
|
||||
BOOL zInstallDemo,zInstallNetWrk,zInstallNetWrkChk;
|
||||
BOOL zInstallDemo,zInstallNetWrkChk;
|
||||
begin
|
||||
|
||||
zInstallDemo = bInstallDemo;
|
||||
zInstallNetWrk = bInstallNetWrk;
|
||||
zInstallNetWrkChk = bInstallNetWrkChk;
|
||||
#ifdef __DEMO__
|
||||
|
||||
@ -70,9 +69,7 @@ begin
|
||||
"&in postazione singola (o server)",
|
||||
bInstallEnv,
|
||||
"in rete con &programmi su disco &locale",
|
||||
bInstallNetWrkChk,
|
||||
"in rete con programmi su disco di &rete",
|
||||
bInstallNetWrk
|
||||
bInstallNetWrkChk
|
||||
);
|
||||
endif;
|
||||
if bInstallNetWrkChk then
|
||||
@ -80,15 +77,11 @@ begin
|
||||
endif;
|
||||
#endif
|
||||
|
||||
if (( zInstallDemo!=bInstallDemo) || (zInstallNetWrk!=bInstallNetWrk)|| (zInstallNetWrkChk!=bInstallNetWrkChk) ) then
|
||||
if (( zInstallDemo!=bInstallDemo) || (zInstallNetWrkChk!=bInstallNetWrkChk) ) then
|
||||
if bInstallDemo then
|
||||
bInstallPrg = TRUE;
|
||||
bInstallData=TRUE;
|
||||
bInstallDemoData=TRUE;
|
||||
elseif bInstallNetWrk then
|
||||
bInstallPrg = FALSE;
|
||||
bInstallData= FALSE;
|
||||
bInstallDemoData=FALSE;
|
||||
else
|
||||
bInstallPrg = TRUE;
|
||||
endif;
|
||||
@ -117,7 +110,8 @@ begin
|
||||
|
||||
//se non esiste una precedente installazione->nuova installazione;necessiterá di un path di default per l'installazione
|
||||
if (szConfigPath = "") then
|
||||
bNuovaInst = ! _FindExistingInst(szConfigPath);
|
||||
// bNuovaInst = ! _FindExistingInst(szConfigPath); //ricerca precedenti installazioni
|
||||
bNuovaInst = TRUE; //se non e' stato scelto un aggiornamento e' comunque una nuova installazione!
|
||||
if bNuovaInst then
|
||||
bInstallData=TRUE;
|
||||
szConfigPath= DEFAULT_LOCALPATH;
|
||||
@ -194,20 +188,16 @@ begin
|
||||
_IsNetworkDrive(szDataPath, bRemoteData);
|
||||
|
||||
bInstallNetWrkChk = FALSE;
|
||||
bInstallNetWrk = FALSE;
|
||||
bInstallEnv = ! bRemoteExe;
|
||||
|
||||
//distingue tra dati in remoto e campo wst
|
||||
if (bRemoteData) then
|
||||
bInstallNetWrk = bRemoteExe;
|
||||
bInstallNetWrkChk = !bRemoteExe;
|
||||
endif;
|
||||
|
||||
|
||||
//non esiste campo.ini -> e' una installazione
|
||||
else
|
||||
//path dei dati in caso di installazione non WST
|
||||
if (!bInstallNetWrk) then
|
||||
szDataPath = szConfigPath ^ "DATI\\";
|
||||
endif;
|
||||
szDataPath = szConfigPath ^ "DATI\\";
|
||||
|
||||
endif;
|
||||
|
||||
@ -217,15 +207,10 @@ begin
|
||||
NumToStr(szPar, nNewInstall);
|
||||
endif;
|
||||
|
||||
//se e' una installazione di rete scrivo su campo.stp l'indirizzo del campo.ini utilizzato
|
||||
if (bInstallNetWrk) then
|
||||
WriteProfString("C:\\Campo.stp", szPar, "CampoIni", szCampoIni);
|
||||
else
|
||||
//in caso non sia una installazione di rete non devo scrivere nulla sul campo.stp...
|
||||
//scrive su campo.stp..
|
||||
WriteProfString("C:\\Campo.stp", szPar, "CampoIni", "");
|
||||
//..e l'application path e' lo stesso del campo.ini (ovvio,ba0.exe e' assieme a campo.ini)
|
||||
szAppPath = szConfigPath;
|
||||
endif;
|
||||
|
||||
return;
|
||||
end;
|
||||
@ -261,8 +246,8 @@ begin
|
||||
repeat
|
||||
|
||||
// Windows 95/98/ME or NT/2000/XP platforms
|
||||
if (bInstallNetWrk || bInstallNetWrkChk) then
|
||||
szMsg= "Setup installera' la postazione di lavoro in rete.\nE' possibile installare anche l'area dati, il server di rete per le chiavi di protezione.";
|
||||
if (bInstallNetWrkChk) then
|
||||
szMsg= "Setup installera' la postazione di lavoro.\nE' possibile installare anche l'area dati, il server di rete per le chiavi di protezione.";
|
||||
nRetv = AskOptions(NONEXCLUSIVE,szMsg,
|
||||
"Installa l'area dati", bInstallData ,
|
||||
"Installa i Server", bInstallServer
|
||||
@ -277,7 +262,7 @@ begin
|
||||
);
|
||||
endif;
|
||||
|
||||
until nRetv!=NEXT || bInstallData || bInstallPrg || bInstallNetWrk || bInstallServer;
|
||||
until nRetv!=NEXT || bInstallData || bInstallPrg || bInstallServer;
|
||||
|
||||
//viene aggiornato il file campo.stp con i valori relativi all'installazione del master server e del server di chiavi
|
||||
if (nReinstall > 0) then
|
||||
@ -308,27 +293,19 @@ function _SelectNetConfig(nDirection )
|
||||
NUMBER nHandle;
|
||||
BOOL ok;
|
||||
begin
|
||||
if ((!bInstallNetWrk) && !(bInstallNetWrkChk && bInstallPrg)) then
|
||||
if (!(bInstallNetWrkChk && bInstallPrg)) then
|
||||
return;
|
||||
endif;
|
||||
if (bInstallNetWrk) then
|
||||
szNetAppPath=szAppPath;
|
||||
else
|
||||
if (szAppRefPath = "") then
|
||||
GetProfString(szCampoIni, "Main", "Program", szAppRefPath);
|
||||
endif;
|
||||
szNetAppPath=szAppRefPath;
|
||||
endif;
|
||||
if (bInstallNetWrk) then
|
||||
szText = szText + "Inserire il percorso completo del direttorio di rete che contiene i files del programma. ";
|
||||
szText = szText + "Se tali files mancano, installarli secondo la modalita' 'postazione singola'. ";
|
||||
szText = szText + "Le installazioni sulle altre macchine della rete andranno effettuate secondo la modalita' 'postazione di rete'.";
|
||||
else
|
||||
szText = szText + "Inserire il percorso completo del direttorio di rete che contiene i files del programma. ";
|
||||
szText = szText + "Se tali files mancano, installarli secondo la modalita' 'postazione singola'. ";
|
||||
szText = szText + "Ogni postazione di rete verifichera' eventuali aggiornamenti di questa installazione ";
|
||||
szText = szText + "aggiornandosi automaticamente.";
|
||||
|
||||
if (szAppRefPath = "") then
|
||||
GetProfString(szCampoIni, "Main", "Program", szAppRefPath);
|
||||
endif;
|
||||
szNetAppPath=szAppRefPath;
|
||||
|
||||
szText = szText + "Inserire il percorso completo del direttorio di rete che contiene i files del programma. ";
|
||||
szText = szText + "Se tali files mancano, installarli secondo la modalita' 'postazione singola'. ";
|
||||
szText = szText + "Ogni postazione di rete verifichera' eventuali aggiornamenti di questa installazione ";
|
||||
szText = szText + "aggiornandosi automaticamente.";
|
||||
|
||||
if (szNetAppPath = "") then
|
||||
szNetAppPath = DEFAULT_NETPATH;
|
||||
@ -352,18 +329,10 @@ begin
|
||||
ok = TRUE;
|
||||
endif;
|
||||
endwhile;
|
||||
if (bInstallNetWrk) then
|
||||
szAppPath = szNetAppPath;
|
||||
if (nReinstall > 0) then
|
||||
NumToStr(szPar, nReinstall);
|
||||
else
|
||||
NumToStr(szPar, nNewInstall);
|
||||
endif;
|
||||
WriteProfString("C:\\Campo.stp", szPar, "Program", szAppPath);
|
||||
else
|
||||
szAppRefPath =szNetAppPath;
|
||||
StrRemoveLastSlash(szAppRefPath);
|
||||
endif;
|
||||
|
||||
szAppRefPath =szNetAppPath;
|
||||
StrRemoveLastSlash(szAppRefPath);
|
||||
|
||||
end;
|
||||
|
||||
//________________________________________________________________________________________________________________________
|
||||
@ -377,7 +346,7 @@ function _SelectDataDestination(nRetv)
|
||||
begin
|
||||
// ricontrolla la presenza di una installazione
|
||||
// e determina la posizione della directory "DATI"
|
||||
if bInstallData || bInstallPrg || bInstallNetWrk then
|
||||
if bInstallData || bInstallPrg then
|
||||
if bInstallData then
|
||||
sMsg = "Setup installerà l'area dati nel seguente direttorio.";
|
||||
else
|
||||
@ -499,7 +468,7 @@ function _SelectDongleXP(nDirection)
|
||||
|
||||
begin
|
||||
#ifndef __DEMO__
|
||||
bLocal = !(bInstallNetWrk || bInstallNetWrkChk); //in caso di installazione in postazione singola o server (chiave locale)
|
||||
bLocal = !(bInstallNetWrkChk); //in caso di installazione in postazione singola o server (chiave locale)
|
||||
if ( szOSName="Windows NT" && ((!bUseDongleServer) || bLocal) ) then //se ho win NT/2000/XP ed ho una chiave locale...
|
||||
bJunk = nReinstall > 0;
|
||||
go_on=FALSE;
|
||||
@ -622,7 +591,7 @@ begin
|
||||
szTempore = szDongleServerName;
|
||||
// se l'installazione e' del tipo avanzata/installazione locale server e si vuole installare il server
|
||||
// di autorizzazioni, propone di default localhost, in quanto il server autorizzazioni e' in locale
|
||||
if ((!bInstallNetWrkChk) && (!bInstallNetWrk) && (nReinstall <= 0) ) then
|
||||
if ((!bInstallNetWrkChk) && (nReinstall <= 0) ) then
|
||||
szTempore = "localhost";
|
||||
endif;
|
||||
|
||||
@ -672,13 +641,11 @@ begin
|
||||
listInfo = ListCreate(STRINGLIST);
|
||||
|
||||
Msg = "Si e' scelto di installare ";
|
||||
if bInstallNetWrk then
|
||||
Msg =Msg +"una postazione di rete";
|
||||
elseif bInstallPrg then
|
||||
if bInstallPrg then
|
||||
if bInstallDemo then
|
||||
Msg =Msg +"programma in versione demo";
|
||||
Msg =Msg +"il programma in versione demo";
|
||||
else
|
||||
Msg =Msg +"programma in versione commerciale";
|
||||
Msg =Msg +"il programma in versione commerciale";
|
||||
endif;
|
||||
else
|
||||
Msg =Msg +"l'area dati";
|
||||
@ -687,23 +654,16 @@ begin
|
||||
|
||||
|
||||
// directory dei programmi (locale o di rete)
|
||||
if bInstallNetWrk then
|
||||
szInfo="Direttorio della postazione di rete: ";
|
||||
if (bInstallNetWrkChk) then
|
||||
szInfo="Installazione di rete di riferimento:";
|
||||
ListAddString(listInfo, szInfo, AFTER);
|
||||
szInfo=" " + szConfigPath;
|
||||
szInfo=" " + szAppRefPath;
|
||||
ListAddString(listInfo, szInfo, AFTER);
|
||||
szInfo="Direttorio dei programmi in rete: ";
|
||||
szInfo="Direttorio dei programmi locali: ";
|
||||
else
|
||||
if (bInstallNetWrkChk) then
|
||||
szInfo="Installazione di rete di riferimento:";
|
||||
ListAddString(listInfo, szInfo, AFTER);
|
||||
szInfo=" " + szAppRefPath;
|
||||
ListAddString(listInfo, szInfo, AFTER);
|
||||
szInfo="Direttorio dei programmi locali: ";
|
||||
else
|
||||
szInfo="Direttorio dei programmi: ";
|
||||
endif;
|
||||
szInfo="Direttorio dei programmi: ";
|
||||
endif;
|
||||
|
||||
ListAddString(listInfo, szInfo, AFTER);
|
||||
szInfo=" " + szAppPath;
|
||||
ListAddString(listInfo, szInfo, AFTER);
|
||||
@ -838,7 +798,7 @@ function _InstallInitialFiles(nRetv)
|
||||
begin
|
||||
|
||||
if (bInstallPrg) then
|
||||
_InstallDongleXP(direction);
|
||||
//_InstallDongleXP(direction);
|
||||
|
||||
if (bInstallEnv || bInstallDemo) then
|
||||
_ForceAttrib4Dll( );
|
||||
@ -887,14 +847,15 @@ begin
|
||||
Enable(STATUS);
|
||||
SetStatusWindow( 0, "Scompattamento in corso..." );
|
||||
|
||||
// ***Eliminata con nuova gestione installazione chiavi! Programma hardlock hldrv32.exe
|
||||
//hardlock.vxd in winsys.z va solo su sistemi win95/98
|
||||
if (szOSName != "Windows NT") then
|
||||
TARGETDIR = WINDIR ^ "SYSTEM";
|
||||
if ( CompressGet( "WINSYS.Z", "*.*", INCLUDE_SUBDIR ) < 0) then
|
||||
szText = STR_ERR_DECOMPRESS + " la libreria WINSYS.";
|
||||
_Errore( szText );
|
||||
endif;
|
||||
endif;
|
||||
// if (szOSName != "Windows NT") then
|
||||
// TARGETDIR = WINDIR ^ "SYSTEM";
|
||||
// if ( CompressGet( "WINSYS.Z", "*.*", INCLUDE_SUBDIR ) < 0) then
|
||||
// szText = STR_ERR_DECOMPRESS + " la libreria WINSYS.";
|
||||
// _Errore( szText );
|
||||
// endif;
|
||||
// endif;
|
||||
|
||||
StatusUpdate( ON, 100 );
|
||||
FileSetEndDefine ( "SYS");
|
||||
@ -1020,7 +981,7 @@ begin
|
||||
return;
|
||||
endif;
|
||||
|
||||
_InstallDongleXP(nDirection);
|
||||
//_InstallDongleXP(nDirection);
|
||||
|
||||
//server di controllo dei vari servers possibili
|
||||
szTempore = szAppPath ^ "\\servers\\lerch.exe";
|
||||
|
@ -33,7 +33,7 @@ begin
|
||||
szTestProg = "";
|
||||
|
||||
//SOLO se e' una installazione locale puo' fare il test del database (con conversione!)
|
||||
if (( ! bInstallNetWrkChk) && ( ! bInstallNetWrk )) then
|
||||
if (!bInstallNetWrkChk) then
|
||||
szTestData = "X";
|
||||
szTestProg = "N";
|
||||
endif;
|
||||
@ -72,7 +72,7 @@ function _UpdateSysFiles( )
|
||||
STRING szTemp[_MAX_LENGTH], szWin_Ini[_MAX_LENGTH];
|
||||
|
||||
begin
|
||||
if (!bNuovaInst) && (!bInstallNetWrk) then
|
||||
if (!bNuovaInst) then
|
||||
return;
|
||||
endif;
|
||||
|
||||
@ -185,13 +185,14 @@ begin
|
||||
|
||||
FileSetBeginDefine ( "WIN");
|
||||
|
||||
if (szOSName != "Windows NT") then
|
||||
TARGETDIR = WINDIR ^ "SYSTEM";
|
||||
if ( CompressGet( "WINSYS.Z", "*.*", INCLUDE_SUBDIR ) < 0) then
|
||||
szText = STR_ERR_DECOMPRESS + " la libreria WINSYS.";
|
||||
_Errore( szText );
|
||||
endif;
|
||||
endif;
|
||||
// ***Eliminata con nuova gestione installazione chiavi! Programma hardlock hldrv32.exe
|
||||
//if (szOSName != "Windows NT") then
|
||||
// TARGETDIR = WINDIR ^ "SYSTEM";
|
||||
// if ( CompressGet( "WINSYS.Z", "*.*", INCLUDE_SUBDIR ) < 0) then
|
||||
// szText = STR_ERR_DECOMPRESS + " la libreria WINSYS.";
|
||||
// _Errore( szText );
|
||||
// endif;
|
||||
//endif;
|
||||
FileSetEndDefine ( "WIN");
|
||||
|
||||
FileSetBeginDefine ( "SYS");
|
||||
@ -332,16 +333,14 @@ begin
|
||||
// Mostra Program Manager
|
||||
AppCommand( PROGMAN, CMD_RESTORE );
|
||||
// Aggiunge il gruppo di programmi ed i programmi
|
||||
szFolder="OneRed";
|
||||
szFolder="Campo";
|
||||
ShowGroup (szFolder , SW_NORMAL );
|
||||
if ( TRUE) then
|
||||
// Aggiunge i link Program Manager
|
||||
if bInstallDemo then
|
||||
szItemName = "OneRed Demo";
|
||||
elseif bInstallNetWrk then
|
||||
szItemName = "OneRed WST";
|
||||
szItemName = "Campo Demo";
|
||||
else
|
||||
szItemName = "OneRed";
|
||||
szItemName = "Campo";
|
||||
endif;
|
||||
szCmdLine = szAppPath ^ "\\BA0.EXE";
|
||||
szIconPath = szCmdLine;
|
||||
|
@ -65,9 +65,8 @@ end;
|
||||
//__________________________________________________________________________________________________
|
||||
function _FindExistingInst(szPrevPath )
|
||||
begin
|
||||
if (! bInstallNetWrk) then //modifica del 04-06-2003;tolta la ricerca local inst in caso di installazione wst
|
||||
_CercaFileOvunque( "CAMPO.AUT",szPrevPath);
|
||||
endif;
|
||||
_CercaFileOvunque( "CAMPO.AUT",szPrevPath);
|
||||
|
||||
if (szPrevPath!="") then
|
||||
ParsePath(szPrevPath,szPrevPath,PATH);
|
||||
return TRUE;
|
||||
|
@ -2210,6 +2210,7 @@ wxFont& TFontId::Font(wxDC* dc, WINDOW win) const
|
||||
{
|
||||
const int nFontSize = nBest-i;
|
||||
wxFont courier(nFontSize, wxFIXED, wxNORMAL, wxNORMAL, FALSE, DEFAULT_FONT_NAME);
|
||||
|
||||
dc->SetFont(courier);
|
||||
int tw, th; dc->GetTextExtent(str, &tw, &th);
|
||||
if (tw > nTarget10 && bPrevGood)
|
||||
@ -2220,6 +2221,7 @@ wxFont& TFontId::Font(wxDC* dc, WINDOW win) const
|
||||
bPrevGood = tw <= nTarget10;
|
||||
}
|
||||
#endif
|
||||
|
||||
dPrintScale = double(nBest) / double(nSize);
|
||||
#ifdef LINUX
|
||||
dPrintScale /= 10.0; // * wxPostScriptDC::GetResolution()) / 72.0);
|
||||
|
@ -106,17 +106,16 @@ ULONG xvt_odbc_execute(XVT_ODBC handle, const char* sql, ODBC_CALLBACK cb, void*
|
||||
wxDbColInf* columns = NULL;
|
||||
short numcols = 0;
|
||||
|
||||
if (db->ExecSql(sql, &columns, numcols))
|
||||
if (db->ExecSql(sql, &columns, numcols) && numcols > 0)
|
||||
{
|
||||
const size_t BUF_SIZE = 1024*64;
|
||||
char* buffer = new char[BUF_SIZE]; // Valore di un singolo campo
|
||||
|
||||
const size_t MAX_COL = 256;
|
||||
char** values = new char*[MAX_COL]; // Lista dei valori del record corrente
|
||||
memset(values, 0, MAX_COL*sizeof(char*));
|
||||
char** values = new char*[numcols]; // Lista dei valori del record corrente
|
||||
memset(values, 0, numcols*sizeof(char*));
|
||||
|
||||
char** names = new char*[MAX_COL*2]; // Lista dei nomi dei campi e dei tipi
|
||||
memset(names, 0, MAX_COL*2*sizeof(char*));
|
||||
char** names = new char*[numcols*2]; // Lista dei nomi dei campi e dei tipi
|
||||
memset(names, 0, numcols*2*sizeof(char*));
|
||||
|
||||
short c;
|
||||
for (c = 0; c < numcols; c++)
|
||||
@ -136,7 +135,7 @@ ULONG xvt_odbc_execute(XVT_ODBC handle, const char* sql, ODBC_CALLBACK cb, void*
|
||||
}
|
||||
|
||||
wxArrayString data;
|
||||
for (nCount = 0; db->GetNext(); nCount++) if (cb != NULL)
|
||||
for (nCount = 0; db->GetNext(); nCount++)
|
||||
{
|
||||
data.Empty(); // Svuota l'array
|
||||
for (c = 0; c < numcols; c++)
|
||||
@ -164,17 +163,16 @@ ULONG xvt_odbc_execute(XVT_ODBC handle, const char* sql, ODBC_CALLBACK cb, void*
|
||||
db->GetData(c+1, SQL_C_CHAR, buffer, BUF_SIZE, &cbReturned);
|
||||
break;
|
||||
}
|
||||
if (cbReturned != SQL_NULL_DATA)
|
||||
data.Add(buffer);
|
||||
else
|
||||
break;
|
||||
if (cbReturned == SQL_NULL_DATA)
|
||||
buffer[0] = '\0';
|
||||
data.Add(buffer);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (c = 0; c < numcols; c++)
|
||||
for (c = 0; c < (short)data.GetCount(); c++)
|
||||
values[c] = (char*)data[c].c_str();
|
||||
const int err = cb(jolly, numcols, values, names);
|
||||
if (err != 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user