This commit is contained in:
rakcsle
2021-09-08 17:05:19 -07:00
20 changed files with 636 additions and 343 deletions

View File

@@ -85,7 +85,7 @@ Partial Class Ventas_CatImpuestosLocales
Dim TieneError = False
Dim CveImpuestoLocal As Integer = GvImpuestos.Rows(e.RowIndex).DataKey("CveImpuestoLocal").ToEntero
Dim Impuesto As String = GvImpuestos.Rows(e.RowIndex).FCTextBox("TxtImpuestoLocal").Text.Trim
Dim Porcentaje As Double = GvImpuestos.Rows(e.RowIndex).FCTextBox("TxtVentaPorcentaje").Text.ToDouble
Dim Porcentaje As Decimal = GvImpuestos.Rows(e.RowIndex).FCTextBox("TxtVentaPorcentaje").Text.ToDecimal
Dim Orden = GvImpuestos.Rows(e.RowIndex).FCTextBox("TxtOrdenImpuesto").Text.ToEntero
Dim TipoImpuesto = GvImpuestos.Rows(e.RowIndex).FCDropDownList("DdlTipoImpuestoEdit").SelectedValue.ToEntero
Dim IdCtaContable = GvImpuestos.Rows(e.RowIndex).FCDropDownList("DdlCuentasContables").SelectedValue.ToEntero
@@ -199,7 +199,7 @@ Partial Class Ventas_CatImpuestosLocales
If CveImpuestoLocal = -1 Then
If ChkEstatus.Checked Then Estatus = 1
If ObjVentas.AddImpuestosLocales(TxtImpuesto.Text.Trim, TxtPorcentaje.Text.ToDouble, TxtOrden.Text.ToEntero, DdlTipoImpuesto.SelectedValue.ToEntero, Estatus, DdlCuentasContables.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
If ObjVentas.AddImpuestosLocales(TxtImpuesto.Text.Trim, TxtPorcentaje.Text.ToDecimal, TxtOrden.Text.ToEntero, DdlTipoImpuesto.SelectedValue.ToEntero, Estatus, DdlCuentasContables.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
CargaDatos()
End If
TxtImpuesto.Text = ""
@@ -210,7 +210,7 @@ Partial Class Ventas_CatImpuestosLocales
If CveImpuestoLocal <> -1 Then
Dim TieneError = False
Dim Impuesto As String = TxtImpuesto.Text.Trim
Dim Porcentaje As Double = TxtPorcentaje.Text.ToDouble
Dim Porcentaje As Decimal = TxtPorcentaje.Text.ToDecimal
Dim Orden = TxtOrden.Text.ToEntero
Dim TipoImpuesto = DdlTipoImpuesto.SelectedValue.ToEntero
Dim IdCtaContable = DdlCuentasContables.SelectedValue.ToEntero

View File

@@ -688,7 +688,7 @@ Partial Class PV
Get
Return New Dictionary(Of Integer, Decimal) From {
{20516, 0.23D}, 'Descuento para lubricantes LTH
{20515, 0.24D} 'Descuento para filtros LTH
{20515, 0.274D} 'Descuento para filtros LTH
}
End Get
End Property
@@ -1934,7 +1934,7 @@ Partial Class PV
For Each Row As DataRow In TmpDT.FiltraParametros("EliminarDB = False").Rows
Dim CveVentaDetalle As Integer = Row("CveVentaDetalle").ToString.ToEntero()
If CveVentaDetalle > 0 Then
If Not ObjVentas.UpdateVentaDetalleRemision(Row("CveVentaDetalle").ToString.ToEntero, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDecimal, Row("PU").ToString.ToDecimal(), Row("ImporteIEPS").ToString.ToDecimal(), Row("PorcentajeIEPS").ToString().ToDecimal(), Row("ImporteIVA").ToString.ToDecimal(), Row("PorcentajeIVA").ToString().ToDecimal(), Row("Obs").ToString, UsuarioActual.CveUsuario) Then
If Not ObjVentas.UpdateVentaDetalleRemision(Row("CveVentaDetalle").ToString.ToEntero, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDecimal, Row("PU").ToString.ToDecimal(), Row("ImporteIEPS").ToString.ToDecimal(), Row("PorcentajeIEPS").ToString().ToDecimal(), Row("ImporteIVA").ToString.ToDecimal(), Row("PorcentajeIVA").ToString().ToDecimal(), Row("Descuento").ToString().ToDecimal(), Row("Obs").ToString, UsuarioActual.CveUsuario) Then
OcurrioError = True
Exit For
End If

View File

@@ -280,19 +280,19 @@ Partial Class PopUpBuscarFolio
End Sub
Private Function ValidarUnFiltroSeleccionado() As Boolean
If DdlClasificacion.SelectedValue.ToEntero > 0 Then Return True
If DdlTipoDocto.SelectedValue <> "-1" Then Return True
If DdlSubProyecto.SelectedValue.ToEntero > 0 Then Return True
If DdlEstatusFactura.SelectedValue.ToEntero > 0 Then Return True
If DdlUsuario.SelectedValue.ToEntero > 0 Then Return True
If DdlPS.SelectedValue.ToEntero > 0 Then Return True
If TxtFolio.Text.Trim.Length > 0 Then Return True
If DdlNombre.SelectedValue.ToEntero > 0 Then Return True
If TxtFolioFiscal.Text.Trim.Length > 0 Then Return True
If TxtPedidoContrato.Text.Length > 0 Then Return True
If TxtOrdenCompra.Text.Length > 0 Then Return True
'If DdlClasificacion.SelectedValue.ToEntero > 0 Then Return True
'If DdlTipoDocto.SelectedValue <> "-1" Then Return True
'If DdlSubProyecto.SelectedValue.ToEntero > 0 Then Return True
'If DdlEstatusFactura.SelectedValue.ToEntero > 0 Then Return True
'If DdlUsuario.SelectedValue.ToEntero > 0 Then Return True
'If DdlPS.SelectedValue.ToEntero > 0 Then Return True
'If TxtFolio.Text.Trim.Length > 0 Then Return True
'If DdlNombre.SelectedValue.ToEntero > 0 Then Return True
'If TxtFolioFiscal.Text.Trim.Length > 0 Then Return True
'If TxtPedidoContrato.Text.Length > 0 Then Return True
'If TxtOrdenCompra.Text.Length > 0 Then Return True
Return False
Return True
End Function
End Class

View File

@@ -154,6 +154,10 @@ Partial Class Ventas_RepVentasUtilidadDetalle
DdlPS.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
End If
DdlMarcas.DataSource = GlobalDTGralMarcas(UsuarioActual.CveEmpresa)
DdlMarcas.DataBind()
DdlMarcas.Items.Insert(0, New ListItem("Todas", "-1"))
'Cargo Clasificaciones
DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa)
DdlClasificacion.DataBind()

View File

@@ -3271,7 +3271,12 @@ Partial Class Ventas
If ObjContratos.GetContratos(-1, UsuarioActual.CveEmpresa, CveCliente, -1, 1) Then
If ObjContratos.DtResultados.FiltraParametros("Estatus = True").Rows.Count > 0 AndAlso (DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ped") Or DdlTipoComprobante.SelectedValue.Contiene("Egs", "Dev")) Then
DtContratos = ObjContratos.DtResultados.FiltraParametros($"Estatus = True AND FechaFinal >= '{Now.ToShortDateString}' AND FechaInicial <= '{Now.ToShortDateString}'")
If UsuarioActual.CveEmpresa.Contiene(72, 80) Then
DtContratos = ObjContratos.DtResultados.FiltraParametros($"Estatus = True AND FechaFinal >= '{Now.ToShortDateString}' AND FechaInicial <= '{Now.ToShortDateString}'")
Else
DtContratos = ObjContratos.DtResultados.FiltraParametros($"Estatus = True ")
End If
If AfterPageLoad Then
RegistraScript("window.onload = function MuestraContratos() { document.getElementById(""C_BtnMostrarContrato"").click(); }")
@@ -8255,7 +8260,7 @@ Partial Class Ventas
For Each Row As DataRow In DtMovDetalles.Rows
Dim Cantidad As Decimal = Row("Cantidad").ToString().ToDecimal()
Dim SaldoAlmacen As Decimal = Row("SaldoAlmacen").ToString().ToDecimal()
Cantidad += Cantidad
CantidadTotal += Cantidad
If SaldoAlmacen < 0 AndAlso Cantidad = Math.Abs(SaldoAlmacen) Then
TotalSalida += Math.Abs(SaldoAlmacen)
@@ -8266,7 +8271,7 @@ Partial Class Ventas
Next
'SI SE VERIFICA QUE TODO ESTA SURTIDO, SE MARCA TODA LA FACTURA
If CantidadTotal = Total Then
If CantidadTotal = TotalSalida Then
If Not ObjInventario.ActualizarEsDevolucionVenta(ObjFactura.CveVenta, 2) Then
ErrorList.Add("No se pudo Cancelar el movimiento de almacen de la Factura")
End If
@@ -8472,10 +8477,10 @@ Partial Class Ventas
If AutoConta Then
If idCuentaContabilizacion > 0 Then
If ObjConta.ContabilizarPrePoliza(ObjFactura.CvePrePoliza, ObjFactura.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjContPaq) Then
If ObjContPaq IsNot Nothing Then ObjContPaq.Commit()
Else
Alert("Ocurrio un Error al contabilizar, pongase en contacto con Soporte Técnico", TipoMensaje.MsgError)
If ObjContPaq IsNot Nothing Then ObjContPaq.RollBack()
End If
Else
Alert(String.Format("Falta asignación de las siguientes cuentas contables: {0}", CuentasContablesInvalidas), TipoMensaje.MsgAdvertencia)
@@ -8483,7 +8488,7 @@ Partial Class Ventas
End If
End If
If ObjContPaq IsNot Nothing Then ObjContPaq.Commit()
'If ObjContPaq IsNot Nothing Then ObjContPaq.RollBack()
'RMF, cuando es pedido, se manda autorización.
@@ -10693,7 +10698,7 @@ Partial Class Ventas
.CuentaPredial = drr("CuentaPredial").ToString(),
.ImporteGravaIVAAdicional = drr("ImporteIEPS").ToString().ToDecimal}
'verifica suma subtotales
If i = Obj.DtDetalle.Rows.Count AndAlso totSubTotal <> concepto.Importe Then 'proceso de ajusta de decimales
If i = Obj.DtDetalle.Rows.Count AndAlso totSubTotal.RoundSQL(2) <> concepto.Importe.RoundSQL(2) AndAlso Math.Abs(totSubTotal.RoundSQL(2) - concepto.Importe.RoundSQL(2)) <= 0.01 Then 'proceso de ajusta de decimales
concepto.Importe = totSubTotal
End If
totSubTotal = totSubTotal - concepto.Importe
@@ -10703,19 +10708,19 @@ Partial Class Ventas
'si es ingreso amortizado por la totalidad, y arroja el valor total de cero, no debe de impuestos, y si la BASE de calculo es mayor a cero
If Timbre.Comprobante.Total > 0 AndAlso concepto.Importe - concepto.Descuento + concepto.ImporteGravaIVAAdicional > 0 Then
concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "T", .Base = concepto.Importe - concepto.Descuento + concepto.ImporteGravaIVAAdicional, .TasaOCuota = drr("PorcentajeIVA").ToString().ToDecimal, .Impuesto = "002", .Importe = drr("ImporteIVA").ToString().ToDecimal})
concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "T", .Base = (concepto.Importe - concepto.Descuento + concepto.ImporteGravaIVAAdicional).RoundSQL(6), .TasaOCuota = drr("PorcentajeIVA").ToString().ToDecimal, .Impuesto = "002", .Importe = drr("ImporteIVA").ToString().ToDecimal})
End If
If drr("ImporteIEPS").ToString().ToDouble > 0 Then
concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "T", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = drr("PorcentajeIEPS").ToString().ToDecimal, .Impuesto = "003", .Importe = drr("ImporteIEPS").ToString().ToDecimal})
concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "T", .Base = (concepto.Importe - concepto.Descuento).RoundSQL(6), .TasaOCuota = drr("PorcentajeIEPS").ToString().ToDecimal, .Impuesto = "003", .Importe = drr("ImporteIEPS").ToString().ToDecimal})
End If
If drr("ImporteRetIVA").ToString().ToDouble > 0 Then 'si hay retenciones
concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "R", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = drr("PorcentajeRetIVA").ToString().ToDecimal, .Impuesto = "002", .Importe = drr("ImporteRetIVA").ToString().ToDecimal})
concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "R", .Base = (concepto.Importe - concepto.Descuento).RoundSQL(6), .TasaOCuota = drr("PorcentajeRetIVA").ToString().ToDecimal, .Impuesto = "002", .Importe = drr("ImporteRetIVA").ToString().ToDecimal})
End If
If drr("ImporteRetISR").ToString().ToDouble > 0 Then 'retención de ISR
concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "R", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = drr("PorcentajeRetISR").ToString().ToDecimal, .Impuesto = "001", .Importe = drr("ImporteRetISR").ToString().ToDecimal})
concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "R", .Base = (concepto.Importe - concepto.Descuento).RoundSQL(6), .TasaOCuota = drr("PorcentajeRetISR").ToString().ToDecimal, .Impuesto = "001", .Importe = drr("ImporteRetISR").ToString().ToDecimal})
End If
Timbre.Conceptos.Add(concepto)
@@ -13256,9 +13261,6 @@ Partial Class Ventas
End If
Dim ModalidadRefacturacion As Integer = UsuarioActual.Empresa.Funcionalidad(586).ToEntero()
If UsuarioActual.CveUsuario.Contiene(100, 1719) Then
ModalidadRefacturacion = 2
End If
'REFACTURACION CON PAGOS, DEBE CANCELAR SALDOS DEL DOCUMENTO ANTERIOR Y TRASPASAR PAGOS AL NUEVO
If ModalidadRefacturacion = 2 AndAlso ObjFactura.TipoDocto.Contiene("Ing", "Ant") AndAlso ObjFactura.NuevaFactura = 1 Then
@@ -19962,6 +19964,9 @@ Partial Class Ventas
sb.Append("Está seguro de cancelar el documento para realizar la refacturación?.")
End If
Else
If Not UsuarioActual.Empresa.FacturaProduccion Then
script = "BtnRefacturacionConfirmar();"
End If
sb.Append("<b>No encontrado</b> <br/>")
End If
Else
@@ -20215,7 +20220,7 @@ Partial Class Ventas
For Each Row As DataRow In TmpDT.Rows
Dim CveVentaDetalle As Integer = Row("CveVentaDetalle").ToString().ToEntero()
If CveVentaDetalle > 0 Then
If Not ObjVentas.UpdateVentaDetalleRemision(Row("CveVentaDetalle").ToString().ToEntero(), Row("CvePS").ToString().ToEntero(), Row("Cantidad").ToString().ToDecimal, Row("PU").ToString().ToDecimal(), Row("ImporteIEPS").ToString().ToDecimal(), Row("PorcentajeIEPS").ToString().ToDecimal(), Row("ImporteIVA").ToString().ToDecimal(), Row("PorcentajeIVA").ToString().ToDecimal(), Row("Obs").ToString(), UsuarioActual.CveUsuario) Then
If Not ObjVentas.UpdateVentaDetalleRemision(Row("CveVentaDetalle").ToString().ToEntero(), Row("CvePS").ToString().ToEntero(), Row("Cantidad").ToString().ToDecimal, Row("PU").ToString().ToDecimal(), Row("ImporteIEPS").ToString().ToDecimal(), Row("PorcentajeIEPS").ToString().ToDecimal(), Row("ImporteIVA").ToString().ToDecimal(), Row("PorcentajeIVA").ToString().ToDecimal(), Row("Descuento").ToString().ToDecimal(), Row("Obs").ToString(), UsuarioActual.CveUsuario) Then
OcurrioError = True
Exit For
End If
@@ -31505,7 +31510,7 @@ Partial Class Ventas
Dim Respuesta As Boolean = False
If EscontratoObra Then
If EscontratoObra AndAlso PorAmortizacionAnticipo > 0 Then ' si es contrato de obra y tiene amortización de anticipo
If DdlTipoComprobante.SelectedValue = "Ing" Then
@@ -31526,7 +31531,7 @@ Partial Class Ventas
Respuesta = True
Else
Respuesta = False
Alert("Debe de seleccioanr un importe de amortización.", TipoMensaje.MsgAdvertencia)
Alert("Debe de seleccionar un importe de amortización.", TipoMensaje.MsgAdvertencia)
End If
Else