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