diff --git a/App_Code/ClsCompras.vb b/App_Code/ClsCompras.vb index f6730e5d0..8737fc436 100644 --- a/App_Code/ClsCompras.vb +++ b/App_Code/ClsCompras.vb @@ -505,7 +505,7 @@ Public Class ClsCompras Public Function UpdateCompraDetalle(CvePS As Integer, Cantidad As Double, PU As Double, IVA As Double, Total As Double, Descuento As Double, Observaciones As String, CveSubProyecto As Integer, CvePresupuestoEgreso As Integer, CveActivoFijo As Integer, CveCompraDetalle As Integer, Optional AplicaCostoIndirecto As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveTipoGasto As Integer = -1, Optional AF_Medida As Integer = -1, Optional AF_TipoMantenimiento As Integer = -1, Optional Referencia As String = "", Optional RetIVA As Double = 0, Optional RetISR As Double = 0, Optional IEPSPS As Double = 0, Optional IEPSPSIVA As Double = 0, - Optional IVAPorcentaje As Double = 0, Optional RetIVAPorcentaje As Double = 0, Optional RetISRPorcentaje As Double = 0, Optional IEPSPSPorcentaje As Double = 0, Optional IEPSPSIVAPorcentaje As Double = 0, Optional NoDeducible As Boolean = False) As Boolean + Optional IVAPorcentaje As Double = 0, Optional RetIVAPorcentaje As Double = 0, Optional RetISRPorcentaje As Double = 0, Optional IEPSPSPorcentaje As Double = 0, Optional IEPSPSIVAPorcentaje As Double = 0, Optional NoDeducible As Boolean = False, Optional CveContratoDetalle As Integer = -1) As Boolean Dim Retorno As Boolean = False @@ -540,6 +540,8 @@ Public Class ClsCompras .Add("@IEPSPSPorcentaje", SqlDbType.Float).Value = IEPSPSPorcentaje .Add("@IEPSPSIVAPorcentaje", SqlDbType.Float).Value = IEPSPSIVAPorcentaje .Add("@NoDeducible", SqlDbType.Bit).Value = NoDeducible + .Add("@CveContratoDetalle", SqlDbType.Int).Value = CveContratoDetalle + End With diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb index 56b39138a..becb87884 100644 --- a/App_Code/ClsGenerales.vb +++ b/App_Code/ClsGenerales.vb @@ -3268,6 +3268,65 @@ Public Class ClsGenerales #End Region +#Region "C A R T A P O R T E" + + Public Function GetMaterialPeligroso() As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Gral_CP_MaterialPeligrosoGet") + 'With SqlAdapter.SelectCommand.Parameters + ' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + ' .Add("@CveClasificacionPorcentaje", SqlDbType.Int).Value = CveClasificacionPorcentaje + ' .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion + ' .Add("@PorcentajeIVA", SqlDbType.Float).Value = PorcentajeIVA + ' .Add("@Opcion", SqlDbType.Int).Value = Opcion + 'End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener materiales peligrosos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + Public Function GetEmbalajes() As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Gral_CP_EmbalajesGet") + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener embalajes.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + + Public Function GetCartaPorteTipoPermiso() As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Gral_CP_TipoPermisoGet") + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los permisos de carta porte.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + + Public Function GetCartaPorteConfigAutoTransportes() As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Gral_CP_ConfigAutoTransportesGet") + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los configuración de autotransporte de carta porte.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + +#End Region + Protected Overridable Sub Dispose(ByVal disposing As Boolean) If Not disposedValue Then If disposing Then diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 56ab4a401..8611e3a83 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -645,6 +645,63 @@ Public Class ClsPaginas End Set End Property +#Region "C A R T A P O R T E " + Property GlobalDTMaterialPeligroso(Optional CveMaterialPeligroso As Integer = -1) As DataTable + Get + + Dim AppNombre As String = "GlobalDTMaterialPeligroso" + 'sino existe, recarga los datos + If Application(AppNombre) Is Nothing Then + Dim Obj As New ClsGenerales + If Obj.GetMaterialPeligroso() Then Application(AppNombre) = Obj.DtResultados + Obj.Dispose() + End If + If CveMaterialPeligroso > 0 Then + Dim Str As New StringBuilder + Str.AppendFormat("CveMaterialPeligroso = {0}", CveMaterialPeligroso) + Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows) + GlobalDTMaterialPeligroso = Dv.ToTable + Dv.Dispose() + Else + GlobalDTMaterialPeligroso = DirectCast(Application(AppNombre), DataTable) + End If + + End Get + Set(value As DataTable) + Dim AppNombre As String = "GlobalDTMaterialPeligroso" + Application(AppNombre) = value + End Set + End Property + + Property GlobalDTEmbalajes(Optional CveEmbalaje As Integer = -1) As DataTable + Get + + Dim AppNombre As String = "GlobalDTEmbalajes" + 'sino existe, recarga los datos + If Application(AppNombre) Is Nothing Then + Dim Obj As New ClsGenerales + If Obj.GetEmbalajes() Then Application(AppNombre) = Obj.DtResultados + Obj.Dispose() + End If + If CveEmbalaje > 0 Then + Dim Str As New StringBuilder + Str.AppendFormat("CveEmbalaje = {0}", CveEmbalaje) + Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows) + GlobalDTEmbalajes = Dv.ToTable + Dv.Dispose() + Else + GlobalDTEmbalajes = DirectCast(Application(AppNombre), DataTable) + End If + + End Get + Set(value As DataTable) + Dim AppNombre As String = "GlobalDTEmbalajes" + Application(AppNombre) = value + End Set + End Property +#End Region + + Property GlobalDTClasificaciones(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1, Optional UsoClasificacion As Integer = -1, Optional CveClasificacion As Integer = -1) As DataTable Get @@ -3125,18 +3182,26 @@ Public Class ClsPaginas Property GlobalDTContaConceptosContables(CveConceptoContable As Integer) As DataTable Get + Dim AppNombre As String = String.Format("GlobalDTContaConceptosContables") + 'sino existe, recarga los datos + If Application(AppNombre) Is Nothing Then + Using ObjContabilidad As New ClsContabilidad + If ObjContabilidad.GetConta_ConceptosContables() Then Application(AppNombre) = ObjContabilidad.DtResultados Else Application(AppNombre) = Nothing + End Using + + End If If CveConceptoContable <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTContaConceptosContables"), DataTable), String.Format("CveConceptoContable = {0}", CveConceptoContable), "", DataViewRowState.CurrentRows) + Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), String.Format("CveConceptoContable = {0}", CveConceptoContable), "", DataViewRowState.CurrentRows) GlobalDTContaConceptosContables = Dv.ToTable Dv.Dispose() Else - GlobalDTContaConceptosContables = DirectCast(Application("GlobalDTContaConceptosContables"), DataTable) + GlobalDTContaConceptosContables = DirectCast(Application(AppNombre), DataTable) End If - End Get Set(value As DataTable) - Application("GlobalDTContaConceptosContables") = value + Dim AppNombre As String = String.Format("GlobalDTContaConceptosContables") + Application(AppNombre) = value End Set End Property #End Region diff --git a/App_Code/ClsProductosServicios.vb b/App_Code/ClsProductosServicios.vb index 4af16b530..113c97ce0 100644 --- a/App_Code/ClsProductosServicios.vb +++ b/App_Code/ClsProductosServicios.vb @@ -89,6 +89,9 @@ Public Class ClsProductosServicios Public Property ClaveSATUnidadAduanaDescripcion As String Public Property ClaveSATFraccionArancelaria As String Public Property ClaveSATUnidadAduana As String + Public Property CveMaterialPeligroso As Integer + Public Property CveEmbalaje As Integer + Public Property PesoKg As Decimal 'Nuevo Raul: 10/08/2018 Public Property CveUsuarioModifico As Integer @@ -295,6 +298,10 @@ Public Class ClsProductosServicios ClaveSATFraccionArancelariaDescripcion = Data.Rows(0)("ClaveSATFraccionArancelariaDescripcion").ToString ClaveSATUnidadAduanaDescripcion = Data.Rows(0)("ClaveSATUnidadAduanaDescripcion").ToString + CveMaterialPeligroso = Data.Rows(0)("CveMaterialPeligroso").ToString.ToEntero + CveEmbalaje = Data.Rows(0)("CveEmbalaje").ToString.ToEntero + PesoKg = Data.Rows(0)("PesoKg").ToString.ToDecimal + 'Nuevo Raul: 10/08/2018 CveUsuarioModifico = Data.Rows(0)("CveUsuarioModifico").ToString.ToEntero UsuarioModifico = Data.Rows(0)("UsuarioModifico").ToString @@ -408,7 +415,8 @@ Public Class ClsProductosServicios Optional CveFraccionArancelaria As Integer = -1, Optional CveClasificacionDetalle As Integer = -1, Optional CveTamaño As Integer = -1, Optional CveModelo As Integer = -1, Optional CveMedida As Integer = -1, Optional CveRinTamaño As Integer = -1, Optional ClaveImpuestoEmpaque As String = "", Optional ClaveImpuestoUM As String = "", Optional ClaveCategoriaToxicidad As String = "", Optional ClaveImpuestoTipoProducto As String = "", Optional Litraje As Double = -1, Optional EsOutSourcing As Boolean = False, Optional AplicaSerie As Boolean = False, Optional AplicaLote As Boolean = False, - Optional AplicaCaducidad As Boolean = False, Optional AplicaSeccion As Boolean = False, Optional TiempoCaducidad As Integer = -1, Optional CvePSAdicionalVigencia As Integer = -1, Optional PrecioLibre As Boolean = False) As Integer + Optional AplicaCaducidad As Boolean = False, Optional AplicaSeccion As Boolean = False, Optional TiempoCaducidad As Integer = -1, Optional CvePSAdicionalVigencia As Integer = -1, Optional PrecioLibre As Boolean = False, + Optional CveMaterialPeligroso As Integer = -1, Optional CveEmbalaje As Integer = -1, Optional PesoKg As Decimal = -1) As Integer Dim Retorno As Integer = -1 DataAdapter("PA_ProductosServiciosAdd") @@ -492,6 +500,10 @@ Public Class ClsProductosServicios .Add("@CvePSAdicionalVigencia", SqlDbType.Int).Value = CvePSAdicionalVigencia .Add("@PrecioLibre", SqlDbType.Bit).Value = PrecioLibre + .Add("@CveMaterialPeligroso", SqlDbType.Int).Value = CveMaterialPeligroso + .Add("@CveEmbalaje", SqlDbType.Int).Value = CveEmbalaje + .Add("@PesoKg", SqlDbType.SmallMoney).Value = PesoKg + End With Try @@ -638,7 +650,8 @@ Public Class ClsProductosServicios Optional CveFraccionArancelaria As Integer = -1, Optional CveUsuarioModifico As Integer = -1, Optional CveClasificacionDetalle As Integer = -1, Optional CveTamaño As Integer = -1, Optional CveModelo As Integer = -1, Optional CveMedida As Integer = -1, Optional CveRinTamaño As Integer = -1, Optional ClaveImpuestoEmpaque As String = "", Optional ClaveImpuestoUM As String = "", Optional ClaveCategoriaToxicidad As String = "", Optional ClaveImpuestoTipoProducto As String = "", Optional Litraje As Double = -1, Optional EsOutSourcing As Boolean = False, - Optional AplicaSerie As Boolean = False, Optional AplicaLote As Boolean = False, Optional AplicaCaducidad As Boolean = False, Optional AplicaSeccion As Boolean = False, Optional TiempoCaducidad As Integer = -1, Optional CvePSAdicionalVigencia As Integer = -1, Optional PrecioLibre As Boolean = False) As Boolean + Optional AplicaSerie As Boolean = False, Optional AplicaLote As Boolean = False, Optional AplicaCaducidad As Boolean = False, Optional AplicaSeccion As Boolean = False, Optional TiempoCaducidad As Integer = -1, Optional CvePSAdicionalVigencia As Integer = -1, Optional PrecioLibre As Boolean = False, + Optional CveMaterialPeligroso As Integer = -1, Optional CveEmbalaje As Integer = -1, Optional PesoKg As Decimal = -1) As Boolean Dim Retorno As Boolean = False @@ -724,6 +737,10 @@ Public Class ClsProductosServicios .Add("@CvePSAdicionalVigencia", SqlDbType.Int).Value = CvePSAdicionalVigencia .Add("@PrecioLibre", SqlDbType.Bit).Value = PrecioLibre + .Add("@CveMaterialPeligroso", SqlDbType.Int).Value = CveMaterialPeligroso + .Add("@CveEmbalaje", SqlDbType.Int).Value = CveEmbalaje + .Add("@PesoKg", SqlDbType.SmallMoney).Value = PesoKg + End With Try diff --git a/App_Code/ClsSAT.vb b/App_Code/ClsSAT.vb index b5592d9d8..ec5a7b30e 100644 --- a/App_Code/ClsSAT.vb +++ b/App_Code/ClsSAT.vb @@ -345,6 +345,103 @@ Public Class ClsSAT #End Region +#Region " C A R T A P O R T E" + + + + Public Function GetCartaPorteMaterialPeligroso() As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Gral_SAT_CP_MaterialPeligroso") + + 'With SqlAdapter.SelectCommand.Parameters + ' .Add("@Tipo", SqlDbType.Int).Value = Tipo + ' .Add("@RFC", SqlDbType.VarChar).Value = RFC + ' .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + ' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + 'End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los registros de material peligroso", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + + End Function + + Public Function GetCartaPorteTipoPermiso() As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Gral_SAT_CP_TipoPermiso") + + 'With SqlAdapter.SelectCommand.Parameters + ' .Add("@Tipo", SqlDbType.Int).Value = Tipo + ' .Add("@RFC", SqlDbType.VarChar).Value = RFC + ' .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + ' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + 'End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los registros de material peligroso", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + + End Function + + Public Function GetCartaPorteConfigAutoTransporte() As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Gral_SAT_CP_ConfiAutoTransporte") + + 'With SqlAdapter.SelectCommand.Parameters + ' .Add("@Tipo", SqlDbType.Int).Value = Tipo + ' .Add("@RFC", SqlDbType.VarChar).Value = RFC + ' .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + ' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + 'End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los registros de material peligroso", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + + End Function + + Public Function GetCartaPorteSubTipoRemolque() As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Gral_SAT_CP_SubTipoRemolque") + + 'With SqlAdapter.SelectCommand.Parameters + ' .Add("@Tipo", SqlDbType.Int).Value = Tipo + ' .Add("@RFC", SqlDbType.VarChar).Value = RFC + ' .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + ' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + 'End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los registros de material peligroso", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + + End Function + +#End Region #Region "IDisposable Support" ' IDisposable diff --git a/App_Code/Timbrado.vb b/App_Code/Timbrado.vb index aa405c7f4..625017e87 100644 --- a/App_Code/Timbrado.vb +++ b/App_Code/Timbrado.vb @@ -1320,7 +1320,7 @@ Public Class Timbrado sw.Start() ' cfdi.saltarValidacion("bNtMuvZockPVhEjaPj0E") - ' cfdi.Decimales = 4 + cfdi.Decimales = 4 #Region "Certificado" cfdi.agregarCertificado(ArchivoCertificado) #End Region @@ -1906,7 +1906,7 @@ Public Class Timbrado sw.Start() ' cfdi.saltarValidacion("bNtMuvZockPVhEjaPj0E") - ' cfdi.Decimales = 4 + 'cfdi.Decimales = 4 #Region "Certificado" cfdi.CertificadoArchivo(ArchivoCertificado) #End Region diff --git a/Ashx/SIGWeb.ashx b/Ashx/SIGWeb.ashx index 8875454bd..57248f917 100644 --- a/Ashx/SIGWeb.ashx +++ b/Ashx/SIGWeb.ashx @@ -87,6 +87,10 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState GETPSUSADOS(context) Case "getumsat" GETUMSAT(context) + Case "getsatmatpeligroso" + GETSATMaterialPeligroso(context) + Case "getsatembalajes" + GETSATEmbalajes(context) Case "getcliente" GetClientes(context) Case "getproveedores" @@ -1054,6 +1058,84 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState End Function #End Region +#Region " GET SAT CARTA PORTE " + Private Function GETSATMaterialPeligroso(ByVal context As HttpContext) As String + Dim retorno As String = "" + + + If context.Application("GlobalDTMaterialPeligroso") Is Nothing Then + Dim ObjGrales As New ClsGenerales + If ObjGrales.GetMaterialPeligroso Then context.Application("GlobalDTMaterialPeligroso") = ObjGrales.DtResultados Else context.Application("GlobalDTMaterialPeligroso") = Nothing + ObjGrales.Dispose() + End If + + Dim DTUM = DirectCast(context.Application("GlobalDTMaterialPeligroso"), DataTable).AsEnumerable + Dim DtPSRetorno As DataTable + + Dim Name = IfNull(context.Request("Name"), "-1").ToString + + If Name <> "-1" Then + DTUM = DTUM.Where((Function(a) a!ClaveMaterialPeligrosoDescripcion.ToString.ToLower Like ("*" + Name.ToLower + "*"))) + End If + + If DTUM.Count > 0 Then + DtPSRetorno = New DataView(DTUM.OrderBy(Function(a) a!ClaveMaterialPeligrosoDescripcion).CopyToDataTable).ToTable(True, {"CveMaterialPeligroso", "ClaveMaterialPeligrosoDescripcion"}) + Else + DtPSRetorno = Nothing + End If + + If DtPSRetorno IsNot Nothing AndAlso DtPSRetorno.Rows.Count > 0 Then + DtPSRetorno.Columns("CveMaterialPeligroso").ColumnName = "id" + DtPSRetorno.Columns("ClaveMaterialPeligrosoDescripcion").ColumnName = "text" + retorno = JsonConvert.SerializeObject(DtPSRetorno).ToString + context.Response.Write(retorno) + DtPSRetorno.Dispose() + Else + context.Response.Write("[]") + End If + Return retorno + End Function + + Private Function GETSATEmbalajes(ByVal context As HttpContext) As String + Dim retorno As String = "" + + + If context.Application("GlobalDTEmbalajes") Is Nothing Then + Dim ObjGrales As New ClsGenerales + If ObjGrales.GetEmbalajes Then context.Application("GlobalDTEmbalajes") = ObjGrales.DtResultados Else context.Application("GlobalDTEmbalajes") = Nothing + ObjGrales.Dispose() + End If + + Dim DTUM = DirectCast(context.Application("GlobalDTEmbalajes"), DataTable).AsEnumerable + Dim DtPSRetorno As DataTable + + Dim Name = IfNull(context.Request("Name"), "-1").ToString + + If Name <> "-1" Then + DTUM = DTUM.Where((Function(a) a!ClaveEmbalajeDescripcion.ToString.ToLower Like ("*" + Name.ToLower + "*"))) + End If + + If DTUM.Count > 0 Then + DtPSRetorno = New DataView(DTUM.OrderBy(Function(a) a!ClaveEmbalajeDescripcion).CopyToDataTable).ToTable(True, {"CveEmbalaje", "ClaveEmbalajeDescripcion"}) + Else + DtPSRetorno = Nothing + End If + + If DtPSRetorno IsNot Nothing AndAlso DtPSRetorno.Rows.Count > 0 Then + DtPSRetorno.Columns("CveEmbalaje").ColumnName = "id" + DtPSRetorno.Columns("ClaveEmbalajeDescripcion").ColumnName = "text" + retorno = JsonConvert.SerializeObject(DtPSRetorno).ToString + context.Response.Write(retorno) + DtPSRetorno.Dispose() + Else + context.Response.Write("[]") + End If + Return retorno + End Function + + +#End Region + #Region " GET FRACCION ARANCELARIA " Private Function GetFraccionArancelaria(ByVal context As HttpContext) As String Dim retorno As String = "" diff --git a/Bin/Profact.TimbraCFDI.dll b/Bin/Profact.TimbraCFDI.dll index 9d83b3e6b..5acf6f2f6 100644 Binary files a/Bin/Profact.TimbraCFDI.dll and b/Bin/Profact.TimbraCFDI.dll differ diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx index 19f9b146a..ec9888e62 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -4835,7 +4835,7 @@
- + diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index da0dd286a..5a0045c9c 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -6741,13 +6741,6 @@ Partial Class Compras_Compras End If Next - 'Dim Valor = (From dr1 In GlobalDTAcumTamaños().FiltraParametros("CveEmpresa = 140").AsEnumerable() - ' Join dr2 In TmpDT.AsEnumerable On dr1.Field(Of Integer)("CvePSCargo") Equals dr2.Field(Of Integer)("CvePS") - ' Select New With - ' { - ' .Total = dr2.Field(Of Double)("Total") - ' }).Sum(Function(item) item.Total) - importeMovimiento += Valor importeMN = importeMovimiento * tipoCambioActual * Multiplicador End If @@ -6771,6 +6764,7 @@ Partial Class Compras_Compras If importeMovimiento > 0 Or TxtTotal.Text.ToDecimal = 0 Then RegistroCuentaPuente = True + Dim ImporteTransito As Decimal = 0 'Conta ContPAQ If IdCtaContable = 0 Then CuentasContablesInvalidas.Append("
" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", 68))("ConceptoContable").ToString) @@ -6783,10 +6777,58 @@ Partial Class Compras_Compras IdCtaContable = 0 End If - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContabilizacionNC, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=tipoCambioActual, CveMovimientoAlmacen:=CveMovimientoDevolucion, Contabilizable:=SeContabiliza) Then - ErrorPrepoliza = True + 'se lleva saldo de Mercancía en tránsito + + If ChkNCInvNC.Checked Then + For Each Gvr As GridViewRow In GVNCInv.Rows + If Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble > 0 Then + If Not ObjCompras.ComprasDetalleDevolucionesAdd(Gvr.DataKey("CveCompraDetalle").ToEntero, CveCompra, Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble, UsuarioActual.CveEmpresa) Then + ErrorMovInv = True + Exit For + End If + + End If + Next + + For Each Gvr As GridViewRow In GVNCInvAlmacen.Rows + If Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble > 0 Then + Dim importeMNTemp As Decimal = 0 + If Not ObjCompras.ComprasDetalleDevolucionesAdd(Gvr.DataKey("CveCompraDetalle").ToEntero, CveCompra, Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble, UsuarioActual.CveEmpresa) Then + ErrorMovInv = True + Exit For + End If + importeMNTemp = (Gvr.DataKey("PU").ToDecimal * Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDecimal * Gvr.DataKey("TipoCambio").ToDecimal).RoundSQL + ImporteTransito += importeMNTemp + 'se registra por cada compra relacionada + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMNTemp, Referencia, ConceptoContabilizacionNC, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveCompraAmortizacion:=Gvr.DataKey("CveCompra").ToEntero, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMNTemp, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=Gvr.DataKey("TipoCambio").ToDecimal, CveMovimientoAlmacen:=CveMovimientoDevolucion, Contabilizable:=SeContabiliza) Then + ErrorPrepoliza = True + End If + End If + Next + + 'si hay diferencia + + Dim diferenciaTransito As Decimal = ImporteTransito - importeMN.RoundSQL + + If diferenciaTransito <> 0 Then + Dim tCveCon As Integer = 65 + If diferenciaTransito < 0 Then + tCveCon = 64 + End If + diferenciaTransito = diferenciaTransito.Abs + IdCtaContable = 0 + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, If(tCveCon = 64, True, False), diferenciaTransito, Referencia, tCveCon, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=diferenciaTransito, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=1, CveMovimientoAlmacen:=CveMovimientoDevolucion, Contabilizable:=SeContabiliza) Then + ErrorPrepoliza = True + End If + End If + + Else + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContabilizacionNC, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=tipoCambioActual, CveMovimientoAlmacen:=CveMovimientoDevolucion, Contabilizable:=SeContabiliza) Then + ErrorPrepoliza = True + End If End If + End If @@ -6931,7 +6973,7 @@ Partial Class Compras_Compras tidctacon = ViewState("CtaProveedorAnticiposExtranjera").ToString.ToEntero End If - ElseIf DdlTipoComprobante.SelectedValue = "NC" Then + ElseIf DdlTipoComprobante.SelectedValue = "NC" AndAlso UsuarioActual.Empresa.Funcionalidad(405).ToEntero > 0 Then tcvecon = 259 tidctacon = UsuarioActual.Empresa.Funcionalidad(405).ToEntero @@ -7151,7 +7193,7 @@ Partial Class Compras_Compras End If ' FLUCTUACION CAMBIARIA - If tipoCambioActual <> TipoCambioFactura Then + If tipoCambioActual <> TipoCambioFactura AndAlso Not ChkNCInvNC.Checked Then ' que no se esté afectando mercancía en tránsto importeMovimiento = (importeMovimientoNC * TipoCambioFactura) - (importeMovimientoNC * tipoCambioActual) If importeMovimiento > 0 Then @@ -10167,7 +10209,7 @@ Partial Class Compras_Compras If Not ObjCompra.UpdateCompraDetalle(Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("PU").ToString.ToDouble, Row("IVA").ToString.ToDouble, Row("Total").ToString.ToDouble, Row("Descuento").ToString.ToDouble, Row("Obs").ToString, Row("CveSubProyecto").ToString.ToEntero, Row("CvePresupuestoEgreso").ToString.ToEntero, CveAF, Row("CveCompraDetalle").ToString.ToEntero, CvePersonal:=CvePersonal, CveTipoGasto:=Row("CveTipoGasto").ToString.ToEntero, AF_Medida:=Row("AFMedida").ToString.ToEntero, AF_TipoMantenimiento:=Row("AFTipoMantenimiento").ToString.ToEntero, Referencia:=Referencia, RetIVA:=Row("RetIVA").ToString.ToDouble, RetISR:=Row("RetISR").ToString.ToDouble, IEPSPS:=Row("IEPSPS").ToString.ToDouble, IEPSPSIVA:=Row("IEPSPSIVA").ToString.ToDouble, - IVAPorcentaje:=Row("IVAPorcentaje").ToString.ToDouble, RetIVAPorcentaje:=Row("RetIVAPorcentaje").ToString.ToDouble, RetISRPorcentaje:=Row("RetISRPorcentaje").ToString.ToDouble, IEPSPSPorcentaje:=Row("IEPSPSPorcentaje").ToString.ToDouble, IEPSPSIVAPorcentaje:=Row("IEPSPSIVAPorcentaje").ToString.ToDouble, NoDeducible:=If((Row("NoDeducible").ToString().ToUpper().Contiene("TRUE", "1")) AndAlso EsNoDeducible, True, False)) Then + IVAPorcentaje:=Row("IVAPorcentaje").ToString.ToDouble, RetIVAPorcentaje:=Row("RetIVAPorcentaje").ToString.ToDouble, RetISRPorcentaje:=Row("RetISRPorcentaje").ToString.ToDouble, IEPSPSPorcentaje:=Row("IEPSPSPorcentaje").ToString.ToDouble, IEPSPSIVAPorcentaje:=Row("IEPSPSIVAPorcentaje").ToString.ToDouble, NoDeducible:=If((Row("NoDeducible").ToString().ToUpper().Contiene("TRUE", "1")) AndAlso EsNoDeducible, True, False), CveContratoDetalle:=Row("CveContratoDetalle").ToString.ToEntero) Then Retorno = False Exit For @@ -10216,9 +10258,10 @@ Partial Class Compras_Compras Next For Each item As String In ClavesBorradas - Dim ObjCompras As New ClsCompras - If Not ObjCompras.DeleteCompraDetalle(item.ToEntero) Then - Retorno = False + If item.ToEntero > 0 Then + If Not ObjCompra.DeleteCompraDetalle(item.ToEntero) Then + Retorno = False + End If End If Next @@ -20107,14 +20150,6 @@ Partial Class Compras_Compras Dim IDPoliza As Integer = 0 - 'EMPIEZA OBJETOS Y TRANSACCIONES - 'Dim OC As New ClsOC - 'Dim OCBitacora As New ClsOIEventos(OC.IniciaTransacSQL()) - 'Dim ObjInventarios As New ClsInventarios(OC.IniciaTransacSQL()) - 'Dim ObjConta As New ClsContabilidad(OC.IniciaTransacSQL()) - - - Dim DtInvOC As New DataTable Dim DtInvOCDiferencias As New DataTable 'Actualizado con diferencia DtInvOCDiferencias.Columns.Add("CveOrdenCompra", GetType(Integer)) @@ -20142,7 +20177,7 @@ Partial Class Compras_Compras Dim diferencia As Decimal = (dr2("PU").ToString.ToDecimal - gvr.FCTextBox("TxtPU").Text.ToDecimal) * gvr.FCTextBox("TxtCantidad").Text.ToDecimal Dim DrInvOCDiferencias As DataRow - If diferencia <> 0 Then 'And DtInvOC.Rows.Count > 0 + If diferencia <> 0 Then DrInvOCDiferencias = DtInvOCDiferencias.NewRow DrInvOCDiferencias("CveOrdenCompra") = dr2("CveOrdenCompra").ToString.ToEntero DrInvOCDiferencias("CveOrdenCompraDetalle") = dr2("CveOrdenCompraDetalle").ToString.ToEntero @@ -20201,7 +20236,7 @@ Partial Class Compras_Compras If DtInvOCDiferencias.Rows.Count > 0 Then 'VARIABLES - Dim CveOrdenCompra = -1 + Dim CveOrdenCompra As Integer = -1 Dim DiferenciaInvOC = 0.0D Dim CveMovimientoAlmacen = -1 Dim CveOCDetalle = -1 @@ -20284,15 +20319,14 @@ Partial Class Compras_Compras If DiferenciaInvOC.RoundSQL() <> 0 Then If CveSubProyecto <= 0 Then - Alert("Debe de asignar un sub proyecto o centro de constos.", TipoMensaje.MsgAdvertencia) + Alert("Debe de asignar un sub proyecto o centro de costos.", TipoMensaje.MsgAdvertencia) Retorno = False End If - CvePrePoliza = ObjConta.AddPrePolizas("Compras/OC-(OCAlmacen)", 74, DiferenciaInvOC, DiferenciaInvOC, 1, Fecha, ConceptoPartida, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) If CvePrePoliza > 0 Then - If CveMoneda = 2 And UsuarioActual.CveEmpresa.Contiene(119) Then + If CveMoneda = 2 Then ImporteME = (DiferenciaInvOC / TCInvOC).RoundAD() ImporteMEComp = ((ImporteME * TCInvOC) - ImporteME).RoundAD() diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index 7bf565dd8..19a607751 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -376,6 +376,12 @@ Partial Class PopUpVerFactura If UrlParametros("CVEMOV") IsNot Nothing AndAlso UrlParametros("CVEMOV").ToString.ToEntero > 0 Then ImprimeFormatoCartaPorte(UrlParametros("CVEMOV").ToString.ToEntero) End If + End If + + If UrlParametros("OP").ToString = "CARPOTIMBRE" Then + If UrlParametros("CVEMOV") IsNot Nothing AndAlso UrlParametros("CVEMOV").ToString.ToEntero > 0 Then + ImprimeFormatoCartaPorteTimbrado(UrlParametros("CVEMOV").ToString.ToEntero) + End If End If @@ -747,7 +753,7 @@ Partial Class PopUpVerFactura #End Region -#Region "OP = 'CARPO' - IMPRIME FORMATO CARTA PORTE" +#Region "OP = 'CARPO' - IMPRIME FORMATO CARTA PORTE TIMBRADO" Private Sub ImprimeFormatoCartaPorte(CveMovimiento As Integer) If CveMovimiento > 0 Then Dim ObjInv As New ClsInventarios @@ -873,6 +879,345 @@ Partial Class PopUpVerFactura End If End Sub + Private Function ValorXML(n As XmlNode, Campo As String, Optional Retorno As String = "") As String + Dim o As XmlNode = n.Attributes.Cast(Of XmlAttribute)().SingleOrDefault(Function(a) String.Compare(a.Name, Campo, True) = 0) + If o Is Nothing Then + Return Retorno + Else + Return o.Value + End If + End Function + + Private Sub ImprimeFormatoCartaPorteTimbrado(CveMovimiento As Integer) + If CveMovimiento > 0 Then + + '01 Autotransporte Federal + '02 Transporte Marítimo + '03 Transporte Aéreo + '04 Transporte Ferroviario + '05 Ducto + Dim HtTransporte As New Hashtable() + HtTransporte.Add("01", "Autotransporte Federal") + HtTransporte.Add("02", "Transporte Marítimo") + HtTransporte.Add("03", "Transporte Aéreo") + HtTransporte.Add("04", "Transporte Ferroviario") + HtTransporte.Add("05", "Ducto") + + 'EMISOR + Dim LugarExpedicion As String = "" + Dim ImgCBB As String = "" + 'COMPROBANTE + Dim SerieFolio As String = "" + Dim Telefono As String = "" + Dim SubTotal As Decimal = 0 + Dim Descuentos As Decimal = 0 + Dim Total As Decimal = 0 + 'DATOS DEL CLIENTE + Dim ClienteRFC As String = "" + Dim ClienteNombre As String = "" + Dim ClienteUsoCFDi As String = "" + + 'TRANSPORTE + Dim MedioTransporte As String = "" + Dim TransporteInternacional As String = "" + Dim PermisoSTCC As String = "" + Dim NumPermiso As String = "" + Dim Aseguradora As String = "" + Dim NumPolizaSeguro As String = "" + Dim PlacaVM As String = "" + Dim AnioModeloVM As String = "" + 'TIMBRADO + Dim FolioFiscal As String = "" + Dim NoCertificadoSAT As String = "" + Dim CadenaOriginal As String = "" + Dim NoSerieCertificado As String = "" + Dim FechaCertificacion As DateTime = Nothing + Dim SelloCFDi As String = "" + Dim SelloSAT As String = "" + + Dim ObjInv As New ClsInventarios + If ObjInv.GetMovimientos(CveMovimiento, -1, -1, UsuarioActual.CveEmpresa) Then + If ObjInv.DtResultados.Rows.Count > 0 Then + Dim Dr As DataRow = ObjInv.DtResultados.Rows(0) + If Dr IsNot Nothing Then + SerieFolio = Dr("Folio").ToString + Telefono = Dr("Telefono1").ToString + End If + End If + End If + ObjInv.Dispose() + + Dim DtConceptos As New DataTable() + DtConceptos.Columns.Add(New DataColumn("Cantidad", GetType(Decimal))) + DtConceptos.Columns.Add(New DataColumn("Unidad", GetType(String))) + DtConceptos.Columns.Add(New DataColumn("Descripcion", GetType(String))) + DtConceptos.Columns.Add(New DataColumn("ValorUnitario", GetType(Decimal))) + DtConceptos.Columns.Add(New DataColumn("Importe", GetType(Decimal))) + + Dim DtUbicaciones As New DataTable() + DtUbicaciones.Columns.Add(New DataColumn("Distancia", GetType(String))) + DtUbicaciones.Columns.Add(New DataColumn("RFC", GetType(String))) + DtUbicaciones.Columns.Add(New DataColumn("Nombre", GetType(String))) + DtUbicaciones.Columns.Add(New DataColumn("FechaHoraSalida", GetType(DateTime))) + DtUbicaciones.Columns.Add(New DataColumn("Direccion", GetType(String))) + + Dim DtMercancias As New DataTable() + DtMercancias.Columns.Add(New DataColumn("Cantidad", GetType(Decimal))) + DtMercancias.Columns.Add(New DataColumn("UnidadMedida", GetType(String))) + DtMercancias.Columns.Add(New DataColumn("Descripcion", GetType(String))) + DtMercancias.Columns.Add(New DataColumn("PesoEnKg", GetType(String))) + + Dim DtOperadores As New DataTable() + DtOperadores.Columns.Add(New DataColumn("RFC", GetType(String))) + DtOperadores.Columns.Add(New DataColumn("NumLicencia", GetType(String))) + DtOperadores.Columns.Add(New DataColumn("NombreOperador", GetType(String))) + + Dim XMLDoc As New XmlDocument + Dim Path As String = String.Format("{0}\{1}\{2}\{3}.{4}", UsuarioActual.Empresa.Ruta, "XML", "Tra", String.Format("Tra-{0}", SerieFolio), "xml") + Dim Archivo As New System.IO.FileInfo(Path) + + If Archivo.Exists Then + Try + XMLDoc.Load(Path) + Catch ex As Exception + Try + Dim oReader = New StreamReader(Path, Encoding.GetEncoding("ISO-8859-1")) + XMLDoc.Load(oReader) + oReader.Dispose() + Catch ex2 As Exception + GuardaLog("Error al intentar leer el XML del SAT. Error:" & ex2.ToString()) + End Try + End Try + End If + + If XMLDoc IsNot Nothing AndAlso Archivo.Exists Then + + Dim RutaCBB As String = String.Format("{0}\CBB\Tra-{1}.jpg", UsuarioActual.Empresa.Ruta, SerieFolio) + Dim ImagenCBB As New System.IO.FileInfo(RutaCBB) + + Dim nodo As XmlNode = XMLDoc.DocumentElement + + Dim Prefijo As String = If(XMLDoc.DocumentElement.Prefix = "", "cfd", XMLDoc.DocumentElement.Prefix) + Dim cfdVer As String = "http://www.sat.gob.mx/cfd/3" + Dim namespaces As New XmlNamespaceManager(XMLDoc.NameTable) + + If Prefijo.ToLower <> "cfdi" Then cfdVer = "http://www.sat.gob.mx/cfd/2" + namespaces.AddNamespace(Prefijo, cfdVer) + 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") + namespaces.AddNamespace("cartaporte", "http://www.sat.gob.mx/CartaPorte") + + Dim nodeComprobante As XmlNode = XMLDoc.SelectSingleNode(String.Format("//{0}:Comprobante", Prefijo), namespaces) + If nodeComprobante IsNot Nothing Then + LugarExpedicion = ValorXML(nodeComprobante, "LugarExpedicion") + SubTotal = ValorXML(nodeComprobante, "SubTotal").ToDecimal() + Total = ValorXML(nodeComprobante, "Total").ToDecimal() + End If + + Dim nodeCliente As XmlNode = XMLDoc.SelectSingleNode(String.Format("//{0}:Receptor", Prefijo), namespaces) + + If nodeCliente IsNot Nothing Then + ClienteRFC = ValorXML(nodeCliente, "RFC") + ClienteNombre = ValorXML(nodeCliente, "Nombre") + Dim UsoCFDI = ValorXML(nodeCliente, "UsoCFDI") + ClienteUsoCFDi = String.Format("{0} - {1}", UsoCFDI, GlobalDTSATUsosCFDI().FiltroPrimeroValor("Descripcion", String.Format("UsoCFDI = '{0}'", UsoCFDI))) + End If + + Dim nodeConceptos As XmlNode = XMLDoc.SelectSingleNode(String.Format("//{0}:Conceptos", Prefijo), namespaces) + + If nodeConceptos IsNot Nothing Then + For Each node As XmlNode In nodeConceptos.ChildNodes + Dim Row As DataRow = DtConceptos.NewRow + + Row("Cantidad") = ValorXML(node, "Cantidad", "") + Row("Unidad") = ValorXML(node, "Unidad", "") + Row("Descripcion") = ValorXML(node, "Descripcion", "") + Row("ValorUnitario") = ValorXML(node, "ValorUnitario", "") + Row("Importe") = ValorXML(node, "Importe", "") + + DtConceptos.Rows.Add(Row) + Next + End If + + + Dim nodeComp As XmlNode = XMLDoc.SelectSingleNode(String.Format("//{0}:Complemento", Prefijo), namespaces) + + Dim nodeCartaPorte As XmlNode = nodeComp.SelectSingleNode(String.Format("//{0}:CartaPorte", "cartaporte"), namespaces) + If nodeCartaPorte IsNot Nothing Then + TransporteInternacional = ValorXML(nodeCartaPorte, "TranspInternac", "") + End If + + Dim nodeAutotransporteFederal As XmlNode = nodeComp.SelectSingleNode(String.Format("//{0}:AutotransporteFederal", "cartaporte"), namespaces) + If nodeAutotransporteFederal IsNot Nothing Then + PermisoSTCC = ValorXML(nodeAutotransporteFederal, "PermSCT", "") + NumPermiso = ValorXML(nodeAutotransporteFederal, "NumPermisoSCT", "") + Aseguradora = ValorXML(nodeAutotransporteFederal, "NombreAseg", "") + NumPolizaSeguro = ValorXML(nodeAutotransporteFederal, "NumPolizaSeguro", "") + End If + + Dim nodeIdentificacionVehicular As XmlNode = nodeComp.SelectSingleNode(String.Format("//{0}:IdentificacionVehicular", "cartaporte"), namespaces) + If nodeIdentificacionVehicular IsNot Nothing Then + PlacaVM = ValorXML(nodeIdentificacionVehicular, "PlacaVM", "") + AnioModeloVM = ValorXML(nodeIdentificacionVehicular, "AnioModeloVM", "") + End If + + Dim nodeFiguraTransporte As XmlNode = nodeComp.SelectSingleNode(String.Format("//{0}:FiguraTransporte", "cartaporte"), namespaces) + If nodeFiguraTransporte IsNot Nothing Then + Dim CveTransporte As String = ValorXML(nodeFiguraTransporte, "CveTransporte", "") + MedioTransporte = String.Format("{0} - {1}", CveTransporte, HtTransporte(CveTransporte).ToString()) + End If + + Dim nodeMercancias As XmlNodeList = nodeComp.SelectNodes(String.Format("//{0}:Mercancia", "cartaporte"), namespaces) + For Each node As XmlNode In nodeMercancias + Dim Row As DataRow = DtMercancias.NewRow + + Row("Cantidad") = ValorXML(node, "Cantidad", "") + Row("UnidadMedida") = ValorXML(node, "Unidad", "") + Row("Descripcion") = ValorXML(node, "Descripcion", "") + Row("PesoEnKg") = ValorXML(node, "PesoEnKg", "") + + DtMercancias.Rows.Add(Row) + Next + + Dim nodeOperadores As XmlNodeList = nodeComp.SelectNodes(String.Format("//{0}:Operador", "cartaporte"), namespaces) + For Each node As XmlNode In nodeOperadores + Dim Row As DataRow = DtOperadores.NewRow + + Row("RFC") = ValorXML(node, "RFCOperador", "") + Row("NumLicencia") = ValorXML(node, "NumLicencia", "") + Row("NombreOperador") = ValorXML(node, "NombreOperador", "") + + DtOperadores.Rows.Add(Row) + Next + + + Dim nodeUbicaciones As XmlNodeList = nodeComp.SelectNodes(String.Format("//{0}:Ubicacion", "cartaporte"), namespaces) + For Each node As XmlNode In nodeUbicaciones + Dim Row As DataRow = DtUbicaciones.NewRow + + Row("Distancia") = ValorXML(node, "DistanciaRecorrida", "") + Dim nodeOrigen = node.ChildNodes.Cast(Of XmlNode).FirstOrDefault(Function(x) x.Name = "cartaporte:Origen") + If nodeOrigen IsNot Nothing Then + Row("RFC") = ValorXML(nodeOrigen, "RFCRemitente", "") + Row("Nombre") = ValorXML(nodeOrigen, "NombreRemitente", "") + Row("FechaHoraSalida") = ValorXML(nodeOrigen, "FechaHoraSalida", "").ToDateTime() + End If + + Dim nodeDestino = node.ChildNodes.Cast(Of XmlNode).FirstOrDefault(Function(x) x.Name = "cartaporte:Destino") 'node.SelectSingleNode(String.Format("//{0}:Destino", "cartaporte"), namespaces) + If nodeDestino IsNot Nothing Then + Row("RFC") = ValorXML(nodeDestino, "RFCDestinatario", "") + Row("Nombre") = ValorXML(nodeDestino, "NombreDestinatario", "") + Row("FechaHoraSalida") = ValorXML(nodeDestino, "FechaHoraProgLlegada", "").ToDateTime() + End If + + Dim nodeDomicilio = node.ChildNodes.Cast(Of XmlNode).FirstOrDefault(Function(x) x.Name = "cartaporte:Domicilio") 'node.SelectSingleNode(String.Format("//{0}:Domicilio", "cartaporte"), namespaces) + If nodeDomicilio IsNot Nothing Then + Dim calle = ValorXML(nodeDomicilio, "Calle", "") + Dim Estado = ValorXML(nodeDomicilio, "Estado", "") + Dim Pais = ValorXML(nodeDomicilio, "MEX", "") + Dim CP = ValorXML(nodeDomicilio, "CodigoPostal", "") + + Row("Direccion") = String.Format("{0} ,{1},{2}. CP {3}", calle, Estado, Pais, CP) + End If + + DtUbicaciones.Rows.Add(Row) + Next + + Dim nodeTFD As XmlNode = nodeComp.SelectSingleNode(String.Format("//{0}:TimbreFiscalDigital", "tfd"), namespaces) + If nodeTFD IsNot Nothing Then + FolioFiscal = ValorXML(nodeTFD, "UUID", "") + NoSerieCertificado = ValorXML(nodeTFD, "NoCertificadoSAT", "") + FechaCertificacion = ValorXML(nodeTFD, "FechaTimbrado", "").ToDateTime + SelloCFDi = ValorXML(nodeTFD, "SelloCFD", "") + SelloSAT = ValorXML(nodeTFD, "SelloSAT", "") + NoCertificadoSAT = ValorXML(nodeTFD, "NoCertificadoSAT", "") + + CadenaOriginal = "||1.0|" + FolioFiscal + "|" + FechaCertificacion.ToString("yyyy-MM-dd") + "T" + FechaCertificacion.ToString("HH:mm:ss") + "|" + SelloCFDi + "|" + NoSerieCertificado + "||" + End If + + If Not ImagenCBB.Exists Then + Dim CBB As New ClbNegBICFDv3_2.ClsNegCBBGenerar() + CBB.GenerarCBB(UsuarioActual.Empresa.RFC, ClienteRFC, Total, FolioFiscal, RutaCBB) + End If + + ImgCBB = String.Format("{0}://{1}:{2}/Empresas/{3}/CBB/Tra-{4}.jpg", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa, SerieFolio) + End If + + If DtConceptos.Rows.Count > 0 Then + Dim params As New List(Of ReportParameter) + Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) + Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + If Imagen.Exists Then + params.Add(New ReportParameter("LogoPath", logouri)) + Else + params.Add(New ReportParameter("LogoPath", "")) + End If + 'EMPRESA + params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) + params.Add(New ReportParameter("RegimenFiscal", UsuarioActual.Empresa.Regimen)) + params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) + params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString)) + params.Add(New ReportParameter("DomicilioFiscal", $"{UsuarioActual.Empresa.Direccion}, {UsuarioActual.Empresa.Colonia}, {UsuarioActual.Empresa.Localidad}, {UsuarioActual.Empresa.Estado}, Tel. {Telefono}")) + params.Add(New ReportParameter("SerieFolio", SerieFolio)) + params.Add(New ReportParameter("RFC", UsuarioActual.Empresa.RFC)) + params.Add(New ReportParameter("DomicilioExpedicion", LugarExpedicion)) + 'CLIENTE + params.Add(New ReportParameter("ClienteNombre", ClienteNombre)) + params.Add(New ReportParameter("ClienteRFC", ClienteRFC)) + params.Add(New ReportParameter("UsoCFDi", ClienteUsoCFDi)) + 'TRANSPORTE + params.Add(New ReportParameter("MedioTransporte", MedioTransporte)) + params.Add(New ReportParameter("TransporteInternacional", TransporteInternacional)) + params.Add(New ReportParameter("PermisoSTCC", PermisoSTCC)) + params.Add(New ReportParameter("NumPermiso", NumPermiso)) + params.Add(New ReportParameter("Aseguradora", Aseguradora)) + params.Add(New ReportParameter("NumPoliza", NumPolizaSeguro)) + params.Add(New ReportParameter("PlacaVM", PlacaVM)) + params.Add(New ReportParameter("AnioVM", AnioModeloVM)) + 'TIMBRADO + params.Add(New ReportParameter("FolioFiscal", FolioFiscal)) + params.Add(New ReportParameter("QR", ImgCBB)) + params.Add(New ReportParameter("SelloCFDI", SelloCFDi)) + params.Add(New ReportParameter("CertificadoContribuyente", NoCertificadoSAT)) + params.Add(New ReportParameter("CadenaOriginal", CadenaOriginal)) + params.Add(New ReportParameter("SerieCertificadoSAT", NoSerieCertificado)) + params.Add(New ReportParameter("FechaCertificacion", FechaCertificacion.ToString("dd/MM/yyyy HH:mm:ss"))) + params.Add(New ReportParameter("SelloSAT", SelloSAT)) + 'TOTALES + params.Add(New ReportParameter("SubTotal", SubTotal.ToString())) + params.Add(New ReportParameter("Descuentos", Descuentos.ToString())) + params.Add(New ReportParameter("Total", Total.ToString())) + ' [@CertificadoContribuyente] + '[@CadenaOriginal] + + Dim lrds As New List(Of ReportDataSource) + + Dim rds As New ReportDataSource + rds.Name = "DataSet1" + rds.Value = DtConceptos + lrds.Add(rds) + + Dim rds2 As New ReportDataSource + rds2.Name = "DataSet2" + rds2.Value = DtUbicaciones + lrds.Add(rds2) + + Dim rds3 As New ReportDataSource + rds3.Name = "DataSet3" + rds3.Value = DtMercancias + lrds.Add(rds3) + + Dim rds4 As New ReportDataSource + rds4.Name = "DataSet4" + rds4.Value = DtOperadores + lrds.Add(rds4) + + ImprimirPDF("Empresas/Grales/Formatos/CartaPorteTimbrado.rdlc", lrds, params, String.Format("Carta Porte -{0}", Now.ToDateTime.ToShortDateString)) + End If + End If + End Sub + #End Region #Region "OP = 'DesXmlTra' - IMPRIME XML TRASLADO" diff --git a/Contabilidad/RegPrePolizaS.aspx.vb b/Contabilidad/RegPrePolizaS.aspx.vb index 277f6358a..bb2f95516 100644 --- a/Contabilidad/RegPrePolizaS.aspx.vb +++ b/Contabilidad/RegPrePolizaS.aspx.vb @@ -223,7 +223,7 @@ Partial Class ContabilidadC_RegPrePolizaS Beneficiario = "-1" Actualizar = False IdPoliza = -1 - + CargaCtaContableE() If IfNull(Request("Tipo"), "").ToString = "NOMPROV" Then DivTipoGasto.Visible = True @@ -452,6 +452,11 @@ Partial Class ContabilidadC_RegPrePolizaS LnkComplementoPago.Visible = True End If + + If UsuarioActual.CveEmpresa = 119 Then + BtnContabilizar.Visible = True + End If + If UsuarioActual.Empresa.TipoContabilizacion = 1 Then If dr("FolioPoliza").ToString.ToEntero > 0 Then divContabilizada.Visible = True @@ -636,8 +641,20 @@ Partial Class ContabilidadC_RegPrePolizaS DdlCuentaContable.Items.Insert(0, New ListItem("Seleccione", "0")) DdlCuentaContableE.DataBind() DdlCuentaContableE.Items.Insert(0, New ListItem("Sin Asignar", "0")) - End Sub - + End Sub + + Private Function CargaCuentasContpaq(CveCuenta As Integer) As Integer + Dim Retorno As Integer = -1 + If CveCuenta > 0 Then + Dim ObjConta As New ClsContabilidad + If ObjConta.GetCuentas(CveCuenta, "-1", 1, UsuarioActual.CveEmpresa) Then + Retorno = ObjConta.DtResultados.Rows(0)("IdCompaq").ToString.ToEntero + End If + ObjConta.Dispose() + End If + Return Retorno + + End Function Private Sub CargaTiposGasto() DdlTipoGasto.DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa) DdlTipoGasto.DataBind() @@ -651,7 +668,7 @@ Partial Class ContabilidadC_RegPrePolizaS End Sub Private Sub CargaCompras(CveProveedor As Integer) - If Not DdlConceptosContables.SelectedValue.ToEntero.Contiene(21) Then + If DdlConceptosContables.SelectedValue.ToEntero.Contiene(5, 17, 305, 308, 310, 311, 312) Then Dim ObjCompras As New ClsCompras DdlCompras.ClearSelection() @@ -1039,17 +1056,22 @@ Partial Class ContabilidadC_RegPrePolizaS End If End Sub - Private Sub ActualizarPrePoliza() - + Private Sub ActualizarPrePoliza() + Dim contador As Integer = 0 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) + ObjContabilidad.UpdatePrePoliza(MinFecha, -1, DdlTipoPoliza.SelectedValue.ToEntero, -1, CvePrePoliza, UsuarioActual.CveEmpresa, Concepto:=TxtConcepto.Text, FechaPoliza:=TxtFechaDocumento.Text.ToDate, CveUsuarioModifico:=UsuarioActual.CveUsuario) + + If Not ObjContabilidad.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False) Then + OcurrioError = True + End If For Each row As GridViewRow In GvPrePoliza.Rows If row.DataKey("CvePrePolizaDetalle").ToEntero > 0 Then If row.FCCheckBox("chkModificado").Checked Then + contador = contador + 1 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), @@ -1061,6 +1083,7 @@ Partial Class ContabilidadC_RegPrePolizaS End If End If Else + contador = contador + 1 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, @@ -1087,6 +1110,13 @@ Partial Class ContabilidadC_RegPrePolizaS ObjContabilidad.Dispose() CargaPrePoliza() + + If Not OcurrioError Then + If IdPoliza > 0 AndAlso contador Then + BtnContabilizar_Click(Nothing, Nothing) + End If + + End If End Sub Protected Sub LnkAddConcepto_Click(sender As Object, e As EventArgs) RegistraScript(String.Format("$('#{0}').modal();", "DivEditConcepto")) @@ -1096,10 +1126,8 @@ Partial Class ContabilidadC_RegPrePolizaS CargaConceptosContablesE() CargaSubProyectoE() - CargaTipoGastoE() - CargaCtaContableE() - - + CargaTipoGastoE() + UpdatePanel1.Update() End Sub Protected Sub GvPrePoliza_RowUpdating(sender As Object, e As GridViewUpdateEventArgs) Handles GvPrePoliza.RowUpdating @@ -1135,9 +1163,12 @@ Partial Class ContabilidadC_RegPrePolizaS DdlPersonalE.SelectedValueExist(CvePersonal) - DdlClientesE.SelectedValue = CveCliente - DdlClientesE.SelectedText = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("NombreComercial", $"CveCliente={CveCliente}") - DdlClientesE_SelectedIndexChanged(DdlClientesE, e) + If CveCliente > 0 Then + DdlClientesE.SelectedValue = CveCliente + DdlClientesE.SelectedText = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("NombreComercial", $"CveCliente={CveCliente}") + DdlClientesE_SelectedIndexChanged(DdlClientesE, e) + + End If DdlVentasE.SelectedValueExist(CveVenta) TxtConceptoE.Text = Concepto @@ -1146,8 +1177,8 @@ Partial Class ContabilidadC_RegPrePolizaS CargaSubProyectoE() DdlSubProyectoE.SelectedValueExist(CveSubProyecto) CargaTipoGastoE() - DdlTipoGastoE.SelectedValueExist(CveTipoGasto) - CargaCtaContableE() + DdlTipoGastoE.SelectedValueExist(CveTipoGasto) + DdlCuentaContableE.SelectedValueExist(CveCuenta) If Cargo <> 0 Then @@ -1234,7 +1265,7 @@ Partial Class ContabilidadC_RegPrePolizaS DdlProveedoresE.Items.Insert(0, New ListItem(" - ", "-1")) End Sub Private Sub CargaComprasE(CveProveedor As Integer) - If Not DdlConceptosContablesE.SelectedValue.ToEntero.Contiene(21) Then + If DdlConceptosContables.SelectedValue.ToEntero.Contiene(5, 17, 305, 308, 310, 311, 312) Then Dim ObjCompras As New ClsCompras DdlComprasE.ClearSelection() @@ -1293,9 +1324,10 @@ Partial Class ContabilidadC_RegPrePolizaS If IndiceGrid = -1 Then If DtMovimientos Is Nothing Then CreaDT() - If CvePrePoliza > 0 Then + If CvePrePoliza > 0 Then + Dim IdCtaContable As Integer = CargaCuentasContpaq(DdlCuentaContableE.SelectedValue.ToEntero) Dim dr As DataRow = DtMovimientos.NewRow - dr("IdCtaContable") = DdlCuentaContableE.SelectedValue + dr("IdCtaContable") = IdCtaContable dr("CveCuenta") = DdlCuentaContableE.SelectedValue dr("ConceptoContable") = DdlConceptosContablesE.SelectedItem.Text dr("CveConceptoContable") = DdlConceptosContablesE.SelectedValue @@ -1385,8 +1417,9 @@ Partial Class ContabilidadC_RegPrePolizaS Dim Rows As DataRow() = DtMovimientos.Select("CvePrePolizaDetalle = " & CvePrePolizaDetalle) If Rows.Count > 0 Then - Dim dr As DataRow = Rows(0) - dr("IdCtaContable") = DdlCuentaContableE.SelectedValue + Dim dr As DataRow = Rows(0) + Dim IdCtaContable As Integer = CargaCuentasContpaq(DdlCuentaContableE.SelectedValue.ToEntero) + dr("IdCtaContable") = IdCtaContable dr("CveCuenta") = DdlCuentaContableE.SelectedValue dr("CodigoNombreCuenta") = DdlCuentaContableE.SelectedItem.Text dr("ConceptoContable") = DdlConceptosContablesE.SelectedItem.Text @@ -1442,12 +1475,13 @@ Partial Class ContabilidadC_RegPrePolizaS UpTotalCargo.Update() UpTotalAbono.Update() - End If + End If + RegistraScript("$('#DivEditConcepto').modal('hide')", "hidemodal") End If - UpPrePoliza.Update() - RegistraScript("$('#DivEditConcepto').modal('hide')", "hidemodal") + UpPrePoliza.Update() + End Sub Protected Sub GvMov_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GvMov.RowDeleting @@ -1831,25 +1865,10 @@ Partial Class ContabilidadC_RegPrePolizaS 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) @@ -2247,7 +2266,29 @@ Partial Class ContabilidadC_RegPrePolizaS End Function #End Region + Private Sub BtnContabilizar_Click(sender As Object, e As EventArgs) Handles BtnContabilizar.Click + Contabilizar() + + 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), Concepto:=TxtConcepto.Text, Fecha:=TxtFechaDocumento.Text.ToDateTime()) 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 "Paquete Egresos" diff --git a/Contabilidad2/CatCuentasAsignaciones.aspx b/Contabilidad2/CatCuentasAsignaciones.aspx index ea32e31b3..cd4a6e804 100644 --- a/Contabilidad2/CatCuentasAsignaciones.aspx +++ b/Contabilidad2/CatCuentasAsignaciones.aspx @@ -69,7 +69,7 @@ @@ -130,7 +130,7 @@
- +
@@ -148,7 +148,7 @@

- +
@@ -181,6 +181,10 @@
+
+ + +
diff --git a/Contabilidad2/CatCuentasAsignaciones.aspx.vb b/Contabilidad2/CatCuentasAsignaciones.aspx.vb index 526852767..cc089bec4 100644 --- a/Contabilidad2/CatCuentasAsignaciones.aspx.vb +++ b/Contabilidad2/CatCuentasAsignaciones.aspx.vb @@ -79,6 +79,8 @@ Partial Class Contabilidad2_CatCuentasAsignaciones DdlActivoFijo.DataSource = GlobalDTActivoFijos(UsuarioActual.CveEmpresa) + DdlSubProyectos.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) + Dim ObjBancos As New ClsBancos If ObjBancos.GetBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa) Then DdlCuentaBancaria.DataSource = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) @@ -94,6 +96,7 @@ Partial Class Contabilidad2_CatCuentasAsignaciones 'DdlPersonal.DataBind() DdlClasificacion.DataBind() DdlAlmacen.DataBind() + DdlSubProyectos.DataBind() DdlCuentaBancaria.Items.Insert(0, New ListItem("Seleccione", "-1")) DdlConceptoNomina.Items.Insert(0, New ListItem("Seleccione", "-1")) @@ -112,6 +115,10 @@ Partial Class Contabilidad2_CatCuentasAsignaciones HdnCveCuentaAsignacion.Value = GvRow.DataKey("CveCuentaAsignacion").ToString If Dr IsNot Nothing Then + DdlCconceptosContables.Enabled = False + DdlSubProyectos.Enabled = False + DdlClasificacion.Enabled = False + DdlPersonal.Enabled = False CveConceptoAsignacion = GvRow.DataKey("CveCuentaAsignacion").ToEntero DdlCconceptosContables.SelectedValueExist(GvRow.DataKey("CveConceptoContable")) DdlCuenta.SelectedValueExist(GvRow.DataKey("CveCuenta")) @@ -126,33 +133,37 @@ Partial Class Contabilidad2_CatCuentasAsignaciones Dim CveCliente As Integer = GvRow.DataKey("CveCliente").ToEntero Dim CvePersonal As Integer = GvRow.DataKey("CvePersonal").ToEntero + RecargaConcepto(CveConceptoContable) + + DdlClientes.ddl.SelectedValueExist(CveCliente) + DdlPersonal.ddl.SelectedValueExist(CvePersonal) + + LbAgregar.Text = "Actualizar" + UpModalModulos.Update() + RegistraScript("$('#ModalCat').modal();") + End If + + + End Sub + + Private Sub RecargaConcepto(CveConceptoContable As Integer) + Dim Dr As DataRow = GlobalDTContaConceptosContables(CveConceptoContable).FiltroPrimero("") + + If Dr IsNot Nothing Then + If Dr("AplicaCliente").ToString = "True" Then divCliente.Visible = True - If CveCliente > 0 Then - DdlClientes.setEsWebService(False) - Dim ObjCliente As New ClsClientes - If ObjCliente.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then - DdlClientes.ddl.DataSource = ObjCliente.DtResultados - End If - DdlClientes.ddl.DataBind() - DdlClientes.ddl.SelectedValue = CveCliente - End If + DdlClientes.setEsWebService(True) End If + If Dr("AplicaProveedor").ToString = "True" Then divProveedor.Visible = True End If If Dr("AplicaPersonal").ToString = "True" Then divPersonal.Visible = True - If CvePersonal > 0 Then - DdlPersonal.setEsWebService(False) - Dim ObjPersonal As New ClsRH - If ObjPersonal.GetPersonal(-1, "-1", "-1", "-1", "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, UsuarioActual.CveEmpresa) Then - DdlPersonal.ddl.DataSource = ObjPersonal.DtResultados - End If - DdlPersonal.ddl.DataBind() - DdlPersonal.ddl.SelectedValueExist(CvePersonal) - End If + DdlPersonal.setEsWebService(True) + End If If Dr("AplicaImpuesto").ToString = "True" Then @@ -172,20 +183,22 @@ Partial Class Contabilidad2_CatCuentasAsignaciones divAlmacen.Visible = True End If + If Dr("AplicaSubProyecto").ToString = "True" Then + divSubProyectos.Visible = True + End If + If Dr("AplicaActivoFijo").ToString = "True" Then divActivoFijo.Visible = True + DdlActivoFijo.DataSource = GlobalDTActivoFijos(UsuarioActual.CveEmpresa) + DdlActivoFijo.DataBind() + ' DdlActivoFijo.SelectedValueExist(GvRow.DataKey("CveActivoFijo")) End If If Dr("AplicaNomina").ToString = "True" Then divConceptoNomina.Visible = True End If - - LbAgregar.Text = "Actualizar" - UpModalModulos.Update() - RegistraScript("$('#ModalCat').modal();") End If - End Sub Protected Sub EliminarRow(sender As Object, e As EventArgs) @@ -218,7 +231,10 @@ Partial Class Contabilidad2_CatCuentasAsignaciones Protected Sub BtnAgregarAsignacion_Click(sender As Object, e As EventArgs) Handles BtnAgregarAsignacion.Click LimpiarDatos() - + DdlCconceptosContables.Enabled = True + DdlSubProyectos.Enabled = True + DdlClasificacion.Enabled = True + DdlPersonal.Enabled = True LbAgregar.Text = "Agregar" UpModalModulos.Update() RegistraScript("$('#ModalCat').modal();") @@ -249,13 +265,15 @@ Partial Class Contabilidad2_CatCuentasAsignaciones If HdnCveCuentaAsignacion.Value.ToEntero <= 0 Then If Not ObjConta.AddCuentasAsignaciones(DdlCconceptosContables.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlCuenta.SelectedValue.ToEntero, TxtIdCuentaContable.Text.ToEntero, DdlProveedor.SelectedValue.ToEntero, DdlClientes.SelectedValue.ToEntero, DdlPersonal.SelectedValue.ToEntero, - DdlClasificacion.SelectedValue.ToEntero, DdlAlmacen.SelectedValue.ToEntero, TxtPorcentajeIVA.Text.ToDecimal, CveBancoCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero(), CveConceptoNomina:=DdlConceptoNomina.SelectedValue.ToEntero()) Then + DdlClasificacion.SelectedValue.ToEntero, DdlAlmacen.SelectedValue.ToEntero, TxtPorcentajeIVA.Text.ToDecimal, CveBancoCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero(), + CveConceptoNomina:=DdlConceptoNomina.SelectedValue.ToEntero(), CveSubProyecto:=DdlSubProyectos.SelectedValue.ToEntero, CveActivoFijo:=DdlActivoFijo.SelectedValue.ToEntero) Then ErrorString = "Error al agregar" End If ElseIf HdnCveCuentaAsignacion.Value.ToEntero > 0 Then If Not ObjConta.UpdateCuentasAsignaciones(CveConceptoAsignacion, DdlCconceptosContables.SelectedValue.ToEntero, DdlCuenta.SelectedValue.ToEntero, TxtIdCuentaContable.Text.ToEntero, DdlProveedor.SelectedValue.ToEntero, DdlClientes.SelectedValue.ToEntero, DdlPersonal.SelectedValue.ToEntero, - DdlClasificacion.SelectedValue.ToEntero, DdlAlmacen.SelectedValue.ToEntero, TxtPorcentajeIVA.Text.ToDecimal, CveBancoCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero(), CveConceptoNomina:=DdlConceptoNomina.SelectedValue.ToEntero()) Then + DdlClasificacion.SelectedValue.ToEntero, DdlAlmacen.SelectedValue.ToEntero, TxtPorcentajeIVA.Text.ToDecimal, CveBancoCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero(), + CveConceptoNomina:=DdlConceptoNomina.SelectedValue.ToEntero(), CveSubProyecto:=DdlSubProyectos.SelectedValue.ToEntero, CveActivoFijo:=DdlActivoFijo.SelectedValue.ToEntero) Then ErrorString = "Error al actualizar" End If End If @@ -288,4 +306,8 @@ Partial Class Contabilidad2_CatCuentasAsignaciones CargaDatosSistema() UpDatos.Update() End Sub + + Private Sub DdlCconceptosContables_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCconceptosContables.SelectedIndexChanged + RecargaConcepto(DdlCconceptosContables.SelectedValue.ToEntero) + End Sub End Class diff --git a/Empresas/Grales/Formatos/CartaPorteTimbrado.rdlc b/Empresas/Grales/Formatos/CartaPorteTimbrado.rdlc new file mode 100644 index 000000000..24d09caea --- /dev/null +++ b/Empresas/Grales/Formatos/CartaPorteTimbrado.rdlc @@ -0,0 +1,3627 @@ + + + + + + + + + + + + true + true + + + + + CANTIDAD + + + + + + + Textbox28 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + 3.00921cm + + + 10.82134cm + + + 2.35479cm + + + + + 0.6cm + + + + + true + true + + + + + =Fields!UnidadMedida.Value + + + + + + + UM + + 2pt + + + + + + 1pt + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Descripcion.Value + + + + + + + Textbox31 + + 5pt + + + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PesoEnKg.Value + + + + + + + PesoEnKg + + 5pt + + + + 1pt + + + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + 0.52062cm + + + true + true + + + + + UNIDAD DE MEDIDA + + + + + + + Textbox40 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.52062cm + + + true + true + + + + + DESCRIPCIÓN + + + + + + + Textbox30 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.52062cm + + + true + true + + + + + PESO(KG) + + + + + + + Textbox64 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + 2.92737cm + + + true + true + + + + + =Fields!Cantidad.Value + + + + + + + Cantidad + + 2pt + + + + + + 1pt + + + 1pt + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + DataSet3 + 5.56865cm + 0.38395cm + 1.12062cm + 19.11271cm + + + + + + true + true + + + + + N + + + + ombre: + + + + =Parameters!ClienteNombre.Value + + + + + + + + + RFC: + + + + =Parameters!ClienteRFC.Value + + + + + + + + + Uso CFDi: + + + + + + + + =Parameters!UsoCFDi.Value + + + + + + + Textbox2 + 0.33302in + 0.41187cm + 0.51791in + 7.5137in + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + MERCANCIAS + + + + + + + Textbox3 + 4.97857cm + 0.1841in + 0.5cm + 7.52776in + 2 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + true + true + + + + + DISTANCIA + + + + + + + Textbox28 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + 3.00921cm + + + 4.47377cm + + + 2.95726cm + + + 6.97146cm + + + + + 0.6cm + + + + + true + true + + + + + =Fields!RFC.Value + + + + + + + UM + + 2pt + + + + + + 1pt + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Nombre.Value + + + + + + + Textbox31 + + 5pt + + + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!FechaHoraSalida.Value + + + + + + + Textbox65 + + 5pt + + + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Direccion.Value + + + + + + + Direccion + + 5pt + + + + 1pt + + + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + 0.52062cm + + + true + true + + + + + RFC + + + + + + + Textbox40 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.52062cm + + + true + true + + + + + NOMBRE + + + + + + + Textbox30 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.52062cm + + + true + true + + + + + FECHA + + + + + + + Textbox64 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.52062cm + + + true + true + + + + + DIRECCIÓN + + + + + + + Textbox1 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + 1.68927cm + + + true + true + + + + + =Fields!Distancia.Value + + + + + + + Cantidad + + 2pt + + + + + + 1pt + + + 1pt + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + DataSet2 + 7.3763cm + 0.42363cm + 1.12062cm + 19.10097cm + 3 + + + + + + true + true + + + + + REMITEMTES Y DESTINATARIOS + + + + + + + Textbox3 + 6.78622cm + 0.19973in + 0.5cm + 7.52776in + 4 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + true + true + + + + + RFC + + + + + + + Textbox28 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + 4.47377cm + + + 9.92872cm + + + + + 0.6cm + + + + + true + true + + + + + =Fields!NumLicencia.Value + + + + + + + UM + + 2pt + + + + + + 1pt + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!NombreOperador.Value + + + + + + + Textbox31 + + 5pt + + + + 1pt + + + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + 0.52062cm + + + true + true + + + + + LICENCIA + + + + + + + Textbox40 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.52062cm + + + true + true + + + + + NOMBRE OPERADOR + + + + + + + Textbox30 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + 4.69848cm + + + true + true + + + + + =Fields!RFC.Value + + + + + + + Cantidad + + 2pt + + + + + + 1pt + + + 1pt + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + DataSet4 + 9.18605cm + 0.42363cm + 1.12062cm + 19.10097cm + 5 + + + + + + true + true + + + + + OPERADORES + + + + + + + Textbox3 + 8.59597cm + 0.19972in + 0.5cm + 7.52776in + 6 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Sello digital del CFDI: + + + + + + + + + =Parameters!SelloCFDI.Value + + + + + + + + + Cadena original del complemento de certificación digital del SAT: + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + External + =Parameters!QR.Value + FitProportional + 5.71082in + 6.18415in + 1.2939in + 1.53682in + 8 + + + + + + true + true + + + + + Medio de transporte + + + + : + + + + =Parameters!MedioTransporte.Value + + + + + + + + + Transporte Internacional: + + + + =Parameters!TransporteInternacional.Value + + + + + + + + + Tipo de Transporte Internacional: + + + + =Parameters!TipoTI.Value + + + + + + + + + Vía de Transporte Internacional: + + + + =Parameters!ViaTI.Value + + + + + + + + + Permiso STCC: + + + + + + + + =Parameters!PermisoSTCC.Value + + + + + + + Textbox2 + 1.13111in + 0.38395cm + 0.76862in + 3.73231in + 9 + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + TRANSPORTE + + + + + + + Textbox3 + 2.33775cm + 0.15116in + 0.5cm + 7.5137in + 10 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Numero de Permiso + + + + : + + + + =Parameters!NumPermiso.Value + + + + + + + + + Aseguradora: + + + + =Parameters!Aseguradora.Value + + + + + + + + + Número de Póliza: + + + + =Parameters!NumPoliza.Value + + + + + + + + + Placa: + + + + =Parameters!PlacaVM.Value + + + + + + + + + Año: + + + + =Parameters!AnioVM.Value + + + + + + + + + + + Textbox2 + 1.13111in + 9.86403cm + 0.76862in + 3.78138in + 11 + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + DATOS DEL CLIENTE + + + + + + + Textbox3 + 0.27884cm + 0.15259in + 0.5cm + 7.5137in + 12 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + true + true + + + + + CANTIDAD + + + + + + + Textbox28 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + 3.00921cm + + + 8.91467cm + + + 2.35479cm + + + 2.95015cm + + + + + 0.6cm + + + + + true + true + + + + + =Fields!Unidad.Value + + + + + + + UM + + 2pt + + + + + + 1pt + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Descripcion.Value + + + + + + + Textbox31 + + 5pt + + + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ValorUnitario.Value + + + + + + + PesoEnKg + + 5pt + + + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Importe.Value + + + + + + + Importe + + 5pt + + + + 1pt + + + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + 0.52062cm + + + true + true + + + + + UNIDAD DE MEDIDA + + + + + + + Textbox40 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.52062cm + + + true + true + + + + + DESCRIPCIÓN + + + + + + + Textbox30 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.52062cm + + + true + true + + + + + PU + + + + + + + Textbox64 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.52062cm + + + true + true + + + + + IMPORTE + + + + + + + Textbox5 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + 1.86551cm + + + true + true + + + + + =Fields!Cantidad.Value + + + + + + + Cantidad + + 2pt + + + + + + 1pt + + + 1pt + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + DataSet1 + 11.01962cm + 0.33883cm + 1.12062cm + 19.09433cm + 13 + + + + + + true + true + + + + + CONCEPTOS + + + + + + + Textbox3 + 10.42954cm + 0.16633in + 0.5cm + 7.52776in + 14 + + + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + =Parameters!SubTotal.Value + + + + + + + Textbox3 + 4.896in + 6.37477in + 0.60856cm + 1.30108in + 15 + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + SUBTOTAL: + + + + + + + Textbox3 + 12.43583cm + 5.24863in + 0.60856cm + 1.12683in + 16 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + =Parameters!Descuentos.Value + + + + + + + Textbox3 + 5.13559in + 6.37685in + 0.60856cm + 1.30108in + 17 + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + DESCUENTOS: + + + + + + + Textbox3 + 13.04438cm + 5.25071in + 0.60856cm + 1.12683in + 18 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + =Parameters!Total.Value + + + + + + + Textbox3 + 5.37518in + 6.37893in + 0.60856cm + 1.30108in + 19 + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + TOTAL: + + + + + + + Textbox3 + 13.65293cm + 5.25279in + 0.60856cm + 1.12614in + 20 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + "Este documento es una representación impresa de un CFDI" + + + + + + + + + + + + + + + + + + Folio fiscal: + + + + =Parameters!FolioFiscal.Value + + + + + + + + + + + =Parameters!FechaCertificacion.Value + + + + + + + + + + + =Parameters!CertificadoContribuyente.Value + + + + + + + =Parameters!SerieCertificadoSAT.Value + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + 7.02116in + + + + + + + Textbox2 + 0.38703cm + 4.85476cm + 0.78571cm + 9.73471cm + + + + true + true + + + + + RFC: + + + + =Parameters!RFC.Value + + + + + + + + + + + =Parameters!DomicilioFiscal.Value + + + + + + + =Parameters!RegimenFiscal.Value + + + + + + + =Parameters!DomicilioExpedicion.Value + + + + + + + External + =Parameters!LogoPath.Value + FitProportional + 0.16845in + 0.46171in + 1.23522in + 2 + + + + + + true + + + + + CARTA PORTE - TRASLADO + + + + + + + Textbox3 + 0.38703cm + 5.81924in + 0.5cm + 1.83161in + 3 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!SerieFolio.Value + + + + + + + Textbox3 + 0.3607in + 5.81924in + 0.60856cm + 1.83161in + 4 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + 1.23524cm + true + true + + + 0.03525cm + 0.64802cm + 0cm + 19.22862cm + + + + + + true + true + + + + + Usuario: + + + + + + + Textbox13 + 0.14108cm + 0.64802cm + 0.54708cm + 1.55632cm + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!UsuarioImprimio.Value + + + + + + + Textbox14 + 0.14108cm + 2.20434cm + 0.54708cm + 4.96223cm + 2 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha Impresion: + + + + + + + Textbox13 + 0.14108cm + 7.27241cm + 0.54708cm + 2.84562cm + 3 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Globals!ExecutionTime + + + + + + + Textbox14 + 0.14108cm + 10.11802cm + 0.54708cm + 4.68641cm + 4 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + ="Página " & Globals.PageNumber & " de " & Globals.TotalPages + + + + + + + Textbox14 + 0.17636cm + 15.0542cm + 0.54708cm + 4.8023cm + 5 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + IMPRESO EN SIG, Traspaso Almacén + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 29.7cm + 21cm + 0.5cm + 0.5cm + 1cm + 1cm + 0.13cm +