From 145e805b1243b56a08ac5b665b06d843c5111501 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Thu, 8 Oct 2020 21:35:42 -0700 Subject: [PATCH 1/8] =?UTF-8?q?reparando=20error=20l=C3=B3gico?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Compras/Compras.aspx.vb | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 7838361a3..47d1eb77c 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -20211,23 +20211,25 @@ Partial Class Compras_Compras CvePSGRuposAux.AppendFormat("{0},", CvePSIndividual) Next - Dim CvePSGRupos As String = Left(CvePSGRuposAux.ToString, CvePSGRuposAux.Length - 1) + If CvePSGRuposAux.Length > 0 Then + Dim CvePSGRupos As String = Left(CvePSGRuposAux.ToString, CvePSGRuposAux.Length - 1) - Dim PSSat As DataTable = GlobalDTPS(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CvePS IN ({0})", CvePSGRuposAux)) + Dim PSSat As DataTable = GlobalDTPS(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CvePS IN ({0})", CvePSGRuposAux)) - Dim ProductosCodigoSATNoPermitidos As New StringBuilder("") - For Each PS As GridViewRow In GvPS.Rows - Dim PSIndividual As String = PS.DataKey("PS") - Dim ClavePSSAT As String = PSSat.FiltroPrimeroValor("CveSATPS", String.Format("PS = '{0}'", PSIndividual)) - If ClavePSSAT = "46920" Then - ProductosCodigoSATNoPermitidos.AppendFormat("{0}
", PSIndividual) + Dim ProductosCodigoSATNoPermitidos As New StringBuilder("") + For Each PS As GridViewRow In GvPS.Rows + Dim PSIndividual As String = PS.DataKey("PS") + Dim ClavePSSAT As String = PSSat.FiltroPrimeroValor("CveSATPS", String.Format("PS = '{0}'", PSIndividual)) + If ClavePSSAT = "46920" Then + ProductosCodigoSATNoPermitidos.AppendFormat("{0}
", PSIndividual) + End If + Next + + If ProductosCodigoSATNoPermitidos.ToString.Length > 0 Then + Dim mensajeAdvertencia As String = String.Format("No se permite vinculación de productos con código SAT '01010101', revise los productos:

{0}", ProductosCodigoSATNoPermitidos.ToString) + Alert(mensajeAdvertencia, TipoMensaje.MsgAdvertencia) + Return False End If - Next - - If ProductosCodigoSATNoPermitidos.ToString.Length > 0 Then - Dim mensajeAdvertencia As String = String.Format("No se permite vinculación de productos con código SAT '01010101', revise los productos:

{0}", ProductosCodigoSATNoPermitidos.ToString) - Alert(mensajeAdvertencia, TipoMensaje.MsgAdvertencia) - Return False End If Return True From 81d669748d8bc8cbf9f993b9527fa4df6e76747d Mon Sep 17 00:00:00 2001 From: Rakcsle Supertramp Date: Fri, 9 Oct 2020 11:19:52 -0700 Subject: [PATCH 2/8] Funcionalidad 281 bloquear fechas --- Bancos/FluctuacionCambiaria.aspx | 10 ++++---- Bancos/PrestamoPersonal.aspx.cs | 11 +++++++++ Inventarios/EntradasSalidas.aspx.vb | 35 ++++++++++++++++++++++++++++ Inventarios/EntregaAlmacen.aspx.vb | 8 +++++++ Inventarios/RecepcionAlmacen.aspx.vb | 8 +++++++ Inventarios/TraspasoAlmacen.aspx.vb | 12 ++++++++++ 6 files changed, 78 insertions(+), 6 deletions(-) diff --git a/Bancos/FluctuacionCambiaria.aspx b/Bancos/FluctuacionCambiaria.aspx index 3ecd068fa..56c76c41c 100644 --- a/Bancos/FluctuacionCambiaria.aspx +++ b/Bancos/FluctuacionCambiaria.aspx @@ -147,9 +147,7 @@
-
- - + @@ -230,15 +228,15 @@
-
- +
+
-
+
diff --git a/Bancos/PrestamoPersonal.aspx.cs b/Bancos/PrestamoPersonal.aspx.cs index f9674a6bb..2ecb1b234 100644 --- a/Bancos/PrestamoPersonal.aspx.cs +++ b/Bancos/PrestamoPersonal.aspx.cs @@ -106,6 +106,17 @@ public partial class Bancos_PrestamoPersonal : ClsPaginas txtFechaF.Text = DateTime.Now.ToShortDateString(); TxtImporte.Attributes.Add("disabled", "disabled"); + if(UsuarioActual.Empresa.Funcionalidad(281).ToEntero() == 1) + { + TxtFechaPrestamo.Enabled = false; + ImgCalendarioPrestamo.Visible = false; + + TxtFechaDocumento.Enabled = false; + ImgCalendario.Visible = false; + + } + + } } diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index 08040c50e..059f71e5b 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -275,6 +275,7 @@ Partial Class Inventarios_EntradasSalidas #End Region Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load + If Not IsPostBack Then CveMovimiento = -1 @@ -289,6 +290,7 @@ Partial Class Inventarios_EntradasSalidas CreaDT() CargaCombos() TxtFecha.Text = Now.ToShortDateString + TxtFechaInvFisico.Text = Now.ToShortDateString RVFecha.MaximumValue = Now.ToShortDateString If Not UsuarioActual.CveEmpresa = 48 Then @@ -350,7 +352,25 @@ Partial Class Inventarios_EntradasSalidas PermisoVerImportes() End If + + If UsuarioActual.Empresa.Funcionalidad(281).ToEntero = 1 Then + + TxtFecha.Enabled = False + ImgFecha.Visible = False + + TxtFechaInvFisico.Enabled = False + ImgFechaInvFisico.Visible = False + + UpGenerales.Update() + UpModalInventarioFisico.Update() + + End If + End If + + + + End Sub #Region " PERMISOS PAGINAS " @@ -927,6 +947,21 @@ Partial Class Inventarios_EntradasSalidas 'BtnGuardar.Visible = False End If + + If UsuarioActual.Empresa.Funcionalidad(281).ToEntero = 1 Then + + TxtFecha.Enabled = False + ImgFecha.Visible = False + + TxtFechaInvFisico.Enabled = False + ImgFechaInvFisico.Visible = False + + + + + End If + + UpModalInventarioFisico.Update() BloqueaEdicionEncabezado() Mov.Dispose() UpGenerales.Update() diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb index 6d6e99153..8aff48266 100644 --- a/Inventarios/EntregaAlmacen.aspx.vb +++ b/Inventarios/EntregaAlmacen.aspx.vb @@ -263,6 +263,14 @@ Partial Class Inventarios_EntregaAlmacen InicializaValores() CargaParametrosAD() If UsuarioActual.CveEmpresa.Contiene(72, 80) Then DdlAlmacen.AutoPostBack = True + + If UsuarioActual.Empresa.Funcionalidad(281).ToEntero = 1 Then + + TxtFecha.Enabled = False + ImgFecha.Visible = False + + End If + End If End Sub diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb index 5022d6ebb..e5b39aeef 100644 --- a/Inventarios/RecepcionAlmacen.aspx.vb +++ b/Inventarios/RecepcionAlmacen.aspx.vb @@ -399,6 +399,14 @@ Partial Class Inventarios_RecepcionAlmacen CargaPermisos() If UsuarioActual.CveEmpresa.Contiene(72, 80) Then DdlAlmacen.AutoPostBack = True + If UsuarioActual.Empresa.Funcionalidad(281).ToEntero = 1 Then + + TxtFecha.Enabled = False + ImgFecha.Visible = False + + End If + + End If End Sub diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb index edb1228f1..efb17de68 100644 --- a/Inventarios/TraspasoAlmacen.aspx.vb +++ b/Inventarios/TraspasoAlmacen.aspx.vb @@ -228,6 +228,18 @@ Partial Class Inventarios_TraspasoAlmacen TipoSeccionAlmacen = 0 + + + If UsuarioActual.Empresa.Funcionalidad(281).ToEntero = 1 Then + + TxtFecha.Enabled = False + ImgFecha.Visible = False + + TxtFechaRecepcion.Enabled = False + ImgFechaRecepcion.Visible = False + + End If + Else If ChkTransitorio.Checked Then RegistraScript("$('#DivTransitorio').show(0);$('#DivGastoIndirecto').show(0);$('#DivDocChofer').show(0);") From a17b7be38a375ed52ae6707e78203b09897828de Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Fri, 9 Oct 2020 12:57:31 -0700 Subject: [PATCH 3/8] Recargar Global DT Subproyectos --- Compras/PopUpVerFactura.aspx.vb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index 482e6026a..83cbf87b1 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -937,7 +937,10 @@ Partial Class PopUpVerFactura 'se rellena la sucursal 'Vta.Subproyecto = ObjVentas.DtResultados.Rows(0).DataRowToObject(Of Modelos.SucursalModel) Dim CveSubProyecto As Integer = dtVentas(0)("CveSubProyecto").ToString().ToEntero() - Vta.SubProyecto = GlobalDTSubProyectos(-1, CveSubProyecto).Rows(0).DataRowToObject(Of Modelos.SubProyectoModel) + + Dim DtSubProyecto = GlobalDTSubProyectos(-1, CveSubProyecto:=CveSubProyecto, CveEmpresa:=dtVentas(0)("CveEmpresa").ToString().ToEntero()) + + Vta.SubProyecto = DtSubProyecto.Rows(0).DataRowToObject(Of Modelos.SubProyectoModel) 'Vta.SubProyecto = ObjVentas.DtResultados.Rows(0).DataRowToObject(Of Modelos.SubProyectoModel) Vta.Cliente = New Modelos.ClienteModel Vta.Cliente.Nombre = dtVentas(0)("ClienteNombre").ToString From bde1f17499de5f7ffa43c3b61081d84ec90f8fe4 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Fri, 9 Oct 2020 12:58:40 -0700 Subject: [PATCH 4/8] Cambiar la forma de recargar el global de subproyectos --- Planeacion/CatSubProyectos.aspx.vb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Planeacion/CatSubProyectos.aspx.vb b/Planeacion/CatSubProyectos.aspx.vb index f2d679fd2..9b1b67cba 100644 --- a/Planeacion/CatSubProyectos.aspx.vb +++ b/Planeacion/CatSubProyectos.aspx.vb @@ -81,12 +81,8 @@ Partial Class CatSubProyectos End If End Sub - Private Sub RecargaGlobal() - Dim ObjSubProyectos As New ClsSubProyectos - If ObjSubProyectos.GetSubProyectos(UsuarioActual.CveEmpresa) Then - GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) = ObjSubProyectos.DtResultados - End If - ObjSubProyectos.Dispose() + Private Sub RecargaGlobal() + GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) = Nothing End Sub #Region "O R D E N A M I E N T O" From b99c73f4571073e484213e85fd6ef7c20e90fbfe Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Fri, 9 Oct 2020 12:59:23 -0700 Subject: [PATCH 5/8] Traspasar Apartados de un cliente a otro siendo un vendedor --- Inventarios/RepApartados.aspx | 295 +++++++++++++++++++------------ Inventarios/RepApartados.aspx.vb | 287 +++++++++++++++++++++++++++--- 2 files changed, 444 insertions(+), 138 deletions(-) diff --git a/Inventarios/RepApartados.aspx b/Inventarios/RepApartados.aspx index 6cb599ee9..c9cbef7a0 100644 --- a/Inventarios/RepApartados.aspx +++ b/Inventarios/RepApartados.aspx @@ -1,116 +1,179 @@ -<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepApartados.aspx.vb" Inherits="Inventarios_RepApartados" %> - - - - - - - Apartados | Reporte de apartados - Detalle - - -
  • - PDF -
  • -
  • - Excel -
  • -
    - - - - - - - <%--FILTROS--%> - - -
    -
    -
    - - -
    -
    -
    -
    Fecha Inicial:
    -
    -
    - - - - - - - - - - -
    -
    -
    Fecha Final:
    -
    -
    - - - - - - - - - - -
    -
    -
    Sucursal:
    -
    - -
    -
    Vendedor:
    -
    - -
    -
    -
    -
    -
    -
    -
    Cliente
    -
    - -
    -
    PS:
    -
    - -
    -
    -
    -
    -
    -
    - -
    - " style="display: inline-block; margin-right: -20px; width: 150px;" /> - " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> -
    - - <%--GV DATOS--%> - - - - - - - - - - - - - - - -
    - - - +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepApartados.aspx.vb" Inherits="Inventarios_RepApartados" %> + + + + + + + Apartados | Reporte de apartados - Detalle + + +
  • + PDF +
  • +
  • + Excel +
  • +
  • + + + Traspasar Apartado + + +
  • +
    + + + + + + + <%--FILTROS--%> + + +
    +
    +
    + + +
    +
    +
    +
    Fecha Inicial:
    +
    +
    + + + + + + + + + + +
    +
    +
    Fecha Final:
    +
    +
    + + + + + + + + + + +
    +
    +
    Sucursal:
    +
    + +
    +
    Vendedor:
    +
    + +
    +
    +
    +
    +
    +
    +
    Cliente
    +
    + +
    +
    PS:
    +
    + +
    +
    +
    +
    +
    +
    + +
    + " style="display: inline-block; margin-right: -20px; width: 150px;" /> + " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> +
    + + <%--GV DATOS--%> +
    +
    + + + + + + + + + + + + + + + + + + + + + +
    +
    + + +
    + + + diff --git a/Inventarios/RepApartados.aspx.vb b/Inventarios/RepApartados.aspx.vb index a5f0bd02d..cb2b86a4d 100644 --- a/Inventarios/RepApartados.aspx.vb +++ b/Inventarios/RepApartados.aspx.vb @@ -6,9 +6,9 @@ Imports Extensiones Imports Microsoft.Reporting.WebForms Partial Class Inventarios_RepApartados - Inherits ClsPaginas - - + Inherits ClsPaginas + + #Region " PROPIEDADES " Private Property DtApartados As DataTable Get @@ -17,18 +17,18 @@ Partial Class Inventarios_RepApartados Set(value As DataTable) ViewState("DtApartados") = value End Set - End Property + End Property #End Region - - + + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not IsPostBack Then SetValues() InicializaParam() End If - End Sub - - + End Sub + + #Region " SET VALUES " Private Sub SetValues() DdlSubProyectos.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) @@ -42,6 +42,15 @@ Partial Class Inventarios_RepApartados DdlClientesWS.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1) DdlClientesWS.DataBind() DdlClientesWS.ddl.Items.Insert(0, New ListItem("Todos", "-1")) + End If + + If UsuarioActual.CveEmpresa = 119 Then + DdlClienteTraspasar.setEsWebService(True) + Else + DdlClienteTraspasar.setEsWebService(False) + DdlClienteTraspasar.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1) + DdlClienteTraspasar.DataBind() + DdlClienteTraspasar.ddl.Items.Insert(0, New ListItem("Todos", "-1")) End If Dim DTVendedores As New DataTable @@ -68,9 +77,9 @@ Partial Class Inventarios_RepApartados txtFechaI.Text = Now.FirstDayOfMonth.ToShortDateString txtFechaF.Text = Now.ToShortDateString - End Sub + End Sub #End Region - + Private Sub InicializaParam() Dim Anio, Mes, AnioMes, Fecha, FechaI, FechaF As String Dim CveCliente, CveVendedor, CveSucursal, CvePS As String @@ -127,7 +136,10 @@ Partial Class Inventarios_RepApartados Else DdlClientesWS.SelectedValue = CveCliente DdlClientesWS.SelectedText = "Todos" - End If + End If + + DdlClienteTraspasar.SelectedValue = "-1" + DdlClienteTraspasar.SelectedText = "Seleccione" DdlVendedor.SelectedValueExist(CveVendedor) DdlSubProyectos.SelectedValueExist(CveSucursal) @@ -162,12 +174,18 @@ Partial Class Inventarios_RepApartados Dim ObjInventarios As New ClsInventarios If ObjInventarios.ApartadosRep(CveAlmacenApartado, DdlClientesWS.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlPS.SelectedValue.ToEntero, txtFechaI.Text.ToDate, txtFechaF.Text.ToDate) Then - GvDatos.DataSource = ObjInventarios.DtResultados DtApartados = ObjInventarios.DtResultados - GvDatos.DataBind() - UpDatos.Update() End If - ObjInventarios.Dispose() + ObjInventarios.Dispose() + + GvDatos.DataSource = DtApartados + If DdlSubProyectos.SelectedValue.ToEntero() > 0 AndAlso DtApartados.COUNT("CveVendedor", $"CveVendedor={UsuarioActual.CveVendedor}") > 0 Then + GvDatos.Columns(6).Visible = True + LnkTraspasarApartados.Visible = True + End If + GvDatos.DataBind() + UpDatos.Update() + UpTraspasar.Update() End Sub Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound @@ -182,14 +200,17 @@ Partial Class Inventarios_RepApartados End If If e.Row.DBCampo("IDGPO").ToString.ToEntero = 3 Then - + If e.Row.DBCampo("CveVendedor").ToEntero() = UsuarioActual.CveVendedor Then + e.Row.FCTextBox("TxtCantidad").Visible = True + e.Row.FCRangeValidator("RVCantidad").Visible = True + End If End If End If - End Sub - + End Sub + #Region "PDF" - + Private Sub LnkPdf_Click(sender As Object, e As EventArgs) Handles LnkPdf.Click If DtApartados IsNot Nothing Then Dim StrFiltro As New StringBuilder @@ -226,7 +247,229 @@ Partial Class Inventarios_RepApartados Private Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click GvDatos.ExportToExcel("Reporte de Apartados" & Now.ToShortDateString) - End Sub - + End Sub + #End Region + Protected Sub LnkTraspasarApartados_Click(sender As Object, e As EventArgs) + + LtlAlmacen.Text = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveTipoAlmacen:=9).FiltroPrimeroValor("Almacen", $"CveSubProyecto={DdlSubProyectos.SelectedValue.ToEntero()}") + + TxtObs.Text = "" + DdlClienteTraspasar.SelectedValue = "-1" + DdlClienteTraspasar.SelectedText = "Seleccione" + UpTraspasar.Update() + UpGenerarTraspaso.Update() + + RegistraScript("$('#ModalTraspaso').modal('show');") + + End Sub + Protected Sub BtnTraspasar_Click(sender As Object, e As EventArgs) + + If DdlClienteTraspasar.SelectedValue.ToEntero() <= 0 Then + Alert("No se ha seleccionado ningun cliente", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + If Not GvDatos.Rows.Cast(Of GridViewRow).Any(Function(gvr) gvr.FCTextBox("TxtCantidad").Text.ToEntero() > 0) Then + Alert("No se ha seleccionado ningun cliente", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + Dim ErrorMovInv As Boolean = False + Dim Mensaje As StringBuilder = New StringBuilder + + Dim SalidasAlmacen As New List(Of MMovimientoAlmacen) + Dim EntradasAlmacen As New List(Of MMovimientoAlmacen) + + Dim ObjInventario As New ClsInventarios + ObjInventario.IniciaTransacSQL() + + Try + Dim CveClienteTraspasar As Integer = DdlClienteTraspasar.SelectedValue.ToEntero() + Dim CveAlmacenApartado As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveTipoAlmacen:=9).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={DdlSubProyectos.SelectedValue.ToEntero()}").ToEntero() + + Dim DtTraspaso As DataTable = CrearDTTraspasosClientes() + + 'SE VAN A REALIZAR LOS MOVIMIENTOS POR CADA CLIENTE CONSIDERADO + For Each Row As DataRow In DtTraspaso.FiltraParametros("", DistinctColumns:={"CveCliente", "CveVendedor"}).Rows + 'SACA LOS PS A TRASPASAR + Dim DtPSTraspasar As DataTable = DtTraspaso.FiltraParametros($"CveCliente={Row("CveCliente")} AND CveVendedor={Row("CveVendedor")}") + + 'CUADRA LOS LOS PRODUCTOS CON LO QUE SE PUEDE DESAPARTAR + Dim DtDetalleTraspasar As DataTable = CuadrarMovimientosApartado(CveAlmacenApartado, Row("CveCliente").ToString().ToEntero(), Row("CveVendedor").ToString().ToEntero(), DtPSTraspasar, ObjInventario) + + DtPSTraspasar.Dispose() + + Dim MovSalida = GenerarMovimientoAlmacen(CveAlmacenApartado, 8, Row("CveVendedor").ToString().ToEntero(), Row("CveCliente").ToString().ToEntero(), -1, TxtObs.Text.Trim(), DtDetalleTraspasar, ObjInventario, "RepApar/1") + + DtDetalleTraspasar.Dispose() + + ErrorMovInv = MovSalida.CveMovimiento <= 0 + + If Not ErrorMovInv Then + + SalidasAlmacen.Add(MovSalida) + + Dim MovEntrada = GenerarMovimientoAlmacen(CveAlmacenApartado, 9, UsuarioActual.CveVendedor, CveClienteTraspasar, MovSalida.CveMovimiento, TxtObs.Text.Trim(), Nothing, ObjInventario, "RepApar/2") + + ErrorMovInv = MovEntrada.CveMovimiento <= 0 + + If Not ErrorMovInv Then + EntradasAlmacen.Add(MovEntrada) + End If + + End If + + Next + + + If Not ErrorMovInv Then + Mensaje.Append("Se realizó con éxito el traspaso.") + + For Each MovSalida In SalidasAlmacen + Mensaje.AppendFormat("

    Folio de Salida: {0}", MovSalida.Folio, MovSalida.CveMovimiento) + Mensaje.AppendFormat("
    Imprimir Reporte", Encripta(String.Format("OP=Alm&CveMovimiento={0}", MovSalida.CveMovimiento))) + Next + + For Each MovEntrada In EntradasAlmacen + Mensaje.AppendFormat("

    Folio de Entrada: {0}", MovEntrada.Folio, MovEntrada.CveMovimiento) + Mensaje.AppendFormat("
    Imprimir Reporte", Encripta(String.Format("OP=Alm&CveMovimiento={0}", MovEntrada.CveMovimiento))) + Next + + End If + + RegistraScript("$('#ModalTraspaso').modal('hide');") + + Alert(Mensaje.ToString(), If(ErrorMovInv, TipoMensaje.MsgError, TipoMensaje.MsgInformacion)) + + Catch ex As Exception + ErrorMovInv = True + OnError("Ocurrió un error al realizar el traspaso", ex) + End Try + + If ErrorMovInv Then + ObjInventario.RollBack() + Else + ObjInventario.Commit() + End If + ObjInventario.Dispose() + + CargaDatos() + End Sub + Private Function CuadrarMovimientosApartado(CveAlmacenApartado As Integer, CveCliente As Integer, CveVendedor As Integer, DtPSTraspasar As DataTable, ByRef ObjInventarios As ClsInventarios) As DataTable + Dim DtRetorno As DataTable = Nothing + + Dim DtDesapartado As DataTable = Nothing + + If ObjInventarios.DesapartadosGet(CveAlmacenApartado, CveCliente, CveVendedor, UsuarioActual.CveEmpresa) Then + DtDesapartado = ObjInventarios.DtResultados.Copy() + DtRetorno = DtDesapartado.Clone() + End If + + If DtRetorno IsNot Nothing Then + For Each RowCantidad As DataRow In DtPSTraspasar.Rows + Dim Filtro As New StringBuilder + Filtro.AppendFormat("CvePS={0}", RowCantidad("CvePS")) + + 'SI TIENE SERIE LA AGREGA AL FILTRO + If Not String.IsNullOrEmpty(RowCantidad("Serie").ToString()) Then + Filtro.AppendFormat("AND Serie='{0}'", RowCantidad("Serie")) + Else + Filtro.AppendFormat("AND ISNULL(Serie,'') = ''") + End If + + Dim RowDesapartado As DataRow = DtDesapartado.Select(Filtro.ToString()).FirstOrDefault() + RowDesapartado("Cantidad") = RowCantidad("Cantidad") + + DtRetorno.Rows.Add(RowDesapartado.ItemArray) + Next + End If + + Return DtRetorno + End Function + + Private Function CrearDTTraspasosClientes() As DataTable + Dim Dt As New DataTable + + Dt.Columns.Add(New DataColumn("Cantidad", GetType(Integer))) + Dt.Columns.Add(New DataColumn("CvePS", GetType(Integer))) + Dt.Columns.Add(New DataColumn("Serie", GetType(String))) + Dt.Columns.Add(New DataColumn("CveCliente", GetType(Integer))) + Dt.Columns.Add(New DataColumn("CveVendedor", GetType(Integer))) + + For Each GvRow As GridViewRow In GvDatos.Rows.Cast(Of GridViewRow).Where(Function(gvr) gvr.FCTextBox("TxtCantidad").Text.ToEntero() > 0) + Dim Row As DataRow = Dt.NewRow + + Row("Cantidad") = GvRow.FCTextBox("TxtCantidad").Text.ToEntero() + Row("CvePS") = GvRow.DataKey("CvePS").ToEntero() + Row("Serie") = GvRow.DataKey("Serie") + Row("CveCliente") = GvRow.DataKey("CveCliente").ToEntero() + Row("CveVendedor") = GvRow.DataKey("CveVendedor").ToEntero() + + Dt.Rows.Add(Row) + Next + + Return Dt + End Function + + Private Function GenerarMovimientoAlmacen(CveAlmacen As Integer, CveConceptoAlmacen As Integer, CveVendedor As Integer, CveCliente As Integer, CveMovimientoRelacionado As Integer, Obs As String, DtDetalle As DataTable, ObjInventario As ClsInventarios, Modulo As String) As MMovimientoAlmacen + Dim ErrorMovInv As Boolean = False + Dim Retorno As New MMovimientoAlmacen + + Dim CveMovimiento As Integer = -1 + Dim Folio As Integer = -1 + + CveMovimiento = ObjInventario.AddMovimiento(CveAlmacen, CveConceptoAlmacen, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, + -1, -1, -1, Observaciones:=Obs, + MovimientoFijo:=True, CveMovimientoRelacionado:=CveMovimientoRelacionado, CveVendedor:=CveVendedor, CveCliente:=CveCliente, Modulo:=Modulo) + Folio = ObjInventario.Folio + + If Not CveMovimiento > 0 Then + ErrorMovInv = True + End If + + 'SI ES MOVIMIENTO DE SALIDA TOMA DE LA TABLA DONDE SE CUADRARON LOS MOVIMIENTOS + If Not ErrorMovInv AndAlso DtDetalle IsNot Nothing AndAlso CveMovimientoRelacionado <= 0 AndAlso CveConceptoAlmacen = 8 Then + For Each Dr As DataRow In DtDetalle.Rows + If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString().ToEntero(), Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal(), -1, CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString().ToEntero(), Serie:=Dr("Serie").ToString(), Lote:=Dr("Lote").ToString(), FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero) Then + ErrorMovInv = True + Exit For + End If + Next + 'SI ES MOVIMIENTO DE ENTRADA TOMA LOS DATOS DEL MOVIMIENTO DE SALIDA + ElseIf Not ErrorMovInv AndAlso DtDetalle Is Nothing AndAlso CveMovimientoRelacionado > 0 AndAlso CveConceptoAlmacen = 9 Then + Dim DtMovimientoDetalle As DataTable = Nothing + + If ObjInventario.GetMovimientosDetalle(CveMovimientoRelacionado, UsuarioActual.CveEmpresa) Then + DtMovimientoDetalle = ObjInventario.DtResultados.Copy() + Else + ErrorMovInv = True + End If + + If Not ErrorMovInv AndAlso DtMovimientoDetalle IsNot Nothing Then + For Each Dr As DataRow In DtMovimientoDetalle.Rows + If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString().ToEntero(), Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero) Then + ErrorMovInv = True + Exit For + End If + Next + End If + + DtMovimientoDetalle.Dispose() + End If + + If Not ErrorMovInv Then + Retorno.CveMovimiento = CveMovimiento + Retorno.Folio = Folio + Retorno.CveConcepto = CveConceptoAlmacen + End If + + Return Retorno + End Function +End Class + +Public Class MMovimientoAlmacen + Public Property CveMovimiento As Integer + Public Property Folio As Integer + Public Property CveConcepto As Integer End Class \ No newline at end of file From c871c61a2d3af095de6e224c6981669bf467b8ab Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Fri, 9 Oct 2020 12:59:51 -0700 Subject: [PATCH 6/8] Quitar facturacion de sucursal de E141 --- Ventas/Ventas.aspx.vb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index f66c6c5ef..fa4571f56 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -5263,7 +5263,7 @@ Partial Class Ventas DdlSucursalCliente.DataBind() 'SI UTILIZA EL RFC GENERICO PERMITE FACTURAR SUCURSAL - If (CveVenta <= 0 OrElse NuevaFactura = 1) AndAlso LblRFC.Text.Trim() = "XAXX010101000" Then + If (Not UsuarioActual.CveEmpresa.Contiene(141)) AndAlso (CveVenta <= 0 OrElse NuevaFactura = 1) AndAlso LblRFC.Text.Trim() = "XAXX010101000" Then HabilitarFacturacionSucursal() End If @@ -5663,7 +5663,7 @@ Partial Class Ventas End If 'SI EL CLIENTE TIENE RFC GENERICO Y LA SUCURSAL TIENE RFC DEBE FACTURAR LA SUCURSAL - If LblRFC.Text.Trim() = "XAXX010101000" AndAlso Not String.IsNullOrEmpty(ObjCliente.DtResultados.Rows(0)("RFC").ToString()) Then + If (Not UsuarioActual.CveEmpresa.Contiene(141)) AndAlso LblRFC.Text.Trim() = "XAXX010101000" AndAlso Not String.IsNullOrEmpty(ObjCliente.DtResultados.Rows(0)("RFC").ToString()) Then Me.FacturarSucursal = True LtlTitleRFCSucursal.Text = "RFC:" From 28b8e96dee2dca65c5eabcf4e3e813dbed89991a Mon Sep 17 00:00:00 2001 From: Rakcsle Supertramp Date: Fri, 9 Oct 2020 13:25:35 -0700 Subject: [PATCH 7/8] Mostrar complementos de Egresos --- Bancos/IE.aspx | 2 +- Bancos/IE.aspx.vb | 30 +++++++++++++++++++++++------- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/Bancos/IE.aspx b/Bancos/IE.aspx index c5e19185d..574ec5150 100644 --- a/Bancos/IE.aspx +++ b/Bancos/IE.aspx @@ -1291,7 +1291,7 @@
    diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index 503feacc6..663b0e342 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -1945,7 +1945,7 @@ Partial Class Bancos_IE ObjOtrosPagos.Add(New CFDINominaOtrosPagos With {.TipoOtroPago = "003", .Clave = "003", .Concepto = "Viáticos (entregados al trabajador).", - .Importe = TxtImporte.Text.ToString.ToDouble + .Importe = TxtImporte.Text.ToString.ToDecimal } ) If ObjOtrosPagos IsNot Nothing AndAlso ObjOtrosPagos.Count > 0 Then cfdi.Nomina.OtrosPagos = ObjOtrosPagos @@ -5678,15 +5678,31 @@ Partial Class Bancos_IE Protected Sub GvComplementoPagos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvComplementoPagos.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then - e.Row.Cells(3).Text = String.Format("", Encripta(String.Format("OP=CompP&EXT=xml&SerieFolio={0}&CVECOMPLEMENTOPAGO={1}&CVEIE={2}", e.Row.DBCampo("SerieFolio"), e.Row.DBCampo("CveComplementoPago"), e.Row.DBCampo("CveIE")))) - e.Row.Cells(4).Text = String.Format("", Encripta(String.Format("OP=CompP&EXT=pdf&SerieFolio={0}&CVECOMPLEMENTOPAGO={1}&CVEIE={2}", e.Row.DBCampo("SerieFolio"), e.Row.DBCampo("CveComplementoPago"), e.Row.DBCampo("CveIE")))) - If e.Row.DataKey("Estatus").Contiene("1", "3") Then - e.Row.FCLinkButton("LnkCancelarComplemetno").Visible = True - Else - e.Row.FCLinkButton("LnkCancelarComplemetno").Visible = False + If e.Row.DataKey("Tipo") = "Ing" Then + e.Row.Cells(3).Text = String.Format("", Encripta(String.Format("OP=CompP&EXT=xml&SerieFolio={0}&CVECOMPLEMENTOPAGO={1}&CVEIE={2}", e.Row.DBCampo("SerieFolio"), e.Row.DBCampo("CveComplementoPago"), e.Row.DBCampo("CveIE")))) + e.Row.Cells(4).Text = String.Format("", Encripta(String.Format("OP=CompP&EXT=pdf&SerieFolio={0}&CVECOMPLEMENTOPAGO={1}&CVEIE={2}", e.Row.DBCampo("SerieFolio"), e.Row.DBCampo("CveComplementoPago"), e.Row.DBCampo("CveIE")))) + + If e.Row.DataKey("Estatus").Contiene("1", "3") Then + e.Row.FCLinkButton("LnkCancelarComplemetno").Visible = True + Else + e.Row.FCLinkButton("LnkCancelarComplemetno").Visible = False + End If + + ElseIf e.Row.DataKey("Tipo") = "Egs" Then + + e.Row.Cells(3).Text = String.Format("", Encripta(String.Format("OP=Fact&EXT=xml&CveFactura={0}&RFC={1}", e.Row.DBCampo("CveFactura"), e.Row.DBCampo(("RFCde").ToString.Replace("&", "%26%"))))) + e.Row.Cells(4).Text = String.Format("", Encripta(String.Format("OP=Fact&EXT=pdf&CveFactura={0}&RFC={1}", e.Row.DBCampo("CveFactura"), e.Row.DBCampo("RFCde").ToString.Replace("&", "%26%")))) + + GvComplementoPagos.Columns(6).Visible = False + GvComplementoPagos.Columns(7).Visible = False + GvComplementoPagos.Columns(8).Visible = False + End If + + + End If End Sub From 6df86a6ba6fb56a2693a8eb283808bf70313d663 Mon Sep 17 00:00:00 2001 From: Rakcsle Supertramp Date: Fri, 9 Oct 2020 13:53:25 -0700 Subject: [PATCH 8/8] =?UTF-8?q?Fluctuaciones=20tama=C3=B1o=20Concepto=20y?= =?UTF-8?q?=20subproyecto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bancos/FluctuacionCambiaria.aspx | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Bancos/FluctuacionCambiaria.aspx b/Bancos/FluctuacionCambiaria.aspx index 56c76c41c..93673c3d1 100644 --- a/Bancos/FluctuacionCambiaria.aspx +++ b/Bancos/FluctuacionCambiaria.aspx @@ -333,7 +333,7 @@
    -
    +
    @@ -341,7 +341,7 @@
    -
    +
    @@ -385,7 +385,7 @@
    -
    +
    @@ -393,7 +393,7 @@
    -
    +
    @@ -443,7 +443,7 @@
    -
    +
    @@ -451,7 +451,7 @@
    -
    +
    @@ -492,7 +492,7 @@
    -
    +
    @@ -500,7 +500,7 @@
    -
    +
    @@ -539,7 +539,7 @@
    -
    +
    @@ -547,7 +547,7 @@
    -
    +