From a7bd0a379898f38143fea170218822c27d1e52f7 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Tue, 25 Aug 2020 15:18:05 -0700 Subject: [PATCH 1/3] - --- OC/RepOC.aspx.vb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OC/RepOC.aspx.vb b/OC/RepOC.aspx.vb index 8c4c615cc..a3596393d 100644 --- a/OC/RepOC.aspx.vb +++ b/OC/RepOC.aspx.vb @@ -86,6 +86,7 @@ Partial Class RepOC 'DdlProyectos.Items.Insert(0, New ListItem("Todos", "-1")) CargarCentrosDeCosto(DdlProyectos, DdlSubProyectos, LblProyecto, LblSubProyecto) GvPorAtender.Columns(5).HeaderText = LblSubProyecto.Text + GvPendientes.Columns(5).HeaderText = LblSubProyecto.Text DivProyectos.Visible = DdlProyectos.Visible End Sub @@ -457,6 +458,7 @@ Partial Class RepOC params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) params.Add(New ReportParameter("AgrupadoPor", $"{Folio}{Tipo}{Proyecto}{SubProyecto}{Estatus}{AF}{Usuario}{FI}{FF}{Clasificacion}{Producto}{Completa}{Proveedor}{Cliente}")) + params.Add(New ReportParameter("SubProyectoHeader", LblSubProyecto.Text)) If Imagen.Exists Then params.Add(New ReportParameter("LogoPath", logouri)) @@ -488,6 +490,7 @@ Partial Class RepOC params.Add(New ReportParameter("FechaFin", If(txtFechaF.Text = "", "-1", txtFechaF.Text))) params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) params.Add(New ReportParameter("FechaImpresion", Now.ToShortDateString)) + params.Add(New ReportParameter("SubProyecto", LblSubProyecto.Text)) ImprimirPDF(String.Format(UsuarioActual.Empresa.Ruta & "/Formatos/RepRequisicionesOC.rdlc", UsuarioActual.Empresa.Ruta), DtOC, params, Formato:="EXCEL") Else From 28ee7f871e4a1087757a2aaaeab0efeed20c6c3d Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Tue, 25 Aug 2020 18:54:03 -0700 Subject: [PATCH 2/3] =?UTF-8?q?PA=20para=20editar=20la=20observaci=C3=B3n?= =?UTF-8?q?=20de=20una=20venta=20agregado?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/ClsVentas.vb | 33 +++++++++++++++++++++++++++------ Ventas/Ventas.aspx.vb | 6 ++---- 2 files changed, 29 insertions(+), 10 deletions(-) diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index e3592c397..3e1fabf64 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -460,8 +460,7 @@ Public Class ClsVentas Optional TipoDocto As String = "Cot", Optional Vigencia As Date = MinFecha, Optional CondicionesPago As Integer = -1, Optional AtencionA As String = "-1", Optional PedidoContrato As String = "-1", Optional CveFormaPago33 As Integer = -1, Optional CveMetodoPago33 As Integer = -1, Optional CveCliente As Integer = -1, Optional CveClienteSucursal As Integer = -1, Optional OrdenCompra As String = "-1", Optional RetIVA As Double = -1, - Optional RetISR As Double = -1, Optional Kilometraje As Double = 0, Optional CveVendedor As Integer = -1, Optional ObsAlm As String = "", Optional FormaPaqueteria As Integer = -1, - Optional CorreoNot As String = "-1") As Boolean + Optional RetISR As Double = -1, Optional Kilometraje As Double = 0) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_VentasUpdate") @@ -492,10 +491,6 @@ Public Class ClsVentas .Add("@CveClienteSucursal", SqlDbType.Int).Value = CveClienteSucursal .Add("@OrdenCompra", SqlDbType.VarChar).Value = OrdenCompra .Add("@Kilometraje", SqlDbType.Float).Value = Kilometraje - .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor - .Add("@ObservacionesAlm", SqlDbType.NVarChar).Value = ObsAlm - .Add("@FormaPaqueteria", SqlDbType.Int).Value = FormaPaqueteria - .Add("@CorreoNotificacion", SqlDbType.NVarChar).Value = CorreoNot End With Try @@ -507,6 +502,32 @@ Public Class ClsVentas Return Retorno End Function + + Public Function UpdateObservacionesVenta(CveVenta As Integer, CveEmpresa As Integer, CveVendedor As Integer, Observaciones As String, FormaPaqueteria As Integer, CorreoNotificaciones As String, ObservacionesAlm As String, + Pedido As String, OrdenCompra As String, FechaPago As String) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_VentasObservacionesUpdate") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveVenta", SqlDbType.Int).Value = CveVenta + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor + .Add("@Observaciones", SqlDbType.NVarChar).Value = Observaciones + .Add("@FormaPaqueteria", SqlDbType.Int).Value = FormaPaqueteria + .Add("@CorreoNotificaciones", SqlDbType.NVarChar).Value = CorreoNotificaciones + .Add("@ObservacionesAlm", SqlDbType.NVarChar).Value = ObservacionesAlm + .Add("@Pedido", SqlDbType.NVarChar).Value = Pedido + .Add("@OrdenCompra", SqlDbType.NVarChar).Value = OrdenCompra + .Add("@FechaPago", SqlDbType.Date).Value = FechaPago + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar las observaciones de la venta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function + Public Function UpdateFechaVencimientoVenta(CveVenta As Integer, FechaVencimiento As Date) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_VentasFechaVencimientoUpdate") diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index ade3b1824..9843d7605 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -26143,10 +26143,8 @@ Partial Class Ventas Private Sub GuardarValoresEditados() Dim ObjVentas As New ClsVentas() - If ObjVentas.UpdateVentas(TxtSubTotal.Text.ToDecimal, LblDescuentos.Text.ToDecimal, TxtIVA.Text.ToDecimal, TxtIEPS.Text.ToDecimal, TxtTotal.Text.ToDecimal, DdlMoneda.SelectedValue.ToEntero(), - TipoCambio, TxtFecha.Text.Trim.ToDate, TxtObsFact.Text.Trim, UsuarioActual.CveEmpresa, CveVenta, DdlMetodoPago33.SelectedValue.ToEntero, DdlFormaPago33.SelectedValue.ToEntero, - TipoDocto:=DdlTipoComprobante.SelectedValue, OrdenCompra:=TxtOrdenCompra.Text, PedidoContrato:=TxtPedidoContrato.Text, ObsAlm:=TxtObsAlmacen.Text, FormaPaqueteria:=RblPaqueteria.SelectedValue.ToEntero, - CorreoNot:=TxtCorreoNotificaciones.Text, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, Kilometraje:=TxtKilometraje.Text.ToDouble) Then + If ObjVentas.UpdateObservacionesVenta(CveVenta, UsuarioActual.CveEmpresa, DdlVendedor.SelectedValue.ToEntero(), TxtObsFact.Text, RblPaqueteria.SelectedValue.ToEntero(), TxtCorreoNotificaciones.Text, + TxtObsAlmacen.Text, TxtPedidoContrato.Text, TxtOrdenCompra.Text, TxtFechaPago.Text) Then CargaVenta() BtnEditar.Text = "Editar" Alert("Actualizado correctamente") From 5f7862bebc5b115e4b8b283ab37ca8644118674b Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 26 Aug 2020 08:44:15 -0700 Subject: [PATCH 3/3] Correcion de almacenes administrativos --- Compras/Compras.aspx.vb | 101 ++++++++++++++++++++++++++-------------- 1 file changed, 67 insertions(+), 34 deletions(-) diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index a28d0e56b..fb5b5faab 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -6347,7 +6347,6 @@ Partial Class Compras_Compras Dim RegistraConcepto225 As Boolean = UsuarioActual.Empresa.UsaInventarios AndAlso DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") AndAlso Not UsuarioActual.Empresa.Funcionalidad(126) = "1" - Dim Insertado205 As Boolean = False If RBLPago.SelectedValue.ToEntero = 4 Then @@ -6392,15 +6391,42 @@ Partial Class Compras_Compras If UsuarioActual.Empresa.UsaInventarios AndAlso Not UsuarioActual.Empresa.Funcionalidad(126) = "1" Then DT = TmpDT.FiltraParametros("ISNULL(TipoAF,0) <> 2 And ISNULL(CveAlmacen,0) > 0", "", {"CveAlmacen"}) 'RECORREMOS PARA DETECTAR LA MODALIDAD DEL ALMACEN, EN CASO DE SER SOLO EXISTENCIA LIMPIAMOS CVEALMACEN - For Each Dr As DataRow In DT.Rows - If DtAlmacenes.FiltroPrimeroValor("Modalidad", $"CveAlmacen = {Dr("CveAlmacen").ToString.ToEntero}").ToString = "Solo Existencia" Then - Dr("CveAlmacen") = 0 - End If - Dr.AcceptChanges() - Next + 'SI LA COMPRA ES DE TIPO GASTO CON ALMACEN DEBE REGISTRAR MOVIMIENTO + If DdlTipoCompra.SelectedValue <> "10" Then + For Each Dr As DataRow In DT.Rows + If DtAlmacenes.FiltroPrimeroValor("Modalidad", $"CveAlmacen = {Dr("CveAlmacen").ToString.ToEntero}").ToString = "Solo Existencia" Then + Dr("CveAlmacen") = 0 + End If + Dr.AcceptChanges() + Next + End If DT.AcceptChanges() DT = DT.FiltraParametros("ISNULL(CveAlmacen,0) > 0") If DT.Rows.Count > 0 AndAlso Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") Then + + 'SI ES GASTO CON ALMACEN + If DdlTipoCompra.SelectedValue = "10" Then + For Each RowDetalle As DataRow In TmpDT.FiltraParametros("ISNULL(TipoAF,0) <> 2 And ISNULL(CveAlmacen,0) > 0", "", {"CveAlmacen", "CveClasificacion", "CveSubProyecto"}).Rows + + importeMovimiento = TmpDT.SUM(If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, "ImporteSinImpuestos", "Total"), $"CveAlmacen = {RowDetalle("CveAlmacen")}").ToString.ToDecimal + TmpDT.SUM("CostoIndirectoAlmacen", $"CveAlmacen = {RowDetalle("CveAlmacen")}").ToString.ToDecimal 'Row2("Total").ToString.ToDecimal + Row2("CostoIndirectoAlmacen").ToString.ToDecimal + importeMN = importeMovimiento * tipoCambioActual * Multiplicador + + If ObjConta.GetRetCuenta(6, RowDetalle("CveClasificacion").ToString().ToEntero()) Then + If ObjConta.DtResultados.Rows.Count > 0 Then + IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaGasto").ToString.ToEntero + CveCuenta = ObjConta.DtResultados.Rows(0)("IdCuentaGastoSIG").ToString.ToEntero + End If + End If + + If importeMN <> 0 Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMN, Referencia, 6, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CvePersonal:=CvePersonal, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, + CveClasificacion:=RowDetalle("CveClasificacion").ToString().ToEntero(), CveSubProyecto:=RowDetalle("CveSubProyecto").ToString().ToEntero(), Contabilizable:=SeContabiliza) Then + ErrorPrepoliza = True + End If + End If + Next + End If + For Each Row2 As DataRow In DT.Rows importeMovimiento = TmpDT.SUM(If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, "ImporteSinImpuestos", "Total"), $"CveAlmacen = {Row2("CveAlmacen")}").ToString.ToDecimal + TmpDT.SUM("CostoIndirectoAlmacen", $"CveAlmacen = {Row2("CveAlmacen")}").ToString.ToDecimal 'Row2("Total").ToString.ToDecimal + Row2("CostoIndirectoAlmacen").ToString.ToDecimal @@ -6418,15 +6444,16 @@ Partial Class Compras_Compras idCuentaContabilizacion = 0 End If - 'SI ES GASTO DE ALMACEN NO DEBE CONTABILIZAR CONCEPTO 68 - If DdlTipoCompra.SelectedValue = "10" Then - SeContabiliza = False - IdCtaContable = 0 - CveCuenta = 0 + 'SI ES GASTO CON ALMACEN NO DEBE CONTABILIZAR CONCEPTO 68 + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMN, Referencia, 68, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CvePersonal:=CvePersonal, CveMovimientoAlmacen:=CveMovimientoInventario, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=If(DdlTipoCompra.SelectedValue = "10", False, SeContabiliza)) Then + ErrorPrepoliza = True End If - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMN, Referencia, 68, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CvePersonal:=CvePersonal, CveMovimientoAlmacen:=CveMovimientoInventario, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza) Then - ErrorPrepoliza = True + 'SI ES GASTO CON ALMACEN REGISTRA EL CONCEPTO 95 + If DdlTipoCompra.SelectedValue = "10" Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, importeMN, Referencia, 95, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CvePersonal:=CvePersonal, CveMovimientoAlmacen:=CveMovimientoInventario, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=False) Then + ErrorPrepoliza = True + End If End If ' si agrego en almacen, ya no se ocupa algun concepto puente AgregaMercanciaInventario = False @@ -6595,8 +6622,6 @@ Partial Class Compras_Compras If RegistraConcepto225 Then - - importeMovimiento = TmpDT.SUM(If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, "ImporteSinImpuestos", "Total"), $"ISNULL(TipoAF,0) <> 2 And ISNULL(CveAlmacen,0) = 0 And ISNULL(AplicaCostoIndirecto,0) <> 1 And ISNULL(CveTipoPS,0) = 2").ToString.ToDecimal importeMN = importeMovimiento * tipoCambioActual * Multiplicador @@ -6682,12 +6707,15 @@ Partial Class Compras_Compras DT = TmpDT.FiltraParametros("ISNULL(AplicaCostoIndirecto,0) <> 1") End If 'RECORREMOS PARA DETECTAR LA MODALIDAD DEL ALMACEN, EN CASO DE SER SOLO EXISTENCIA LIMPIAMOS CVEALMACEN - For Each Dr As DataRow In DT.Rows - If DtAlmacenes.FiltroPrimeroValor("Modalidad", $"CveAlmacen = {Dr("CveAlmacen").ToString.ToEntero}").ToString = "Solo Existencia" Then - Dr("CveAlmacen") = 0 - End If - Dr.AcceptChanges() - Next + If DdlTipoCompra.SelectedValue <> "10" Then + For Each Dr As DataRow In DT.Rows + If DtAlmacenes.FiltroPrimeroValor("Modalidad", $"CveAlmacen = {Dr("CveAlmacen").ToString.ToEntero}").ToString = "Solo Existencia" Then + Dr("CveAlmacen") = 0 + End If + Dr.AcceptChanges() + Next + End If + DT.AcceptChanges() DtAlmacenes.Dispose() @@ -10118,12 +10146,14 @@ Partial Class Compras_Compras If UsuarioActual.Empresa.UsaInventarios AndAlso Not UsuarioActual.Empresa.Funcionalidad(126) = "1" And ConceptoContabilizacionAlmacen = 0 Then DT = TmpDT.FiltraParametros("ISNULL(TipoAF,0) <> 2 AND ISNULL(CveAlmacen,0) > 0", "", {"CveAlmacen"}) 'RECORREMOS PARA DETECTAR LA MODALIDAD DEL ALMACEN, EN CASO DE SER SOLO EXISTENCIA LIMPIAMOS CVEALMACEN - For Each Dr As DataRow In DT.Rows - If DtAlmacenes.FiltroPrimeroValor("Modalidad", $"CveAlmacen = {Dr("CveAlmacen").ToString.ToEntero}").ToString = "Solo Existencia" Then - Dr("CveAlmacen") = 0 - End If - Dr.AcceptChanges() - Next + If DdlTipoCompra.SelectedValue <> "10" Then + For Each Dr As DataRow In DT.Rows + If DtAlmacenes.FiltroPrimeroValor("Modalidad", $"CveAlmacen = {Dr("CveAlmacen").ToString.ToEntero}").ToString = "Solo Existencia" Then + Dr("CveAlmacen") = 0 + End If + Dr.AcceptChanges() + Next + End If DT.AcceptChanges() DT = DT.FiltraParametros("ISNULL(CveAlmacen,0) > 0") If DT.Rows.Count > 0 AndAlso Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") Then @@ -10204,12 +10234,15 @@ Partial Class Compras_Compras 'GASTO DT = TmpDT.Copy 'RECORREMOS PARA DETECTAR LA MODALIDAD DEL ALMACEN, EN CASO DE SER SOLO EXISTENCIA LIMPIAMOS CVEALMACEN - For Each Dr As DataRow In DT.Rows - If DtAlmacenes.FiltroPrimeroValor("Modalidad", $"CveAlmacen = {Dr("CveAlmacen").ToString.ToEntero}").ToString = "Solo Existencia" Then - Dr("CveAlmacen") = 0 - End If - Dr.AcceptChanges() - Next + If DdlTipoCompra.SelectedValue <> "10" Then + For Each Dr As DataRow In DT.Rows + If DtAlmacenes.FiltroPrimeroValor("Modalidad", $"CveAlmacen = {Dr("CveAlmacen").ToString.ToEntero}").ToString = "Solo Existencia" Then + Dr("CveAlmacen") = 0 + End If + Dr.AcceptChanges() + Next + End If + DT.AcceptChanges() DtAlmacenes.Dispose()