diff --git a/Bancos/PopIECompras.aspx.vb b/Bancos/PopIECompras.aspx.vb index 565f5c4bf..01a53afc1 100644 --- a/Bancos/PopIECompras.aspx.vb +++ b/Bancos/PopIECompras.aspx.vb @@ -1413,21 +1413,49 @@ Partial Class Bancos_PopIECompras Pago.ImportePago = ImportePagado Pago.CveIE = CveIE - 'If DivTarjeta.Visible AndAlso DdlTarjeta.SelectedValue.ToEntero > 0 Then - ' Dim ObjCreditos As New ClsBancos - ' ObjCreditos.GetTarjetasCreditos(DdlCuenta.SelectedValue.ToEntero, DdlTarjeta.SelectedValue.ToEntero) - ' If ObjCreditos.DtResultados.Rows.Count > 0 AndAlso (ObjCreditos.DtResultados.Rows(0)("IdCtaContableTarjeta").ToString.ToEntero > 0 Or ObjCreditos.DtResultados.Rows(0)("IdCtaContableTarjetaSIG").ToString.ToEntero > 0) Then - ' IdCtaContable = ObjCreditos.DtResultados.Rows(0)("IdCtaContableTarjeta").ToString.ToEntero - ' Else - ' IdCtaContable = CtaProveedor - ' End If - ' ObjCreditos.Dispose() - ' Else - ' IdCtaContable = IdCuentaBancaria - ' End If - If MsgError = "" AndAlso AplicaPrePolizaPagoCompra(CompraActual, Pago, CvePrePoliza, ObjMov) Then MsgError = "No se pudo insertar la póliza" + End If + 'AGREGO PREPOLIZA BANCOS + Dim IdCuenta As Integer = 0 + Dim UsaComplementariaBancos As Boolean = Not UsuarioActual.CveEmpresa.Contiene(7, 11, 122, 145, 13, 83) + Dim ConceptoMovimiento As String = $"{TxtPagueseA.Text.Trim} - {TxtObservaciones.Text} {If(Pago.TCPago > 1, $" TC:{Pago.TCPago}", "")}" + Dim Referencia As String = TxtFolio.Text.Trim + Dim tImporteMN As Decimal = TxtImporte.Text.ToDecimal + Pago.ImportePago = tImporteMN + + If DivTarjeta.Visible AndAlso DdlTarjeta.SelectedValue.ToEntero > 0 Then + Dim ObjCreditos As New ClsBancos + ObjCreditos.GetTarjetasCreditos(DdlCuenta.SelectedValue.ToEntero, DdlTarjeta.SelectedValue.ToEntero) + + If ObjCreditos.DtResultados.Rows.Count > 0 AndAlso (ObjCreditos.DtResultados.Rows(0)("IdCtaContableTarjeta").ToString.ToEntero > 0) Then + IdCuenta = ObjCreditos.DtResultados.Rows(0)("IdCtaContableTarjeta").ToString.ToEntero + End If + + Dim Importe42 As Decimal = Pago.ImportePago + Pago.OtroGastoIngreso + tImporteMN = If(Pago.CveMonedaPago = 2, If(DivTipoCambio.Visible, Importe42 / TxtTipoCambio.Text.ToDecimal * Pago.TCPago, Importe42 * Pago.TCPago), Importe42) + + If MsgError = "" AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, Importe42, tImporteMN, 42, Referencia, ConceptoMovimiento, IdCuenta, CveIE:=CveIE, CveProveedor:=CveProveedor, TipoCambio:=Pago.TCPago, CveSubProyecto:=CveSubProyecto) Then + MsgError = "No se pudo insertar la póliza" + End If + + Else + Dim ImporteME As Decimal = 0 + If Pago.CveMonedaPago = 2 Then ImporteME = Pago.ImportePago + If Not UsaComplementariaBancos And Pago.CveMonedaPago = 2 Then + ImporteME = tImporteMN + tImporteMN = (tImporteMN * Pago.TCPago).RoundSQL + End If + + If MsgError = "" AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePago, tImporteMN, 30, Referencia, ConceptoMovimiento, IdCuenta, CveIE:=CveIE, CveProveedor:=CveProveedor, TipoCambio:=Pago.TCPago, CveSubProyecto:=CveSubProyecto, ImporteME:=ImporteME) Then + MsgError = "No se pudo insertar la póliza" + End If + + If Pago.CveMonedaPago = 2 AndAlso UsaComplementariaBancos Then + If MsgError = "" AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePago, (Pago.ImportePago * Pago.TCPago - Pago.ImportePago).RoundSQL, 204, Referencia, ConceptoMovimiento, IdCuentaBancariaComplementaria, CveIE:=CveIE, CveProveedor:=CveProveedor, ImporteME:=Pago.ImportePago, TipoCambio:=Pago.TCPago, CveSubProyecto:=CveSubProyecto) Then + MsgError = "No se pudo insertar la póliza" + End If + End If End If Case "2" 'FyE diff --git a/Bancos/Transferencias.aspx b/Bancos/Transferencias.aspx index 54bfe794e..701a2ed2c 100644 --- a/Bancos/Transferencias.aspx +++ b/Bancos/Transferencias.aspx @@ -30,7 +30,7 @@ Tipo Movimiento: - + Cheque Emitido Transferencia Bancaria @@ -127,7 +127,12 @@ Paguese - + + + + Observaciones: @@ -138,7 +143,7 @@
- + diff --git a/Bancos/Transferencias.aspx.vb b/Bancos/Transferencias.aspx.vb index e649693cd..1d343190b 100644 --- a/Bancos/Transferencias.aspx.vb +++ b/Bancos/Transferencias.aspx.vb @@ -42,7 +42,9 @@ Partial Class Bancos_Transferencias #End Region Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load + If Not IsPostBack Then + tCveMonedaOrigen = 0 tCveMonedaDestino = 0 If Request("OPC") IsNot Nothing AndAlso IsNumeric(Request("OPC")) Then @@ -70,6 +72,8 @@ Partial Class Bancos_Transferencias TxtFechaDocumento.Text = Now.ToShortDateString + DdlTipoMovto_SelectedIndexChanged(Nothing, Nothing) + End If End Sub @@ -281,20 +285,26 @@ Partial Class Bancos_Transferencias Observaciones = TxtObservaciones.Text.Trim End If - If Opcion = 1 Then + + If Opcion = 1 Then 'ESTO ES TRANSFERENCIA ENTRE CveIE = ObjIE.AddBancos_IE(DdlCuentaDestino.SelectedValue.ToEntero, DdlTipoMovto.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, TxtFolio.Text.Trim, CuentaDestino, ImporteMXOrigen, CveMonedaOrigen, TipoCambio, Observaciones, "", False, False, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) CveIEDestino = CveIE Else + If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then FolioDestino = TxtFolio.Text.Trim If TxtPaguese.Text.Trim <> "" Then CuentaDestino = TxtPaguese.Text.Trim End If - + Else + If DdlTipoMovto.SelectedValue.ToEntero = 1 Then + CuentaDestino = TxtPaguese.Text.Trim + End If End If CveIE = ObjIE.AddBancos_IE(DdlCuentaOrigen.SelectedValue.ToEntero, DdlTipoMovto.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, TxtFolio.Text.Trim, CuentaDestino, TxtImporte.Text.Trim.ToDouble, CveMonedaOrigen, TipoCambio, TxtObservaciones.Text.Trim, "", False, False, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) CveIEDestino = ObjIE.AddBancos_IE(DdlCuentaDestino.SelectedValue.ToEntero, If(DdlTipoMovto.SelectedValue = "2", 8, 3), TxtFechaDocumento.Text.Trim.ToDate, FolioDestino, String.Format("Transferencia Cta: {0}", DdlCuentaOrigen.SelectedItem.Text), ImporteDestino, CveMonedaDestino, TipoCambio, TxtObservaciones.Text.Trim, "", False, False, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + End If Dim CveIEDevolucion As Integer = -1 @@ -636,12 +646,21 @@ Partial Class Bancos_Transferencias Private Sub DdlTipoMovto_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTipoMovto.SelectedIndexChanged + RFVTxtPaguese.Visible = False + If Opcion = 1 Then CargaFolio(DdlCuentaDestino.SelectedValue.ToEntero, DdlTipoMovto.SelectedValue.ToEntero) Else CargaFolio(DdlCuentaOrigen.SelectedValue.ToEntero, DdlTipoMovto.SelectedValue.ToEntero) + + If DdlTipoMovto.SelectedValue.ToEntero = 1 And Opcion <> 1 Then 'CHEQUE ACTIVA EL REQUIRED DE TxtPaguese + RFVTxtPaguese.Visible = True + End If + End If + UPPDatos.Update() + End Sub Protected Sub RBLOpcion_SelectedIndexChanged(sender As Object, e As EventArgs) diff --git a/CRM/RegPrePolizaS.aspx.vb b/CRM/RegPrePolizaS.aspx.vb deleted file mode 100644 index bcb621de3..000000000 --- a/CRM/RegPrePolizaS.aspx.vb +++ /dev/null @@ -1,2083 +0,0 @@ - - -Imports System.Data -Imports Extensiones -Imports System.Linq -Imports System.Web.Services -Imports GemBox.Spreadsheet -Imports Microsoft.Reporting.WebForms -Imports System.IO -Imports iTextSharp.text.pdf - -Partial Class ContabilidadC_RegPrePolizaS - Inherits ClsPaginas - - -#Region "Propiedades" - Public Property ArregloMovs As ArrayList - Get - Return CType(ViewState("ArregloMovs"), ArrayList) - End Get - Set(value As ArrayList) - ViewState("ArregloMovs") = value - End Set - End Property - Public Property DtMovimientos As DataTable - Get - Return CType(ViewState("DtMovimientos"), DataTable) - End Get - Set(value As DataTable) - ViewState("DtMovimientos") = value - End Set - End Property - Public Property DtCuentasContables As DataTable - Get - Return CType(ViewState("DtCuentasContables"), DataTable) - End Get - Set(value As DataTable) - ViewState("DtCuentasContables") = value - End Set - End Property - Public Property TipoPlantilla As Integer - Get - Return CType(ViewState("TipoPlantilla"), Integer) - End Get - Set(value As Integer) - ViewState("TipoPlantilla") = value - End Set - End Property - Public Property CveMoneda As Integer - Get - Return CType(ViewState("CveMoneda"), Integer) - End Get - Set(value As Integer) - ViewState("CveMoneda") = value - End Set - End Property - Private ReadOnly Property CvePrePoliza As Integer - Get - Return ViewState("CvePrePoliza").ToString.ToEntero - End Get - End Property - - 'PARA CREAR IE - Private Property CveConcepto As Integer - Get - Return ViewState("CveConcepto").ToString.ToEntero - End Get - Set(value As Integer) - ViewState("CveConcepto") = value - End Set - End Property - Private Property CveTipoTransaccion As Integer - Get - Return ViewState("CveTipoTransaccion").ToString.ToEntero - End Get - Set(value As Integer) - ViewState("CveTipoTransaccion") = value - End Set - End Property - Private Property CveCuenta As Integer - Get - Return ViewState("CveCuenta").ToString.ToEntero - End Get - Set(value As Integer) - ViewState("CveCuenta") = value - End Set - End Property - Private Property Folio As String - Get - Return ViewState("Folio").ToString - End Get - Set(value As String) - ViewState("Folio") = value - End Set - End Property - Private Property ImporteDocumento As Decimal - Get - Return ViewState("ImporteDocumento").ToString.ToDecimal - End Get - Set(value As Decimal) - ViewState("ImporteDocumento") = value - End Set - End Property - Private Property Observaciones As String - Get - Return ViewState("Observaciones").ToString - End Get - Set(value As String) - ViewState("Observaciones") = value - End Set - End Property - Private Property Beneficiario As String - Get - Return ViewState("Beneficiario").ToString - End Get - Set(value As String) - ViewState("Beneficiario") = value - End Set - End Property - Private Property RowIndex As Integer - Get - Return ViewState("RowIndex").ToString.ToEntero - End Get - Set(value As Integer) - ViewState("RowIndex") = value - End Set - End Property - Private Property Actualizar As Boolean - Get - Return CBool(ViewState("Actualizar").ToString) - End Get - Set(value As Boolean) - ViewState("Actualizar") = value - End Set - End Property - - Private ReadOnly Property CvePeriodo As Integer - Get - Return CType(ViewState("CvePeriodo"), Integer) - End Get - End Property - Private ReadOnly Property CveProyecto As Integer - Get - Return CType(ViewState("CveProyecto"), Integer) - End Get - End Property - Private ReadOnly Property CveSubProyecto As Integer - Get - Return CType(ViewState("CveSubProyecto"), Integer) - End Get - End Property - Private ReadOnly Property CveTurno As Integer - Get - Return CType(ViewState("CveTurno"), Integer) - End Get - End Property - Public Property IndiceGrid As Integer - Get - Return CType(ViewState("IndiceGrid"), Integer) - End Get - Set(value As Integer) - ViewState("IndiceGrid") = value - End Set - End Property - Public Property IdPoliza As Integer - Get - Return CType(ViewState("IdPoliza"), Integer) - End Get - Set(value As Integer) - ViewState("IdPoliza") = value - End Set - End Property - Public Property Tick As String - Get - Return CType(ViewState("Tick"), String) - End Get - Set(value As String) - ViewState("Tick") = value - End Set - End Property - - Public Property CveIE As Integer - Get - Return CType(ViewState("CveIE"), Integer) - End Get - Set(value As Integer) - ViewState("CveIE") = value - End Set - End Property - - Public Property TipoPoliza As String - Get - Return CType(ViewState("TipoPoliza"), String) - End Get - Set(value As String) - ViewState("TipoPoliza") = value - End Set - End Property -#End Region - - Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load - - If Not Page.IsPostBack Then - Tick = DateTime.Now.Ticks.ToString - - CveMoneda = 1 - ViewState("CvePrePoliza") = 0 - ViewState("CvePeriodo") = "0" - CveConcepto = -1 - CveTipoTransaccion = -1 - CveCuenta = -1 - Folio = "-1" - ImporteDocumento = -1 - Observaciones = "-1" - Beneficiario = "-1" - Actualizar = False - IdPoliza = -1 - - - If IfNull(Request("Tipo"), "").ToString = "NOMPROV" Then - DivTipoGasto.Visible = True - ThTipoGasto.Visible = True - CargaTiposGasto() - End If - - If Request("CvePrePoliza") IsNot Nothing AndAlso IsNumeric(Request("CvePrePoliza")) AndAlso Request("CvePrePoliza").ToEntero > 0 Then - ViewState("CvePrePoliza") = Request("CvePrePoliza").ToEntero - CreaDT() - CargaPrePoliza() - If IfNull(Request("Tipo"), "").ToString <> "NOMPROV" Then - GvPrePoliza.Columns(5).Visible = False - DivTG.Visible = False - GvMov.Columns(5).Visible = False - End If - - Exit Sub - Else - CreaDT() - BtnEliminar.Visible = False - LnkExcel.Visible = True - LnkImprimirPDF.Visible = False - End If - - - TipoPlantilla = -1 - If IfNull(Request("Tipo"), "").ToString = "Ing" Then - TipoPlantilla = 1 - LblEncabezado.Text = "Otros Ingresos" - End If - - CargaPlantillas(TipoPlantilla) - - If UsuarioActual.CveRol = 1 Then trNotificar.Visible = True - - CargaConceptos() - CargaSubProyectos() - CargaCuentasContables() - - 'crea tabla temporal - ArregloMovs = New ArrayList - - CargaCuentas() - - 'If Request("CvePeriodo") IsNot Nothing AndAlso IsNumeric(Request("CvePeriodo")) AndAlso Request("CvePeriodo").ToEntero > 0 Then - ' ViewState("CvePeriodo") = Request("CvePeriodo").ToEntero - ' ViewState("CveProyecto") = Request("CveProyecto").ToEntero - ' ViewState("CveSubProyecto") = Request("CveSubProyecto").ToEntero - ' ViewState("CveTurno") = Request("CveTurno").ToEntero - - ' DdlPlantilla.Items.Add(New ListItem("Pago Nomina", "61")) - ' DdlPlantilla.SelectedValue = "61" - ' DdlPlantilla.Enabled = False - ' DivAgregarConceptos.Visible = False - - ' CargaNomina() - - ' RegistraScript("$(document).ready(function () { calculateCargo(); Sys.Application.add_load(function (s, e) { calculateCargo(); }); } );", 1) - ' RegistraScript("$(document).ready(function () { calculateAbono(); Sys.Application.add_load(function (s, e) { calculateAbono(); }); } );", 2) - ' RegistraScript("$(document).ready(function () { comparar(); Sys.Application.add_load(function (s, e) { comparar(); }); } );", 3) - 'End If - - If IfNull(Request("Tipo"), "").ToString <> "NOMPROV" Then - GvPrePoliza.Columns(4).Visible = False - GvMov.Columns(4).Visible = False - End If - - - - End If - - End Sub - - Private Sub CreaDT() - DtMovimientos = New DataTable("Movimientos") - Dim IDMov As DataColumn = DtMovimientos.Columns.Add("IdMov", Type.GetType("System.Int32")) : IDMov.AutoIncrement = True - With DtMovimientos.Columns - .Add("CodigoCuenta", Type.GetType("System.String")) - .Add("Cuenta", Type.GetType("System.String")) - .Add("Referencia", Type.GetType("System.String")) - .Add("Concepto", Type.GetType("System.String")) - .Add("Cargo", Type.GetType("System.Double")) - .Add("Abono", Type.GetType("System.Double")) - .Add("TipoMovto", Type.GetType("System.Int32")) - .Add("EsComodin", Type.GetType("System.Int32")) - .Add("CveConcepto", Type.GetType("System.Int32")) - .Add("CveSubProyecto", Type.GetType("System.Int32")) - .Add("Descripcion", Type.GetType("System.String")) - .Add("CveProveedor", Type.GetType("System.Int32")) - .Add("CvePersonal", Type.GetType("System.Int32")) - .Add("CveCompra", Type.GetType("System.Int32")) - .Add("CveCliente", Type.GetType("System.Int32")) - .Add("CveVenta", Type.GetType("System.Int32")) - .Add("CveClasificacion", Type.GetType("System.Int32")) - .Add("MultipleSubProyecto", Type.GetType("System.Boolean")) - .Add("CveTipoGasto", Type.GetType("System.Int32")) - .Add("CvePrePolizaDetalle", Type.GetType("System.Int32")) - .Add("CveConceptoContable", Type.GetType("System.Int32")) - .Add("IdCtaContable", Type.GetType("System.Int32")) - .Add("ConceptoContable", Type.GetType("System.String")) - .Add("CveCuenta", Type.GetType("System.Int32")) - End With - End Sub - - 'Private Sub CargaNomina() - ' Dim CvePlantilla As Integer = DdlPlantilla.SelectedValue.ToEntero - ' Dim ObjNomina As New ClsNominas - ' Dim ObjConta As New ClsContabilidad - - ' Dim Dt As DataTable = Nothing - ' Dim Cuenta As String = "" - ' Dim Concepto As String = "" - ' Dim IdCuenta As Integer = 0 - ' Dim TipoMovto As Integer - ' Dim CveConcepto As Integer - ' Dim CodigoCuenta As String = "" - ' Dim NombreCuenta As String = "" - ' Dim Referencia As String = "" - ' Dim EsComodin As Integer = 0 - ' DtMovimientos.Clear() - - ' If ObjNomina.GetProvisionNomina(CveProyecto, CveSubProyecto, CveTurno, CvePeriodo, UsuarioActual.CveEmpresa) Then - ' Dt = ObjNomina.DtResultados - - ' For Each drt As DataRow In Dt.Rows - ' Dim dr As DataRow = DtMovimientos.NewRow - - ' If drt("NombreCompleto").ToString = "" AndAlso ObjConta.GetRetCuenta(31, UsuarioActual.CveEmpresa) Then - ' CveConcepto = 98 - ' Cuenta = "Nominas por Pagar" - ' IdCuenta = ObjConta.DtResultados(0)("IdCtaContable").ToString.ToEntero - ' Concepto = "Pago Nomina" - ' Referencia = "Pago Nomina" - ' Else - ' Concepto = drt("NombreCompleto") - ' Referencia = "" - ' CveConcepto = drt("CveConceptoContable").ToString.ToEntero - ' Cuenta = drt("ConceptoContable").ToString - ' IdCuenta = drt("IdCtaContable").ToString.ToEntero - ' End If - - ' Dim drr As DataRow = DtCuentasContables.FiltroPrimero($"Id={IdCuenta}") - ' CodigoCuenta = If(drr IsNot Nothing, drr("CuentaFormato").ToString(), "") - ' NombreCuenta = If(drr IsNot Nothing, drr("Nombre").ToString(), "") - - ' TipoMovto = drt("TipoMovto") - - ' If TipoMovto = 0 Then - ' dr("Cargo") = Math.Abs(drt("Importe").ToString.ToDecimal) - ' dr("Abono") = 0 - ' Else - ' dr("Cargo") = 0 - ' dr("Abono") = Math.Abs(drt("Importe").ToString.ToDecimal) - ' End If - - ' dr("IdCuenta") = IdCuenta - ' dr("CodigoCuenta") = CodigoCuenta & "
" & NombreCuenta - ' dr("Cuenta") = Cuenta - ' dr("Concepto") = Concepto - ' dr("Descripcion") = Concepto - ' dr("Referencia") = Referencia - ' dr("TipoMovto") = TipoMovto - ' dr("EsComodin") = EsComodin - ' dr("CveConcepto") = CveConcepto - ' dr("CveProveedor") = "-1" - ' dr("CveSubProyecto") = drt("CveSubProyecto") - ' dr("CvePersonal") = drt("CvePersonal") - ' dr("CveClasificacion") = drt("CveClasificacion") - ' dr("CveTipoGasto") = drt("CveTipoGasto") - - ' DtMovimientos.Rows.Add(dr) - ' Next - - ' GvMov.DataSource = DtMovimientos - ' GvMov.DataBind() - ' UPMovs.Update() - ' End If - - 'End Sub - - Private Sub CargaPrePoliza() - BtnEliminar.Visible = True - LblEncabezado.Text = "Edición de Póliza" - - Dim ObjContabilidad As New ClsContabilidad - If ObjContabilidad.GetPrePoliza(CvePrePoliza, UsuarioActual.CveEmpresa) Then - Dim dr As DataRow = ObjContabilidad.DtResultados.FiltroPrimero("") - If dr IsNot Nothing Then - DivAgregarConceptos.Visible = False - DdlTipoPoliza.SelectedValue = dr("CveTipoPoliza") - TxtFechaDocumento.Text = dr("Fecha") - TxtConcepto.Text = dr("Concepto") - DivDatosPoliza.Visible = True - TipoPoliza = DdlTipoPoliza.SelectedItem.Text - Folio = dr("FolioPoliza").ToString - - If UsuarioActual.CveRol = 1 OrElse UsuarioActual.TienePermisoProceso(221) Then - 'DivAgregarConceptos.Visible = True - LnkAddConcepto.Visible = True - CargaConceptos() - CargaSubProyectos() - CargaCuentasContables() - End If - - ObjContabilidad.GetContabilizacionDiarioDetalle(CvePrePoliza) - - DtMovimientos = ObjContabilidad.DtResultados.FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa}") - GvPrePoliza.DataSource = DtMovimientos - GvPrePoliza.DataBind() - - If UsuarioActual.CveRol = 1 AndAlso DtMovimientos.COUNT("TC", "TC > 1") > 0 Then - GvPrePoliza.Columns(7).Visible = True - End If - - If DtMovimientos.FiltraParametros("CveConceptoContable IN (2,17)").Rows.Count > 0 Then - LnkComplementoPago.Visible = True - End If - - If UsuarioActual.Empresa.TipoContabilizacion = 1 Then - If dr("FolioPoliza").ToString.ToEntero > 0 Then - divContabilizada.Visible = True - LblFolio.Text = dr("FolioPoliza").ToString - Folio = dr("FolioPoliza").ToString - - End If - Else - If dr("IdPoliza").ToString.ToEntero > 0 Then - HplContabilizada.NavigateUrl = String.Format("RegPoliza.aspx?IdPoliza={0}", dr("IdPoliza")) - divContabilizada.Visible = True - IdPoliza = dr("IdPoliza").ToString.ToEntero - ElseIf TxtTotalCargos.Text.ToDouble = TxtTotalAbonos.Text.ToDouble Then - 'sino está contabilizada, se activa el botón - BtnContabilizar.Visible = True - End If - End If - - divDatosPrincipales.Visible = False - divObservaciones.Visible = False - UPMovs.Visible = False - UPMovs.Update() - UPPDocumento.Update() - UpPrePoliza.Update() - - RegistraScript("comparar();") - - If Request("Tipo") IsNot Nothing AndAlso IsNumeric(Request("Tipo")) AndAlso Request("Tipo").ToEntero = 1 AndAlso UsuarioActual.CveUsuario <> 100 Then - 'For Each row As GridViewRow In GvPrePoliza.Rows - ' row.FCTextBox("TxtCargo").Enabled = False - ' row.FCTextBox("TxtAbono").Enabled = False - 'Next - End If - LnkExcel.Visible = False - LnkImprimirPDF.Visible = True - Else - Alert("El documento solicitado no existe, favor de revisar su búsqueda.", TipoMensaje.MsgAdvertencia) - BtnEliminar.Visible = False - End If - - End If - - ObjContabilidad.Dispose() - UpPoliza.Update() - End Sub - - Private Sub GvPrePoliza_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvPrePoliza.RowDataBound - - If e.Row.RowType = DataControlRowType.DataRow Then - - ''Asignamos los Subproyectos - 'e.Row.FCDropDownList("DdlSubProyecto").DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) - 'e.Row.FCDropDownList("DdlSubProyecto").DataBind() - 'e.Row.FCDropDownList("DdlSubProyecto").Items.Insert(0, New ListItem(" - ", "-1")) - 'e.Row.FCDropDownList("DdlSubProyecto").SelectedValueExist(e.Row.DataKey("CveSubProyecto")) - - 'Asignamos los Tipos de Gasto - 'e.Row.FCDropDownList("DdlTipoGasto").DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa) - 'e.Row.FCDropDownList("DdlTipoGasto").DataBind() - 'e.Row.FCDropDownList("DdlTipoGasto").Items.Insert(0, New ListItem("Sin Asignar", "-1")) - 'e.Row.FCDropDownList("DdlTipoGasto").SelectedValueExist(e.Row.DataKey("CveTipoGasto")) - - 'ASignamos las CuentasContables - 'e.Row.FCDropDownList("DdlCtaContable").DataSource = Session("DtCuentas") - 'e.Row.FCDropDownList("DdlCtaContable").DataBind() - 'e.Row.FCDropDownList("DdlCtaContable").Items.Insert(0, New ListItem("Sin Asignar", "0")) - 'e.Row.FCDropDownList("DdlCtaContable").SelectedValueExist(e.Row.DataKey("IdCtaContable")) - - If e.Row.DataKey("IdCtaContable") > 0 Then - Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", e.Row.DataKey("IdCtaContable"))) - If drr IsNot Nothing Then - e.Row.FCLiteral("DdlCtaContable").Text = drr("CuentaFormato").ToString() + " - " + drr("Nombre").ToString() - End If - End If - - TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + e.Row.FCLiteral("TxtCargo").Text.ToDouble).ToString.FormatoNumero - TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + e.Row.FCLiteral("TxtAbono").Text.ToDouble).ToString.FormatoNumero - - Dim CveConceptoContable As Integer = e.Row.DataKey("CveConceptoContable").ToEntero - - If CveConceptoContable.Contiene(1, 2, 13, 38, 207, 203, 39, 61, 62, 63) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveVenta={0}", e.Row.DataKey("CveVenta")) - If CveConceptoContable.Contiene(5, 6, 17, 18, 14, 19, 25, 26, 60, 234, 235, 240) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Compras/Compras.aspx?CveCompra={0}", e.Row.DataKey("CveCompra")) - If CveConceptoContable.Contiene(68) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}", e.Row.DBCampo("CveMovimientoAlmacen")) - If CveConceptoContable.Contiene(30, 204) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Bancos/IE.aspx?CveIE={0}", e.Row.DBCampo("CveIE")) - - 'e.Row.FCHyperLink("HlReferencia").NavigateUrl = CveConceptoContable - - End If - - If e.Row.RowType = DataControlRowType.Header Then - 'e.Row.FCDropDownList("DdlSubProyectoFiltro").DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) - 'e.Row.FCDropDownList("DdlSubProyectoFiltro").DataBind() - 'e.Row.FCDropDownList("DdlSubProyectoFiltro").Items.Insert(0, New ListItem("Todos", "-1")) - End If - - End Sub - - Private Sub CargaPlantillas(TipoPlantilla As Integer) - - 'GvPlantillas.DataSource = GlobalDTContaPlantillasPolizas(UsuarioActual.CveEmpresa, TipoPlantilla) - 'GvPlantillas.DataBind() - - If UsuarioActual.CveEmpresa.Contiene(120) Then - DdlPlantilla.DataSource = GlobalDTContaPlantillasPolizas(UsuarioActual.CveEmpresa, -1) - DdlPlantilla2.DataSource = GlobalDTContaPlantillasPolizas(UsuarioActual.CveEmpresa, -1) - - Else - DdlPlantilla.DataSource = GlobalDTContaPlantillasPolizas(UsuarioActual.CveEmpresa, TipoPlantilla) - DdlPlantilla2.DataSource = GlobalDTContaPlantillasPolizas(UsuarioActual.CveEmpresa, TipoPlantilla) - - End If - - - DdlPlantilla.DataBind() - DdlPlantilla.Items.Insert(0, New ListItem("Plantilla Personalizada", "53")) - - DdlPlantilla2.DataBind() - DdlPlantilla2.Items.Insert(0, New ListItem("Plantilla Personalizada", "53")) - End Sub - - Private Sub CargaConceptos() - DdlConceptosContables.DataSource = GlobalDTContaConceptosContables(-1) - DdlConceptosContables.DataBind() - End Sub - - Private Sub DdlConceptosContables_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlConceptosContables.SelectedIndexChanged - If DdlConceptosContables.SelectedValue.ToEntero.Contiene(5, 17, 201, 206, 14, 15, 16, 19, 25, 26, 21) Then - CargaProveedores() - DdlProveedores.Visible = True - DdlCompras.Visible = True - Else - DdlProveedores.Visible = False - DdlCompras.Visible = False - End If - - If DdlConceptosContables.SelectedValue.ToEntero.Contiene(28, 29) Then - CargaPersonal() - DdlPersonal.Visible = True - Else - DdlPersonal.Visible = False - End If - If DdlConceptosContables.SelectedValue.ToEntero.Contiene(1, 2, 203, 207, 13, 61, 8, 9, 62, 63, 38, 39, 12, 91) Then - CargaClientes() - DdlClientes.Visible = True - DdlVentas.Visible = True - Else - DdlClientes.Visible = False - DdlVentas.Visible = False - End If - End Sub - - Private Sub DdlProveedores_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlProveedores.SelectedIndexChanged - CargaCompras(DdlProveedores.SelectedValue.ToEntero) - End Sub - - Private Sub DdlClientes_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlClientes.selectedindexchange - CargaVentas(DdlClientes.SelectedValue.ToEntero) - End Sub - - Private Sub CargaSubProyectos() - DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) - DdlSubProyecto.DataBind() - DdlSubProyecto.Items.Insert(0, New ListItem(" - ", "-1")) - DdlSubProyectoFiltroMov.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) - DdlSubProyectoFiltroMov.DataBind() - DdlSubProyectoFiltroMov.Items.Insert(0, New ListItem("Todos", "-1")) - End Sub - - Private Sub CargaCuentasContables() - Dim ObjConta As New ClsContabilidad - If ObjConta.GetCuentas(-1, "-1", 1, UsuarioActual.CveEmpresa) Then - DdlCtaContable.DataSource = ObjConta.DtResultados - DtCuentasContables = ObjConta.DtResultados - End If - ObjConta.Dispose() - DdlCtaContable.DataBind() - DdlCtaContable.Items.Insert(0, New ListItem("Sin Asignar", "0")) - End Sub - - Private Sub CargaTiposGasto() - DdlTipoGasto.DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa) - DdlTipoGasto.DataBind() - DdlTipoGasto.Items.Insert(0, New ListItem("Sin Asignar", "0")) - End Sub - - Private Sub CargaProveedores() - DdlProveedores.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa) - DdlProveedores.DataBind() - DdlProveedores.Items.Insert(0, New ListItem(" - ", "-1")) - End Sub - - Private Sub CargaCompras(CveProveedor As Integer) - If Not DdlConceptosContables.SelectedValue.ToEntero.Contiene(21) Then - Dim ObjCompras As New ClsCompras - - DdlCompras.ClearSelection() - If ObjCompras.GetCompras(-1, "-1", "-1", CveProveedor, -1, UsuarioActual.CveEmpresa) Then - DdlCompras.DataSource = ObjCompras.DtResultados.FiltraParametros("Saldo > 0") - DdlCompras.DataBind() - DdlCompras.Items.Insert(0, New ListItem(" - ", "-1")) - Else - DdlCompras.DataSource = Nothing - DdlCompras.DataBind() - DdlCompras.Items.Insert(0, New ListItem(" - ", "-1")) - End If - ObjCompras.Dispose() - End If - End Sub - - Private Sub CargaClientes() - DdlClientes.setEsWebService(True) - DdlClientes.Attributes.Add("data-metodo", "getcliente") - DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa) - DdlClientes.DataBind() - ' DdlClientes.Items.Insert(0, New ListItem(" - ", "-1")) - End Sub - - Private Sub CargaVentas(CveCliente As Integer) - Dim ObjVentas As New ClsVentas - - DdlVentas.ClearSelection() - If ObjVentas.GetVentas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1", CveCliente, -1, -1, -1, "-1", "-1", "-1", CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then - DdlVentas.DataSource = ObjVentas.DtResultados '.FiltraParametros("Saldo > 0") - DdlVentas.DataBind() - DdlVentas.Items.Insert(0, New ListItem(" - ", "-1")) - Else - DdlVentas.DataSource = Nothing - DdlVentas.DataBind() - DdlVentas.Items.Insert(0, New ListItem(" - ", "-1")) - End If - ObjVentas.Dispose() - End Sub - - Private Sub CargaPersonal() - DdlPersonal.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa) - DdlPersonal.DataBind() - DdlPersonal.Items.Insert(0, New ListItem(" - ", "-1")) - End Sub - - - Protected Sub DdlPlantilla_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPlantilla.SelectedIndexChanged - - TxtTotalAbonos.Text = "" - TxtTotalCargos.Text = "" - - If DdlPlantilla.SelectedValue.ToEntero <= 0 Then - Alert("Seleccione un Movimiento Válido", TipoMensaje.MsgAdvertencia) - DdlPlantilla.SelectedValue = "-1" - Exit Sub - End If - - If DdlPlantilla.SelectedValue.ToEntero = 53 Then 'Plantilla Personalizada - DivAgregarConceptos.Visible = True - Else - DivAgregarConceptos.Visible = False - End If - - - - Dim CvePlantilla As Integer = DdlPlantilla.SelectedValue.ToEntero - - Dim Dt As DataTable = GlobalDTContaPlantillasPolizasDetalle(CvePlantilla).FiltraParametros(String.Format("CveEmpresa={0}", UsuarioActual.CveEmpresa), "Orden") - Dim Cuenta As String = "" - Dim IdCuenta As Integer = 0 - Dim CodigoCuenta As String = "" - Dim NombreCuenta As String = "" - Dim EsComodin As Integer = 0 - DtMovimientos.Clear() - - For Each drt As DataRow In Dt.Rows - - Cuenta = drt("ConceptoContable").ToString - IdCuenta = 0 - CodigoCuenta = "" - NombreCuenta = "" - If drt("IdCtaContable").ToString.ToEntero > 0 Then 'DtCuentasContables - Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", drt("IdCtaContable").ToString)) - If drr IsNot Nothing Then - IdCuenta = drt("IdCtaContable").ToString.ToEntero - CodigoCuenta = drr("CuentaFormato").ToString() - NombreCuenta = drr("Nombre").ToString() - 'Cuenta = drr("Nombre").ToString() - End If - EsComodin = 0 - End If - - Dim dr As DataRow = DtMovimientos.NewRow - - dr("CodigoCuenta") = CodigoCuenta & "
" & NombreCuenta - dr("Cuenta") = Cuenta 'TxtCuentaContable.Text - dr("Referencia") = If(drt("CveConcepto").ToString.Contiene("29", "130"), drt("Personal"), drt("RazonSocial")) - dr("Concepto") = TxtObservaciones.Text - dr("TipoMovto") = If(drt("TipoMovto").ToString = "False", 0, 1) - dr("EsComodin") = EsComodin - dr("CveConcepto") = drt("CveConcepto") - dr("CveSubProyecto") = drt("CveSubProyectoNegativo") - dr("Cargo") = TxtCargo.Text.ToDouble - dr("Abono") = TxtAbono.Text.ToDouble - dr("CveProveedor") = drt("CveProveedor") - dr("CvePersonal") = drt("CvePersonal") - dr("CveClasificacion") = -1 - dr("MultipleSubProyecto") = drt("MultipleSubProyecto") - dr("CveCuenta") = drt("CveCuenta") - 'dr("FolioPoliza") = 0 'drt("FolioPoliza") - - DtMovimientos.Rows.Add(dr) - Next - - - GvMov.DataSource = DtMovimientos - GvMov.DataBind() - UPMovs.Update() - - End Sub - - Protected Sub GvMov_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvMov.RowDataBound - If e.Row.RowType = DataControlRowType.DataRow Then - - e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left - e.Row.Height = Unit.Pixel(1) - e.Row.Cells(0).ToolTip = e.Row.DBCampo("CveCuenta") - - If e.Row.DBCampo("TipoMovto") = "1" Then - e.Row.FCTextBox("TxtAbono").Visible = True - Else - e.Row.FCTextBox("TxtCargo").Visible = True - End If - - e.Row.FCTextBox("TxtAbono").Text = If(e.Row.DBCampo("Abono") = 0, "", e.Row.DBCampo("Abono")) - e.Row.FCTextBox("TxtCargo").Text = If(e.Row.DBCampo("Cargo") = 0, "", e.Row.DBCampo("Cargo")) - e.Row.FCTextBox("TxtConcepto").Text = e.Row.DBCampo("Descripcion") - - If CvePeriodo > 0 Then - e.Row.FCTextBox("TxtCargo").Enabled = False - e.Row.FCTextBox("TxtAbono").Enabled = False - End If - - e.Row.FCDropDownList("DdlSubProyecto").DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) - e.Row.FCDropDownList("DdlSubProyecto").DataBind() - e.Row.FCDropDownList("DdlSubProyecto").Items.Insert(0, New ListItem(" - ", "-1")) - e.Row.FCDropDownList("DdlSubProyecto").SelectedValue = e.Row.DBCampo("CveSubProyecto") - - 'Asignamos los Tipos de Gasto - e.Row.FCDropDownList("DdlTipoGasto").DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa) - e.Row.FCDropDownList("DdlTipoGasto").DataBind() - e.Row.FCDropDownList("DdlTipoGasto").Items.Insert(0, New ListItem("Sin Asignar", "-1")) - e.Row.FCDropDownList("DdlTipoGasto").SelectedValue = e.Row.DBCampo("CveTipoGasto") - - If DdlPlantilla.SelectedValue.ToEntero = 53 Then 'Plantilla Personalizada - e.Row.FCDropDownList("DdlSubProyecto").Enabled = True - e.Row.FCLinkButton("imgD").Visible = True - Else - e.Row.FCDropDownList("DdlSubProyecto").Enabled = False - End If - - If e.Row.DBCampo("MultipleSubProyecto") = "True" Then - e.Row.FCDropDownList("DdlSubProyecto").Enabled = True - End If - - 'Agregamos la opcion para vincular los movimientos bancarios - If e.Row.DataKey("CveConcepto").ToEntero.Contiene(41) Then - Dim ObjMovimientos As New ClsMovimientos - Dim DdlSaldos As DropDownList = e.Row.FCDropDownList("DdlSaldos") - - Select Case e.Row.DataKey("CveConcepto").ToEntero - - 'Acreedores - Case 41 - If (ObjMovimientos.GetAcreedoresSaldosDetalles(-1, CveMoneda, UsuarioActual.CveEmpresa)) Then - DdlSaldos.Visible = True - DdlSaldos.DataSource = ObjMovimientos.DtResultados.FiltraParametros($"CveIE > 0 AND CveProveedor = {e.Row.DataKey("CveProveedor").ToEntero}") - DdlSaldos.DataBind() - DdlSaldos.Items.Insert(0, New ListItem("Seleccione", "-1")) - End If - - End Select - - ObjMovimientos.Dispose() - End If - - If e.Row.DataKey("CveConcepto").ToEntero.Contiene(30) Then - e.Row.FCLinkButton("ImgBancos").Visible = True - - - If CveTipoTransaccion > 0 And CveCuenta > 0 And Folio.Length > 0 And ImporteDocumento > 0 And Beneficiario.Length > 0 Then - e.Row.FCLinkButton("ImgBancos").CssClass = "btn btn-circle btn-sm green" - End If - End If - End If - End Sub - - Protected Sub BtnIEGuardar_Click(sender As Object, e As EventArgs) Handles BtnIEGuardar.Click - Dim TotalCargos, TotalAbonos As Decimal - - If CvePrePoliza > 0 Then - TotalCargos = TxtTotalCargos.Text.ToDecimal - TotalAbonos = TxtTotalAbonos.Text.ToDecimal - Else - For Each Gvr As GridViewRow In GvMov.Rows - TotalCargos += Gvr.FCTextBox("TxtCargo").Text.ToDecimal - TotalAbonos += Gvr.FCTextBox("TxtAbono").Text.ToDecimal - Next - End If - - If Not (TotalCargos = TotalAbonos AndAlso (GvPrePoliza.Rows.Count > 0 Or GvMov.Rows.Count > 0)) Then - Alert($"La suma de los movimientos no son iguales ({TotalCargos}-{TotalAbonos})", TipoMensaje.MsgAdvertencia) - Exit Sub - End If - - If CvePrePoliza > 0 Then - 'Nuevo Modulo Charlie - ActualizarPrePoliza() - Else - Dim MensajeAlert = New StringBuilder - Dim ObjIE As New ClsBancos() - Dim ObjMov As New ClsContabilidad(ObjIE.IniciaTransacSQL) - ' Dim ObjNom As New ClsNominas(ObjIE.IniciaTransacSQL) - Dim Conta As ClsContPAQi = Nothing - Dim IDPoliza As Integer = 0 - Dim MsgError As String = "" - Dim CveIE As Integer - Dim FolioIE As String = "" - - Try - Dim CvePrePoliza As Integer - Dim ConceptoPoliza As String = TxtObservaciones.Text - CvePrePoliza = ObjMov.AddPrePolizas("Contabilidad/RegPrePoliza", DdlPlantilla.SelectedValue.ToEntero, TotalCargos, TotalAbonos, 1, TxtFecha.Text.ToDate, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=DdlTipoPolizaAdd.SelectedValue.ToEntero) - - If CvePrePoliza > 0 Then - Dim alertaContabilizacion As String = "Se enviaron correctamente las siguientes pólizas:

" - Dim idCuentaContabilizacion As Long = 1 - Dim Importe As Double = 0 - Dim TipoMovto As Boolean = False - Dim IdCtaContable As Integer = 0 - - 'Registra movimieno bancario - If CveConcepto = 30 Then - CveIE = ObjIE.AddBancos_IE(CveCuenta, CveTipoTransaccion, TxtFecha.Text, Folio, Beneficiario, ImporteDocumento, CveMoneda, 0, Observaciones, "", False, False, 0, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) - If CveIE < 0 Then MsgError = "No se pudo registrar movimiento bancario" - If ObjIE.GetBancosIE(CveIE, -1, -1, "-1", -1, "-1", "-1", -1, -1, -1, -1, -1, MinFecha, MaxFecha, MinFecha, MaxFecha, MinFecha, MaxFecha, -1, -1, UsuarioActual.CveEmpresa) Then - FolioIE = ObjIE.Folio - End If - End If - - - - 'inserto las compras que voy a pagarDdlSaldos - For Each gvr As GridViewRow In GvMov.Rows - 'If gvr.DataKey("IDCuenta").ToEntero > 0 Then - ' IdCtaContable = gvr.DataKey("IDCuenta") - 'End If - - If gvr.DataKey("TipoMovto").ToDouble > 0 Then - Importe = gvr.FCTextBox("TxtAbono").Text.ToDouble - TipoMovto = True - Else - Importe = gvr.FCTextBox("TxtCargo").Text.ToDouble - TipoMovto = False - End If - - If CveConcepto <> 30 Then - - If CveConcepto = 41 Then - CveIE = gvr.FCDropDownList("DdlSaldos").SelectedValue.ToEntero - Else - CveIE = -1 - End If - - End If - - - If idCuentaContabilizacion = 1 AndAlso (IdCtaContable = 0) Then - idCuentaContabilizacion = 0 - End If - If Importe <> 0 Then - Dim tCveCuenta As Integer = gvr.DataKey("CveCuenta").ToEntero - - 'If gvr.datakey("CveConcepto") = "299" Then - ' tCveCuenta = gvr.DataKey("CveCuenta").ToEntero - 'End If - - If ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, gvr.FCLiteral("LtlReferencia").Text, gvr.DataKey("CveConcepto").ToEntero, gvr.FCTextBox("TxtConcepto").Text, - TxtFecha.Text.ToDate, IdCtaContable, -1, CveSubProyecto:=gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero, CveIE:=CveIE, - CveProveedor:=gvr.DataKey("CveProveedor").ToEntero, CveCompra:=gvr.DataKey("CveCompra").ToEntero, - CvePersonal:=gvr.DataKey("CvePersonal").ToEntero, CveClasificacion:=gvr.DataKey("CveClasificacion").ToEntero, - ImporteMX:=Importe, CveTipoGasto:=gvr.FCDropDownList("DdlTipoGasto").SelectedValue.ToEntero, - CveCliente:=gvr.DataKey("CveCliente").ToEntero, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveCuenta:=tCveCuenta) Then - Else - MsgError = "No se pudo insertar el detalle de la póliza2" - Exit For - End If - End If - Next - - If MsgError = "" AndAlso ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, 1) Then - If ObjMov.ValorPolizaDescuadre > 0 Then - GuardaLogAD($"Contabilidad/RegPrePolizas | Error:{ObjMov.MensajePolizaDescuadre} Diferencia:{ObjMov.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas") - MsgError = ObjMov.MensajePolizaDescuadre - End If - End If - - - 'El movimiento 2 es el de Pago - If ChkAutoConta.Checked AndAlso UsuarioActual.Empresa.Funcionalidad(200) = "1" AndAlso MsgError = "" Then - If idCuentaContabilizacion > 0 Then - If ObjMov.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then - - 'MENSAJE PRINCIPAL - MensajeAlert.AppendFormat("

Folio de Salida: {1}", ObjMov.ContaIdPoliza, ObjMov.ContaFolio) - 'Alert(MensajeAlert.ToString, ModExtensiones.TipoMensaje.MsgInformacion) - Else - Alert("Ocurrio un error al contabilizar, pongase en contacto con Soporte Técnico") - End If - Else - Alert("No se puede contabilizar la Prepoliza debido a que una o mas cuentas son inválidas") - End If - Else - MensajeAlert.AppendFormat("

Folio: {1}", CvePrePoliza, ObjMov.ContaFolio) - End If - - Else - MsgError = "No se pudo insertar la póliza" - End If - Catch ex As Exception - MsgError = "Error" - End Try - - If MsgError = "" Then - 'MENSAJE IE - If CveIE Then - MensajeAlert.AppendFormat("

Folio Bancario: {1}", CveIE, FolioIE) - Alert(MensajeAlert.ToString, ModExtensiones.TipoMensaje.MsgInformacion, "window.location.reload()") - Else - Alert(If(MensajeAlert.ToString = "", "Se registro con exito.", MensajeAlert.ToString), TipoMensaje.MsgInformacion, "window.location.reload()") - End If - - ObjIE.Commit() - If Conta IsNot Nothing Then Conta.Commit() - - UPPDocumento.Update() - - TxtObservaciones.Text = "" - GvMov.DataBind() - TxtFecha.Text = "" - TxtObservaciones.Text = "" - Else - Alert(MsgError.ToString, ModExtensiones.TipoMensaje.MsgError) - ObjIE.RollBack() - If Conta IsNot Nothing Then Conta.RollBack() - End If - - ObjIE.Dispose() - ObjMov.Dispose() - If Conta IsNot Nothing Then Conta.Dispose() - End If - End Sub - - Private Sub ActualizarPrePoliza() - - Dim OcurrioError As Boolean = False - Dim ObjContabilidad As New ClsContabilidad - ObjContabilidad.IniciaTransacSQL() - - ObjContabilidad.UpdatePrePoliza(MinFecha, -1, DdlTipoPoliza.SelectedValue.ToEntero, -1, CvePrePoliza, UsuarioActual.CveEmpresa, Concepto:=TxtConcepto.Text, FechaPoliza:=TxtFechaDocumento.Text.ToDate, CveUsuarioModifico:=UsuarioActual.CveUsuario) - - For Each row As GridViewRow In GvPrePoliza.Rows - If row.DataKey("CvePrePolizaDetalle").ToEntero > 0 Then - If row.FCCheckBox("chkModificado").Checked Then - If Not ObjContabilidad.UpdatePrePolizasDetalle(row.DataKey("CvePrePolizaDetalle").ToEntero, row.FCLiteral("TxtConcepto").Text, row.DataKey("CveSubProyecto").ToEntero, - row.DataKey("IdCtaContable").ToEntero, If(row.FCLiteral("TxtCargo").Text.ToDecimal <> 0, False, True), If(row.FCLiteral("TxtCargo").Text.ToDecimal <> 0, - row.FCLiteral("TxtCargo").Text.ToDecimal, row.FCLiteral("TxtAbono").Text.ToDecimal), CveTipoGasto:=If(DdlTipoGasto.Visible, row.DataKey("CveTipoGasto").ToEntero, row.DataKey("CveTipoGasto").ToEntero), - CveConceptoContable:=row.DataKey("CveConceptoContable").ToEntero, CveProveedor:=row.DataKey("CveProveedor").ToEntero, CveCompra:=row.DataKey("CveCompra").ToEntero, - CveCliente:=row.DataKey("CveCliente").ToEntero, CveVenta:=row.DataKey("CveVenta").ToEntero, CvePersonal:=row.DataKey("CvePersonal").ToEntero, Referencia:=row.FCLiteral("TxtRef").Text, CveCuenta:=row.DataKey("CveCuenta").ToEntero, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then - OcurrioError = True - Exit For - End If - End If - Else - If Not ObjContabilidad.AddPrePolizasDetalle(CvePrePoliza, If(row.FCLiteral("TxtCargo").Text.ToDecimal <> 0, False, True), If(row.FCLiteral("TxtCargo").Text.ToDecimal <> 0, - row.FCLiteral("TxtCargo").Text.ToDecimal, row.FCLiteral("TxtAbono").Text.ToDecimal), row.DataKey("Referencia").ToString, - row.DataKey("CveConceptoContable").ToEntero, row.FCLiteral("TxtConcepto").Text, Now, - row.DataKey("IdCtaContable").ToEntero, 0, CveSubProyecto:=row.DataKey("CveSubProyecto").ToEntero, - CveTipoGasto:=If(DdlTipoGasto.Visible, row.DataKey("CveTipoGasto").ToEntero, row.DataKey("CveTipoGasto").ToEntero), - ImporteMX:=If(row.FCLiteral("TxtCargo").Text.ToDecimal <> 0, - row.FCLiteral("TxtCargo").Text.ToDecimal, row.FCLiteral("TxtAbono").Text.ToDecimal), CveProveedor:=row.DataKey("CveProveedor").ToEntero, - CveCompra:=row.DataKey("CveCompra").ToEntero, CveCliente:=row.DataKey("CveCliente").ToEntero, CveVenta:=row.DataKey("CveVenta").ToEntero, - CvePersonal:=row.DataKey("CvePersonal").ToEntero) Then - OcurrioError = True - Exit For - End If - End If - - Next - - If Not OcurrioError Then - ObjContabilidad.Commit() - Alert("La PrePoliza se actualizó correctamente.", TipoMensaje.MsgInformacion) - Else - ObjContabilidad.RollBack() - Alert("Ocurrio un error al actualizar la PrePoliza.", TipoMensaje.MsgError) - End If - - ObjContabilidad.Dispose() - CargaPrePoliza() - End Sub - Protected Sub LnkAddConcepto_Click(sender As Object, e As EventArgs) - RegistraScript(String.Format("$('#{0}').modal();", "DivEditConcepto")) - LtlTitulo.Text = "Agregar Concepto" - BtnAceptar.Text = "Agregar" - LimpiaCampos() - - CargaConceptosContablesE() - CargaSubProyectoE() - CargaTipoGastoE() - CargaCtaContableE() - - - UpdatePanel1.Update() - End Sub - Protected Sub GvPrePoliza_RowUpdating(sender As Object, e As GridViewUpdateEventArgs) Handles GvPrePoliza.RowUpdating - RegistraScript(String.Format("$('#{0}').modal();", "DivEditConcepto")) - LtlTitulo.Text = "Editar Concepto" - BtnAceptar.Text = "Aceptar" - LimpiaCampos() - IndiceGrid = e.RowIndex - - Dim CveConceptoContable As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CveConceptoContable").ToEntero - Dim CveProveedor As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CveProveedor").ToEntero - Dim CveCompra As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CveCompra").ToEntero - Dim CvePersonal As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CvePersonal").ToEntero - Dim CveCliente As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CveCliente").ToEntero - Dim CveVenta As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CveVenta").ToEntero - 'Dim FolioFactura As String = GvPrePoliza.Rows(IndiceGrid).FCHyperLink("HlReferencia").Text - Dim Concepto As String = GvPrePoliza.Rows(IndiceGrid).FCLiteral("TxtConcepto").Text - Dim Referencia As String = GvPrePoliza.Rows(IndiceGrid).FCLiteral("TxtRef").Text - Dim CveSubProyecto As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CveSubProyecto").ToString.ToEntero - Dim CveTipoGasto As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CveTipoGasto").ToString.ToEntero - Dim CveCuenta As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CveCuenta").ToString.ToEntero - Dim Cargo As Double = GvPrePoliza.Rows(IndiceGrid).FCLiteral("TxtCargo").Text.ToDouble - Dim Abono As Double = GvPrePoliza.Rows(IndiceGrid).FCLiteral("TxtAbono").Text.ToDouble - - CargaConceptosContablesE() - DdlConceptosContablesE.SelectedValueExist(CveConceptoContable) - DdlConceptosContablesE_SelectedIndexChanged(DdlConceptosContablesE, e) - - DdlProveedoresE.SelectedValueExist(CveProveedor) - DdlProveedoresE_SelectedIndexChanged(DdlProveedoresE, e) - DdlComprasE.SelectedValueExist(CveCompra) - - DdlPersonalE.SelectedValueExist(CvePersonal) - - DdlClientesE.SelectedValue = CveCliente - DdlClientesE.SelectedText = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("NombreComercial", $"CveCliente={CveCliente}") - DdlClientesE_SelectedIndexChanged(DdlClientesE, e) - DdlVentasE.SelectedValueExist(CveVenta) - - TxtConceptoE.Text = Concepto - TxtReferenciaE.Text = Referencia - - CargaSubProyectoE() - DdlSubProyectoE.SelectedValueExist(CveSubProyecto) - CargaTipoGastoE() - DdlTipoGastoE.SelectedValueExist(CveTipoGasto) - CargaCtaContableE() - DdlCtaContableE.SelectedValueExist(CveCuenta) - - If Cargo <> 0 Then - TxtCargoE.Text = Cargo - End If - - If Abono <> 0 Then - TxtAbonoE.Text = Abono - End If - - UpdatePanel1.Update() - - End Sub - Private Sub LimpiaCampos() - IndiceGrid = -1 - TxtConceptoE.Text = "" - TxtCargoE.Text = "" - TxtAbonoE.Text = "" - TxtReferenciaE.Text = "" - End Sub - Private Sub CargaConceptosContablesE() - DdlConceptosContablesE.DataSource = GlobalDTContaConceptosContables(-1) - DdlConceptosContablesE.DataBind() - End Sub - Private Sub CargaSubProyectoE() - DdlSubProyectoE.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) - DdlSubProyectoE.DataBind() - DdlSubProyectoE.Items.Insert(0, New ListItem(" - ", "-1")) - End Sub - Private Sub CargaTipoGastoE() - DdlTipoGastoE.DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa) - DdlTipoGastoE.DataBind() - DdlTipoGastoE.Items.Insert(0, New ListItem("Sin Asignar", "0")) - End Sub - Private Sub CargaCtaContableE() - Dim ObjConta As New ClsContabilidad - If ObjConta.GetCuentas(-1, "-1", -1, UsuarioActual.CveEmpresa) Then - DdlCtaContableE.DataSource = ObjConta.DtResultados - End If - ObjConta.Dispose() - - DdlCtaContableE.DataBind() - DdlCtaContableE.Items.Insert(0, New ListItem("Sin Asignar", "0")) - End Sub - Private Sub DdlConceptosContablesE_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlConceptosContablesE.SelectedIndexChanged - If DdlConceptosContablesE.SelectedValue.ToEntero.Contiene(5, 17, 201, 206, 14, 15, 16, 19, 25, 26, 21) Then - CargaProveedoresE() - DdlProveedoresE.Visible = True - DdlComprasE.Visible = True - Else - DdlProveedoresE.Visible = False - DdlComprasE.Visible = False - End If - - If DdlConceptosContablesE.SelectedValue.ToEntero.Contiene(28, 29) Then - CargaPersonalE() - DdlPersonalE.Visible = True - Else - DdlPersonalE.Visible = False - End If - - If DdlConceptosContablesE.SelectedValue.ToEntero.Contiene(51) Then - CargaClasificacionesE() - DdlClasificacionesE.Visible = True - Else - DdlClasificacionesE.Visible = False - End If - If DdlConceptosContablesE.SelectedValue.ToEntero.Contiene(1, 2, 203, 207, 13, 61, 8, 9, 62, 63, 38, 39, 12, 91) Then - CargaClientesE() - DdlClientesE.Visible = True - DdlVentasE.Visible = True - Else - DdlClientesE.Visible = False - DdlVentasE.Visible = False - End If - End Sub - Private Sub CargaProveedoresE() - DdlProveedoresE.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa) - DdlProveedoresE.DataBind() - DdlProveedoresE.Items.Insert(0, New ListItem(" - ", "-1")) - End Sub - Private Sub CargaComprasE(CveProveedor As Integer) - If Not DdlConceptosContablesE.SelectedValue.ToEntero.Contiene(21) Then - Dim ObjCompras As New ClsCompras - - DdlComprasE.ClearSelection() - If ObjCompras.GetCompras(-1, "-1", "-1", CveProveedor, -1, UsuarioActual.CveEmpresa) Then - DdlComprasE.DataSource = ObjCompras.DtResultados.FiltraParametros("Saldo > 0") - DdlComprasE.DataBind() - DdlComprasE.Items.Insert(0, New ListItem(" - ", "-1")) - Else - DdlComprasE.DataSource = Nothing - DdlComprasE.DataBind() - DdlComprasE.Items.Insert(0, New ListItem(" - ", "-1")) - End If - ObjCompras.Dispose() - End If - End Sub - Private Sub CargaClientesE() - DdlClientesE.setEsWebService(True) - DdlClientesE.Attributes.Add("data-metodo", "getcliente") - DdlClientesE.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa) - DdlClientesE.DataBind() - ' DdlClientes.Items.Insert(0, New ListItem(" - ", "-1")) - End Sub - Private Sub CargaVentasE(CveCliente As Integer) - Dim ObjVentas As New ClsVentas - - DdlVentasE.ClearSelection() - If ObjVentas.GetVentas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1", CveCliente, -1, -1, -1, "-1", "-1", "-1", CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then - DdlVentasE.DataSource = ObjVentas.DtResultados '.FiltraParametros("Saldo > 0") - DdlVentasE.DataBind() - DdlVentasE.Items.Insert(0, New ListItem(" - ", "-1")) - Else - DdlVentasE.DataSource = Nothing - DdlVentasE.DataBind() - DdlVentasE.Items.Insert(0, New ListItem(" - ", "-1")) - End If - ObjVentas.Dispose() - End Sub - Private Sub CargaPersonalE() - DdlPersonalE.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa) - DdlPersonalE.DataBind() - DdlPersonalE.Items.Insert(0, New ListItem(" - ", "-1")) - End Sub - - Private Sub CargaClasificacionesE() - DdlClasificacionesE.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) - DdlClasificacionesE.DataBind() - DdlClasificacionesE.Items.Insert(0, New ListItem(" - ", "-1")) - End Sub - Private Sub DdlProveedoresE_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlProveedoresE.SelectedIndexChanged - CargaComprasE(DdlProveedoresE.SelectedValue.ToEntero) - End Sub - Private Sub DdlClientesE_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlClientesE.selectedindexchange - CargaVentasE(DdlClientesE.SelectedValue.ToEntero) - End Sub - Protected Sub BtnAceptar_Click(sender As Object, e As EventArgs) Handles BtnAceptar.Click - - If IndiceGrid = -1 Then - If DtMovimientos Is Nothing Then CreaDT() - If CvePrePoliza > 0 Then - Dim dr As DataRow = DtMovimientos.NewRow - dr("IdCtaContable") = DdlCtaContableE.SelectedValue - dr("ConceptoContable") = DdlConceptosContablesE.SelectedItem.Text - dr("CveConceptoContable") = DdlConceptosContablesE.SelectedValue - dr("Concepto") = TxtConceptoE.Text - dr("Referencia") = TxtReferenciaE.Text - dr("TipoMovto") = If(Math.Abs(TxtCargoE.Text.ToDouble) > 0, 0, 1) - dr("Cargo") = TxtCargoE.Text.ToDouble - dr("Abono") = TxtAbonoE.Text.ToDouble - dr("ImporteMN") = If(Math.Abs(TxtCargoE.Text.ToDouble) > 0, TxtCargoE.Text.ToDouble, TxtAbonoE.Text.ToDouble) - dr("CveSubProyecto") = DdlSubProyectoE.SelectedValue - dr("SubProyecto") = DdlSubProyectoE.SelectedItem.Text - dr("CveProveedor") = DdlProveedoresE.SelectedValue.ToEntero - dr("CveCompra") = DdlComprasE.SelectedValue.ToEntero - dr("CvePersonal") = DdlPersonalE.SelectedValue.ToEntero - dr("CveCliente") = DdlClientesE.SelectedValue.ToEntero - dr("CveVenta") = DdlVentasE.SelectedValue.ToEntero - dr("FolioFactura") = If(DdlComprasE.Visible = True, DdlComprasE.SelectedItem.ToString, If(DdlVentasE.Visible = True, DdlVentasE.SelectedItem.ToString, "")) - - - TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbonoE.Text.ToDouble).ToString.FormatoNumero - TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargoE.Text.ToDouble).ToString.FormatoNumero - DtMovimientos.Rows.Add(dr) - DtMovimientos.AcceptChanges() - - If CvePrePoliza > 0 Then - GvPrePoliza.DataSource = DtMovimientos - GvPrePoliza.DataBind() - UpPrePoliza.Update() - End If - Else - 'Dim dr As DataRow = DtMovimientos.NewRow - 'Dim CodigoCuenta As String = "" - 'Dim NombreCuenta As String = "" - - 'dr("IdCuenta") = DdlCtaContableE.SelectedValue - - 'If DdlCtaContableE.SelectedValue.ToEntero > 0 Then - ' Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", DdlCtaContableE.SelectedValue)) - ' If drr IsNot Nothing Then - ' CodigoCuenta = drr("CuentaFormato").ToString() - ' NombreCuenta = drr("Nombre").ToString() - ' End If - 'End If - - 'dr("CodigoCuenta") = CodigoCuenta & "
" & NombreCuenta - 'dr("Cuenta") = DdlConceptosContablesE.SelectedItem.Text - 'dr("Referencia") = TxtReferenciaE.Text - 'dr("Concepto") = TxtConceptoE.Text - 'dr("TipoMovto") = If(Math.Abs(TxtCargoE.Text.ToDouble) > 0, 0, 1) - 'dr("EsComodin") = 0 - 'dr("CveConcepto") = DdlConceptosContablesE.SelectedValue - 'dr("CveConceptoContable") = DdlConceptosContablesE.SelectedValue - 'dr("ConceptoContable") = DdlConceptosContablesE.SelectedItem.Text - 'dr("Cargo") = TxtCargoE.Text.ToDouble - 'dr("Abono") = TxtAbonoE.Text.ToDouble - ''dr("Descripcion") = TxtDescripcionE.Text - 'dr("CveSubProyecto") = DdlSubProyectoE.SelectedValue - 'dr("CveProveedor") = DdlProveedoresE.SelectedValue.ToEntero - 'dr("CveCompra") = DdlComprasE.SelectedValue.ToEntero - 'dr("CvePersonal") = DdlPersonalE.SelectedValue.ToEntero - 'dr("CveClasificacion") = -1 - 'dr("CveCliente") = DdlClientesE.SelectedValue.ToEntero - 'dr("CveVenta") = DdlVentasE.SelectedValue.ToEntero - - 'TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbonoE.Text.ToDouble).ToString.FormatoNumero - 'TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargoE.Text.ToDouble).ToString.FormatoNumero - 'DtMovimientos.Rows.Add(dr) - 'DtMovimientos.AcceptChanges() - - 'GvMov.DataSource = DtMovimientos - 'GvMov.DataBind() - 'UPMovs.Update() - 'Actualizar = False - - End If - Else - Dim CvePrePolizaDetalle As Integer = GvPrePoliza.DataKeys(IndiceGrid).Value.ToString.ToEntero - Dim Rows As DataRow() = DtMovimientos.Select("CvePrePolizaDetalle = " & CvePrePolizaDetalle) - - If Rows.Count > 0 Then - Dim dr As DataRow = Rows(0) - dr("IdCtaContable") = DdlCtaContableE.SelectedValue - dr("ConceptoContable") = DdlConceptosContablesE.SelectedItem.Text - dr("CveConceptoContable") = DdlConceptosContablesE.SelectedValue - dr("Concepto") = TxtConceptoE.Text - dr("Referencia") = TxtReferenciaE.Text - dr("TipoMovto") = If(Math.Abs(TxtCargoE.Text.ToDouble) > 0, 0, 1) - dr("ImporteMN") = If(Math.Abs(TxtCargoE.Text.ToDouble) > 0, TxtCargoE.Text.ToDouble, TxtAbonoE.Text.ToDouble) - dr("CveSubProyecto") = DdlSubProyectoE.SelectedValue - dr("SubProyecto") = DdlSubProyectoE.SelectedItem.Text - dr("CveProveedor") = DdlProveedoresE.SelectedValue.ToEntero - dr("CveCompra") = DdlComprasE.SelectedValue.ToEntero - dr("CvePersonal") = DdlPersonalE.SelectedValue.ToEntero - dr("CveCliente") = DdlClientesE.SelectedValue.ToEntero - dr("CveVenta") = DdlVentasE.SelectedValue.ToEntero - dr("FolioFactura") = If(DdlComprasE.Visible = True, DdlComprasE.SelectedItem.ToString, If(DdlVentasE.Visible = True, DdlVentasE.SelectedItem.ToString, "")) - dr("CveCuenta") = DdlCtaContableE.SelectedValue.ToEntero - dr("CodigoNombreCuenta") = DdlCtaContableE.SelectedItem.Text - - 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnConceptoContable").Value = DdlConceptosContablesE.SelectedValue.ToEntero - 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnProveedor").Value = DdlProveedoresE.SelectedValue.ToEntero - 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnCompra").Value = DdlComprasE.SelectedValue.ToEntero - 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnPersonal").Value = DdlPersonalE.SelectedValue.ToEntero - 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnCliente").Value = DdlClientesE.SelectedValue.ToEntero - 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnVenta").Value = DdlVentasE.SelectedValue.ToEntero - - 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnSubProyecto").Value = DdlSubProyectoE.SelectedValue.ToEntero - 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnTipoGasto").Value = DdlTipoGastoE.SelectedValue.ToEntero - 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnCtaContable").Value = DdlCtaContableE.SelectedValue.ToEntero - - If TxtCargoE.Text <> "" Then - dr("Cargo") = TxtCargoE.Text.ToDouble - dr("Abono") = "".ToDouble - Else - dr("Abono") = TxtAbonoE.Text.ToDouble - dr("Cargo") = "".ToDouble - End If - - TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbonoE.Text.ToDouble).ToString.FormatoNumero - TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargoE.Text.ToDouble).ToString.FormatoNumero - DtMovimientos.AcceptChanges() - GvPrePoliza.EditIndex = -1 - - If CvePrePoliza > 0 Then - GvPrePoliza.DataSource = DtMovimientos - GvPrePoliza.DataBind() - UpPrePoliza.Update() - End If - GvPrePoliza.Columns(11).Visible = True - - GvPrePoliza.Rows(IndiceGrid).FCCheckBox("chkModificado").Checked = True - End If - End If - - UpPrePoliza.Update() - RegistraScript("$('#DivEditConcepto').modal('hide')", "hidemodal") - End Sub - Protected Sub GvMov_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GvMov.RowDeleting - - Dim idMov As Integer = GvMov.DataKeys(e.RowIndex).Value.ToString.ToEntero - - Dim Rows As DataRow() = DtMovimientos.Select("IDMov = " & idMov) - If Rows.Count > 0 Then - DtMovimientos.Rows.Remove(Rows(0)) - DtMovimientos.AcceptChanges() - End If - GvMov.DataSource = DtMovimientos - GvMov.DataBind() - - TxtTotalAbonos.Text = DtMovimientos.SUM("Abono").FormatoNumero - TxtTotalCargos.Text = DtMovimientos.SUM("Cargo").FormatoNumero - - 'saco de la póliza el importe del cheque, que coincida la cuenta contable con la bancaria - - End Sub - - Private Sub LbAgregar_Click(sender As Object, e As EventArgs) Handles LbAgregar.Click - - If DtMovimientos Is Nothing Then CreaDT() - - If Actualizar Then - - Dim Rows As DataRow() = DtMovimientos.Select("IDMov = " & HdnCve.Value) - - If Rows.Count > 0 Then - Dim dr As DataRow = Rows(0) - Dim CodigoCuenta As String = "" - Dim NombreCuenta As String = "" - dr("CveCuenta") = DdlCtaContable.SelectedValue - - If DdlCtaContable.SelectedValue.ToEntero > 0 Then - Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("CveCuenta={0}", DdlCtaContable.SelectedValue)) - If drr IsNot Nothing Then - CodigoCuenta = drr("CuentaFormato").ToString() - NombreCuenta = drr("Nombre").ToString() - End If - End If - - dr("CodigoCuenta") = CodigoCuenta & "
" & NombreCuenta - dr("Cuenta") = DdlConceptosContables.SelectedItem - dr("Referencia") = TxtReferencia.Text - dr("Concepto") = TxtObservaciones.Text - dr("TipoMovto") = If(Math.Abs(TxtCargo.Text.ToDouble) > 0, 0, 1) - dr("EsComodin") = 0 - dr("CveConcepto") = DdlConceptosContables.SelectedValue - dr("Cargo") = TxtCargo.Text.ToDouble - dr("Abono") = TxtAbono.Text.ToDouble - dr("Descripcion") = TxtDescripcion.Text - dr("CveSubProyecto") = DdlSubProyecto.SelectedValue - dr("CveProveedor") = DdlProveedores.SelectedValue.ToEntero - dr("CveCompra") = DdlCompras.SelectedValue.ToEntero - dr("CvePersonal") = DdlPersonal.SelectedValue.ToEntero - dr("CveClasificacion") = -1 - dr("CveCliente") = DdlClientes.SelectedValue.ToEntero - dr("CveVenta") = DdlVentas.SelectedValue.ToEntero - dr("CveCuenta") = DdlCtaContable.SelectedValue.ToEntero - End If - GvMov.DataSource = DtMovimientos - GvMov.DataBind() - UPMovs.Update() - LbCancelarEdicion.Visible = False - LbAgregar.Text = "Agregar" - - Else - - If CvePrePoliza > 0 Then - Dim dr As DataRow = DtMovimientos.NewRow - dr("IdCtaContable") = -1 'DdlCtaContable.SelectedValue - dr("ConceptoContable") = DdlConceptosContables.SelectedItem.Text - dr("CveConceptoContable") = DdlConceptosContables.SelectedValue - dr("Concepto") = TxtDescripcion.Text - dr("Referencia") = TxtReferencia.Text - dr("TipoMovto") = If(Math.Abs(TxtCargo.Text.ToDouble) > 0, 0, 1) - dr("Cargo") = TxtCargo.Text.ToDouble - dr("Abono") = TxtAbono.Text.ToDouble - dr("ImporteMN") = If(Math.Abs(TxtCargo.Text.ToDouble) > 0, TxtCargo.Text.ToDouble, TxtAbono.Text.ToDouble) - dr("CveSubProyecto") = DdlSubProyecto.SelectedValue - dr("SubProyecto") = DdlSubProyecto.SelectedItem.Text - dr("CveProveedor") = DdlProveedores.SelectedValue.ToEntero - dr("CveCompra") = DdlCompras.SelectedValue.ToEntero - dr("CvePersonal") = DdlPersonal.SelectedValue.ToEntero - dr("CveCliente") = DdlClientes.SelectedValue.ToEntero - dr("CveVenta") = DdlVentas.SelectedValue.ToEntero - - - TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbono.Text.ToDouble).ToString.FormatoNumero - TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargo.Text.ToDouble).ToString.FormatoNumero - DtMovimientos.Rows.Add(dr) - DtMovimientos.AcceptChanges() - - If CvePrePoliza > 0 Then - GvPrePoliza.DataSource = DtMovimientos - GvPrePoliza.DataBind() - UpPrePoliza.Update() - End If - Else - Dim dr As DataRow = DtMovimientos.NewRow - Dim CodigoCuenta As String = "" - Dim NombreCuenta As String = "" - - dr("CveCuenta") = DdlCtaContable.SelectedValue - - If DdlCtaContable.SelectedValue.ToEntero > 0 Then - Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("CveCuenta={0}", DdlCtaContable.SelectedValue)) - If drr IsNot Nothing Then - CodigoCuenta = drr("CuentaFormato").ToString() - NombreCuenta = drr("Nombre").ToString() - End If - End If - - dr("CodigoCuenta") = CodigoCuenta & "
" & NombreCuenta - dr("Cuenta") = DdlConceptosContables.SelectedItem.Text - dr("Referencia") = TxtReferencia.Text - dr("Concepto") = TxtObservaciones.Text - dr("TipoMovto") = If(Math.Abs(TxtCargo.Text.ToDouble) > 0, 0, 1) - dr("EsComodin") = 0 - dr("CveConcepto") = DdlConceptosContables.SelectedValue - dr("CveConceptoContable") = DdlConceptosContables.SelectedValue - dr("ConceptoContable") = DdlConceptosContables.SelectedItem.Text - dr("Cargo") = TxtCargo.Text.ToDouble - dr("Abono") = TxtAbono.Text.ToDouble - dr("Descripcion") = TxtDescripcion.Text - dr("CveSubProyecto") = DdlSubProyecto.SelectedValue - dr("CveProveedor") = DdlProveedores.SelectedValue.ToEntero - dr("CveCompra") = DdlCompras.SelectedValue.ToEntero - dr("CvePersonal") = DdlPersonal.SelectedValue.ToEntero - dr("CveClasificacion") = -1 - dr("CveCliente") = DdlClientes.SelectedValue.ToEntero - dr("CveVenta") = DdlVentas.SelectedValue.ToEntero - - TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbono.Text.ToDouble).ToString.FormatoNumero - TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargo.Text.ToDouble).ToString.FormatoNumero - DtMovimientos.Rows.Add(dr) - DtMovimientos.AcceptChanges() - - 'If CvePrePoliza > 0 Then - ' GvPrePoliza.DataSource = DtMovimientos - ' GvPrePoliza.DataBind() - ' UpPrePoliza.Update() - 'End If - - GvMov.DataSource = DtMovimientos - GvMov.DataBind() - UPMovs.Update() - Actualizar = False - - End If - - End If - - TxtCargo.Text = "" - TxtAbono.Text = "" - TxtReferencia.Text = "" - TxtDescripcion.Text = "" - End Sub - -#Region "PESTAÑA INFORMACION GENERAL DE BANCO IE" - Public Sub Bancos_Click(sender As Object, e As EventArgs) - Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) - RowIndex = GvRow.RowIndex - - If GvRow.FCTextBox("TxtAbono").Text = "" Then - CargaTipoTransaccion("Ing") - Else - CargaTipoTransaccion("Egs") - End If - - - TxtDocumentoImporte.Text = If(GvRow.FCTextBox("TxtAbono").Text = "", GvRow.FCTextBox("TxtCargo").Text.FormatoNumero, GvRow.FCTextBox("TxtAbono").Text.FormatoNumero) - UpBancos.Update() - RegistraScript(String.Format("$('#{0}').modal();", "DivContadoModal")) - End Sub - Private Sub CargaTipoTransaccion(Tipo As String) - DdlTipoTransaccion.Items.Clear() - DdlTipoTransaccion.DataSource = GlobalDTTipoTransacciones.FiltraParametros($"Tipo = '{Tipo}' AND Estatus = 1 ") - DdlTipoTransaccion.DataBind() - DdlTipoTransaccion.Items.Insert(0, New ListItem("Seleccione Tipo Movimiento", "-1")) - End Sub - Private Sub CargaCuentas() - DdlCuenta.Items.Clear() - DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) '.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", DdlMoneda.SelectedValue)) - DdlCuenta.DataBind() - DdlCuenta.Items.Insert(0, New ListItem("Seleccione", "-1")) - End Sub - Private Sub BtnContado_Click(sender As Object, e As EventArgs) Handles BtnContado.Click - CveConcepto = 30 - CveTipoTransaccion = DdlTipoTransaccion.SelectedValue.ToEntero - CveCuenta = DdlCuenta.SelectedValue.ToEntero - Folio = TxtDocumentoFolio.Text - ImporteDocumento = TxtDocumentoImporte.Text.ToDecimal - Observaciones = TxtDocumentoObservaciones.Text - Beneficiario = TxtDocumentoBeneficiario.Text - RegistraScript(String.Format("$('#{0}').modal('hide');", "DivContadoModal")) - GvMov.Rows(RowIndex).FCLinkButton("ImgBancos").CssClass = "btn btn-circle btn-sm green" - UPMovs.Update() - End Sub - - Private Sub BtnEliminar_Click(sender As Object, e As EventArgs) Handles BtnEliminar.Click - Dim ObjContabilidad As New ClsContabilidad - - If ObjContabilidad.RemovePrePolizas(CvePrePoliza, UsuarioActual.CveEmpresa) Then - Alert("La Prepóliza ha sido eliminada", TipoMensaje.MsgInformacion) - Else - Alert("La Prepóliza ha podido ser eliminada", TipoMensaje.MsgError) - End If - - ObjContabilidad.Dispose() - End Sub -#End Region - - Protected Sub DdlTipoGasto_SelectedIndexChanged(sender As Object, e As EventArgs) - If UpPrePoliza.Visible Then - For Each Gvr As GridViewRow In GvPrePoliza.Rows - Gvr.FCDropDownList("DdlTipoGasto").SelectedValueExist(DdlTipoGasto.SelectedValue) - Next - UpPrePoliza.Update() - End If - If UPMovs.Visible Then - For Each Gvr As GridViewRow In GvMov.Rows - Gvr.FCDropDownList("DdlTipoGasto").SelectedValueExist(DdlTipoGasto.SelectedValue) - Next - UPMovs.Update() - End If - End Sub - Protected Sub DdlSubProyectoFiltro_SelectedIndexChanged(sender As Object, e As EventArgs) - Dim Ddl As DropDownList = CType(sender, DropDownList) - For Each Gvr As GridViewRow In GvPrePoliza.Rows - If Ddl.SelectedValue.ToEntero > 0 Then - If Gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero = Ddl.SelectedValue.ToEntero Or Not Gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero > 0 Then - Gvr.Visible = True - Else - Gvr.Visible = False - End If - Else - Gvr.Visible = True - End If - Next - UpPrePoliza.Update() - RegistraScript("calculateAbono()", "cargo") - RegistraScript("calculateCargo()", "abono") - RegistraScript("comparar()", "compara") - End Sub - Protected Sub DdlSubProyectoFiltroMov_SelectedIndexChanged(sender As Object, e As EventArgs) - For Each Gvr As GridViewRow In GvMov.Rows - If DdlSubProyectoFiltroMov.SelectedValue.ToEntero > 0 Then - If Gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero = DdlSubProyectoFiltroMov.SelectedValue.ToEntero Or Not Gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero > 0 Then - Gvr.Visible = True - Else - Gvr.Visible = False - End If - Else - Gvr.Visible = True - End If - Next - UpPrePoliza.Update() - RegistraScript("calculateAbono()", "cargo") - RegistraScript("calculateCargo()", "abono") - RegistraScript("comparar()", "compara") - End Sub - - Private Sub GvMov_RowEditing(sender As Object, e As GridViewEditEventArgs) Handles GvMov.RowEditing - Actualizar = True - GvMov.DataKeys(e.NewEditIndex).Value.ToString.ToEntero - Dim idMov As Integer = GvMov.DataKeys(e.NewEditIndex).Value.ToString.ToEntero - - Dim DrM As DataRow = DtMovimientos.Rows(e.NewEditIndex) - - If DrM IsNot Nothing Then - HdnCve.Value = idMov.ToString - - DdlCtaContable.SelectedValue = DrM("CveCuenta") - TxtReferencia.Text = DrM("Referencia") - TxtObservaciones.Text = DrM("Concepto") - ' (Math.Abs(TxtCargo.Text.ToDouble) > 0, 0, 1) = dr("TipoMovto") - DrM("EsComodin") = 0 - DdlConceptosContables.SelectedValue = DrM("CveConcepto").ToString - TxtCargo.Text = DrM("Cargo").ToString - TxtAbono.Text = DrM("Abono").ToString - TxtDescripcion.Text = DrM("Descripcion") - DdlSubProyecto.SelectedValue = DrM("CveSubProyecto") - DdlProveedores.SelectedValue = DrM("CveProveedor") - DdlCompras.SelectedValue = DrM("CveCompra") - DdlPersonal.SelectedValue = DrM("CvePersonal") - ' DrM("CveClasificacion") = -1 - DdlClientes.SelectedValue = DrM("CveCliente") - DdlVentas.SelectedValue = DrM("CveVenta") - LbCancelarEdicion.Visible = True - LbAgregar.Text = "Actualizar" - - End If - - UPPDocumento.Update() - DivAgregarConceptos.Visible = True - - 'If DtMovimientos Is Nothing Then CreaDT() - - 'Dim dr As DataRow = DtMovimientos.NewRow - 'Dim CodigoCuenta As String = "" - 'Dim NombreCuenta As String = "" - - 'dr("IdCuenta") = DdlCtaContable.SelectedValue - - 'If DdlCtaContable.SelectedValue.ToEntero > 0 Then - ' Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", DdlCtaContable.SelectedValue)) - ' If drr IsNot Nothing Then - ' CodigoCuenta = drr("CuentaFormato").ToString() - ' NombreCuenta = drr("Nombre").ToString() - ' End If - 'End If - - 'dr("CodigoCuenta") = CodigoCuenta & "
" & NombreCuenta - 'dr("Cuenta") = DdlConceptosContables.SelectedItem - 'dr("Referencia") = TxtReferencia.Text - 'dr("Concepto") = TxtObservaciones.Text - 'dr("TipoMovto") = If(Math.Abs(TxtCargo.Text.ToDouble) > 0, 0, 1) - 'dr("EsComodin") = 0 - 'dr("CveConcepto") = DdlConceptosContables.SelectedValue - 'dr("Cargo") = TxtCargo.Text.ToDouble - 'dr("Abono") = TxtAbono.Text.ToDouble - 'dr("Descripcion") = TxtDescripcion.Text - 'dr("CveSubProyecto") = DdlSubProyecto.SelectedValue - 'dr("CveProveedor") = DdlProveedores.SelectedValue.ToEntero - 'dr("CveCompra") = DdlCompras.SelectedValue.ToEntero - 'dr("CvePersonal") = DdlPersonal.SelectedValue.ToEntero - 'dr("CveClasificacion") = -1 - 'dr("CveCliente") = DdlClientes.SelectedValue.ToEntero - 'dr("CveVenta") = DdlVentas.SelectedValue.ToEntero - - 'TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbono.Text.ToDouble).ToString.FormatoNumero - 'TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargo.Text.ToDouble).ToString.FormatoNumero - 'DtMovimientos.Rows.Add(dr) - - 'If CvePrePoliza > 0 Then - ' GvPrePoliza.DataSource = DtMovimientos - ' GvPrePoliza.DataBind() - 'End If - - - 'GvMov.DataSource = DtMovimientos - 'GvMov.DataBind() - 'UPMovs.Update() - - - End Sub - - Private Sub LbCancelarEdicion_Click(sender As Object, e As EventArgs) Handles LbCancelarEdicion.Click - LbCancelarEdicion.Visible = False - TxtObservaciones.Text = "" - Actualizar = False - LbAgregar.Text = "Agregar" - End Sub - - Private Sub BtnContabilizar_Click(sender As Object, e As EventArgs) Handles BtnContabilizar.Click - - Dim ObjConta As New ClsContabilidad - - If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then - Alert(String.Format("Prepóliza contabilizada.

Folio:Ver Póliza", ObjConta.ContaIdPoliza), ModExtensiones.TipoMensaje.MsgInformacion) - Else - - Alert($"Ocurrio un error al contabilizar {ObjConta.AlertaMensaje}", TipoMensaje.MsgAdvertencia) - End If - - ObjConta.Dispose() - - - End Sub - - -#Region "COMPLEMENTO DE PAGO" - - Private Sub GeneraTimbre(CvePrePoliza As Integer) - Dim Str As New StringBuilder - Dim Banco As New ClsBancos - Banco.IniciaTransacSQL() - If Banco.GeneraTimbrePago(-1, -1, UsuarioActual, CvePrePoliza:=CvePrePoliza) Then - If Banco.Mensaje = "" Then - Banco.Commit() - PDFReciboDePagos(-1, -1, Banco.CveComplementoPago, False) - Str.AppendFormat("Folio: {0}  ", Banco.ComplementoSerieFolio) - Str.AppendFormat("XML    ", Encripta(String.Format("OP=CompP&EXT=xml&SerieFolio={0}&CveComplementoPago={1}", Banco.ComplementoSerieFolio, Banco.CveComplementoPago))) - Str.AppendFormat("PDF   ", Encripta(String.Format("OP=CompP&EXT=pdf&SerieFolio={0}&CveComplementoPago={1}", Banco.ComplementoSerieFolio, Banco.CveComplementoPago))) - MandaCorreo(Banco.ComplementoSerieFolio, Banco.CobranzaCorreo) - End If - Else - Banco.RollBack() - Str.AppendFormat("No se genero complemento por el siguiente motivo: {0}", Banco.Mensaje) - End If - Banco.Dispose() - Alert(Str.ToString, TipoMensaje.MsgInformacion, "self.parent.tb_remove();self.parent.location.reload();") - End Sub - - Private Sub MandaCorreo(NombreArchivo As String, Correo As String, Optional ConAlerta As Boolean = True) - Try - Dim Msg As String = "" - If NombreArchivo <> "-1" Then ' - Dim ObjMail As New ClsSisMail() - Dim RutaXML As String = String.Format("{0}\XML\Pag\{1}.xml", UsuarioActual.Empresa.Ruta, NombreArchivo) - Dim RutaPDF As String = String.Format("{0}\PDF\Pag\{1}.pdf", UsuarioActual.Empresa.Ruta, NombreArchivo) - Dim Cuerpo As String = "Se hace entrega del comprobante de pago" - Dim Asunto As String = "Entrega de comprobante de pago" - If IO.File.Exists(RutaPDF) AndAlso IO.File.Exists(RutaXML) Then - Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail) - LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.Ruta = RutaPDF}) - LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.Ruta = RutaXML}) - If ObjMail.SendMail(UsuarioActual.Empresa, Correo, Asunto, Cuerpo, "", LSRutasMail) Then - If ConAlerta Then - 'RegistraScript("$('#ModalDivMail').modal('hide');") - Alert("El correo se envió correctamente", TipoMensaje.MsgInformacion) - End If - Else - Msg = "No se pudo enviar el correo electrónico." - End If - Else - Msg = "No se pudo adjuntar el correo electrónico." - End If - End If - If ConAlerta AndAlso Msg <> "" Then - Alert(Msg, TipoMensaje.MsgError) - End If - Catch ex As Exception - OnError("Ocurrió error al mandar MAIL", ex) - End Try - End Sub - - Protected Sub LnkComplementoPago_Click(sender As Object, e As EventArgs) - GeneraTimbre(CvePrePoliza) - End Sub -#End Region - - - -#Region "E X C E L" - - - Private Sub LnkExcel_Click(sender As Object, e As EventArgs) Handles LnkExcel.Click - RegistraScript(String.Format("$('#{0}').modal();", "DivCargaExcel")) - - End Sub - - Protected Sub BtnDescargar_Click(sender As Object, e As EventArgs) Handles BtnDescargar.Click - Dim NombreArchivo As String - SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet) - Dim workbook As New ExcelFile() - Dim worksheet = workbook.Worksheets.Add(DdlPlantilla2.SelectedItem.Text.ToString) - - Dim CvePlantilla As Integer = DdlPlantilla2.SelectedValue.ToEntero - Dim Dt As DataTable = GlobalDTContaPlantillasPolizasDetalle(CvePlantilla).FiltraParametros(String.Format("CveEmpresa={0}", UsuarioActual.CveEmpresa), "Orden") - - Dim DtExcel As DataTable = (From row As DataRow In Dt.Rows - Select New With - { - .ConceptoAdministrativo = row.Item("ConceptoContable"), - .Cuenta = row.Item("Codigo"), - .NombreCuenta = row.Item("NombreCuenta"), - .Cargo = "", - .Abono = "", - .Referencia = "", - .Concepto = "", - .SubProyecto = row.Item("SubProyecto"), - .CveConceptoContable = row.Item("CveConcepto"), - .CveSubProyecto = IIf(row.Item("CveSubProyecto").ToString.ToEntero > 0, row.Item("CveSubProyecto"), -1), - .IdCtaContable = IIf(row.Item("IdCtaContable").ToString.ToEntero > 0, row.Item("IdCtaContable"), -1), - .CveCuenta = row.Item("CveCuenta") - }).QueryToDataTable(True) - - worksheet.InsertDataTable(DtExcel, New InsertDataTableOptions() With - { - .ColumnHeaders = True, - .StartRow = 0, - .StartColumn = 0 - }) - - Dim columnCount = worksheet.CalculateMaxUsedColumns() - For i = 0 To columnCount - worksheet.Columns(i).AutoFit(1, worksheet.Rows(0), worksheet.Rows(worksheet.Rows.Count - 1)) - Next - worksheet.Columns("I").Hidden = True - worksheet.Columns("J").Hidden = True - worksheet.Columns("K").Hidden = True - worksheet.Columns("L").Hidden = True - - - NombreArchivo = DdlPlantilla2.SelectedItem.Text.ToString - workbook.Save(Response, $"{NombreArchivo}.xlsx", SaveOptions.XlsxDefault) - - - End Sub - - Protected Sub BtnCargaExcel_Click(sender As Object, e As EventArgs) Handles BtnCargaExcel.Click - If TxtExcel.getfiles().Archivos.Count > 0 Then - Dim file As Archivo = TxtExcel.getfiles().Archivos(0) - - Dim Directorio As String = Server.MapPath("~") & file.patch - - Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") - CargarArchivo(Directorio, file.filename, Tipo) - Else - Alert("No existe el archivo.Favor de subir un archivo csv o excel a la plataforma", TipoMensaje.MsgError) - End If - End Sub - Private Sub CargarArchivo(Ruta As String, FileName As String, Tipo As String) - Dim dt As New DataTable - ' Conexion As Odbc.OdbcConnection = Nothing - Dim ErrorArchivo = False - Dim ErrorExcel = False - DdlPlantilla.SelectedValue = DdlPlantilla2.SelectedValue - dt = ReadExcelFile(Ruta + FileName, True) - - - If Not ErrorArchivo Then - - If Not dt.Columns(0).ColumnName = "ConceptoAdministrativo" Then - Alert("El nombre de la primera columna debe ser 'ConceptoAdmin'. Favor de corregirlo", TipoMensaje.MsgError) - Exit Sub - End If - If Not dt.Columns(1).ColumnName = "Cuenta" Then - Alert("El nombre de la segunda columna debe ser 'Cuenta'.Favor de corregirlo", TipoMensaje.MsgError) - Exit Sub - End If - If Not dt.Columns(2).ColumnName = "NombreCuenta" Then - Alert("El nombre de la tercera columna debe ser 'NombreCuenta'.Favor de corregirlo", TipoMensaje.MsgError) - Exit Sub - End If - If Not dt.Columns(3).ColumnName = "Cargo" Then - Alert("El nombre de la cuarta columna debe ser 'Cargo'. Favor de corregirlo", TipoMensaje.MsgError) - Exit Sub - End If - If Not dt.Columns(4).ColumnName = "Abono" Then - Alert("El nombre de la quinta columna debe ser 'Abono' .Favor de corregirlo", TipoMensaje.MsgError) - Exit Sub - End If - If Not dt.Columns(5).ColumnName = "Referencia" Then - Alert("El nombre de la sexta columna debe ser 'Referencia'. Favor de corregirlo", TipoMensaje.MsgError) - Exit Sub - End If - If Not dt.Columns(6).ColumnName = "Concepto" Then - Alert("El nombre de la séptima columna debe ser 'Concepto'.Favor de corregirlo", TipoMensaje.MsgError) - Exit Sub - End If - If Not dt.Columns(7).ColumnName = "SubProyecto" Then - Alert("El nombre de la octava columna debe ser 'SubProyecto'. Favor de corregirlo", TipoMensaje.MsgError) - Exit Sub - End If - End If - - If Not ErrorArchivo Then - - DtMovimientos.Clear() - - Dim ObjConta As New ClsContabilidad() - ObjConta.IniciaTransacSQL() - Try - - - For Each Row As DataRow In dt.FiltraParametros("ConceptoAdministrativo <> ''").Rows - - Dim NombreCuenta As String = Row("NombreCuenta").ToString - Dim Cuenta As String = Row("Cuenta").ToString - Dim ConceptoAdministrativo As String = Row("ConceptoAdministrativo").ToString - - Dim CveSubProyecto As Integer = -1 - Dim TipoMovto As Boolean = If(Row("Cargo").ToString.ToDecimal <> 0, False, True) - Dim CveConceptoContable As Integer = GlobalDTContaConceptosContables(-1).FiltroPrimeroValor("CveConceptoContable", String.Format("ConceptoContable ='{0}'", Row("ConceptoAdministrativo"))).ToEntero ' Row("CveConceptoContable").ToString.ToEntero - 'Dim IdCtaContable As Integer = Row("IdCtaContable").ToString.ToEntero - Dim CveClasificacion As Integer = -1 - Dim CveCuenta As Integer = -1 - Dim ObjConta2 As New ClsContabilidad - If ObjConta2.GetCuentas(-1, Row("Cuenta").ToString.Replace("-", ""), 1, UsuarioActual.CveEmpresa) Then - CveCuenta = ObjConta2.DtResultados.FiltroPrimeroValor("CveCuenta", "").ToEntero - NombreCuenta = ObjConta2.DtResultados.FiltroPrimeroValor("CtaCodigo", "") - End If - ObjConta2.Dispose() - - If CveCuenta <= 0 AndAlso CveConceptoContable <> 30 Then - Alert(String.Format("La cuenta {0} no se reconoció, favor de verificar el archivo.", Row("Cuenta").ToString)) - DtMovimientos.Clear() - Exit For - End If - - 'sino viene el cveconcepto, busca por le nombre del concepto - If CveConceptoContable = 0 Then - Alert(String.Format("El concepto {0} no se reconoció, favor de verificar el archivo.", Row("ConceptoAdministrativo"))) - DtMovimientos.Clear() - Exit For - End If - - If Row("SubProyecto").ToString.Trim <> "" Then - CveSubProyecto = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa, Estatus:=-1).FiltroPrimeroValor("CveSubProyecto", String.Format("SubProyecto = '{0}'", Row("SubProyecto").ToString.Trim)).ToEntero 'Row("CveSubProyecto").ToString.ToEntero - - If CveSubProyecto = 0 Then - Alert(String.Format("El subproyecto {0} no se reconoció, favor de verificar el archivo.", Row("SubProyecto"))) - DtMovimientos.Clear() - Exit For - End If - - End If - - If CveConceptoContable = 69 Then - CveClasificacion = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveClasificacion", "").ToEntero - End If - - Dim dr As DataRow = DtMovimientos.NewRow - Dim CodigoCuenta As String = "" - - dr("CodigoCuenta") = NombreCuenta 'Cuenta & "
" & NombreCuenta - dr("Cuenta") = ConceptoAdministrativo - dr("Referencia") = Row("Referencia").ToString - dr("Concepto") = Row("Concepto").ToString - dr("TipoMovto") = TipoMovto - dr("EsComodin") = 0 - dr("CveConcepto") = CveConceptoContable - dr("CveConceptoContable") = CveConceptoContable - dr("ConceptoContable") = Row("ConceptoAdministrativo").ToString - dr("Cargo") = Row("Cargo").ToString.ToDecimal.RoundSQL - dr("Abono") = Row("Abono").ToString.ToDecimal.RoundSQL - dr("Descripcion") = Row("Concepto").ToString - dr("CveSubProyecto") = CveSubProyecto - dr("CveProveedor") = -1 - dr("CveCompra") = -1 - dr("CvePersonal") = -1 - dr("CveClasificacion") = CveClasificacion - dr("CveCliente") = -1 - dr("CveVenta") = -1 - dr("CveCuenta") = CveCuenta - - - DtMovimientos.Rows.Add(dr) - DtMovimientos.AcceptChanges() - Next - - TxtTotalCargos.Text = DtMovimientos.SUMD("Cargo").ToString.FormatoNumero - TxtTotalAbonos.Text = DtMovimientos.SUMD("Abono").ToString.FormatoNumero - - GvMov.DataSource = DtMovimientos - GvMov.DataBind() - UPMovs.Update() - - Catch ex As Exception - Alert("No se pudo cargar el excel") - End Try - End If - End Sub -#End Region - -#Region "Paquete Egresos" - Protected Sub LnkImprimirPDF_Click(sender As Object, e As EventArgs) - ImprimirPolizaPDF(IdPoliza) - End Sub - Private Function ImprimirPolizaPDF(IdPoliza As Integer) As String - Dim ObjConta As New ClsContabilidad - 'Dim ObjPoliza As New ClsContPAQi(UsuarioActual.Empresa) - - Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos/Polizas.rdlc", UsuarioActual.Empresa.Ruta)) - Dim params As New List(Of ReportParameter) - Dim Bytes As Byte() = Nothing - - - 'If ObjPoliza.GetPoliza(IdPoliza, -1, -1, -1, -1) AndAlso ObjPoliza.DtResultados.Rows.Count > 0 Then - If ObjConta.GetPrePolizasDetalle(CvePrePoliza) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then - Dim dtVC As DataTable - Dim dr As DataRow - dtVC = ObjConta.DtResultados.FiltraParametros("Contabilizable = 1", "Orden") - dr = dtVC.Rows(0) - Dim ruta As String = "" - params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa)) - params.Add(New ReportParameter("TipoPoliza", dr("TipoPoliza").ToString)) - params.Add(New ReportParameter("Finicio", dr("Fecha").ToString.ToDate.ToShortDateString)) - params.Add(New ReportParameter("FFin", dr("Fecha").ToString.ToDate.ToShortDateString)) - params.Add(New ReportParameter("Fecha", dr("Fecha").ToString.ToDate.ToShortDateString)) - 'params.Add(New ReportParameter("Nombre", dr("Cuenta").ToString)) - 'params.Add(New ReportParameter("Cuenta", dr("Codigo").ToString)) - params.Add(New ReportParameter("Numero", dr("FolioPoliza").ToString)) - params.Add(New ReportParameter("Moneda", "")) - params.Add(New ReportParameter("CodigoPostal", "")) - If UsuarioActual.CveEmpresa = 119 Then - params.Add(New ReportParameter("UsuarioRegistro", GlobalDTUsuarios(dr("CveUsuario").ToString.ToEntero).FiltroPrimeroValor("Nombre"))) - End If - If UsuarioActual.CveEmpresa = 140 Then - params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) - End If - If Archivo.Exists Then - ruta = UsuarioActual.Empresa.Ruta & "Formatos/Polizas.rdlc" - Else - ruta = "Empresas/Grales/Formatos/Polizas.rdlc" - End If - ImprimirbytesPDF(StreamPDF(ruta, dtVC, params, "ppoliza"), String.Format("{0}-{1}", TipoPoliza, dr("FolioPoliza").ToString), "PDF", True) - - End If - Return String.Format("{0}\{1}\{2}.pdf", AppDomain.CurrentDomain.BaseDirectory, Tick, IdPoliza.ToString) - ObjConta.Dispose() - - End Function - - -#End Region - -End Class - diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 9bd4ce5fc..841911cad 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -7,7 +7,7 @@ Imports System.Diagnostics Imports System.Globalization Imports System.IO Imports System.Threading.Tasks -Imports Newtonsoft.Json +Imports Newtonsoft.Jsonf Imports Extensiones Imports System.Activities.Expressions Imports iText.Barcodes.Dmcode @@ -1853,6 +1853,7 @@ Partial Class Compras_Compras 'If Prefijo.ToLower <> "cfdi" Then cfdVer = "http://www.sat.gob.mx/cfd/2" namespaces.AddNamespace(Prefijo, cfdVer) + namespaces.AddNamespace("aerolineas", "http://www.sat.gob.mx/aerolineas") namespaces.AddNamespace("tfd", "http://www.sat.gob.mx/TimbreFiscalDigital") namespaces.AddNamespace("implocal", "http://www.sat.gob.mx/implocal") namespaces.AddNamespace("registrofiscal", "http://www.sat.gob.mx/registrofiscal") @@ -8106,7 +8107,7 @@ Partial Class Compras_Compras End If 'CUANDO ES REEMBOLSO COMPROBACION Y CAJA CHICA - If UsuarioActual.CveEmpresa.Contiene(1, 119, 141, 172, 173, 174) AndAlso TxtNumeroReembolso.Text.Trim <> "" AndAlso (DdlPersonalReembolso.SelectedValue.ToEntero > 0 Or DdlCuentaCajaChicaReembolso.SelectedValue.ToEntero > 0) Then + If UsuarioActual.CveEmpresa.Contiene(1, 119, 141, 172, 173, 174, 13, 83) AndAlso TxtNumeroReembolso.Text.Trim <> "" AndAlso (DdlPersonalReembolso.SelectedValue.ToEntero > 0 Or DdlCuentaCajaChicaReembolso.SelectedValue.ToEntero > 0) Then If ObjCompras.GetComprobacion(DdlPersonalReembolso.SelectedValue.ToEntero, DdlCuentaCajaChicaReembolso.SelectedValue.ToEntero, TxtNumeroReembolso.Text.Trim, UsuarioActual.CveEmpresa) Then Dim CvePreComprobacion As Integer If ObjCompras.DtResultados.Rows.Count = 0 Then @@ -9334,7 +9335,7 @@ Partial Class Compras_Compras If (TxtRembolsoNumero.Text.Trim.Length > 0 AndAlso IdPoliza <= 0) AndAlso (NumeroReembolsoOriginal.Trim <> TxtRembolsoNumero.Text.Trim) Then 'CUANDO ES REEMBOLSO COMPROBACION Y CAJA CHICA - If UsuarioActual.CveEmpresa.Contiene(1, 119, 141) AndAlso TxtRembolsoNumero.Text.Trim <> "" AndAlso (DdlRembolsoPersonal.SelectedValue.ToEntero > 0 Or DdlRembolsoCajaChica.SelectedValue.ToEntero > 0) Then + If UsuarioActual.CveEmpresa.Contiene(1, 119, 141, 172, 173, 174, 13, 83) AndAlso TxtRembolsoNumero.Text.Trim <> "" AndAlso (DdlRembolsoPersonal.SelectedValue.ToEntero > 0 Or DdlRembolsoCajaChica.SelectedValue.ToEntero > 0) Then If ObjCompra.GetComprobacion(DdlRembolsoPersonal.SelectedValue.ToEntero, DdlRembolsoCajaChica.SelectedValue.ToEntero, TxtRembolsoNumero.Text.Trim, UsuarioActual.CveEmpresa) Then Dim CvePreComprobacion As Integer If ObjCompra.DtResultados.Rows.Count = 0 Then @@ -20674,11 +20675,8 @@ Partial Class Compras_Compras TxtModalEliminarCompraDescripcion.Text = "" RegistraScript("$('#DvModalEliminarCompra').modal('show');") - UpModalEliminarcompraCuerpo.Update() - - End Sub Protected Sub BtnModalEliminarCompra_Click(sender As Object, e As EventArgs) @@ -20781,9 +20779,9 @@ Partial Class Compras_Compras SBEliminacionCompra.Append($"Capturó: {LblUsuarioCaptura.Text}, ") SBEliminacionCompra.Append($"F Captura: {LitFechCaptura.Text}, ") - SBEliminacionCompra.Append($"Dealles: ") + SBEliminacionCompra.Append($"Dealles:
") For Each dRow As DataRow In TmpDT.Rows - SBEliminacionCompra.Append($"Cantidad: {dRow("Cantidad")}, PS: {dRow("PS")}, Obs: {dRow("Obs")}, Sub Proyecto: {dRow("SubProyecto")}, Tipo Gasto: {dRow("TipoGasto")}, IVA: {dRow("IVA").ToString.ToDecimal.ToString("###,###,###.00")}, IEPSPS: {dRow("IEPSPS").ToString.ToDecimal.ToString("###,###,###.00") } ") + SBEliminacionCompra.Append($"-Cantidad: {dRow("Cantidad").ToString.ToDecimal().ToString("###,###,###.00") }, PS: {dRow("PS")}, Obs: {dRow("Obs")}, Sub Proyecto: {dRow("SubProyecto")}, Tipo Gasto: {dRow("TipoGasto")}, IVA: {dRow("IVA").ToString.ToDecimal.ToString("###,###,###.00")}, IEPSPS: {dRow("IEPSPS").ToString.ToDecimal.ToString("###,###,###.00") }
") Next If Not ObjGral.AddHistorialBitacora(Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, CveCompra, Nothing, "", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, diff --git a/Compras/Proveedores.aspx.vb b/Compras/Proveedores.aspx.vb index 17f4b9ac2..ccfb2ae94 100644 --- a/Compras/Proveedores.aspx.vb +++ b/Compras/Proveedores.aspx.vb @@ -2674,7 +2674,7 @@ Partial Class Compras_Proveedores End If If e.Row.RowIndex > 0 Then e.Row.FCLiteral("LtlAux").Text = String.Format("Ir", CveProveedor, e.Row.DBCampo("CveCompra")) 'DirectCast(e.Row.FindControl("ImgAbonar"), Image).Attributes.Add("onclick", String.Format("$get('HdnCveVenta').value='{0}';$get('HdnCveVentaAbono').value='{0}';$('#DivAddPago').show(1000);PosicionaObjeto('{1}', 'DivAddPago');", e.Row.DBCampo("CveCompra"), DirectCast(e.Row.FindControl("ImgAbonar"), Image).ClientID)) - If e.Row.FCHyperLink("ImgAbonar") IsNot Nothing Then e.Row.FCHyperLink("ImgAbonar").NavigateUrl = String.Format("/Bancos/PopIECompras.aspx?CveCompra={0}&TB_iframe=true&height=450&width=790", e.Row.DBCampo("CveCompra")) + If e.Row.FCHyperLink("ImgAbonar") IsNot Nothing Then e.Row.FCHyperLink("ImgAbonar").NavigateUrl = String.Format("/Bancos/PopIECompras.aspx?CveCompra={0}&TB_iframe=true&height=510&width=800", e.Row.DBCampo("CveCompra")) If CType(sender, GridView).ID = "GvCxPHistorial" Then diff --git a/Compras/RepNotasCredito.aspx b/Compras/RepNotasCredito.aspx index 95cfef677..5c8f0bec3 100644 --- a/Compras/RepNotasCredito.aspx +++ b/Compras/RepNotasCredito.aspx @@ -108,7 +108,7 @@ + DataKeyNames="CveCompra,Saldo,CveIE,CveProveedor,CvePersonal,CveMoneda,CveTipoConcepto,IdCtaContProveedores,IdCtaContExtranjera,IdCtaContComplementaria,TipoCambio,CveSubProyecto,SerieFolio"> diff --git a/Compras/RepNotasCredito.aspx.vb b/Compras/RepNotasCredito.aspx.vb index 0b7e4d24c..c3ab63854 100644 --- a/Compras/RepNotasCredito.aspx.vb +++ b/Compras/RepNotasCredito.aspx.vb @@ -156,20 +156,19 @@ Partial Class Compras_RepNotasCredito 'Dim CveCon As Integer = ObtConceptoContableProvisionCompra(CveTipoConcepto, DdlTipoComprobante.SelectedValue, DdlMoneda.SelectedValue.ToEntero, False) - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, -Importe, "", 18, Concepto, TxtFechaSaldar.Text.ToDate, IdCtaContable, -1, gr.DataKey("CveIE").ToEntero, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CvePersonal:=gr.DataKey("CvePersonal").ToEntero, ImporteMX:=-If(CveMoneda > 1 AndAlso UsaComplementaria, Importe, ImporteMN), ImporteME:=-If(CveMoneda > 1, Importe, 0), CveCompra:=gr.DataKey("CveCompra").ToEntero, CveCompraAmortizacion:=gr.DataKey("CveCompra").ToEntero, TipoCambio:=TCCompra) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, -Importe, gr.DataKey("SerieFolio"), 18, Concepto, TxtFechaSaldar.Text.ToDate, IdCtaContable, -1, gr.DataKey("CveIE").ToEntero, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CvePersonal:=gr.DataKey("CvePersonal").ToEntero, ImporteMX:=-If(CveMoneda > 1 AndAlso UsaComplementaria, Importe, ImporteMN), ImporteME:=-If(CveMoneda > 1, Importe, 0), CveCompra:=gr.DataKey("CveCompra").ToEntero, CveCompraAmortizacion:=gr.DataKey("CveCompra").ToEntero, TipoCambio:=TCCompra, CveSubProyecto:=gr.DataKey("CveSubProyecto").ToEntero) Then MsgError = "Ocurrio un Error al saldar el movimiento" End If If UsaComplementaria AndAlso CveMoneda > 1 Then ImporteComplementaria = (Importe * TCCompra - Importe).RoundSQL IdCtaContableComplementaria = gr.DataKey("IdCtaContComplementaria").ToEntero - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, -ImporteComplementaria, "", 235, Concepto, TxtFechaSaldar.Text.ToDate, IdCtaContableComplementaria, -1, CveCompra:=gr.DataKey("CveCompra").ToEntero, CveCompraAmortizacion:=gr.DataKey("CveCompra").ToEntero, CvePersonal:=gr.DataKey("CvePersonal").ToEntero, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, ImporteMX:=-ImporteComplementaria, ImporteME:=-Importe, TipoCambioPago:=TC, TipoCambio:=TCCompra) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, -ImporteComplementaria, "", 235, Concepto, TxtFechaSaldar.Text.ToDate, IdCtaContableComplementaria, -1, CveCompra:=gr.DataKey("CveCompra").ToEntero, CveCompraAmortizacion:=gr.DataKey("CveCompra").ToEntero, CvePersonal:=gr.DataKey("CvePersonal").ToEntero, CveSubProyecto:=gr.DataKey("CveSubProyecto").ToEntero, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, ImporteMX:=-ImporteComplementaria, ImporteME:=-Importe, TipoCambioPago:=TC, TipoCambio:=TCCompra) Then MsgError = "Ocurrio un Error al saldar el movimiento" End If End If - IdCtaContable = UsuarioActual.Empresa.Funcionalidad(266).ToString.ToEntero - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Importe, "", 211, Concepto, TxtFechaSaldar.Text.ToDate, IdCtaContable, -1, gr.DataKey("CveIE").ToEntero, ImporteMX:=If(CveMoneda > 1, (Importe * TC), Importe).RoundSQL, CveCuenta:=-1, CveCompra:=gr.DataKey("CveCompra").ToEntero, CveSubProyecto:=gr.DataKey("CveSubProyecto").ToEntero, CveProveedor:=gr.DataKey("CveProveedor").ToEntero) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Importe, gr.DataKey("SerieFolio"), 211, Concepto, TxtFechaSaldar.Text.ToDate, 0, -1, gr.DataKey("CveIE").ToEntero, ImporteMX:=If(CveMoneda > 1, (Importe * TC), Importe).RoundSQL, CveCuenta:=-1, CveCompra:=gr.DataKey("CveCompra").ToEntero, CveSubProyecto:=gr.DataKey("CveSubProyecto").ToEntero, CveProveedor:=gr.DataKey("CveProveedor").ToEntero) Then MsgError = "Ocurrio un Error al saldar el movimiento" End If @@ -191,44 +190,45 @@ Partial Class Compras_RepNotasCredito MsgError = "Ocurrio un Error al saldar el movimiento" End If End If - - If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, 5) Then - If ObjConta.ValorPolizaDescuadre > 0 Then - MsgError = ObjConta.MensajePolizaDescuadre - GuardaLogAD($"Ventas/Ventas-ProcesoPrePolizas | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas") - End If - End If - - If UsuarioActual.Empresa.Funcionalidad(200) = "1" AndAlso MsgError = "" Then - If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then - If MensajeAlert.ToString = "" Then - MensajeAlert.AppendFormat("Los siguientes movimientos fueron saldados correctamente:
") - End If - MensajeAlert.AppendFormat("", ObjConta.ContaIdPoliza, ObjConta.ContaFolio) - End If - End If - + If MsgError <> "" Then Exit For End If Next - If MsgError = "" Then - ObjConta.Commit() - If MensajeAlert.ToString <> "" Then + If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, 5) Then + If ObjConta.ValorPolizaDescuadre > 0 Then + MsgError = ObjConta.MensajePolizaDescuadre + GuardaLogAD($"Ventas/Ventas-ProcesoPrePolizas | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas") + End If + End If + + If UsuarioActual.Empresa.Funcionalidad(200) = "1" AndAlso MsgError = "" Then + If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then + If MensajeAlert.ToString = "" Then + MensajeAlert.AppendFormat("Los siguientes movimientos fueron saldados correctamente:
") + End If + MensajeAlert.AppendFormat("", ObjConta.ContaIdPoliza, ObjConta.ContaFolio) + End If + End If + + If MsgError = "" Then + ObjConta.Commit() + If MensajeAlert.ToString <> "" Then + Alert(MensajeAlert.ToString) + Else + Alert("Los movimientos fueron saldados correctamente.") + End If Alert(MensajeAlert.ToString) + CargaDatos() + HLSaldar.Visible = False + RegistraScript("$('#DivSaldar').modal('hide')") + LnkHabilitarSaldar.Visible = True Else - Alert("Los movimientos fueron saldados correctamente.") + ObjConta.RollBack() + Alert(MsgError, TipoMensaje.MsgError) End If - Alert(MensajeAlert.ToString) - CargaDatos() - HLSaldar.Visible = False - RegistraScript("$('#DivSaldar').modal('hide')") - LnkHabilitarSaldar.Visible = True - Else - ObjConta.RollBack() - Alert(MsgError, TipoMensaje.MsgError) End If ObjConta.Dispose() End Sub diff --git a/Compras/eFacturas.aspx b/Compras/eFacturas.aspx index 44d945232..8af65aaa1 100644 --- a/Compras/eFacturas.aspx +++ b/Compras/eFacturas.aspx @@ -578,14 +578,17 @@
+ + + +
- - +

@@ -596,7 +599,13 @@ - + + + + + + + diff --git a/Compras/eFacturas.aspx.vb b/Compras/eFacturas.aspx.vb index 6f4633835..6ba918478 100644 --- a/Compras/eFacturas.aspx.vb +++ b/Compras/eFacturas.aspx.vb @@ -1907,6 +1907,7 @@ Partial Class Compras_eFacturas cfdVer = "http://www.sat.gob.mx/cfd/2" End If namespaces.AddNamespace(Prefijo, cfdVer) + namespaces.AddNamespace("aerolineas", "http://www.sat.gob.mx/aerolineas") namespaces.AddNamespace("tfd", "http://www.sat.gob.mx/TimbreFiscalDigital") namespaces.AddNamespace("implocal", "http://www.sat.gob.mx/implocal") namespaces.AddNamespace("registrofiscal", "http://www.sat.gob.mx/registrofiscal") @@ -1963,6 +1964,7 @@ Partial Class Compras_eFacturas cfdVer = "http://www.sat.gob.mx/cfd/2" End If namespaces.AddNamespace(Prefijo, cfdVer) + namespaces.AddNamespace("aerolineas", "http://www.sat.gob.mx/aerolineas") namespaces.AddNamespace("tfd", "http://www.sat.gob.mx/TimbreFiscalDigital") namespaces.AddNamespace("implocal", "http://www.sat.gob.mx/implocal") namespaces.AddNamespace("registrofiscal", "http://www.sat.gob.mx/registrofiscal") @@ -2180,6 +2182,7 @@ Partial Class Compras_eFacturas cfdVer = "http://www.sat.gob.mx/cfd/2" End If namespaces.AddNamespace(Prefijo, cfdVer) + namespaces.AddNamespace("aerolineas", "http://www.sat.gob.mx/aerolineas") namespaces.AddNamespace("tfd", "http://www.sat.gob.mx/TimbreFiscalDigital") namespaces.AddNamespace("implocal", "http://www.sat.gob.mx/implocal") namespaces.AddNamespace("registrofiscal", "http://www.sat.gob.mx/registrofiscal") @@ -3302,6 +3305,7 @@ Partial Class Compras_eFacturas End If + namespaces.AddNamespace("aerolineas", "http://www.sat.gob.mx/aerolineas") namespaces.AddNamespace("tfd", "http://www.sat.gob.mx/TimbreFiscalDigital") @@ -4498,6 +4502,7 @@ Partial Class Compras_eFacturas Dim namespaces As New XmlNamespaceManager(XMLDoc.NameTable) namespaces.AddNamespace(XMLDoc.DocumentElement.Prefix, "http://www.sat.gob.mx/cfd/3") + namespaces.AddNamespace("aerolineas", "http://www.sat.gob.mx/aerolineas") namespaces.AddNamespace("tfd", "http://www.sat.gob.mx/TimbreFiscalDigital") namespaces.AddNamespace("pago10", "http://www.sat.gob.mx/Pagos") nodeComp = XMLDoc.SelectSingleNode(String.Format("//{0}:Complemento", XMLDoc.DocumentElement.Prefix), namespaces) diff --git a/Empresas/13/Formatos/Factura.rdlc b/Empresas/13/Formatos/Factura.rdlc index cae98ad77..15e0000f9 100644 --- a/Empresas/13/Formatos/Factura.rdlc +++ b/Empresas/13/Formatos/Factura.rdlc @@ -1,3605 +1,5 @@ - - - - - true - - - - - EXPLORACIONES MINERAS DEL DESIERTO S.A. DE C.V. RFC: EMD950206SRA - - - - - - - - - Tipo de Comprobante: I - Ingreso - - - - - - - - - Del Cobre No. 95 Col. Parque Industrial Hermosillo, Sonora. México, C.P. 83299 - - - - - - - - - Tel. 6622510249 - - - - - - - - - Régimen Fiscal: 601 - General de Ley Personas Morales - - - - - - - Textbox4 - 1.67497in - 0.75237in - 6.31315in - - - 2pt - 2pt - 2pt - 2pt - - - - Embedded - Logo1 - FitProportional - 1.06146cm - 1.91102cm - 2.76081cm - 1 - - - - - - true - true - - - - - Nombre: - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - =Parameters!ClienteNombre.Value - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - 1.19026cm - - - 1.4759cm - - - 1.29788cm - - - 1.48643cm - - - 7.60751cm - - - 1.37298cm - - - 1.42482cm - - - 1.73271cm - - - 2.4815cm - - - - - 0.48536cm - - - - - true - - - - - Cantidad - - - - - - - Textbox34 - - - - Black - - - - Black - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Codigo - - - - - - - Textbox15 - - - - Black - - - - Black - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - C.U. SAT - - - - - - - Textbox75 - - - - Black - - - - Black - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Clave Prod. - - - - - - - Textbox82 - - - - Black - - - - Black - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - - - - Descripción - - - - - - - Textbox79 - - - - Black - - - - Black - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Obj. Imp. - - - - - - - Textbox7 - - - - Black - - - - Black - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - - - - P.U. - - - - - - - Textbox84 - - - - Black - - - - Black - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Impuestos - - - - - - - Textbox91 - - - - Black - - - - Black - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - - - - Importe - - - - - - - - - - - - - - - - Black - - - - Black - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.48536cm - - - - - true - true - - - - - =Fields!Cantidad.Value - - - - - - - Cantidad1 - - - - #4f81bd - - - #4f81bd - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Codigo.Value - - - - - - - Codigo1 - - - - #4f81bd - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!SATClaveUM.Value - - - - - - - SATClaveUM - - - - #4f81bd - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!SATClaveProdServ.Value - - - - - - - SATClaveProdServ - - - - #4f81bd - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!PS.Value & " " & Fields!Obs.Value - - - - - - - #4f81bd - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!CodigoObjetoImpuesto.Value - - - - - - - #4f81bd - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!PU.Value - - - - - - - PU1 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ImporteIVA.Value - - - - - - - ImporteIVA - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Cantidad.Value*Fields!PU.Value - - - - - - - Textbox88 - - - - #4f81bd - - - #4f81bd - - 2pt - 2pt - 2pt - 2pt - es-MX - - - - - - - - - - - - - - - - - - - - - - - - - After - - - - - - - DsOC - 4.63617cm - 0.21985cm - 0.97072cm - 20.06999cm - 4 - - - 8pt - - - - true - true - true - - - - - =Parameters!ClienteDatoExtra1.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - 3.15414cm - - - - - 0.5841cm - - - - - true - true - - - - - =Fields!Importe.Value - - - - - - - Importe - - - 2pt - 2pt - 2pt - 2pt - es-MX - - - - - - - - 0.66667cm - - - - - true - true - - - - - =Replace(Parameters!Moneda.Value,"Pesos","Peso mexicano") - - - - - - - Textbox47 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - =Fields!ImpuestoLocal.Value - - - - 2.52863cm - - - true - true - - - - - =Fields!ImpuestoLocal.Value - - - - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - 2.52863cm - - - true - true - - - - - Moneda - - - - - - White - 2pt - 2pt - 2pt - 2pt - - - - - Before - - - - DataSet1 - 7.01572cm - 14.60707cm - 1.25076cm - 5.68277cm - 6 - - - - - - true - true - - - - - Folio Factura - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =IIF(Parameters!Serie.Value.ToString="",Parameters!Folio.Value,Parameters!Serie.Value & "-" &Parameters!Folio.Value) - - - - - - - Textbox3 - 1.84362cm - 17.17098cm - 0.41303cm - 3.066cm - 8 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Fecha - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!Fecha.Value - - - - - - - Textbox12 - 2.27076cm - 17.17098cm - 0.42714cm - 3.066cm - 10 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Lugar de Expedición - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - 83299 - - - - - - - Textbox55 - 2.77551cm - 17.17098cm - 0.46681cm - 3.05452cm - 12 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Forma de Pago - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!FormaPago.Value - - - - - - - Textbox3 - 1.8799cm - 4.25442cm - 0.42944cm - 6.76133cm - 14 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Método de Pago - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =IIF(Parameters!MetodoPago.Value.ToString="","No Identificado",Parameters!MetodoPago.Value) - - - - - - - Textbox3 - 2.29523cm - 4.25442cm - 0.40122cm - 6.76133cm - 16 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Moneda - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!Moneda.Value - - - - - - - - Tipo de Cambio - - - - - - - - =Parameters!TipoCambio.Value - - - - - - - - - - - Textbox3 - 2.74584cm - 4.25442cm - 0.43297cm - 6.76133cm - 18 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Datos del Cliente - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - R.F.C.: - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - =Parameters!ClienteRFC.Value - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Uso CFDI: - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - =Parameters!UsoCFDI.Value - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Domicilio: - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!ClienteDireccion.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - OBSERVACIONES GENERALES: - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!Observaciones.Value - - - - - - - Textbox3 - 6.90978cm - 4.83044cm - 0.44003cm - 9.60024cm - 27 - - - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - =Parameters!ImporteLetra.Value - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Importe Con Letra: - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Este documento es una representación impresa de un CFDI Version - - - - =IIf(Parameters!CFDIVersion.Value = "4.0","4.0","3.3") - - - - - - - Textbox19 - 3.39026in - 14.1724cm - 0.13921in - 2.40844in - 30 - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!SelloCFDI.Value - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Sello Digital del CFDI - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!SelloSAT.Value - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Sello SAT - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!CadenaSAT.Value - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Cadena Original del Complemento del Certificación Digital del SAT - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - true - true - - - - - CFDI Relacionados - - - - - - - Textbox5 - 0.02226cm - 1.30058cm - 0.46066cm - 18.98926cm - - - White - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Tipo Relación: - - - - - - - Textbox29 - 0.57625cm - 5.06432cm - 0.41981cm - 5.31841cm - 1 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!TipoRelacionTexto.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - 2.42456cm - - - 2.05585cm - - - 3.03631cm - - - 7.7847cm - - - - - 0.44125cm - - - - - true - true - - - - - Folio - - - - - - - Textbox10 - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Fecha - - - - - - - Textbox12 - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Importe - - - - - - - Textbox21 - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Folio Fiscal - - - - - - - Textbox11 - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.41479cm - - - - - true - true - - - - - =Fields!SerieFolio.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Fecha.Value - - - - - - - Fecha - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Importe.Value - - - - - - - Importe1 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!FolioFiscal.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - After - - - - - - - DataSet4 - 1.07893cm - 3.56258cm - 0.85604cm - 15.30142cm - 3 - - - - - - true - 11.9011cm - 1.93497cm - 20.28984cm - 37 - - =Microsoft.VisualBasic.Interaction.IIF(First(Fields!SerieFolio.Value, "DataSet4") <> "", False, True) - - - - - - - - - CartaPorteTimbrado - - - =Parameters!SRP_LogoPath.Value - - - =Parameters!SRP_RFC.Value - - - =Parameters!SRP_SerieFolio.Value - - - =Parameters!SRP_DomicilioFiscal.Value - - - =Parameters!SRP_RegimenFiscal.Value - - - =Parameters!SRP_DomicilioExpedicion.Value - - - =Parameters!SRP_ClienteDireccion.Value - - - =Parameters!SRP_ClienteNombre.Value - - - =Parameters!SRP_ClienteRFC.Value - - - =Parameters!SRP_MedioTransporte.Value - - - =Parameters!SRP_TransporteInternacional.Value - - - =Parameters!SRP_FolioFiscal.Value - - - =Parameters!SRP_FechaCertificacion.Value - - - =Parameters!SRP_CertificadoContribuyente.Value - - - =Parameters!SRP_SerieCertificadoSAT.Value - - - =Parameters!SRP_SelloCFDI.Value - - - =Parameters!SRP_CadenaOriginal.Value - - - =Parameters!SRP_SelloSAT.Value - - - =Parameters!SRP_QR.Value - - - =Parameters!SRP_PermisoSTCC.Value - - - =Parameters!SRP_NumPermiso.Value - - - =Parameters!SRP_Aseguradora.Value - - - =Parameters!SRP_NumPoliza.Value - - - =Parameters!SRP_PlacaVM.Value - - - =Parameters!SRP_AnioVM.Value - - - =Parameters!SRP_TipoTI.Value - - - =Parameters!SRP_ViaTI.Value - - - =Parameters!SRP_UsoCFDi.Value - - - =Parameters!SRP_SubTotal.Value - - - =Parameters!SRP_Total.Value - - - =Parameters!SRP_Descuentos.Value - - - =Parameters!SRP_NombreAseguradoraMedioAmbiente.Value - - - =Parameters!SRP_NumPolizaSeguroMedioAmbiente.Value - - - =Parameters!SRP_NombreAseguradoraCarga.Value - - - =Parameters!SRP_NumPolizaSeguroCarga.Value - - - =Parameters!SRP_RemolquePlaca1.Value - - - =Parameters!SRP_RemolqueSubtimo1.Value - - - =Parameters!SRP_RemolquePlaca2.Value - - - =Parameters!SRP_RemolqueSubtimo2.Value - - - =True - - - =Parameters!SRP_PesoNetoTotal.Value - - - =Parameters!SRP_DistanciaTotal.Value - - - =Parameters!SRP_UnidadPeso.Value - - - =Parameters!SRP_NumTotalMercancias.Value - - - =Parameters!SRP_PermisoSCTRemolque1.Value - - - =Parameters!SRP_PermisoSCTRemolque2.Value - - - =Parameters!SRP_ConfATR1.Value - - - =Parameters!SRP_ConfATR2.Value - - - 0.06863cm - 1.11461cm - 20.12945cm - - - - - - true - 5.65275cm - 1.2341cm - 20.2229cm - 38 - - = Not iif(IsNothing(Parameters!TieneCartaPorte), True, iif(Parameters!TieneCartaPorte.Value , True, False)) - - - - - - - true - true - - - - - Regimen Fiscal: - - - - - - - Textbox19 - 1.62527in - 10.5005cm - 0.17222in - 0.82757in - 39 - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - =Parameters!RegimenFiscalCodigo.Value - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - External - =Parameters!QR.Value - FitProportional - 0.06848in - 0.0372in - 0.51336in - 0.79074in - - - - - - true - true - - - - - Serie del Certificado del Emisor - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Folio Fiscal - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - No. de Serie del Certificado de l SAT - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Fecha y Hora de Certificación - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!CertificadoContribuyente.Value - - - - - - - Textbox2 - 0cm - 8.1126cm - 0.35889cm - 5.62289cm - 5 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!FolioFiscal.Value - - - - - - - Textbox2 - 0.39417cm - 8.1126cm - 0.33067cm - 5.62289cm - 6 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!SerieCertificadoSAT.Value - - - - - - - Textbox2 - 0.76717cm - 8.1126cm - 0.3536cm - 5.62289cm - 7 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!FechaCertificacion.Value - - - - - - - Textbox2 - 1.1631cm - 8.1126cm - 0.31479cm - 5.62289cm - 8 - - - 2pt - 2pt - 2pt - 2pt - - - - true - 7.84409cm - 0.19628cm - 1.6525cm - 13.9708cm - 41 - - - - - - 13.83608cm - - - - - - - Textbox3 - 0.04232cm - 16.6252cm - 0.30896cm - 3.66464cm - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Fecha Impresión: - - - - - - - - =Today - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 27.94cm - 21.59cm - 0.5cm - 0.5cm - 1cm - 0.5cm - 1.27cm - + + + + + + + + Tipo de Comprobante: I - Ingreso + + + + + + + + + Del Cobre No. 95 Col. Parque Industrial Hermosillo, Sonora. México, C.P. 83299 + + + + + + + + + Tel. 6622510249 + + + + + + + + + Régimen Fiscal: 601 - General de Ley Personas Morales + + + + + + + Textbox4 + 1.67497in + 0.75237in + 6.31315in + + + 2pt + 2pt + 2pt + 2pt + + + + Embedded + Logo1 + FitProportional + 1.06146cm + 1.91102cm + 2.76081cm + 1 + + + + + + true + true + + + + + Nombre: + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + =Parameters!ClienteNombre.Value + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + 1.19026cm + + + 1.10859cm + + + 1.29788cm + + + 1.48643cm + + + 7.60751cm + + + 1.25656cm + + + 1.91588cm + + + 1.72538cm + + + 2.4815cm + + + + + 0.48536cm + + + + + true + + + + + Cantidad + + + + + + + Textbox34 + + + + Black + + + + Black + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Codigo + + + + + + + Textbox15 + + + + Black + + + + Black + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + C.U. SAT + + + + + + + Textbox75 + + + + Black + + + + Black + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Clave Prod. + + + + + + + Textbox82 + + + + Black + + + + Black + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + + + + Descripción + + + + + + + Textbox79 + + + + Black + + + + Black + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Obj. Imp. + + + + + + + Textbox7 + + + + Black + + + + Black + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + + + + P.U. + + + + + + + Textbox84 + + + + Black + + + + Black + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Impuestos + + + + + + + Textbox91 + + + + Black + + + + Black + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + + + + Importe + + + + + + + + + + + + + + + + Black + + + + Black + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.48536cm + + + + + true + true + + + + + =Fields!Cantidad.Value + + + + + + + Cantidad1 + + + + #4f81bd + + + #4f81bd + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Codigo.Value + + + + + + + Codigo1 + + + + #4f81bd + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!SATClaveUM.Value + + + + + + + SATClaveUM + + + + #4f81bd + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!SATClaveProdServ.Value + + + + + + + SATClaveProdServ + + + + #4f81bd + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PS.Value & " " & Fields!Obs.Value + + + + + + + #4f81bd + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!CodigoObjetoImpuesto.Value + + + + + + + #4f81bd + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PU.Value + + + + + + + PU1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ImporteIVA.Value + + + + + + + ImporteIVA + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Cantidad.Value*Fields!PU.Value + + + + + + + Textbox88 + + + + #4f81bd + + + #4f81bd + + 2pt + 2pt + 2pt + 2pt + es-MX + + + + + + + + + + + + + + + + + + + + + + + + + After + + + + + + + DsOC + 4.63617cm + 0.21985cm + 0.97072cm + 20.06999cm + 4 + + + 8pt + + + + true + true + true + + + + + =Parameters!ClienteDatoExtra1.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + 3.15414cm + + + + + 0.5841cm + + + + + true + true + + + + + =Fields!Importe.Value + + + + + + + Importe + + + 2pt + 2pt + 2pt + 2pt + es-MX + + + + + + + + 0.66667cm + + + + + true + true + + + + + =Replace(Parameters!Moneda.Value,"Pesos","Peso mexicano") + + + + + + + Textbox47 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + =Fields!ImpuestoLocal.Value + + + + 2.52863cm + + + true + true + + + + + =Fields!ImpuestoLocal.Value + + + + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + 2.52863cm + + + true + true + + + + + Moneda + + + + + + White + 2pt + 2pt + 2pt + 2pt + + + + + Before + + + + DataSet1 + 7.01572cm + 14.60707cm + 1.25077cm + 5.68277cm + 6 + + + + + + true + true + + + + + Folio Factura + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =IIF(Parameters!Serie.Value.ToString="",Parameters!Folio.Value,Parameters!Serie.Value & "-" &Parameters!Folio.Value) + + + + + + + Textbox3 + 1.84362cm + 17.17098cm + 0.41303cm + 3.066cm + 8 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Fecha.Value + + + + + + + Textbox12 + 2.27076cm + 17.17098cm + 0.42714cm + 3.066cm + 10 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Lugar de Expedición + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + 83299 + + + + + + + Textbox55 + 2.77551cm + 17.17098cm + 0.46681cm + 3.05452cm + 12 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Forma de Pago + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!FormaPago.Value + + + + + + + Textbox3 + 1.8799cm + 4.25442cm + 0.42944cm + 6.76133cm + 14 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Método de Pago + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =IIF(Parameters!MetodoPago.Value.ToString="","No Identificado",Parameters!MetodoPago.Value) + + + + + + + Textbox3 + 2.29523cm + 4.25442cm + 0.40122cm + 6.76133cm + 16 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Moneda + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Moneda.Value + + + + + + + + Tipo de Cambio + + + + + + + + =Parameters!TipoCambio.Value + + + + + + + + + + + Textbox3 + 2.74584cm + 4.25442cm + 0.43297cm + 6.76133cm + 18 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Datos del Cliente + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + R.F.C.: + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + =Parameters!ClienteRFC.Value + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Uso CFDI: + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + =Parameters!UsoCFDI.Value + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Domicilio: + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!ClienteDireccion.Value + + + + , + + + + =UCase(Parameters!ClienteCiudad.Value) + + + + , + + + + =UCase(Parameters!ClienteEstado.Value) + + + + , + + + + =UCase(Parameters!ClientePais.Value) + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + OBSERVACIONES GENERALES: + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Observaciones.Value + + + + + + + Textbox3 + 6.90978cm + 4.83044cm + 0.44003cm + 9.60024cm + 27 + + + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + =Parameters!ImporteLetra.Value + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Importe Con Letra: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Este documento es una representación impresa de un CFDI Version + + + + =IIf(Parameters!CFDIVersion.Value = "4.0","4.0","3.3") + + + + + + + Textbox19 + 3.39026in + 14.1724cm + 0.13921in + 2.40844in + 30 + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!SelloCFDI.Value + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Sello Digital del CFDI + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!SelloSAT.Value + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Sello SAT + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!CadenaSAT.Value + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Cadena Original del Complemento del Certificación Digital del SAT + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + true + true + + + + + CFDI Relacionados + + + + + + + Textbox5 + 0.02226cm + 1.30058cm + 0.46066cm + 18.98926cm + + + White + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Tipo Relación: + + + + + + + Textbox29 + 0.57625cm + 5.06432cm + 0.41981cm + 5.31841cm + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!TipoRelacionTexto.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + 2.42456cm + + + 2.05585cm + + + 3.03631cm + + + 7.7847cm + + + + + 0.44125cm + + + + + true + true + + + + + Folio + + + + + + + Textbox10 + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Fecha + + + + + + + Textbox12 + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Importe + + + + + + + Textbox21 + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Folio Fiscal + + + + + + + Textbox11 + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.41479cm + + + + + true + true + + + + + =Fields!SerieFolio.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Fecha.Value + + + + + + + Fecha + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Importe.Value + + + + + + + Importe1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!FolioFiscal.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + After + + + + + + + DataSet4 + 1.07893cm + 3.56258cm + 0.85604cm + 15.30142cm + 3 + + + + + + true + 11.9011cm + 1.93497cm + 20.28984cm + 37 + + =Microsoft.VisualBasic.Interaction.IIF(First(Fields!SerieFolio.Value, "DataSet4") <> "", False, True) + + + + + + + + + CartaPorteTimbrado + + + =Parameters!SRP_LogoPath.Value + + + =Parameters!SRP_RFC.Value + + + =Parameters!SRP_SerieFolio.Value + + + =Parameters!SRP_DomicilioFiscal.Value + + + =Parameters!SRP_RegimenFiscal.Value + + + =Parameters!SRP_DomicilioExpedicion.Value + + + =Parameters!SRP_ClienteDireccion.Value + + + =Parameters!SRP_ClienteNombre.Value + + + =Parameters!SRP_ClienteRFC.Value + + + =Parameters!SRP_MedioTransporte.Value + + + =Parameters!SRP_TransporteInternacional.Value + + + =Parameters!SRP_FolioFiscal.Value + + + =Parameters!SRP_FechaCertificacion.Value + + + =Parameters!SRP_CertificadoContribuyente.Value + + + =Parameters!SRP_SerieCertificadoSAT.Value + + + =Parameters!SRP_SelloCFDI.Value + + + =Parameters!SRP_CadenaOriginal.Value + + + =Parameters!SRP_SelloSAT.Value + + + =Parameters!SRP_QR.Value + + + =Parameters!SRP_PermisoSTCC.Value + + + =Parameters!SRP_NumPermiso.Value + + + =Parameters!SRP_Aseguradora.Value + + + =Parameters!SRP_NumPoliza.Value + + + =Parameters!SRP_PlacaVM.Value + + + =Parameters!SRP_AnioVM.Value + + + =Parameters!SRP_TipoTI.Value + + + =Parameters!SRP_ViaTI.Value + + + =Parameters!SRP_UsoCFDi.Value + + + =Parameters!SRP_SubTotal.Value + + + =Parameters!SRP_Total.Value + + + =Parameters!SRP_Descuentos.Value + + + =Parameters!SRP_NombreAseguradoraMedioAmbiente.Value + + + =Parameters!SRP_NumPolizaSeguroMedioAmbiente.Value + + + =Parameters!SRP_NombreAseguradoraCarga.Value + + + =Parameters!SRP_NumPolizaSeguroCarga.Value + + + =Parameters!SRP_RemolquePlaca1.Value + + + =Parameters!SRP_RemolqueSubtimo1.Value + + + =Parameters!SRP_RemolquePlaca2.Value + + + =Parameters!SRP_RemolqueSubtimo2.Value + + + =True + + + =Parameters!SRP_PesoNetoTotal.Value + + + =Parameters!SRP_DistanciaTotal.Value + + + =Parameters!SRP_UnidadPeso.Value + + + =Parameters!SRP_NumTotalMercancias.Value + + + =Parameters!SRP_PermisoSCTRemolque1.Value + + + =Parameters!SRP_PermisoSCTRemolque2.Value + + + =Parameters!SRP_ConfATR1.Value + + + =Parameters!SRP_ConfATR2.Value + + + 0.06863cm + 1.11461cm + 20.12945cm + + + + + + true + 5.65275cm + 1.2341cm + 20.2229cm + 38 + + = Not iif(IsNothing(Parameters!TieneCartaPorte), True, iif(Parameters!TieneCartaPorte.Value , True, False)) + + + + + + + true + true + + + + + Regimen Fiscal: + + + + + + + Textbox19 + 1.62527in + 10.5005cm + 0.17222in + 0.82757in + 39 + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + =Parameters!RegimenFiscalCodigo.Value + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + External + =Parameters!QR.Value + FitProportional + 0.06848in + 0.0372in + 0.51336in + 0.79074in + + + + + + true + true + + + + + Serie del Certificado del Emisor + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Folio Fiscal + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + No. de Serie del Certificado de l SAT + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha y Hora de Certificación + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!CertificadoContribuyente.Value + + + + + + + Textbox2 + 8.1126cm + 0.35889cm + 5.62289cm + 5 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!FolioFiscal.Value + + + + + + + Textbox2 + 0.39417cm + 8.1126cm + 0.33067cm + 5.62289cm + 6 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!SerieCertificadoSAT.Value + + + + + + + Textbox2 + 0.76717cm + 8.1126cm + 0.3536cm + 5.62289cm + 7 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!FechaCertificacion.Value + + + + + + + Textbox2 + 1.1631cm + 8.1126cm + 0.31479cm + 5.62289cm + 8 + + + 2pt + 2pt + 2pt + 2pt + + + + true + 7.84409cm + 0.19628cm + 1.6525cm + 13.9708cm + 41 + + + + + + 13.83608cm + + + + + + + Textbox3 + 0.04232cm + 16.6252cm + 0.30896cm + 3.66464cm + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha Impresión: + + + + + + + + =Today + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 27.94cm + 21.59cm + 0.5cm + 0.5cm + 1cm + 0.5cm + 1.27cm + - - - =Parameters!Serie.Value - - - - - - - - - =Parameters!Folio.Value - - - - Por éste pagare prometo (emos) pagar incondicionalmente a la orden de VALPA SUPERVISIONES SA DE CV, a su vencimiento el - - - - =Parameters!Vencimiento.Value - - - - , en Hermosillo, Sonora o en el domicilio señalado a elección del acreedor o tenedor la cantidad de $ - - - - =Parameters!Total.Value - - - - SON: ( - - - - =Microsoft.VisualBasic.Strings.UCase(Parameters!ImporteLetra.Value) - - - - ). Valor recibido a mi (nuestra) entera satisfacción. la falta de pago de éste documento a su vencimiento dará derecho a VALPA SUPERVISIONES SA DE CV o tenedor, desde el día siguiente a cobrar el 10% mensual de interes moratorios hasta su total liquidación y los gastos judiciales que se ocasionen. Lugar y Fecha de Suscripción: Hermosillo, Sonora a - - - - =CDATE(Parameters!Fecha.Value).ToString("dd/MM/yyyy") - - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Nombre: - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Dirección: - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!ClienteNombre.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!ClienteDireccion.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Acepto de conformidad - - - - - - 2pt - 2pt - 2pt - 2pt - - - - 3.15cm - 15.1696cm - 0cm - 4.87315cm - 6 - - - - @@ -1533,10 +1150,8 @@ true - 3.58328cm 1.82156cm 20.12951cm - 7 =Microsoft.VisualBasic.Interaction.iif(Parameters!TipoRelacionTexto.Value <> "" Or Parameters!FolioFiscalRelacionado.Value <> "", False, True) @@ -1573,11 +1188,11 @@ Textbox5 - 5.54595cm + 1.96267cm 15.89718cm 0.49387cm 4.14557cm - 8 + 1 @@ -1590,8 +1205,8 @@ true - 17.24694cm - 6.03982cm + 17.27869cm + 2.45654cm 20.18336cm 16 @@ -1602,7 +1217,7 @@ - + 1.5pt @@ -1636,7 +1251,7 @@ Textbox19 1.60478in - 6.03032in + 6.03465in 0.22222in 1.89794in 17 @@ -2462,7 +2077,7 @@ - =Parameters!Moneda.Value + =IIF(Parameters!Moneda.Value="Pesos", "Peso Mexicano",Parameters!Moneda.Value) + true @@ -2593,7 +2209,7 @@ true 6.48302cm - 0.17537cm + 0.18636cm 7.01685cm 20.00799cm 18 @@ -3107,7 +2723,7 @@ true 13.60571cm - 0.17537cm + 0.18636cm 3.53187cm 20.00799cm 19 @@ -4522,9 +4138,9 @@ DsOC 4.62939cm - 0.17537cm + 0.18636cm 1.75603cm - 19.86738cm + 19.86739cm 20 - 23.28676cm + 19.73523cm + Asistencia Cheador diff --git a/RH/ChecadorAsistencia.aspx b/RH/ChecadorAsistencia.aspx index 6e53815a5..b5d33bea8 100644 --- a/RH/ChecadorAsistencia.aspx +++ b/RH/ChecadorAsistencia.aspx @@ -5,7 +5,7 @@ - ASistencia Cheador + Asistencia Cheador diff --git a/TareasProgramadas/Tareas119.ashx b/TareasProgramadas/Tareas119.ashx index 57bdafa48..aaf580219 100644 --- a/TareasProgramadas/Tareas119.ashx +++ b/TareasProgramadas/Tareas119.ashx @@ -26,7 +26,7 @@ public class TareasJam : IHttpHandler switch (Metodo) { case "TestConexion": - retorno = PruebaConexionFTP("ftp://thalamus.exavault.com", "agrojam", "A12345678"); + retorno = PruebaConexionFTP("ftp://ftp.thalamuslive.com", "agrojam", "A12345678"); break; case "EjecutaThalamus": @@ -112,7 +112,7 @@ public class TareasJam : IHttpHandler //string FTPPass = "agj-3500"; - string FTPServer = "ftp://thalamus.exavault.com"; + string FTPServer = "ftp://ftp.thalamuslive.com"; string TFPUsr = "agrojam"; string FTPPass = "A12345678"; @@ -677,7 +677,7 @@ public class TareasJam : IHttpHandler { bool Respuesta = false; - FtpWebRequest request =(FtpWebRequest)WebRequest.Create($"{FTPServer}/Test.log"); + FtpWebRequest request =(FtpWebRequest)WebRequest.Create($"{FTPServer}/clientes/Test.xlsx"); request.Method = WebRequestMethods.Ftp.ListDirectory; request.Credentials = new NetworkCredential(FTPUsr, FTPPass); diff --git a/Ventas/CatUnidadesMedida.aspx.vb b/Ventas/CatUnidadesMedida.aspx.vb index 259a38460..f075d3b40 100644 --- a/Ventas/CatUnidadesMedida.aspx.vb +++ b/Ventas/CatUnidadesMedida.aspx.vb @@ -31,7 +31,7 @@ Partial Class CatUnidadesMedida Dim ObjUnidadesMedida As New ClsUnidadesMedida If ObjUnidadesMedida.GetUnidadesMedida(UsuarioActual.CveEmpresa) Then - GlobalDTUnidadesMedida = ObjUnidadesMedida.DtResultados + GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa) = Nothing ViewState("DTUnidadesMedida") = ObjUnidadesMedida.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) GvDatos.DataSource = ViewState("DTUnidadesMedida") GvDatos.DataBind() @@ -293,7 +293,7 @@ Partial Class CatUnidadesMedida If ObjUnidadesMedida.UpdateUnidadMedida(TxtUnidadMedida.Text.Trim, TxtAbreviatura.Text.Trim, "", "", "", CBool(Estatus), UsuarioActual.CveUsuario, HdnID.Value.ToEntero, DdlSATUnidadMedida.SelectedValue.ToEntero) Then GvDatos.EditIndex = -1 - GlobalDTUnidadesMedida = ObjUnidadesMedida.DtResultados + GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa) = Nothing ViewState("DTUnidadesMedida") = ObjUnidadesMedida.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) End If