Sistemati errori sulla generazione delle righe omaggio ( focus e prezzo)
Sistemato output su sconti Sistemata stampa documenti git-svn-id: svn://10.65.10.50/trunk@5140 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
f2c81b4290
commit
43c00e8eef
@ -533,7 +533,7 @@ void TCond_vendita::update_omaggi(bool full)
|
|||||||
{
|
{
|
||||||
static TString16 tipo_riga("_");
|
static TString16 tipo_riga("_");
|
||||||
TSheet_field & sh = (TSheet_field &) testa().field(F_SHEET);
|
TSheet_field & sh = (TSheet_field &) testa().field(F_SHEET);
|
||||||
const int current_doc_row = sh.selected() + 1;
|
int current_doc_row = sh.selected() + 1;
|
||||||
TDocumento & doc = testa().doc();
|
TDocumento & doc = testa().doc();
|
||||||
bool update = FALSE;
|
bool update = FALSE;
|
||||||
|
|
||||||
@ -546,6 +546,7 @@ void TCond_vendita::update_omaggi(bool full)
|
|||||||
|
|
||||||
if (r.is_omaggio() && r.is_generata())
|
if (r.is_omaggio() && r.is_generata())
|
||||||
{
|
{
|
||||||
|
sh.update_row(current_doc_row - 1);
|
||||||
doc.destroy_row(current_doc_row + 1, TRUE);
|
doc.destroy_row(current_doc_row + 1, TRUE);
|
||||||
sh.destroy(current_doc_row, FALSE);
|
sh.destroy(current_doc_row, FALSE);
|
||||||
update = TRUE;
|
update = TRUE;
|
||||||
@ -553,6 +554,7 @@ void TCond_vendita::update_omaggi(bool full)
|
|||||||
}
|
}
|
||||||
|
|
||||||
real qta = _riga->get(FR_QTA);
|
real qta = _riga->get(FR_QTA);
|
||||||
|
bool creata = FALSE;
|
||||||
|
|
||||||
if (full || qta != ZERO)
|
if (full || qta != ZERO)
|
||||||
{
|
{
|
||||||
@ -566,10 +568,14 @@ void TCond_vendita::update_omaggi(bool full)
|
|||||||
qta /= _rcondv.get_real("QBASE");
|
qta /= _rcondv.get_real("QBASE");
|
||||||
qta.floor();
|
qta.floor();
|
||||||
qta *= _rcondv.get_real("QOM");
|
qta *= _rcondv.get_real("QOM");
|
||||||
if (codart_omaggio.not_empty() && tipo_riga.not_empty() && qta != ZERO)
|
creata = codart_omaggio.not_empty() && tipo_riga.not_empty() && qta != ZERO;
|
||||||
|
|
||||||
|
if (creata)
|
||||||
{
|
{
|
||||||
TRiga_documento & curr_row = doc[current_doc_row];
|
TRiga_documento & curr_row = doc[current_doc_row];
|
||||||
|
TToken_string & rw = sh.row(current_doc_row - 1);
|
||||||
|
|
||||||
|
sh.update_row(current_doc_row - 1);
|
||||||
curr_row.autosave(sh);
|
curr_row.autosave(sh);
|
||||||
|
|
||||||
TRiga_documento & r = doc.insert_row(current_doc_row + 1, tipo_riga);
|
TRiga_documento & r = doc.insert_row(current_doc_row + 1, tipo_riga);
|
||||||
@ -580,7 +586,8 @@ void TCond_vendita::update_omaggi(bool full)
|
|||||||
r.put("CODART", codart_omaggio);
|
r.put("CODART", codart_omaggio);
|
||||||
r.put("UMQTA", _rcondv.get("UMOM"));
|
r.put("UMQTA", _rcondv.get("UMOM"));
|
||||||
r.put("QTA", qta);
|
r.put("QTA", qta);
|
||||||
// r.put("PREZZO", _rcondv.get("PROMAGGIO"));
|
real prezzo(_rcondv.get("PROMAGGIO"));
|
||||||
|
const TString16 codval(_condv.get("CODVAL"));
|
||||||
const TString16 codiva_cli(clifo().vendite().get(CFV_ASSFIS));
|
const TString16 codiva_cli(clifo().vendite().get(CFV_ASSFIS));
|
||||||
if (codiva_cli.not_empty())
|
if (codiva_cli.not_empty())
|
||||||
r.put("CODIVA", codiva_cli);
|
r.put("CODIVA", codiva_cli);
|
||||||
@ -592,14 +599,18 @@ void TCond_vendita::update_omaggi(bool full)
|
|||||||
sh.check_row(current_doc_row);
|
sh.check_row(current_doc_row);
|
||||||
r.autosave(sh);
|
r.autosave(sh);
|
||||||
|
|
||||||
const real prezzo_omaggio = normalize_valuta(_rcondv.get_real("PROMAGGIO"), _condv.get("CODVAL"));
|
prezzo = normalize_valuta(prezzo, codval);
|
||||||
r.put("PREZZO", prezzo_omaggio);
|
r.put("PREZZO", prezzo);
|
||||||
|
r.autoload(sh);
|
||||||
update = TRUE;
|
update = TRUE;
|
||||||
curr_row.autoload(sh);
|
// curr_row.autoload(sh);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (update)
|
if (update)
|
||||||
|
{
|
||||||
sh.force_update();
|
sh.force_update();
|
||||||
|
sh.select(creata ? current_doc_row : current_doc_row - 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TCond_vendita::TCond_vendita(TCli_for * clifo, TConfig * ditta, TDocumento_mask * testa, TMask * riga,
|
TCond_vendita::TCond_vendita(TCli_for * clifo, TConfig * ditta, TDocumento_mask * testa, TMask * riga,
|
||||||
|
422
ve/ve1100.cpp
422
ve/ve1100.cpp
@ -452,110 +452,13 @@ void TDocumento_form::extended_parse_general(TScanner &scanner)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TDocumento_form::validate(TForm_item &cf, TToken_string &s) {
|
bool TDocumento_form::validate(TForm_item &cf, TToken_string &s)
|
||||||
|
{
|
||||||
const TString code(s.get(0)); // prende il primo parametro, il codice del messaggio
|
const TString code(s.get(0)); // prende il primo parametro, il codice del messaggio
|
||||||
TString valore;
|
TString valore;
|
||||||
|
|
||||||
if (code== "_ISAMREAD") {
|
if (code== "_DITTA")
|
||||||
// lettura generica di un file del database
|
{
|
||||||
// sintassi: _ISAMREAD,<file>,<espressione input>[!<espressione input>!...],{<campo file>|<espressione output>[!<espressione output>!...]}
|
|
||||||
// dove: <file> è il numero logico del file o il nome della tabella
|
|
||||||
// <espressione input> è un'espressione del tipo <campo file>=<espressione campi form>
|
|
||||||
// <espressione campi form> è un'espressione di costanti numeriche, stringhe e valori di campi della form (indicati con il loro numero preceduto da #)
|
|
||||||
// <espressione output> è un'espressione del tipo <campo form o gruppo>=<campo file> (se è un gruppo deve essere seguito da @) oppure solo <campo file> (il campo della form è quello corrente)
|
|
||||||
int i, j, poseq, posrv, itms;
|
|
||||||
pagetype pt;
|
|
||||||
char sec;
|
|
||||||
TLocalisamfile *file;
|
|
||||||
TString f_code(s.get()); // prende il codice del file da leggere
|
|
||||||
if (atoi(f_code) != 0) file= new TLocalisamfile(atoi(f_code)); // se il codice è numerico allora è un file
|
|
||||||
else file= new TTable(f_code); // altrimenti è una tabella
|
|
||||||
file->zero(); // vuota il record corrente del file
|
|
||||||
TToken_string in(s.get(), '!');
|
|
||||||
for (i=0; i<in.items(); i++) { // scansione sugli elementi dell'input
|
|
||||||
TString curr(in.get(i));
|
|
||||||
poseq= curr.find("=="); // divide la stringa corrente in lvalue e rvalue
|
|
||||||
if (poseq== -1) {
|
|
||||||
poseq= curr.find('=');
|
|
||||||
if (poseq != -1) posrv= poseq+1;
|
|
||||||
} else posrv= poseq+2;
|
|
||||||
TString fld(curr.left(poseq)); // preleva il nome del campo del file alla sinistra dell'uguale
|
|
||||||
TString expr(curr.mid(posrv)); // preleva l'espressione di assegnamento alla destra dell'uguale
|
|
||||||
TExpression rval(expr, _strexpr);
|
|
||||||
for (j=0; j<rval.numvar(); j++) { // scansione delle variabili dell'espressione di rvalue
|
|
||||||
TString var= rval.varname(j);
|
|
||||||
if (var[0]=='#') var.ltrim(1); // rimuove dalla stringa il primo carattere
|
|
||||||
TForm_item &fi= cf.find_field(var);
|
|
||||||
rval.setvar(j, fi.get()); // il valore corrente del campo viene settato nell'espressione
|
|
||||||
}
|
|
||||||
file->put(fld, (const char *)rval); // scrive il risultato dell'espressione nel campo del file
|
|
||||||
}
|
|
||||||
if (file->read()== NOERR) { // tenta una lettura del file
|
|
||||||
TToken_string out(s.get(), '!');
|
|
||||||
for (i=0; i<out.items(); i++) { // scansione sugli elementi dell'output
|
|
||||||
TString curr(out.get(i));
|
|
||||||
poseq= curr.find("=="); // divide la stringa corrente in lvalue e rvalue
|
|
||||||
if (poseq== -1) {
|
|
||||||
poseq= curr.find('=');
|
|
||||||
if (poseq != -1) posrv= poseq+1;
|
|
||||||
} else posrv= poseq+2;
|
|
||||||
if (poseq== -1) {
|
|
||||||
const TString &dat= file->get(curr); // preleva il nome del campo del file e lo legge dal record
|
|
||||||
cf.put_paragraph(dat);
|
|
||||||
} else {
|
|
||||||
TString fld(curr.left(poseq)); // preleva il nome del campo del form alla sinistra dell'uguale
|
|
||||||
const TString &dat= file->get(curr.mid(posrv)); // preleva il nome del campo del file alla destra dell'uguale e lo legge dal record
|
|
||||||
if (fld[0]=='#') fld.ltrim(1);
|
|
||||||
if (fld.right(1)== "@") { // se c'è la a-commerciale è un gruppo
|
|
||||||
if (fld.find("->") != -1) { // se nel gruppo c'è la freccia si riferisce ad un'altra sezione
|
|
||||||
sec= fld[0];
|
|
||||||
if (fld[1] != '-') pt= char2page(fld[1]);
|
|
||||||
else pt= even_page;
|
|
||||||
itms= section(sec, pt).fields();
|
|
||||||
} else { // altrimenti si riferisce alla sezione corrente
|
|
||||||
sec= cf.section().section_type();
|
|
||||||
pt= cf.section().page_type();
|
|
||||||
itms= cf.section().fields();
|
|
||||||
}
|
|
||||||
for (j=0; j<itms; j++) { // per ogni campo della sezione specificata (o sottointesa)...
|
|
||||||
TForm_item &fi= section(sec, pt).field(j);
|
|
||||||
fi.put_paragraph(dat);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
TForm_item &fi= cf.find_field(fld);
|
|
||||||
fi.put_paragraph(dat);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
delete file;
|
|
||||||
return (TRUE);
|
|
||||||
} // fine _ISAMREAD
|
|
||||||
|
|
||||||
if (code== "_TABLEREAD") {
|
|
||||||
// lettura generica di un campo di una tabella
|
|
||||||
// sintassi: _TABLEREAD,<tabella>,<chiave>,<campo file>
|
|
||||||
// dove: <tabella> nome tabella da leggere
|
|
||||||
// <chiave> costante stringa o riferimento a campo della form (preceduto da '#') da usare come chiave di ricerca
|
|
||||||
// <campo file> identificativo del campo da leggere dalla tabella
|
|
||||||
TTable tab(s.get()); // prende il nome della tabella
|
|
||||||
tab.zero(); // vuota il record corrente della tabella
|
|
||||||
TString in(s.get()); // prende il valore o il campo da usare come codice di ricerca
|
|
||||||
if (in[0]== '#') {
|
|
||||||
in.ltrim(1);
|
|
||||||
TForm_item &fi= cf.find_field(in);
|
|
||||||
in= fi.get();
|
|
||||||
}
|
|
||||||
tab.put("CODTAB", in); // setta la chiave nella tabella
|
|
||||||
if (tab.read()== NOERR) {
|
|
||||||
const TString &fld= s.get(); // prende il nome del campo da leggere...
|
|
||||||
valore = tab.get(fld);
|
|
||||||
cf.put_paragraph(valore);
|
|
||||||
}
|
|
||||||
return (TRUE);
|
|
||||||
} // fine _TABLEREAD
|
|
||||||
|
|
||||||
if (code== "_DITTA") {
|
|
||||||
// lettura dei dati della ditta
|
// lettura dei dati della ditta
|
||||||
// sintassi: _DITTA,{<campo relazione>|<macro>}
|
// sintassi: _DITTA,{<campo relazione>|<macro>}
|
||||||
// dove: <campo relazione> è un riferimento alla relazione di gestione dei dati della ditta (es. 113@->DENCOM è la denominazione del comune di residenza della ditta)
|
// dove: <campo relazione> è un riferimento alla relazione di gestione dei dati della ditta (es. 113@->DENCOM è la denominazione del comune di residenza della ditta)
|
||||||
@ -578,68 +481,106 @@ bool TDocumento_form::validate(TForm_item &cf, TToken_string &s) {
|
|||||||
// + %COMUNI (113@) Comune di residenza
|
// + %COMUNI (113@) Comune di residenza
|
||||||
// + %COMUNI (213@) Comune di residenza fiscale
|
// + %COMUNI (213@) Comune di residenza fiscale
|
||||||
TString in(s.get());
|
TString in(s.get());
|
||||||
if (in[0]=='!') {
|
|
||||||
|
if (in[0]!='!')
|
||||||
|
{
|
||||||
|
cf.set(_firmrel.curr().get(in));
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
in.ltrim(1);
|
in.ltrim(1);
|
||||||
bool _fisc= _firmrel.lfile(6).get("INDRF").not_empty();
|
bool _fisc= _firmrel.lfile(6).get("INDRF").not_empty();
|
||||||
if (in=="RAGSOC")
|
if (in=="RAGSOC")
|
||||||
valore = _firmrel.lfile().get("RAGSOC");
|
{
|
||||||
if (in=="IND") {
|
cf.set(_firmrel.lfile().get("RAGSOC"));
|
||||||
if (_fisc)
|
return TRUE;
|
||||||
valore = _firmrel.lfile(6).get("INDRF");
|
|
||||||
else
|
|
||||||
valore = _firmrel.lfile(6).get("INDRES");
|
|
||||||
}
|
}
|
||||||
if (in=="NUM") {
|
if (in=="IND")
|
||||||
|
{
|
||||||
if (_fisc)
|
if (_fisc)
|
||||||
valore = _firmrel.lfile(6).get("CIVRF");
|
cf.set(_firmrel.lfile(6).get("INDRF"));
|
||||||
else
|
else
|
||||||
valore = _firmrel.lfile(6).get("CIVRES");
|
cf.set(_firmrel.lfile(6).get("INDRES"));
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
if (in=="CAP") {
|
if (in=="NUM")
|
||||||
|
{
|
||||||
if (_fisc)
|
if (_fisc)
|
||||||
valore = _firmrel.lfile(6).get("CAPRF");
|
cf.set(_firmrel.lfile(6).get("CIVRF"));
|
||||||
else
|
else
|
||||||
valore = _firmrel.lfile(6).get("CAPRES");
|
cf.set(_firmrel.lfile(6).get("CIVRES"));
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
if (in=="COM") {
|
if (in=="CAP")
|
||||||
|
{
|
||||||
if (_fisc)
|
if (_fisc)
|
||||||
valore = _firmrel.lfile(-213).get("DENCOM");
|
cf.set(_firmrel.lfile(6).get("CAPRF"));
|
||||||
else
|
else
|
||||||
valore = _firmrel.lfile(-113).get("DENCOM");
|
cf.set(_firmrel.lfile(6).get("CAPRES"));
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
if (in=="PROV") {
|
if (in=="COM")
|
||||||
|
{
|
||||||
if (_fisc)
|
if (_fisc)
|
||||||
valore = _firmrel.lfile(-213).get("PROVCOM");
|
cf.set(_firmrel.lfile(-213).get("DENCOM"));
|
||||||
else
|
else
|
||||||
valore = _firmrel.lfile(-113).get("PROVCOM");
|
cf.set(_firmrel.lfile(-113).get("DENCOM"));
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
if (in=="PROV")
|
||||||
|
{
|
||||||
|
if (_fisc)
|
||||||
|
cf.set(_firmrel.lfile(-213).get("PROVCOM"));
|
||||||
|
else
|
||||||
|
cf.set(_firmrel.lfile(-113).get("PROVCOM"));
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
if (in=="IVA")
|
if (in=="IVA")
|
||||||
valore = _firmrel.lfile(6).get("PAIV");
|
{
|
||||||
|
cf.set(_firmrel.lfile(6).get("PAIV"));
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
if (in=="CF")
|
if (in=="CF")
|
||||||
_firmrel.lfile(6).get("COFI");
|
{
|
||||||
if (in=="TEL") {
|
cf.set(_firmrel.lfile(6).get("COFI"));
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
if (in=="TEL")
|
||||||
|
{
|
||||||
valore = _firmrel.lfile().get("PTEL");
|
valore = _firmrel.lfile().get("PTEL");
|
||||||
valore << "/" << _firmrel.lfile().get("TEL");
|
valore << "/" << _firmrel.lfile().get("TEL");
|
||||||
|
cf.set(valore);
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
if (in=="FAX") {
|
if (in=="FAX")
|
||||||
|
{
|
||||||
valore = _firmrel.lfile().get("PFAX");
|
valore = _firmrel.lfile().get("PFAX");
|
||||||
valore << "/" << _firmrel.lfile().get("FAX");
|
valore << "/" << _firmrel.lfile().get("FAX");
|
||||||
|
cf.set(valore);
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
if (in=="REGSOC") {
|
if (in=="REGSOC")
|
||||||
|
{
|
||||||
valore = _firmrel[LF_UNLOC].get("REGTRIB");
|
valore = _firmrel[LF_UNLOC].get("REGTRIB");
|
||||||
valore << " Vol. " << _firmrel[LF_UNLOC].get("VOLTRIB");
|
const TString & vol = _firmrel[LF_UNLOC].get("VOLTRIB");
|
||||||
valore << " Fasc. " << _firmrel[LF_UNLOC].get("FASCTRIB");
|
if (vol.not_empty())
|
||||||
|
valore << " Vol. " << vol;
|
||||||
|
const TString & fasc = _firmrel[LF_UNLOC].get("FASCTRIB");
|
||||||
|
if (fasc.not_empty())
|
||||||
|
valore << " Fasc. " << fasc;
|
||||||
|
cf.set(valore);
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
if (in=="CCIAA") {
|
if (in=="CCIAA")
|
||||||
|
{
|
||||||
valore = _firmrel[LF_UNLOC].get("NUMCCIAA");
|
valore = _firmrel[LF_UNLOC].get("NUMCCIAA");
|
||||||
valore << " del " << _firmrel[LF_UNLOC].get("DATAICCIAA");
|
const TString & data = _firmrel[LF_UNLOC].get("DATAICCIAA");
|
||||||
|
if (data.not_empty())
|
||||||
|
valore << " del " << data;
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
TFieldref fref(in, 0);
|
|
||||||
valore = fref.read(_firmrel);
|
|
||||||
}
|
}
|
||||||
cf.put_paragraph(valore);
|
|
||||||
return (TRUE);
|
|
||||||
} // fine _DITTA
|
} // fine _DITTA
|
||||||
|
|
||||||
if (code== "_CLIENTE")
|
if (code== "_CLIENTE")
|
||||||
@ -663,61 +604,64 @@ bool TDocumento_form::validate(TForm_item &cf, TToken_string &s) {
|
|||||||
TCli_for & cli_for = _doc->clifor();
|
TCli_for & cli_for = _doc->clifor();
|
||||||
TString in(s.get()); // prende la macro o il fieldref
|
TString in(s.get()); // prende la macro o il fieldref
|
||||||
if (in[0] != '!')
|
if (in[0] != '!')
|
||||||
valore = cli_for.get(in);
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
in.ltrim(1);
|
cf.set(cli_for.get(in));
|
||||||
if (in=="INDNUM")
|
return TRUE;
|
||||||
|
}
|
||||||
|
in.ltrim(1);
|
||||||
|
if (in=="INDNUM")
|
||||||
|
{
|
||||||
|
valore = cli_for.get(CLI_INDCF);
|
||||||
|
valore << " " << cli_for.get(CLI_CIVCF);
|
||||||
|
cf.set(valore);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
if (in.find("COM") == 0)
|
||||||
|
{
|
||||||
|
const bool nascita = in[3] == 'N';
|
||||||
|
const int p = in.find("->");
|
||||||
|
if (p > 0)
|
||||||
|
in.ltrim(p + 2);
|
||||||
|
TLocalisamfile com(LF_COMUNI);
|
||||||
|
if (nascita)
|
||||||
{
|
{
|
||||||
valore = cli_for.get(CLI_INDCF);
|
com.put("STATO", cli_for.get(CLI_STATONASC));
|
||||||
valore << " " << cli_for.get(CLI_CIVCF);
|
com.put("COM", cli_for.get(CLI_COMNASC));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (in.find("COM") == 0)
|
{
|
||||||
{
|
com.put("STATO", cli_for.get(CLI_STATOCF));
|
||||||
in.ltrim(3);
|
com.put("COM", cli_for.get(CLI_COMCF));
|
||||||
TLocalisamfile com(LF_COMUNI);
|
}
|
||||||
const bool nascita = in[0] == 'N';
|
if (com.read() == NOERR)
|
||||||
if (nascita)
|
cf.set(com.get(in));
|
||||||
{
|
return TRUE;
|
||||||
in.ltrim(3);
|
}
|
||||||
com.put("STATO", cli_for.get(CLI_STATOCF));
|
if (in.find("TEL") == 0)
|
||||||
com.put("COM", cli_for.get(CLI_COMCF));
|
{
|
||||||
}
|
if (in.len() == 3)
|
||||||
else
|
in << "1";
|
||||||
{
|
const TString num(cli_for.get(in));
|
||||||
in.ltrim(2);
|
in.insert("P");
|
||||||
com.put("STATO", cli_for.get(CLI_STATONASC));
|
valore = cli_for.get(in);
|
||||||
com.put("COM", cli_for.get(CLI_COMNASC));
|
valore << "/" << num;
|
||||||
}
|
cf.set(valore);
|
||||||
if (com.read() == NOERR)
|
return TRUE;
|
||||||
valore = com.get(in);
|
}
|
||||||
}
|
if (in=="FAX")
|
||||||
else
|
{
|
||||||
if (in.find("TEL") == 0)
|
valore = cli_for.get("PFAX");
|
||||||
{
|
valore << "/" << cli_for.get("FAX");
|
||||||
if (in.len() == 3)
|
cf.set(valore);
|
||||||
in << "1";
|
return TRUE;
|
||||||
const TString num(cli_for.get(in));
|
}
|
||||||
in.insert("P");
|
if (in=="RAGSOC")
|
||||||
valore = cli_for.get(in);
|
{
|
||||||
valore << "/" << num;
|
valore = cli_for.get(in);
|
||||||
}
|
valore.strip_d_spaces();
|
||||||
else
|
cf.set(valore);
|
||||||
if (in=="FAX")
|
return TRUE;
|
||||||
{
|
|
||||||
valore = cli_for.get("PFAX");
|
|
||||||
valore << "/" << cli_for.get("FAX");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
if (in=="RAGSOC")
|
|
||||||
{
|
|
||||||
valore = cli_for.get(in);
|
|
||||||
valore.strip_d_spaces();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
cf.put_paragraph(valore);
|
|
||||||
return (TRUE);
|
|
||||||
} // fine _CLIENTE
|
} // fine _CLIENTE
|
||||||
|
|
||||||
if (code == "_DESCRIGA")
|
if (code == "_DESCRIGA")
|
||||||
@ -732,76 +676,14 @@ bool TDocumento_form::validate(TForm_item &cf, TToken_string &s) {
|
|||||||
|
|
||||||
descrizione << s;
|
descrizione << s;
|
||||||
}
|
}
|
||||||
cf.put_paragraph(descrizione);
|
cf.set(descrizione);
|
||||||
|
TParagraph_string p(descrizione, cf.width());
|
||||||
|
const int h = cf.height();
|
||||||
|
for (int i=0; p.get() != NULL && i < h; i++);
|
||||||
|
// cf.put_paragraph(descrizione);
|
||||||
// Setta l'altezza effettiva del body, per evitare sprechi di righe
|
// Setta l'altezza effettiva del body, per evitare sprechi di righe
|
||||||
cf.section().set_height(cf.effective_height());
|
cf.section().set_height(i);
|
||||||
}
|
return TRUE;
|
||||||
|
|
||||||
if (code== "_ALIGN")
|
|
||||||
{
|
|
||||||
// allineamento della posizione di un campo rispetto ad un altro
|
|
||||||
// sintassi: _ALIGN,<campo form>[,<allineamento>][,<allineamento>...]
|
|
||||||
// dove: <campo form> è il campo della form (preceduto da '#') da cui prendere l'allineamento
|
|
||||||
// <allineamento> è uno dei seguenti valori:
|
|
||||||
// TOP allinea sulla riga d'inizio
|
|
||||||
// MIDDLE allinea al centro (effettivo)
|
|
||||||
// BOTTOM allinea sulla riga di fine (effettiva, non preimpostata)
|
|
||||||
// LEFT allinea sulla colonna d'inizio
|
|
||||||
// RIGHT allinea sulla colonna di fine
|
|
||||||
TString in(s.get());
|
|
||||||
if (in[0]== '#') in.ltrim(1);
|
|
||||||
TForm_item &fi= cf.find_field(in);
|
|
||||||
const int width = cf.width();
|
|
||||||
valore = cf.get();
|
|
||||||
TString clear(width);
|
|
||||||
TString picture(cf.picture());
|
|
||||||
clear.spaces();
|
|
||||||
int i= 2;
|
|
||||||
short save_x = cf.x();
|
|
||||||
short save_y = cf.y();
|
|
||||||
short save_height = cf.height();
|
|
||||||
cf.height() = 2; // Solo temporaneamente per far si' che stampi alla giusta posizione
|
|
||||||
cf.set(clear);
|
|
||||||
cf.put_paragraph(clear);
|
|
||||||
while (i<s.items()) { // Calcola la nuova posizione
|
|
||||||
TString align(s.get());
|
|
||||||
if (align[0]=='!') align.ltrim(1);
|
|
||||||
if (align== "TOP") cf.y()= fi.y();
|
|
||||||
if (align== "MIDDLE") cf.y()= fi.y()+ fi.effective_height()/2;
|
|
||||||
if (align== "BOTTOM") cf.y()= fi.y()+ fi.effective_height()-1;
|
|
||||||
if (align== "LEFT") cf.set_x(fi.x());
|
|
||||||
if (align== "RIGHT") cf.set_x(fi.x()+ fi.width());
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
real x(valore);
|
|
||||||
if (x.is_real(valore)) // se e' un numero controlla che non sia uguale 0
|
|
||||||
{
|
|
||||||
if (x != 0.0)
|
|
||||||
valore = x.string(picture);
|
|
||||||
else
|
|
||||||
valore = "";
|
|
||||||
}
|
|
||||||
// altrimenti stampa la stringa cosi' com'e'
|
|
||||||
cf.set(valore);
|
|
||||||
cf.put_paragraph(valore);
|
|
||||||
cf.y() = save_y;
|
|
||||||
cf.set_x(save_x);
|
|
||||||
cf.height() = save_height;
|
|
||||||
return (TRUE);
|
|
||||||
} // fine _ALIGN
|
|
||||||
|
|
||||||
// Messaggio per stampare il numero di pagina corrente
|
|
||||||
if (code== "_PAGENO")
|
|
||||||
{
|
|
||||||
TString16 pg; pg << int(printer().getcurrentpage() );
|
|
||||||
cf.put_paragraph(pg);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Messaggio per stampare la data di oggi
|
|
||||||
if (code== "_DATA")
|
|
||||||
{
|
|
||||||
TString16 pg(TDate(TODAY).string());
|
|
||||||
cf.put_paragraph(pg);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (code== "_RIEPILOGOIVA")
|
if (code== "_RIEPILOGOIVA")
|
||||||
@ -826,7 +708,6 @@ bool TDocumento_form::validate(TForm_item &cf, TToken_string &s) {
|
|||||||
// 0 indica di non leggere il successivo codice IVA nella tabella riepilogativa
|
// 0 indica di non leggere il successivo codice IVA nella tabella riepilogativa
|
||||||
// 1 indica di leggere il successivo codice IVA nella tabella riepilogativa
|
// 1 indica di leggere il successivo codice IVA nella tabella riepilogativa
|
||||||
|
|
||||||
|
|
||||||
if (s.items() == 4)
|
if (s.items() == 4)
|
||||||
{
|
{
|
||||||
byte selector = byte(atoi(s.get())); // il primo parametro e' il selettore del tipo di codice
|
byte selector = byte(atoi(s.get())); // il primo parametro e' il selettore del tipo di codice
|
||||||
@ -841,21 +722,12 @@ bool TDocumento_form::validate(TForm_item &cf, TToken_string &s) {
|
|||||||
const bool next = what == "1"; // deve cambiare elemento ?
|
const bool next = what == "1"; // deve cambiare elemento ?
|
||||||
if (next) _doc->summary_set_next();
|
if (next) _doc->summary_set_next();
|
||||||
|
|
||||||
real x(value);
|
cf.set(value);
|
||||||
if (x.is_real(value))
|
|
||||||
{
|
|
||||||
TString picture(cf.picture());
|
|
||||||
if (x != ZERO)
|
|
||||||
value = x.string(picture); // Riformatta il valore
|
|
||||||
else
|
|
||||||
value = "";
|
|
||||||
}
|
|
||||||
cf.put_paragraph(value);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
error_box("Numero di parametri non corretto in _RIEPILOGOIVA");
|
error_box("Numero di parametri non corretto in _RIEPILOGOIVA");
|
||||||
return (TRUE);
|
return TRUE;
|
||||||
} // fine _RIEPILOGOIVA
|
} // fine _RIEPILOGOIVA
|
||||||
|
|
||||||
if (code == "_TOTIMPONIBILI")
|
if (code == "_TOTIMPONIBILI")
|
||||||
@ -867,12 +739,7 @@ bool TDocumento_form::validate(TForm_item &cf, TToken_string &s) {
|
|||||||
byte sel = atoi(s.get());
|
byte sel = atoi(s.get());
|
||||||
real x = sel == 0 ? _doc->imponibile(TRUE): _doc->tot_imponibili(sel);
|
real x = sel == 0 ? _doc->imponibile(TRUE): _doc->tot_imponibili(sel);
|
||||||
|
|
||||||
TString picture(cf.picture());
|
cf.set(x.string());
|
||||||
if (x != 0.0)
|
|
||||||
valore = x.string(picture); // Riformatta il valore
|
|
||||||
else
|
|
||||||
valore = "";
|
|
||||||
cf.put_paragraph(valore);
|
|
||||||
return (TRUE);
|
return (TRUE);
|
||||||
} // fine _TOTIMPONIBILI
|
} // fine _TOTIMPONIBILI
|
||||||
|
|
||||||
@ -889,21 +756,12 @@ bool TDocumento_form::validate(TForm_item &cf, TToken_string &s) {
|
|||||||
TString what(s.get());
|
TString what(s.get());
|
||||||
TString value(_doc->scadenze_get(what));
|
TString value(_doc->scadenze_get(what));
|
||||||
|
|
||||||
real x(value);
|
|
||||||
if (x.is_real(value))
|
|
||||||
{
|
|
||||||
TString picture(cf.picture());
|
|
||||||
if (x != 0.0)
|
|
||||||
value = x.string(picture); // Riformatta il valore
|
|
||||||
else
|
|
||||||
value = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
what = s.get();
|
what = s.get();
|
||||||
const bool next = what == "1";
|
const bool next = what == "1";
|
||||||
if (next) _doc->scadenze_set_next();
|
if (next) _doc->scadenze_set_next();
|
||||||
cf.put_paragraph(value);
|
cf.set(value);
|
||||||
}
|
}
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return TForm::validate(cf, s); // se il codice del messaggio non è identificato viene passato alla funzione standard
|
return TForm::validate(cf, s); // se il codice del messaggio non è identificato viene passato alla funzione standard
|
||||||
|
@ -189,11 +189,11 @@ bool TTabelle_sconti::handle_check(TMask_field &f, KEY k)
|
|||||||
{
|
{
|
||||||
if (f.to_check(k))
|
if (f.to_check(k))
|
||||||
{
|
{
|
||||||
TEditable_field & check_field = (TEditable_field &) f.mask().field(f.dlg() + 100);
|
TEditable_field & check_field = f.mask().efield(f.dlg() + 100);
|
||||||
|
|
||||||
check_field.set(f.get());
|
check_field.set(f.get());
|
||||||
if (!check_field.check())
|
if (!check_field.check())
|
||||||
return check_field.error_box(check_field.get_warning());
|
return f.error_box(check_field.get_warning());
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,6 @@ BEGIN
|
|||||||
DISPLAY "Cod.pag." CODART[5,8]
|
DISPLAY "Cod.pag." CODART[5,8]
|
||||||
DISPLAY "Sconto@25" SCONTO
|
DISPLAY "Sconto@25" SCONTO
|
||||||
OUTPUT F_I_RICERCA CODCAT
|
OUTPUT F_I_RICERCA CODCAT
|
||||||
OUTPUT F_I_DESVEN -201->S0
|
|
||||||
OUTPUT F_I_RICERCA_SC CODART[1,2]
|
OUTPUT F_I_RICERCA_SC CODART[1,2]
|
||||||
OUTPUT F_I_RICERCA_ZO CODART[3,4]
|
OUTPUT F_I_RICERCA_ZO CODART[3,4]
|
||||||
OUTPUT F_I_RICERCA_CO CODART[5,8]
|
OUTPUT F_I_RICERCA_CO CODART[5,8]
|
||||||
|
@ -78,7 +78,6 @@ BEGIN
|
|||||||
OUTPUT F_R_TIPO_RIGA TIPORIGA
|
OUTPUT F_R_TIPO_RIGA TIPORIGA
|
||||||
OUTPUT F_R_CODART_A CODART
|
OUTPUT F_R_CODART_A CODART
|
||||||
OUTPUT F_R_UM UM
|
OUTPUT F_R_UM UM
|
||||||
OUTPUT F_R_DESART LF_ANAMAG->DESCR
|
|
||||||
OUTPUT F_R_SCA NSCAGL
|
OUTPUT F_R_SCA NSCAGL
|
||||||
CHECKYTPE REQUIRED
|
CHECKYTPE REQUIRED
|
||||||
GROUP 1
|
GROUP 1
|
||||||
@ -125,7 +124,6 @@ BEGIN
|
|||||||
OUTPUT F_R_TIPO_RIGA TIPORIGA
|
OUTPUT F_R_TIPO_RIGA TIPORIGA
|
||||||
OUTPUT F_R_RFA_A CODART
|
OUTPUT F_R_RFA_A CODART
|
||||||
OUTPUT F_R_UM UM
|
OUTPUT F_R_UM UM
|
||||||
OUTPUT F_R_DESART RFA->S0
|
|
||||||
OUTPUT F_R_SCA NSCAGL
|
OUTPUT F_R_SCA NSCAGL
|
||||||
CHECKYTPE REQUIRED
|
CHECKYTPE REQUIRED
|
||||||
GROUP 2
|
GROUP 2
|
||||||
@ -170,7 +168,6 @@ BEGIN
|
|||||||
OUTPUT F_R_TIPO_RIGA TIPORIGA
|
OUTPUT F_R_TIPO_RIGA TIPORIGA
|
||||||
OUTPUT F_R_GRM_A CODART
|
OUTPUT F_R_GRM_A CODART
|
||||||
OUTPUT F_R_UM UM
|
OUTPUT F_R_UM UM
|
||||||
OUTPUT F_R_DESART GMC->S0
|
|
||||||
OUTPUT F_R_SCA NSCAGL
|
OUTPUT F_R_SCA NSCAGL
|
||||||
CHECKYTPE REQUIRED
|
CHECKYTPE REQUIRED
|
||||||
GROUP 3
|
GROUP 3
|
||||||
@ -215,7 +212,6 @@ BEGIN
|
|||||||
OUTPUT F_R_TIPO_RIGA TIPORIGA
|
OUTPUT F_R_TIPO_RIGA TIPORIGA
|
||||||
OUTPUT F_R_SGM_A CODART
|
OUTPUT F_R_SGM_A CODART
|
||||||
OUTPUT F_R_UM UM
|
OUTPUT F_R_UM UM
|
||||||
OUTPUT F_R_DESART GMC->S0
|
|
||||||
OUTPUT F_R_SCA NSCAGL
|
OUTPUT F_R_SCA NSCAGL
|
||||||
CHECKYTPE REQUIRED
|
CHECKYTPE REQUIRED
|
||||||
GROUP 3
|
GROUP 3
|
||||||
|
Loading…
x
Reference in New Issue
Block a user