Riportata la R_98_01_01M sul main trunk

git-svn-id: svn://10.65.10.50/trunk@5884 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 1998-01-09 16:33:25 +00:00
parent 37d71bc9d8
commit 7740b94e1c
31 changed files with 301 additions and 135 deletions

View File

@ -207,13 +207,13 @@ NUMERO 27 18
BEGIN
KEY "importo"
PROMPT 122 1 ""
FIELD 31->IMPORTO
PICTURE "###.###.###.###,@@"
MESSAGE _IMPORTO
PICTURE "###.###.###.###"
END
END
SECTION FOOTER ODD 2
SECTION FOOTER LAST 2
STRING 25
BEGIN
@ -231,11 +231,11 @@ END
NUMERO 28 18
BEGIN
KEY "Totale"
PROMPT 111 2 "TOTALE "
PICTURE "###.###.###.###,@@"
PROMPT 115 2 "TOTALE "
PICTURE "###.###.###.###"
MESSAGE _FOOTER,!TOTALE
END
END
END
END

View File

@ -19,7 +19,7 @@ class TVariazione_effetti: public TRelation_application
TMask *_msk;
TEffetto *_effetto;
TRelation *_rel;
TLocalisamfile *_reff, *_cess, *_com, * _doc, * _rdoc;
TLocalisamfile *_reff, *_cess, *_com, * _doc, * _rdoc, *_cfven, *_occas;
protected:
virtual void init_query_mode(TMask&);
virtual void init_insert_mode(TMask&);
@ -265,6 +265,8 @@ bool TVariazione_effetti::user_create()
_com = new TLocalisamfile(LF_COMUNI);
_doc = new TLocalisamfile(LF_DOC);
_rdoc = new TLocalisamfile(LF_RIGHEDOC);
_cfven = new TLocalisamfile(LF_CFVEN);
_occas = new TLocalisamfile(LF_OCCAS);
_effetto = new TEffetto;
_msk->set_handler(F_CODVAL, codval_handler);
_msk->set_handler(F_EFFCONT, contab_handler);
@ -286,6 +288,8 @@ bool TVariazione_effetti::user_destroy()
delete _com;
delete _doc;
delete _rdoc;
delete _cfven;
delete _occas;
return TRUE;
}

View File

@ -216,7 +216,7 @@ bool TEffetto::fatt(long num)
// restituisce i dati relativi alle fatture a cui si riferisce l'effetto
// costruendo una TToken_string del tipo
// "num_fatt0|data_fatt0|imp_fatt0|num_fatt1|data_fatt1|imp_fatt1|..."
TToken_string* TEffetto::dati_fatt(long num)
TToken_string* TEffetto::dati_fatt(long num, const bool valuta)
{
TToken_string* dati= new TToken_string;
dati->cut(0);
@ -229,8 +229,15 @@ TToken_string* TEffetto::dati_fatt(long num)
{
dati->add(righe_eff.get(REFF_NFATT));//prende il numero
dati->add(righe_eff.get(REFF_DATAFATT));//prende la data
dati->add(righe_eff.get(REFF_IMPFATT));//prende l' importo
dati->add(righe_eff.get(valuta ? REFF_IMPFATTVAL : REFF_IMPFATT));//prende l' importo
righe_eff.next();// passa alla riga successiva
}
return dati;
}
const bool TEffetto::in_valuta()
{
TString val = get(EFF_CODVAL);
val.upper();
return val.not_empty() && val != "LIT";
}

View File

@ -80,7 +80,8 @@ public:
// restituisce il numero della riga distinta a cui appartiene l'effetto estraendolo dal record
int nrgdist() const { return get_int(EFF_NRIGADIST); }
// restituisce l'importo dell'effetto
real importo() const { return get_real(EFF_IMPORTO); }
real importo(const bool valuta = FALSE) const { return get_real(valuta ? EFF_IMPORTOVAL : EFF_IMPORTO); }
const bool in_valuta() ;
// setta i campi per la quarta chiave del file
void put_key(TRectype& rec,char tipodist, long ndist, int nrigadist = 0);
// setta i campi per la prima chiave del file
@ -88,7 +89,7 @@ public:
// restituisce true se l'effetto si riferisce ad una sola fattura
bool fatt(long num);
// restituisce i dati relativi alle fatture a cui si riferisce l'effetto
TToken_string* dati_fatt(long num);
TToken_string* dati_fatt(long num, const bool valuta = FALSE);
// costruttore di default
TEffetto();
// costuisce l'effetto con il record passato

View File

@ -17,7 +17,16 @@
#define F_TIPOPAG 112
#define F_SHEET_RIBA 113
// Identificatori campi per lo spreadsheet Righe Distinta
// Identificatori campi per lo spreadsheet di selezione RiBa da aggiungere
// alla distinta (ef0300c.uml)
#define F_DADATA 201
#define F_ADATA 202
#define F_TIPORD 203
#define F_SHEET 204
#define F_TOTIMPDIST 205
#define F_IMPSEL 206
// Identificatori campi per lo spreadsheet Righe Distinta (ef0300b.uml ed ef0300d.uml)
#define F_CHECK 101
#define F_NRIBA 102
#define F_SCAD 103
@ -29,13 +38,5 @@
#define F_IMPORTO 109
#define F_IMPORTOVAL 110
// Identificatori campi per lo spreadsheet di selezione RiBa da aggiungere
// alla distinta
#define F_DADATA 101
#define F_ADATA 102
#define F_TIPORD 103
#define F_SHEET 104
#define F_TOTIMPDIST 105
#define F_IMPSEL 106
#endif // __EF0300_H

View File

@ -84,6 +84,7 @@ BEGIN
DISPLAY "Denominazione@50" S0
OUTPUT F_CODABIP CODTAB[1,5]
OUTPUT F_CODCABP CODTAB[6,10]
OUTPUT F_DENBANP S0
CHECKTYPE REQUIRED
VALIDATE REQIF_FUNC 1 F_CODCABP
WARNING "Banca assente"

View File

@ -64,5 +64,8 @@ BEGIN
END
ENDPAGE
ENDMASK
#include "ef0300d.uml"
#include "ef0300d.uml"

View File

@ -396,7 +396,7 @@ void TEmissione::print_rb(char tipost, int ndist, char tipodist, int ncopie, con
if (!is_vis)
pi = new TProgind(n,"Stampa Effetti...",FALSE,TRUE,10);
// ciclo sugli elementi del cursore di stampa
for (*fcur = 0; fcur->pos() < n; ++(*fcur))
//for (*fcur = 0; fcur->pos() < n; ++(*fcur))
{
if (!is_vis)
pi->addstatus(1L); // aggiorna la barra d'attesa
@ -510,7 +510,24 @@ bool TRiba_form::validate(TForm_item &cf, TToken_string &s)
{
const TString code(s.get(0));
TString valore;
if (code == "_BANCAP")
if (code == "_IMPORTO")
{
// gestione dei campi relativi all'importo dell'effetto. Setta il valore da
// solo se e' in valuta (cambia anche la picture)
// sintassi: _IMPORTO
TEffetto effetto(cursor()->file().curr());
TString picture(cf.picture());
const bool in_valuta = effetto.in_valuta();
real importo = effetto.importo(in_valuta);
if (in_valuta)
picture << ",@@@";
valore = importo.string(picture);
cf.set(valore);
cf.put_paragraph(valore);
cf.set("");
}
if (code == "_BANCAP")
{
// gestione dei campi relativi alla banca di presentazione dell'effetto
// sintassi: _BANCAP
@ -534,12 +551,13 @@ bool TRiba_form::validate(TForm_item &cf, TToken_string &s)
// "!A" fattura o fatture
// "!DATI" numero e data fattura
// "!IMPFATT" importo fattura
TCursor* fcur = cursor();
TLocalisamfile &eff = fcur->file(LF_EFFETTI);
TEffetto effetto = eff.curr();
//TCursor* fcur = cursor();
//TLocalisamfile &eff = fcur->file(LF_EFFETTI);
TEffetto effetto(cursor()->file().curr());// = eff.curr();
long num = effetto.numero();
const bool in_valuta = effetto.in_valuta();
bool condition = (effetto.fatt(num));//TRUE se effetto non raggruppato
TToken_string* dati = effetto.dati_fatt(num);
TToken_string* dati = effetto.dati_fatt(num, in_valuta);
TString in(s.get());
if (in[0]=='!')
{
@ -571,8 +589,11 @@ bool TRiba_form::validate(TForm_item &cf, TToken_string &s)
{
if (condition)
{
TString picture(cf.picture());
if (in_valuta)
picture << ",@@@";
real importo(dati->get(2));
cf.set(importo.string("###.###.###.###,@@"));
cf.set(importo.string(picture));
}
}
}
@ -615,7 +636,23 @@ bool TDistinta_form::validate(TForm_item &cf, TToken_string &s)
{
const TString code(s.get(0));
TString valore;
if (code == "_BANCAP")
if (code == "_IMPORTO")
{
// gestione dei campi relativi all'importo dell'effetto. Setta il valore da
// solo se e' in valuta (cambia anche la picture)
// sintassi: _IMPORTO
TEffetto effetto(cursor()->file().curr());
TString picture(cf.picture());
const bool in_valuta = effetto.in_valuta();
real importo = effetto.importo(in_valuta);
if (in_valuta)
picture << ",@@@";
valore = importo.string(picture);
cf.set(valore);
cf.put_paragraph(valore);
cf.set("");
}
if (code == "_BANCAP")
{
// gestione dei campi relativi alla banca di presentazione della distinta
// sintassi: _BANCAP
@ -665,9 +702,9 @@ bool TDistinta_form::validate(TForm_item &cf, TToken_string &s)
// sintassi: _FATT,<macro>
// dove: <macro> è uno delle macro seguenti:
// "!DATI" numero e data fattura
TCursor* fcur = cursor();
TLocalisamfile &eff = fcur->file(LF_EFFETTI);
TEffetto effetto = eff.curr();
//TCursor* fcur = cursor();
//TLocalisamfile &eff = fcur->file(LF_EFFETTI);
TEffetto effetto(cursor()->file().curr()); //= eff.curr();
long num = effetto.numero();
TToken_string* dati = effetto.dati_fatt(num);
int elem = dati->items();
@ -716,14 +753,15 @@ bool TDistinta_form::validate(TForm_item &cf, TToken_string &s)
if (in == "TOTALE")
{
real totale = 0.0;
TLocalisamfile &eff = fcur->file(LF_EFFETTI);
TString picture(cf.picture());
TEffetto effetto(fcur->file().curr());
const bool in_valuta = effetto.in_valuta();
if (in_valuta) // In una distinta le riba sono tutte della stessa valuta; quindi basta prenderne 1
picture << ",@@@";
TLocalisamfile& eff = fcur->file();
for (*fcur = 0; fcur->pos() < i; ++(*fcur))
{
TEffetto effetto = eff.curr();
real imp = (real)effetto.importo();
totale +=imp;
}
cf.set(totale.string("###.###.###.###,@@"));
totale += eff.get_real(in_valuta ? EFF_IMPORTOVAL : EFF_IMPORTO);
cf.set(totale.string(picture));
}
}
valore = cf.get();
@ -731,6 +769,7 @@ bool TDistinta_form::validate(TForm_item &cf, TToken_string &s)
cf.set("");
return (TRUE);
}
/*
if (code== "_PAGENO")
{
// messaggio per stampare il numero di pagina corrente
@ -738,6 +777,7 @@ bool TDistinta_form::validate(TForm_item &cf, TToken_string &s)
cf.set(pg); cf.put_paragraph(pg);
cf.set("");
}
*/
return TForm::validate(cf, s);
}

View File

@ -6,10 +6,10 @@ PAGE "Emissione Effetti e Distinte" -1 -1 77 19
RADIOBUTTON F_TIPOEMIS 76
BEGIN
PROMPT 1 0 " "
ITEM "1| Emissione RI.BA. su floppy"
ITEM "1|Emissione RI.BA. su floppy"
MESSAGE DISABLE,2@|DISABLE,4@|DISABLE,5@
MESSAGE ENABLE,1@
ITEM "2| Emissione RI.BA. su moduli cartacei"
ITEM "2|Emissione RI.BA. su moduli cartacei"
MESSAGE DISABLE,1@
MESSAGE ENABLE,2@
END
@ -23,9 +23,9 @@ LIST F_TIPODIST 18
BEGIN
PROMPT 2 5 "Tipo Distinta "
KEY 4
ITEM "I| All'incasso"
ITEM "B| Salvo buon fine"
ITEM "S| Allo sconto"
ITEM "I|All'incasso"
ITEM "B|Salvo buon fine"
ITEM "S|Allo sconto"
END
NUMBER F_NUMBER 5
@ -63,8 +63,8 @@ END
LIST F_UNITA 9
BEGIN
PROMPT 2 8 "Unità di output "
ITEM "a| Drive A"
ITEM "b| Drive B"
ITEM "a|Drive A"
ITEM "b|Drive B"
GROUP 1
END
@ -87,9 +87,9 @@ END
LIST F_EMIS 20
BEGIN
PROMPT 2 11 "Emissione "
ITEM "1| Emissione effetti"
ITEM "1|Emissione effetti"
MESSAGE DISABLE,4@|ENABLE,5@
ITEM "2| Emissione distinta"
ITEM "2|Emissione distinta"
MESSAGE ENABLE,4@|DISABLE,5@
GROUP 2
END
@ -105,16 +105,16 @@ END
LIST F_TIPORD 14
BEGIN
PROMPT 2 13 "Tipo Ordinamento "
ITEM "S| Scadenza "
ITEM "F| Fattura "
ITEM "S|Scadenza "
ITEM "F|Fattura "
GROUP 4
END
LIST F_TIPOST 14
BEGIN
PROMPT 43 12 "Tipo di Stampa "
ITEM "P| Provvisoria"
ITEM "D| Definitiva"
ITEM "P|Provvisoria"
ITEM "D|Definitiva"
GROUP 2
END

View File

@ -34,15 +34,14 @@ BEGIN
KEY "data scadenza"
PROMPT 50 2 ""
FIELD 31->DATASCAD
FORMAT "2444/"
END
NUMERO 2 18
BEGIN
KEY "importo"
PROMPT 70 2 ""
FIELD 31->IMPORTO
PICTURE "###.###.###.###,@@"
MESSAGE _IMPORTO
PICTURE "###.###.###.###"
END
STRING 3 50
@ -104,6 +103,7 @@ BEGIN
KEY "importo fattura"
PROMPT 73 10 ""
MESSAGE _FATT,!IMPFATT
PICTURE "###.###.###.###"
END
STRING 11 30 2
@ -188,4 +188,4 @@ END
END
END
END

View File

@ -1,11 +0,0 @@
[AREADICH_001]
Caption = "Dichiarazioni"
Picture = <ba00.bmp>
Module = 0
Item_01 = "Modello 740", "740 -t -cCONF740.FPW", ""
Item_02 = "Modello 750", "750 -t -cCONF750.FPW", ""
Item_03 = "Modello 760", "760 -t -cCONF760.FPW", ""
Item_04 = "Modello 770", <77prassi.men>
Item_05 = "Dichiarazione IVA", "miva -t", ""
Item_06 = "Gestione ICI", "gici -t /cPRAWIN.INI", ""

View File

@ -11,6 +11,7 @@ BEGIN
DISPLAY "Descrizione@50" S0
OUTPUT F_INIZIO1 CODTAB[1,1]
GROUP 1
NUM_EXPR #F_FINE1>=#F_INIZIO1
CHECKTYPE NORMAL
END
@ -23,6 +24,7 @@ BEGIN
COPY DISPLAY F_INIZIO1
OUTPUT F_FINE1 CODTAB
GROUP 2
NUM_EXPR #F_FINE1>=#F_INIZIO1
CHECKTYPE NORMAL
END
@ -35,6 +37,7 @@ END
STRING F_INIZIO2 20
BEGIN
FLAGS "U"
PROMPT 28 1 "Dal gruppo "
FIELD LF_TABCOM->CODTAB[2,20]
USE GCA SELECT CODTAB[1,1]==#F_INIZIO1
@ -43,21 +46,22 @@ BEGIN
DISPLAY "Codice " CODTAB[2,20]
DISPLAY "Descrizione@50" S0
OUTPUT F_INIZIO2 CODTAB[2,20]
OUTPUT F_INIZIO1 CODTAB[1,1]
// OUTPUT F_INIZIO1 CODTAB[1,1]
GROUP 1
CHECKTYPE NORMAL
END
STRING F_FINE2 20
BEGIN
FLAGS "U"
PROMPT 28 3 " Al gruppo "
FIELD LF_TABCOM->CODTAB[2,20]
USE GCA SELECT CODTAB[1,1]==#F_FINE1
INPUT CODTAB[1,1] F_FINE1
USE GCA SELECT CODTAB[1,1]==#F_INIZIO1
INPUT CODTAB[1,1] F_INIZIO1
INPUT CODTAB[2,20] F_FINE2
COPY DISPLAY F_INIZIO2
OUTPUT F_FINE2 CODTAB[2,20]
OUTPUT F_FINE1 CODTAB[1,1]
// OUTPUT F_FINE1 CODTAB[1,1]
GROUP 2
CHECKTYPE NORMAL
END

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

After

Width:  |  Height:  |  Size: 94 KiB

View File

@ -221,11 +221,17 @@ bool TMask_tabmag::numlivart_handler(TMask_field& f, KEY k)
// HANDLER DEL CODICE LIVELLO anagrafica
bool TMask_tabmag::codgrp_handler(TMask_field& f, KEY k)
{
if ((k == K_TAB && f.focusdirty())||k == K_ENTER )
if ((k == K_TAB && f.focusdirty() )||k == K_ENTER )
{
TMask_tabmag & myself=((TMask_tabmag &)f.mask());
if (!(myself.cod_liv->fit_to_format(f.get(),myself.get_int(F_CODLIV))))
if (!myself.cod_liv->enabled())
{
f.error_box("Livelli del codice non abilitati");
return FALSE;
}
if (!f.empty() && !(myself.cod_liv->fit_to_format(f.get(),myself.get_int(F_CODLIV))))
{
f.error_box("Codice non corrispondente al formato previsto");
return FALSE;

View File

@ -6,10 +6,12 @@
#include <tabutil.h>
#include <urldefid.h>
#include <utility.h>
#include "mglib.h"
#include "mg0200.h"
class TStampa_tabmag : public TApplication
{
TCodice_livelli * _cod_liv;
TMask * _mask;
TForm * _form;
@ -18,10 +20,46 @@ protected:
virtual bool create();
virtual bool destroy();
virtual bool menu(MENU_TAG);
static bool hnd_livinizio(TMask_field &, KEY); // handler
static bool hnd_livfine(TMask_field &, KEY); // handler
public:
const TCodice_livelli & liv_cod()
{return *_cod_liv;}
};
bool TStampa_tabmag::hnd_livinizio(TMask_field &f, KEY k)
{
if (f.empty())
{
f.set("1");
}
return TRUE;
}
bool TStampa_tabmag::hnd_livfine(TMask_field &f, KEY k)
{
const TCodice_livelli &codliv = ((TStampa_tabmag &)main_app()).liv_cod();
if (f.empty())
{
f.set(codliv.last_level());
}
if (f.focusdirty())
{
TMask & m=f.mask();
const bool enab=(m.get(F_INIZIO1)==f.get() && m.get_bool(F_DETTAGLIO));
m.enable(F_INIZIO2,enab );
m.enable(F_FINE2,enab );
}
return TRUE;
}
void TStampa_tabmag::set_print(TString & tabname)
{
const short begin=_cod_liv->code_start(_mask->get_int(F_INIZIO1)),
end= begin+_cod_liv->code_length(_mask->get_int(F_INIZIO1))-1;
TString filter;
TRectype from_rec(LF_TAB),to_rec(LF_TAB);
from_rec.put("COD",tabname);
@ -30,11 +68,12 @@ void TStampa_tabmag::set_print(TString & tabname)
to_rec.put("CODTAB",_mask->get(F_FINE1));
if (tabname=="FCA" || tabname=="FCG") {
if (*_mask->get(F_INIZIO2))
filter << "500@->CODTAB[2,20]>=" << _mask->get(F_INIZIO2);
if (filter.not_empty())
filter << "&&";
filter << "500@->CODTAB[" << begin << "," << end << "]>=" << '"' <<_mask->get(F_INIZIO2) << '"' ;
if (*_mask->get(F_FINE2))
filter << "500@->CODTAB[2,20]<=" << _mask->get(F_FINE2);
{
if (filter.not_empty()) filter << "&&";
filter << "500@->CODTAB[" << begin << "," << end << "]<=" << '"' << _mask->get(F_FINE2) << '"' ;
}
_form->find_field('B',odd_page,"GRUPPI").show(_mask->get_bool(F_DETTAGLIO));
}
_form->cursor()->setregion(from_rec,to_rec);
@ -59,6 +98,12 @@ bool TStampa_tabmag::menu(MENU_TAG)
formname << tabname;
_mask = new TMask(maskname);
_mask->set_handler(F_INIZIO1,hnd_livinizio);
_mask->set_handler(F_FINE1,hnd_livfine);
if (tabname=="FCA")
_cod_liv = new TCodart_livelli();
else
_cod_liv = new TCodgiac_livelli();
while ((_mask->run() == K_ENTER)) {
_form = new TForm(formname);
set_print(tabname);
@ -71,6 +116,7 @@ bool TStampa_tabmag::menu(MENU_TAG)
bool TStampa_tabmag::destroy()
{
delete _mask;
delete _cod_liv;
return TRUE;
}

View File

@ -227,13 +227,14 @@ bool TMask_movmag::update_rigamov (int r, const char * old_codcaus)
ss.insert(r+1);
ss.row(r+1)=ss.row(r);
} else {
codmag=ss.cell(r+1,ss.cid2index(F_CODMAG));
coddep=ss.cell(r+1,ss.cid2index(F_CODDEP));
ss.row(r+1)=ss.row(r);
}
//codmag=ss.cell(r,ss.cid2index(F_CODMAG));
//coddep=ss.cell(r,ss.cid2index(F_CODDEP));
//ss.row(r+1).add(codmag,ss.cid2index(F_CODMAG));
//ss.row(r+1).add(coddep,ss.cid2index(F_CODDEP));
ss.row(r+1).add(prezzo.string(),ss.cid2index(F_PREZZO));
ss.row(r+1).add(codmag,ss.cid2index(F_CODMAG));
ss.row(r+1).add(coddep,ss.cid2index(F_CODDEP));
ss.row(r+1).add(cau.caus_collegata(),ss.cid2index(F_CAUSRIG));
ss.row(r+1).add(TString(1,riga_automatica),ss.cid2index(F_AUTOMATICA));
ss.check_row(r+1);

View File

@ -31,8 +31,10 @@ bool TMask_buildmov::handle_annoes(TMask_field &fld, KEY k)
TMask_buildmov &mask=(TMask_buildmov &)fld.mask();
if (fld.get().empty())
{
// DEFAULT
fld.set(mask.esercizi.date2esc(mask.get_date(F_DATA)));
// DEFAULT
const long esc=mask.esercizi.date2esc(mask.get_date(F_DATA));
if (esc!=0)
fld.set(esc);
}
if (k == K_TAB && fld.focusdirty())
{

View File

@ -1,14 +1,14 @@
#include "mg1200.h"
TOOLBAR "" 0 20 60 2
TOOLBAR "" 0 20 40 2
BUTTON DLG_OK 14 2
BEGIN
PROMPT -13 -1 "Ricostruisci"
PROMPT -12 -1 "Ricostruisci"
END
BUTTON DLG_CANCEL 14 2
BEGIN
PROMPT -23 -1 "Annulla"
PROMPT -22 -1 "Annulla"
END
ENDPAGE
@ -16,7 +16,7 @@ PAGE "Ricostruzione movimenti" 11 50 10
DATE F_DATA
BEGIN
FLAGS "DA"
FLAGS "HDA"
PROMPT 1 1 "Anno attuale"
MESSAGE "0",F_ANNOES
END
@ -26,9 +26,9 @@ BEGIN
PROMPT 2 3 "Codice esercizio "
USE ESC
INPUT CODTAB F_ANNOES
DISPLAY "Esercizio" CODTAB
DISPLAY "Dal@12" D0
DISPLAY "Al@12" D0
DISPLAY "Esercizio@20" CODTAB
DISPLAY "Dal@20" D0
DISPLAY "Al@20" D1
OUTPUT F_ANNOES CODTAB
CHECKTYPE REQUIRED
END

View File

@ -79,6 +79,8 @@ Item_07 = "Categorie acquisti articoli", "ba3 -0 CAA", ""
Item_08 = "Raggrupp. fiscali articoli", "ba3 -0 RFA", ""
Item_09 = "Raggruppamenti causali magazzino", "mg0 -0 %RFC", ""
Item_10 = "Causali magazzino", "mg0 -0 %CAU", ""
Item_11 = "Gruppi codice articoli", "mg0 -0 GCA", ""
Item_12 = "Gruppi codice giacenze", "mg0 -0 GCG", ""
[MGAREA_007]
Caption = "Stampa tabelle"
@ -138,6 +140,8 @@ Item_06 = "Categorie acquisti articoli", "ba3 -1 CAA", ""
Item_07 = "Raggrupp. fiscali articoli", "ba3 -1 RFA", ""
Item_08 = "Raggruppamenti causali magazzino", "ba3 -1 %RFC", ""
Item_09 = "Causali magazzino", "ba3 -1 %CAU", ""
Item_10 = "Formato e gruppi codice articoli", "mg0 -1 FCA", ""
Item_11 = "Formato e gruppi codice giacenze", "mg0 -1 FCG", ""
[MGAREA_012]
Caption = "Gestione archivi di base"
@ -152,7 +156,7 @@ Item_05 = "Sconti clienti", "ba3 -0 %SCC", ""
Item_06 = "Sconti incondizionati", "ve2 -0 i", ""
Item_07 = "Sconti di riga", "ve2 -0 r", ""
Item_08 = "Clienti/Fornitori", "cg0 -1", "F"
Item_09 = "Agenti", "sv0 -4", ""
Item_09 = "Agenti", "pr0 -4", ""
[MGAREA_013]
Caption = "Stampa archivi di base"
@ -167,7 +171,7 @@ Item_05 = "Sconti clienti", "ba3 -1 %SCC", ""
Item_06 = "Sconti incondizionati", "ve3 -0 i", ""
Item_07 = "Sconti di riga", "ve3 -0 r", ""
Item_08 = "Clienti/Fornitori", "cg1 -1", "F"
Item_09 = "Agenti", "sv1 -0", ""
Item_09 = "Agenti", "pr1 -0", ""
[MGAREA_019]
Caption = "Servizi"

View File

@ -410,6 +410,7 @@ public:
virtual void synchronize_bodies();
virtual int remove(TBaseisamfile& f) const ;
void add_automatiche();
virtual void zero(char c = '\0');// azzeramento ;
virtual int write(TBaseisamfile& f) const ;
virtual int rewrite(TBaseisamfile& f) const ;
int force_update_bal();

View File

@ -109,7 +109,8 @@ void TArticolo::set_body_key(TRectype & rowrec)
int TArticolo::read(TRectype & rec, word op, word lockop)
{
if (op == _isequal && lockop == _nolock && strcmp (rec.get(ANAMAG_CODART), (const char *) (*_codice)) == 0)
TString compstr((const char *) *_codice);
if (op == _isequal && lockop == _nolock && strcmp (rec.get(ANAMAG_CODART), (const char *) (compstr)) == 0)
return NOERR;
*_codice = rec.get(ANAMAG_CODART);
@ -123,8 +124,9 @@ int TArticolo::read(TRectype & rec, word op, word lockop)
int TArticolo::read(const char * cod, word op, word lockop)
{
put(ANAMAG_CODART,cod);
return read( *this, op, lockop);
TRectype tmp(*this);
tmp.put(ANAMAG_CODART,cod);
return read( tmp, op, lockop);
}
const TString & TArticolo::descrizione(const char* lingua) const
@ -173,14 +175,29 @@ bool TArticolo::unlock()
bool TArticolo::lock_and_prompt()
{
TString mess;
mess << "Il record di anagrafica dell'articolo ''"<< codice() << "'' risulta essere già in uso.\n Interrompo ?";
TTimed_breakbox bbox((const char *)mess,10);
int err;
do {
TLocalisamfile anag(LF_ANAMAG);
anag.curr()=*this;
if (anag.read(_isequal,_testandlock)==NOERR)
return TRUE;
} while (bbox.run()!=K_ESC);
err=anag.read(_isequal,_testandlock);
switch (err)
{
case NOERR:
return TRUE;
case _islocked:
{
mess.cut(0);
mess << "Il record di anagrafica dell'articolo ''"<< codice() << "'' risulta essere già in uso.\n Interrompo ?";
break;
}
default:
mess.cut(0);
mess << "Non riesco ad accedere al record di anagrafica dell'articolo ''"<< codice() << "'' \n Interrompo ?";
}
TTimed_breakbox bbox((const char *)mess,10);
if (bbox.run()==K_ESC)
return FALSE;
} while (TRUE);
return FALSE;
}
@ -1039,6 +1056,15 @@ TMov_mag::~TMov_mag()
{
}
void TMov_mag::zero(char c)
{
TMultiple_rectype::zero(c);
lines_to_add.destroy();
lines_to_subtract.destroy();
}
// valuta il valore della chiave per un nuovo record
bool TMov_mag::renum()
{
@ -1115,16 +1141,16 @@ void TMov_mag::add_automatiche()
int TMov_mag::write(TBaseisamfile& f) const
{
int res;
((TMov_mag *)this)->add_automatiche();
// memorizza le variazioni
TMov_mag &myself=((TMov_mag &)*this);
myself.add_automatiche();
const int nrows = rows();
for (int i = 1; i <= nrows; i++)
((TMov_mag *)this)->line_inserted(line2key(i), line2data(i));
myself.line_inserted(line2key(i), line2data(i));
if ((res=TMultiple_rectype::write(f))==NOERR )
// effettua la variazione dei saldi
((TMov_mag *)this)->update_balances();
myself.update_balances();
return res;
}
@ -1302,12 +1328,15 @@ int TMov_mag::update_balances()
while (curr_key) {
curr_art.read((const char *)key2field(*curr_key,"CODART"));
if (curr_art.lock_and_prompt()) {
// lock gained
TLine_movmag & line_mov=(TLine_movmag &)lines_to_add[*curr_key];
TCausale_magazzino & causmag=(TCausale_magazzino &)cache_causali.get(line_mov.codcaus());
if (causmag.update_ultcos())
{
curr_art.update_ultcosti(line_mov.prezzo(),get_date("DATACOMP"));
// lock gained
curr_art.rewrite();
}
giac_putkey(mag,get("ANNOES"),*curr_key);
if (mag.read()!=NOERR) {
// non trovato: aggiungo

View File

@ -3,10 +3,18 @@ Caption = "Gestione magazzino"
Picture = <mg01.bmp>
Module = 0
Flags = ""
Item_01 = "Tabelle", [PRASSIMG_061]
Item_05 = "Movimenti", [PRASSIMG_063]
Item_06 = "Stampe", [PRASSIMG_064]
Item_08 = "Configurazione magazzino", [PRASSIMG_099]
[PRASSIMG_061]
Caption = "Tabelle di magazzino"
Picture = <mg01.bmp>
Item_02 = "Gestione tabelle", [MGAREA_006]
Item_03 = "Stampa tabelle", [MGAREA_011]
[PRASSIMG_063]
Caption = "Movimenti di magazzino"
Picture = <mg01.bmp>

View File

@ -25,6 +25,7 @@ int main( int argc, char** argv )
error_box( usage, argv[0] );
break;
}
exit(0);
return rt;
}

View File

@ -521,6 +521,9 @@ TMask* TMotore_application::get_mask( int mode )
msk1->set_handler( F_CODNOTE, note_hndl );
msk1->set_handler( F_DATADOC, data_hndl );
msk1->set_handler( 99, elabora_handler ); // cazzo !!!!!!
#ifndef DBG
msk1->disable(99);
#endif
msk1->set_handler( DLG_PRINT, print_handler );
int numhandler = pro( ).get_int( "NHANDLER", "HANDLERS" ); // prof
for ( i = 1; i <= numhandler; i ++ )

View File

@ -155,7 +155,7 @@ SIZE=20
[PAIVA]
// il campo e' letto nel file 20 clifo
GROUP=100
X=35
X=38
Y=1
MSKID=F_PAIVA
TYPE=T_STRINGA

View File

@ -322,14 +322,14 @@ bool TMask_anamag::handle_stoanno(TMask_field &fld, KEY k)
{
TSheet_field &fld_stomag= (TSheet_field &)fld.mask().field(F_SHEETSTOMAG);
if (mask.get_int(F_STOANNO) >=mask.esercizi_contabili().last())
/*if (mask.get_int(F_STOANNO) >=mask.esercizi_contabili().last())
{
fld.error_box("Impossibile dare la composizione delle rimanenze per l'ultimo anno");
mask.reset(F_STOANNO);
}
}*/
if (mask.get(F_STOANNO).empty() )
{
mask.set(F_STOANNORIF, max(mask.esercizi_contabili().first(),mask.esercizi_contabili().pred(mask.get_int(F_ANNORIF))) );
mask.set(F_STOANNORIF, mask.esercizi_contabili().last()) ;
mask.set(F_STOANNO, mask.get(F_STOANNORIF));
}
if ( fld.focusdirty() && mask.last_annosto>0 && mask.last_annosto!=fld.mask().get_int(F_STOANNO))
@ -520,12 +520,12 @@ int TMask_anamag::add_totali_storico(TString & codmag)
real totq,totval;
TLocalisamfile mag(LF_MAG);
mag.setkey(2);
mag.put(MAG_ANNOES,esercizi_contabili().next(get_int(F_STOANNORIF)));
mag.put(MAG_ANNOES,get(F_STOANNORIF));
//mag.put(MAG_CODART,get(F_CODART));
mag.put(MAG_CODMAG,codmag);
mag.read();
while (!mag.eof()
&& esercizi_contabili().next(get_int(F_STOANNORIF))==mag.get_int(MAG_ANNOES)
&& get_int(F_STOANNORIF)==mag.get_int(MAG_ANNOES)
&& strncmp((const char *)codmag,mag.get(MAG_CODMAG),3)==0)
{
if (get(F_CODART)==mag.get(MAG_CODART))
@ -611,15 +611,16 @@ bool TMask_anamag::check_totali_storico()
TSheet_field &s =(TSheet_field &)field(F_SHEETSTOMAG);
for (int r=0 ; r< s.items() ; r++)
{
// rintraccia il totale
for (; r< s.items() && *s.cell(r,s.cid2index(F_STOTIPORIGA))!=SIMBOLO_TOTALI; r++) ;
real totq1(s.cell(r,s.cid2index(F_STOQUANT))),totq2(s.cell(r+1,s.cid2index(F_STOQUANT)));
if (totq1!=totq2)
if (!yesno_box("La somma delle composizioni dello storico \nper il magazzino %s non corrisponde \nalla rimanenza dell'esercizio successivo\n Proseguo ugualmente ?",
if (!yesno_box("La somma delle composizioni dello storico \nper il magazzino %s non corrisponde \nalla rimanenza iniziale.\n Proseguo ugualmente ?",
(const char *)s.cell(r,s.cid2index(F_STOCODMAG))))
return FALSE;
real totval1(s.cell(r,s.cid2index(F_STOVAL))),totval2(s.cell(r+1,s.cid2index(F_STOVAL)));
if (totval1!=totval2)
return yesno_box("La somma del valore delle composizioni dello storico \n per il magazzino %s non corrisponde \nal valore della rimanenza dell'esercizio successivo\n Proseguo ugualmente ?",
return yesno_box("La somma del valore delle composizioni dello storico \n per il magazzino %s non corrisponde \nal valore della rimanenza iniziale.\n Proseguo ugualmente ?",
(const char *)s.cell(r,s.cid2index(F_STOCODMAG)));
r++;
}
@ -692,7 +693,15 @@ bool TMask_anamag::notify_sheet_sto(TSheet_field &s, int r, KEY k)
break;
case (K_ENTER): // fine modifica
newanno=(s.cell(r,s.cid2index(F_STOANNOES)));
newcodmag=(s.cell(r,s.cid2index(F_STOCODMAG)));
if (m.esercizi_contabili()[atoi(newanno)].inizio() >= m.esercizi_contabili()[m.get_int(F_STOANNO)].inizio())
{
s.row(r).add(oldanno,s.cid2index(F_STOANNOES));
s.error_box("La rimanenza iniziale di un esercizio deve essere composta da parti provenienti da esercizi precedenti");
return FALSE;
}
// modifica
m.update_totali_storico(newcodmag);
if (oldcodmag==s.cell(r,s.cid2index(F_STOCODMAG)))
@ -703,6 +712,12 @@ bool TMask_anamag::notify_sheet_sto(TSheet_field &s, int r, KEY k)
m.remove_totali_storico(oldcodmag);
}
case (K_CTRL + K_INS ): // fine inserimento
if (*s.cell(r,s.cid2index(F_STOCODMAG))==' ' && m.magazzini().standardmag().not_empty())
{
// new line
s.row(r).add(m.magazzini().standardmag(),s.cid2index(F_STOCODMAG));
}
newcodmag=(s.cell(r,s.cid2index(F_STOCODMAG)));
newanno=(s.cell(r,s.cid2index(F_STOANNOES)));
if (newcodmag != " ")
@ -729,10 +744,6 @@ bool TMask_anamag::notify_sheet_sto(TSheet_field &s, int r, KEY k)
break;
case (K_INS): // richiesta di inserimento
if (m.magazzini().standardmag().not_empty())
{
s.row(r).add(m.magazzini().standardmag(),s.cid2index(F_STOCODMAG));
}
break;
}
@ -960,11 +971,13 @@ void TMask_anamag::ricalcola_giacenze()
{
TLocalisamfile mag(LF_MAG),stomag(LF_STOMAG);
int annoes=esercizi_contabili().first();
// ciclo sugli esercizi
do {
mag.zero();
mag.put(MAG_ANNOES,annoes);
mag.put(MAG_CODART,get(F_CODART));
mag.read();
mag.read(_isgteq);
// ciclo per le giacenze di questo esercizio
while (!mag.eof() && get(F_CODART)==mag.get(MAG_CODART) && annoes==mag.get_int(MAG_ANNOES))
{
mag.put(MAG_LIVRIOR,mag.get_real(MAG_LIVRIOR)*fc); // update ..
@ -984,27 +997,27 @@ void TMask_anamag::ricalcola_giacenze()
mag.put(MAG_PRODCOMP,mag.get_real(MAG_PRODCOMP)*fc);
mag.put(MAG_PRODFIN,mag.get_real(MAG_PRODFIN)*fc);
mag.put(MAG_SCORTAMIN,mag.get_real(MAG_SCORTAMIN)*fc);
// valori
mag.put(MAG_VALACQ,mag.get_real(MAG_VALACQ)*fc);
// i valori non vanno aggiornati !
/*mag.put(MAG_VALACQ,mag.get_real(MAG_VALACQ)*fc);
mag.put(MAG_VALENT,mag.get_real(MAG_VALENT)*fc);
mag.put(MAG_VALVEN,mag.get_real(MAG_VALVEN)*fc);
mag.put(MAG_VALUSC,mag.get_real(MAG_VALUSC)*fc);
mag.put(MAG_VALORDC,mag.get_real(MAG_VALORDC)*fc);
mag.put(MAG_VALORDF,mag.get_real(MAG_VALORDF)*fc);
mag.put(MAG_VALRIM,mag.get_real(MAG_VALRIM)*fc);
mag.put(MAG_VALSCARTI,mag.get_real(MAG_VALSCARTI)*fc);
mag.put(MAG_VALSCARTI,mag.get_real(MAG_VALSCARTI)*fc); */
mag.rewrite();
mag.next();
}
stomag.zero();
stomag.put(MAG_ANNOES,annoes);
stomag.put(MAG_CODART,get(F_CODART));
stomag.read();
while (!stomag.eof() && get(F_CODART)==stomag.get(MAG_CODART) && annoes==mag.get_int(MAG_ANNOES))
stomag.put(STOMAG_ANNOESRIF,annoes);
stomag.put(STOMAG_CODART,get(F_CODART));
stomag.read(_isgteq);
// ciclo per lo storico di questo esercizio
while (!stomag.eof() && get(F_CODART)==stomag.get(STOMAG_CODART) && annoes==stomag.get_int(STOMAG_ANNOESRIF))
{
stomag.put(STOMAG_QUANT,mag.get_real(STOMAG_QUANT)*fc); // update ..
stomag.put(STOMAG_VALORE,mag.get_real(STOMAG_VALORE)*fc);
stomag.put(STOMAG_QUANT,stomag.get_real(STOMAG_QUANT)*fc); // update ..
stomag.rewrite();
stomag.next();

View File

@ -949,7 +949,7 @@ END
STRING F_STOANNORIF 4 // anno usato per il write dell'annata precedente
BEGIN
PROMPT 2 6 "Composizione rimanenze a fine "
PROMPT 2 6 "Composizione rimanenze iniziali del "
FLAGS "DP"
END

View File

@ -112,6 +112,7 @@ bool TStampa_sconti::create()
TMask choose("VE3100"); // istanzia la maschera di scelta del tipo di tabella
if (choose.run() == K_ENTER) _sconti= choose.get(F_TIPOSC); // prende il tipo di tabella dalla maschera
}
_sconti.upper();
switch (_sconti[0])
{
case 'D': // sconti documento
@ -135,7 +136,8 @@ bool TStampa_sconti::create()
_cve = new TTable("CVE");
_zon = new TTable("%ZON");
_cpg = new TTable("%CPG");
dispatch_e_menu(BAR_ITEM(1));
if (gotcha)
dispatch_e_menu(BAR_ITEM(1));
return (gotcha);
}

View File

@ -3,7 +3,7 @@ JOIN 34 INTO CODNUM==CODNUM ANNO==ANNO PROVV==PROVV NDOC==NDOC
JOIN 16 TO 33 INTO TIPOCF==TIPOCF CODCF==CODCF CODIND==CODINDSP
JOIN 47 TO 34 INTO CODART==CODART
JOIN %CPG TO 33 ALIAS 201 INTO CODTAB==CODPAG
JOIN 122 TO 33 ALIAS 202 INTO CODTAB==CODAG
JOIN 122 TO 33 ALIAS 202 INTO CODAGE==CODAG
JOIN %POR TO 33 ALIAS 203 INTO CODTAB==CODPORTO
JOIN %BAN TO 33 ALIAS 204 INTO CODTAB==CODABIA+CODCABA
JOIN %VET TO 33 ALIAS 205 INTO CODTAB==CODVETT1
@ -244,7 +244,7 @@ STRING 29 28 1
BEGIN
KEY "nome agente"
PROMPT 33 29 ""
FIELD 202@->S0
FIELD 202@->RAGSOC
END
END

View File

@ -3,7 +3,7 @@ JOIN 34 INTO CODNUM==CODNUM ANNO==ANNO PROVV==PROVV NDOC==NDOC
JOIN 16 TO 33 INTO TIPOCF==TIPOCF CODCF==CODCF CODIND==CODINDSP
JOIN 47 INTO CODART==CODART
JOIN %CPG TO 33 ALIAS 201 INTO CODTAB==CODPAG
JOIN 122 TO 33 ALIAS 202 INTO CODTAB==CODAG
JOIN 122 TO 33 ALIAS 202 INTO CODAGE==CODAG
JOIN %POR TO 33 ALIAS 203 INTO CODTAB==CODPORTO
JOIN %BAN TO 33 ALIAS 204 INTO CODTAB==CODABIA+CODCABA
JOIN %VET TO 33 ALIAS 205 INTO CODTAB==CODVETT1
@ -252,7 +252,7 @@ STRING 29 28 1
BEGIN
KEY "nome agente"
PROMPT 33 29 ""
FIELD 202@->S0
FIELD 202@->RAGSOC
FLAGS "D"
END

View File

@ -6,7 +6,7 @@ JOIN 16 TO 33 INTO TIPOCF==TIPOCF CODCF==CODCF CODIND==CODINDSP
JOIN 16 TO 17 ALIAS 116 INTO TIPOCF==TIPOCF CODCF==CODCF CODIND==CODINDSP
JOIN 47 TO 34 INTO CODART==CODART
JOIN %CPG TO 33 ALIAS 201 INTO CODTAB==CODPAG
JOIN 122 TO 33 ALIAS 202 INTO CODAGE==CODAG
JOIN 122 TO 33 ALIAS 202 INTO CODAGE==CODAG
JOIN %POR TO 33 ALIAS 203 INTO CODTAB==CODPORTO
JOIN %BAN TO 33 ALIAS 204 INTO CODTAB==CODABIA+CODCABA
JOIN %VET TO 33 ALIAS 205 INTO CODTAB==CODVETT1