This commit is contained in:
2023-06-02 22:05:30 -07:00
parent 5e68fc8eda
commit 0417c264e7
2 changed files with 44 additions and 45 deletions

View File

@@ -2407,7 +2407,7 @@
<td align="left"> <td align="left">
<asp:Label ID="LblAplicaNC" runat="server" Width="100px" Text="Aplica NC/Dev:" ToolTip="Aplica Nota Crédito"></asp:Label></td> <asp:Label ID="LblAplicaNC" runat="server" Width="100px" Text="Aplica NC/Dev:" ToolTip="Aplica Nota Crédito"></asp:Label></td>
<td align="left"> <td align="left">
<asp:CheckBox ID="ChkAplicaNotaCredito" CssClass="make-switchsd" runat="server" /></td> <asp:CheckBox ID="ChkAplicaNotaCredito" CssClass="chksino" data-size="small" Text=" " runat="server" /></td>
</tr> </tr>
<tr id="TrReembolso" runat="server" visible="false"> <tr id="TrReembolso" runat="server" visible="false">

View File

@@ -1953,8 +1953,6 @@ Partial Class Compras_Compras
End If End If
Dim Msg As String = "" Dim Msg As String = ""
If Version = "3.3" Or Version = "4.0" Then If Version = "3.3" Or Version = "4.0" Then
If Not TmpDT.Columns.Contains("Amortizacion") Then If Not TmpDT.Columns.Contains("Amortizacion") Then
@@ -5204,10 +5202,6 @@ Partial Class Compras_Compras
Dim AutoConta As Boolean = UsuarioActual.Empresa.Funcionalidad(200) = "1" Dim AutoConta As Boolean = UsuarioActual.Empresa.Funcionalidad(200) = "1"
If UsuarioActual.CveEmpresa = 119 AndAlso (DdlPersonalReembolso.SelectedValue.ToEntero > 0 Or DdlCuentaCajaChicaReembolso.SelectedValue.ToEntero > 0 Or DdlTipoComprobante.SelectedValue = "Ant") Then
AutoConta = False
End If
If (AutoConta Or UsuarioActual.Empresa.UsaAC) And ObjContaAC Is Nothing AndAlso UsuarioActual.Empresa.TipoContabilidad = 2 Then If (AutoConta Or UsuarioActual.Empresa.UsaAC) And ObjContaAC Is Nothing AndAlso UsuarioActual.Empresa.TipoContabilidad = 2 Then
ObjContaAC = New ClsContPAQi(UsuarioActual.Empresa) ObjContaAC = New ClsContPAQi(UsuarioActual.Empresa)
ObjContaAC.IniciaTransacSQL() ObjContaAC.IniciaTransacSQL()
@@ -7358,35 +7352,35 @@ Partial Class Compras_Compras
End If End If
End If End If
'Simplificacion de PrePolizas ''Simplificacion de PrePolizas
If Not ErrorPrepoliza AndAlso UsuarioActual.Empresa.Funcionalidad(220) <> "" Then 'If Not ErrorPrepoliza AndAlso UsuarioActual.Empresa.Funcionalidad(220) <> "" Then
If Not ObjConta.PrePolizaSimplificacion(CvePrePoliza, UsuarioActual.CveEmpresa) Then ' If Not ObjConta.PrePolizaSimplificacion(CvePrePoliza, UsuarioActual.CveEmpresa) Then
ErrorPrepolizaDescuadre = True ' ErrorPrepolizaDescuadre = True
End If ' End If
End If 'End If
If Not ErrorPrepoliza AndAlso ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, 4) Then 'If Not ErrorPrepoliza AndAlso ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, 4) Then
If ObjConta.ValorPolizaDescuadre > 0 Then ' If ObjConta.ValorPolizaDescuadre > 0 Then
GuardaLogAD($"Compras/Compras-Guardar | Error{ObjConta.MensajePolizaDescuadre} Diferencia{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas") ' GuardaLogAD($"Compras/Compras-Guardar | Error{ObjConta.MensajePolizaDescuadre} Diferencia{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
ErrorPrepolizaDescuadre = True ' ErrorPrepolizaDescuadre = True
End If ' End If
End If 'End If
'Conta ContPAQ ''Conta ContPAQ
If ObjContaAC IsNot Nothing AndAlso Not ErrorPrepoliza AndAlso Not ErrorPrepolizaDescuadre AndAlso UsuarioActual.Empresa.Funcionalidad(200).ToString = "1" Then 'If ObjContaAC IsNot Nothing AndAlso Not ErrorPrepoliza AndAlso Not ErrorPrepolizaDescuadre AndAlso UsuarioActual.Empresa.Funcionalidad(200).ToString = "1" Then
If idCuentaContabilizacion > 0 Then ' If idCuentaContabilizacion > 0 Then
If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjContaAC) Then ' If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjContaAC) Then
' Alert(alertaContabilizacion, ModExtensiones.TipoMensaje.MsgInformacion) ' ' Alert(alertaContabilizacion, ModExtensiones.TipoMensaje.MsgInformacion)
IdPoliza = ObjConta.ContaIdPoliza ' IdPoliza = ObjConta.ContaIdPoliza
Else ' Else
ErrorPrepoliza = True ' ErrorPrepoliza = True
Alert($"Ocurrio un error al contabilizar {ObjConta.AlertaMensaje}", TipoMensaje.MsgAdvertencia) ' Alert($"Ocurrio un error al contabilizar {ObjConta.AlertaMensaje}", TipoMensaje.MsgAdvertencia)
End If ' End If
Else ' Else
Alert(String.Format("No se puede contabilizar la Prepoliza debido a que las siguientes cuentas son inválidas: <br>{0}", CuentasContablesInvalidas), TipoMensaje.MsgAdvertencia) ' Alert(String.Format("No se puede contabilizar la Prepoliza debido a que las siguientes cuentas son inválidas: <br>{0}", CuentasContablesInvalidas), TipoMensaje.MsgAdvertencia)
ErrorPrepoliza = True ' ErrorPrepoliza = True
End If ' End If
End If 'End If
End If End If
'' A N T I C I P O S '' A N T I C I P O S
@@ -7698,12 +7692,17 @@ Partial Class Compras_Compras
Msg.AppendFormat($"</br><a class=""Texto"" target='_blank' href=""/Inventarios/RecepcionAlmacen.aspx?CveCompra={CveCompra}&ED=1"">Recibir mercancía de entrega directa.</a>") Msg.AppendFormat($"</br><a class=""Texto"" target='_blank' href=""/Inventarios/RecepcionAlmacen.aspx?CveCompra={CveCompra}&ED=1"">Recibir mercancía de entrega directa.</a>")
End If End If
Dim AutoConta As Boolean = True
If (DdlPersonalReembolso.SelectedValue.ToEntero > 0 Or DdlCuentaCajaChicaReembolso.SelectedValue.ToEntero > 0 Or DdlTipoComprobante.SelectedValue = "Ant") Then
AutoConta = False
End If
If UsuarioActual.Empresa.Funcionalidad(220) <> "" Then If Not ErrorPrepoliza AndAlso Not ObjConta.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual, Opcion:=4, AutoConta:=AutoConta) Then
If Not TieneError AndAlso Not ObjConta.PrePolizaSimplificacion(CvePrePoliza, UsuarioActual.CveEmpresa) Then TieneError = True
TieneError = True 'If ObjConta.ValorPolizaDescuadre > 0 Then
Alert("No se pudo simplificar los movimientos", TipoMensaje.MsgError) ' GuardaLogAD($"Compras/Compras-Guardar | Error{ObjConta.MensajePolizaDescuadre} Diferencia{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
End If ' ErrorPrepolizaDescuadre = True
'End If
End If End If
If Not TieneError Then If Not TieneError Then
@@ -16669,9 +16668,9 @@ Partial Class Compras_Compras
DdlIVA.SelectedValue = "1.08" DdlIVA.SelectedValue = "1.08"
End Select End Select
TxtRetIVAModal.Text = FormatoNumero(GvRow.DataKey("RetIVAPorcentaje").ToDouble * 100, 4) TxtRetIVAModal.Text = FormatoNumero(GvRow.DataKey("RetIVAPorcentaje").ToDouble * 100, 6)
TxtRetISRModal.Text = FormatoNumero(GvRow.DataKey("RetISRPorcentaje").ToDouble * 100, 4) TxtRetISRModal.Text = FormatoNumero(GvRow.DataKey("RetISRPorcentaje").ToDouble * 100, 6)
TxtIEPSModal.Text = FormatoNumero(GvRow.DataKey("IEPSPSPorcentaje").ToDouble * 100, 2) TxtIEPSModal.Text = FormatoNumero(GvRow.DataKey("IEPSPSPorcentaje").ToDouble * 100, 6)
ViewState("RetIVA") = GvRow.DataKey("RetIVAPorcentaje").ToDouble ViewState("RetIVA") = GvRow.DataKey("RetIVAPorcentaje").ToDouble
ViewState("RetISR") = GvRow.DataKey("RetISRPorcentaje").ToDouble ViewState("RetISR") = GvRow.DataKey("RetISRPorcentaje").ToDouble
@@ -16869,14 +16868,14 @@ Partial Class Compras_Compras
End If End If
If TxtIEPSModal.Text = "" Then If TxtIEPSModal.Text = "" Then
TxtIEPSModal.Text = FormatoNumero(PS("IEPSPorcentaje").ToString.ToDecimal * 100, 2) TxtIEPSModal.Text = FormatoNumero(PS("IEPSPorcentaje").ToString.ToDecimal * 100, 6)
End If End If
ViewState("IEPSPSIVA") = If(PS("IEPSGrabaIVA").ToString = "True", PS("IEPSPorcentaje").ToString.ToDouble, 0) ViewState("IEPSPSIVA") = If(PS("IEPSGrabaIVA").ToString = "True", PS("IEPSPorcentaje").ToString.ToDouble, 0)
'TxtIVAModal.Text = FormatoNumero(ViewState("IVAPS").ToString().ToDouble * 100, 0) 'TxtIVAModal.Text = FormatoNumero(ViewState("IVAPS").ToString().ToDouble * 100, 0)
TxtRetIVAModal.Text = FormatoNumero(ViewState("RetIVA").ToString().ToDouble * 100, 2) TxtRetIVAModal.Text = FormatoNumero(ViewState("RetIVA").ToString().ToDouble * 100, 6)
TxtRetISRModal.Text = FormatoNumero(ViewState("RetISR").ToString().ToDouble * 100, 2) TxtRetISRModal.Text = FormatoNumero(ViewState("RetISR").ToString().ToDouble * 100, 6)
If (CveFactura > 0 Or CveCompra > 0) And TxtIEPS.Text.ToDecimal = 0 And PS("IEPSPorcentaje").ToString.ToDecimal > 0 Then If (CveFactura > 0 Or CveCompra > 0) And TxtIEPS.Text.ToDecimal = 0 And PS("IEPSPorcentaje").ToString.ToDecimal > 0 Then