This commit is contained in:
2024-08-15 12:52:45 -07:00
12 changed files with 62507 additions and 287 deletions

View File

@@ -555,6 +555,7 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState
cevent.id = dr("CveContrato").ToString.ToEntero
cevent.title = If(dr("CodigoAF").ToString.Trim.Length > 0, $"#{dr("CodigoAF").ToString}-{dr("DescripcionContrato").ToString}", $"-{dr("DescripcionContrato").ToString}")
cevent.description = dr("DescripcionContrato").ToString
cevent.start = String.Format("{0:s}", dr("FechaInicial").ToString.ToDateTime)
cevent.end = If(tipoVista = "fecha", String.Format("{0:s}", dr("FechaInicial").ToString.ToDateTime.AddHours(1)), String.Format("{0:s}", dr("FechaFinal").ToString.ToDateTime))
cevent.FechaFinal = String.Format("{0:s}", dr("FechaFinal").ToString.ToDateTime)

View File

@@ -811,6 +811,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
Dim retorno As String = ""
Dim DtRetorno As DataTable = Nothing
Dim Estatus = IfNull(context.Request("estatus"), "-1").ToString.ToEntero
Dim filtro As String = ""
@@ -823,7 +824,6 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
filtro = " Estatus = 'Inactivo' "
End If
Dim usuario As Usuario = UsuarioActual(context)
Dim CveEmpresa As Integer
If IsNothing(usuario) Then
@@ -998,6 +998,12 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
End If
If usuario.Empresa.Funcionalidad(578) = "1" AndAlso DtPSRetorno IsNot Nothing Then
'solo muestar productos con existencia.
DtPSRetorno = DtPSRetorno.FiltraParametros("ExistenciaTotal > 0")
End If
If DtPSRetorno IsNot Nothing AndAlso DtPSRetorno.Columns("ExistenciaTotal") IsNot Nothing Then DtPSRetorno.Columns.Remove("ExistenciaTotal")
If UsaGlobal Then
'se recarga el global, y el clspaginas, son los unicos 2 lugares
'Dim AppNombre As String = String.Format("GlobalDTPSSimplificado-{0}", CveEmpresa)

View File

@@ -345,9 +345,6 @@ Partial Class Bancos_PopIEVentas
CargaTipoTransaccion(TipoTransaccion)
CargaCuentas()
Dim dia As Integer = If(UsuarioActual.CveEmpresa = 13, NowADS().Day - 1, NowADS().Day)
Fecha = (dia.ToString + "/" + NowADS().Month.ToString + "/" + NowADS().Year.ToString).ToDate
@@ -1231,7 +1228,6 @@ Partial Class Bancos_PopIEVentas
If CveVenta > 0 Then
If VentaActual IsNot Nothing Then
Dim tipoCambioPago As Decimal = 1
Dim CuentasContablesInvalidas As New StringBuilder
Dim tFecha As Date = TxtFechaDocumento.Text.ToDate
@@ -1250,18 +1246,18 @@ Partial Class Bancos_PopIEVentas
'Pago.TCPago = 1 / TxtTipoCambio.Text.ToDecimal
ImportePagadoVenta = (ImportePagado / TxtTipoCambio.Text.ToDecimal).RoundSQL
ElseIf Pago.CveMonedaPago = 2 AndAlso VentaActual.CveMoneda = 2 Then 'Si la venta viene en Dolares y se va a pagar en DOLARES
Pago.TCPago = TxtTipoCambio.Text.ToDecimal
Pago.TCPago = TxtTCDolaresDolares.Text.ToDecimal
ElseIf Pago.CveMonedaPago = 2 AndAlso VentaActual.CveMoneda = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES
Pago.TCPago = TxtTipoCambio.Text.ToDecimal
End If
'If ChkPagarPesos.Checked Then Pago.TCPago = 1 / TxtTipoCambio.Text.ToDecimal
If ChkPagarDolares.Checked Then Pago.TCPago = TxtTipoCambio.Text.ToDecimal
If TxtComision.Text.ToDecimal <> 0 Then Pago.OtroGastoIngreso = TxtComision.Text.ToDecimal Else Pago.OtroGastoIngreso = 0
If TxtComision.Text.ToDecimal <> 0 Then Pago.OtroGastoIngreso = TxtComision.Text.ToDecimal Else Pago.OtroGastoIngreso = 0
Select Case RBLContado.SelectedValue
Case "1" ' Banco
CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, Fecha, TxtFolio.Text.Trim, TxtPagueseA.Text.Trim, ImportePagado, CveMoneda, tipoCambioPago, TxtObservaciones.Text.Trim, "",
Select Case RBLContado.SelectedValue
Case "1" ' Banco
CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, Fecha, TxtFolio.Text.Trim, TxtPagueseA.Text.Trim, ImportePagado, CveMoneda, Pago.TCPago, TxtObservaciones.Text.Trim, "",
True, True, -1, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCuentaTarjeta:=If(DivTarjeta.Visible, DdlTarjeta.SelectedValue.ToEntero, -1), CveCuentaDeposito:=CveCuentaDeposito,
Referencia:=If(TxtReferenciaCIE.Visible, TxtReferenciaCIE.Text, "-1"), CveCorte:=CveCorte, FechaEmision:=FechaEmision)
If CveIE > 0 Then
@@ -1272,130 +1268,130 @@ Partial Class Bancos_PopIEVentas
Pago.TipoPago = "B"
If MsgError = "" AndAlso AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjMov) Then
MsgError = "No se pudo insertar la póliza"
End If
Else
MsgError = "Ocurrio un Error al registrarse el movimiento bancario."
Inserta = False
MsgError = "No se pudo insertar la póliza"
End If
Else
MsgError = "Ocurrio un Error al registrarse el movimiento bancario."
Inserta = False
End If
Case "2" ' FyE
Pago.ImportePago = ImportePagado
Pago.ImportePagoVenta = ImportePagado - Pago.OtroGastoIngreso
Pago.TipoPago = "FyE"
Pago.CvePersonal = DdlFuncionarioEmpleado.SelectedValue.ToEntero
Pago.Referencia = DdlFuncionarioEmpleado.SelectedItem.ToString
Pago.CvePersonal = DdlFuncionarioEmpleado.SelectedValue.ToEntero
Pago.Referencia = DdlFuncionarioEmpleado.SelectedItem.ToString
If MsgError = "" AndAlso AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjMov) Then
MsgError = "No se pudo insertar la póliza"
End If
If MsgError = "" AndAlso AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjMov) Then
MsgError = "No se pudo insertar la póliza"
End If
Case "3" 'Ingresos x Comprobar
Case "3" 'Ingresos x Comprobar
CveCliente = DdlIngreso.SelectedValue.ToEntero
CveIE = -1
ImportePagado = TxtImporte.Text.Trim.ToDecimal
Pago.ImportePago = ImportePagado
Pago.TipoPago = "I"
CveCliente = DdlIngreso.SelectedValue.ToEntero
CveIE = -1
ImportePagado = TxtImporte.Text.Trim.ToDecimal
Pago.ImportePago = ImportePagado
Pago.TipoPago = "I"
For Each rw As GridViewRow In GvIngresos.Rows
If rw.FCCheckBox("Chk").Checked Then
CveIE = rw.DataKey("CveIE").ToEntero
Pago.CveMonedaPago = rw.DataKey("CveMoneda").ToEntero
Pago.ImportePago = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal
Pago.ImportePagoVenta = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal
Pago.TCPago = rw.DataKey("TipoCambio").ToDecimal
Pago.FechaDocumentoRelacionado = rw.DataKey("FechaDocumento").ToDate
Pago.CveIE = CveIE
Pago.CveClientePago = rw.DataKey("CveCliente").ToEntero
If ChkPagarPesos.Checked Then Pago.TCPago = 1 / rw.DataKey("TipoCambio").ToDecimal
If ChkPagarDolares.Checked Then Pago.TCPago = rw.DataKey("TipoCambio").ToDecimal
For Each rw As GridViewRow In GvIngresos.Rows
If rw.FCCheckBox("Chk").Checked Then
CveIE = rw.DataKey("CveIE").ToEntero
Pago.CveMonedaPago = rw.DataKey("CveMoneda").ToEntero
Pago.ImportePago = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal
Pago.ImportePagoVenta = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal
Pago.TCPago = rw.DataKey("TipoCambio").ToDecimal
Pago.FechaDocumentoRelacionado = rw.DataKey("FechaDocumento").ToDate
Pago.CveIE = CveIE
Pago.CveClientePago = rw.DataKey("CveCliente").ToEntero
If ChkPagarPesos.Checked Then Pago.TCPago = 1 / rw.DataKey("TipoCambio").ToDecimal
If ChkPagarDolares.Checked Then Pago.TCPago = rw.DataKey("TipoCambio").ToDecimal
If AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjMov) Then
MsgError = "No se pudo insertar la póliza"
Else
Exit For
End If
If AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjMov) Then
MsgError = "No se pudo insertar la póliza"
Else
Exit For
End If
Next
End If
Next
Case "4" 'Deudores Diversos
Case "4" 'Deudores Diversos
ImportePagado = TxtImporte.Text.Trim.ToDecimal
'CveProveedor2 = DdlDeudor.SelectedValue.ToEntero
CveIE = -1
If DdlDeudor.SelectedValue.ToEntero <= 0 Then
Alert("Debe especificar el deudor.", TipoMensaje.MsgAdvertencia)
Exit Sub
ImportePagado = TxtImporte.Text.Trim.ToDecimal
'CveProveedor2 = DdlDeudor.SelectedValue.ToEntero
CveIE = -1
If DdlDeudor.SelectedValue.ToEntero <= 0 Then
Alert("Debe especificar el deudor.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
For Each rw As GridViewRow In GvDeudores.Rows
If rw.FCCheckBox("Chk").Checked AndAlso rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal <> 0 Then
Pago.CveIE = rw.DataKey("CveIE").ToEntero
Pago.CveMonedaPago = rw.DataKey("CveMoneda").ToEntero
Pago.ImportePago = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal
Pago.TCPago = rw.DataKey("TipoCambio").ToDecimal
'Pago.CveProveedor = DdlDeudor.SelectedValue.ToEntero
Pago.TipoPago = "DD"
If AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjMov) Then
MsgError = "No se pudo insertar la póliza"
Else
Exit For
End If
End If
Next
For Each rw As GridViewRow In GvDeudores.Rows
If rw.FCCheckBox("Chk").Checked AndAlso rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal <> 0 Then
Pago.CveIE = rw.DataKey("CveIE").ToEntero
Pago.CveMonedaPago = rw.DataKey("CveMoneda").ToEntero
Pago.ImportePago = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal
Pago.TCPago = rw.DataKey("TipoCambio").ToDecimal
'Pago.CveProveedor = DdlDeudor.SelectedValue.ToEntero
Pago.TipoPago = "DD"
If AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjMov) Then
MsgError = "No se pudo insertar la póliza"
Else
Exit For
End If
Case "5" 'Compras
ImportePagado = TxtImporte.Text.Trim.ToDecimal
CveIE = -1
For Each rw As GridViewRow In GvCompras.Rows
If rw.FCCheckBox("Chk").Checked AndAlso rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal <> 0 Then
Pago.CveMonedaPago = 1
Pago.ImportePago = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal
Pago.ImportePagoVenta = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal
Pago.TipoPago = "Compra"
If AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjMov) Then
MsgError = "No se pudo insertar la póliza"
End If
Next
Case "5" 'Compras
If MsgError = "" Then
Dim CompraActual As New Compra() With {.CveCompra = rw.DataKey("CveCompra").ToEntero, .ProveedorNombre = NombreCliente, .SerieFolio = rw.DataKey("SerieFolio"), .CveProveedor = rw.DataKey("CveProveedor").ToEntero, .IVA = rw.DataKey("IVA").ToDecimal, .IEPS = rw.DataKey("IEPS").ToDecimal, .RetIVA = rw.DataKey("RetIVA").ToDecimal, .RetISR = rw.DataKey("RetISR").ToDecimal, .Total = rw.DataKey("Total").ToDecimal, .PorcentajeIVA = rw.DataKey("PorcentajeIVA").ToDecimal, .CveSubProyecto = rw.DataKey("CveSubProyecto").ToEntero, .CveMoneda = rw.DataKey("CveMoneda").ToEntero, .CveTipoConceptoProveedor = rw.DataKey("CveTipoConcepto").ToEntero}
Dim PagoCompra As New CompraPago
ImportePagado = TxtImporte.Text.Trim.ToDecimal
CveIE = -1
For Each rw As GridViewRow In GvCompras.Rows
If rw.FCCheckBox("Chk").Checked AndAlso rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal <> 0 Then
Pago.CveMonedaPago = 1
Pago.ImportePago = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal
Pago.ImportePagoVenta = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal
Pago.TipoPago = "Compra"
If AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjMov) Then
PagoCompra.CveMonedaPago = rw.DataKey("CveMoneda").ToEntero
PagoCompra.ImportePago = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal
PagoCompra.TCPago = rw.DataKey("TipoCambio").ToDecimal
PagoCompra.CveProveedor = rw.DataKey("CveProveedor").ToEntero
PagoCompra.CveVentaRelacionada = CveVenta
PagoCompra.TipoPago = "Venta"
If AplicaPrePolizaPagoCompra(CompraActual, PagoCompra, CvePrePoliza, ObjMov) Then
MsgError = "No se pudo insertar la póliza"
End If
If MsgError = "" Then
Dim CompraActual As New Compra() With {.CveCompra = rw.DataKey("CveCompra").ToEntero, .ProveedorNombre = NombreCliente, .SerieFolio = rw.DataKey("SerieFolio"), .CveProveedor = rw.DataKey("CveProveedor").ToEntero, .IVA = rw.DataKey("IVA").ToDecimal, .IEPS = rw.DataKey("IEPS").ToDecimal, .RetIVA = rw.DataKey("RetIVA").ToDecimal, .RetISR = rw.DataKey("RetISR").ToDecimal, .Total = rw.DataKey("Total").ToDecimal, .PorcentajeIVA = rw.DataKey("PorcentajeIVA").ToDecimal, .CveSubProyecto = rw.DataKey("CveSubProyecto").ToEntero, .CveMoneda = rw.DataKey("CveMoneda").ToEntero, .CveTipoConceptoProveedor = rw.DataKey("CveTipoConcepto").ToEntero}
Dim PagoCompra As New CompraPago
PagoCompra.CveMonedaPago = rw.DataKey("CveMoneda").ToEntero
PagoCompra.ImportePago = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal
PagoCompra.TCPago = rw.DataKey("TipoCambio").ToDecimal
PagoCompra.CveProveedor = rw.DataKey("CveProveedor").ToEntero
PagoCompra.CveVentaRelacionada = CveVenta
PagoCompra.TipoPago = "Venta"
If AplicaPrePolizaPagoCompra(CompraActual, PagoCompra, CvePrePoliza, ObjMov) Then
MsgError = "No se pudo insertar la póliza"
End If
End If
End If
Next
Case Else
'NO SE HA DEFINIDO PARA FUNCIONARIO Y EMPLEADO
If RBLContado.SelectedValue <> "2" Then
MsgError = "No se ha especificada opcion."
End If
End Select
Next
Case Else
'NO SE HA DEFINIDO PARA FUNCIONARIO Y EMPLEADO
If RBLContado.SelectedValue <> "2" Then
MsgError = "No se ha especificada opcion."
End If
End Select
If MsgError = "" Then
If MsgError = "" Then
If MsgError = "" AndAlso ObjMov.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual, Opcion:=3) Then
If ObjMov.ValorPolizaDescuadre > 0 Then
MsgError = ObjMov.MensajePolizaDescuadre
End If
If MsgError = "" AndAlso ObjMov.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual, Opcion:=3) Then
If ObjMov.ValorPolizaDescuadre > 0 Then
MsgError = ObjMov.MensajePolizaDescuadre
End If
Else
MsgError = "No se pudo insertar la poliza detalle"
End If
Else
MsgError = "No se pudo insertar la poliza detalle"
End If
Else
End If
Else
MsgError = "venta no identificada"
End If
Else

62241
Bin/MailKit.xml Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1266,7 +1266,7 @@
<asp:UpdatePanel ID="UpInv" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvInv" runat="server" DataKeyNames="Total,PU,Cantidad,CvePS" AutoGenerateColumns="false" GridLines="None" EmptyDataText="Aun no hay registros."
<asp:GridView ID="GvInv" runat="server" DataKeyNames="Total,PU,Cantidad,CvePS,Descuento" AutoGenerateColumns="false" GridLines="None" EmptyDataText="Aun no hay registros."
ShowHeaderWhenEmpty="True" CssClass="table table-striped table-hover Widthall mysmallbtn" Visible="false">
<Columns>
<asp:TemplateField ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center">
@@ -1340,7 +1340,7 @@
<ItemTemplate>
<asp:DropDownList runat="server" ID="Ddlnewps" DataTextField="PSCodigo" DataValueField="CvePS" CssClass="form-control input-sm select2me" Width="100%"></asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>--%>
</asp:TemplateField>--%>
</Columns>
</asp:GridView>

View File

@@ -6430,7 +6430,8 @@ Partial Class Compras_Compras
For Each gvRowInv As GridViewRow In GvInv.Rows
Dim gvCantidad As Decimal = gvRowInv.FCTextBox("TbCantidad").Text.ToDecimal
Dim gvPU As Decimal = gvRowInv.DataKey("PU").ToDecimal
ImpPrepoliza = ImpPrepoliza + (gvCantidad * gvPU)
Dim gvDescuento As Decimal = gvRowInv.DataKey("PU").ToDecimal
ImpPrepoliza = (ImpPrepoliza + (gvCantidad * gvPU)) - gvDescuento
Next
ImpPrepolizaMN = ImpPrepoliza * tipoCambioActual * Multiplicador

View File

@@ -221,7 +221,8 @@
<asp:ListItem Text="Media" Value="2"></asp:ListItem>
<asp:ListItem Text="Baja" Value="3"></asp:ListItem>
</asp:DropDownList>
<asp:DropDownList ID="DdlSubProyectoGral" Visible="false" CssClass="form-control select2me" runat="server" Width="85%" DataTextField="SubProyecto" DataValueField="CveSubProyecto" OnSelectedIndexChanged ="DdlSubProyectoGral_SelectedIndexChanged" AutoPostBack="true">
<asp:DropDownList ID="DdlSubProyectoGral" Visible="false" CssClass="form-control select2me" runat="server" Width="85%" DataTextField="SubProyecto" DataValueField="CveSubProyecto"
OnSelectedIndexChanged ="DdlSubProyectoGral_SelectedIndexChanged" AutoPostBack="true">
<asp:ListItem Selected="True" Text="-" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
@@ -492,12 +493,7 @@
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtPorcentajeProntoPago" ValidChars="1234567890." />
</td>
</tr>
<tr id="TrEdicionMasiva" runat="server" visible="false">
<td><b>Edición Masiva:</b></td>
<td>
<asp:Button runat="server" ID="BtnEdicionMasiva" Text="Editar" CssClass="btn btn-primary" OnClick="BtnEdicionMasiva_Click" />
</td>
</tr>
@@ -808,7 +804,7 @@
Producto o Servicio(<asp:HyperLink ID="HplPS" NavigateUrl="/Ventas/CatPS.aspx" runat="server">+</asp:HyperLink>)</th>
<th scope="col">Unidad</th>
<th scope="col">Observación</th>
<th scope="col">
<th scope="col" runat="server" id="TdProyectoSubPrpyecto">
<asp:Label ID="TtituloProyecto" Text="" runat="server" />
<asp:Label ID="TituloSubProyecto" Text="" runat="server" />
</th>
@@ -854,7 +850,7 @@
</td>
<td>
<asp:TextBox ID="TxtObsPS" CssClass=" form-control input-sm txtobs" runat="server" Rows="2" TextMode="MultiLine" MaxLength="750"></asp:TextBox></td>
<td>
<td runat="server" id="TdProyectoSubPrpyectoDdl">
<asp:DropDownList ID="DdlProyecto" CssClass=" form-control input-sm select2me" runat="server" AppendDataBoundItems="true" Style="width: 100%; max-width: 600px;" AutoPostBack="true" DataTextField="Proyecto" DataValueField="CveProyecto">
</asp:DropDownList>
<asp:DropDownList ID="DdlSubProyecto" CssClass=" form-control input-sm select2me" runat="server" OnSelectedIndexChanged="DdlSubProyecto_SelectedIndexChanged" DataTextField="SubProyecto" Style="width: 100%; max-width: 600px;" DataValueField="CveSubProyecto" ValidationGroup="GrpDetalleGuardar">
@@ -1707,6 +1703,11 @@
<ContentTemplate>
<table>
<tr>
<td style="text-align: center;">
<asp:Button runat="server" ID="BtnEdicionMasiva" Text="Edición Masiva" CssClass="btn btn-success" OnClick="BtnEdicionMasiva_Click" Width="170px" />
</td>
</tr>
<tr>
<td style="text-align: center;">
<asp:Panel runat="server" ID="PnlUsuarioAsignado" Visible="False">
Asignar a:
@@ -1716,7 +1717,7 @@
<asp:Panel runat="server" ID="PnlUsuarioYaAsignado" Visible="false" Style="text-align:left;font-size:14px;height:34px;margin-top:10px">
Asignado a:
<asp:Label runat="server" ID="LblUsuarioYaAsignado"/><br /><br />
</asp:Panel>
</asp:Panel>
<asp:Button ID="BtnGuardar" CssClass="btn btn-primary" Style="margin-top: 5px;" runat="server" Text="Guardar" Width="170px" ValidationGroup="GrpGuardar" />
<asp:UpdatePanel runat="server">
<ContentTemplate>

View File

@@ -606,6 +606,23 @@ Partial Class OC_OC
End Property
Private Property EstaEnmodiEdicionMasiva As Boolean
Get
If ViewState("EstaEnmodiEdicionMasiva") Is Nothing Then
ViewState("EstaEnmodiEdicionMasiva") = False
End If
Return Boolean.Parse(ViewState("EstaEnmodiEdicionMasiva").ToString)
End Get
Set(value As Boolean)
ViewState("EstaEnmodiEdicionMasiva") = value
End Set
End Property
#End Region
@@ -727,11 +744,19 @@ Partial Class OC_OC
End If
'temporal
'If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
If UsuarioActual.CveEmpresa = 189 Then
'GlobalDTOCEstatusUsuarios(CveEmpresaActual, UsuarioActual.CveUsuario, TipoOC)
DdlSubProyectoGral.DataSource = GlobalDTOCEstatusUsuarios(CveEmpresaActual, UsuarioActual.CveUsuario, TipoOC).FiltraParametros("", "SubProyecto", DistinctColumns:={"CveSubProyecto", "SubProyecto"})
DdlSubProyectoGral.DataBind()
DdlSubProyectoGral.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
DdlSubProyectoGral.SelectedValueExist(UsuarioActual.CveSubProyecto)
TdProyectoSubPrpyectoDdl.Visible = False
TdProyectoSubPrpyecto.Visible = False
GvD.Columns(4).Visible = False
UPPDetalle.Update()
End If
BtnGeneraContrato.Visible = True : CargaClientesContrato()
@@ -968,7 +993,7 @@ Partial Class OC_OC
If UsuarioActual.CveRol = 1 Then
TrDescuentoEscalonado.Visible = True
TrDescuentoProntoPago.Visible = True
TrEdicionMasiva.Visible = True
BtnEdicionMasiva.Visible = True
End If
End If
@@ -2246,12 +2271,24 @@ Partial Class OC_OC
#Region " AGREGAR "
Protected Sub LbAgregar_Click(sender As Object, e As EventArgs) Handles LbAgregar.Click
'VALIDA CVEPS
If DdlP2.SelectedValue().ToEntero <= 0 Then
Alert("El campo <b>'Producto/Servicio'</b> es necesario, por favor seleccione uno.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
'VALIDA
If TxtDescuento.Text.ToDecimal > 0 AndAlso ((TxtCant.Text.ToDecimal * txtPrecioUnitario.Text.ToDecimal) <= TxtDescuentoAdd.Text.ToDecimal) Then
Alert($"El campo <b>'Descuento'</b> no debe ser mayor o igual al total({(TxtCant.Text.ToDecimal * txtPrecioUnitario.Text.ToDecimal).ToString("###,###,###.00")}).", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
'Valida cantidad en contrato
Dim TieneError As Boolean = False
Dim dttemp As New DataTable ' GlobalDTContratos().FiltraParametros(String.Format("CveSubProyecto = {0}", DdlSubProyecto.SelectedValue.ToString))
@@ -4130,6 +4167,7 @@ Partial Class OC_OC
DtDetalle.AcceptChanges()
CargaDatosDetalles()
ModoEdicionMasiva()
End Sub
@@ -4173,6 +4211,14 @@ Partial Class OC_OC
CveClasificacion = gvr.FCDropDownList("DdlClasificacion").SelectedValue.ToEntero
Clasificacion = gvr.FCDropDownList("DdlClasificacion").SelectedItem.Text
'VALIDA
If Descuento > 0 AndAlso ((Cantidad * Importe) <= Descuento) Then
Alert($"El campo <b>'Descuento'</b> no debe ser mayor o igual al total({(Cantidad * Importe).ToString("###,###,###.00")}).", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
'SE TOMAN VALORES EN CASO DE QUE LA CvePS SEA DIFERENTE DE LA ANTERIOR
Dim CvePSAnterior As Integer = gvr.DataKey("CvePS").ToEntero
PS = gvr.DataKey("PS").ToString
@@ -9387,8 +9433,23 @@ Partial Class OC_OC
Protected Sub BtnEdicionMasiva_Click(sender As Object, e As EventArgs)
If BtnEdicionMasiva.Text = "Editar" Then
BtnEdicionMasiva.Text = "Aplicar"
If BtnEdicionMasiva.Text = "Edición Masiva" Then
EstaEnmodiEdicionMasiva = True
Else
If GvD_RecalculaEdicionMasiva() Then
EstaEnmodiEdicionMasiva = False
End If
End If
ModoEdicionMasiva()
End Sub
Private Sub ModoEdicionMasiva()
If EstaEnmodiEdicionMasiva Then
BtnEdicionMasiva.Text = "Aplicar Edición Masiva"
For Each GvRow As GridViewRow In GvD.Rows
@@ -9401,6 +9462,7 @@ Partial Class OC_OC
GvRow.FCLiteral("LtlObsPS").Visible = False
GvRow.FCLiteral("LtlDescuento").Visible = False
GvRow.FCLabel("LtlImporte").Visible = False
GvRow.FCLinkButton("imgE").Visible = False
'observación, PU, descuento, cantidad
@@ -9408,9 +9470,9 @@ Partial Class OC_OC
Else
GvD_RecalculaEdicionMasiva()
'GvD_RecalculaEdicionMasiva()
BtnEdicionMasiva.Text = "Editar"
BtnEdicionMasiva.Text = "Edición Masiva"
For Each GvRow As GridViewRow In GvD.Rows
GvRow.FCTextBox("TxtEMObsPS").Visible = False
GvRow.FCTextBox("TxtEMCantEdit").Visible = False
@@ -9421,6 +9483,8 @@ Partial Class OC_OC
GvRow.FCLiteral("LtlObsPS").Visible = True
GvRow.FCLiteral("LtlDescuento").Visible = True
GvRow.FCLabel("LtlImporte").Visible = True
GvRow.FCLinkButton("imgE").Visible = True
Next
@@ -9429,12 +9493,30 @@ Partial Class OC_OC
UPPDetalle.Update()
uppEstatus.Update()
uppOpciones.Update()
End Sub
Private Function GvD_RecalculaEdicionMasiva() As Boolean
Private Sub GvD_RecalculaEdicionMasiva()
For Each gvr As GridViewRow In GvD.Rows
Dim Cantidad, Importe, Descuento As Decimal
Cantidad = gvr.FCTextBox("TxtEMCantEdit").Text.Trim.ToDecimal
Importe = gvr.FCTextBox("TxtEMImporteEdit").Text.Trim.ToDecimal
Descuento = gvr.FCTextBox("TxtEMDescuentoEdit").Text.Trim.ToDecimal
Dim PS As String = gvr.DataKey("PS").ToString
Dim Total As Decimal = Importe * Cantidad - Descuento
'VALIDA
If Descuento > 0 AndAlso ((Cantidad * Importe) <= Descuento) Then
Alert($"El producto {PS}, cantidad {Cantidad}, el campo <b>'Descuento'</b> no debe ser mayor o igual al total({(Cantidad * Importe).ToString("###,###,###.00")}).", TipoMensaje.MsgAdvertencia)
Return False
End If
Next
For Each gvr As GridViewRow In GvD.Rows
@@ -9448,8 +9530,7 @@ Partial Class OC_OC
Descuento = gvr.FCTextBox("TxtEMDescuentoEdit").Text.Trim.ToDecimal
Obs = gvr.FCTextBox("TxtEMObsPS").Text.Trim
'SubProyecto, Cantidad, Importe, Descuento, CveOrdenCompra, CveUnidadMedida, CvePresupuestoEgreso, PS,CveClasificacion, CvePS, CveSubProyecto, CveActivoFijo, CodigoAF, TipoDato, Observacion,
'CveOrdenCompraDetalle,CveCompra,IVAPorcentaje,RetIVAPorcentaje,RetISRPorcentaje,IEPSPSPorcentaje,IEPSPSIVAPorcentaje,CantidadNoEditable,CveCultivoCuadroDetalle
'
CveUnidad = gvr.DataKey("CveUnidadMedida").ToEntero
UM = gvr.FCLiteral("LA").Text
@@ -9466,118 +9547,10 @@ Partial Class OC_OC
Dim IEPSPSIVA As Decimal = gvr.DataKey("IEPSPSIVAPorcentaje").ToDecimal
Dim Total As Decimal = Importe * Cantidad - Descuento
'VALORES DEL PS
'CvePS = gvr.FCDropDownList("DdlPS").SelectedValue.ToEntero
'PS = gvr.FCDropDownList("DdlPS").SelectedItem.Text
'Dim DrPS As DataRow = GlobalDTPS(CveEmpresaActual, CvePS:=CvePS).FiltroPrimero("")
'If DrPS Is Nothing Then
' Alert("Ocurrió un error al cargar la información del producto para actualizar. Por favor vuelva a intentar.", TipoMensaje.MsgAdvertencia)
' Exit Sub
'End If
'Dim IvaPS As Decimal = DrPS("IVA").ToString.ToDecimal
'IEPSPS = DrPS("IEPSPorcentaje").ToString.ToDecimal
'IEPSPSIVA = If(DrPS("IEPSGrabaIVA").ToString = "True", DrPS("IEPSPorcentaje").ToString.ToDecimal, 0)
'If DdlProveedores.SelectedValue.ToEntero > 0 Then
' 'Si es Proveedor Extranjero el IVA es 0%
' Dim drProv As DataRow = GlobalDTCompProveedores(CveEmpresaActual, CveProveedor:=DdlProveedores.SelectedValue.ToEntero).FiltroPrimero("")
' If drProv IsNot Nothing Then
' If drProv("CodigoRegimenFiscal").ToString = "626" Then 'simplificado lleva retencion de 1.25 de isr
' RetISR = 0.0125D
' End If
' End If
'End If
'If CvePS <> CvePSAnterior Or Not CveOrdenCompra > 0 Then
' RetISR = DrPS("RetISR").ToString.ToDecimal
' RetIVA = DrPS("RetIVA").ToString.ToDecimal
' If Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2) = 0.08 Then
' RetIVA = RetIVA / 2
' End If
' If IvaPS <> 0 Then IvaPS = -1
'End If
'CveSubProyecto = gvr.FCDropDownList("DdlSubProyectoEdit").SelectedValue.ToEntero
'SubProyecto = gvr.FCDropDownList("DdlSubProyectoEdit").SelectedItem.Text
'CveCultivoCuadroDetalle = gvr.FCDropDownList("DdlCultivosCuadroEdit").SelectedValue.ToEntero
'Cuadro = ""
'If CveCultivoCuadroDetalle > 0 Then
' Cuadro = gvr.FCDropDownList("DdlCultivosCuadroEdit").SelectedItem.Text
'End If
'If UsuarioActual.Empresa.Tipo_CentroCosto = 1 Or UsuarioActual.Empresa.Tipo_CentroCosto = 2 Then
' CveProyecto = -1
' Proyecto = "Seleccione"
'Else
' CveProyecto = gvr.FCDropDownList("DdlProyectoEdit").SelectedValue.ToEntero
' Proyecto = gvr.FCDropDownList("DdlProyectoEdit").SelectedItem.Text
'End If
'If UsuarioActual.Empresa.Funcionalidad(532).Contiene("1", "2") Then
' Dim ObjCon As New ClsContratos
' Dim CvePresupuesto As Integer = 0
' Dim Autorizado As Decimal = 0
' Dim Ejercido As Decimal = 0
' If ObjCon.GetPresupuestos(-1, "-1", CveSubProyecto, 2, -1, UsuarioActual.CveEmpresa) Then
' If ObjCon.DtResultados.Rows.Count > 0 Then
' CvePresupuesto = ObjCon.DtResultados.Rows(0)("CvePresupuesto").ToString.ToEntero
' If CvePresupuesto > 0 Then
' If ObjCon.GetPresupuestosDetalle(CvePresupuesto, -1, UsuarioActual.CveEmpresa) Then
' If ObjCon.DtResultados.FiltraParametros($"CveClasificacion = {CveClasificacion} And Importe > 0").Rows.Count > 0 Then
' Autorizado = ObjCon.DtResultados.FiltraParametros($"CveClasificacion = {CveClasificacion} And Importe > 0").Rows(0)("Importe").ToString.ToDecimal
' End If
' End If
' If ObjCon.GetPresupuestosRep(CvePresupuesto, -1, 1, $"01/09/{NowADS().Year - 1}".ToDate, NowADS(), UsuarioActual.CveEmpresa, CveProyecto,
' CveSubProyecto, UsuarioActual.CveUsuario, CveClasificacion) Then
' If ObjCon.DtResultados.Rows.Count > 0 Then
' Ejercido = ObjCon.DtResultados.Rows(0)("Ejercido").ToString.ToDecimal
' End If
' End If
' End If
' End If
' End If
' ObjCon.Dispose()
' If CvePresupuesto > 0 And Autorizado > 0 Then
' Dim Diferencia As Decimal = (Ejercido + Total) - Autorizado
' If Diferencia > 0 Then
' Alert($"No hay presupuesto disponible:<br/> - Subproyecto <b>{SubProyecto}</b> <br/> - Clasificación <b>{Clasificacion}</b> <br/> se excede por <b>{Diferencia.FormatoNumero}</b>", TipoMensaje.MsgAdvertencia)
' Exit Sub
' End If
' End If
'End If
'Agarra el nuevo AF si se modifico o deja el pasado
'CveActivoFijo = If(gvr.FCHiddenField("HdnCveActivoFijo").Value.ToEntero > 0, gvr.FCHiddenField("HdnCveActivoFijo").Value.ToEntero, HdnEditCveActivoFijo.Value.ToEntero)
'Codigo = If(gvr.FCHiddenField("HdnCodigoAF").Value <> "-1", gvr.FCHiddenField("HdnCodigoAF").Value, HdnEditCodigo.Value)
'HdnEditCveActivoFijo.Value = ""
'HdnEditCodigo.Value = ""
Dim dr As DataRow() = DtDetalle.Select("CveOrdenCompraDetalle = " & gvr.DataKey("CveOrdenCompraDetalle").ToString.ToEntero)
dr(0)("Cantidad") = Cantidad
'dr(0)("CveUnidadMedida") = CveUnidad
'dr(0)("UM") = UM
'dr(0)("CveClasificacion") = CveClasificacion
'dr(0)("Clasificacion") = Clasificacion
'If isWithFamily() Then
' dr(0)("CveSubFamilia") = CveClasificacion
' dr(0)("SubFamilia") = Clasificacion
'End If
'dr(0)("CvePS") = CvePS
'dr(0)("PS") = PS
dr(0)("Observacion") = Obs
'dr(0)("CveSubProyecto") = CveSubProyecto
'dr(0)("SubProyecto") = SubProyecto
'dr(0)("CveProyecto") = CveProyecto
'dr(0)("Proyecto") = Proyecto
dr(0)("Importe") = Importe
dr(0)("Descuento") = Descuento
dr(0)("Total") = Total
@@ -9586,8 +9559,6 @@ Partial Class OC_OC
dr(0)("IEPSPSIVA") = IEPSPSIVA * Total
dr(0)("IEPSPSIVAPorcentaje") = IEPSPSIVA
'If DdlIVA.SelectedValue.ToDecimal = 1 Then dr(0)("IVA") = 0 Else dr(0)("IVA") = IvaPS * Total
'dr(0)("IVAPorcentaje") = If(IvaPS = -1, Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2), 0)
Dim TotalGravado As Decimal = Total
If IEPSPSIVA > 0 Then TotalGravado = Total * (1 + IEPSPSIVA) 'grava para iva, el importe del IEPS
dr(0)("IVA") = Math.Round(dr(0)("IVAPorcentaje").ToString.ToDecimal * TotalGravado, 2)
@@ -9597,13 +9568,6 @@ Partial Class OC_OC
dr(0)("RetISR") = (RetISR * Total).RoundSQL(6)
dr(0)("RetISRPorcentaje") = RetISR
'dr(0)("CveActivoFijo") = CveActivoFijo
'dr(0)("CodigoAF") = Codigo
'dr(0)("CveCultivoCuadroDetalle") = CveCultivoCuadroDetalle
'dr(0)("Cuadro") = Cuadro
'si el tipodato viene de la BD, entonces sufrió una actualización
If dr(0)("TipoDato").ToString.ToEntero = 2 Then dr(0)("TipoDato") = 1
DtDetalle.AcceptChanges()
@@ -9614,8 +9578,9 @@ Partial Class OC_OC
CargaDatosDetalles()
Return True
End Sub
End Function
End Class

View File

@@ -3407,11 +3407,13 @@ Partial Class OS_OrdenesServicios
Dim ProcesoOK As Boolean = True
Dim CveSubProyectoPedido As Integer = -1
Dim CveMoneda As Integer = -1
Dim tCveVendedor As Integer = -1
If ObjVentas.GetVenta(CvePedido, UsuarioActual.CveEmpresa, VerificaAlmacen:=False) Then
Dim DbRowVenta As DataRow = ObjVentas.DtResultados.Copy().Rows(0)
CveMoneda = DbRowVenta("CveMoneda").ToString.ToEntero
CveSubProyectoPedido = DbRowVenta("CveSubProyecto").ToString().ToEntero()
tCveVendedor = DbRowVenta("CveVendedor").ToString.ToEntero
End If
Dim ObjFactura As Modelos.Factura = Modelos.Factura.CrearVentaNueva(UsuarioActual, CveSubProyectoPedido, CveCliente, CveMoneda, "Rem")
@@ -3427,6 +3429,7 @@ Partial Class OS_OrdenesServicios
ObjFactura.Paciente = TxtPacienteModal.Text.Trim
ObjFactura.Episodio = TxtEpisodioModal.Text.Trim
ObjFactura.Alfa1 = TxtFolioRemisionModal.Text.Trim
ObjFactura.CveVendedor = tCveVendedor
Dim TmpDTMat As New DataTable
TmpDTMat.Columns.Add("Consec", GetType(Integer))

View File

@@ -25,59 +25,65 @@ Partial Class Sistemas_PopUpCambiaUsuario
RegistraScript("window.close();")
End If
Dim DtEmp As DataTable = GlobalDTEmpresas(CveEmpresa:=-1).Copy
Dim DtEmp As DataTable = Nothing '= GlobalDTEmpresas(CveEmpresa:=-1, tUsrActual:=UsuarioActual).Copy
Using ObjEmpresas As New ClsSisEmpresas()
If ObjEmpresas.GetEmpresas(-1, "-1", "-1", "-1", "-1") Then
DtEmp = ObjEmpresas.DtResultados
End If
End Using
Dim NombreEmp As String = UsuarioActual.Empresa.Empresa
''condición para ocultar los nombres de las empresas y ponerles "mi empresa de venta (xxx)"
''If UsuarioActual.CveUsuario = 100 Then
''condición para ocultar los nombres de las empresas y ponerles "mi empresa de venta (xxx)"
''If UsuarioActual.CveUsuario = 100 Then
'' Dim customerRow() As Data.DataRow
'' customerRow = DtEmp.Select("")
'' Dim customerRow() As Data.DataRow
'' customerRow = DtEmp.Select("")
'' For Each drt As DataRow In customerRow
'' drt("Empresa") = "Mi Empresa de ventas (" & drt("CveEmpresa") & ")"
'' Next
'' For Each drt As DataRow In customerRow
'' drt("Empresa") = "Mi Empresa de ventas (" & drt("CveEmpresa") & ")"
'' Next
''End If
''End If
CType(Me.Master, BaseMasterPage).EsPopup = True
LblUsuario.Text = String.Format("{0} - {1}", UsuarioActual.Nombre, UsuarioActual.Empresa.Empresa)
CType(Me.Master, BaseMasterPage).EsPopup = True
LblUsuario.Text = String.Format("{0} - {1}", UsuarioActual.Nombre, UsuarioActual.Empresa.Empresa)
DdlEmpresa.DataSource = DtEmp '.FiltraParametros(If(UsuarioActual.CveRol = 1, "CvePlataforma IN (1,2)", $"CvePlataforma={UsuarioActual.Empresa.CvePlataforma}"))
Dim CveEmpresa As String = UsuarioActual.CveEmpresa.ToString()
DdlEmpresa.DataSource = DtEmp '.FiltraParametros(If(UsuarioActual.CveRol = 1, "CvePlataforma IN (1,2)", $"CvePlataforma={UsuarioActual.Empresa.CvePlataforma}"))
Dim CveEmpresa As String = UsuarioActual.CveEmpresa.ToString()
Dim splitedtext As String() = Request.Url.AbsoluteUri.Replace("http://", "").Replace("https://", "").Split("."c)
Dim splitedtext As String() = Request.Url.AbsoluteUri.Replace("http://", "").Replace("https://", "").Split("."c)
If splitedtext.Length > 0 Then
Select Case splitedtext(0).ToUpper()
Case "VSH" : CveEmpresa = "7"
Case "JAM" : CveEmpresa = "119"
Case "COMPUPROVEEDORES" : CveEmpresa = "72"
Case "DNDIFUSA" : CveEmpresa = "80"
Case "SOGO" : CveEmpresa = "8"
Case "BDH" : CveEmpresa = "140"
Case "ECONOLLANTAS" : CveEmpresa = "141"
Case "SERVEC" : CveEmpresa = "153"
Case "CITRUS" : CveEmpresa = "172"
Case "KINO" : CveEmpresa = "173"
End Select
End If
If Request.Url.AbsoluteUri.Contains("sig.agrojam.com.mx") Then
CveEmpresa = "158"
End If
DdlEmpresa.DataBind()
DdlEmpresa.SelectedValue = CveEmpresa
If splitedtext.Length > 0 Then
Select Case splitedtext(0).ToUpper()
Case "VSH" : CveEmpresa = "7"
Case "JAM" : CveEmpresa = "119"
Case "COMPUPROVEEDORES" : CveEmpresa = "72"
Case "DNDIFUSA" : CveEmpresa = "80"
Case "SOGO" : CveEmpresa = "8"
Case "BDH" : CveEmpresa = "140"
Case "ECONOLLANTAS" : CveEmpresa = "141"
Case "SERVEC" : CveEmpresa = "153"
Case "CITRUS" : CveEmpresa = "172"
Case "KINO" : CveEmpresa = "173"
End Select
End If
If Request.Url.AbsoluteUri.Contains("sig.agrojam.com.mx") Then
CveEmpresa = "158"
End If
DdlEmpresa.DataBind()
DdlEmpresa.SelectedValue = CveEmpresa
'DdlRol.DataSource = GlobalDTRoles(DdlEmpresa.SelectedValue.ToEntero)
'DdlRol.DataBind()
'DdlRol.Items.Insert(0, New ListItem("Todos", "-1"))
'DdlRol.DataSource = GlobalDTRoles(DdlEmpresa.SelectedValue.ToEntero)
'DdlRol.DataBind()
'DdlRol.Items.Insert(0, New ListItem("Todos", "-1"))
CargaUsuarios()
'LblUsuario.Text = usuarioactual.
CargaUsuarios()
'LblUsuario.Text = usuarioactual.
End If
End If
End Sub

View File

@@ -425,7 +425,7 @@
<asp:BoundField DataField="ConceptoHistorialBitacora" HeaderText="Campo" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Anterior" HeaderText="Anterior" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Actual" HeaderText="Actual" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Descripcio n" HeaderText="Descripción" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Descripcion" HeaderText="Descripción" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Usuario" HeaderText="Usuario" ItemStyle-HorizontalAlign="Left" />
</Columns>
</asp:GridView>

View File

@@ -786,7 +786,7 @@
$('#<%=TxtCantidadPasajeros.ClientID%>').val(event.CantidadPasajeros);
$('#<%=TxtFolio.ClientID%>').val(event.NumeroContrato);
$('#<%=TxtObservaciones.ClientID%>').val(event.Observaciones);
$('#<%=TxtDescripcion.ClientID%>').val(event.title);
$('#<%=TxtDescripcion.ClientID%>').val(event.description);
$('#<%=TxtUbicacion.ClientID%>').val(event.NombreAcercamiento);
if (esCalendario) {