From e7ede03f87d47465e485827d8405d416e6cb7a01 Mon Sep 17 00:00:00 2001 From: alex Date: Tue, 28 Oct 2008 20:15:28 +0000 Subject: [PATCH] Patch level : 10.0 148 Files correlati : ve0.exe Ricompilazione Demo : [ ] Commento : Aggiunti i flag di lavanderia alle causali di magazzino bollaclv.msk bollaclv.ini verig16.msk verig16.ini Prima bozza di profilo di bolla manuale di lavanderia e di rigo bolla lavanderia con causale lavanderia quantita' consegnata e ritirata git-svn-id: svn://10.65.10.50/trunk@17497 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- ve/bollaclv.src | 263 ++++++++++++++++++++++++++++++++++++++++++++++++ ve/ve0100.cpp | 26 ++++- ve/velib.h | 2 + ve/velib03.cpp | 48 ++++++++- ve/velib03a.cpp | 1 + ve/velib04.h | 6 +- ve/velib04f.cpp | 172 +++++++++++++++---------------- ve/velib06.cpp | 18 +++- ve/velib06a.cpp | 2 +- ve/vepriv.h | 3 + ve/verig.h | 4 + ve/verig.uml | 69 +++++++++++-- ve/verig00.uml | 1 - ve/verig16.ini | 9 ++ ve/verig16.uml | 44 ++++++++ 15 files changed, 561 insertions(+), 107 deletions(-) create mode 100755 ve/bollaclv.src create mode 100755 ve/verig16.ini create mode 100755 ve/verig16.uml diff --git a/ve/bollaclv.src b/ve/bollaclv.src new file mode 100755 index 000000000..bcbe3ae20 --- /dev/null +++ b/ve/bollaclv.src @@ -0,0 +1,263 @@ +#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 +// modifica +CAMPICALC=TOTMER|TOTPRE|SPESE|SPESIMB|SPESTRA|SPESINC|BOLLI|IMPONIBILI|IMPOSTE|TOTDOC|SCONTOD|SCONTOT|OMAGGI|TOTPROVV +CALCOLI=* +TOTPROVV= +// Indica se il documento è indirizzato ad un cliente o ad un fornitore +TIPOCF=C + +[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 +CONTROEURO = 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 +IBAN = S_NORMALE //600 +IBAN_STATO = S_NORMALE //600 +IBAN_CHECK = S_NORMALE //600 +BBAN = S_NORMALE //600 +BBAN_CIN = S_NORMALE //600 +BBAN_ABI = S_NORMALE //600 +BBAN_CAB = S_NORMALE //600 +BBAN_CONTO = 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_NORMALE //1000 +NUMDOCRIF = S_NOCHECK //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_NORMALE //1300 +DESNOTESP2 = S_NORMALE //1300 +CAUSTRASP = S_OBBLIGATORIO //1400 +DENCAUSTRASP = S_NORMALE //1400 +CODVETT1 = S_NORMALE //1500 +CODVETT2 = S_NORMALE //1500 +CODVETT3 = S_NORMALE //1500 +NOMEVETT1 = S_NORMALE //1500 +NOMEVETT2 = S_NORMALE //1500 +NOMEVETT3 = S_NORMALE //1500 +NCOPIE = S_NASCOSTO //1600 +GRPARTENZA = S_NORMALE //1700 +DATAPART = S_NORMALE //1700 +ORAPART = S_NORMALE //1700 +IMPPAGATO = S_NORMALE //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_NASCOSTO //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 +CAUSMAGC = S_DISABILITATO //2900 +DESCRMAG = S_NORMALE //2900 +DESCRMAGC = S_DISABILITATO //2900 +CODCMS = S_NORMALE //3000 +DESCRCMS = S_NORMALE //3000 +FASCMS = S_NORMALE //3000 +DESCRFAS = S_NORMALE //3000 +BLANK = S_DISABILITATO //4000 +CODNOTE = S_NORMALE //2500 +NOTECLI = S_NOCHECK //2500 + +[DEFAULT] +Default(0)=F_CAUSTRASP|VEN + +[SHEET] +Col(0)=FR_CODAGG1|Causale Lavanderie +Col(1)=FR_CODMAG +Col(2)=FR_CODDEP +Col(3)=FR_CODART +Col(4)=FR_LIV1 +Col(5)=FR_LIV2 +Col(6)=FR_LIV3 +Col(7)=FR_LIV4 +Col(8)=FR_DESCR +Col(9)=FR_UMQTA +Col(10)=FR_QTA|Consegnato|18 +Col(11)=FR_QTAGG1|Ritirato|18 +Col(12)=FR_PREZZO +Col(13)=FR_SCONTO +Col(14)=FR_PERCPROV +Col(15)=FR_IMPFISUN +Col(16)=FR_IMPFISSO +Col(17)=FR_CODIVA +Col(18)=FR_NCOLLI +Col(19)=FR_PNETTO +Col(20)=FR_TARA +Col(21)=FR_CAUS +Col(22)=FR_CODMAGC +Col(23)=FR_CODDEPC +Col(24)=FR_TIPORIGA + +[RIGHE] + +[HANDLERS] +// Handler(0) = 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_NORMALE +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_NASCOSTO +2300 = S_NORMALE +2400 = S_NORMALE +2500 = S_NORMALE +2700 = S_NORMALE +2710 = S_NORMALE +2800 = S_NORMALE +2900 = S_NORMALE +3000 = S_NORMALE +4000 = S_NORMALE + +[ORDINEGRUPPI] +NGROUPS=30 +1=100 +2=2500 +3=200 +4=300 +5=400 +6=500 +7=600 +8=700 +9=2400 +10=2300 +11=800 +12=810 +13=820 +14=830 +15=900 +16=1100 +17=1200 +18=1500 +19=1210 +20=1300 +21=1400 +22=2100 +23=2800 +24=2700 +25=2710 +26=1700 +27=1800 +28=1000 +29=2900 +30=3000 + diff --git a/ve/ve0100.cpp b/ve/ve0100.cpp index a1884408d..138ebdf87 100755 --- a/ve/ve0100.cpp +++ b/ve/ve0100.cpp @@ -481,6 +481,17 @@ void TMotore_application::load_auto_reopen_data() } } +bool num_filter(const TRelation* r) +{ + const TCodice_numerazione & cod_num = cached_numerazione(r->curr().get("CODTAB")); + + int last = cod_num.ntipi_doc(); + for (int i = 0; i < last; i++ ) + if (tipodoc_ok(cod_num.tipo_doc(i))) + return true; + return false; +} + bool TMotore_application::user_create( ) { open_files(LF_DOC, LF_RIGHEDOC, LF_CONDV, LF_RCONDV, LF_ANAMAG, LF_SCONTI, LF_UMART, LF_DESLIN, LF_CODCORR, @@ -505,6 +516,16 @@ bool TMotore_application::user_create( ) const int args = argc() ; + TEdit_field & e = _msk->efield(F_CODNUM); + TBrowse * b = e.browse(); + TEdit_field & edes = _msk->efield(F_DESNUM); + TBrowse * bdes = edes.browse(); + TCursor * cur = b->cursor(); + TCursor * descur = bdes->cursor(); + + cur->set_filterfunction(num_filter); + descur->set_filterfunction(num_filter); + for (int i = 2; i < args; i++) { const TString arg(argv(i)); @@ -532,11 +553,6 @@ bool TMotore_application::user_create( ) else if (arg.starts_with("-filt")) { - TEdit_field & e = _msk->efield(F_CODNUM); - TBrowse * b = e.browse(); - TEdit_field & edes = _msk->efield(F_DESNUM); - TBrowse * bdes = edes.browse(); - if (b != NULL || bdes != NULL) { TString filter = b->get_filter(); diff --git a/ve/velib.h b/ve/velib.h index e01f592fb..68509dcc9 100755 --- a/ve/velib.h +++ b/ve/velib.h @@ -224,6 +224,7 @@ class TTipo_documento : public TRectype // velib03 TString16 _field_qta, _field_qtaevasa; // Veri campi Quantità e Quantità Evasa TString16 _raee_cod, _raee_fld; TString _str_desc_doc, _str_desc_rdoc; + TString4 _module; char _tipocf; char _tipocr; @@ -305,6 +306,7 @@ public: bool additional_print_profile(TFilename& report) const; bool is_costo() const ; bool is_ricavo() const ; + const TString & module() const { return _module; } TFormula_documento* first_formula() { return succ_formula(true); } TFormula_documento* succ_formula(bool restart = false); diff --git a/ve/velib03.cpp b/ve/velib03.cpp index a62350081..0f60ade9e 100755 --- a/ve/velib03.cpp +++ b/ve/velib03.cpp @@ -1131,8 +1131,52 @@ int TDocumento::write_rewrite(TBaseisamfile & f, bool re) const rm.put(RMOVMAG_CODCAUS, cod_caus_riga); rm.put(RMOVMAG_TIPORIGA, (char) riga_dadocumento); } - } - + + if (main_app().has_module(LVAUT)) + { + const TString & codcauslav = r.get(RDOC_CODAGG1); + const TRectype & caulav = cache().get("&LVCAU", codcauslav); + if (!caulav.empty()) + { + const real qta = r.get(RDOC_QTAGG1); + const TString & causcons = caulav.get("S6"); + + if (causcons.full()) + mov[LF_RMOVMAG][j - 1].put(RMOVMAG_CODCAUS, causcons); + + if (r_num == num_movmag && !qta.is_zero()) + { + const TString & causrit = caulav.get("S7"); + TRectype & rm = mov.insert_row(j++); + + rm.put(RMOVMAG_IMPIANTO, r.get(RDOC_IMPIANTO)); + rm.put(RMOVMAG_LINEA, r.get(RDOC_LINEA)); + rm.put(RMOVMAG_CODMAG, r.get(RDOC_CODMAGC)); + if (articolo && (causrit.full() ? cached_causale_magazzino(causrit).scarica_alternativi() : scarica_alt)) + { + const TRectype art = cache().get(LF_ANAMAG, codart); + const TString & alt = art.get(ANAMAG_CODARTALT); + + if (alt.full()) + codart = alt; + } + rm.put(RMOVMAG_CODART, codart); + rm.put(RMOVMAG_LIVGIAC, r.get(RDOC_LIVELLO)); + rm.put(RMOVMAG_UM, r.get(RDOC_UMQTA)); + + rm.put(RMOVMAG_QUANT, qta); + +/* TCurrency_documento prezzo(r.prezzo(TRUE, FALSE), *this, TRUE); + + prezzo.change_to_firm_val(); + rm.put(RMOVMAG_PREZZO, prezzo.get_num()); */ + rm.put(RMOVMAG_CODCAUS, causrit); + rm.put(RMOVMAG_TIPORIGA, (char) riga_dadocumento); + } + } + } + } + const TString & indetr = r.get(RDOC_TIPODET); if (indetr.full()) diff --git a/ve/velib03a.cpp b/ve/velib03a.cpp index 08b8f495f..137e884ac 100755 --- a/ve/velib03a.cpp +++ b/ve/velib03a.cpp @@ -343,6 +343,7 @@ void TTipo_documento::read_formule() _str_desc_rdoc = prof.get("DESCRIZIONE_RDOC"); _show_evaded_lines = !prof.get_bool("NASCONDI_RIGHE_EVASE"); // Normalmente mostra anche evase _non_evadere = prof.get_bool("NON_EVADERE"); // Normalmente mostra anche evase + _module = prof.get("MODULE", NULL, -1, "ve").left(2); } diff --git a/ve/velib04.h b/ve/velib04.h index d20208a8d..012ae17da 100755 --- a/ve/velib04.h +++ b/ve/velib04.h @@ -592,14 +592,14 @@ class TContabilizzazione_analitica : public TElaborazione // velib04f bool _usepdcc; protected: - bool find_conti_iva_indetraibile(const TRiga_documento& riga, const TBill & bill, TString_array& conti, int annoes, const char tipomov); - bool find_conti(const TRiga_documento& riga, TString_array& conti, int annoes, bool riclassifica_fdr_fde, const char tipomov); + bool find_conti_iva_indetraibile(const TRiga_documento& riga, const TBill & bill, TString_array& conti, int annoes, const char tipomov, bool & pareggio); + bool find_conti(const TRiga_documento& riga, TString_array& conti, int annoes, bool riclassifica_fdr_fde, const char tipomov, bool & pareggio); void init(); const TCausale& doc2caus(const TDocumento& doc); const TCausale& rdoc2caus(const TRiga_documento& rdoc); - void init_distrib(TString_array& conti, TGeneric_distrib& distrib); + void init_distrib(TString_array& conti, TGeneric_distrib& distrib, bool pareggio); public: bool search_costo_ricavo(const TRiga_documento& riga, TBill& conto, bool riclassifica_fdr_fde); diff --git a/ve/velib04f.cpp b/ve/velib04f.cpp index 4ab443a13..adeb16dca 100755 --- a/ve/velib04f.cpp +++ b/ve/velib04f.cpp @@ -327,62 +327,56 @@ bool TContabilizzazione_analitica::search_costo_ricavo(const TRiga_documento& r, return conto.ok() && conto.find(); } -bool TContabilizzazione_analitica::find_conti_iva_indetraibile(const TRiga_documento& riga, const TBill & bill, TString_array& conti, int annoes, const char tipomov) +bool TContabilizzazione_analitica::find_conti_iva_indetraibile(const TRiga_documento& riga, const TBill & bill, TString_array& conti, int annoes, const char tipomov, bool & pareggio) { const TString80 riga_cos = riga.codice_costo(); const TString80 riga_cms = riga.codice_commessa(); const TString16 riga_fsc = riga.fase_commessa(); -// const int annoes = riga.get_int(RDOC_ANNO); - const bool riga_any = riga_cos.full() || riga_cms.full() || riga_fsc.full(); - TToken_string conto; - if (_usepdcc) - { - conto = bill.string(0x8); // format("%03d%03d%06ld", bill.gruppo(), bill.conto(), bill.sottoconto()); - if (riga_any) - { - conto.add(riga_cos, 1); - conto.add(riga_cms, 2); - conto.add(riga_fsc, 3); - } - conto.add(100, 4); - conti.add(conto); - } - else + + conto = bill.string(0x8); // format("%03d%03d%06ld", bill.gruppo(), bill.conto(), bill.sottoconto()); + conto.add(riga_cos, 1); + conto.add(riga_cms, 2); + conto.add(riga_fsc, 3); + conto.add(100, 4); + conti.add(conto); + + const TAnal_ripartizioni_batch & rip = _rip.righe(bill, annoes, tipomov); + + pareggio = rip.rows() == 0; + for (int i = 1; i <= rip.rows(); i++) { - // Cerca la ripartizione del conto - const TAnal_ripartizioni_batch& rip = _rip.righe_interattive(bill, annoes, tipomov); - for (int i = 1; i <= rip.rows(); i++) - { - const TRectype& rigarip = rip.row(i); - conto = rigarip.get(RRIP_CODCONTO); - if (riga_any) - { - conto.add(riga_cos, 1); - conto.add(riga_cms, 2); - conto.add(riga_fsc, 3); - } - else - { - conto.add(rigarip.get(RRIP_CODCOSTO), 1); - conto.add(rigarip.get(RRIP_CODCMS), 2); - conto.add(rigarip.get(RRIP_CODFASE), 3); - } - conto.add(rigarip.get(RRIP_RIPARTO), 4); - conti.add(conto); - } + const TRectype& rigarip = rip.row(i); + + conto = rigarip.get(RRIP_CODCONTO); + + const TString costo = rigarip.get(RRIP_CODCOSTO); + + conto.add(costo.full() ? costo : riga_cos, 1); + + const TString & commessa = rigarip.get(RRIP_CODCMS); + + conto.add(commessa.full() ? commessa : riga_cms, 2); + + const TString & fase = rigarip.get(RRIP_CODFASE); + + conto.add(fase.full() ? fase: riga_fsc, 3); + conto.add(rigarip.get(RRIP_RIPARTO), 4); + conti.add(conto); } return !conti.empty(); } -bool TContabilizzazione_analitica::find_conti(const TRiga_documento& riga, TString_array& conti, int annoes, bool riclassifica_fdr_fde, const char tipomov) +bool TContabilizzazione_analitica::find_conti(const TRiga_documento& riga, TString_array& conti, int annoes, bool riclassifica_fdr_fde, const char tipomov, bool & pareggio) { bool bArcticleFound = false; const char tipocf = riga.doc().get_char(DOC_TIPOCF); TString80 contanal; + TToken_string conto; TBill bill; // Cerco il conto contabile + pareggio = false; if (riga.is_sconto()) { if (riga.is_sconto_perc()) @@ -432,59 +426,56 @@ bool TContabilizzazione_analitica::find_conti(const TRiga_documento& riga, TStri const TString80 riga_cos = riga.codice_costo(); const TString80 riga_cms = riga.codice_commessa(); const TString16 riga_fsc = riga.fase_commessa(); -// const int annoes = riga.get_int(RDOC_ANNO); - const bool riga_any = riga_cos.not_empty() || riga_cms.not_empty() || riga_fsc.not_empty(); - if (contanal.blank()) // Non ho trovato il conto in anagrafica ... - { - // Cerca la ripartizione del conto - const TAnal_ripartizioni_batch& rip = _rip.righe_interattive(bill, annoes, tipomov); - TToken_string conto; - for (int i = 1; i <= rip.rows(); i++) - { - const TRectype& rigarip = rip.row(i); - conto = rigarip.get(RRIP_CODCONTO); - if (riga_any) - { - conto.add(riga_cos, 1); - conto.add(riga_cms, 2); - conto.add(riga_fsc, 3); - } - else - { - conto.add(rigarip.get(RRIP_CODCOSTO), 1); - conto.add(rigarip.get(RRIP_CODCMS), 2); - conto.add(rigarip.get(RRIP_CODFASE), 3); - } - conto.add(rigarip.get(RRIP_RIPARTO), 4); - conti.add(conto); - } - } - else + if (contanal.full()) // Non ho trovato il conto in anagrafica ... { // Ho trovato il conto in anagrafica ... TToken_string conto = contanal; - if (riga_any) - { - conto.add(riga_cos, 1); - conto.add(riga_cms, 2); - conto.add(riga_fsc, 3); - } + + conto.add(riga_cos, 1); + conto.add(riga_cms, 2); + conto.add(riga_fsc, 3); conto.add(100, 4); conti.add(conto); } + const TAnal_ripartizioni_batch & rip = _rip.righe(bill, annoes, tipomov); + + pareggio = rip.rows() > 0; + for (int i = 1; i <= rip.rows(); i++) + { + const TRectype& rigarip = rip.row(i); + + conto = rigarip.get(RRIP_CODCONTO); + + const TString costo = rigarip.get(RRIP_CODCOSTO); + + conto.add(costo.full() ? costo : riga_cos, 1); + + const TString & commessa = rigarip.get(RRIP_CODCMS); + + conto.add(commessa.full() ? commessa : riga_cms, 2); + + const TString & fase = rigarip.get(RRIP_CODFASE); + + conto.add(fase.full() ? fase: riga_fsc, 3); + conto.add(rigarip.get(RRIP_RIPARTO), 4); + conti.add(conto); + } return !conti.empty(); } -void TContabilizzazione_analitica::init_distrib(TString_array& conti, TGeneric_distrib& distrib) +void TContabilizzazione_analitica::init_distrib(TString_array& conti, TGeneric_distrib& distrib, bool pareggio) { FOR_EACH_ARRAY_ROW(conti, i, row) { - real slice = row->get(4); - if (slice <= ZERO) - slice = UNO; - distrib.add(slice); + if (!pareggio || i > 0) + { + real slice = row->get(4); + if (slice <= ZERO) + slice = UNO; + distrib.add(slice); + } } } @@ -574,6 +565,7 @@ bool TContabilizzazione_analitica::elabora(TDocumento& doc, long numreg_cg, TVis for (i = 1; i <= doc.physical_rows(); i++) { const TRiga_documento& riga = doc[i]; + bool pareggio = false; // salto descrizioni, sconti e omaggi // if (riga.is_descrizione() || riga.is_sconto() || riga.is_omaggio()) @@ -604,11 +596,11 @@ bool TContabilizzazione_analitica::elabora(TDocumento& doc, long numreg_cg, TVis { TString_array conti_ind; const char tipomov = mov.get_char(MOVANA_TIPOMOV); - if (find_conti_iva_indetraibile(riga, bill, conti_ind, annoes, tipomov)) //qui + if (find_conti_iva_indetraibile(riga, bill, conti_ind, annoes, tipomov, pareggio)) //qui { TGeneric_distrib esso(ivaind, decimals); - init_distrib(conti_ind, esso); + init_distrib(conti_ind, esso, pareggio); FOR_EACH_ARRAY_ROW(conti_ind, j, row_ind) { TRectype& rmov = mov.new_row(); @@ -619,11 +611,15 @@ bool TContabilizzazione_analitica::elabora(TDocumento& doc, long numreg_cg, TVis rmov.put(RMOVANA_CODFASE, row_ind->get()); rmov.put(RMOVANA_DESCR, riga.get(RDOC_DESCR)); - TImporto imp(sezione, real(esso.get())); + const bool negative = pareggio && j > 0; + const bool totale = pareggio && j == 0; + TImporto imp(sezione, totale ? ivaind : real(esso.get())); + + if (negative) + imp.swap_section(); imp.normalize(); rmov.put(RMOVANA_SEZIONE, imp.sezione()); rmov.put(RMOVANA_IMPORTO, imp.valore()); - totdoc += imp; } } @@ -639,7 +635,7 @@ bool TContabilizzazione_analitica::elabora(TDocumento& doc, long numreg_cg, TVis TString_array conti; const char tipomov = mov.get_char(MOVANA_TIPOMOV); - const bool ok = find_conti(riga, conti, annoes, riclassifica_fdr_fde, tipomov); + const bool ok = find_conti(riga, conti, annoes, riclassifica_fdr_fde, tipomov, pareggio); if (!ok) { if (viswin != NULL) @@ -655,7 +651,7 @@ bool TContabilizzazione_analitica::elabora(TDocumento& doc, long numreg_cg, TVis TGeneric_distrib esso(valore, decimals); - init_distrib(conti, esso); + init_distrib(conti, esso, pareggio); FOR_EACH_ARRAY_ROW(conti, i, row) { TRectype& rmov = mov.new_row(); @@ -666,11 +662,15 @@ bool TContabilizzazione_analitica::elabora(TDocumento& doc, long numreg_cg, TVis rmov.put(RMOVANA_CODFASE, row->get()); rmov.put(RMOVANA_DESCR, riga.get(RDOC_DESCR)); - TImporto imp(sezione, real(esso.get())); + const bool negative = pareggio && i > 0; + const bool totale = pareggio && i == 0; + TImporto imp(sezione, totale ? valore : real(esso.get())); + + if (negative) + imp.swap_section(); imp.normalize(); rmov.put(RMOVANA_SEZIONE, imp.sezione()); rmov.put(RMOVANA_IMPORTO, imp.valore()); - totdoc += imp; } } diff --git a/ve/velib06.cpp b/ve/velib06.cpp index 9cc5fcfda..ba37ecb5b 100755 --- a/ve/velib06.cpp +++ b/ve/velib06.cpp @@ -3054,6 +3054,17 @@ bool TDocumento_mask::anno_handler( TMask_field& f, KEY key) TString16 __codnum; +bool tipodoc_ok(const TString & tipodoc) +{ + const TString4 module(main_app().name().left(2)); + const TTipo_documento& tipo = cached_tipodoc(tipodoc); + const TString & tipomod = tipo.module(); + + if (module == "ve" && tipomod.blank()) + return true; + return tipomod == module; +} + bool tip_filter(const TRelation* r) { if (__codnum.blank()) @@ -3065,15 +3076,16 @@ bool tip_filter(const TRelation* r) for (int i = 0; i < last; i++ ) { const TString & curtipo = cod_num.tipo_doc(i); - if (curtipo == tipo) - return true; + + if (curtipo == tipo && tipodoc_ok(curtipo)) + return true; } return false; } bool TDocumento_mask::num_handler( TMask_field& f, KEY key) { - if (key == K_TAB && f.to_check(key, TRUE)) + if (key == K_TAB && f.to_check(key, true)) { // Ottengo la maschera TMask& m = f.mask(); diff --git a/ve/velib06a.cpp b/ve/velib06a.cpp index 84b4d71f6..f8cdd3655 100755 --- a/ve/velib06a.cpp +++ b/ve/velib06a.cpp @@ -2195,7 +2195,7 @@ bool TDocumento_mask::ragsoc_search_handler(TMask_field& f, KEY key) sheet.cursor()->read(); if (sheet.run() == K_ENTER) { - const TString16 ndoc = sheet.row(-1).get(5); + const long ndoc = sheet.row(-1).get_long(2); m.set(F_NDOC, ndoc); m.stop_run(K_AUTO_ENTER); } diff --git a/ve/vepriv.h b/ve/vepriv.h index d597c9b84..08b676387 100755 --- a/ve/vepriv.h +++ b/ve/vepriv.h @@ -36,4 +36,7 @@ bool cms_mag_handler(TMask_field& f, KEY key); bool codcms_handler(TMask_field &f, KEY key); bool numdocrif_hndl(TMask_field& field, KEY key); bool smart_hndl(TMask_field& field, KEY key); + +bool tipodoc_ok(const TString & tipodoc); + #endif diff --git a/ve/verig.h b/ve/verig.h index 21606ba67..7a397197b 100755 --- a/ve/verig.h +++ b/ve/verig.h @@ -67,6 +67,7 @@ #define FR_CODARTMAG 131 #define FR_CHECKED 132 #define FR_CHECKED 132 +#define FR_RITIRO 133 // Lavanderie #define FR_QTAGG1 133 #define FR_QTAGG2 134 #define FR_QTAGG3 135 @@ -87,6 +88,7 @@ #define FR_CDC11 150 #define FR_CDC12 151 #define FR_CODAGG1 152 +#define FR_CAULAV 153 // Lavanderie #define FR_CODAGG2 153 #define FR_TIPODET 154 @@ -132,5 +134,7 @@ #define FR_DESCDC10 290 #define FR_DESCDC11 291 #define FR_DESCDC12 292 +#define FR_FLCONS 293 +#define FR_FLRIT 294 #endif \ No newline at end of file diff --git a/ve/verig.uml b/ve/verig.uml index 1cf046696..d9d4168f1 100755 --- a/ve/verig.uml +++ b/ve/verig.uml @@ -1319,7 +1319,7 @@ BEGIN DISPLAY "Tipo" I0 DISPLAY "Descrizione@50" S0 OUTPUT FR_TIPODET CODTAB - CHECTYPE NORMAL + CHECKTYPE NORMAL FLAGS "U" END @@ -1421,6 +1421,68 @@ END ENDIF ENDIF +IFDEF(FLD_RITIRO) +NUMBER FR_RITIRO 13 5 +BEGIN +IFDEF(X_RITIRO) + PROMPT X_RITIRO Y_RITIRO PR_RITIRO +ELSEIF + PROMPT 2 20 "Ritirato " +ENDIF +IFDEF(FL_RITIRO) + FLAGS FL_RITIRO +ENDIF +IFDEF(MS_RITIRO) + MESSAGE MS_RITIRO +ENDIF +IFDEF(NC_RITIRO) + NUM_CALC NC_RITIRO +ENDIF + FIELD QTAGG1 +END +ENDIF + +IFDEF(FLD_CAULAV) +STRING FR_CAULAV 3 +BEGIN +IFDEF(X_CAULAV) +PROMPT X_CAULAV Y_CAULAV PR_CAULAV +ELSEIF + PROMPT 35 20 "Causale lavanderie " +ENDIF +USE &LVCAU +INPUT CODTAB FR_CAULAV +DISPLAY "Codice" CODTAB +DISPLAY "Descrizione@50" S0 +OUTPUT FR_CAULAV CODTAB +OUTPUT FR_FLCONS B0 +OUTPUT FR_FLRIT B1 +FLAGS "UZ" +IFDEF(MS_CAULAV) + MESSAGE MS_CAULAV +ENDIF +IFDEF(NC_CAULAV) + NUM_CALC NC_CAULAV +ENDIF + FIELD CODAGG1 +END +BOOLEAN FR_FLCONS +BEGIN + PROMPT 50 50 "Flag consegnato" + MESSAGE FALSE CLEAR,FR_QTA + MESSAGE TRUE ENABLE,FR_QTA + FLAGS "HG" +END + +BOOLEAN FR_FLRIT +BEGIN + PROMPT 50 50 "Flag ritirato" + MESSAGE FALSE CLEAR,FR_RITIRO + MESSAGE TRUE ENABLE,FR_RITIRO + FLAGS "HG" +END +ENDIF + #ifdef PAGE_2 #ifndef FULL_SCREEN @@ -1972,9 +2034,4 @@ END #endif ENDPAGE - -#ifdef JOLLY -#include "jolly.uml" -#endif - ENDMASK diff --git a/ve/verig00.uml b/ve/verig00.uml index c6e91d85b..6b202be9b 100755 --- a/ve/verig00.uml +++ b/ve/verig00.uml @@ -1,7 +1,6 @@ #include "verigdef.h" #define PAGE_2 -#define JOLLY DEFINE_FIELD(CODMAG) DEFINE_FIELD(DESMAG) diff --git a/ve/verig16.ini b/ve/verig16.ini new file mode 100755 index 000000000..baa69bdde --- /dev/null +++ b/ve/verig16.ini @@ -0,0 +1,9 @@ +#Profilo di riga tipo merce lavanderie +[MAIN] +CALCOLI=* +CAMPICALC= +IMPONIBILE=IMPNS + +[HANDLERS] +NHANDLER = 0 + diff --git a/ve/verig16.uml b/ve/verig16.uml new file mode 100755 index 000000000..e4f0e2db6 --- /dev/null +++ b/ve/verig16.uml @@ -0,0 +1,44 @@ +#include "verigdef.h" + +#define FULL_SCREEN +// else +// #define MASK_WIDTH 60 +// #define MASK_HEIGHT 14 +// +#define MASK_TITLE1 "Merce Lavanderie" +#define PAGE_2 + +DEFINE_FIELD(CODMAG) +DEFINE_FIELD(DESMAG) +DEFINE_FIELD(CODDEP) +DEFINE_FIELD(DESDEP) +DEFINE_FIELD(CODART) +// F_OUT(CODART, FR_CODAGG1, USER1) +DEFINE_FIELD(DESCRART) +DEFINE_FIELD(UMQTA) +DEFINE_FIELD(QTA) +F_POS(QTA, 21, 9,"Consegnato " ) +DEFINE_FIELD(PREZZO) +F_POS(PREZZO, 47, 9,"Prezzo " ) +DEFINE_FIELD(SCONTO) +F_POS(SCONTO, 2, 11,"Sconto " ) +DEFINE_FIELD(PERCPROV) +F_POS(PERCPROV, 42, 11,"Provvigione" ) +DEFINE_FIELD(CODIVA) +DEFINE_FIELD(DESIVA) +DEFINE_FIELD(CAULAV) +F_POS(CAULAV, 47, 10,"Causale Lavanderie " ) +DEFINE_FIELD(RITIRO) +F_POS(RITIRO, 21, 10,"Ritirato " ) +DEFINE_FIELD(NCOLLI) +DEFINE_FIELD(PNETTO) +DEFINE_FIELD(TARA) +DEFINE_FIELD(DESCRCAUS) +DEFINE_FIELD(CODMAGC) +DEFINE_FIELD(DESMAGC) +DEFINE_FIELD(CODDEPC) +DEFINE_FIELD(DESDEPC) + + +#include "verig.uml" +