This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2019-08-22 02:29:45 -07:00
28 changed files with 9908 additions and 9733 deletions

View File

@@ -160,7 +160,7 @@
<asp:BoundField DataField="PrecioLista" NullDisplayText="N/A" ItemStyle-Width="10%" HeaderText="Importe" DataFormatString="$ {0:N2}" ItemStyle-HorizontalAlign="right" />
<asp:TemplateField HeaderText="">
<ItemTemplate>
<asp:TextBox ID="TxtPrecio" runat="server" CssClass="CssCamviaPrecio" MaxLength="39" Width="60px"></asp:TextBox>
<asp:TextBox ID="TxtPrecio" runat="server" Text='<%# Eval("PrecioLista", "{0:N2}")%>' CssClass="CssCamviaPrecio" MaxLength="39" Width="60px"></asp:TextBox>
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtPrecio" FilterType="Numbers,Custom" ValidChars="." />
<asp:RegularExpressionValidator ID="REVTxtPrecio" runat="server" ControlToValidate="TxtPrecio" Display="None" EnableClientScript="True" ErrorMessage="El campo <b>''PrecioLista''</b> no tiene el formato correcto, por favor corrija e intente de nuevo (Solo formato numérico)." ValidationGroup="GrpGuardar" ValidationExpression="^[0-9]{1,15}(?:\.[0-9]{1,4})?$" />
<ajax:ValidatorCalloutExtender ID="VCPrecio" runat="server" HighlightCssClass="vco" TargetControlID="REVTxtPrecio" Width="300px"></ajax:ValidatorCalloutExtender>
@@ -173,7 +173,7 @@
</asp:TemplateField>
<asp:TemplateField HeaderText="">
<ItemTemplate>
<asp:TextBox ID="TxtPrecioMinimo" runat="server" CssClass="CssCamviaPrecio" MaxLength="39" Width="60px"></asp:TextBox>
<asp:TextBox ID="TxtPrecioMinimo" runat="server" Text='<%# Eval("PrecioMinimo", "{0:N2}")%>' CssClass="CssCamviaPrecio" MaxLength="39" Width="60px"></asp:TextBox>
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtPrecioMinimo" FilterType="Numbers,Custom" ValidChars="." />
<asp:RegularExpressionValidator ID="REVTxtPrecioMinimo" runat="server" ControlToValidate="TxtPrecioMinimo" Display="None" EnableClientScript="True" ErrorMessage="El campo <b>''PrecioLista''</b> no tiene el formato correcto, por favor corrija e intente de nuevo (Solo formato numérico)." ValidationGroup="GrpGuardar" ValidationExpression="^[0-9]{1,15}(?:\.[0-9]{1,4})?$" />
<ajax:ValidatorCalloutExtender ID="VCTxtPrecioMinimo" runat="server" HighlightCssClass="vco" TargetControlID="REVTxtPrecioMinimo" Width="300px"></ajax:ValidatorCalloutExtender>
@@ -186,7 +186,8 @@
<asp:BoundField DataField="ImporteAnterior" NullDisplayText="N/A" ItemStyle-Width="10%" HeaderText="Importe Anterior" DataFormatString="$ {0:N2}" ItemStyle-HorizontalAlign="right" />
<asp:BoundField DataField="FechaModificacion" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-Width="10%" HeaderText="Fecha Modificación" />
<asp:BoundField DataField="PrecioMinimoAnterior" NullDisplayText="N/A" ItemStyle-Width="10%" HeaderText="Precio Mínimo Anterior" DataFormatString="$ {0:N2}" ItemStyle-HorizontalAlign="right" />
<asp:BoundField DataField="FechaModificacion" DataFormatString="{0:dd/MM/yyyy hh:mm:ss}" ItemStyle-Width="10%" HeaderText="Fecha Modificación" />
<asp:BoundField DataField="UsuarioModifico" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-Width="10%" HeaderText="Usuario Modificó" />
<asp:BoundField DataField="Porcentaje" NullDisplayText="N/A" ItemStyle-Width="10%" DataFormatString="%{0}" HeaderText="Porcentaje" ItemStyle-HorizontalAlign="right" />
<asp:BoundField DataField="FechaIng" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-Width="10%" HeaderText="Fecha Ingreso" />
@@ -199,7 +200,7 @@
</ContentTemplate>
</asp:UpdatePanel>
<div id="ModalActualizaPrecios" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<div class="modal-dialog" style="width: 900px; margin: auto;">
<div class="modal-content">
<div class="modal-header ">
@@ -216,21 +217,17 @@
<div class="modal-body">
<asp:UpdatePanel runat="server" ID="UpModalActualizaPrecios" UpdateMode="Conditional">
<ContentTemplate>
<div class="col-md-12">
<div class="col-md-4" style="text-align: left">
<input id="ChkSeleccionarTodos" type="checkbox" title="Seleccionar Todos" onclick="SeleccionarTodosChkGvSucursa()" />Seleccionar Todos
<div class="col-md-3" style="text-align: left">
<input id="ChkSeleccionarTodos" type="checkbox" title="Seleccionar Todos" onclick="SeleccionarTodosChkGvSucursa()" /> Seleccionar Todos
</div>
<div class="col-md-8" style="text-align: right">
<div class="col-md-9" style="text-align: right">
<label>Aplicar precio mínimo</label>
<asp:TextBox ID="TxtAplicarPrecio" runat="server" Width="60px" MaxLength="39"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="FilTxtAplicarPrecio" TargetControlID="TxtAplicarPrecio" runat="server" FilterType="Numbers,Custom" ValidChars="." InvalidChars="-+" />
<a id="lnkAplicarPrecioSucursales" runat="server" class="btn btn-default" onclick="CambiaPrecioModal();">Aplicar</a>
</div>
</div>
<asp:GridView ID="gvSucursal" runat="server" AutoGenerateColumns="False" DataKeyNames="CveSubProyecto" EmptyDataText="No se encontraron Sucursales" ToolTip="Listado de Sucursales habilitadas para Productos o Servicios"
CssClass="table table-striped table-smallpadding table-advance table-hover Widthall" Style="text-align: center;" GridLines="None">
<Columns>
@@ -240,7 +237,7 @@
<asp:HiddenField ID="hdnEnBD" runat="server" Value='<%# If (IsDBNull(Eval("CvePS")),0,1) %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Sucursal">
<asp:TemplateField HeaderText="Sucursal" ItemStyle-Width="30%">
<ItemTemplate>
<asp:Literal ID="LtlSucursal" runat="server" Text='<%# Eval("SubProyecto", "{0}") %>'></asp:Literal>
</ItemTemplate>
@@ -264,6 +261,9 @@
<asp:TextBox ID="TxtMaximo" Style="text-align: right" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Maximo")%>' ValidationGroup="GrpEditGuardarO" Width="100px"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Precio Mínimo Anterior" DataField="PrecioMinimoAnterior" DataFormatString="{0:N2}" />
<asp:BoundField HeaderText="Usuario Modificó" DataField="Usuario" />
<asp:BoundField HeaderText="Fecha Modificación" DataField="FechaModificacion" DataFormatString="{0:dd/MM/yyyy hh:mm:ss}" />
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />

View File

@@ -207,7 +207,7 @@
<asp:BoundField DataField="Codigo" HeaderText="Número de Parte / Código:" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="10%" />
<asp:HyperLinkField ItemStyle-CssClass="Izquierda Texto" HeaderText="Producto o Servicio" DataNavigateUrlFormatString="/Ventas/ProductosServicios.aspx?CvePS={0}" DataTextField="PS" DataNavigateUrlFields="CvePS" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="30%" />
<asp:BoundField DataField="Precio" HeaderText="Precio" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="10%" />
<asp:BoundField DataField="AplicaParaVentap" HeaderText="Aplica Para Venta" Visible="false" ItemStyle-Width="10%" />
<asp:BoundField DataField="AplicaParaVentap" HeaderText="Aplica Para Venta" Visible="false" ItemStyle-Width="20px" />
<%-- <asp:BoundField DataField="Estado" HeaderText="Estado" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center" />--%>
<asp:TemplateField HeaderText="Estado" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center">
<ItemTemplate>

View File

@@ -2700,8 +2700,27 @@
<div class="row">
<div class="col-md-12">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlFacturas" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="SerieFolio" DataValueField="CveVenta" OnSelectedIndexChanged="DdlFacturas_SelectedIndexChanged" Width="100%" AutoPostBack="true">
</asp:DropDownList>
<label for="<%= DdlFacturas.ClientID.ToString()%>">Facturas:</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-9">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlPSAjuste" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="PSCodigo" DataValueField="CvePS" OnSelectedIndexChanged="DdlPSAjuste_selectedindexchange" Width="100%" AutoPostBack="true">
</asp:DropDownList>
<label for="<%= DdlPSAjuste.ClientID.ToString()%>">Producto/Servicio a Recibir:</label>
<ADS:Dropdownlost runat="server" ID="DdlPSAjuste" CssStyle="width: 100%;" CssClassDdl="select2me form-control" DataTextField="PSCodigo" DataValueField="CvePS" Onselectedindexchange="DdlPSAjuste_selectedindexchange" />
</div>
</div>
<div class="col-md-3">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtPUFactura" CssClass="form-control" runat="server" MaxLength="50" ></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVPUFactura" runat="server" ControlToValidate="TxtPUFactura" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''PU Factura''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEPUFactura" runat="server" HighlightCssClass="vco" TargetControlID="RFVPUFactura"></ajax:ValidatorCalloutExtender>
<ajax:FilteredTextBoxExtender ID="FTBEPUFactura" runat="server" TargetControlID="TxtPUFactura" FilterType="Custom, Numbers" ValidChars="." />
<label for="<%= TxtPUFactura.ClientID.ToString()%>">PU Factura:</label>
</div>
</div>
</div>
@@ -2811,7 +2830,7 @@
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="col-md-3">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtPoliza" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
<%--<asp:RequiredFieldValidator ID="RFVPoliza" runat="server" ControlToValidate="TxtPoliza" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Poliza''</b> es necesario, por favor ingréselo." ValidationGroup="VGMAjuste"></asp:RequiredFieldValidator>--%>
@@ -2828,6 +2847,9 @@
<label for="<%= TxtImporteAjuste.ClientID.ToString()%>">Importe:</label>
</div>
</div>
<div class="col-md-3">
<asp:Button ID="BtnCalcularImporteAjuste" CssClass="btn green-haze btn-outline btn-circle btn-sm" OnClick="BtnCalcularImporteAjuste_Click" runat="server" Text="Recalcular" />
</div>
</div>
</div>
</div>

View File

@@ -924,6 +924,14 @@ Partial Class PV
ViewState("DtPagos") = value
End Set
End Property
Private Property DtPUFacturas As DataTable
Get
Return CType(ViewState("DtPUFacturas"), DataTable)
End Get
Set(value As DataTable)
ViewState("DtPUFacturas") = value
End Set
End Property
#End Region
#Region "PROPIEDADES ACUMULADORES"
@@ -996,6 +1004,8 @@ Partial Class PV
EsCreaApartirDe = False
RequiereAlmacenDestino = False
TmpDTComplementos = New DataTable
DtPUFacturas = New DataTable
Modalidad = ""
Index = -1
@@ -1680,6 +1690,7 @@ Partial Class PV
UpComplementos.Update()
CargarAlmacenes()
CargaFacturasAjuste()
Else
Alert("El cliente solicitado no existe, por favor intente de nuevo.", TipoMensaje.MsgError)
End If
@@ -2684,6 +2695,10 @@ Partial Class PV
#End Region
#Region "SELECTED INDEX CHANGE"
Protected Sub DdlFacturas_SelectedIndexChanged(sender As Object, e As EventArgs)
CargaPSAjuste()
End Sub
Private Sub DdlPSIndexChange(CvePSParametro As Integer, Ddl As ADServerControl.Dropdownlost)
If Not CveCliente > 0 Then
@@ -4848,9 +4863,22 @@ Partial Class PV
TmpDTAjustes.Columns.Add("Cantidad", GetType(Decimal))
TmpDTAjustes.Columns.Add("CveUM", GetType(Integer))
TmpDTAjustes.Columns.Add("CveVentaDetalle", GetType(Integer))
TmpDTAjustes.Columns.Add("CveVenta", GetType(Integer))
TmpDTAjustes.Columns.Add("PUFactura", GetType(Integer))
End Sub
Private Sub CargaFacturasAjuste()
DdlFacturas.Items.Clear()
Dim ObjVenta As New ClsVentas
If ObjVenta.GetVentas(UsuarioActual.CveEmpresa, "Ing", "-1", -1, "-1", CveCliente, -1, -1, -1, "-1", "-1", "-1", CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then
DdlFacturas.DataSource = ObjVenta.DtResultados
DdlFacturas.Items.Insert(0, New ListItem("Seleccione", "-1"))
End If
ObjVenta.Dispose()
DdlFacturas.DataBind()
UpAjuste.Update()
End Sub
Private Sub CargaAjuste()
Dim ObjAcum As New ClsAcumuladores
@@ -4859,6 +4887,9 @@ Partial Class PV
DdlFolioGarantia.Items.Insert(0, New ListItem("Seleccione", "-1"))
End If
DdlFacturas.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlTipoUso.DataSource = GlobalDTAcumTiposUso.FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa}")
DdlTipoUso.Items.Insert(0, New ListItem("Seleccione", "-1"))
@@ -4872,19 +4903,9 @@ Partial Class PV
DdlTipoUso.DataBind()
DdlTipoDefecto.DataBind()
GvRecepcionUsados.DataBind()
DdlFacturas.DataBind()
DdlPSAjuste.setEsWebService(UsuarioActual.Empresa.Funcionalidad(141) = "1")
If UsuarioActual.Empresa.Funcionalidad(141) = "1" Then
DdlPSAjuste.ddlWS.Attributes.Add("data-cveclasificacion", "-1")
DdlPSAjuste.SelectedText = "Seleccione"
DdlPSAjuste.SelectedValue = "-1"
Else
DdlPSAjuste.ddl.Items.Clear()
DdlPSAjuste.ddl.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
DdlPSAjuste.ddl.DataBind()
DdlPSAjuste.ddl.Items.Insert(0, New ListItem("Seleccione", "-1"))
End If
CargaPSAjuste()
CreaDTmpDTAjustes()
CreaDTmpDTRecepcionUsados()
@@ -4894,6 +4915,29 @@ Partial Class PV
End Sub
Private Sub CargaPSAjuste()
DdlPSAjuste.Items.Clear()
DtPUFacturas.Rows.Clear()
If DdlFacturas.SelectedValue.ToEntero > 0 Then
TxtPUFactura.Enabled = False
Dim ObjVenta As New ClsVentas
If ObjVenta.GetVentaDetalle(DdlFacturas.SelectedValue.ToEntero) Then
DdlPSAjuste.DataSource = ObjVenta.DtResultados
DtPUFacturas = ObjVenta.DtResultados
End If
ObjVenta.Dispose()
Else
TxtPUFactura.Enabled = True
TxtPUFactura.Text = ""
DdlPSAjuste.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
End If
DdlPSAjuste.DataBind()
DdlPSAjuste.Items.Insert(0, New ListItem("Seleccione", "-1"))
DtPUFacturas.AcceptChanges()
UpAjuste.Update()
End Sub
Private Sub Ajuste()
LimpiaAjuste()
If TmpDTAjustes IsNot Nothing AndAlso TmpDTAjustes.FiltraParametros($"ConsecutivoVenta = {ConsecutivoVenta}").Rows.Count > 0 Then
@@ -4920,15 +4964,22 @@ Partial Class PV
TxtPorcentajeAjuste.Text = ""
TxtPoliza.Text = ""
TxtImporteAjuste.Text = ""
DdlPSAjuste.SelectedValue = "-1"
DdlPSAjuste.SelectedText = "Seleccione"
DdlPSAjuste.SelectedIndex = 0
ChkAjuste.Checked = False
DivAjuste.Visible = False
End Sub
Private Sub CargaAjusteDetalle()
Dim Dr As DataRow = TmpDTAjustes.FiltraParametros($"ConsecutivoVenta = {ConsecutivoVenta}").Rows(0)
Dim Dr As DataRow = Nothing
IndexAjuste = 0
For Each Dr2 As DataRow In TmpDTAjustes.Rows
If Dr2("ConsecutivoVenta").ToString.ToEntero = ConsecutivoVenta Then
Dr = Dr2
Exit For
End If
IndexAjuste += 1
Next
If Dr IsNot Nothing Then
IndexAjuste = TmpDTAjustes.Rows.IndexOf(Dr)
DdlFolioGarantia.SelectedValueExist(Dr("CveFolioGarantia").ToString)
@@ -4943,8 +4994,11 @@ Partial Class PV
TxtPorcentajeAjuste.Text = Dr("PorcentajeAjuste").ToString
TxtPoliza.Text = Dr("NumPoliza").ToString
TxtImporteAjuste.Text = Dr("Importe").ToString
DdlPSAjuste.SelectedValue = Dr("CvePS").ToString
DdlPSAjuste.SelectedText = Dr("PS").ToString
DdlFacturas.SelectedValueExist(Dr("CveVenta").ToString)
CargaPSAjuste()
DdlPSAjuste.SelectedValueExist(Dr("CvePS").ToString)
TxtPUFactura.Text = Dr("PUFactura").ToString.ToDecimal.FormatoNumero(4)
TxtPUFactura.Enabled = Not Dr("CveVenta").ToString.ToEntero > 0
End If
End Sub
Protected Sub BtnCalculaMesesUso_Click(sender As Object, e As EventArgs)
@@ -4957,6 +5011,23 @@ Partial Class PV
End Sub
Protected Sub DdlPSAjuste_selectedindexchange(sender As Object, e As EventArgs)
If DdlPSAjuste.SelectedValue.ToEntero > 0 AndAlso DdlFacturas.SelectedValue.ToEntero > 0 Then
Dim Index As Integer = DdlPSAjuste.SelectedIndex
Dim Contador As Integer = 1
Dim PUFactura As Decimal = 0
For Each Dr As DataRow In DtPUFacturas.Rows
If Index = Contador Then
PUFactura = Dr("PU").ToString.ToDecimal
End If
Contador += 1
Next
TxtPUFactura.Text = PUFactura.FormatoNumero(4)
End If
If Not DdlPSAjuste.SelectedValue.ToEntero > 0 AndAlso DdlFacturas.SelectedValue.ToEntero > 0 Then
TxtPUFactura.Text = ""
End If
CalculaPorcentajeAjuste()
End Sub
@@ -4964,6 +5035,10 @@ Partial Class PV
CalculaPorcentajeAjuste()
End Sub
Protected Sub BtnCalcularImporteAjuste_Click(sender As Object, e As EventArgs)
CalculaPorcentajeAjuste()
End Sub
Private Sub CalculaPorcentajeAjuste()
If DdlTipoUso.SelectedValue.ToEntero > 0 AndAlso DdlPSAjuste.SelectedValue.ToEntero > 0 AndAlso TxtMesesUso.Text <> "" Then
Dim CveMarca As Integer = -1
@@ -4974,7 +5049,7 @@ Partial Class PV
If ObjAcum.GarantiasMesesGet(-1, UsuarioActual.CveEmpresa, CveMarca, DdlTipoUso.SelectedValue.ToEntero, TxtMesesUso.Text.ToEntero) Then
If ObjAcum.DtResultados.Rows.Count > 0 Then
TxtPorcentajeAjuste.Text = (ObjAcum.DtResultados.Rows(0)("Valor").ToString.ToDouble / 100).ToString
TxtImporteAjuste.Text = (TxtPorcentajeAjuste.Text.ToDouble * AsignaPUFijo(DdlPSAjuste.SelectedValue.ToEntero)).FormatoNumero
TxtImporteAjuste.Text = (TxtPorcentajeAjuste.Text.ToDouble * TxtPUFactura.Text.ToDouble).FormatoNumero
End If
End If
ObjAcum.Dispose()
@@ -4982,30 +5057,30 @@ Partial Class PV
UpAjuste.Update()
End Sub
Private Function AsignaPUFijo(CvePS As Integer) As Double
Select Case CvePS
Case 360449
Return 500
Case 360450
Return 1000
Case 360451
Return 2000
Case 360452
Return 3000
Case 360453
Return 4000
Case 360455
Return 5000
Case 365353
Return 6000
Case 360454
Return 1500 'lth. acumulador
Case 370810
Return 2500 'lth. 1872
Case Else
Return 5000
End Select
End Function
'Private Function AsignaPUFijo(CvePS As Integer) As Double
' Select Case CvePS
' Case 360449
' Return 500
' Case 360450
' Return 1000
' Case 360451
' Return 2000
' Case 360452
' Return 3000
' Case 360453
' Return 4000
' Case 360455
' Return 5000
' Case 365353
' Return 6000
' Case 360454
' Return 1500 'lth. acumulador
' Case 370810
' Return 2500 'lth. 1872
' Case Else
' Return 5000
' End Select
'End Function
Private Sub GuardaAjuste()
Dim CargoAnterior As Double = 0
@@ -5015,7 +5090,7 @@ Partial Class PV
Row = TmpDTAjustes.NewRow
Row("CveFolioGarantia") = DdlFolioGarantia.SelectedValue.ToEntero
Row("CveTipoUso") = DdlTipoUso.SelectedValue.ToEntero
Row("CveTipoDefecto") = DdlTipoDefecto.ToEntero
Row("CveTipoDefecto") = DdlTipoDefecto.SelectedValue.ToEntero
Row("CodigoEnsamble") = TxtCodEnsamble.Text
Row("CodigoLinea") = TxtCodLinea.Text
Row("CodigoInspeccion") = TxtCodInspeccion.Text
@@ -5027,7 +5102,9 @@ Partial Class PV
Row("Importe") = TxtImporteAjuste.Text.ToDouble
Row("ConsecutivoVenta") = ConsecutivoVenta
Row("CvePS") = DdlPSAjuste.SelectedValue
Row("PS") = DdlPSAjuste.SelectedText
Row("PS") = DdlPSAjuste.SelectedItem.Text
Row("CveVenta") = DdlFacturas.SelectedValue
Row("PUFactura") = TxtPUFactura.Text.ToDouble
Row("Cantidad") = 1
Dim CveUM As Integer = -1
If DdlPSAjuste.SelectedValue.ToEntero > 0 Then
@@ -5043,7 +5120,7 @@ Partial Class PV
ElseIf ModalidadAjuste = "U" Then
TmpDTAjustes.Rows(IndexAjuste)("CveFolioGarantia") = DdlFolioGarantia.SelectedValue.ToEntero
TmpDTAjustes.Rows(IndexAjuste)("CveTipoUso") = DdlTipoUso.SelectedValue.ToEntero
TmpDTAjustes.Rows(IndexAjuste)("CveTipoDefecto") = DdlTipoDefecto.ToEntero
TmpDTAjustes.Rows(IndexAjuste)("CveTipoDefecto") = DdlTipoDefecto.SelectedValue.ToEntero
TmpDTAjustes.Rows(IndexAjuste)("CodigoEnsamble") = TxtCodEnsamble.Text
TmpDTAjustes.Rows(IndexAjuste)("CodigoLinea") = TxtCodLinea.Text
TmpDTAjustes.Rows(IndexAjuste)("CodigoInspeccion") = TxtCodInspeccion.Text
@@ -5055,7 +5132,9 @@ Partial Class PV
TmpDTAjustes.Rows(IndexAjuste)("Importe") = TxtImporteAjuste.Text.ToDouble
TmpDTAjustes.Rows(IndexAjuste)("ConsecutivoVenta") = ConsecutivoVenta
TmpDTAjustes.Rows(IndexAjuste)("CvePS") = DdlPSAjuste.SelectedValue
TmpDTAjustes.Rows(IndexAjuste)("PS") = DdlPSAjuste.SelectedText
TmpDTAjustes.Rows(IndexAjuste)("PS") = DdlPSAjuste.SelectedItem.Text
TmpDTAjustes.Rows(IndexAjuste)("CveVenta") = DdlFacturas.SelectedValue
TmpDTAjustes.Rows(IndexAjuste)("PUFactura") = TxtPUFactura.Text.ToDouble
TmpDTAjustes.Rows(IndexAjuste)("Cantidad") = 1
Dim CveUM As Integer = -1
If DdlPSAjuste.SelectedValue.ToEntero > 0 Then
@@ -5082,7 +5161,7 @@ Partial Class PV
End If
End If
Dr("Descuento") = Math.Round((AsignaPUFijo(DdlPSAjuste.SelectedValue.ToEntero) - TxtImporteAjuste.Text.ToDouble) - (CargoActual - CargoAnterior), NumeroDecimales)
Dr("Descuento") = Math.Round((TxtPUFactura.Text.ToDouble - TxtImporteAjuste.Text.ToDouble) - (CargoActual - CargoAnterior), NumeroDecimales)
Dim TotalCalculableImpuestos As Decimal = (Dr("Cantidad").ToString.ToDecimal * (Dr("PU").ToString.ToDecimal)) - Dr("Descuento").ToString.ToDecimal
Dr("ImporteIVA") = Math.Round(Dr("PorcentajeIVA").ToString.ToDecimal * TotalCalculableImpuestos, NumeroDecimales)
@@ -5372,7 +5451,7 @@ Partial Class PV
For Each drowPsTamaños As DataRow In DTPSTemp.Rows
' Modalidad = "A"
Modalidad = "A"
If drowPsTamaños("PU").ToString.ToDecimal > 0 Then
AgregarProductoServicio(drowPsTamaños("Cantidad").ToString.ToEntero, drowPsTamaños("CveUnidadMedida").ToString.ToEntero, drowPsTamaños("UnidadMedida").ToString,
drowPsTamaños("CveClacificacion").ToString.ToEntero, drowPsTamaños("Clacificacion").ToString, drowPsTamaños("CvePS").ToString.ToEntero,
@@ -5390,4 +5469,6 @@ Partial Class PV
#End Region
End Class

View File

@@ -8186,8 +8186,9 @@ Partial Class Ventas
Else
'SI LA FACTURA VIENE DE SER CANCELADA SISTEMA CUANDO SE REFACTURO NO HAY QUE RELACIONAR
If CveEstatusFacturaPadre <> 4 Then
If (CveEstatusFacturaPadre > 0 AndAlso CveEstatusFacturaPadre <> 4) OrElse (DtVentasNC IsNot Nothing AndAlso DtVentasNC.Rows.Count > 0) Then
If Obj.CveTipoRelacion > 0 Then
Select Case Obj.CveTipoRelacion
Case 1
Timbre.CFDIRelacionados.TipoRelacion = "01"
@@ -10214,7 +10215,11 @@ Partial Class Ventas
If ObjConta.ValidacionPrePolizaCuadre(ObjFactura.CvePrePoliza, 2) Then
If ObjConta.ValorPolizaDescuadre > 0 Then
'ErrorPrepoliza = True
If ObjConta.ValorPolizaDescuadre = 2 Then
ErrorPrepoliza = True
Alert(ObjConta.MensajePolizaDescuadre, TipoMensaje.MsgError)
End If
'ErrorPrepoliza = True
GuardaLogAD($"Ventas/Ventas-ProcesoPrePolizas | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{ObjFactura.CvePrePoliza}", "LogPrePolizas")
'SIRVE PARA VER LA PREPOLIZA QUE SE VALIDA
@@ -15668,6 +15673,15 @@ Partial Class Ventas
End If
End If
If ObjConta.ValidacionPrePolizaCuadre(-1, 2, CveVenta) Then
If ObjConta.ValorPolizaDescuadre > 0 Then
If ObjConta.ValorPolizaDescuadre = 2 Then
OcurrioError = True
ErrorList.Add(ObjConta.MensajePolizaDescuadre)
End If
End If
End If
If Not OcurrioError Then
If RegeneracionPolizas(ObjVentas, ObjAC) Then
OcurrioError = True
@@ -21649,6 +21663,7 @@ Partial Class Ventas
Dim ObjVentas As New ClsVentas
Dim ObjCGame As New ClsCGame(ObjVentas.IniciaTransacSQL())
Dim ObjConta As New ClsContabilidad(ObjVentas.IniciaTransacSQL())
Dim OcurrioError = False
Dim MensajeError = ""
@@ -21702,6 +21717,15 @@ Partial Class Ventas
End If
End If
If ObjConta.ValidacionPrePolizaCuadre(-1, 2, CveVenta) Then
If ObjConta.ValorPolizaDescuadre > 0 Then
If ObjConta.ValorPolizaDescuadre = 2 Then
OcurrioError = True
MensajeError = ObjConta.MensajePolizaDescuadre
End If
End If
End If
If OcurrioError Then
ObjVentas.RollBack()
Alert($"{MensajeError}. Por favor vuelva a intentar.", TipoMensaje.MsgError)
@@ -21720,6 +21744,8 @@ Partial Class Ventas
End If
ObjVentas.Dispose()
ObjConta.Dispose()
ObjCGame.Dispose()
End Sub
#End Region