Merge -- Empresas
This commit is contained in:
@@ -5824,9 +5824,7 @@ Partial Class Compras_Compras
|
||||
|
||||
Dim CveSubProyectoInsertar As Integer = -1
|
||||
Dim ConceptoContable As Integer = Row("CveConcepto").ToString.ToEntero
|
||||
If chkImportacion.Checked And ConceptoContable = 14 Then
|
||||
ConceptoContable = 287
|
||||
End If
|
||||
|
||||
Dim TipoMovimiento As Boolean = If(Row("TipoMovto").ToString = "True", True, False)
|
||||
Dim importeMovimiento As Decimal = 0
|
||||
Dim IdCtaContable As Integer = 0
|
||||
@@ -6005,6 +6003,9 @@ Partial Class Compras_Compras
|
||||
|
||||
PorcentajeImpuesto = PorcentajeIVA
|
||||
IdCtaContable = If(IdCtaIVAAcreditable > 0, IdCtaIVAAcreditable, 0)
|
||||
If chkImportacion.Checked Then
|
||||
ConceptoContable = 288
|
||||
End If
|
||||
|
||||
If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then
|
||||
If ObjConta.DtResultados.Rows.Count > 0 Then
|
||||
@@ -6035,6 +6036,11 @@ Partial Class Compras_Compras
|
||||
If tipoCambioActual > 1 Then Concepto += $" TC{tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}"
|
||||
PorcentajeImpuesto = PorcentajeIVA
|
||||
IdCtaContable = If(IdCtaIVAXAcreditar > 0, IdCtaIVAXAcreditar, 0)
|
||||
|
||||
If chkImportacion.Checked Then
|
||||
ConceptoContable = 287
|
||||
End If
|
||||
|
||||
If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then
|
||||
If ObjConta.DtResultados.Rows.Count > 0 Then
|
||||
IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaIVAxAcreditar").ToString.ToEntero
|
||||
@@ -7592,6 +7598,7 @@ Partial Class Compras_Compras
|
||||
|
||||
'** PRUEBA CUANDO SE AMORTIZA NC ANTES DE QUE SE REGISTRE NO DEBE TENER CONCEPTO 19 ** JM 01/06/2017 SE HIZO ESTO PARA LA FACTURA HRFA-8012831 DE VIGILANCIA
|
||||
'[IPP] NC NO DEBE REGISTRAR IMPUESTOS EN AMORTIZACIÓN 27/Agosto/2018
|
||||
Dim tConceptoContable As Integer
|
||||
If Not Ant.TipoMovto.Contiene("NC", "DEV") Then
|
||||
Dim PorcentajePagoAnt As Decimal = importeMovimiento / If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, TmpDT.SUMD("ImporteConImpuestos"), TxtTotal.Text.ToDecimal)
|
||||
Dim ImporteIVA As Decimal = Math.Round(PorcentajePagoAnt * TxtIVA.Text.ToDecimal, 2)
|
||||
@@ -7599,12 +7606,20 @@ Partial Class Compras_Compras
|
||||
|
||||
If ImporteIVA <> 0 Then
|
||||
'Agregamos el 14
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteIVA, Referencia, 14, Concepto, FechaMovimiento, CtaIvaxAcreditar, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorLocal, CveAcreedor:=CveAcreedor, CveIE:=Ant.CveIE, CveColectiva:=CveColectiva, ImporteMX:=ImporteIVA * tipoCambioActual * Multiplicador, ImporteME:=If(tipoCambioActual = 1, 0, ImporteIVA), PorcentajeImpuesto:=PorcentajeImpuestoAnticipo, Contabilizable:=SeContabiliza) Then
|
||||
tConceptoContable = 14
|
||||
If chkImportacion.Checked Then
|
||||
tConceptoContable = 287
|
||||
End If
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteIVA, Referencia, tConceptoContable, Concepto, FechaMovimiento, CtaIvaxAcreditar, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorLocal, CveAcreedor:=CveAcreedor, CveIE:=Ant.CveIE, CveColectiva:=CveColectiva, ImporteMX:=ImporteIVA * tipoCambioActual * Multiplicador, ImporteME:=If(tipoCambioActual = 1, 0, ImporteIVA), PorcentajeImpuesto:=PorcentajeImpuestoAnticipo, Contabilizable:=SeContabiliza) Then
|
||||
ErrorPrepoliza = True
|
||||
End If
|
||||
|
||||
'Agregamos el 19
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, ImporteIVA, Referencia, 19, Concepto, FechaMovimiento, CtaIvaAcreditable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorLocal, CveAcreedor:=CveAcreedor, CveIE:=Ant.CveIE, CveColectiva:=CveColectiva, ImporteMX:=ImporteIVA * tipoCambioActual * Multiplicador, ImporteME:=If(tipoCambioActual = 1, 0, ImporteIVA), PorcentajeImpuesto:=PorcentajeImpuestoAnticipo, Contabilizable:=SeContabiliza) Then
|
||||
tConceptoContable = 19
|
||||
If chkImportacion.Checked Then
|
||||
tConceptoContable = 288
|
||||
End If
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, ImporteIVA, Referencia, tConceptoContable, Concepto, FechaMovimiento, CtaIvaAcreditable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorLocal, CveAcreedor:=CveAcreedor, CveIE:=Ant.CveIE, CveColectiva:=CveColectiva, ImporteMX:=ImporteIVA * tipoCambioActual * Multiplicador, ImporteME:=If(tipoCambioActual = 1, 0, ImporteIVA), PorcentajeImpuesto:=PorcentajeImpuestoAnticipo, Contabilizable:=SeContabiliza) Then
|
||||
ErrorPrepoliza = True
|
||||
End If
|
||||
End If
|
||||
@@ -8582,13 +8597,57 @@ Partial Class Compras_Compras
|
||||
Next
|
||||
|
||||
Else
|
||||
Alert("Los productos especificados en el lisado no tienen asigando impuesto IVA, favor de realizar la correción en el producto que aplique el impúesto.", TipoMensaje.MsgAdvertencia)
|
||||
Alert("Los productos especificados en el listado no tienen asignado impuesto IVA, favor de realizar la corrección en el producto que aplique el impuesto.", TipoMensaje.MsgAdvertencia)
|
||||
Respuesta = False
|
||||
End If
|
||||
Else
|
||||
Respuesta = True
|
||||
End If
|
||||
|
||||
|
||||
|
||||
If Respuesta Then
|
||||
|
||||
Dim IEPSPSDetalles As Decimal = TmpDT.SUM("IEPSPS", " IEPSPS > 0 ").ToDecimal
|
||||
Dim DiferenciaIEPSPS As Decimal = TxtIEPS.Text.ToDecimal - IEPSPSDetalles
|
||||
|
||||
Dim DTConsultaIEPSPS As New DataTable
|
||||
DTConsultaIEPSPS = TmpDT.FiltraParametros(" AplicaIEPS = 'True'")
|
||||
|
||||
|
||||
Dim IndiceContador As Integer = 0
|
||||
Dim IndicePrimero As Integer = 0
|
||||
|
||||
|
||||
For Each dRow As DataRow In TmpDT.Rows
|
||||
If Boolean.Parse(dRow("AplicaIEPS").ToString) Then
|
||||
IndicePrimero = IndiceContador
|
||||
Exit For
|
||||
End If
|
||||
IndiceContador = IndiceContador + 1
|
||||
Next
|
||||
|
||||
If DiferenciaIEPSPS <> 0 Then
|
||||
|
||||
If DTConsultaIEPSPS.Rows.Count > 0 Then
|
||||
'Ajusta IPES en primer registro que aplique IEPS
|
||||
TmpDT.Rows(IndicePrimero)("IEPSPS") = TmpDT.Rows(IndicePrimero)("IEPSPS").ToString.ToDecimal + DiferenciaIEPSPS
|
||||
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)
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Return Respuesta
|
||||
|
||||
End Function
|
||||
@@ -9753,7 +9812,7 @@ Partial Class Compras_Compras
|
||||
Dim ObjInventario As New ClsInventarios(ObjCompra.IniciaTransacSQL)
|
||||
Dim ObjContabilidad As New ClsContabilidad(ObjCompra.IniciaTransacSQL)
|
||||
Dim ObjAF As New ClsAF(ObjCompra.IniciaTransacSQL)
|
||||
Dim ObjContaAC As ClsContPAQi '= New ClsContPAQi(UsuarioActual.Empresa)
|
||||
Dim ObjContaAC As ClsContPAQi = Nothing '= New ClsContPAQi(UsuarioActual.Empresa)
|
||||
|
||||
Dim Retorno As Boolean = True
|
||||
Dim CveEstatusFactura As Integer = HdnCveEstatusFactura.Value.ToEntero
|
||||
@@ -10957,11 +11016,12 @@ Partial Class Compras_Compras
|
||||
'e.Row.Cells(11).Width = Unit.Pixel(43)
|
||||
|
||||
If UsuarioActual.Empresa.UsaAC Then 'AndAlso (CveFactura > 0 Or CveCompra > 0)
|
||||
e.Row.Cells(12).Width = Unit.Pixel(150)
|
||||
e.Row.Cells(13).Width = Unit.Pixel(150)
|
||||
e.Row.Cells(14).Width = Unit.Pixel(150)
|
||||
e.Row.Cells(15).Width = Unit.Pixel(150)
|
||||
e.Row.Cells(16).Width = Unit.Pixel(100)
|
||||
e.Row.Cells(16).Width = Unit.Pixel(150)
|
||||
e.Row.Cells(17).Width = Unit.Pixel(150)
|
||||
e.Row.Cells(18).Width = Unit.Pixel(100)
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -11062,11 +11122,11 @@ Partial Class Compras_Compras
|
||||
|
||||
'CargaPresupuestosEgresos
|
||||
If UsuarioActual.Empresa.UsaAC Then
|
||||
e.Row.Cells(13).Visible = True
|
||||
e.Row.Cells(14).Visible = True
|
||||
e.Row.Cells(15).Visible = True
|
||||
e.Row.Cells(16).Visible = True
|
||||
e.Row.Cells(17).Visible = True
|
||||
e.Row.Cells(18).Visible = True
|
||||
|
||||
e.Row.FCDropDownList("DdlAC1").Items.Clear()
|
||||
e.Row.FCDropDownList("DdlAC1").DataSource = DtPresupuestos.FiltraParametros("", DistinctColumns:={"CveProgramaOperativo", "ProgramaOperativo"})
|
||||
@@ -11097,19 +11157,19 @@ Partial Class Compras_Compras
|
||||
'SI EL PRESUPUESTO DE EGRESOS VIENE DESDE LA OC, SE BLOQUEA PE
|
||||
If e.Row.DBCampo("CveOrdenCompraDetalle").ToEntero > 0 AndAlso e.Row.DBCampo("CvePresupuestoEgreso").ToEntero > 0 Then
|
||||
|
||||
e.Row.Cells(13).Enabled = False
|
||||
e.Row.Cells(14).Enabled = False
|
||||
e.Row.Cells(15).Enabled = False
|
||||
e.Row.Cells(16).Enabled = False
|
||||
e.Row.Cells(17).Enabled = False
|
||||
e.Row.Cells(18).Enabled = False
|
||||
End If
|
||||
Else
|
||||
|
||||
e.Row.Cells(13).Visible = False
|
||||
e.Row.Cells(14).Visible = False
|
||||
e.Row.Cells(15).Visible = False
|
||||
e.Row.Cells(16).Visible = False
|
||||
e.Row.Cells(17).Visible = False
|
||||
e.Row.Cells(18).Visible = False
|
||||
End If
|
||||
|
||||
End If
|
||||
@@ -13226,11 +13286,11 @@ Partial Class Compras_Compras
|
||||
|
||||
'Seccion Grid
|
||||
GvPS.Width = 1760
|
||||
GvPS.Columns(12).Visible = True
|
||||
GvPS.Columns(13).Visible = True
|
||||
GvPS.Columns(14).Visible = True
|
||||
GvPS.Columns(15).Visible = True
|
||||
GvPS.Columns(16).Visible = True
|
||||
GvPS.Columns(17).Visible = True
|
||||
|
||||
'Panel General
|
||||
UpPresupuestosAC.Visible = True
|
||||
@@ -17441,7 +17501,7 @@ Partial Class Compras_Compras
|
||||
CargaRetISRConcepto()
|
||||
|
||||
Dim NumNoDed As Integer = TmpDT.COUNT("CvePS", "NoDeducible = True ")
|
||||
If NumNoDed > 0 Then GvPS.Columns(10).Visible = True 'visualiza columnas de nodeducibles
|
||||
If NumNoDed > 0 Then GvPS.Columns(11).Visible = True 'visualiza columnas de nodeducibles
|
||||
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") Then
|
||||
InicializaAplicaNCFact()
|
||||
@@ -17971,14 +18031,16 @@ Partial Class Compras_Compras
|
||||
|
||||
ViewState("RetIVA") = If(PS("RetIVA").ToString = "-1", ViewState("RetIVA"), PS("RetIVA").ToString).ToString
|
||||
ViewState("RetISR") = If(PS("RetISR").ToString = "-1", ViewState("RetISR"), PS("RetISR").ToString).ToString
|
||||
ViewState("IEPSPS") = If(PS("IEPSPorcentaje").ToString = "-1", ViewState("IEPSPS"), PS("IEPSPorcentaje").ToString).ToString
|
||||
If TxtIEPSModal.Text = "" Then
|
||||
TxtIEPSModal.Text = FormatoNumero(PS("IEPSPorcentaje").ToString.ToDecimal * 100, 0)
|
||||
End If
|
||||
ViewState("IEPSPSIVA") = If(PS("IEPSGrabaIVA").ToString = "True", PS("IEPSPorcentaje").ToString.ToDouble, 0)
|
||||
|
||||
|
||||
'TxtIVAModal.Text = FormatoNumero(ViewState("IVAPS").ToString().ToDouble * 100, 0)
|
||||
TxtRetIVAModal.Text = FormatoNumero(ViewState("RetIVA").ToString().ToDouble * 100, 0)
|
||||
TxtRetISRModal.Text = FormatoNumero(ViewState("RetISR").ToString().ToDouble * 100, 0)
|
||||
TxtIEPSModal.Text = FormatoNumero(ViewState("IEPSPS").ToString().ToDouble * 100, 0)
|
||||
|
||||
|
||||
UpIVA.Update()
|
||||
|
||||
@@ -20441,12 +20503,12 @@ Partial Class Compras_Compras
|
||||
If ChkEsNoDeducible.Checked Then
|
||||
EsNoDeducible = True
|
||||
dvNoDeducible.Visible = True
|
||||
GvPS.Columns(10).Visible = True
|
||||
GvPS.Columns(11).Visible = True
|
||||
UpEsNoDeduciblePS.Visible = True
|
||||
Else
|
||||
EsNoDeducible = False
|
||||
dvNoDeducible.Visible = False
|
||||
GvPS.Columns(10).Visible = False
|
||||
GvPS.Columns(11).Visible = False
|
||||
UpEsNoDeduciblePS.Visible = False
|
||||
End If
|
||||
'DivEsNoDeducible.Visible = False
|
||||
@@ -20787,7 +20849,7 @@ Partial Class Compras_Compras
|
||||
DdlTipoGastoContrato.DataBind()
|
||||
DdlTipoGasto.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
|
||||
RegistraScript("$('#DivmodalConmtrato').modal('show')")
|
||||
RegistraScript("$('#DivmodalContrato').modal('show')")
|
||||
UpModalContrato.Update()
|
||||
|
||||
End Sub
|
||||
@@ -20833,28 +20895,30 @@ Partial Class Compras_Compras
|
||||
|
||||
|
||||
Protected Sub BtnAplicarContrato_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim PorcentajeIVA As Decimal = TmpDT.MAX("IVAPorcentaje").ToDecimal
|
||||
|
||||
TmpDT.Rows.Clear()
|
||||
|
||||
Dim CveTipoGastoObra As Integer = DdlTipoGastoContrato.SelectedValue.ToEntero
|
||||
Dim TuipoGasto As String = DdlTipoGastoContrato.SelectedItem.Text
|
||||
Dim TipoGasto As String = DdlTipoGastoContrato.SelectedItem.Text
|
||||
|
||||
For Each GvRow As GridViewRow In GvContratosControl.Rows
|
||||
|
||||
Dim CveContratoDetalle As Integer = GvRow.DataKey("CveContratoDetalle").ToEntero
|
||||
|
||||
Dim Cantidad As Double = GvRow.FCTextBox("TxtCantidad").Text.ToDouble
|
||||
Dim Cantidad As Decimal = GvRow.FCTextBox("TxtCantidad").Text.ToDecimal
|
||||
Dim CvePS As Integer = GvRow.DataKey("CvePS").ToEntero
|
||||
Dim PS As String = GvRow.DataKey("PS")
|
||||
Dim PU As Double = GvRow.DataKey("PU").ToDouble
|
||||
Dim TotalPS As Double = GvRow.FCTextBox("TxtImporte").Text.ToDouble
|
||||
Dim TotalPS As Decimal = GvRow.FCTextBox("TxtImporte").Text.ToDecimal
|
||||
Dim PU As Decimal
|
||||
|
||||
If Cantidad > 0 Then PU = TotalPS / Cantidad
|
||||
|
||||
Dim CveUnidadMedida As Integer = GvRow.DataKey("CveUnidadMedida").ToEntero
|
||||
Dim UMAbreviatura As String = GvRow.DataKey("Abreviatura").ToString
|
||||
|
||||
Dim SubProyecto As String = GvRow.DataKey("SubProyecto")
|
||||
Dim CveSubProyecto As Integer = GvRow.DataKey("CveSubProyecto").ToEntero
|
||||
Dim Codigo As String = "" 'GvRow.DataKey("Codigo")
|
||||
|
||||
Dim Proyecto As String = GvRow.DataKey("Proyecto")
|
||||
Dim CveProyecto As Integer = GvRow.DataKey("CveProyecto").ToEntero
|
||||
@@ -20863,24 +20927,23 @@ Partial Class Compras_Compras
|
||||
Dim RetIVA As Double = GvRow.DataKey("RetIVA").ToString.ToDouble
|
||||
Dim IvaPS As Double = GvRow.DataKey("IVA").ToString.ToDouble
|
||||
|
||||
If IvaPS = -1 Then
|
||||
IvaPS = PorcentajeIVA
|
||||
End If
|
||||
|
||||
IvaPS = IvaPS * TotalPS
|
||||
|
||||
Dim CveClasificacion As Integer = GvRow.DataKey("CveClasificacion").ToString.ToEntero
|
||||
Dim Clasificacion As String = GvRow.DataKey("Clasificacion")
|
||||
|
||||
|
||||
Dim IEPSPS As Double = GvRow.DataKey("IEPSPorcentaje").ToString.ToDouble
|
||||
Dim IEPSPSIVA As Double = If(GvRow.DataKey("IEPSGrabaIVA").ToString = "True", IEPSPS, 0)
|
||||
|
||||
Dim IdCuentaPorEjercer As Integer = -1
|
||||
Dim IdCuentaComprometido As Integer = -1
|
||||
|
||||
|
||||
|
||||
|
||||
If Cantidad > 0 Then
|
||||
|
||||
AddPS(Cantidad, CveUnidadMedida, UMAbreviatura, CveClasificacion, Clasificacion, CvePS, PS, 1, CveSubProyecto.ToString, SubProyecto, Proyecto, CveProyecto.ToString, "", PU, PU * Cantidad, IvaPS, RetIVA, RetISR, IEPSPS, IEPSPSIVA, 0, CveContratoDetalle:=CveContratoDetalle,
|
||||
CveTipoGasto:=CveTipoGastoObra, TipoGasto:=TuipoGasto)
|
||||
|
||||
AddPS(Cantidad, CveUnidadMedida, UMAbreviatura, CveClasificacion, Clasificacion, CvePS, PS, 1, CveSubProyecto.ToString, SubProyecto, Proyecto, CveProyecto.ToString, "", PU, PU * Cantidad, PorcentajeIVA, RetIVA, RetISR, IEPSPS, IEPSPSIVA, 0, PorcentajeIVA:=PorcentajeIVA, CveContratoDetalle:=CveContratoDetalle,
|
||||
CveTipoGasto:=CveTipoGastoObra, TipoGasto:=TipoGasto)
|
||||
|
||||
'ContratoObraAplciado = True
|
||||
|
||||
@@ -20890,7 +20953,7 @@ Partial Class Compras_Compras
|
||||
|
||||
AddPS2()
|
||||
If Not ChkContinualAgregandoControl.Checked Then
|
||||
RegistraScript("$('#DivmodalConmtrato').modal('hide')")
|
||||
RegistraScript("$('#DivmodalContrato').modal('hide')")
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Reference in New Issue
Block a user