This commit is contained in:
2025-01-14 20:54:32 -07:00
9 changed files with 2490 additions and 37 deletions

View File

@@ -876,6 +876,34 @@ Partial Class Ventas_PVCobranza
If Not String.IsNullOrEmpty(MsgTimbrado) Then
msBuild.AppendFormat("<br/>{0}<br/>", MsgTimbrado)
End If
If respNC IsNot Nothing Then
For Each dr As DataRow In respNC.Factura.DtAnticiposAplicados.Rows
msBuild.AppendLine($"<br><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=AMORTIZACIONHIS&CVEIE={0}&CVEVENTA={1}&CVECLIENTE={2}&CVEVENTAAMORTIZADA={3}&MONTO={4}&SALDO={5}",
dr("CveIE").ToString,
dr("CveVenta").ToString,
respNC.Factura.CveCliente,
respNC.CveVenta,
respNC.Factura.Total,
(respNC.Factura.Total - respNC.Factura.DtAnticiposAplicados.SUM("Importe"))))}"">Imprimir historial {dr("Folio").ToString}</a><br/>")
Next
Else
For Each dr As DataRow In respFactura.Factura.DtAnticiposAplicados.Rows
msBuild.AppendLine($"<br><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=AMORTIZACIONHIS&CVEIE={0}&CVEVENTA={1}&CVECLIENTE={2}&CVEVENTAAMORTIZADA={3}&MONTO={4}&SALDO={5}",
dr("CveIE").ToString,
dr("CveVenta").ToString,
respFactura.Factura.CveCliente,
respFactura.CveVenta,
respFactura.Factura.Total,
(respFactura.Factura.Total - respFactura.Factura.DtAnticiposAplicados.SUM("Importe"))))}"">Imprimir historial {dr("Folio").ToString}</a><br/>")
Next
End If
Else
msBuild.Append($"Pago Registrado correctamente.<br/><br/> <a href=""/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1&TICKET=1&REGENERAR=1", CveVenta))}"" class='Texto'>Imprimir ticket</a>")
End If
@@ -992,6 +1020,13 @@ Partial Class Ventas_PVCobranza
End If
Dim ObjFactura = Modelos.Factura.CrearVentaNueva(UsuarioActual, VentaRemision.CveSubProyecto, VentaRemision.CveCliente, VentaRemision.CveMoneda, "Ing")
ObjFactura.CveMoneda = VentaRemision.CveMoneda
If ObjFactura.CveMoneda = 2 Then
ObjFactura.TipoCambio = GlobalTipoCambio(Now).ToString().ToDecimal()
Else
ObjFactura.TipoCambio = 1
End If
ObjFactura.RemisionesLista = RemisionesLista
ObjFactura.DtRemisionesPS = DtRemisionesPS
@@ -1132,7 +1167,7 @@ Partial Class Ventas_PVCobranza
SbAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF Factura</a></li></ul><br/>", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", Retorno.CveVenta)))
For Each dr As DataRow In DtAnticipos.Rows
SBAmortizaciones.AppendLine($"<br><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=AMORTIZACIONHIS&CVEIE={0}&CVEVENTA{1}&CVECLIENTE={2}&CVEVENTAAMORTIZADA={3}&MONTO={4}&SALDO={5}",
SBAmortizaciones.AppendLine($"<br><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=AMORTIZACIONHIS&CVEIE={0}&CVEVENTA={1}&CVECLIENTE={2}&CVEVENTAAMORTIZADA={3}&MONTO={4}&SALDO={5}",
dr("CveIE").ToString,
dr("CveVenta").ToString,
Retorno.Factura.CveCliente,
@@ -1199,6 +1234,7 @@ Partial Class Ventas_PVCobranza
End If
Return Retorno
End Function
Private Function ValidateString(texto As String, contenidoValidar As String) As Boolean
@@ -1213,6 +1249,12 @@ Partial Class Ventas_PVCobranza
Try
Dim ObjNC = Modelos.Factura.CrearVentaNueva(UsuarioActual, Venta.CveSubProyecto, Venta.CveCliente, Venta.CveMoneda, "Egs")
ObjNC.CveMoneda = Venta.CveMoneda
If ObjNC.CveMoneda = 2 Then
ObjNC.TipoCambio = GlobalTipoCambio(Now).ToString().ToDecimal()
Else
ObjNC.TipoCambio = 1
End If
Dim Total As Decimal = TxtNCDev.Text.ToDecimal()
Dim subTotal As Decimal = (Total / (1D + Venta.PorcentajeIVA))
@@ -1391,6 +1433,10 @@ Partial Class Ventas_PVCobranza
OnError("Ocurrió un error al generar el timbrado", ex)
End Try
If Not String.IsNullOrEmpty(MsgErrorTimbrado) Then
GuardaLogAD(MsgErrorTimbrado, Archivo:="LogTimbrado")
End If
Return MsgErrorTimbrado
End Function

View File

@@ -108,6 +108,9 @@
padding-left: 28px;
}
.titulops {
width: 300px !important;
}
.GVAnticipos input {
text-align: right;
@@ -411,6 +414,9 @@
<asp:LinkButton ID="LnkCalcularPromociones" runat="server" CausesValidation="False" Text="<i class='fa fa-tag'></i> Aplicar promociones" OnClick="LnkCalcularPromociones_Click"
data-toggle="confirmation" data-popout="true" data-original-title="¿Aplicar Promociones?" data-btn-ok-label="si" />
</li>
<li>
<asp:LinkButton ID="LbVerificarExistencia" Visible="false" runat="server"><i class='fa fa-list-alt'></i>Verificar Existencias</asp:LinkButton>
</li>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="LnkImprimir" EventName="Click" />
@@ -1982,7 +1988,7 @@
<asp:TemplateField>
<HeaderTemplate>Producto</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlPS" runat="server" Text='<%# Eval("CodigoPS") %>'></asp:Literal>
<asp:Literal ID="LtlPS" runat="server" Text='<%# Eval("CodigoPS") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Serie" Visible="false">
@@ -9281,6 +9287,29 @@
</div>
</div>
<div id="DivModalExistenciaTotal" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Existencias</h4>
</div>
<div class="modal-body">
<asp:UpdatePanel runat="server" ID="UPExist" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvExist" runat="server" AutoGenerateColumns="true" GridLines="None" BorderWidth="0" CssClass="table table-striped table-hover Widthall">
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</div>
</div>
</div>
</div>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">

View File

@@ -5461,6 +5461,10 @@ Partial Class Ventas
UPCondicionesPago.Update()
End If
If UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso DbRowVenta("TipoDocto").ToString().Contiene("Cot", "Rem") Then
LbVerificarExistencia.Visible = True
End If
'ESCONDE ACCIONES
LnkRemisiones.Visible = False
LnkPedido2SinFacturar.Visible = False
@@ -40627,5 +40631,70 @@ Partial Class Ventas
End If
End Sub
Private Sub LbVerificarExistencia_Click(sender As Object, e As EventArgs) Handles LbVerificarExistencia.Click
'RegistraScript(String.Format("AbrirVentana('/Inventarios/PopUpExistenciasAlmacenDT.aspx?CveOrdenCompra={0}',800,547,'N');", CveOrdenCompra))
VerificarExistencias()
End Sub
Private Sub VerificarExistencias()
Dim objInv As New ClsInventarios
Dim tmpDTPS As DataTable = Nothing
If objInv.GetExistenciasPSVenta(CveVenta, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
tmpDTPS = objInv.DtResultados.Copy()
End If
objInv.Dispose()
If tmpDTPS IsNot Nothing Then
' limpio los almacenes donde no tiene ningun producto existencia
For i As Integer = tmpDTPS.Columns.Count - 1 To 1 Step -1
If Not tmpDTPS.Columns(i).ColumnName.Contiene("Producto") AndAlso tmpDTPS.SUM(String.Format("[{0}]", tmpDTPS.Columns(i).ColumnName)) = 0 Then
tmpDTPS.Columns.RemoveAt(i)
End If
Next
Dim DtExistencias = tmpDTPS.Clone()
For i As Integer = 0 To DtExistencias.Columns.Count - 1
If DtExistencias.Columns(i).DataType <> GetType(String) Then DtExistencias.Columns(i).DataType = GetType(String)
Next
For Each dr As DataRow In tmpDTPS.Rows
DtExistencias.ImportRow(dr)
Next
'FORMATEAR NUEVO DT
For j = 0 To DtExistencias.Rows.Count - 1
For i As Integer = DtExistencias.Columns.Count - 1 To 1 Step -1
If Not DtExistencias.Columns(i).ColumnName.Contiene("Producto") Then
If DtExistencias.Rows(j)(i).ToString().ToEntero() = 0 Then
DtExistencias.Rows(j)(i) = "-"
Else
DtExistencias.Rows(j)(i) = DtExistencias.Rows(j)(i).ToString().Replace(".0000", "")
End If
End If
Next
Next
GvExist.DataSource = DtExistencias
GvExist.DataBind()
'GvExist.Columns(0).ItemStyle.Width = New Unit(200, UnitType.Pixel)
'ORDENA HACIA LA DERECHA LAS CANTIDAD - OJO!! NO SE USO GV.COLUMNS.COUNT PORQUE LAS COLUMNAS GENERADAS EN BEHIND NO LAS RECONOCE
For index As Integer = 0 To DtExistencias.Columns.Count - 1
For Each gvr As GridViewRow In GvExist.Rows
If index = 0 Then
gvr.Cells(index).CssClass = "titulops"
Else
gvr.Cells(index).HorizontalAlign = HorizontalAlign.Right
End If
Next
Next
End If
RegistraScript("$('#DivModalExistenciaTotal').modal('show');")
UPExist.Update()
End Sub
End Class