From 38d4268129de67bdd21c420bff5fd50d5f31412c Mon Sep 17 00:00:00 2001 From: luca Date: Thu, 22 Oct 2009 10:58:27 +0000 Subject: [PATCH] =?UTF-8?q?Patch=20level=20=20=20=20=20=20=20=20=20:10.0?= =?UTF-8?q?=20Files=20correlati=20=20=20=20=20:=20Ricompilazione=20Demo=20?= =?UTF-8?q?:=20[=20]=20Commento=20=20=20=20=20=20=20=20=20=20=20=20:aggiun?= =?UTF-8?q?ta=20stampa=20contratti;=20aggiunta=20possibilit=C3=A0=20di=20u?= =?UTF-8?q?sare=20rep=20personalizzati;=20aggiunta=20stampa=20contratti?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://10.65.10.50/trunk@19498 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- ve/ve2700.cpp | 20 ++++- ve/ve3500.cpp | 34 +++++++- ve/ve3500a.h | 4 +- ve/ve3500a.uml | 9 ++- ve/ve3500c.rep | 205 +++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 261 insertions(+), 11 deletions(-) create mode 100755 ve/ve3500c.rep diff --git a/ve/ve2700.cpp b/ve/ve2700.cpp index 4c47487f3..fa0785af3 100755 --- a/ve/ve2700.cpp +++ b/ve/ve2700.cpp @@ -45,6 +45,7 @@ protected: void save_listini(); //salva tutte le righe listini (padre e figli) così come sono sullo sheet (on_field) real get_price(TSheet_field& sf, const int row, const short dlg_id) const; + real get_price(TMask_field& fld) const; void set_price(TSheet_field& sf, const int row, const short dlg_id, real& price); void set_price(TMask_field& fld, real& price); bool arrotonda(const short dlg_id, real& price); @@ -203,6 +204,17 @@ void TAggiorna_listini_edit_mask::save_children_list() //metodi F_MULTILISTINI +real TAggiorna_listini_edit_mask::get_price(TMask_field& fld) const +{ + TString16 str_prezzo = fld.get(); + if (fld.dlg() == S2_PREZZO) + { + str_prezzo.strip("."); + str_prezzo.replace(',', '.'); + } + return real(str_prezzo); +} + //prende il prezzo del padre e sostituisce i '.' con le ',' real TAggiorna_listini_edit_mask::get_price(TSheet_field& sf, const int row, const short dlg_id) const { @@ -267,7 +279,7 @@ void TAggiorna_listini_edit_mask::set_price(TMask_field& fld, real& price) { const bool is_father_list = arrotonda(fld.dlg(), price); if (is_father_list) - fld.set(price.stringa()); + fld.set(price.stringa(0, TCurrency::get_firm_dec(true))); else fld.set(price.string()); } @@ -742,7 +754,8 @@ bool TAggiorna_listini_edit_mask::on_field_event(TOperable_field& o, TField_even { //se il prezzo viene messo a 0 nel listino padre, si prepara ad eliminare l'articolo.. //..come se fosse premuto DLG_USER (vedi DLG_USER qui sotto) - if (real::is_null(o.get())) + real father_price = get_price(o); + if (father_price.is_zero()) { TMask& rowmask = o.mask(); rowmask.field(DLG_USER).on_hit(); @@ -751,7 +764,6 @@ bool TAggiorna_listini_edit_mask::on_field_event(TOperable_field& o, TField_even //..(articolo nuovo o resettato), sui prezzi figli viene messo il prezzo del padre { //per prima cosa sistema se stesso (è un padre ignobile!) - real father_price = o.get(); set_price(o, father_price); //poi i figli @@ -793,7 +805,7 @@ bool TAggiorna_listini_edit_mask::on_field_event(TOperable_field& o, TField_even case S2_LIST10: if (e == fe_modify && jolly == 2) { - real price = o.get(); + real price = get_price(o); set_price(o, price); _ask_save = true; } diff --git a/ve/ve3500.cpp b/ve/ve3500.cpp index b95206798..5fc21a9ae 100755 --- a/ve/ve3500.cpp +++ b/ve/ve3500.cpp @@ -29,7 +29,9 @@ TPrint_condven_mask::TPrint_condven_mask() : TAutomask("ve3500a") tipo = main_app().argv(2); set(F_TIPO, tipo); - if (tipo[0] == 'L') + switch (tipo[0]) + { + case 'L': { //il costruttore abilita/disabilita i campi delle categorie di vendita in base alla configurazione const bool gesliscv = ini_get_bool(CONFIG_DITTA, "ve", "GESLISCV"); @@ -39,6 +41,27 @@ TPrint_condven_mask::TPrint_condven_mask() : TAutomask("ve3500a") if (!gesliscv) efield(F_L_CATVEN).reset_key(1); } + break; + case 'C': + { + const bool gescf = ini_get_bool(CONFIG_DITTA, "ve", "GESCONCC"); + enable(F_C_TIPOCF, gescf); + enable(F_C_CODCF, gescf); + //anche i campi dei clifo stanno in chiave! + if (!gescf) + { + efield(F_C_TIPOCF).reset_key(1); + efield(F_C_CODCF).reset_key(1); + } + } + break; + case 'O': + break; + default: + break; + } + + } bool TPrint_condven_mask::on_field_event(TOperable_field& o, TField_event e, long jolly) @@ -104,10 +127,13 @@ void TPrint_condven::print_or_preview(const bool stampa) { if (_mask->check_fields()) { - TString8 rep_name; - rep_name << "ve3500" << _mask->get(F_TIPO); + //l'utonto può scegliere che report usare (personalizzato!) + TString rep_name = _mask->get(F_REPORT); + //se il rep non è selezionato usa quello standard + if (rep_name.empty()) + rep_name << "ve3500" << _mask->get(F_TIPO); - TPrint_condven_report rep; + TPrint_condven_report rep; rep.load(rep_name); rep.mask2report(*_mask); //setta i valori della maschera sul report diff --git a/ve/ve3500a.h b/ve/ve3500a.h index 5e4ed08a0..616f2a176 100755 --- a/ve/ve3500a.h +++ b/ve/ve3500a.h @@ -24,4 +24,6 @@ #define F_DARAGFIS 230 #define F_DADESRAGFIS 231 #define F_ARAGFIS 232 -#define F_ADESRAGFIS 233 +#define F_ADESRAGFIS 233 + +#define F_REPORT 240 diff --git a/ve/ve3500a.uml b/ve/ve3500a.uml index 0d4f58c81..e97dd8bf6 100755 --- a/ve/ve3500a.uml +++ b/ve/ve3500a.uml @@ -113,7 +113,6 @@ END STRING F_C_RAGSOC 50 47 BEGIN PROMPT 27 3 "" - FLAGS "U" USE LF_CLIFO KEY 2 INPUT TIPOCF F_C_TIPOCF INPUT RAGSOC F_C_RAGSOC @@ -123,7 +122,6 @@ BEGIN COPY OUTPUT F_C_CODCF CHECKTYPE NORMAL GROUP 2 - FIELD #RAGSOC END TEXT DLG_NULL @@ -403,6 +401,13 @@ BEGIN CHECKTYPE NORMAL END +STRING F_REPORT 50 +BEGIN + PROMPT 2 18 "Report personalizzato " + RSELECT "" + CHECKTYPE NORMAL +END + ENDPAGE ENDMASK \ No newline at end of file diff --git a/ve/ve3500c.rep b/ve/ve3500c.rep new file mode 100755 index 000000000..18b2b3e30 --- /dev/null +++ b/ve/ve3500c.rep @@ -0,0 +1,205 @@ + + + Stampa contratti + +
+ + + + + + + + + + + + + + + +
+
+ + + + + + + + COD + MESSAGE ISAMREAD,52,TIPO=C!TIPOCF=TIPOCF!CODCF=CODCF!COD=COD,101=DESCR!102=VALIN!103=VALFIN!104=OBBLIG!201=IMPLORDI!202=GESTUM!203=GESTSCAGL!204=GESTSCO + + MESSAGE COPY,F0.100 + + + + TIPOCF + MESSAGE COPY,F0.102 + +
  • +
  • + + + + + CODCF + MESSAGE COPY,F0.103 + + + + MESSAGE ISAMREAD,20,TIPOCF=TIPOCF!CODCF=CODCF,RAGSOC + MESSAGE COPY,F0.104 + + + + + + + + + + + + MESSAGE COPY,F0.101 + + + + + + + + + + +
  • +
  • + + + + + +
  • +
  • + + + + + +
  • +
  • + + + + + +
  • +
  • + + + + + +
  • +
  • + + +
  • +
    + TIPORIGA="A" + + + + + TIPORIGA + +
  • +
  • +
  • + + +
  • +
    +
    + + PREZZO + + + + CODIVA + + + + PERCPROVV + + + + SCONTO + + + + QBASE + + + + QOM + + + + PROMAGGIO + + + + UMOM + + + + CODRIGA + + + + MESSAGE ISAMREAD,47,CODART=#102,DESCR + + + + MESSAGE TABLEREAD,GMC,#102,S0 + + + + MESSAGE TABLEREAD,RFA,#102,S0 + +
    +
    + + + + + #REPORT.PAGE + + + + + +
  • +
  • + + + + +
  • +
    +
    + USE RCONDV +SELECT ((TIPORIGA="A")(BETWEEN(CODRIGA,#DACODART,#ACODART))(BETWEEN(ANAMAG.GRMERC,#DAGRMERC,#AGRMERC))(BETWEEN(ANAMAG.RAGGFIS,#DARAGFIS,#ARAGFIS)))||((TIPORIGA="G")(BETWEEN(CODRIGA,#DAGRMERC,#AGRMERC)))||((TIPORIGA="R")(BETWEEN(CODRIGA,#DARAGFIS,#ARAGFIS))) +JOIN ANAMAG INTO CODART=CODRIGA +FROM TIPO=C TIPOCF=#TIPOCF CODCF=#CODCF COD=#COD +TO TIPO=C TIPOCF=#TIPOCF CODCF=#CODCF COD=#COD + + \ No newline at end of file