-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
+ }
+
+
+
+
diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb
index e17b22c08..23a69a6d9 100644
--- a/Compras/Compras.aspx.vb
+++ b/Compras/Compras.aspx.vb
@@ -1165,57 +1165,6 @@ Partial Class Compras_Compras
End Set
End Property
-
- Private Property CveContratoObra As Integer
- Get
- If ViewState("CveContratoObra") Is Nothing Then
- Return -1
- Else
- Return ViewState("CveContratoObra").ToString.ToEntero
- End If
- End Get
- Set(value As Integer)
- ViewState("CveContratoObra") = value
- End Set
- End Property
-
-
-
- Private Property MaxIVAProcentaje As Decimal
- Get
- If ViewState("MaxIVAProcentaje") Is Nothing Then
- Return 0
- Else
- Return ViewState("MaxIVAProcentaje").ToString.ToDecimal
- End If
- End Get
- Set(value As Decimal)
- ViewState("MaxIVAProcentaje") = value
- End Set
- End Property
-
-
- Private Property MAXRetIVAPorcentaje As Decimal
- Get
- If ViewState("MAXRetIVAPorcentaje") Is Nothing Then
- Return 0
- Else
- Return ViewState("MAXRetIVAPorcentaje").ToString.ToDecimal
- End If
- End Get
- Set(value As Decimal)
- ViewState("MAXRetIVAPorcentaje") = value
- 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")
@@ -1237,7 +1186,6 @@ Partial Class Compras_Compras
CveConceptoContableAlmacen = 0
EsNoDeducible = False
CveTipoConcepto = 1
- 'CargaContratos()
'******** Prorrateo ********************************************
If UsuarioActual.Empresa.Funcionalidad(117) <> "" Then
btnProrateo.Visible = True
@@ -1366,15 +1314,14 @@ Partial Class Compras_Compras
Dim ObjPersonal As New ClsRH
ObjPersonal.GetPersonal(-1, UsuarioActual.CveEmpresa)
DdlPersonal.DataSource = ObjPersonal.DtResultados
-
+
If UsuarioActual.CveEmpresa = 119 Then
DdlPersonalReembolso.DataSource = ObjPersonal.DtResultados
Else
DdlPersonalReembolso.DataSource = ObjPersonal.DtResultados.FiltraParametros("CveEstatusPersonal = 1")
End If
-
-
-
+
+
ObjPersonal.Dispose()
DdlPersonal.DataBind()
DdlPersonalReembolso.DataBind()
@@ -1502,8 +1449,6 @@ Partial Class Compras_Compras
DivEsNoDeducible.Visible = True
DivActualizarVincular.Visible = True
- 'LiAccionesContratos.Visible = False
-
Else
ViewState("CveProveedor") = -1
@@ -1828,17 +1773,6 @@ Partial Class Compras_Compras
Xml.Append(Replace(Replace(Replace(nodeconceptos.OuterXml, " 0 Then
- MaxIVAProcentaje = ObjeFacturas.DtResultados.MAX("IVAPorcentaje").ToDecimal
- MAXRetIVAPorcentaje = ObjeFacturas.DtResultados.MAX("RetIVAPorcentaje").ToDecimal
- Else
- MaxIVAProcentaje = 0
- End If
-
-
-
-
'TmpDT.Columns.Add("IVAPorcentaje")
'TmpDT.Columns.Add("RetIVAPorcentaje")
'TmpDT.Columns.Add("RetISRPorcentaje")
@@ -1886,10 +1820,10 @@ Partial Class Compras_Compras
DdlTipoCompra.Items.Clear()
DdlTipoCompra.Items.Add(New ListItem("Seleccione", "-1"))
DdlTipoCompra.Items.Add(New ListItem("NC Con Productos", "6"))
- DdlTipoCompra.Items.Add(New ListItem("Apoyo Logístico", "9"))
+ DdlTipoCompra.Items.Add(New ListItem("Apoyo Logístico", "9"))
DdlTipoCompra.Items.Add(New ListItem("NC Por Devolución", "11"))
- LiAccionesContratos.Visible = True
+
End Select
'DIV ALIAS
@@ -2770,7 +2704,9 @@ Partial Class Compras_Compras
TmpDT.Columns.Add("CveContrato", GetType(Integer))
TmpDT.Columns.Add("DifPSSat", GetType(Integer))
-
+
+
+
If Not TmpDT.Columns.Contains("CveContratoDetalle") Then
TmpDT.Columns.Add("CveContratoDetalle", GetType(Integer))
End If
@@ -2781,10 +2717,6 @@ Partial Class Compras_Compras
End If
-
-
-
-
GvPS.DataSource = TmpDT
GvPS.DataBind()
@@ -4051,7 +3983,6 @@ Partial Class Compras_Compras
Protected Sub BtnGuardar_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnGuardar.Click
-
'------------------INICIA VALIDACIONES------------------
Dim EstatusCredito As Integer = 0
Dim CveSubProyecto As Integer = 0
@@ -4651,7 +4582,7 @@ Partial Class Compras_Compras
'End If
'METODO DE PREPOLIZA DE ALMACEN
- If UsuarioActual.CveEmpresa.Contiene(1, 119, 72, 80, 140, 141, 153) And UsuarioActual.Empresa.UsaInventarios And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" Then
+ If UsuarioActual.CveEmpresa.Contiene(1, 119, 72, 80, 140, 141, 152, 153, 159, 160, 161, 162, 163) And UsuarioActual.Empresa.UsaInventarios And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" Then
Dim ImporteAlmacen = TmpDT.SUM(If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0, "ImporteSinImpuestos", "Total"), $"ISNULL(TipoAF,0) <> 2 AND ISNULL(CveAlmacen,0) = 0 AND ISNULL(AplicaCostoIndirecto,0) <> 1 AND CveTipoPS = 2").ToString.ToDecimal
If ImporteAlmacen > 0 Then
If Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") Then
@@ -4685,18 +4616,19 @@ Partial Class Compras_Compras
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
- '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
+ '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
'si el registro es manual, toma el mismo dato
If CveFactura <= 0 Then TotalOriginal = TxtTotal.Text.ToDecimal
@@ -4717,12 +4649,12 @@ Partial Class Compras_Compras
TxtRedondeo.Text.ToDouble, TxtTotal.Text.ToDouble, TxtFecha.Text.Trim.ToDate, DdlMoneda.SelectedValue.ToEntero, TipoCambio, TxtFechaPago.Text.Trim.ToDate, ChkAplicaNotaCredito.Checked, TxtObsFact.Text.Trim, CveEstatusFactura,
CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, IdPoliza, CveCajaChica:=CveCajaChica, CvePersonal:=CvePersonal, NumeroReembolso:=NumeroReembolso, CveProveedorSucursal:=DdlProveedorSucursal.SelectedValue.ToEntero,
AplicoPromocion:=ChkOCPromocion.Checked, PorcentajeIVA:=PorcentajeIVA, CveMetodoPago:=CveMetodoPago, CveRetIVAConcepto:=If(DdlRetIVAConcepto.Items.Count > 0, DdlRetIVAConcepto.SelectedValue.ToEntero, -1), CveConceptoContableAlmacen:=CveConceptoContableAlmacen,
- CveRetISRConcepto:=If(DdlRetISRConcepto.Items.Count > 0, DdlRetISRConcepto.SelectedValue.ToEntero, -1), NoDeducible:=EsNoDeducible, CveTipoCompra:=DdlTipoCompra.SelectedValue.ToEntero, TotalOriginal:=TotalOriginal, CveTipoConcepto:=CveTipoConcepto, CveContrato:=CveContratoObra) Then
+ CveRetISRConcepto:=If(DdlRetISRConcepto.Items.Count > 0, DdlRetISRConcepto.SelectedValue.ToEntero, -1), NoDeducible:=EsNoDeducible, CveTipoCompra:=DdlTipoCompra.SelectedValue.ToEntero, TotalOriginal:=TotalOriginal, CveTipoConcepto:=CveTipoConcepto) Then
ViewState("CveCompra") = ObjCompras.CveCompra
If ObjCompras.DtResultados.Rows.Count > 0 Then ViewState("CompraFolio") = ObjCompras.DtResultados.Rows(0)("vFolio").ToString
If DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") Then
- Devolucion = guardardevolucion(ObjInventario, ObjCompras.CveCompra, TxtSubTotal.Text.ToDouble, TxtFecha.Text.Trim.ToDate)
+ Devolucion = guardardevolucion(ObjInventario, ObjCompras.CveCompra, TxtSubTotal.Text.ToDecimal, TxtFecha.Text.Trim.ToDate)
TieneError = Devolucion.TieneError
End If
@@ -5110,7 +5042,7 @@ Partial Class Compras_Compras
Dim AutoConta As Boolean = UsuarioActual.Empresa.Funcionalidad(200) = "1"
- If UsuarioActual.CveEmpresa.Contiene(119, 158) AndAlso (DdlPersonalReembolso.SelectedValue.ToEntero > 0 Or DdlCuentaCajaChicaReembolso.SelectedValue.ToEntero > 0 Or DdlTipoComprobante.SelectedValue = "Ant") Then
+ If UsuarioActual.CveEmpresa = 119 AndAlso (DdlPersonalReembolso.SelectedValue.ToEntero > 0 Or DdlCuentaCajaChicaReembolso.SelectedValue.ToEntero > 0 Or DdlTipoComprobante.SelectedValue = "Ant") Then
AutoConta = False
End If
@@ -5313,7 +5245,7 @@ Partial Class Compras_Compras
If Not UsuarioActual.Empresa.UsaAC Then fecha = Now
folio = ObjInventario.GetFolioSiguiente(2, UsuarioActual.CveEmpresa)
- cvemovimientoentrada = ObjInventario.AddMovimiento(tcvealmacen, 2, 1, fecha, folio, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompra, -1, -1, -1, TipoCambio:=If(DdlMoneda.SelectedValue.ToEntero = 1, -1, TipoCambioGuardar), Modulo:="Comp/G")
+ cvemovimientoentrada = ObjInventario.AddMovimiento(tcvealmacen, 2, 1, fecha, folio, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompra, -1, -1, -1, TipoCambio:=If(DdlMoneda.SelectedValue.ToEntero = 1, -1, TipoCambioGuardar), Modulo:="Comp/G4")
If cvemovimientoentrada <= 0 Then
ErrorMovInv = True
Exit For
@@ -5337,7 +5269,7 @@ Partial Class Compras_Compras
'agregamos la salida gasto
folio = ObjInventario.GetFolioSiguiente(3, UsuarioActual.CveEmpresa)
- cvemovimientosalidagasto = ObjInventario.AddMovimiento(tcvealmacen, 3, DdlMoneda.SelectedValue.ToEntero, fecha.AddSeconds(1), folio, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompra, -1, -1, -1, Modulo:="Comp/G")
+ cvemovimientosalidagasto = ObjInventario.AddMovimiento(tcvealmacen, 3, DdlMoneda.SelectedValue.ToEntero, fecha.AddSeconds(1), folio, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompra, -1, -1, -1, Modulo:="Comp/G3")
If cvemovimientosalidagasto <= 0 Then
ErrorMovInv = True
Exit For
@@ -5394,7 +5326,7 @@ Partial Class Compras_Compras
Dim fecha As Date = TxtFecha.Text.ToDate
If Not UsuarioActual.Empresa.UsaAC Then fecha = Now
- CveMovimientoInventario = ObjInventario.AddMovimiento(tCveAlmacen, 2, 1, fecha, 0, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompra, -1, -1, -1, TipoCambio:=If(DdlMoneda.SelectedValue.ToEntero = 1, -1, TipoCambioGuardar), Modulo:="Comp/G")
+ CveMovimientoInventario = ObjInventario.AddMovimiento(tCveAlmacen, 2, 1, fecha, 0, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompra, -1, -1, -1, TipoCambio:=If(DdlMoneda.SelectedValue.ToEntero = 1, -1, TipoCambioGuardar), Modulo:="Comp/G2")
If CveMovimientoInventario <= 0 Then
ErrorMovInv = True
@@ -6559,7 +6491,7 @@ Partial Class Compras_Compras
End If
Case 6 'Compra
- Dim AgregaMercanciaInventario As Boolean = UsuarioActual.CveEmpresa.Contiene(1, 72, 80, 119, 140, 141) AndAlso UsuarioActual.Empresa.UsaInventarios AndAlso Not UsuarioActual.Empresa.Funcionalidad(126) = "1"
+ Dim AgregaMercanciaInventario As Boolean = UsuarioActual.CveEmpresa.Contiene(1, 72, 80, 119, 140, 141,152,159,160,161,162,163) andalso UsuarioActual.Empresa.UsaInventarios AndAlso Not UsuarioActual.Empresa.Funcionalidad(126) = "1"
Dim RegistraConcepto225 As Boolean = UsuarioActual.Empresa.UsaInventarios AndAlso DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") AndAlso Not UsuarioActual.Empresa.Funcionalidad(126) = "1"
@@ -6849,20 +6781,20 @@ Partial Class Compras_Compras
End If
End If
Case 6
- PorcentajeImpuesto = TmpDT.MAX("IVAPorcentaje").ToDecimal
Concepto = $"{NombreProveedor} {TxtSerie.Text} - {TxtFolio.Text}"
- For Each RowDetalle As DataRow In TmpDT.FiltraParametros("ISNULL(TipoAF,0) <> 2", "", {"CveClasificacion", "CveSubProyecto", "IVAPorcentaje"}).Rows
+ For Each RowDetalle As DataRow In TmpDT.FiltraParametros("ISNULL(TipoAF,0) <> 2", "", {"CveClasificacion", "CveSubProyecto"}).Rows
If ObjConta.GetRetCuenta(6, RowDetalle("CveClasificacion").ToString().ToEntero()) Then
If ObjConta.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaGasto").ToString.ToEntero
+ CveCuenta = ObjConta.DtResultados.Rows(0)("IdCuentaGastoSIG").ToString.ToEntero
End If
End If
If importeMN <> 0 Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMN, Referencia, 6, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CvePersonal:=CvePersonal, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual,
- CveClasificacion:=RowDetalle("CveClasificacion").ToString().ToEntero(), CveSubProyecto:=RowDetalle("CveSubProyecto").ToString().ToEntero(), Contabilizable:=SeContabiliza, PorcentajeImpuesto:=RowDetalle("IVAPorcentaje").ToString.ToDecimal) Then
+ CveClasificacion:=RowDetalle("CveClasificacion").ToString().ToEntero(), CveSubProyecto:=RowDetalle("CveSubProyecto").ToString().ToEntero(), Contabilizable:=SeContabiliza) Then
ErrorPrepoliza = True
End If
End If
@@ -6887,8 +6819,8 @@ Partial Class Compras_Compras
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 ISNULL(CveTipoPS,0) = 2").ToString.ToDecimal
importeMN = importeMovimiento * tipoCambioActual * Multiplicador
-
- If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then 'cuando es emp acumuladora
+
+ If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then 'cuando es emp acumuladora
Dim Valor = (From dr1 In GlobalDTAcumTamaños().FiltraParametros("CveEmpresa = 140").AsEnumerable()
Join dr2 In TmpDT.AsEnumerable On dr1.Field(Of Integer)("CvePSCargo") Equals dr2.Field(Of Integer)("CvePS")
@@ -6977,7 +6909,7 @@ Partial Class Compras_Compras
If Not RegistroCuentaPuente AndAlso Not ChkNCInvNC.Checked Then
'GASTO
- If UsuarioActual.CveEmpresa.Contiene(119, 158) Then
+ If UsuarioActual.CveEmpresa = 119 Then
DT = TmpDT
Else
DT = TmpDT.FiltraParametros("ISNULL(AplicaCostoIndirecto,0) <> 1")
@@ -7075,7 +7007,7 @@ Partial Class Compras_Compras
End If
Dim usacomplementariaProveedor As Boolean = False
- usacomplementariaProveedor = If(tipoCambioActual > 1 AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119), True, False)
+ usacomplementariaProveedor = If(tipoCambioActual > 1 AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119, 158), True, False)
If usacomplementariaProveedor AndAlso DdlTipoComprobante.SelectedValue = "Ant" Then
'importeMovimiento
@@ -7114,7 +7046,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 = UsuarioActual.CveEmpresa.Contiene(119, 158)
If tipoCambioActual <> 1 Then
Select Case ConceptoContable
Case 5
@@ -7140,7 +7072,7 @@ Partial Class Compras_Compras
Else
IdCtaContable = CtaProveedorComplementaria
CveCuenta = CveCuentaProveedorComplementaria
- If importeMovimiento <> 0 AndAlso (IdCtaContable > 0 Or CveCuenta > 0 OrElse UsaComplementaria) Then 'Cuando tiene complementaria lo dividimos en dos Then
+ If importeMovimiento <> 0 AndAlso (IdCtaContable > 0 Or CveCuenta > 0 Or UsaComplementaria) Then 'Cuando tiene complementaria lo dividimos en dos Then
importeMN = importeMovimiento
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, Referencia, CveConceptoContableComplementaria, Concepto, FechaMovimiento, IdCtaContable, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteMX:=importeMovimiento * tipoCambioActual - importeMovimiento, ImporteME:=importeMovimiento, CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza) Then
ErrorPrepoliza = True
@@ -7150,6 +7082,11 @@ Partial Class Compras_Compras
CveCuenta = CveCuentaProveedorExtranjera
End If
End If
+
+ If CveCompraRefacturacion > 0 Then
+ importeMovimiento = 0
+ importeMN = 0
+ End If
Case 59 'Documentos
@@ -8299,6 +8236,16 @@ Partial Class Compras_Compras
End If
End If
Next
+
+ For Each Gvr As GridViewRow In GVNCInvAlmacen.Rows
+ If Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble > 0 Then
+ If Not ObjCompras.ComprasDetalleDevolucionesAdd(Gvr.DataKey("CveCompraDetalle").ToEntero, CveCompra, Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble, UsuarioActual.CveEmpresa) Then
+ ErrorMovInv = True
+ Exit For
+ End If
+ End If
+ Next
+
End If
@@ -13141,7 +13088,7 @@ Partial Class Compras_Compras
End If
'CONTADO
- Select Case RBLContado.SelectedValue
+ Select Case RBLContado.SelectedValue
Case "1" ' Bancos
PnlContadoBancos.Visible = True
TxtDocumentoImporte.Text = (TxtTotal.Text.ToDecimal - LblAmortizacion.Text.ToDecimal).FormatoNumero
@@ -13190,7 +13137,7 @@ Partial Class Compras_Compras
End Sub
Protected Sub BtnContado_Click(sender As Object, e As EventArgs)
- TxtRembolsoNumero.Text = TxtNumeroReembolso.Text
+ TxtRembolsoNumero.Text = TxtNumeroReembolso.Text
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivContadoModal"))
End Sub
@@ -14266,7 +14213,7 @@ Partial Class Compras_Compras
'*se envia true si hubo un error*'
- Private Function guardardevolucion(ObjInventario As ClsInventarios, CveCompra As Integer, subtotal As Double, Fecha As Date) As MMensajeDevolucion
+ Private Function guardardevolucion(ObjInventario As ClsInventarios, CveCompra As Integer, subtotal As Decimal, Fecha As Date) As MMensajeDevolucion
Dim ErrorMovInv As Boolean = False
Dim CveAlmacen As Integer = DdlAlmacenDevolucion.SelectedValue.ToEntero()
Dim subtotaldevolucion As Double = 0
@@ -14274,6 +14221,7 @@ Partial Class Compras_Compras
Dim CveMovimientoEntrada As Integer = -1
'Calculo los subtotales para comparar con la NC
Dim cantidad As Double = 0.0
+ Dim TotalAlmacen As Decimal = 0
For Each Dr As GridViewRow In GVDevolucion.Rows
'CveAlmacen = Dr.DataKey("CveAlmacen").ToString.ToEntero
@@ -14289,18 +14237,28 @@ Partial Class Compras_Compras
'si el subtotal es iwal a la nc lo guardo si no marco error
If subtotal > subtotaldevolucion - 1 AndAlso subtotal < subtotaldevolucion + 1 Then
- CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacen, 13, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompra, -1, -1, -1, Modulo:="Comp/G")
+ CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacen, 13, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompra, -1, -1, -1, Modulo:="Comp/G1")
If CveMovimientoEntrada <= 0 Then
ErrorMovInv = True
Else
+ Dim Acumulado As Decimal = 0
+ Dim PU As Decimal = 0
For Each Dr As GridViewRow In GVDevolucion.Rows
If Dr.FCTextBox("TxtCantidad").Text.ToDouble > 0 Then
- If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr.FCTextBox("TxtCantidad").Text.ToDouble, Dr.DataKey("CveUM").ToString.ToEntero, Dr.DataKey("CvePS").ToString.ToEntero, Dr.DataKey("PU").ToString.ToDecimal, -1, CveMovimientoDetalleEntrada:=Dr.DataKey("CveMovimientoDetalle").ToString.ToEntero) Then
+ Acumulado += (Dr.FCTextBox("TxtCantidad").Text.ToDecimal * Dr.DataKey("PU").ToString.ToDecimal)
+ PU = Dr.DataKey("PU").ToString.ToDecimal
+ If subtotal < Acumulado Then
+ Dim dif As Decimal = subtotal - Acumulado
+ PU = (((Dr.FCTextBox("TxtCantidad").Text.ToDecimal * Dr.DataKey("PU").ToString.ToDecimal)) + dif) / Dr.FCTextBox("TxtCantidad").Text.ToDecimal
+ End If
+
+ If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr.FCTextBox("TxtCantidad").Text.ToDouble, Dr.DataKey("CveUM").ToString.ToEntero, Dr.DataKey("CvePS").ToString.ToEntero, PU, -1, CveMovimientoDetalleEntrada:=Dr.DataKey("CveMovimientoDetalle").ToString.ToEntero) Then
ErrorMovInv = True
Exit For
End If
End If
Next
+
End If
Else
ErrorMovInv = True
@@ -14407,10 +14365,19 @@ Partial Class Compras_Compras
Dim IEPSCompra As Decimal = TxtIEPS.Text.ToDecimal()
Dim RetIVACompra As Decimal = TxtRetIVA.Text.ToDecimal()
Dim RetISRCompra As Decimal = TxtRetISR.Text.ToDecimal()
+ Dim Acumulado As Decimal = 0
'Dim TotalCalculable As Decimal = TotalCompra - IEPSCompra + RetIVACompra + RetISRCompra
Dim IVAPorcentajeCompra As Decimal = Math.Round((IVACompra / SubTotalCompra), 2)
+ Dim Contador As Integer = 0
+ Dim Consec As Integer = 0
+
+ For Each gvr As GridViewRow In GVDevolucion.Rows
+ If gvr.FCTextBox("TxtCantidad").Text.ToDecimal > 0 Then
+ Contador += 1
+ End If
+ Next
'Iteramos el GridView de la OC
For Each gvr As GridViewRow In GVDevolucion.Rows
@@ -14436,6 +14403,19 @@ Partial Class Compras_Compras
Dim IVA As Decimal = IVAPorcentajeCompra 'Math.Round(Total * IVAPorcentajeCompra, 2)
Dim Descuento As Decimal = 0
+ Acumulado += (PU * Cantidad)
+ Consec += 1
+
+ If Consec = Contador Then 'SubTotalCompra < Acumulado Then
+ 'ajusta el valor
+ Dim dif As Decimal = SubTotalCompra - Acumulado
+ If dif <> 0 Then
+ PU = ((PU * Cantidad) + dif) / Cantidad
+ Total = Cantidad * PU
+ End If
+
+ End If
+
AddPS(Cantidad, CveUM, UM, CveClasificacion, Clasificacion, CvePS, PS, CveTipoPS, CveSubProyectoContrato, SubProyecto, Proyecto, CveProyecto, Obs, PU, Total, IVA, 0, 0, 0, 0, Descuento, -1, False)
End If
@@ -15303,7 +15283,7 @@ Partial Class Compras_Compras
'SI PUEDE RECIBIR POR OC Y COMPRA
' si usa almacen, si tiene activado que reciba por OC, y que si la compra tipo Proveedor. que lo muestre
- If UsuarioActual.CveEmpresa.Contiene(119, 158) AndAlso UsuarioActual.Empresa.UsaInventarios And UsuarioActual.Empresa.Funcionalidad(131).ToEntero > 0 AndAlso CveTipoConcepto = 1 Then
+ If UsuarioActual.CveEmpresa = 119 AndAlso UsuarioActual.Empresa.UsaInventarios And UsuarioActual.Empresa.Funcionalidad(131).ToEntero > 0 AndAlso CveTipoConcepto = 1 Then
DivOCVinculaInv.Visible = True
End If
@@ -15345,7 +15325,7 @@ Partial Class Compras_Compras
'PROMOCIONES
LtOCPromocion.Text = StrPromos.ToString
- If LtOCPromocion.Text.Length > 0 And UsuarioActual.CveEmpresa.Contiene(119, 158) Then
+ If LtOCPromocion.Text.Length > 0 And UsuarioActual.CveEmpresa = 119 Then
DivOCPromocion.Visible = True
End If
@@ -15619,6 +15599,12 @@ Partial Class Compras_Compras
'If DdlOCVinculaInv.SelectedValue.ToEntero = 237 And Not CveFlete > 0 Then Alert("Necesita vincular un flete si selecciona Factura de Flete", TipoMensaje.MsgAdvertencia) : Exit Sub
'If DdlOCVinculaInv.SelectedValue.ToEntero = 240 And Not CveImportacion > 0 Then Alert("Necesita vincular una Importación si selecciona Factura de Importación", TipoMensaje.MsgAdvertencia) : Exit Sub
+ 'If UsuarioActual.CveEmpresa = 119 And DdlTipoComprobante.SelectedValue = "Fac" Then
+ ' If Not VerificarProductosCompraConOC() Then
+ ' Exit Sub
+ ' End If
+ 'End If
+
Dim SubTotalGV = 0.0D
Dim Amortizacion As Decimal = TmpDT.SUMD("Total")
If ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 Then
@@ -15681,7 +15667,7 @@ Partial Class Compras_Compras
'SI PUEDE RECIBIR POR OC Y COMPRA
- If UsuarioActual.CveEmpresa.Contiene(119, 158) AndAlso UsuarioActual.Empresa.UsaInventarios And UsuarioActual.Empresa.Funcionalidad(131).ToEntero > 0 AndAlso CveTipoConcepto = 1 Then
+ If UsuarioActual.CveEmpresa = 119 AndAlso UsuarioActual.Empresa.UsaInventarios And UsuarioActual.Empresa.Funcionalidad(131).ToEntero > 0 AndAlso CveTipoConcepto = 1 Then
If DdlOCVinculaInv.SelectedValue.ToEntero <= 0 Then
Alert("El campo Tipo de recepción almacén es necesario. Por favor verifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
@@ -16672,19 +16658,12 @@ Partial Class Compras_Compras
Protected Sub DdlTipoComprobante_SelectedIndexChanged(sender As Object, e As EventArgs)
- LiAccionesContratos.Visible = False
If DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") Then
If DdlTipoComprobante.SelectedValue = "NC" Then
DivReembolso.Visible = False
RBLPago.Items(2).Enabled = False
-
-
- If Not CveCompra > 0 Then
- LiAccionesContratos.Visible = True
- End If
-
Else
DivReembolso.Visible = True
RBLPago.Items(2).Enabled = True
@@ -16708,8 +16687,6 @@ Partial Class Compras_Compras
End If
-
- UpAccionesContratos.Update()
UPCondicionesPago.Update()
End Sub
@@ -17353,7 +17330,7 @@ Partial Class Compras_Compras
LblAmortizacion.Text = "0.00"
End If
- If UsuarioActual.CveEmpresa.Contiene(119, 158) AndAlso TieneAmortizacion Then
+ If UsuarioActual.CveEmpresa = 119 AndAlso TieneAmortizacion Then
Amortizacion = LblAmortizacion.Text.Trim.ToDecimal
TxtSubTotal.Text = (TxtSubTotal.Text.ToDouble + Amortizacion).ToString
End If
@@ -18799,6 +18776,7 @@ Partial Class Compras_Compras
HLAplicaNCFact.Visible = True
LblTotalNC.Text = TxtTotal.Text.FormatoNumero
CargaCuentasXPagar()
+ TabModoNC_ActiveTabChanged(TabModoNC, EventArgs.Empty)
End Sub
Private Sub CargaCuentasXPagar()
@@ -18932,6 +18910,9 @@ Partial Class Compras_Compras
ChkNCInv.Visible = True
GVNCInv.DataSource = DtPendientesAlmacen
GVNCInv.DataBind()
+
+ GVNCInvAlmacen.DataSource = DtPendientesAlmacen
+ GVNCInvAlmacen.DataBind()
End If
End If
@@ -18940,7 +18921,7 @@ Partial Class Compras_Compras
CargaAnticipos(CveProveedor, If(ChkNCInv.Checked, "NC", "-1"))
UpAnticipos.Update()
End Sub
- Private Sub CargaNCINV()
+Private Sub CargaNCINV()
Dim SaldoAnticipo = 0.0
Dim CveCompras As String = ""
@@ -18961,20 +18942,22 @@ Partial Class Compras_Compras
SaldoAnticipo += gvr.FCTextBox("TxtAnticipo").Text.ToDouble
End If
Next
+
+ If SaldoAnticipo <= 0 Then
+ Alert("No hay movimientos seleccionados para aplicar", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
End If
- If SaldoAnticipo <= 0 Then
- Alert("No hay movimientos seleccionados para aplicar", TipoMensaje.MsgAdvertencia)
- Exit Sub
- End If
-
LbNCInvSaldo.Text = SaldoAnticipo.FormatoNumero()
+ LbNCInvSaldoAlmacen.Text = SaldoAnticipo.FormatoNumero()
If ChkNCInvNC.Checked Then
Dim ObjInventarios As New ClsInventarios
- If ObjInventarios.RecepcionAlmacenGet(-1, -1, UsuarioActual.CveEmpresa, CveProveedor) AndAlso ObjInventarios.DtResultados.FiltraParametros($"CveCompra IN ({CveCompras}) AND CantidadF > 0").Rows.Count > 0 Then
- DtPendientesAlmacen = ObjInventarios.DtResultados.FiltraParametros($"CveCompra IN ({CveCompras}) AND CantidadF > 0").Copy
+ If ObjInventarios.RecepcionAlmacenGet(-1, -1, UsuarioActual.CveEmpresa, CveProveedor) AndAlso ObjInventarios.DtResultados.FiltraParametros($"CantidadF > 0").Rows.Count > 0 Then
+ DtPendientesAlmacen = ObjInventarios.DtResultados.FiltraParametros($"CantidadF > 0").Copy
End If
ObjInventarios.Dispose()
End If
@@ -18983,10 +18966,12 @@ Partial Class Compras_Compras
If ChkNCInvNC.Checked Then
GVNCInv.DataSource = DtPendientesAlmacen
GVNCInv.DataBind()
- UpNCInv.Update()
- RegistraScript("$('#FacturaNC').modal('hide');", "FacturaNC")
+
+ GVNCInvAlmacen.DataSource = DtPendientesAlmacen
+ GVNCInvAlmacen.DataBind()
+
End If
- RegistraScript("$('#ModalNCInv').modal('show');", "ModalNCInv")
+
Else
If ChkNCInvNC.Checked Then
Alert("Niguna de las facturas seleccionadas cuenta con productos pendientes de darles entrada.", TipoMensaje.MsgAdvertencia)
@@ -18999,14 +18984,22 @@ Partial Class Compras_Compras
End If
UpNCInv.Update()
+ UpFacturaNC.Update()
End Sub
+
Protected Sub GVNCInv_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GVNCInv.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
'e.Row.FCCheckBox("cbInv").Attributes.Add("onclick", "FnCambiaInvNC(this);")
e.Row.FCTextBox("TxtCantidadNCInv").Attributes.Add("onkeyup", $"ValidarCantidad(this,{e.Row.DBCampo("CantidadF")});FnCambiaInvNC(this);")
End If
End Sub
+ Protected Sub GVNCInvAlmacen_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GVNCInvAlmacen.RowDataBound
+ If e.Row.RowType = DataControlRowType.DataRow Then
+ 'e.Row.FCCheckBox("cbInv").Attributes.Add("onclick", "FnCambiaInvNC(this);")
+ e.Row.FCTextBox("TxtCantidadNCInv").Attributes.Add("onkeyup", $"ValidarCantidad(this,{e.Row.DBCampo("CantidadF")});FnCambiaInvNC(this);")
+ End If
+ End Sub
Protected Sub BtnNCInv_Click(sender As Object, e As EventArgs)
If ChkNCInvNC.Checked Then
@@ -19064,6 +19057,34 @@ Partial Class Compras_Compras
Protected Sub BtnNCConfirmacion_Click(sender As Object, e As EventArgs)
GuardaAnticipos(Nothing, Nothing)
End Sub
+
+ Protected Sub BtnNCInvAlmacen_Click(sender As Object, e As EventArgs)
+
+ 'Dim ObjCompras As New ClsCompras
+ 'Dim ObjConta As New ClsContabilidad(ObjCompras.IniciaTransacSQL)
+ 'Dim TieneError = False
+
+ 'For Each Gvr As GridViewRow In GVNCInvAlmacen.Rows
+ ' If Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble > 0 Then
+ ' If Not ObjCompras.ComprasDetalleDevolucionesAdd(Gvr.DataKey("CveCompraDetalle").ToEntero, Gvr.DataKey("CveCompra").ToEntero, Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble, UsuarioActual.CveEmpresa) Then
+ ' TieneError = True
+ ' Exit For
+ ' End If
+ ' End If
+ 'Next
+
+ 'If Not TieneError Then
+ ' Alert("Se guardo la devolución correctamente", TipoMensaje.MsgInformacion)
+ ' ObjCompras.Commit()
+ 'Else
+ ' Alert("Ocurrió un error al guardar la devolución", TipoMensaje.MsgError)
+ ' ObjCompras.RollBack()
+ 'End If
+
+ 'ObjCompras.Dispose()
+ RegistraScript("$('#FacturaNC').modal('hide');", "ModalNCInv")
+
+ End Sub
#End Region
#Region " INVENTARIO: MOVIMIENTOS DE LA COMPRA "
@@ -19685,8 +19706,8 @@ Partial Class Compras_Compras
Dim Multiplicador = If(DdlTipoComprobante.SelectedValue = "NC", -1, 1)
If DdlMoneda.SelectedValue.ToString.ToEntero = 2 Then
- 'tipoCambioActual = GlobalTipoCambio(TxtFecha.Text.ToDate).ToString.ToDecimal
- tipoCambioActual = TxtTC.Text.ToDecimal
+ tipoCambioActual = GlobalTipoCambio(TxtFecha.Text.ToDate).ToString.ToDecimal
+ tipoCambioActual = If(DivTC.Visible, TipoCambio.ToDecimal, tipoCambioActual)
Else
tipoCambioActual = 1
End If
@@ -20211,6 +20232,10 @@ Partial Class Compras_Compras
Protected Sub BtnFacturaNC_Click(sender As Object, e As EventArgs)
If ChkNCInvNC.Checked Then
CargaNCINV()
+
+ TabModoNC.ActiveTabIndex = 1
+ TabModoNC_ActiveTabChanged(TabModoNC, EventArgs.Empty)
+ UpFacturaNC.Update()
Else
RegistraScript("$('#FacturaNC').modal('hide');", "FacturaNC")
End If
@@ -20526,184 +20551,32 @@ Partial Class Compras_Compras
Return True
End Function
+ Protected Sub TabModoNC_ActiveTabChanged(sender As Object, e As EventArgs)
+ Select Case TabModoNC.ActiveTabIndex
+ Case 0
+ BtnFacturaNC.Visible = True
+ BtnNCInvAlmacen.Visible = False
+ TabNCAlmacen.Enabled = False
+ Case 1
+ BtnFacturaNC.Visible = False
+ BtnNCInvAlmacen.Visible = True
+ TabNCAlmacen.Enabled = True
+ End Select
- 'Private Sub CargaContratos()
- ' DdlContrato.DataSource = GlobalDTContratos.FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveContratoTipo IN(30,31) ")
- ' DdlContrato.DataBind()
- ' DdlContrato.Items.Insert(0, New System.Web.UI.WebControls.ListItem("Todos", "-1"))
- 'End Sub
-
- 'Protected Sub BtnModalContratos_Click(sender As Object, e As EventArgs)
-
- ' RegistraScript("$('#DvModalContratos').modal('hide');")
- ' CveContratoObra = DdlContrato.SelectedValue.ToEntero
-
-
- 'End Sub
-
+ UpFooterFacturaNC.Update()
+ End Sub
Protected Sub LnkContratos_Click(sender As Object, e As EventArgs)
- 'RegistraScript("$('#DvModalContratos').modal('show');")
-
- DdlContratosObra.Items.Clear()
- DdlContratosObra.DataSource = GlobalDTContratos.FiltraParametros(String.Format($"CveContratoTipo in (30,31) AND CveEmpresa = {UsuarioActual.CveEmpresa}"))
- DdlContratosObra.DataBind()
- 'DdlContratosObra.Items.Insert(0, New ListItem("Seleccione", "-1"))
-
-
- DdlTipoGastoObra.Items.Clear()
- DdlTipoGastoObra.DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa)
- DdlTipoGastoObra.DataBind()
- DdlTipoGastoObra.Items.Insert(0, New ListItem("Seleccione", "-1"))
-
-
-
- RegistraScript($"$('#DivmodalConmtrato').modal('show'); $( '#BtnAplicarContrato' ).prop( 'disabled', true ); ValidaBotonContrato({TxtSubTotal2.Text.ToDecimal});")
- UpModalContrato.Update()
-
-
End Sub
-
- Protected Sub DdlContratosCompras_SelectedIndexChanged(sender As Object, e As EventArgs)
-
-
- If DdlContratosObra.SelectedValue.ToEntero > 0 Then
- Dim ObjContratos As New ClsContratos()
-
- If ObjContratos.GetContratosObraCompras(DdlContratosObra.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
-
- If ObjContratos.DtResultados.Rows.Count > 0 Then
- GvContratosControl.DataSource = ObjContratos.DtResultados
- 'BtnAplicarContrato.Visible = True
- Else
- GvContratosControl.DataSource = Nothing
- 'BtnAplicarContrato.Visible = False
- End If
-
- End If
-
-
- ObjContratos.Dispose()
-
- GvContratosControl.DataBind()
-
- UpModalContrato.Update()
- End If
-
- RegistraScript("$( '#BtnAplicarContrato' ).prop( 'disabled', true );")
+ Protected Sub DdlContratosObra_SelectedIndexChanged(sender As Object, e As EventArgs)
End Sub
-
Protected Sub BtnAplicarContrato_Click(sender As Object, e As EventArgs)
-
- TmpDT.Rows.Clear()
-
- Dim CveTipoGastoObra As Integer = DdlTipoGasto.SelectedValue.ToEntero
-
- 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 CvePS As Integer = GvRow.DataKey("CvePS").ToEntero
- Dim PS As String = GvRow.DataKey("PS")
- Dim PU As Double = GvRow.FCTextBox("TxtPU").Text.ToDouble
- Dim TotalPS As Double = GvRow.FCTextBox("TxtImporte").Text.ToDouble
- 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
-
- Dim RetISR As Double = GvRow.DataKey("RetISR").ToString.ToDouble
- Dim RetIVA As Double = MAXRetIVAPorcentaje 'GvRow.DataKey("RetIVA").ToString.ToDouble
-
- Dim IvaPS As Double = MaxIVAProcentaje
-
- 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 CveTipoPS As Integer = GvRow.DataKey("CveTipoPS").ToEntero
-
- Dim CveSATPS As Integer = GvRow.DataKey("CveSATPS").ToEntero
-
-
- Dim IdCuentaPorEjercer As Integer = -1
- Dim IdCuentaComprometido As Integer = -1
-
- Dim TotalRow As Decimal = (PU * Cantidad).RoundSQL(2).ToDecimal
-
- If Cantidad > 0 Then
-
-
- AddPS(Cantidad, CveUnidadMedida, UMAbreviatura, CveClasificacion, Clasificacion, CvePS, PS, CveTipoPS, CveSubProyecto.ToString, SubProyecto, Proyecto, CveProyecto.ToString, "", PU, TotalRow, IvaPS, RetIVA, RetISR, IEPSPS, IEPSPSIVA, 0, -1, False,
- CantidadF:=0, EntregaDirecta:=0, CveSATPS:=CveSATPS, CveTipoGasto:=DdlTipoGastoObra.SelectedValue.ToEntero, TipoGasto:=DdlTipoGastoObra.SelectedItem.Text, CveContratoDetalle:=CveContratoDetalle, CveCultivoCuadroDetalle:=-1)
-
-
- 'AddPS(Cantidad, CvePS, PS, PS, PU, 0, TotalPS,
- 'CveUnidadMedida, IvaPS, IEPSPS, IEPSPSIVA, CveClasificacion, UMAbreviatura, Clasificacion, CveProyecto, Proyecto,
- 'CveSubProyecto, SubProyecto, Codigo, -1, 0, -1, -1, IdCuentaPorEjercer,
- 'IdCuentaComprometido, -1, -1, -1, -1,
- '-1, RetIVA, RetISR, CveContratoDetalle:=CveContratoDetalle, CveTipoGastoObra:=CveTipoGastoObra, CveCultivoCuadroDetalle:=-1, Cuadro:="")
-
-
- '' ContratoObraAplciado = True
-
- End If
-
- Next
-
- 'CargaSuperior()
- 'CargaDatosDetalles()
-
-
-
- GvPS.DataSource = TmpDT
- GvPS.DataBind()
- UpPS.Update()
-
- RegistraScript("$('#DivmodalConmtrato').modal('hide')")
- ' UPPDetalle.Update()
-
-
End Sub
-
- Private Sub GvContratosControl_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvContratosControl.RowDataBound
-
-
- If e.Row.RowType = DataControlRowType.DataRow Then
-
- Dim CveContratoDetalle As Integer = e.Row.DataKey("CveContratoDetalle").ToEntero
-
- e.Row.FCTextBox("TxtCantidad").CssClass = $"CssCantidad{CveContratoDetalle}"
- e.Row.FCTextBox("TxtCantidad").Attributes.Add("onkeyup", $"ValidateCant('{CveContratoDetalle}',{TxtSubTotal2.Text.ToDecimal})")
-
- e.Row.FCTextBox("TxtPU").CssClass = $"CssPU{CveContratoDetalle}"
- e.Row.FCTextBox("TxtPU").Attributes.Add("onkeyup", $"ValidateCant('{CveContratoDetalle}',{TxtSubTotal2.Text.ToDecimal})")
-
-
- e.Row.FCTextBox("TxtImporte").CssClass = $"ImporteCSS CssImporte{CveContratoDetalle}"
-
-
-
- End If
-
-
- End Sub
-
End Class
Public Class MMensajeDevolucion
diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb
index b39460360..99cd97ad1 100644
--- a/Compras/PopUpVerFactura.aspx.vb
+++ b/Compras/PopUpVerFactura.aspx.vb
@@ -1152,6 +1152,29 @@ Partial Class PopUpVerFactura
Vta.DtDocumentosRelacionados = ObjVentas.DtResultados.FiltraParametros("FolioFiscal IS NOT NULL")
End If
+ End If
+
+ If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso (Vta.DtDocumentosRelacionados Is Nothing OrElse Vta.DtDocumentosRelacionados.Rows.Count = 0) Then
+ If ObjVentas.GetVentasRelacionadas(CveVenta, UsuarioActual.CveEmpresa) Then
+ Vta.DtNCVinculadas = ObjVentas.DtResultados
+ Vta.DtDocumentosRelacionados = ObjVentas.DtResultados '.FiltraParametros("FolioFiscal IS NOT NULL")
+ If Vta.DtDocumentosRelacionados.Rows.Count > 0 Then
+ If Vta.TipoDocto.Contiene("Ing") Then
+ Vta.Timbre.CFDIRelacionados.TipoRelacion = "01"
+ Vta.Timbre.CFDIRelacionados.TipoRelacionTexto = "Nota de Crédito aplicada a Ingreso"
+ End If
+
+ If Vta.TipoDocto.Contiene("Egs") Then
+ Vta.Timbre.CFDIRelacionados.TipoRelacion = "01"
+ Vta.Timbre.CFDIRelacionados.TipoRelacionTexto = "Nota de Crédito aplicada a Ingreso"
+ End If
+
+ If Vta.TipoDocto.Contiene("Dev") Then
+ Vta.Timbre.CFDIRelacionados.TipoRelacion = "03"
+ Vta.Timbre.CFDIRelacionados.TipoRelacionTexto = "Devolución aplicada a Ingreso"
+ End If
+ End If
+ End If
End If
End If
diff --git a/Compras/RepCxP.aspx.vb b/Compras/RepCxP.aspx.vb
index fdd9bf68e..c3a54da1d 100644
--- a/Compras/RepCxP.aspx.vb
+++ b/Compras/RepCxP.aspx.vb
@@ -763,6 +763,9 @@ Partial Class Compras_RepCxP
End If
If Modalidad = "A" Then
+ If Not ValidarRangosAgregar() Then
+ Exit Sub
+ End If
Dim Dt As DataRow = Nothing
Dt = DtPersonalizarRango.NewRow
Dt("RangoInicial") = TxtRI.Text.ToDouble
@@ -771,6 +774,9 @@ Partial Class Compras_RepCxP
Dt("TipoEscrito") = DdlTipo.SelectedItem.Text
DtPersonalizarRango.Rows.InsertAt(Dt, DtPersonalizarRango.Rows.Count)
ElseIf Modalidad = "U" Then
+ If Not ValidarRangosEditar() Then
+ Exit Sub
+ End If
DtPersonalizarRango.Rows(Index)("RangoInicial") = TxtRI.Text.ToDouble
DtPersonalizarRango.Rows(Index)("RangoFinal") = TxtRF.Text.ToDouble
DtPersonalizarRango.Rows(Index)("Tipo") = DdlTipo.SelectedValue
@@ -783,6 +789,61 @@ Partial Class Compras_RepCxP
RegistraScript("$('#DivPersonalizarRango').modal()", "SDSD")
End Sub
+ Private Function ValidarRangosAgregar() As Boolean
+ Dim UltimoRango As DataTable = DtPersonalizarRango.FiltraParametros(String.Format("Tipo = {0}", DdlTipo.SelectedValue), "RangoInicial")
+ Dim TieneNullRow As DataRow = UltimoRango.Rows(UltimoRango.Rows.Count - 1)
+ Dim aux As String = TieneNullRow.Item("RangoFinal").ToString
+ 'Dim TieneNull As DataTable = UltimoRango.FiltraParametros(String.Format("RangoFinal < 0"))
+ If aux = "" Then
+ Alert("Falta indicar el valor maximo del rango anterior", TipoMensaje.MsgAdvertencia)
+ Return False
+ End If
+ Dim ValorMinimoPosible As Double = UltimoRango.MAX("RangoFinal").ToDouble
+ If Not TxtRI.Text.ToDouble > ValorMinimoPosible Then
+ Alert("El rango inicial no puede ser inferior al rango final anterior", TipoMensaje.MsgAdvertencia)
+ End If
+ Return TxtRI.Text.ToDouble > ValorMinimoPosible
+ End Function
+
+ Private Function ValidarRangosEditar() As Boolean
+ Dim TablaDeDatosAux As DataTable = DtPersonalizarRango.FiltraParametros(String.Format("Tipo = {0}", DdlTipo.SelectedValue))
+
+ 'Valida que hay datos en el row anterior
+ Dim valorMinimo As Double = 0.0
+ If Index > 0 Then
+ 'Validar que el RowAnterior sea del mismo tipo
+ Dim RowAnterior As GridViewRow = GvPersonalizarRango.Rows(Index - 1)
+ If RowAnterior.DataKey("Tipo") = DdlTipo.SelectedValue Then
+ 'Validar que el valor final del row anterior no sea null
+ valorMinimo = If(RowAnterior.DataKey("RangoFinal") IsNot Nothing, RowAnterior.DataKey("RangoFinal").ToDouble, -1.0)
+ End If
+ End If
+
+ 'Valida que datos en e row siguiente
+ Dim valorMaximo As Double = 1000000.0
+ If Index < (GvPersonalizarRango.Rows.Count - 1) Then
+ 'Validamos que el row siguiente sea del mismo tipo
+ Dim RowSiguiente As GridViewRow = GvPersonalizarRango.Rows(Index + 1)
+ If RowSiguiente.DataKey("Tipo") = DdlTipo.SelectedValue Then
+ 'Validamos que el valor inicial del row siguiente no sea NULL
+ valorMaximo = If(RowSiguiente.DataKey("RangoInicial") IsNot Nothing, RowSiguiente.DataKey("RangoInicial").ToDouble, 1000000.0)
+ End If
+ End If
+
+ If Not TxtRI.Text.ToDouble > valorMinimo Then
+ Alert("El rango inicial no puede ser inferior al rango final anterior", TipoMensaje.MsgAdvertencia)
+ Return False
+ End If
+
+ If Not TxtRF.Text.ToDouble < valorMaximo Then
+ Alert("El rango final no puede ser superior al rango inicial siguiente", TipoMensaje.MsgAdvertencia)
+ Return False
+ End If
+
+ Return (TxtRI.Text.ToDouble > valorMinimo And TxtRF.Text.ToDouble < valorMaximo)
+
+ End Function
+
Protected Sub BtnCancelarPersonalizarRangoEditar_Click(sender As Object, e As EventArgs)
RegistraScript("$('#DivPersonalizarRangoEditar').modal('hide')")
RegistraScript("$('#DivPersonalizarRango').modal()", "SDSD")
diff --git a/Contabilidad/RegPrePoliza.aspx b/Contabilidad/RegPrePoliza.aspx
index 1cb80a307..56e6c5379 100644
--- a/Contabilidad/RegPrePoliza.aspx
+++ b/Contabilidad/RegPrePoliza.aspx
@@ -194,6 +194,7 @@
+
diff --git a/Contabilidad/RegPrePoliza.aspx.vb b/Contabilidad/RegPrePoliza.aspx.vb
index 6215cdbce..197c8bf07 100644
--- a/Contabilidad/RegPrePoliza.aspx.vb
+++ b/Contabilidad/RegPrePoliza.aspx.vb
@@ -1,195 +1,195 @@
-
-
-Imports System.Data
-Imports Extensiones
-Imports System.Linq
-Imports System.Web.Services
-
-Partial Class ContabilidadC_RegPrePoliza
- Inherits ClsPaginas
-
-
-#Region "Propiedades"
- Public Property ArregloMovs As ArrayList
- Get
- Return CType(ViewState("ArregloMovs"), ArrayList)
- End Get
- Set(value As ArrayList)
- ViewState("ArregloMovs") = value
- End Set
- End Property
- Public Property DtMovimientos As DataTable
- Get
- Return CType(ViewState("DtMovimientos"), DataTable)
- End Get
- Set(value As DataTable)
- ViewState("DtMovimientos") = value
- End Set
- End Property
- Public Property DtCuentasContables As DataTable
- Get
- Return CType(ViewState("DtCuentasContables"), DataTable)
- End Get
- Set(value As DataTable)
- ViewState("DtCuentasContables") = value
- End Set
- End Property
- Public Property TipoPlantilla As Integer
- Get
- Return CType(ViewState("TipoPlantilla"), Integer)
- End Get
- Set(value As Integer)
- ViewState("TipoPlantilla") = value
- End Set
- End Property
- Public Property CveMoneda As Integer
- Get
- Return CType(ViewState("CveMoneda"), Integer)
- End Get
- Set(value As Integer)
- ViewState("CveMoneda") = value
- End Set
- End Property
- Private ReadOnly Property CvePrePoliza As Integer
- Get
- Return ViewState("CvePrePoliza").ToString.ToEntero
- End Get
- End Property
-
- 'PARA CREAR IE
- Private Property CveConcepto As Integer
- Get
- Return ViewState("CveConcepto").ToString.ToEntero
- End Get
- Set(value As Integer)
- ViewState("CveConcepto") = value
- End Set
- End Property
- Private Property CveTipoTransaccion As Integer
- Get
- Return ViewState("CveTipoTransaccion").ToString.ToEntero
- End Get
- Set(value As Integer)
- ViewState("CveTipoTransaccion") = value
- End Set
- End Property
- Private Property CveCuenta As Integer
- Get
- Return ViewState("CveCuenta").ToString.ToEntero
- End Get
- Set(value As Integer)
- ViewState("CveCuenta") = value
- End Set
- End Property
- Private Property Folio As String
- Get
- Return ViewState("Folio").ToString
- End Get
- Set(value As String)
- ViewState("Folio") = value
- End Set
- End Property
- Private Property ImporteDocumento As Decimal
- Get
- Return ViewState("ImporteDocumento").ToString.ToDecimal
- End Get
- Set(value As Decimal)
- ViewState("ImporteDocumento") = value
- End Set
- End Property
- Private Property Observaciones As String
- Get
- Return ViewState("Observaciones").ToString
- End Get
- Set(value As String)
- ViewState("Observaciones") = value
- End Set
- End Property
- Private Property Beneficiario As String
- Get
- Return ViewState("Beneficiario").ToString
- End Get
- Set(value As String)
- ViewState("Beneficiario") = value
- End Set
- End Property
- Private Property RowIndex As Integer
- Get
- Return ViewState("RowIndex").ToString.ToEntero
- End Get
- Set(value As Integer)
- ViewState("RowIndex") = value
- End Set
- End Property
- Private Property Actualizar As Boolean
- Get
- Return CBool(ViewState("Actualizar").ToString)
- End Get
- Set(value As Boolean)
- ViewState("Actualizar") = value
- End Set
- End Property
-
- Private ReadOnly Property CvePeriodo As Integer
- Get
- Return CType(ViewState("CvePeriodo"), Integer)
- End Get
- End Property
- Private ReadOnly Property CveProyecto As Integer
- Get
- Return CType(ViewState("CveProyecto"), Integer)
- End Get
- End Property
- Private ReadOnly Property CveSubProyecto As Integer
- Get
- Return CType(ViewState("CveSubProyecto"), Integer)
- End Get
- End Property
- Private ReadOnly Property CveTurno As Integer
- Get
- Return CType(ViewState("CveTurno"), Integer)
- End Get
- End Property
- Public Property IndiceGrid As Integer
- Get
- Return CType(ViewState("IndiceGrid"), Integer)
- End Get
- Set(value As Integer)
- ViewState("IndiceGrid") = value
- End Set
- End Property
- Public Property IdPoliza As Integer
- Get
- Return CType(ViewState("IdPoliza"), Integer)
- End Get
- Set(value As Integer)
- ViewState("IdPoliza") = value
- End Set
- End Property
-#End Region
+
- Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
-
- If Not Page.IsPostBack Then
+Imports System.Data
+Imports Extensiones
+Imports System.Linq
+Imports System.Web.Services
+
+Partial Class ContabilidadC_RegPrePoliza
+ Inherits ClsPaginas
+
+
+#Region "Propiedades"
+ Public Property ArregloMovs As ArrayList
+ Get
+ Return CType(ViewState("ArregloMovs"), ArrayList)
+ End Get
+ Set(value As ArrayList)
+ ViewState("ArregloMovs") = value
+ End Set
+ End Property
+ Public Property DtMovimientos As DataTable
+ Get
+ Return CType(ViewState("DtMovimientos"), DataTable)
+ End Get
+ Set(value As DataTable)
+ ViewState("DtMovimientos") = value
+ End Set
+ End Property
+ Public Property DtCuentasContables As DataTable
+ Get
+ Return CType(ViewState("DtCuentasContables"), DataTable)
+ End Get
+ Set(value As DataTable)
+ ViewState("DtCuentasContables") = value
+ End Set
+ End Property
+ Public Property TipoPlantilla As Integer
+ Get
+ Return CType(ViewState("TipoPlantilla"), Integer)
+ End Get
+ Set(value As Integer)
+ ViewState("TipoPlantilla") = value
+ End Set
+ End Property
+ Public Property CveMoneda As Integer
+ Get
+ Return CType(ViewState("CveMoneda"), Integer)
+ End Get
+ Set(value As Integer)
+ ViewState("CveMoneda") = value
+ End Set
+ End Property
+ Private ReadOnly Property CvePrePoliza As Integer
+ Get
+ Return ViewState("CvePrePoliza").ToString.ToEntero
+ End Get
+ End Property
+
+ 'PARA CREAR IE
+ Private Property CveConcepto As Integer
+ Get
+ Return ViewState("CveConcepto").ToString.ToEntero
+ End Get
+ Set(value As Integer)
+ ViewState("CveConcepto") = value
+ End Set
+ End Property
+ Private Property CveTipoTransaccion As Integer
+ Get
+ Return ViewState("CveTipoTransaccion").ToString.ToEntero
+ End Get
+ Set(value As Integer)
+ ViewState("CveTipoTransaccion") = value
+ End Set
+ End Property
+ Private Property CveCuenta As Integer
+ Get
+ Return ViewState("CveCuenta").ToString.ToEntero
+ End Get
+ Set(value As Integer)
+ ViewState("CveCuenta") = value
+ End Set
+ End Property
+ Private Property Folio As String
+ Get
+ Return ViewState("Folio").ToString
+ End Get
+ Set(value As String)
+ ViewState("Folio") = value
+ End Set
+ End Property
+ Private Property ImporteDocumento As Decimal
+ Get
+ Return ViewState("ImporteDocumento").ToString.ToDecimal
+ End Get
+ Set(value As Decimal)
+ ViewState("ImporteDocumento") = value
+ End Set
+ End Property
+ Private Property Observaciones As String
+ Get
+ Return ViewState("Observaciones").ToString
+ End Get
+ Set(value As String)
+ ViewState("Observaciones") = value
+ End Set
+ End Property
+ Private Property Beneficiario As String
+ Get
+ Return ViewState("Beneficiario").ToString
+ End Get
+ Set(value As String)
+ ViewState("Beneficiario") = value
+ End Set
+ End Property
+ Private Property RowIndex As Integer
+ Get
+ Return ViewState("RowIndex").ToString.ToEntero
+ End Get
+ Set(value As Integer)
+ ViewState("RowIndex") = value
+ End Set
+ End Property
+ Private Property Actualizar As Boolean
+ Get
+ Return CBool(ViewState("Actualizar").ToString)
+ End Get
+ Set(value As Boolean)
+ ViewState("Actualizar") = value
+ End Set
+ End Property
+
+ Private ReadOnly Property CvePeriodo As Integer
+ Get
+ Return CType(ViewState("CvePeriodo"), Integer)
+ End Get
+ End Property
+ Private ReadOnly Property CveProyecto As Integer
+ Get
+ Return CType(ViewState("CveProyecto"), Integer)
+ End Get
+ End Property
+ Private ReadOnly Property CveSubProyecto As Integer
+ Get
+ Return CType(ViewState("CveSubProyecto"), Integer)
+ End Get
+ End Property
+ Private ReadOnly Property CveTurno As Integer
+ Get
+ Return CType(ViewState("CveTurno"), Integer)
+ End Get
+ End Property
+ Public Property IndiceGrid As Integer
+ Get
+ Return CType(ViewState("IndiceGrid"), Integer)
+ End Get
+ Set(value As Integer)
+ ViewState("IndiceGrid") = value
+ End Set
+ End Property
+ Public Property IdPoliza As Integer
+ Get
+ Return CType(ViewState("IdPoliza"), Integer)
+ End Get
+ Set(value As Integer)
+ ViewState("IdPoliza") = value
+ End Set
+ End Property
+#End Region
+
+ Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
+
+ If Not Page.IsPostBack Then
If UsuarioActual.Empresa.TipoContabilizacion = 1 Then
Response.Redirect(Request.Url.PathAndQuery.Replace("RegPrePoliza", "RegPrePolizaS"))
- End If
-
- CveMoneda = 1
- ViewState("CvePrePoliza") = 0
- ViewState("CvePeriodo") = "0"
- CveConcepto = -1
- CveTipoTransaccion = -1
- CveCuenta = -1
- Folio = "-1"
- ImporteDocumento = -1
- Observaciones = "-1"
- Beneficiario = "-1"
- Actualizar = False
- IdPoliza = -1
-
- Dim dt As DataTable = Nothing
- ' If UsuarioActual.Empresa.UsaContabilidad Then
+ End If
+
+ CveMoneda = 1
+ ViewState("CvePrePoliza") = 0
+ ViewState("CvePeriodo") = "0"
+ CveConcepto = -1
+ CveTipoTransaccion = -1
+ CveCuenta = -1
+ Folio = "-1"
+ ImporteDocumento = -1
+ Observaciones = "-1"
+ Beneficiario = "-1"
+ Actualizar = False
+ IdPoliza = -1
+
+ Dim dt As DataTable = Nothing
+ ' If UsuarioActual.Empresa.UsaContabilidad Then
If UsuarioActual.Empresa.TipoContabilidad = 2 Then
Dim Conta As New ClsContPAQi(UsuarioActual.Empresa)
@@ -277,254 +277,254 @@ Partial Class ContabilidadC_RegPrePoliza
GvPrePoliza.Columns(3).Visible = False
GvConcepto.Columns(3).Visible = False
GvMov.Columns(4).Visible = False
- End If
-
- 'Else
- ' Alert("Este módulo requiere el uso de Contabilidad.", TipoMensaje.MsgAdvertencia)
- ' BtnIEGuardar.Enabled = False
- ' BtnEliminar.Visible = False
- ' LbAgregar.Enabled = False
- 'End If
-
- End If
-
- End Sub
-
-
- Private Sub CreaDT()
- DtMovimientos = New DataTable("Movimientos")
- Dim IDMov As DataColumn = DtMovimientos.Columns.Add("IdMov", Type.GetType("System.Int32")) : IDMov.AutoIncrement = True
- With DtMovimientos.Columns
- .Add("IdCuenta", Type.GetType("System.Int32"))
- .Add("CodigoCuenta", Type.GetType("System.String"))
- .Add("Cuenta", Type.GetType("System.String"))
- .Add("Referencia", Type.GetType("System.String"))
- .Add("Concepto", Type.GetType("System.String"))
- .Add("Cargo", Type.GetType("System.Decimal"))
- .Add("Abono", Type.GetType("System.Decimal"))
- .Add("TipoMovto", Type.GetType("System.Int32"))
- .Add("EsComodin", Type.GetType("System.Int32"))
- .Add("CveConcepto", Type.GetType("System.Int32"))
- .Add("CveSubProyecto", Type.GetType("System.Int32"))
- .Add("Descripcion", Type.GetType("System.String"))
- .Add("CveProveedor", Type.GetType("System.Int32"))
- .Add("CvePersonal", Type.GetType("System.Int32"))
- .Add("CveCompra", Type.GetType("System.Int32"))
- .Add("CveCliente", Type.GetType("System.Int32"))
- .Add("CveVenta", Type.GetType("System.Int32"))
- .Add("CveClasificacion", Type.GetType("System.Int32"))
- .Add("MultipleSubProyecto", Type.GetType("System.Boolean"))
- .Add("CveTipoGasto", Type.GetType("System.Int32"))
- .Add("CvePrePolizaDetalle", Type.GetType("System.Int32"))
- .Add("CveConceptoContable", Type.GetType("System.Int32"))
- .Add("IdCtaContable", Type.GetType("System.Int32"))
- .Add("CveOC", Type.GetType("System.Int32"))
- .Add("ConceptoContable", Type.GetType("System.String"))
- .Add("TC", Type.GetType("System.Decimal"))
- .Add("PorcentajeImpuesto", Type.GetType("System.Decimal"))
- .Add("CveCuenta", Type.GetType("System.Int32"))
- End With
- End Sub
-
- Private Sub CargaNomina()
- Dim CvePlantilla As Integer = DdlPlantilla.SelectedValue.ToEntero
- Dim ObjNomina As New ClsNominas
- Dim ObjConta As New ClsContabilidad
-
- Dim Dt As DataTable = Nothing
- Dim Cuenta As String = ""
- Dim Concepto As String = ""
- Dim IdCuenta As Integer = 0
- Dim TipoMovto As Integer
- Dim CveConcepto As Integer
- Dim CodigoCuenta As String = ""
- Dim NombreCuenta As String = ""
- Dim Referencia As String = ""
- Dim EsComodin As Integer = 0
- DtMovimientos.Clear()
-
- If ObjNomina.GetProvisionNomina(CveProyecto, CveSubProyecto, CveTurno, CvePeriodo, UsuarioActual.CveEmpresa) Then
- Dt = ObjNomina.DtResultados
-
- For Each drt As DataRow In Dt.Rows
- Dim dr As DataRow = DtMovimientos.NewRow
-
- If drt("NombreCompleto").ToString = "" AndAlso ObjConta.GetRetCuenta(31, UsuarioActual.CveEmpresa) Then
- CveConcepto = 98
- Cuenta = "Nominas por Pagar"
- IdCuenta = ObjConta.DtResultados(0)("IdCtaContable").ToString.ToEntero
- Concepto = "Pago Nomina"
- Referencia = "Pago Nomina"
- Else
- Concepto = drt("NombreCompleto")
- Referencia = ""
- CveConcepto = drt("CveConceptoContable").ToString.ToEntero
- Cuenta = drt("ConceptoContable").ToString
- IdCuenta = drt("IdCtaContable").ToString.ToEntero
- End If
-
- Dim drr As DataRow = DtCuentasContables.FiltroPrimero($"Id={IdCuenta}")
- CodigoCuenta = If(drr IsNot Nothing, drr("CuentaFormato").ToString(), "")
- NombreCuenta = If(drr IsNot Nothing, drr("Nombre").ToString(), "")
-
- TipoMovto = drt("TipoMovto")
-
- If TipoMovto = 0 Then
- dr("Cargo") = Math.Abs(drt("Importe").ToString.ToDecimal)
- dr("Abono") = 0
- Else
- dr("Cargo") = 0
- dr("Abono") = Math.Abs(drt("Importe").ToString.ToDecimal)
- End If
-
- dr("IdCuenta") = IdCuenta
- dr("CodigoCuenta") = CodigoCuenta & " " & NombreCuenta
- dr("Cuenta") = Cuenta
- dr("Concepto") = Concepto
- dr("Descripcion") = Concepto
- dr("Referencia") = Referencia
- dr("TipoMovto") = TipoMovto
- dr("EsComodin") = EsComodin
- dr("CveConcepto") = CveConcepto
- dr("CveProveedor") = "-1"
- dr("CveSubProyecto") = drt("CveSubProyecto")
- dr("CvePersonal") = drt("CvePersonal")
- dr("CveClasificacion") = drt("CveClasificacion")
- dr("CveTipoGasto") = drt("CveTipoGasto")
-
- DtMovimientos.Rows.Add(dr)
- Next
-
- GvMov.DataSource = DtMovimientos
- GvMov.DataBind()
- UPMovs.Update()
- End If
-
- End Sub
-
- Private Sub CargaPrePoliza()
- BtnEliminar.Visible = True
- LblEncabezado.Text = "Edición de Póliza"
-
- Dim ObjContabilidad As New ClsContabilidad
- If ObjContabilidad.GetPrePoliza(CvePrePoliza, UsuarioActual.CveEmpresa) Then
- Dim dr As DataRow = ObjContabilidad.DtResultados.FiltroPrimero("")
- If dr IsNot Nothing Then
- DdlTipoPoliza.SelectedValue = dr("CveTipoPoliza")
- TxtFechaDocumento.Text = dr("Fecha")
- TxtConcepto.Text = dr("Concepto")
- DivDatosPoliza.Visible = True
-
- If UsuarioActual.CveRol = 1 OrElse UsuarioActual.TienePermisoProceso(221) Then
- DivAgregarConceptos.Visible = True
- CargaConceptos()
- CargaSubProyectos()
- CargaCuentasContables()
- End If
-
- ObjContabilidad.GetContabilizacionDiarioDetalle(CvePrePoliza)
-
- DtMovimientos = ObjContabilidad.DtResultados.FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa}")
- GvPrePoliza.DataSource = DtMovimientos
- GvPrePoliza.DataBind()
-
- If DtMovimientos.FiltraParametros("CveConceptoContable IN (2,17)").Rows.Count > 0 Then
- LnkComplementoPago.Visible = True
- End If
-
- IdPoliza = dr("IdPoliza").ToString.ToEntero
- If dr("IdPoliza").ToString.ToEntero > 0 Then
- HplContabilizada.NavigateUrl = String.Format("RegPoliza.aspx?IdPoliza={0}", dr("IdPoliza"))
- divContabilziada.Visible = True
- BtnEliminar.Visible = False
- If UsuarioActual.CveUsuario = 100 Then
- BtnContabilizar.Visible = True
- BtnContabilizar.Text = "Actualizar Poliza"
- End If
- ElseIf TxtTotalCargos.Text.ToDouble = TxtTotalAbonos.Text.ToDouble Then
- 'sino está contabilizada, se activa el botón
- BtnContabilizar.Visible = True
- End If
-
- divDatosPrincipales.Visible = False
- divObservaciones.Visible = False
- UPMovs.Visible = False
- UPMovs.Update()
- UPPDocumento.Update()
- UpPrePoliza.Update()
-
- RegistraScript("comparar();")
-
- If Request("Tipo") IsNot Nothing AndAlso IsNumeric(Request("Tipo")) AndAlso Request("Tipo").ToEntero = 1 AndAlso UsuarioActual.CveUsuario <> 100 Then
- For Each row As GridViewRow In GvPrePoliza.Rows
- row.FCTextBox("TxtCargo").Enabled = False
- row.FCTextBox("TxtAbono").Enabled = False
- Next
- End If
-
- Else
- Alert("El documento solicitado no existe, favor de revisar su búsqueda.", TipoMensaje.MsgAdvertencia)
- BtnEliminar.Visible = False
- End If
-
- End If
- CargaGvBitacora()
- ObjContabilidad.Dispose()
- UpPoliza.Update()
- UpBitacora.Update()
- End Sub
-
- Private Sub GvPrePoliza_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvPrePoliza.RowDataBound
-
- If e.Row.RowType = DataControlRowType.DataRow Then
-
- 'Asignamos los Subproyectos
- e.Row.FCDropDownList("DdlSubProyecto").DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
- e.Row.FCDropDownList("DdlSubProyecto").DataBind()
- e.Row.FCDropDownList("DdlSubProyecto").Items.Insert(0, New ListItem(" - ", "-1"))
- e.Row.FCDropDownList("DdlSubProyecto").SelectedValueExist(e.Row.DataKey("CveSubProyecto"))
-
- 'Asignamos los Tipos de Gasto
- e.Row.FCDropDownList("DdlTipoGasto").DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa)
- e.Row.FCDropDownList("DdlTipoGasto").DataBind()
- e.Row.FCDropDownList("DdlTipoGasto").Items.Insert(0, New ListItem("Sin Asignar", "-1"))
- e.Row.FCDropDownList("DdlTipoGasto").SelectedValueExist(e.Row.DataKey("CveTipoGasto"))
-
- 'ASignamos las CuentasContables
- e.Row.FCDropDownList("DdlCtaContable").DataSource = Session("DtCuentas")
- e.Row.FCDropDownList("DdlCtaContable").DataBind()
- e.Row.FCDropDownList("DdlCtaContable").Items.Insert(0, New ListItem("Sin Asignar", "0"))
- e.Row.FCDropDownList("DdlCtaContable").SelectedValueExist(e.Row.DataKey("IdCtaContable"))
-
- TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + e.Row.FCTextBox("TxtCargo").Text.ToDouble).ToString.FormatoNumero
- TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + e.Row.FCTextBox("TxtAbono").Text.ToDouble).ToString.FormatoNumero
-
- Dim CveConceptoContable As Integer = e.Row.DataKey("CveConceptoContable").ToEntero
-
- If CveConceptoContable.Contiene(1, 2, 12, 13, 38, 207, 203, 39, 61, 62, 63, 150, 251, 226) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveVenta={0}", e.Row.DataKey("CveVenta"))
- If CveConceptoContable.Contiene(5, 6, 17, 18, 14, 19, 25, 26, 60, 205, 225, 234, 235, 240) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Compras/Compras.aspx?CveCompra={0}", e.Row.DataKey("CveCompra"))
- If CveConceptoContable.Contiene(176) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/OC/OC.aspx?CveOrdenCompra={0}", e.Row.DataKey("CveOC"))
- If CveConceptoContable.Contiene(68) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}", e.Row.DBCampo("CveMovimientoAlmacen"))
- If CveConceptoContable.Contiene(30, 204) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Bancos/IE.aspx?CveIE={0}", e.Row.DBCampo("CveIE"))
-
-
- 'e.Row.FCHyperLink("HlReferencia").NavigateUrl = CveConceptoContable
-
- End If
-
- If e.Row.RowType = DataControlRowType.Header Then
- e.Row.FCDropDownList("DdlSubProyectoFiltro").DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
- e.Row.FCDropDownList("DdlSubProyectoFiltro").DataBind()
- e.Row.FCDropDownList("DdlSubProyectoFiltro").Items.Insert(0, New ListItem("Todos", "-1"))
- End If
-
- End Sub
-
- Private Sub CargaPlantillas(TipoPlantilla As Integer)
-
- 'GvPlantillas.DataSource = GlobalDTContaPlantillasPolizas(UsuarioActual.CveEmpresa, TipoPlantilla)
- 'GvPlantillas.DataBind()
-
+ End If
+
+ 'Else
+ ' Alert("Este módulo requiere el uso de Contabilidad.", TipoMensaje.MsgAdvertencia)
+ ' BtnIEGuardar.Enabled = False
+ ' BtnEliminar.Visible = False
+ ' LbAgregar.Enabled = False
+ 'End If
+
+ End If
+
+ End Sub
+
+
+ Private Sub CreaDT()
+ DtMovimientos = New DataTable("Movimientos")
+ Dim IDMov As DataColumn = DtMovimientos.Columns.Add("IdMov", Type.GetType("System.Int32")) : IDMov.AutoIncrement = True
+ With DtMovimientos.Columns
+ .Add("IdCuenta", Type.GetType("System.Int32"))
+ .Add("CodigoCuenta", Type.GetType("System.String"))
+ .Add("Cuenta", Type.GetType("System.String"))
+ .Add("Referencia", Type.GetType("System.String"))
+ .Add("Concepto", Type.GetType("System.String"))
+ .Add("Cargo", Type.GetType("System.Decimal"))
+ .Add("Abono", Type.GetType("System.Decimal"))
+ .Add("TipoMovto", Type.GetType("System.Int32"))
+ .Add("EsComodin", Type.GetType("System.Int32"))
+ .Add("CveConcepto", Type.GetType("System.Int32"))
+ .Add("CveSubProyecto", Type.GetType("System.Int32"))
+ .Add("Descripcion", Type.GetType("System.String"))
+ .Add("CveProveedor", Type.GetType("System.Int32"))
+ .Add("CvePersonal", Type.GetType("System.Int32"))
+ .Add("CveCompra", Type.GetType("System.Int32"))
+ .Add("CveCliente", Type.GetType("System.Int32"))
+ .Add("CveVenta", Type.GetType("System.Int32"))
+ .Add("CveClasificacion", Type.GetType("System.Int32"))
+ .Add("MultipleSubProyecto", Type.GetType("System.Boolean"))
+ .Add("CveTipoGasto", Type.GetType("System.Int32"))
+ .Add("CvePrePolizaDetalle", Type.GetType("System.Int32"))
+ .Add("CveConceptoContable", Type.GetType("System.Int32"))
+ .Add("IdCtaContable", Type.GetType("System.Int32"))
+ .Add("CveOC", Type.GetType("System.Int32"))
+ .Add("ConceptoContable", Type.GetType("System.String"))
+ .Add("TC", Type.GetType("System.Decimal"))
+ .Add("PorcentajeImpuesto", Type.GetType("System.Decimal"))
+ .Add("CveCuenta", Type.GetType("System.Int32"))
+ End With
+ End Sub
+
+ Private Sub CargaNomina()
+ Dim CvePlantilla As Integer = DdlPlantilla.SelectedValue.ToEntero
+ Dim ObjNomina As New ClsNominas
+ Dim ObjConta As New ClsContabilidad
+
+ Dim Dt As DataTable = Nothing
+ Dim Cuenta As String = ""
+ Dim Concepto As String = ""
+ Dim IdCuenta As Integer = 0
+ Dim TipoMovto As Integer
+ Dim CveConcepto As Integer
+ Dim CodigoCuenta As String = ""
+ Dim NombreCuenta As String = ""
+ Dim Referencia As String = ""
+ Dim EsComodin As Integer = 0
+ DtMovimientos.Clear()
+
+ If ObjNomina.GetProvisionNomina(CveProyecto, CveSubProyecto, CveTurno, CvePeriodo, UsuarioActual.CveEmpresa) Then
+ Dt = ObjNomina.DtResultados
+
+ For Each drt As DataRow In Dt.Rows
+ Dim dr As DataRow = DtMovimientos.NewRow
+
+ If drt("NombreCompleto").ToString = "" AndAlso ObjConta.GetRetCuenta(31, UsuarioActual.CveEmpresa) Then
+ CveConcepto = 98
+ Cuenta = "Nominas por Pagar"
+ IdCuenta = ObjConta.DtResultados(0)("IdCtaContable").ToString.ToEntero
+ Concepto = "Pago Nomina"
+ Referencia = "Pago Nomina"
+ Else
+ Concepto = drt("NombreCompleto")
+ Referencia = ""
+ CveConcepto = drt("CveConceptoContable").ToString.ToEntero
+ Cuenta = drt("ConceptoContable").ToString
+ IdCuenta = drt("IdCtaContable").ToString.ToEntero
+ End If
+
+ Dim drr As DataRow = DtCuentasContables.FiltroPrimero($"Id={IdCuenta}")
+ CodigoCuenta = If(drr IsNot Nothing, drr("CuentaFormato").ToString(), "")
+ NombreCuenta = If(drr IsNot Nothing, drr("Nombre").ToString(), "")
+
+ TipoMovto = drt("TipoMovto")
+
+ If TipoMovto = 0 Then
+ dr("Cargo") = Math.Abs(drt("Importe").ToString.ToDecimal)
+ dr("Abono") = 0
+ Else
+ dr("Cargo") = 0
+ dr("Abono") = Math.Abs(drt("Importe").ToString.ToDecimal)
+ End If
+
+ dr("IdCuenta") = IdCuenta
+ dr("CodigoCuenta") = CodigoCuenta & " " & NombreCuenta
+ dr("Cuenta") = Cuenta
+ dr("Concepto") = Concepto
+ dr("Descripcion") = Concepto
+ dr("Referencia") = Referencia
+ dr("TipoMovto") = TipoMovto
+ dr("EsComodin") = EsComodin
+ dr("CveConcepto") = CveConcepto
+ dr("CveProveedor") = "-1"
+ dr("CveSubProyecto") = drt("CveSubProyecto")
+ dr("CvePersonal") = drt("CvePersonal")
+ dr("CveClasificacion") = drt("CveClasificacion")
+ dr("CveTipoGasto") = drt("CveTipoGasto")
+
+ DtMovimientos.Rows.Add(dr)
+ Next
+
+ GvMov.DataSource = DtMovimientos
+ GvMov.DataBind()
+ UPMovs.Update()
+ End If
+
+ End Sub
+
+ Private Sub CargaPrePoliza()
+ BtnEliminar.Visible = True
+ LblEncabezado.Text = "Edición de Póliza"
+
+ Dim ObjContabilidad As New ClsContabilidad
+ If ObjContabilidad.GetPrePoliza(CvePrePoliza, UsuarioActual.CveEmpresa) Then
+ Dim dr As DataRow = ObjContabilidad.DtResultados.FiltroPrimero("")
+ If dr IsNot Nothing Then
+ DdlTipoPoliza.SelectedValue = dr("CveTipoPoliza")
+ TxtFechaDocumento.Text = dr("Fecha")
+ TxtConcepto.Text = dr("Concepto")
+ DivDatosPoliza.Visible = True
+
+ If UsuarioActual.CveRol = 1 OrElse UsuarioActual.TienePermisoProceso(221) Then
+ DivAgregarConceptos.Visible = True
+ CargaConceptos()
+ CargaSubProyectos()
+ CargaCuentasContables()
+ End If
+
+ ObjContabilidad.GetContabilizacionDiarioDetalle(CvePrePoliza)
+
+ DtMovimientos = ObjContabilidad.DtResultados.FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa}")
+ GvPrePoliza.DataSource = DtMovimientos
+ GvPrePoliza.DataBind()
+
+ If DtMovimientos.FiltraParametros("CveConceptoContable IN (2,17)").Rows.Count > 0 Then
+ LnkComplementoPago.Visible = True
+ End If
+
+ IdPoliza = dr("IdPoliza").ToString.ToEntero
+ If dr("IdPoliza").ToString.ToEntero > 0 Then
+ HplContabilizada.NavigateUrl = String.Format("RegPoliza.aspx?IdPoliza={0}", dr("IdPoliza"))
+ divContabilziada.Visible = True
+ BtnEliminar.Visible = False
+ If UsuarioActual.CveUsuario = 100 Then
+ BtnContabilizar.Visible = True
+ BtnContabilizar.Text = "Actualizar Poliza"
+ End If
+ ElseIf TxtTotalCargos.Text.ToDouble = TxtTotalAbonos.Text.ToDouble Then
+ 'sino está contabilizada, se activa el botón
+ BtnContabilizar.Visible = True
+ End If
+
+ divDatosPrincipales.Visible = False
+ divObservaciones.Visible = False
+ UPMovs.Visible = False
+ UPMovs.Update()
+ UPPDocumento.Update()
+ UpPrePoliza.Update()
+
+ RegistraScript("comparar();")
+
+ If Request("Tipo") IsNot Nothing AndAlso IsNumeric(Request("Tipo")) AndAlso Request("Tipo").ToEntero = 1 AndAlso UsuarioActual.CveUsuario <> 100 Then
+ For Each row As GridViewRow In GvPrePoliza.Rows
+ row.FCTextBox("TxtCargo").Enabled = False
+ row.FCTextBox("TxtAbono").Enabled = False
+ Next
+ End If
+
+ Else
+ Alert("El documento solicitado no existe, favor de revisar su búsqueda.", TipoMensaje.MsgAdvertencia)
+ BtnEliminar.Visible = False
+ End If
+
+ End If
+ CargaGvBitacora()
+ ObjContabilidad.Dispose()
+ UpPoliza.Update()
+ UpBitacora.Update()
+ End Sub
+
+ Private Sub GvPrePoliza_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvPrePoliza.RowDataBound
+
+ If e.Row.RowType = DataControlRowType.DataRow Then
+
+ 'Asignamos los Subproyectos
+ e.Row.FCDropDownList("DdlSubProyecto").DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
+ e.Row.FCDropDownList("DdlSubProyecto").DataBind()
+ e.Row.FCDropDownList("DdlSubProyecto").Items.Insert(0, New ListItem(" - ", "-1"))
+ e.Row.FCDropDownList("DdlSubProyecto").SelectedValueExist(e.Row.DataKey("CveSubProyecto"))
+
+ 'Asignamos los Tipos de Gasto
+ e.Row.FCDropDownList("DdlTipoGasto").DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa)
+ e.Row.FCDropDownList("DdlTipoGasto").DataBind()
+ e.Row.FCDropDownList("DdlTipoGasto").Items.Insert(0, New ListItem("Sin Asignar", "-1"))
+ e.Row.FCDropDownList("DdlTipoGasto").SelectedValueExist(e.Row.DataKey("CveTipoGasto"))
+
+ 'ASignamos las CuentasContables
+ e.Row.FCDropDownList("DdlCtaContable").DataSource = Session("DtCuentas")
+ e.Row.FCDropDownList("DdlCtaContable").DataBind()
+ e.Row.FCDropDownList("DdlCtaContable").Items.Insert(0, New ListItem("Sin Asignar", "0"))
+ e.Row.FCDropDownList("DdlCtaContable").SelectedValueExist(e.Row.DataKey("IdCtaContable"))
+
+ TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + e.Row.FCTextBox("TxtCargo").Text.ToDouble).ToString.FormatoNumero
+ TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + e.Row.FCTextBox("TxtAbono").Text.ToDouble).ToString.FormatoNumero
+
+ Dim CveConceptoContable As Integer = e.Row.DataKey("CveConceptoContable").ToEntero
+
+ If CveConceptoContable.Contiene(1, 2, 12, 13, 38, 207, 203, 39, 61, 62, 63, 150, 251, 226) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveVenta={0}", e.Row.DataKey("CveVenta"))
+ If CveConceptoContable.Contiene(5, 6, 17, 18, 14, 19, 25, 26, 60, 205, 225, 234, 235, 240) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Compras/Compras.aspx?CveCompra={0}", e.Row.DataKey("CveCompra"))
+ If CveConceptoContable.Contiene(176) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/OC/OC.aspx?CveOrdenCompra={0}", e.Row.DataKey("CveOC"))
+ If CveConceptoContable.Contiene(68) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}", e.Row.DBCampo("CveMovimientoAlmacen"))
+ If CveConceptoContable.Contiene(30, 204) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Bancos/IE.aspx?CveIE={0}", e.Row.DBCampo("CveIE"))
+
+
+ 'e.Row.FCHyperLink("HlReferencia").NavigateUrl = CveConceptoContable
+
+ End If
+
+ If e.Row.RowType = DataControlRowType.Header Then
+ e.Row.FCDropDownList("DdlSubProyectoFiltro").DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
+ e.Row.FCDropDownList("DdlSubProyectoFiltro").DataBind()
+ e.Row.FCDropDownList("DdlSubProyectoFiltro").Items.Insert(0, New ListItem("Todos", "-1"))
+ End If
+
+ End Sub
+
+ Private Sub CargaPlantillas(TipoPlantilla As Integer)
+
+ 'GvPlantillas.DataSource = GlobalDTContaPlantillasPolizas(UsuarioActual.CveEmpresa, TipoPlantilla)
+ 'GvPlantillas.DataBind()
+
If UsuarioActual.CveEmpresa.Contiene(120) Then
DdlPlantilla.DataSource = GlobalDTContaPlantillasPolizas(UsuarioActual.CveEmpresa, -1)
Else
@@ -532,304 +532,315 @@ Partial Class ContabilidadC_RegPrePoliza
End If
- DdlPlantilla.DataBind()
- DdlPlantilla.Items.Insert(0, New ListItem("Plantilla Personalizada", "53"))
- End Sub
-
- Private Sub CargaConceptos()
- DdlConceptosContables.DataSource = GlobalDTContaConceptosContables(-1)
- DdlConceptosContables.DataBind()
- End Sub
-
- Private Sub DdlConceptosContables_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlConceptosContables.SelectedIndexChanged
- If DdlConceptosContables.SelectedValue.ToEntero.Contiene(5, 17, 201, 205, 206, 14, 15, 16, 19, 25, 26, 21) Then
- CargaProveedores()
- DdlProveedores.Visible = True
- DdlCompras.Visible = True
- Else
- DdlProveedores.Visible = False
- DdlCompras.Visible = False
- End If
-
- If DdlConceptosContables.SelectedValue.ToEntero.Contiene(28, 29) Then
- CargaPersonal()
- DdlPersonal.Visible = True
- Else
- DdlPersonal.Visible = False
- End If
- If DdlConceptosContables.SelectedValue.ToEntero.Contiene(1, 2, 203, 207, 13, 61, 8, 9, 62, 63, 38, 39) Then
- CargaClientes()
- DdlClientes.Visible = True
- DdlVentas.Visible = True
- Else
- DdlClientes.Visible = False
- DdlVentas.Visible = False
- End If
-
- If DdlConceptosContables.SelectedValue.ToEntero.Contiene(201, 202, 203, 204, 206, 207, 226, 227, 229, 233, 234, 235, 239, 242, 256, 266) Then
- TxtTC.Text = "2"
- TxtTC.Visible = True
- Else
- TxtTC.Text = ""
- TxtTC.Visible = False
+ DdlPlantilla.DataBind()
+ DdlPlantilla.Items.Insert(0, New ListItem("Plantilla Personalizada", "53"))
+ End Sub
+
+ Private Sub CargaConceptos()
+ DdlConceptosContables.DataSource = GlobalDTContaConceptosContables(-1)
+ DdlConceptosContables.DataBind()
+ End Sub
+
+ Private Sub DdlConceptosContables_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlConceptosContables.SelectedIndexChanged
+ If DdlConceptosContables.SelectedValue.ToEntero.Contiene(5, 17, 201, 205, 206, 14, 15, 16, 19, 25, 26, 21) Then
+ CargaProveedores()
+ DdlProveedores.Visible = True
+ DdlCompras.Visible = True
+ Else
+ DdlProveedores.Visible = False
+ DdlCompras.Visible = False
+ End If
+
+ If DdlConceptosContables.SelectedValue.ToEntero.Contiene(28, 29) Then
+ CargaPersonal()
+ DdlPersonal.Visible = True
+ Else
+ DdlPersonal.Visible = False
+ End If
+ If DdlConceptosContables.SelectedValue.ToEntero.Contiene(1, 2, 203, 207, 13, 61, 8, 9, 62, 63, 38, 39) Then
+ CargaClientes()
+ DdlClientes.Visible = True
+ DdlVentas.Visible = True
+ Else
+ DdlClientes.Visible = False
+ DdlVentas.Visible = False
+ End If
+
+ If DdlConceptosContables.SelectedValue.ToEntero.Contiene(51) Then
+ CargaClasificacionesE()
+ DdlClasificacionesE.Visible = True
+ Else
+ DdlClasificacionesE.Visible = False
+ End If
+
+ If DdlConceptosContables.SelectedValue.ToEntero.Contiene(201, 202, 203, 204, 206, 207, 226, 227, 229, 233, 234, 235, 239, 242, 256, 266) Then
+ TxtTC.Text = "2"
+ TxtTC.Visible = True
+ Else
+ TxtTC.Text = ""
+ TxtTC.Visible = False
End If
If DdlConceptosContables.SelectedValue.ToEntero.Contiene(69) Then
CargaClasificaciones()
- DdlClasificaciones.Visible = True
+ DdlClasificaciones.Visible = True
Else
- TxtTC.Text = ""
- DdlClasificaciones.Visible = False
+ TxtTC.Text = ""
+ DdlClasificaciones.Visible = False
End If
- End Sub
-
- Private Sub DdlProveedores_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlProveedores.SelectedIndexChanged
- CargaCompras(DdlProveedores.SelectedValue.ToEntero)
- End Sub
-
- Private Sub DdlClientes_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlClientes.selectedindexchange
- CargaVentas(DdlClientes.SelectedValue.ToEntero)
- End Sub
-
- Private Sub CargaSubProyectos()
- DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
- DdlSubProyecto.DataBind()
- DdlSubProyecto.Items.Insert(0, New ListItem(" - ", "-1"))
- DdlSubProyectoFiltroMov.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
- DdlSubProyectoFiltroMov.DataBind()
- DdlSubProyectoFiltroMov.Items.Insert(0, New ListItem("Todos", "-1"))
- End Sub
-
- Private Sub CargaCuentasContables()
- DdlCtaContable.DataSource = Session("DtCuentas")
- DdlCtaContable.DataBind()
- DdlCtaContable.Items.Insert(0, New ListItem("Sin Asignar", "0"))
- End Sub
-
- Private Sub CargaTiposGasto()
- DdlTipoGasto.DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa)
- DdlTipoGasto.DataBind()
- DdlTipoGasto.Items.Insert(0, New ListItem("Sin Asignar", "0"))
- End Sub
-
- Private Sub CargaProveedores()
- DdlProveedores.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
- DdlProveedores.DataBind()
- DdlProveedores.Items.Insert(0, New ListItem(" - ", "-1"))
- End Sub
-
- Private Sub CargaCompras(CveProveedor As Integer)
- If Not DdlConceptosContables.SelectedValue.ToEntero.Contiene(21) Then
- Dim ObjCompras As New ClsCompras
-
- DdlCompras.ClearSelection()
- If ObjCompras.GetCompras(-1, "-1", "-1", CveProveedor, -1, UsuarioActual.CveEmpresa) Then
- DdlCompras.DataSource = ObjCompras.DtResultados.FiltraParametros("Saldo > 0")
- DdlCompras.DataBind()
- DdlCompras.Items.Insert(0, New ListItem(" - ", "-1"))
- Else
- DdlCompras.DataSource = Nothing
- DdlCompras.DataBind()
- DdlCompras.Items.Insert(0, New ListItem(" - ", "-1"))
- End If
- ObjCompras.Dispose()
- End If
- End Sub
-
- Private Sub CargaClientes()
- DdlClientes.setEsWebService(True)
- DdlClientes.Attributes.Add("data-metodo", "getcliente")
- DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa)
- DdlClientes.DataBind()
- ' DdlClientes.Items.Insert(0, New ListItem(" - ", "-1"))
+ End Sub
+
+ Private Sub DdlProveedores_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlProveedores.SelectedIndexChanged
+ CargaCompras(DdlProveedores.SelectedValue.ToEntero)
+ End Sub
+
+ Private Sub DdlClientes_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlClientes.selectedindexchange
+ CargaVentas(DdlClientes.SelectedValue.ToEntero)
+ End Sub
+
+ Private Sub CargaSubProyectos()
+ DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
+ DdlSubProyecto.DataBind()
+ DdlSubProyecto.Items.Insert(0, New ListItem(" - ", "-1"))
+ DdlSubProyectoFiltroMov.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
+ DdlSubProyectoFiltroMov.DataBind()
+ DdlSubProyectoFiltroMov.Items.Insert(0, New ListItem("Todos", "-1"))
+ End Sub
+
+ Private Sub CargaCuentasContables()
+ DdlCtaContable.DataSource = Session("DtCuentas")
+ DdlCtaContable.DataBind()
+ DdlCtaContable.Items.Insert(0, New ListItem("Sin Asignar", "0"))
+ End Sub
+
+ Private Sub CargaTiposGasto()
+ DdlTipoGasto.DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa)
+ DdlTipoGasto.DataBind()
+ DdlTipoGasto.Items.Insert(0, New ListItem("Sin Asignar", "0"))
+ End Sub
+
+ Private Sub CargaProveedores()
+ DdlProveedores.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
+ DdlProveedores.DataBind()
+ DdlProveedores.Items.Insert(0, New ListItem(" - ", "-1"))
+ End Sub
+
+ Private Sub CargaCompras(CveProveedor As Integer)
+ If Not DdlConceptosContables.SelectedValue.ToEntero.Contiene(21) Then
+ Dim ObjCompras As New ClsCompras
+
+ DdlCompras.ClearSelection()
+ If ObjCompras.GetCompras(-1, "-1", "-1", CveProveedor, -1, UsuarioActual.CveEmpresa) Then
+ DdlCompras.DataSource = ObjCompras.DtResultados.FiltraParametros("Saldo > 0")
+ DdlCompras.DataBind()
+ DdlCompras.Items.Insert(0, New ListItem(" - ", "-1"))
+ Else
+ DdlCompras.DataSource = Nothing
+ DdlCompras.DataBind()
+ DdlCompras.Items.Insert(0, New ListItem(" - ", "-1"))
+ End If
+ ObjCompras.Dispose()
+ End If
+ End Sub
+
+ Private Sub CargaClientes()
+ DdlClientes.setEsWebService(True)
+ DdlClientes.Attributes.Add("data-metodo", "getcliente")
+ DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa)
+ DdlClientes.DataBind()
+ ' DdlClientes.Items.Insert(0, New ListItem(" - ", "-1"))
End Sub
Private Sub CargaClasificaciones()
- DdlClasificaciones.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa)
- DdlClasificaciones.DataBind()
- ' DdlClientes.Items.Insert(0, New ListItem(" - ", "-1"))
- End Sub
-
- Private Sub CargaVentas(CveCliente As Integer)
- Dim ObjVentas As New ClsVentas
-
- DdlVentas.ClearSelection()
- If ObjVentas.GetVentas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1", CveCliente, -1, -1, -1, "-1", "-1", "-1", CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then
- DdlVentas.DataSource = ObjVentas.DtResultados '.FiltraParametros("Saldo > 0")
- DdlVentas.DataBind()
- DdlVentas.Items.Insert(0, New ListItem(" - ", "-1"))
- Else
- DdlVentas.DataSource = Nothing
- DdlVentas.DataBind()
- DdlVentas.Items.Insert(0, New ListItem(" - ", "-1"))
- End If
- ObjVentas.Dispose()
- End Sub
-
- Private Sub CargaPersonal()
- DdlPersonal.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa)
- DdlPersonal.DataBind()
- DdlPersonal.Items.Insert(0, New ListItem(" - ", "-1"))
- End Sub
-
-
- Protected Sub DdlPlantilla_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPlantilla.SelectedIndexChanged
-
- TxtTotalAbonos.Text = ""
- TxtTotalCargos.Text = ""
-
- If DdlPlantilla.SelectedValue.ToEntero <= 0 Then
- Alert("Seleccione un Movimiento Válido", TipoMensaje.MsgAdvertencia)
- DdlPlantilla.SelectedValue = "-1"
- Exit Sub
- End If
-
- If DdlPlantilla.SelectedValue.ToEntero = 53 Then 'Plantilla Personalizada
- DivAgregarConceptos.Visible = True
- Else
- DivAgregarConceptos.Visible = False
- End If
-
-
-
- Dim CvePlantilla As Integer = DdlPlantilla.SelectedValue.ToEntero
-
- Dim Dt As DataTable = GlobalDTContaPlantillasPolizasDetalle(CvePlantilla).FiltraParametros(String.Format("CveEmpresa={0}", UsuarioActual.CveEmpresa), "Orden")
- Dim Cuenta As String = ""
- Dim IdCuenta As Integer = 0
- Dim CodigoCuenta As String = ""
- Dim NombreCuenta As String = ""
- Dim EsComodin As Integer = 0
- DtMovimientos.Clear()
-
- For Each drt As DataRow In Dt.Rows
-
- Cuenta = drt("ConceptoContable").ToString
- IdCuenta = 0
- CodigoCuenta = ""
- NombreCuenta = ""
- If drt("IdCtaContable").ToString.ToEntero > 0 Then 'DtCuentasContables
- Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", drt("IdCtaContable").ToString))
- If drr IsNot Nothing Then
- IdCuenta = drt("IdCtaContable").ToString.ToEntero
- CodigoCuenta = drr("CuentaFormato").ToString()
+ DdlClasificaciones.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa)
+ DdlClasificaciones.DataBind()
+ ' DdlClientes.Items.Insert(0, New ListItem(" - ", "-1"))
+ End Sub
+
+ Private Sub CargaVentas(CveCliente As Integer)
+ Dim ObjVentas As New ClsVentas
+
+ DdlVentas.ClearSelection()
+ If ObjVentas.GetVentas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1", CveCliente, -1, -1, -1, "-1", "-1", "-1", CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then
+ DdlVentas.DataSource = ObjVentas.DtResultados '.FiltraParametros("Saldo > 0")
+ DdlVentas.DataBind()
+ DdlVentas.Items.Insert(0, New ListItem(" - ", "-1"))
+ Else
+ DdlVentas.DataSource = Nothing
+ DdlVentas.DataBind()
+ DdlVentas.Items.Insert(0, New ListItem(" - ", "-1"))
+ End If
+ ObjVentas.Dispose()
+ End Sub
+
+ Private Sub CargaPersonal()
+ DdlPersonal.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa)
+ DdlPersonal.DataBind()
+ DdlPersonal.Items.Insert(0, New ListItem(" - ", "-1"))
+ End Sub
+
+ Private Sub CargaClasificacionesE()
+ DdlClasificacionesE.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa)
+ DdlClasificacionesE.DataBind()
+ DdlClasificacionesE.Items.Insert(0, New ListItem(" - ", "-1"))
+ End Sub
+ Protected Sub DdlPlantilla_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPlantilla.SelectedIndexChanged
+
+ TxtTotalAbonos.Text = ""
+ TxtTotalCargos.Text = ""
+
+ If DdlPlantilla.SelectedValue.ToEntero <= 0 Then
+ Alert("Seleccione un Movimiento Válido", TipoMensaje.MsgAdvertencia)
+ DdlPlantilla.SelectedValue = "-1"
+ Exit Sub
+ End If
+
+ If DdlPlantilla.SelectedValue.ToEntero = 53 Then 'Plantilla Personalizada
+ DivAgregarConceptos.Visible = True
+ Else
+ DivAgregarConceptos.Visible = False
+ End If
+
+
+
+ Dim CvePlantilla As Integer = DdlPlantilla.SelectedValue.ToEntero
+
+ Dim Dt As DataTable = GlobalDTContaPlantillasPolizasDetalle(CvePlantilla).FiltraParametros(String.Format("CveEmpresa={0}", UsuarioActual.CveEmpresa), "Orden")
+ Dim Cuenta As String = ""
+ Dim IdCuenta As Integer = 0
+ Dim CodigoCuenta As String = ""
+ Dim NombreCuenta As String = ""
+ Dim EsComodin As Integer = 0
+ DtMovimientos.Clear()
+
+ For Each drt As DataRow In Dt.Rows
+
+ Cuenta = drt("ConceptoContable").ToString
+ IdCuenta = 0
+ CodigoCuenta = ""
+ NombreCuenta = ""
+ If drt("IdCtaContable").ToString.ToEntero > 0 Then 'DtCuentasContables
+ Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", drt("IdCtaContable").ToString))
+ If drr IsNot Nothing Then
+ IdCuenta = drt("IdCtaContable").ToString.ToEntero
+ CodigoCuenta = drr("CuentaFormato").ToString()
NombreCuenta = drr("Nombre").ToString()
'Cuenta = drr("Nombre").ToString()
- NombreCuenta = CodigoCuenta & " " & NombreCuenta
- End If
- EsComodin = 0
- End If
-
+ NombreCuenta = CodigoCuenta & " " & NombreCuenta
+ End If
+ EsComodin = 0
+ End If
+
If drt("CveCuenta").ToString.ToEntero > 0 Then
NombreCuenta = String.Format("{0} {1}", drt("Codigo"), drt("Nombre"))
- End If
-
- Dim dr As DataRow = DtMovimientos.NewRow
- dr("IdCuenta") = IdCuenta
- dr("CodigoCuenta") = NombreCuenta
- dr("Cuenta") = Cuenta 'TxtCuentaContable.Text
- dr("Referencia") = If(drt("CveConcepto").ToString.Contiene("29", "130"), drt("Personal"), drt("RazonSocial"))
- dr("Concepto") = TxtObservaciones.Text
- dr("TipoMovto") = If(drt("TipoMovto").ToString = "False", 0, 1)
- dr("EsComodin") = EsComodin
- dr("CveConcepto") = drt("CveConcepto")
- dr("CveSubProyecto") = drt("CveSubProyectoNegativo")
- dr("Cargo") = TxtCargo.Text.ToDouble
- dr("Abono") = TxtAbono.Text.ToDouble
- dr("CveProveedor") = drt("CveProveedor")
- dr("CvePersonal") = drt("CvePersonal")
- dr("CveClasificacion") = -1
+ End If
+
+ Dim dr As DataRow = DtMovimientos.NewRow
+ dr("IdCuenta") = IdCuenta
+ dr("CodigoCuenta") = NombreCuenta
+ dr("Cuenta") = Cuenta 'TxtCuentaContable.Text
+ dr("Referencia") = If(drt("CveConcepto").ToString.Contiene("29", "130"), drt("Personal"), drt("RazonSocial"))
+ dr("Concepto") = TxtObservaciones.Text
+ dr("TipoMovto") = If(drt("TipoMovto").ToString = "False", 0, 1)
+ dr("EsComodin") = EsComodin
+ dr("CveConcepto") = drt("CveConcepto")
+ dr("CveSubProyecto") = drt("CveSubProyectoNegativo")
+ dr("Cargo") = TxtCargo.Text.ToDouble
+ dr("Abono") = TxtAbono.Text.ToDouble
+ dr("CveProveedor") = drt("CveProveedor")
+ dr("CvePersonal") = drt("CvePersonal")
+ dr("CveClasificacion") = -1
dr("MultipleSubProyecto") = drt("MultipleSubProyecto")
dr("PorcentajeImpuesto") = drt("PorcentajeImpuesto")
- dr("CveCuenta") = drt("CveCuenta")
- DtMovimientos.Rows.Add(dr)
- Next
-
-
- GvMov.DataSource = DtMovimientos
- GvMov.DataBind()
- UPMovs.Update()
-
- End Sub
-
- Protected Sub GvMov_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvMov.RowDataBound
- If e.Row.RowType = DataControlRowType.DataRow Then
-
- e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
- e.Row.Height = Unit.Pixel(1)
- e.Row.Cells(0).ToolTip = e.Row.DBCampo("IdCuenta")
-
- If e.Row.DBCampo("TipoMovto") = "1" Then
- e.Row.FCTextBox("TxtAbono").Visible = True
- Else
- e.Row.FCTextBox("TxtCargo").Visible = True
- End If
-
- e.Row.FCTextBox("TxtAbono").Text = If(e.Row.DBCampo("Abono") = 0, "", e.Row.DBCampo("Abono"))
- e.Row.FCTextBox("TxtCargo").Text = If(e.Row.DBCampo("Cargo") = 0, "", e.Row.DBCampo("Cargo"))
- e.Row.FCTextBox("TxtConcepto").Text = e.Row.DBCampo("Descripcion")
-
- If CvePeriodo > 0 Then
- e.Row.FCTextBox("TxtCargo").Enabled = False
- e.Row.FCTextBox("TxtAbono").Enabled = False
- End If
-
- e.Row.FCDropDownList("DdlSubProyecto").DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
- e.Row.FCDropDownList("DdlSubProyecto").DataBind()
- e.Row.FCDropDownList("DdlSubProyecto").Items.Insert(0, New ListItem(" - ", "-1"))
- e.Row.FCDropDownList("DdlSubProyecto").SelectedValue = e.Row.DBCampo("CveSubProyecto")
-
- 'Asignamos los Tipos de Gasto
- e.Row.FCDropDownList("DdlTipoGasto").DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa)
- e.Row.FCDropDownList("DdlTipoGasto").DataBind()
- e.Row.FCDropDownList("DdlTipoGasto").Items.Insert(0, New ListItem("Sin Asignar", "-1"))
- e.Row.FCDropDownList("DdlTipoGasto").SelectedValue = e.Row.DBCampo("CveTipoGasto")
-
- If DdlPlantilla.SelectedValue.ToEntero = 53 Then 'Plantilla Personalizada
- e.Row.FCDropDownList("DdlSubProyecto").Enabled = True
- e.Row.FCImageButton("imgD").Visible = True
- Else
- e.Row.FCDropDownList("DdlSubProyecto").Enabled = False
- End If
-
- If e.Row.DBCampo("MultipleSubProyecto") = "True" Then
- e.Row.FCDropDownList("DdlSubProyecto").Enabled = True
- End If
-
- 'Agregamos la opcion para vincular los movimientos bancarios
- If e.Row.DataKey("CveConcepto").ToEntero.Contiene(41) Then
- Dim ObjMovimientos As New ClsMovimientos
- Dim DdlSaldos As DropDownList = e.Row.FCDropDownList("DdlSaldos")
-
- Select Case e.Row.DataKey("CveConcepto").ToEntero
-
- 'Acreedores
- Case 41
- If (ObjMovimientos.GetAcreedoresSaldosDetalles(-1, CveMoneda, UsuarioActual.CveEmpresa)) Then
- DdlSaldos.Visible = True
- DdlSaldos.DataSource = ObjMovimientos.DtResultados.FiltraParametros($"CveIE > 0 AND CveProveedor = {e.Row.DataKey("CveProveedor").ToEntero}")
- DdlSaldos.DataBind()
- DdlSaldos.Items.Insert(0, New ListItem("Seleccione", "-1"))
- End If
-
- End Select
-
- ObjMovimientos.Dispose()
- End If
-
- If e.Row.DataKey("CveConcepto").ToEntero.Contiene(30) Then
- e.Row.FCLinkButton("ImgBancos").Visible = True
-
-
- If CveTipoTransaccion > 0 And CveCuenta > 0 And Folio.Length > 0 And ImporteDocumento > 0 And Beneficiario.Length > 0 Then
- e.Row.FCLinkButton("ImgBancos").CssClass = "btn btn-circle btn-sm green"
- End If
- End If
-
- If e.Row.DataKey("CveConcepto").ToEntero.Contiene(17) Then
+ dr("CveCuenta") = drt("CveCuenta")
+ DtMovimientos.Rows.Add(dr)
+ Next
+
+
+ GvMov.DataSource = DtMovimientos
+ GvMov.DataBind()
+ UPMovs.Update()
+
+ End Sub
+
+ Protected Sub GvMov_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvMov.RowDataBound
+ If e.Row.RowType = DataControlRowType.DataRow Then
+
+ e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
+ e.Row.Height = Unit.Pixel(1)
+ e.Row.Cells(0).ToolTip = e.Row.DBCampo("IdCuenta")
+
+ If e.Row.DBCampo("TipoMovto") = "1" Then
+ e.Row.FCTextBox("TxtAbono").Visible = True
+ Else
+ e.Row.FCTextBox("TxtCargo").Visible = True
+ End If
+
+ e.Row.FCTextBox("TxtAbono").Text = If(e.Row.DBCampo("Abono") = 0, "", e.Row.DBCampo("Abono"))
+ e.Row.FCTextBox("TxtCargo").Text = If(e.Row.DBCampo("Cargo") = 0, "", e.Row.DBCampo("Cargo"))
+ e.Row.FCTextBox("TxtConcepto").Text = e.Row.DBCampo("Descripcion")
+
+ If CvePeriodo > 0 Then
+ e.Row.FCTextBox("TxtCargo").Enabled = False
+ e.Row.FCTextBox("TxtAbono").Enabled = False
+ End If
+
+ e.Row.FCDropDownList("DdlSubProyecto").DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
+ e.Row.FCDropDownList("DdlSubProyecto").DataBind()
+ e.Row.FCDropDownList("DdlSubProyecto").Items.Insert(0, New ListItem(" - ", "-1"))
+ e.Row.FCDropDownList("DdlSubProyecto").SelectedValue = e.Row.DBCampo("CveSubProyecto")
+
+ 'Asignamos los Tipos de Gasto
+ e.Row.FCDropDownList("DdlTipoGasto").DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa)
+ e.Row.FCDropDownList("DdlTipoGasto").DataBind()
+ e.Row.FCDropDownList("DdlTipoGasto").Items.Insert(0, New ListItem("Sin Asignar", "-1"))
+ e.Row.FCDropDownList("DdlTipoGasto").SelectedValue = e.Row.DBCampo("CveTipoGasto")
+
+ If DdlPlantilla.SelectedValue.ToEntero = 53 Then 'Plantilla Personalizada
+ e.Row.FCDropDownList("DdlSubProyecto").Enabled = True
+ e.Row.FCImageButton("imgD").Visible = True
+ Else
+ e.Row.FCDropDownList("DdlSubProyecto").Enabled = False
+ End If
+
+ If e.Row.DBCampo("MultipleSubProyecto") = "True" Then
+ e.Row.FCDropDownList("DdlSubProyecto").Enabled = True
+ End If
+
+ 'Agregamos la opcion para vincular los movimientos bancarios
+ If e.Row.DataKey("CveConcepto").ToEntero.Contiene(41) Then
+ Dim ObjMovimientos As New ClsMovimientos
+ Dim DdlSaldos As DropDownList = e.Row.FCDropDownList("DdlSaldos")
+
+ Select Case e.Row.DataKey("CveConcepto").ToEntero
+
+ 'Acreedores
+ Case 41
+ If (ObjMovimientos.GetAcreedoresSaldosDetalles(-1, CveMoneda, UsuarioActual.CveEmpresa)) Then
+ DdlSaldos.Visible = True
+ DdlSaldos.DataSource = ObjMovimientos.DtResultados.FiltraParametros($"CveIE > 0 AND CveProveedor = {e.Row.DataKey("CveProveedor").ToEntero}")
+ DdlSaldos.DataBind()
+ DdlSaldos.Items.Insert(0, New ListItem("Seleccione", "-1"))
+ End If
+
+ End Select
+
+ ObjMovimientos.Dispose()
+ End If
+
+ If e.Row.DataKey("CveConcepto").ToEntero.Contiene(30) Then
+ e.Row.FCLinkButton("ImgBancos").Visible = True
+
+
+ If CveTipoTransaccion > 0 And CveCuenta > 0 And Folio.Length > 0 And ImporteDocumento > 0 And Beneficiario.Length > 0 Then
+ e.Row.FCLinkButton("ImgBancos").CssClass = "btn btn-circle btn-sm green"
+ End If
+ End If
+
+ If e.Row.DataKey("CveConcepto").ToEntero.Contiene(17) Then
e.Row.FCDropDownList("DdlProveedores").Visible = True
e.Row.FCDropDownList("DdlProveedores").DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
e.Row.FCDropDownList("DdlProveedores").DataBind()
@@ -838,162 +849,162 @@ Partial Class ContabilidadC_RegPrePoliza
'If CveTipoTransaccion > 0 And CveCuenta > 0 And Folio.Length > 0 And ImporteDocumento > 0 And Beneficiario.Length > 0 Then
' e.Row.FCLinkButton("ImgPagoCompra").CssClass = "btn btn-circle btn-sm green"
'End If
- End If
-
- End If
- End Sub
-
- Protected Sub BtnIEGuardar_Click(sender As Object, e As EventArgs) Handles BtnIEGuardar.Click
- Dim TotalCargos, TotalAbonos As Decimal
-
- If CvePrePoliza > 0 Then
- TotalCargos = TxtTotalCargos.Text.ToDecimal
- TotalAbonos = TxtTotalAbonos.Text.ToDecimal
- Else
- For Each Gvr As GridViewRow In GvMov.Rows
- TotalCargos += Gvr.FCTextBox("TxtCargo").Text.ToDecimal
- TotalAbonos += Gvr.FCTextBox("TxtAbono").Text.ToDecimal
- Next
- End If
-
- If Not (TotalCargos = TotalAbonos AndAlso (GvPrePoliza.Rows.Count > 0 Or GvMov.Rows.Count > 0)) Then
- Alert($"La suma de los movimientos no son iguales ({TotalCargos}-{TotalAbonos})", TipoMensaje.MsgAdvertencia)
- Exit Sub
- End If
-
- If CvePrePoliza > 0 Then
- 'Nuevo Modulo Charlie
+ End If
+
+ End If
+ End Sub
+
+ Protected Sub BtnIEGuardar_Click(sender As Object, e As EventArgs) Handles BtnIEGuardar.Click
+ Dim TotalCargos, TotalAbonos As Decimal
+
+ If CvePrePoliza > 0 Then
+ TotalCargos = TxtTotalCargos.Text.ToDecimal
+ TotalAbonos = TxtTotalAbonos.Text.ToDecimal
+ Else
+ For Each Gvr As GridViewRow In GvMov.Rows
+ TotalCargos += Gvr.FCTextBox("TxtCargo").Text.ToDecimal
+ TotalAbonos += Gvr.FCTextBox("TxtAbono").Text.ToDecimal
+ Next
+ End If
+
+ If Not (TotalCargos = TotalAbonos AndAlso (GvPrePoliza.Rows.Count > 0 Or GvMov.Rows.Count > 0)) Then
+ Alert($"La suma de los movimientos no son iguales ({TotalCargos}-{TotalAbonos})", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
+ If CvePrePoliza > 0 Then
+ 'Nuevo Modulo Charlie
ActualizarPrePoliza()
- Else
- Dim MensajeAlert = New StringBuilder
- Dim ObjIE As New ClsBancos()
- Dim ObjMov As New ClsContabilidad(ObjIE.IniciaTransacSQL)
- Dim ObjNom As New ClsNominas(ObjIE.IniciaTransacSQL)
- Dim Conta As ClsContPAQi = Nothing
- Dim IDPoliza As Integer = 0
- Dim MsgError As String = ""
- Dim CveIE As Integer = -1
- Dim CveIEInsertado As Integer = -1
- Dim FolioIE As String = ""
-
- Try
- Dim CvePrePoliza As Integer
- Dim ConceptoPoliza As String = TxtObservaciones.Text
- CvePrePoliza = ObjMov.AddPrePolizas("Contabilidad/RegPrePoliza", DdlPlantilla.SelectedValue.ToEntero, TotalCargos, TotalAbonos, 1, TxtFecha.Text.ToDate, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=DdlTipoPolizaAdd.SelectedValue.ToEntero)
-
- If CvePrePoliza > 0 Then
- Dim alertaContabilizacion As String = "Se enviaron correctamente las siguientes pólizas:
"
- Dim idCuentaContabilizacion As Long = 1
- Dim Importe As Double = 0
- Dim TipoMovto As Boolean = False
- Dim IdCtaContable As Integer = 0
- Dim PorcentajeImpuesto As Decimal = 0
-
- 'Registra movimieno bancario
- If CveConcepto = 30 Then
- CveIE = ObjIE.AddBancos_IE(CveCuenta, CveTipoTransaccion, TxtFecha.Text, Folio, Beneficiario, ImporteDocumento, CveMoneda, 0, Observaciones, "", False, False, 0, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
- If CveIE < 0 Then MsgError = "No se pudo registrar movimiento bancario"
- CveIEInsertado = CveIE
- If ObjIE.GetBancosIE(CveIE, -1, -1, "-1", -1, "-1", "-1", -1, -1, -1, -1, -1, MinFecha, MaxFecha, MinFecha, MaxFecha, MinFecha, MaxFecha, -1, -1, UsuarioActual.CveEmpresa) Then
- FolioIE = ObjIE.Folio
- End If
+ Else
+ Dim MensajeAlert = New StringBuilder
+ Dim ObjIE As New ClsBancos()
+ Dim ObjMov As New ClsContabilidad(ObjIE.IniciaTransacSQL)
+ Dim ObjNom As New ClsNominas(ObjIE.IniciaTransacSQL)
+ Dim Conta As ClsContPAQi = Nothing
+ Dim IDPoliza As Integer = 0
+ Dim MsgError As String = ""
+ Dim CveIE As Integer = -1
+ Dim CveIEInsertado As Integer = -1
+ Dim FolioIE As String = ""
+
+ Try
+ Dim CvePrePoliza As Integer
+ Dim ConceptoPoliza As String = TxtObservaciones.Text
+ CvePrePoliza = ObjMov.AddPrePolizas("Contabilidad/RegPrePoliza", DdlPlantilla.SelectedValue.ToEntero, TotalCargos, TotalAbonos, 1, TxtFecha.Text.ToDate, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=DdlTipoPolizaAdd.SelectedValue.ToEntero)
+
+ If CvePrePoliza > 0 Then
+ Dim alertaContabilizacion As String = "Se enviaron correctamente las siguientes pólizas:
"
+ Dim idCuentaContabilizacion As Long = 1
+ Dim Importe As Double = 0
+ Dim TipoMovto As Boolean = False
+ Dim IdCtaContable As Integer = 0
+ Dim PorcentajeImpuesto As Decimal = 0
+
+ 'Registra movimieno bancario
+ If CveConcepto = 30 Then
+ CveIE = ObjIE.AddBancos_IE(CveCuenta, CveTipoTransaccion, TxtFecha.Text, Folio, Beneficiario, ImporteDocumento, CveMoneda, 0, Observaciones, "", False, False, 0, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
+ If CveIE < 0 Then MsgError = "No se pudo registrar movimiento bancario"
+ CveIEInsertado = CveIE
+ If ObjIE.GetBancosIE(CveIE, -1, -1, "-1", -1, "-1", "-1", -1, -1, -1, -1, -1, MinFecha, MaxFecha, MinFecha, MaxFecha, MinFecha, MaxFecha, -1, -1, UsuarioActual.CveEmpresa) Then
+ FolioIE = ObjIE.Folio
+ End If
End If
Dim CveProveedor As Integer = -1
- Dim CveCompra As Integer = -1
-
- 'inserto las compras que voy a pagarDdlSaldos
+ Dim CveCompra As Integer = -1
+
+ 'inserto las compras que voy a pagarDdlSaldos
For Each gvr As GridViewRow In GvMov.Rows
- If gvr.DataKey("IDCuenta").ToEntero > 0 Then
- IdCtaContable = gvr.DataKey("IDCuenta")
- End If
- CveProveedor = gvr.DataKey("CveProveedor").ToEntero
- CveCompra = gvr.DataKey("CveCompra").ToEntero
- CveConcepto = gvr.DataKey("CveConcepto").ToEntero
-
- If gvr.DataKey("TipoMovto").ToDouble <> 0 Then
- Importe = gvr.FCTextBox("TxtAbono").Text.ToDouble
- TipoMovto = True
- Else
- Importe = gvr.FCTextBox("TxtCargo").Text.ToDouble
- TipoMovto = False
+ If gvr.DataKey("IDCuenta").ToEntero > 0 Then
+ IdCtaContable = gvr.DataKey("IDCuenta")
+ End If
+ CveProveedor = gvr.DataKey("CveProveedor").ToEntero
+ CveCompra = gvr.DataKey("CveCompra").ToEntero
+ CveConcepto = gvr.DataKey("CveConcepto").ToEntero
+
+ If gvr.DataKey("TipoMovto").ToDouble <> 0 Then
+ Importe = gvr.FCTextBox("TxtAbono").Text.ToDouble
+ TipoMovto = True
+ Else
+ Importe = gvr.FCTextBox("TxtCargo").Text.ToDouble
+ TipoMovto = False
End If
'Registra pago de compra
If CveConcepto = 17 Then
CveProveedor = gvr.FCDropDownList("DdlProveedores").SelectedValue.ToEntero
CveCompra = gvr.FCDropDownList("DdlCompras").SelectedValue.ToEntero
- End If
-
- If CveConcepto = 41 Then
- CveIE = gvr.FCDropDownList("DdlSaldos").SelectedValue.ToEntero
- Else
- If CveConcepto = 30 Then
- CveIE = CveIEInsertado
- Else
- CveIE = -1
- End If
- End If
-
-
- If idCuentaContabilizacion = 1 AndAlso (IdCtaContable = 0) Then
- idCuentaContabilizacion = 0
- End If
-
- If Importe <> 0 Then
- If ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, gvr.FCLiteral("LtlReferencia").Text, gvr.DataKey("CveConcepto").ToEntero, gvr.FCTextBox("TxtConcepto").Text,
- TxtFecha.Text.ToDate, IdCtaContable, -1, CveSubProyecto:=gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero, CveIE:=CveIE,
- CveProveedor:=CveProveedor, CveCompra:=CveCompra,
- CvePersonal:=gvr.DataKey("CvePersonal").ToEntero, CveClasificacion:=gvr.DataKey("CveClasificacion").ToEntero,
- ImporteMX:=Importe, CveTipoGasto:=gvr.FCDropDownList("DdlTipoGasto").SelectedValue.ToEntero,
- CveCliente:=gvr.DataKey("CveCliente").ToEntero, CveVenta:=gvr.DataKey("CveVenta").ToEntero, TipoCambio:=If(gvr.DataKey("TC").ToString.ToDecimal > 0, gvr.DataKey("TC").ToString.ToDecimal, 1),
- ImporteME:=If(gvr.DataKey("TC").ToString.ToDecimal > 0, (Importe / (gvr.DataKey("TC").ToString.ToDecimal - 1)).RoundSQL, 0),
- PorcentajeImpuesto:=gvr.DataKey("PorcentajeImpuesto").ToDecimal, CveCuenta:=gvr.DataKey("CveCuenta").ToEntero) Then
- Else
- MsgError = "No se pudo insertar el detalle de la póliza2"
- Exit For
- End If
- End If
+ End If
+
+ If CveConcepto = 41 Then
+ CveIE = gvr.FCDropDownList("DdlSaldos").SelectedValue.ToEntero
+ Else
+ If CveConcepto = 30 Then
+ CveIE = CveIEInsertado
+ Else
+ CveIE = -1
+ End If
+ End If
+
+
+ If idCuentaContabilizacion = 1 AndAlso (IdCtaContable = 0) Then
+ idCuentaContabilizacion = 0
+ End If
+
+ If Importe <> 0 Then
+ If ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, gvr.FCLiteral("LtlReferencia").Text, gvr.DataKey("CveConcepto").ToEntero, gvr.FCTextBox("TxtConcepto").Text,
+ TxtFecha.Text.ToDate, IdCtaContable, -1, CveSubProyecto:=gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero, CveIE:=CveIE,
+ CveProveedor:=CveProveedor, CveCompra:=CveCompra,
+ CvePersonal:=gvr.DataKey("CvePersonal").ToEntero, CveClasificacion:=gvr.DataKey("CveClasificacion").ToEntero,
+ ImporteMX:=Importe, CveTipoGasto:=gvr.FCDropDownList("DdlTipoGasto").SelectedValue.ToEntero,
+ CveCliente:=gvr.DataKey("CveCliente").ToEntero, CveVenta:=gvr.DataKey("CveVenta").ToEntero, TipoCambio:=If(gvr.DataKey("TC").ToString.ToDecimal > 0, gvr.DataKey("TC").ToString.ToDecimal, 1),
+ ImporteME:=If(gvr.DataKey("TC").ToString.ToDecimal > 0, (Importe / (gvr.DataKey("TC").ToString.ToDecimal - 1)).RoundSQL, 0),
+ PorcentajeImpuesto:=gvr.DataKey("PorcentajeImpuesto").ToDecimal, CveCuenta:=gvr.DataKey("CveCuenta").ToEntero) Then
+ Else
+ MsgError = "No se pudo insertar el detalle de la póliza2"
+ Exit For
+ End If
+ End If
Next
- If CvePeriodo > 0 Then
- If Not ObjNom.UpdateProvisionNomina(CvePeriodo, CvePrePoliza, UsuarioActual.CveEmpresa) Then
- MsgError = "No se pudo actualizar el periodo de la nómina"
- End If
- End If
-
- If ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, 1) Then
- If ObjMov.ValorPolizaDescuadre > 0 Then
- GuardaLogAD($"Contabilidad/RegPrePolizas | Error:{ObjMov.MensajePolizaDescuadre} Diferencia:{ObjMov.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
- MsgError = ObjMov.MensajePolizaDescuadre & "-"
- End If
+ If CvePeriodo > 0 Then
+ If Not ObjNom.UpdateProvisionNomina(CvePeriodo, CvePrePoliza, UsuarioActual.CveEmpresa) Then
+ MsgError = "No se pudo actualizar el periodo de la nómina"
+ End If
+ End If
+
+ If ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, 1) Then
+ If ObjMov.ValorPolizaDescuadre > 0 Then
+ GuardaLogAD($"Contabilidad/RegPrePolizas | Error:{ObjMov.MensajePolizaDescuadre} Diferencia:{ObjMov.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
+ MsgError = ObjMov.MensajePolizaDescuadre & "-"
+ End If
End If
'El movimiento 2 es el de Pago
- If ChkAutoConta.Checked AndAlso MsgError = "" Or UsuarioActual.Empresa.Funcionalidad(200) = "1" And MsgError = "" Then
- If idCuentaContabilizacion > 0 Then
- If ObjMov.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then
-
- 'MENSAJE PRINCIPAL
- MensajeAlert.AppendFormat("
Folio de Póliza: {1}", ObjMov.ContaIdPoliza, ObjMov.ContaFolio)
- MensajeAlert.AppendFormat("
Prepóliza: {1}", CvePrePoliza, ObjMov.ContaFolio)
- 'Alert(MensajeAlert.ToString, ModExtensiones.TipoMensaje.MsgInformacion)
- Else
- Alert("Ocurrio un error al contabilizar, pongase en contacto con Soporte Técnico")
- End If
- Else
- Alert("No se puede contabilizar la Prepoliza debido a que una o mas cuentas son inválidas")
- End If
- End If
-
- Else
- MsgError = "No se pudo insertar la póliza"
+ If ChkAutoConta.Checked AndAlso MsgError = "" Or UsuarioActual.Empresa.Funcionalidad(200) = "1" And MsgError = "" Then
+ If idCuentaContabilizacion > 0 Then
+ If ObjMov.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then
+
+ 'MENSAJE PRINCIPAL
+ MensajeAlert.AppendFormat("
Folio de Póliza: {1}", ObjMov.ContaIdPoliza, ObjMov.ContaFolio)
+ MensajeAlert.AppendFormat("
Prepóliza: {1}", CvePrePoliza, ObjMov.ContaFolio)
+ 'Alert(MensajeAlert.ToString, ModExtensiones.TipoMensaje.MsgInformacion)
+ Else
+ Alert("Ocurrio un error al contabilizar, pongase en contacto con Soporte Técnico")
+ End If
+ Else
+ Alert("No se puede contabilizar la Prepoliza debido a que una o mas cuentas son inválidas")
+ End If
+ End If
+
+ Else
+ MsgError = "No se pudo insertar la póliza"
End If
If MsgError = "" Then
@@ -1022,23 +1033,23 @@ Partial Class ContabilidadC_RegPrePoliza
Catch ex As Exception
ex.GuardaLog(ex.Message)
ObjIE.RollBack()
- If Conta IsNot Nothing Then Conta.RollBack()
+ If Conta IsNot Nothing Then Conta.RollBack()
Alert("Ocurrio un error al registrar el movimiento", TipoMensaje.MsgInformacion)
End Try
- ObjIE.Dispose()
- ObjMov.Dispose()
- If Conta IsNot Nothing Then Conta.Dispose()
- End If
- End Sub
-
- Private Sub ActualizarPrePoliza()
-
- Dim OcurrioError As Boolean = False
- Dim ObjContabilidad As New ClsContabilidad
+ ObjIE.Dispose()
+ ObjMov.Dispose()
+ If Conta IsNot Nothing Then Conta.Dispose()
+ End If
+ End Sub
+
+ Private Sub ActualizarPrePoliza()
+
+ Dim OcurrioError As Boolean = False
+ Dim ObjContabilidad As New ClsContabilidad
ObjContabilidad.IniciaTransacSQL()
@@ -1055,19 +1066,19 @@ Partial Class ContabilidadC_RegPrePoliza
For Each row As GridViewRow In GvPrePoliza.Rows
If row.DataKey("CvePrePolizaDetalle").ToEntero > 0 Then
- If Not ObjContabilidad.UpdatePrepolizasDetalle(row.DataKey("CvePrePolizaDetalle").ToEntero, row.FCTextBox("TxtConcepto").Text, row.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero,
- row.FCDropDownList("DdlCtaContable").SelectedValue.ToEntero, If(row.FCTextBox("TxtCargo").Text.ToDecimal <> 0, False, True), If(row.FCTextBox("TxtCargo").Text.ToDecimal <> 0,
+ If Not ObjContabilidad.UpdatePrepolizasDetalle(row.DataKey("CvePrePolizaDetalle").ToEntero, row.FCTextBox("TxtConcepto").Text, row.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero,
+ row.FCDropDownList("DdlCtaContable").SelectedValue.ToEntero, If(row.FCTextBox("TxtCargo").Text.ToDecimal <> 0, False, True), If(row.FCTextBox("TxtCargo").Text.ToDecimal <> 0,
row.FCTextBox("TxtCargo").Text.ToDecimal, row.FCTextBox("TxtAbono").Text.ToDecimal), CveTipoGasto:=If(DdlTipoGasto.Visible, row.FCDropDownList("DdlTipoGasto").SelectedValue.ToEntero, row.DataKey("CveTipoGasto").ToEntero), CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
OcurrioError = True
Exit For
End If
Else
- If Not ObjContabilidad.AddPrePolizasDetalle(CvePrePoliza, If(row.FCTextBox("TxtCargo").Text.ToDecimal <> 0, False, True), If(row.FCTextBox("TxtCargo").Text.ToDecimal <> 0,
- row.FCTextBox("TxtCargo").Text.ToDecimal, row.FCTextBox("TxtAbono").Text.ToDecimal), row.DataKey("Referencia").ToString,
- row.DataKey("CveConceptoContable").ToEntero, row.FCTextBox("TxtConcepto").Text, Now,
- row.FCDropDownList("DdlCtaContable").SelectedValue.ToEntero, 0, CveSubProyecto:=row.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero,
- CveTipoGasto:=If(DdlTipoGasto.Visible, row.FCDropDownList("DdlTipoGasto").SelectedValue.ToEntero, row.DataKey("CveTipoGasto").ToEntero),
- ImporteMX:=If(row.FCTextBox("TxtCargo").Text.ToDecimal <> 0,
+ If Not ObjContabilidad.AddPrePolizasDetalle(CvePrePoliza, If(row.FCTextBox("TxtCargo").Text.ToDecimal <> 0, False, True), If(row.FCTextBox("TxtCargo").Text.ToDecimal <> 0,
+ row.FCTextBox("TxtCargo").Text.ToDecimal, row.FCTextBox("TxtAbono").Text.ToDecimal), row.DataKey("Referencia").ToString,
+ row.DataKey("CveConceptoContable").ToEntero, row.FCTextBox("TxtConcepto").Text, Now,
+ row.FCDropDownList("DdlCtaContable").SelectedValue.ToEntero, 0, CveSubProyecto:=row.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero,
+ CveTipoGasto:=If(DdlTipoGasto.Visible, row.FCDropDownList("DdlTipoGasto").SelectedValue.ToEntero, row.DataKey("CveTipoGasto").ToEntero),
+ ImporteMX:=If(row.FCTextBox("TxtCargo").Text.ToDecimal <> 0,
row.FCTextBox("TxtCargo").Text.ToDecimal, row.FCTextBox("TxtAbono").Text.ToDecimal), CveProveedor:=DdlProveedores.SelectedValue.ToEntero) Then
OcurrioError = True
Exit For
@@ -1079,581 +1090,581 @@ Partial Class ContabilidadC_RegPrePoliza
OcurrioError = True
End If
- If Not OcurrioError Then
- ObjContabilidad.Commit()
- Alert("La PrePoliza se actualizó correctamente.", TipoMensaje.MsgInformacion)
+ If Not OcurrioError Then
+ ObjContabilidad.Commit()
+ Alert("La PrePoliza se actualizó correctamente.", TipoMensaje.MsgInformacion)
Else
- ObjContabilidad.RollBack()
- Alert("Ocurrio un error al actualizar la PrePoliza.", TipoMensaje.MsgError)
- End If
-
- ObjContabilidad.Dispose()
- CargaPrePoliza()
-
+ ObjContabilidad.RollBack()
+ Alert("Ocurrio un error al actualizar la PrePoliza.", TipoMensaje.MsgError)
+ End If
+
+ ObjContabilidad.Dispose()
+ CargaPrePoliza()
+
If Not OcurrioError Then
If IdPoliza > 0 Then
BtnContabilizar_Click(Nothing, Nothing)
End If
- End If
- End Sub
- Protected Sub GvPrePoliza_RowUpdating(sender As Object, e As GridViewUpdateEventArgs) Handles GvPrePoliza.RowUpdating
- RegistraScript(String.Format("$('#{0}').modal();", "DivEditConcepto"))
- CargaSubProyectos()
- IndiceGrid = e.RowIndex
-
- Dim DtTemp As New DataTable
- DtTemp.Columns.Add("ConceptoContable", GetType(String))
- DtTemp.Columns.Add("FolioFactura", GetType(String))
- DtTemp.Columns.Add("Concepto", GetType(String))
- DtTemp.Columns.Add("CveSubProyecto", GetType(Integer))
- DtTemp.Columns.Add("CveTipoGasto", GetType(Integer))
- DtTemp.Columns.Add("Id", GetType(Integer))
- DtTemp.Columns.Add("CargoImporteMN", GetType(Decimal))
- DtTemp.Columns.Add("AbonoImporteMN", GetType(Decimal))
-
- Dim ConceptoContable As String = GvPrePoliza.Rows(IndiceGrid).FCLiteral("LtlConceptoContable").Text
- Dim FolioFactura As String = GvPrePoliza.Rows(IndiceGrid).FCHyperLink("HlReferencia").Text
- Dim Concepto As String = GvPrePoliza.Rows(IndiceGrid).FCTextBox("TxtConcepto").Text
- Dim CveSubProyecto As Integer = GvPrePoliza.Rows(IndiceGrid).FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero
- Dim CveTipoGasto As Integer = GvPrePoliza.Rows(IndiceGrid).FCDropDownList("DdlTipoGasto").SelectedValue.ToEntero
- Dim Id As Integer = GvPrePoliza.Rows(IndiceGrid).FCDropDownList("DdlCtaContable").SelectedValue.ToEntero
- Dim Cargo As Double = GvPrePoliza.Rows(IndiceGrid).FCTextBox("TxtCargo").Text.ToDouble
- Dim Abono As Double = GvPrePoliza.Rows(IndiceGrid).FCTextBox("TxtAbono").Text.ToDouble
-
- Dim registro As DataRow = DtTemp.NewRow
- registro.Item("ConceptoContable") = ConceptoContable
- registro.Item("FolioFactura") = FolioFactura
- registro.Item("Concepto") = Concepto
- registro.Item("CveSubProyecto") = CveSubProyecto
- registro.Item("CveTipoGasto") = CveTipoGasto
- registro.Item("Id") = Id
- registro.Item("CargoImporteMN") = Cargo
- registro.Item("AbonoImporteMN") = Abono
- DtTemp.Rows.Add(registro)
-
- GvConcepto.DataSource = DtTemp
- GvConcepto.DataBind()
-
- UppGrid.Update()
-
- End Sub
- Private Sub GvConcepto_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvConcepto.RowDataBound
-
- If e.Row.RowType = DataControlRowType.DataRow Then
-
- 'Asignamos los Subproyectos
- e.Row.FCDropDownList("DdlSubProyecto").DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
- e.Row.FCDropDownList("DdlSubProyecto").DataBind()
- e.Row.FCDropDownList("DdlSubProyecto").Items.Insert(0, New ListItem(" - ", "-1"))
- e.Row.FCDropDownList("DdlSubProyecto").SelectedValueExist(e.Row.DataKey("CveSubProyecto"))
-
- 'Asignamos los Tipos de Gasto
- e.Row.FCDropDownList("DdlTipoGasto").DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa)
- e.Row.FCDropDownList("DdlTipoGasto").DataBind()
- e.Row.FCDropDownList("DdlTipoGasto").Items.Insert(0, New ListItem("Sin Asignar", "-1"))
- e.Row.FCDropDownList("DdlTipoGasto").SelectedValueExist(e.Row.DataKey("CveTipoGasto"))
-
- 'ASignamos las CuentasContables
- e.Row.FCDropDownList("DdlCtaContable").DataSource = Session("DtCuentas")
- e.Row.FCDropDownList("DdlCtaContable").DataBind()
- e.Row.FCDropDownList("DdlCtaContable").Items.Insert(0, New ListItem("Sin Asignar", "0"))
- 'e.Row.FCDropDownList("DdlCtaContable").SelectedValueExist(e.Row.DataKey("IdCtaContable"))
-
-
-
-
-
- 'TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + e.Row.FCTextBox("TxtCargo").Text.ToDouble).ToString.FormatoNumero
- 'TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + e.Row.FCTextBox("TxtAbono").Text.ToDouble).ToString.FormatoNumero
-
- 'Dim CveConceptoContable As Integer = e.Row.DataKey("CveConceptoContable").ToEntero
-
- 'If CveConceptoContable.Contiene(1, 2, 13, 38, 207, 203, 39, 61, 62, 63) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveVenta={0}", e.Row.DataKey("CveVenta"))
- 'If CveConceptoContable.Contiene(5, 6, 17, 18, 14, 19, 25, 26, 60, 234, 235) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Compras/Compras.aspx?CveCompra={0}", e.Row.DataKey("CveCompra"))
- 'If CveConceptoContable.Contiene(68) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}", e.Row.DBCampo("CveMovimientoAlmacen"))
-
- 'e.Row.FCHyperLink("HlReferencia").NavigateUrl = CveConceptoContable
-
- End If
-
- If e.Row.RowType = DataControlRowType.Header Then
- e.Row.FCDropDownList("DdlSubProyectoFiltro").DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
- e.Row.FCDropDownList("DdlSubProyectoFiltro").DataBind()
- e.Row.FCDropDownList("DdlSubProyectoFiltro").Items.Insert(0, New ListItem("Todos", "-1"))
- End If
-
- End Sub
- Protected Sub BtnAceptar_Click(sender As Object, e As EventArgs) Handles BtnAceptar.Click
-
-
- End Sub
-
- Protected Sub GvMov_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GvMov.RowDeleting
-
- Dim idMov As Integer = GvMov.DataKeys(e.RowIndex).Value.ToString.ToEntero
-
- Dim Rows As DataRow() = DtMovimientos.Select("IDMov = " & idMov)
- If Rows.Count > 0 Then
- DtMovimientos.Rows.Remove(Rows(0))
- DtMovimientos.AcceptChanges()
- End If
- GvMov.DataSource = DtMovimientos
- GvMov.DataBind()
-
- TxtTotalAbonos.Text = DtMovimientos.SUM("Abono").FormatoNumero
- TxtTotalCargos.Text = DtMovimientos.SUM("Cargo").FormatoNumero
- RegistraScript("calculateCargo();calculateAbono();comparar()")
-
- 'saco de la póliza el importe del cheque, que coincida la cuenta contable con la bancaria
-
- End Sub
-
- Private Sub LbAgregar_Click(sender As Object, e As EventArgs) Handles LbAgregar.Click
-
- If DtMovimientos Is Nothing Then CreaDT()
-
- If Actualizar Then
-
- Dim Rows As DataRow() = DtMovimientos.Select("IDMov = " & HdnCve.Value)
-
- If Rows.Count > 0 Then
- Dim dr As DataRow = Rows(0)
- Dim CodigoCuenta As String = ""
- Dim NombreCuenta As String = ""
- dr("IdCuenta") = DdlCtaContable.SelectedValue
-
- If DdlCtaContable.SelectedValue.ToEntero > 0 Then
- Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", DdlCtaContable.SelectedValue))
- If drr IsNot Nothing Then
- CodigoCuenta = drr("CuentaFormato").ToString()
- NombreCuenta = drr("Nombre").ToString()
- End If
- End If
-
- dr("CodigoCuenta") = CodigoCuenta & " " & NombreCuenta
- dr("Cuenta") = DdlConceptosContables.SelectedItem
- dr("Referencia") = TxtReferencia.Text
- dr("Concepto") = TxtObservaciones.Text
- dr("TipoMovto") = If(Math.Abs(TxtCargo.Text.ToDouble) > 0, 0, 1)
- dr("EsComodin") = 0
- dr("CveConcepto") = DdlConceptosContables.SelectedValue
- dr("Cargo") = TxtCargo.Text.ToDouble
- dr("Abono") = TxtAbono.Text.ToDouble
- dr("Descripcion") = TxtDescripcion.Text
- dr("CveSubProyecto") = DdlSubProyecto.SelectedValue
- dr("CveProveedor") = DdlProveedores.SelectedValue.ToEntero
- dr("CveCompra") = DdlCompras.SelectedValue.ToEntero
- dr("CvePersonal") = DdlPersonal.SelectedValue.ToEntero
- dr("CveClasificacion") = DdlClasificaciones.SelectedValue.ToEntero
- dr("CveCliente") = DdlClientes.SelectedValue.ToEntero
- dr("CveVenta") = DdlVentas.SelectedValue.ToEntero
- End If
-
- GvMov.DataSource = DtMovimientos
- GvMov.DataBind()
- UPMovs.Update()
-
- LbCancelarEdicion.Visible = False
- LbAgregar.Text = "Agregar"
- Actualizar = False
- Else
-
- If CvePrePoliza > 0 Then
- Dim dr As DataRow = DtMovimientos.NewRow
- dr("IdCtaContable") = DdlCtaContable.SelectedValue
- dr("ConceptoContable") = DdlConceptosContables.SelectedItem.Text
- dr("CveConceptoContable") = DdlConceptosContables.SelectedValue
- dr("Concepto") = TxtDescripcion.Text
- dr("Referencia") = TxtReferencia.Text
- dr("TipoMovto") = If(Math.Abs(TxtCargo.Text.ToDouble) > 0, 0, 1)
- dr("Cargo") = TxtCargo.Text.ToDouble
- dr("Abono") = TxtAbono.Text.ToDouble
- dr("ImporteMN") = If(Math.Abs(TxtCargo.Text.ToDouble) > 0, TxtCargo.Text.ToDouble, TxtAbono.Text.ToDouble)
- dr("CveSubProyecto") = DdlSubProyecto.SelectedValue
-
-
- TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbono.Text.ToDouble).ToString.FormatoNumero
- TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargo.Text.ToDouble).ToString.FormatoNumero
- DtMovimientos.Rows.Add(dr)
- DtMovimientos.AcceptChanges()
-
- If CvePrePoliza > 0 Then
- GvPrePoliza.DataSource = DtMovimientos
- GvPrePoliza.DataBind()
- UpPrePoliza.Update()
- End If
- Else
- Dim dr As DataRow = DtMovimientos.NewRow
- Dim CodigoCuenta As String = ""
- Dim NombreCuenta As String = ""
-
- dr("IdCuenta") = DdlCtaContable.SelectedValue
-
- If DdlCtaContable.SelectedValue.ToEntero > 0 Then
- Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", DdlCtaContable.SelectedValue))
- If drr IsNot Nothing Then
- CodigoCuenta = drr("CuentaFormato").ToString()
- NombreCuenta = drr("Nombre").ToString()
- End If
- End If
-
- dr("CodigoCuenta") = CodigoCuenta & " " & NombreCuenta
- dr("Cuenta") = DdlConceptosContables.SelectedItem.Text
- dr("Referencia") = TxtReferencia.Text
- dr("Concepto") = TxtObservaciones.Text
- dr("TipoMovto") = If(Math.Abs(TxtCargo.Text.ToDouble) > 0, 0, 1)
- dr("EsComodin") = 0
- dr("CveConcepto") = DdlConceptosContables.SelectedValue
- dr("CveConceptoContable") = DdlConceptosContables.SelectedValue
- dr("ConceptoContable") = DdlConceptosContables.SelectedItem.Text
- dr("Cargo") = TxtCargo.Text.ToDouble
- dr("Abono") = TxtAbono.Text.ToDouble
- dr("Descripcion") = TxtDescripcion.Text
- dr("CveSubProyecto") = DdlSubProyecto.SelectedValue
- dr("CveProveedor") = DdlProveedores.SelectedValue.ToEntero
- dr("CveCompra") = DdlCompras.SelectedValue.ToEntero
- dr("CvePersonal") = DdlPersonal.SelectedValue.ToEntero
- dr("CveClasificacion") = DdlClasificaciones.SelectedValue.ToEntero
- dr("CveCliente") = DdlClientes.SelectedValue.ToEntero
- dr("CveVenta") = DdlVentas.SelectedValue.ToEntero
- dr("TC") = TxtTC.Text.ToDouble
-
- TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbono.Text.ToDouble).ToString.FormatoNumero
- TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargo.Text.ToDouble).ToString.FormatoNumero
- DtMovimientos.Rows.Add(dr)
- DtMovimientos.AcceptChanges()
-
- 'If CvePrePoliza > 0 Then
- ' GvPrePoliza.DataSource = DtMovimientos
- ' GvPrePoliza.DataBind()
- ' UpPrePoliza.Update()
- 'End If
-
- GvMov.DataSource = DtMovimientos
- GvMov.DataBind()
- UPMovs.Update()
- Actualizar = False
-
- End If
-
- End If
-
- TxtCargo.Text = ""
- TxtAbono.Text = ""
- TxtReferencia.Text = ""
- TxtDescripcion.Text = ""
- End Sub
-
-#Region "PESTAÑA INFORMACION GENERAL DE BANCO IE"
- Public Sub Bancos_Click(sender As Object, e As EventArgs)
- Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
- RowIndex = GvRow.RowIndex
-
- If GvRow.FCTextBox("TxtAbono").Text = "" Then
- CargaTipoTransaccion("Ing")
- Else
- CargaTipoTransaccion("Egs")
- End If
-
-
- TxtDocumentoImporte.Text = If(GvRow.FCTextBox("TxtAbono").Text = "", GvRow.FCTextBox("TxtCargo").Text.FormatoNumero, GvRow.FCTextBox("TxtAbono").Text.FormatoNumero)
- UpBancos.Update()
- RegistraScript(String.Format("$('#{0}').modal();", "DivContadoModal"))
- End Sub
- Private Sub CargaTipoTransaccion(Tipo As String)
- DdlTipoTransaccion.Items.Clear()
- DdlTipoTransaccion.DataSource = GlobalDTTipoTransacciones.FiltraParametros($"Tipo = '{Tipo}'")
- DdlTipoTransaccion.DataBind()
- DdlTipoTransaccion.Items.Insert(0, New ListItem("Seleccione Tipo Movimiento", "-1"))
- End Sub
- Private Sub CargaCuentas()
- DdlCuenta.Items.Clear()
- DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) '.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", DdlMoneda.SelectedValue))
- DdlCuenta.DataBind()
- DdlCuenta.Items.Insert(0, New ListItem("Seleccione", "-1"))
- End Sub
- Private Sub BtnContado_Click(sender As Object, e As EventArgs) Handles BtnContado.Click
- CveConcepto = 30
- CveTipoTransaccion = DdlTipoTransaccion.SelectedValue.ToEntero
- CveCuenta = DdlCuenta.SelectedValue.ToEntero
- Folio = TxtDocumentoFolio.Text
- ImporteDocumento = TxtDocumentoImporte.Text.ToDecimal
- Observaciones = TxtDocumentoObservaciones.Text
- Beneficiario = TxtDocumentoBeneficiario.Text
- RegistraScript(String.Format("$('#{0}').modal('hide');", "DivContadoModal"))
- GvMov.Rows(RowIndex).FCLinkButton("ImgBancos").CssClass = "btn btn-circle btn-sm green"
- UPMovs.Update()
- End Sub
-
- Private Sub BtnEliminar_Click(sender As Object, e As EventArgs) Handles BtnEliminar.Click
- Dim ObjContabilidad As New ClsContabilidad
+ End If
+ End Sub
+ Protected Sub GvPrePoliza_RowUpdating(sender As Object, e As GridViewUpdateEventArgs) Handles GvPrePoliza.RowUpdating
+ RegistraScript(String.Format("$('#{0}').modal();", "DivEditConcepto"))
+ CargaSubProyectos()
+ IndiceGrid = e.RowIndex
+
+ Dim DtTemp As New DataTable
+ DtTemp.Columns.Add("ConceptoContable", GetType(String))
+ DtTemp.Columns.Add("FolioFactura", GetType(String))
+ DtTemp.Columns.Add("Concepto", GetType(String))
+ DtTemp.Columns.Add("CveSubProyecto", GetType(Integer))
+ DtTemp.Columns.Add("CveTipoGasto", GetType(Integer))
+ DtTemp.Columns.Add("Id", GetType(Integer))
+ DtTemp.Columns.Add("CargoImporteMN", GetType(Decimal))
+ DtTemp.Columns.Add("AbonoImporteMN", GetType(Decimal))
+
+ Dim ConceptoContable As String = GvPrePoliza.Rows(IndiceGrid).FCLiteral("LtlConceptoContable").Text
+ Dim FolioFactura As String = GvPrePoliza.Rows(IndiceGrid).FCHyperLink("HlReferencia").Text
+ Dim Concepto As String = GvPrePoliza.Rows(IndiceGrid).FCTextBox("TxtConcepto").Text
+ Dim CveSubProyecto As Integer = GvPrePoliza.Rows(IndiceGrid).FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero
+ Dim CveTipoGasto As Integer = GvPrePoliza.Rows(IndiceGrid).FCDropDownList("DdlTipoGasto").SelectedValue.ToEntero
+ Dim Id As Integer = GvPrePoliza.Rows(IndiceGrid).FCDropDownList("DdlCtaContable").SelectedValue.ToEntero
+ Dim Cargo As Double = GvPrePoliza.Rows(IndiceGrid).FCTextBox("TxtCargo").Text.ToDouble
+ Dim Abono As Double = GvPrePoliza.Rows(IndiceGrid).FCTextBox("TxtAbono").Text.ToDouble
+
+ Dim registro As DataRow = DtTemp.NewRow
+ registro.Item("ConceptoContable") = ConceptoContable
+ registro.Item("FolioFactura") = FolioFactura
+ registro.Item("Concepto") = Concepto
+ registro.Item("CveSubProyecto") = CveSubProyecto
+ registro.Item("CveTipoGasto") = CveTipoGasto
+ registro.Item("Id") = Id
+ registro.Item("CargoImporteMN") = Cargo
+ registro.Item("AbonoImporteMN") = Abono
+ DtTemp.Rows.Add(registro)
+
+ GvConcepto.DataSource = DtTemp
+ GvConcepto.DataBind()
+
+ UppGrid.Update()
+
+ End Sub
+ Private Sub GvConcepto_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvConcepto.RowDataBound
+
+ If e.Row.RowType = DataControlRowType.DataRow Then
+
+ 'Asignamos los Subproyectos
+ e.Row.FCDropDownList("DdlSubProyecto").DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
+ e.Row.FCDropDownList("DdlSubProyecto").DataBind()
+ e.Row.FCDropDownList("DdlSubProyecto").Items.Insert(0, New ListItem(" - ", "-1"))
+ e.Row.FCDropDownList("DdlSubProyecto").SelectedValueExist(e.Row.DataKey("CveSubProyecto"))
+
+ 'Asignamos los Tipos de Gasto
+ e.Row.FCDropDownList("DdlTipoGasto").DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa)
+ e.Row.FCDropDownList("DdlTipoGasto").DataBind()
+ e.Row.FCDropDownList("DdlTipoGasto").Items.Insert(0, New ListItem("Sin Asignar", "-1"))
+ e.Row.FCDropDownList("DdlTipoGasto").SelectedValueExist(e.Row.DataKey("CveTipoGasto"))
+
+ 'ASignamos las CuentasContables
+ e.Row.FCDropDownList("DdlCtaContable").DataSource = Session("DtCuentas")
+ e.Row.FCDropDownList("DdlCtaContable").DataBind()
+ e.Row.FCDropDownList("DdlCtaContable").Items.Insert(0, New ListItem("Sin Asignar", "0"))
+ 'e.Row.FCDropDownList("DdlCtaContable").SelectedValueExist(e.Row.DataKey("IdCtaContable"))
+
+
+
+
+
+ 'TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + e.Row.FCTextBox("TxtCargo").Text.ToDouble).ToString.FormatoNumero
+ 'TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + e.Row.FCTextBox("TxtAbono").Text.ToDouble).ToString.FormatoNumero
+
+ 'Dim CveConceptoContable As Integer = e.Row.DataKey("CveConceptoContable").ToEntero
+
+ 'If CveConceptoContable.Contiene(1, 2, 13, 38, 207, 203, 39, 61, 62, 63) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveVenta={0}", e.Row.DataKey("CveVenta"))
+ 'If CveConceptoContable.Contiene(5, 6, 17, 18, 14, 19, 25, 26, 60, 234, 235) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Compras/Compras.aspx?CveCompra={0}", e.Row.DataKey("CveCompra"))
+ 'If CveConceptoContable.Contiene(68) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}", e.Row.DBCampo("CveMovimientoAlmacen"))
+
+ 'e.Row.FCHyperLink("HlReferencia").NavigateUrl = CveConceptoContable
+
+ End If
+
+ If e.Row.RowType = DataControlRowType.Header Then
+ e.Row.FCDropDownList("DdlSubProyectoFiltro").DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
+ e.Row.FCDropDownList("DdlSubProyectoFiltro").DataBind()
+ e.Row.FCDropDownList("DdlSubProyectoFiltro").Items.Insert(0, New ListItem("Todos", "-1"))
+ End If
+
+ End Sub
+ Protected Sub BtnAceptar_Click(sender As Object, e As EventArgs) Handles BtnAceptar.Click
+
+
+ End Sub
+
+ Protected Sub GvMov_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GvMov.RowDeleting
+
+ Dim idMov As Integer = GvMov.DataKeys(e.RowIndex).Value.ToString.ToEntero
+
+ Dim Rows As DataRow() = DtMovimientos.Select("IDMov = " & idMov)
+ If Rows.Count > 0 Then
+ DtMovimientos.Rows.Remove(Rows(0))
+ DtMovimientos.AcceptChanges()
+ End If
+ GvMov.DataSource = DtMovimientos
+ GvMov.DataBind()
+
+ TxtTotalAbonos.Text = DtMovimientos.SUM("Abono").FormatoNumero
+ TxtTotalCargos.Text = DtMovimientos.SUM("Cargo").FormatoNumero
+ RegistraScript("calculateCargo();calculateAbono();comparar()")
+
+ 'saco de la póliza el importe del cheque, que coincida la cuenta contable con la bancaria
+
+ End Sub
+
+ Private Sub LbAgregar_Click(sender As Object, e As EventArgs) Handles LbAgregar.Click
+
+ If DtMovimientos Is Nothing Then CreaDT()
+
+ If Actualizar Then
+
+ Dim Rows As DataRow() = DtMovimientos.Select("IDMov = " & HdnCve.Value)
+
+ If Rows.Count > 0 Then
+ Dim dr As DataRow = Rows(0)
+ Dim CodigoCuenta As String = ""
+ Dim NombreCuenta As String = ""
+ dr("IdCuenta") = DdlCtaContable.SelectedValue
+
+ If DdlCtaContable.SelectedValue.ToEntero > 0 Then
+ Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", DdlCtaContable.SelectedValue))
+ If drr IsNot Nothing Then
+ CodigoCuenta = drr("CuentaFormato").ToString()
+ NombreCuenta = drr("Nombre").ToString()
+ End If
+ End If
+
+ dr("CodigoCuenta") = CodigoCuenta & " " & NombreCuenta
+ dr("Cuenta") = DdlConceptosContables.SelectedItem
+ dr("Referencia") = TxtReferencia.Text
+ dr("Concepto") = TxtObservaciones.Text
+ dr("TipoMovto") = If(Math.Abs(TxtCargo.Text.ToDouble) > 0, 0, 1)
+ dr("EsComodin") = 0
+ dr("CveConcepto") = DdlConceptosContables.SelectedValue
+ dr("Cargo") = TxtCargo.Text.ToDouble
+ dr("Abono") = TxtAbono.Text.ToDouble
+ dr("Descripcion") = TxtDescripcion.Text
+ dr("CveSubProyecto") = DdlSubProyecto.SelectedValue
+ dr("CveProveedor") = DdlProveedores.SelectedValue.ToEntero
+ dr("CveCompra") = DdlCompras.SelectedValue.ToEntero
+ dr("CvePersonal") = DdlPersonal.SelectedValue.ToEntero
+ dr("CveClasificacion") = DdlClasificaciones.SelectedValue.ToEntero
+ dr("CveCliente") = DdlClientes.SelectedValue.ToEntero
+ dr("CveVenta") = DdlVentas.SelectedValue.ToEntero
+ End If
+
+ GvMov.DataSource = DtMovimientos
+ GvMov.DataBind()
+ UPMovs.Update()
+
+ LbCancelarEdicion.Visible = False
+ LbAgregar.Text = "Agregar"
+ Actualizar = False
+ Else
+
+ If CvePrePoliza > 0 Then
+ Dim dr As DataRow = DtMovimientos.NewRow
+ dr("IdCtaContable") = DdlCtaContable.SelectedValue
+ dr("ConceptoContable") = DdlConceptosContables.SelectedItem.Text
+ dr("CveConceptoContable") = DdlConceptosContables.SelectedValue
+ dr("Concepto") = TxtDescripcion.Text
+ dr("Referencia") = TxtReferencia.Text
+ dr("TipoMovto") = If(Math.Abs(TxtCargo.Text.ToDouble) > 0, 0, 1)
+ dr("Cargo") = TxtCargo.Text.ToDouble
+ dr("Abono") = TxtAbono.Text.ToDouble
+ dr("ImporteMN") = If(Math.Abs(TxtCargo.Text.ToDouble) > 0, TxtCargo.Text.ToDouble, TxtAbono.Text.ToDouble)
+ dr("CveSubProyecto") = DdlSubProyecto.SelectedValue
+
+
+ TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbono.Text.ToDouble).ToString.FormatoNumero
+ TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargo.Text.ToDouble).ToString.FormatoNumero
+ DtMovimientos.Rows.Add(dr)
+ DtMovimientos.AcceptChanges()
+
+ If CvePrePoliza > 0 Then
+ GvPrePoliza.DataSource = DtMovimientos
+ GvPrePoliza.DataBind()
+ UpPrePoliza.Update()
+ End If
+ Else
+ Dim dr As DataRow = DtMovimientos.NewRow
+ Dim CodigoCuenta As String = ""
+ Dim NombreCuenta As String = ""
+
+ dr("IdCuenta") = DdlCtaContable.SelectedValue
+
+ If DdlCtaContable.SelectedValue.ToEntero > 0 Then
+ Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", DdlCtaContable.SelectedValue))
+ If drr IsNot Nothing Then
+ CodigoCuenta = drr("CuentaFormato").ToString()
+ NombreCuenta = drr("Nombre").ToString()
+ End If
+ End If
+
+ dr("CodigoCuenta") = CodigoCuenta & " " & NombreCuenta
+ dr("Cuenta") = DdlConceptosContables.SelectedItem.Text
+ dr("Referencia") = TxtReferencia.Text
+ dr("Concepto") = TxtObservaciones.Text
+ dr("TipoMovto") = If(Math.Abs(TxtCargo.Text.ToDouble) > 0, 0, 1)
+ dr("EsComodin") = 0
+ dr("CveConcepto") = DdlConceptosContables.SelectedValue
+ dr("CveConceptoContable") = DdlConceptosContables.SelectedValue
+ dr("ConceptoContable") = DdlConceptosContables.SelectedItem.Text
+ dr("Cargo") = TxtCargo.Text.ToDouble
+ dr("Abono") = TxtAbono.Text.ToDouble
+ dr("Descripcion") = TxtDescripcion.Text
+ dr("CveSubProyecto") = DdlSubProyecto.SelectedValue
+ dr("CveProveedor") = DdlProveedores.SelectedValue.ToEntero
+ dr("CveCompra") = DdlCompras.SelectedValue.ToEntero
+ dr("CvePersonal") = DdlPersonal.SelectedValue.ToEntero
+ dr("CveClasificacion") = DdlClasificaciones.SelectedValue.ToEntero
+ dr("CveCliente") = DdlClientes.SelectedValue.ToEntero
+ dr("CveVenta") = DdlVentas.SelectedValue.ToEntero
+ dr("TC") = TxtTC.Text.ToDouble
+
+ TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbono.Text.ToDouble).ToString.FormatoNumero
+ TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargo.Text.ToDouble).ToString.FormatoNumero
+ DtMovimientos.Rows.Add(dr)
+ DtMovimientos.AcceptChanges()
+
+ 'If CvePrePoliza > 0 Then
+ ' GvPrePoliza.DataSource = DtMovimientos
+ ' GvPrePoliza.DataBind()
+ ' UpPrePoliza.Update()
+ 'End If
+
+ GvMov.DataSource = DtMovimientos
+ GvMov.DataBind()
+ UPMovs.Update()
+ Actualizar = False
+
+ End If
+
+ End If
+
+ TxtCargo.Text = ""
+ TxtAbono.Text = ""
+ TxtReferencia.Text = ""
+ TxtDescripcion.Text = ""
+ End Sub
+
+#Region "PESTAÑA INFORMACION GENERAL DE BANCO IE"
+ Public Sub Bancos_Click(sender As Object, e As EventArgs)
+ Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
+ RowIndex = GvRow.RowIndex
+
+ If GvRow.FCTextBox("TxtAbono").Text = "" Then
+ CargaTipoTransaccion("Ing")
+ Else
+ CargaTipoTransaccion("Egs")
+ End If
+
+
+ TxtDocumentoImporte.Text = If(GvRow.FCTextBox("TxtAbono").Text = "", GvRow.FCTextBox("TxtCargo").Text.FormatoNumero, GvRow.FCTextBox("TxtAbono").Text.FormatoNumero)
+ UpBancos.Update()
+ RegistraScript(String.Format("$('#{0}').modal();", "DivContadoModal"))
+ End Sub
+ Private Sub CargaTipoTransaccion(Tipo As String)
+ DdlTipoTransaccion.Items.Clear()
+ DdlTipoTransaccion.DataSource = GlobalDTTipoTransacciones.FiltraParametros($"Tipo = '{Tipo}'")
+ DdlTipoTransaccion.DataBind()
+ DdlTipoTransaccion.Items.Insert(0, New ListItem("Seleccione Tipo Movimiento", "-1"))
+ End Sub
+ Private Sub CargaCuentas()
+ DdlCuenta.Items.Clear()
+ DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) '.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", DdlMoneda.SelectedValue))
+ DdlCuenta.DataBind()
+ DdlCuenta.Items.Insert(0, New ListItem("Seleccione", "-1"))
+ End Sub
+ Private Sub BtnContado_Click(sender As Object, e As EventArgs) Handles BtnContado.Click
+ CveConcepto = 30
+ CveTipoTransaccion = DdlTipoTransaccion.SelectedValue.ToEntero
+ CveCuenta = DdlCuenta.SelectedValue.ToEntero
+ Folio = TxtDocumentoFolio.Text
+ ImporteDocumento = TxtDocumentoImporte.Text.ToDecimal
+ Observaciones = TxtDocumentoObservaciones.Text
+ Beneficiario = TxtDocumentoBeneficiario.Text
+ RegistraScript(String.Format("$('#{0}').modal('hide');", "DivContadoModal"))
+ GvMov.Rows(RowIndex).FCLinkButton("ImgBancos").CssClass = "btn btn-circle btn-sm green"
+ UPMovs.Update()
+ End Sub
+
+ Private Sub BtnEliminar_Click(sender As Object, e As EventArgs) Handles BtnEliminar.Click
+ Dim ObjContabilidad As New ClsContabilidad
ObjContabilidad.IniciaTransacSQL()
Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
ObjConta.IniciaTransacSQL()
Dim TieneError As Boolean = False
- If ObjContabilidad.RemovePrePolizas(CvePrePoliza, UsuarioActual.CveEmpresa) Then
+ If ObjContabilidad.RemovePrePolizas(CvePrePoliza, UsuarioActual.CveEmpresa) Then
If IdPoliza > 0 Then
If Not ObjConta.RemovePoliza(IdPoliza) Then
TieneError = True
End If
- End If
-
- Alert("La Prepóliza ha sido eliminada", TipoMensaje.MsgInformacion)
- Else
- Alert("La Prepóliza ha podido ser eliminada", TipoMensaje.MsgError)
+ End If
+
+ Alert("La Prepóliza ha sido eliminada", TipoMensaje.MsgInformacion)
+ Else
+ Alert("La Prepóliza ha podido ser eliminada", TipoMensaje.MsgError)
TieneError = True
- End If
-
+ End If
+
If Not TieneError Then
ObjContabilidad.Commit()
ObjConta.Commit()
Else
ObjContabilidad.RollBack()
ObjConta.RollBack()
- End If
-
- ObjContabilidad.Dispose()
- End Sub
-#End Region
-
- Protected Sub DdlTipoGasto_SelectedIndexChanged(sender As Object, e As EventArgs)
- If UpPrePoliza.Visible Then
- For Each Gvr As GridViewRow In GvPrePoliza.Rows
- Gvr.FCDropDownList("DdlTipoGasto").SelectedValueExist(DdlTipoGasto.SelectedValue)
- Next
- UpPrePoliza.Update()
- End If
- If UPMovs.Visible Then
- For Each Gvr As GridViewRow In GvMov.Rows
- Gvr.FCDropDownList("DdlTipoGasto").SelectedValueExist(DdlTipoGasto.SelectedValue)
- Next
- UPMovs.Update()
- End If
- End Sub
- Protected Sub DdlSubProyectoFiltro_SelectedIndexChanged(sender As Object, e As EventArgs)
- Dim Ddl As DropDownList = CType(sender, DropDownList)
- For Each Gvr As GridViewRow In GvPrePoliza.Rows
- If Ddl.SelectedValue.ToEntero > 0 Then
- If Gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero = Ddl.SelectedValue.ToEntero Or Not Gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero > 0 Or Gvr.FCDropDownList("DdlSubProyecto").Enabled Then
- Gvr.Visible = True
- Gvr.FCDropDownList("DdlSubProyecto").SelectedValueExist(Ddl.SelectedValue)
- Else
- Gvr.Visible = False
- End If
- Else
- Gvr.Visible = True
- End If
- Next
- UpPrePoliza.Update()
- RegistraScript("calculateAbono()", "cargo")
- RegistraScript("calculateCargo()", "abono")
- RegistraScript("comparar()", "compara")
- End Sub
- Protected Sub DdlSubProyectoFiltroMov_SelectedIndexChanged(sender As Object, e As EventArgs)
- For Each Gvr As GridViewRow In GvMov.Rows
- If DdlSubProyectoFiltroMov.SelectedValue.ToEntero > 0 Then
- If Gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero = DdlSubProyectoFiltroMov.SelectedValue.ToEntero Or Not Gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero > 0 Or Gvr.FCDropDownList("DdlSubProyecto").Enabled Then
- Gvr.Visible = True
- Gvr.FCDropDownList("DdlSubProyecto").SelectedValueExist(DdlSubProyectoFiltroMov.SelectedValue)
- Else
- Gvr.Visible = False
- End If
- Else
- Gvr.Visible = True
- End If
- Next
- UpPrePoliza.Update()
- RegistraScript("calculateAbono()", "cargo")
- RegistraScript("calculateCargo()", "abono")
- RegistraScript("comparar()", "compara")
- End Sub
-
- Private Sub GvMov_RowEditing(sender As Object, e As GridViewEditEventArgs) Handles GvMov.RowEditing
- Actualizar = True
- GvMov.DataKeys(e.NewEditIndex).Value.ToString.ToEntero
- Dim idMov As Integer = GvMov.DataKeys(e.NewEditIndex).Value.ToString.ToEntero
-
- Dim DrM As DataRow = DtMovimientos.Rows(e.NewEditIndex)
-
- If DrM IsNot Nothing Then
- HdnCve.Value = idMov.ToString
-
- DdlCtaContable.SelectedValue = DrM("IdCuenta")
- TxtReferencia.Text = DrM("Referencia")
- TxtObservaciones.Text = DrM("Concepto")
- ' (Math.Abs(TxtCargo.Text.ToDouble) > 0, 0, 1) = dr("TipoMovto")
- DrM("EsComodin") = 0
- DdlConceptosContables.SelectedValue = DrM("CveConcepto").ToString
- TxtCargo.Text = DrM("Cargo").ToString
- TxtAbono.Text = DrM("Abono").ToString
- TxtDescripcion.Text = DrM("Descripcion")
- DdlSubProyecto.SelectedValue = DrM("CveSubProyecto")
- DdlProveedores.SelectedValue = DrM("CveProveedor")
- DdlCompras.SelectedValue = DrM("CveCompra")
- DdlPersonal.SelectedValue = DrM("CvePersonal")
- ' DrM("CveClasificacion") = -1
- DdlClientes.SelectedValue = DrM("CveCliente")
- DdlVentas.SelectedValue = DrM("CveVenta")
- LbCancelarEdicion.Visible = True
- LbAgregar.Text = "Actualizar"
- GvMov.Rows(e.NewEditIndex).FCTextBox("TxtCargo").CssClass = ""
- GvMov.Rows(e.NewEditIndex).FCTextBox("TxtAbono").CssClass = ""
- End If
-
- UPPDocumento.Update()
- DivAgregarConceptos.Visible = True
-
- 'If DtMovimientos Is Nothing Then CreaDT()
-
- 'Dim dr As DataRow = DtMovimientos.NewRow
- 'Dim CodigoCuenta As String = ""
- 'Dim NombreCuenta As String = ""
-
- 'dr("IdCuenta") = DdlCtaContable.SelectedValue
-
- 'If DdlCtaContable.SelectedValue.ToEntero > 0 Then
- ' Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", DdlCtaContable.SelectedValue))
- ' If drr IsNot Nothing Then
- ' CodigoCuenta = drr("CuentaFormato").ToString()
- ' NombreCuenta = drr("Nombre").ToString()
- ' End If
- 'End If
-
- 'dr("CodigoCuenta") = CodigoCuenta & " " & NombreCuenta
- 'dr("Cuenta") = DdlConceptosContables.SelectedItem
- 'dr("Referencia") = TxtReferencia.Text
- 'dr("Concepto") = TxtObservaciones.Text
- 'dr("TipoMovto") = If(Math.Abs(TxtCargo.Text.ToDouble) > 0, 0, 1)
- 'dr("EsComodin") = 0
- 'dr("CveConcepto") = DdlConceptosContables.SelectedValue
- 'dr("Cargo") = TxtCargo.Text.ToDouble
- 'dr("Abono") = TxtAbono.Text.ToDouble
- 'dr("Descripcion") = TxtDescripcion.Text
- 'dr("CveSubProyecto") = DdlSubProyecto.SelectedValue
- 'dr("CveProveedor") = DdlProveedores.SelectedValue.ToEntero
- 'dr("CveCompra") = DdlCompras.SelectedValue.ToEntero
- 'dr("CvePersonal") = DdlPersonal.SelectedValue.ToEntero
- 'dr("CveClasificacion") = -1
- 'dr("CveCliente") = DdlClientes.SelectedValue.ToEntero
- 'dr("CveVenta") = DdlVentas.SelectedValue.ToEntero
-
- 'TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbono.Text.ToDouble).ToString.FormatoNumero
- 'TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargo.Text.ToDouble).ToString.FormatoNumero
- 'DtMovimientos.Rows.Add(dr)
-
- 'If CvePrePoliza > 0 Then
- ' GvPrePoliza.DataSource = DtMovimientos
- ' GvPrePoliza.DataBind()
- 'End If
-
-
- 'GvMov.DataSource = DtMovimientos
- 'GvMov.DataBind()
- 'UPMovs.Update()
-
-
- End Sub
-
- Private Sub LbCancelarEdicion_Click(sender As Object, e As EventArgs) Handles LbCancelarEdicion.Click
- LbCancelarEdicion.Visible = False
- TxtObservaciones.Text = ""
- Actualizar = False
- LbAgregar.Text = "Agregar"
-
- GvMov.DataSource = DtMovimientos
- GvMov.DataBind()
- UPMovs.Update()
- RegistraScript("calculateCargo();calculateAbono();comparar()")
- End Sub
-
- Private Sub BtnContabilizar_Click(sender As Object, e As EventArgs) Handles BtnContabilizar.Click
-
+ End If
+
+ ObjContabilidad.Dispose()
+ End Sub
+#End Region
+
+ Protected Sub DdlTipoGasto_SelectedIndexChanged(sender As Object, e As EventArgs)
+ If UpPrePoliza.Visible Then
+ For Each Gvr As GridViewRow In GvPrePoliza.Rows
+ Gvr.FCDropDownList("DdlTipoGasto").SelectedValueExist(DdlTipoGasto.SelectedValue)
+ Next
+ UpPrePoliza.Update()
+ End If
+ If UPMovs.Visible Then
+ For Each Gvr As GridViewRow In GvMov.Rows
+ Gvr.FCDropDownList("DdlTipoGasto").SelectedValueExist(DdlTipoGasto.SelectedValue)
+ Next
+ UPMovs.Update()
+ End If
+ End Sub
+ Protected Sub DdlSubProyectoFiltro_SelectedIndexChanged(sender As Object, e As EventArgs)
+ Dim Ddl As DropDownList = CType(sender, DropDownList)
+ For Each Gvr As GridViewRow In GvPrePoliza.Rows
+ If Ddl.SelectedValue.ToEntero > 0 Then
+ If Gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero = Ddl.SelectedValue.ToEntero Or Not Gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero > 0 Or Gvr.FCDropDownList("DdlSubProyecto").Enabled Then
+ Gvr.Visible = True
+ Gvr.FCDropDownList("DdlSubProyecto").SelectedValueExist(Ddl.SelectedValue)
+ Else
+ Gvr.Visible = False
+ End If
+ Else
+ Gvr.Visible = True
+ End If
+ Next
+ UpPrePoliza.Update()
+ RegistraScript("calculateAbono()", "cargo")
+ RegistraScript("calculateCargo()", "abono")
+ RegistraScript("comparar()", "compara")
+ End Sub
+ Protected Sub DdlSubProyectoFiltroMov_SelectedIndexChanged(sender As Object, e As EventArgs)
+ For Each Gvr As GridViewRow In GvMov.Rows
+ If DdlSubProyectoFiltroMov.SelectedValue.ToEntero > 0 Then
+ If Gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero = DdlSubProyectoFiltroMov.SelectedValue.ToEntero Or Not Gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero > 0 Or Gvr.FCDropDownList("DdlSubProyecto").Enabled Then
+ Gvr.Visible = True
+ Gvr.FCDropDownList("DdlSubProyecto").SelectedValueExist(DdlSubProyectoFiltroMov.SelectedValue)
+ Else
+ Gvr.Visible = False
+ End If
+ Else
+ Gvr.Visible = True
+ End If
+ Next
+ UpPrePoliza.Update()
+ RegistraScript("calculateAbono()", "cargo")
+ RegistraScript("calculateCargo()", "abono")
+ RegistraScript("comparar()", "compara")
+ End Sub
+
+ Private Sub GvMov_RowEditing(sender As Object, e As GridViewEditEventArgs) Handles GvMov.RowEditing
+ Actualizar = True
+ GvMov.DataKeys(e.NewEditIndex).Value.ToString.ToEntero
+ Dim idMov As Integer = GvMov.DataKeys(e.NewEditIndex).Value.ToString.ToEntero
+
+ Dim DrM As DataRow = DtMovimientos.Rows(e.NewEditIndex)
+
+ If DrM IsNot Nothing Then
+ HdnCve.Value = idMov.ToString
+
+ DdlCtaContable.SelectedValue = DrM("IdCuenta")
+ TxtReferencia.Text = DrM("Referencia")
+ TxtObservaciones.Text = DrM("Concepto")
+ ' (Math.Abs(TxtCargo.Text.ToDouble) > 0, 0, 1) = dr("TipoMovto")
+ DrM("EsComodin") = 0
+ DdlConceptosContables.SelectedValue = DrM("CveConcepto").ToString
+ TxtCargo.Text = DrM("Cargo").ToString
+ TxtAbono.Text = DrM("Abono").ToString
+ TxtDescripcion.Text = DrM("Descripcion")
+ DdlSubProyecto.SelectedValue = DrM("CveSubProyecto")
+ DdlProveedores.SelectedValue = DrM("CveProveedor")
+ DdlCompras.SelectedValue = DrM("CveCompra")
+ DdlPersonal.SelectedValue = DrM("CvePersonal")
+ ' DrM("CveClasificacion") = -1
+ DdlClientes.SelectedValue = DrM("CveCliente")
+ DdlVentas.SelectedValue = DrM("CveVenta")
+ LbCancelarEdicion.Visible = True
+ LbAgregar.Text = "Actualizar"
+ GvMov.Rows(e.NewEditIndex).FCTextBox("TxtCargo").CssClass = ""
+ GvMov.Rows(e.NewEditIndex).FCTextBox("TxtAbono").CssClass = ""
+ End If
+
+ UPPDocumento.Update()
+ DivAgregarConceptos.Visible = True
+
+ 'If DtMovimientos Is Nothing Then CreaDT()
+
+ 'Dim dr As DataRow = DtMovimientos.NewRow
+ 'Dim CodigoCuenta As String = ""
+ 'Dim NombreCuenta As String = ""
+
+ 'dr("IdCuenta") = DdlCtaContable.SelectedValue
+
+ 'If DdlCtaContable.SelectedValue.ToEntero > 0 Then
+ ' Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", DdlCtaContable.SelectedValue))
+ ' If drr IsNot Nothing Then
+ ' CodigoCuenta = drr("CuentaFormato").ToString()
+ ' NombreCuenta = drr("Nombre").ToString()
+ ' End If
+ 'End If
+
+ 'dr("CodigoCuenta") = CodigoCuenta & " " & NombreCuenta
+ 'dr("Cuenta") = DdlConceptosContables.SelectedItem
+ 'dr("Referencia") = TxtReferencia.Text
+ 'dr("Concepto") = TxtObservaciones.Text
+ 'dr("TipoMovto") = If(Math.Abs(TxtCargo.Text.ToDouble) > 0, 0, 1)
+ 'dr("EsComodin") = 0
+ 'dr("CveConcepto") = DdlConceptosContables.SelectedValue
+ 'dr("Cargo") = TxtCargo.Text.ToDouble
+ 'dr("Abono") = TxtAbono.Text.ToDouble
+ 'dr("Descripcion") = TxtDescripcion.Text
+ 'dr("CveSubProyecto") = DdlSubProyecto.SelectedValue
+ 'dr("CveProveedor") = DdlProveedores.SelectedValue.ToEntero
+ 'dr("CveCompra") = DdlCompras.SelectedValue.ToEntero
+ 'dr("CvePersonal") = DdlPersonal.SelectedValue.ToEntero
+ 'dr("CveClasificacion") = -1
+ 'dr("CveCliente") = DdlClientes.SelectedValue.ToEntero
+ 'dr("CveVenta") = DdlVentas.SelectedValue.ToEntero
+
+ 'TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbono.Text.ToDouble).ToString.FormatoNumero
+ 'TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargo.Text.ToDouble).ToString.FormatoNumero
+ 'DtMovimientos.Rows.Add(dr)
+
+ 'If CvePrePoliza > 0 Then
+ ' GvPrePoliza.DataSource = DtMovimientos
+ ' GvPrePoliza.DataBind()
+ 'End If
+
+
+ 'GvMov.DataSource = DtMovimientos
+ 'GvMov.DataBind()
+ 'UPMovs.Update()
+
+
+ End Sub
+
+ Private Sub LbCancelarEdicion_Click(sender As Object, e As EventArgs) Handles LbCancelarEdicion.Click
+ LbCancelarEdicion.Visible = False
+ TxtObservaciones.Text = ""
+ Actualizar = False
+ LbAgregar.Text = "Agregar"
+
+ GvMov.DataSource = DtMovimientos
+ GvMov.DataBind()
+ UPMovs.Update()
+ RegistraScript("calculateCargo();calculateAbono();comparar()")
+ End Sub
+
+ Private Sub BtnContabilizar_Click(sender As Object, e As EventArgs) Handles BtnContabilizar.Click
+
Contabilizar()
End Sub
Private Sub Contabilizar()
- Dim ObjConta As New ClsContabilidad
-
+ Dim ObjConta As New ClsContabilidad
+
If IdPoliza > 0 Then 'si está bloqueada, lo desbloqueaprimero
ObjConta.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False)
- End If
-
- If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, pIDPoliza:=If(IdPoliza > 0, IdPoliza, -1), Concepto:=TxtConcepto.Text, Fecha:=TxtFechaDocumento.Text.ToDateTime) Then
- Alert(String.Format("Prepóliza contabilizada.
Folio:Ver Póliza", ObjConta.ContaIdPoliza), ModExtensiones.TipoMensaje.MsgInformacion)
- Else
-
- Alert($"Ocurrio un error al contabilizar {ObjConta.AlertaMensaje}", TipoMensaje.MsgAdvertencia)
- End If
-
+ End If
+
+ If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, pIDPoliza:=If(IdPoliza > 0, IdPoliza, -1), Concepto:=TxtConcepto.Text, Fecha:=TxtFechaDocumento.Text.ToDateTime) Then
+ Alert(String.Format("Prepóliza contabilizada.
Folio:Ver Póliza", ObjConta.ContaIdPoliza), ModExtensiones.TipoMensaje.MsgInformacion)
+ Else
+
+ Alert($"Ocurrio un error al contabilizar {ObjConta.AlertaMensaje}", TipoMensaje.MsgAdvertencia)
+ End If
+
ObjConta.Dispose()
End Sub
-#Region "COMPLEMENTO DE PAGO"
+#Region "COMPLEMENTO DE PAGO"
- Private Sub GeneraTimbre(CvePrePoliza As Integer)
- Dim Str As New StringBuilder
- Dim Banco As New ClsBancos
- Banco.IniciaTransacSQL()
- If Banco.GeneraTimbrePago(-1, -1, UsuarioActual, CvePrePoliza:=CvePrePoliza) Then
- If Banco.Mensaje = "" Then
- Banco.Commit()
- PDFReciboDePagos(-1, -1, Banco.CveComplementoPago, False)
- Str.AppendFormat("Folio: {0} ", Banco.ComplementoSerieFolio)
- Str.AppendFormat("XML ", Encripta(String.Format("OP=CompP&EXT=xml&SerieFolio={0}&CveComplementoPago={1}", Banco.ComplementoSerieFolio, Banco.CveComplementoPago)))
- Str.AppendFormat("PDF ", Encripta(String.Format("OP=CompP&EXT=pdf&SerieFolio={0}&CveComplementoPago={1}", Banco.ComplementoSerieFolio, Banco.CveComplementoPago)))
- MandaCorreo(Banco.ComplementoSerieFolio, Banco.CobranzaCorreo)
- End If
- Else
- Banco.RollBack()
- Str.AppendFormat("No se genero complemento por el siguiente motivo: {0}", Banco.Mensaje)
- End If
- Banco.Dispose()
- Alert(Str.ToString, TipoMensaje.MsgInformacion, "self.parent.tb_remove();self.parent.location.reload();")
- End Sub
-
- Private Sub MandaCorreo(NombreArchivo As String, Correo As String, Optional ConAlerta As Boolean = True)
- Try
- Dim Msg As String = ""
- If NombreArchivo <> "-1" Then '
- Dim ObjMail As New ClsSisMail()
- Dim RutaXML As String = String.Format("{0}\XML\Pag\{1}.xml", UsuarioActual.Empresa.Ruta, NombreArchivo)
- Dim RutaPDF As String = String.Format("{0}\PDF\Pag\{1}.pdf", UsuarioActual.Empresa.Ruta, NombreArchivo)
- Dim Cuerpo As String = "Se hace entrega del comprobante de pago"
- Dim Asunto As String = "Entrega de comprobante de pago"
- If IO.File.Exists(RutaPDF) AndAlso IO.File.Exists(RutaXML) Then
- Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail)
- LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.Ruta = RutaPDF})
- LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.Ruta = RutaXML})
- If ObjMail.SendMail(UsuarioActual.Empresa, Correo, Asunto, Cuerpo, "", LSRutasMail) Then
- If ConAlerta Then
- 'RegistraScript("$('#ModalDivMail').modal('hide');")
- Alert("El correo se envió correctamente", TipoMensaje.MsgInformacion)
- End If
- Else
- Msg = "No se pudo enviar el correo electrónico."
- End If
- Else
- Msg = "No se pudo adjuntar el correo electrónico."
- End If
- End If
- If ConAlerta AndAlso Msg <> "" Then
- Alert(Msg, TipoMensaje.MsgError)
- End If
- Catch ex As Exception
- OnError("Ocurrió error al mandar MAIL", ex)
- End Try
- End Sub
-
- Protected Sub LnkComplementoPago_Click(sender As Object, e As EventArgs)
- GeneraTimbre(CvePrePoliza)
+ Private Sub GeneraTimbre(CvePrePoliza As Integer)
+ Dim Str As New StringBuilder
+ Dim Banco As New ClsBancos
+ Banco.IniciaTransacSQL()
+ If Banco.GeneraTimbrePago(-1, -1, UsuarioActual, CvePrePoliza:=CvePrePoliza) Then
+ If Banco.Mensaje = "" Then
+ Banco.Commit()
+ PDFReciboDePagos(-1, -1, Banco.CveComplementoPago, False)
+ Str.AppendFormat("Folio: {0} ", Banco.ComplementoSerieFolio)
+ Str.AppendFormat("XML ", Encripta(String.Format("OP=CompP&EXT=xml&SerieFolio={0}&CveComplementoPago={1}", Banco.ComplementoSerieFolio, Banco.CveComplementoPago)))
+ Str.AppendFormat("PDF ", Encripta(String.Format("OP=CompP&EXT=pdf&SerieFolio={0}&CveComplementoPago={1}", Banco.ComplementoSerieFolio, Banco.CveComplementoPago)))
+ MandaCorreo(Banco.ComplementoSerieFolio, Banco.CobranzaCorreo)
+ End If
+ Else
+ Banco.RollBack()
+ Str.AppendFormat("No se genero complemento por el siguiente motivo: {0}", Banco.Mensaje)
+ End If
+ Banco.Dispose()
+ Alert(Str.ToString, TipoMensaje.MsgInformacion, "self.parent.tb_remove();self.parent.location.reload();")
End Sub
-#End Region
+
+ Private Sub MandaCorreo(NombreArchivo As String, Correo As String, Optional ConAlerta As Boolean = True)
+ Try
+ Dim Msg As String = ""
+ If NombreArchivo <> "-1" Then '
+ Dim ObjMail As New ClsSisMail()
+ Dim RutaXML As String = String.Format("{0}\XML\Pag\{1}.xml", UsuarioActual.Empresa.Ruta, NombreArchivo)
+ Dim RutaPDF As String = String.Format("{0}\PDF\Pag\{1}.pdf", UsuarioActual.Empresa.Ruta, NombreArchivo)
+ Dim Cuerpo As String = "Se hace entrega del comprobante de pago"
+ Dim Asunto As String = "Entrega de comprobante de pago"
+ If IO.File.Exists(RutaPDF) AndAlso IO.File.Exists(RutaXML) Then
+ Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail)
+ LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.Ruta = RutaPDF})
+ LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.Ruta = RutaXML})
+ If ObjMail.SendMail(UsuarioActual.Empresa, Correo, Asunto, Cuerpo, "", LSRutasMail) Then
+ If ConAlerta Then
+ 'RegistraScript("$('#ModalDivMail').modal('hide');")
+ Alert("El correo se envió correctamente", TipoMensaje.MsgInformacion)
+ End If
+ Else
+ Msg = "No se pudo enviar el correo electrónico."
+ End If
+ Else
+ Msg = "No se pudo adjuntar el correo electrónico."
+ End If
+ End If
+ If ConAlerta AndAlso Msg <> "" Then
+ Alert(Msg, TipoMensaje.MsgError)
+ End If
+ Catch ex As Exception
+ OnError("Ocurrió error al mandar MAIL", ex)
+ End Try
+ End Sub
+
+ Protected Sub LnkComplementoPago_Click(sender As Object, e As EventArgs)
+ GeneraTimbre(CvePrePoliza)
+ End Sub
+#End Region
@@ -1679,7 +1690,7 @@ Partial Class ContabilidadC_RegPrePoliza
ddl.Items.Insert(0, New ListItem(" - ", "-1"))
End If
- ObjCompras.Dispose()
+ ObjCompras.Dispose()
End Sub
Private Sub CargaGvBitacora()
@@ -1691,5 +1702,5 @@ Partial Class ContabilidadC_RegPrePoliza
End If
ObjGral.Dispose()
End Sub
-End Class
-
+End Class
+
diff --git a/Contabilidad/RegPrePolizaS.aspx b/Contabilidad/RegPrePolizaS.aspx
index e3b61c3c4..5d6f271af 100644
--- a/Contabilidad/RegPrePolizaS.aspx
+++ b/Contabilidad/RegPrePolizaS.aspx
@@ -650,6 +650,7 @@
+
diff --git a/Contabilidad/RegPrePolizaS.aspx.vb b/Contabilidad/RegPrePolizaS.aspx.vb
index 2c17d3d82..2210878a2 100644
--- a/Contabilidad/RegPrePolizaS.aspx.vb
+++ b/Contabilidad/RegPrePolizaS.aspx.vb
@@ -1079,6 +1079,13 @@ Partial Class ContabilidadC_RegPrePolizaS
Else
DdlPersonalE.Visible = False
End If
+
+ If DdlConceptosContablesE.SelectedValue.ToEntero.Contiene(51) Then
+ CargaClasificacionesE()
+ DdlClasificacionesE.Visible = True
+ Else
+ DdlClasificacionesE.Visible = False
+ End If
If DdlConceptosContablesE.SelectedValue.ToEntero.Contiene(1, 2, 203, 207, 13, 61, 8, 9, 62, 63, 38, 39) Then
CargaClientesE()
DdlClientesE.Visible = True
@@ -1136,6 +1143,12 @@ Partial Class ContabilidadC_RegPrePolizaS
DdlPersonalE.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa)
DdlPersonalE.DataBind()
DdlPersonalE.Items.Insert(0, New ListItem(" - ", "-1"))
+ End Sub
+
+ Private Sub CargaClasificacionesE()
+ DdlClasificacionesE.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa)
+ DdlClasificacionesE.DataBind()
+ DdlClasificacionesE.Items.Insert(0, New ListItem(" - ", "-1"))
End Sub
Private Sub DdlProveedoresE_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlProveedoresE.SelectedIndexChanged
CargaComprasE(DdlProveedoresE.SelectedValue.ToEntero)
diff --git a/Contratos/Contrato.aspx.vb b/Contratos/Contrato.aspx.vb
index fb51b55b5..1653e71d9 100644
--- a/Contratos/Contrato.aspx.vb
+++ b/Contratos/Contrato.aspx.vb
@@ -1048,7 +1048,7 @@ Partial Class Contratos_Default
TxtPorAnticipo.Text = ObjContratos.PorAmortizacionAnticipo.FormatoNumero
TxtPorAmortizacionAnticipo.Text = ObjContratos.PorAmortizacionAnticipo.FormatoNumero
TxtPorGarantia.Text = ObjContratos.PorGarantia.FormatoNumero
- DdlProyecto.SelectedValue = ObjContratos.CveProyecto.ToString
+ 'DdlProyecto.SelectedValue = ObjContratos.CveProyecto.ToString
CargaSubProyectoContrato(DdlProyecto.SelectedValue.ToEntero)
DdlSubProyectoContrato.SelectedValue = ObjContratos.CveSubProyecto.ToString
TxtPorIVA.Text = ObjContratos.PorIVA.ToString
diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb
index b4a6d3302..93b79843a 100644
--- a/Inventarios/EntradasSalidas.aspx.vb
+++ b/Inventarios/EntradasSalidas.aspx.vb
@@ -294,6 +294,11 @@ Partial Class Inventarios_EntradasSalidas
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then
+ If UsuarioActual.CveUsuario = 100 AndAlso IfNull(Request("Regenera"), "").ToString = "1" Then
+ RegeneraRM(Request("CveMovimiento").ToString.ToEntero, 119)
+ Exit Sub
+ End If
+
CveMovimiento = -1
CveMovimientoRelacionado = -1
TieneRelacionado = -1
@@ -3594,45 +3599,52 @@ Partial Class Inventarios_EntradasSalidas
End If
Next
Else
- If ObjInventario.Modulo = "ASA/G1" Then
+ If ObjInventario.Modulo.Contiene("TA/G1", "Recons") Then
Contabilizable = False
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, DtCostos.SUMD("Total").RoundSQL, Concepto, 68, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimientoRelacionado, ImporteMX:=DtCostos.SUMD("Total").RoundSQL, Contabilizable:=Contabilizable) Then
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, DtCostos.SUMD("Total").RoundSQL, Concepto, 289, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimientoRelacionado, ImporteMX:=DtCostos.SUMD("Total").RoundSQL, Contabilizable:=Contabilizable) Then
ErrorMovInv = True
End If
Else
- If DdlConcepto.SelectedValue.Contiene("6", "22", "23", "7", "16", "21", "24") Then
- 'genero las prepolizas manuales
- Dim tCveConcepto As Integer = 95
- Dim CveCuenta As Integer
- If UsuarioActual.CveEmpresa = 119 Then CveCuenta = 55519
- IdCtaContable = 1
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, DtCostos.SUMD("Total"), Concepto, tCveConcepto, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveClasificacion:=-1, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=DtCostos.SUMD("Total"), CveSubProyecto:=-1, CveCuenta:=CveCuenta, Contabilizable:=Contabilizable) Then
+ If ObjInventario.Modulo = "ASA/G1" Then
+ Contabilizable = False
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, DtCostos.SUMD("Total").RoundSQL, Concepto, 68, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimientoRelacionado, ImporteMX:=DtCostos.SUMD("Total").RoundSQL, Contabilizable:=Contabilizable) Then
ErrorMovInv = True
-
End If
-
Else
-
- Dim tCveSubProyecto = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen={DdlAlmacen.SelectedValue.ToEntero}").ToEntero
- Dim tCveConcepto As Integer = 69
- If DdlConcepto.SelectedValue = "30" Then
- tCveConcepto = 181
- IdCtaContable = UsuarioActual.Empresa.Funcionalidad(342).ToEntero
- End If
-
- For Each RowInv As DataRow In tmpCostos.Rows
- ValorInventario = DtCostos.SUM("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").ToString.ToDecimal.RoundSQL
- If tCveConcepto = 69 Then
- IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero
- End If
-
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, ValorInventario, Concepto, tCveConcepto, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=ValorInventario, CveSubProyecto:=tCveSubProyecto) Then
+ If DdlConcepto.SelectedValue.Contiene("6", "22", "23", "7", "16", "21", "24") Then
+ 'genero las prepolizas manuales
+ Dim tCveConcepto As Integer = 95
+ Dim CveCuenta As Integer
+ If UsuarioActual.CveEmpresa = 119 Then CveCuenta = 55519
+ IdCtaContable = 1
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, DtCostos.SUMD("Total"), Concepto, tCveConcepto, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveClasificacion:=-1, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=DtCostos.SUMD("Total"), CveSubProyecto:=-1, CveCuenta:=CveCuenta, Contabilizable:=Contabilizable) Then
ErrorMovInv = True
- Exit For
+
End If
- Next
+ Else
+ Dim tCveSubProyecto = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen={DdlAlmacen.SelectedValue.ToEntero}").ToEntero
+ Dim tCveConcepto As Integer = 69
+ If DdlConcepto.SelectedValue = "30" Then
+ tCveConcepto = 181
+ IdCtaContable = UsuarioActual.Empresa.Funcionalidad(342).ToEntero
+ End If
+
+ For Each RowInv As DataRow In tmpCostos.Rows
+ ValorInventario = DtCostos.SUM("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").ToString.ToDecimal.RoundSQL
+ If tCveConcepto = 69 Then
+ IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero
+ End If
+
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, ValorInventario, Concepto, tCveConcepto, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=ValorInventario, CveSubProyecto:=tCveSubProyecto) Then
+ ErrorMovInv = True
+ Exit For
+ End If
+
+ Next
+
+ End If
End If
End If
End If
@@ -4840,6 +4852,76 @@ Partial Class Inventarios_EntradasSalidas
End Sub
+ Private Sub RegeneraRM(CveMovD As Integer, CveMov2 As Integer)
+ 'Dim Retorno As Integer = -1
+ 'Dim ErrorMovInv As Boolean = False
+ 'Dim ObjConta As New ClsContabilidad
+ 'ObjConta.IniciaTransacSQL()
+ 'Dim ObjInventario As New ClsInventarios(ObjConta.IniciaTransacSQL)
+ 'Dim CveMovimientoInsertado As Integer = 0
+ 'Dim Fecha As Date
+ 'Dim Importe As Decimal
+
+ 'If ObjInventario.GetMovimientosDetalleTransitorio(CveMovD, UsuarioActual.CveEmpresa) Then
+
+
+ ' Fecha = ObjInventario.DtResultados.Rows(0)("FechaMovto").ToString.ToDate
+
+ ' Dim dtvirtual As DataTable = ObjInventario.DtResultados
+
+ ' If dtvirtual.Rows.Count > 0 Then
+ ' CveMovimientoInsertado = ObjInventario.AddMovimiento(352, 8, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="TA/VM")
+
+ ' For Each RowVirtual As DataRow In dtvirtual.Rows
+ ' Dim CvePS = RowVirtual("CvePS").ToString().ToEntero()
+ ' Dim CantidadUsado As Double = RowVirtual("Cantidad").ToString().ToDouble()
+ ' Dim PU As Decimal = RowVirtual("PUOriginal").ToString().ToDecimal()
+ ' Dim CveUM As Integer = RowVirtual("CveUM").ToString().ToEntero()
+ ' Dim CveMovimientoDetalle As Integer = RowVirtual("CveMovimientoDetalle").ToString().ToEntero()
+
+ ' If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInsertado, CantidadUsado, CveUM, CvePS, PU, -1, CveMovimientoDetalleEntrada:=CveMovimientoDetalle, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
+ ' ErrorMovInv = True
+ ' Exit For
+ ' End If
+ ' Next
+
+ ' If ObjInventario.GetMovimientosDetalle(CveMovimientoInsertado, UsuarioActual.CveEmpresa) Then
+
+ ' Dim resultado As DataTable = ObjInventario.DtResultados
+ ' Importe = resultado.SUMD("Total").RoundSQL
+
+ ' Dim Contabilizable As Boolean = False
+ ' Dim Concepto As String = "Traspaso"
+ ' Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Manualx", 53, 0, 0, 1, Fecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
+ ' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Importe, "", 68, Concepto, Fecha, -1, -1, CveMovimientoAlmacen:=CveMovimientoInsertado, ImporteMX:=Importe, Contabilizable:=Contabilizable) Then
+ ' ErrorMovInv = True
+ ' End If
+
+ ' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Importe, "", 68, Concepto, Fecha, -1, -1, CveMovimientoAlmacen:=CveMovD, ImporteMX:=Importe, Contabilizable:=Contabilizable) Then
+ ' ErrorMovInv = True
+ ' End If
+
+ ' If Not ErrorMovInv Then Retorno = CvePrePoliza
+
+ ' End If
+ ' End If
+ 'Else
+ ' ErrorMovInv = True
+ 'End If
+
+ 'If ErrorMovInv Then
+ ' ObjConta.RollBack()
+ ' Alert("No se aplico", TipoMensaje.MsgError)
+ 'Else
+ ' ObjConta.Commit()
+ ' Alert("Se aplico", TipoMensaje.MsgInformacion)
+ 'End If
+
+ 'ObjConta.Dispose()
+ 'ObjInventario.Dispose()
+
+ End Sub
+
End Class
diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb
index 097e61ba0..e45b5635f 100644
--- a/Inventarios/RecepcionAlmacen.aspx.vb
+++ b/Inventarios/RecepcionAlmacen.aspx.vb
@@ -2307,6 +2307,7 @@ Partial Class Inventarios_RecepcionAlmacen
Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL())
Dim ObjOC As New ClsOC(ObjInventario.IniciaTransacSQL())
Dim ObjAcum As New ClsAcumuladores(ObjInventario.IniciaTransacSQL())
+ Dim ObjVentas As New ClsVentas(ObjInventario.IniciaTransacSQL())
Dim ObjContaAC As ClsContPAQi = Nothing
Dim ObjContaContPAQ As ClsContPAQi = Nothing
@@ -2629,6 +2630,36 @@ Partial Class Inventarios_RecepcionAlmacen
If Not ErrorMovInv Then
MovtosEntradaExA.Add(MovEntradaExA.CveMovimiento)
FoliosEntradaExA.Add(MovEntradaExA.Folio)
+
+ 'SI LA REMISION FUE FACTURADA GENERA EL MOVIMIENTO DE SALIDA DIRECTA
+ If ObjFactura.DtRemisionesDocumentosRelacionados.Rows.Count > 0 Then
+ If ObjVentas.VerificarRemisionFacturada(ObjFactura.CveVenta) Then
+
+ Dim dttsalida As DataTable = dttexa.Copy
+ 'se limpia la seccion, para que lo tome automaticamente
+ For Each drr As DataRow In dttsalida.Rows
+ Dim RowFactura As DataRow = ObjVentas.DtResultados.FiltroPrimero($"CveVentaDetalleRemision={drr("CveVentaDetalle")}")
+ drr("CveVentaDetalle") = RowFactura("CveVentaDetalleFacturada")
+ drr("CveVenta") = RowFactura("CveVenta")
+ Next
+
+ For Each DrFactura As DataRow In Dt.FiltraParametros("", DistinctColumns:={"CveVenta"}).Rows
+ Dim dtSalidaFactura As DataTable = dttsalida.FiltraParametros($"CveVenta={DrFactura("CveVenta")}")
+ Dim MovSalidaDirectaExA = GenerarMovimientoAlmacenVenta(ObjFactura.CveAlmacenTraspasoDestino, 40, DrFactura("CveVenta").ToString().ToEntero(), MovEntradaExA.CveMovimiento, dtSalidaFactura, ObjInventario, ObjConta, ObjContaContPAQ, False, "RA/G2R3")
+
+ ErrorMovInv = MovSalidaDirectaExA.CveMovimiento <= 0
+
+ If ErrorMovInv Then
+ Exit For
+ Else
+ MovtosSalidaDirecta.Add(MovSalidaDirectaExA.CveMovimiento)
+ FoliosSalidaDirecta.Add(MovSalidaDirectaExA.Folio)
+ End If
+
+ Next
+
+ End If
+ End If
End If
End If
@@ -3459,6 +3490,8 @@ Partial Class Inventarios_RecepcionAlmacen
link = String.Format("{1}", MovtosSalidaDirecta(index), FoliosSalidaDirecta(index))
Msg.AppendFormat(" Movimiento de Salida Folio: {0}", link)
Next
+
+
End If
'APARTADO
diff --git a/Inventarios/ResguardoMaterial.aspx.vb b/Inventarios/ResguardoMaterial.aspx.vb
index 320899cee..95743d634 100644
--- a/Inventarios/ResguardoMaterial.aspx.vb
+++ b/Inventarios/ResguardoMaterial.aspx.vb
@@ -802,6 +802,7 @@ Partial Class Inventarios_ResguardoMaterial
Private Sub Guardar(Concepto As Integer)
Dim ObjInventario As New ClsInventarios
Dim ObjEventos As New ClsOIEventos(ObjInventario.IniciaTransacSQL()) 'Inicia la transacción
+ Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL())
Dim TieneError = False
Dim MensajeError As String = ""
Dim ImporteConcepto = 0.0
@@ -854,6 +855,7 @@ Partial Class Inventarios_ResguardoMaterial
If Not TieneError Then
CveMovimientoEntrada = ObjInventario.AddMovimiento(DdlAlmacenDestino.SelectedValue.ToEntero, 2, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, SubProyecto, ActivoFijo, Observaciones:=TxtObservaciones.Text, CvePersonal:=CvePersonal, CveMovimientoRelacionado:=CveMovimientoSalida, CveCliente:=CveCliente, CveProveedor:=CveProveedor, Modulo:="ResgMat2")
FolioEntrada = ObjInventario.Folio
+ Dim Importe As Decimal = 0
If CveMovimientoEntrada <= 0 Then
MensajeError = "Ocurrió un error al guardar el movimiento de entrada correctamente. Por favor vuelva a intentar."
@@ -862,6 +864,7 @@ Partial Class Inventarios_ResguardoMaterial
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
Dim CveSeccionAlmacen As Integer = 0
+ Importe = ObjInventario.DtResultados.SUMD("Total").RoundSQL
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
If CBool(Dr("AplicaSeccion")) Then
CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, DdlAlmacenDestino.SelectedValue.ToEntero, Dr("CvePS").ToString.ToEntero).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero
@@ -880,6 +883,10 @@ Partial Class Inventarios_ResguardoMaterial
Next
End If
End If
+
+ 'registra la prepoliza
+
+ ContabilizaMovimientoAlmacen(ObjConta, Fecha, "Resguardo", "ResgMat", CveMovimientoSalida, CveMovimientoEntrada, Importe, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False)
End If
Case 24 'LIBERACION
@@ -914,6 +921,7 @@ Partial Class Inventarios_ResguardoMaterial
If Not TieneError Then
CveMovimientoEntrada = ObjInventario.AddMovimiento(DdlAlmacenDestinoLiberacion.SelectedValue.ToEntero, 23, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, SubProyecto, ActivoFijo, Observaciones:=TxtObservacionesLiberacion.Text, CvePersonal:=CvePersonalLiberacion, CveMovimientoRelacionado:=CveMovimientoSalida, CveProveedor:=CveProveedorLiberacion, CveCliente:=CveClienteLiberacion, MovimientoFijo:=True, Modulo:="ResgMat4")
FolioEntrada = ObjInventario.Folio
+ Dim Importe As Decimal = 0
If CveMovimientoEntrada <= 0 Then
MensajeError = "Ocurrió un error al guardar el movimiento de entrada correctamente. Por favor vuelva a intentar."
@@ -921,6 +929,7 @@ Partial Class Inventarios_ResguardoMaterial
Else
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
Cont = 0
+ Importe = ObjInventario.DtResultados.SUMD("Total").RoundSQL
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
Dim CveSeccionAlmacen As Integer = DiccionarioSecciones(Dr("CveMovimientoDetalle").ToString.ToEntero).ToString.ToEntero
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Dr("Serie").ToString, Observaciones:=Dr("Observaciones").ToString) Then
@@ -932,6 +941,9 @@ Partial Class Inventarios_ResguardoMaterial
Cont += 1
Next
End If
+
+ ContabilizaMovimientoAlmacen(ObjConta, Fecha, "Resguardo", "ResgMat", CveMovimientoSalida, CveMovimientoEntrada, Importe, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False)
+
End If
End If
@@ -981,6 +993,25 @@ Partial Class Inventarios_ResguardoMaterial
ObjInventario.Dispose()
ObjEventos.Dispose()
End Sub
+
+ Public Function ContabilizaMovimientoAlmacen(ByRef ObjConta As ClsContabilidad, Fecha As Date, Concepto As String, Modulo As String, CveMovimientoSalida As Integer, CveMovimientoEntrada As Integer, Importe As Decimal, CveUsuario As Integer, CveEmpresa As Integer, Contabilizable As Boolean) As Integer
+ Dim Retorno As Integer = -1
+ Dim ErrorMovInv As Boolean = False
+
+ Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas(Modulo, 53, 0, 0, 1, Fecha, Concepto, CveUsuario, CveEmpresa)
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Importe, "", 68, Concepto, Fecha, -1, -1, CveMovimientoAlmacen:=CveMovimientoSalida, ImporteMX:=Importe, Contabilizable:=Contabilizable) Then
+ ErrorMovInv = True
+ End If
+
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Importe, "", 68, Concepto, Fecha, -1, -1, CveMovimientoAlmacen:=CveMovimientoEntrada, ImporteMX:=Importe, Contabilizable:=Contabilizable) Then
+ ErrorMovInv = True
+ End If
+
+ If Not ErrorMovInv Then Retorno = CvePrePoliza
+
+ Return Retorno
+ End Function
+
Private Function AgregarAgenda(ByRef ObjEventos As ClsOIEventos, FolioEntrada As Integer, FolioSalida As Integer) As Boolean
Dim TieneError As Boolean = False
Dim RecurrenciaTipo = 0, Frecuencia = -1, DiasSemana = "-1", Dias = -1, Mes = -1, RecurrenciaFin = "-1", CveAgendaTipo = 4, Prioridad = 3, CveTipoEvento = 2, Importe = -1
diff --git a/Inventarios/TraspasoAlmacen.aspx b/Inventarios/TraspasoAlmacen.aspx
index 06766458f..eaf48f3d2 100644
--- a/Inventarios/TraspasoAlmacen.aspx
+++ b/Inventarios/TraspasoAlmacen.aspx
@@ -650,7 +650,7 @@
-
+
<%--
diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb
index 5146a4a86..4639c8aea 100644
--- a/Inventarios/TraspasoAlmacen.aspx.vb
+++ b/Inventarios/TraspasoAlmacen.aspx.vb
@@ -971,7 +971,7 @@ Partial Class Inventarios_TraspasoAlmacen
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
Dim resultado As DataTable = ObjInventario.DtResultados
- Dim importe As Decimal = resultado.SUMD("Total").RoundSQL
+ Dim importe As Decimal = resultado.SUMD("Total").RoundAD
'Dim IdCtaContableSalida As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenOrigen.SelectedValue.ToEntero)).ToEntero
'Dim IdCtaContableEntrada As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenDestino.SelectedValue.ToEntero)).ToEntero
Dim Contabilizable As Boolean = True
@@ -1012,7 +1012,7 @@ Partial Class Inventarios_TraspasoAlmacen
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
Dim resultado As DataTable = ObjInventario.DtResultados
- Dim importe As Decimal = resultado.SUMD("Total").RoundSQL
+ Dim importe As Decimal = resultado.SUMD("Total").RoundAD
Dim IdCtaContable As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenTransitorio.SelectedValue.ToEntero)).ToEntero
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoSalida, ImporteMX:=importe, Contabilizable:=False) Then
@@ -1532,7 +1532,7 @@ Partial Class Inventarios_TraspasoAlmacen
If Dtt IsNot Nothing Then
If TxtFolioRecepcion.Text.Trim <> "" Then
- CveMovimientoSalida = ObjInventarios.DtResultados.FiltroPrimeroValor("CveMovimiento", "").ToEntero
+ CveMovimientoSalida = Dtt.FiltroPrimeroValor("CveMovimiento", "").ToEntero
End If
CveAlmacenDestino = DdlAlmacenRecepcion.SelectedValue.ToEntero
@@ -1736,7 +1736,7 @@ Partial Class Inventarios_TraspasoAlmacen
End If
If Not ErrorMovInv Then
- Dim ImporteDecimal As Decimal = importe.ToDecimal.RoundSQL
+ Dim ImporteDecimal As Decimal = importe.ToDecimal.RoundAD
Dim IdCtaContable As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenTransitorioRecepcion.SelectedValue.ToEntero)).ToEntero
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteDecimal, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1,
@@ -1810,6 +1810,7 @@ Partial Class Inventarios_TraspasoAlmacen
Dim ObjInventario As New ClsInventarios
Dim Dtt As DataTable = Nothing
Dim CveMovimientoEntrada As Integer = 0
+ Dim CveMovimientoSalidaTransitorio As Integer = 0
Dim Folio = 0
Dim ErrorMovInv As Boolean = False
Dim TextoError = ""
@@ -1845,15 +1846,15 @@ Partial Class Inventarios_TraspasoAlmacen
'AGREGAMOS LA SALIDA
- 'CveMovimientoSalida = ObjInventario.AddMovimiento(CveAlmacenSalida, 8, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1,
- ' Observaciones:=TxtObservacionesRecepcion.Text.Trim, CveAlmacenDestino:=GvDatosRecepcion.Rows(0).DataKey("CveAlmacenSalida").ToEntero, Modulo:="TA/G11")
+ CveMovimientoSalidaTransitorio = ObjInventario.AddMovimiento(CveAlmacenSalida, 8, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1,
+ Observaciones:=TxtObservacionesRecepcion.Text.Trim, CveAlmacenDestino:=GvDatosRecepcion.Rows(0).DataKey("CveAlmacenSalida").ToEntero, Modulo:="TA/G11")
'AGREGAMOS LA ENTRADA
CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacenEntrada, 27, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1,
Observaciones:=TxtObservacionesRecepcion.Text.Trim, CveAlmacenDestino:=GvDatosRecepcion.Rows(0).DataKey("CveAlmacenSalida").ToEntero, CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="TA/G1")
Folio = ObjInventario.Folio
- If CveMovimientoSalida <= 0 Then
+ If CveMovimientoSalidaTransitorio <= 0 Then
TextoError = "No se pudo generar el movimiento de salida correctamente"
ErrorMovInv = True
Else
@@ -1887,12 +1888,16 @@ Partial Class Inventarios_TraspasoAlmacen
TextoError = "Ocurrió un error al guardar los movimientos de salida"
Exit For
End If
- ''MOV, Alm, Transito
- 'If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, gvr.FCTextBox("TxtCantidad").Text.ToString.ToDecimal, gvr.DataKey("CveUM").ToString.ToEntero, gvr.DataKey("CvePS").ToString.ToEntero, PrecioEntrada, CveAF:=gvr.DataKey("CveAF").ToString.ToEntero, CveSeccionAlmacen:=gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, Serie:=gvr.DataKey("Serie").ToString, Lote:=gvr.DataKey("Lote").ToString, FechaCaducidad:=gvr.DataKey("FechaCaducidad").ToDate, CveMovimientoDetalleEntrada:=CveMovimientoDetalleEntrada) Then
- ' ErrorMovInv = True
- ' TextoError = "Ocurrió un error al guardar los movimientos de salida"
- ' Exit For
- 'End If
+ 'MOV, Alm, Transito
+ If gvr.DataKey("CveMovimientoDetalleTransitorio").ToString.ToEntero > 0 Then
+ If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaTransitorio, gvr.FCTextBox("TxtCantidad").Text.ToString.ToDecimal, gvr.DataKey("CveUM").ToString.ToEntero, gvr.DataKey("CvePS").ToString.ToEntero, PrecioEntrada, CveAF:=gvr.DataKey("CveAF").ToString.ToEntero, CveSeccionAlmacen:=gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, Serie:=gvr.DataKey("Serie").ToString, Lote:=gvr.DataKey("Lote").ToString, FechaCaducidad:=gvr.DataKey("FechaCaducidad").ToDate, CveMovimientoDetalleEntrada:=gvr.DataKey("CveMovimientoDetalleTransitorio").ToString.ToEntero) Then
+ ErrorMovInv = True
+ TextoError = "Ocurrió un error al guardar los movimientos de salida"
+ Exit For
+ End If
+ Else
+ CveMovimientoSalidaTransitorio = 0
+ End If
ElseIf cantidadDisponibleValidacion < 0 Then
TextoError = String.Format("Se exceden la cantidad disponibles para {0}", gvr.DataKey("PS").ToString)
@@ -1903,22 +1908,26 @@ Partial Class Inventarios_TraspasoAlmacen
If Not ErrorMovInv Then
Dim Concepto As String = TxtObservacionesRecepcion.Text
If Concepto = "" Then Concepto = "Recepción Traspaso"
- 'Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inventario/TraspasoAlmacen", 53, 0, 0, 1, Fecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
- 'If ObjInventario.GetMovimientosDetalle(CveMovimientoEntrada, UsuarioActual.CveEmpresa) Then
+ Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inventario/TraspasoAlmacen", 53, 0, 0, 1, Fecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
+ If ObjInventario.GetMovimientosDetalle(CveMovimientoEntrada, UsuarioActual.CveEmpresa) Then
- ' Dim resultado As DataTable = ObjInventario.DtResultados
- ' Dim importe As Decimal = resultado.SUMD("Total").RoundSQL
- ' Dim IdCtaContable As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenTransitorioRecepcion.SelectedValue.ToEntero)).ToEntero
+ Dim resultado As DataTable = ObjInventario.DtResultados
+ Dim importe As Decimal = resultado.SUMD("Total").RoundAD
+ Dim IdCtaContable As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenTransitorioRecepcion.SelectedValue.ToEntero)).ToEntero
+ Dim tCveConcepto As Integer = 68
- ' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoSalida, ImporteMX:=importe, Contabilizable:=False) Then
- ' ErrorMovInv = True
- ' End If
+ If CveMovimientoSalidaTransitorio = 0 Then
+ tCveConcepto = 289
+ End If
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importe, TxtObservaciones.Text, tCveConcepto, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoSalidaTransitorio, ImporteMX:=importe, Contabilizable:=False) Then
+ ErrorMovInv = True
+ End If
- ' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoEntrada, ImporteMX:=importe, Contabilizable:=False) Then
- ' ErrorMovInv = True
- ' End If
- 'End If
- End If
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoEntrada, ImporteMX:=importe, Contabilizable:=False) Then
+ ErrorMovInv = True
+ End If
+ End If
+ End If
End If
diff --git a/Nomina/Aguinaldo.aspx.cs b/Nomina/Aguinaldo.aspx.cs
index e1507fd52..b89c02fb9 100644
--- a/Nomina/Aguinaldo.aspx.cs
+++ b/Nomina/Aguinaldo.aspx.cs
@@ -537,16 +537,8 @@ Aguinaldoapagar
if (Listaparametros!= null)
{
foreach (parametroQuery pr in Listaparametros)
- {
- if (pr.SqlDataType != null)
- {
- if (pr.ParameterDirection != null)
- SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Direction = pr.ParameterDirection;
- else
- SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Value = pr.SqlValue != null ? pr.SqlValue : DBNull.Value;
- }
- else
- SqlAdapter.SelectCommand.Parameters.AddWithValue(pr.ParameterName, pr.SqlValue);
+ {
+ SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Direction = pr.ParameterDirection;
}
}
@@ -586,15 +578,7 @@ Aguinaldoapagar
{
foreach (parametroQuery pr in Listaparametros)
{
- if ( pr.SqlDataType != null)
- {
- if ( pr.ParameterDirection != null)
- SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Direction = pr.ParameterDirection;
- else
- SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Value = pr.SqlValue != null ? pr.SqlValue : DBNull.Value;
- }
- else
- SqlAdapter.SelectCommand.Parameters.AddWithValue(pr.ParameterName, pr.SqlValue);
+ SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Direction = pr.ParameterDirection;
}
}
@@ -714,18 +698,18 @@ Aguinaldoapagar
}
}
-public class parametroQuery
-{
- public parametroQuery(string parameterName, object sqlValue, SqlDbType sqlDataType = default(SqlDbType), ParameterDirection parameterDirection = default(ParameterDirection))
- {
- this.ParameterName = parameterName;
- this.SqlDataType = sqlDataType;
- this.ParameterDirection = parameterDirection;
- this.SqlValue = sqlValue;
- }
+//public class parametroQuery
+//{
+// public parametroQuery(string parameterName, object sqlValue, SqlDbType sqlDataType = default(SqlDbType), ParameterDirection parameterDirection = default(ParameterDirection))
+// {
+// this.ParameterName = parameterName;
+// this.SqlDataType = sqlDataType;
+// this.ParameterDirection = parameterDirection;
+// this.SqlValue = sqlValue;
+// }
- public string ParameterName { get; set; }
- public SqlDbType SqlDataType { get; set; }
- public ParameterDirection ParameterDirection { get; set; }
- public object SqlValue { get; set; }
-}
+// public string ParameterName { get; set; }
+// public SqlDbType SqlDataType { get; set; }
+// public ParameterDirection ParameterDirection { get; set; }
+// public object SqlValue { get; set; }
+//}
diff --git a/Nomina/Finiquito.aspx b/Nomina/Finiquito.aspx
index c77da1039..c2112291a 100644
--- a/Nomina/Finiquito.aspx
+++ b/Nomina/Finiquito.aspx
@@ -4,6 +4,37 @@
- Finiquito
-
diff --git a/Ventas/RepCotizacionesxFacturar.aspx.vb b/Ventas/RepCotizacionesxFacturar.aspx.vb
index 8f4a49951..34059ca2e 100644
--- a/Ventas/RepCotizacionesxFacturar.aspx.vb
+++ b/Ventas/RepCotizacionesxFacturar.aspx.vb
@@ -74,7 +74,7 @@ Partial Class RepCotizacionesxFacturar
Sucursales = IIf(DdlSubProyectos.GetSelectedValuesM = "", "-1", DdlSubProyectos.GetSelectedValuesM).ToString
- If ObjVentas.GetRepCotizacionesSinFacturar(FechaI.ToDate, FechaF.ToDate, Sucursales, CveCliente, UsuarioActual.CveEmpresa, CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then
+ If ObjVentas.GetRepCotizacionesSinFacturar(FechaI.ToDate, FechaF.ToDate, Sucursales, CveCliente, UsuarioActual.CveEmpresa, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveEstatusFactura:=DdlEstatusFactura.SelectedValue.ToEntero) Then
GvDatos.DataSource = ObjVentas.DtResultados
DtVentas = ObjVentas.DtResultados
GvDatos.DataBind()
@@ -139,6 +139,14 @@ Partial Class RepCotizacionesxFacturar
DdlSubProyectos.DataSource() = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1)
DdlSubProyectos.DataBind()
'DdlSubProyectos.Items.Insert(0, New ListItem("Todos", "-1"))
+
+ 'DdlEstatusFactura.DataSource = GlobalDTEstatusFactura().FiltraParametros("TipoDocto = 'Cot'")
+ 'DdlEstatusFactura.DataBind()
+ DdlEstatusFactura.Items.Add(New ListItem("Registrada", "2"))
+ DdlEstatusFactura.Items.Add(New ListItem("Supervisada", "8"))
+ DdlEstatusFactura.Items.Add(New ListItem("Cancelada", "10"))
+ DdlEstatusFactura.Items.Insert(0, New ListItem("Todos", "-1"))
+
End Sub
#End Region
diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx
index 13e2eaef7..3ea56173b 100644
--- a/Ventas/Ventas.aspx
+++ b/Ventas/Ventas.aspx
@@ -1371,16 +1371,16 @@
-
Total NC:
+
Pronto Pago:
-
+
-
Pronto Pago:
+
Total a Pagar:
-
+
@@ -6340,8 +6340,8 @@
- CargosBonificaciones
+ CargosAjuste/Garantía
diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb
index ce8535aa8..b8790a882 100644
--- a/Ventas/Ventas.aspx.vb
+++ b/Ventas/Ventas.aspx.vb
@@ -3981,7 +3981,7 @@ Partial Class Ventas
Dim TipoEstatus As Integer = GlobalDTEstatusFactura().FiltroPrimeroValor("TipoEstatus", $"CveEstatusFactura = {CveEstatus}").ToEntero()
- If UsuarioActual.Empresa.Funcionalidad(135) = "1" AndAlso DdlTipoComprobante.SelectedValue.Contiene("Cot") AndAlso TipoEstatus = 5 Then
+ If UsuarioActual.Empresa.Funcionalidad(135).Contiene("1", "2") AndAlso DdlTipoComprobante.SelectedValue.Contiene("Cot") AndAlso TipoEstatus = 5 Then
If UsuarioActual.TienePermisoProceso(159) Then
Dim TienePermiso As String = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, -1).FiltroPrimeroValor("CveSubProyecto", String.Format("CveSubProyecto = {0}", DbRowVenta("CveSubProyecto")))
If TienePermiso <> "" Then
@@ -4087,7 +4087,7 @@ Partial Class Ventas
End If
-
+ 'SI LA AUTORIZACION ES POR SUPERVISOR, BUSCA EL SUPERVISOR QUE TIENE EL VENDEDOR
If UsuarioActual.Empresa.Funcionalidad(135) = "1" Then
'Reviso cuales son los supervisores
Dim Objeto As New ClsVtaVendedores
@@ -4104,7 +4104,7 @@ Partial Class Ventas
If TipoEstatus = 2 Then
LkCotizacionAutorizar.Visible = False
- ElseIf TipoEstatus = 2 Then
+ ElseIf TipoEstatus = 5 Then
LkCotizacionAutorizar.Visible = False
End If
End If
@@ -4113,8 +4113,18 @@ Partial Class Ventas
Objeto.Dispose()
End If
- String.Format("CveVendedor = {0}", DbRowVenta("CveVendedor").ToString())
-
+ 'SI LA AUTORIZACION ES POR PERMISO, BUSCA QUE EL USUARIO TENGA EL PERMISO PARA AUTORIZAR
+ If UsuarioActual.Empresa.Funcionalidad(135) = "2" Then
+ 'Reviso cuales son los supervisores
+ If UsuarioActual.TienePermisoProceso(116) Then
+ LkCotizacionAutorizar.Visible = True
+ If TipoEstatus = 2 Then
+ LkCotizacionAutorizar.Visible = False
+ ElseIf TipoEstatus = 5 Then
+ LkCotizacionAutorizar.Visible = False
+ End If
+ End If
+ End If
Case "Ant"
Trsaldo.Visible = True
@@ -4582,7 +4592,7 @@ Partial Class Ventas
End If
End If
- DdlVendedor.SelectedValue = DbRowVenta("CveVendedor").ToString()
+ DdlVendedor.SelectedValue = If(DbRowVenta("CveVendedor").ToString = "", "0", DbRowVenta("CveVendedor").ToString) 'si viene dbnull, que ponga cero.
DdlTipoComprobante.Enabled = False
'TxtDocto.Enabled = False
@@ -4872,30 +4882,47 @@ Partial Class Ventas
'Verifico si tiene la funcionalidad (135)
- If DdlTipoComprobante.SelectedValue = "Cot" AndAlso UsuarioActual.Empresa.Funcionalidad(135) = "1" Then
- 'Reviso cuales son los supervisores
- Dim ObjVendedores As New ClsVtaVendedores
+ If DdlTipoComprobante.SelectedValue = "Cot" AndAlso UsuarioActual.Empresa.Funcionalidad(135).Contiene("1", "2") Then
- If ObjVendedores.GetVendedores(UsuarioActual.CveEmpresa) Then
- Dim DTVendedores As New DataTable
- If DbRowVenta("CveVendedor").ToString().ToEntero() > 0 AndAlso UsuarioActual.CveVendedor > 0 Then
- DTVendedores = ObjVendedores.DtResultados.FiltraParametros(String.Format("CveVendedor = {0}", DbRowVenta("CveVendedor").ToString())).FiltraParametros(String.Format("CveSupervisor = {0}", UsuarioActual.CveVendedor))
- End If
+ Select Case UsuarioActual.Empresa.Funcionalidad(135)
+ Case "1" ' POR SUPERVISOR
+ Dim ObjVendedores As New ClsVtaVendedores
- 'Verifico si es su supervisor asignado
- If DTVendedores.Rows.Count > 0 Then
- If GlobalDTEstatusFactura().FiltroPrimeroValor("TipoEstatus", $"CveEstatusFactura = {Me.CveEstatus}").ToEntero() = 2 Then
- BtnsFacturar.Visible = True
- BtnGenerarRemision.Visible = True
- Else
- BtnsFacturar.Visible = False
- BtnGenerarRemision.Visible = False
+ If ObjVendedores.GetVendedores(UsuarioActual.CveEmpresa) Then
+ Dim DTVendedores As New DataTable
+ If DbRowVenta("CveVendedor").ToString().ToEntero() > 0 AndAlso UsuarioActual.CveVendedor > 0 Then
+ DTVendedores = ObjVendedores.DtResultados.FiltraParametros(String.Format("CveVendedor = {0}", DbRowVenta("CveVendedor").ToString())).FiltraParametros(String.Format("CveSupervisor = {0}", UsuarioActual.CveVendedor))
+ End If
+
+ 'Verifico si es su supervisor asignado
+ If DTVendedores.Rows.Count > 0 Then
+ If GlobalDTEstatusFactura().FiltroPrimeroValor("TipoEstatus", $"CveEstatusFactura = {Me.CveEstatus}").ToEntero() = 2 Then
+ BtnsFacturar.Visible = True
+ BtnGenerarRemision.Visible = True
+ Else
+ BtnsFacturar.Visible = False
+ BtnGenerarRemision.Visible = False
+ End If
+ End If
+
+ DTVendedores.Dispose()
End If
- End If
+ ObjVendedores.Dispose()
+
+ Case "2" ' POR PERMISO
+ If UsuarioActual.TienePermisoProceso(116) Then
+ If GlobalDTEstatusFactura().FiltroPrimeroValor("TipoEstatus", $"CveEstatusFactura = {Me.CveEstatus}").ToEntero() = 2 Then
+ BtnsFacturar.Visible = True
+ BtnGenerarRemision.Visible = True
+ Else
+ BtnsFacturar.Visible = False
+ BtnGenerarRemision.Visible = False
+ End If
+ End If
+
+ End Select
+
- DTVendedores.Dispose()
- End If
- ObjVendedores.Dispose()
End If
If DdlTipoComprobante.SelectedValue = "Cot" Then
@@ -5897,7 +5924,7 @@ Partial Class Ventas
LnkCotizaciones.Visible = False
End If
UPCondicionesPago.Update()
- ElseIf UsuarioActual.CveEmpresa.Contiene(72, 80, 146, 119, 158, 140) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem", "Cot", "PA") AndAlso CveVenta < 1 Then
+ ElseIf UsuarioActual.CveEmpresa.Contiene(72, 80, 119, 146, 158, 140) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem", "Cot", "PA") AndAlso CveVenta < 1 Then
RBLPago.SelectedValue = "1"
RBLPago_SelectedIndexChanged(Nothing, Nothing)
UPCondicionesPago.Update()
@@ -5960,7 +5987,7 @@ Partial Class Ventas
End If
Else
- If UsuarioActual.CveEmpresa.Contiene(119) AndAlso Not UsuarioActual.TienePermisoProceso(268) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Rem", "Ing", "Ant", "PA") Then
+ If UsuarioActual.CveEmpresa = 119 AndAlso Not UsuarioActual.TienePermisoProceso(268) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Rem", "Ing", "Ant", "PA") Then
Dim Vta As New ClsVentas
Dim Opcion As Integer = Vta.ObtenerClienteLimitesVenta(CveCliente, UsuarioActual.CveEmpresa)
Dim OpcionMsg As String = String.Format("El Cliente se encuentra bloqueado por la siguiente razón:
{0}", Vta.SerieVenta)
@@ -5971,7 +5998,7 @@ Partial Class Ventas
End If
If Alertas Then Alert(OpcionMsg, TipoMensaje.MsgAdvertencia)
Else
- If Alertas Then Alert("El cliente tiene su límite de crédito agotado.", TipoMensaje.MsgAdvertencia)
+ If Alertas AndAlso UsuarioActual.Empresa.Funcionalidad(518) = "1" Then Alert("El cliente tiene su límite de crédito agotado.", TipoMensaje.MsgAdvertencia)
End If
'RBLPago.SelectedValue = "2"
@@ -7668,6 +7695,7 @@ Partial Class Ventas
'CONTABILIDAD AUTOMATICA Y AC
If UsuarioActual.Empresa.UsaAC OrElse UsuarioActual.Empresa.Funcionalidad(200) = "1" Then
ObjContPaq = New ClsContPAQi(UsuarioActual.Empresa)
+ ObjContPaq.IniciaTransacSQL()
End If
'VERIFICA QUE EL FOLIO NO SEA IGUAL AL DE LA FACTURA ANTERIOR
@@ -10131,6 +10159,8 @@ Partial Class Ventas
End If
End If
+ tPS = tPS.Replace("|", " ")
+
If tPS.Length >= 1000 Then
Dim tPSRecortado = tPS.Remove(999, tPS.Length - 999)
tPS = tPSRecortado
@@ -10800,19 +10830,30 @@ Partial Class Ventas
End Try
'SI SE FACTURA UNA RNC SE MUESTRA
- If UsuarioActual.CveEmpresa = 140 AndAlso factura.TipoDocto = "Egs" Then
+ If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso factura.TipoDocto = "Egs" Then
If Row("CveVentaDetalleRNC").ToString().ToEntero() > 0 Then
If Not ObjVentas.AddVentaDetalleRNCFacturada(Row("CveVentaDetalleRNC").ToString().ToEntero(), ObjVentas.CveVentaDetalle, Row("Cantidad").ToString().ToDecimal()) Then
ErrorList.Add("Ocurrió un error al agregar la venta detalle devolución.")
End If
+ Dim EsCargo As Boolean = False
+ Dim ListaRNC As List(Of Modelos.Factura) = Nothing
+
+ If NCDescuento Then
+ EsCargo = (Not ListaNCDescuento.Any(Function(RNC) RNC.Num2 = 1))
+ ListaRNC = ListaNCDescuento
+ Else
+ EsCargo = RblRNCTipo.SelectedValue = "1"
+ ListaRNC = ListaRemisionesNC
+ End If
+
'SI SE FACTURAN RNC DE CARGO, SE AGREGA EL CONCEPTO DE ACREDITAMIENTO
- If ClienteEsDistribuidor AndAlso RblRNCTipo.SelectedValue = "1" Then
+ If ListaRNC IsNot Nothing AndAlso ClienteEsDistribuidor AndAlso EsCargo Then
Dim ObjAcum As New ClsAcumuladores(ObjVentas.IniciaTransacSQL())
Dim CvePSCargo As Integer = -1
- For Each RNC In ListaRemisionesNC
+ For Each RNC In ListaRNC
CvePSCargo = RNC.DtDetalle.FiltroPrimeroValor("CvePS", $"CveVentaDetalle={Row("CveVentaDetalleRNC").ToString()}").ToEntero()
If CvePSCargo > 0 Then
Exit For
@@ -12834,7 +12875,7 @@ Partial Class Ventas
If ObjInventario.GetMovimientosDetalle(CveMovimientoInventario, UsuarioActual.CveEmpresa) Then
DtCostos = ObjInventario.DtResultados
- TotalCosto = DtCostos.SUMD("Total").RoundSQL
+ TotalCosto = DtCostos.SUMD("Total").RoundAD
Dim tmpCostos As DataTable = DtCostos.FiltraParametros("", "", {"CveClasificacion"})
Dim IdCtaContable As Integer = 0
Dim CveCuenta As Integer = 0
@@ -12843,7 +12884,7 @@ Partial Class Ventas
Dim cont As Integer = 1
'Se agrega movimiento separado por la cuenta de ventas (ER)
For Each RowInv As DataRow In tmpCostos.Rows
- ValorInventario = DtCostos.SUMD("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").RoundSQL
+ ValorInventario = DtCostos.SUMD("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").RoundAD
TotalCostoAcumulado += ValorInventario
'cuando es el último movimiento y hay diferencias en los importes
@@ -12853,12 +12894,12 @@ Partial Class Ventas
'Concepto = String.Format("{0} - {1}", Row2("Clasificacion").ToString(), Row2("SubProyecto").ToString())
IdCtaContable = GlobalDTClasificaciones(factura.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
- ' CveCuenta = GlobalDTClasificaciones(factura.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
+ 'CveCuenta = GlobalDTClasificaciones(factura.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
'If ValorInventario <> 0 Then
If Not ObjConta.AddPrePolizasDetalle(factura.CvePrePoliza, TipoMovto69, ValorInventario, factura.SerieFolio, 69, factura.SerieFolio, factura.Fecha, IdCtaContable, -1, CveVenta:=factura.CveVenta, CveCliente:=factura.CveCliente, CveSubProyecto:=factura.CveSubProyecto, CveClasificacion:=RowInv("CveClasificacion").ToString().ToEntero(), CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=ValorInventario, CveCuenta:=CveCuenta) Then
- OcurrioError = True
- End If
+ OcurrioError = True
+ End If
'End If
cont += 1
Next
@@ -13492,7 +13533,7 @@ Partial Class Ventas
divAmortizacionTipoRelacion.Visible = True
End If
- If UsuarioActual.CveEmpresa.Contiene(1, 72, 80) Then
+ If UsuarioActual.CveEmpresa.Contiene(1, 72, 80, 146) Then
If Not DdlTipoAmortizacionAnticipo.Items.Cast(Of ListItem).Any(Function(x) x.Value = "3") Then
DdlTipoAmortizacionAnticipo.Items.Add(New ListItem("Amortización anticipo sobre factura en cero", "3"))
End If
@@ -15467,7 +15508,7 @@ Partial Class Ventas
TrAlmacenAsignado.Visible = False
TrAlmacenOrigen.Visible = False
- If DdlTipoComprobante.SelectedValue = "Cot" And UsuarioActual.Empresa.Funcionalidad(135) = "1" Then
+ If DdlTipoComprobante.SelectedValue = "Cot" And UsuarioActual.Empresa.Funcionalidad(135).Contiene("1", "2") Then
Alert("Se ocupa una autorización.", TipoMensaje.MsgAdvertencia)
TrDireccion.Visible = False
TrCiudad.Visible = False
@@ -15482,7 +15523,7 @@ Partial Class Ventas
UpnTools.Update()
tdTelefonoGen.Visible = False
tdTxtTelefonoGen.Visible = False
- If UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 122, 145, 140) Then
+ If UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 122, 145) Then
ChkEnviarFactura.Checked = False
End If
@@ -16279,7 +16320,7 @@ Partial Class Ventas
End If
'SI TIENE PRONTO PAGO CALCULA EL IMPORTE
- If RowPorcentaje("ProntoPago").ToString().ToDecimal() > 0 Then
+ If DdlTipoComprobante.SelectedValue = "Ing" AndAlso RowPorcentaje("ProntoPago").ToString().ToDecimal() > 0 Then
Dim TotalProntoPago As Decimal = (Cantidad * (PU)) - Descuento
Dim PorcentajeProntoPago = RowPorcentaje("ProntoPago").ToString().ToDecimal() / 100D
@@ -17381,6 +17422,11 @@ Partial Class Ventas
TotalAmortizacion = 0
End If
+ Dim TotalRemNCAplicado As Decimal = 0
+
+ If TbDescuentosRNC.Visible AndAlso ListaNCDesc IsNot Nothing Then
+ TotalRemNCAplicado = ListaNCDesc.Sum(Function(RNC) RNC.TotalRemNCAplicado)
+ End If
Total = (TotalSubTotal - TotalDescuentos - TotalAmortizacion + TotalIVA + TotalIEPS - TotalRetIVA - TotalRetISR - TotalImpuestosLocales)
LblSubTotal1.Text = TotalSubTotal.FormatoNumero(2)
@@ -17396,6 +17442,8 @@ Partial Class Ventas
HdnProntoPago.Value = TotalProntoPago.ToString()
LblProntoPago.Text = TotalProntoPago.FormatoNumero(2)
+ LblTotalAPagar.Text = (TxtTotal.Text.ToDecimal() - TotalRemNCAplicado - TotalProntoPago).FormatoNumero
+
LblAmort.Text = TxtSubTotal.Text
If CveVenta <= 0 OrElse (CveDevolucion > 0 And NuevaFactura = 1) Then
HdnVentaSaldo.Value = Total.ToString()
@@ -18202,10 +18250,10 @@ Partial Class Ventas
Dim ValorInventario As Decimal
Dim TotalCostoAcumulado As Decimal = 0D
Dim Cont As Integer = 1
- Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundSQL
+ Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundAD
For Each RowInv As DataRow In DtCostosDistinct.Rows
- ValorInventario = DtCostos.SUMD("Total", String.Format("CveClasificacion = {0}", RowInv("CveClasificacion"))).RoundSQL
+ ValorInventario = DtCostos.SUMD("Total", String.Format("CveClasificacion = {0}", RowInv("CveClasificacion"))).RoundAD
IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
CveCuenta = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
TotalCostoAcumulado += ValorInventario
@@ -20116,7 +20164,7 @@ Partial Class Ventas
End If
If UsuarioActual.Empresa.Funcionalidad(572) = "1" Then
- Dim TotalNC As Decimal = If((ListaNCDesc IsNot Nothing AndAlso ListaNCDesc.Count > 0) OrElse (ListaNCBonificacion IsNot Nothing AndAlso ListaNCBonificacion.Count > 0), LblTotalNC.Text.Trim().ToDecimal(), 0)
+ Dim TotalNC As Decimal = If((ListaNCDesc IsNot Nothing AndAlso ListaNCDesc.Count > 0) OrElse (ListaNCBonificacion IsNot Nothing AndAlso ListaNCBonificacion.Count > 0), LblTotalAPagar.Text.Trim().ToDecimal(), 0)
If TotalNC > 0 Then
If (DtPagos.SUM("Importe").ToString().ToDecimal() + AmortizacionNC + Total - TxtCambio.Text.ToDecimal) > TotalNC Then
Alert("El importe de los pagos no puede exceder el importe de la factura. Por favor verifique.", TipoMensaje.MsgAdvertencia)
@@ -21192,8 +21240,14 @@ Partial Class Ventas
ObjVentas.Dispose()
If ActualizoEstatus Then
- 'GeneraPDFCotizacion(True)
- Alert("La cotización ha sido enviada al correo de nuestro cliente:" & Mail)
+
+ If UsuarioActual.Empresa.Funcionalidad(135) = "1" Then
+ GeneraPDFCotizacion(True)
+ Alert("La cotización ha sido enviada al correo de nuestro cliente:" & Mail)
+ ElseIf UsuarioActual.Empresa.Funcionalidad(135) = "2" Then
+ Alert("La cotización ha sido autorizada.")
+ End If
+
Else
Alert("No se pudo autorizar la cotización", TipoMensaje.MsgError)
End If
@@ -24209,7 +24263,8 @@ Partial Class Ventas
Me.TmpDTRNCBonificacionesCliente.Columns.Add("CveVentaRNCCargo", GetType(Integer))
If CargarBonificaciones Then
- Me.TmpDTRNCBonificacionesSeleccionadas = Me.TmpDTRNCBonificacionesCliente.Copy()
+ 'Me.TmpDTRNCBonificacionesSeleccionadas = Me.TmpDTRNCBonificacionesCliente.Copy()
+ CargaBonificaciones(-1, True)
End If
If CargarSoloGarantias Then
@@ -24217,10 +24272,10 @@ Partial Class Ventas
Else
GvRemisionesNC.DataSource = DtNC.FiltraParametros("TipoRNC = 1 AND EsGarantia = False")
End If
- GvRemisionesNCBon.DataSource = Me.TmpDTRNCBonificacionesSeleccionadas
-
GvRemisionesNC.DataBind()
- GvRemisionesNCBon.DataBind()
+
+ 'GvRemisionesNCBon.DataSource = Me.TmpDTRNCBonificacionesSeleccionadas
+ 'GvRemisionesNCBon.DataBind()
If CveVentaUsado > 0 Then
DivSMU.Visible = True
@@ -24349,6 +24404,11 @@ Partial Class Ventas
Dim ChkAplicarRNC As CheckBox = DirectCast(sender, CheckBox)
Dim GvRow As GridViewRow = DirectCast(ChkAplicarRNC.NamingContainer, GridViewRow)
+ CargaBonificacionesDesc(GvRow.DataKey("CveVenta").ToEntero(), ChkAplicarRNC.Checked)
+
+ End Sub
+
+ Private Sub CargaBonificacionesDesc(CveVentaRNCCargo As Integer, AplicarRNC As Boolean)
If TmpDTRNCBonificacionesSeleccionadas Is Nothing Then
TmpDTRNCBonificacionesSeleccionadas = Me.TmpDTRNCBonificacionesCliente.Clone()
End If
@@ -24358,7 +24418,7 @@ Partial Class Ventas
Dim SbFiltro As New StringBuilder()
SbFiltro.Append("CveVenta IN(")
Using ObjAcum As New ClsAcumuladores
- If ObjAcum.DistribuidorMovtosGet(CveCliente, UsuarioActual.CveEmpresa, CveVentaRNCCargo:=GvRow.DataKey("CveVenta").ToEntero()) Then
+ If ObjAcum.DistribuidorMovtosGet(CveCliente, UsuarioActual.CveEmpresa, CveVentaRNCCargo:=CveVentaRNCCargo) Then
DtBon = ObjAcum.DtResultados.Copy()
End If
End Using
@@ -24375,7 +24435,7 @@ Partial Class Ventas
For Each bon In queryBonificacion
SbFiltro.AppendFormat("'{0}',", bon.CveVentaBonificacion)
- ListaBon.Add(New VentasBonificaciones() With {.CveVentaRNCCargo = GvRow.DataKey("CveVenta").ToEntero(), .CveVentaBonificacion = bon.CveVentaBonificacion, .ImporteBonificacion = bon.ImporteBonificacion, .IVABonificacion = bon.IVABonificacion})
+ ListaBon.Add(New VentasBonificaciones() With {.CveVentaRNCCargo = CveVentaRNCCargo, .CveVentaBonificacion = bon.CveVentaBonificacion, .ImporteBonificacion = bon.ImporteBonificacion, .IVABonificacion = bon.IVABonificacion})
Next
SbFiltro.Remove(SbFiltro.Length - 1, 1)
SbFiltro.Append(")")
@@ -24389,9 +24449,9 @@ Partial Class Ventas
RowBonificacion("ImporteBonificacion") = RNCBonificacion.Sum(Function(x) x.ImporteBonificacion)
RowBonificacion("IVABonificacion") = RNCBonificacion.Sum(Function(x) x.IVABonificacion)
- RowBonificacion("CveVentaRNCCargo") = GvRow.DataKey("CveVenta").ToEntero()
+ RowBonificacion("CveVentaRNCCargo") = CveVentaRNCCargo
- If ChkAplicarRNC.Checked Then
+ If AplicarRNC Then
TmpDTRNCBonificacionesSeleccionadas.Rows.Add(RowBonificacion.ItemArray)
Else
For Each RowEliminar In Me.TmpDTRNCBonificacionesSeleccionadas.Select(SbFiltro.ToString())
@@ -24415,12 +24475,16 @@ Partial Class Ventas
LblSaldoMaximoBonificacion.Text = String.Format("{0:N2}", Me.TmpDTRNCBonificacionesSeleccionadas.SUM("ImporteBonificacion").ToDecimal() + Me.TmpDTRNCBonificacionesSeleccionadas.SUM("IVABonificacion").ToDecimal())
UpDescNC.Update()
-
End Sub
Protected Sub ChkAplicarNCBon_CheckedChanged(sender As Object, e As EventArgs)
Dim ChkAplicarRNC As CheckBox = DirectCast(sender, CheckBox)
Dim GvRow As GridViewRow = DirectCast(ChkAplicarRNC.NamingContainer, GridViewRow)
+ CargaBonificaciones(GvRow.DataKey("CveVenta").ToEntero(), ChkAplicarRNC.Checked)
+
+ End Sub
+
+ Private Sub CargaBonificaciones(CveVentaRNCCargo As Integer, AplicarRNC As Boolean)
If TmpDTRNCBonificacionesSeleccionadas Is Nothing Then
TmpDTRNCBonificacionesSeleccionadas = Me.TmpDTRNCBonificacionesCliente.Clone()
End If
@@ -24430,16 +24494,18 @@ Partial Class Ventas
Dim SbFiltro As New StringBuilder()
SbFiltro.Append("CveVenta IN(")
Using ObjAcum As New ClsAcumuladores
- If ObjAcum.DistribuidorMovtosGet(CveCliente, UsuarioActual.CveEmpresa, CveVentaRNCCargo:=GvRow.DataKey("CveVenta").ToEntero()) Then
+ If ObjAcum.DistribuidorMovtosGet(CveCliente, UsuarioActual.CveEmpresa, CveVentaRNCCargo:=CveVentaRNCCargo) Then
DtBon = ObjAcum.DtResultados.Copy()
End If
End Using
If DtBon IsNot Nothing Then
Dim queryBonificacion = From dr In DtBon
- Group By CveVentaBonificacion = dr("CveVentaBonificacion").ToString().ToEntero
+ Where dr("CveVentaBonificacion").ToString().ToEntero > 0
+ Group By CveVentaBonificacion = dr("CveVentaBonificacion").ToString().ToEntero, CveVenta = dr("CveVenta").ToString().ToEntero
Into x = Group
Select New With {
+ .CveVentaRNCCargo = CveVenta,
.CveVentaBonificacion = CveVentaBonificacion,
.ImporteBonificacion = x.Sum(Function(s) s("ImporteBonificacion").ToString().ToDecimal),
.IVABonificacion = x.Sum(Function(s) s("IVABonificacion").ToString().ToDecimal)
@@ -24447,7 +24513,7 @@ Partial Class Ventas
For Each bon In queryBonificacion
SbFiltro.AppendFormat("'{0}',", bon.CveVentaBonificacion)
- ListaBon.Add(New VentasBonificaciones() With {.CveVentaRNCCargo = GvRow.DataKey("CveVenta").ToEntero(), .CveVentaBonificacion = bon.CveVentaBonificacion, .ImporteBonificacion = bon.ImporteBonificacion, .IVABonificacion = bon.IVABonificacion})
+ ListaBon.Add(New VentasBonificaciones() With {.CveVentaRNCCargo = bon.CveVentaRNCCargo, .CveVentaBonificacion = bon.CveVentaBonificacion, .ImporteBonificacion = bon.ImporteBonificacion, .IVABonificacion = bon.IVABonificacion})
Next
SbFiltro.Remove(SbFiltro.Length - 1, 1)
SbFiltro.Append(")")
@@ -24461,9 +24527,9 @@ Partial Class Ventas
RowBonificacion("ImporteBonificacion") = RNCBonificacion.Sum(Function(x) x.ImporteBonificacion)
RowBonificacion("IVABonificacion") = RNCBonificacion.Sum(Function(x) x.IVABonificacion)
- RowBonificacion("CveVentaRNCCargo") = GvRow.DataKey("CveVenta").ToEntero()
+ RowBonificacion("CveVentaRNCCargo") = CveVentaRNCCargo
- If ChkAplicarRNC.Checked Then
+ If AplicarRNC Then
TmpDTRNCBonificacionesSeleccionadas.Rows.Add(RowBonificacion.ItemArray)
Else
For Each RowEliminar In Me.TmpDTRNCBonificacionesSeleccionadas.Select(SbFiltro.ToString())
@@ -24487,7 +24553,6 @@ Partial Class Ventas
LtlSMUBon.Text = String.Format("{0:N2}", Me.TmpDTRNCBonificacionesSeleccionadas.SUM("ImporteBonificacion").ToDecimal() + Me.TmpDTRNCBonificacionesSeleccionadas.SUM("IVABonificacion").ToDecimal())
UpModalRemisionesNC.Update()
-
End Sub
Protected Sub GvDescNCCargos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDescNCCargos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
@@ -24523,6 +24588,12 @@ Partial Class Ventas
End If
End If
End Sub
+ Protected Sub GvRemisionesNCBon_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvRemisionesNCBon.RowDataBound
+ If e.Row.RowType = DataControlRowType.DataRow Then
+ e.Row.FCCheckBox("ChkAplicar").Attributes.Add("onclick", $"CalculaSaldoRNCBonChk({e.Row.FCTextBox("TxtImporte").ClientID},{e.Row.DBCampo("Saldo").ToDouble}, this);")
+ e.Row.FCTextBox("TxtImporte").Attributes.Add("onkeyup", $"LimitaSaldoRNCBonChk({e.Row.FCTextBox("TxtImporte").ClientID},{e.Row.DBCampo("Saldo").ToDouble});")
+ End If
+ End Sub
Protected Sub DdlNCNivelImporte_SelectedIndexChanged(sender As Object, e As EventArgs)
Dim ImporteReferencia As Double = 0, PorcentajeMaximo As Double = 0
@@ -24910,7 +24981,7 @@ Partial Class Ventas
Dim TotalAcumuladoRNC As Decimal = 0
Dim Terminar As Boolean = False
- For Each RowUsado As DataRow In RNC.DtDetalle.Rows
+ For Each RowUsado As DataRow In RNC.DtDetalle.FiltraParametros("", Orderby:="PU").Rows
Dim Cantidad As Decimal = RowUsado("Cantidad").ToString().ToDecimal()
@@ -24994,7 +25065,7 @@ Partial Class Ventas
Dim TotalAcumuladoRNC As Decimal = 0
Dim Terminar As Boolean = False
- For Each RowUsado As DataRow In Me.TmpDTRNCDetalleSelecciondas.FiltraParametros($"CveVenta={RNC.CveVenta}").Rows
+ For Each RowUsado As DataRow In Me.TmpDTRNCDetalleSelecciondas.FiltraParametros($"CveVenta={RNC.CveVenta}", Orderby:="PU").Rows
Dim Cantidad As Decimal = RowUsado("Cantidad").ToString().ToDecimal()
@@ -25087,7 +25158,7 @@ Partial Class Ventas
Dim RNCCargo = ListaNC.Where(Function(f) f.CveVenta = RNCBonificacion.CveVentaRNCCargo).FirstOrDefault()
- For Each RowCargo As DataRow In RNCCargo.DtDetalle.Rows
+ For Each RowCargo As DataRow In RNCCargo.DtDetalle.FiltraParametros("", Orderby:="PU").Rows
Dim PorcentajeAplicado = (RNCBonificacion.TotalRemNCAplicado / RNCBonificacion.Total)
@@ -26499,8 +26570,12 @@ Partial Class Ventas
If Not DtCotizaciones.Columns.Contains("Aplicado") Then
DtCotizaciones.Columns.Add("Aplicado", Type.GetType("System.Boolean"))
End If
+ If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
+ GvCotPS.DataSource = DtCotizaciones.FiltraParametros("Cantidad > 0 AND EsAcumulador = False")
+ Else
+ GvCotPS.DataSource = DtCotizaciones.FiltraParametros("Cantidad > 0")
+ End If
- GvCotPS.DataSource = DtCotizaciones.FiltraParametros("Cantidad > 0")
End If
ObjVentas.Dispose()
GvCotPS.DataBind()
@@ -26568,6 +26643,11 @@ Partial Class Ventas
For Each row As DataRow In DTSeleccionadas.FiltraParametros("", DistinctColumns:={"CveVenta"}).Rows
CotizacionesLista.Add(row("CveVenta").ToString().ToEntero())
Next
+
+ If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
+ CalculaUsadosCotizacion(Cves, DTSeleccionadas, DtCotizaciones)
+ End If
+
Else
For Each row As DataRow In DTSeleccionadas.Rows
If CveMetodoPago <> -1 And row("CveMetodoPago33").ToString().ToEntero() <> CveMetodoPago Then
@@ -26612,6 +26692,74 @@ Partial Class Ventas
UpPS.Update()
UpParametros.Update()
End Sub
+
+ Private Sub CalculaUsadosCotizacion(ByRef SbVentasDetalle As StringBuilder, ByVal DTSeleccionadas As DataTable, ByVal DtCotizaciones As DataTable)
+ If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Cot", "Dev") Then
+
+ Dim DTTamanios As DataTable = GlobalDTAcumTamaños()
+
+ Dim DTCvePSCostos As DataTable = DTTamanios.FiltraParametros("", "", {"CvePSCargo"})
+
+ Dim TmpDTCalculo As DataRow() = DTSeleccionadas.Rows.Cast(Of DataRow).ToArray()
+
+ Dim DTPSTemp As New DataTable '= TmpDT.Clone
+
+ DTPSTemp.Columns.Add("CveVenta", GetType(Integer))
+ DTPSTemp.Columns.Add("Cantidad", GetType(Integer))
+ DTPSTemp.Columns.Add("CvePS", GetType(Integer))
+ DTPSTemp.Columns.Add("PU", GetType(Decimal))
+
+ For Each DrowPartidas As DataRow In TmpDTCalculo
+ Dim CveTamanioTemp As Integer = DrowPartidas("CveTamaño").ToString().ToEntero()
+ Dim CveVenta As Integer = DrowPartidas("CveVenta").ToString().ToEntero()
+
+ If CveTamanioTemp > 0 Then
+
+ Dim DTTamanioTemp As New DataTable
+ Dim CvePsTemp As Integer = DTTamanios.FiltraParametros($"CveTamaño = { CveTamanioTemp } ").Rows(0)("CvePSCargo").ToString().ToEntero()
+
+ Dim Cargo As Decimal = DTTamanios.FiltroPrimeroValor("Cargo", $" CveTamaño = { CveTamanioTemp }").ToDecimal
+
+ If DTPSTemp.FiltraParametros($"CvePs = { CvePsTemp }").Rows.Count > 0 Then
+
+ For Each dRowUpdate As DataRow In DTPSTemp.Rows
+
+ If (dRowUpdate("CvePS").ToString().ToEntero() = CvePsTemp) Then
+ dRowUpdate("Cantidad") = dRowUpdate("Cantidad").ToString().ToDecimal + DrowPartidas("Cantidad").ToString().ToDecimal
+ dRowUpdate("PU") = Cargo ' dRowUpdate("Total").ToString().ToDecimal + ImporteCargo
+ dRowUpdate("CveVenta") = CveVenta
+ End If
+ Next
+
+ DTPSTemp.AcceptChanges()
+
+ Else
+ Dim dRowNuevo As DataRow = DTPSTemp.NewRow
+
+ dRowNuevo("CvePS") = CvePsTemp
+ dRowNuevo("Cantidad") = DrowPartidas("Cantidad").ToString().ToDecimal
+ dRowNuevo("PU") = Cargo
+ dRowNuevo("CveVenta") = CveVenta
+
+ DTPSTemp.Rows.Add(dRowNuevo)
+ DTPSTemp.AcceptChanges()
+ End If
+
+ End If
+ Next
+
+ For Each drowPsTamaños As DataRow In DTPSTemp.Rows
+
+ If drowPsTamaños("PU").ToString().ToDecimal > 0 Then
+
+ Dim CveVentaDetalleUsado = DtCotizaciones.FiltroPrimeroValor("CveVentaDetalle", $"CveVenta = {drowPsTamaños("CveVenta")} AND CvePS = {drowPsTamaños("CvePS")}").ToEntero()
+ SbVentasDetalle.AppendFormat("{0},", CveVentaDetalleUsado)
+
+ End If
+ Next
+
+ End If
+ End Sub
Private Sub VerificaCotizaciones(ByRef dt As DataTable)
If ChkCotProductos.Checked Then
For Each Gvr As GridViewRow In GvCotPS.Rows
@@ -28382,13 +28530,15 @@ Partial Class Ventas
End Sub
Protected Sub BtnAplicarDesc_Click(sender As Object, e As EventArgs)
Try
- Dim CveSATNC = "84111506"
- Dim DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, SATClavePS:=CveSATNC, AplicaParaVenta:=1).Rows(0)
+ Dim DrPS As DataRow = Nothing
Dim ArrayNC As String() = UsuarioActual.Empresa.Funcionalidad(591).Split(",".ToCharArray())
- If ArrayNC.Length > 0 Then
- Dim CvePSNC As Integer = ArrayNC(0).ToEntero()
+ If ArrayNC.Length >= 4 Then
+ Dim CvePSNC As Integer = ArrayNC(3).ToEntero()
DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSNC, AplicaParaVenta:=1).Rows(0)
+ Else
+ Dim CveSATNC = "84111506"
+ DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, SATClavePS:=CveSATNC, AplicaParaVenta:=1).Rows(0)
End If
If DrPS Is Nothing Then
@@ -28431,7 +28581,7 @@ Partial Class Ventas
'SI TIENE ALGUN AJUSTE O GARANTIA
If ListaNCDesc.Any(Function(RNC) RNC.Num2 = 1) Then
- For Each RNC In ListaRemisionesNC.Where(Function(x) x.Num2 = 1)
+ For Each RNC In ListaNCDesc.Where(Function(x) x.Num2 = 1)
Dim Salir As Boolean = False
Dim NCAjuste As Integer = -1
@@ -28496,9 +28646,12 @@ Partial Class Ventas
ListaNCDesc.Clear()
Exit Sub
End If
+
+ Dim TotalProntoPago As Decimal = TmpDT.SUM("ImporteProntoPago").ToDecimal
+
HdnTotalRNC.Value = TotalRemNCAplicado.ToString()
LblDescuentosRNC.Text = TotalRemNCAplicado.FormatoNumero
- LblTotalNC.Text = (TxtTotal.Text.ToDecimal() - TotalRemNCAplicado).FormatoNumero
+ LblTotalAPagar.Text = (TxtTotal.Text.ToDecimal() - TotalRemNCAplicado - TotalProntoPago).FormatoNumero
Dim CvePS = DrPS("CvePS").ToString().ToEntero()
@@ -29415,7 +29568,7 @@ Partial Class Ventas
DtImpuestos.AcceptChanges()
Dim AcumuladoNC As Decimal = 0
- DtImpuestos.Merge(CargaDtImpuestosNC(ObjFactura.CveVenta, ObjFactura.DescuentoProntoPago), True, MissingSchemaAction.Ignore)
+ DtImpuestos.Merge(CargaDtImpuestosNCProntoPago(ObjFactura.CveVenta, ObjFactura.DescuentoProntoPago), True, MissingSchemaAction.Ignore)
DtImpuestos = CargaTotalesImpuestosProntoPago(DtImpuestos)
diff --git a/vwd.webinfo b/vwd.webinfo
index 3de4958f8..f962c21d4 100644
--- a/vwd.webinfo
+++ b/vwd.webinfo
@@ -154,6 +154,10 @@
+
+
+
+