This commit is contained in:
2020-08-20 17:02:28 -07:00
58 changed files with 2836 additions and 857 deletions

View File

@@ -72,9 +72,12 @@ Partial Class Ventas_CatClasificaciones2
Public Sub CargaDatosS()
Dim ObjClasificaciones As New ClsClasificaciones
If ObjClasificaciones.GetClasificaciones(-1, 4) Then
GlobalDTClasificaciones2 = ObjClasificaciones.DtResultados
If ObjClasificaciones.GetClasificaciones(UsuarioActual.CveEmpresa, 4) Then
GlobalDTClasificaciones2(UsuarioActual.CveEmpresa) = ObjClasificaciones.DtResultados.FiltraParametros(String.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa))
ViewState("DTClasificacion2") = GlobalDTClasificaciones2(UsuarioActual.CveEmpresa)
Else
GvDatosS.DataSource = Nothing
End If
@@ -185,17 +188,19 @@ Partial Class Ventas_CatClasificaciones2
Dim ObjClasificaciones As New ClsClasificaciones
If ObjClasificaciones.AddClasificaciones(TxtClasificacionS.Text.Trim, "",
-1, "", -1, "", -1, "",
DdlCategoriaS.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, RequiereAFCompra:=False, RequiereAFInsumo:=False, RequierePersonal:=False) Then
'DdlCuentaGastoS.SelectedValue.ToEntero, DdlCuentaGastoS.SelectedItem.Text,
'DdlCuentaAnticipoS.SelectedValue.ToEntero, DdlCuentaAnticipoS.SelectedItem.Text,
'DdlCuentaInventarioS.SelectedValue.ToEntero, DdlCuentaInventarioS.SelectedItem.Text,
DdlCategoriaS.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, RequiereAFCompra:=False, RequiereAFInsumo:=False, RequierePersonal:=False) Then
'DdlCuentaGastoS.SelectedValue.ToEntero, DdlCuentaGastoS.SelectedItem.Text,
'DdlCuentaAnticipoS.SelectedValue.ToEntero, DdlCuentaAnticipoS.SelectedItem.Text,
'DdlCuentaInventarioS.SelectedValue.ToEntero, DdlCuentaInventarioS.SelectedItem.Text,
TxtClasificacionS.Text = ""
Alert("La nueva Clasificación se guardó correctamente.", TipoMensaje.MsgInformacion)
UpTitulosS.Update()
If ObjClasificaciones.GetClasificaciones(-1, 4) Then
GlobalDTClasificaciones2(UsuarioActual.CveEmpresa) = Nothing
ViewState("DTClasificacion2") = ObjClasificaciones.DtResultados.FiltraParametros(String.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa))
GlobalDTClasificaciones2 = ObjClasificaciones.DtResultados
GlobalDTClasificaciones2(UsuarioActual.CveEmpresa) = ObjClasificaciones.DtResultados.FiltraParametros(String.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa))
End If
'DdlCuentaGastoS.SelectedValue = "-1"
@@ -283,12 +288,13 @@ Partial Class Ventas_CatClasificaciones2
End If
End Sub
Protected Sub GvDatosS_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GvDatosS.RowDeleting
Dim ObjClasificaciones As New ClsClasificaciones
Dim ObjClasificaciones As New ClsClasificaciones
If ObjClasificaciones.RemoveClasificacion(GvDatosS.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
GvDatosS.EditIndex = -1
If ObjClasificaciones.GetClasificaciones(-1, 4) Then
ViewState("DTClasificacion2") = ObjClasificaciones.DtResultados.FiltraParametros(String.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa))
GlobalDTClasificaciones2 = ObjClasificaciones.DtResultados
GlobalDTClasificaciones2(UsuarioActual.CveEmpresa) = ObjClasificaciones.DtResultados.FiltraParametros(String.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa))
End If
Alert("La Clasificacion se eliminó correctamente.", TipoMensaje.MsgInformacion)
End If

View File

@@ -111,7 +111,7 @@ Partial Class ProductosyServicios
Private ReadOnly Property PermiteClasificacion2 As Boolean
Get
Return (UsuarioActual.CveEmpresa.Contiene(72, 80))
Return (UsuarioActual.CveEmpresa.Contiene(1, 72, 80))
End Get
End Property
@@ -1164,7 +1164,7 @@ Partial Class ProductosyServicios
End If
Dim CveMarca As Integer = 0
If UsuarioActual.CveEmpresa.Contiene(1, 72, 80) Then CveMarca = DdlMarcaPSDes.SelectedValue.ToEntero Else CveMarca = DdlMarca.SelectedValue.ToEntero
If UsuarioActual.CveEmpresa.Contiene(1, 72, 80) And CvePS = -1 Then CveMarca = DdlMarcaPSDes.SelectedValue.ToEntero Else CveMarca = DdlMarca.SelectedValue.ToEntero
If CvePS = -1 Then
Dim PSS As String = TxtPS.Text.Trim.Replace("|", "")
@@ -1656,11 +1656,13 @@ Partial Class ProductosyServicios
Protected Sub CargarMarcas()
If UsuarioActual.Empresa.Funcionalidad(130) = "1" Then
If UsuarioActual.CveEmpresa.Contiene(1, 72, 80) And CvePS = -1 Then
DivMarcaPSDes.Visible = True
Else
DivMarca.Visible = True
End If
Dim ObjMarcas As New ClsProductosServicios
ObjMarcas.GetMarcas(UsuarioActual.CveEmpresa)
DdlMarca.DataSource = ObjMarcas.DtResultados

View File

@@ -5094,7 +5094,7 @@ Partial Class Ventas
DdlSubProyectoDatos.SelectedValueExist(UsuarioActual.CveSubProyecto)
DdlSubProyectoDatos.Enabled = False
Else
DdlSubProyectoDatos.SelectedValueExist(ObjCliente.CveSubProyecto)
DdlSubProyectoDatos.SelectedValueExist(UsuarioActual.CveSubProyecto) ' DdlSubProyectoDatos.SelectedValueExist(ObjCliente.CveSubProyecto)
End If
'RECARGA LOS VALORES DE LA SUCURSAL
CambiaSucursal()
@@ -10279,15 +10279,15 @@ Partial Class Ventas
If IngresoIVA > 0 Then
IdCtaIVAXTrasladar = If(IdCtaIVAXTrasladar > 0, IdCtaIVAXTrasladar, UsuarioActual.Empresa.IdCuentaIVAxTrasladar)
Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 13, NombreCliente, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString())
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, (importeMovimiento * IngresoIVA) / IngresoTotal, Referencia, 13, Concepto, Fecha, IdCtaIVAXTrasladar, -1, CveVenta:=Dr("CveVenta").ToString().ToEntero(), CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=((importeMovimiento * IngresoIVA) / IngresoTotal) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, PorcentajeImpuesto:=PorcentajeImpuestoPago) Then
Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 13, NombreCliente, Dr("Folio").ToString, FolioIE.ToString())
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, False, (importeMovimiento * IngresoIVA) / IngresoTotal, Referencia, 13, Concepto, Fecha, IdCtaIVAXTrasladar, -1, CveVenta:=Dr("CveVenta").ToString().ToEntero(), CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=((importeMovimiento * IngresoIVA) / IngresoTotal) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, PorcentajeImpuesto:=PorcentajeImpuestoPago) Then
ErrorPrepoliza = True
Exit For
End If
'IVA PAGADO
IdCtaIVATrasladado = If(IdCtaIVATrasladado > 0, IdCtaIVATrasladado, UsuarioActual.Empresa.IdCuentaIVATrasladado)
Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 61, NombreCliente, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString())
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, Not TipoMovimiento, (importeMovimiento * IngresoIVA) / IngresoTotal, Referencia, 61, Concepto, Fecha, IdCtaIVATrasladado, -1, CveVenta:=Dr("CveVenta").ToString().ToEntero(), CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=((importeMovimiento * IngresoIVA) / IngresoTotal) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, PorcentajeImpuesto:=PorcentajeImpuestoPago) Then
Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 61, NombreCliente, Dr("Folio").ToString, FolioIE.ToString())
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, (importeMovimiento * IngresoIVA) / IngresoTotal, Referencia, 61, Concepto, Fecha, IdCtaIVATrasladado, -1, CveVenta:=Dr("CveVenta").ToString().ToEntero(), CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=((importeMovimiento * IngresoIVA) / IngresoTotal) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, PorcentajeImpuesto:=PorcentajeImpuestoPago) Then
ErrorPrepoliza = True
Exit For
End If
@@ -10296,15 +10296,15 @@ Partial Class Ventas
If IngresoIEPS > 0 Then
'IEPS X TRASLADAR
Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 38, NombreCliente, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString())
If IngresoIEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, (importeMovimiento * IngresoIEPS) / IngresoTotal, Referencia, 38, Concepto, Fecha, UsuarioActual.Empresa.IdCuentaIEPSxTrasladar, -1, CveVenta:=Dr("CveVenta").ToString().ToEntero(), CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=((importeMovimiento * IngresoIEPS) / IngresoTotal) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar) Then
Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 38, NombreCliente, Dr("Folio").ToString, FolioIE.ToString())
If IngresoIEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, False, (importeMovimiento * IngresoIEPS) / IngresoTotal, Referencia, 38, Concepto, Fecha, UsuarioActual.Empresa.IdCuentaIEPSxTrasladar, -1, CveVenta:=Dr("CveVenta").ToString().ToEntero(), CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=((importeMovimiento * IngresoIEPS) / IngresoTotal) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar) Then
ErrorPrepoliza = True
Exit For
End If
'IEPS PAGADO
Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 39, NombreCliente, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString())
If IngresoIEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, Not TipoMovimiento, (importeMovimiento * IngresoIEPS) / IngresoTotal, Referencia, 39, Concepto, Fecha, UsuarioActual.Empresa.IdCuentaIEPSTrasladado, -1, CveVenta:=Dr("CveVenta").ToString().ToEntero(), CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=((importeMovimiento * IngresoIEPS) / IngresoTotal) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar) Then
Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 39, NombreCliente, Dr("Folio").ToString, FolioIE.ToString())
If IngresoIEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, (importeMovimiento * IngresoIEPS) / IngresoTotal, Referencia, 39, Concepto, Fecha, UsuarioActual.Empresa.IdCuentaIEPSTrasladado, -1, CveVenta:=Dr("CveVenta").ToString().ToEntero(), CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=((importeMovimiento * IngresoIEPS) / IngresoTotal) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar) Then
ErrorPrepoliza = True
Exit For
End If
@@ -10642,8 +10642,11 @@ Partial Class Ventas
'CTACONTABLE
'IdCtaContable = IdCtaContAnticipos
'CveCuenta = CveCuentaAnticipos
IdCtaContable = ObjFactura.Cliente.IdCtaContClientes
CveCuenta = ObjFactura.Cliente.CveCuentaClientes
If tipoCambio = 1 Then
IdCtaContable = ObjFactura.Cliente.IdCtaContClientes
Else
IdCtaContable = ObjFactura.Cliente.IdCtaContMonedaExtranjera
End If
CveSubProyectoContabilizar = CveSubProyectoVenta
@@ -11510,6 +11513,7 @@ Partial Class Ventas
CveProducto = Dr("CvePS").ToString().ToEntero()
CveUnidad = Dr("CveUM").ToString().ToEntero()
Cantidad = Dr("Cantidad").ToString().ToDouble
Dim AplicaSeccion As Boolean = CBool(GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=CveProducto).FiltroPrimeroValor("AplicaSeccion"))
If Dr("CveTipoInvPS").ToString().ToEntero() = 5 And Dr("Serie").ToString() = "" Then
OcurrioError = True
@@ -11550,8 +11554,10 @@ Partial Class Ventas
Exit For
End If
End If
Dim CveSeccionAlmacen As Integer = -1
If AplicaSeccion Then CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacen, CveProducto).FiltroPrimeroValor("CveSeccionAlmacen", "").ToEntero
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, Cantidad, CveUnidad, CveProducto, PU, -1, Serie:=Dr("Serie").ToString(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero()) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, Cantidad, CveUnidad, CveProducto, PU, -1, Serie:=Dr("Serie").ToString(), CveSeccionAlmacen:=CveSeccionAlmacen, CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero()) Then
OcurrioError = True
ErrorList.Add("Ocurrió un error al agregar los Movimientos de salida al Inventario.<br />")
Exit For