diff --git a/GMW/GMW.Publish.xml b/GMW/GMW.Publish.xml index b60489cb..933f67ac 100644 --- a/GMW/GMW.Publish.xml +++ b/GMW/GMW.Publish.xml @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/GMW/GMW.csproj b/GMW/GMW.csproj index ba72144a..4c79f506 100644 --- a/GMW/GMW.csproj +++ b/GMW/GMW.csproj @@ -161,6 +161,7 @@ + @@ -251,6 +252,13 @@ chLang.aspx + + consumoFusi.aspx + ASPXCodeBehind + + + consumoFusi.aspx + Default.aspx ASPXCodeBehind @@ -574,6 +582,13 @@ mod_confMag.ascx + + mod_consumoFusi.ascx + ASPXCodeBehind + + + mod_consumoFusi.ascx + mod_delibera.ascx ASPXCodeBehind @@ -1193,6 +1208,7 @@ + diff --git a/GMW/Web.TK_prod.config b/GMW/Web.TK_prod.config index ec675eaf..bdcec848 100644 --- a/GMW/Web.TK_prod.config +++ b/GMW/Web.TK_prod.config @@ -42,6 +42,7 @@ + diff --git a/GMW/Web.TK_test.config b/GMW/Web.TK_test.config index 3a8704f4..9e44166a 100644 --- a/GMW/Web.TK_test.config +++ b/GMW/Web.TK_test.config @@ -43,6 +43,7 @@ + diff --git a/GMW/Web.config b/GMW/Web.config index a1e6afcb..2014b484 100644 --- a/GMW/Web.config +++ b/GMW/Web.config @@ -61,7 +61,7 @@ - + diff --git a/GMW/WebUserControls/mod_consumoFusi.ascx b/GMW/WebUserControls/mod_consumoFusi.ascx new file mode 100644 index 00000000..09d53f7d --- /dev/null +++ b/GMW/WebUserControls/mod_consumoFusi.ascx @@ -0,0 +1,46 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_consumoFusi.ascx.cs" Inherits="GMW.WebUserControls.mod_consumoFusi" %> +<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> + +
+
+
+
+ +
+
+ +
+
+ +
+ +
+
+
+ +
+
+ +
+
+
+
+
+ +
+ + +
+
+
+ +
+   +
+ +
+
+
+
+
+
diff --git a/GMW/WebUserControls/mod_consumoFusi.ascx.cs b/GMW/WebUserControls/mod_consumoFusi.ascx.cs new file mode 100644 index 00000000..3e9359e2 --- /dev/null +++ b/GMW/WebUserControls/mod_consumoFusi.ascx.cs @@ -0,0 +1,308 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using SteamWare; +using GMW_data; + +namespace GMW.WebUserControls +{ + public partial class mod_consumoFusi : System.Web.UI.UserControl + { + /// + /// caricamento pagina + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!Page.IsPostBack) + { + calcolaPostazione(); + traduciObj(); + } + doChecks(); + lblGitterBoxAttivo.Text = ""; + if (currUdcFrom != "") + { + lblGitterBoxAttivo.Text += string.Format("UDC FROM: {0}", currUdcFrom); + } + if (lblGitterBoxAttivo.Text == "") + { + lblGitterBoxAttivo.Text = "..."; + } + } + /// + /// effettua controlli visibilità + /// + private void doChecks() + { + checkBarcode(); + checkConsuma(); + } + /// + /// sistemo labels oggetti + /// + private void traduciObj() + { + // labels + lblPostazione.Text = string.Format("{2}: {0} ({1})", postazione_name, postazione_IP, traduci("postazione")); + lblPrinter.Text = string.Format("{1}: {0}", postazione_printer, traduci("stampante")); + lblCurrentPage.Text = traduci(PagCorrente); + // buttons + btnConsuma.Text = traduci("btnConsumaUdcF10"); + } + /// + /// restituisce il nome della pagina corrente + /// + protected string PagCorrente + { + get + { + string answ = ""; + Uri MyUrl = Request.Url; + string delimStr = "/"; + char[] delimiter = delimStr.ToCharArray(); + string[] finalUrl = MyUrl.LocalPath.ToString().Split(delimiter); + int n = finalUrl.Length; + answ = finalUrl[n - 1].ToString(); + DataLayer_AnagGen.PermessiRow riga = (DataLayer_AnagGen.PermessiRow)user_std.UtSn.permessi.Select(string.Format("URL = '{0}'", answ))[0]; + answ = riga.NOME; + return answ; + } + } + /// + /// wrapper traduzione + /// + /// + /// + public string traduci(object lemma) + { + return user_std.UtSn.Traduci(lemma.ToString()); + } + /// + /// calcola postazione corrente (ip, name, printer) + /// + private void calcolaPostazione() + { + postazione_IP = Request.UserHostName; + postazione_name = dnsUtils.DetermineCompName(postazione_IP); + // cerco stampante x postazione + postazione_printer = "n.d."; + try + { + DS_Applicazione.ElencoPostazioniDataTable tabPost = DataProxy.obj.taElPost.getByCod(postazione_name); + if (tabPost.Rows.Count > 0) + { + postazione_printer = tabPost[0].stampante; + } + else + { + tabPost = DataProxy.obj.taElPost.getByCod("default"); + postazione_printer = tabPost[0].stampante; + } + } + catch + { } + } + /// + /// indica name della postazione corrente + /// + protected string postazione_name + { + get + { + return memLayer.ML.StringSessionObj("postazione_name"); + } + set + { + memLayer.ML.setSessionVal("postazione_name", value); + } + } + /// + /// indica ip della postazione corrente + /// + protected string postazione_IP + { + get + { + return memLayer.ML.StringSessionObj("postazione_IP"); + } + set + { + memLayer.ML.setSessionVal("postazione_IP", value); + } + } + /// + /// indica stampante associata alla postazione corrente + /// + protected string postazione_printer + { + get + { + return memLayer.ML.StringSessionObj("postazione_printer"); + } + set + { + memLayer.ML.setSessionVal("postazione_printer", value); + } + } + /// + /// indica UDC FROM (F10) selezionato + /// + protected string currUdcFrom + { + get + { + return memLayer.ML.StringSessionObj("currUdcFrom"); + } + set + { + memLayer.ML.setSessionVal("currUdcFrom", value, false); + } + } + /// + /// indica se i caratteri vadano forzati a maiuscoli + /// + public bool forceUppercase + { + get + { + return memLayer.ML.confReadBool("forceUppercase"); + } + } + /// + /// decodifica il tipo barcode acquisito + /// + public tipoCodiceBarcode tipoBCode + { + get + { + tipoCodiceBarcode answ = tipoCodiceBarcode.ND; + int trovati = 0; + // controllo non si tratti di un comando... + string preCmd = memLayer.ML.confReadString("prefComandi"); + if (barcodeIn.StartsWith(preCmd)) + { + answ = tipoCodiceBarcode.Comando; + } + // controllo se sia un particolare "P" + else if (barcodeIn.StartsWith("P")) + { + answ = tipoCodiceBarcode.Particolare; + } + else + { + try + { + // cerco tra gitterbox (UDC)... + trovati = MagClass.magazzino.taCartellini.getByUdc(barcodeIn).Rows.Count; + if (trovati > 0) + { + answ = tipoCodiceBarcode.UDC; + } + } + catch + { + } + } + return answ; + } + } + /// + /// valore barcode + /// + public string barcodeIn + { + get + { + return txtBarcode.Text.Trim(); + } + set + { + txtBarcode.Text = value; + } + } + /// + /// controlla se ci sia un barcode + /// + private void checkBarcode() + { + if (barcodeIn != "") + { + DS_Applicazione.ElencoCartelliniRow rigaCart; + string tipoImballo = ""; + lblMessaggi.Text = string.Format("Barcode digitato: {0}", barcodeIn); + switch (tipoBCode) + { + + case tipoCodiceBarcode.UDC: + // procedo solo se UDC esistente + if (MagClass.magazzino.checkUDC(barcodeIn)) + { + // cerco di recuperare riga UDC + try + { + rigaCart = DataProxy.obj.taCartellini.stp_getByUdc(barcodeIn)[0]; + tipoImballo = rigaCart.CodImballo; + } + catch + { } + // salvo UDC from + currUdcFrom = barcodeIn; + } + break; + default: + lblMessaggi.Text += " - codice non riconosciuto!"; + pnlAll.CssClass = "stileComandoND"; + break; + } + barcodeIn = ""; + } + else + { + lblMessaggi.Text = "...attesa barcode..."; + } + //grView.DataBind(); + txtBarcode.Focus(); + } + /// + /// controllo abilitazione consumo + /// + private void checkConsuma() + { + bool consumaOk = false; + if (currUdcFrom != "") + { + consumaOk = true; + } + btnConsuma.Enabled = consumaOk; + } + /// + /// genera i barcode di + /// - trattamenti + /// - nuovo x pezzi liquidi + /// e lancia la relativa stampa + /// + /// + /// + protected void btnConsuma_Click(object sender, EventArgs e) + { + if (currUdcFrom != "") + { + // controllo se UDC non sia già consumato... + if (MagClass.magazzino.udcMpIsConsumabile(currUdcFrom)) + { + // consumo UDC + MagClass.magazzino.scaricaUdcMpWip(currUdcFrom, Request.UserHostName); + } + // indico UDC consumato! + lblMessaggi.Text = string.Format("{0} {1}", traduci("effettuatoConsumoUDC"), currUdcFrom); + currUdcFrom = ""; + lblGitterBoxAttivo.Text = ""; + } + } + } +} \ No newline at end of file diff --git a/GMW/WebUserControls/mod_consumoFusi.ascx.designer.cs b/GMW/WebUserControls/mod_consumoFusi.ascx.designer.cs new file mode 100644 index 00000000..0251216f --- /dev/null +++ b/GMW/WebUserControls/mod_consumoFusi.ascx.designer.cs @@ -0,0 +1,123 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace GMW.WebUserControls { + + + public partial class mod_consumoFusi { + + /// + /// pnlAll control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel pnlAll; + + /// + /// lblPostazione control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblPostazione; + + /// + /// lblPrinter control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblPrinter; + + /// + /// lblCurrentPage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblCurrentPage; + + /// + /// hlMenu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HyperLink hlMenu; + + /// + /// lblGitterBoxAttivo control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblGitterBoxAttivo; + + /// + /// lblMessaggi control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblMessaggi; + + /// + /// lblBarcode control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblBarcode; + + /// + /// txtBarcode control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtBarcode; + + /// + /// aceParticolare control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::AjaxControlToolkit.AutoCompleteExtender aceParticolare; + + /// + /// lblConsuma control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblConsuma; + + /// + /// btnConsuma control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnConsuma; + } +} diff --git a/GMW/bin/GMW.dll b/GMW/bin/GMW.dll index b5ec53c6..6c655043 100644 Binary files a/GMW/bin/GMW.dll and b/GMW/bin/GMW.dll differ diff --git a/GMW/bin/GMW_data.dll b/GMW/bin/GMW_data.dll index b3c7a03d..7be4e34b 100644 Binary files a/GMW/bin/GMW_data.dll and b/GMW/bin/GMW_data.dll differ diff --git a/GMW/bin/SteamWare.dll b/GMW/bin/SteamWare.dll index 5995ad6e..47c6a697 100644 Binary files a/GMW/bin/SteamWare.dll and b/GMW/bin/SteamWare.dll differ diff --git a/GMW/consumoFusi.aspx b/GMW/consumoFusi.aspx new file mode 100644 index 00000000..27f5196c --- /dev/null +++ b/GMW/consumoFusi.aspx @@ -0,0 +1,5 @@ +<%@ Page Title="" Language="C#" MasterPageFile="~/WebMasterPages/AjaxSimpleFull.Master" AutoEventWireup="true" CodeBehind="consumoFusi.aspx.cs" Inherits="GMW.consumoFusi" %> +<%@ Register src="WebUserControls/mod_consumoFusi.ascx" tagname="mod_consumoFusi" tagprefix="uc1" %> + + + diff --git a/GMW/consumoFusi.aspx.cs b/GMW/consumoFusi.aspx.cs new file mode 100644 index 00000000..eb2ca005 --- /dev/null +++ b/GMW/consumoFusi.aspx.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace GMW +{ + public partial class consumoFusi : System.Web.UI.Page + { + protected void Page_Load(object sender, EventArgs e) + { + + } + } +} \ No newline at end of file diff --git a/GMW/consumoFusi.aspx.designer.cs b/GMW/consumoFusi.aspx.designer.cs new file mode 100644 index 00000000..a4e0d9e9 --- /dev/null +++ b/GMW/consumoFusi.aspx.designer.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace GMW { + + + public partial class consumoFusi { + + /// + /// mod_consumoFusi1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::GMW.WebUserControls.mod_consumoFusi mod_consumoFusi1; + } +} diff --git a/GMW_Term/bin/GMW_Term.dll b/GMW_Term/bin/GMW_Term.dll index 7de3ed62..f6b393b2 100644 Binary files a/GMW_Term/bin/GMW_Term.dll and b/GMW_Term/bin/GMW_Term.dll differ diff --git a/GMW_Term/bin/GMW_data.dll b/GMW_Term/bin/GMW_data.dll index 39d46062..09b226e1 100644 Binary files a/GMW_Term/bin/GMW_data.dll and b/GMW_Term/bin/GMW_data.dll differ diff --git a/GMW_Term/bin/SteamWare.dll b/GMW_Term/bin/SteamWare.dll index 5995ad6e..d1628b5e 100644 Binary files a/GMW_Term/bin/SteamWare.dll and b/GMW_Term/bin/SteamWare.dll differ diff --git a/GMW_data/GMW_data.csproj b/GMW_data/GMW_data.csproj index 42ddc127..9aeda80d 100644 --- a/GMW_data/GMW_data.csproj +++ b/GMW_data/GMW_data.csproj @@ -420,6 +420,8 @@
+ + diff --git a/GMW_data/MagClass.cs b/GMW_data/MagClass.cs index 6c331cbd..382fbfe8 100644 --- a/GMW_data/MagClass.cs +++ b/GMW_data/MagClass.cs @@ -509,16 +509,16 @@ namespace GMW_data /// Codice dello stampo /// codice dell'esponente dello stampo /// Codice figura - /// Data di rif per la dichiarazione - /// Turno di rif per la dichiarazione - /// codice dell'imballo (tipo cassone) - string LIBERO (non facciamo controlli in input) - /// codice dell'operatore /// codice dell'UDC parent (UDC della tara) /// peso in kg (0 se non noto) da associare all'UDC come tara del contenitore + /// codice dell'imballo (tipo cassone) - string LIBERO (non facciamo controlli in input) /// tipo di dichiarazione (vedere relativa anagrafica consentita, es U=uomo, M=macchina...) + /// codice dell'operatore /// numero pezzi associati all'UDC /// Peso totale rilevato /// Peso unitario rilevato + /// Data di rif per la dichiarazione + /// Turno di rif per la dichiarazione /// Codice dello stato del pezzo (da anagrafica: sabbiato, ...) /// Codice del magazzino in cui inserire l'UDC /// NOME della posizione default in cui creare UDC diff --git a/GMW_data/SqlScripts/V2.1/GMW_00516.sql b/GMW_data/SqlScripts/V2.1/GMW_00516.sql new file mode 100644 index 00000000..e0962847 --- /dev/null +++ b/GMW_data/SqlScripts/V2.1/GMW_00516.sql @@ -0,0 +1,578 @@ +set xact_abort on +go + +begin transaction +go + +INSERT INTO dbo.Permessi + VALUES ('POST_fusiCons', 'consumoFusi.aspx', 4, 5, 'ConsFusi', 'ConsFusiExpl') +go + +commit transaction +go + + +set xact_abort on +go + +begin transaction +go + +INSERT INTO dbo.Permessi2Funzione + VALUES ('POST_fusiCons', N'GMW_consFusi', 'S') +go + +commit transaction +go + + +set xact_abort on +go + +begin transaction +go + +UPDATE AnagPosizioni +set idxposizione=3 +WHERE IdxPosizione=7 +go + +commit transaction +go + +set xact_abort on +go + +begin transaction +go + +INSERT INTO dbo.TabTranPosizEventi + VALUES (N'UDC_CONS', 3, -3, 0, NULL, N'consumo fusi') +INSERT INTO dbo.TabTranPosizEventi + VALUES (N'UDC_FUSI', 0, 3, 49, N'Fusi', N'creazione UDC fusi (creare magazzino e blocco x fusi e sostituire 49)') +go + +commit transaction +go + +set xact_abort on +go + +begin transaction +go + +set ANSI_NULLS on +go + +/*************************************** +* STORED stp_UDC_insNewFull +* +* crea un nuovo record nella TabStatoOdpUdc FULL (con pesi, qta...) e restituisce il codice UDC appena creato +* +* Steamware, S.E.L. +* mod: 2010.04.28 +* +****************************************/ +alter PROCEDURE stp_UDC_insNewFull +( + @CodCS VARCHAR(2), + @Flusso VARCHAR(2), + @Anno VARCHAR(2), + @CodCliente VARCHAR(6), + @Particolare VARCHAR(15), + @CodImpianto AS VARCHAR(50), + @CodStampo VARCHAR(8), + @Esponente VARCHAR(6), + @Figura VARCHAR(4), + @DataFus DATETIME, + @TurnoFus INT, + @CodImballo VARCHAR(15), + @CodSoggetto VARCHAR(17), + @Tara FLOAT, + @IdxPosizione INT, + @CodTipoDichiaraz CHAR(1), + @CodEvento VARCHAR(10), + @Qta DECIMAL(10,2), + @PesoTot FLOAT, + @PesoCad FLOAT, + @CodStato VARCHAR(50), + @UDC_parent VARCHAR(50), + @DoDeleteUdcParent BIT, + @Note NVARCHAR(500) +) +AS + +-- DECLARE iniziali +DECLARE @UDC AS VARCHAR(50) +DECLARE @RagSociale AS VARCHAR(35) +DECLARE @DescParticolare AS VARCHAR(30) +DECLARE @DescImpianto AS VARCHAR(50) +DECLARE @DisegnoGrezzo AS VARCHAR(30) +DECLARE @NumCont AS INT +DECLARE @numFlu AS INT +DECLARE @numUdc AS INT +DECLARE @nextUdc AS INT +DECLARE @IdxCella AS INT + +SET @UDC_parent = UPPER(@UDC_parent) -- nel caso sia passato in minuscolo + +------------------------------------------------------------------------------------------------------ +-- Caricamento Dati da anagrafica +------------------------------------------------------------------------------------------------------ +-- cerco la ragione sociale... +SET @RagSociale = ISNULL( +( + SELECT RagSociale + FROM RilPro.AnagClienti + WHERE (CodCliente = @CodCliente) +) +, '') + +-- Cerco descrizione del particolare... +SET @DescParticolare = ISNULL( +( + SELECT DescParticolare + FROM RilPro.AnagParticolari + WHERE (Particolare = @Particolare) +) +, 'ND') + +-- se non lo trova provo anche nell'anagrafica leghe +IF(@DescParticolare = 'ND')-- OR (@DescParticolare is null) + BEGIN + SET @DescParticolare = ISNULL( + ( + SELECT DescLega + FROM RilPro.AnagLeghe + WHERE ('L'+CodLega = @Particolare) + ) + , '') + END +-- cerco codice disegno grezzo +SET @DisegnoGrezzo = ISNULL( +( + SELECT DisegnoGrezzo + FROM RilPro.AnagParticolari + WHERE (Particolare = @Particolare) +) +, '') + +-- cerco descrizione Impianto +SET @DescImpianto = ISNULL( +( + SELECT DescImpianto + FROM AnagImpianti + WHERE (CodImpianto = @CodImpianto) +) +, '') + + +-- Calcolo contatore intero successivo x il contenitore... +SET @NumCont = ( + SELECT ISNULL(MAX(NumCont), 0) + 1 AS NumCont + FROM ElencoCartellini + WHERE (Particolare = @Particolare) + AND (DataFus = @DataFus) + AND (TurnoFus = @TurnoFus) + AND (CodImpianto = @CodImpianto) + AND (CodStampo = @CodStampo) + AND (Figura = @Figura) +) + + +------------------------------------------------------------------------------------------------------ + +------------------------------------------------------------------------------------------------------ +-- Flusso +------------------------------------------------------------------------------------------------------ +-- controllo se esiste il flusso (bilancia)... +SET @numFlu = ( + SELECT count(*) + FROM AnagBilance + WHERE CodBilancia = @Flusso +) +-- ...sennò lo creo... +IF(@numFlu = 0) + BEGIN + -- se c'è inserisco in tab + INSERT INTO AnagBilance(CodBilancia, DescrImpianto, CodCS) + VALUES (@Flusso, @Flusso, @CodCS) + END +------------------------------------------------------------------------------------------------------ + + +------------------------------------------------------------------------------------------------------ +-- UDC +------------------------------------------------------------------------------------------------------ +-- controllo se ci sia già un UDC per company / flusso anno +BEGIN TRAN + -- cerco nella tab contatori se esiste contatore x il flusso + -- controllo se record c'è... + IF EXISTS( SELECT TOP 1 Flusso FROM ContatoriUdc + WHERE CodCS = @CodCS + AND Flusso = @Flusso + AND Anno = @Anno ) + BEGIN + -- se c'è incremento di 1 in tab + UPDATE ContatoriUdc + SET LastIdx = LastIdx + 1 + WHERE CodCS = @CodCS + AND Flusso = @Flusso + AND Anno = @Anno + END + ELSE + BEGIN + -- lo creo! + INSERT INTO ContatoriUdc(CodCS, Flusso, Anno, LastIdx) + VALUES (@CodCS, @Flusso, @Anno, 1) + END + -- aggiorno numero UDC + SET @numUdc = ( + SELECT LastIdx + FROM ContatoriUdc + WHERE CodCS = @CodCS + AND Flusso = @Flusso + AND Anno = @Anno + ) +COMMIT TRAN +------------------------------------------------------------------------------------------------------ + +------------------------------------------------------------------------------------------------------ +-- Ciclo principale x inserimento nuovo record +------------------------------------------------------------------------------------------------------ +BEGIN TRAN + -- ottengo il nuovo codice UDC completo + SET @UDC = dbo.componiUdc(@CodCS, @Flusso, @Anno, @numUdc) + + -- inserisco un nuovo record + INSERT INTO ElencoCartellini(UDC, CodCS, CodCliente, RagSociale, Particolare, DescParticolare, DisegnoGrezzo, Esponente, CodImpianto, DescImpianto, CodStampo, Figura, DataFus, TurnoFus, CodImballo, CodSoggetto, NumCont, Tara, Qta, CodStato, IdxPosizione, PesoTot, PesoCad, CreateDate, ModDate, Note, CodEvento) + VALUES (@UDC, @CodCS, @CodCliente, @RagSociale, @Particolare, @DescParticolare, @DisegnoGrezzo, @Esponente, @CodImpianto, @DescImpianto, @CodStampo, @Figura, @DataFus, @TurnoFus, @CodImballo, @CodSoggetto, @NumCont, @Tara, @Qta, @CodStato, @IdxPosizione, @PesoTot, @PesoCad, GETDATE(), GETDATE(), @Note, @CodEvento) + + -- inserisco relazione parent-child tra UDC vecchio (tara) e nuovo (pesa) SSE UDC_Parent valido + IF((NOT @UDC_parent IS NULL) AND (NOT @UDC_parent = '')) + BEGIN + INSERT INTO RelazUDC(UDC_parent, UDC_child) + VALUES (@UDC_parent, @UDC) + END +COMMIT TRAN + +------------------------------------------------------------------------------------------------------ + +------------------------------------------------------------------------------------------------------ +-- Ciclo secondario x eventuale cancellazione UDC tara parent e inserimento in posizione +------------------------------------------------------------------------------------------------------ + -- se richiesto elimino l'UDC parent (tara) + IF(@DoDeleteUdcParent = 1) + BEGIN + DELETE FROM ElencoCartellini WHERE UDC = @UDC_parent + END + + -- cerco in TabTranPosizEventi record x calcolare cella + DECLARE @IdxBloccoTo INT + SET @IdxBloccoTo = 0 + + /* da testare... + SET @IdxBloccoTo = ( + SELECT ISNULL( + ( + SELECT IdxBloccoTo + FROM TabTranPosizEventi + WHERE CodEvento = @CodEvento + AND IdxPosizione = 0 + AND IdxPosizioneTo = @IdxPosizione + AND CodStatoTo = @CodStato + ), 0) + ) + -- se non lo trovo cerco con CodStatoTo null... + IF(@IdxBloccoTo = 0) + BEGIN + SET @IdxBloccoTo = ( + SELECT ISNULL( + ( + SELECT IdxBloccoTo + FROM TabTranPosizEventi + WHERE CodEvento = @CodEvento + AND IdxPosizione = 0 + AND IdxPosizioneTo = @IdxPosizione + ), 0) + ) + END + */ + + -- se NON HO trovato una conf x @IdxBloccoTo utilizzo questo valore utilizzo modalità "vecchia" + IF(@IdxBloccoTo = 0) + BEGIN + -- calcolo la prima cella della posizione indicata.. + SET @IdxCella = ( + SELECT TOP 1 c.IdxCella + FROM Celle c INNER JOIN Blocchi b ON c.IdxBlocco=b.IdxBlocco + WHERE b.CodMag = CAST(@IdxPosizione AS NVARCHAR(50)) + ) + END + ELSE + BEGIN + -- calcolo la prima cella della posizione indicata.. + SET @IdxCella = ( + SELECT TOP 1 c.IdxCella + FROM Celle c + WHERE c.IdxBlocco = @IdxBloccoTo + ) + END + + + -- inserisco il cartellino nella prima cella della posizione indicata... + INSERT INTO PosizioneUdcCorrente(UDC, IdxCella, CodCS, DataRif, CodSoggetto) + VALUES(@Udc, @IdxCella, @CodCs, GETDATE(), @CodSoggetto) +------------------------------------------------------------------------------------------------------ + + +------------------------------------------------------------------------------------------------------ +-- restituisco la tab dati con l'udc appena inserito +------------------------------------------------------------------------------------------------------ +SELECT * +FROM ElencoCartellini +WHERE UDC = @UDC +------------------------------------------------------------------------------------------------------ + +RETURN +go + +/*************************************** +* STORED stp_UDC_insNewFull_fixUDC +* +* crea un nuovo record nella TabStatoOdpUdc FULL (con pesi, qta...) avendo in entrata il codice UDC da + +utilizzare +* +* Steamware, S.E.L. +* mod: 2011.12.07 +* +****************************************/ +alter PROCEDURE stp_UDC_insNewFull_fixUDC +( + @UDC AS NVARCHAR(50), + @CodCS VARCHAR(2), + @Flusso VARCHAR(2), + @Anno VARCHAR(2), + @CodCliente VARCHAR(6), + @Particolare VARCHAR(15), + @CodImpianto AS VARCHAR(50), + @CodStampo VARCHAR(8), + @Esponente VARCHAR(6), + @Figura VARCHAR(4), + @DataFus DATETIME, + @TurnoFus INT, + @CodImballo VARCHAR(15), + @CodSoggetto VARCHAR(17), + @Tara FLOAT, + @IdxPosizione INT, + @CodTipoDichiaraz CHAR(1), + @CodEvento VARCHAR(10), + @Qta DECIMAL(10,2), + @PesoTot FLOAT, + @PesoCad FLOAT, + @CodStato VARCHAR(50), + @UDC_parent VARCHAR(50), + @DoDeleteUdcParent BIT, + @Note NVARCHAR(500) +) +AS + +-- DECLARE iniziali +DECLARE @RagSociale AS VARCHAR(35) +DECLARE @DescParticolare AS VARCHAR(30) +DECLARE @DescImpianto AS VARCHAR(50) +DECLARE @DisegnoGrezzo AS VARCHAR(30) +DECLARE @NumCont AS INT +DECLARE @numFlu AS INT +DECLARE @numUdc AS INT +DECLARE @nextUdc AS INT +DECLARE @IdxCella AS INT + +------------------------------------------------------------------------------------------------------ +-- Caricamento Dati da anagrafica +------------------------------------------------------------------------------------------------------ +-- cerco la ragione sociale... +SET @RagSociale = ISNULL( +( + SELECT RagSociale + FROM RilPro.AnagClienti + WHERE (CodCliente = @CodCliente) +) +, '') + +-- Cerco descrizione del particolare... +SET @DescParticolare = ISNULL( +( + SELECT DescParticolare + FROM RilPro.AnagParticolari + WHERE (Particolare = @Particolare) +) +, 'ND') + +-- se non lo trova provo anche nell'anagrafica leghe +IF(@DescParticolare = 'ND')-- OR (@DescParticolare is null) + BEGIN + SET @DescParticolare = ISNULL( + ( + SELECT DescLega + FROM RilPro.AnagLeghe + WHERE ('L'+CodLega = @Particolare) + ) + , '') + END +-- cerco codice disegno grezzo +SET @DisegnoGrezzo = ISNULL( +( + SELECT DisegnoGrezzo + FROM RilPro.AnagParticolari + WHERE (Particolare = @Particolare) +) +, '') + +-- cerco descrizione Impianto +SET @DescImpianto = ISNULL( +( + SELECT DescImpianto + FROM AnagImpianti + WHERE (CodImpianto = @CodImpianto) +) +, '') + + + +-- Calcolo contatore intero successivo x il contenitore... +SET @NumCont = ( + SELECT ISNULL(MAX(NumCont), 0) + 1 AS NumCont + FROM ElencoCartellini + WHERE (Particolare = @Particolare) + AND (DataFus = @DataFus) + AND (TurnoFus = @TurnoFus) + AND (CodImpianto = @CodImpianto) + AND (CodStampo = @CodStampo) + AND (Figura = @Figura) +) + + +------------------------------------------------------------------------------------------------------ + + +------------------------------------------------------------------------------------------------------ +-- Ciclo principale x inserimento nuovo record +------------------------------------------------------------------------------------------------------ +BEGIN TRAN + + -- inserisco un nuovo record + INSERT INTO ElencoCartellini(UDC, CodCS, CodCliente, RagSociale, Particolare, DescParticolare, + +DisegnoGrezzo, Esponente, CodImpianto, DescImpianto, CodStampo, Figura, DataFus, TurnoFus, CodImballo, + +CodSoggetto, NumCont, Tara, Qta, CodStato, IdxPosizione, PesoTot, PesoCad, CreateDate, ModDate, Note, CodEvento) + VALUES (@UDC, @CodCS, @CodCliente, @RagSociale, @Particolare, @DescParticolare, @DisegnoGrezzo, + +@Esponente, @CodImpianto, @DescImpianto, @CodStampo, @Figura, @DataFus, @TurnoFus, @CodImballo, + +@CodSoggetto, @NumCont, @Tara, @Qta, @CodStato, @IdxPosizione, @PesoTot, @PesoCad, GETDATE(), GETDATE(), + +@Note, @CodEvento) + + -- inserisco relazione parent-child tra UDC vecchio (tara) e nuovo (pesa) SSE UDC_Parent valido + IF((NOT @UDC_parent IS NULL) AND (NOT @UDC_parent = '')) + BEGIN + INSERT INTO RelazUDC(UDC_parent, UDC_child) + VALUES (@UDC_parent, @UDC) + END +COMMIT TRAN + +------------------------------------------------------------------------------------------------------ + +------------------------------------------------------------------------------------------------------ +-- Ciclo secondario x eventuale cancellazione UDC tara parent e inserimento in posizione +------------------------------------------------------------------------------------------------------ + -- se richiesto elimino l'UDC parent (tara) + IF(@DoDeleteUdcParent = 1) + BEGIN + DELETE FROM ElencoCartellini WHERE UDC = @UDC_parent + END + + -- cerco in TabTranPosizEventi record x calcolare cella + DECLARE @IdxBloccoTo INT + SET @IdxBloccoTo = 0 + + /* da testare... + SET @IdxBloccoTo = ( + SELECT ISNULL( + ( + SELECT IdxBloccoTo + FROM TabTranPosizEventi + WHERE CodEvento = @CodEvento + AND IdxPosizione = 0 + AND IdxPosizioneTo = @IdxPosizione + AND CodStatoTo = @CodStato + ), 0) + ) + -- se non lo trovo cerco con CodStatoTo null... + IF(@IdxBloccoTo = 0) + BEGIN + SET @IdxBloccoTo = ( + SELECT ISNULL( + ( + SELECT IdxBloccoTo + FROM TabTranPosizEventi + WHERE CodEvento = @CodEvento + AND IdxPosizione = 0 + AND IdxPosizioneTo = @IdxPosizione + ), 0) + ) + END + */ + + -- se NON HO trovato una conf x @IdxBloccoTo utilizzo questo valore utilizzo modalità "vecchia" + IF(@IdxBloccoTo = 0) + BEGIN + -- calcolo la prima cella della posizione indicata.. + SET @IdxCella = ( + SELECT TOP 1 c.IdxCella + FROM Celle c INNER JOIN Blocchi b ON c.IdxBlocco=b.IdxBlocco + WHERE b.CodMag = CAST(@IdxPosizione AS NVARCHAR(50)) + ) + END + ELSE + BEGIN + -- calcolo la prima cella della posizione indicata.. + SET @IdxCella = ( + SELECT TOP 1 c.IdxCella + FROM Celle c + WHERE c.IdxBlocco = @IdxBloccoTo + ) + END + + -- inserisco il cartellino nella prima cella della posizione indicata.. + INSERT INTO PosizioneUdcCorrente(UDC, IdxCella, CodCS, DataRif, CodSoggetto) + VALUES(@Udc, @IdxCella, @CodCs, GETDATE(), @CodSoggetto) +------------------------------------------------------------------------------------------------------ + +------------------------------------------------------------------------------------------------------ +-- restituisco la tab dati con l'udc appena inserito +------------------------------------------------------------------------------------------------------ +SELECT * +FROM ElencoCartellini +WHERE UDC = @UDC +------------------------------------------------------------------------------------------------------ + +RETURN +go + +commit +go + + + + + + + +INSERT INTO [dbo].[LogUpdateDb] ([Versione],[Data]) VALUES(516, GETDATE()) +GO + +SELECT TOP 10 * FROM LogUpdateDb ORDER BY Versione DESC diff --git a/GMW_data/SqlScripts/Vocabolario/vocab_516.sql b/GMW_data/SqlScripts/Vocabolario/vocab_516.sql new file mode 100644 index 00000000..64f40653 --- /dev/null +++ b/GMW_data/SqlScripts/Vocabolario/vocab_516.sql @@ -0,0 +1,10 @@ +exec stp_insNewLemma 'ConsFusi', 'Consumo Fusi' +exec stp_insNewLemma 'ConsFusiExpl', 'Gestione Consumo Fusi' + + + + +INSERT INTO [dbo].[LogUpdateDb] ([Versione],[Data]) VALUES(516, GETDATE()) +GO + +SELECT TOP 10 * FROM LogUpdateDb ORDER BY Versione DESC diff --git a/GMW_data/bin/SP_prod/GMW_data.dll b/GMW_data/bin/SP_prod/GMW_data.dll index f0e9f01c..9d0f54e0 100644 Binary files a/GMW_data/bin/SP_prod/GMW_data.dll and b/GMW_data/bin/SP_prod/GMW_data.dll differ diff --git a/GMW_data/bin/SP_prod/SteamWare.dll b/GMW_data/bin/SP_prod/SteamWare.dll index 79288680..5efa2cdf 100644 Binary files a/GMW_data/bin/SP_prod/SteamWare.dll and b/GMW_data/bin/SP_prod/SteamWare.dll differ diff --git a/GMW_data/bin/TK_prod/GMW_data.dll b/GMW_data/bin/TK_prod/GMW_data.dll index 25d07fbd..09b226e1 100644 Binary files a/GMW_data/bin/TK_prod/GMW_data.dll and b/GMW_data/bin/TK_prod/GMW_data.dll differ