This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2020-01-09 18:14:28 -07:00
21 changed files with 5626 additions and 5146 deletions

View File

@@ -89,7 +89,6 @@ Partial Class CatClasificaciones
CargaDdlSATPS()
CargaDDLs()
CargaGlobal()
DdlCategoriaFiltro.DataSource = GlobalDTGralCategorias(UsuarioActual.CveEmpresa)
DdlCategoriaFiltro.Items.Insert(0, New ListItem("Todos", "-1"))
@@ -152,20 +151,20 @@ Partial Class CatClasificaciones
CargaGrid()
End Sub
Public Sub CargaGlobal()
'Public Sub CargaGlobal()
Dim ObjClasificaciones As New ClsClasificaciones
' Dim ObjClasificaciones As New ClsClasificaciones
If ObjClasificaciones.GetClasificaciones() Then
ViewState("DTClasificaciones") = ObjClasificaciones.DtResultados.FiltraParametros($"(Codigo IS NULL OR Codigo = '') AND CveEmpresa = {UsuarioActual.CveEmpresa} AND (CveCategoria = {DdlCategoriaFiltro.SelectedValue.ToEntero} OR {DdlCategoriaFiltro.SelectedValue.ToEntero} = -1) AND (UsoClasificacion = {DdlTipoClasificacion.SelectedValue.ToEntero} OR {DdlTipoClasificacion.SelectedValue.ToEntero} = -1 ) AND (Estado = {DdlEstatus.SelectedValue.ToEntero} OR {DdlEstatus.SelectedValue.ToEntero} = -1)")
GlobalDTClasificaciones = ObjClasificaciones.DtResultados
Else
Me.GvDatos.DataSource = Nothing
Alert("Ocurrió un error al cargar las clasificaciones. Por favor vuelva a intentar.", TipoMensaje.MsgError)
End If
' If ObjClasificaciones.GetClasificaciones(UsuarioActual.CveEmpresa) Then
' ViewState("DTClasificaciones") = ObjClasificaciones.DtResultados.FiltraParametros($"(Codigo IS NULL OR Codigo = '') AND CveEmpresa = {UsuarioActual.CveEmpresa} AND (CveCategoria = {DdlCategoriaFiltro.SelectedValue.ToEntero} OR {DdlCategoriaFiltro.SelectedValue.ToEntero} = -1) AND (UsoClasificacion = {DdlTipoClasificacion.SelectedValue.ToEntero} OR {DdlTipoClasificacion.SelectedValue.ToEntero} = -1 ) AND (Estado = {DdlEstatus.SelectedValue.ToEntero} OR {DdlEstatus.SelectedValue.ToEntero} = -1)")
' GlobalDTClasificaciones(UsuarioActual.CveEmpresa) = Nothing
' Else
' Me.GvDatos.DataSource = Nothing
' Alert("Ocurrió un error al cargar las clasificaciones. Por favor vuelva a intentar.", TipoMensaje.MsgError)
' End If
ObjClasificaciones.Dispose()
End Sub
' ObjClasificaciones.Dispose()
'End Sub
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
@@ -212,7 +211,7 @@ Partial Class CatClasificaciones
End If
End If
CargaGlobal()
GlobalDTClasificaciones(UsuarioActual.CveEmpresa) = Nothing
ObjClasificaciones.Dispose()
CargaDatos()
@@ -317,6 +316,7 @@ Partial Class CatClasificaciones
If ObjClasificaciones.RemoveClasificacion(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
GvDatos.EditIndex = -1
ViewState("DTClasificaciones") = ObjClasificaciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTClasificaciones(UsuarioActual.CveEmpresa) = Nothing
Alert("La Clasificación se eliminó correctamente.", TipoMensaje.MsgInformacion)
Else
Alert("Ocurrió un error al eliminar la clasificación. Por favor vuelva a intentar.", TipoMensaje.MsgError)
@@ -324,7 +324,7 @@ Partial Class CatClasificaciones
ObjClasificaciones.Dispose()
CargaGrid()
CargaGlobal()
End Sub
#End Region
@@ -348,7 +348,9 @@ Partial Class CatClasificaciones
TxtClasificacion.Text = ""
TxtPrecioBaseCosto.Text = ""
DdlCategoria.SelectedIndex = 0
If DdlCategoria.Items.Count > 0 Then
DdlCategoria.SelectedIndex = 0
End If
DdlSATPS.SelectedValue = ""
DdlSATPS.SelectedText = ""
LtlTituloModal.Text = "Agregar Clasificación"

View File

@@ -137,11 +137,12 @@ Partial Class Ventas_CatVendedores
#Region "CARGA GLOBAL"
Private Sub CargaGlobal()
Dim ObjVendedores As New ClsVtaVendedores
If ObjVendedores.GetVendedores(-1) Then
GlobalDTVendedores(-1) = ObjVendedores.DtResultados
End If
ObjVendedores.Dispose()
GlobalDTVendedores(UsuarioActual.CveEmpresa) = Nothing
'Dim ObjVendedores As New ClsVtaVendedores
'If ObjVendedores.GetVendedores(UsuarioActual.CveEmpresa) Then
' GlobalDTVendedores(-1) = ObjVendedores.DtResultados
'End If
'ObjVendedores.Dispose()
End Sub
#End Region

View File

@@ -459,7 +459,7 @@ Partial Class Ventas_ClientesAbonar
TxtImporte.Text = ""
TxtObservaciones.Text = ""
If SumDescuentoProntoPago > 0.0 Then
GvCxC.Columns("DescuentoProntoPago").Visible = True
GvCxC.Columns(15).Visible = True
End If
Mov.Dispose()
@@ -900,6 +900,7 @@ Partial Class Ventas_ClientesAbonar
Select Case ConceptoContable
Case 2 'Pago Cliente
'If gvr.DataKey("CveMoneda").ToEntero > 1 Then ConceptoContable = 292
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = gvr.FCTextBox("TxtAbonar").Text.ToDecimal
importeMX = ImporteMovimiento

View File

@@ -616,8 +616,7 @@
</th>
<th id="thEncIEPS1" runat="server" visible="false">IEPS
</th>
<th>Total&nbsp<%--;<asp:LinkButton ID="ImgDescConcepto" runat="server" Text="<i class='fa fa-comment-o'></i>" Style="cursor: pointer;" AlternateText="Agregar Descuento" /></th>--%>
<th style="width: 100px;" colspan="3">Comandos</th>
<th>Total&nbsp<%--;<asp:LinkButton ID="ImgDescConcepto" runat="server" Text="<i class='fa fa-comment-o'></i>" Style="cursor: pointer;" AlternateText="Agregar Descuento" /></th>--%><th style="width: 100px;" colspan="3">Comandos</th>
<th></th>
<th runat="server" visible="false" id="nomostrar2"></th>
</tr>

View File

@@ -5611,6 +5611,9 @@ Partial Class Ventas
'LO NO PERMITIDO MODIFICAR
e.Row.FCDropDownList("DdlUnidadMedida").Enabled = False
If UsuarioActual.CveEmpresa = 119 Then
e.Row.FCTextBox("TxtCantidad").Enabled = False
End If
'e.Row.FCDropDownList("DdlClasificacion").Enabled = False
'e.Row.FCDropDownLost("DdlPS").Enabled = False
@@ -6704,6 +6707,23 @@ Partial Class Ventas
GuardarVenta(ObjVentas, ObjConta, ObjInventario, ObjContr, ObjFactura, TmpDT, ObjFactura.CveNCaVincular, ObjContPaq, ObjBancos, ObjOS,
ObjEventos, ObjCGame, ObjClientes, EsNCAmortizacion:=EsNCAmortizacion)
'Agregamos las OCs a la tabla
If ObjFactura.CveVenta > 0 AndAlso ErrorList.Count = 0 AndAlso DTOrdenesCompraPS IsNot Nothing AndAlso DTOrdenesCompraPS.Rows.Count > 0 AndAlso ErrorList.Count = 0 Then
Dim CveVentaDetalle As Integer = 0
Dim CveOrdenCompraDetalle As Integer = 0
Dim Cantidad As Decimal = 0
For Each row As DataRow In TmpDT.Rows
Cantidad = row("Cantidad").ToString.ToDecimal
CveVentaDetalle = row("CveVentaDetalle").ToString.ToEntero
CveOrdenCompraDetalle = row("CveOrdenCompraDetalle").ToString.ToEntero
If Not ObjVentas.AgregarVentaOCDetalle(CveVentaDetalle, CveOrdenCompraDetalle, Cantidad) Then
ErrorList.Add("Ocurrió un Error al agregar el detalle de la Remision")
Exit For
End If
Next
End If
'SI ES REFACTURACION
Dim ObjNC As List(Of Object) = Nothing
If ErrorList.Count = 0 Then
@@ -6723,7 +6743,6 @@ Partial Class Ventas
End If
End If
End If
End If
End If
@@ -6789,24 +6808,6 @@ Partial Class Ventas
End If
End If
'Agregamos las OCs a la tabla
If DTOrdenesCompraPS IsNot Nothing AndAlso DTOrdenesCompraPS.Rows.Count > 0 AndAlso ErrorList.Count = 0 Then
Dim CveVentaDetalle As Integer = 0
Dim CveOrdenCompraDetalle As Integer = 0
Dim Cantidad As Decimal = 0
For Each row As DataRow In TmpDT.Rows
Cantidad = row("Cantidad").ToString.ToDecimal
CveVentaDetalle = row("CveVentaDetalle").ToString.ToEntero
CveOrdenCompraDetalle = row("CveOrdenCompraDetalle").ToString.ToEntero
If Not ObjVentas.AgregarVentaOCDetalle(CveVentaDetalle, CveOrdenCompraDetalle, Cantidad) Then
ErrorList.Add("Ocurrió un Error al agregar el detalle de la Remision")
End If
Next
End If
'Agregamos las Cotizaciones a la tabla
If DtCotizacionesPS IsNot Nothing AndAlso DtCotizacionesPS.Rows.Count > 0 AndAlso ErrorList.Count = 0 Then
Dim CveVentaDetalle As Integer = 0
@@ -6828,8 +6829,6 @@ Partial Class Ventas
Next
End If
'Marcamos las ventas anteriores a febrero como surtidas - Ajuste Compu
If ErrorList.Count = 0 Then
If Not ObjVentas.MarcarRemisionesSinSurtir(ObjVentas.CveVenta) Then
@@ -7723,15 +7722,21 @@ Partial Class Ventas
'CONVERTIR REMISION - TIPO MONEDA -DOLARES A PESOS
If (ObjFactura.CveMoneda = 2 AndAlso ObjFactura.ConvertirPesos = True AndAlso ObjFactura.TipodeComprobante = "Ingresos" AndAlso RemisionesLista.Count > 0) Then
Dim TotalCalculableImpuestos, TotalCalculableImpuestosIVA As Decimal
For Each Row As DataRow In TmpDT.Rows
Row("PU") = Math.Round(Row("PU").ToString.ToDouble * ObjFactura.TipoCambio, 6)
Row("PU") = Math.Round(Row("PU").ToString.ToDecimal * ObjFactura.TipoCambio, 6)
Row("Descuento") = Math.Round(Row("Descuento").ToString.ToDouble * ObjFactura.TipoCambio, NumeroDecimales)
TotalCalculableImpuestos = (Row("Cantidad").ToString.ToDecimal * Row("PU").ToString.ToDecimal) - Row("Descuento").ToString.ToDecimal
TotalCalculableImpuestosIVA = TotalCalculableImpuestos * (1 + Row("PorcentajeIEPS").ToString.ToDecimal)
Row("IVA") = Row("PorcentajeIVA")
Row("ImporteIVA") = Math.Round(Row("PorcentajeIVA").ToString.ToDecimal * TotalCalculableImpuestosIVA, NumeroDecimales)
Row("ImporteRetIVA") = Math.Round(ClienteRetIVA * TotalCalculableImpuestos, NumeroDecimales)
Row("ImporteRetISR") = Math.Round(ClienteRetISR * TotalCalculableImpuestos, NumeroDecimales)
Row("ImporteIEPS") = Math.Round(Row("PorcentajeIEPS").ToString.ToDecimal * TotalCalculableImpuestos, NumeroDecimales)
Row("IEPS") = Row("ImporteIEPS")
Row("Total") = Math.Round(Row("Cantidad").ToString.ToDouble * Row("PU").ToString.ToDouble, NumeroDecimales)
Row("TotalImporte") = Math.Round(Row("Cantidad").ToString.ToDouble * Row("PU").ToString.ToDouble, NumeroDecimales)
Row("Descuento") = Math.Round(Row("Descuento").ToString.ToDouble * ObjFactura.TipoCambio, NumeroDecimales)
Row("ImporteRetIVA") = Math.Round(Row("ImporteRetIVA").ToString.ToDouble * ObjFactura.TipoCambio, NumeroDecimales)
Row("ImporteRetISR") = Math.Round(Row("ImporteRetISR").ToString.ToDouble * ObjFactura.TipoCambio, NumeroDecimales)
Row("ImporteIVA") = Math.Round(Row("ImporteIVA").ToString.ToDouble * ObjFactura.TipoCambio, NumeroDecimales)
Row("ImporteIEPS") = Math.Round(Row("ImporteIEPS").ToString.ToDouble * ObjFactura.TipoCambio, NumeroDecimales)
Next
Dim ImpuestosLocales As Double = 0
@@ -7799,21 +7804,28 @@ Partial Class Ventas
'CONVERTIR REMISION - TIPO MONEDA -DOLARES A PESOS REGISTRO DIRECTO SIN VENTA
ElseIf (EditoRemision = False AndAlso ObjFactura.CveMoneda = 2 AndAlso ObjFactura.ConvertirPesos = True) Then
Dim TotalCalculableImpuestos, TotalCalculableImpuestosIVA As Decimal
For Each Row As DataRow In TmpDT.Rows
Row("PU") = Math.Round(Row("PU").ToString.ToDouble * ObjFactura.TipoCambio, 6)
Row("PU") = Math.Round(Row("PU").ToString.ToDecimal * ObjFactura.TipoCambio, 6)
Row("Descuento") = Math.Round(Row("Descuento").ToString.ToDouble * ObjFactura.TipoCambio, NumeroDecimales)
TotalCalculableImpuestos = (Row("Cantidad").ToString.ToDecimal * Row("PU").ToString.ToDecimal) - Row("Descuento").ToString.ToDecimal
TotalCalculableImpuestosIVA = TotalCalculableImpuestos * (1 + Row("PorcentajeIEPS").ToString.ToDecimal)
Row("IVA") = Row("PorcentajeIVA")
Row("ImporteIVA") = Math.Round(Row("PorcentajeIVA").ToString.ToDecimal * TotalCalculableImpuestosIVA, NumeroDecimales)
Row("ImporteRetIVA") = Math.Round(ClienteRetIVA * TotalCalculableImpuestos, NumeroDecimales)
Row("ImporteRetISR") = Math.Round(ClienteRetISR * TotalCalculableImpuestos, NumeroDecimales)
Row("ImporteIEPS") = Math.Round(Row("PorcentajeIEPS").ToString.ToDecimal * TotalCalculableImpuestos, NumeroDecimales)
Row("IEPS") = Row("ImporteIEPS")
Row("Total") = Math.Round(Row("Cantidad").ToString.ToDouble * Row("PU").ToString.ToDouble, NumeroDecimales)
Row("TotalImporte") = Math.Round(Row("Cantidad").ToString.ToDouble * Row("PU").ToString.ToDouble, NumeroDecimales)
Row("Descuento") = Math.Round(Row("Descuento").ToString.ToDouble * ObjFactura.TipoCambio, NumeroDecimales)
Row("ImporteRetIVA") = Math.Round(Row("ImporteRetIVA").ToString.ToDouble * ObjFactura.TipoCambio, NumeroDecimales)
Row("ImporteRetISR") = Math.Round(Row("ImporteRetISR").ToString.ToDouble * ObjFactura.TipoCambio, NumeroDecimales)
Row("ImporteIVA") = Math.Round(Row("ImporteIVA").ToString.ToDouble * ObjFactura.TipoCambio, NumeroDecimales)
Row("ImporteIEPS") = Math.Round(Row("ImporteIEPS").ToString.ToDouble * ObjFactura.TipoCambio, NumeroDecimales)
Next
Dim ImpuestosLocales As Double = 0
For Each gvr As GridViewRow In GvImpuestosLocales2.Rows
If gvr.RowType = DataControlRowType.DataRow Then
gvr.FCTextBox("TxtImpuestoLocalPS").Text = (gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble * ObjFactura.TipoCambio).FormatoNumero
gvr.FCTextBox("TxtImpuestoLocalPS").Text = (gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDecimal * ObjFactura.TipoCambio).FormatoNumero
ImpuestosLocales += Math.Round(gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble * ObjFactura.TipoCambio, NumeroDecimales)
End If
Next
@@ -9037,7 +9049,7 @@ Partial Class Ventas
#Region " GUARDAR - VENTA, PREPOLIZAS, INV, ESTIMACIONES, AC, NOTA DE CRÉDITO "
Private Sub GuardarVenta(ByRef ObjVentas As ClsVentas, ByRef ObjConta As ClsContabilidad, ByRef ObjInventario As ClsInventarios, ByRef ObjContr As ClsContratos, factura As Modelos.Factura, TmpDTDetalle As DataTable, CveNCaVincular As Integer,
Private Sub GuardarVenta(ByRef ObjVentas As ClsVentas, ByRef ObjConta As ClsContabilidad, ByRef ObjInventario As ClsInventarios, ByRef ObjContr As ClsContratos, factura As Modelos.Factura, ByRef TmpDTDetalle As DataTable, CveNCaVincular As Integer,
ByRef objContPaqi As ClsContPAQi, Optional ByRef ObjBancos As ClsBancos = Nothing, Optional ByRef ObjOS As ClsOS = Nothing, ByRef Optional ObjEventos As ClsOIEventos = Nothing, ByRef Optional ObjCGame As ClsCGame = Nothing,
ByRef Optional ObjCliente As ClsClientes = Nothing, Optional EsNCAmortizacion As Boolean = False, Optional NCDescuento As Boolean = False)
@@ -9108,8 +9120,8 @@ Partial Class Ventas
PedidoContrato:=TxtPedidoContrato.Text, ObservacionesAlmacen:=TxtObsAlmacen.Text, CveSubProyecto:=factura.CveSubProyecto, CveSubProyectoCobranza:=factura.CveSubProyectoCobranza, CveSubProyectoEjecucion:=factura.CveSubProyectoEjecucion, CveFormaPago33:=factura.CveFormaPago33,
CveMetodoPago33:=factura.CveMetodoPago33, CveUsoCFDI:=factura.CveUsoCFDI, OrdenCompra:=TxtOrdenCompra.Text, CveCuentaTerminal:=DdlCuentasTerminal.SelectedValue.ToEntero, CveTipoRelacion:=factura.CveTipoRelacion, ImpuestoLocal:=TotalImpuestoLocal,
CveVentaRelacion:=(If(factura.CveVentaRelacion.ToEntero > 0, factura.CveVentaRelacion, -1)), ImporteRelacion:=(If(factura.ImporteRelacion <> Nothing, factura.ImporteRelacion, -1)),
CveTipoAmortizacionAnticipo:=factura.CveTipoAmortizacionAnticipo, CveEmpresaCRM:=CveEmpresaCRM, EsInterno:=EsInterno, CveAcercamientoCRM:=CveAcercamientoCRM,
DiasCredito:=factura.DiasCredito, EsDiasCreditoFijo:=factura.EsDiasCreditoFijo, AnticipoEspecial:=If(TrAntEspecial.Visible, ChkAntEspecial.Checked, False)) Then
CveTipoAmortizacionAnticipo:=factura.CveTipoAmortizacionAnticipo, CveEmpresaCRM:=CveEmpresaCRM, EsInterno:=EsInterno, CveAcercamientoCRM:=CveAcercamientoCRM,
DiasCredito:=factura.DiasCredito, EsDiasCreditoFijo:=factura.EsDiasCreditoFijo, AnticipoEspecial:=If(TrAntEspecial.Visible, ChkAntEspecial.Checked, False)) Then
ErrorList.Add("Ocurrió un error al Generar la Venta.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
@@ -9171,7 +9183,7 @@ Partial Class Ventas
End If
End If
Dim TmpDr As DataRow = TmpDT.Select($"Consec = {Row("Consec").ToString}")(0)
Dim TmpDr As DataRow = TmpDTDetalle.Select($"Consec = {Row("Consec").ToString}")(0)
TmpDr("CveVentaDetalle") = ObjVentas.CveVentaDetalle
Try
@@ -9342,7 +9354,7 @@ Partial Class Ventas
Cantidad = DtPedidos2TmpDT.FiltroPrimeroValor("Cantidad", $"CveVentaDetallePedido2={row("CveVentaDetalle")}").ToDecimal
CvePS = DtPedidos2TmpDT.FiltroPrimeroValor("CvePS", $"CveVentaDetallePedido2={row("CveVentaDetalle")}").ToEntero
PU = DtPedidos2TmpDT.FiltroPrimeroValor("PU", $"CveVentaDetallePedido2={row("CveVentaDetalle")}").ToDecimal
CveVentaDetalle = TmpDT.FiltroPrimeroValor("CveVentaDetalle", $"CveVentaDetallePedido2={row("CveVentaDetalle")}").ToEntero
CveVentaDetalle = TmpDTDetalle.FiltroPrimeroValor("CveVentaDetalle", $"CveVentaDetallePedido2={row("CveVentaDetalle")}").ToEntero
CveVentaDetallePadre = row("CveVentaDetalle").ToString.ToEntero
If Not ObjVentas.AddVentaDetallePedido2(CveVentaDetalle, CveVentaDetallePadre, Cantidad) Then
@@ -9393,6 +9405,7 @@ Partial Class Ventas
End If
End Sub
Private Sub GuardarVentaPrePolizas(ByRef ObjConta As ClsContabilidad, factura As Modelos.Factura, TmpDTDetalleMovimientos As DataTable, CveNCaVincular As Integer,
ByRef objContPaqi As ClsContPAQi, Optional ByRef ObjBancos As ClsBancos = Nothing, ByRef Optional ObjVentas As ClsVentas = Nothing,
ByRef Optional ObjEventos As ClsOIEventos = Nothing, Optional EsNCAmortizacion As Boolean = False, Optional NCDescuento As Boolean = False)
@@ -9512,6 +9525,7 @@ Partial Class Ventas
Select Case ConceptoContable
Case 1 'Cliente
If Not ObjFactura.TipoDocto.Contiene("Egs", "Rem", "RNC") Then
If ObjFactura.CveMoneda > 1 Then ConceptoContable = 291
importeMovimiento = (ObjFactura.Total - TotalOtrosConceptos) * ValorMultiplicador
importeMX = importeMovimiento * tipoCambio * Multiplicador
FechaMovimiento = ObjFactura.FechaPago
@@ -9542,6 +9556,7 @@ Partial Class Ventas
CveCuentaCliente = CveCuenta
End If
Case 3 'Cliente
If ObjFactura.TipoDocto = "Ant" Then
@@ -10257,7 +10272,9 @@ Partial Class Ventas
If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}"
'Nota cuando es Nota de crédiot, debe de tomar el devoluciones y rebajas
If ObjFactura.TipoDocto.Contiene("Egs", "Dev") Then
IdCtaContable = GlobalDTClasificaciones(ObjFactura.CveEmpresa).FiltroPrimeroValor("IdCuentaGasto", String.Format("CveClasificacion = {0}", Row2("CveClasificacion"))).ToEntero
Dim CampoCuenta As String = "IdCuentaGasto"
If UsuarioActual.CveEmpresa.Contiene(80, 72, 146) Then CampoCuenta = "IdCuentaDescuento"
IdCtaContable = GlobalDTClasificaciones(ObjFactura.CveEmpresa).FiltroPrimeroValor(CampoCuenta, String.Format("CveClasificacion = {0}", Row2("CveClasificacion"))).ToEntero
Else
IdCtaContable = GlobalDTClasificaciones(ObjFactura.CveEmpresa).FiltroPrimeroValor("IdCuentaIngresos", String.Format("CveClasificacion = {0}", Row2("CveClasificacion"))).ToEntero
End If
@@ -11685,6 +11702,7 @@ Partial Class Ventas
Select Case ConceptoContable
Case 2 'Cliente
'If CveMonedaVenta > 1 Then ConceptoContable = 292
If Not (gvr.DataKey("CveIE").ToString.ToEntero > 0 AndAlso gvr.DataKey("CveConceptoContable").ToString().ToEntero = 66) Then
If DdlMoneda.SelectedValue.ToEntero = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal
@@ -13824,10 +13842,12 @@ Partial Class Ventas
If DtPromociones.Rows.Count > 0 And DtPromociones IsNot Nothing Then
Dim dr As DataRow = DtPromociones.FiltroPrimero($"CvePS = {CvePS}")
TipoPromo = dr("TipoPromocion").ToString.ToEntero
TotalPromocion = dr("PUPromocion").ToString.ToDecimal * TxtCantidad.Text.ToDecimal
PromocionPorcentaje = dr("Promocion").ToString.ToDecimal
CantMinima = dr("CantidadMinima").ToString.ToEntero
If dr IsNot Nothing Then
TipoPromo = dr("TipoPromocion").ToString.ToEntero
TotalPromocion = dr("PUPromocion").ToString.ToDecimal * TxtCantidad.Text.ToDecimal
PromocionPorcentaje = dr("Promocion").ToString.ToDecimal
CantMinima = dr("CantidadMinima").ToString.ToEntero
End If
End If
If TipoPromo = 1 Then 'Promocion por Importe $
@@ -14252,7 +14272,8 @@ Partial Class Ventas
'AGREGA PS ADICIONAL
If UsuarioActual.Empresa.Funcionalidad(561).ToString = "1" AndAlso GlobalDTPSAdicionales(CvePS, UsuarioActual.CveEmpresa).Rows.Count > 0 AndAlso Not SeActualiza Then
If UsuarioActual.Empresa.Funcionalidad(561).ToString = "1" AndAlso Not UsuarioActual.TienePermisoProceso(284) AndAlso GlobalDTPSAdicionales(CvePS, UsuarioActual.CveEmpresa).Rows.Count > 0 AndAlso Not SeActualiza Then
For Each Dr As DataRow In GlobalDTPSAdicionales(CvePS, UsuarioActual.CveEmpresa).Rows
Dim CvePSAdicional As Integer = Dr("CvePSAdicional").ToString.ToEntero
Dim DrPoliza As DataRow = TmpDT.NewRow()
@@ -14334,6 +14355,8 @@ Partial Class Ventas
TmpDT.Rows.Add(DrPoliza)
End If
Next
End If
Retorno = True
@@ -15346,9 +15369,11 @@ Partial Class Ventas
If ErrorList.Count = 0 AndAlso MovDetalle.Rows.Count > 0 Then
Dim CveMovimientoSalidaPorTraspaso As Integer = -1
Dim CveConceptoSalidaAlmacen As Integer = 3
Dim CveAlmacenParaSalida As Integer = CveAlmacenEntrada
'SALIDA DEFINITIVA DEL SISTEMA
If UsuarioActual.Empresa.Funcionalidad(575) = "1" Then
CveConceptoSalidaAlmacen = 40
CveAlmacenParaSalida = CveAlmacenSalida
''Le damos salida normal
'If ConSalida Then
' GeneroMovimientoAlmacen = GenerarMovimientoAlmacen(ObjInventario, MovDetalle, CveAlmacenSalida, 40, CveMoneda, CveVenta, AplicaMovimientoDetalleEntrada:=AplicaMovimientoDetalleEntrada, MovimientoPrePoliza:=True, ObjConta:=ObjConta) > 0
@@ -15393,7 +15418,7 @@ Partial Class Ventas
End If
If Not OcurrioError Then
GeneroMovimientoAlmacen = GenerarMovimientoAlmacen(ObjInventario, MovDetalle, CveAlmacenEntrada, CveConceptoSalidaAlmacen, CveMoneda, ObjFactura.CveVenta, MovimientoPrePoliza:=True, ObjConta:=ObjConta) > 0
GeneroMovimientoAlmacen = GenerarMovimientoAlmacen(ObjInventario, MovDetalle, CveAlmacenParaSalida, CveConceptoSalidaAlmacen, CveMoneda, ObjFactura.CveVenta, MovimientoPrePoliza:=True, ObjConta:=ObjConta) > 0
If Not GeneroMovimientoAlmacen Then
OcurrioError = True
@@ -16256,7 +16281,7 @@ Partial Class Ventas
Next
'ACTIVA CAMBIO DE CLIENTE - SI NO TIENE NADA FACTURADO
If Not CantidadFacturadaRemision > 0 Then
If Not CantidadFacturadaRemision > 0 AndAlso UsuarioActual.TienePermisoProceso(284) Then
HlCliente.Attributes.Remove("class")
HlCliente.Attributes.Add("class", "Texto")
TxtCodigo.ReadOnly = False
@@ -18232,7 +18257,9 @@ Partial Class Ventas
Exit Sub
End If
If String.IsNullOrEmpty(Vigencia.EsCancelable) Then
sb.Append("<b>No encontrado</b> <br/>")
Alert("No se pudo encontrar el estatus de la factura en el SAT.", TipoMensaje.MsgAdvertencia)
Exit Sub
'sb.Append("<b>No encontrado</b> <br/>")
Else
sb.AppendFormat("<b>{0}</b> <br/>", Vigencia.EsCancelable)
End If
@@ -23510,12 +23537,15 @@ Partial Class Ventas
End If
For Each drow As DataRow In TmpDT.Rows
For Each drow2 As DataRow In DTCvePSCostos.Rows
If drow("CvePS").ToString.ToEntero = drow2("CvePSCargo").ToString.ToEntero Then
drow("Eliminar") = 1
Exit For
End If
Next
If DTCvePSCostos IsNot Nothing Then
For Each drow2 As DataRow In DTCvePSCostos.Rows
If drow("CvePS").ToString.ToEntero = drow2("CvePSCargo").ToString.ToEntero Then
drow("Eliminar") = 1
Exit For
End If
Next
End If
Next
Dim TmpDTView As New DataView(TmpDT)