From b085f4b290b6f39b9f89d4470690c94269fe255c Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 11 Sep 2013 09:46:01 +0000 Subject: [PATCH] =?UTF-8?q?Gestione=20costo=20disponibilit=C3=A0=20attrezz?= =?UTF-8?q?ature?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://10.65.10.50/branches/R_10_00@22892 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- ci/ci0300a.h | 2 ++ ci/ci0300a.uml | 56 ++++++++++++++++++++++++++++++++++++-------------- ci/ci2400.cpp | 33 ++++++++++++++++++++++++----- 3 files changed, 71 insertions(+), 20 deletions(-) diff --git a/ci/ci0300a.h b/ci/ci0300a.h index d037c3555..7c4d2bf07 100755 --- a/ci/ci0300a.h +++ b/ci/ci0300a.h @@ -16,6 +16,8 @@ #define F_DESTIPODOCCN 164 #define F_CAUSCN 171 #define F_DESCAUSCN 172 +#define F_CODARTPR 173 +#define F_DESARTPR 174 #define F_CODNUMNI 165 #define F_DESNUMNI 166 diff --git a/ci/ci0300a.uml b/ci/ci0300a.uml index 3f3614231..9a183c4f1 100755 --- a/ci/ci0300a.uml +++ b/ci/ci0300a.uml @@ -69,7 +69,7 @@ BEGIN FIELD DETTCONS END -GROUPBOX DLG_NULL 78 4 +GROUPBOX DLG_NULL 78 5 BEGIN PROMPT 1 5 "@bPreventivi" END @@ -128,14 +128,40 @@ BEGIN COPY OUTPUT F_TIPODOCPR END +STRING F_CODARTPR 20 +BEGIN + PROMPT 2 8 "Articolo " + FIELD CODARTPR + USE LF_ANAMAG + INPUT CODART F_CODARTPR + DISPLAY "Codice@20" CODART + DISPLAY "Descrizione@50" DESCR + OUTPUT F_CODARTPR CODART + OUTPUT F_DESARTPR DESCR + CHECKTYPE NORMAL + FLAG "U" +END + +STRING F_DESARTPR 50 30 +BEGIN + PROMPT 45 8 "" + USE LF_ANAMAG KEY 2 + INPUT DESCR F_DESARTPR + DISPLAY "Descrizione@50" DESCR + DISPLAY "Codice@20" CODART + COPY OUTPUT F_CODARTPR + CHECKTYPE NORMAL + FLAG "U" +END + GROUPBOX DLG_NULL 78 5 BEGIN - PROMPT 1 9 "@bConsuntivi" + PROMPT 1 10 "@bConsuntivi" END STRING F_CODNUMCN 4 BEGIN - PROMPT 2 10 "Numerazione " + PROMPT 2 11 "Numerazione " FIELD CODNUMCN HELP "Codice numerazione" USE %NUM @@ -151,7 +177,7 @@ END STRING F_DESNUMCN 50 BEGIN - PROMPT 25 10 "" + PROMPT 25 11 "" HELP "Descrizione numerazione" USE %NUM KEY 2 INPUT S0 F_DESNUMCN @@ -162,7 +188,7 @@ END STRING F_TIPODOCCN 4 BEGIN - PROMPT 2 11 "Tipo documento " + PROMPT 2 12 "Tipo documento " FIELD TIPODOCCN HELP "Codice tipo documento" USE %TIP @@ -177,7 +203,7 @@ END STRING F_DESTIPODOCCN 50 BEGIN - PROMPT 25 11 "" + PROMPT 25 12 "" HELP "Descrizione tipo documento" USE %TIP KEY 2 INPUT S0 F_DESTIPODOCCN @@ -188,7 +214,7 @@ END STRING F_CAUSCN 4 BEGIN - PROMPT 2 12 "Casuale cont. " + PROMPT 2 13 "Casuale cont. " USE LF_CAUSALI SELECT MOVIND="X" INPUT CODCAUS F_CAUSCN DISPLAY "Codice" CODCAUS @@ -204,7 +230,7 @@ END STRING F_DESCAUSCN 50 BEGIN - PROMPT 25 12 "" + PROMPT 25 13 "" USE LF_CAUSALI KEY 2 SELECT MOVIND="X" INPUT DESCR F_DESCAUSCN DISPLAY "Descrizione@50" DESCR @@ -218,12 +244,12 @@ END GROUPBOX DLG_NULL 78 5 BEGIN - PROMPT 1 14 "@bMovimenti NON IVA" + PROMPT 1 15 "@bMovimenti NON IVA" END STRING F_CODNUMNI 4 BEGIN - PROMPT 2 15 "Numerazione " + PROMPT 2 16 "Numerazione " FIELD CODNUMNI HELP "Codice numerazione" COPY USE F_CODNUMPR @@ -238,7 +264,7 @@ END STRING F_DESNUMNI 50 BEGIN - PROMPT 25 15 "" + PROMPT 25 16 "" HELP "Descrizione numerazione" COPY USE F_DESNUMPR INPUT S0 F_DESNUMNI @@ -248,7 +274,7 @@ END STRING F_TIPODOCNI 4 BEGIN - PROMPT 2 16 "Tipo documento " + PROMPT 2 17 "Tipo documento " FIELD TIPODOCNI HELP "Codice tipo documento" COPY USE F_TIPODOCPR @@ -262,7 +288,7 @@ END STRING F_DESTIPODOCNI 50 BEGIN - PROMPT 25 16 "" + PROMPT 25 17 "" HELP "Descrizione tipo documento" COPY USE F_DESTIPODOCPR INPUT S0 F_DESTIPODOCNI @@ -272,7 +298,7 @@ END STRING F_CODIVANI 4 BEGIN - PROMPT 2 17 "Codice IVA " + PROMPT 2 18 "Codice IVA " FIELD CODIVANI HELP "Codice IVA" USE %IVA @@ -287,7 +313,7 @@ END STRING F_DESIVANI 50 BEGIN - PROMPT 25 17 "" + PROMPT 25 18 "" HELP "Descrizione IVA" USE %IVA KEY 2 INPUT S0 F_DESIVANI diff --git a/ci/ci2400.cpp b/ci/ci2400.cpp index 51a6d6fd8..670abe4eb 100644 --- a/ci/ci2400.cpp +++ b/ci/ci2400.cpp @@ -717,10 +717,10 @@ void TConsuntivazione_msk::riempi_nuova_riga(int r) bool TConsuntivazione_msk::add_ril_to_doc(TRectype& rilore, TDocumento& doc, TLog_report& log) const { - const char tipo_roa = rilore.get_char(RILORE_TIPORA); + const char tipo_roa = rilore.get_char(RILORE_TIPORA); // 'R'isorsa o 'A'ttrezzatura const TString& codice_roa = rilore.get(RILORE_CODICE); const TRectype& roa = cache().get(tipo_roa == 'A' ? "ATR" : "RSS", codice_roa); - const TString80 codart = roa.get("S2"); + TString80 codart = roa.get("S2").left(20); codart.trim(); if (codart.blank()) { TString msg; msg << TR("Impossibile associare un articolo a ") << codice_roa; @@ -1206,7 +1206,7 @@ bool TConsuntivazione_msk::on_field_event(TOperable_field& o, TField_event e, lo break; case se_query_del: { - TSheet_field& sheet = sfield(F_SHEET); + TSheet_field& sheet = (TSheet_field&)o; TToken_string& row = sheet.row(jolly); const int posid = sheet.cid2index(S_ID); const long id = row.get_long(posid); @@ -1224,7 +1224,7 @@ bool TConsuntivazione_msk::on_field_event(TOperable_field& o, TField_event e, lo break; case se_enter: { - TSheet_field& sheet = sfield(F_SHEET); + TSheet_field& sheet = (TSheet_field&)o; TToken_string& row = sheet.row(jolly); const TDate d = row.get(0); if (d.ok()) @@ -1235,10 +1235,33 @@ bool TConsuntivazione_msk::on_field_event(TOperable_field& o, TField_event e, lo enable(DLG_SAVEREC, _sheet_dirty = true); if (_sheet_dirty) { - TSheet_field& sheet = sfield(F_SHEET); + TSheet_field& sheet = (TSheet_field&)o; const char stato = sheet.cell(jolly, S_STATO)[0]; if (stato > '1') _recontabilize = _sheet_dirty; + + TToken_string& row = sheet.row(jolly); + const char tipo = row.get_char(1); + const TString16 cod = row.get(2); + const TString4 ora = row.get(4); + if (tipo == 'A' && cod.full() && ora.full()) + { + const TRectype& atr = cache().get("ATR", cod); + TString4 orad = atr.get("S9"); + if (orad.full() && ora != orad) // Attrezzatura con ora normale + { + if (jolly == sheet.items()-1 || orad != sheet.row(jolly+1).get(4)) + { + const int nr = sheet.insert(jolly+1); + TToken_string& rowd = sheet.row(nr); + rowd = row; + rowd.add(orad, 4); + rowd.add(1, 5); + rowd.add(atr.get("R11"), 6); + sheet.force_update(nr); + } + } + } } break; case se_notify_add: