diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index e5b2e1482..05f3aaefd 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -4663,6 +4663,55 @@ Public Class ClsInventarios End Try Return Retorno End Function + Public Function AddProductosServiciosAlmacenSeccion(CvePS As Integer, CveAlmacen As Integer, CveAlmacenSeccion As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_ProductosServiciosAlmacenSeccionAdd") + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen + .Add("@CveAlmacenSeccion", SqlDbType.Int).Value = CveAlmacenSeccion + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al agregar el ps de la seccion de almacen", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + + Public Function GetProductosServiciosAlmacenSeccion(CvePS As Integer, CveAlmacen As Integer, CveAlmacenSeccion As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_ProductosServiciosAlmacenSeccionGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen + .Add("@CveAlmacenSeccion", SqlDbType.Int).Value = CveAlmacenSeccion + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el ps de la seccion de almacen", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + + Public Function RemoveProductosServiciosAlmacenSeccion(CvePSAlmacenSeccion As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_ProductosServiciosAlmacenSeccionRemove") + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePSAlmacenSeccion", SqlDbType.Int).Value = CvePSAlmacenSeccion + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al eliminar el ps de la seccion de almacen", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + #End Region diff --git a/Bancos/IE.aspx b/Bancos/IE.aspx index d6f6d6e03..0e5e68162 100644 --- a/Bancos/IE.aspx +++ b/Bancos/IE.aspx @@ -1,4 +1,4 @@ -<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="IE.aspx.vb" Inherits="Bancos_IE" %> +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="IE.aspx.vb" Inherits="Bancos_IE" ValidateRequest="false" %> diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 987479ce5..47b2f010e 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -1126,9 +1126,9 @@ Partial Class Compras_Compras CveCuentaBancaria = 0 End If - If UsuarioActual.TienePermisoProceso(259) Then - DivEsNoDeducible.Visible = True - End If + 'If UsuarioActual.TienePermisoProceso(259) Then + DivEsNoDeducible.Visible = True + 'End If If UsuarioActual.Empresa.Funcionalidad(125) = "1" Then 'Seleccionar a quien se abona la Prepoliza 'ddlCargoPrePoliza.Visible = True @@ -4642,6 +4642,18 @@ Partial Class Compras_Compras If Not ErrorAC Then + + Dim AutoConta As Boolean = UsuarioActual.Empresa.Funcionalidad(200) = "1" + + If UsuarioActual.CveEmpresa = 119 AndAlso (DdlPersonalReembolso.SelectedValue.ToEntero > 0 Or DdlCuentaCajaChicaReembolso.SelectedValue.ToEntero > 0) Then + AutoConta = False + End If + + If (AutoConta Or UsuarioActual.Empresa.UsaAC) And ObjContaAC Is Nothing Then + ObjContaAC = New ClsContPAQi(UsuarioActual.Empresa) + ObjContaAC.IniciaTransacSQL() + End If + ''EMPIEZA: INSERTA DETALLES DE LA COMPRA Dim indiceTR = 0 Dim Cont As Integer = 0 @@ -4747,7 +4759,7 @@ Partial Class Compras_Compras 'verifica si fue vinculada con una OC, y si fue la opción de entrega por adelantado, que si hubo cambios de precios If DdlOCVinculaInv.SelectedValue.ToEntero.Contiene(176, 205) Then - If Not AjustarPrePolizaVinculacionOC(ObjOC, ObjEventos, ObjInventario, ObjConta) Then + If Not AjustarPrePolizaVinculacionOC(ObjOC, ObjEventos, ObjInventario, ObjConta, ObjContaAC) Then ErrorPrepoliza = True End If End If @@ -5218,16 +5230,7 @@ Partial Class Compras_Compras IdCtaIVAAcreditable = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeIVA).Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero End If - Dim AutoConta As Boolean = UsuarioActual.Empresa.Funcionalidad(200) = "1" - If UsuarioActual.CveEmpresa = 119 AndAlso (DdlPersonalReembolso.SelectedValue.ToEntero > 0 Or DdlCuentaCajaChicaReembolso.SelectedValue.ToEntero > 0) Then - AutoConta = False - End If - - If (AutoConta Or UsuarioActual.Empresa.UsaAC) And ObjContaAC Is Nothing Then - ObjContaAC = New ClsContPAQi(UsuarioActual.Empresa) - ObjContaAC.IniciaTransacSQL() - End If '********************** Variables '********************** @@ -6226,31 +6229,31 @@ Partial Class Compras_Compras End If Dim ContienePSNeteoBonif As Boolean = False - For Each Dr As DataRow In TmpDT.Rows - If Dr("CveClasificacion").ToString.ToEntero.Contiene(20319) Then 'clasificación de Bonificación, no se incluirá en el neteo - ContienePSNeteoBonif = True - Exit For - End If - Next + For Each Dr As DataRow In TmpDT.Rows + If Dr("CveClasificacion").ToString.ToEntero.Contiene(20319) Then 'clasificación de Bonificación, no se incluirá en el neteo + ContienePSNeteoBonif = True + Exit For + End If + Next - If ContienePSNeteoBonif 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 ").ToString.ToDecimal - importeMN = importeMovimiento * tipoCambioActual * Multiplicador - Dim IdCtaContableDescCompra As Integer = UsuarioActual.Empresa.Funcionalidad(405).ToEntero - If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importeMovimiento, Referencia, 259, Concepto, FechaMovimiento, IdCtaContableDescCompra, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza) Then - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -importeMovimiento, Referencia, 259, Concepto, FechaMovimiento, IdCtaContableDescCompra, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=-importeMN, ImporteME:=If(tipoCambioActual = 1, 0, -importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza) Then - ErrorPrepoliza = True - End If - Else + If ContienePSNeteoBonif 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 ").ToString.ToDecimal + importeMN = importeMovimiento * tipoCambioActual * Multiplicador + Dim IdCtaContableDescCompra As Integer = UsuarioActual.Empresa.Funcionalidad(405).ToEntero + If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importeMovimiento, Referencia, 259, Concepto, FechaMovimiento, IdCtaContableDescCompra, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -importeMovimiento, Referencia, 259, Concepto, FechaMovimiento, IdCtaContableDescCompra, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=-importeMN, ImporteME:=If(tipoCambioActual = 1, 0, -importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza) Then ErrorPrepoliza = True End If + Else + ErrorPrepoliza = True End If - End If + End If - If Not ChkNCInvNC.Checked OrElse Not ListaDocumentos.Count > 0 Then + + If Not ChkNCInvNC.Checked OrElse Not ListaDocumentos.Count > 0 Then 'GASTO If UsuarioActual.CveEmpresa = 119 Then DT = TmpDT @@ -18467,7 +18470,7 @@ Partial Class Compras_Compras #End Region - Private Function AjustarPrePolizaVinculacionOC(ByRef OC As ClsOC, ByRef OCBitacora As ClsOIEventos, ByRef ObjInventarios As ClsInventarios, ByRef ObjConta As ClsContabilidad) As Boolean + Private Function AjustarPrePolizaVinculacionOC(ByRef OC As ClsOC, ByRef OCBitacora As ClsOIEventos, ByRef ObjInventarios As ClsInventarios, ByRef ObjConta As ClsContabilidad, ByRef ObjAC As ClsContPAQi) As Boolean 'VARIABLES Dim CveProveedorSucursal As Integer = -1 @@ -18687,6 +18690,12 @@ Partial Class Compras_Compras Retorno = False End If End If + + If UsuarioActual.Empresa.Funcionalidad(200) = "1" AndAlso ObjAC IsNot Nothing Then + If Not ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjAC) Then + Retorno = False + End If + End If End If End If Next diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb index 818e6c6d0..3c43ac662 100644 --- a/OC/OC.aspx.vb +++ b/OC/OC.aspx.vb @@ -2249,7 +2249,7 @@ Partial Class OC Dim ObjConta As New ClsContabilidad(OC.IniciaTransacSQL()) Dim Conta As ClsContPAQi = Nothing - If UsuarioActual.Empresa.UsaAC AndAlso VerificaPresupuesto Then + If (UsuarioActual.Empresa.UsaAC AndAlso VerificaPresupuesto) Or UsuarioActual.Empresa.Funcionalidad(200) = "1" Then Conta = New ClsContPAQi(UsuarioActual.Empresa) Conta.IniciaTransacSQL() End If @@ -2647,6 +2647,13 @@ Partial Class OC End If End If + + If UsuarioActual.Empresa.Funcionalidad(200) = "1" AndAlso Conta IsNot Nothing Then + If Not ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=Conta) Then + TieneError = False + End If + End If + End If End If Next diff --git a/Ventas/ProductosServicios.aspx b/Ventas/ProductosServicios.aspx index 06edab7a6..38921f40b 100644 --- a/Ventas/ProductosServicios.aspx +++ b/Ventas/ProductosServicios.aspx @@ -140,7 +140,7 @@ -
+
@@ -201,7 +201,7 @@
-
+
@@ -209,15 +209,9 @@
- -
- - - - - -
- + + +
Seleccione @@ -554,10 +548,12 @@
+
+
@@ -721,6 +717,7 @@
Seleccionar Todos +
@@ -938,8 +935,47 @@
+
+
+ + +
+
+
+
+ + Secciones de Almacen +
+
+
+ +
+
+
+
+ + + + + + + + + + + + + + + + +
+
+
+
+
+
-
@@ -1011,25 +1047,29 @@ Característica - + + Opción - + + Fecha Ing. - + + Usuario - + + @@ -1670,6 +1710,7 @@

El producto seleccionado en el recuadro de arriba sera unificado en el producto actual +

@@ -1901,6 +1942,7 @@

Tipo de Clasificación: +

@@ -1910,6 +1952,7 @@   +
@@ -1978,6 +2021,46 @@
+ + <%-- MODAL PS ADICIONALES --%> + + + <%-- FIN MODAL PS ADICIONALES --%> @@ -2154,7 +2237,9 @@ var initcarusel2 = initcarusel; - + function ADSReady() { + setPoscicion(); + } //TERMINA: ECOMMERCE diff --git a/Ventas/ProductosServicios.aspx.vb b/Ventas/ProductosServicios.aspx.vb index 31ec53798..873cd7766 100644 --- a/Ventas/ProductosServicios.aspx.vb +++ b/Ventas/ProductosServicios.aspx.vb @@ -97,6 +97,15 @@ Partial Class ProductosyServicios ViewState("CvePSAdicional") = value End Set End Property + Public Property DtSeccionAlmacen() As DataTable + Get + Return CType(ViewState("DtSeccionAlmacen"), DataTable) + End Get + Set(value As DataTable) + ViewState("DtSeccionAlmacen") = value + End Set + End Property + #End Region @@ -137,6 +146,7 @@ Partial Class ProductosyServicios CargarAlias() CargaExistencias() + CargaGvSeccionAlmacen() Else 'Configuración de Modalidad Insert RegistraScript("$('#C_Tab_TabPaquetes_tab').css('display' , 'none')") @@ -216,7 +226,7 @@ Partial Class ProductosyServicios 'DivDatos.Attributes("class") = "col-md-12" DivDdlTipo.Visible = True - DdlTipoPSDes.Attributes.Add("onChange", "CreaDescripcionPS();") + 'DdlTipoPSDes.Attributes.Add("onChange", "CreaDescripcionPS();") End If @@ -235,16 +245,11 @@ Partial Class ProductosyServicios If ddlMetodos.SelectedValue.ToEntero = 5 And Not UsuarioActual.TienePermisoProceso(255) Then ddlMetodos.Enabled = False End If + Dim posiciontipo As String = If(UsuarioActual.Empresa.Funcionalidad(558).ToString = "1", "$('.DIVCLASIFICACIONCONTABLE').after( $('.DIVTIPO') );", "") + LtlScripts.Text = $"" If Not CvePS > 0 Then MuestraPanel(True) - - - - - - - End If End Sub @@ -280,6 +285,11 @@ Partial Class ProductosyServicios CargaDdlFraccionArancelaria() CveSATPS = -1 + CargaCombosSeccionAlmacen() + DivSeccionAlmacen.Visible = UsuarioActual.Empresa.Funcionalidad(563).ToString = "1" + + CreaDtSeccionAlmacen() + If UsuarioActual.Empresa.UsaContabilidad Then CargaCuentasContables() If Not (Request("CvePS") IsNot Nothing AndAlso IsNumeric(Request("CvePS")) AndAlso Request("CvePS").ToEntero > 0) Then DivUsoClasificacion.Visible = True @@ -2467,4 +2477,71 @@ Partial Class ProductosyServicios DdlCategoriaToxicidad.SelectedValue = "000" End If End Sub + +#Region "SECCION ALMACEN" + + Private Sub CreaDtSeccionAlmacen() + DtSeccionAlmacen = New DataTable + DtSeccionAlmacen.Columns.Add("CvePSAlmacenSeccion", GetType(Integer)) + DtSeccionAlmacen.Columns.Add("CvePS", GetType(Integer)) + DtSeccionAlmacen.Columns.Add("CveAlmacen", GetType(Integer)) + DtSeccionAlmacen.Columns.Add("Almacen", GetType(String)) + DtSeccionAlmacen.Columns.Add("CveAlmacenSeccion", GetType(Integer)) + DtSeccionAlmacen.Columns.Add("AlmacenSeccion", GetType(String)) + End Sub + Private Sub CargaGvSeccionAlmacen() + Dim ObjInv As New ClsInventarios + If ObjInv.GetProductosServiciosAlmacenSeccion(CvePS, -1, -1) Then + GvSeccionAlmacen.DataSource = ObjInv.DtResultados + DtSeccionAlmacen = ObjInv.DtResultados + End If + ObjInv.Dispose() + GvSeccionAlmacen.DataBind() + UpSeccionAlmacen.Update() + End Sub + + + Private Sub CargaCombosSeccionAlmacen() + DdlAlmacen.DataSource = GlobalDTAlmacen(UsuarioActual.CveAlmacen) + DdlAlmacen.Items.Add(New ListItem("Seleccione", "-1")) + DdlAlmacen.DataBind() + + DdlSeccionAlmacen.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveAlmacen) + DdlSeccionAlmacen.Items.Add(New ListItem("Seleccione", "-1")) + DdlSeccionAlmacen.DataBind() + + End Sub + + Protected Sub LnkSeccionAlmacenAdd_Click(sender As Object, e As EventArgs) + DdlAlmacen.SelectedIndex = 0 + DdlSeccionAlmacen.SelectedIndex = 0 + RegistraScript("$('#DivAddSeccionAlmacen').modal();") + UpModalSeccionAlmacen.Update() + End Sub + Protected Sub LnkEditarSeccionAlmacen_Click(sender As Object, e As EventArgs) + Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow) + DdlAlmacen.SelectedValueExist(gvRow.DataKey("CvAlmacen")) + DdlSeccionAlmacen.SelectedValueExist(gvRow.DataKey("CveAlmacenSeccion")) + RegistraScript("$('#DivAddSeccionAlmacen').modal();") + UpModalSeccionAlmacen.Update() + End Sub + Protected Sub LnkRemoveSeccionAlmacen_Click(sender As Object, e As EventArgs) + Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow) + If gvRow.DataKey("CvePSAlmacenSeccion").ToEntero > 0 Then + DtSeccionAlmacen.Rows(gvRow.RowIndex)("CvePS") = -1 + Else + DtSeccionAlmacen.Rows(gvRow.RowIndex.ToEntero).Delete() + End If + DtSeccionAlmacen.AcceptChanges() + GvSeccionAlmacen.DataSource = DtSeccionAlmacen + GvSeccionAlmacen.DataBind() + End Sub + + Protected Sub BtnAddSeccionAlmacen_Click(sender As Object, e As EventArgs) + + End Sub + +#End Region + + End Class diff --git a/Ventas/RepCancelacionesPorRespuesta.aspx.cs b/Ventas/RepCancelacionesPorRespuesta.aspx.cs index 3dbbbcf11..4a27125d5 100644 --- a/Ventas/RepCancelacionesPorRespuesta.aspx.cs +++ b/Ventas/RepCancelacionesPorRespuesta.aspx.cs @@ -132,7 +132,7 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas CancelacionFecha = xmlAcuse.SelectSingleNode("Acuse").Attributes["Fecha"].Value.ToDate(); } - var FueCancelado = CancelarDocumento(CveVenta, CveEstatus, CveCliente, Folio, uuid, CancelacionAcuse, CancelacionFecha, TipoDocto, total.ToDouble(), UsuarioActual.Empresa.CvePAC).Mensaje; + // var FueCancelado = CancelarDocumento(CveVenta, CveEstatus, CveCliente, Folio, uuid, CancelacionAcuse, CancelacionFecha, TipoDocto, total.ToDouble(), UsuarioActual.Empresa.CvePAC).Mensaje; sb.AppendFormat("{0}
", FueCancelado); if (CveEstatus.Contiene(4, 5) && EsRefacturacion) @@ -170,12 +170,13 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas return sb.ToString(); } - private Modelos.Factura.MCancelacionVentaMensaje CancelarDocumento(int CveVenta, int CveEstatus, int CveCliente, string Folio, string FolioFiscal, string CancelacionAcuse, DateTime CancelacionFecha, string TipoComprobante, double Total, int CvePACCancelacion) - { - var factura = new Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa); - var retorno = factura.EjecutarCancelacionPendiente(CveEstatus, CancelacionFecha, CancelacionAcuse); - return retorno; - } + + //private Modelos.Factura.MCancelacionVentaMensaje CancelarDocumento(int CveVenta, int CveEstatus, int CveCliente, string Folio, string FolioFiscal, string CancelacionAcuse, DateTime CancelacionFecha, string TipoComprobante, double Total, int CvePACCancelacion) + //{ + // //var factura = new Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa); + // //var retorno = factura.EjecutarCancelacionPendiente(CveEstatus, CancelacionFecha, CancelacionAcuse); + // return retorno; + //} private int GenerarPolizaAC(ClsContPAQi ObjAC, int CveVenta, string Folio, int CveCliente, string TipoComprobante, DateTime Fecha, bool CancelacionIngreso = false) {