This commit is contained in:
Hector
2021-08-05 10:14:38 -07:00
32 changed files with 2510 additions and 1160 deletions

View File

@@ -1109,6 +1109,8 @@ Partial Class Compras_Compras
End Set
End Property
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
'ImgBtnBuscarOC.Attributes.Add("data-toggle", "tooltip")
@@ -1548,8 +1550,8 @@ Partial Class Compras_Compras
End If
'SE OCUPAN AFUERA DEL POSTBACK ??
cargaddlVinculacionServcios()
'SE OCUPAN AFUERA DEL POSTBACK ??
cargaddlVinculacionServcios()
If UsuarioActual.TienePermisoProceso(117) Then
HplAddClasificacion.Visible = False
@@ -4088,11 +4090,15 @@ Partial Class Compras_Compras
'DF - 10/04/2017
If UsuarioActual.TienePermisoProceso(187) Then
If TxtSerie.Text <> SerieVieja Then
Dim SerieNueva As String = GlobalDTProveedorSucursales(CveProveedor, UsuarioActual.CveEmpresa).FiltroPrimeroValor("Serie", $"Serie = '{TxtSerie.Text}'").ToString
If SerieNueva = "" Then
Alert("La Serie no es válida, por favor revise que se encuentre dentro de la lista de las sucursales del proveedor.", TipoMensaje.MsgAdvertencia)
Exit Sub
Dim dtt As DataTable = GlobalDTProveedorSucursales(CveProveedor, UsuarioActual.CveEmpresa)
If dtt IsNot Nothing AndAlso dtt.Rows.Count > 0 Then
Dim SerieNueva As String = dtt.FiltroPrimeroValor("Serie", $"Serie = '{TxtSerie.Text}'").ToString
If SerieNueva = "" Then
Alert("La Serie no es válida, por favor revise que se encuentre dentro de la lista de las sucursales del proveedor.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
End If
End If
@@ -4385,6 +4391,8 @@ Partial Class Compras_Compras
Exit Sub
End If
'------------------TERMINA VALIDACIONES------------------
'si hay necesidad de actualizar el globaldtps
@@ -4633,20 +4641,7 @@ Partial Class Compras_Compras
If RBLPago.SelectedValue.ToEntero = 4 And EstatusCredito.Contiene(1, 101) Then
CveEstatusFactura = 6
End If
'hay amortización directa como descuento. RMF Temporal
If UsuarioActual.CveEmpresa = 119 Then
'If LblAmortizacion.Text.ToDouble > 0 AndAlso TxtDescuento.Text.ToDouble = 0 Then
' TxtDescuento.Text = LblAmortizacion.Text
' LblAmortizacion.Text = "0.00"
'End If
'o si el descuento es igual a la amortizacion
'If LblAmortizacion.Text.ToDouble = TxtDescuento.Text.ToDouble Then
' TxtDescuento.Text = LblAmortizacion.Text
' LblAmortizacion.Text = "0.00"
'End If
End If
'Compra
Dim CveFactura As Integer = -1
@@ -6698,7 +6693,7 @@ Partial Class Compras_Compras
CveMovimientoAlmacen = ObjOC.DtResultados.FiltroPrimeroValor("CveMovimientoAlmacen").ToEntero
Dim TCAjuste As Decimal = ObjOC.DtResultados.FiltroPrimeroValor("TipoCambioAjuste").ToDecimal
'RMF. falta verificar el costo indirecto de la OC
If DdlMoneda.SelectedValue.ToEntero <> 1 And UsuarioActual.CveEmpresa.Contiene(119) Then
If DdlMoneda.SelectedValue.ToEntero <> 1 Then
TCO = TxtTC.Text.ToDecimal
ImporteCI176 = ObjOC.DtResultados.FiltroPrimeroValor("ImporteCI228").ToDecimal
CostoIndirectoAcum176 += ImporteCI176
@@ -6884,7 +6879,7 @@ Partial Class Compras_Compras
Next
If ContienePSNeteoBonif Then
importeMovimiento = TmpDT.SUM(If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, "ImporteSinImpuestos", "Total"), $"ISNULL(TipoAF,0) <> 2 And ISNULL(CveAlmacen,0) = 0 And ISNULL(AplicaCostoIndirecto,0) <> 1 ").ToString.ToDecimal
importeMovimiento = TmpDT.SUM(If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, "ImporteSinImpuestos", "Total"), $"ISNULL(TipoAF,0) <> 2 And ISNULL(CveAlmacen,0) = 0 And ISNULL(AplicaCostoIndirecto,0) <> 1 AND CveClasificacion = 20319 ").ToString.ToDecimal
importeMN = importeMovimiento * tipoCambioActual * Multiplicador
Dim IdCtaContableDescCompra As Integer = UsuarioActual.Empresa.Funcionalidad(405).ToEntero
@@ -6905,8 +6900,6 @@ Partial Class Compras_Compras
End If
' adfasdasd
'ChkNCInvNC
If Not RegistroCuentaPuente AndAlso Not ChkNCInvNC.Checked Then
@@ -6968,9 +6961,11 @@ Partial Class Compras_Compras
DTDistinct.Clear()
End If
Dim tTipoMovimiento As Boolean = TipoMovimiento
If DTDistinct.Rows.Count > 0 Then
For Each Row2 As DataRow In DTDistinct.Rows
tTipoMovimiento = TipoMovimiento
'DETERMINA IMPORTE
If UsuarioActual.Empresa.Funcionalidad(126) = "1" Then
importeMovimiento = DT.SUM(If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, "ImporteSinImpuestos", "Total"), String.Format("ISNULL(TipoAF,0) <> 2 And CveClasificacion = {0} And CveSubProyecto = {1} And ISNULL(CveTipoGasto,0) = {2}", Row2("CveClasificacion").ToString.ToEntero, Row2("CveSubProyecto").ToString.ToEntero, Row2("CveTipoGasto").ToString.ToEntero)).ToString.ToDecimal
@@ -6995,8 +6990,6 @@ Partial Class Compras_Compras
End If
'SEGMENTO DE NEGOCIO
Dim IdSegmentoNegocio As Integer = -1
Dim drT As DataRow = GlobalDTSubProyectos(-1, CveSubProyecto:=Row2("CveSubProyecto").ToString.ToEntero).FiltroPrimero(String.Format("CveSubProyecto = {0} ", Row2("CveSubProyecto").ToString.ToEntero))
@@ -7006,12 +6999,6 @@ Partial Class Compras_Compras
'AGREGA MOVIMIENTO
If importeMovimiento.RoundSQL <> 0 Then
'Conta ContPAQ
' If IdCtaContable = 0 Then
' CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", 6))("ConceptoContable").ToString)
' idCuentaContabilizacion = 0
'End If
Dim tcvecon As Integer = 6
Dim tidctacon As Integer = 6
@@ -7027,17 +7014,23 @@ Partial Class Compras_Compras
tcvecon = 259
tidctacon = UsuarioActual.Empresa.Funcionalidad(405).ToEntero
ElseIf UsuarioActual.CveEmpresa = 119 AndAlso Row2("CveClasificacion").ToString = "20473" Then
'CODIGO FIJO, SI ES LA CLASIFICACION DE "SEGURO/SERVICIO COSTO", SE ABONARÁ
tTipoMovimiento = True
importeMovimiento = -importeMovimiento
importeMN = -importeMN
End If
Dim usacomplementariaProveedor As Boolean = False
usacomplementariaProveedor = If(tipoCambioActual > 1 AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119, 158), True, False)
usacomplementariaProveedor = If(tipoCambioActual > 1, True, False)
If usacomplementariaProveedor AndAlso DdlTipoComprobante.SelectedValue = "Ant" Then
'importeMovimiento
Concepto = $"{NombreProveedor} {TxtSerie.Text} - {TxtFolio.Text}"
importeMN = tipoCambioActual * importeMovimiento - importeMovimiento
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, 266, Concepto, FechaMovimiento, tidctacon, IdSegmentoNegocio, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, CveClasificacion:=Row2("CveClasificacion").ToString.ToEntero, CveSubProyecto:=Row2("CveSubProyecto").ToString.ToEntero, ImporteMX:=importeMN, ImporteME:=importeMovimiento, CveTipoGasto:=Row2("CveTipoGasto").ToString.ToEntero, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, tTipoMovimiento, importeMovimiento, Referencia, 266, Concepto, FechaMovimiento, tidctacon, IdSegmentoNegocio, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, CveClasificacion:=Row2("CveClasificacion").ToString.ToEntero, CveSubProyecto:=Row2("CveSubProyecto").ToString.ToEntero, ImporteMX:=importeMN, ImporteME:=importeMovimiento, CveTipoGasto:=Row2("CveTipoGasto").ToString.ToEntero, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza) Then
ErrorPrepoliza = True
End If
importeMN = importeMovimiento
@@ -7047,7 +7040,7 @@ Partial Class Compras_Compras
If Not Insertado205 Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, tcvecon, Concepto, FechaMovimiento, tidctacon, IdSegmentoNegocio, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, CveClasificacion:=Row2("CveClasificacion").ToString.ToEntero, CveSubProyecto:=Row2("CveSubProyecto").ToString.ToEntero, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveTipoGasto:=Row2("CveTipoGasto").ToString.ToEntero, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, tTipoMovimiento, importeMovimiento, Referencia, tcvecon, Concepto, FechaMovimiento, tidctacon, IdSegmentoNegocio, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, CveClasificacion:=Row2("CveClasificacion").ToString.ToEntero, CveSubProyecto:=Row2("CveSubProyecto").ToString.ToEntero, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveTipoGasto:=Row2("CveTipoGasto").ToString.ToEntero, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza) Then
ErrorPrepoliza = True
End If
@@ -7068,7 +7061,7 @@ Partial Class Compras_Compras
End If
Case 5 'Proveedores
If CveTipoConcepto = 2 Then ConceptoContable = 305 'cuando es acreedor
Dim UsaComplementaria As Boolean = UsuarioActual.CveEmpresa.Contiene(119, 158)
Dim UsaComplementaria As Boolean = True
If tipoCambioActual <> 1 Then
Select Case ConceptoContable
Case 5
@@ -7374,7 +7367,7 @@ Partial Class Compras_Compras
End If
'AMORTIZACIÓN NC ESPECIAL COMPLEMENTARIA
If ConceptoContableAnticipo.Contiene(60) And DdlMoneda.SelectedValue.ToEntero <> 1 And UsuarioActual.CveEmpresa.Contiene(119) Then
If ConceptoContableAnticipo.Contiene(60) And DdlMoneda.SelectedValue.ToEntero <> 1 Then
Dim importeMovimientoNC = Ant.Importe
Dim importeMNNC = 0.0D
Dim TipoCambioNC = Ant.TCCompra
@@ -7435,7 +7428,7 @@ Partial Class Compras_Compras
End If
End If
ElseIf ConceptoContableAnticipo.Contiene(265) And DdlMoneda.SelectedValue.ToEntero <> 1 And UsuarioActual.CveEmpresa.Contiene(119) Then
ElseIf ConceptoContableAnticipo.Contiene(265) And DdlMoneda.SelectedValue.ToEntero <> 1 Then
Dim importeMovimientoNC = Ant.Importe
Dim importeMNNC = 0.0D
Dim TipoCambioNC = Ant.TCCompra
@@ -7530,7 +7523,7 @@ Partial Class Compras_Compras
Dim usacomplementariaAnticipo As Boolean = False
usacomplementariaAnticipo = If(Ant.TCCompra > 1 AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119), True, False)
usacomplementariaAnticipo = If(Ant.TCCompra > 1, True, False)
Dim TipoCambioAnt As Decimal = Ant.TCCompra
@@ -7560,7 +7553,7 @@ Partial Class Compras_Compras
If CveTipoConcepto = 2 Then CveConceptoContableComplementaria = 307
Dim IdCtaContablePago As Integer = CtaProveedor
Dim usacomplementariaProveedor As Boolean = False
usacomplementariaProveedor = If(tipoCambioActual > 1 AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119), True, False)
usacomplementariaProveedor = If(tipoCambioActual > 1, True, False)
If usacomplementariaProveedor Then
Concepto = $"{NombreProveedor} {TxtSerie.Text} - {TxtFolio.Text}"
importeMN = tipoCambioActual * importeMovimiento - importeMovimiento
@@ -8633,7 +8626,7 @@ Partial Class Compras_Compras
If Respuesta Then
Dim IEPSPSDetalles As Decimal = TmpDT.SUM("IEPSPS", " IEPSPS > 0 ").ToDecimal
Dim IEPSPSDetalles As Decimal = TmpDT.SUMD("IEPSPS", " IEPSPS > 0 ")
Dim DiferenciaIEPSPS As Decimal = TxtIEPS.Text.ToDecimal - IEPSPSDetalles
Dim DTConsultaIEPSPS As New DataTable
@@ -8652,7 +8645,7 @@ Partial Class Compras_Compras
IndiceContador = IndiceContador + 1
Next
If DiferenciaIEPSPS <> 0 Then
If DiferenciaIEPSPS.RoundAD(2) <> 0 Then
If DTConsultaIEPSPS.Rows.Count > 0 Then
'Ajusta IPES en primer registro que aplique IEPS
@@ -8660,7 +8653,7 @@ Partial Class Compras_Compras
TmpDT.AcceptChanges()
Else
Respuesta = False
Alert("Los productos especificados en el lisado no tienen asigando impuesto IEPS, favor de realizar la correción en el producto que aplique el impúesto.", TipoMensaje.MsgAdvertencia)
Alert(String.Format("Los productos especificados en el listado no tienen asigando impuesto IEPS, favor de realizar la corrección en el producto que aplique el impuesto. ({0}-{1})", IEPSPSDetalles, TxtIEPS.Text.ToDecimal), TipoMensaje.MsgAdvertencia)
End If
End If
@@ -8921,13 +8914,13 @@ Partial Class Compras_Compras
If DdlMoneda.SelectedValue.ToEntero <> 1 Then
IdCtaContable = CtaProveedorAnticiposExtranjera
If ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, ImporteMovimiento, "", ConceptoContable, "", Fecha, IdCtaContable, -1, CveCompra:=CveCompraNC, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=ImporteMovimiento, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=ImporteMovimiento, TipoCambio:=tipoCambioNC, CveCompraAmortizacion:=CveCompra) Then
If UsuarioActual.CveEmpresa.Contiene(119) Then
IdCtaContable = CtaProveedorAnticiposComplementaria
If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, importeMN - ImporteMovimiento, "", 266, "", Fecha, IdCtaContable, -1, CveCompra:=CveCompraNC, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=importeMN - ImporteMovimiento, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=ImporteMovimiento, TipoCambio:=tipoCambioNC, CveCompraAmortizacion:=CveCompra) Then
ErrorMovtosCxP = 1
Exit Select
End If
IdCtaContable = CtaProveedorAnticiposComplementaria
If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, importeMN - ImporteMovimiento, "", 266, "", Fecha, IdCtaContable, -1, CveCompra:=CveCompraNC, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=importeMN - ImporteMovimiento, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=ImporteMovimiento, TipoCambio:=tipoCambioNC, CveCompraAmortizacion:=CveCompra) Then
ErrorMovtosCxP = 1
Exit Select
End If
Else
ErrorMovtosCxP = 1
Exit Select
@@ -8958,7 +8951,7 @@ Partial Class Compras_Compras
ImporteMovimiento = ImporteMovimiento / gvr.DataKey("TCCompra").ToDecimal
End If
If DdlMoneda.SelectedValue.ToEntero <> 1 And UsuarioActual.CveEmpresa.Contiene(119) Then
If DdlMoneda.SelectedValue.ToEntero <> 1 Then
IdCtaContable = CtaProveedorExtranjera
If ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, ImporteMovimiento, ConceptoPartida, ConceptoContable, ConceptoPartida, Fecha, IdCtaContable, -1, CveCompra:=CveCompraNC, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=ImporteMovimiento, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=ImporteMovimiento, TipoCambio:=tipoCambioNC, CveCompraAmortizacion:=CveCompra) Then
IdCtaContable = CtaProveedorComplementaria
@@ -9004,7 +8997,7 @@ Partial Class Compras_Compras
Dim TipoCambioAnt = gvr.DataKey("TCCompra").ToDecimal
Dim usacomplementariaAnticipo As Boolean = False
usacomplementariaAnticipo = If(TipoCambioAnt > 1 AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119), True, False)
usacomplementariaAnticipo = If(TipoCambioAnt > 1, True, False)
Dim ImporteAnt As Decimal = ImporteMovimiento
@@ -9103,7 +9096,7 @@ Partial Class Compras_Compras
ImporteMovimiento = sumaAmortizacion
importeMN = ImporteMovimiento * TipoCambio17
If DdlMoneda.SelectedValue.ToEntero <> 1 And UsuarioActual.CveEmpresa.Contiene(119) Then
If DdlMoneda.SelectedValue.ToEntero <> 1 Then
IdCtaContable = CtaProveedorExtranjera
If ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, ImporteMovimiento, Concepto, ConceptoContable, Concepto, Fecha, IdCtaContable, -1, CveCompra:=CveCompra, CveCompraAmortizacion:=CveCompraNC, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=ImporteMovimiento, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=ImporteMovimiento, TipoCambio:=TipoCambio17) Then
@@ -11037,18 +11030,6 @@ Partial Class Compras_Compras
If Not (e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5) Then
If e.Row.RowIndex = 0 Then
'e.Row.Cells(0).Width = Unit.Pixel(15)
'e.Row.Cells(1).Width = Unit.Pixel(45)
'e.Row.Cells(2).Width = Unit.Pixel(70)
'e.Row.Cells(3).Width = Unit.Pixel(230)
'e.Row.Cells(4).Width = Unit.Pixel(202)
'e.Row.Cells(5).Width = Unit.Pixel(155)
'e.Row.Cells(6).Width = Unit.Pixel(155)
'e.Row.Cells(7).Width = Unit.Pixel(50)
'e.Row.Cells(8).Width = Unit.Pixel(80)
'e.Row.Cells(9).Width = Unit.Pixel(80)
'e.Row.Cells(10).Width = Unit.Pixel(43)
'e.Row.Cells(11).Width = Unit.Pixel(43)
If UsuarioActual.Empresa.UsaAC Then 'AndAlso (CveFactura > 0 Or CveCompra > 0)
e.Row.Cells(13).Width = Unit.Pixel(150)
@@ -11239,10 +11220,6 @@ Partial Class Compras_Compras
GvPS.DataSource = TmpDT
GvPS.DataBind()
'GVAF.DataSource = TmpDT
'GVAF.DataBind()
''UpnAF.Update()
CalculaTotales(True)
CargaGvInv()
CargaGVsAF()
@@ -11274,17 +11251,7 @@ Partial Class Compras_Compras
Private Sub GeneraGlobalDT(data As Object)
GlobalDTPSSimplificado(UsuarioActual.CveEmpresa) = Nothing
GlobalDTProductosServiciosEquivalencias(-1, -1, UsuarioActual.CveEmpresa) = Nothing
'Dim ObjPS As New ClsProductosServicios
'If (ObjPS.GetPSSimplificado(-1)) Then
' Application("GlobalDTPSSimplificado") = ObjPS.DtResultados.AsEnumerable
'End If
'If ObjPS.GetPSEquivalencias(-1, -1) Then
' GlobalDTProductosServiciosEquivalencias(-1, -1, UsuarioActual.CveEmpresa) = ObjPS.DtResultados
'End If
'ObjPS.Dispose()
End Sub
Private Function notienepresupuesto() As Boolean
Dim notienerecursos = False
@@ -11357,21 +11324,7 @@ Partial Class Compras_Compras
DTConceptos.Columns.Add("Total", GetType(Double))
DTConceptos.Columns.Add("Amortizacion", GetType(Double))
End Sub
'Private Sub AddPS(Cantidad As Double, UM As String, PS As String, PU As Double, IVA As Double, Descuento As Double, Optional Total As Double = 0)
' Dim Row As DataRow = Nothing
' Row = DTConceptos.NewRow()
' Row("Consec") = DTConceptos.Rows.Count + 1
' Row("Cantidad") = Cantidad
' Row("UM") = UM
' Row("CveClasificacion") = -1
' Row("PS") = PS
' Row("PU") = PU
' Row("IVA") = IVA
' Row("Total") = If(Total > 0, Total, Cantidad * PU)
' Row("Descuento") = Descuento
' DTConceptos.Rows.Add(Row)
'End Sub
Private Sub CreaDTCompras()
TmpDT = New DataTable
@@ -11599,26 +11552,6 @@ Partial Class Compras_Compras
End Sub
'Private Sub AddDTEnvio(Cantidad As Double, UM As String, CveUM As Integer, CvePS As Integer, PS As String, PU As Double, CveAlmacen As Integer, CveEq As Integer)
' Dim dr As DataRow = DtInv.NewRow
' dr("Cantidad") = Cantidad
' dr("UM") = UM
' dr("CveUM") = CveUM
' dr("CvePS") = CvePS
' dr("PS") = PS
' dr("PU") = PU
' dr("CveAlmacen") = CveAlmacen
' dr("CveEq") = CveEq
' DtInv.Rows.InsertAt(dr, hdnIndexInv.Value.ToEntero + 1)
' GvInv.DataSource = DtInv
' GvInv.DataBind()
'End Sub
Protected Sub RecargaMaximum_Click(sender As Object, e As System.EventArgs)
@@ -11719,62 +11652,6 @@ Partial Class Compras_Compras
#End Region
#Region " ALGO DE AF QUE NUNCA SE USABA "
'Protected Sub GVAF_RowCreated(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GVAF.RowCreated
' If e.Row.RowType = DataControlRowType.DataRow AndAlso (e.Row.RowState = DataControlRowState.Alternate OrElse e.Row.RowState = DataControlRowState.Normal) Then
' e.Row.FCDropDownList("DdlTipoActivoFijo").DataSource = TmpDTTiposAF
' e.Row.FCDropDownList("DdlTipoActivoFijo").DataBind()
' e.Row.FCDropDownList("DdlSubTipoActivoFijo").DataSource = Nothing
' e.Row.FCDropDownList("DdlSubTipoActivoFijo").DataBind()
' e.Row.FCDropDownList("DdlSubTipoActivoFijo").Items.Insert(0, New ListItem("Seleccione", "-1"))
' e.Row.FCDropDownList("DdlAF").DataSource = Nothing
' e.Row.FCDropDownList("DdlAF").DataBind()
' e.Row.FCDropDownList("DdlAF").Items.Insert(0, New ListItem("Seleccione", "-1"))
' End If
'End Sub
'Protected Sub GVAF_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GVAF.RowDataBound
' If e.Row.RowType = DataControlRowType.DataRow Then
' If e.Row.RowIndex = 0 Then
' e.Row.Cells(0).Width = Unit.Pixel(20)
' e.Row.Cells(1).Width = Unit.Pixel(140)
' e.Row.Cells(2).Width = Unit.Pixel(250)
' End If
' e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Right
' e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
' e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Left
' End If
'End Sub
'Protected Sub DdlTipoActivoFijo_SelectedIndexChanged(sender As Object, e As System.EventArgs)
' Dim Array() As String = Nothing
' Dim DdlGVSubTipoAF As DropDownList = Nothing
' Array = DirectCast(sender, DropDownList).ClientID.Split("_"c)
' If Array.Length > 0 Then
' DdlGVSubTipoAF = DirectCast(GVAF.Rows(Array(3).ToEntero).Controls(4).Controls(1), DropDownList)
' End If
' If DdlGVSubTipoAF IsNot Nothing Then CargaSubTipoAF(DirectCast(sender, DropDownList), DdlGVSubTipoAF)
'End Sub
'Protected Sub GvOCC2_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvOCC2.RowDataBound
' If e.Row.RowType = DataControlRowType.DataRow Then
' e.Row.Cells(0).Text = (e.Row.RowIndex + 1).ToString
' End If
'End Sub
'Protected Sub chkFuncionariosEmpleados_CheckedChanged(sender As Object, e As EventArgs) Handles chkFuncionariosEmpleados.CheckedChanged
' PnlPagoContado.Visible = Not chkFuncionariosEmpleados.Checked
' PnlFuncionarioEmpleado.Visible = chkFuncionariosEmpleados.Checked
' UPCondicionesPago.Update()
'End Sub
Protected Sub BtnOCAceptar_Click(sender As Object, e As EventArgs) Handles BtnOCAceptar.Click
'carga la OC
Dim CveOC As Integer = -1
@@ -11804,13 +11681,6 @@ Partial Class Compras_Compras
OC.Dispose()
End If
'GvOCC.DataSource = TmpDT
'GvOCC.DataBind()
'GvOCC2.DataSource = dt
'GvOCC2.DataBind()
'UpnAF.Update()
End Sub
#End Region
@@ -12877,12 +12747,6 @@ Partial Class Compras_Compras
Dim dr As DataRow
dr = DtAcreedores.FiltroPrimero(String.Format("CveProveedor = {0}", DdlAcreedor.SelectedValue))
'If EmpresaPrueba Then
' dr = DtAcreedores.FiltroPrimero(String.Format("CveProveedor = {0}", DdlAcreedor.SelectedValue))
'Else
' dr = DtAcreedores.FiltroPrimero(String.Format("CveProveedor = {0}", DdlDeudor.SelectedValue))
'End If
If dr IsNot Nothing Then
Dim tSaldo As Double = dr("Saldo").ToString.ToDouble
@@ -12972,12 +12836,6 @@ Partial Class Compras_Compras
UpTabs.Update()
'DdlProveedor.Attributes.Add("onclick", "CargaProveedores();")
End Sub
Protected Sub DdlCuenta_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCuenta.SelectedIndexChanged
Dim Folio As Long
@@ -13528,12 +13386,6 @@ Partial Class Compras_Compras
For Each gvr As GridViewRow In GvPS.Rows
dr = TmpDT.Rows(gvr.RowIndex)
'DtDetalle.Rows(gvr.RowIndex)("CveClasificacionOG") = gvr.FCDropDownList("DdlAC5").SelectedValue.ToEntero
'DtDetalle.Rows(gvr.RowIndex)("CveProgramaOperativo") = gvr.FCDropDownList("DdlAC1").SelectedValue.ToEntero
'DtDetalle.Rows(gvr.RowIndex)("CveUnidadAdministrativa") = gvr.FCDropDownList("DdlAC2").SelectedValue.ToEntero
'DtDetalle.Rows(gvr.RowIndex)("CveFuenteFinanciamiento") = gvr.FCDropDownList("DdlAC3").SelectedValue.ToEntero
'DtDetalle.Rows(gvr.RowIndex)("CveTipoGasto") = gvr.FCDropDownList("DdlAC4").SelectedValue.ToEntero
dr("CveProgramaOperativo") = gvr.FCDropDownList("DdlAC1").SelectedValue.ToEntero
dr("CveUnidadAdministrativa") = gvr.FCDropDownList("DdlAC2").SelectedValue.ToEntero
dr("CveFuenteFinanciamiento") = gvr.FCDropDownList("DdlAC3").SelectedValue.ToEntero
@@ -18080,6 +17932,12 @@ Partial Class Compras_Compras
TxtRetISRModal.Text = FormatoNumero(ViewState("RetISR").ToString().ToDouble * 100, 0)
If (CveFactura > 0 Or CveCompra > 0) And TxtIEPS.Text.ToDecimal = 0 And PS("IEPSPorcentaje").ToString.ToDecimal > 0 Then
TxtIEPSModal.Text = "0"
Alert("El producto seleccionado contiene IEPS, pero el acumulado de la factura no contiene IEPS, por lo que no se agregara el impuesto.", TipoMensaje.MsgAdvertencia)
End If
UpIVA.Update()
If PS("CveClasificacion").ToString IsNot Nothing Then
@@ -18473,6 +18331,13 @@ Partial Class Compras_Compras
End If
'Esta parte es para validar cuando la factura tenga ieps en o se asignara el ieps como una partida ya no se considere
If (CveFactura > 0 Or CveCompra > 0) And TxtIEPS.Text.ToDecimal = 0 Then
Row("IEPSPS") = 0
Row("IEPSPSPorcentaje") = 0
End If
TmpDT.Rows.Add(Row)
TmpDT.Rows.IndexOf(Row)
@@ -18603,6 +18468,13 @@ Partial Class Compras_Compras
DrPS("IEPSPSIVAPorcentaje") = IEPSPSIVA
'Esta parte es para validar cuando la factura tenga ieps en o se asignara el ieps como una partida ya no se considere
If (CveFactura > 0 Or CveCompra > 0) And TxtIEPS.Text.ToDecimal = 0 Then
DrPS("IEPSPS") = 0
DrPS("IEPSPSPorcentaje") = 0
End If
AplicaCalculaTotales = True
'End If
@@ -19813,6 +19685,7 @@ Partial Class Compras_Compras
Dim CvePS As Integer = DdlConceptoIEPS.SelectedValue.ToEntero
' If CvePS = -1 Then CvePS = UsuarioActual.Empresa.Funcionalidad(112).ToString.ToEntero
AgregarConceptoIEPS(TrasladoIEPS, CvePS)
TrasladoIEPS = 0
TxtIEPS.Text = 0.ToString.FormatoNumero
TrIEPS.Visible = False
@@ -19827,6 +19700,7 @@ Partial Class Compras_Compras
Dim CvePS As Integer = DdlConceptoOI.SelectedValue.ToEntero
'If CvePS = -1 Then CvePS = UsuarioActual.Empresa.Funcionalidad(305).ToString.ToEntero
AgregarConceptoIEPS(OtrosImpuestos, CvePS)
OtrosImpuestos = 0
TxtOtrosImpuestos.Text = 0.ToString.FormatoNumero
TrOtrosImpuestos.Visible = False
@@ -19841,7 +19715,7 @@ Partial Class Compras_Compras
MostrarOcultarColumnaIEPS()
AddPS2()
End Sub
#End Region

View File

@@ -4437,7 +4437,7 @@ Partial Class PopUpVerFactura
RepParams.Add(New ReportParameter("AsignadoA", pUsuarioEntregar))
RepParams.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
ImprimirPDF($"Empresas/{UsuarioActual.CveEmpresa}/Formatos/EntregasPorRealizar.rdlc", DtPaqueteriasGuias, RepParams, "Entregas por realizar", "PDF", RDSName:="DsInventarios")
ImprimirPDF($"{UsuarioActual.Empresa.Ruta}Formatos\EntregasPorRealizar.rdlc", DtPaqueteriasGuias, RepParams, "Entregas por realizar", "PDF", RDSName:="DsInventarios")
End If
End Sub

View File

@@ -149,17 +149,21 @@ Partial Class Compras_RepProductosServiciosDetalle
'DdlCategoria.SelectedValueExist(Categoria)
DdlClasificacion.SelectedValueExist(Clasificacion)
If PS <> "-1" Then
If PS.ToEntero > 1 Then
DdlPS.SelectedValue = PS
DdlPS.SelectedText = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=PS.ToEntero)(0)("PSCodigo").ToString
DdlPS.SelectedText = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=PS.ToEntero).FiltroPrimeroValor("PSCodigo")
End If
'DdlSubProyecto.SelectedValueExist(SubProyecto)
DdlFamilia.SelectedValueExist(Familia)
DdlSubFamilia.SelectedValueExist(SubFamilia)
DdlProveedor.SelectedValue = Proveedor
If Proveedor.ToEntero > 0 Then
DdlProveedor.SelectedText = GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltraParametros($"CveProveedor = {Proveedor}").Rows(0)("RazonSocial").ToString
Dim Dr As DataRow = GlobalDTCompProveedores(UsuarioActual.CveEmpresa, Proveedor.ToEntero).FiltroPrimero("")
If Dr IsNot Nothing Then
DdlProveedor.SelectedText = Dr("RazonSocial").ToString
DdlProveedor.SelectedValue = Proveedor
End If
Else
DdlProveedor.SelectedText = "Todos"
End If
@@ -200,8 +204,10 @@ Partial Class Compras_RepProductosServiciosDetalle
DdlClasificacion.DataBind()
'CargaProveedor
DdlProveedor.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
DdlProveedor.DataBind()
DdlProveedor.setEsWebService(True)
DdlProveedor.Attributes.Add("data-metodo", "getproveedores")
DdlProveedor.SelectedText = "Todos"
DdlProveedor.SelectedValue = "-1"
'CargaUsuarios
DdlUsuario.DataSource = GlobalDTUsuarios.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)