Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -9373,7 +9373,7 @@ Partial Class Compras_Compras
|
||||
|
||||
'----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
If Not ErrorAC Then
|
||||
If Retorno AndAlso Not ErrorAC Then
|
||||
Dim Cont As Integer = 0
|
||||
Dim indiceTR As Integer = 0
|
||||
For Each Row As DataRow In TmpDT.Rows
|
||||
@@ -9501,6 +9501,11 @@ Partial Class Compras_Compras
|
||||
End If
|
||||
'Retorno = True
|
||||
'Alert("La Compra se actualizó correctamente.")
|
||||
|
||||
If Not ActualizarPrePolizaValidacion(ObjContabilidad, ObjCompra) Then
|
||||
Retorno = False
|
||||
End If
|
||||
|
||||
Else
|
||||
If IdPoliza > 0 Then
|
||||
If Not ObjContabilidad.UpdatePrePolizasDetalleBloquear(CvePrePoliza, True) Then
|
||||
@@ -9513,7 +9518,7 @@ Partial Class Compras_Compras
|
||||
End If
|
||||
End If
|
||||
|
||||
If (NumeroReembolsoOriginal.Trim <> TxtRembolsoNumero.Text.Trim) Then
|
||||
If Retorno AndAlso (NumeroReembolsoOriginal.Trim <> TxtRembolsoNumero.Text.Trim) Then
|
||||
'NOTA. si hay un cambio en el reembolso, puede tener estas consideraciones.
|
||||
'1. no tenía comprobación y se ocupa relacionar, se deberá validar que no tenga pagos contabilizados
|
||||
'2. se está cambiando de comprobación
|
||||
@@ -9937,7 +9942,7 @@ Partial Class Compras_Compras
|
||||
|
||||
End Function
|
||||
|
||||
Private Function ActualizarPrePoliza(ObjConta As ClsContabilidad, ObjCompra As ClsCompras) As Boolean
|
||||
Private Function ActualizarPrePoliza(ByRef ObjConta As ClsContabilidad, ByRef ObjCompra As ClsCompras) As Boolean
|
||||
|
||||
Dim Retorno As Boolean = True, ErrorPrepoliza As Boolean = False
|
||||
Dim CvePlantillaPrePoliza As Integer
|
||||
@@ -10048,8 +10053,15 @@ Partial Class Compras_Compras
|
||||
If Not ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 228, CveCompra, 1) Then ErrorPrepoliza = True 'PS NO RECIBIDO
|
||||
If Not ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 229, CveCompra, 1) Then ErrorPrepoliza = True 'PS NO RECIBIDO
|
||||
|
||||
If CveCompra > 0 And CveCompraFactura = 0 Then
|
||||
If Not ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 14, CveCompra, 1) Then ErrorPrepoliza = True
|
||||
If Not ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 5, CveCompra, 1) Then ErrorPrepoliza = True
|
||||
If Not ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 311, CveCompra, 1) Then ErrorPrepoliza = True
|
||||
If Not ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 305, CveCompra, 1) Then ErrorPrepoliza = True
|
||||
If Not ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 306, CveCompra, 1) Then ErrorPrepoliza = True
|
||||
End If
|
||||
|
||||
'SI ES GASTO CON ALMACEN REGISTRA EL CONCEPTO 95
|
||||
If Not ErrorPrepoliza Then
|
||||
If DdlTipoCompra.SelectedValue = "10" Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, importeMN, importeMN, 95, Referencia, Concepto, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveIE:=CveIE, CvePersonal:=CvePersonal, CveMovimientoAlmacen:=CveMovimientoInventario, CveCreditoDetalle:=CveCreditoDetalle, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=tipoCambioActual, Contabilizable:=False) Then
|
||||
ErrorPrepoliza = True
|
||||
@@ -10213,10 +10225,52 @@ Partial Class Compras_Compras
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
|
||||
|
||||
End If
|
||||
|
||||
'LIMPIA
|
||||
importeMovimiento = 0
|
||||
|
||||
If CveCompra > 0 And CveCompraFactura = 0 Then
|
||||
|
||||
Dim CveSubProyecto As Integer = TmpDT.MAX("CveSubProyecto").ToEntero
|
||||
Dim IVAPorcentaje As Decimal = TmpDT.MAX("IVAPorcentaje").ToDecimal
|
||||
Dim CveTipoSaldo As Integer = 1
|
||||
|
||||
Select Case DdlTipoComprobante.SelectedValue
|
||||
Case "Fac"
|
||||
CveTipoSaldo = 1
|
||||
Exit Select
|
||||
Case "NC"
|
||||
CveTipoSaldo = 15
|
||||
Exit Select
|
||||
Case "Ant"
|
||||
CveTipoSaldo = 11
|
||||
Exit Select
|
||||
Case "Dev"
|
||||
CveTipoSaldo = 15
|
||||
Exit Select
|
||||
End Select
|
||||
|
||||
Dim ConceptoTipoTotal As ConceptosTipoSaldo = ClsPaginas.ObtenerCveConceptoPrePoliza(CveTipoSaldo, DdlMoneda.SelectedValue.ToEntero, False, CveTipoConcepto)
|
||||
|
||||
If Not ErrorPrepoliza AndAlso TxtIVA.Text.ToDecimal > 0 Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, TxtIVA.Text.ToDecimal, (TxtIVA.Text.ToDecimal * tipoCambioActual * Multiplicador), 14, Referencia, Concepto, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveSubProyecto:=CveSubProyecto, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=tipoCambioActual, PorcentajeImpuesto:=IVAPorcentaje) Then
|
||||
ErrorPrepoliza = True
|
||||
End If
|
||||
End If
|
||||
|
||||
If Not ErrorPrepoliza AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, TxtTotal.Text.ToDecimal, (TxtTotal.Text.ToDecimal * tipoCambioActual * Multiplicador), ConceptoTipoTotal.CveConcepto, Referencia, Concepto, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveSubProyecto:=CveSubProyecto, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=tipoCambioActual) Then
|
||||
ErrorPrepoliza = True
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
'SI ES GASTO CON ALMACEN REGISTRA EL CONCEPTO 95
|
||||
|
||||
|
||||
Next
|
||||
End If
|
||||
|
||||
@@ -10226,9 +10280,91 @@ Partial Class Compras_Compras
|
||||
Next
|
||||
End If
|
||||
|
||||
''OIC 2025-04-16 El bloque de validacion se paso a la funcion ActualizarPrePolizaValidacion
|
||||
'If DtPrePolizas IsNot Nothing Then
|
||||
' For Each RowPrePoliza As DataRow In DtPrePolizas.FiltraParametros("", DistinctColumns:={"CvePrePoliza"}).Rows
|
||||
' If ObjConta.ValidacionesPrePoliza(RowPrePoliza("CvePrePoliza").ToString().ToEntero(), UsuarioActual, Opcion:=4, AutoConta:=False) Then
|
||||
' If ObjConta.ValorPolizaDescuadre > 0 Then
|
||||
' ErrorPrepoliza = True
|
||||
' Alert("Error en validacion de prepoliza cuadre", TipoMensaje.MsgAdvertencia)
|
||||
' GuardaLogAD($"Compras/Compras-Actualizar | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
|
||||
' Exit For
|
||||
' End If
|
||||
' End If
|
||||
' Next
|
||||
'End If
|
||||
|
||||
If Not ErrorPrepoliza Then
|
||||
Retorno = True
|
||||
Else
|
||||
Retorno = False
|
||||
End If
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
|
||||
Private Function ActualizarPrePolizaValidacion(ByRef ObjConta As ClsContabilidad, ByRef ObjCompra As ClsCompras) As Boolean
|
||||
|
||||
Dim Retorno As Boolean = True, ErrorPrepoliza As Boolean = False
|
||||
Dim CvePlantillaPrePoliza As Integer
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") Then
|
||||
CvePlantillaPrePoliza = 60
|
||||
Else
|
||||
CvePlantillaPrePoliza = 1
|
||||
End If
|
||||
|
||||
If (ArrAnticipos.Count > 0 And CveCompra > 0) Or (ArrAnticipos.Count > 0 And UsuarioActual.Empresa.UsaAC) Then
|
||||
CvePlantillaPrePoliza = 52
|
||||
End If
|
||||
|
||||
If RBLContado.SelectedValue = "2" AndAlso DdlFuncionarioEmpleado.SelectedValue.ToEntero > 0 Then
|
||||
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") Then
|
||||
CvePlantillaPrePoliza = 60
|
||||
Else
|
||||
CvePlantillaPrePoliza = 1
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Dim DtPrePolizas As DataTable = Nothing
|
||||
|
||||
If ObjConta.GetPlantillaConceptos(UsuarioActual.CveEmpresa, CvePlantillaPrePoliza) Then
|
||||
For Each Row As DataRow In ObjConta.DtResultados.Rows
|
||||
|
||||
Dim ConceptoContable As Integer = Row("CveConcepto").ToString.ToEntero
|
||||
|
||||
Select Case ConceptoContable
|
||||
|
||||
Case 6
|
||||
|
||||
Dim CveProveedorConcepto As Integer = 0, CveIE As Integer = 0, CveCreditoDetalle As Integer = 0
|
||||
Dim ConceptoPersonal As String = "", Concepto As String = ""
|
||||
Dim tUsaInventarios As Boolean = UsuarioActual.Empresa.UsaInventarios
|
||||
If (UsuarioActual.CveEmpresa.Contiene(13, 83, 7, 11, 12, 122, 145)) Then tUsaInventarios = False
|
||||
|
||||
If Not ObjConta.GetPrePolizasDetalleCompra(CveCompra, UsuarioActual.CveEmpresa) Then
|
||||
ErrorPrepoliza = True
|
||||
Else
|
||||
DtPrePolizas = ObjConta.DtResultados.FiltraParametros("CveConceptoContable IN (6,68,49,205,176,5,305,311)")
|
||||
|
||||
If DtPrePolizas.Rows.Count > 0 Then
|
||||
Dim drr As DataRow = ObjConta.DtResultados.FiltraParametros("CveConceptoContable in(6,68,49,205,176,5,305,311)").FiltroPrimero("")
|
||||
CveProveedorConcepto = drr("CveProveedor").ToString.ToEntero
|
||||
CveIE = drr("CveIE").ToString.ToEntero
|
||||
CveCreditoDetalle = drr("CveCreditoDetalle").ToString.ToEntero
|
||||
Concepto = drr("Concepto").ToString
|
||||
End If
|
||||
End If
|
||||
|
||||
End Select
|
||||
Next
|
||||
End If
|
||||
|
||||
If DtPrePolizas IsNot Nothing Then
|
||||
For Each RowPrePoliza As DataRow In DtPrePolizas.FiltraParametros("", DistinctColumns:={"CvePrePoliza"}).Rows
|
||||
If ObjConta.ValidacionesPrePoliza(RowPrePoliza("CvePrePoliza").ToString().ToEntero(), UsuarioActual, Opcion:=4, AutoConta:=False) Then
|
||||
If Not ObjConta.ValidacionesPrePoliza(RowPrePoliza("CvePrePoliza").ToString().ToEntero(), UsuarioActual, Opcion:=4, AutoConta:=False) Then
|
||||
If ObjConta.ValorPolizaDescuadre > 0 Then
|
||||
ErrorPrepoliza = True
|
||||
Alert("Error en validacion de prepoliza cuadre", TipoMensaje.MsgAdvertencia)
|
||||
@@ -10248,6 +10384,7 @@ Partial Class Compras_Compras
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
|
||||
Protected Sub ImgActualizarProyecto_Click(sender As Object, e As EventArgs) Handles ImgActualizarProyecto.Click
|
||||
'actualizo los proyectos
|
||||
Dim Compra As New ClsCompras
|
||||
@@ -19837,6 +19974,10 @@ Partial Class Compras_Compras
|
||||
Dim ObjContabilidad As New ClsContabilidad(ObjCompra.IniciaTransacSQL)
|
||||
|
||||
Dim Estatus As Boolean = ActualizarPrePoliza(ObjContabilidad, ObjCompra)
|
||||
If Estatus Then
|
||||
Estatus = ActualizarPrePolizaValidacion(ObjContabilidad, ObjCompra)
|
||||
End If
|
||||
|
||||
|
||||
If Estatus Then
|
||||
ObjCompra.Commit()
|
||||
|
||||
@@ -87,7 +87,7 @@ Partial Class Compras_RepRembolsoComprobaciones
|
||||
|
||||
DdlPersonal.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa)
|
||||
DdlPersonal.DataBind()
|
||||
txtFechaI.Text = NowADS.AddYears(-1).ToShortDateString
|
||||
txtFechaI.Text = NowADS.AddMonths(-3).ToShortDateString
|
||||
|
||||
CargarCentrosDeCosto(Nothing, DdlSubProyecto, Nothing, LblSubProyecto, "Todos")
|
||||
|
||||
|
||||
@@ -342,7 +342,7 @@
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="col-md-5">
|
||||
|
||||
<div class="portlet light xspadding traspasorow bordered">
|
||||
<div class="portlet-title">
|
||||
@@ -371,16 +371,16 @@
|
||||
DataKeyNames="CveVenta,CveCliente,TipoDocto,Saldo,AtencionA,CveFormaPago33,SerieFolio,CondicionesPago,PlazoCobranza">
|
||||
<Columns>
|
||||
<%--<asp:BoundField HeaderText="Atención" DataField="AtencionA" />--%>
|
||||
<asp:TemplateField HeaderText="Atención/Cliente" ItemStyle-HorizontalAlign="Left">
|
||||
<asp:TemplateField HeaderText="Atención/Cliente" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="25%">
|
||||
<ItemTemplate>
|
||||
<asp:Label runat="server" ID="LblAtencionA" Font-Italic="true" Text='<%# Eval("AtencionA") %>'></asp:Label><br />
|
||||
<asp:Label runat="server" ID="Label4" Text='<%# Eval("NombreComercial") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:HyperLinkField HeaderText="Folio" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" DataTextField="SerieFolio" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField HeaderText="Fecha/Hora" DataField="Fecha" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField HeaderText="Importe" DataField="Saldo" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Right">
|
||||
<asp:HyperLinkField ItemStyle-Width="20%" HeaderText="Folio" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" DataTextField="SerieFolio" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField ItemStyle-Width="15%" HeaderText="Fecha/Hora" DataField="Fecha" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField ItemStyle-Width="20%" HeaderText="Importe" DataField="Saldo" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:TemplateField ItemStyle-Width="20%" HeaderText="" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="LnkImprimir" runat="server" AlternateText="Imprimir ticket"
|
||||
CssClass="btn btn-circle btn-sm blue" Text="<i class='fa fa-print'></i>" ToolTip="Imprimir"
|
||||
@@ -478,7 +478,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="col-md-7">
|
||||
<asp:Panel runat="server" ID="PnlContado" DefaultButton="BtnPagar" Visible="false">
|
||||
<div class="row">
|
||||
|
||||
@@ -685,13 +685,13 @@
|
||||
<label style="font-weight: bold; font-size: medium;">Total:</label>
|
||||
<div class="input-icon">
|
||||
<i style="margin: 0px;">$</i>
|
||||
<asp:TextBox ID="TxtImporteContado" CssClass="form-control input-sm " runat="server" MaxLength="12" Width="180px" ReadOnly="true" ClientIDMode="Static" Style="text-align: right; font-size: 14px;"></asp:TextBox>
|
||||
<asp:TextBox ID="TxtImporteContado" CssClass="form-control input-sm " runat="server" MaxLength="12" Width="100%" ReadOnly="true" ClientIDMode="Static" Style="text-align: right; font-size: 14px;"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtender3" runat="server" TargetControlID="TxtImporteContado" FilterType="Custom, Numbers" ValidChars=".," />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="row">
|
||||
<div class="col-md-4" style="display: flex; align-items: center;">
|
||||
<div class="col-md-5" style="display: flex; align-items: center;">
|
||||
<label id="lblCambio" runat="server" style="font-weight: bold; font-size: medium;">Cambio:</label>
|
||||
<div class="input-icon">
|
||||
<i style="margin: 0px;">$</i>
|
||||
@@ -700,7 +700,7 @@
|
||||
<ajax:FilteredTextBoxExtender ID="FTBECambio" runat="server" TargetControlID="TxtCambio" FilterType="Custom, Numbers" ValidChars=".," />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-8" style="display: flex; align-items: center;">
|
||||
<div class="col-md-7" style="display: flex; align-items: center;">
|
||||
<label style="font-weight: bold; font-size: medium;">Sob/falt:</label>
|
||||
|
||||
<asp:CheckBox ID="ChkSobFaltante" runat="server" ClientIDMode="Static" />
|
||||
|
||||
Reference in New Issue
Block a user