diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb index 23bdee732..79167e0a2 100644 --- a/App_Code/ClsGenerales.vb +++ b/App_Code/ClsGenerales.vb @@ -134,6 +134,42 @@ Public Class ClsGenerales End Sub + Public Function RepConciliacionSatGET(cveEmpresa As Int32, tipoDocto As String, fechaI As String, fechaF As String) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_RepConciliacionSatGET", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa + .Add("@TipoDocto", SqlDbType.VarChar).Value = tipoDocto + .Add("@FechaI", SqlDbType.VarChar).Value = fechaI + .Add("@FechaF", SqlDbType.VarChar).Value = fechaF + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los registros de Conciliaciones SAT.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function + Public Function SAT_DescargaSolicitudesGET(CveEmpresa As Int32, tipo As Int32, fIngInicio As String, fIngFin As String, fSolInicio As String, fSolFin As String) As Boolean + Dim retorno As Boolean = False + DataAdapter("[PA_SAT_DescargaSolicitudesGET]", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@Tipo", SqlDbType.Int).Value = tipo + .Add("@FIngInicio", SqlDbType.VarChar).Value = fIngInicio + .Add("@FIngFin", SqlDbType.VarChar).Value = fIngFin + .Add("@FSolInicio", SqlDbType.VarChar).Value = fSolInicio + .Add("@FSolFin", SqlDbType.VarChar).Value = fSolFin + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los registros de solicitudes CFDI SAT.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function #Region " I N D I C A D O R E S Y G R A F I C A S" Public Function GetIndicadores(CveEmpresa As Integer) As DataSet 'Dim Retorno As Boolean = False diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index e5ff86535..150011e9b 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -3483,6 +3483,8 @@ Public Class ClsPaginas PaginaDict.Add("/Inicio.aspx".ToUpper(), -1) PaginaDict.Add("/Ventas/RepConciliacionEmitidosSat.aspx".ToUpper(), -1) + PaginaDict.Add("/Ventas/RepConciliacionSat.aspx".ToUpper(), 716) + PaginaDict.Add("/Ventas/SolicitudesSAT.aspx".ToUpper(), 717) PaginaDict.Add("/Nomina/CatConceptos2.aspx".ToUpper(), -1) PaginaDict.Add("/Nomina/Aguinaldo.aspx".ToUpper(), -1) diff --git a/Bancos/FluctuacionCambiaria.aspx.vb b/Bancos/FluctuacionCambiaria.aspx.vb index a9981710e..64f05ff7c 100644 --- a/Bancos/FluctuacionCambiaria.aspx.vb +++ b/Bancos/FluctuacionCambiaria.aspx.vb @@ -465,6 +465,8 @@ Partial Class Bancos_FluctuacionCambiaria Dim Total As Decimal = 0 Dim Conta As New ClsContabilidad Dim Banco As New ClsBancos(Conta.IniciaTransacSQL()) + Dim ObjContPaq As New ClsContPAQi(UsuarioActual.Empresa) + ObjContPaq.IniciaTransacSQL() Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaFilial", 1, 0, 0, 1, TxtFecha.Text.ToDate, "Fluctuación Filiales", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Dim idCta As Integer = 0 Dim CveCuenta As Integer = 0 @@ -524,13 +526,29 @@ Partial Class Bancos_FluctuacionCambiaria Next If Not ErrorRegistrar Then + + 'Inicio auto conta + Dim AutoConta As Boolean = UsuarioActual.Empresa.Funcionalidad(200) = "1" + If AutoConta Then + + If Conta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjContPaq) Then + Else + Alert("Ocurrio un Error al contabilizar, pongase en contacto con Soporte Técnico", TipoMensaje.MsgError) + End If + End If + + If ObjContPaq IsNot Nothing Then ObjContPaq.Commit() + 'Fin autoconta Conta.Commit() + Alert(String.Format("La Fluctuación se ha generado
Ver Póliza", CvePrePoliza), TipoMensaje.MsgInformacion) Else Conta.RollBack() + ObjContPaq.RollBack() End If Conta.Dispose() Banco.Dispose() + ObjContPaq.Dispose() End Sub #End Region diff --git a/Bancos/PopIEVentas.aspx.vb b/Bancos/PopIEVentas.aspx.vb index cf4f7d2b5..db600b31e 100644 --- a/Bancos/PopIEVentas.aspx.vb +++ b/Bancos/PopIEVentas.aspx.vb @@ -1556,6 +1556,7 @@ Partial Class Bancos_PopIEVentas Select Case ConceptoContable Case 2 'Pago Cliente If RBLContado.SelectedValue.Contiene("3", "4", "5") Then + 'If CveMonedaVenta > 1 Then ConceptoContable = 292 For Each rw As GridViewRow In GvIngresos.Rows If rw.FCCheckBox("Chk").Checked Then If CveMoneda = 1 AndAlso CveMonedaVenta = 1 Then diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 3d24b5aef..6d3b6c35f 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -5833,9 +5833,15 @@ Partial Class Compras_Compras CveCuenta = ObjConta.DtResultados.Rows(0)("IdCuentaRetIVACirculacionSIG").ToString.ToEntero End If End If - End If - - 'Agregamos el Opuesto del 22 -> 15 + End If + + + If UsuarioActual.Empresa.Funcionalidad(577).ToEntero = 1 Then + IdCtaContable = UsuarioActual.Empresa.Funcionalidad(578).ToEntero + End If + + + 'Agregamos el Opuesto del 22 -> 15 If importeMovimiento <> 0 Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, importeMovimiento, Referencia, 15, Concepto + If(tipoCambioActual > 1, $" TC: {tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}", ""), FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CvePersonal:=CvePersonal, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMovimiento * tipoCambioActual, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, Contabilizable:=SeContabiliza, TipoCambio:=tipoCambioActual) Then ErrorPrepoliza = True @@ -8472,7 +8478,9 @@ Partial Class Compras_Compras If DdlRetIVAConcepto.Items.Count > 0 Then If DdlRetIVAConcepto.SelectedValue.ToEntero = 1 Then ImporteMovimiento = Math.Round(PorcentajePago * TxtRetIVA.Text.ToDecimal, 2) - importeMN = ImporteMovimiento * tipoCambio + importeMN = ImporteMovimiento * tipoCambio + + If CtaProveedorRetIVA > 0 Then IdCtaContable = CtaProveedorRetIVA CveCuenta = CveCuentaProveedorRetIVA @@ -8486,10 +8494,19 @@ Partial Class Compras_Compras End If End If End If - End If + + + If UsuarioActual.Empresa.Funcionalidad(577).ToEntero = 1 Then + IdCtaContable = UsuarioActual.Empresa.Funcionalidad(578).ToEntero + End If + + + End If End If + End If + Case 183 'RetIVA x Acreditar Fletes P.F. If Not gvr.DataKey("TipoDocto").Contiene("NC", "DEV", "Ant") Then If DdlRetIVAConcepto.Items.Count > 0 Then @@ -19077,7 +19094,7 @@ Partial Class Compras_Compras Dim ObjPS As New ClsProductosServicios If ObjPS.AddPSSimplificado(PS) > 0 Then Alert("El P/S fue agregado correctamente.") - RecargaGlobalEquivalencias() + GeneraGlobalDT(Nothing) End If ObjPS.Dispose() @@ -19089,18 +19106,11 @@ Partial Class Compras_Compras UpAgregarPS.Update() - RegistraScript("$('#DivAgregarPS').modal('hide');") - RecargaPSGlobal() - End Sub - Private Sub RecargaPSGlobal() - 'GlobalDTPSSimplificado(UsuarioActual.CveEmpresa) = Nothing - 'Dim ObjPS As New ClsProductosServicios + RegistraScript("$('#DivAgregarPS').modal('hide');") - 'If ObjPS.GetPSSimplificado(-1) Then Application("GlobalDTPSSimplificado") = ObjPS.DtResultados.AsEnumerable() - - 'ObjPS.Dispose() End Sub + #End Region #Region "TIPO DE COMPRA" diff --git a/Compras/RepRembolsoComprobaciones.aspx b/Compras/RepRembolsoComprobaciones.aspx index e55f48af0..854a49898 100644 --- a/Compras/RepRembolsoComprobaciones.aspx +++ b/Compras/RepRembolsoComprobaciones.aspx @@ -106,6 +106,7 @@
+
@@ -120,7 +121,7 @@
- +
diff --git a/Contabilidad/RegPrePoliza.aspx.vb b/Contabilidad/RegPrePoliza.aspx.vb index d867a4a8e..623229efd 100644 --- a/Contabilidad/RegPrePoliza.aspx.vb +++ b/Contabilidad/RegPrePoliza.aspx.vb @@ -817,7 +817,11 @@ Partial Class ContabilidadC_RegPrePoliza If CvePrePoliza > 0 Then 'Nuevo Modulo Charlie - ActualizarPrePoliza() + ActualizarPrePoliza() + + + + Else Dim MensajeAlert = New StringBuilder Dim ObjIE As New ClsBancos() @@ -966,10 +970,19 @@ Partial Class ContabilidadC_RegPrePoliza Dim OcurrioError As Boolean = False Dim ObjContabilidad As New ClsContabilidad - ObjContabilidad.IniciaTransacSQL() + ObjContabilidad.IniciaTransacSQL() + + + + If Not ObjContabilidad.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False) Then + OcurrioError = True + End If + + ObjContabilidad.UpdatePrePoliza(MinFecha, -1, DdlTipoPoliza.SelectedValue.ToEntero, -1, CvePrePoliza, UsuarioActual.CveEmpresa, Concepto:=TxtConcepto.Text, FechaPoliza:=TxtFechaDocumento.Text.ToDate) + For Each row As GridViewRow In GvPrePoliza.Rows If row.DataKey("CvePrePolizaDetalle").ToEntero > 0 Then If Not ObjContabilidad.UpdatePrepolizasDetalle(row.DataKey("CvePrePolizaDetalle").ToEntero, row.FCTextBox("TxtConcepto").Text, row.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero, @@ -996,13 +1009,20 @@ Partial Class ContabilidadC_RegPrePoliza If Not OcurrioError Then ObjContabilidad.Commit() Alert("La PrePoliza se actualizó correctamente.", TipoMensaje.MsgInformacion) - Else + Else ObjContabilidad.RollBack() Alert("Ocurrio un error al actualizar la PrePoliza.", TipoMensaje.MsgError) End If ObjContabilidad.Dispose() CargaPrePoliza() + + If Not OcurrioError Then + If IdPoliza > 0 Then + BtnContabilizar_Click(Nothing, Nothing) + End If + + End If End Sub Protected Sub GvPrePoliza_RowUpdating(sender As Object, e As GridViewUpdateEventArgs) Handles GvPrePoliza.RowUpdating RegistraScript(String.Format("$('#{0}').modal();", "DivEditConcepto")) @@ -1463,13 +1483,14 @@ Partial Class ContabilidadC_RegPrePoliza End Sub Private Sub Contabilizar() + Dim ObjConta As New ClsContabilidad If IdPoliza > 0 Then 'si está bloqueada, lo desbloqueaprimero ObjConta.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False) End If - If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, pIDPoliza:=If(IdPoliza > 0, IdPoliza, -1)) Then + If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, pIDPoliza:=If(IdPoliza > 0, IdPoliza, -1), Concepto:=TxtConcepto.Text, Fecha:=TxtFechaDocumento.Text.ToDateTime) Then Alert(String.Format("Prepóliza contabilizada.

Folio:Ver Póliza", ObjConta.ContaIdPoliza), ModExtensiones.TipoMensaje.MsgInformacion) Else diff --git a/Inventarios/CatAlmacenes.aspx.vb b/Inventarios/CatAlmacenes.aspx.vb index 072edd0a3..d28cd35dd 100644 --- a/Inventarios/CatAlmacenes.aspx.vb +++ b/Inventarios/CatAlmacenes.aspx.vb @@ -297,6 +297,7 @@ Partial Class Inventarios_CatAlmacenes Private Sub DdlModalidad_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlModalidad.SelectedIndexChanged If DdlModalidad.SelectedValue = 1 Then divddlcc.Visible = True + CargaCuentasContables() Else divddlcc.Visible = False End If diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb index 44e5f7e9c..7906f4e00 100644 --- a/Inventarios/RecepcionAlmacen.aspx.vb +++ b/Inventarios/RecepcionAlmacen.aspx.vb @@ -2155,7 +2155,7 @@ Partial Class Inventarios_RecepcionAlmacen ErrorMovInv = True End If - If Not ErrorMovInv Then + If Not ErrorMovInv AndAlso Dt IsNot Nothing Then For Each Dr As DataRow In Dt.Rows If Not ObjInventario.AddMovimientoDetalle(CveMovtoSalidaDirecta, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero, Dr("CveSeccionAlmacen").ToString.ToEntero, Dr("SerieLote").ToString, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then ErrorMovInv = True diff --git a/Inventarios/RecepcionUsados.aspx.vb b/Inventarios/RecepcionUsados.aspx.vb index a22ed7047..2034619c5 100644 --- a/Inventarios/RecepcionUsados.aspx.vb +++ b/Inventarios/RecepcionUsados.aspx.vb @@ -2535,6 +2535,15 @@ Partial Class Inventarios_RecepcionUsados If drPS IsNot Nothing Then PrecioSugerido = drPS("Precio").ToString.ToDecimal + Dim PS As String = drPS("PS").ToString + Dim Arr = PS.Split("-"c) + If Arr.Count > 0 Then + If (DdlBCIAjuste.Items.FindByText(Arr(1).ToString) IsNot Nothing) Then + DdlBCIAjuste.SelectedValueExist(DdlBCIAjuste.Items.FindByText(Arr(1).ToString).Value) + End If + + End If + End If txtPrecio.Text = PrecioSugerido.FormatoNumero(2) TxtPUFactura.Text = PrecioSugerido.FormatoNumero(2) diff --git a/Ventas/ClientesAbonar.aspx.vb b/Ventas/ClientesAbonar.aspx.vb index 25766dd80..e91c73d26 100644 --- a/Ventas/ClientesAbonar.aspx.vb +++ b/Ventas/ClientesAbonar.aspx.vb @@ -900,6 +900,7 @@ Partial Class Ventas_ClientesAbonar Select Case ConceptoContable Case 2 'Pago Cliente + 'If gvr.DataKey("CveMoneda").ToEntero > 1 Then ConceptoContable = 292 If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then ImporteMovimiento = gvr.FCTextBox("TxtAbonar").Text.ToDecimal importeMX = ImporteMovimiento diff --git a/Ventas/RepConciliacionSat.aspx b/Ventas/RepConciliacionSat.aspx index 234fbe0c8..77d257d1d 100644 --- a/Ventas/RepConciliacionSat.aspx +++ b/Ventas/RepConciliacionSat.aspx @@ -1,15 +1,188 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeFile="RepConciliacionSat.aspx.cs" Inherits="Ventas_RepConciliacionSat" %> +<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepConciliacionSat.aspx.cs" Inherits="Ventas_RepConciliacionSat" %> - + + + + + + + Conciliación CFDI SAT + + + + +
  • Solicitudes SAT
  • + +
    + + + + + + +
    +
    +
    + + +
    +
    +
    + + +
    + Fecha Inicio: +
    +
    +
    + + + + +
    + + + + + + +
    +
    + Fecha Fin: +
    +
    +
    + + + + +
    + + + + + + +
    +
    +
    +
    + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + - - - - - -
    -
    -
    -
    - - diff --git a/Ventas/RepConciliacionSat.aspx.cs b/Ventas/RepConciliacionSat.aspx.cs index d0acae9eb..0ab06995d 100644 --- a/Ventas/RepConciliacionSat.aspx.cs +++ b/Ventas/RepConciliacionSat.aspx.cs @@ -4,11 +4,62 @@ using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; +using Extensiones; -public partial class Ventas_RepConciliacionSat : System.Web.UI.Page +public partial class Ventas_RepConciliacionSat : ClsPaginas { + const string rqFechaInicio = "FechaInicio"; + const string rqFechaFin = "FechaFin"; protected void Page_Load(object sender, EventArgs e) { + if (!IsPostBack) + { + DateTime fecha; + DateTime fechaInicio = DateTime.Now; + DateTime fechaFin = DateTime.Now; + if (fechaInicio.Day < 5) { fechaInicio = fechaInicio.AddMonths(-1); } + fechaInicio = fechaInicio.AddDays(1 - fechaInicio.DayOfYear); + fechaFin = fechaInicio.AddYears(1).AddDays(-1); + if (Request[rqFechaInicio] != null) { DateTime.TryParse(Request[rqFechaInicio], out fecha); fechaInicio = fecha.Year > 1900 ? fecha : fechaInicio; } + if (Request[rqFechaFin] != null) { DateTime.TryParse(Request[rqFechaFin], out fecha); fechaFin = fecha.Year > 1900 ? fecha : fechaFin; } + txtFechaI.Text = string.Format("{0:dd/MM/yyyy}", fechaInicio); + txtFechaF.Text = string.Format("{0:dd/MM/yyyy}", fechaFin); + + } + CargaRepConciliacionSatGET(); + } + + + protected void CargaRepConciliacionSatGET() + { + string RtipoDocto, RfechaI, RfechaF; + RtipoDocto = "I"; + RfechaI = txtFechaI.Text.ToDateTime().ToString(); + RfechaF = txtFechaF.Text.ToDateTime().ToString(); + using (ClsGenerales ObjRepC = new ClsGenerales()) + { + ObjRepC.RepConciliacionSatGET(UsuarioActual.CveEmpresa, RtipoDocto, RfechaI, RfechaF); + GVRepConciliacionSatGET.DataSource = ObjRepC.DtResultados; + ObjRepC.Dispose(); + + } + GVRepConciliacionSatGET.DataBind(); + upDatosRepC.Update(); + } + + protected void BtnConsultar_Click(object sender, EventArgs e) + { + CargaRepConciliacionSatGET(); + } + + protected void GVRepConciliacionSatGET_RowDataBound(object sender, GridViewRowEventArgs e) + { + if(e.Row.RowType == DataControlRowType.DataRow) + { + e.Row.CssClass = string.Format("Grupo{0}", e.Row.DBCampo("GRUPOCve")); + e.Row.Attributes.Add("ganio", string.Format("{0}", e.Row.DBCampo("anio"))); + e.Row.Attributes.Add("gMes", string.Format("{0}", e.Row.DBCampo("Mes"))); + } } } \ No newline at end of file diff --git a/Ventas/SolicitudesSAT.aspx b/Ventas/SolicitudesSAT.aspx new file mode 100644 index 000000000..209472801 --- /dev/null +++ b/Ventas/SolicitudesSAT.aspx @@ -0,0 +1,344 @@ +<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="SolicitudesSAT.aspx.cs" Inherits="Ventas_SolicitudesSAT" %> + + + + + + + Solicitudes CFDI SAT + + + + + + +
  • + Verificar Solicitudes
  • +
  • + Solicitar SAT
  • +
    +
    +
    + + + + + +
    +
    +
    + + <%----%> +
    +
    +
    +
    + Tipo: +
    +
    + + + + + +
    +
    + Fecha Inicio(ing.): +
    +
    +
    + + + + +
    + + + + + + +
    +
    + Fecha Fin(ing.): +
    +
    +
    + + + + +
    + + + + + + +
    +
    + Fecha Inicio(Sol.): +
    +
    +
    + + + + +
    + + + + + + +
    +
    + Fecha Fin(Sol.): +
    +
    +
    + + + + +
    + + + + + + +
    +
    +
    +
    + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + diff --git a/Ventas/SolicitudesSAT.aspx.cs b/Ventas/SolicitudesSAT.aspx.cs new file mode 100644 index 000000000..12aad683c --- /dev/null +++ b/Ventas/SolicitudesSAT.aspx.cs @@ -0,0 +1,128 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using Extensiones; + +public partial class Ventas_SolicitudesSAT : ClsPaginas +{ + protected void Page_Load(object sender, EventArgs e) + { + + if (!IsPostBack) + { + //this.RegistraScript("$('#ModalSolicitarSat').modal();"); + int rtipo = Request["tipo"] == null ? -1 : Request["tipo"].ToString().ToEntero(); + string rfIngInicio = Request["fIngInicio"] == null ? "" : Request["fIngInicio"].ToString().Trim(); + string rfIngFin = Request["fIngFin"] == null ? "" : Request["fIngFin"].ToString().Trim(); + string rfSolInicio = Request["fSolInicio"] == null ? "" : Request["fSolInicio"].ToString().Trim(); + string rfSolFin = Request["fSolFin"] == null ? "" : Request["fSolFin"].ToString().Trim(); + + DateTime dValor = DateTime.Now; + dValor = DateTime.Now; if (DateTime.TryParse(rfIngInicio, out dValor)) { rfIngInicio = string.Format("{0:dd/MM/yyyy}", dValor); } else { rfIngInicio = ""; } + dValor = DateTime.Now; if (DateTime.TryParse(rfIngFin, out dValor)) { rfIngFin = string.Format("{0:dd/MM/yyyy}", dValor); } else { rfIngFin = ""; } + dValor = DateTime.Now; if (DateTime.TryParse(rfSolInicio, out dValor)) { rfSolInicio = string.Format("{0:dd/MM/yyyy}", dValor); } else { rfSolInicio = ""; } + dValor = DateTime.Now; if (DateTime.TryParse(rfSolFin, out dValor)) { rfSolFin = string.Format("{0:dd/MM/yyyy}", dValor); } else { rfSolFin = ""; } + + DdlTipo.SelectedValueExist(rtipo); + txtFechaI.Text = rfIngInicio; + txtFechaF.Text = rfIngFin; + txtFechaISol.Text = rfSolInicio; + txtFechaFSol.Text = rfSolFin; + cargarDatos(); + } + } + + + private void cargarDatos() + { + int rtipo = DdlTipo.SelectedValue.ToEntero(); + string rfIngInicio = txtFechaI.Text; + string rfIngFin = txtFechaF.Text; + string rfSolInicio = txtFechaISol.Text; + string rfSolFin = txtFechaFSol.Text; + using (ClsGenerales objgral = new ClsGenerales()) + { + objgral.SAT_DescargaSolicitudesGET(UsuarioActual.CveEmpresa, rtipo, rfIngInicio, rfIngFin, rfSolInicio, rfSolFin); + GVSAT_DescargaSolicitudes.DataSource = objgral.DtResultados; + GVSAT_DescargaSolicitudes.DataBind(); + } + upDatosSAT.Update(); + } + + protected void BtnConsultar_Click(object sender, EventArgs e) + { + cargarDatos(); + } + + protected void LnkVerificarSolicitudes_Click(object sender, EventArgs e) + { + string direxe = string.Format("{0}{1}",AppDomain.CurrentDomain.BaseDirectory, "Utilerias\\ADSUtilerias.exe"); + + String json = string.Format("{{cveTareaProgramada:{0},cveEmpresa:{1},CveTareaProgramadaHistorial:{2},recursividad:{3},Resultado:{4},parametros:'Tipo=SP'}}", 1, UsuarioActual.CveEmpresa,-1, 0, 1);//Mod.ToLiteral(new System.Web.Script.Serialization.JavaScriptSerializer().Serialize(tarea)); + //this.Alert(string.Format("json:{0} : --mod TareaProgramada --Item {1}", DateTime.Now, json)); + try + { + string Mensajes = ""; + System.Diagnostics.Process ObjProcess = null; + { + ObjProcess = new System.Diagnostics.Process(); + ObjProcess.StartInfo.RedirectStandardOutput = true; + ObjProcess.StartInfo.FileName = direxe;//System.Configuration.ConfigurationManager.AppSettings["DirUtilerias"].ToString(); + ObjProcess.StartInfo.Arguments = $"--mod TareaProgramada --Item {json} "; + ObjProcess.StartInfo.UseShellExecute = false; + ObjProcess.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal; + ObjProcess.Start(); + } + using (System.IO.StreamReader myStreamReader = ObjProcess.StandardOutput) + { + Mensajes = myStreamReader.ReadLine(); + + } + } + catch (Exception ex) + { + ex.ToString().GuardaLog(); + } + cargarDatos(); + Alert("La solicitud ha sido enviada"); + } + + protected void LnkSolicitarCFDI_Click(object sender, EventArgs e) + { + string FechaI = string.Format("{0:yyyy-MM-ddTHH}:{0:mm}:{0:ss}", txtFechaIAdd.Text.ToDateTime()); + string FechaF = string.Format("{0:yyyy-MM-ddTHH}:{0:mm}:{0:ss}", txtFechaFAdd.Text.ToDateTime()); + + string direxe = string.Format("{0}{1}", AppDomain.CurrentDomain.BaseDirectory, "Utilerias\\ADSUtilerias.exe"); + + String json = string.Format("{{cveTareaProgramada:{0},cveEmpresa:{1},CveTareaProgramadaHistorial:{2},recursividad:{3},Resultado:{4},parametros:'Tipo={5}&fechai={6}&fechaf={7}'}}", 1, UsuarioActual.CveEmpresa, -1, 0, 1,DdlTipoAdd.SelectedValue, FechaI, FechaF);//Mod.ToLiteral(new System.Web.Script.Serialization.JavaScriptSerializer().Serialize(tarea)); + //this.Alert(string.Format("json:{0} : --mod TareaProgramada --Item {1}", DateTime.Now, json)); + try + { + string Mensajes = ""; + System.Diagnostics.Process ObjProcess = null; + { + ObjProcess = new System.Diagnostics.Process(); + ObjProcess.StartInfo.RedirectStandardOutput = true; + ObjProcess.StartInfo.FileName = direxe;//System.Configuration.ConfigurationManager.AppSettings["DirUtilerias"].ToString(); + ObjProcess.StartInfo.Arguments = $"--mod TareaProgramada --Item {json} "; + ObjProcess.StartInfo.UseShellExecute = false; + ObjProcess.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal; + ObjProcess.Start(); + } + using (System.IO.StreamReader myStreamReader = ObjProcess.StandardOutput) + { + Mensajes = myStreamReader.ReadLine(); + + } + } + catch (Exception ex) + { + ex.ToString().GuardaLog(); + } + cargarDatos(); + Alert("La solicitud ha sido enviada"); + } +} \ No newline at end of file diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index f40cfb01b..0748e7778 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -9512,6 +9512,7 @@ Partial Class Ventas Select Case ConceptoContable Case 1 'Cliente If Not ObjFactura.TipoDocto.Contiene("Egs", "Rem", "RNC") Then + If ObjFactura.CveMoneda > 1 Then ConceptoContable = 291 importeMovimiento = (ObjFactura.Total - TotalOtrosConceptos) * ValorMultiplicador importeMX = importeMovimiento * tipoCambio * Multiplicador FechaMovimiento = ObjFactura.FechaPago @@ -9542,6 +9543,7 @@ Partial Class Ventas CveCuentaCliente = CveCuenta End If + Case 3 'Cliente If ObjFactura.TipoDocto = "Ant" Then @@ -11685,6 +11687,7 @@ Partial Class Ventas Select Case ConceptoContable Case 2 'Cliente + 'If CveMonedaVenta > 1 Then ConceptoContable = 292 If Not (gvr.DataKey("CveIE").ToString.ToEntero > 0 AndAlso gvr.DataKey("CveConceptoContable").ToString().ToEntero = 66) Then If DdlMoneda.SelectedValue.ToEntero = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal @@ -15346,9 +15349,11 @@ Partial Class Ventas If ErrorList.Count = 0 AndAlso MovDetalle.Rows.Count > 0 Then Dim CveMovimientoSalidaPorTraspaso As Integer = -1 Dim CveConceptoSalidaAlmacen As Integer = 3 + Dim CveAlmacenParaSalida As Integer = CveAlmacenEntrada 'SALIDA DEFINITIVA DEL SISTEMA If UsuarioActual.Empresa.Funcionalidad(575) = "1" Then CveConceptoSalidaAlmacen = 40 + CveAlmacenParaSalida = CveAlmacenSalida ''Le damos salida normal 'If ConSalida Then ' GeneroMovimientoAlmacen = GenerarMovimientoAlmacen(ObjInventario, MovDetalle, CveAlmacenSalida, 40, CveMoneda, CveVenta, AplicaMovimientoDetalleEntrada:=AplicaMovimientoDetalleEntrada, MovimientoPrePoliza:=True, ObjConta:=ObjConta) > 0 @@ -15393,7 +15398,7 @@ Partial Class Ventas End If If Not OcurrioError Then - GeneroMovimientoAlmacen = GenerarMovimientoAlmacen(ObjInventario, MovDetalle, CveAlmacenEntrada, CveConceptoSalidaAlmacen, CveMoneda, ObjFactura.CveVenta, MovimientoPrePoliza:=True, ObjConta:=ObjConta) > 0 + GeneroMovimientoAlmacen = GenerarMovimientoAlmacen(ObjInventario, MovDetalle, CveAlmacenParaSalida, CveConceptoSalidaAlmacen, CveMoneda, ObjFactura.CveVenta, MovimientoPrePoliza:=True, ObjConta:=ObjConta) > 0 If Not GeneroMovimientoAlmacen Then OcurrioError = True diff --git a/asmx/WSApp.asmx b/asmx/WSApp.asmx index 10913c010..92d0c128c 100644 --- a/asmx/WSApp.asmx +++ b/asmx/WSApp.asmx @@ -67,52 +67,41 @@ Public Class WSApp Application("GlobalDTVtaFormaPago") = value End Set End Property - 'Property GlobalDTSubProyectos(CveProyecto As Integer, Optional CveSubProyecto As Integer = -1, Optional CveEmpresa As Integer = -1, Optional Estatus As Integer = 1) As DataTable - ' Get + Public Property GlobalDTSubProyectos(CveProyecto As Integer, Optional CveSubProyecto As Integer = -1, Optional CveEmpresa As Integer = -1, Optional Estatus As Integer = 1) As DataTable + Get + Dim AppNombre As String = String.Format("GlobalDTSubProyectos{0}", CveEmpresa) + 'sino existe, recarga los datos + If DirectCast(Application(AppNombre), DataTable) Is Nothing Or (DirectCast(Application(AppNombre), DataTable) IsNot Nothing AndAlso DirectCast(Application(AppNombre), DataTable).Rows.Count = 0) Then + Dim P As New ClsSubProyectos + If P.GetSubProyectos(CveEmpresa:=CveEmpresa) Then Application(AppNombre) = P.DtResultados + P.Dispose() - ' If DirectCast(Application("GlobalDTSubProyectos"), DataTable) Is Nothing Or (DirectCast(Application("GlobalDTSubProyectos"), DataTable) IsNot Nothing AndAlso DirectCast(Application("GlobalDTSubProyectos"), DataTable).Rows.Count = 0) Then - ' Dim P As New ClsSubProyectos - ' If P.GetSubProyectos Then - ' Application("GlobalDTSubProyectos") = P.DtResultados - ' End If - ' P.Dispose() + Dim msg As String = "aqui no se carga subproyectos" + msg.GuardaLog() - ' Dim msg As String = "aqui no se carga subproyectos" - ' 'If Request IsNot Nothing Then - ' ' msg = msg & Request.ServerVariables("URL") - ' 'End If - ' msg.GuardaLog() + End If - ' End If + If CveProyecto <> -1 OrElse CveSubProyecto <> -1 OrElse CveEmpresa <> -1 OrElse Estatus <> -1 Then + Dim StrSQL As New StringBuilder + If CveProyecto <> -1 Then StrSQL.AppendFormat(" AND CveProyecto = {0}", CveProyecto) + If CveSubProyecto <> -1 Then StrSQL.AppendFormat(" AND CveSubProyecto = {0}", CveSubProyecto) + If Estatus <> -1 Then StrSQL.AppendFormat(" AND CveEstatus = {0}", Estatus) + If CveEmpresa <> -1 Then StrSQL.AppendFormat(" AND CveEmpresa = {0}", CveEmpresa) - ' If CveProyecto <> -1 OrElse CveSubProyecto <> -1 OrElse CveEmpresa <> -1 OrElse Estatus <> -1 Then - ' Dim StrSQL As New StringBuilder - ' If CveProyecto <> -1 Then StrSQL.AppendFormat(" AND CveProyecto = {0}", CveProyecto) - ' If CveSubProyecto <> -1 Then StrSQL.AppendFormat(" AND CveSubProyecto = {0}", CveSubProyecto) - ' If Estatus <> -1 Then StrSQL.AppendFormat(" AND CveEstatus = {0}", Estatus) - ' If CveEmpresa <> -1 Then StrSQL.AppendFormat(" AND CveEmpresa = {0}", CveEmpresa) + Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), StrSQL.ToString.Trim.TrimStart("A"c, "N"c, "D"c), "", DataViewRowState.CurrentRows) + GlobalDTSubProyectos = Dv.ToTable + Dv.Dispose() - ' Dim Dv As New DataView(DirectCast(Application("GlobalDTSubProyectos"), DataTable), StrSQL.ToString.Trim.TrimStart("A"c, "N"c, "D"c), "", DataViewRowState.CurrentRows) - ' GlobalDTSubProyectos = Dv.ToTable - ' Dv.Dispose() + Else + GlobalDTSubProyectos = DirectCast(Application(AppNombre), DataTable) + End If - ' Else - ' GlobalDTSubProyectos = DirectCast(Application("GlobalDTSubProyectos"), DataTable) - ' End If - - ' End Get - ' Set(ByVal value As DataTable) - ' If value Is Nothing OrElse value.Rows.Count = 0 Then - ' Dim msg As String = "aqui no se carga subproyectos" - ' 'If Request IsNot Nothing Then - ' ' msg = msg & Request.ServerVariables("URL") - ' 'End If - ' msg.GuardaLog() - - ' End If - ' Application("GlobalDTSubProyectos") = value - ' End Set - 'End Property + End Get + Set(ByVal value As DataTable) + Dim AppNombre As String = String.Format("GlobalDTSubProyectos{0}", CveEmpresa) + Application(AppNombre) = value + End Set + End Property Property GlobalDTSATUsosCFDI(Optional EsPersonaFisica As Integer = -1) As DataTable Get If EsPersonaFisica <> -1 Then