Cambios Importe Pronto Pago
This commit is contained in:
@@ -3961,7 +3961,7 @@ Partial Class Ventas
|
||||
LblAlertRefacInv.Visible = True
|
||||
End If
|
||||
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Egs", "Ing", "Ant", "Dev", "Rem", "DPe", "RNC", "Pd2") AndAlso Not CveEstatus.Contiene(4, 5, 12, 13, 20) Then
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Egs", "Ing", "Ant", "Dev", "Rem", "DPe", "RNC", "Pd2", "Cot") AndAlso Not CveEstatus.Contiene(4, 5, 10, 12, 13, 20) 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
|
||||
@@ -3981,11 +3981,13 @@ Partial Class Ventas
|
||||
|
||||
Dim TipoEstatus As Integer = GlobalDTEstatusFactura().FiltroPrimeroValor("TipoEstatus", $"CveEstatusFactura = {CveEstatus}").ToEntero()
|
||||
|
||||
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
|
||||
LbCancelarDocumento.Visible = True
|
||||
If UsuarioActual.Empresa.Funcionalidad(135).Contiene("1", "2") AndAlso DdlTipoComprobante.SelectedValue.Contiene("Cot") Then
|
||||
If UsuarioActual.TienePermisoProceso(116) Then
|
||||
LbCancelarDocumento.Visible = True
|
||||
If TipoEstatus = 2 Then
|
||||
LbCancelarDocumento.Visible = False
|
||||
ElseIf TipoEstatus = 5 Then
|
||||
LbCancelarDocumento.Visible = False
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
@@ -7874,21 +7876,30 @@ Partial Class Ventas
|
||||
Dim SerieFolioNCProntoPago As String = ""
|
||||
Dim CveVentaNCProntoPago As Integer = -1
|
||||
Dim GeneroDescuentoProntoPago As Boolean = False
|
||||
If ObjFactura.DescuentoProntoPago > 0 Then
|
||||
Dim RespFacturaProntoPago = GenerarNCProntoPago(ObjVentas.IniciaTransacSQL(), ObjClientes, ObjContPaq, ObjFactura)
|
||||
If RespFacturaProntoPago.ObjFacturaProntoPago Is Nothing OrElse RespFacturaProntoPago Is Nothing Then
|
||||
ErrorList.Add("No se pudo generar la nota de crédito de pronto pago")
|
||||
Else
|
||||
If RespFacturaProntoPago.Mensaje.CveVenta <= 0 OrElse RespFacturaProntoPago.Mensaje.TieneError Then
|
||||
|
||||
'SOLO GENERAR NC POR DESCUENTO PRONTO PAGO SI EL PAGO ES DE CONTADO
|
||||
If RBLPago.SelectedValue = "2" AndAlso ObjFactura.DescuentoProntoPago > 0 Then
|
||||
Dim ImportePagado = DtPagos.SUM("Importe").ToString().ToDecimal
|
||||
If (ImportePagado + ObjFactura.DescuentoProntoPago) >= ObjFactura.Total Then
|
||||
|
||||
Dim RespFacturaProntoPago = GenerarNCProntoPago(ObjVentas.IniciaTransacSQL(), ObjClientes, ObjContPaq, ObjFactura)
|
||||
If RespFacturaProntoPago.ObjFacturaProntoPago Is Nothing OrElse RespFacturaProntoPago Is Nothing Then
|
||||
ErrorList.Add("No se pudo generar la nota de crédito de pronto pago")
|
||||
Else
|
||||
GeneroDescuentoProntoPago = True
|
||||
CveVentaNCProntoPago = RespFacturaProntoPago.Mensaje.CveVenta
|
||||
SerieFolioNCProntoPago = RespFacturaProntoPago.Mensaje.SerieFolio
|
||||
If RespFacturaProntoPago.Mensaje.CveVenta <= 0 OrElse RespFacturaProntoPago.Mensaje.TieneError Then
|
||||
ErrorList.Add("No se pudo generar la nota de crédito de pronto pago")
|
||||
Else
|
||||
GeneroDescuentoProntoPago = True
|
||||
CveVentaNCProntoPago = RespFacturaProntoPago.Mensaje.CveVenta
|
||||
SerieFolioNCProntoPago = RespFacturaProntoPago.Mensaje.SerieFolio
|
||||
|
||||
Obj2.Add(RespFacturaProntoPago.ObjFacturaProntoPago)
|
||||
Obj2.Add(RespFacturaProntoPago.ObjFacturaProntoPago)
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
|
||||
'MARCA PARA NO SURTIR VENTA DE COTNRATO DE CONSIGNACION DE VENTA | [IPP] : PARCHE
|
||||
@@ -16709,9 +16720,13 @@ Partial Class Ventas
|
||||
If ImporteProntoPago > 0 Then
|
||||
Row("ImporteProntoPago") = ImporteProntoPago
|
||||
Row("TieneProntoPago") = "Si"
|
||||
GvPS.Columns(22).Visible = True
|
||||
thProntoPago.Visible = True
|
||||
thProntoPago2.Visible = True
|
||||
'SOLO DEBE MOSTRASE SI EL PAGO ES DE CONTADO
|
||||
If RBLPago.SelectedValue = "2" Then
|
||||
GvPS.Columns(22).Visible = True
|
||||
thProntoPago.Visible = True
|
||||
thProntoPago2.Visible = True
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
If UsuarioActual.CveEmpresa = 119 Then
|
||||
@@ -17364,7 +17379,7 @@ Partial Class Ventas
|
||||
Dim Total As Decimal = 0
|
||||
Dim TotalImpuestosLocales As Decimal = 0
|
||||
|
||||
Dim TotalProntoPago As Decimal = TmpDT.SUM("ImporteProntoPago").ToDecimal
|
||||
Dim TotalProntoPago As Decimal = 0
|
||||
|
||||
If TotalAmortizacion > 0 AndAlso TotalSubTotal = TotalAmortizacion Then ' si se amortizó completa la factura, debe de limpiar los impuestos
|
||||
If DdlTipoAmortizacionAnticipo.SelectedValue.Contiene("3") Then
|
||||
@@ -17438,6 +17453,11 @@ Partial Class Ventas
|
||||
TxtIEPS.Text = TotalIEPS.FormatoNumero
|
||||
TxtTotal.Text = Total.FormatoNumero
|
||||
|
||||
'SI ES PAGO DE CONTADO
|
||||
If RBLPago.SelectedValue = "2" Then
|
||||
TotalProntoPago = TmpDT.SUM("ImporteProntoPago").ToDecimal
|
||||
End If
|
||||
|
||||
HdnProntoPago.Value = TotalProntoPago.ToString()
|
||||
LblProntoPago.Text = TotalProntoPago.FormatoNumero(2)
|
||||
|
||||
@@ -19782,9 +19802,26 @@ Partial Class Ventas
|
||||
End Select
|
||||
|
||||
LimpiaContado()
|
||||
LimpiaProntoPago()
|
||||
UpContado.Update()
|
||||
UPCondicionesPago.Update()
|
||||
End Sub
|
||||
Private Sub LimpiaProntoPago()
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
|
||||
If RBLPago.SelectedValue = "2" Then
|
||||
GvPS.Columns(22).Visible = True
|
||||
thProntoPago.Visible = True
|
||||
thProntoPago2.Visible = True
|
||||
Else
|
||||
GvPS.Columns(22).Visible = False
|
||||
thProntoPago.Visible = False
|
||||
thProntoPago2.Visible = False
|
||||
End If
|
||||
|
||||
CalculaTotalesVenta()
|
||||
End If
|
||||
End Sub
|
||||
Private Sub CargaCuentas()
|
||||
|
||||
DdlCuentaEfectivo.Items.Clear()
|
||||
@@ -28646,7 +28683,12 @@ Partial Class Ventas
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim TotalProntoPago As Decimal = TmpDT.SUM("ImporteProntoPago").ToDecimal
|
||||
Dim TotalProntoPago As Decimal = 0
|
||||
|
||||
'SOLO APLICA SI EL PAGO ES DE CONTADO
|
||||
If RBLPago.SelectedValue = "2" Then
|
||||
TotalProntoPago = TmpDT.SUM("ImporteProntoPago").ToDecimal
|
||||
End If
|
||||
|
||||
HdnTotalRNC.Value = TotalRemNCAplicado.ToString()
|
||||
LblDescuentosRNC.Text = TotalRemNCAplicado.FormatoNumero
|
||||
|
||||
Reference in New Issue
Block a user