Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -8081,6 +8081,7 @@ Public Class ClsPaginas
|
||||
Dim tFechaUltimaFluctuacion As Date
|
||||
Dim tImportePago, tImporteVenta As Decimal
|
||||
Dim CveConceptoContableComplementaria As Integer = 207
|
||||
Dim Contabilizable As Boolean = True
|
||||
If PorcentajePago > 1 Then PorcentajePago = 1
|
||||
Pago.CveConceptoPago = If(Pago.CveConceptoPago = -1, 2, Pago.CveConceptoPago) 'si viene en parametro lo toma com primera opcion, sino el 2
|
||||
If VentaActual.CveMoneda <> 1 Then
|
||||
@@ -8097,7 +8098,8 @@ Public Class ClsPaginas
|
||||
TCValuacion = UltimaFluctuacion.TCFluctuacion
|
||||
End If
|
||||
If VentaActual.Fecha < tFechaUltimaFluctuacion Then TCValuacionVenta = TCValuacion
|
||||
If Pago.Fecha < tFechaUltimaFluctuacion Then TCValuacionPago = TCValuacion
|
||||
'si tiene fecha de documento, debe de evaluarse para su tc. y no la fecha de la prepóliza
|
||||
If IIf(Pago.FechaDocumentoRelacionado > MinFecha, Pago.FechaDocumentoRelacionado, Pago.Fecha).ToString.ToDate < tFechaUltimaFluctuacion Then TCValuacionPago = TCValuacion
|
||||
End If
|
||||
End If
|
||||
If VentaActual.CveMoneda = 1 And Pago.CveMonedaPago <> 1 Then 'factura pesos, pago en dolares
|
||||
@@ -8111,11 +8113,34 @@ Public Class ClsPaginas
|
||||
tImportePago = (Pago.ImportePago * TCValuacionPago).RoundSQL
|
||||
End If
|
||||
If VentaActual.CveMoneda > 1 Then ImporteME = Pago.ImportePagoVenta
|
||||
'CONDICION ESPECIAL, PARA ANTICIPOS ESPECIALES, QUE SE EMITE LA VENTA, PERO NO SE CONTABILIZA, EL TRATAMIENTO SE LLEVA POR EL ANTICIPO
|
||||
If VentaActual.TipoDocto = "Ant" AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119, 158) Then
|
||||
Pago.AplicaTraslado = False
|
||||
Dim IdCtaContable As Integer = VentaActual.IdCtaContableClienteAnticipo
|
||||
If VentaActual.CveMoneda = 2 Then IdCtaContable = VentaActual.IdCtaContableClienteAnticipoExtranjera
|
||||
Contabilizable = False
|
||||
|
||||
If Pago.CveMonedaPago > 1 Then
|
||||
'Agregamos la Extranjera
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePago, Pago.ImportePago, 295, Pago.Referencia, Concepto, VentaActual.IdCtaContableClienteAnticipoExtranjera, CveVenta:=Pago.CveVentaAmortizacion, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, ImporteME:=Pago.ImportePago, TipoCambio:=TCValuacionPago, CveSubProyecto:=VentaActual.CveSubProyecto) Then ErrorMovtos = True
|
||||
ImporteMN = (Pago.ImportePago * TCValuacionPago - Pago.ImportePago).RoundSQL
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePago, ImporteMN, 227, Pago.Referencia, Concepto, VentaActual.IdCtaContableClienteAnticipoComplementaria, CveVenta:=Pago.CveVentaAmortizacion, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, ImporteME:=Pago.ImportePago, TipoCambio:=TCValuacionPago, CveSubProyecto:=VentaActual.CveSubProyecto) Then ErrorMovtos = True
|
||||
Else
|
||||
'Agregamos Nacional
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePago, Pago.ImportePago, 3, Pago.Referencia, Concepto, VentaActual.IdCtaContableClienteAnticipo, CveVenta:=Pago.CveVentaAmortizacion, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambioPago:=Pago.TCPago) Then ErrorMovtos = True
|
||||
End If
|
||||
|
||||
If Not ErrorMovtos AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, Pago.ImportePago, 95, VentaActual.SerieFolio, VentaActual.SerieFolio, IdCtaContable, CveIE:=Pago.CveIE, CveVenta:=VentaActual.CveVenta, CveSubProyecto:=VentaActual.CveSubProyecto, CveCliente:=VentaActual.CveCliente, TipoCambio:=TCValuacionVenta, TipoCambioPago:=Pago.TCPago, PorcentajeImpuesto:=VentaActual.PorcentajeIVA, Contabilizable:=False) Then
|
||||
ErrorMovtos = True
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
'movimiento de pago cliente
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePagoVenta, Pago.ImportePagoVenta, Pago.CveConceptoPago, VentaActual.SerieFolio, Concepto, VentaActual.IdCtaContableCliente, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, CveVentaAmortizacion:=Pago.CveVentaAmortizacion, TipoCambio:=TCValuacionVenta, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto) Then ErrorMovtos = True
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePagoVenta, Pago.ImportePagoVenta, Pago.CveConceptoPago, VentaActual.SerieFolio, Concepto, VentaActual.IdCtaContableCliente, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, CveVentaAmortizacion:=Pago.CveVentaAmortizacion, TipoCambio:=TCValuacionVenta, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto, Contabilizable:=Contabilizable) Then ErrorMovtos = True
|
||||
'movimiento de pago cliente Complementaria
|
||||
If Not ErrorMovtos AndAlso VentaActual.CveMoneda > 1 Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePagoVenta, (ImporteME * TCValuacionVenta - ImporteME).RoundSQL, CveConceptoContableComplementaria, VentaActual.SerieFolio, Concepto, VentaActual.IdCtaContableClienteComplementaria, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, CveVentaAmortizacion:=Pago.CveVentaAmortizacion, TipoCambio:=TCValuacionVenta, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto) Then ErrorMovtos = True
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePagoVenta, (ImporteME * TCValuacionVenta - ImporteME).RoundSQL, CveConceptoContableComplementaria, VentaActual.SerieFolio, Concepto, VentaActual.IdCtaContableClienteComplementaria, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, CveVentaAmortizacion:=Pago.CveVentaAmortizacion, TipoCambio:=TCValuacionVenta, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto, Contabilizable:=Contabilizable) Then ErrorMovtos = True
|
||||
End If
|
||||
If Pago.AplicaTraslado Then
|
||||
'si tiene iva y su proporcion
|
||||
@@ -8281,6 +8306,7 @@ Public Class ClsPaginas
|
||||
Public Property CveVenta As Integer = -1
|
||||
Public Property CveCliente As Integer
|
||||
Public Property CveMoneda As Integer
|
||||
Public Property TipoDocto As String
|
||||
Public Property Fecha As Date
|
||||
Public Property SerieFolio As String = ""
|
||||
Public Property ClienteNombre As String = ""
|
||||
|
||||
@@ -301,6 +301,40 @@ Namespace Modelos
|
||||
|
||||
|
||||
#Region " OBJETOS Ventas"
|
||||
<Serializable>
|
||||
Public Class VentaDescuentos
|
||||
Public Consec As Integer
|
||||
Public ImporteDescuento As Decimal = 0
|
||||
Public CvePromocionDetalle As Integer = -1
|
||||
Public PU As Decimal = 0
|
||||
Public EsPUModificado As Boolean = False
|
||||
Public ImporteProntoPago As Decimal = 0
|
||||
Public NombrePromo As String = ""
|
||||
Public CveMarca As Integer = -1
|
||||
Public ObsDescuento As String = ""
|
||||
End Class
|
||||
<Serializable>
|
||||
Public Class VentasBonificaciones
|
||||
Public CveVentaRNCCargo As Integer = -1
|
||||
Public CveVentaBonificacion As Integer = -1
|
||||
Public ImporteBonificacion As Decimal = 0
|
||||
Public IVABonificacion As Decimal = 0
|
||||
End Class
|
||||
<Serializable>
|
||||
Public Class MensajeProntoPago
|
||||
Public Property ObjFacturaProntoPago As Modelos.Factura
|
||||
Public Property Mensaje As Modelos.Factura.MMensajeFactura
|
||||
End Class
|
||||
<Serializable>
|
||||
Public Class MAnticipoRelacionado
|
||||
Public Property CveVenta As Integer
|
||||
Public Property FolioFiscal As String
|
||||
End Class
|
||||
<Serializable>
|
||||
Public Class MVentaDetalleCotizacion
|
||||
Public Property CveVentaDetalle As Integer
|
||||
Public Property Cantidad As Decimal
|
||||
End Class
|
||||
Public Enum TipoMensajeRespuesta
|
||||
TextoLimpio = 0
|
||||
HTML = 1
|
||||
|
||||
@@ -1711,7 +1711,7 @@ Public Class E141 : Implements IHttpHandler
|
||||
Dim DtPS As DataTable = Nothing
|
||||
Using ObjPS As New ClsProductosServicios
|
||||
'OBTERNER PRECIOS DE PUBLICO GENERAL
|
||||
If ObjPS.GetProductosModificados(CveEmpresa, 44, If(Todos, -1, 1)) Then
|
||||
If ObjPS.GetProductosModificados(CveEmpresa, 44, If(Todos, -1, 26)) Then
|
||||
DtPS = ObjPS.DtResultados.Copy()
|
||||
End If
|
||||
End Using
|
||||
|
||||
@@ -1042,8 +1042,11 @@ Partial Class ContabilidadC_RegPrePolizaS
|
||||
If tFolio.ToEntero = 0 Then tFolio = SiguienteFolioBancos(gvr.DataKey("ContadoCuenta").ToEntero, gvr.DataKey("ContadoTipoTransaccion").ToEntero)
|
||||
|
||||
|
||||
Dim tCveMoneda As Integer = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveCuenta:=DdlCuenta.SelectedValue.ToEntero).FiltroPrimeroValor("CveMoneda").ToEntero
|
||||
|
||||
|
||||
CveIE = ObjIE.AddBancos_IE(gvr.DataKey("ContadoCuenta").ToEntero, gvr.DataKey("ContadoTipoTransaccion").ToEntero, TxtFechaDocumento.Text, tFolio,
|
||||
gvr.DataKey("ContadoBeneficiario"), gvr.DataKey("ContadoImporte").ToDecimal, CveMoneda, 0, gvr.DataKey("ContadoObservaciones"), "",
|
||||
gvr.DataKey("ContadoBeneficiario"), gvr.DataKey("ContadoImporte").ToDecimal, tCveMoneda, 0, gvr.DataKey("ContadoObservaciones"), "",
|
||||
False, False, 0, CvePrePolizaInsertada, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
If CveIE < 0 Then
|
||||
MsgError = "No se pudo registrar movimiento bancario"
|
||||
|
||||
@@ -63,7 +63,8 @@
|
||||
<asp:ListItem Text="GlobalSATGenerales" Value="GlobalSATGenerales"></asp:ListItem>
|
||||
<asp:ListItem Text="GlobalDTActivoFijos" Value="GlobalDTActivoFijos"></asp:ListItem>
|
||||
<asp:ListItem Text="GlobalDTVendedoresOld" Value="GlobalDTVendedoresOld"></asp:ListItem>
|
||||
<asp:ListItem Text="GlobalDTAC" Value="GlobalDTAC"></asp:ListItem>
|
||||
<asp:ListItem Text="GlobalDTAC" Value="GlobalDTAC"></asp:ListItem>
|
||||
<asp:ListItem Text="GlobalDTSATUsosCFDI" Value="GlobalDTSATUsosCFDI"></asp:ListItem>
|
||||
|
||||
</asp:DropDownList>
|
||||
|
||||
|
||||
@@ -106,12 +106,16 @@ Partial Class Sistemas_CatSesiones
|
||||
ElseIf DdlVariable.SelectedItem.Value = "GlobalDTVendedoresOld" Then
|
||||
CargaActivoFijos()
|
||||
ElseIf DdlVariable.SelectedItem.Value = "GlobalDTAC" Then
|
||||
cargaAC()
|
||||
cargaAC()
|
||||
ElseIf DdlVariable.SelectedItem.Value = "GlobalDTSATUsosCFDI" Then
|
||||
CargaUsosCFDI()
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CargaUsosCFDI()
|
||||
HttpContext.Current.Application("GlobalDTSATUsosCFDI") = Nothing
|
||||
End Sub
|
||||
Private Sub CargaGlobalDTVendedoresOld()
|
||||
Dim AppNombre As String = $"GlobalDTVendedores-{-1}"
|
||||
If HttpContext.Current.Application(AppNombre) Is Nothing Then
|
||||
|
||||
@@ -36,6 +36,14 @@ Partial Class Ventas_ClientesAbonar
|
||||
ViewState("CveMonedaFiltro") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property FechaIngreso As Date
|
||||
Get
|
||||
Return ViewState("FechaIngreso").ToString.ToDate
|
||||
End Get
|
||||
Set(value As Date)
|
||||
ViewState("FechaIngreso") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property CveSubProyecto As Integer
|
||||
Get
|
||||
Return ViewState("CveSubProyecto").ToString.ToEntero
|
||||
@@ -622,7 +630,7 @@ Partial Class Ventas_ClientesAbonar
|
||||
e.Row.FCRangeValidator("RVComision").MaximumValue = e.Row.DBCampo("Saldo")
|
||||
End If
|
||||
|
||||
If e.Row.DBCampo("DescuentoProntoPago").ToDecimal() > 0 AndAlso e.Row.DBCampo("DiasVencidos").ToEntero() <= 0 Then
|
||||
If e.Row.DBCampo("DescuentoProntoPago").ToDecimal() > 0 AndAlso e.Row.DBCampo("DiasVencidos").ToEntero() <= 5 Then
|
||||
e.Row.FCCheckBox("ChkGenerarNC").Visible = True
|
||||
e.Row.FCCheckBox("ChkGenerarNC").Attributes.Add("onclick", String.Format("FnSuma(this,{0},{1},{5}); FnCambia({2},this,{1},0,{3},{4}); FnEditarImporte({2}, {0});", e.Row.FCTextBox("TxtAbonar").ClientID, e.Row.DBCampo("Saldo").ToDecimal - e.Row.DBCampo("DescuentoProntoPago").ToDecimal, e.Row.FCCheckBox("ChkGenerarNC").ClientID, CveMonedaFiltro, moneda, e.Row.DBCampo("CveVenta")))
|
||||
End If
|
||||
@@ -855,7 +863,7 @@ Partial Class Ventas_ClientesAbonar
|
||||
End If
|
||||
CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, TxtFolio.Text.Trim, TxtAboneA.Text.Trim, TxtImporte.Text.ToDecimal, GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", "CveCuenta = " & DdlCuenta.SelectedValue).ToEntero, TipoCambio, TxtObservaciones.Text.Trim, "", True, True, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCuentaDeposito:=CveCuentaDeposito, CveProveedorIntermediario:=CveProvIntermediario)
|
||||
Else
|
||||
If RblTipoPago.SelectedValue.Contiene("3") Then
|
||||
If RblTipoPago.SelectedValue.Contiene("3") Then 'ixc
|
||||
CveIE = DdlIngreso.SelectedValue.ToEntero
|
||||
If CveMonedaPago = 2 And Not ChkPagarPesos.Checked Then CveMoneda = 2
|
||||
If ChkPagarDolares.Checked Then CveMoneda = 2
|
||||
@@ -957,6 +965,7 @@ Partial Class Ventas_ClientesAbonar
|
||||
VentaActual.Fecha = gvr.DataKey("Fecha").ToDate
|
||||
VentaActual.CveCliente = gvr.DataKey("CveCliente").ToEntero
|
||||
VentaActual.CveMoneda = gvr.DataKey("CveMoneda").ToEntero
|
||||
VentaActual.TipoDocto = gvr.DataKey("TipoDocto")
|
||||
VentaActual.SerieFolio = gvr.DataKey("SerieFolio")
|
||||
VentaActual.ClienteNombre = NombreComercial
|
||||
VentaActual.TC = gvr.DataKey("TipoCambio").ToDecimal
|
||||
@@ -981,34 +990,37 @@ Partial Class Ventas_ClientesAbonar
|
||||
Pago.ImportePagoVenta = gvr.FCTextBox("TxtAbonar").Text.ToDecimal
|
||||
Pago.Referencia = TxtFolio.Text
|
||||
|
||||
If RblTipoPago.SelectedValue = "3" Then Pago.TipoPago = "I"
|
||||
If RblTipoPago.SelectedValue = "3" Then
|
||||
Pago.TipoPago = "I"
|
||||
Pago.FechaDocumentoRelacionado = FechaIngreso
|
||||
End If
|
||||
|
||||
'Tipos de cambio
|
||||
If Pago.CveMonedaPago = 1 AndAlso VentaActual.CveMoneda = 2 Then 'Si la venta viene en Dolares y se va a pagar en Pesos
|
||||
Pago.TCPago = TxtTC.Text.ToDecimal
|
||||
ElseIf Pago.CveMonedaPago = 2 AndAlso VentaActual.CveMoneda = 2 Then 'Si la venta viene en Dolares y se va a pagar en DOLARES
|
||||
ElseIf Pago.CveMonedaPago = 2 AndAlso VentaActual.CveMoneda = 2 Then 'Si la venta viene en Dolares y se va a pagar en DOLARES
|
||||
Pago.TCPago = IIf(TxtTCDolaresDolares.Visible, TxtTCDolaresDolares.Text.ToDecimal, TxtTCDolares.Text.ToDecimal)
|
||||
ElseIf Pago.CveMonedaPago = 2 AndAlso VentaActual.CveMoneda = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES
|
||||
ElseIf Pago.CveMonedaPago = 2 AndAlso VentaActual.CveMoneda = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES
|
||||
Pago.TCPago = TxtTCDolares.Text.ToDecimal
|
||||
End If
|
||||
tipoCambioPago = Pago.TCPago
|
||||
|
||||
If gvr.FCTextBox("TxtComision").Text.ToDecimal <> 0 Then Pago.OtroGastoIngreso = gvr.FCTextBox("TxtComision").Text.ToDecimal
|
||||
|
||||
If gvr.DataKey("TipoDocto") = "Ant" AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119, 158) Then
|
||||
EsAnticipoEspecial = True
|
||||
Pago.AplicaTraslado = False
|
||||
Dim IdCtaContable As Integer = If(EsAnticipoEspecial, IdCtaAnticipo, IdCuentaCliente)
|
||||
If VentaActual.CveMoneda = 2 Then IdCtaContable = If(EsAnticipoEspecial, IdCtaContMonedaExtranjeraAnticipo, IdCtaContMonedaExtranjera)
|
||||
'If gvr.DataKey("TipoDocto") = "Ant" AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119, 158) Then
|
||||
' EsAnticipoEspecial = True
|
||||
' Pago.AplicaTraslado = False
|
||||
' Dim IdCtaContable As Integer = If(EsAnticipoEspecial, IdCtaAnticipo, IdCuentaCliente)
|
||||
' If VentaActual.CveMoneda = 2 Then IdCtaContable = If(EsAnticipoEspecial, IdCtaContMonedaExtranjeraAnticipo, IdCtaContMonedaExtranjera)
|
||||
|
||||
If ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePago, Pago.ImportePago, 3, VentaActual.SerieFolio, VentaActual.SerieFolio, IdCtaContable, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveSubProyecto:=CveSubProyectoContabilizar, CveCliente:=ViewState("CveCliente").ToString.ToEntero, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=VentaActual.PorcentajeIVA, Contabilizable:=False) Then
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, Pago.ImportePago, 95, VentaActual.SerieFolio, VentaActual.SerieFolio, IdCtaContable, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveSubProyecto:=CveSubProyectoContabilizar, CveCliente:=ViewState("CveCliente").ToString.ToEntero, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=VentaActual.PorcentajeIVA, Contabilizable:=False) Then
|
||||
MsgError = "No se pudo insertar la póliza"
|
||||
End If
|
||||
Else
|
||||
MsgError = "No se pudo insertar la póliza"
|
||||
End If
|
||||
End If
|
||||
' If ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePago, Pago.ImportePago, 3, VentaActual.SerieFolio, VentaActual.SerieFolio, IdCtaContable, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveSubProyecto:=CveSubProyectoContabilizar, CveCliente:=ViewState("CveCliente").ToString.ToEntero, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=VentaActual.PorcentajeIVA, Contabilizable:=False) Then
|
||||
' If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, Pago.ImportePago, 95, VentaActual.SerieFolio, VentaActual.SerieFolio, IdCtaContable, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveSubProyecto:=CveSubProyectoContabilizar, CveCliente:=ViewState("CveCliente").ToString.ToEntero, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=VentaActual.PorcentajeIVA, Contabilizable:=False) Then
|
||||
' MsgError = "No se pudo insertar la póliza"
|
||||
' End If
|
||||
' Else
|
||||
' MsgError = "No se pudo insertar la póliza"
|
||||
' End If
|
||||
'End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(590) = "1" AndAlso MsgError = "" Then '' si es empresa agrícola
|
||||
Dim FluctuacionAnticipo As Decimal = 0
|
||||
@@ -2714,6 +2726,8 @@ Partial Class Ventas_ClientesAbonar
|
||||
Dim Deudores As New ClsMovimientos
|
||||
If Deudores.GetIngresosSaldosDetalle(CveCliente, -1, UsuarioActual.CveEmpresa) Then
|
||||
HdnIngresoImporte.Value = Deudores.DtResultados.FiltroPrimeroValor("Saldo", String.Format("CveIE = {0}", DdlIngreso.SelectedValue))
|
||||
TxtTCDolares.Text = Deudores.DtResultados.FiltroPrimeroValor("TipoCambio", String.Format("CveIE = {0}", DdlIngreso.SelectedValue))
|
||||
FechaIngreso = Deudores.DtResultados.FiltroPrimeroValor("FechaDocumento", String.Format("CveIE = {0}", DdlIngreso.SelectedValue))
|
||||
End If
|
||||
Deudores.Dispose()
|
||||
End If
|
||||
|
||||
@@ -2623,6 +2623,10 @@ Partial Class PV
|
||||
DdlAlmacenAsignado.SelectedValueExist(GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto = {DdlSubProyectoDatos.SelectedValue}").ToString.ToEntero)
|
||||
End If
|
||||
|
||||
If ChkServicioDomicilio.Checked Then
|
||||
PreparaServicioDomicilio()
|
||||
End If
|
||||
|
||||
UpINV.Update()
|
||||
End Sub
|
||||
Private Sub CargaFormaEntrega()
|
||||
|
||||
@@ -600,10 +600,10 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
|
||||
|
||||
//
|
||||
|
||||
if (e.Row.DBCampo("CveEstatusFactura").ToString().ToEntero() == 23)
|
||||
{
|
||||
e.Row.FCLinkButton("LnkValidarRefac").Visible = false;
|
||||
}
|
||||
//if (e.Row.DBCampo("CveEstatusFactura").ToString().ToEntero() == 23)
|
||||
//{
|
||||
// e.Row.FCLinkButton("LnkValidarRefac").Visible = false;
|
||||
//}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1724,6 +1724,7 @@
|
||||
|
||||
<asp:UpdatePanel ID="UpINV" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:HiddenField ID="HdnCargarInventario" runat="server" ClientIDMode="Static" Value="True"/>
|
||||
<asp:Button ID="BtnCargarInventario" runat="server" ClientIDMode="Static" Text="" Style="display: none;" OnClick="BtnCargarInventario_Click" />
|
||||
<div class="portlet box purpleAlmacen" id="DivSalidaAlmacen" runat="server">
|
||||
<div class="portlet-title">
|
||||
@@ -9501,9 +9502,11 @@
|
||||
step: 30
|
||||
});
|
||||
|
||||
$("#TabAlmacen_tab .ajax__tab_inner").click(function () {
|
||||
CargaMovimientosInventario();
|
||||
});
|
||||
if(HdnCargarInventario.value == 'True'){
|
||||
$("#TabAlmacen_tab .ajax__tab_inner").click(function () {
|
||||
CargaMovimientosInventario();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -348,11 +348,11 @@ Partial Class Ventas
|
||||
ViewState("DTRemisiones") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property ListaDescuentos As List(Of Descuentos)
|
||||
Private Property ListaDescuentos As List(Of Modelos.VentaDescuentos)
|
||||
Get
|
||||
Return If(IsNothing(ViewState("ListaDescuentos")), Nothing, CType(ViewState("ListaDescuentos"), List(Of Descuentos)))
|
||||
Return If(IsNothing(ViewState("ListaDescuentos")), Nothing, CType(ViewState("ListaDescuentos"), List(Of Modelos.VentaDescuentos)))
|
||||
End Get
|
||||
Set(value As List(Of Descuentos))
|
||||
Set(value As List(Of Modelos.VentaDescuentos))
|
||||
ViewState("ListaDescuentos") = value
|
||||
End Set
|
||||
End Property
|
||||
@@ -1402,11 +1402,11 @@ Partial Class Ventas
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property ListaAnticiposAplicados As List(Of MAnticipoRelacionado)
|
||||
Private Property ListaAnticiposAplicados As List(Of Modelos.MAnticipoRelacionado)
|
||||
Get
|
||||
Return If(IsNothing(ViewState("ListaAnticiposAplicados")), Nothing, CType(ViewState("ListaAnticiposAplicados"), List(Of MAnticipoRelacionado)))
|
||||
Return If(IsNothing(ViewState("ListaAnticiposAplicados")), Nothing, CType(ViewState("ListaAnticiposAplicados"), List(Of Modelos.MAnticipoRelacionado)))
|
||||
End Get
|
||||
Set(value As List(Of MAnticipoRelacionado))
|
||||
Set(value As List(Of Modelos.MAnticipoRelacionado))
|
||||
ViewState("ListaAnticiposAplicados") = value
|
||||
End Set
|
||||
End Property
|
||||
@@ -2307,7 +2307,6 @@ Partial Class Ventas
|
||||
ViewState("CveContratoTipo") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
'#Region "AuxiliarConta"
|
||||
@@ -2412,7 +2411,7 @@ Partial Class Ventas
|
||||
RemisionesLista = New List(Of Integer)
|
||||
Pedidos2Lista = New List(Of Integer)
|
||||
CotizacionesLista = New List(Of Integer)
|
||||
ListaDescuentos = New List(Of Descuentos)
|
||||
ListaDescuentos = New List(Of Modelos.VentaDescuentos)
|
||||
|
||||
CuentasContablesInvalidas = New StringBuilder
|
||||
CvePrePoliza = 0
|
||||
@@ -2847,6 +2846,7 @@ Partial Class Ventas
|
||||
'SI ES VENTA NUEVA, NO RECARGAR TAB DE ALMACEN
|
||||
If CveVenta <= 0 Then
|
||||
'REMOVER EVENTO PARA RECARGAR ALMACEN
|
||||
HdnCargarInventario.Value = "False"
|
||||
spanAlmacen.Attributes.Remove("onclick")
|
||||
Tab.ActiveTabIndex = 1
|
||||
Updatetabs.Update()
|
||||
@@ -5154,9 +5154,9 @@ Partial Class Ventas
|
||||
'RELACIONAR ANTICIPOS APLICADOS
|
||||
If DbRowVenta("CveTipoRelacion").ToString().ToEntero() = 7 AndAlso DtAntRelacionados IsNot Nothing AndAlso DtAntRelacionados.Rows.Count > 0 Then
|
||||
DdlTipoRelacionAnticipo.SelectedValueExist(7)
|
||||
ListaAnticiposAplicados = New List(Of MAnticipoRelacionado)()
|
||||
ListaAnticiposAplicados = New List(Of Modelos.MAnticipoRelacionado)()
|
||||
For Each RowAnt As DataRow In DtAntRelacionados.Rows
|
||||
ListaAnticiposAplicados.Add(New MAnticipoRelacionado() With {.CveVenta = RowAnt("CveVentaRelacionada").ToString().ToEntero(), .FolioFiscal = RowAnt("FolioFiscal").ToString()})
|
||||
ListaAnticiposAplicados.Add(New Modelos.MAnticipoRelacionado() With {.CveVenta = RowAnt("CveVentaRelacionada").ToString().ToEntero(), .FolioFiscal = RowAnt("FolioFiscal").ToString()})
|
||||
Next
|
||||
Else
|
||||
HdnFolioFiscalNC.Value = DbRowVenta("FolioFiscalPadre").ToString()
|
||||
@@ -6127,10 +6127,17 @@ Partial Class Ventas
|
||||
DdlSucursalUsoCFDI.DataSource = GlobalDTSATUsosCFDI(UsuarioActual.Empresa.EsPersonaFisica, RegimenFiscalReceptor:=RegimenFiscalCliente)
|
||||
End If
|
||||
|
||||
|
||||
DdlUsoCFDI.DataBind()
|
||||
DdlSucursalUsoCFDI.DataBind()
|
||||
|
||||
If Not UsuarioActual.CveEmpresa.Contiene(76, 15) Then
|
||||
If DdlUsoCFDI.DataSource IsNot Nothing Then
|
||||
If DdlUsoCFDI.Items.FindByValue("25") IsNot Nothing Then
|
||||
DdlUsoCFDI.Items.Remove(DdlUsoCFDI.Items.FindByValue("25"))
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
DdlUsoCFDI.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
DdlSucursalUsoCFDI.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
|
||||
@@ -8105,7 +8112,7 @@ Partial Class Ventas
|
||||
Protected Sub GvPS_RowUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvPS.RowUpdating
|
||||
'Dim TipoDescuento As Integer
|
||||
Dim Cantidad, PU, CantidadInventario As Decimal
|
||||
Dim ObjDescuento As New Descuentos
|
||||
Dim ObjDescuento As New Modelos.VentaDescuentos
|
||||
Dim CuentaPredial As String
|
||||
Cantidad = GvPS.Rows(e.RowIndex).FCTextBox("TxtCantidad").Text.ToDecimal
|
||||
PU = (GvPS.Rows(e.RowIndex).FCTextBox("TxtPrecio").Text.ToDecimal).RoundSQL(6)
|
||||
@@ -11834,7 +11841,7 @@ Partial Class Ventas
|
||||
' ObjFactura.Timbre.CFDIRelacionados.TipoRelacionTexto = "07-CFDI por aplicación de anticipo"
|
||||
|
||||
' If ListaAnticiposAplicados IsNot Nothing Then
|
||||
' For Each Ant As MAnticipoRelacionado In ListaAnticiposAplicados
|
||||
' For Each Ant As Modelos.MAnticipoRelacionado In ListaAnticiposAplicados
|
||||
' ObjFactura.Timbre.CFDIRelacionados.UUID.Add(Ant.FolioFiscal)
|
||||
' Next
|
||||
' End If
|
||||
@@ -12407,7 +12414,7 @@ Partial Class Ventas
|
||||
Next
|
||||
Else
|
||||
If ListaAnticiposAplicados IsNot Nothing AndAlso ListaAnticiposAplicados.Count > 0 Then
|
||||
For Each Ant As MAnticipoRelacionado In ListaAnticiposAplicados
|
||||
For Each Ant As Modelos.MAnticipoRelacionado In ListaAnticiposAplicados
|
||||
Timbre.CFDIRelacionados.UUID.Add(Ant.FolioFiscal)
|
||||
Next
|
||||
Else
|
||||
@@ -13152,7 +13159,7 @@ Partial Class Ventas
|
||||
'SI TIENE UN ANTICIPO TAMBIEN DEBE RELACIONARLO
|
||||
If CveAnticipoPadre > 0 Then
|
||||
If ListaAnticiposAplicados IsNot Nothing Then
|
||||
For Each Ant As MAnticipoRelacionado In ListaAnticiposAplicados
|
||||
For Each Ant As Modelos.MAnticipoRelacionado In ListaAnticiposAplicados
|
||||
If Not ObjVentas.AddVentasRelacionadas(ObjVentas.CveVenta, Ant.CveVenta) Then
|
||||
ErrorList.Add("Ocurrió un error al relacionar las ventas entre si comuníquese a Soporte Técnico")
|
||||
End If
|
||||
@@ -14067,10 +14074,14 @@ Partial Class Ventas
|
||||
CveIEAnticipo = row2.DataKey("CveIE").ToString().ToEntero()
|
||||
importeMovimiento = row2.FCTextBox("TxtAnticipo" & row2.RowIndex).Text.ToDecimal '- ((row2.FCTextBox("TxtAnticipo" & row2.RowIndex).Text.ToDecimal / row2.DataKey("TotalAnticipo").ToDecimal) * row2.DataKey("IVAAnticipo").ToDecimal)
|
||||
Dim ImporteAnticipo As Decimal = importeMovimiento
|
||||
Dim CveMonedaAnticipo As Integer = row2.DataKey("CveMoneda").ToString().ToEntero()
|
||||
|
||||
If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}"
|
||||
|
||||
If DdlTipoAmortizacionAnticipo.SelectedValue = "2" Then ImporteAnticipo = row2.FCTextBox("TxtAnticipo" & row2.RowIndex).Text.ToDecimal / row2.DataKey("TotalAnticipo").ToDecimal * row2.DataKey("SubTotalAnticipo").ToDecimal
|
||||
|
||||
Dim Importe11MX As Decimal = ImporteAnticipo
|
||||
|
||||
IdCtaContable = IdCtaContAnticipos
|
||||
CveSubProyectoContabilizar = CveSubProyectoVenta
|
||||
|
||||
@@ -14085,11 +14096,16 @@ Partial Class Ventas
|
||||
tipoCambioAnticipo = GlobalTipoCambio(row2.DataKey("Fecha").ToString().ToDate.AddDays(-1)).ToDecimal
|
||||
End If
|
||||
|
||||
|
||||
If ObjFactura.CveMoneda = 2 AndAlso CveMonedaAnticipo = 1 Then
|
||||
Importe11MX = Importe11MX * tipoCambio
|
||||
End If
|
||||
|
||||
If row2.DataKey("CveMoneda").ToString.ToEntero = 2 Then
|
||||
IdCtaContable = IdCtaContAnticiposExtranjera
|
||||
End If
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, False, ImporteAnticipo, Referencia, 11, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=row2.DataKey("CveVenta").ToEntero(), CveVentaAmortizacion:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=ImporteAnticipo, ImporteME:=If(tipoCambioAnticipo = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=SeContabiliza, TipoCambio:=tipoCambioAnticipo) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, False, Importe11MX, Referencia, 11, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=row2.DataKey("CveVenta").ToEntero(), CveVentaAmortizacion:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=Importe11MX, ImporteME:=If(tipoCambioAnticipo = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=SeContabiliza, TipoCambio:=tipoCambioAnticipo) Then
|
||||
ErrorPrepoliza = True
|
||||
Exit For
|
||||
End If
|
||||
@@ -14111,7 +14127,7 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
Else
|
||||
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, False, ImporteAnticipo, Referencia, 11, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=row2.DataKey("CveVenta").ToEntero(), CveVentaAmortizacion:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=ImporteAnticipo, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=SeContabiliza) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, False, Importe11MX, Referencia, 11, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=row2.DataKey("CveVenta").ToEntero(), CveVentaAmortizacion:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=Importe11MX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=SeContabiliza) Then
|
||||
ErrorPrepoliza = True
|
||||
Exit For
|
||||
Else
|
||||
@@ -16682,7 +16698,7 @@ Partial Class Ventas
|
||||
If ListaAnticiposAplicados IsNot Nothing Then
|
||||
ListaAnticiposAplicados.Clear()
|
||||
Else
|
||||
ListaAnticiposAplicados = New List(Of MAnticipoRelacionado)
|
||||
ListaAnticiposAplicados = New List(Of Modelos.MAnticipoRelacionado)
|
||||
End If
|
||||
|
||||
HdnIVACalculado.Value = HdnIVAOriginal.Value
|
||||
@@ -16690,7 +16706,7 @@ Partial Class Ventas
|
||||
If gvr.FCCheckBox("Chk" & gvr.RowIndex) IsNot Nothing AndAlso gvr.FCCheckBox("Chk" & gvr.RowIndex).Checked AndAlso gvr.DataKey("CveConceptoContable").ToEntero().Contiene(3) Then
|
||||
Amortizacion += gvr.FCTextBox(String.Format("TxtAnticipo{0}", gvr.RowIndex)).Text.ToDecimal ' - ((gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.DataKey("TotalAnticipo").ToDecimal) * gvr.DataKey("IVAAnticipo").ToDecimal)
|
||||
HdnIVACalculado.Value = (HdnIVACalculado.Value.ToDouble - ((gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.DataKey("TotalAnticipo").ToDecimal) * gvr.DataKey("IVAAnticipo").ToDecimal)).FormatoNumero(2)
|
||||
ListaAnticiposAplicados.Add(New MAnticipoRelacionado() With {.CveVenta = gvr.DataKey("CveVenta").ToEntero(), .FolioFiscal = gvr.DataKey("FolioFiscal")})
|
||||
ListaAnticiposAplicados.Add(New Modelos.MAnticipoRelacionado() With {.CveVenta = gvr.DataKey("CveVenta").ToEntero(), .FolioFiscal = gvr.DataKey("FolioFiscal")})
|
||||
'HdnFolioFiscalNC.Value = gvr.DataKey("FolioFiscal")
|
||||
|
||||
'CvePSAmortizacion = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePS", "CveConceptoContable = 11").ToEntero()
|
||||
@@ -18506,7 +18522,7 @@ Partial Class Ventas
|
||||
Return True
|
||||
|
||||
End Function
|
||||
Private Function CalcularDescuentos(CvePS As Integer, Cantidad As Decimal, PU As Decimal) As Descuentos
|
||||
Private Function CalcularDescuentos(CvePS As Integer, Cantidad As Decimal, PU As Decimal) As Modelos.VentaDescuentos
|
||||
Dim Descuento As Decimal = HdnDescuento.Value.ToDecimal
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(572) = "1" AndAlso Not TbDescuentosRNC.Visible Then
|
||||
@@ -18534,7 +18550,7 @@ Partial Class Ventas
|
||||
Dim CvePromocionDetalle As Integer = 0
|
||||
Dim IncluyeImpuestos As Boolean = False
|
||||
Dim TipoAplicacion As Integer = 1 ' 1 - descuento, 2 en PU
|
||||
Dim ObjDescuento As New Descuentos
|
||||
Dim ObjDescuento As New Modelos.VentaDescuentos
|
||||
|
||||
If DdlSubProyectoDatos.SelectedValue = "11842" Then '' E141, el subproyecto: Franquicia, no proceden las promociones
|
||||
Return ObjDescuento
|
||||
@@ -18749,7 +18765,7 @@ Partial Class Ventas
|
||||
Dim Cantidad As Decimal = TxtCantidad.Text.ToDecimal
|
||||
Dim PU As Decimal = If(CvePSAmortizacion > 0, TxtPrecio.Text.Trim.ToDecimal * -1, TxtPrecio.Text.Trim.ToDecimal)
|
||||
|
||||
Dim ObjDescuento As Descuentos = CalcularDescuentos(CvePS, Cantidad, PU)
|
||||
Dim ObjDescuento As Modelos.VentaDescuentos = CalcularDescuentos(CvePS, Cantidad, PU)
|
||||
If ObjDescuento.EsPUModificado Then
|
||||
PU = ObjDescuento.PU
|
||||
End If
|
||||
@@ -18847,7 +18863,7 @@ Partial Class Ventas
|
||||
|
||||
Dim CvePS As Integer = DdlPSPyME.SelectedValue.ToEntero()
|
||||
|
||||
Dim Descuento As Descuentos = CalcularDescuentos(CvePS, Cantidad, PU)
|
||||
Dim Descuento As Modelos.VentaDescuentos = CalcularDescuentos(CvePS, Cantidad, PU)
|
||||
|
||||
AgregarProductoServicio(Cantidad, DdlUMPyME.SelectedValue.ToEntero(), DdlUMPyME.SelectedItem.Text, DdlClasificacionPyME.SelectedValue.ToEntero(), DdlClasificacionPyME.SelectedItem.Text,
|
||||
CvePS, DdlPSPyME.SelectedText, TxtObsPyME.Text, PU, Descuento.ImporteDescuento, CveProyecto, Proyecto, CveSubProyecto, SubProyecto)
|
||||
@@ -18947,7 +18963,7 @@ Partial Class Ventas
|
||||
Optional EntregaDirecta As Integer = 0, Optional CveContratoDetalle As Integer = 0, Optional CveVentaDetalle As Integer = 0, Optional CveMovimientoDetallePedido As Integer = 0,
|
||||
Optional CveOrdenCompraDetalle As Integer = 0, Optional CveVentaDetalleRemision As Integer = 0, Optional CveVentaDetalleCotizacion As Integer = 0, Optional CuentaPredial As String = "",
|
||||
Optional RegeneraIEPS As Boolean = True, Optional CveVentaDetallePedido2 As Integer = 0, Optional SeActualiza As Boolean = False, Optional CvePromocionDetalle As Integer = -1, Optional EsCargo As Boolean = False,
|
||||
Optional ImporteProntoPago As Decimal = 0, Optional ByRef ObjDescuento As Descuentos = Nothing) As Boolean
|
||||
Optional ImporteProntoPago As Decimal = 0, Optional ByRef ObjDescuento As Modelos.VentaDescuentos = Nothing) As Boolean
|
||||
|
||||
Dim Retorno As Boolean = False
|
||||
Try
|
||||
@@ -19999,7 +20015,7 @@ Partial Class Ventas
|
||||
Dim strPromos As New StringBuilder
|
||||
If Not String.IsNullOrEmpty(Titulo) Then
|
||||
|
||||
For Each Promo As Descuentos In ListaDescuentos
|
||||
For Each Promo As Modelos.VentaDescuentos In ListaDescuentos
|
||||
If Not String.IsNullOrEmpty(Promo.ObsDescuento) Then
|
||||
strPromos.AppendFormat("{0}, ", Promo.ObsDescuento)
|
||||
End If
|
||||
@@ -26182,7 +26198,7 @@ Partial Class Ventas
|
||||
Dim Cantidad As Decimal = TxtCantidadPyME.Text.ToDecimal()
|
||||
Dim PU As Decimal = TxtPrecioPyME.Text.ToDecimal()
|
||||
|
||||
Dim ObjDescuento As Descuentos = CalcularDescuentos(DdlPSPyME.SelectedValue.ToEntero(), Cantidad, PU)
|
||||
Dim ObjDescuento As Modelos.VentaDescuentos = CalcularDescuentos(DdlPSPyME.SelectedValue.ToEntero(), Cantidad, PU)
|
||||
|
||||
TxtDescuentoPyME.Text = ObjDescuento.ImporteDescuento.FormatoNumero(2).Replace(","c, "")
|
||||
|
||||
@@ -28046,22 +28062,30 @@ Partial Class Ventas
|
||||
SaldoMaximoUtilizable = 0
|
||||
End If
|
||||
Else
|
||||
Dim ObjAcum As New ClsAcumuladores
|
||||
If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then
|
||||
Dim RowUsadosNC As DataRow = ObjAcum.DtResultados.Rows(2)
|
||||
DivSMU.Visible = True
|
||||
'SI ES DISTRUIBUIDOR DEBE CARGAR EN BASE SU SALDO DE USADOS, SI ES PISO PUEDE PERMITIR APLICAR TODO SU SALDO
|
||||
If ClienteEsDistribuidor Then
|
||||
Dim ObjAcum As New ClsAcumuladores
|
||||
If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then
|
||||
Dim RowUsadosNC As DataRow = ObjAcum.DtResultados.Rows(2)
|
||||
DivSMU.Visible = True
|
||||
|
||||
Dim SaldoMaximo As Decimal = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal()
|
||||
If SaldoMaximo > 0 Then
|
||||
SaldoMaximoUtilizable = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal()
|
||||
Else
|
||||
SaldoMaximoUtilizable = 0
|
||||
End If
|
||||
|
||||
Dim SaldoMaximo As Decimal = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal()
|
||||
If SaldoMaximo > 0 Then
|
||||
SaldoMaximoUtilizable = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal()
|
||||
Else
|
||||
SaldoMaximoUtilizable = 0
|
||||
End If
|
||||
|
||||
ObjAcum.Dispose()
|
||||
Else
|
||||
SaldoMaximoUtilizable = 0
|
||||
If DtNC IsNot Nothing Then
|
||||
SaldoMaximoUtilizable = DtNC.SUMD("Saldo")
|
||||
End If
|
||||
End If
|
||||
ObjAcum.Dispose()
|
||||
|
||||
End If
|
||||
|
||||
If CveVentaUsado > 0 Then
|
||||
@@ -28226,16 +28250,21 @@ Partial Class Ventas
|
||||
SaldoMaximoUtilizable = 0
|
||||
End If
|
||||
Else
|
||||
Dim ObjAcum As New ClsAcumuladores
|
||||
If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then
|
||||
Dim RowUsadosNC As DataRow = ObjAcum.DtResultados.Rows(2)
|
||||
DivSMU.Visible = True
|
||||
SaldoMaximoUtilizable = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal()
|
||||
If Me.ClienteEsDistribuidor Then
|
||||
Dim ObjAcum As New ClsAcumuladores
|
||||
If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then
|
||||
Dim RowUsadosNC As DataRow = ObjAcum.DtResultados.Rows(2)
|
||||
DivSMU.Visible = True
|
||||
SaldoMaximoUtilizable = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal()
|
||||
Else
|
||||
'DivSMU.Visible = False
|
||||
SaldoMaximoUtilizable = 0
|
||||
End If
|
||||
ObjAcum.Dispose()
|
||||
Else
|
||||
'DivSMU.Visible = False
|
||||
SaldoMaximoUtilizable = 0
|
||||
SaldoMaximoUtilizable = TmpDTRNCDetalle.SUMD("Total")
|
||||
End If
|
||||
ObjAcum.Dispose()
|
||||
|
||||
End If
|
||||
|
||||
If CveVentaUsado > 0 Then
|
||||
@@ -28450,7 +28479,7 @@ Partial Class Ventas
|
||||
DivRNCBonificaciones.Visible = True
|
||||
DivRNCBonificacionesDetalle.Visible = False
|
||||
|
||||
Dim ListaBon As New List(Of VentasBonificaciones)
|
||||
Dim ListaBon As New List(Of Modelos.VentasBonificaciones)
|
||||
Dim DtBon As DataTable = Nothing
|
||||
Dim SbFiltro As New StringBuilder()
|
||||
SbFiltro.Append("CveVenta IN(")
|
||||
@@ -28474,7 +28503,7 @@ Partial Class Ventas
|
||||
|
||||
For Each bon In queryBonificacion
|
||||
SbFiltro.AppendFormat("'{0}',", bon.CveVentaBonificacion)
|
||||
ListaBon.Add(New VentasBonificaciones() With {.CveVentaRNCCargo = bon.CveVentaRNCCargo, .CveVentaBonificacion = bon.CveVentaBonificacion, .ImporteBonificacion = bon.ImporteBonificacion, .IVABonificacion = bon.IVABonificacion})
|
||||
ListaBon.Add(New Modelos.VentasBonificaciones() With {.CveVentaRNCCargo = bon.CveVentaRNCCargo, .CveVentaBonificacion = bon.CveVentaBonificacion, .ImporteBonificacion = bon.ImporteBonificacion, .IVABonificacion = bon.IVABonificacion})
|
||||
Next
|
||||
SbFiltro.Remove(SbFiltro.Length - 1, 1)
|
||||
SbFiltro.Append(")")
|
||||
@@ -28618,7 +28647,7 @@ Partial Class Ventas
|
||||
ListaVentasRNCCargos = CvesVentaRNCCargo.Split(","c)
|
||||
End If
|
||||
|
||||
Dim ListaBon As New List(Of VentasBonificaciones)
|
||||
Dim ListaBon As New List(Of Modelos.VentasBonificaciones)
|
||||
Dim DtBon As DataTable = Nothing
|
||||
Dim SbFiltro As New StringBuilder()
|
||||
SbFiltro.Append("CveVenta IN(")
|
||||
@@ -28650,7 +28679,7 @@ Partial Class Ventas
|
||||
|
||||
For Each bon In queryBonificacion
|
||||
SbFiltro.AppendFormat("'{0}',", bon.CveVentaBonificacion)
|
||||
ListaBon.Add(New VentasBonificaciones() With {.CveVentaRNCCargo = bon.CveVentaRNCCargo, .CveVentaBonificacion = bon.CveVentaBonificacion, .ImporteBonificacion = bon.ImporteBonificacion, .IVABonificacion = bon.IVABonificacion})
|
||||
ListaBon.Add(New Modelos.VentasBonificaciones() With {.CveVentaRNCCargo = bon.CveVentaRNCCargo, .CveVentaBonificacion = bon.CveVentaBonificacion, .ImporteBonificacion = bon.ImporteBonificacion, .IVABonificacion = bon.IVABonificacion})
|
||||
Next
|
||||
|
||||
SbFiltro.Remove(SbFiltro.Length - 1, 1)
|
||||
@@ -31394,7 +31423,7 @@ Partial Class Ventas
|
||||
Dim CveMetodoPago As Integer = -1
|
||||
Dim MetodoPagoDif As Boolean = False
|
||||
|
||||
Dim ListaVentaDetalleCotizacion As List(Of MVentaDetalleCotizacion) = Nothing
|
||||
Dim ListaVentaDetalleCotizacion As List(Of Modelos.MVentaDetalleCotizacion) = Nothing
|
||||
|
||||
If ChkCotProductos.Checked Then
|
||||
For Each row As DataRow In DTSeleccionadas.Rows
|
||||
@@ -31524,13 +31553,8 @@ Partial Class Ventas
|
||||
' Return Not ErrorAjuste
|
||||
'End Function
|
||||
|
||||
Private Class MVentaDetalleCotizacion
|
||||
Public Property CveVentaDetalle As Integer
|
||||
Public Property Cantidad As Decimal
|
||||
End Class
|
||||
|
||||
Private Function CalculaUsadosCotizacion(ByRef SbVentasDetalle As StringBuilder, ByVal DTSeleccionadas As DataTable, ByVal DtCotizaciones As DataTable) As List(Of MVentaDetalleCotizacion)
|
||||
Dim Retorno As New List(Of MVentaDetalleCotizacion)
|
||||
Private Function CalculaUsadosCotizacion(ByRef SbVentasDetalle As StringBuilder, ByVal DTSeleccionadas As DataTable, ByVal DtCotizaciones As DataTable) As List(Of Modelos.MVentaDetalleCotizacion)
|
||||
Dim Retorno As New List(Of Modelos.MVentaDetalleCotizacion)
|
||||
|
||||
Dim DTTamanios As DataTable = ClsPaginas.GlobalDTAcumTamaños(UsuarioActual.CveEmpresa)
|
||||
|
||||
@@ -31540,7 +31564,7 @@ Partial Class Ventas
|
||||
Dim tCantidad = If(ChkCotProductos.Checked, GvCotPS.Rows(IndiceGVCotDataKey(GvCotPS, Dr("CveVentaDetalle").ToString())).FCTextBox("TxtCantidadCot").Text.ToDecimal, Dr("Cantidad")).ToString().ToDecimal
|
||||
Dr("Cantidad") = tCantidad
|
||||
|
||||
Retorno.Add(New MVentaDetalleCotizacion() With {.CveVentaDetalle = Dr("CveVentaDetalle").ToString().ToEntero(), .Cantidad = tCantidad})
|
||||
Retorno.Add(New Modelos.MVentaDetalleCotizacion() With {.CveVentaDetalle = Dr("CveVentaDetalle").ToString().ToEntero(), .Cantidad = tCantidad})
|
||||
|
||||
Next
|
||||
|
||||
@@ -31599,7 +31623,7 @@ Partial Class Ventas
|
||||
Dim CveVentaDetalleUsado = DtCotizaciones.FiltroPrimeroValor("CveVentaDetalle", $"CveVenta = {drowPsTamaños("CveVenta")} AND CvePS = {drowPsTamaños("CvePS")}").ToEntero()
|
||||
SbVentasDetalle.AppendFormat("{0},", CveVentaDetalleUsado)
|
||||
|
||||
Retorno.Add(New MVentaDetalleCotizacion() With {.CveVentaDetalle = CveVentaDetalleUsado, .Cantidad = drowPsTamaños("Cantidad").ToString().ToDecimal()})
|
||||
Retorno.Add(New Modelos.MVentaDetalleCotizacion() With {.CveVentaDetalle = CveVentaDetalleUsado, .Cantidad = drowPsTamaños("Cantidad").ToString().ToDecimal()})
|
||||
|
||||
End If
|
||||
Next
|
||||
@@ -32877,6 +32901,7 @@ Partial Class Ventas
|
||||
'REMOVER EVENTO PARA RECARGAR ALMACEN
|
||||
spanAlmacen.Attributes.Remove("onclick")
|
||||
Tab.ActiveTabIndex = 1
|
||||
HdnCargarInventario.Value = "False"
|
||||
Updatetabs.Update()
|
||||
|
||||
|
||||
@@ -33068,7 +33093,12 @@ Partial Class Ventas
|
||||
If Not (EstablecioFolio AndAlso UsuarioActual.TienePermisoProceso(130)) Then
|
||||
TxtFecha.Text = Now.ToString()
|
||||
End If
|
||||
TxtFechaPago.Text = If(TipoDoctoViejo = "Rem" AndAlso EsDiasCreditoFijo, Now.AddDays(DiasCredito), If(DdlTipoComprobante.SelectedValue = "Rem", Now.AddDays(PlazoCobranzaRemision), Now.AddDays(PlazoCobranza))).ToShortDateString
|
||||
|
||||
'SI TIENE LINEA ADICIONAL, NO DEBE MODIFICAR LA FECHA YA ASIGNADA
|
||||
If DdlLineaAdicional.SelectedValue.ToEntero() <= 0 Then
|
||||
TxtFechaPago.Text = If(TipoDoctoViejo = "Rem" AndAlso EsDiasCreditoFijo, Now.AddDays(DiasCredito), If(DdlTipoComprobante.SelectedValue = "Rem", Now.AddDays(PlazoCobranzaRemision), Now.AddDays(PlazoCobranza))).ToShortDateString
|
||||
End If
|
||||
|
||||
TxtFechaEjecucion.Text = Now.ToString()
|
||||
|
||||
DdlLineaAdicional_SelectedIndexChanged(DdlLineaAdicional, EventArgs.Empty)
|
||||
@@ -34438,18 +34468,6 @@ Partial Class Ventas
|
||||
' ObjBancos.Dispose()
|
||||
' If ObjAC IsNot Nothing Then ObjAC.Dispose()
|
||||
'End Sub
|
||||
Partial Class Descuentos
|
||||
Public Consec As Integer
|
||||
Public ImporteDescuento As Decimal = 0
|
||||
Public CvePromocionDetalle As Integer = -1
|
||||
Public PU As Decimal = 0
|
||||
Public EsPUModificado As Boolean = False
|
||||
Public ImporteProntoPago As Decimal = 0
|
||||
Public NombrePromo As String = ""
|
||||
Public CveMarca As Integer = -1
|
||||
Public ObsDescuento As String = ""
|
||||
End Class
|
||||
|
||||
Protected Sub btnupEventoBitacora_Click(sender As Object, e As EventArgs)
|
||||
CargaEventoBitacora()
|
||||
End Sub
|
||||
@@ -34718,19 +34736,10 @@ Partial Class Ventas
|
||||
#End Region
|
||||
|
||||
|
||||
Partial Class VentasBonificaciones
|
||||
Public CveVentaRNCCargo As Integer = -1
|
||||
Public CveVentaBonificacion As Integer = -1
|
||||
Public ImporteBonificacion As Decimal = 0
|
||||
Public IVABonificacion As Decimal = 0
|
||||
End Class
|
||||
|
||||
|
||||
|
||||
#Region " N O T A - D E - C R E D I T O - P R O N T O - P A G O"
|
||||
|
||||
Private Function GenerarNCProntoPago(SqlTransaccion As SqlClient.SqlTransaction, ByRef ObjCliente As ClsClientes, ByRef ObjConta As ClsContPAQi, ObjFactura As Modelos.Factura) As MensajeProntoPago
|
||||
Dim Retorno As New MensajeProntoPago
|
||||
Private Function GenerarNCProntoPago(SqlTransaccion As SqlClient.SqlTransaction, ByRef ObjCliente As ClsClientes, ByRef ObjConta As ClsContPAQi, ObjFactura As Modelos.Factura) As Modelos.MensajeProntoPago
|
||||
Dim Retorno As New Modelos.MensajeProntoPago
|
||||
|
||||
Dim Resp As New Modelos.Factura.MMensajeFactura
|
||||
Dim ObjFacturaProntoPago As Modelos.Factura = Nothing
|
||||
@@ -35198,11 +35207,6 @@ Partial Class Ventas
|
||||
Return DtVentasNC
|
||||
End Function
|
||||
|
||||
Public Class MensajeProntoPago
|
||||
Public Property ObjFacturaProntoPago As Modelos.Factura
|
||||
Public Property Mensaje As Modelos.Factura.MMensajeFactura
|
||||
End Class
|
||||
|
||||
#End Region
|
||||
|
||||
Protected Sub LnkAplicarRNCDevolucion_Click(sender As Object, e As EventArgs)
|
||||
@@ -35459,11 +35463,6 @@ Partial Class Ventas
|
||||
' UpParametros.Update()
|
||||
'End Sub
|
||||
|
||||
Public Class MAnticipoRelacionado
|
||||
Public Property CveVenta As Integer
|
||||
Public Property FolioFiscal As String
|
||||
End Class
|
||||
|
||||
Protected Sub LnkEditarDir_Click(sender As Object, e As EventArgs)
|
||||
DdlDireccionEnvio.Enabled = True
|
||||
LnkEditarDir.Visible = False
|
||||
@@ -36442,7 +36441,7 @@ Partial Class Ventas
|
||||
|
||||
'AL FACTURAR CON LINEA ADICIONAL TIPO PO, SE SUMARÁN LOS DIAS DE VENCIMIENTO A LA FECHA ACTUAL
|
||||
If RowLinea("TipoLinea").ToString() = "2" Then
|
||||
TxtFechaPago.Text = Now.AddDays(RowLinea("DiasVencimiento").ToString().ToEntero()).ToString("dd/MM/yyyy")
|
||||
TxtFechaPago.Text = TxtFecha.Text.ToDate().AddDays(RowLinea("DiasVencimiento").ToString().ToEntero()).ToString("dd/MM/yyyy")
|
||||
Else
|
||||
TxtFechaPago.Text = RowLinea("FechaVencimiento").ToString().ToDateTime().ToString("dd/MM/yyyy")
|
||||
End If
|
||||
@@ -36590,6 +36589,7 @@ Partial Class Ventas
|
||||
'REMOVER EVENTO PARA RECARGAR ALMACEN
|
||||
spanAlmacen.Attributes.Remove("onclick")
|
||||
Tab.ActiveTabIndex = 1
|
||||
HdnCargarInventario.Value = "False"
|
||||
Updatetabs.Update()
|
||||
End Sub
|
||||
Protected Sub LBAplicaDevolucion_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Reference in New Issue
Block a user