diff --git a/ve/batbnum.uml b/ve/batbnum.uml index 22b674025..d02916689 100755 --- a/ve/batbnum.uml +++ b/ve/batbnum.uml @@ -82,7 +82,7 @@ PAGE "Tipi documento validi" -1 -1 60 14 BEGIN PROMPT 2 2 "Tipo dei documenti " FIELD I1 - ITEM "0|Altro" + ITEM "|Altro" ITEM "1|Bolla" ITEM "2|Fattura" ITEM "3|Ordine" diff --git a/ve/batbtip.uml b/ve/batbtip.uml index 0954dc1e0..2d1134d02 100755 --- a/ve/batbtip.uml +++ b/ve/batbtip.uml @@ -156,7 +156,7 @@ BEGIN WARNING "Stato finale impossibile" END -STRING F_CAUS_MAG 4 +STRING F_CAUS_MAG 5 BEGIN PROMPT 2 17 "Codice causale magazzino " FIELD S9 diff --git a/ve/f33.dir b/ve/f33.dir index b2e0b738c..e4f908bb0 100755 --- a/ve/f33.dir +++ b/ve/f33.dir @@ -1,3 +1,3 @@ 33 0 -$doc|0|0|408|31|Documenti di vendita|NDOC|| +$doc|0|0|418|31|Documenti di vendita|NDOC|| diff --git a/ve/f33.trr b/ve/f33.trr index 968c43287..ed38a35a5 100755 --- a/ve/f33.trr +++ b/ve/f33.trr @@ -61,7 +61,7 @@ TARA|4|15|2|Tara UMPNETTO|1|2|0|Unità di misura per il peso netto PNETTO|4|15|2|Peso netto NCOLLI|3|7|0|Numero di colli -CAUSMAG|1|4|0|Causale di magazzino +CAUSMAG|1|6|0|Causale di magazzino MOVMAG|3|7|0|Numero movimento di magazzino CODNOTE|1|2|0|Codice note cliente NOTE|11|10|0|Note diff --git a/ve/f34.dir b/ve/f34.dir index af761e438..e31cd2c4a 100755 --- a/ve/f34.dir +++ b/ve/f34.dir @@ -1,3 +1,3 @@ 34 0 -$rdoc|0|0|305|31|Righe documenti di vendita|NDOC*3|| +$rdoc|0|0|314|31|Righe documenti di vendita|NDOC*3|| diff --git a/ve/f34.trr b/ve/f34.trr index 6ad7f828d..3c5843f47 100755 --- a/ve/f34.trr +++ b/ve/f34.trr @@ -33,7 +33,7 @@ CODIVA|1|4|0|Codice IVA ADDIVA|8|1|0|Addebito IVA ASPBENI|1|2|0|Aspetto dei beni PSPESA|4|5|2|Percentuale di spesa -CAUSMAG|1|4|0|Causale di magazzino +CAUSMAG|1|6|0|Causale di magazzino MOVMAG|3|7|0|Numero di movimento id magazzino CODMAGC|1|5|0|Codice di magazzino per causale collegata 1 diff --git a/ve/ordbon.src b/ve/ordbon.src new file mode 100755 index 000000000..6bb2c6b9e --- /dev/null +++ b/ve/ordbon.src @@ -0,0 +1,256 @@ +#include "veini.h" +#include "veuml.h" +#include "verig.h" +// Esempio di profilo documento : Profilo Bolla Vendita + +[MAIN] +// Descrizione a caratteri del documento +TYPE=Bolla di vendita +// Dove sono le risorse per il documento +MSKFILE=ORDBON +FRMFILE=ORDBON.FRM +// modifica +CAMPICALC= +CALCOLI=BASESCONTO +TOTPROVV= +// Indica se il documento è indirizzato ad un cliente o ad un fornitore +TIPOCF=F + +[PROFILO] +// Si possono indicare, dopo il numero, PROMPT, HELP, WARNING cosi: +// 1|Prompt|Help|Warning + +// TIPOCF = S_NORMALE +// CODCF = S_OBBLIGATORIO +// RAGSOC = S_NORMALE +OCCASEDIT = S_NORMALE //100 +OCFPI = S_DISABILITATO //100 +COFI = S_NORMALE //100 +STATOPAIV = S_NORMALE //100 +PAIVA = S_NORMALE //100 +GOLEM = S_NORMALE //100 +GRRECAPITO = S_NORMALE //100 +INDCF = S_DISABILITATO //100 +CIVCF = S_DISABILITATO //100 +LOCALITACF = S_DISABILITATO //100 +CAPCF = S_DISABILITATO //100 +PROVCOM = S_DISABILITATO //100 +COMCF = S_DISABILITATO //100 +DENCOM = S_DISABILITATO //100 +STATOCF = S_DISABILITATO //100 +DESSTATOCF = S_DISABILITATO //100 +CODVAL1 = S_NORMALE //200 +CODVAL2 = S_NORMALE //200 +NOME_VAL1 = S_NORMALE //200 +NOME_VAL2 = S_NORMALE //200 +CAMBIO = S_NORMALE //200 +DATA_CAMBIO1 = S_NORMALE //200 +DATA_CAMBIO2 = S_NORMALE //200 +CODLIN = S_NORMALE //300 +DESLIN = S_NORMALE //300 +CODPAG = S_OBBLIGATORIO //400 +DESCODPAG = S_NORMALE //400 +GRSCADENZE = S_NORMALE //500 +DATAINSC = S_NORMALE //500 +DATASCAD1 = S_DISABILITATO //500 +DATASCAD2 = S_DISABILITATO //500 +DATASCAD3 = S_DISABILITATO //500 +DATASCAD4 = S_DISABILITATO //500 +DATASCAD5 = S_DISABILITATO //500 +CODABIA = S_OBBLIGATORIO //600 +CODCABA = S_OBBLIGATORIO //600 +DESBANAPP = S_NORMALE //600 +CODABIP = S_NORMALE //700 +CODCABP = S_NORMALE //700 +DESBANPRE = S_NORMALE //700 +CATVEN = S_NORMALE //800 +DESCATVEN = S_DISABILITATO //800 +CODLIST1 = S_NORMALE //800 +CODLIST2 = S_NORMALE //800 +DESLIST = S_DISABILITATO //800 +CODCONT1 = S_NORMALE //810 +CODCONT2 = S_NORMALE //810 +DESCONT = S_DISABILITATO //810 +CODCAMP = S_NORMALE //820 +DESCAMP = S_DISABILITATO //820 +SCONTOPERC = S_NORMALE //830 +GRINDSPED = S_NORMALE //900 +CODINDSP = S_NORMALE //900 +RAGSOCSP = S_DISABILITATO //900 +INDSP = S_DISABILITATO //900 +CIVSP = S_DISABILITATO //900 +LOCALITASP = S_DISABILITATO //900 +CAPSP = S_DISABILITATO //900 +COMSP = S_DISABILITATO //900 +DENCOMSP = S_DISABILITATO //900 +PROVCOMSP = S_DISABILITATO //900 +STATOSP = S_DISABILITATO //900 +DESSTATOSP = S_DISABILITATO //900 +DATADOCRIF = S_NASCOSTO //1000 +NUMDOCRIF = S_NASCOSTO //1000 +CODAGVIS = S_NASCOSTO //1110 +DESAGVIS = S_NASCOSTO //1110 +CODAG = S_NORMALE //1100 +DESAG = S_NORMALE //1100 +CODZON = S_NORMALE //1100 +DESZON = S_NORMALE //1100 +CODSPMEZZO = S_OBBLIGATORIO //1200 +DESSPMEZZO = S_NORMALE //1200 +CODPORTO = S_NORMALE //1210 +DESPORTO = S_NORMALE //1210 +CODNOTESP1 = S_NORMALE //1300 +DESNOTESP1 = S_NORMALE //1300 +CODNOTESP2 = S_NASCOSTO //1300 +DESNOTESP2 = S_NASCOSTO //1300 +CAUSTRASP = S_OBBLIGATORIO //1400 +DENCAUSTRASP = S_NORMALE //1400 +CODVETT1 = S_NORMALE //1500 +CODVETT2 = S_NASCOSTO //1500 +CODVETT3 = S_NASCOSTO //1500 +NOMEVETT1 = S_NORMALE //1500 +NOMEVETT2 = S_NASCOSTO //1500 +NOMEVETT3 = S_NASCOSTO //1500 +NCOPIE = S_NASCOSTO //1600 +GRPARTENZA = S_NORMALE //1700 +DATAPART = S_NORMALE //1700 +ORAPART = S_NORMALE //1700 +IMPPAGATO = S_NASCOSTO //1800 +ACCSALDO = S_NASCOSTO //1800 +DOC1 = S_NASCOSTO //1900 +DOC2 = S_NASCOSTO //1900 +DOC3 = S_NASCOSTO //1900 +DATACONS = S_NASCOSTO //2000 +ASPBENI1 = S_OBBLIGATORIO //2100 +DESCRBENI1 = S_NORMALE //2100 +ASPBENI2 = S_NASCOSTO //2100 +DESCRBENI2 = S_NASCOSTO //2100 +IMPNETTI = S_NORMALE //2200 +RAGGR = S_NORMALE //2300 +RAGGREFF = S_NORMALE //2300 +SPESEINC = S_NORMALE //2400 +ADDBOLLI = S_NORMALE //2400 +UMTARA = S_NORMALE //2710 +TARA = S_NORMALE //2710 +DESUMTARA = S_NASCOSTO //2710 +UMPNETTO = S_NORMALE //2700 +PNETTO = S_NORMALE //2700 +DESUMPNETTO = S_NASCOSTO //2700 +NCOLLI = S_NORMALE //2800 +CAUSMAG = S_OBBLIGATORIO //2900 +DESCRMAG = S_NORMALE //2900 +BLANK = S_DISABILITATO //4000 +CODNOTE = S_NORMALE //2500 +NOTECLI = S_NORMALE //2500 + + +[DEFAULT] +NDEFAULTS=1 +1=F_CAUSTRASP|VEN + +[SHEET] +NCOLS=18 +1=FR_CODMAG +2=FR_CODDEP +3=FR_CODART +4=FR_LIV1 +5=FR_LIV2 +6=FR_LIV3 +7=FR_LIV4 +8=FR_DESCR +9=FR_UMQTA +10=FR_QTA +11=FR_PREZZO +12=FR_SCONTO +13=FR_PERCPROV +14=FR_CODIVA +15=FR_ADDIVA +16=FR_CAUS +17=FR_CODMAGC +18=FR_CODDEPC + +[RIGHE] +NTIPIRIGA=9 +1=01 +2=02 +3=03 +4=04 +5=05 +6=06 +7=07 +8=08 +9=09 + +[HANDLERS] +NHANDLER=0 +1 = F_ORAPART|1 + +[PROFILOGRUPPO] +101 = S_NASCOSTO +100 = S_NORMALE +200 = S_NORMALE +300 = S_NORMALE +400 = S_NORMALE +500 = S_NORMALE +600 = S_NORMALE +700 = S_NORMALE +800 = S_NORMALE +810 = S_NORMALE +820 = S_NORMALE +830 = S_NORMALE +900 = S_NORMALE +1000 = S_NASCOSTO +1100 = S_NORMALE +1200 = S_NORMALE +1210 = S_NORMALE +1300 = S_NORMALE +1400 = S_NORMALE +1500 = S_NORMALE +1600 = S_NASCOSTO +1700 = S_NORMALE +1800 = S_NORMALE +1900 = S_NORMALE +2000 = S_NASCOSTO +2100 = S_NORMALE +2200 = S_NORMALE +2300 = S_NORMALE +2400 = S_NORMALE +2500 = S_NORMALE +2700 = S_NORMALE +2710 = S_NORMALE +2800 = S_NORMALE +2900 = S_NORMALE +4000 = S_NORMALE + +[ORDINEGRUPPI] +NGROUPS=30 +1=100 +2=200 +3=300 +4=400 +5=500 +6=600 +7=700 +8=800 +9=810 +10=820 +11=830 +12=900 +13=1100 +14=1200 +15=1500 +16=1210 +17=1300 +18=1400 +19=1800 +20=1900 +21=2100 +22=2300 +23=2200 +24=2800 +25=2700 +26=2710 +27=1700 +28=2500 +29=2400 +30=2900 + diff --git a/ve/sconti.cpp b/ve/sconti.cpp index cb5389113..c0fb659ce 100755 --- a/ve/sconti.cpp +++ b/ve/sconti.cpp @@ -537,8 +537,8 @@ void TCond_vendita::ricerca(bool load_um_only, bool load_scagl_only) int len = seqric.len(); - _load_mask |= load_scagl_only && sco_scagl; - _load_mask |= load_scagl_only && sco_um_gest; + _load_mask |= load_scagl_only && cv_scagl; + _load_mask |= load_scagl_only && cv_um; for (int i = 0; percprovv == ZERO && i < len && seqric[i] != '-'; i++) { diff --git a/ve/ve0100.cpp b/ve/ve0100.cpp index ac8ab506f..a0e9ffac2 100755 --- a/ve/ve0100.cpp +++ b/ve/ve0100.cpp @@ -1,5 +1,5 @@ #include "ve0100.h" -#include "ve0100o.h" +#include "ve0100o.h" #include "veini.h" #include @@ -18,49 +18,49 @@ void TMotore_application::init_query_mode( TMask& m ) { - _msk->set( F_CODNUM, _codnum); + _msk->set( F_CODNUM, _codnum); _msk->field(F_CODNUM).set_focusdirty(TRUE); _msk->field(F_CODNUM).on_key(K_TAB); _msk->field(F_CODNUM).set_dirty(FALSE); - - _msk->set( F_TIPODOC, _tipodoc, TRUE); + + _msk->set( F_TIPODOC, _tipodoc, TRUE); } void TMotore_application::init_insert_mode( TMask& m ) { TString tipocf( "A" ); - tipocf[ 0 ] = app().tipocf(); + tipocf[ 0 ] = app().tipocf(); const TString16 codnum(m.get(F_CODNUM)); const int anno = m.get_int(F_ANNO); const char provv = m.get(F_PROVV)[0]; const long numdoc = m.get_long(F_NDOC); - + _doc->read(provv, anno, codnum, numdoc); _doc->set_tipo(m.get(F_TIPODOC)); - + _codnum = codnum; _tipodoc = m.get(F_TIPODOC); - + m.field(F_CODNUM).set_focusdirty(TRUE); m.field(F_CODNUM).on_key(K_TAB); m.field(F_TIPODOC).set_focusdirty(TRUE); - m.field(F_TIPODOC).on_key(K_TAB); + m.field(F_TIPODOC).on_key(K_TAB); m.set(F_STATO, _doc->stato()); const TString16 data_doc(m.get( F_DATADOC)); - + const int pos = m.id2pos( F_DATACAMBIO1); - + if (pos >= 0 && m.fld(pos).active()) { - m.fld(pos).set(data_doc); + m.fld(pos).set(data_doc); m.fld(pos).dirty(); } m.disable(DLG_PRINT); _occas_mask->reset( ); const int ndefaults = pro( ).get_int( "NDEFAULTS", "DEFAULT" ); // prof - + for( int i = 1; i <= ndefaults; i++ ) { TString16 chiave; @@ -74,27 +74,27 @@ void TMotore_application::init_insert_mode( TMask& m ) void TMotore_application::init_modify_mode( TMask& m ) { - m.enable(DLG_PRINT); + m.enable(DLG_PRINT); } void TMotore_application::update_profile() { TFilename fn(_doc->tipo().profile_name()); - + fn.ext("ini"); - if (_pro && _pro->name() != fn) + if (_pro && _pro->name() != fn) { - delete _pro; + delete _pro; _pro = NULL; } - if (_pro == NULL) + if (_pro == NULL) _pro = new TConfig( fn ); } int TMotore_application::user_function(int index) { switch(index) - { + { case 1: break; default: @@ -102,19 +102,19 @@ int TMotore_application::user_function(int index) return NOERR; break; } - return NOERR; + return NOERR; } // Funzione che dato il profilo di riga ottiene la maschera // Serve per ottenere una maschera diversa per ogni riga TMask * TMotore_application::ss_getmask( int numriga, TMask& fullmask) -{ +{ const int n = numriga + 1; if (n <= app()._doc->physical_rows()) { TRiga_documento & riga = (*(app()._doc))[numriga + 1]; - - return ((TTipo_riga_documento &)riga.tipo()).mask(); + + return ((TTipo_riga_documento &)riga.tipo()).mask(); } else return &fullmask; @@ -125,7 +125,7 @@ void TMotore_application::user_set_handler( int fieldid, int index, TMask* m ) if ( !m ) m = &edit_mask( ); switch( index ) - { + { case 1: m->set_handler( fieldid, ora_hndl ); break; @@ -140,15 +140,15 @@ void TMotore_application::user_set_handler( int fieldid, int index, TMask* m ) bool TMotore_application::ss_handler( TSheet_field& ss, int r, KEY key ) -{ +{ if ( key == K_ENTER ) // modifica { TRiga_documento & riga = (*(app()._doc))[r + 1]; - + riga.autosave(ss); } else - if ( key == K_DEL ) // Cancellazione + if ( key == K_DEL ) // Cancellazione { app()._doc->destroy_row(r + 1, TRUE); if (r < app()._doc->rows()) @@ -162,7 +162,7 @@ bool TMotore_application::ss_handler( TSheet_field& ss, int r, KEY key ) } } else - if (key == K_INS) // Inserimento + if (key == K_INS) // Inserimento { if (r < app()._doc->rows()) { @@ -170,17 +170,17 @@ bool TMotore_application::ss_handler( TSheet_field& ss, int r, KEY key ) if (riga.is_omaggio() && riga.is_generata()) return FALSE; } - TMask & emask = app().edit_mask(); + TMask & emask = app().edit_mask(); app()._doc->insert_row(r + 1, emask.get( F_LBTIPORIGA )); } - else + else if (key == K_CTRL + K_INS) { TRiga_documento & riga = (*(app()._doc))[r + 1]; TRectype & ven_rec = app().doc().clifor().vendite(); TString16 s(ven_rec.get(CFV_CODMAG)); if (s.not_empty()) - { + { s.left_just(3); s << ven_rec.get(CFV_CODDEP); } @@ -191,7 +191,7 @@ bool TMotore_application::ss_handler( TSheet_field& ss, int r, KEY key ) s << app()._std_dep; } riga.put("CODMAG", s); - riga.autoload(ss); + riga.autoload(ss); ss.check_row(r); ss.select(r); } @@ -203,15 +203,15 @@ bool TMotore_application::ss_handler( TSheet_field& ss, int r, KEY key ) } bool TMotore_application::num_handler( TMask_field& f, KEY key ) -{ - // Ottengo la maschera - TMask& m = f.mask( ); - +{ + // Ottengo la maschera + TMask& m = f.mask( ); + if (key == K_TAB && f.to_check(key, TRUE)) - { + { TTable & tabnum = ((TTable &) ((TEdit_field &)f).browse()->cursor()->file()); - if ( tabnum.good()) - { + if ( tabnum.good()) + { if (app()._cod_num) delete app()._cod_num; app()._cod_num = new TCodice_numerazione(tabnum.curr()); @@ -234,47 +234,47 @@ bool TMotore_application::num_handler( TMask_field& f, KEY key ) m.set( F_PROVV, "D" ); // Disabilita il campo per la selezione della numerazione m.disable( F_PROVV ); - } + } } else - { + { m.set( F_DESNUM, "" ); m.set( F_TIPODOC, "" ); } - } + } return TRUE; } bool TMotore_application::elabora_handler( TMask_field& f, KEY key ) -{ +{ if (key == K_SPACE) { #ifndef DBG return message_box("Funzione in fase di implementazione"); #endif - TString_array elabs; + TString_array elabs; TMask & m = f.mask(); const TString16 tipo(m.get(F_TIPODOC)); const TString16 stato(m.get(F_STATO)); TLista_elaborazioni & elab = app().elab(); - - const int items = elab.select(elabs, TRUE, m.insert_mode(), NULL, NULL, tipo, stato); + + const int items = elab.select(elabs, TRUE, m.insert_mode(), NULL, NULL, tipo, stato); if (items == 0) return message_box("Non ci sono elaborazioni attive per questo documento"); int selected = 0; if (items > 1) - { + { TMask selection("ve0100b"); TList_field & f = (TList_field &) selection.field(F_SELECT); - + for (int i = 0; i < items; i++) f.add_item(format("%d|%s", i, (const char *)elab[elabs.row(i)].descrizione())); - + if (selection.run() == K_ENTER) selected = atoi(selection.get(F_SELECT)); - } + } else - selected = 1; + selected = 1; if (selected > 0) TElaborazione & e = elab[elabs.row(selected)]; } @@ -284,25 +284,25 @@ bool TMotore_application::elabora_handler( TMask_field& f, KEY key ) bool TMotore_application::print_handler( TMask_field& f, KEY key ) { - if (key == K_SPACE) + if (key == K_SPACE) { TMask& m = f.mask(); - + if (app().save(TRUE)) // Registra il record corrente { TString commandline("ve1 -0 "); - + commandline << m.get(F_CODNUM) << " " << m.get(F_ANNO) << " "; commandline << m.get(F_PROVV) << " " << m.get(F_NDOC); - + TExternal_app interattivo( commandline ); - + interattivo.run(); - if (app().doc().stampabile()) + if (app().doc().stampabile()) { - const char s[2] = {app().doc().tipo().stato_finale_stampa(), '\0'}; - - m.set(F_STATO, s, TRUE); + const char s[2] = {app().doc().tipo().stato_finale_stampa(), '\0'}; + + m.set(F_STATO, s, TRUE); } } } @@ -323,20 +323,20 @@ bool TMotore_application::occas_code_handler(TMask_field& f, KEY key) f.mask().autoload(occas); f.mask().send_key(K_TAB, O_COMUNE); // Forza decodifica comuni f.mask().send_key(K_TAB, O_COMUNENAS); - } + } } - } + } return TRUE; -} +} bool TMotore_application::occas_handler( TMask_field& f, KEY key ) { TDocumento_mask & m = (TDocumento_mask &)f.mask(); if ( key == K_SPACE && m.is_running( ) ) - { - TDocumento & doc = app().doc(); + { + TDocumento & doc = app().doc(); TMask * occ_m = app()._occas_mask; - TOccasionale & occ = doc.occas(); + TOccasionale & occ = doc.occas(); TCli_for & cli_for = doc.clifor(); for (int i = occ_m->fields() - 1; i >= 0; i--) { @@ -344,9 +344,9 @@ bool TMotore_application::occas_handler( TMask_field& f, KEY key ) const TFieldref * c = f.field(); if (c) f.set(c->read(occ)); - } - if (occ_m->run() != K_ESC) - { + } + if (occ_m->run() != K_ESC) + { const TString80 ocfpi(occ_m->get(O_CODICE)); doc.put("OCFPI", ocfpi); m.set(F_OCFPI, ocfpi); @@ -356,20 +356,20 @@ bool TMotore_application::occas_handler( TMask_field& f, KEY key ) TFieldref * c = (TFieldref *) f.field(); if (c) c->write(f.get(), occ); - } + } m.occ2mask(occ); } f.set_focus( ); - } + } return TRUE; } bool TMotore_application::tip_handler( TMask_field& f, KEY key ) -{ +{ TMask& m = f.mask( ); if ( key == K_TAB && m.is_running( ) && m.get(F_TIPODOC).not_empty()) - { + { const TString16 tipo(f.get()); TCodice_numerazione * c = app()._cod_num; int last = c->ntipi_doc(); @@ -386,45 +386,45 @@ bool TMotore_application::tip_handler( TMask_field& f, KEY key ) bool TMotore_application::clifo_handler( TMask_field& f, KEY key ) -{ - if (key != K_ENTER && f.to_check(key, TRUE)) - { +{ + if (key != K_ENTER && f.to_check(key, TRUE)) + { TDocumento & d = app().doc(); TDocumento_mask & m = (TDocumento_mask &) f.mask(); const TString & val = f.get(); - + d.put("TIPOCF", app().tipocf()); d.put("CODCF", atol(val)); - + app().doc().clifor().put(CLI_CODCF, ""); // force reload - TCli_for & cli_for = app().doc().clifor(); + TCli_for & cli_for = app().doc().clifor(); TOccasionale & occas = app().doc().occas(); - + if ( cli_for.get_bool("SOSPESO") ) - return f.error_box( "Il codice '%ld' e' sospeso e non puo' essere utilizzato", atol(val) ); + return f.error_box( "Il codice '%ld' e' sospeso e non puo' essere utilizzato", atol(val) ); m.cli2mask(cli_for, occas, *(app()._config_ditta)); if (cli_for.occasionale()) { if(m.id2pos(F_OCCASEDIT) > 0 && f.to_check(key) && *(occas.codice()) == '\0') - m.send_key( K_SPACE, F_OCCASEDIT ); // Lancia maschera occasionali + m.send_key( K_SPACE, F_OCCASEDIT ); // Lancia maschera occasionali } - else + else app().doc().zero("OCFPI"); - } + } return TRUE; } bool TMotore_application::changing_mask( int mode ) -{ +{ static int lastmode = NO_MODE; - + const bool change = ( mode != lastmode ); lastmode = mode; - return change; + return change; } void TMotore_application::configura_sheet( TSheet_field& sheet, TConfig& config ) -{ +{ TBit_array to_delete(MAX_COLUMNS); to_delete.set(); int ncols = config.get_int( "NCOLS", "SHEET" ); @@ -438,7 +438,7 @@ void TMotore_application::configura_sheet( TSheet_field& sheet, TConfig& config to_delete.reset(coltomove); const TString descr(sheet_col.get( 1 )); - + if (descr.not_empty() ) sheet.set_column_header( field_id, descr); @@ -446,46 +446,61 @@ void TMotore_application::configura_sheet( TSheet_field& sheet, TConfig& config if (size != 0) sheet.set_column_width( field_id, size); - } + + } to_delete.reset(0); to_delete.reset(1); if (!to_delete[sheet.cid2index(FR_CODDEP)]) sheet.enable_column(FR_CODDEP, _ges_dep && _ges_mag); if (!to_delete[sheet.cid2index(FR_CODMAG)]) sheet.enable_column(FR_CODMAG, _ges_mag); + if (!to_delete[sheet.cid2index(FR_CODDEPC)]) + sheet.enable_column(FR_CODDEPC, _ges_dep && _ges_mag); + if (!to_delete[sheet.cid2index(FR_CODMAGC)]) + sheet.enable_column(FR_CODMAGC, _ges_mag); to_delete.set(sheet.cid2index(FR_CODARTMAG)); to_delete.set(sheet.cid2index(FR_CHECKED)); - + const int sconto_col = sheet.cid2index(FR_SCONTO); if (to_delete[sconto_col] == FALSE) { const bool del = (_config_ditta->get("GESSCORIGA") == "N"); - + to_delete.set(sconto_col, del); } - + for ( i = MAX_COLUMNS - 1; i >= 0; i-- ) if( to_delete[i] ) { sheet.enable_column( i + FIRST_FIELD, FALSE); sheet.delete_column( i + FIRST_FIELD); } + +/* for ( i = 1; i <= ncols; i ++ ) + { + TString col; + col.format( "%d", i ); + TToken_string sheet_col( config.get( col, "SHEET" ) ); + const int field_id = sheet_col.get_int(0); + + sheet.move_column(field_id, i); + } */ } TMask* TMotore_application::get_mask( int mode ) -{ +{ switch ( mode ) { - case MODE_INS: - case MODE_MOD: - { - const TString16 tipodoc(_msk->get(F_TIPODOC)); - + case MODE_INS: + case MODE_MOD: + { + const TString16 tipodoc(_msk->get(F_TIPODOC)); + TDocumento_mask * msk1 = (TDocumento_mask *) _doc_masks.objptr(tipodoc); - + _doc->set_tipo(tipodoc); update_profile(); - + TString tipocf( app( ).pro( ).get( "TIPOCF", "MAIN" ) ); //prof app( ).tipocf( tipocf[ 0 ] ); if (msk1 == NULL) @@ -497,23 +512,23 @@ TMask* TMotore_application::get_mask( int mode ) sheet().set_append(FALSE); TList_field& listbox = ( TList_field& ) msk1->field( F_LBTIPORIGA ); const int numtr = app( ).pro( ).get_int( "NTIPIRIGA", "RIGHE" ); //prof - TToken_string keys, descrs; + TToken_string keys, descrs; TRiga_documento r(_doc); - + for ( int i = 1; i <= numtr; i ++ ) - { - TString16 var; - + { + TString16 var; + var.format("%d", i); TString tiporiga(app().pro().get(var, "RIGHE")); // pro r.set_tipo(tiporiga); keys.add(r.tipo().codice()); descrs.add(r.tipo().descrizione()); } - listbox.replace_items( keys, descrs ); + listbox.replace_items( keys, descrs ); configura_sheet( *_sheet, *_pro ); ((TVariable_sheet_field&)sheet()).set_getmask( ss_getmask ); - if (msk1->id2pos( F_OCCASEDIT ) > 0 ) + if (msk1->id2pos( F_OCCASEDIT ) > 0 ) msk1->set_handler( F_OCCASEDIT, occas_handler ); msk1->set_handler( F_CODCF, clifo_handler ); msk1->set_handler( F_CODPAG, condpag_hndl ); @@ -523,26 +538,26 @@ TMask* TMotore_application::get_mask( int mode ) msk1->set_handler( 99, elabora_handler ); // cazzo !!!!!! #ifndef DBG msk1->disable(99); -#endif +#endif msk1->set_handler( DLG_PRINT, print_handler ); int numhandler = pro( ).get_int( "NHANDLER", "HANDLERS" ); // prof for ( i = 1; i <= numhandler; i ++ ) - { + { TString chiave; chiave.format( "%d", i ); TToken_string riga = pro( ).get( chiave, "HANDLERS" ); user_set_handler( riga.get_int( 0 ), riga.get_int( 1 ) ); - } - + } + TCodgiac_livelli l; - + for ( i = MAX_GIAC_LEVEL; i > 0; i--) { const short pos = _sheet->cid2index(FR_LIV1 + i -1); if (l.enabled(i)) - { + { const TString & header = l.name(i); - const int len = header.len() + 1; + const int len = header.len() + 1; const int f_len = l.code_length(i); _doc->set_liv_giac_len(i, f_len); @@ -555,42 +570,42 @@ TMask* TMotore_application::get_mask( int mode ) _doc->set_liv_giac_len(i, 0); } } - + // configurazione campi - const bool gesval = _config_ditta->get_bool("GESVAL"); - const bool gescambi = _config_ditta->get_bool("GESVALAC"); - + const bool gesval = _config_ditta->get_bool("GESVAL"); + const bool gescambi = _config_ditta->get_bool("GESVALAC"); + if (gesval) { msk1->show(F_CODVAL, !gescambi); msk1->show(F_DATACAMBIO, !gescambi); - msk1->show(F_NOMEVAL, !gescambi); + msk1->show(F_NOMEVAL, !gescambi); msk1->show(F_CODVAL1, gescambi); msk1->show(F_DATACAMBIO1, gescambi); - msk1->show(F_NOMEVAL1, gescambi); + msk1->show(F_NOMEVAL1, gescambi); msk1->show(F_CAMBIO); } else { msk1->disable(F_CODVAL); msk1->disable(F_DATACAMBIO); - msk1->disable(F_NOMEVAL); + msk1->disable(F_NOMEVAL); msk1->hide(F_CODVAL1); msk1->hide(F_DATACAMBIO1); - msk1->hide(F_NOMEVAL1); + msk1->hide(F_NOMEVAL1); msk1->disable(F_CAMBIO); } - const bool geslin = _config_ditta->get_bool("GESLIN"); + const bool geslin = _config_ditta->get_bool("GESLIN"); - msk1->enable(F_CODLIN, geslin); - msk1->enable(F_DESLIN, geslin); + msk1->enable(F_CODLIN, geslin); + msk1->enable(F_DESLIN, geslin); - const bool geslis = _config_ditta->get_bool("GES", "ve", 1); - const bool gesliscatven = _config_ditta->get_bool("GESLISCV"); - - if (geslis) + const bool geslis = _config_ditta->get_bool("GES", "ve", 1); + const bool gesliscatven = _config_ditta->get_bool("GESLISCV"); + + if (geslis) { msk1->show(F_CODLIST, !gesliscatven); msk1->show(F_CODLIST1, gesliscatven); @@ -601,35 +616,35 @@ TMask* TMotore_application::get_mask( int mode ) msk1->hide(F_CODLIST1); } - const bool gescontr = _config_ditta->get_bool("GES", "ve", 2); - const bool gescontrcli = _config_ditta->get_bool("GESCONCC"); + const bool gescontr = _config_ditta->get_bool("GES", "ve", 2); + const bool gescontrcli = _config_ditta->get_bool("GESCONCC"); if (gescontr) - { - - msk1->show(F_CODCONT1, gescontrcli); + { + + msk1->show(F_CODCONT1, gescontrcli); msk1->show(F_CODCONT, !gescontrcli); } - else + else { msk1->disable(F_CODCONT); msk1->hide(F_CODCONT1); } - const bool gesoff = _config_ditta->get_bool("GES", "ve", 3); + const bool gesoff = _config_ditta->get_bool("GES", "ve", 3); msk1->enable(F_CODCAMP, gesoff); - const bool gessco = _config_ditta->get_char("GESSCO") != 'N'; + const bool gessco = _config_ditta->get_char("GESSCO") != 'N'; msk1->enable(F_SCONTOPERC, gessco); - const bool gesage = _config_ditta->get_bool("GESAGE"); + const bool gesage = _config_ditta->get_bool("GESAGE"); msk1->enable(F_CODAG, gesage); msk1->enable(F_DESAG, gesage); msk1->enable(F_CODAGVIS, gesage); - msk1->enable(F_DESAGVIS, gesage); + msk1->enable(F_DESAGVIS, gesage); const bool has_movmag = app().has_module(MGAUT, CHK_DONGLE) && _doc->tipo().mov_mag(); short pos = msk1->id2pos(F_CAUSMAG); if (pos >= 0) @@ -637,12 +652,12 @@ TMask* TMotore_application::get_mask( int mode ) pos = msk1->id2pos(F_DESCRMAG); if (pos >= 0) msk1->fld(pos).show(has_movmag); - } + } else _sheet = &( TSheet_field& )edit_mask( ).field( F_SHEET ); return msk1; } - break; + break; default: return _msk; break; @@ -650,35 +665,36 @@ TMask* TMotore_application::get_mask( int mode ) } const char* TMotore_application::get_next_key( ) -{ - TToken_string key; +{ TMask& m = curr_mask( ); - const TString16 value = m.get( F_CODNUM ); + //const TString16 value = m.get( F_CODNUM ); - // Se per questa numerazione h abilitata le numerazione automatica + // Se per questa numerazione h abilitata le numerazione automatica if( _cod_num->auto_num()) { TLocalisamfile doc(LF_DOC); doc.zero(); - doc.put("CODNUM", value); + doc.put("CODNUM", _cod_num->codice()); doc.put("ANNO", m.get(F_ANNO)); doc.put("PROVV", m.get(F_PROVV)); - + TRectype cmp_rec(doc.curr()); // record campione - + doc.put( "NDOC", 9999999L ); - if (doc.read(_isgreat) == NOERR) - doc.prev(); - + if (doc.read(_isgreat) == NOERR) + doc.prev(); + else + doc.last(); + const long num = ((doc.curr() == cmp_rec) ? doc.get_long( "NDOC" ) : 0) + 1; - - key.format( "%d|%d", F_NDOC, num); + + return (format( "%d|%d", F_NDOC, num)); } - return key; + return ""; } -int TMotore_application::read(TMask& m) -{ +int TMotore_application::read( TMask& m ) +{ // m.autoload(*_rel); TRelation_application::read(m); *_doc = (TDocumento &) _rel->curr(); @@ -688,23 +704,24 @@ int TMotore_application::read(TMask& m) TSheet_field& f = ( TSheet_field& ) m.field( F_SHEET ); - f.destroy( ); + f.destroy( ); const int rows = _doc->physical_rows(); for (int i = 1; i <= rows; i++) - { - f.insert(-1, FALSE); - TToken_string & r = f.row(i-1); + { + f.insert(-1, FALSE); + TToken_string & r = f.row(i -1); TRiga_documento & rec = (*_doc)[i]; - rec.autoload(f); + + rec.autoload(f); f.check_row(i - 1); - } + } return NOERR; } int TMotore_application::write( const TMask& m ) // C 90 -{ +{ TDocumento & doc = (TDocumento &) _rel->curr(); - + doc = *_doc; return TRelation_application::write(m); } @@ -712,7 +729,7 @@ int TMotore_application::write( const TMask& m ) // C 90 int TMotore_application::rewrite( const TMask& m ) // C 90 { TDocumento & doc = (TDocumento &) _rel->curr(); - + doc = *_doc; return TRelation_application::rewrite(m); } @@ -757,8 +774,8 @@ void TMotore_application::ini2mask(TConfig& ini, TMask& msk, bool query) } -void TMotore_application::open_files(int logicnum, ...) -{ +void TMotore_application::open_files(int logicnum, ...) +{ va_list marker; va_start(marker, logicnum); while (logicnum > 0) @@ -770,7 +787,7 @@ void TMotore_application::open_files(int logicnum, ...) } void TMotore_application::on_firm_change() -{ +{ if (_config_ditta != NULL) delete _config_ditta; _config_ditta = new TConfig(CONFIG_DITTA); @@ -780,7 +797,7 @@ void TMotore_application::on_firm_change() } bool TMotore_application::user_create( ) -{ +{ _config_ditta = new TConfig(CONFIG_DITTA); // Metto in relazione testata e righe @@ -790,30 +807,30 @@ bool TMotore_application::user_create( ) _doc = new TDocumento; _rel->lfile().set_curr(new TDocumento); _cod_num = NULL; - + _condv = new TCond_vendita(&doc().clifor(), _config_ditta); _doc->set_condv(_condv); ((TDocumento &) _rel->curr()).set_condv(_condv); - _msk = new TMask("ve0100a"); + _msk = new TMask("ve0100a"); set_search_field(F_NDOC); query_mask().set_handler( F_CODNUM, num_handler ); query_mask().set_handler( F_TIPODOC, tip_handler ); - _occas_mask = new TMask("ve0100o"); + _occas_mask = new TMask("ve0100o"); _occas_mask->set_handler( O_CODICE, occas_code_handler ); TConfig utente( CONFIG_USER ); _codnum = utente.get("CODNUM"); _tipodoc = utente.get("TIPODOC"); - + // La maschera di inserimento/modifica per ora non la so! // Viene letta dal profilo non appena trovato il record - + TMagazzini m; - + _ges_mag = m.gestmag(); - _ges_dep = m.gestdep(); - + _ges_dep = m.gestdep(); + _std_mag = m.standardmag(); _std_dep = m.standarddep(); @@ -821,7 +838,7 @@ bool TMotore_application::user_create( ) } bool TMotore_application::user_destroy( ) -{ +{ // Registro l'ultimo tipo documento e l'ultima numerazione TConfig utente( CONFIG_USER ); utente.set( "CODNUM", _codnum, "ve" ); @@ -834,24 +851,75 @@ bool TMotore_application::user_destroy( ) delete _msk; if (_cod_num) delete _cod_num; - + // Distruggo la relazione delete _doc; delete _rel; delete _condv; return TRUE; -} +} int TMotore_application::stato_corrente( ) -{ +{ return edit_mask().get_int(F_STATO); } +void TMotore_application::ini2mask(TConfig& ini, TMask& msk, bool query) +{ + TRelation_application::ini2mask(ini, msk, query); // Default processing + + TMask_field& campo = msk.field(F_TIPODOC); + TString16 str = campo.field()->read(ini, format("%d", LF_DOC)); + if (str.not_empty()) + campo.set(str); + + if (query) + { + } + else + { + TSheet_field& f = msk.sfield(F_SHEET); + TTipo_riga_documento tr; + + // Scorre tutti i paragrafi delle righe documento + TMaskmode oldmode= (TMaskmode)msk.mode(); + + msk.set_mode(MODE_MOD); + for (int i = 1; ini.set_paragraph(format("%d,%d", LF_RIGHEDOC, i)); i++) + { + // Considera solo i tipi riga validi + const TString16 tipo = ini.get(RDOC_TIPORIGA); + if (tr.read(tipo) == NOERR) + { + // Crea una nuova riga documento + TRiga_documento& rec = _doc->new_row(tipo); + // Riempie i campi della nuova riga + TAssoc_array& var = ini.list_variables(); + FOR_EACH_ASSOC_STRING(var, obj, key, val) + { + if (stricmp(key, RDOC_NRIGA) != 0) // Ignora il numero riga .. + if (stricmp(key, RDOC_TIPORIGA) != 0) // ... ed il tipo riga + rec.put(key, val); + } + // solo la insert chiama la post_insert necessaria alla disabilitazione verifichiamo + // l'autoload ?? +// f.insert(-1, FALSE); + // Aggiunge la riga allo sheet + rec.autoload(f); + f.check_row(rec.numero()-1); + } + } + msk.set_mode(oldmode); + } +} + + + int ve0100( int argc, char** argv ) { TMotore_application a; - + a.run( argc, argv, "Gestione documenti" ); return 0; } diff --git a/ve/ve0100.h b/ve/ve0100.h index 2cac8ed3a..1881577cb 100755 --- a/ve/ve0100.h +++ b/ve/ve0100.h @@ -105,6 +105,8 @@ protected: // Configurazione dello sheet dato il profilo void configura_sheet( TSheet_field& sheet, TConfig& config ); + // caricamento Inifile + void ini2mask(TConfig& ini, TMask& m, bool query); public: virtual TRelation* get_relation( ) const { return _rel;} virtual const char* get_next_key( ); diff --git a/ve/ve0300a.src b/ve/ve0300a.src index ecc6ffc09..2152b9bc9 100755 --- a/ve/ve0300a.src +++ b/ve/ve0300a.src @@ -110,7 +110,7 @@ SIZE=12 [GOLEM] GROUP=100 -X=76 +X=73 Y=0 MSKID=F_GOLEM FIELDNAME=COLL_GOLEM @@ -1497,7 +1497,7 @@ INPUT=CODTAB F_CAUSMAG DISPLAY="Codice" CODTAB~"Descrizione@50" S0 OUTPUT=F_CAUSMAG CODTAB~F_DESCRMAG S0 WARNING=Causale di magazzino non trovata -SIZE=4 +SIZE=5 FLAG=U WARNING=Codice causale non trovato HELP=Inserisci il codice della causale diff --git a/ve/ve1100.cpp b/ve/ve1100.cpp index 3bc8bdac8..78a904f83 100755 --- a/ve/ve1100.cpp +++ b/ve/ve1100.cpp @@ -18,7 +18,8 @@ #include "ve1100.h" #include "ve0100b.h" -#define LISTADOC "listadoc" +#define LISTADOC "listadoc" +#define FAKETOTFLD 9999 #define Usage "Usage: ve1 -0 {[codnum anno {D|P} dalnum alnum {D|P} [ncopie]] | [L]}" // Queste classi (TDocisamfile e TRDocisamfile) servono nel costruttore di TDocumento_form @@ -112,6 +113,8 @@ protected: static void doc_footer_handler(TPrinter& p); public: + void hide_sections(); + bool is_faketotfld(); void print_documento(); bool valid() { return _valid; } bool doc_arrange(); @@ -232,6 +235,44 @@ TDocumento_form::~TDocumento_form() if (_rdocfile) delete _rdocfile; } +void TDocumento_form::hide_sections() +{ + // Scorre tutte le sezioni e nasconde gli items + const char s[3] = { 'B', 'G', 'H' }; + for (int sn = 0; sn < 3 ; sn++) + { + const char sc = s[sn]; + for (pagetype pt = odd_page; pt <= last_page; pt = pagetype(pt+1)) + { + TPrint_section* sec = exist(sc, pt); + if (sec == NULL) + continue; + TForm_item* f; + for(word i = 0; i < sec->fields(); i++) + { + f = &(sec->field(i)); + f->hide(); + } + } + } +} + +bool TDocumento_form::is_faketotfld() +{ + TPrint_section* fl = exist('F',last_page); + if (fl != NULL) + { + TForm_item* f; + for(word i = 0; i < fl->fields(); i++) + { + f = &(fl->field(i)); + if (f->id() == FAKETOTFLD) + return TRUE; + } + } + return FALSE; +} + bool TDocumento_form::doc_arrange() { TPrinter& pr = printer(); @@ -775,7 +816,7 @@ bool TDocumento_form::validate(TForm_item &cf, TToken_string &s) } return TRUE; } - + return TForm::validate(cf, s); // se il codice del messaggio non è identificato viene passato alla funzione standard } @@ -880,6 +921,7 @@ void TStampaDoc_application::print_selected() const long items = cur.items(); behaviour whattodo = go; bool first_inst = TRUE; + real totdocumenti = ZERO; //TDocumentoEsteso *documento = new TDocumentoEsteso; //cur.file().set_curr(documento); for (long i = 0; i < items; i++) @@ -913,11 +955,22 @@ void TStampaDoc_application::print_selected() _form->doc().summary_reset(); _form->doc().scadenze_reset(); } + if (_definitiva && (numerazione_definitiva(_form->doc()) != NOERR)) { // se la stampa è definitiva viene lanciata la procedura di rinumerazione if (_interattivo) error_box("Non è possibile completare la procedura di numerazione definitiva dei documenti. Errore %d", doc.status()); break; } + // Totalizza gli importi per eventuale stampa su FAKETOTFLD + totdocumenti += _form->doc().totale_doc(); + if (i == items - 1 && _form->is_faketotfld()) + { + _form->hide_sections(); + TForm_item& fk = _form->find_field('F', last_page, FAKETOTFLD); + fk.show(); + fk.set(totdocumenti.string()); + print_documento(); + } delete _form; } diff --git a/ve/ve3400.cpp b/ve/ve3400.cpp index de0b398d1..73e51477a 100755 --- a/ve/ve3400.cpp +++ b/ve/ve3400.cpp @@ -1,4 +1,3 @@ - #include #include #include @@ -48,7 +47,6 @@ public: }; - bool TStampa_anagrafica_magazzino::user_create() { _rel= new TRelation(LF_ANAMAG); // crea la relazione principale _rel->add("GMC", "CODTAB==GRMERC", 1, 0, GMC); // aggancia la tabella Gruppi Merceologici al primo campo GRMERC1 @@ -148,11 +146,13 @@ void TStampa_anagrafica_magazzino::preprocess_header() TLocalisamfile ditte(LF_NDITTE); // apre il file ditte ditte.zero(); // vuota il record ditte.put("CODDITTA", firm); // riempie la chiave + set_header(i++, ""); // riga vuota (errore PG015/4) if (ditte.read()== NOERR) { // se il record della ditta viene trovato viene settato l'header const TString &s= ditte.get("RAGSOC"); // legge la ragione sociale della ditta set_header(i, "Ditta %ld %s", firm, (const char *)s); // setta il nome e l'id della ditta della prima linea dell'header } set_header(i, "@125gPag @#"); // la prima linea contiene, sicuramente, il numero di pagina + set_header(++i, "@44gStampa Anagrafica Articoli di Magazzino"); set_header(++i, separator); set_header(++i, "Codice articolo@24gDescrizione@75gGrMer@81gDescrizione gruppo merceologico"); // setta la linea successiva dell'header if (_st_umart || _st_codcorr) set_header(++i, ""); // crea una linea vuota se almeno una stampa condizionale è abilitata @@ -167,13 +167,12 @@ void TStampa_anagrafica_magazzino::preprocess_header() } void TStampa_anagrafica_magazzino::set_page(int file, int) { - if (file== LF_ANAMAG) { // se il file in stampa non è il file principale non c'è nulla da fare + if (file== LF_ANAMAG) // se il file in stampa non è il file principale non c'è nulla da fare + { + TLocalisamfile &anagr= _rel->lfile(); // prende il riferimento al file principale - //set_row(1, "$[g]@20s$[n]@22g@1s@24g@50s@75g@5s@81g@50s", FLD(LF_ANAMAG, "CODART"), FLD(LF_ANAMAG, "TIPO"), FLD(LF_ANAMAG, "DESCR"), FLD(LF_ANAMAG, "GRMERC1"), FLD(-GMC1, "S0")); // imposta la prima linea di dati - set_row(1, "$[b]@20s$[n]@24g@50s@75g@5s@81g@50s", - FLD(LF_ANAMAG, "CODART"),FLD(LF_ANAMAG, "DESCR"), - FLD(LF_ANAMAG, "GRMERC"), FLD(-GMC, "S0")); // imposta la prima linea di dati - int n_codcorr= 0, n_umart= 0, n_gmc= 1;// (anagr.get("GRMERC2").not_empty())?(1):(0)+(anagr.get("GRMERC3").not_empty())?(1):(0); // legge il numero di gruppi merc. + //set_row(1, "$[g]@20s$[n]@22g@1s@24g@50s@75g@5s@81g@50s", FLD(LF_ANAMAG, "CODART"), FLD(LF_ANAMAG, "TIPO"), FLD(LF_ANAMAG, "DESCR"), FLD(LF_ANAMAG, "GRMERC1"), FLD(-GMC1, "S0")); // imposta la prima linea di dati + word n_codcorr= 0, n_umart= 0, n_gmc= 1;// (anagr.get("GRMERC2").not_empty())?(1):(0)+(anagr.get("GRMERC3").not_empty())?(1):(0); // legge il numero di gruppi merc. if (_st_codcorr) { // se è abilitata la stampa dei codici corrispondenti viene letto il numero di codici presenti, altrimenti viene lasciato a 0 _codcorr->zero(); // il record corrente del file dei codici corrispondenti viene vuotato _codcorr->put("CODART", anagr.get("CODART")); // viene composta la chiave @@ -186,8 +185,14 @@ void TStampa_anagrafica_magazzino::set_page(int file, int) { _arr_umart->read(_umart->curr()); // il record array delle unità di misura viene caricato n_umart= _arr_umart->rows(); // viene settato il numero di unità di misura trovate } - int n_max= max3(n_gmc, n_codcorr, n_umart); // viene trovato il maggiore dei tre contatori (gruppi merc., unità di mis. e codici corrisp.) - for (int i=1; i<=n_max; i++) { // ciclo sul maggiore dei contatori + word n_max= max3(n_gmc, n_codcorr, n_umart); // viene trovato il maggiore dei tre contatori (gruppi merc., unità di mis. e codici corrisp.) + if (printer().rows_left() < n_max+5) + printer().formfeed(); + set_row(1, "$[b]@20s$[n]@24g@50s@75g@5s@81g@50s", + FLD(LF_ANAMAG, "CODART"),FLD(LF_ANAMAG, "DESCR"), + FLD(LF_ANAMAG, "GRMERC"), FLD(-GMC, "S0")); // imposta la prima linea di dati + + for (word i=1; i<=n_max; i++) { // ciclo sul maggiore dei contatori set_row(i+1, ""); // vuota la linea di stampa corrente if (i<=n_codcorr) { // se ci sono ancora codici corrispondenti gli spazi relativi della riga vengono riempiti TString codartalt(_arr_codcorr->row(i, FALSE).get("CODARTALT")); // legge il codice corrispondente dell'articolo @@ -215,11 +220,13 @@ void TStampa_anagrafica_magazzino::set_page(int file, int) { FLD(LF_ANAMAG, "CODFORN"), FLD(LF_CLIFO, "RAGSOC"), FLD(LF_ANAMAG, "COSTSTD","###.###.###,@@"), FLD(LF_ANAMAG, "PESO","#########,@@@@@"), FLD(LF_ANAMAG, "TARA"),"#########,@@@@@"); // imposta la penultima linea - if (_st_umart) set_row(n_max+2, "@80g@2s", FLD(LF_ANAMAG, "UMP")); // se è abilitata la stampa delle unità di misura aggiunge l'u.m. del peso + if (_st_umart) + set_row(n_max+2, "@80g@2s", FLD(LF_ANAMAG, "UMP")); // se è abilitata la stampa delle unità di misura aggiunge l'u.m. del peso set_row(n_max+3, "@pn@23g@pn@45g@f@48g@f", FLD(LF_ANAMAG, "PPCONF","#########,@@@@@"), FLD(LF_ANAMAG, "PPCOLLO","#########,@@@@@"), FLD(LF_ANAMAG, "ARTPROD"), FLD(LF_ANAMAG, "RIORDINO")); // imposta l'ultima linea - if (_st_fisc) set_row(n_max+3, "@51g@f@54g@5s@60g@1s@62g@3s@66g@3n@70g@3n@74g@6n@81g@3s@85g@3n@89g@3n@93g@6n@100g@10s@111g@4s@116g@4s", // imposta i dati fiscali sull'ultima linea + if (_st_fisc) + set_row(n_max+3, "@51g@f@54g@5s@60g@1s@62g@3s@66g@3n@70g@3n@74g@6n@81g@3s@85g@3n@89g@3n@93g@6n@100g@10s@111g@4s@116g@4s", // imposta i dati fiscali sull'ultima linea FLD(LF_ANAMAG, "ARTFIS"), FLD(LF_ANAMAG, "RAGGFIS"), FLD(LF_ANAMAG, "CLASSEFIS"), FLD(LF_ANAMAG, "CATCONA"), FLD(LF_ANAMAG, "GRUPPOA"), FLD(LF_ANAMAG, "CONTOA"), FLD(LF_ANAMAG, "SOTTOCA"), FLD(LF_ANAMAG, "CATCONV"), FLD(LF_ANAMAG, "GRUPPOV"), FLD(LF_ANAMAG, "CONTOV"), FLD(LF_ANAMAG, "SOTTOCV"), diff --git a/ve/ve3400.uml b/ve/ve3400.uml index 9f5492d2f..2cd121b8e 100755 --- a/ve/ve3400.uml +++ b/ve/ve3400.uml @@ -78,9 +78,9 @@ BEGIN PROMPT 2 10 "Stampa dati fiscali" END -BUTTON DLG_SELECT 9 2 +BUTTON DLG_OK 9 2 BEGIN - PROMPT -12 -1 "Selezione" + PROMPT -12 -1 "" MESSAGE EXIT,K_ENTER END diff --git a/ve/ve6300.cpp b/ve/ve6300.cpp index 2e9914729..8b758c401 100755 --- a/ve/ve6300.cpp +++ b/ve/ve6300.cpp @@ -216,7 +216,7 @@ bool TGenerazioneEffetti_app::create() error_box("Impossibile eseguire il programma se il modulo Effetti non e' abilitato"); return FALSE; } - open_files(LF_TABCOM, LF_CLIFO, LF_CFVEN, LF_DOC, LF_RIGHEDOC, LF_OCCAS, 0); + open_files(LF_TABCOM, LF_TAB, LF_CLIFO, LF_OCCAS, LF_INDSP, LF_CFVEN, LF_DOC, LF_RIGHEDOC, LF_ANAMAG, LF_MOVMAG, LF_RMOVMAG, LF_CONDV, LF_SVRIEP, LF_AGENTI, LF_PERCPROV, LF_CESS, 0); _msk = new TMask("ve6300a"); _msk->set_handler(F_CODICE_ELAB,handle_cod_eld); _msk->set_handler(F_DATA_INI,handle_data_range); diff --git a/ve/vearea.men b/ve/vearea.men index 9d85d7573..1a653e679 100755 --- a/ve/vearea.men +++ b/ve/vearea.men @@ -36,7 +36,7 @@ Caption = "Tabelle vendita" Picture = Module = 0 Flags = "" -Item_01 = "Categorie vendita", "ba3 -0 CVE", "" +Item_01 = "Categorie vendita", "ba3 -0 CVE", "F" Item_02 = "Note cliente", "ba3 -0 %NOT", "" Item_03 = "Note documento", "ba3 -0 %NDO", "" Item_04 = "Modalita' di spedizione", "ba3 -0 %MSP", "" @@ -44,10 +44,10 @@ Item_05 = "Modalita' di consegna", "ba3 -0 %POR", "" Item_06 = "Causali di trasporto", "ba3 -0 %CTR", "" Item_07 = "Aspetto dei beni", "ba3 -0 %ABE", "" Item_08 = "Vettori", "ba3 -0 %VET", "" -Item_09 = "Spese", "ba3 -0 SPP", "" -Item_10 = "Prestazioni", "ba3 -0 PRS", "" -Item_11 = "Banche di presentazione", "ef0 -6 BNP", "" -Item_12 = "Zone", "ba3 -0 ZON", "" +Item_09 = "Spese", "ba3 -0 SPP", "F" +Item_10 = "Prestazioni", "ba3 -0 PRS", "F" +Item_11 = "Banche di presentazione", "ef0 -6 BNP", "F" +Item_12 = "Zone", "ba3 -0 ZON", "F" [ACQVEN_005] Caption = "Tabelle contabili" @@ -57,32 +57,32 @@ Flags = "" Item_01 = "Codici IVA", "ba3 -0 %iva", "" Item_02 = "Condizioni pagamento", "ba3 -6", "" Item_03 = "Classificazione pagamento", "ba3 -0 %CLR", "" -Item_05 = "Categorie contabili C/F", "ba3 -0 CCO", "" +Item_05 = "Categorie contabili C/F", "ba3 -0 CCO", "F" Item_06 = "Banche", "ba3 -0 %BAN", "" Item_07 = "Legali", "ba3 -0 %LEG", "" Item_08 = "Nazioni", "ba3 -0 %STA", "" Item_09 = "Lingue", "ba3 -0 %LNG", "" Item_10 = "Divise", "ba3 -0 %VAL", "" -Item_11 = "Cambi giornalieri", "ba3 -0 CAM", "" -Item_12 = "Esercizi", "cg0 -5 esc", "" +Item_11 = "Cambi giornalieri", "ba3 -0 CAM", "F" +Item_12 = "Esercizi", "cg0 -5 esc", "F" [ACQVEN_006] Caption = "Tabelle magazzino" Picture = Module = 0 Flags = "" -Item_01 = "Gruppi merceologici", "ba3 -0 GMC", "" -Item_02 = "Magazzini e depositi", "ba3 -0 MAG", "" +Item_01 = "Gruppi merceologici", "ba3 -0 GMC", "F" +Item_02 = "Magazzini e depositi", "ba3 -0 MAG", "F" Item_03 = "Unita' di misura", "ba3 -0 %UMS", "" Item_04 = "Province d'origine", "ba3 -0 %PRV", "" -Item_05 = "Classi fiscali articoli", "ba3 -0 ASF", "" -Item_06 = "Categorie ricavi articoli", "ba3 -0 CRA", "" -Item_07 = "Categorie acquisti articoli", "ba3 -0 CAA", "" -Item_08 = "Raggrupp. fiscali articoli", "ba3 -0 RFA", "" +Item_05 = "Classi fiscali articoli", "ba3 -0 ASF", "F" +Item_06 = "Categorie ricavi articoli", "ba3 -0 CRA", "F" +Item_07 = "Categorie acquisti articoli", "ba3 -0 CAA", "F" +Item_08 = "Raggrupp. fiscali articoli", "ba3 -0 RFA", "F" 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", "" +Item_11 = "Gruppi codice articoli", "mg0 -0 GCA", "F" +Item_12 = "Gruppi codice giacenze", "mg0 -0 GCG", "F" [ACQVEN_007] Caption = "Stampa tabelle" @@ -98,7 +98,7 @@ Caption = "Stampa tabelle vendita" Picture = Module = 0 Flags = "" -Item_01 = "Categorie vendita", "ba3 -1 CVE", "" +Item_01 = "Categorie vendita", "ba3 -1 CVE", "F" Item_02 = "Note anagrafiche", "ba3 -1 %NOT", "" Item_03 = "Note documento", "ba3 -1 %NDO", "" Item_04 = "Modalita' di spedizione", "ba3 -1 %MSP", "" @@ -106,10 +106,10 @@ Item_05 = "Modalita' di consegna", "ba3 -1 %POR", "" Item_06 = "Causali di trasporto", "ba3 -1 %CTR", "" Item_07 = "Aspetto dei beni", "ba3 -1 %ABE", "" Item_08 = "Vettori", "ba3 -1 %VET", "" -Item_09 = "Spese", "ba3 -1 SPP", "" -Item_10 = "Prestazioni", "ba3 -1 PRS", "" -Item_11 = "Banche di presentazione", "ba3 -1 BNP", "" -Item_12 = "Zone", "ba3 -1 ZON", "" +Item_09 = "Spese", "ba3 -1 SPP", "F" +Item_10 = "Prestazioni", "ba3 -1 PRS", "F" +Item_11 = "Banche di presentazione", "ba3 -1 BNP", "F" +Item_12 = "Zone", "ba3 -1 ZON", "F" [ACQVEN_010] Caption = "Stampa tabelle contabili" @@ -118,28 +118,28 @@ Module = 0 Flags = "" Item_01 = "Codici IVA", "ba3 -1 %iva", "" Item_02 = "Condizioni pagamento", "ba3 -9", "" -Item_03 = "Classificazione pagamento", "ba3 -1 CLR", "" -Item_05 = "Categorie contabili C/F", "ba3 -1 CCO", "" +Item_03 = "Classificazione pagamento", "ba3 -1 CLR", "F" +Item_05 = "Categorie contabili C/F", "ba3 -1 CCO", "F" Item_06 = "Banche", "ba3 -1 %ban", "" Item_07 = "Legali", "ba3 -1 %LEG", "" Item_08 = "Nazioni", "ba3 -1 %sta", "" Item_09 = "Lingue", "ba3 -1 %lng", "" Item_10 = "Divise", "ba3 -1 %val", "" -Item_11 = "Cambi giornalieri", "ba3 -1 CAM", "" -Item_12 = "Esercizi", "ba3 -1 esc", "" +Item_11 = "Cambi giornalieri", "ba3 -1 CAM", "F" +Item_12 = "Esercizi", "ba3 -1 esc", "F" [ACQVEN_011] Caption = "Stampa tabelle magazzino" Picture = Module = 0 Flags = "" -Item_01 = "Gruppi merceologici", "ba3 -1 GMC", "" -Item_02 = "Magazzini e depositi", "ba3 -1 MAG", "" +Item_01 = "Gruppi merceologici", "ba3 -1 GMC", "F" +Item_02 = "Magazzini e depositi", "ba3 -1 MAG", "F" Item_03 = "Unita' di misura", "ba3 -1 %UMS", "" -Item_04 = "Classi fiscali e articoli", "ba3 -1 ASF", "" -Item_05 = "Categorie ricavi articoli", "ba3 -1 CRA", "" -Item_06 = "Categorie acquisti articoli", "ba3 -1 CAA", "" -Item_07 = "Raggrupp. fiscali articoli", "ba3 -1 RFA", "" +Item_04 = "Classi fiscali e articoli", "ba3 -1 ASF", "F" +Item_05 = "Categorie ricavi articoli", "ba3 -1 CRA", "F" +Item_06 = "Categorie acquisti articoli", "ba3 -1 CAA", "F" +Item_07 = "Raggrupp. fiscali articoli", "ba3 -1 RFA", "F" Item_08 = "Raggruppamenti causali magazzino", "ba3 -1 %RFC", "" Item_09 = "Causali magazzino", "ba3 -1 %CAU", "" @@ -148,30 +148,30 @@ Caption = "Gestione archivi di base" Picture = Module = 0 Flags = "" -Item_01 = "Articoli", "ve2 -3", "" -Item_02 = "Listini", "ve2 -1 l", "" -Item_03 = "Contratti", "ve2 -1 c", "" -Item_04 = "Offerte", "ve2 -1 o", "" +Item_01 = "Articoli", "ve2 -3", "F" +Item_02 = "Listini", "ve2 -1 l", "F" +Item_03 = "Contratti", "ve2 -1 c", "F" +Item_04 = "Offerte", "ve2 -1 o", "F" Item_05 = "Sconti clienti", "ba3 -0 %SCC", "" -Item_06 = "Sconti incondizionati", "ve2 -0 i", "" -Item_07 = "Sconti di riga", "ve2 -0 r", "" +Item_06 = "Sconti incondizionati", "ve2 -0 i", "F" +Item_07 = "Sconti di riga", "ve2 -0 r", "F" Item_08 = "Clienti/Fornitori", "cg0 -1", "F" -Item_09 = "Agenti", "pr0 -4", "" +Item_09 = "Agenti", "pr0 -4", "F" [ACQVEN_013] Caption = "Stampa archivi di base" Picture = Module = 0 Flags = "" -Item_01 = "Articoli", "ve3 -3", "" -Item_02 = "Listini", "ve3 -1 l", "" -Item_03 = "Contratti", "ve3 -1 c", "" -Item_04 = "Offerte", "ve3 -1 o", "" +Item_01 = "Articoli", "ve3 -3", "F" +Item_02 = "Listini", "ve3 -1 l", "F" +Item_03 = "Contratti", "ve3 -1 c", "F" +Item_04 = "Offerte", "ve3 -1 o", "F" Item_05 = "Sconti clienti", "ba3 -1 %SCC", "" -Item_06 = "Sconti incondizionati", "ve3 -0 i", "" -Item_07 = "Sconti di riga", "ve3 -0 r", "" +Item_06 = "Sconti incondizionati", "ve3 -0 i", "F" +Item_07 = "Sconti di riga", "ve3 -0 r", "F" Item_08 = "Clienti/Fornitori", "cg1 -1", "F" -Item_09 = "Agenti", "pr1 -0", "" +Item_09 = "Agenti", "pr1 -0", "F" [ACQVEN_020] @@ -179,16 +179,16 @@ Caption = "Configurazione" Picture = Module = 0 Flags = "" -Item_01 = "Condizioni di vendita", "ve0 -2 -1", "" -Item_02 = "Agenti e dati generali", "ve0 -2 -2", "" -Item_03 = "Contabilizzazione sconti", "ve0 -2 -3", "" -Item_04 = "Contabilizzazione spese e bolli", "ve0 -2 -4", "" -Item_05 = "Contabilizzazione", "ve0 -2 -5", "" -Item_06 = "Gestione spese e bolli", "ve0 -2 -6", "" +Item_01 = "Condizioni di vendita", "ve0 -2 -1", "F" +Item_02 = "Agenti e dati generali", "ve0 -2 -2", "F" +Item_03 = "Contabilizzazione sconti", "ve0 -2 -3", "F" +Item_04 = "Contabilizzazione spese e bolli", "ve0 -2 -4", "F" +Item_05 = "Contabilizzazione", "ve0 -2 -5", "F" +Item_06 = "Gestione spese e bolli", "ve0 -2 -6", "F" [ACQVEN_021] Caption = "Servizi" Picture = Module = 0 Flags = "" -Item_09 = "Modifica valori", "ve4 -0", "" +Item_09 = "Modifica valori", "ve4 -0", "F" diff --git a/ve/veinst.ini b/ve/veinst.ini new file mode 100755 index 000000000..7354508ca --- /dev/null +++ b/ve/veinst.ini @@ -0,0 +1,214 @@ +[ve] +Data = 01-04-1998 +Descrizione = Vendite +Dischi = 1 +Moduli = ba,cg9,pr9,mg9,sv9 +Patch = 304 +PostProcess = +PreProcess = +Prezzo(1) = 900,300 +Versione = 19980102 + +[ve0] +File(0) = ve00.bmp +File(1) = vearea.men +Patch = 304 +Versione = 19980102 + +[ve1] +File(2) = basteld.msk +File(3) = bastfrd.msk +File(4) = bastfrr.msk +File(5) = bastnum.msk +File(6) = baststd.msk +File(7) = basttip.msk +File(8) = batbeld.msk +File(9) = batbeld.rpt +File(10) = batbfrd.msk +File(11) = batbfrd.rpt +File(12) = batbfrr.msk +File(13) = batbfrr.rpt +File(14) = batbgcg.msk +File(15) = batbnum.msk +File(16) = batbnum.rpt +File(17) = batbstd.msk +File(18) = batbstd.rpt +File(19) = batbtip.msk +File(20) = batbtip.rpt +File(21) = fatacq.ini +File(22) = fatacq.msk +File(23) = listadoc.frm +File(24) = ve01.bmp +File(25) = ve1.exe +File(26) = ve1000b.msk +File(27) = ve1100a.msk +File(28) = ve5.exe +File(29) = ve5100a.msk +File(30) = ve6.exe|X +File(31) = ve6100a.msk +File(32) = ve6200a.msk +File(33) = ve6300a.msk +File(34) = veprassi.hlp +File(35) = veprassi.men +Patch = 304 +Versione = 19980102 + +[ve2] +File(36) = recdesc\f33.dir +File(37) = recdesc\f33.trr +File(38) = recdesc\f34.dir +File(39) = recdesc\f34.trr +Patch = 304 +Versione = 19980102 + +[ve3] +File(40) = bolla.bmp +File(41) = bollac.ini +File(42) = bollac.msk +File(43) = bollaf.ini +File(44) = bollaf.msk +File(45) = fattura.bmp +File(46) = fatturaa.ini +File(47) = fatturaa.msk +File(48) = fatturac.ini +File(49) = fatturac.msk +File(50) = ordinec.ini +File(51) = ordinec.msk +File(52) = ordinef.ini +File(53) = ordinef.msk +File(54) = veacc.frm +File(55) = vebol.frm +File(56) = vebolbmp.frm +File(57) = vefat.frm +File(58) = vefatbmp.frm +File(59) = verig00.msk +File(60) = verig01.ini +File(61) = verig01.msk +File(62) = verig02.ini +File(63) = verig02.msk +File(64) = verig03.ini +File(65) = verig03.msk +File(66) = verig04.ini +File(67) = verig04.msk +File(68) = verig05.ini +File(69) = verig05.msk +File(70) = verig06.ini +File(71) = verig06.msk +File(72) = verig07.ini +File(73) = verig07.msk +File(74) = verig08.ini +File(75) = verig08.msk +File(76) = verig09.ini +File(77) = verig09.msk +Patch = 304 +Versione = 19980102 + +[ve9] +File(78) = bastabe.msk +File(79) = bastasf.msk +File(80) = bastbnp.msk +File(81) = bastcaa.msk +File(82) = bastcau.msk +File(83) = bastcra.msk +File(84) = bastctr.msk +File(85) = bastfca.msk +File(86) = bastfrm.msk +File(87) = bastgmc.msk +File(88) = bastprs.msk|X +File(89) = bastrfa.msk +File(90) = bastrfc.msk +File(91) = batbabe.msk +File(92) = batbabe.rpt +File(93) = batbasf.msk +File(94) = batbasf.rpt +File(95) = batbbnp.msk +File(96) = batbbnp.rpt +File(97) = batbcaa.msk +File(98) = batbcaa.rpt +File(99) = batbcau.msk +File(100) = batbcau.rpt +File(101) = batbcld.msk +File(102) = batbcra.msk +File(103) = batbcra.rpt +File(104) = batbctr.msk +File(105) = batbctr.rpt +File(106) = batbfca.msk +File(107) = batbfrm.msk +File(108) = batbfrm.rpt +File(109) = batbgca.msk +File(110) = batbgmc.msk +File(111) = batbgmc.rpt +File(112) = batbmag.msk +File(113) = batbmag.rpt +File(114) = batbprs.msk|X +File(115) = batbprs.rpt|X +File(116) = batbprv.msk +File(117) = batbrfa.msk +File(118) = batbrfa.rpt +File(119) = batbrfc.msk +File(120) = batbrfc.rpt +File(121) = mg0.exe +File(122) = mg0300a.msk +File(123) = pr0.exe +File(124) = pr0500a.msk +File(125) = pr0600a.msk +File(126) = pr1.exe +File(127) = pr1100.msk +File(128) = pr1100a.frm +File(129) = prtbapr.msk +File(130) = recdesc\f122.dir +File(131) = recdesc\f122.trr +File(132) = recdesc\f35.dir +File(133) = recdesc\f35.trr +File(134) = recdesc\f47.dir +File(135) = recdesc\f47.trr +File(136) = recdesc\f48.dir +File(137) = recdesc\f48.trr +File(138) = recdesc\f49.dir +File(139) = recdesc\f49.trr +File(140) = recdesc\f51.dir +File(141) = recdesc\f51.trr +File(142) = recdesc\f52.dir +File(143) = recdesc\f52.trr +File(144) = recdesc\f53.dir +File(145) = recdesc\f53.trr +File(146) = tab_fca.frm +File(147) = ve0.exe|X +File(148) = ve0100a.msk +File(149) = ve0100o.msk +File(150) = ve0200a.msk +File(151) = ve0200b.msk +File(152) = ve0200c.msk +File(153) = ve0200d.msk +File(154) = ve0200e.msk +File(155) = ve0200f.msk +File(156) = ve0300a.ini +File(157) = ve0300b.dat +File(158) = ve0300c.ini +File(159) = ve2.exe +File(160) = ve2100.msk +File(161) = ve2100d.msk +File(162) = ve2100i.msk +File(163) = ve2100r.msk +File(164) = ve2200.msk +File(165) = ve2200x.msk +File(166) = ve2300.msk +File(167) = ve2300x.msk +File(168) = ve2400.msk +File(169) = ve2400a.msk +File(170) = ve2400b.msk +File(171) = ve2400c.msk +File(172) = ve3.exe +File(173) = ve3100.msk +File(174) = ve3100d.msk +File(175) = ve3100i.msk +File(176) = ve3100r.msk +File(177) = ve3200.msk +File(178) = ve3200x.msk +File(179) = ve3300.msk +File(180) = ve3400.msk +File(181) = ve4.exe +File(182) = ve4100.msk +Patch = 304 +Versione = 19980102 + diff --git a/ve/velib.h b/ve/velib.h index 15f382388..d48855404 100755 --- a/ve/velib.h +++ b/ve/velib.h @@ -113,12 +113,13 @@ class TSpesa_prest : public TRectype // velib01 { protected: - int read(const char* codice); public: TObject* dup() const { return new TSpesa_prest(codice()); } public: + int read(const char* codice); + const TString& codice() const { return get("CODTAB");} const TString& descrizione() const { return get("S0"); } const TString& field_perc() const { return get("S5"); } @@ -321,6 +322,8 @@ public: TObject* dup() const { return new TTipo_riga_documento(codice()); } public: + int read(const char* tiporig); + const TString& profile_name() const { return _name;} const TString& mask_name() const { return profile_name();} const TString& codice() const { return get("CODTAB");} @@ -434,6 +437,7 @@ class TRiepilogo_iva : public TObject TIVA _codiva; real _imp; real _imp_spese; + real _imp_spese_row; real _iva; real _iva_spese; real _sconto_perc; @@ -450,6 +454,7 @@ public: real imposta(bool spese = TRUE) const { return _iva + (spese ? _iva_spese : ZERO);} // Iva real & imp() { return _imp;}; real & imp_spese() { return _imp_spese;}; + real & imp_spese_row() { return _imp_spese_row;}; real & iva() { return _iva;}; real & iva_spese() { return _iva_spese;}; real & iva_sconto() { return _iva_sconto;}; diff --git a/ve/velib01.cpp b/ve/velib01.cpp index 0c1deb38c..947419a6a 100755 --- a/ve/velib01.cpp +++ b/ve/velib01.cpp @@ -8,7 +8,8 @@ TSpesa_prest::TSpesa_prest(const char* codice, char tipo) { settab(tipo == RIGA_SPESEDOC ? "SPP" : "PRS"); if (codice && *codice) - read(codice); + if (read(codice) != NOERR) + yesnofatal_box("Tipo spesa assente : %s", codice); } TSpesa_prest::TSpesa_prest(const TRectype& rec) @@ -17,12 +18,11 @@ TSpesa_prest::TSpesa_prest(const TRectype& rec) } int TSpesa_prest::read(const char* codice) -{ +{ + zero(); TTable t(get("COD")); put("CODTAB", codice); int err = TRectype::read(t); - if (err != NOERR) - yesnofatal_box("Tipo spesa assente : %s", codice); return err; } diff --git a/ve/velib01a.cpp b/ve/velib01a.cpp index bdaa641e2..a8d2c7007 100755 --- a/ve/velib01a.cpp +++ b/ve/velib01a.cpp @@ -196,6 +196,68 @@ bool iva_handler( TMask_field& f, KEY key ) return TRUE; } +bool codmag_handler( TMask_field& f, KEY key ) +{ + if (f.to_check(key, TRUE)) + { + TMask& row_mask = f.mask(); + + if (row_mask.get_sheet()->column_enabled( ((TSheet_field &)f).cid2index(FR_CODDEP))) + { + const int pos = row_mask.id2pos(FR_CODDEP); + const TString & val = f.get(); + + if (pos >= 0 && val.not_empty()) + { + TTable & mag = (TTable &)((TEdit_field &) f).browse()->cursor()->file(); + const TString &codmag = mag.get("CODTAB"); + if (codmag != val) + { + mag.put("CODTAB", val); + if (mag.read() != NOERR) + mag.zero(); + } + const bool active = mag.get_bool("B0"); + row_mask.fld(pos).enable(active); + if (!active) + row_mask.fld(pos).reset(); + } + } + } + return TRUE; +} + +bool codmag_coll_handler( TMask_field& f, KEY key ) +{ + if (f.to_check(key, TRUE)) + { + TMask& row_mask = f.mask(); + + if (row_mask.get_sheet()->column_enabled( ((TSheet_field &)f).cid2index(FR_CODDEPC))) + { + const int pos = row_mask.id2pos(FR_CODDEPC); + const TString & val = f.get(); + + if (pos >= 0 && val.not_empty()) + { + TTable & mag = (TTable &)((TEdit_field &) f).browse()->cursor()->file(); + const TString &codmag = mag.get("CODTAB"); + if (codmag != val) + { + mag.put("CODTAB", val); + if (mag.read() != NOERR) + mag.zero(); + } + const bool active = mag.get_bool("B0"); + row_mask.fld(pos).enable(active); + if (!active) + row_mask.fld(pos).reset(); + } + } + } + return TRUE; +} + bool codart_handler( TMask_field& f, KEY key ) { TMask& row_mask = f.mask(); diff --git a/ve/velib02.cpp b/ve/velib02.cpp index 74923cb51..ddc4c2cca 100755 --- a/ve/velib02.cpp +++ b/ve/velib02.cpp @@ -148,6 +148,8 @@ TVariable_mask * TTipo_riga_documento::mask() const int num = cur->file().num(); if (num == LF_ANAMAG) { + _mask->set_handler( FR_CODMAG, codmag_handler ); + _mask->set_handler( FR_CODMAGC, codmag_coll_handler ); _mask->set_handler( FR_CODART, codart_handler ); _mask->set_handler( FR_LIV1, liv_handler ); _mask->set_handler( FR_LIV2, liv_handler ); diff --git a/ve/velib03.cpp b/ve/velib03.cpp index 1d964a23b..2412bc2c1 100755 --- a/ve/velib03.cpp +++ b/ve/velib03.cpp @@ -42,6 +42,10 @@ #include "../sv/svlib01.h" #endif +#ifndef __CGLIB01_H +#include "../cg/cglib01.h" +#endif + #ifndef __PRLIB_H #include "../pr/prlib.h" #endif @@ -1356,6 +1360,8 @@ void TDocumento::update_tabella_iva() table.add(cod, aliquota); } aliquota->imp() += imponibile; + if (r.is_spese() && iva.tipo().not_empty()) + aliquota->imp_spese_row() += imponibile; aliquota->iva() += imposta; tot_doc += imposta; } @@ -1369,7 +1375,7 @@ void TDocumento::update_tabella_iva() table.restart(); for (TRiepilogo_iva * ri = (TRiepilogo_iva *) table.get(); ri != NULL; ri = (TRiepilogo_iva *) table.get()) - d.add(ri->imp()); + d.add(ri->imp() - ri->imp_spese_row()); table.restart(); for (ri = (TRiepilogo_iva *) table.get(); ri != NULL; @@ -1672,6 +1678,7 @@ void TDocumento::update_spese_aut(TString_array & spese_aut, bool preserve_old, if (nspese > 0) { TLocalisamfile cfven(LF_CFVEN); + TSpesa_prest sp; cfven.put("TIPOCF", get("TIPOCF")); cfven.put("CODCF", get("CODCF")); if (cfven.read() == NOERR) @@ -1680,49 +1687,53 @@ void TDocumento::update_spese_aut(TString_array & spese_aut, bool preserve_old, { const TString & s = spese_aut.row(i); - TSpesa_prest sp(s); - TString16 tipo(sp.tipo_riga()); - TRiga_documento & riga = new_row(tipo); - - riga.put("CODART", s); - riga.generata(); - riga.put("DESCR", sp.descrizione()); - switch (sp.tipo()) - { - case 'Q': - { - real qta = sp.qta(); - - if (qta == ZERO) - qta = 1.0; - riga.put("QTA", qta); - } - case 'V': - { - const real cambio = get_real("CAMBIO"); - const TString16 valuta = get("CODVAL"); - real prezzo = sp.prezzo(); - - sppr_calc(sp, valuta, cambio, prezzo); - riga.put("PREZZO", prezzo); - riga.put("UMQTA", sp.um()); - } - break; - case 'P': - default: - break; - } - if (cod_iva_cli.empty()) - riga.put("CODIVA", sp.cod_iva()); - else - riga.put("CODIVA", cod_iva_cli); - if (interactive) - { - const int nrow = sh->insert(-1, FALSE); - riga.autoload(*sh); - sh->check_row(nrow); - } - } + if (sp.read(s) != NOERR) + message_box("Codice spesa %s assente", (const char *) s); + else + { + TString16 tipo(sp.tipo_riga()); + TRiga_documento & riga = new_row(tipo); + + riga.put("CODART", s); + riga.generata(); + riga.put("DESCR", sp.descrizione()); + switch (sp.tipo()) + { + case 'Q': + { + real qta = sp.qta(); + + if (qta == ZERO) + qta = 1.0; + riga.put("QTA", qta); + } + case 'V': + { + const real cambio = get_real("CAMBIO"); + const TString16 valuta = get("CODVAL"); + real prezzo = sp.prezzo(); + + sppr_calc(sp, valuta, cambio, prezzo); + riga.put("PREZZO", prezzo); + riga.put("UMQTA", sp.um()); + } + break; + case 'P': + default: + break; + } + if (cod_iva_cli.empty()) + riga.put("CODIVA", sp.cod_iva()); + else + riga.put("CODIVA", cod_iva_cli); + if (interactive) + { + const int nrow = sh->insert(-1, FALSE); + riga.autoload(*sh); + sh->check_row(nrow); + } + } + } } } put("SPESEUPD", TRUE); diff --git a/ve/veprassi.men b/ve/veprassi.men index 83dd43136..115c3f651 100755 --- a/ve/veprassi.men +++ b/ve/veprassi.men @@ -3,8 +3,8 @@ Caption = "Gestione documenti" Picture = Module = 31 Flags = "" -Item_06 = "Documenti interattivi", "ve0 -1", "" -Item_07 = "Stampe documenti", "ve1 -0", "" +Item_06 = "Documenti interattivi", "ve0 -1", "F" +Item_07 = "Stampe documenti", "ve1 -0", "F" Item_08 = "Elaborazioni differite", [PRASSIVE_050] Item_09 = "Servizi", [PRASSIVE_051] Item_10 = "Configurazione modulo", [PRASSIVE_052] @@ -14,18 +14,18 @@ Caption = "Gestione elaborazioni differite" Picture = Module = 0 Flags = "" -Item_01 = "Fatturazione bolle", "ve6 -2", "" -Item_02 = "Contabilizzazione fatture", "ve6 -1", "" -Item_03 = "Generazione effetti", "ve6 -3", "" +Item_01 = "Fatturazione bolle", "ve6 -2", "F" +Item_02 = "Contabilizzazione fatture", "ve6 -1", "F" +Item_03 = "Generazione effetti", "ve6 -3", "F" [PRASSIVE_051] Caption = "Servizi" Picture = Module = 0 Flags = "" -Item_02 = "Cambiamento stato documento", "disabled", "" -Item_03 = "Stampa riepilogo documenti immessi", "ve1 -0 L", "" -Item_04 = "Scarico e ripristino documenti", "ve5 -0", "" +Item_02 = "Cambiamento stato documento", "disabled", "F" +Item_03 = "Stampa riepilogo documenti immessi", "ve1 -0 L", "F" +Item_04 = "Scarico e ripristino documenti", "ve5 -0", "F" [PRASSIVE_052] Caption = "Configurazione" @@ -40,26 +40,26 @@ Caption = "Tabelle personalizzazione documenti" Picture = Module = 0 Flags = "" -Item_01 = "Tipo documento", "ba3 -0 %TIP", "" -Item_02 = "Numerazione documenti", "ba3 -0 %NUM", "" -Item_03 = "Tipo riga documento", "ba3 -0 %TRI", "" -Item_04 = "Formule documento", "ba3 -0 %FRD", "" -Item_05 = "Formule righe documento", "ba3 -0 %FRR", "" -Item_06 = "Formule ricalcolo magazzino", "ba3 -0 %FRM", "" -Item_07 = "Elaborazioni differite", "ba3 -0 %ELD", "" -Item_08 = "Stati documento", "ba3 -0 %STD", "" +Item_01 = "Tipo documento", "ba3 -0 %TIP", "F" +Item_02 = "Numerazione documenti", "ba3 -0 %NUM", "F" +Item_03 = "Tipo riga documento", "ba3 -0 %TRI", "F" +Item_04 = "Formule documento", "ba3 -0 %FRD", "F" +Item_05 = "Formule righe documento", "ba3 -0 %FRR", "F" +Item_06 = "Formule ricalcolo magazzino", "ba3 -0 %FRM", "F" +Item_07 = "Elaborazioni differite", "ba3 -0 %ELD", "F" +Item_08 = "Stati documento", "ba3 -0 %STD", "F" [PRASSIVE_008] Caption = "Stampa tabelle personalizzazione documenti" Picture = Module = 0 Flags = "" -Item_01 = "Tipo documento", "ba3 -1 %TIP", "" -Item_02 = "Numerazione documenti", "ba3 -1 %NUM", "" -Item_03 = "Tipo riga documento", "ba3 -1 %TRI", "" -Item_04 = "Formule documento", "ba3 -1 %FRD", "" -Item_05 = "Formule righe documento", "ba3 -1 %FRR", "" -Item_06 = "Formule ricalcolo magazzino", "ba3 -1 %FRM", "" -Item_07 = "Elaborazioni differite", "ba3 -1 %ELD", "" -Item_08 = "Stati documento", "ba3 -1 %STD", "" +Item_01 = "Tipo documento", "ba3 -1 %TIP", "F" +Item_02 = "Numerazione documenti", "ba3 -1 %NUM", "F" +Item_03 = "Tipo riga documento", "ba3 -1 %TRI", "F" +Item_04 = "Formule documento", "ba3 -1 %FRD", "F" +Item_05 = "Formule righe documento", "ba3 -1 %FRR", "F" +Item_06 = "Formule ricalcolo magazzino", "ba3 -1 %FRM", "F" +Item_07 = "Elaborazioni differite", "ba3 -1 %ELD", "F" +Item_08 = "Stati documento", "ba3 -1 %STD", "F" diff --git a/ve/vepriv.h b/ve/vepriv.h index eaf8bb283..6133cf014 100755 --- a/ve/vepriv.h +++ b/ve/vepriv.h @@ -9,6 +9,8 @@ bool codartmag_handler( TMask_field& f, KEY key ); bool iva_handler( TMask_field& f, KEY key ); void sppr_calc(TRectype & rec, const TString & valuta_doc, const real & cambio, real & prezzo); void row_set_handler(TMask& m, const int field, const int index); +bool codmag_handler(TMask_field& f, KEY key); +bool codmag_coll_handler(TMask_field& f, KEY key); bool codart_handler(TMask_field& f, KEY key); bool umart_handler(TMask_field& f, KEY key); bool descr_handler(TMask_field& f, KEY key); diff --git a/ve/verig.uml b/ve/verig.uml index da3a0d440..89dee5444 100755 --- a/ve/verig.uml +++ b/ve/verig.uml @@ -811,6 +811,18 @@ ENDIF END ENDIF +IFDEF(F_DATACONS) +DATE FR_DATACONS +BEGIN +IFDEF(X_RIGAEVASA) + PROMPT X_DATACONS Y_DATACONS PR_DATACONS +ELSEIF + PROMPT 53 10 "Consegna " +ENDIF + FIELD DATACONS +END +ENDIF + IFDEF(F_TARA) NUMBER FR_TARA 15 2 BEGIN @@ -999,7 +1011,7 @@ ENDIF ENDIF IFDEF(F_CAUS) -STRING FR_CAUS 4 +STRING FR_CAUS 5 BEGIN IFDEF(X_CAUS) PROMPT X_CAUS Y_CAUS PR_CAUS @@ -1022,12 +1034,12 @@ ENDIF END IFDEF(F_DESCRCAUS) -STRING FR_DESCRCAUS 50 +STRING FR_DESCRCAUS 49 BEGIN IFDEF(X_DESCRCAUS) PROMPT X_DESCRCAUS Y_DESCRCAUS PR_DESCRCAUS ELSEIF - PROMPT 22 18 "" + PROMPT 23 18 "" ENDIF FLAGS "D" END @@ -1086,7 +1098,7 @@ IFDEF(X_CODDEPC) ELSEIF PROMPT 2 20 "Deposito " ENDIF - COPY USE FR_CODDEP + USE MAG SELECT (CODTAB[1,3]==#FR_CODMAGC) && (CODTAB[4,5]!="") INPUT CODTAB[1,3] FR_CODMAGC INPUT CODTAB[4,5] FR_CODDEPC DISPLAY "Codice mag." CODTAB[1,3]