Continua la saga della stampa estratti conto
git-svn-id: svn://10.65.10.50/trunk@2146 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
7b8f1ed944
commit
dc9dc4d6fb
@ -6,6 +6,10 @@
|
|||||||
#include <mask.h>
|
#include <mask.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __CONFIG_H
|
||||||
|
#include <config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef __FORM_H
|
#ifndef __FORM_H
|
||||||
#include <form.h>
|
#include <form.h>
|
||||||
#endif
|
#endif
|
||||||
@ -26,12 +30,18 @@
|
|||||||
#include <lffiles.h>
|
#include <lffiles.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __CLIFO_H
|
||||||
|
#include <clifo.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "sc2.h"
|
#include "sc2.h"
|
||||||
#include "sc2100a.h"
|
#include "sc2100a.h"
|
||||||
|
|
||||||
class TStampaEC_application : public TApplication
|
class TStampaEC_application : public TApplication
|
||||||
{
|
{
|
||||||
enum what {clienti, fornitori};
|
enum what {clienti, fornitori};
|
||||||
|
|
||||||
|
TForm* _form;
|
||||||
|
|
||||||
// begin AARGH
|
// begin AARGH
|
||||||
TRelation* _clifo_rel;
|
TRelation* _clifo_rel;
|
||||||
@ -50,6 +60,9 @@ class TStampaEC_application : public TApplication
|
|||||||
TBit_array _selected;
|
TBit_array _selected;
|
||||||
|
|
||||||
TRelation* _ditta;
|
TRelation* _ditta;
|
||||||
|
TString _lingua;
|
||||||
|
TString _linprof;
|
||||||
|
bool _gesval;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
@ -278,9 +291,15 @@ bool TStampaEC_application::select_ec()
|
|||||||
}
|
}
|
||||||
|
|
||||||
while ((k = m.run()) != K_ESC)
|
while ((k = m.run()) != K_ESC)
|
||||||
if (k == K_ENTER)
|
if (k == K_ENTER)
|
||||||
|
{
|
||||||
|
// sciroppa profilo
|
||||||
|
if (_form != NULL) delete _form;
|
||||||
|
_form = new TForm(BASE_EC_PROFILE, m.get(F_CODPROF));
|
||||||
|
_linprof[0] = _form->code()[_form->code().len() - 1];
|
||||||
|
_linprof[1] = '\0';
|
||||||
print_selected();
|
print_selected();
|
||||||
|
}
|
||||||
return k != K_ESC;
|
return k != K_ESC;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -317,7 +336,33 @@ bool TStampaEC_application::print_selected()
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool TStampaEC_application::print_ec(long clifo)
|
bool TStampaEC_application::print_ec(long clifo)
|
||||||
{
|
{
|
||||||
|
TLocalisamfile clf(LF_CLIFO);
|
||||||
|
clf.zero();
|
||||||
|
|
||||||
|
clf.put(CLI_TIPOCF, _what == clienti ? "C" : "F");
|
||||||
|
clf.put(CLI_CODCF, clifo);
|
||||||
|
if (clf.read() != NOERR)
|
||||||
|
fatal_box("Errore in archivio clienti/fornitori");
|
||||||
|
|
||||||
|
TString lincf = clf.get(CLI_CODLIN);
|
||||||
|
|
||||||
|
bool ok = TRUE;
|
||||||
|
|
||||||
|
// make controllations per lingua profilo/CF
|
||||||
|
if (_linprof == _lingua && !lincf.empty())
|
||||||
|
ok = (lincf == _linprof);
|
||||||
|
else if (_linprof != _lingua)
|
||||||
|
ok = (lincf == _linprof);
|
||||||
|
|
||||||
|
if (ok)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
warning_box ("Dio bestia! Cliente analfabeta!");
|
||||||
|
};
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -356,6 +401,10 @@ bool TStampaEC_application::create()
|
|||||||
_ditta->zero();
|
_ditta->zero();
|
||||||
_ditta->lfile().put("CODDITTA", get_firm());
|
_ditta->lfile().put("CODDITTA", get_firm());
|
||||||
_ditta->read();
|
_ditta->read();
|
||||||
|
|
||||||
|
TConfig tc(CONFIG_DITTA);
|
||||||
|
_lingua = tc.get("CodLin", "");
|
||||||
|
_gesval = tc.get_bool("GesVal", "");
|
||||||
|
|
||||||
dispatch_e_menu(MENU_ITEM(1));
|
dispatch_e_menu(MENU_ITEM(1));
|
||||||
|
|
||||||
@ -384,9 +433,9 @@ bool TStampaEC_application::menu(MENU_TAG m)
|
|||||||
else return TApplication::menu(m);
|
else return TApplication::menu(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
TStampaEC_application::TStampaEC_application() : _selected(10000), _what(clienti), _key(1)
|
TStampaEC_application::TStampaEC_application() : _selected(10000),
|
||||||
{
|
_what(clienti), _key(1), _lingua(1), _linprof(2), _form(NULL)
|
||||||
}
|
{}
|
||||||
|
|
||||||
int sc2100(int argc, char** argv)
|
int sc2100(int argc, char** argv)
|
||||||
{
|
{
|
||||||
|
@ -21,3 +21,6 @@
|
|||||||
#define R_SORTCF 121
|
#define R_SORTCF 121
|
||||||
#define F_NSEL 122
|
#define F_NSEL 122
|
||||||
#define F_COMSEND 123
|
#define F_COMSEND 123
|
||||||
|
|
||||||
|
// basename of profile
|
||||||
|
#define BASE_EC_PROFILE "PEC"
|
||||||
|
@ -29,6 +29,7 @@ BEGIN
|
|||||||
USE LF_FORM KEY 1
|
USE LF_FORM KEY 1
|
||||||
DISPLAY "Codice" CODPROF
|
DISPLAY "Codice" CODPROF
|
||||||
DISPLAY "Descrizione@50" DESC
|
DISPLAY "Descrizione@50" DESC
|
||||||
|
INPUT TIPOPROF BASE_EC_PROFILE
|
||||||
INPUT CODPROF F_CODPROF
|
INPUT CODPROF F_CODPROF
|
||||||
OUTPUT F_CODPROF CODPROF
|
OUTPUT F_CODPROF CODPROF
|
||||||
OUTPUT F_DESPROF DESC
|
OUTPUT F_DESPROF DESC
|
||||||
|
Loading…
x
Reference in New Issue
Block a user