Generar OC a partir de una cotizacion y modificar precios

This commit is contained in:
2020-02-26 19:01:27 -07:00
parent e34df69643
commit 017f404b32
5 changed files with 112 additions and 11 deletions

View File

@@ -308,6 +308,9 @@
<%--<asp:LinkButton ID="LnkSaldarVenta" runat="server" CausesValidation="False" Text="<i class='fa fa-ban'></i> Saldar" data-toggle="confirmation" data-popout="true" data-original-title="¿Estás seguro que deseas saldar el Documento?" data-btn-ok-label="si" Visible="false" />--%>
<asp:HyperLink ID="HLSaldarVenta" NavigateUrl="#" Visible="false" data-toggle="modal" data-target="#ModalSaldarVenta" runat="server"><i class='fa fa-ban'></i> Saldar</asp:HyperLink>
</li>
<li id="LtGenerarOC" runat="server" visible="false">
<asp:LinkButton ID="LnkGenerarOC" OnClick="LnkGenerarOC_Click" title="Generar Orden de Compra!" runat="server"><i class="fa fa-tags"></i> Generar Orden de Compra</asp:LinkButton>
</li>
<asp:UpdatePanel ID="UPPDescontabilizar" runat="server" UpdateMode="Conditional">
<ContentTemplate>
@@ -3541,7 +3544,7 @@
<div style="max-height: 300px; overflow-y: auto;">
<asp:GridView ID="GVAnticipos" runat="server" AutoGenerateColumns="False" ClientIDMode="Static" EmptyDataText="No se encontraron Anticipos del Cliente"
ToolTip="Listado de Anticipos" CssClass="GVAnticipos table table-striped table-hover Widthall" data-height="300" Style="text-align: center;" GridLines="None"
DataKeyNames="ISTotal,Saldo,CveIE,Folio,Tipo,CveVenta,CveConceptoContable,CveConceptoContableAmor, TotalAnticipo, SubTotalAnticipo, IVAAnticipo, ImpuestosLocalesAnticipo, SubTotalAmortizacion, SubTotal, Original, IVA, RetIVA, RetISR, IdCtaContableNC,FolioFiscal, CveClasificacionNC, IdCtaContableNCSIG, TipoCambio,TipoCambioPago, CveMoneda,Fecha,SaldoSubTotal">
DataKeyNames="ISTotal,Saldo,CveIE,Folio,Tipo,CveVenta,CveConceptoContable,CveConceptoContableAmor, TotalAnticipo, SubTotalAnticipo, IVAAnticipo, ImpuestosLocalesAnticipo, SubTotalAmortizacion, SubTotal, Original, IVA, RetIVA, RetISR, IdCtaContableNC,FolioFiscal, CveClasificacionNC, IdCtaContableNCSIG, TipoCambio,TipoCambioPago,TipoCambioHoy, CveMoneda,Fecha,SaldoSubTotal">
<Columns>
<asp:TemplateField>
<ItemTemplate>

View File

@@ -3543,6 +3543,7 @@ Partial Class Ventas
' LbCancelarDocumentoManual.Visible = True
'End If
If Not CveEstatus.Contiene(4, 5, 12, 13, 20) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Egs", "Ant") AndAlso 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
@@ -4362,6 +4363,19 @@ Partial Class Ventas
CargaCodigoUnico()
'SI ES COTIZACION PUEDE GENERAR UNA OC PARA MODIFICAR LOS IMPORTES
If DdlTipoComprobante.SelectedValue = "Cot" AndAlso UsuarioActual.Empresa.Funcionalidad(583) = "1" Then
Dim DtOCGeneradas As DataTable = Nothing
If ObjVentas.GetVentasCotizacionesOC(Me.CveVenta, -1, UsuarioActual.CveEmpresa) Then
DtOCGeneradas = ObjVentas.DtResultados.Copy()
End If
If DtOCGeneradas IsNot Nothing AndAlso DtOCGeneradas.Rows.Count > 0 Then
LtGenerarOC.Visible = False
Else
LtGenerarOC.Visible = True
End If
End If
UpPS.Update()
UpContado.Update()
UpEstatus.Update()
@@ -11670,7 +11684,7 @@ Partial Class Ventas
If e.Row.DBCampo("Tipo").ToString = "NC" And e.Row.DataKey("CveVenta").ToString.ToEntero > 0 Then
If e.Row.DBCampo("CveMoneda").ToString.ToEntero = 2 Then
tipoCambio = e.Row.DataKey("TipoCambio").ToString.ToDecimal
tipoCambio = e.Row.DBCampo("TipoCambioHoy").ToString.ToDecimal
Else
tipoCambio = GlobalTipoCambio(e.Row.DataKey("Fecha").ToString.ToDate).ToDecimal
End If
@@ -11703,7 +11717,7 @@ Partial Class Ventas
maxsaldo = total
End If
e.Row.FCLiteral("MonedaVenta").Text = saldo.FormatoNumero(4)
e.Row.FCLiteral("MonedaVenta").Text = saldo.FormatoNumero(2)
e.Row.FCCheckBox("Chk" & e.Row.RowIndex).Attributes.Add("onclick", String.Format("chkAnt(this,{0},{1});", e.Row.FCTextBox("TxtAnticipo" & e.Row.RowIndex).ClientID, saldo))
e.Row.FCTextBox("TxtAnticipo" & e.Row.RowIndex).Attributes.Add("onKeyUp", String.Format("FnCambiaAnt({0},this,{1});", e.Row.FCCheckBox("Chk" & e.Row.RowIndex).ClientID, saldo))
e.Row.FCTextBox("TxtTC" & e.Row.RowIndex).Attributes.Add("onKeyUp", String.Format("CambioTipoMoneda({0},{1},{2},{3},{4});", e.Row.FCCheckBox("Chk" & e.Row.RowIndex).ClientID, e.Row.DataKey("Saldo"), e.Row.FCTextBox("TxtAnticipo" & e.Row.RowIndex).ClientID, e.Row.FCTextBox("TxtTC" & e.Row.RowIndex).ClientID, e.Row.DataKey("CveMoneda")))
@@ -11874,7 +11888,7 @@ Partial Class Ventas
tipoCambioVentaValuacion = If(TxtFecha.Text.ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, TxtTipoCambio.Text.ToDecimal)
PorcentajePago = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.DataKey("Original").ToDecimal
ElseIf DdlMoneda.SelectedValue.ToEntero = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then 'SI LA VENTA VIENE EN PESOS Y SE VA A PAGAR EN DOLARES
tipoCambioPago = gvr.DataKey("TipoCambio").ToDecimal() ' gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal
tipoCambioPago = gvr.DataKey("TipoCambioHoy").ToDecimal() ' gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal
tipoCambioVenta = 1
tipoCambioVentaValuacion = If(TxtFecha.Text.ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, TxtTipoCambio.Text.ToDecimal)
PorcentajePago = (gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal) / gvr.DataKey("Original").ToDecimal
@@ -24658,4 +24672,7 @@ Partial Class Ventas
' Return File
'End Function
Protected Sub LnkGenerarOC_Click(sender As Object, e As EventArgs)
Response.Redirect($"~/OC/OC.aspx?CveCotizacion={Me.CveVenta}&Tipo=OC")
End Sub
End Class