diff --git a/Acumuladores/CatFoliosGarantia.aspx b/Acumuladores/CatFoliosGarantia.aspx index ac47d269b..37ded6f64 100644 --- a/Acumuladores/CatFoliosGarantia.aspx +++ b/Acumuladores/CatFoliosGarantia.aspx @@ -84,15 +84,16 @@ general optima motobateria + Auxiliar
- + - +
@@ -122,7 +123,7 @@ - +   - +   - - + +   @@ -170,9 +171,9 @@ - + - + @@ -181,10 +182,10 @@ - + - + @@ -258,10 +259,10 @@ - + ControlToValidate="TxtFolioGarantia" runat="server" CssClass="help-block errorimput" + ErrorMessage="solo números" ValidationGroup="GrpFolioGarantia" + ValidationExpression="\d+"> + @@ -269,8 +270,9 @@
-
+
SubProyecto:
+ @@ -286,10 +288,12 @@
Tipo Folio:
+ General Optima Motobateria + Auxiliar
@@ -297,6 +301,7 @@
Área:
+ Piso Almacén @@ -308,7 +313,7 @@
-
+
diff --git a/App_Code/ClsBancos.vb b/App_Code/ClsBancos.vb index 8e7c0f8a7..8882bb2d9 100644 --- a/App_Code/ClsBancos.vb +++ b/App_Code/ClsBancos.vb @@ -295,7 +295,8 @@ Public Class ClsBancos Return Retorno End Function - Public Function AddBancos(Banco As String, Ejecutivo As String, Telefono As String, CveUsuario As Integer, CveEmpresa As Integer, Optional IdContPaq As Integer = -1, Optional RFC As String = "-1") As Boolean + Public Function AddBancos(Banco As String, Ejecutivo As String, Telefono As String, CveUsuario As Integer, CveEmpresa As Integer, Optional IdContPaq As Integer = -1, Optional RFC As String = "-1", + Optional CveSATBanco As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Banc_BancosAdd ") @@ -308,6 +309,7 @@ Public Class ClsBancos .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@IdContPaq", SqlDbType.Int).Value = IdContPaq .Add("@RFC", SqlDbType.VarChar).Value = RFC + .Add("@CveSATBanco", SqlDbType.Int).Value = CveSATBanco End With Try @@ -326,7 +328,8 @@ Public Class ClsBancos Return Retorno End Function - Public Function UpdateBancos(Banco As String, Ejecutivo As String, Telefono As String, Estatus As Boolean, CveBanco As Integer, Optional IdContPaq As Integer = -1, Optional RFC As String = "-1") As Boolean + Public Function UpdateBancos(Banco As String, Ejecutivo As String, Telefono As String, Estatus As Boolean, CveBanco As Integer, Optional IdContPaq As Integer = -1, Optional RFC As String = "-1", + Optional CveSATBanco As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Banc_BancosUpdate") @@ -339,6 +342,7 @@ Public Class ClsBancos .Add("@CveBanco", SqlDbType.Int).Value = CveBanco .Add("@IdContPaq", SqlDbType.Int).Value = IdContPaq .Add("@RFC", SqlDbType.VarChar).Value = RFC + .Add("@CveSATBanco", SqlDbType.Int).Value = CveSATBanco End With Try diff --git a/App_Code/ClsExportaciones.vb b/App_Code/ClsExportaciones.vb index c7317a75b..ea59fddc9 100644 --- a/App_Code/ClsExportaciones.vb +++ b/App_Code/ClsExportaciones.vb @@ -120,14 +120,17 @@ Public Class ClsExportaciones End Sub #Region "EXPORTACIONES" - Public Function GetExportacion(Optional CveExportacion As Integer = -1, Optional CveEmpresa As Integer = -1, Optional FechaInicio As Date = MinFecha, Optional FechaFin As Date = MaxFecha) As Boolean + Public Function GetExportacion(Optional CveExportacion As Integer = -1, Optional CveEmpresa As Integer = -1, Optional EsExportacion As Boolean = True, Optional FechaInicio As Date = MinFecha, + Optional FechaFin As Date = MaxFecha, Optional CveSubProyecto As String = "-1") As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Exp_ExportacionesRep") With SqlAdapter.SelectCommand.Parameters .Add("@CveExportacion", SqlDbType.Int).Value = CveExportacion .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@EsExportacion", SqlDbType.Bit).Value = EsExportacion .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio .Add("@FechaFin", SqlDbType.Date).Value = FechaFin + .Add("@CveSubProyecto", SqlDbType.VarChar).Value = CveSubProyecto End With Try SqlAdapter.Fill(Data) @@ -138,14 +141,16 @@ Public Class ClsExportaciones Return Retorno End Function - Public Function AddExportacion(NumeroPedimento As String, FechaPedimento As Date, CveVenta As Integer, TipoCambio As Decimal, TipoExportacion As Integer, CveExportacionEstatus As Integer, - CveClienteExportador As Integer, CveClienteImportador As Integer, CveClienteConsignatario As Integer, CveAgente As Integer, ClaveAduana As Integer, - CveProveedor As Integer, MedioTransporte As Integer, TipoContenedor As Integer, Sello1 As String, Sello2 As String, Sello3 As String, SCAC As String, - CAAT As String, ContenedorPlaca As String, CveEmpresa As Integer, CveUsuario As Integer, CveDirExportador As Integer, CveDirConsignatario As Integer, - CveIncoterm As Integer, Notas As String, CvePedimento As Integer, CveAgenteExtranjero As Integer, ITN As String, Vinculacion As Boolean) As Integer + Public Function AddExportacion(CveSubProyecto As Integer, NumeroPedimento As String, FechaPedimento As Date, CveVenta As Integer, TipoCambio As Decimal, TipoExportacion As Integer, + CveExportacionEstatus As Integer, CveClienteExportador As Integer, CveClienteImportador As Integer, CveClienteConsignatario As Integer, CveAgente As Integer, + ClaveAduana As Integer, DescripcionContenedor As String, CveProveedor As Integer, MedioTransporte As Integer, TipoContenedor As Integer, Sello1 As String, + Sello2 As String, Sello3 As String, SCAC As String, CAAT As String, ContenedorPlaca As String, CveEmpresa As Integer, CveUsuario As Integer, CveDirExportador As Integer, + CveDirImportador As Integer, CveDirConsignatario As Integer, CveIncoterm As Integer, Notas As String, CvePedimento As Integer, CveAgenteExtranjero As Integer, + ITN As String, Vinculacion As Boolean, EsExportacion As Boolean) As Integer Dim Retorno As Integer = -1 DataAdapter("PA_Exp_ExportacionesAdd") With SqlAdapter.SelectCommand.Parameters + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@NumeroPedimento", SqlDbType.VarChar).Value = NumeroPedimento .Add("@FechaPedimento", SqlDbType.Date).Value = FechaPedimento .Add("@CveVenta", SqlDbType.Int).Value = CveVenta @@ -157,6 +162,7 @@ Public Class ClsExportaciones .Add("@CveClienteConsignatario", SqlDbType.Int).Value = CveClienteConsignatario .Add("@CveAgente", SqlDbType.Int).Value = CveAgente .Add("@ClaveAduana", SqlDbType.Int).Value = ClaveAduana + .Add("@DescripcionContenedor", SqlDbType.VarChar).Value = DescripcionContenedor .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor .Add("@MedioTransporte", SqlDbType.Int).Value = MedioTransporte .Add("@TipoContenedor", SqlDbType.Int).Value = TipoContenedor @@ -169,6 +175,7 @@ Public Class ClsExportaciones .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveDirExportador", SqlDbType.Int).Value = CveDirExportador + .Add("@CveDirImportador", SqlDbType.Int).Value = CveDirImportador .Add("@CveDirConsignatario", SqlDbType.Int).Value = CveDirConsignatario .Add("@CveIncoterm", SqlDbType.Int).Value = CveIncoterm .Add("@Notas", SqlDbType.VarChar).Value = Notas @@ -176,6 +183,7 @@ Public Class ClsExportaciones .Add("@CveAgenteExtranjero", SqlDbType.Int).Value = CveAgenteExtranjero .Add("@ITN", SqlDbType.VarChar).Value = ITN .Add("@Vinculacion", SqlDbType.Bit).Value = Vinculacion + .Add("@EsExportacion", SqlDbType.Bit).Value = EsExportacion .Add("@CveExportacion", SqlDbType.Int).Direction = ParameterDirection.Output End With @@ -189,15 +197,17 @@ Public Class ClsExportaciones Return Retorno End Function - Public Function UpdateExportacion(CveExportacion As Integer, NumeroPedimento As String, FechaPedimento As Date, CveVenta As Integer, TipoCambio As Decimal, TipoExportacion As Integer, CveExportacionEstatus As Integer, - CveClienteExportador As Integer, CveClienteImportador As Integer, CveClienteConsignatario As Integer, CveAgente As Integer, ClaveAduana As Integer, - CveProveedor As Integer, MedioTransporte As Integer, TipoContenedor As Integer, Sello1 As String, Sello2 As String, Sello3 As String, SCAC As String, - CAAT As String, ContenedorPlaca As String, CveEmpresa As Integer, CveUsuario As Integer, CveDirExportador As Integer, CveDirConsignatario As Integer, - CveIncoterm As Integer, Notas As String, CvePedimento As Integer, CveAgenteExtranjero As Integer, ITN As String, Vinculacion As Boolean) As Boolean + Public Function UpdateExportacion(CveExportacion As Integer, CveSubProyecto As Integer, NumeroPedimento As String, FechaPedimento As Date, CveVenta As Integer, TipoCambio As Decimal, + TipoExportacion As Integer, CveExportacionEstatus As Integer, CveClienteExportador As Integer, CveClienteImportador As Integer, CveClienteConsignatario As Integer, + CveAgente As Integer, ClaveAduana As Integer, DescripcionContenedor As String, CveProveedor As Integer, MedioTransporte As Integer, TipoContenedor As Integer, + Sello1 As String, Sello2 As String, Sello3 As String, SCAC As String, CAAT As String, ContenedorPlaca As String, CveEmpresa As Integer, CveUsuario As Integer, + CveDirExportador As Integer, CveDirImportador As Integer, CveDirConsignatario As Integer, CveIncoterm As Integer, Notas As String, CvePedimento As Integer, + CveAgenteExtranjero As Integer, ITN As String, Vinculacion As Boolean) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Exp_ExportacionesUpdate") With SqlAdapter.SelectCommand.Parameters .Add("@CveExportacion", SqlDbType.Int).Value = CveExportacion + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@NumeroPedimento", SqlDbType.VarChar).Value = NumeroPedimento .Add("@FechaPedimento", SqlDbType.Date).Value = FechaPedimento .Add("@CveVenta", SqlDbType.Int).Value = CveVenta @@ -209,6 +219,7 @@ Public Class ClsExportaciones .Add("@CveClienteConsignatario", SqlDbType.Int).Value = CveClienteConsignatario .Add("@CveAgente", SqlDbType.Int).Value = CveAgente .Add("@ClaveAduana", SqlDbType.Int).Value = ClaveAduana + .Add("@DescripcionContenedor", SqlDbType.VarChar).Value = DescripcionContenedor .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor .Add("@MedioTransporte", SqlDbType.Int).Value = MedioTransporte .Add("@TipoContenedor", SqlDbType.Int).Value = TipoContenedor @@ -221,6 +232,7 @@ Public Class ClsExportaciones .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveDirExportador", SqlDbType.Int).Value = CveDirExportador + .Add("@CveDirImportador", SqlDbType.Int).Value = CveDirImportador .Add("@CveDirConsignatario", SqlDbType.Int).Value = CveDirConsignatario .Add("@CveIncoterm", SqlDbType.Int).Value = CveIncoterm .Add("@Notas", SqlDbType.VarChar).Value = Notas diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb index e315a33e6..8613d0d3c 100644 --- a/App_Code/ClsNominas.vb +++ b/App_Code/ClsNominas.vb @@ -324,6 +324,30 @@ Public Class ClsNominas End Try Return retorno End Function + + + Public Function GetAniversarioLaboral(fecha As String, cveEmpresa As Integer) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_RH_AniversarioLaboral", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa + .Add("@Fecha", SqlDbType.Date).Value = fecha + + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch Ex1 As SqlException + + Me.OnError("Ocurrió un error en aniversario laboral.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error en aniversario laboral.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return retorno + End Function + + + Public Function AutorizaCalculoAnual(CveEmpresa As Integer, CveUsuario As Integer, PersonalXml As String, Optional Numpagos As Integer = 1, Optional Ejercicio As Integer = 2023) As Boolean Dim retorno As Boolean = False DataAdapter("PA_Nom_AutorizaCalculoAnual", CommandType.StoredProcedure) diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 68f28fc66..8ed054aa6 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -475,7 +475,7 @@ Public Class ClsVentas Optional DevolucionImportePagado As Decimal = 0, Optional EsGarantia As Boolean = False, Optional CveLineaAdicional As Integer = -1, Optional DescripcionVenta As String = "", Optional CveMedico As Integer = -1, Optional CveProcedimiento As Integer = -1, Optional CveTipoVenta As Integer = -1, Optional RequiereOS As Boolean = False, Optional FechaParaSurtir As DateTime = MinFecha, Optional Paciente As String = "-1", Optional Episodio As String = "-1", Optional EsFacturaGlobal As Boolean = False, Optional CveSATPeriodicidad As Integer = -1, Optional CveSATMes As Integer = -1, Optional SATAnio As Integer = -1, Optional CveMotivoDevolucion As Integer = -1, - Optional CveCobranzaEstatusTurno As Integer = -1, Optional Addenda As String = "", Optional Bloqueada As Boolean = False) As Boolean + Optional CveCobranzaEstatusTurno As Integer = -1, Optional Addenda As String = "", Optional Bloqueada As Boolean = False, Optional CveComplementoTimbrado As Integer = -1, Optional ComplementoSAT As String = "") As Boolean Dim Retorno As Boolean = False DataAdapter("PA_VentasAdd") @@ -593,6 +593,8 @@ Public Class ClsVentas .Add("@CveCobranzaEstatusTurno", SqlDbType.Int).Value = CveCobranzaEstatusTurno .Add("@Addenda", SqlDbType.VarChar).Value = Addenda .Add("@Bloqueada", SqlDbType.Bit).Value = Bloqueada + .Add("@CveComplementoTimbrado", SqlDbType.Int).Value = CveComplementoTimbrado + .Add("@ComplementoSAT", SqlDbType.VarChar).Value = ComplementoSAT End With 'SqlTypes.SqlDateTime.Null Try diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index c7fe1ca9c..278a0546d 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -412,6 +412,27 @@ Namespace Modelos End Class + + Public Class MParcialesConstruccion + 'required + Public Property NumPerLicoAut As String + 'required + Public Property Calle As String + Public Property NoExterior As String = "" + Public Property NoInterior As String = "" + Public Property Colonia As String = "" + Public Property Localidad As String = "" + Public Property Referencia As String = "" + 'required + Public Property Municipio As String + 'required + Public Property CveEstado As Integer + 'required + Public Property Estado As String + 'required + Public Property CodigoPostal As String + End Class + Public Class M_REM @@ -8015,6 +8036,7 @@ Namespace Modelos Public Property DescripcionContrato As String = "" Public Property NumeroDescripcionContrato As String = "" Public Property CveComplementoTimbrado As Integer = 0 + Public Property ComplementoSAT As String = "" Public Property ComplementoINE As Modelos.ComplementoINE Public Property FordGSDB As String = "" Public Property FordASN As String = "" diff --git a/App_Code/Timbrado.vb b/App_Code/Timbrado.vb index a0df85f43..e5770fa7b 100644 --- a/App_Code/Timbrado.vb +++ b/App_Code/Timbrado.vb @@ -9,6 +9,8 @@ Imports System.Reflection Imports System.Xml Imports System.Xml.Serialization Imports Extensiones +Imports Modelos +Imports Newtonsoft.Json Imports Newtonsoft.Json.Linq Imports Profact.TimbraCFDI33.Complementos Imports ProfactCartaPorte = Profact.TimbraCFDI33.Complementos.CartaPorte30 @@ -993,7 +995,7 @@ Public Class Timbrado ' Retorno = If(Ret = "", True, False) Case 3 - Retorno = TimbrarFacturaProFactv40(UsuarioActual, Ventas) + Retorno = TimbrarFacturaProFactV40(UsuarioActual, Ventas) Case 4 Dim Ret As String = TimbrarFacturaGoCFDIv40(Ventas, UsuarioActual, CvePACEspecial) If Ret <> "" Then MensajeErrorCFDI = Ret @@ -2829,6 +2831,17 @@ concep.DescripcionesEspecificas.NumeroSerie) End If #End Region + If Ventas.CveComplementoTimbrado = 9 Then + Dim settings As New JsonSerializerSettings + settings.NullValueHandling = NullValueHandling.Ignore + + Dim pc As Modelos.MParcialesConstruccion = JsonConvert.DeserializeObject(Of MParcialesConstruccion)(Ventas.ComplementoSAT, settings) + If pc IsNot Nothing Then + cfdi.ParcialesConstruccion(pc.NumPerLicoAut) + cfdi.Inmueble(pc.Calle, pc.NoExterior, pc.NoInterior, pc.Colonia, pc.Localidad, pc.Referencia, pc.Municipio, pc.Estado, pc.CodigoPostal) + End If + End If + #Region "Genera XML" Dim ArchivoGenerado As Boolean = False Try diff --git a/Bancos/CatBancos.aspx b/Bancos/CatBancos.aspx index 3fa839955..481fe7485 100644 --- a/Bancos/CatBancos.aspx +++ b/Bancos/CatBancos.aspx @@ -4,6 +4,16 @@ +
  • @@ -24,6 +34,12 @@ + +
    + + Banco SAT + + + Banco @@ -64,6 +80,13 @@
    + + Seleccione uno + + + + @@ -90,8 +113,22 @@ - + + + + + + + + Seleccione uno + + + + + @@ -142,10 +179,14 @@ -
    - -   -
    +
    +
    + +
    +
    + +
    +
    diff --git a/Bancos/CatBancos.aspx.vb b/Bancos/CatBancos.aspx.vb index 1784f8c16..ab30a2db6 100644 --- a/Bancos/CatBancos.aspx.vb +++ b/Bancos/CatBancos.aspx.vb @@ -19,13 +19,43 @@ Partial Class Bancos_CatBancos End Set End Property + Private Property DTBancosSAT As DataTable + Get + If ViewState("DTBancosSAT") Is Nothing Then + ViewState("DTBancosSAT") = New DataTable() + End If + Return DirectCast(ViewState("DTBancosSAT"), DataTable) + End Get + + Set(ByVal value As DataTable) + ViewState("DTBancosSAT") = value + End Set + End Property + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not Page.IsPostBack Then + CargaBancosSAT() ViewState("Orden") = "" CargaDatos() End If End Sub + Private Sub CargaBancosSAT() + + Dim ObjBancos As New ClsBancos + + If ObjBancos.GetBancosSAT Then + DdlSatBanco.DataSource = ObjBancos.DtResultados + DTBancosSAT = ObjBancos.DtResultados + End If + + ObjBancos.Dispose() + + DdlSatBanco.DataBind() + DdlSatBanco.Items.Insert(0, New ListItem("Seleccione uno", "-1")) + + End Sub + Public Sub CargaDatos() Dim ObjBancos As New ClsBancos If ObjBancos.GetBancos() Then @@ -47,7 +77,8 @@ Partial Class Bancos_CatBancos Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click Dim ObjBancos As New ClsBancos - If ObjBancos.AddBancos(TxtBanco.Text.Trim, TxtEjecutivo.Text.Trim, TxtTelefono.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then + If ObjBancos.AddBancos(TxtBanco.Text.Trim, TxtEjecutivo.Text.Trim, TxtTelefono.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveSATBanco:=DdlSatBanco.SelectedValue.ToEntero) Then + DdlSatBanco.SelectedValueExist(-1) TxtBanco.Text = "" TxtEjecutivo.Text = "" TxtTelefono.Text = "" @@ -68,24 +99,42 @@ Partial Class Bancos_CatBancos #Region "G V D A T O S" Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound + If e.Row.RowType = DataControlRowType.DataRow Then + If e.Row.RowIndex = 0 Then - e.Row.Cells(0).Width = Unit.Pixel(156) 'BANCO - e.Row.Cells(1).Width = Unit.Pixel(206) 'EJECUTIVO - e.Row.Cells(2).Width = Unit.Pixel(106) 'TELEFONO - e.Row.Cells(3).Width = Unit.Pixel(95) 'ESTATUS - e.Row.Cells(4).Width = Unit.Pixel(95) 'FECHA - e.Row.Cells(5).Width = Unit.Pixel(100) 'USUARIO - e.Row.Cells(6).Width = Unit.Pixel(100) 'EDITAR - e.Row.Cells(7).Width = Unit.Pixel(65) 'ELIMINAR + e.Row.Cells(0).Width = Unit.Pixel(156) 'BANCO SAT + e.Row.Cells(1).Width = Unit.Pixel(156) 'BANCO + e.Row.Cells(2).Width = Unit.Pixel(206) 'EJECUTIVO + e.Row.Cells(3).Width = Unit.Pixel(106) 'TELEFONO + e.Row.Cells(4).Width = Unit.Pixel(95) 'ESTATUS + e.Row.Cells(5).Width = Unit.Pixel(95) 'FECHA + e.Row.Cells(6).Width = Unit.Pixel(100) 'USUARIO + e.Row.Cells(7).Width = Unit.Pixel(65) 'EDITAR + e.Row.Cells(8).Width = Unit.Pixel(65) 'ELIMINAR End If + e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left - e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Center + e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Center e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Center e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Center - e.Row.Cells(7).HorizontalAlign = HorizontalAlign.Center + 'e.Row.Cells(7).HorizontalAlign = HorizontalAlign.Center + e.Row.Cells(8).HorizontalAlign = HorizontalAlign.Center + End If + + If (e.Row.RowState And DataControlRowState.Edit) = DataControlRowState.Edit Then + Dim DdlSatBanco As DropDownList = e.Row.FCDropDownList("DdlSatBanco") + DdlSatBanco.ClearSelection() + DdlSatBanco.SelectedValue = Nothing + DdlSatBanco.Items.Clear() + DdlSatBanco.DataSource = DTBancosSAT + DdlSatBanco.DataBind() + DdlSatBanco.Items.Insert(0, New ListItem("Seleccione uno", "-1")) + DdlSatBanco.SelectedValueExist(e.Row.DataKey("CveSATBanco").ToString()) + End If + End Sub Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting @@ -126,19 +175,16 @@ Partial Class Bancos_CatBancos Dim Telefono As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtTelefono"), TextBox).Text.Trim Dim Estatus As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked Dim CveBanco As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero + Dim CveSATBanco As Integer = GvDatos.Rows(e.RowIndex).FCDropDownList("DdlSatBanco").SelectedValue.ToEntero Dim TieneError As Boolean = False - If ObjBancos.UpdateBancos(Banco, Ejecutivo, Telefono, Estatus, CveBanco) Then - If ObjBancos.InhabilitarCuentasBancos(CveBanco, Estatus) Then - GvDatos.EditIndex = -1 - ViewState("DTBancos") = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - DtBan = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTBancos = ObjBancos.DtResultados - Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) - Else + If ObjBancos.UpdateBancos(Banco, Ejecutivo, Telefono, Estatus, CveBanco, CveSATBanco:=CveSATBanco) Then + + If Not ObjBancos.InhabilitarCuentasBancos(CveBanco, Estatus) Then TieneError = True End If + Else TieneError = True End If @@ -152,12 +198,24 @@ Partial Class Bancos_CatBancos ObjBancos.Dispose() - If ViewState("Orden").ToString() <> String.Empty Then - CargaGrid(ViewState("Orden").ToString()) - Else - CargaGrid("") + If Not TieneError Then + + GvDatos.EditIndex = -1 + CargaDatos() + GlobalDTBancos = Nothing + Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) + + If ViewState("Orden").ToString() <> String.Empty Then + CargaGrid(ViewState("Orden").ToString()) + Else + CargaGrid("") + End If + End If + + + End Sub Protected Sub GvDatos_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatos.RowEditing diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index 7c63cd39d..673703de3 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -1284,6 +1284,7 @@ Partial Class Bancos_IE ViewState("CveCliente") = "-1" CargaProveedor(HdnCveProveedor.Value.ToEntero, "-1") + CargaCuentasDepositos() End Sub Private Sub CargaProveedor(ByVal CveProveedor As Integer, RFC As String) @@ -4098,11 +4099,17 @@ Partial Class Bancos_IE Dim dtc As DataTable = Nothing - If CveProveedor > 0 Then - dtc = GlobalDTProveedoresCuentas(UsuarioActual.CveEmpresa, CveProveedor:=CveProveedor) + Dim CveProveedorTemp As Integer = CveProveedor + + If DdlProveedores.SelectedValue.ToEntero > 0 Then + CveProveedorTemp = DdlProveedores.SelectedValue.ToEntero + End If + + If CveProveedorTemp > 0 Then + dtc = GlobalDTProveedoresCuentas(UsuarioActual.CveEmpresa, CveProveedor:=CveProveedorTemp) ElseIf CveCliente > 0 Then dtc = GlobalDTCuentasDepositosClientes(UsuarioActual.CveEmpresa, CveCliente:=CveCliente) - ElseIf cvepersonal > 0 Then + ElseIf CvePersonal > 0 Then dtc = GlobalDTCuentasDepositosPersonales(UsuarioActual.CveEmpresa, CvePersonal:=CvePersonal) End If @@ -4216,14 +4223,14 @@ Partial Class Bancos_IE ElseIf OpBanco = 3 Then If dtc.Rows.Count > 0 Then - DdlCuentaDeposito.DataSource = dtc.FiltraParametros("EstatusPagoElectronicoScotia = 'True' AND Estatus ='True'") + DdlCuentaDeposito.DataSource = dtc.FiltraParametros(" Estatus ='True'") DdlCuentaDeposito.DataBind() DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) End If - If dtc.FiltraParametros("EstatusPagoElectronicoScotia = 'True' AND Estatus ='True'").Rows.Count > 0 Then + If dtc.FiltraParametros(" Estatus ='True'").Rows.Count > 0 Then trCuentaDeposito.Visible = True - DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + 'DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) Else BtnGuardar.Enabled = False Alert("El Beneficiario no tiene una cuenta activa en Scotiabank, dela de alta o seleccione otro método de pago", TipoMensaje.MsgAdvertencia) @@ -4265,6 +4272,19 @@ Partial Class Bancos_IE End If End If + + If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString.Contiene("EGSSINFACT", "EGSCREDITO") Then + If DdlTipoTransaccion.SelectedValue.Contiene("9") AndAlso OpBanco = 3 Then + RBL.Items(1).Enabled = False + RBL.Items(2).Enabled = False + Else + RBL.Items(1).Enabled = True + RBL.Items(2).Enabled = True + End If + End If + + + UPPP.Update() UpGuardar.Update() UpCuentaDeposito.Update() UpDatos.Update() @@ -4500,6 +4520,7 @@ Partial Class Bancos_IE DdlProveedores_selectedindexchange(DdlProveedores, Nothing) DdlProveedores.SelectedText = RazonSocial ' BuscaCargaProveedor() + End If CveOCSolicitudAnticipo = DrOC("CveOC").ToString.ToEntero Else diff --git a/Bancos/PagoElectronico.aspx b/Bancos/PagoElectronico.aspx index 453f22d68..5bd2bf71c 100644 --- a/Bancos/PagoElectronico.aspx +++ b/Bancos/PagoElectronico.aspx @@ -60,7 +60,7 @@
    -
    +
    @@ -79,7 +79,7 @@
    -
    +
    @@ -127,7 +127,7 @@
    -
    +
    @@ -178,7 +178,7 @@
    -
    +
    diff --git a/Bancos/PagoElectronico.aspx.vb b/Bancos/PagoElectronico.aspx.vb index bde6db7ea..b058e60bb 100644 --- a/Bancos/PagoElectronico.aspx.vb +++ b/Bancos/PagoElectronico.aspx.vb @@ -277,6 +277,8 @@ Partial Class Bancos_PagoElectronico If DTPendientes IsNot Nothing AndAlso DTPendientes.Rows.Count > 0 Then CargaDatosInformativos() + Else + VistaComandoGeneracion() End If End Sub @@ -946,7 +948,7 @@ Partial Class Bancos_PagoElectronico Dim correo As String = dr("Correo").ToString.Trim If correo.Trim.Length = 0 Then - SBErrores.Append($"Email no definido en fila {idx + 1}. Debe ser un correo electrónico válido.
    ") + SBErrores.Append($" {nombreBen} Email no definido en fila {idx + 1}. Debe ser un correo electrónico válido.
    ") ErrorLayout = True End If diff --git a/Bancos/PagoElectronicoGrupos.aspx.vb b/Bancos/PagoElectronicoGrupos.aspx.vb index ac144efca..981d83af1 100644 --- a/Bancos/PagoElectronicoGrupos.aspx.vb +++ b/Bancos/PagoElectronicoGrupos.aspx.vb @@ -2037,15 +2037,15 @@ Partial Class Bancos_PagoElectronicoGrupos 'Motivo de pago If drow("Observaciones").ToString.Trim.Length > 30 Then - RegistrosPago.Append(drow("Observaciones").ToString.Substring(0, 30)) + RegistrosPago.Append(drow("Observaciones").ToString.Trim.Substring(0, 30)) Else - RegistrosPago.Append(drow("Observaciones").ToString.PadRight(30, EspacioRelleno)) + RegistrosPago.Append(drow("Observaciones").ToString.Trim.PadRight(30, EspacioRelleno)) End If If drow("Referencia").ToString.Trim.Length > 7 Then - RegistrosPago.Append(drow("Referencia").ToString.Substring(0, 7)) + RegistrosPago.Append(drow("Referencia").ToString.Trim.Substring(0, 7)) Else - RegistrosPago.Append(drow("Referencia").ToString.PadRight(7, EspacioRelleno)) + RegistrosPago.Append(drow("Referencia").ToString.Trim.PadRight(7, EspacioRelleno)) End If RegistrosPago.Append("H") diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx index bf2ccb6ec..3d6d102d3 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -5042,7 +5042,7 @@ - + diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index dc292aa46..b9ee9e5b3 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -15524,6 +15524,9 @@ Partial Class Compras_Compras End If End If + Dim ivaPorcentaje As Decimal = DTOCGV.MAX("IVAPorcentaje").ToDecimal + Dim IVAPorcentajeTmp As Decimal = TmpDT.MAX("IVAPorcentaje").ToDecimal + If DTOCGV.MAX("IVAPorcentaje").ToDecimal <> TmpDT.MAX("IVAPorcentaje").ToDecimal Then Alert("La orden de compra(s) tiene diferentes tasa de IVA.", TipoMensaje.MsgAdvertencia) End If diff --git a/Compras/Proveedores.aspx.vb b/Compras/Proveedores.aspx.vb index a3e2ddbda..634f7cc68 100644 --- a/Compras/Proveedores.aspx.vb +++ b/Compras/Proveedores.aspx.vb @@ -5890,7 +5890,14 @@ Partial Class Compras_Proveedores Private Sub CargaTipoTransaccion() + + + If GlobalDTDIOTTipoOperacion IsNot Nothing AndAlso GlobalDTDIOTTipoOperacion.Rows.Count = 0 Then + GlobalDTDIOTTipoOperacion = Nothing + End If + Dim Filtro As String = "" + Select Case DDlDIOTTipoTercero.SelectedValue Case "1" Filtro = "AplicaProvNacional = 1" @@ -5900,8 +5907,11 @@ Partial Class Compras_Proveedores Filtro = "AplicaProvGlobal = 1" End Select + GlobalDTDIOTTipoOperacion.FiltraParametros(Filtro) + DdlDIOTTipoOperacion.DataSource = GlobalDTDIOTTipoOperacion.FiltraParametros(Filtro) DdlDIOTTipoOperacion.DataBind() + End Sub diff --git a/Contabilidad/DiarioPagos.aspx b/Contabilidad/DiarioPagos.aspx index 6c193ac59..7c2ba64e9 100644 --- a/Contabilidad/DiarioPagos.aspx +++ b/Contabilidad/DiarioPagos.aspx @@ -695,6 +695,7 @@ + diff --git a/Export/ExpDetalle.aspx b/Export/ExpDetalle.aspx index cd4946771..ac4590e6d 100644 --- a/Export/ExpDetalle.aspx +++ b/Export/ExpDetalle.aspx @@ -23,6 +23,12 @@
    +
    + + + + +
    @@ -41,7 +47,7 @@ - +
    @@ -209,6 +215,14 @@
    +
    + +
    + + + +
    +
    @@ -340,8 +354,9 @@
    -
    - +
    + +
    @@ -616,81 +631,88 @@

    - - - <%--asp:TemplateField HeaderText="Id" ItemStyle-HorizontalAlign="Left"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
    + + + <%--asp:TemplateField HeaderText="Id" ItemStyle-HorizontalAlign="Left"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + +
    diff --git a/Export/ExpDetalle.aspx.cs b/Export/ExpDetalle.aspx.cs index 895d00d9a..995c5e416 100644 --- a/Export/ExpDetalle.aspx.cs +++ b/Export/ExpDetalle.aspx.cs @@ -1,9 +1,10 @@ using ADSNetLibrary.Helpers; using CrystalDecisions.ReportAppServer.DataDefModel; - //using DocumentFormat.OpenXml.Wordprocessing; using Extensiones; using HigLabo.Core; +using iText.IO.Font.Otf; +using Microsoft.Reporting.WebForms; using Profact.TimbraCFDI; using Profact.TimbraCFDI.Complementos.ComercioExterior10; using StackExchange.Redis; @@ -13,13 +14,13 @@ using System.Activities.Expressions; using System.Activities.Statements; using System.Collections.Generic; using System.Data; +using System.Globalization; using System.IO; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using ModExtensiones = Extensiones.ModExtensiones; -using Microsoft.Reporting.WebForms; public partial class Export_ExpDetalle : ClsPaginas { @@ -34,6 +35,12 @@ public partial class Export_ExpDetalle : ClsPaginas get { return (ViewState["CveExportacionDetalle"] == null) ? -1 : Convert.ToInt32(ViewState["CveExportacionDetalle"]); } set { ViewState["CveExportacionDetalle"] = value; } } + + private bool EsImportacion + { + get { return (ViewState["EsImportacion"] == null) ? false : Boolean.Parse(ViewState["EsImportacion"].ToString()); } + set { ViewState["EsImportacion"] = value; } + } #endregion @@ -41,6 +48,23 @@ public partial class Export_ExpDetalle : ClsPaginas { if (!IsPostBack) { + EsImportacion = false; + if (!string.IsNullOrEmpty(Request["Opcion"]) && Request["Opcion"].Equals("I", StringComparison.OrdinalIgnoreCase)) + { + EsImportacion = true; + } + + LblTipoExp.InnerText = EsImportacion ? "Tipo Importación:" : "Tipo Exportación:"; + + if (EsImportacion) + { + LblExp.Text = "Importaciones"; + } + else + { + LblExp.Text = "Exportación"; + } + CveExportacion = !string.IsNullOrEmpty(Request["CveExportacion"]) ? Request["CveExportacion"].ToEntero() : -1; InicializarValores(); CargaDatos(); @@ -53,11 +77,17 @@ public partial class Export_ExpDetalle : ClsPaginas protected void InicializarValores() { int CveEmpresa = UsuarioActual.CveEmpresa; + int CveUsuario = UsuarioActual.CveUsuario; + + // Sub Proyecto + DdlSubProyecto.Items.Clear(); + DdlSubProyecto.DataSource = get_GlobalDTSubProyectosUsuarios(CveUsuario, -1, CveEmpresa); + DdlSubProyecto.Items.Insert(0, new ListItem("Seleccione", "-1")); + DdlSubProyecto.DataBind(); // Factura ClsVentas Ventas = new ClsVentas(); - // El problema es que solo se obtienen los registros donde CveUsuarioConsulta = Sis_UsuariosSubProyectos.CveUsuario en la BD - if (Ventas.GetVentas(CveEmpresa, "-1", "-1", -1, "-1", -1, -1, -1, -1, DateTime.Today.AddMonths(-1).ToString(), ModExtensiones.MaxFecha.ToString(), "-1", CveUsuarioConsulta: UsuarioActual.CveUsuario)) + if (Ventas.GetVentas(CveEmpresa, "-1", "-1", -1, "-1", -1, -1, -1, -1, DateTime.Today.AddMonths(-1).ToString(), ModExtensiones.MaxFecha.ToString(), "-1", CveUsuarioConsulta: CveUsuario)) { DdlVentas.Items.Clear(); DdlVentas.DataSource = Ventas.DtResultados; @@ -116,13 +146,16 @@ public partial class Export_ExpDetalle : ClsPaginas { DataTable DTExportaciones = new DataTable(); ClsExportaciones Exportaciones = new ClsExportaciones(); - if (Exportaciones.GetExportacion(CveExportacion, UsuarioActual.CveEmpresa)) + bool EsExportacion = !EsImportacion; + if (Exportaciones.GetExportacion(CveExportacion, UsuarioActual.CveEmpresa, EsExportacion)) { DTExportaciones = Exportaciones.DtResultados; if (DTExportaciones.Rows.Count > 0) { LblExp.Text = DTExportaciones.FiltroPrimeroValor("CveExportacion"); + DdlSubProyecto.SelectedValue = DTExportaciones.FiltroPrimeroValor("CveSubProyecto"); + string CveVenta = DTExportaciones.FiltroPrimeroValor("CveVenta"); if (CveVenta != "" && CveVenta != "-1") { @@ -158,6 +191,7 @@ public partial class Export_ExpDetalle : ClsPaginas DdlAgenteExt.SelectedValue = DTExportaciones.FiltroPrimeroValor("CveAgenteExtranjero"); DdlClaveAduana.SelectedValue = DTExportaciones.FiltroPrimeroValor("ClaveAduana"); + TxtDescContenedor.Text = DTExportaciones.FiltroPrimeroValor("DescripcionContenedor"); DdlCompTransportista.SelectedValue = DTExportaciones.FiltroPrimeroValor("CveProveedor"); DdlCompTransportista.SelectedText = DTExportaciones.FiltroPrimeroValor("Proveedor"); TxtPlaca.Text = DTExportaciones.FiltroPrimeroValor("ContenedorPlaca"); @@ -193,6 +227,7 @@ public partial class Export_ExpDetalle : ClsPaginas ActualizarValores(); // Se actualizan los valores que dependen de otros campos DdlDirExp.SelectedValue = DTExportaciones.FiltroPrimeroValor("CveDirExportador"); // Seleccionar las Dir DESPUÉS de llenar el dropdown + DdlDirImp.SelectedValue = DTExportaciones.FiltroPrimeroValor("CveDirImportador"); DdlDirCon.SelectedValue = DTExportaciones.FiltroPrimeroValor("CveDirConsignatario"); CargarPartidas(); @@ -258,6 +293,23 @@ public partial class Export_ExpDetalle : ClsPaginas } } + // Clave Dir. Importador + string CveImportador = DdlImp.SelectedValue; + if (CveImportador != "" && CveImportador != "-1") + { + string CveDirImp = DdlDirImp.Text; + DdlDirImp.Items.Clear(); + DdlDirImp.DataSource = get_GlobalDTProveedorSucursales(CveImportador.ToEntero(), CveEmpresa); + DdlDirImp.Items.Insert(0, new ListItem("Seleccione", "-1")); + DdlDirImp.DataBind(); + if (CveDirImp != "" && CveDirImp != "-1") + { + ListItem ItemDirImp = DdlDirImp.Items.FindByValue(CveDirImp); + if (ItemDirImp != null) + DdlDirImp.SelectedValue = CveDirImp; + } + } + // Clave Dir. Consignatario string CveConsignatario = DdlCon.SelectedValue; if (CveConsignatario != "" && CveConsignatario != "-1") @@ -331,7 +383,9 @@ public partial class Export_ExpDetalle : ClsPaginas } string ITN = TxtITN.Text; + int CveSubProyecto = DdlSubProyecto.Text.ToEntero(); string NumeroPedimento = TxtNumPed.Text; + NumeroPedimento = NumeroPedimento == "__--__--____--_______" ? "" : NumeroPedimento; DateTime FechaPedimento = TxtFechaPedim.Text.ToDate(); int CveVenta = DdlVentas.Text.ToEntero(); decimal TipoCambio = ModExtensiones.ToDecimal(TxtTipoCambio.Text); @@ -339,6 +393,7 @@ public partial class Export_ExpDetalle : ClsPaginas int CveExportacionEstatus = DdlExpEstatus.Text.ToEntero(); int CveAgente = DdlAgenteMex.Text.ToEntero(); int ClaveAduana = DdlClaveAduana.Text.ToEntero(); + string DescripcionContenedor = TxtDescContenedor.Text; int CveProveedor = DdlCompTransportista.SelectedValue.ToEntero(); int MedioTransporte = DdlMedioTran.Text.ToEntero(); int TipoContenedor = DdlTipoContenedor.Text.ToEntero(); @@ -351,6 +406,7 @@ public partial class Export_ExpDetalle : ClsPaginas int CveEmpresa = UsuarioActual.CveEmpresa; int CveUsuario = UsuarioActual.CveUsuario; int CveDirExportador = DdlDirExp.Text.ToEntero(); + int CveDirImportador = DdlDirImp.Text.ToEntero(); int CveDirConsignatario = DdlDirCon.Text.ToEntero(); bool Vinculacion = CkbVinculacion.Checked; int CveIncoterm = DdlIncoterm.Text.ToEntero(); @@ -370,10 +426,11 @@ public partial class Export_ExpDetalle : ClsPaginas decimal DecOtros = ModExtensiones.ToDecimal(TxtDecOtros.Text); ClsExportaciones Exportaciones = new ClsExportaciones(); - + bool EsExportacion = !EsImportacion; if (CveExportacion == -1) { int ExportacionGuardada = Exportaciones.AddExportacion( + CveSubProyecto, NumeroPedimento, FechaPedimento, CveVenta, @@ -385,6 +442,7 @@ public partial class Export_ExpDetalle : ClsPaginas CveClienteConsignatario.ToEntero(), CveAgente, ClaveAduana, + DescripcionContenedor, CveProveedor, MedioTransporte, TipoContenedor, @@ -397,13 +455,15 @@ public partial class Export_ExpDetalle : ClsPaginas CveEmpresa, CveUsuario, CveDirExportador, + CveDirImportador, CveDirConsignatario, CveIncoterm, Notas, CvePedimento, CveAgenteExtranjero, ITN, - Vinculacion + Vinculacion, + EsExportacion ); if (ExportacionGuardada != -1) { @@ -441,8 +501,10 @@ public partial class Export_ExpDetalle : ClsPaginas } //string Liga = "document.location.href=\"/Export/RepExportaciones.aspx\";"; - string Liga = $"document.location.href=\"/Export/ExpDetalle.aspx?CveExportacion={ExportacionGuardada}\";"; - Alert("La Exportación se ha agregado correctamente.", JSBtnAceptar: Liga); + string liga = EsImportacion + ? $"document.location.href=\"/Export/ExpDetalle.aspx?CveExportacion={ExportacionGuardada}&Opcion=I\";" + : $"document.location.href=\"/Export/ExpDetalle.aspx?CveExportacion={ExportacionGuardada}\";"; + Alert("La Exportación se ha agregado correctamente.", JSBtnAceptar: liga); } Exportaciones.Dispose(); } @@ -450,6 +512,7 @@ public partial class Export_ExpDetalle : ClsPaginas { bool Continuar = Exportaciones.UpdateExportacion( CveExportacion, + CveSubProyecto, NumeroPedimento, FechaPedimento, CveVenta, @@ -461,6 +524,7 @@ public partial class Export_ExpDetalle : ClsPaginas CveClienteConsignatario.ToEntero(), CveAgente, ClaveAduana, + DescripcionContenedor, CveProveedor, MedioTransporte, TipoContenedor, @@ -473,6 +537,7 @@ public partial class Export_ExpDetalle : ClsPaginas CveEmpresa, CveUsuario, CveDirExportador, + CveDirImportador, CveDirConsignatario, CveIncoterm, Notas, @@ -754,7 +819,26 @@ public partial class Export_ExpDetalle : ClsPaginas string FraccionArancelaria = ""; string UnidadAduana = ""; - string CveFraccionArancelaria = get_GlobalDTPS(CveEmpresa, CvePS).FiltroPrimeroValor("CveFraccionArancelaria"); + DataTable DTPS = get_GlobalDTPS(CveEmpresa, CvePS); + string IVA = DTPS.FiltroPrimeroValor("IVA"); + if (IVA == "-1") + { + if (DdlSubProyecto.Text != "-1") + { + DataTable DTSubProyectos = get_GlobalDTSubProyectosUsuarios(CveUsuario, -1, CveEmpresa, DdlSubProyecto.Text.ToEntero()); + IVA = DTSubProyectos.FiltroPrimeroValor("IVA"); + } + else + { + IVA = ""; + } + } + if (IVA != "") + { + decimal iva_decimal = ModExtensiones.ToDecimal(IVA); + IVA = iva_decimal.ToString("N2"); + } + string CveFraccionArancelaria = DTPS.FiltroPrimeroValor("CveFraccionArancelaria"); if (CveFraccionArancelaria != "" && GlobalDTFraccionArancelaria.Any()) { DataTable DTFraccArancelaria = GlobalDTFraccionArancelaria.CopyToDataTable(); @@ -774,6 +858,7 @@ public partial class Export_ExpDetalle : ClsPaginas PartidaRow["ClaveSATPais"] = ClaveSATPais; PartidaRow["Precio"] = Precio; PartidaRow["ValorTotalMXP"] = ValorTotalMXP; + PartidaRow["IVA"] = IVA; PartidaRow["Cantidad"] = Cantidad; PartidaRow["PesoUnitario"] = PesoUnitario; PartidaRow["PesoBruto"] = PesoBruto; @@ -797,6 +882,7 @@ public partial class Export_ExpDetalle : ClsPaginas PartidaRow["ClaveSATPais"] = ClaveSATPais; PartidaRow["Precio"] = Precio; PartidaRow["ValorTotalMXP"] = ValorTotalMXP; + PartidaRow["IVA"] = IVA; PartidaRow["Cantidad"] = Cantidad; PartidaRow["PesoUnitario"] = PesoUnitario; PartidaRow["PesoBruto"] = PesoBruto; @@ -839,6 +925,7 @@ public partial class Export_ExpDetalle : ClsPaginas DTTemp.Columns.Add("ClaveSATPais", typeof(string)); DTTemp.Columns.Add("Precio", typeof(decimal)); DTTemp.Columns.Add("ValorTotalMXP", typeof(decimal)); + DTTemp.Columns.Add("IVA", typeof(string)); DTTemp.Columns.Add("Cantidad", typeof(decimal)); DTTemp.Columns.Add("PesoUnitario", typeof(decimal)); DTTemp.Columns.Add("PesoBruto", typeof(decimal)); @@ -923,17 +1010,38 @@ public partial class Export_ExpDetalle : ClsPaginas DataRow RowExp = DTExportaciones.Rows[0]; string ClienteExportador = DTExportaciones.FiltroPrimeroValor("ClienteExportador"); string DirExportador = DTExportaciones.FiltroPrimeroValor("DirExportador"); - string ClienteImortador = DTExportaciones.FiltroPrimeroValor("ClienteImportador"); + string ClienteImportador = DTExportaciones.FiltroPrimeroValor("ClienteImportador"); string RFCImp = DTExportaciones.FiltroPrimeroValor("RFCImp"); + string IMMEXimp = DTExportaciones.FiltroPrimeroValor("IMMEXimp"); string NumFactura = DTExportaciones.FiltroPrimeroValor("SerieFolio"); string ClaveSATPedimento = DTExportaciones.FiltroPrimeroValor("ClaveSATPedimento"); - string FechaFact = RowExp["FechaFact"] != DBNull.Value ? Convert.ToDateTime(RowExp["FechaFact"]).ToString("dd/MM/yyyy") : ""; + string ITN = DTExportaciones.FiltroPrimeroValor("ITN"); + string Vinculacion = DTExportaciones.FiltroPrimeroValor("Vinculacion") == "True" ? "SI" : "NO"; + string FechaFact = ""; + string NumSemana = ""; + if (RowExp["FechaFact"] != DBNull.Value) + { + DateTime fechaf = Convert.ToDateTime(RowExp["FechaFact"]); + FechaFact = fechaf.ToString("dd/MM/yyyy"); + + CultureInfo cultura = CultureInfo.CurrentCulture; + System.Globalization.Calendar calendario = cultura.Calendar; + int numeroSemana = calendario.GetWeekOfYear( + fechaf, + cultura.DateTimeFormat.CalendarWeekRule, + cultura.DateTimeFormat.FirstDayOfWeek + ); + NumSemana = numeroSemana.ToString(); + } string TipoCambio = ModExtensiones.ToDecimal(DTExportaciones.FiltroPrimeroValor("TipoCambio")).ToString("#,###.####"); string MedioTransporte = DTExportaciones.FiltroPrimeroValor("MedioTransporte"); + MedioTransporte = MedioTransporte != "-1" ? MedioTransporte : ""; string TipoContenedor = DTExportaciones.FiltroPrimeroValor("TipoContenedor"); + TipoContenedor = TipoContenedor != "-1" ? TipoContenedor : ""; string ClienteConsignatario = DTExportaciones.FiltroPrimeroValor("ClienteConsignatario"); string DirConsignatario = DTExportaciones.FiltroPrimeroValor("DirConsignatario"); string RFCCon = DTExportaciones.FiltroPrimeroValor("RFCCon"); + string IMMEXcon = DTExportaciones.FiltroPrimeroValor("IMMEXcon"); decimal IncFletes = 0.00m; decimal IncSeguro = 0.00m; @@ -953,24 +1061,34 @@ public partial class Export_ExpDetalle : ClsPaginas string SCAC = DTExportaciones.FiltroPrimeroValor("SCAC"); string CAAT = DTExportaciones.FiltroPrimeroValor("CAAT"); string ClaveAduana = DTExportaciones.FiltroPrimeroValor("ClaveSATAduanaSeccionDescripcion"); + ClaveAduana = ClaveAduana != " - - " ? ClaveAduana : ""; string ClaveSATIncoterm = DTExportaciones.FiltroPrimeroValor("ClaveSATIncoterm"); - string CedulaAgente = DTExportaciones.FiltroPrimeroValor("CedulaAgente"); + string RFCAgente = DTExportaciones.FiltroPrimeroValor("RFCAgente"); + string Patente = DTExportaciones.FiltroPrimeroValor("Patente"); + string AgenteExt = DTExportaciones.FiltroPrimeroValor("AgenteExt"); + string TaxId = DTExportaciones.FiltroPrimeroValor("TaxId"); + string Notas = DTExportaciones.FiltroPrimeroValor("Notas"); List para = new List(); para.Add(new ReportParameter("CveExportacion", CveExportacion.ToString())); para.Add(new ReportParameter("ClienteExportador", ClienteExportador)); para.Add(new ReportParameter("DirExportador", DirExportador)); - para.Add(new ReportParameter("ClienteImportador", ClienteImortador)); + para.Add(new ReportParameter("ClienteImportador", ClienteImportador)); para.Add(new ReportParameter("RFCImp", RFCImp)); + para.Add(new ReportParameter("IMMEXimp", IMMEXimp)); para.Add(new ReportParameter("NumFactura", NumFactura)); para.Add(new ReportParameter("ClaveSATPedimento", ClaveSATPedimento)); + para.Add(new ReportParameter("ITN", ITN)); + para.Add(new ReportParameter("Vinculacion", Vinculacion)); para.Add(new ReportParameter("FechaFact", FechaFact)); + para.Add(new ReportParameter("NumSemana", NumSemana)); para.Add(new ReportParameter("TipoCambio", TipoCambio)); para.Add(new ReportParameter("MedioTransporte", MedioTransporte)); para.Add(new ReportParameter("TipoContenedor", TipoContenedor)); para.Add(new ReportParameter("ClienteConsignatario", ClienteConsignatario)); para.Add(new ReportParameter("DirConsignatario", DirConsignatario)); para.Add(new ReportParameter("RFCCon", RFCCon)); + para.Add(new ReportParameter("IMMEXcon", IMMEXcon)); ClsExportaciones Gastos = new ClsExportaciones(); if (Gastos.GetGastos(CveExportacion)) @@ -1013,14 +1131,44 @@ public partial class Export_ExpDetalle : ClsPaginas para.Add(new ReportParameter("CAAT", CAAT)); para.Add(new ReportParameter("ClaveAduana", ClaveAduana)); para.Add(new ReportParameter("ClaveSATIncoterm", ClaveSATIncoterm)); - para.Add(new ReportParameter("CedulaAgente", CedulaAgente)); - + para.Add(new ReportParameter("RFCAgente", RFCAgente)); + para.Add(new ReportParameter("Patente", Patente)); + para.Add(new ReportParameter("AgenteExt", AgenteExt)); + para.Add(new ReportParameter("TaxId", TaxId)); + para.Add(new ReportParameter("Notas", Notas)); List lrds = new List(); - ReportDataSource rds = new ReportDataSource(); - rds.Name = "DsExportaciones"; - rds.Value = DTExportaciones; - lrds.Add(rds); + ReportDataSource RDSExportaciones = new ReportDataSource(); + RDSExportaciones.Name = "DsExportaciones"; + RDSExportaciones.Value = DTExportaciones; + lrds.Add(RDSExportaciones); + + DataTable DTPartidas = new DataTable(); + ClsExportaciones Partidas = new ClsExportaciones(); + if (Partidas.GetPartidas(UsuarioActual.CveEmpresa, CveExportacion)) + { + DTPartidas = Partidas.DtResultados; + if (DTPartidas.Rows.Count > 0) + { + DTPartidas.Columns.Add("ValorUnitarioUSD", typeof(decimal)); + DTPartidas.Columns.Add("ValorUnitarioMN", typeof(decimal)); + DTPartidas.Columns["ValorUnitarioUSD"].DefaultValue = 0.0m; + DTPartidas.Columns["ValorUnitarioMN"].DefaultValue = 0.0m; + foreach (DataRow row in DTPartidas.Rows) + { + decimal cantidad = Convert.ToDecimal(row["Cantidad"]); + if (cantidad > 0) + { + row["ValorUnitarioUSD"] = Convert.ToDecimal(row["Precio"]) / cantidad; + row["ValorUnitarioMN"] = Convert.ToDecimal(row["ValorTotalMXP"]) / cantidad; + } + } + ReportDataSource RDSPartidas = new ReportDataSource(); + RDSPartidas.Name = "DsPartidas"; + RDSPartidas.Value = DTPartidas; + lrds.Add(RDSPartidas); + } + } string NombreArchivo = $"Exportacion_{CveExportacion}"; string CveVenta = DTExportaciones.FiltroPrimeroValor("CveVenta"); ; diff --git a/Export/RepExportaciones.aspx b/Export/RepExportaciones.aspx index b8f405ae6..951f87ba6 100644 --- a/Export/RepExportaciones.aspx +++ b/Export/RepExportaciones.aspx @@ -4,9 +4,59 @@ + - Exportaciones +
  • @@ -18,125 +68,176 @@ - + - -
    -
    -
    - - Información - -
    - +
    +
    + <%--asp:Literal ID="LtlPeriodoseleccionado" runat="server">
    - - <%----%> + + <%--a href="javascript:;" class="expand">
    -
    +
    +
    + Proyecto: +
    + +
    + SubProyecto: +
    + +
    +
    + Fecha Inicio: + +
    +
    +
    + + + + +
    + + + + + + +
    +
    + Fecha Fin: + +
    +
    +
    + + + + +
    + + + + + + +
    +
    +
    + <%--div class="tools">
    " style="display: inline-block; margin-right: -20px; width: 150px;" /> " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info">
    + +
    + <%--div class="portlet-body" style="display: none"> +
    + +
    + + +
    - -
    -
    - - - - - - > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    +
    + + + + + + + > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Export/RepExportaciones.aspx.cs b/Export/RepExportaciones.aspx.cs index 7a71cc001..d6977de3a 100644 --- a/Export/RepExportaciones.aspx.cs +++ b/Export/RepExportaciones.aspx.cs @@ -1,11 +1,14 @@ using DocumentFormat.OpenXml.Wordprocessing; using Extensiones; +using HigLabo.Core; +using iText.Layout.Element; using StackExchange.Redis; using System; using System.Activities; using System.Activities.Expressions; using System.Activities.Statements; using System.Collections.Generic; +using System.EnterpriseServices.Internal; using System.Linq; using System.Web; using System.Web.UI; @@ -13,6 +16,7 @@ using System.Web.UI.WebControls; using static Microsoft.EntityFrameworkCore.DbLoggerCategory; using static Stimulsoft.Report.Export.DeflaterHuffman; + public partial class Export_RepExportaciones : ClsPaginas { #region Propiedades @@ -21,18 +25,76 @@ public partial class Export_RepExportaciones : ClsPaginas get { return (ViewState["CveExportacion"] == null) ? -1 : Convert.ToInt32(ViewState["CveExportacion"]); } set { ViewState["CveExportacion"] = value; } } + + private bool EsImportacion + { + get{ return (ViewState["EsImportacion"] == null) ? false : Boolean.Parse(ViewState["EsImportacion"].ToString()); } + set { ViewState["EsImportacion"] = value; } + } + public string EmptyDataTextPersonalizado { get; set; } + public string ToolTipPersonalizado { get; set; } #endregion protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { - CargaExportaciones(); + EsImportacion = false; + + if (Request["Opcion"] != null) + { + if (Request["Opcion"] == "I") + EsImportacion = true; + } + + Page.Title = EsImportacion ? "Importaciones" : "Exportaciones"; + // Ahora sí, usa la bandera para los textos + if (EsImportacion) + { + LtlTitulo.Text = "Importaciones"; + EmptyDataTextPersonalizado = "No se encontraron importaciones"; + ToolTipPersonalizado = "Importaciones"; + HLAgregarExp.Text = " Agregar Importación"; + HLAgregarExp.NavigateUrl = "ExpDetalle.aspx?CveExportacion=-1&Opcion=I"; + } + else + { + LtlTitulo.Text = "Exportaciones"; + EmptyDataTextPersonalizado = "No se encontraron exportaciones"; + ToolTipPersonalizado = "Exportaciones"; + HLAgregarExp.Text = " Agregar Exportación"; + HLAgregarExp.NavigateUrl = "ExpDetalle.aspx?CveExportacion=-1"; + } + + GVExportaciones.EmptyDataText = EmptyDataTextPersonalizado; + GVExportaciones.ToolTip = ToolTipPersonalizado; + + InicializarValores(); + //CargaExportaciones(); } } + protected void InicializarValores() + { + CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, LblProyecto, LblSubProyecto, divProyecto: DivProyecto); + DdlProyecto.Visible = false; + LblProyecto.Visible = false; + DivProyecto.Visible = false; + LblSubProyecto.Text = $"{LblSubProyecto.Text}:"; + txtFechaI.Text = NowADS().FirstDayOfMonth().ToShortDateString(); + txtFechaF.Text = NowADS().ToShortDateString(); + + CargaExportaciones(); + } protected void CargaExportaciones() { + + bool EsExportacion = !EsImportacion; + string SubProyectos = DdlSubProyecto.GetSelectedValuesM(); + SubProyectos = SubProyectos == "" ? "-1" : SubProyectos; + DateTime FechaInicio = DateTime.TryParse(txtFechaI.Text, out _) ? txtFechaI.Text.ToDate() : ModExtensiones.MinFecha; + DateTime FechaFin = DateTime.TryParse(txtFechaF.Text, out _) ? txtFechaF.Text.ToDate() : ModExtensiones.MaxFecha; + ClsExportaciones Exportaciones = new ClsExportaciones(); - if (Exportaciones.GetExportacion(-1, UsuarioActual.CveEmpresa)) + if (Exportaciones.GetExportacion(-1, UsuarioActual.CveEmpresa, EsExportacion, FechaInicio, FechaFin, SubProyectos)) { GVExportaciones.DataSource = Exportaciones.DtResultados; GVExportaciones.DataBind(); @@ -46,6 +108,11 @@ public partial class Export_RepExportaciones : ClsPaginas Response.Redirect($"/Export/ExpDetalle.aspx?CveExportacion={gvRow.DataKey("CveExportacion")}", true); upDatosExp.Update(); } + protected void BtnConsultar_Click(object sender, EventArgs e) + { + CargaExportaciones(); + upDatosExp.Update(); + } protected void EliminarExp_Click(object sender, EventArgs e) { GridViewRow gvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); diff --git a/General/SaldosIniciales.aspx.vb b/General/SaldosIniciales.aspx.vb index 36d0bbeb0..17bbe038d 100644 --- a/General/SaldosIniciales.aspx.vb +++ b/General/SaldosIniciales.aspx.vb @@ -794,7 +794,7 @@ Partial Class General_SaldosIniciales Dim DTCuentasContables As New DataTable - If UsuarioActual.Empresa.TipoContabilizacion = 1 Or UsuarioActual.CveEmpresa.Contiene(172, 174) Then + If UsuarioActual.Empresa.TipoContabilizacion = 1 Or UsuarioActual.CveEmpresa.Contiene(172, 174, 184) Then Dim ObjConta As New ClsContabilidad If ObjConta.GetCuentas(-1, "-1", -1, UsuarioActual.CveEmpresa) Then @@ -1445,7 +1445,7 @@ Partial Class General_SaldosIniciales If CobranzaTelefono.Trim.Length > 10 Then CobranzaTelefono = "" - Dim FormaPago As String = If(dt.Columns.Contains("Forma Pago"), Row("Forma Pago").ToString(), "") + Dim FormaPago As String = If(dt.Columns.Contains("FormaPago"), Row("FormaPago").ToString(), "") Dim CveFormaPago33 As Integer = 99 Select Case FormaPago diff --git a/Inicio.aspx b/Inicio.aspx index 6f20e28c0..ed13f6142 100644 --- a/Inicio.aspx +++ b/Inicio.aspx @@ -1712,7 +1712,59 @@
    + +