From aae6187f954d92ca3e35839c5403edcecbbfdd72 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Thu, 11 Jun 2020 12:43:03 -0700 Subject: [PATCH 1/3] =?UTF-8?q?correcci=C3=B3n=20de=20una=20palabra?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Inventarios/EntregaAlmacen.aspx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Inventarios/EntregaAlmacen.aspx b/Inventarios/EntregaAlmacen.aspx index f4078c025..e52c5de61 100644 --- a/Inventarios/EntregaAlmacen.aspx +++ b/Inventarios/EntregaAlmacen.aspx @@ -244,7 +244,7 @@ - + From cd24b5128ae898a5235e8d31137854b4ed391a5b Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Sun, 14 Jun 2020 17:48:44 -0700 Subject: [PATCH 2/3] CARGA DE TRABAJO 1 Y 2 --- App_Code/ClsGenerales.vb | 6 +- App_Code/ClsVentas.vb | 3 +- General/PopUpPaqueteriasGuias.aspx.cs | 29 ++- General/RepPaqueteriasGuias.aspx | 14 +- General/RepPaqueteriasGuias.aspx.cs | 25 ++- Inventarios/EntregaAlmacen.aspx | 1 + Inventarios/EntregaAlmacen.aspx.vb | 51 ++++- Inventarios/EntregasPorRealizar.aspx | 2 +- Inventarios/EntregasPorRealizar.aspx.cs | 17 +- Ventas/Ventas.aspx | 238 +++++++++++++----------- Ventas/Ventas.aspx.vb | 43 ++++- 11 files changed, 291 insertions(+), 138 deletions(-) diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb index 2db192a9c..3b77ade94 100644 --- a/App_Code/ClsGenerales.vb +++ b/App_Code/ClsGenerales.vb @@ -2724,7 +2724,8 @@ Public Class ClsGenerales Public Function GetPaqueteriasGuias(CvePaqueteriaGuia As Integer, CvePaqueteriaGuiaTipo As Integer, CvePaqueteria As Integer, CveEstatus As Integer, CveSubProyecto As Integer, CveEmpresa As Integer, Guia As String, FechaInicio As String, FechaFin As String, Optional FechaIngInicio As String = "-1", - Optional FechaIngFin As String = "-1", Optional Filtro As Integer = -1, Optional CveUsuarioEntrega As Integer = -1) As Boolean + Optional FechaIngFin As String = "-1", Optional Filtro As Integer = -1, Optional CveUsuarioEntrega As Integer = -1, + Optional EsEntregaInterna As Boolean = False) As Boolean Dim Retorno As Boolean = False @@ -2744,6 +2745,7 @@ Public Class ClsGenerales .Add("@FechaIngFin", SqlDbType.VarChar).Value = FechaIngFin .Add("@Filtro", SqlDbType.Int).Value = Filtro .Add("@CveUsuarioEntrega", SqlDbType.Int).Value = CveUsuarioEntrega + .Add("@EsEntregaInterna", SqlDbType.Bit).Value = EsEntregaInterna End With Try SqlAdapter.Fill(Data) @@ -2833,7 +2835,7 @@ Public Class ClsGenerales DataAdapter("PA_Gral_AsignarEntregasPorRealizar") With SqlAdapter.SelectCommand.Parameters .Add("@CvePaqueteriaGuia", SqlDbType.Int).Value = CvePaqueteriaGuia - .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal + .Add("@CveUsuarioAsignado", SqlDbType.Int).Value = CvePersonal End With Try SqlAdapter.Fill(Data) diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index f78d1e3bf..e9f7496a6 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -341,7 +341,7 @@ Public Class ClsVentas Optional CveFormaPago33 As Integer = -1, Optional CveMetodoPago33 As Integer = -1, Optional CveUsoCFDI As Integer = -1, Optional OrdenCompra As String = "-1", Optional CveCuentaTerminal As Integer = -1, Optional CveTipoRelacion As Integer = -1, Optional ImpuestoLocal As Double = 0, Optional CveTipoAmortizacionAnticipo As Integer = -1, Optional CveVentaRelacion As Integer = -1, Optional ImporteRelacion As Decimal = -1, Optional CveEmpresaCRM As Integer = -1, Optional EsInterno As Integer = -1, Optional CveAcercamientoCRM As Integer = -1, Optional DiasCredito As Integer = 0, Optional EsDiasCreditoFijo As Boolean = False, Optional AnticipoEspecial As Boolean = False, Optional Kilometraje As Double = 0, Optional EsAmortizacion As Boolean = False, Optional CveTipoRetencion As Integer = 0, - Optional CorreoNotificacion As String = "") As Boolean + Optional CorreoNotificacion As String = "", Optional FormaPaqueteria As Integer = 1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_VentasAdd") @@ -431,6 +431,7 @@ Public Class ClsVentas .Add("@EsAmortizacion", SqlDbType.Bit).Value = EsAmortizacion .Add("@CveTipoRetencion", SqlDbType.TinyInt).Value = CveTipoRetencion .Add("@CorreoNotificacion", SqlDbType.VarChar).Value = CorreoNotificacion + .Add("@FormaPaqueteria", SqlDbType.Int).Value = FormaPaqueteria .Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue End With diff --git a/General/PopUpPaqueteriasGuias.aspx.cs b/General/PopUpPaqueteriasGuias.aspx.cs index 91306f8d4..0ecbbe8ee 100644 --- a/General/PopUpPaqueteriasGuias.aspx.cs +++ b/General/PopUpPaqueteriasGuias.aspx.cs @@ -400,6 +400,8 @@ public partial class General_PopUpPaqueteriasGuias : ClsPaginas else { ObjGeneral.Commit(); + string notificacionCorreos = getCorreoString(); + MandaCorreoNotificacionGuia(notificacionCorreos); if (Guia == "-1") { if (CveVenta > 0 || CveOC > 0 || CveMovimiento > 0 || CveCompra > 0) @@ -718,7 +720,6 @@ public partial class General_PopUpPaqueteriasGuias : ClsPaginas } Destinatario = $"{DbRowVenta["Mail"].ToString()};{DbRowVenta["CorreoVendedorVenta"].ToString()}{CorreoAsistente}"; - if (ObjVentas.GetVentaDetalle(CveVenta)) { DTMovimientos = ObjVentas.DtResultados; @@ -727,6 +728,32 @@ public partial class General_PopUpPaqueteriasGuias : ClsPaginas } } } + + private string getCorreoString() + { + ClsVentas ObjVentas = new ClsVentas(); + if (ObjVentas.GetVenta(CveVenta,UsuarioActual.CveEmpresa)) + { + int CveVendedor = ObjVentas.DtResultados.Rows[0]["CveVendedor"].ToEntero(); + int CveCliente = ObjVentas.DtResultados.Rows[0]["CveCliente"].ToEntero(); + DataRow Vendedor = get_GlobalDTVendedores(UsuarioActual.CveEmpresa).FiltroPrimero(string.Format("CveVendedor = {0}",CveVendedor)); + DataRow Cliente = get_GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimero(string.Format("CveCliente = {0}",CveCliente)); + + string CorreosConcat = "{0};{1};{2};{3};{4}"; + return CorreosConcat; + } + ObjVentas.Dispose(); + return ""; + } + + private void MandaCorreoNotificacionGuia(string Correos) + { + Correos.GuardaLog(); + + ClsSisMail MailCls = new ClsSisMail(); + MailCls.SendMail(ClsPaginas.EmpresaNotificaciones, Correos, "Se enviara la compra a su dirección", "Pendiente", Correos); + MailCls = null; + } #endregion } \ No newline at end of file diff --git a/General/RepPaqueteriasGuias.aspx b/General/RepPaqueteriasGuias.aspx index b13c27470..637293558 100644 --- a/General/RepPaqueteriasGuias.aspx +++ b/General/RepPaqueteriasGuias.aspx @@ -170,7 +170,12 @@
- + +
+
+
+     +
@@ -185,13 +190,13 @@ " style="display: inline-block; margin-right: -20px; width: 150px;" /> " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> - - + @@ -207,11 +212,12 @@ - + + diff --git a/General/RepPaqueteriasGuias.aspx.cs b/General/RepPaqueteriasGuias.aspx.cs index 75a951155..7793d8e44 100644 --- a/General/RepPaqueteriasGuias.aspx.cs +++ b/General/RepPaqueteriasGuias.aspx.cs @@ -229,6 +229,11 @@ public partial class General_RepPaqueteriasGuias : ClsPaginas DdlEstatusEditar.Items.Insert(3, new ListItem("Entregado ", "3")); DdlEstatusEditar.Items.Insert(4, new ListItem("Confirmado por Cliente", "4")); DdlEstatusEditar.SelectedValue = "-1"; + + if(UsuarioActual.Empresa.Funcionalidad(280) == "1"){ + DivEstatusEntrega.Visible = true; + } + } private void CargaUsuarios() @@ -270,7 +275,8 @@ public partial class General_RepPaqueteriasGuias : ClsPaginas String FechaIngInicio = TxtFechaInicialIngreso.Text == "" ? "-1" : TxtFechaInicialIngreso.Text; String FechaIngFin = TxtFechaFinalIngreso.Text == "" ? "-1" : TxtFechaFinalIngreso.Text; - if (ObjGeneral.GetPaqueteriasGuias(CvePaqueteriaGuia, CvePaqueteriaGuiaTipo, CvePaqueteria, CveEstatus, CveSubProyecto, CveEmpresa, Guia, FechaInicio, FechaFin, FechaIngInicio, FechaIngFin, Filtro: Filtro, CveUsuarioEntrega: CveUsuarioEntrega)) + if (ObjGeneral.GetPaqueteriasGuias(CvePaqueteriaGuia, CvePaqueteriaGuiaTipo, CvePaqueteria, CveEstatus, CveSubProyecto, CveEmpresa, Guia, FechaInicio, FechaFin, + FechaIngInicio, FechaIngFin, Filtro: Filtro, CveUsuarioEntrega: CveUsuarioEntrega, EsEntregaInterna: ChkLote.Checked)) { DTDatos = ObjGeneral.DtResultados; GVDatos.DataSource = DTDatos; @@ -532,7 +538,7 @@ public partial class General_RepPaqueteriasGuias : ClsPaginas { e.Row.FCLinkButton("SubirArchivo").Visible = false; } - + e.Row.FCLinkButton("LnkReasignar").Visible = e.Row.DataKey("EsEntregaInterna").ToString() == "True"; } } @@ -953,6 +959,19 @@ public partial class General_RepPaqueteriasGuias : ClsPaginas } #endregion + protected void Reasignar_Click(object sender, EventArgs e) + { + GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); + int CvePaqueteriaGuia = GvRow.DataKey("CvePaqueteriaGuia").ToEntero(); + + ClsGenerales ObjGeneral = new ClsGenerales(); + if (ObjGeneral.AsignarEntregasPorRealizar(CvePaqueteriaGuia, -1)) + { + Alert("La guía está lista para volver a ser asignada, disponible en el reporte Entregas Por Realizar"); + } + ObjGeneral.Dispose(); + CargaDatos(); + UPDatos.Update(); + } - } \ No newline at end of file diff --git a/Inventarios/EntregaAlmacen.aspx b/Inventarios/EntregaAlmacen.aspx index e52c5de61..f175f0d5d 100644 --- a/Inventarios/EntregaAlmacen.aspx +++ b/Inventarios/EntregaAlmacen.aspx @@ -248,6 +248,7 @@ + ver detalle de entrega diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb index d02cb3b2b..a55be2639 100644 --- a/Inventarios/EntregaAlmacen.aspx.vb +++ b/Inventarios/EntregaAlmacen.aspx.vb @@ -245,6 +245,15 @@ Partial Class Inventarios_EntregaAlmacen End Set End Property + Private Property FormaPaqueteria As Integer + Get + Return CType(ViewState("FormaPaqueteria"), Integer) + End Get + Set(value As Integer) + ViewState("FormaPaqueteria") = value + End Set + End Property + #End Region Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load @@ -322,7 +331,6 @@ Partial Class Inventarios_EntregaAlmacen CreaDtDetalleLote() CargaPendientes() - LimpiaCampos() End Sub @@ -614,6 +622,21 @@ Partial Class Inventarios_EntregaAlmacen DtDatos.Columns.Add("CantidadSeleccionada", GetType(Double)) End If + If UsuarioActual.Empresa.Funcionalidad(280) = "1" Then + FormaPaqueteria = DtDatos.Rows(0)("FormaPaqueteria").ToString.ToEntero + Dim FormaPaq As Integer = FormaPaqueteria + Select Case FormaPaq + Case 1 + RbSinEntrega.Checked = True + Case 2 + RbEntregaInterna.Checked = True + LnkPaqueteriaDetalle.Visible = True + DdlEstatus.SelectedValue = "5" + Case 3 + RbEntregaExterna.Checked = True + LnkPaqueteriaDetalle.Visible = True + End Select + End If 'TxtFecha.Text = If(EsDevolucionVenta = 1, Now.ToShortDateString, DtDatos.Rows(0)("Fecha").ToString) End If @@ -2143,8 +2166,8 @@ Partial Class Inventarios_EntregaAlmacen ValorMultiplicador = -1 ElseIf TipoMovimiento = 2 AndAlso TipoDocto.Contiene({"Dev"}) And (EsDevolucionVenta = 1) Then ValorMultiplicador = 1 - End If - + End If + Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inventario/RecepcionEntrega", 4, TotalCosto, TotalCosto, 1, Fecha, ClienteNombre, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) 'Se agrega movimiento separado por la cuenta de ventas (ER) @@ -3288,12 +3311,13 @@ Partial Class Inventarios_EntregaAlmacen Protected Sub EntregaRadioGroup_Click(sender As Object, e As EventArgs) If RbEntregaExterna.Checked Then RegistraScript("AbrirVentana('/General/PopUpPaqueteriasGuias.aspx',800,547,'N')") + LnkPaqueteriaDetalle.Visible = False ElseIf RbEntregaInterna.Checked Then - RegistraScript("$('#ModalPaqueteriaInterna').modal('show')") - 'RegistraScript($"AbrirVentana('/General/PopUpPaqueteriasGuiasInternas.aspx?CveVenta={CveVentaSurtir}&CveSubProyecto={CveSubProyecto}',800,547,'N')") - 'CveVentaSurtir + LnkPaqueteriaDetalle.Visible = True + 'RegistraScript("$('#ModalPaqueteriaInterna').modal('show')") ElseIf RbSinEntrega.Checked Then LimpiaCampos() + LnkPaqueteriaDetalle.Visible = False End If End Sub @@ -3304,8 +3328,17 @@ Partial Class Inventarios_EntregaAlmacen TxtNoCajas.Text = "" TxtObservacionesPaqInterna.Text = "" UpPaqInterna.Update() - End Sub + End Sub + + Protected Sub PaqueteriaDetalle_Click(sender As Object, e As EventArgs) + If RbEntregaExterna.Checked Then + RegistraScript("AbrirVentana('/General/PopUpPaqueteriasGuias.aspx',800,547,'N')") + ElseIf RbEntregaInterna.Checked Then + RegistraScript("$('#ModalPaqueteriaInterna').modal('show')") + End If + End Sub + #End Region - - + + End Class diff --git a/Inventarios/EntregasPorRealizar.aspx b/Inventarios/EntregasPorRealizar.aspx index 7dbb9bc60..7c71eac19 100644 --- a/Inventarios/EntregasPorRealizar.aspx +++ b/Inventarios/EntregasPorRealizar.aspx @@ -70,7 +70,7 @@
- + +
@@ -3259,7 +3259,7 @@ - + Orden de Compra:   @@ -3294,6 +3294,18 @@ + + Tipo de Entrega:  + + + + + + + + + +
@@ -3371,7 +3383,7 @@ - + @@ -3574,7 +3586,7 @@   - + Moneda Venta @@ -4141,8 +4153,8 @@
@@ -7071,9 +7083,9 @@ $get(Row).style.backgroundColor = "#82b6db"; $get(Obj).focus(); var total = parseFloat($('#<%= HplSaldoAuxiliar.ClientID%>').text().replace(',', '')); - $get(Obj).value = 0; - var suma = 0; - $('#<%= GVAnticipos.ClientID%> input[type="text"]').each(function (index) { + $get(Obj).value = 0; + var suma = 0; + $('#<%= GVAnticipos.ClientID%> input[type="text"]').each(function (index) { var currentsaldo = parseFloat($(this).val()) if (isNaN(currentsaldo)) { currentsaldo = 0 } suma = currentsaldo + suma; @@ -7089,7 +7101,7 @@ $get(Obj).value = ""; $get(Row).style.backgroundColor = "#ffffff"; } - //if ($("input:checkbox:not(:checked)")) + //if ($("input:checkbox:not(:checked)")) SetText2($get("LblTotalAnticipos"), formato_numero($get("HdnAnticipos").value, 2, '.', ',')); } function imprimircotizacion() { @@ -7103,121 +7115,121 @@ var ValorTxt = Obj.value; var suma = 0; var total = parseFloat($('#<%= HplSaldoAuxiliar.ClientID%>').text().replace(',', '')); - $('#<%= GVAnticipos.ClientID%> input[type="text"]').each(function (index) { - var currentsaldo = parseFloat($(this).val()) - if (isNaN(currentsaldo)) { currentsaldo = 0 } - suma = currentsaldo + suma; - }); - var txtvalue = (total - suma) + parseFloat(ValorTxt); - if (txtvalue < 0) { txtvalue = 0; } - if (txtvalue < Monto) { Monto = txtvalue.toFixed(2); } + $('#<%= GVAnticipos.ClientID%> input[type="text"]').each(function (index) { + var currentsaldo = parseFloat($(this).val()) + if (isNaN(currentsaldo)) { currentsaldo = 0 } + suma = currentsaldo + suma; + }); + var txtvalue = (total - suma) + parseFloat(ValorTxt); + if (txtvalue < 0) { txtvalue = 0; } + if (txtvalue < Monto) { Monto = txtvalue.toFixed(2); } - if (isNaN(ValorTxt)) - ValorTxt = 0; - if (isNaN(Monto)) - Monto = 0; - if (parseFloat(ValorTxt) < 0) { - ValorTxt = 0; - Obj.value = 0; - } + if (isNaN(ValorTxt)) + ValorTxt = 0; + if (isNaN(Monto)) + Monto = 0; + if (parseFloat(ValorTxt) < 0) { + ValorTxt = 0; + Obj.value = 0; + } - if (parseFloat(ValorTxt) > parseFloat(Monto)) { - alert("El monto de ''Anticipo a Amortizar'' no puede ser mayor al monto del ''Anticipo''"); - Obj.value = Monto; - } - } - function ImprimirCotizacion() { - __doPostBack('ctl00$HB$LNKImprimirCotizacion', ''); - } - function SetText2(ObjTo, Value) { - ObjTo.innerText = Value; - } + if (parseFloat(ValorTxt) > parseFloat(Monto)) { + alert("El monto de ''Anticipo a Amortizar'' no puede ser mayor al monto del ''Anticipo''"); + Obj.value = Monto; + } + } + function ImprimirCotizacion() { + __doPostBack('ctl00$HB$LNKImprimirCotizacion', ''); + } + function SetText2(ObjTo, Value) { + ObjTo.innerText = Value; + } - //VALIDA QUE LA CANTIDAD DE T (TXT) NO SEA MAYOR A C - function ValidarCantidad(t, c) { - t.value = (t.value > c ? c : t.value) - } + //VALIDA QUE LA CANTIDAD DE T (TXT) NO SEA MAYOR A C + function ValidarCantidad(t, c) { + t.value = (t.value > c ? c : t.value) + } - //VALIDA QUE LA CANTIDAD DE T (TXT) NO SEA MENOR A C - function ValidarCantidadMenor(t, c) { - t.value = (t.value > c ? t.value : c) - } + //VALIDA QUE LA CANTIDAD DE T (TXT) NO SEA MENOR A C + function ValidarCantidadMenor(t, c) { + t.value = (t.value > c ? t.value : c) + } - function Comma(Num) { //function to add commas to textboxes - Num += ''; - Num = Num.replace(',', ''); Num = Num.replace(',', ''); Num = Num.replace(',', ''); - Num = Num.replace(',', ''); Num = Num.replace(',', ''); Num = Num.replace(',', ''); - x = Num.split('.'); - x1 = x[0]; - x2 = x.length > 1 ? '.' + x[1] : ''; - var rgx = /(\d+)(\d{3})/; - while (rgx.test(x1)) - x1 = x1.replace(rgx, '$1' + ',' + '$2'); - return x1 + x2; - } + function Comma(Num) { //function to add commas to textboxes + Num += ''; + Num = Num.replace(',', ''); Num = Num.replace(',', ''); Num = Num.replace(',', ''); + Num = Num.replace(',', ''); Num = Num.replace(',', ''); Num = Num.replace(',', ''); + x = Num.split('.'); + x1 = x[0]; + x2 = x.length > 1 ? '.' + x[1] : ''; + var rgx = /(\d+)(\d{3})/; + while (rgx.test(x1)) + x1 = x1.replace(rgx, '$1' + ',' + '$2'); + return x1 + x2; + } - function AddCodigoBarrasSerie(e) { - if (e.keyCode == 13 || e.which == 13) { - $('#BtnCodigoBarrasSerie').click(); - } - } + function AddCodigoBarrasSerie(e) { + if (e.keyCode == 13 || e.which == 13) { + $('#BtnCodigoBarrasSerie').click(); + } + } - //SERIE PS - function SeriePS(e, b, txt, hdn) { - ; - if (e.keyCode == 13 || e.which == 13) { - if (txt.value != "" && txt.value != hdn.value) { - $(b).click(); - } - } - } + //SERIE PS + function SeriePS(e, b, txt, hdn) { + ; + if (e.keyCode == 13 || e.which == 13) { + if (txt.value != "" && txt.value != hdn.value) { + $(b).click(); + } + } + } - function SeriePSBlur(b, txt, hdn) { - ; - if (txt.value != "" && txt.value != hdn.value) { - $(b).click(); - } - } + function SeriePSBlur(b, txt, hdn) { + ; + if (txt.value != "" && txt.value != hdn.value) { + $(b).click(); + } + } - //SERIE-LOTE INV - var H1 = ""; - var H2 = ""; - var T = ""; + //SERIE-LOTE INV + var H1 = ""; + var H2 = ""; + var T = ""; - function EnterAFEdit(event, Txt, Hdn1, Hdn2) { - if (event.which == 13 || event.keyCode == 13) { - H1 = Hdn1; - H2 = Hdn2; - T = Txt; - $get("HdnCodAFEdit").value = Txt.value; + function EnterAFEdit(event, Txt, Hdn1, Hdn2) { + if (event.which == 13 || event.keyCode == 13) { + H1 = Hdn1; + H2 = Hdn2; + T = Txt; + $get("HdnCodAFEdit").value = Txt.value; - $('#BtnVinculaAFEdit').click(); - } - } + $('#BtnVinculaAFEdit').click(); + } + } - function AFBlurEdit(Txt, Hdn1, Hdn2) { - if (Txt.value.length > 0 && Txt.value != Hdn2.value) { - H1 = Hdn1; - H2 = Hdn2; - T = Txt; - $get("HdnCodAFEdit").value = Txt.value; - $('#BtnVinculaAFEdit').click(); - } - } + function AFBlurEdit(Txt, Hdn1, Hdn2) { + if (Txt.value.length > 0 && Txt.value != Hdn2.value) { + H1 = Hdn1; + H2 = Hdn2; + T = Txt; + $get("HdnCodAFEdit").value = Txt.value; + $('#BtnVinculaAFEdit').click(); + } + } - function EnterAFEditOK(Cve, Codigo) { - $get(H1.id).value = Cve; - $get(H2.id).value = Codigo; - $get(T.id).value = (Codigo == -1) ? "" : Codigo; + function EnterAFEditOK(Cve, Codigo) { + $get(H1.id).value = Cve; + $get(H2.id).value = Codigo; + $get(T.id).value = (Codigo == -1) ? "" : Codigo; - } + } - //Suma Totales - function FnSuma() { - $get('TxtSubTotal2').value = FormatoNumero(ToDouble($get('TxtSubTotal').value) - ToDouble($get('LblDescuentos').innerHTML) - ToDouble($get('LblAmortizacion').innerHTML), 2); - var totalVenta = ToDouble($get('TxtSubTotal2').value) + ToDouble($get('TxtIVA').value) + ToDouble($get('TxtIEPS') ? ToDouble($get('TxtIEPS').value) : 0) - ToDouble($get('TxtRetIVA').value) - ToDouble($get('TxtRetISR').value); - debugger; - $("#<%=GvImpuestosLocales2.ClientID%> input[type='text']").each(function () { + //Suma Totales + function FnSuma() { + $get('TxtSubTotal2').value = FormatoNumero(ToDouble($get('TxtSubTotal').value) - ToDouble($get('LblDescuentos').innerHTML) - ToDouble($get('LblAmortizacion').innerHTML), 2); + var totalVenta = ToDouble($get('TxtSubTotal2').value) + ToDouble($get('TxtIVA').value) + ToDouble($get('TxtIEPS') ? ToDouble($get('TxtIEPS').value) : 0) - ToDouble($get('TxtRetIVA').value) - ToDouble($get('TxtRetISR').value); + debugger; + $("#<%=GvImpuestosLocales2.ClientID%> input[type='text']").each(function () { if ($(this).attr("class") == '5') // cuando es traslado de impuesto local, se suma totalVenta += ToDouble($(this).val().toString()); @@ -7239,7 +7251,7 @@ $get("HdnTipoDescuento").value = "3"; //si es con.nc,es.el.total - var Total = ToDouble($get(TipoAnticipo == 2? 'TxtTotal':'TxtSubTotal').value); + var Total = ToDouble($get(TipoAnticipo == 2 ? 'TxtTotal' : 'TxtSubTotal').value); var SaldoCompra = parseFloat(parseFloat($get('HdnVentaSaldo').value).toFixed(2)); if (ToDouble($get('HdnCveVenta').value) == 0) SaldoCompra = Total; diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index a95238a33..31e2c7cab 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -1206,6 +1206,15 @@ Partial Class Ventas ViewState("SaldoAnticipo") = value End Set End Property + Private Property CorreoEntregaAlmacen As String + Get + Return If(IsNothing(ViewState("CorreoEntregaAlmacen")), "", ViewState("CorreoEntregaAlmacen").ToString()) + End Get + + Set(value As String) + ViewState("CorreoEntregaAlmacen") = value + End Set + End Property #End Region @@ -2634,6 +2643,7 @@ Partial Class Ventas If UsuarioActual.CveEmpresa = 141 Then BtnModalAddPS.Enabled = False End If + MostrarOpcioensPaqueteria() End Sub Private Sub BloqueaClasificaciones() If UsuarioActual.CveEmpresa = 141 AndAlso DdlTipoComprobante.SelectedValue = "Cot" Then @@ -4847,6 +4857,7 @@ Partial Class Ventas ViewState("Mail") = If(DdlTipoComprobante.SelectedValue = "Cot", ObjCliente.MailCotizacion, ObjCliente.Mail) ViewState("MailCC") = ObjCliente.NotificarA + CorreoEntregaAlmacen = ObjCliente.DtResultados(0)("CorreoEntregaAlmacen").ToString LblDireccion.Text = ObjCliente.Direccion LblColonia.Text = ObjCliente.Colonia LblCiudad.Text = ObjCliente.Ciudad @@ -5157,8 +5168,8 @@ Partial Class Ventas CargarAlmacenes() If UsuarioActual.Empresa.FacturaProduccion Then - CargaDocumentacionCliente() End If + CargaDocumentacionCliente() If UsuarioActual.CveEmpresa.Contiene(72, 80, 1, 119) Then BtnEmitirImprimir.OnClientClick = $"ValidaGuardar({ If(ImprimeNombreSucursal = True, 1, 0)});" @@ -9502,7 +9513,7 @@ Partial Class Ventas CveVentaRelacion:=(If(factura.CveVentaRelacion.ToEntero() > 0, factura.CveVentaRelacion, -1)), ImporteRelacion:=(If(factura.ImporteRelacion <> Nothing, factura.ImporteRelacion, -1)), CveTipoAmortizacionAnticipo:=factura.CveTipoAmortizacionAnticipo, CveEmpresaCRM:=CveEmpresaCRM, EsInterno:=EsInterno, CveAcercamientoCRM:=CveAcercamientoCRM, DiasCredito:=factura.DiasCredito, EsDiasCreditoFijo:=factura.EsDiasCreditoFijo, AnticipoEspecial:=If(TrAntEspecial.Visible, ChkAntEspecial.Checked, False), - Kilometraje:=TxtKilometraje.Text.ToDouble, EsAmortizacion:=EsNCAmortizacion, CveTipoRetencion:=CveTipoRetencion, CorreoNotificacion:=TxtCorreoNotificaciones.Text) Then + Kilometraje:=TxtKilometraje.Text.ToDouble, EsAmortizacion:=EsNCAmortizacion, CveTipoRetencion:=CveTipoRetencion, CorreoNotificacion:=TxtCorreoNotificaciones.Text, FormaPaqueteria:=RblPaqueteria.SelectedValue.ToEntero) Then ErrorList.Add("Ocurrió un error al Generar la Venta.
Revise su factura y cualquier detalle comuníquese a Soporte Técnico") Else If factura.TipoDocto.Contiene("Dev", "Egs") Or DtVentasNC IsNot Nothing Or CveEstatusRefacturacion = 1 Then @@ -9523,6 +9534,10 @@ Partial Class Ventas End If End If + + If UsuarioActual.Empresa.Funcionalidad(280) = "1" And RblPaqueteria.SelectedValue = "1" Then + NotificarPaqueteria() + End If End If If Not GuardarUsados(ObjVentas.IniciaTransacSQL, ObjVentas.CveVenta) Then @@ -14056,7 +14071,7 @@ Partial Class Ventas TrVistaPrevia.Visible = EstatusCliente End If - + MostrarOpcioensPaqueteria() TrAtencionA.Visible = True tdVigencia.Visible = DdlTipoComprobante.SelectedValue.Contiene("Cot") @@ -14067,6 +14082,7 @@ Partial Class Ventas UPCondicionesPago.Update() UpCliente.Update() UpPS.Update() + UPObservaciones.Update() End Sub Protected Sub DdlSucursalCliente_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlSucursalCliente.SelectedIndexChanged CargaClienteSucursal(DdlSucursalCliente.SelectedValue.ToEntero()) @@ -25648,6 +25664,27 @@ Partial Class Ventas CargaEventoBitacora() End Sub + Private Sub MostrarOpcioensPaqueteria() + Dim mostrarOpcionesPaq As Boolean = DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ped") + trPaqueteriaOpciones.Visible = mostrarOpcionesPaq + trPaqueteriOpcionesLabel.Visible = mostrarOpcionesPaq + End Sub + Private Sub NotificarPaqueteria() + Dim DtVendedores As DataTable = GlobalDTVendedores(UsuarioActual.CveEmpresa) + Dim CorreoVendedor As String = DtVendedores.FiltroPrimeroValor("Correo", String.Format("CveVendedor = {0}", DdlVendedor.SelectedValue)) + Dim CorreoVendedorAdicional As String = DtVendedores.FiltroPrimeroValor("CorreoAdicionalNotificaciones", String.Format("CveVendedor = {0}", DdlVendedor.SelectedValue)) + Dim CorreoCliente As String = Mail + Dim CorreoClienteAlmacen As String = CorreoEntregaAlmacen + Dim CorreoNotificacionCliente As String = MailCC + + Dim CorreosCC As String = String.Format("{0};{1};{2};{3}", CorreoVendedor, CorreoVendedorAdicional, CorreoCliente, CorreoNotificacionCliente) + Dim LogCorreo As String = String.Format("{0} -- {1} --- {2}", "Tipo de entrega", CorreoClienteAlmacen, CorreosCC) + LogCorreo.GuardaLog + + Dim MailCls As New ClsSisMail + MailCls.SendMail(ClsPaginas.EmpresaNotificaciones, CorreoVendedor, "Entrega en mostrador", "Pendiente", CorreosCC) + MailCls = Nothing + End Sub End Class \ No newline at end of file From c6853ed0e1f5ecfcf7d7a974120d2d7efcc74665 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Sun, 14 Jun 2020 18:06:05 -0700 Subject: [PATCH 3/3] - --- Ventas/Ventas.aspx.vb | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 31e2c7cab..ae5e7372b 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -4819,7 +4819,7 @@ Partial Class Ventas End Sub Private Sub CargaCliente(CveCliente As Integer, Optional Estatus As Integer = -1) - + If CveCliente <= 0 Then Exit Sub RBLPago.Items(0).Enabled = True @@ -7481,7 +7481,7 @@ Partial Class Ventas ObjContr.Dispose() ObjDocCliente.Dispose() 'ObjFolios.Dispose() - ErrorList.Clear + ErrorList.Clear() ErrorList = Nothing MensajeAlert = Nothing If ObjContPaq IsNot Nothing Then ObjContPaq.Dispose() @@ -9021,7 +9021,7 @@ Partial Class Ventas i += 1 Next - Dim AplicaComercioExteriorSubProyecto As Boolean = If(GlobalDTSubProyectos(-1, Obj.CveSubProyecto)(0)("AplicaComercioExterior").ToString() = "True", True, False) + Dim AplicaComercioExteriorSubProyecto As Boolean = If(GlobalDTSubProyectos(-1, Obj.CveSubProyecto, CveEmpresa:=UsuarioActual.CveEmpresa)(0)("AplicaComercioExterior").ToString() = "True", True, False) Timbre.Complementos.ComercioExterior11.AplicaComercioExteriorSubProyecto = AplicaComercioExteriorSubProyecto If Obj.Cliente.AplicaComercioExterior And AplicaComercioExteriorSubProyecto Then 'DATOS GENERALES @@ -9037,8 +9037,8 @@ Partial Class Ventas 'EMISOR Dim Dr As DataRow Dr = Nothing - If GlobalDTSubProyectos(-1, DdlSubProyectoDatos.SelectedValue.ToEntero()).Rows.Count > 0 Then - Dr = GlobalDTSubProyectos(-1, DdlSubProyectoDatos.SelectedValue.ToEntero())(0) + If GlobalDTSubProyectos(-1, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa).Rows.Count > 0 Then + Dr = GlobalDTSubProyectos(-1, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa)(0) End If Timbre.Complementos.ComercioExterior11.Emisor.CURP = UsuarioActual.Empresa.CURP Timbre.Complementos.ComercioExterior11.Emisor.Calle = Dr("Calle").ToString() @@ -13818,7 +13818,6 @@ Partial Class Ventas ObjPS.Dispose() End If - If PrecioSugerido = 0 Then Dim ObjInventarios As New ClsInventarios Dim CostoPS = ObjInventarios.GetCostoPS(CvePSParametro, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveTipoAlmacen:=1) @@ -13829,7 +13828,7 @@ Partial Class Ventas PrecioSugerido = ((PorcentajePrecio / 100) + 1) * CostoPS End If End If - + CvePrecioLista = CvePrecioListaPS End If @@ -16103,6 +16102,8 @@ Partial Class Ventas Dim DtMovimientosDetalles As DataTable DtRemConceptosSurtidos = Nothing + Dim TieneMovimientosSinCosto As Boolean = False + 'Obtenemos los movimientos detalle If ObjInventario.GetInv_Mov(CveRemision, UsuarioActual.CveEmpresa) Then @@ -16133,6 +16134,9 @@ Partial Class Ventas 'VALIDAR SI TIENE PRODUCTOS POR TRASPASAR If DtMovimientos.Rows.Count > 0 Then Dim GeneroMovimientoAlmacen As Boolean = False + + TieneMovimientosSinCosto = DtMovimientosDetalles.COUNT("CveTipoAlmacen", "CveTipoAlmacen=26") > 0 + For Each dr As DataRow In DtMovimientos.Rows 'Obtenemos los Movimientos de salida If ObjInventario.GetMovimientos(dr("CveMovimiento").ToString().ToEntero(), ConceptoMovimiento, -1, UsuarioActual.CveEmpresa) Then @@ -16149,9 +16153,14 @@ Partial Class Ventas Dim MovDetalle As New DataTable Dim AplicaMovimientoDetalleEntrada As Boolean = False + If RemisionesLista.Count > 0 Then AplicaMovimientoDetalleEntrada = True - MovDetalle = CuadrarFacturaMovimientos(DtMovimientosDetalles.FiltraParametros($"CveMovimiento = {dr("CveMovimiento")} AND (TieneSalidaxFactura IS NULL OR SaldoAlmacen > 0)")) + If TieneMovimientosSinCosto Then + MovDetalle = DtMovimientosDetalles.FiltraParametros($"CveMovimiento = {dr("CveMovimiento")}") + Else + MovDetalle = CuadrarFacturaMovimientos(DtMovimientosDetalles.FiltraParametros($"CveMovimiento = {dr("CveMovimiento")} AND (TieneSalidaxFactura IS NULL OR SaldoAlmacen > 0)")) + End If Else MovDetalle = DtMovimientosDetalles.FiltraParametros($"CveMovimiento = {dr("CveMovimiento")}") End If @@ -16226,7 +16235,10 @@ Partial Class Ventas MovDetalle.Dispose() - OcurrioError = Not GeneroMovimientoAlmacen + 'VERIFICA QUE SE HAYA GENERADO MOVIMIENTO DE ALMACEN + If Not OcurrioError Then + OcurrioError = Not GeneroMovimientoAlmacen + End If End If End If