Descuento por forma de pago
This commit is contained in:
@@ -1406,6 +1406,29 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
|
<table id="TbDescuentosAdicionales" border="0" rules="none" class="well TextTab" style="float: right;" runat="server" visible="false">
|
||||||
|
<tr align="right">
|
||||||
|
<td style="border: 1px none white"><b>Descuento Adicional Por Pago:</b></td>
|
||||||
|
<td>
|
||||||
|
<asp:Label ID="LblDescuentoAdicional" ClientIDMode="Static" runat="server" Style="text-align: right;" Text="0.00" Width="78px"></asp:Label></td>
|
||||||
|
<td align="right">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr align="right">
|
||||||
|
<td style="border: 1px none white"><b>Total Original:</b></td>
|
||||||
|
<td>
|
||||||
|
<asp:Label ID="LblTotalOriginal" ClientIDMode="Static" runat="server" Style="text-align: right;" Text="0.00" Width="78px"></asp:Label></td>
|
||||||
|
<td align="right">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr align="right">
|
||||||
|
<td style="border: 1px none white"><b>Total a Pagar:</b></td>
|
||||||
|
<td>
|
||||||
|
<asp:Label ID="LblTotalAPagarAdicional" ClientIDMode="Static" runat="server" Style="text-align: right;" Text="0.00" Width="78px"></asp:Label></td>
|
||||||
|
<td align="right">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
<table id="TbDescuentosRNC" border="0" rules="none" class="well TextTab" style="float: right;" runat="server" visible="false">
|
<table id="TbDescuentosRNC" border="0" rules="none" class="well TextTab" style="float: right;" runat="server" visible="false">
|
||||||
<tr align="right">
|
<tr align="right">
|
||||||
<td style="border: 1px none white"><b>Descuentos RNC:</b></td>
|
<td style="border: 1px none white"><b>Descuentos RNC:</b></td>
|
||||||
@@ -2472,10 +2495,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<label class="col-md-2 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">Motivo Traslado:</label>
|
<%-- <label class="col-md-2 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">Motivo Traslado:</label>
|
||||||
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
|
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
|
||||||
<asp:DropDownList ID="DdlSATMotivoTraslado" Width="100%" runat="server" CssClass="select2me" DataTextField="ClaveSATMotivoTrasladoDescripcion" DataValueField="CveMotivoTraslado"></asp:DropDownList>
|
<asp:DropDownList ID="DdlSATMotivoTraslado" Width="100%" runat="server" CssClass="select2me" DataTextField="ClaveSATMotivoTrasladoDescripcion" DataValueField="CveMotivoTraslado"></asp:DropDownList>
|
||||||
</div>
|
</div>--%>
|
||||||
<label class="col-md-2 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">Num Reg IdTrib:</label>
|
<label class="col-md-2 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">Num Reg IdTrib:</label>
|
||||||
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
|
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
|
||||||
<asp:TextBox ID="TxtNumRegIdTrib" CssClass="form-control input-sm" runat="server" Width="100%"></asp:TextBox>
|
<asp:TextBox ID="TxtNumRegIdTrib" CssClass="form-control input-sm" runat="server" Width="100%"></asp:TextBox>
|
||||||
|
|||||||
@@ -5993,6 +5993,21 @@ Partial Class Ventas
|
|||||||
DdlFormaCliente.DataBind()
|
DdlFormaCliente.DataBind()
|
||||||
DdlMetodoCliente.DataSource = GlobalDTVtaMetodoPago
|
DdlMetodoCliente.DataSource = GlobalDTVtaMetodoPago
|
||||||
DdlMetodoCliente.DataBind()
|
DdlMetodoCliente.DataBind()
|
||||||
|
|
||||||
|
If CveMetodoPago = 1 AndAlso DdlTipoComprobante.SelectedValue = "Cot" AndAlso UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso TbDescuentosAdicionales.Visible Then
|
||||||
|
If TmpDT.SUMD("Descuento") > 0 Then
|
||||||
|
Dim TotalDescuento As Decimal = TmpDT.SUMD("Total", "Descuento > 0") * 0.05D
|
||||||
|
Dim RowDescuentos = TmpDT.Select("Descuento > 0")
|
||||||
|
|
||||||
|
If RowDescuentos IsNot Nothing Then
|
||||||
|
LblDescuentoAdicional.Text = TotalDescuento.FormatoNumero(2)
|
||||||
|
CalculaTotalesVenta()
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
LblDescuentoAdicional.Text = "0.00"
|
||||||
|
End If
|
||||||
|
UpPS.Update()
|
||||||
|
End If
|
||||||
'End If
|
'End If
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub CargaUsoCFDI()
|
Private Sub CargaUsoCFDI()
|
||||||
@@ -6423,9 +6438,9 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If ObjCliente.AplicaComercioExterior Then
|
If ObjCliente.AplicaComercioExterior Then
|
||||||
DdlSATMotivoTraslado.DataSource = GlobalDTSATMotivoTraslado
|
'DdlSATMotivoTraslado.DataSource = GlobalDTSATMotivoTraslado
|
||||||
DdlSATMotivoTraslado.DataBind()
|
'DdlSATMotivoTraslado.DataBind()
|
||||||
DdlSATMotivoTraslado.SelectedValueExist(ObjCliente.CveMotivoTraslado)
|
'DdlSATMotivoTraslado.SelectedValueExist(ObjCliente.CveMotivoTraslado)
|
||||||
DdlIncoterm.Items.Clear()
|
DdlIncoterm.Items.Clear()
|
||||||
DdlIncoterm.DataSource = GlobalDTIncoterm()
|
DdlIncoterm.DataSource = GlobalDTIncoterm()
|
||||||
DdlIncoterm.DataBind()
|
DdlIncoterm.DataBind()
|
||||||
@@ -7298,7 +7313,9 @@ Partial Class Ventas
|
|||||||
LblEstado.Text = ObjCliente.DtResultados.Rows(0)("Estado").ToString()
|
LblEstado.Text = ObjCliente.DtResultados.Rows(0)("Estado").ToString()
|
||||||
'TxtNumCtaPago.Text = ObjCliente.DtResultados.Rows(0)("NumCtaPago").ToString()
|
'TxtNumCtaPago.Text = ObjCliente.DtResultados.Rows(0)("NumCtaPago").ToString()
|
||||||
LblTelefono.Text = ObjCliente.DtResultados.Rows(0)("Telefono").ToString()
|
LblTelefono.Text = ObjCliente.DtResultados.Rows(0)("Telefono").ToString()
|
||||||
|
If Not UsuarioActual.Empresa.Funcionalidad(350) = "1" Then
|
||||||
LblCP.Text = ObjCliente.DtResultados.Rows(0)("CP").ToString()
|
LblCP.Text = ObjCliente.DtResultados.Rows(0)("CP").ToString()
|
||||||
|
End If
|
||||||
ViewState("CliLocalidad") = ObjCliente.DtResultados.Rows(0)("Localidad").ToString()
|
ViewState("CliLocalidad") = ObjCliente.DtResultados.Rows(0)("Localidad").ToString()
|
||||||
ViewState("CliPais") = ObjCliente.DtResultados.Rows(0)("Pais").ToString()
|
ViewState("CliPais") = ObjCliente.DtResultados.Rows(0)("Pais").ToString()
|
||||||
ViewState("CliNoExt") = ObjCliente.DtResultados.Rows(0)("NoExt").ToString()
|
ViewState("CliNoExt") = ObjCliente.DtResultados.Rows(0)("NoExt").ToString()
|
||||||
@@ -8557,7 +8574,6 @@ Partial Class Ventas
|
|||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region " EMITIR IMPRIMIR - GUARDAR "
|
#Region " EMITIR IMPRIMIR - GUARDAR "
|
||||||
|
|
||||||
Protected Sub BtnEmitirImprimir_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnEmitirImprimir.Click
|
Protected Sub BtnEmitirImprimir_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnEmitirImprimir.Click
|
||||||
Try
|
Try
|
||||||
EmitirImprimir()
|
EmitirImprimir()
|
||||||
@@ -9184,11 +9200,12 @@ Partial Class Ventas
|
|||||||
|
|
||||||
Dim ArchivoSti As New System.IO.FileInfo(String.Format("{0}Formatos/Factura.mrt", UsuarioActual.Empresa.Ruta))
|
Dim ArchivoSti As New System.IO.FileInfo(String.Format("{0}Formatos/Factura.mrt", UsuarioActual.Empresa.Ruta))
|
||||||
Dim ArchivoSti2 As New System.IO.FileInfo(String.Format("{0}Formatos/Remision.mrt", UsuarioActual.Empresa.Ruta))
|
Dim ArchivoSti2 As New System.IO.FileInfo(String.Format("{0}Formatos/Remision.mrt", UsuarioActual.Empresa.Ruta))
|
||||||
|
Dim ArchivoSti3 As New System.IO.FileInfo(String.Format("{0}Formatos/Cotizacion.mrt", UsuarioActual.Empresa.Ruta))
|
||||||
|
|
||||||
LnkImprimir.Visible = False
|
LnkImprimir.Visible = False
|
||||||
|
|
||||||
'If (UsuarioActual.CveEmpresa.Contiene(1, 4, 5, 7, 11, 12, 72, 80, 81, 83) And UsuarioActual.CveUsuario = 100) Or UsuarioActual.CveEmpresa.Contiene(80, 83) Or UsuarioActual.CveUsuario = 100 Then
|
'If (UsuarioActual.CveEmpresa.Contiene(1, 4, 5, 7, 11, 12, 72, 80, 81, 83) And UsuarioActual.CveUsuario = 100) Or UsuarioActual.CveEmpresa.Contiene(80, 83) Or UsuarioActual.CveUsuario = 100 Then
|
||||||
If (Archivo.Exists Or Archivo2.Exists Or ArchivoSti.Exists Or ArchivoSti2.Exists) And IfNull(CveVenta, 0).ToString().ToEntero() > 0 Then
|
If (Archivo.Exists Or Archivo2.Exists Or ArchivoSti.Exists Or ArchivoSti2.Exists Or ArchivoSti3.Exists) And IfNull(CveVenta, 0).ToString().ToEntero() > 0 Then
|
||||||
HplDownPDF.Visible = True
|
HplDownPDF.Visible = True
|
||||||
HplDownPDF.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta)))
|
HplDownPDF.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta)))
|
||||||
If UsuarioActual.CveRol = 1 Then
|
If UsuarioActual.CveRol = 1 Then
|
||||||
@@ -9218,10 +9235,8 @@ Partial Class Ventas
|
|||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
|
||||||
CreaObjetosVenta(TipoDoctoViejo:=TipoDoctoViejo)
|
|
||||||
|
|
||||||
'Verifica versión 3.3.()
|
'Verifica versión 3.3.()
|
||||||
If ObjFactura.Version = "3.3" AndAlso Not DdlTipoComprobante.SelectedValue.Contiene("Ped", "PeC") Then
|
If (Not UsuarioActual.Empresa.Funcionalidad(350) = "1") AndAlso Not DdlTipoComprobante.SelectedValue.Contiene("Ped", "PeC") Then
|
||||||
Dim dttsat As DataTable = TmpDT.FiltraParametros("ISNULL(SATClaveProdServ,'') = '' OR ISNULL(SATClaveUM,'') = '' ")
|
Dim dttsat As DataTable = TmpDT.FiltraParametros("ISNULL(SATClaveProdServ,'') = '' OR ISNULL(SATClaveUM,'') = '' ")
|
||||||
If dttsat IsNot Nothing AndAlso dttsat.Rows.Count > 0 Then
|
If dttsat IsNot Nothing AndAlso dttsat.Rows.Count > 0 Then
|
||||||
Dim str As New StringBuilder
|
Dim str As New StringBuilder
|
||||||
@@ -9253,6 +9268,40 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
'CREA UNA COPIA DE SEGURIDAD PARA LOS DATOS DEL TMPDT
|
||||||
|
If TmpDTError Is Nothing OrElse TmpDTError.Rows.Count = 0 Then
|
||||||
|
TmpDTError = TmpDT.Copy()
|
||||||
|
End If
|
||||||
|
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso TbDescuentosAdicionales.Visible Then
|
||||||
|
If LblDescuentoAdicional.Text.ToDecimal() > 0 Then
|
||||||
|
Dim TotalDescuento As Decimal = LblDescuentoAdicional.Text.ToDecimal() / (1D + TmpDT.MAX("PorcentajeIVA").ToString().ToDecimal())
|
||||||
|
Dim RowDescuentos = TmpDT.Select("Descuento > 0")
|
||||||
|
|
||||||
|
If RowDescuentos IsNot Nothing Then
|
||||||
|
|
||||||
|
Dim Row As DataRow = RowDescuentos(0)
|
||||||
|
Row("Descuento") = Row("Descuento").ToString().ToDecimal() + TotalDescuento
|
||||||
|
|
||||||
|
Dim TotalCalculableImpuestos As Decimal = (Row("Cantidad").ToString().ToDecimal() * Row("PU").ToString().ToDecimal()) - Row("Descuento").ToString().ToDecimal()
|
||||||
|
Row("ImporteIVA") = (TotalCalculableImpuestos * Row("PorcentajeIVA").ToString().ToDecimal()).RoundSQL(2)
|
||||||
|
|
||||||
|
CalculaTotalesVenta(RecalcularTotalOriginal:=False)
|
||||||
|
|
||||||
|
'UpPS.Update()
|
||||||
|
'VALIDA EL CALCULO DE LOS DESCUENTOS
|
||||||
|
If (LblTotalOriginal.Text.ToDecimal() - LblDescuentoAdicional.Text.ToDecimal()) <> TxtTotal.Text.ToDecimal() Then
|
||||||
|
TmpDT = TmpDTError.Copy()
|
||||||
|
CalculaTotalesVenta(RecalcularTotalOriginal:=False)
|
||||||
|
Alert("Ocurrió un error al procesar los datos de la Venta. Los descuentos no coinciden con el importe final", TipoMensaje.MsgError)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
CreaObjetosVenta(TipoDoctoViejo:=TipoDoctoViejo)
|
||||||
|
|
||||||
If ObjFactura Is Nothing Or (ObjFactura.Cliente Is Nothing And Not CveEmpresaCRM > 0) Then
|
If ObjFactura Is Nothing Or (ObjFactura.Cliente Is Nothing And Not CveEmpresaCRM > 0) Then
|
||||||
Alert("Ocurrió un error al procesar los datos de la Venta.", TipoMensaje.MsgError)
|
Alert("Ocurrió un error al procesar los datos de la Venta.", TipoMensaje.MsgError)
|
||||||
ObjFactura = Nothing
|
ObjFactura = Nothing
|
||||||
@@ -10138,6 +10187,7 @@ Partial Class Ventas
|
|||||||
MensajeAlert = Nothing
|
MensajeAlert = Nothing
|
||||||
If ObjContPaq IsNot Nothing Then ObjContPaq.Dispose()
|
If ObjContPaq IsNot Nothing Then ObjContPaq.Dispose()
|
||||||
TmpDT = TmpDTError.Copy
|
TmpDT = TmpDTError.Copy
|
||||||
|
CalculaTotalesVenta(RecalcularTotalOriginal:=False)
|
||||||
|
|
||||||
Else
|
Else
|
||||||
ObjVentas.RollBack()
|
ObjVentas.RollBack()
|
||||||
@@ -10161,7 +10211,7 @@ Partial Class Ventas
|
|||||||
MensajeAlert = Nothing
|
MensajeAlert = Nothing
|
||||||
If ObjContPaq IsNot Nothing Then ObjContPaq.Dispose()
|
If ObjContPaq IsNot Nothing Then ObjContPaq.Dispose()
|
||||||
TmpDT = TmpDTError.Copy
|
TmpDT = TmpDTError.Copy
|
||||||
|
CalculaTotalesVenta(RecalcularTotalOriginal:=False)
|
||||||
End If
|
End If
|
||||||
ObjFactura = Nothing
|
ObjFactura = Nothing
|
||||||
ListaNotasCreditoGeneradas = Nothing
|
ListaNotasCreditoGeneradas = Nothing
|
||||||
@@ -12197,13 +12247,12 @@ Partial Class Ventas
|
|||||||
i += 1
|
i += 1
|
||||||
Next
|
Next
|
||||||
|
|
||||||
Dim AplicaComercioExteriorSubProyecto As Boolean
|
Dim AplicaComercioExteriorSubProyecto As Boolean = True
|
||||||
|
|
||||||
If ChkEmitirComercioExterior.Checked Then
|
If ChkEmitirComercioExterior.Checked Then
|
||||||
AplicaComercioExteriorSubProyecto = If(GlobalDTSubProyectos(-1, Obj.CveSubProyecto, CveEmpresa:=UsuarioActual.CveEmpresa)(0)("AplicaComercioExterior").ToString() = "True", True, False)
|
'AplicaComercioExteriorSubProyecto = If(GlobalDTSubProyectos(-1, Obj.CveSubProyecto, CveEmpresa:=UsuarioActual.CveEmpresa)(0)("AplicaComercioExterior").ToString() = "True", True, False)
|
||||||
Timbre.Complementos.ComercioExterior11.AplicaComercioExteriorSubProyecto = AplicaComercioExteriorSubProyecto
|
Timbre.Complementos.ComercioExterior11.AplicaComercioExteriorSubProyecto = AplicaComercioExteriorSubProyecto
|
||||||
|
|
||||||
If Obj.Cliente.AplicaComercioExterior And AplicaComercioExteriorSubProyecto Then
|
|
||||||
'DATOS GENERALES
|
'DATOS GENERALES
|
||||||
|
|
||||||
Timbre.Comprobante.Exportacion = "02"
|
Timbre.Comprobante.Exportacion = "02"
|
||||||
@@ -12214,11 +12263,14 @@ Partial Class Ventas
|
|||||||
Timbre.Complementos.ComercioExterior11.Subdivision = "0"
|
Timbre.Complementos.ComercioExterior11.Subdivision = "0"
|
||||||
|
|
||||||
Timbre.Complementos.ComercioExterior11.TipoCambioUSD = If(Obj.CveMoneda = 1, 1, Obj.TipoCambio)
|
Timbre.Complementos.ComercioExterior11.TipoCambioUSD = If(Obj.CveMoneda = 1, 1, Obj.TipoCambio)
|
||||||
If Timbre.Comprobante.TipoComprobante = "T" Then
|
|
||||||
Timbre.Complementos.ComercioExterior11.MotivoTraslado = GlobalDTSATMotivoTraslado.FiltroPrimeroValor("ClaveSATMotivoTraslado", $"CveMotivoTraslado={DdlSATMotivoTraslado.SelectedValue}")
|
|
||||||
Else
|
|
||||||
Timbre.Complementos.ComercioExterior11.MotivoTraslado = ""
|
Timbre.Complementos.ComercioExterior11.MotivoTraslado = ""
|
||||||
End If
|
|
||||||
|
'If Timbre.Comprobante.TipoComprobante = "T" Then
|
||||||
|
' Timbre.Complementos.ComercioExterior11.MotivoTraslado = GlobalDTSATMotivoTraslado.FiltroPrimeroValor("ClaveSATMotivoTraslado", $"CveMotivoTraslado={DdlSATMotivoTraslado.SelectedValue}")
|
||||||
|
'Else
|
||||||
|
' Timbre.Complementos.ComercioExterior11.MotivoTraslado = ""
|
||||||
|
'End If
|
||||||
|
|
||||||
'EMISOR
|
'EMISOR
|
||||||
Dim Dr As DataRow
|
Dim Dr As DataRow
|
||||||
@@ -12305,7 +12357,6 @@ Partial Class Ventas
|
|||||||
Timbre.Complementos.ComercioExterior11.Mercancias.Add(mercancia)
|
Timbre.Complementos.ComercioExterior11.Mercancias.Add(mercancia)
|
||||||
i += 1
|
i += 1
|
||||||
Next
|
Next
|
||||||
End If
|
|
||||||
|
|
||||||
|
|
||||||
Else
|
Else
|
||||||
@@ -17969,6 +18020,12 @@ Partial Class Ventas
|
|||||||
ObjDescuento.ImporteDescuento = 0
|
ObjDescuento.ImporteDescuento = 0
|
||||||
Return ObjDescuento
|
Return ObjDescuento
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Cot") AndAlso CveRinTamañoPS > 0 Then
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso Not TbDescuentosAdicionales.Visible Then
|
||||||
|
TbDescuentosAdicionales.Visible = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim dr As DataRow = Nothing
|
Dim dr As DataRow = Nothing
|
||||||
@@ -19241,7 +19298,7 @@ Partial Class Ventas
|
|||||||
ConfiguraTipoDocto()
|
ConfiguraTipoDocto()
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub CalculaTotalesVenta(Optional RecalculaImpuestosLocales As Boolean = True, Optional NCDescuento As Boolean = False, Optional ValidarDescuentos As Boolean = False)
|
Private Sub CalculaTotalesVenta(Optional RecalculaImpuestosLocales As Boolean = True, Optional NCDescuento As Boolean = False, Optional ValidarDescuentos As Boolean = False, Optional RecalcularTotalOriginal As Boolean = True)
|
||||||
|
|
||||||
Dim TotalSubTotal As Decimal = TmpDT.SUMD("TotalImporte")
|
Dim TotalSubTotal As Decimal = TmpDT.SUMD("TotalImporte")
|
||||||
Dim TotalSubTotalRef As Decimal = TotalSubTotal
|
Dim TotalSubTotalRef As Decimal = TotalSubTotal
|
||||||
@@ -19346,6 +19403,12 @@ Partial Class Ventas
|
|||||||
|
|
||||||
LblTotalAPagar.Text = (TxtTotal.Text.ToDecimal() - TotalRemNCAplicado - TotalProntoPago).FormatoNumero
|
LblTotalAPagar.Text = (TxtTotal.Text.ToDecimal() - TotalRemNCAplicado - TotalProntoPago).FormatoNumero
|
||||||
|
|
||||||
|
If RecalcularTotalOriginal Then
|
||||||
|
LblTotalOriginal.Text = (TxtTotal.Text.ToDecimal()).FormatoNumero
|
||||||
|
End If
|
||||||
|
|
||||||
|
LblTotalAPagarAdicional.Text = (LblTotalOriginal.Text.ToDecimal() - LblDescuentoAdicional.Text.ToDecimal()).FormatoNumero
|
||||||
|
|
||||||
LblAmort.Text = TxtSubTotal.Text
|
LblAmort.Text = TxtSubTotal.Text
|
||||||
If CveVenta <= 0 OrElse (CveDevolucion > 0 And NuevaFactura = 1) Then
|
If CveVenta <= 0 OrElse (CveDevolucion > 0 And NuevaFactura = 1) Then
|
||||||
HdnVentaSaldo.Value = Total.ToString()
|
HdnVentaSaldo.Value = Total.ToString()
|
||||||
@@ -22071,6 +22134,9 @@ Partial Class Ventas
|
|||||||
Dim saldo = TxtTotal.Text.Replace(",", "").ToDouble - abonado
|
Dim saldo = TxtTotal.Text.Replace(",", "").ToDouble - abonado
|
||||||
'CVImporteContado.ValueToCompare = (saldo.FormatoNumero(2).ToDouble).ToString()
|
'CVImporteContado.ValueToCompare = (saldo.FormatoNumero(2).ToDouble).ToString()
|
||||||
|
|
||||||
|
LblDescuentoAdicional.Text = "0.00"
|
||||||
|
CalculaTotalesVenta()
|
||||||
|
|
||||||
CargaGridContado()
|
CargaGridContado()
|
||||||
UpContado.Update()
|
UpContado.Update()
|
||||||
End Sub
|
End Sub
|
||||||
@@ -22322,6 +22388,40 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
Dim VieneDeCotizacion As Boolean = False
|
||||||
|
If DtCotizacionesPS IsNot Nothing AndAlso DtCotizacionesPS.Rows.Count > 0 Then
|
||||||
|
VieneDeCotizacion = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
If DdlTipoComprobante.SelectedValue = "Ing" AndAlso (Not VieneDeCotizacion) AndAlso UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso DtPagos IsNot Nothing AndAlso TbDescuentosAdicionales.Visible Then
|
||||||
|
If TmpDT.SUMD("Descuento") > 0 AndAlso DtPagos.SUMD("Importe", "MesesSinIntereses <=0") = TxtTotal.Text.ToDecimal() Then
|
||||||
|
Dim TotalDescuento As Decimal = TmpDT.SUMD("Total", "Descuento > 0") * 0.05D
|
||||||
|
Dim RowDescuentos = TmpDT.Select("Descuento > 0")
|
||||||
|
|
||||||
|
If RowDescuentos IsNot Nothing Then
|
||||||
|
LblDescuentoAdicional.Text = TotalDescuento.FormatoNumero(2)
|
||||||
|
|
||||||
|
'Dim Row As DataRow = RowDescuentos(0)
|
||||||
|
'Row("Descuento") = Row("Descuento").ToString().ToDecimal() + TotalDescuento
|
||||||
|
|
||||||
|
'Dim TotalCalculableImpuestos As Decimal = (Row("Cantidad").ToString().ToDecimal() * Row("PU").ToString().ToDecimal()) - Row("Descuento").ToString().ToDecimal()
|
||||||
|
'Row("ImporteIVA") = (TotalCalculableImpuestos * Row("PorcentajeIVA").ToString().ToDecimal()).RoundSQL(2)
|
||||||
|
|
||||||
|
'BtnAgregarPago.Enabled = False
|
||||||
|
|
||||||
|
CalculaTotalesVenta()
|
||||||
|
|
||||||
|
Dim RowPago = DtPagos.Rows(0)
|
||||||
|
RowPago("Importe") = LblTotalAPagarAdicional.Text.ToDecimal()
|
||||||
|
|
||||||
|
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
LblDescuentoAdicional.Text = "0.00"
|
||||||
|
End If
|
||||||
|
UpPS.Update()
|
||||||
|
End If
|
||||||
|
|
||||||
CargaGridContado()
|
CargaGridContado()
|
||||||
UpContado.Update()
|
UpContado.Update()
|
||||||
|
|
||||||
@@ -22360,7 +22460,7 @@ Partial Class Ventas
|
|||||||
If (Not PermiteCredito OrElse RBLPago.SelectedValue = "2") AndAlso TienePagos AndAlso TxtTotal.Text.ToDecimal > 0 Then
|
If (Not PermiteCredito OrElse RBLPago.SelectedValue = "2") AndAlso TienePagos AndAlso TxtTotal.Text.ToDecimal > 0 Then
|
||||||
Dim TotalPago As Decimal = DtPagos.SUM("Importe").ToDecimal() + AmortizacionNC
|
Dim TotalPago As Decimal = DtPagos.SUM("Importe").ToDecimal() + AmortizacionNC
|
||||||
|
|
||||||
If TotalPago <> TxtTotal.Text.ToDecimal Then
|
If TotalPago <> (TxtTotal.Text.ToDecimal - LblDescuentoAdicional.Text.ToDecimal()) Then
|
||||||
If MostrarAlertas Then
|
If MostrarAlertas Then
|
||||||
Alert("La suma de los pagos debe ser igual al total de la venta.", TipoMensaje.MsgAdvertencia)
|
Alert("La suma de los pagos debe ser igual al total de la venta.", TipoMensaje.MsgAdvertencia)
|
||||||
End If
|
End If
|
||||||
@@ -29481,7 +29581,8 @@ Partial Class Ventas
|
|||||||
Dim PU As Decimal = If(AplicaPUEditado, Gv.FCTextBox("TxtPrecioEditado").Text.ToDecimal, Gv.DataKey("PU").ToDecimal)
|
Dim PU As Decimal = If(AplicaPUEditado, Gv.FCTextBox("TxtPrecioEditado").Text.ToDecimal, Gv.DataKey("PU").ToDecimal)
|
||||||
Dim Total As Decimal = (Cantidad * PU)
|
Dim Total As Decimal = (Cantidad * PU)
|
||||||
Dim TotalImpuestos As Decimal = (Cantidad * PU) - Descuento
|
Dim TotalImpuestos As Decimal = (Cantidad * PU) - Descuento
|
||||||
Dim ImporteIVA As Decimal = TotalImpuestos * Gv.DataKey("PorcentajeIVA").ToString().ToDecimal
|
Dim TotalCalculableImpuestosIVA = TotalImpuestos * (1 + Gv.DataKey("PorcentajeIEPS").ToString().ToDecimal)
|
||||||
|
Dim ImporteIVA As Decimal = TotalCalculableImpuestosIVA * Gv.DataKey("PorcentajeIVA").ToString().ToDecimal
|
||||||
Dim ImporteRetIVA As Decimal = TotalImpuestos * Gv.DataKey("PorcentajeRetIVA").ToString().ToDecimal
|
Dim ImporteRetIVA As Decimal = TotalImpuestos * Gv.DataKey("PorcentajeRetIVA").ToString().ToDecimal
|
||||||
Dim ImporteRetISR As Decimal = TotalImpuestos * Gv.DataKey("PorcentajeRetISR").ToString().ToDecimal
|
Dim ImporteRetISR As Decimal = TotalImpuestos * Gv.DataKey("PorcentajeRetISR").ToString().ToDecimal
|
||||||
Dim ImporteIEPS As Decimal = TotalImpuestos * Gv.DataKey("PorcentajeIEPS").ToString().ToDecimal
|
Dim ImporteIEPS As Decimal = TotalImpuestos * Gv.DataKey("PorcentajeIEPS").ToString().ToDecimal
|
||||||
@@ -35535,6 +35636,9 @@ Partial Class Ventas
|
|||||||
|
|
||||||
Protected Sub ChkEmitirComercioExterior_CheckedChanged(sender As Object, e As EventArgs)
|
Protected Sub ChkEmitirComercioExterior_CheckedChanged(sender As Object, e As EventArgs)
|
||||||
If CveVenta <= 0 OrElse EsCreaApartirDe Then
|
If CveVenta <= 0 OrElse EsCreaApartirDe Then
|
||||||
|
|
||||||
|
ViewState("AplicaComercioExterior") = ChkEmitirComercioExterior.Checked
|
||||||
|
|
||||||
If ChkEmitirComercioExterior.Checked Then
|
If ChkEmitirComercioExterior.Checked Then
|
||||||
DdlMoneda.SelectedValueExist("2")
|
DdlMoneda.SelectedValueExist("2")
|
||||||
CambiaMoneda()
|
CambiaMoneda()
|
||||||
|
|||||||
Reference in New Issue
Block a user