This commit is contained in:
rakcsle
2022-05-21 08:43:29 -07:00
10 changed files with 125 additions and 360 deletions

View File

@@ -369,7 +369,7 @@
<asp:UpdatePanel ID="UPCompras" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UPCompras" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<asp:GridView ID="GvCxP" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Cuentas X Pagar Pendientes" <asp:GridView ID="GvCxP" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Cuentas X Pagar Pendientes"
DataKeyNames="CveCompra,ImporteProgramo,Saldo,SubTotal,IVA,IVADeducible,IVANoDeducible,IEPS,RetIVA,RetISR,Original,UUID,RFC,CveFactura,SerieFolio,Descripcion,CvePrePoliza,Fecha,EstatusInventario,CveProveedor,TipoCambio, CveMoneda,CveRetIVAConcepto,IVAPorPagar,IVAPorPagarDeducible,IVAPorPagarNoDeducible,IEPSPorPagar,CveRetISRConcepto,PorcentajeIVA,CveTipoConcepto,CveSubProyecto,TotalOriginal,EsImportacion" DataKeyNames="CveCompra,ImporteProgramo,Saldo,SubTotal,IVA,IVADeducible,IVANoDeducible,IEPS,RetIVA,RetISR,Original,UUID,RFC,CveFactura,SerieFolio,Descripcion,CvePrePoliza,Fecha,EstatusInventario,CveProveedor,TipoCambio,TipoCambioOriginal, CveMoneda,CveRetIVAConcepto,IVAPorPagar,IVAPorPagarDeducible,IVAPorPagarNoDeducible,IEPSPorPagar,CveRetISRConcepto,PorcentajeIVA,CveTipoConcepto,CveSubProyecto,TotalOriginal,EsImportacion"
Width="100%" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" Style="text-align: center;" GridLines="None"> Width="100%" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" Style="text-align: center;" GridLines="None">
<Columns> <Columns>
<asp:TemplateField> <asp:TemplateField>

View File

@@ -574,7 +574,6 @@ Partial Class Bancos_ProveedoresAbonar
FiltroInv = "" 'queno considera lo proporcional FiltroInv = "" 'queno considera lo proporcional
End If End If
If PorcentajeAlmacen = 0 Then ' sin recibir If PorcentajeAlmacen = 0 Then ' sin recibir
e.Row.FCLabel("LbEstatusInv").Text = "<i Class='fa fa-flag-o' aria-hidden='true'></i>" e.Row.FCLabel("LbEstatusInv").Text = "<i Class='fa fa-flag-o' aria-hidden='true'></i>"
e.Row.FCLabel("LbEstatusInv").ForeColor = Drawing.Color.Red e.Row.FCLabel("LbEstatusInv").ForeColor = Drawing.Color.Red
@@ -732,11 +731,6 @@ Partial Class Bancos_ProveedoresAbonar
ImporteSeleccionado += gvr.FCTextBox("TxtAbonar").Text.ToDecimal ImporteSeleccionado += gvr.FCTextBox("TxtAbonar").Text.ToDecimal
If gvr.DataKey("UUID") <> "" Then If gvr.DataKey("UUID") <> "" Then
'529
Valida.Verificar(gvr.DataKey("UUID"), gvr.DataKey("RFC"), UsuarioActual.Empresa.RFC, gvr.DataKey("TotalOriginal").ToDecimal) Valida.Verificar(gvr.DataKey("UUID"), gvr.DataKey("RFC"), UsuarioActual.Empresa.RFC, gvr.DataKey("TotalOriginal").ToDecimal)
If Not UsuarioActual.Empresa.FacturaProduccion OrElse UsuarioActual.CveEmpresa < 2 Then If Not UsuarioActual.Empresa.FacturaProduccion OrElse UsuarioActual.CveEmpresa < 2 Then
@@ -770,7 +764,6 @@ Partial Class Bancos_ProveedoresAbonar
ObjCompra.Dispose() ObjCompra.Dispose()
Else Else
MsgValidadas.AppendFormat("Factura Cancelada: {0} - {1} con movimientos de almacen, relacione su factura nueva para descontar saldo<br>", gvr.DataKey("SerieFolio"), gvr.DataKey("Descripcion")) MsgValidadas.AppendFormat("Factura Cancelada: {0} - {1} con movimientos de almacen, relacione su factura nueva para descontar saldo<br>", gvr.DataKey("SerieFolio"), gvr.DataKey("Descripcion"))
End If End If
Else Else
@@ -807,7 +800,7 @@ Partial Class Bancos_ProveedoresAbonar
Dim ObjMov As New ClsContabilidad(ObjIE.IniciaTransacSQL) Dim ObjMov As New ClsContabilidad(ObjIE.IniciaTransacSQL)
Dim ObjComp As New ClsCompras(ObjIE.IniciaTransacSQL) Dim ObjComp As New ClsCompras(ObjIE.IniciaTransacSQL)
Dim ObjConta As ClsContPAQi = Nothing Dim ObjConta As ClsContPAQi = Nothing
If UsuarioActual.Empresa.UsaContabilidad Then If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.UsaContabilidad Then
ObjConta = New ClsContPAQi(UsuarioActual.Empresa) ObjConta = New ClsContPAQi(UsuarioActual.Empresa)
ObjConta.IniciaTransacSQL() ObjConta.IniciaTransacSQL()
End If End If
@@ -892,7 +885,6 @@ Partial Class Bancos_ProveedoresAbonar
End If End If
Anexo.Text = "" Anexo.Text = ""
'inserto los movimientos de la conta para abonar al saldo 'inserto los movimientos de la conta para abonar al saldo
If CvePrePoliza > 0 Then If CvePrePoliza > 0 Then
@@ -935,21 +927,6 @@ Partial Class Bancos_ProveedoresAbonar
End If End If
End If End If
'If ObjIE.GetFluctuacionesBitacora(UsuarioActual.CveEmpresa) Then
' If ObjIE.DtResultados.Rows.Count > 0 Then
' Dim tFecha As Date = TxtFechaDocumento.Text.ToDate
' Dim FechaC As String = String.Format("{0}/{1}/{2}", tFecha.Year, tFecha.Month, tFecha.Day)
' Dim drr As DataRow = ObjIE.DtResultados.FiltroPrimero("Fecha < #" & FechaC & "#", "Fecha DESC")
' If drr IsNot Nothing Then
' FechaUltimaFluctuacion = drr("Fecha").ToString.ToDate
' TipoCambioFluctuacion = drr("TipoCambio").ToString.ToDecimal
' End If
' End If
'End If
Dim DttPlantilla As DataTable = Nothing Dim DttPlantilla As DataTable = Nothing
If ObjMov.GetPlantillaConceptos(UsuarioActual.CveEmpresa, CvePlantillaPoliza) Then If ObjMov.GetPlantillaConceptos(UsuarioActual.CveEmpresa, CvePlantillaPoliza) Then
DttPlantilla = ObjMov.DtResultados DttPlantilla = ObjMov.DtResultados
@@ -961,31 +938,24 @@ Partial Class Bancos_ProveedoresAbonar
For Each gvr As GridViewRow In GvCxP.Rows For Each gvr As GridViewRow In GvCxP.Rows
If gvr.FCCheckBox("Chk").Checked Then If gvr.FCCheckBox("Chk").Checked Then
Dim EsImportacion As Boolean = False Dim EsImportacion As Boolean = False
tipoCambioCompra = gvr.DataKey("TipoCambioOriginal").ToDecimal
PorcentajePago = (gvr.FCTextBox("TxtAbonar").Text.ToDecimal) / gvr.DataKey("Original").ToDecimal
tipoCambioCompraValuacion = 1
'Tipos de cambio 'Tipos de cambio
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then 'Si la venta viene en Pesos y se va a pagar en Pesos If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then 'Si la venta viene en Pesos y se va a pagar en Pesos
TipoCambioPago = 1 TipoCambioPago = 1
tipoCambioCompra = 1
PorcentajePago = gvr.FCTextBox("TxtAbonar").Text.ToDecimal / gvr.DataKey("Original").ToDecimal
ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then 'Si la venta viene en Dolares y se va a pagar en Pesos ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then 'Si la venta viene en Dolares y se va a pagar en Pesos
TipoCambioPago = TxtTC.Text.ToDecimal TipoCambioPago = TxtTC.Text.ToDecimal
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal tipoCambioCompraValuacion = If(gvr.DataKey("Fecha").ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, tipoCambioCompra)
tipoCambioCompraValuacion = If(gvr.DataKey("Fecha").ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, gvr.DataKey("TipoCambio").ToDecimal)
PorcentajePago = ((gvr.FCTextBox("TxtAbonar").Text.ToDecimal) / gvr.DataKey("Original").ToDecimal).RoundSQL
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then 'Si la venta viene en Dolares y se va a pagar en DOLARES ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then 'Si la venta viene en Dolares y se va a pagar en DOLARES
'TipoCambioPago = 'GlobalTipoCambio(TxtFechaDocumento.Text.ToDate).ToString.ToDecimal 'TipoCambioPago = 'GlobalTipoCambio(TxtFechaDocumento.Text.ToDate).ToString.ToDecimal
TipoCambioPago = TxtTCDolaresDolares.Text.ToDecimal TipoCambioPago = TxtTCDolaresDolares.Text.ToDecimal
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal tipoCambioCompraValuacion = If(gvr.DataKey("Fecha").ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, tipoCambioCompra)
tipoCambioCompraValuacion = If(gvr.DataKey("Fecha").ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, gvr.DataKey("TipoCambio").ToDecimal)
PorcentajePago = gvr.FCTextBox("TxtAbonar").Text.ToDecimal / gvr.DataKey("Original").ToDecimal
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES
TipoCambioPago = TxtTCDolares.Text.ToDecimal TipoCambioPago = TxtTCDolares.Text.ToDecimal
tipoCambioCompra = 1
PorcentajePago = (gvr.FCTextBox("TxtAbonar").Text.ToDecimal) / gvr.DataKey("Original").ToDecimal
End If End If
CveSubProyecto = gvr.DataKey("CveSubProyecto").ToEntero CveSubProyecto = gvr.DataKey("CveSubProyecto").ToEntero
'If ObjMov.GetPlantillaConceptos(UsuarioActual.CveEmpresa, CvePlantillaPoliza) Then
If DttPlantilla IsNot Nothing AndAlso DttPlantilla.Rows.Count > 0 Then If DttPlantilla IsNot Nothing AndAlso DttPlantilla.Rows.Count > 0 Then
For Each Row As DataRow In DttPlantilla.Rows For Each Row As DataRow In DttPlantilla.Rows
ConceptoContable = Row("CveConcepto").ToString.ToEntero ConceptoContable = Row("CveConcepto").ToString.ToEntero
@@ -996,7 +966,6 @@ Partial Class Bancos_ProveedoresAbonar
Referencia = gvr.DataKey("SerieFolio").ToString Referencia = gvr.DataKey("SerieFolio").ToString
Dim PorcentajeImpuesto As Decimal = 0 Dim PorcentajeImpuesto As Decimal = 0
Select Case ConceptoContable Select Case ConceptoContable
Case 17 'Pago Proveedores Case 17 'Pago Proveedores
@@ -1011,21 +980,8 @@ Partial Class Bancos_ProveedoresAbonar
End Select End Select
End If End If
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then ImporteMovimiento = gvr.FCTextBox("TxtAbonar").Text.ToDecimal.RoundSQL
ImporteMovimiento = gvr.FCTextBox("TxtAbonar").Text.ToDecimal importeMX = (gvr.FCTextBox("TxtAbonar").Text.ToDecimal * tipoCambioCompraValuacion).RoundSQL
importeMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
ImporteMovimiento = gvr.FCTextBox("TxtAbonar").Text.ToDecimal
importeMX = gvr.FCTextBox("TxtAbonar").Text.ToDecimal * tipoCambioCompraValuacion
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = gvr.FCTextBox("TxtAbonar").Text.ToDecimal
importeMX = gvr.FCTextBox("TxtAbonar").Text.ToDecimal * tipoCambioCompraValuacion
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
ImporteMovimiento = gvr.FCTextBox("TxtAbonar").Text.ToDecimal
importeMX = ImporteMovimiento * tipoCambioCompraValuacion
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
importeMX = importeMX.RoundSQL
TipoCambioGeneral = tipoCambioCompraValuacion TipoCambioGeneral = tipoCambioCompraValuacion
ConceptoMovimiento = $"{HplProveedor.Text} F:{gvr.DataKey("SerieFolio")}" ConceptoMovimiento = $"{HplProveedor.Text} F:{gvr.DataKey("SerieFolio")}"
'cuando son dolares, y tienen complementaria, se hace el registro 'cuando son dolares, y tienen complementaria, se hace el registro
@@ -1070,26 +1026,10 @@ Partial Class Bancos_ProveedoresAbonar
ConceptoContable = 285 ConceptoContable = 285
End If End If
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago).RoundSQL
ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago importeMX = (ImporteMovimiento * tipoCambioCompra).RoundSQL
importeMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago
importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago
importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago
importeMX = ImporteMovimiento * tipoCambioCompra
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
importeMX = importeMX.RoundSQL
TipoCambioGeneral = tipoCambioCompra TipoCambioGeneral = tipoCambioCompra
If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}" If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}"
'Conta ContPAQ 'Conta ContPAQ
@@ -1127,23 +1067,10 @@ Partial Class Bancos_ProveedoresAbonar
Funcionalidad = 578 Funcionalidad = 578
ConceptoContable = 286 ConceptoContable = 286
End If End If
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago).RoundSQL
importeMX = ImporteMovimiento importeMX = (ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)).RoundSQL
ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
importeMX = importeMX.RoundSQL
TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}" If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
@@ -1177,21 +1104,9 @@ Partial Class Bancos_ProveedoresAbonar
ConceptoContable = 328 ConceptoContable = 328
End If End If
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago).RoundSQL
ImporteMovimiento = gvr.DataKey("RetISR").ToDecimal * PorcentajePago importeMX = (ImporteMovimiento * tipoCambioCompra).RoundSQL
importeMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * tipoCambioCompra
End If
ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero)
importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero)
TipoCambioGeneral = tipoCambioCompra TipoCambioGeneral = tipoCambioCompra
If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}" If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}"
@@ -1221,22 +1136,8 @@ Partial Class Bancos_ProveedoresAbonar
funcionalidad = 348 funcionalidad = 348
ConceptoContable = 328 ConceptoContable = 328
End If End If
ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago).RoundSQL
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then importeMX = (ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)).RoundSQL
ImporteMovimiento = gvr.DataKey("RetISR").ToDecimal * PorcentajePago
importeMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
importeMX = importeMX.RoundSQL
TipoCambioGeneral = TipoCambioPago TipoCambioGeneral = TipoCambioPago
If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}" If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
@@ -1254,7 +1155,6 @@ Partial Class Bancos_ProveedoresAbonar
End If End If
End If End If
End If End If
Case 14 'Iva X Acreditar Case 14 'Iva X Acreditar
@@ -1263,23 +1163,8 @@ Partial Class Bancos_ProveedoresAbonar
'funcionalidad que toma el 100% del pago para acreditamiento de iva 'funcionalidad que toma el 100% del pago para acreditamiento de iva
If TotalImporte = gvr.DataKey("Saldo").ToDecimal Then If TotalImporte = gvr.DataKey("Saldo").ToDecimal Then
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then ImporteMovimiento = (gvr.DataKey("IVA").ToDecimal).RoundSQL
ImporteMovimiento = gvr.DataKey("IVA").ToDecimal importeMX = (ImporteMovimiento * tipoCambioCompra).RoundSQL
importeMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
ImporteMovimiento = gvr.DataKey("IVA").ToDecimal
importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = gvr.DataKey("IVA").ToDecimal
importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
ImporteMovimiento = gvr.DataKey("IVA").ToDecimal
importeMX = ImporteMovimiento * tipoCambioCompra
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
importeMX = importeMX.RoundSQL
If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}" If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}"
Else Else
@@ -1287,23 +1172,10 @@ Partial Class Bancos_ProveedoresAbonar
importeMX = 0 importeMX = 0
End If End If
Else Else
ImporteMovimiento = gvr.DataKey("IVA").ToDecimal * PorcentajePago ImporteMovimiento = (gvr.DataKey("IVA").ToDecimal * PorcentajePago).RoundSQL
importeMX = (ImporteMovimiento * tipoCambioCompra).RoundSQL
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
importeMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
importeMX = ImporteMovimiento * tipoCambioCompra
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
importeMX = importeMX.RoundSQL
If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}" If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}"
End If End If
TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
@@ -1330,24 +1202,10 @@ Partial Class Bancos_ProveedoresAbonar
Dim TotalImporte As Decimal = gvr.FCTextBox("TxtAbonar").Text.ToDecimal Dim TotalImporte As Decimal = gvr.FCTextBox("TxtAbonar").Text.ToDecimal
If UsuarioActual.Empresa.Funcionalidad(521) = "1" Then If UsuarioActual.Empresa.Funcionalidad(521) = "1" Then
'funcionalidad que toma el 100% del pago para acreditamiento de iva 'funcionalidad que toma el 100% del pago para acreditamiento de iva
If TotalImporte = gvr.DataKey("Saldo").ToDecimal Then If TotalImporte = gvr.DataKey("Saldo").ToDecimal Then
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then ImporteMovimiento = (gvr.DataKey("IVADeducible").ToDecimal).RoundSQL
ImporteMovimiento = gvr.DataKey("IVADeducible").ToDecimal importeMX = (ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)).RoundSQL
importeMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
ImporteMovimiento = gvr.DataKey("IVADeducible").ToDecimal
importeMX = gvr.DataKey("IVADeducible").ToDecimal * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = gvr.DataKey("IVADeducible").ToDecimal
importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
ImporteMovimiento = gvr.DataKey("IVADeducible").ToDecimal
importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
End If
ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero)
importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero)
If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}" If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
Else Else
@@ -1356,19 +1214,8 @@ Partial Class Bancos_ProveedoresAbonar
End If End If
Else Else
ImporteMovimiento = gvr.DataKey("IVADeducible").ToDecimal * PorcentajePago ImporteMovimiento = gvr.DataKey("IVADeducible").ToDecimal * PorcentajePago
importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
importeMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL ImporteMovimiento = ImporteMovimiento.RoundSQL
importeMX = importeMX.RoundSQL importeMX = importeMX.RoundSQL
@@ -1411,20 +1258,8 @@ Partial Class Bancos_ProveedoresAbonar
Case 25 'IEPS X Acreditar Case 25 'IEPS X Acreditar
Dim TotalImporte As Decimal = gvr.FCTextBox("TxtAbonar").Text.ToDecimal Dim TotalImporte As Decimal = gvr.FCTextBox("TxtAbonar").Text.ToDecimal
ImporteMovimiento = gvr.DataKey("IEPSPorPagar").ToDecimal * PorcentajePago ImporteMovimiento = (gvr.DataKey("IEPSPorPagar").ToDecimal * PorcentajePago).RoundSQL
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then importeMX = (ImporteMovimiento * tipoCambioCompra).RoundSQL
importeMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
importeMX = ImporteMovimiento * tipoCambioCompra
End If
ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero)
importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero)
TipoCambioGeneral = tipoCambioCompra TipoCambioGeneral = tipoCambioCompra
If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}" If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}"
@@ -1435,20 +1270,8 @@ Partial Class Bancos_ProveedoresAbonar
End If End If
Case 26 'IEPS Acreditable Case 26 'IEPS Acreditable
Dim TotalImporte As Decimal = gvr.FCTextBox("TxtAbonar").Text.ToDecimal Dim TotalImporte As Decimal = gvr.FCTextBox("TxtAbonar").Text.ToDecimal
ImporteMovimiento = gvr.DataKey("IEPSPorPagar").ToDecimal * PorcentajePago ImporteMovimiento = (gvr.DataKey("IEPSPorPagar").ToDecimal * PorcentajePago).RoundSQL
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then importeMX = (ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)).RoundSQL
importeMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
End If
ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero)
importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero)
TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
If ImporteMovimiento <> 0 AndAlso TipoContabilidad <> 1 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then If ImporteMovimiento <> 0 AndAlso TipoContabilidad <> 1 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
@@ -1456,6 +1279,7 @@ Partial Class Bancos_ProveedoresAbonar
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaIEPSAcreditable").ToString.ToEntero IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaIEPSAcreditable").ToString.ToEntero
End If End If
End If End If
Case 64 'Ganancia Case 64 'Ganancia
If CveMoneda <> 1 OrElse gvr.DataKey("CveMoneda").ToEntero <> 1 Then If CveMoneda <> 1 OrElse gvr.DataKey("CveMoneda").ToEntero <> 1 Then
@@ -1479,37 +1303,6 @@ Partial Class Bancos_ProveedoresAbonar
importeMX = ImporteMovimiento importeMX = ImporteMovimiento
End If End If
'' si tiene funcionalidad de flucturación con ivas, tomar tipocambioventa
'If tipoCambioPago > tipoCambioVentaDiferenciaCambiaria AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
' ImporteMovimiento = (gvr.FCTextBox("TxtAbonar").Text.ToDecimal * tipoCambioPago) - (gvr.FCTextBox("TxtAbonar").Text.ToDecimal * tipoCambioVentaDiferenciaCambiaria) 'Añadimos la diferencia de ganancia en la venta
' ImporteMovimiento -= ((gvr.DataKey("IVA").ToDecimal * PorcentajePago) * TCImpuestos) - ((gvr.DataKey("IVA").ToDecimal * PorcentajePago) * tipoCambioVentaDiferenciaCambiaria) 'Añadimos la diferencia de ganancia en el IVA
' ImporteMovimiento += ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * TCImpuestos) - ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * tipoCambioVentaDiferenciaCambiaria) 'Añadimos la diferencia de ganancia en el RetIVA
' ImporteMovimiento += ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * TCImpuestos) - ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * tipoCambioVentaDiferenciaCambiaria) 'Añadimos la diferencia de ganancia en el RetISR
' ImporteMovimiento -= ((gvr.DataKey("IEPS").ToDecimal * PorcentajePago) * TCImpuestos) - ((gvr.DataKey("IEPS").ToDecimal * PorcentajePago) * tipoCambioVentaDiferenciaCambiaria) 'Añadimos la diferencia de ganancia en el IEPS
' ImporteMovimiento = Math.Abs(Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero))
' importeMX = ImporteMovimiento
'End If
'Dim TotalImporte As Decimal = gvr.FCTextBox("TxtAbonar").Text.ToDecimal
''Dim IVA As Decimal = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal, gvr.DataKey("IVAPorPagar").ToDecimal, gvr.DataKey("IVA").ToDecimal * PorcentajePago)
'Dim IVA As Decimal = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal AndAlso Math.Abs(Math.Round(gvr.DataKey("IVAPorPagar").ToDecimal - (gvr.DataKey("IVA").ToDecimal * PorcentajePago), 2)) <= 0.02, gvr.DataKey("IVAPorPagar").ToDecimal, gvr.DataKey("IVA").ToDecimal * PorcentajePago)
'Dim IEPS As Decimal = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal AndAlso Math.Abs(Math.Round(gvr.DataKey("IEPSPorPagar").ToDecimal - (gvr.DataKey("IEPS").ToDecimal * PorcentajePago), 2)) <= 0.02, gvr.DataKey("IEPSPorPagar").ToDecimal, gvr.DataKey("IEPS").ToDecimal * PorcentajePago) 'If(TotalImporte = gvr.DataKey("Saldo").ToDecimal, gvr.DataKey("IEPSPorPagar").ToDecimal, gvr.DataKey("IEPS").ToDecimal * PorcentajePago)
'IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria
'Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompraValuacion)
'TipoCambioGeneral = TCImpuestos
'''' si tiene funcionalidad de flucturación con ivas, tomar tipocambioCompra
'If TipoCambioPago < tipoCambioCompra AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
' ImporteMovimiento = (gvr.FCTextBox("TxtAbonar").Text.ToDecimal * TipoCambioPago) - (gvr.FCTextBox("TxtAbonar").Text.ToDecimal * tipoCambioCompra) 'Añadimos la diferencia de ganancia en la venta
' ImporteMovimiento -= (IVA * TCImpuestos) - (IVA * tipoCambioCompra) 'Añadimos la diferencia de ganancia en el IVA
' ImporteMovimiento += ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * TCImpuestos) - ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * tipoCambioCompra) 'Añadimos la diferencia de ganancia en el RetIVA
' ImporteMovimiento += ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * TCImpuestos) - ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * tipoCambioCompra) 'Añadimos la diferencia de ganancia en el RetISR
' ImporteMovimiento -= (IEPS * TCImpuestos) - (IEPS * tipoCambioCompra) 'Añadimos la diferencia de ganancia en el IEPS
' ImporteMovimiento = Math.Abs(Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero))
' importeMX = ImporteMovimiento
'End If
Else Else
ImporteMovimiento = 0 ImporteMovimiento = 0
End If End If
@@ -1531,23 +1324,6 @@ Partial Class Bancos_ProveedoresAbonar
ImporteMovimiento = Math.Abs(Diferencia) ImporteMovimiento = Math.Abs(Diferencia)
importeMX = ImporteMovimiento importeMX = ImporteMovimiento
End If End If
'Dim TotalImporte As Decimal = gvr.FCTextBox("TxtAbonar").Text.ToDecimal
'Dim IVA As Decimal = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal AndAlso Math.Abs(Math.Round(gvr.DataKey("IVAPorPagar").ToDecimal - (gvr.DataKey("IVA").ToDecimal * PorcentajePago), 2)) <= 0.02, gvr.DataKey("IVAPorPagar").ToDecimal, gvr.DataKey("IVA").ToDecimal * PorcentajePago)
'Dim IEPS As Decimal = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal AndAlso Math.Abs(Math.Round(gvr.DataKey("IEPSPorPagar").ToDecimal - (gvr.DataKey("IEPS").ToDecimal * PorcentajePago), 2)) <= 0.02, gvr.DataKey("IEPSPorPagar").ToDecimal, gvr.DataKey("IEPS").ToDecimal * PorcentajePago) 'If(TotalImporte = gvr.DataKey("Saldo").ToDecimal, gvr.DataKey("IEPSPorPagar").ToDecimal, gvr.DataKey("IEPS").ToDecimal * PorcentajePago)
'IdCtaContable = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria
'Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompraValuacion)
'' si tiene funcionalidad de flucturación con ivas, tomar tipocambioCompra
'If TipoCambioPago > tipoCambioCompra AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
' ImporteMovimiento = (gvr.FCTextBox("TxtAbonar").Text.ToDecimal * tipoCambioCompra) - (gvr.FCTextBox("TxtAbonar").Text.ToDecimal * TipoCambioPago) 'Añadimos la diferencia de ganancia en la venta
' ImporteMovimiento -= (IVA * tipoCambioCompra) - (IVA * TCImpuestos) 'Añadimos la diferencia de ganancia en el IVA
' ImporteMovimiento += ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * tipoCambioCompra) - ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetIVA
' ImporteMovimiento += ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * tipoCambioCompra) - ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetISR
' ImporteMovimiento -= (IEPS * tipoCambioCompra) - (IEPS * TCImpuestos) 'Añadimos la diferencia de ganancia en el IEPS
' ImporteMovimiento = Math.Abs(Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero))
' importeMX = ImporteMovimiento
'End If
Else Else
ImporteMovimiento = 0 ImporteMovimiento = 0
End If End If
@@ -1645,8 +1421,6 @@ Partial Class Bancos_ProveedoresAbonar
ObjComp.ProgramarCompra(gvr.DataKey("CveCompra").ToEntero, 0, UsuarioActual.CveUsuario, -1) ObjComp.ProgramarCompra(gvr.DataKey("CveCompra").ToEntero, 0, UsuarioActual.CveUsuario, -1)
End If End If
' End If
End If End If
Next Next
ConceptoMovimiento = $"{TxtPagueseA.Text.Trim} - {TxtObservaciones.Text} {If(TipoCambioPago > 1, $" TC:{TipoCambioPago}", "")}" ConceptoMovimiento = $"{TxtPagueseA.Text.Trim} - {TxtObservaciones.Text} {If(TipoCambioPago > 1, $" TC:{TipoCambioPago}", "")}"
@@ -1816,7 +1590,6 @@ Partial Class Bancos_ProveedoresAbonar
Exit For Exit For
Else Else
'IVA. siempre se registra aunque sea cero 'IVA. siempre se registra aunque sea cero
If MsgError = "" Then If MsgError = "" Then

View File

@@ -9132,18 +9132,16 @@ Partial Class Compras_Compras
If UsuarioActual.Empresa.Funcionalidad(521) = "1" Then If UsuarioActual.Empresa.Funcionalidad(521) = "1" Then
If sumaAmortizacion = CompraSaldo Then If sumaAmortizacion = CompraSaldo Then
ImporteMovimiento = TxtIVA.Text.ToDecimal ImporteMovimiento = TxtIVA.Text.ToDecimal
If ImporteMovimiento > 0 Then If ImporteMovimiento > 0 Then
IVACompleto = True IVACompleto = True
End If End If
Else Else
ImporteMovimiento = 0 ImporteMovimiento = 0
End If End If
Else Else
ImporteMovimiento = Math.Round(PorcentajePago * TxtIVA.Text.ToDecimal, 2) ImporteMovimiento = Math.Round(PorcentajePago * TxtIVA.Text.ToDecimal, 2)
End If End If
importeMN = ImporteMovimiento * tipoCambio importeMN = ImporteMovimiento * tipoCambioNC
PorcentajeImpuesto = TmpDT.MAX("IVAPorcentaje").ToDecimal PorcentajeImpuesto = TmpDT.MAX("IVAPorcentaje").ToDecimal
IdCtaContable = If(IdCtaIVAXAcreditar > 0, IdCtaIVAXAcreditar, 0) IdCtaContable = If(IdCtaIVAXAcreditar > 0, IdCtaIVAXAcreditar, 0)
@@ -9157,31 +9155,6 @@ Partial Class Compras_Compras
End If End If
End If End If
End If End If
'Case 287 'Iva X Acreditar importacion
' If Not gvr.DataKey("TipoDocto").Contiene("NC", "DEV", "Ant") AndAlso chkImportacion.checked Then
' If UsuarioActual.Empresa.Funcionalidad(521) = "1" Then
' If sumaAmortizacion = CompraSaldo Then
' ImporteMovimiento = TxtIVA.Text.ToDecimal
' If ImporteMovimiento > 0 Then
' IVACompleto = True
' End If
' Else
' ImporteMovimiento = 0
' End If
' Else
' ImporteMovimiento = Math.Round(PorcentajePago * TxtIVA.Text.ToDecimal, 2)
' End If
' importeMN = ImporteMovimiento * tipoCambio
' PorcentajeImpuesto = TmpDT.MAX("IVAPorcentaje").ToDecimal
' IdCtaContable = If(IdCtaIVAXAcreditar > 0, IdCtaIVAXAcreditar, 0)
' 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
' End If
' End If
' End If
Case 19 'Iva Acreditado Case 19 'Iva Acreditado
@@ -9196,7 +9169,7 @@ Partial Class Compras_Compras
Else Else
ImporteMovimiento = Math.Round(PorcentajePago * TxtIVA.Text.ToDecimal, 2) ImporteMovimiento = Math.Round(PorcentajePago * TxtIVA.Text.ToDecimal, 2)
End If End If
importeMN = ImporteMovimiento * tipoCambio importeMN = ImporteMovimiento * tipoCambioNC
PorcentajeImpuesto = TmpDT.MAX("IVAPorcentaje").ToDecimal PorcentajeImpuesto = TmpDT.MAX("IVAPorcentaje").ToDecimal
IdCtaContable = If(IdCtaIVAAcreditable > 0, IdCtaIVAAcreditable, 0) IdCtaContable = If(IdCtaIVAAcreditable > 0, IdCtaIVAAcreditable, 0)
@@ -9246,7 +9219,7 @@ Partial Class Compras_Compras
End If End If
ImporteMovimiento = Math.Round(PorcentajePago * TxtRetIVA.Text.ToDecimal, 2) ImporteMovimiento = Math.Round(PorcentajePago * TxtRetIVA.Text.ToDecimal, 2)
importeMN = ImporteMovimiento * tipoCambio importeMN = ImporteMovimiento * tipoCambioNC
If CtaProveedorRetIVA > 0 Then If CtaProveedorRetIVA > 0 Then
@@ -9261,20 +9234,9 @@ Partial Class Compras_Compras
End If End If
End If End If
'If UsuarioActual.Empresa.Funcionalidad(577).ToEntero = 1 Then
' IdCtaContable = UsuarioActual.Empresa.Funcionalidad(578).ToEntero
'End If
'If DdlRetIVAConcepto.SelectedValue.ToEntero = 5 Then
' IdCtaContable = UsuarioActual.Empresa.Funcionalidad(578).ToEntero
'End If
End If End If
End If End If
Case 183 'RetIVA x Acreditar Fletes P.F. Case 183 'RetIVA x Acreditar Fletes P.F.
If Not gvr.DataKey("TipoDocto").Contiene("NC", "DEV", "Ant") Then If Not gvr.DataKey("TipoDocto").Contiene("NC", "DEV", "Ant") Then
If DdlRetIVAConcepto.Items.Count > 0 Then If DdlRetIVAConcepto.Items.Count > 0 Then
@@ -9484,9 +9446,6 @@ Partial Class Compras_Compras
importeMN = ImporteMovimiento importeMN = ImporteMovimiento
End If End If
If ImporteMovimiento <> 0 Then If ImporteMovimiento <> 0 Then
Dim CveSubProyecto64 As Integer = TmpDT.FiltroPrimeroValor("CveSubProyecto", " CveSubProyecto > 0").ToEntero Dim CveSubProyecto64 As Integer = TmpDT.FiltroPrimeroValor("CveSubProyecto", " CveSubProyecto > 0").ToEntero
@@ -9532,7 +9491,7 @@ Partial Class Compras_Compras
End If End If
If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, ImporteMovimiento, Concepto, ConceptoContable, Concepto, Fecha, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=importeMN, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=If(tipoCambio = 1, 0, ImporteMovimiento), PorcentajeImpuesto:=PorcentajeImpuesto) Then If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, ImporteMovimiento, Concepto, ConceptoContable, Concepto, Fecha, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=importeMN, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=If(tipoCambio = 1, 0, ImporteMovimiento), PorcentajeImpuesto:=PorcentajeImpuesto, TipoCambio:=tipoCambioNC) Then
ErrorMovtosCxP = 1 ErrorMovtosCxP = 1
Exit For Exit For
End If End If

View File

@@ -1579,6 +1579,7 @@ Partial Class ContabilidadC_RegPrePolizaS
If DrConceptoContable IsNot Nothing Then If DrConceptoContable IsNot Nothing Then
Dim AplicaComplementaria = Boolean.Parse(DrConceptoContable("EsComplementaria").ToString) Dim AplicaComplementaria = Boolean.Parse(DrConceptoContable("EsComplementaria").ToString)
Dim AplicaBancos = Boolean.Parse(DrConceptoContable("AplicaBancos").ToString)
If AplicaComplementaria Then If AplicaComplementaria Then
Dim Importe As Decimal = IIf(TxtCargoE.Text.ToDecimal <> 0, TxtCargoE.Text.ToDecimal, TxtAbonoE.Text.ToDecimal) Dim Importe As Decimal = IIf(TxtCargoE.Text.ToDecimal <> 0, TxtCargoE.Text.ToDecimal, TxtAbonoE.Text.ToDecimal)
@@ -1593,6 +1594,13 @@ Partial Class ContabilidadC_RegPrePolizaS
End If End If
End If End If
If AplicaBancos Then
If DdlModalConceptoTipoTransaccion.SelectedValue.ToEntero <= 0 Then
Alert("seleccione las opciones de bancos ")
Retorno = False
End If
End If
End If End If
Return Retorno Return Retorno
End Function End Function
@@ -2290,8 +2298,6 @@ Partial Class ContabilidadC_RegPrePolizaS
DtMovimientos.Clear() DtMovimientos.Clear()
Dim ObjConta As New ClsContabilidad()
ObjConta.IniciaTransacSQL()
Try Try
Dim ContadorRegistros As Integer = 2 Dim ContadorRegistros As Integer = 2
@@ -2449,16 +2455,15 @@ Partial Class ContabilidadC_RegPrePolizaS
DtMovimientos.AcceptChanges() DtMovimientos.AcceptChanges()
End If End If
ContadorRegistros = ContadorRegistros + 1 ContadorRegistros = ContadorRegistros + 1
Next Next
TxtTotalCargos.Text = DtMovimientos.SUMD("Cargo").ToString.FormatoNumero
TxtTotalAbonos.Text = DtMovimientos.SUMD("Abono").ToString.FormatoNumero
GvPrePoliza.DataSource = DtMovimientos GvPrePoliza.DataSource = DtMovimientos
GvPrePoliza.DataBind() GvPrePoliza.DataBind()
UpPrePoliza.Update() UpPrePoliza.Update()
TxtTotalCargos.Text = DtMovimientos.SUMD("Cargo").ToString.FormatoNumero
TxtTotalAbonos.Text = DtMovimientos.SUMD("Abono").ToString.FormatoNumero
Catch ex As Exception Catch ex As Exception
Alert("No se pudo cargar el excel", TipoMensaje.MsgAdvertencia) Alert("No se pudo cargar el excel", TipoMensaje.MsgAdvertencia)
GuardaLog(ex.Message) GuardaLog(ex.Message)

View File

@@ -156,7 +156,7 @@ Partial Class Inicio
LtlTitulo.Text = "Sistema Integral de Información Gluyas" LtlTitulo.Text = "Sistema Integral de Información Gluyas"
End If End If
If UsuarioActual.Empresa.UsaContabilidad Then If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.UsaContabilidad Then
Dim ObjPolizas As New ClsContPAQi(UsuarioActual.Empresa) Dim ObjPolizas As New ClsContPAQi(UsuarioActual.Empresa)
If ObjPolizas.GetPolizasCuadre() And ObjPolizas.DtResultados.Rows.Count > 0 Then If ObjPolizas.GetPolizasCuadre() And ObjPolizas.DtResultados.Rows.Count > 0 Then
Dim ObjNotificacion = ItemNotificaciones(String.Format("Polizas de cuadre {0}", ObjPolizas.DtResultados.Rows.Count), Ico:="icon-calculator", Tipo:="warning", Link:="/Contabilidad/RepPolizasCuadre.aspx") Dim ObjNotificacion = ItemNotificaciones(String.Format("Polizas de cuadre {0}", ObjPolizas.DtResultados.Rows.Count), Ico:="icon-calculator", Tipo:="warning", Link:="/Contabilidad/RepPolizasCuadre.aspx")

View File

@@ -2330,7 +2330,7 @@ Partial Class Inventarios_EntregaAlmacen
Dim PU As Decimal = RowGarantia("Importe").ToString().ToDecimal() ' / RowGarantia("Cantidad").ToString().ToDouble() Dim PU As Decimal = RowGarantia("Importe").ToString().ToDecimal() ' / RowGarantia("Cantidad").ToString().ToDouble()
Dim Serie As String = RowGarantia("Comprobante").ToString Dim Serie As String = RowGarantia("Comprobante").ToString
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoGarantia, RowGarantia("Cantidad").ToString().ToDouble(), CveUM, CvePS, PU, Serie:=Serie, CveVentaDetalle:=RowGarantia("CveVentaDetalle").ToString.ToEntero) Then If Not ObjInventario.AddMovimientoDetalle(CveMovimientoGarantia, RowGarantia("Cantidad").ToString().ToDouble(), CveUM, CvePS, PU, Serie:=Serie, CveVentaDetalle:=IIf(RowGarantia("MismoCvePS").ToString = "1", RowGarantia("CveVentaDetalle"), -1).ToString.ToEntero) Then
ErrorMovInv = True ErrorMovInv = True
TextoError.AppendFormat("Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar.") TextoError.AppendFormat("Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar.")
Exit For Exit For
@@ -2430,8 +2430,9 @@ Partial Class Inventarios_EntregaAlmacen
ConceptoMovimiento = If(CveAlmacenTraspasoDestino > 0, 8, ConceptoMovimiento) ConceptoMovimiento = If(CveAlmacenTraspasoDestino > 0, 8, ConceptoMovimiento)
Dim Almacen1 As Integer = DdlAlmacen.SelectedValue.ToEntero() Dim Almacen1 As Integer = DdlAlmacen.SelectedValue.ToEntero()
Dim tCveAlmacenTraspasoDestino As Integer = CveAlmacenTraspasoDestino
If TipoDocto = "Rem" AndAlso CveAlmacenTraspasoDestino = 0 Then If TipoDocto = "Rem" AndAlso tCveAlmacenTraspasoDestino = 0 Then
ErrorMovInv = True ErrorMovInv = True
TextoError.AppendFormat("Ocurrió un error. no se tiene definido el almacen destino") TextoError.AppendFormat("Ocurrió un error. no se tiene definido el almacen destino")
End If End If
@@ -2440,14 +2441,14 @@ Partial Class Inventarios_EntregaAlmacen
If TipoMovimiento = 2 And TipoDocto = "Rem" Then If TipoMovimiento = 2 And TipoDocto = "Rem" Then
ConceptoMovimiento = 8 ConceptoMovimiento = 8
Almacen1 = CveAlmacenTraspasoDestino Almacen1 = CveAlmacenTraspasoDestino
CveAlmacenTraspasoDestino = DdlAlmacen.SelectedValue.ToEntero() tCveAlmacenTraspasoDestino = DdlAlmacen.SelectedValue.ToEntero()
End If End If
'CANCELACION DE DEVOLUCION 'CANCELACION DE DEVOLUCION
If TipoMovimiento = 2 And TipoDocto = "Dev" And EsDevolucionVenta = 1 Then If TipoMovimiento = 2 And TipoDocto = "Dev" And EsDevolucionVenta = 1 Then
ConceptoMovimiento = 3 ConceptoMovimiento = 3
Almacen1 = DdlAlmacen.SelectedValue.ToEntero() Almacen1 = DdlAlmacen.SelectedValue.ToEntero()
CveAlmacenTraspasoDestino = DdlAlmacen.SelectedValue.ToEntero() tCveAlmacenTraspasoDestino = DdlAlmacen.SelectedValue.ToEntero()
End If End If
'DEVOLUCION DIRECTA A ENTREGA POR ADELANTADO 'DEVOLUCION DIRECTA A ENTREGA POR ADELANTADO
@@ -2456,7 +2457,7 @@ Partial Class Inventarios_EntregaAlmacen
End If End If
CveMovimiento = ObjInventario.AddMovimiento(Almacen1, ConceptoMovimiento, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text, CveMovimiento = ObjInventario.AddMovimiento(Almacen1, ConceptoMovimiento, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text,
CveContrato:=CveContrato, CveAlmacenDestino:=CveAlmacenTraspasoDestino, Modulo:="RE/G7") CveContrato:=CveContrato, CveAlmacenDestino:=tCveAlmacenTraspasoDestino, Modulo:="RE/G7")
Folio = ObjInventario.Folio Folio = ObjInventario.Folio
'SALIDA DE ALMACEN - SALIDA POR TRASPASO CUANDO ES REMISION - DEVOLUCION (SI ES TRASPASO Y TIENE CONTRATO NO HACE DEVOLUCIóN) 'SALIDA DE ALMACEN - SALIDA POR TRASPASO CUANDO ES REMISION - DEVOLUCION (SI ES TRASPASO Y TIENE CONTRATO NO HACE DEVOLUCIóN)
@@ -2555,8 +2556,8 @@ Partial Class Inventarios_EntregaAlmacen
'ENTRADA POR TRASPASO CUANDO ES REMISION 'ENTRADA POR TRASPASO CUANDO ES REMISION
If Not ErrorMovInv Then If Not ErrorMovInv Then
If CveAlmacenTraspasoDestino > 0 AndAlso Not (TipoMovimiento = 2 And TipoDocto = "Dev" And EsDevolucionVenta = 1) Then ' TRASPASO CUANDO ES REMISION If tCveAlmacenTraspasoDestino > 0 AndAlso Not (TipoMovimiento = 2 And TipoDocto = "Dev" And EsDevolucionVenta = 1) Then ' TRASPASO CUANDO ES REMISION
CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacenTraspasoDestino, 9, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveMovimientoEntrada = ObjInventario.AddMovimiento(tCveAlmacenTraspasoDestino, 9, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text, CveContrato:=CveContrato,
CveMovimientoRelacionado:=CveMovimiento, CveAlmacenDestino:=DdlAlmacen.SelectedValue.ToEntero(), Modulo:="RE/G8") CveMovimientoRelacionado:=CveMovimiento, CveAlmacenDestino:=DdlAlmacen.SelectedValue.ToEntero(), Modulo:="RE/G8")
FolioEntrada = ObjInventario.Folio FolioEntrada = ObjInventario.Folio
Dim ImporteAlmacen As Decimal = 0 Dim ImporteAlmacen As Decimal = 0

View File

@@ -284,7 +284,7 @@ Partial Class CatMetasVendedores
Dim Correcto As Boolean = True Dim Correcto As Boolean = True
ObjMetas.IniciaTransacSQL() ObjMetas.IniciaTransacSQL()
Try Try
Dim DtVendedores As DataTable = GlobalDTVendedores(UsuarioActual.CveEmpresa) Dim DtVendedores As DataTable = GlobalDTVendedores(UsuarioActual.CveEmpresa, Estatus:=-1, VendedorTipo:=-1)
Dim DtClasificaciones As DataTable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) Dim DtClasificaciones As DataTable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa)
Dim DtClasificaciones2 As DataTable = GlobalDTClasificaciones2(UsuarioActual.CveEmpresa) Dim DtClasificaciones2 As DataTable = GlobalDTClasificaciones2(UsuarioActual.CveEmpresa)
@@ -293,7 +293,7 @@ Partial Class CatMetasVendedores
If Correcto Then If Correcto Then
Dim TieneError As Boolean = False Dim TieneError As Boolean = False
Dim CveVendedor As Integer = DtVendedores.FiltroPrimeroValor("CveVendedor", String.Format("trim(Vendedor) LIKE '%{0}%'", row("Vendedor").ToString().TrimStart().TrimEnd())).ToEntero Dim CveVendedor As Integer = DtVendedores.FiltroPrimeroValor("CveVendedor", String.Format("trim(Vendedor) LIKE '%{0}%'", row("Vendedor").ToString().TrimStart().TrimEnd().ToUpper)).ToEntero
Dim CveClasificacion As Integer = DtClasificaciones.FiltroPrimeroValor("CveClasificacion", String.Format("trim(Clasificacion)='{0}'", row("Clasificación Superior").ToString().TrimStart().TrimEnd())).ToEntero Dim CveClasificacion As Integer = DtClasificaciones.FiltroPrimeroValor("CveClasificacion", String.Format("trim(Clasificacion)='{0}'", row("Clasificación Superior").ToString().TrimStart().TrimEnd())).ToEntero
Dim CveClasificacion2 As Integer = DtClasificaciones2.FiltroPrimeroValor("CveClasificacion", String.Format("trim(Clasificacion)='{0}'", row("Clasificación").ToString().TrimStart().TrimEnd())).ToEntero Dim CveClasificacion2 As Integer = DtClasificaciones2.FiltroPrimeroValor("CveClasificacion", String.Format("trim(Clasificacion)='{0}'", row("Clasificación").ToString().TrimStart().TrimEnd())).ToEntero
Dim CveMarca As Integer = DtMarcas.FiltroPrimeroValor("CveMarca", String.Format("Marca='{0}'", row("Marca").ToString().TrimStart().TrimEnd())).ToEntero Dim CveMarca As Integer = DtMarcas.FiltroPrimeroValor("CveMarca", String.Format("Marca='{0}'", row("Marca").ToString().TrimStart().TrimEnd())).ToEntero
@@ -309,6 +309,8 @@ Partial Class CatMetasVendedores
If Correcto Then If Correcto Then
RowsCargados += 1 RowsCargados += 1
End If End If
Else
Correcto = False
End If End If
If Not Correcto Then If Not Correcto Then
@@ -318,7 +320,7 @@ Partial Class CatMetasVendedores
Next Next
Catch ex As Exception Catch ex As Exception
OnError("Ocurrió un error al cargar los precios.", ex) OnError("Ocurrió un error al cargar las metas.", ex)
Finally Finally
Dim MensajeFinal As New StringBuilder() Dim MensajeFinal As New StringBuilder()

View File

@@ -1082,7 +1082,7 @@ Partial Class Ventas_ClientesAbonar
Exit Select Exit Select
End If End If
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago * tipoCambioVenta).RoundSQL ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago).RoundSQL
ImporteMN = (ImporteMovimiento * tipoCambioVenta).RoundSQL ImporteMN = (ImporteMovimiento * tipoCambioVenta).RoundSQL
TipoCambioGeneral = tipoCambioVenta TipoCambioGeneral = tipoCambioVenta
CveSubProyectoContabilizar = CveSubProyecto CveSubProyectoContabilizar = CveSubProyecto
@@ -1104,7 +1104,7 @@ Partial Class Ventas_ClientesAbonar
If EsAnticipoEspecial Then Exit Select If EsAnticipoEspecial Then Exit Select
If gvr.DataKey("CveTipoRetencion").ToEntero = 4 Then If gvr.DataKey("CveTipoRetencion").ToEntero = 4 Then
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago * tipoCambioVenta).RoundSQL ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago).RoundSQL
ImporteMN = (ImporteMovimiento * tipoCambioVenta).RoundSQL ImporteMN = (ImporteMovimiento * tipoCambioVenta).RoundSQL
TipoCambioGeneral = tipoCambioVenta TipoCambioGeneral = tipoCambioVenta
CveSubProyectoContabilizar = CveSubProyecto CveSubProyectoContabilizar = CveSubProyecto
@@ -1125,7 +1125,7 @@ Partial Class Ventas_ClientesAbonar
Case 9 'Ret ISR x Trasladar Case 9 'Ret ISR x Trasladar
If EsAnticipoEspecial Then Exit Select If EsAnticipoEspecial Then Exit Select
ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago * tipoCambioVenta).RoundSQL ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago).RoundSQL
ImporteMN = (ImporteMovimiento * tipoCambioVenta).RoundSQL ImporteMN = (ImporteMovimiento * tipoCambioVenta).RoundSQL
TipoCambioGeneral = tipoCambioVenta TipoCambioGeneral = tipoCambioVenta
CveSubProyectoContabilizar = CveSubProyecto CveSubProyectoContabilizar = CveSubProyecto
@@ -1147,7 +1147,7 @@ Partial Class Ventas_ClientesAbonar
Case 13 'Iva por Trasladar Case 13 'Iva por Trasladar
If EsAnticipoEspecial Then Exit Select If EsAnticipoEspecial Then Exit Select
ImporteMovimiento = (gvr.DataKey("IVA").ToDecimal * PorcentajePago * tipoCambioVenta).RoundSQL ImporteMovimiento = (gvr.DataKey("IVA").ToDecimal * PorcentajePago).RoundSQL
ImporteMN = (ImporteMovimiento * tipoCambioVenta).RoundSQL ImporteMN = (ImporteMovimiento * tipoCambioVenta).RoundSQL
TipoCambioGeneral = tipoCambioVenta TipoCambioGeneral = tipoCambioVenta
CveSubProyectoContabilizar = CveSubProyecto CveSubProyectoContabilizar = CveSubProyecto
@@ -1167,7 +1167,7 @@ Partial Class Ventas_ClientesAbonar
Exit Select Exit Select
End If End If
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago * tipoCambioVenta).RoundSQL ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago).RoundSQL
ImporteMN = (ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)).RoundSQL ImporteMN = (ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)).RoundSQL
TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta) TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)
CveSubProyectoContabilizar = CveSubProyecto CveSubProyectoContabilizar = CveSubProyecto
@@ -1188,7 +1188,7 @@ Partial Class Ventas_ClientesAbonar
If EsAnticipoEspecial Then Exit Select If EsAnticipoEspecial Then Exit Select
If gvr.DataKey("CveTipoRetencion").ToEntero = 4 Then If gvr.DataKey("CveTipoRetencion").ToEntero = 4 Then
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago * tipoCambioVenta).RoundSQL ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago).RoundSQL
ImporteMN = (ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)).RoundSQL ImporteMN = (ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)).RoundSQL
TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta) TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)
CveSubProyectoContabilizar = CveSubProyecto CveSubProyectoContabilizar = CveSubProyecto
@@ -1207,7 +1207,7 @@ Partial Class Ventas_ClientesAbonar
Case 63 'Ret ISR Trasladado Case 63 'Ret ISR Trasladado
If EsAnticipoEspecial Then Exit Select If EsAnticipoEspecial Then Exit Select
ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago * tipoCambioVenta).RoundSQL ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago).RoundSQL
ImporteMN = (ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)).RoundSQL ImporteMN = (ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)).RoundSQL
TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta) TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)
CveSubProyectoContabilizar = CveSubProyecto CveSubProyectoContabilizar = CveSubProyecto
@@ -1229,7 +1229,7 @@ Partial Class Ventas_ClientesAbonar
Case 61 'Iva Trasladado Case 61 'Iva Trasladado
If EsAnticipoEspecial Then Exit Select If EsAnticipoEspecial Then Exit Select
ImporteMovimiento = (gvr.DataKey("IVA").ToDecimal * PorcentajePago * tipoCambioVenta).RoundSQL ImporteMovimiento = (gvr.DataKey("IVA").ToDecimal * PorcentajePago).RoundSQL
ImporteMN = (ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)).RoundSQL ImporteMN = (ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)).RoundSQL
TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta) TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)
CveSubProyectoContabilizar = CveSubProyecto CveSubProyectoContabilizar = CveSubProyecto
@@ -1246,7 +1246,7 @@ Partial Class Ventas_ClientesAbonar
Case 38 'IEPS por trasladar Case 38 'IEPS por trasladar
If EsAnticipoEspecial Then Exit Select If EsAnticipoEspecial Then Exit Select
ImporteMovimiento = (gvr.DataKey("IEPS").ToDecimal * PorcentajePago * tipoCambioVenta).RoundSQL ImporteMovimiento = (gvr.DataKey("IEPS").ToDecimal * PorcentajePago).RoundSQL
ImporteMN = (ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)).RoundSQL ImporteMN = (ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)).RoundSQL
TipoCambioGeneral = tipoCambioVenta TipoCambioGeneral = tipoCambioVenta
CveSubProyectoContabilizar = CveSubProyecto CveSubProyectoContabilizar = CveSubProyecto
@@ -1255,7 +1255,7 @@ Partial Class Ventas_ClientesAbonar
Case 39 'IEPS Trasladado Case 39 'IEPS Trasladado
If EsAnticipoEspecial Then Exit Select If EsAnticipoEspecial Then Exit Select
ImporteMovimiento = (gvr.DataKey("IEPS").ToDecimal * PorcentajePago * tipoCambioVenta).RoundSQL ImporteMovimiento = (gvr.DataKey("IEPS").ToDecimal * PorcentajePago).RoundSQL
ImporteMN = (ImporteMovimiento * tipoCambioVenta).RoundSQL ImporteMN = (ImporteMovimiento * tipoCambioVenta).RoundSQL
TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta) TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)

View File

@@ -110,7 +110,7 @@
<label class="col-md-1 text-right">Categoria: </label> <label class="col-md-1 text-right">Categoria: </label>
<div class="col-md-3"> <div class="col-md-3">
<asp:DropDownList ID="DdlCategoria" runat="server" Class="table-group-action-input form-control input-inline input-sm select2me" Width="50%" DataValueField="CveCategoria" DataTextField="Categoria"></asp:DropDownList> <asp:DropDownList ID="DdlCategoria" runat="server" Class="table-group-action-input form-control input-inline input-sm select2me" Width="50%" DataValueField="CveCategoria" DataTextField="Categoria" AutoPostBack="true"></asp:DropDownList>
</div> </div>
<label class="col-md-1 text-right">Clasificaciones: </label> <label class="col-md-1 text-right">Clasificaciones: </label>
<div class="col-md-3"> <div class="col-md-3">
@@ -118,7 +118,7 @@
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<label class="col-md-1 text-right">Sub Clasificaciones: </label> <label class="col-md-1 text-right">Sub Clasif: </label>
<div class="col-md-3"> <div class="col-md-3">
<asp:DropDownList ID="DdlClasificacion2" runat="server" Class="table-group-action-input form-control input-inline input-sm select2me" Width="50%" DataValueField="CveClasificacion" DataTextField="Clasificacion"></asp:DropDownList> <asp:DropDownList ID="DdlClasificacion2" runat="server" Class="table-group-action-input form-control input-inline input-sm select2me" Width="50%" DataValueField="CveClasificacion" DataTextField="Clasificacion"></asp:DropDownList>
</div> </div>
@@ -130,6 +130,17 @@
<div class="col-md-3"> <div class="col-md-3">
<asp:DropDownList ID="DdlMarcaFiltro" runat="server" DataTextField="Marca" DataValueField="CveMarca" Class="table-group-action-input form-control input-inline input-sm select2me" Width="50%"></asp:DropDownList> <asp:DropDownList ID="DdlMarcaFiltro" runat="server" DataTextField="Marca" DataValueField="CveMarca" Class="table-group-action-input form-control input-inline input-sm select2me" Width="50%"></asp:DropDownList>
</div> </div>
</div>
<div class="row">
<label title="Distr" data-toggle="tooltip" class="col-md-1 truncate">Distribuidor:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlDistribuidor" runat="server" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
<asp:ListItem Text="Distribuidor" Value="1"></asp:ListItem>
<asp:ListItem Text="No Distribuidor" Value="0"></asp:ListItem>
</asp:DropDownList>
</div>
</div> </div>
<div id="DivFamiliaSubFamilia" class="row" runat="server" visible="false"> <div id="DivFamiliaSubFamilia" class="row" runat="server" visible="false">
</div> </div>
@@ -159,7 +170,7 @@
%Inte %Inte
</HeaderTemplate> </HeaderTemplate>
<ItemTemplate> <ItemTemplate>
<asp:Label ID="lblRealMesPorcentaje" runat="server" Target="_blank" Text='<%# Eval("RealMesPorcentaje").ToString() %>'> </asp:Label> <asp:Label ID="lblRealMesPorcentaje" runat="server" Target="_blank" Text='<%# Eval("RealMesPorcentaje", "{0:#,###}").ToString() %>'> </asp:Label>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Center"> <asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Center">
@@ -207,7 +218,7 @@
%Inte %Inte
</HeaderTemplate> </HeaderTemplate>
<ItemTemplate> <ItemTemplate>
<asp:Label ID="lblRealAcumuladoPorcentaje" runat="server" Target="_blank" Text='<%# Eval("RealAcumuladoPorcentaje").ToString() %>'> </asp:Label> <asp:Label ID="lblRealAcumuladoPorcentaje" runat="server" Target="_blank" Text='<%# Eval("RealAcumuladoPorcentaje", "{0:###.###}").ToString() %>'> </asp:Label>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Center"> <asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Center">

View File

@@ -16,7 +16,7 @@ Partial Class MetasVendedores
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then If Not IsPostBack Then
CargaDatosFiltros() CargaDatosFiltros()
CargarDatosReporte()
End If End If
End Sub End Sub
Private Sub CargaDatosFiltros() Private Sub CargaDatosFiltros()
@@ -43,7 +43,7 @@ Partial Class MetasVendedores
DdlCategoria.DataBind() DdlCategoria.DataBind()
DdlCategoria.Items.Insert(0, New ListItem("Todos", "-1")) DdlCategoria.Items.Insert(0, New ListItem("Todos", "-1"))
DdlClasificaciones.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) DdlClasificaciones.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, UsoClasificacion:=1)
DdlClasificaciones.DataBind() DdlClasificaciones.DataBind()
DdlClasificaciones.Items.Insert(0, New ListItem("Todos", "-1")) DdlClasificaciones.Items.Insert(0, New ListItem("Todos", "-1"))
@@ -51,12 +51,10 @@ Partial Class MetasVendedores
DdlClasificacion2.DataBind() DdlClasificacion2.DataBind()
DdlClasificacion2.Items.Insert(0, New ListItem("Todos", "-1")) DdlClasificacion2.Items.Insert(0, New ListItem("Todos", "-1"))
'DdlCliente.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa)
'DdlCliente.DataBind()
'DdlCliente.Items.Insert(0, New ListItem("Todos", "-1"))
End Sub End Sub
Private Sub CargarDatosReporte() Private Sub CargarDatos()
Dim CveCliente As Integer = -1 Dim CveCliente As Integer = -1
If DdlClientes.SelectedValue.ToEntero > 0 Then If DdlClientes.SelectedValue.ToEntero > 0 Then
CveCliente = DdlClientes.SelectedValue.ToEntero CveCliente = DdlClientes.SelectedValue.ToEntero
@@ -65,7 +63,7 @@ Partial Class MetasVendedores
Dim ObjVentas As New ClsVentas Dim ObjVentas As New ClsVentas
If ObjVentas.GetRepMetasVendedores(TxtFechaMes.Text, UsuarioActual.CveEmpresa, DdlVendedorFiltro.SelectedValue.ToEntero, DdlCategoria.SelectedValue.ToEntero, If ObjVentas.GetRepMetasVendedores(TxtFechaMes.Text, UsuarioActual.CveEmpresa, DdlVendedorFiltro.SelectedValue.ToEntero, DdlCategoria.SelectedValue.ToEntero,
DdlClasificaciones.SelectedValue.ToEntero, DdlClasificacion2.SelectedValue.ToEntero, DdlMarcaFiltro.SelectedValue.ToEntero, DdlClasificaciones.SelectedValue.ToEntero, DdlClasificacion2.SelectedValue.ToEntero, DdlMarcaFiltro.SelectedValue.ToEntero,
DdlSubProyectoFiltro.SelectedValue.ToEntero, CveCliente, DdlGrupo.SelectedValue.ToEntero) Then DdlSubProyectoFiltro.SelectedValue.ToEntero, CveCliente, DdlDistribuidor.SelectedValue.ToEntero, DdlGrupo.SelectedValue.ToEntero) Then
GV.DataSource = ObjVentas.DtResultados GV.DataSource = ObjVentas.DtResultados
DtDatos = ObjVentas.DtResultados DtDatos = ObjVentas.DtResultados
End If End If
@@ -74,7 +72,7 @@ Partial Class MetasVendedores
End Sub End Sub
Protected Sub btConsultar_Click(sender As Object, e As EventArgs) Handles btConsultar.Click Protected Sub btConsultar_Click(sender As Object, e As EventArgs) Handles btConsultar.Click
CargarDatosReporte() CargarDatos()
UPDatos.Update() UPDatos.Update()
End Sub End Sub
@@ -87,16 +85,7 @@ Partial Class MetasVendedores
Select Case e.Row.DBCampo("TipoFila") Select Case e.Row.DBCampo("TipoFila")
Case "1" Case "1"
e.Row.CssClass = "Totales" e.Row.CssClass = "Totales"
' e.Row.FCLabel("lblRealMes").Text = ""
' e.Row.FCLabel("lblVtaMesAA").Text = ""
' e.Row.FCLabel("lblObjMes").Text = ""
' e.Row.FCLabel("lblRealAcumulado").Text = ""
' e.Row.FCLabel("lblRealMesPorcentaje").Text = ""
' e.Row.FCLabel("lblAAntAcumulado").Text = ""
' e.Row.FCLabel("lblObjAcumulado").Text = ""
' e.Row.FCLabel("lblVarVSAAPerc").Text = ""
' e.Row.FCLabel("lblVarVSAA").Text = ""
' e.Row.FCLabel("lblVarVSObjAcum").Text = ""
Case "2" Case "2"
e.Row.CssClass = "SubTotales2" e.Row.CssClass = "SubTotales2"
Case "3" Case "3"
@@ -129,4 +118,29 @@ Partial Class MetasVendedores
ImprimirPDF("Empresas/Grales/Formatos/MetasVendedores.rdlc", DtDatos, params, "Rep. Metas por vendedores", "PDF", RDSName:="DataSet1") ImprimirPDF("Empresas/Grales/Formatos/MetasVendedores.rdlc", DtDatos, params, "Rep. Metas por vendedores", "PDF", RDSName:="DataSet1")
End Sub End Sub
Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
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)
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("pEmp", UsuarioActual.Empresa.Empresa))
If Imagen.Exists Then
params.Add(New ReportParameter("pImg", logouri))
Else
params.Add(New ReportParameter("pImg", ""))
End If
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Usuario))
params.Add(New ReportParameter("FechaImpresion", Today))
params.Add(New ReportParameter("SubProyecto", DdlSubProyectoFiltro.SelectedItem.ToString))
params.Add(New ReportParameter("Agente", DdlVendedorFiltro.SelectedItem.ToString))
ImprimirPDF("Empresas/Grales/Formatos/MetasVendedores.rdlc", DtDatos, params, "Rep. Metas por vendedores", "Excel", RDSName:="DataSet1")
End Sub
Private Sub DdlCategoria_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCategoria.SelectedIndexChanged
DdlClasificaciones.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveCategoria:=DdlCategoria.SelectedValue.ToEntero, UsoClasificacion:=1)
DdlClasificaciones.DataBind()
DdlClasificaciones.Items.Insert(0, New ListItem("Todos", "-1"))
End Sub
End Class End Class