-compras. concepto de entrada

- proveedoresbonar, simplificar y C78
- modextensiones. log
This commit is contained in:
rrene
2020-04-14 21:11:50 -07:00
parent 9893e16385
commit e8e370173a
4 changed files with 102 additions and 72 deletions

View File

@@ -99,7 +99,7 @@ Namespace Extensiones
' strLineaTMP = Chr(13) & Chr(10) & Day(Now) & "/" & Month(Now) & "/" & Year(Now) & " " & Hour(Now) & ":" & Minuto & ". " & Str & Chr(13) & Chr(10) ' strLineaTMP = Chr(13) & Chr(10) & Day(Now) & "/" & Month(Now) & "/" & Year(Now) & " " & Hour(Now) & ":" & Minuto & ". " & Str & Chr(13) & Chr(10)
strLineaTMP = String.Format("{0}{1}Log: {5}{2}{3}:{4}", Chr(13), Chr(10), Str, DateTime.Now.ToShortDateString, DateTime.Now.ToShortTimeString, Urlstring) strLineaTMP = String.Format("{0}{1}Log: {5}{2}{3}:{4}", Chr(13), Chr(10), Str, DateTime.Now.ToShortDateString, DateTime.Now.ToShortTimeString, Urlstring)
Try Try
ArchivoW = New StreamWriter(String.Format("{0}\Log.txt", AppDomain.CurrentDomain.BaseDirectory), True, System.Text.Encoding.UTF8) ArchivoW = New StreamWriter(String.Format("{0}\Log\Log.txt", AppDomain.CurrentDomain.BaseDirectory), True, System.Text.Encoding.UTF8)
Catch ex As UnauthorizedAccessException Catch ex As UnauthorizedAccessException
'Alert("No hay permisos para guardar en el Log.", Extensiones.TipoMensaje.MsgError) 'Alert("No hay permisos para guardar en el Log.", Extensiones.TipoMensaje.MsgError)
Exit Sub Exit Sub

View File

@@ -565,17 +565,51 @@ Partial Class Bancos_ProveedoresAbonar
If e.Row.DBCampo("CveCompra").ToEntero > 0 Then If e.Row.DBCampo("CveCompra").ToEntero > 0 Then
Dim FiltroInv As String = "" Dim FiltroInv As String = ""
If UsuarioActual.Empresa.Funcionalidad(134).ToEntero > 0 Then
Dim PorcentajeSaldo = e.Row.DBCampo("ImporteAlmacenPorcentaje").ToString.ToDouble + e.Row.DBCampo("ImporteServiciosPorcentaje").ToString.ToDouble + e.Row.DBCampo("ImporteDevolucionPorcentaje").ToString.ToDouble If UsuarioActual.Empresa.Funcionalidad(134).ToEntero > 0 Then ' valores 1 - permite pago proporcional, valor 2. paga solo si se recibio el 100%
Dim SaldoInv = (e.Row.DBCampo("Saldo").ToString.ToDouble * (PorcentajeSaldo / 100)) 'se bloquean las opciones
e.Row.FCCheckBox("Chk").Enabled = False
e.Row.FCTextBox("TxtAbonar").Enabled = False
Dim Str As New StringBuilder
Str.AppendFormat("Importe Almacen: ${0} ({1}%) <br/>", e.Row.DBCampo("ImporteAlmacen").FormatoNumero, e.Row.DBCampo("ImporteAlmacenPorcentaje"))
If e.Row.DBCampo("ImporteServicios").ToDouble > 0 Then Str.AppendFormat("Importe Servicios: ${0} ({1}%) <br/>", e.Row.DBCampo("ImporteServicios").FormatoNumero, e.Row.DBCampo("ImporteServiciosPorcentaje"))
If e.Row.DBCampo("ImporteDevolucion").ToDouble > 0 Then Str.AppendFormat("Importe Devuelto: ${0} ({1}%) <br/>", e.Row.DBCampo("ImporteDevolucion").FormatoNumero, e.Row.DBCampo("ImporteDevolucionPorcentaje"))
Str.AppendFormat(" <i> Importes <b> SIN</b> IVA</i>")
e.Row.FCLabel("LbEstatusInv").Attributes.Add("title", Str.ToString)
Dim PorcentajeAlmacen As Decimal = e.Row.DBCampo("ImporteAlmacenPorcentaje").ToString.ToDecimal + e.Row.DBCampo("ImporteServiciosPorcentaje").ToString.ToDecimal + e.Row.DBCampo("ImporteDevolucionPorcentaje").ToString.ToDecimal
Dim SaldoInv As Decimal = (e.Row.DBCampo("Saldo").ToString.ToDecimal * (PorcentajeAlmacen / 100))
If UsuarioActual.Empresa.Funcionalidad(134) = "1" Then 'cuando es proporcional If UsuarioActual.Empresa.Funcionalidad(134) = "1" Then 'cuando es proporcional
FiltroInv = $"FnCambia({e.Row.FCCheckBox("Chk").ClientID},this,{SaldoInv},1,'{"El importe no debe exceder lo recibido en almacén"}',1);" FiltroInv = $"FnCambia({e.Row.FCCheckBox("Chk").ClientID},this,{SaldoInv},1,'{"El importe no debe exceder lo recibido en almacén"}',1);"
ElseIf UsuarioActual.Empresa.Funcionalidad(134) = "2" Then ElseIf UsuarioActual.Empresa.Funcionalidad(134) = "2" Then
FiltroInv = "" 'queno considera lo proporcional FiltroInv = "" 'queno considera lo proporcional
End If End If
If PorcentajeAlmacen = 0 Then ' sin recibir
e.Row.FCLabel("LbEstatusInv").Text = "<i Class='fa fa-flag-o' aria-hidden='true'></i>"
e.Row.FCLabel("LbEstatusInv").ForeColor = Drawing.Color.Red
ElseIf PorcentajeAlmacen > 99.0 OrElse e.Row.DBCampo("ImporteAlmacen").ToDecimal >= e.Row.DBCampo("Saldo").ToString.ToDecimal Then 'recibido completo ' si tiene un porcentaje mayor ingresado, que este halla sido por OC, debe de permitirlo
' NOTA. si la factura tiene devoluciones, debera comparar el saldo de la factura con lo recibido en el almacen
e.Row.FCLabel("LbEstatusInv").Text = "<i Class='fa fa-flag' aria-hidden='true'></i>"
e.Row.FCLabel("LbEstatusInv").ForeColor = Drawing.Color.Green
e.Row.FCCheckBox("Chk").Enabled = True
e.Row.FCTextBox("TxtAbonar").Enabled = True
Else ' parcial
e.Row.FCLabel("LbEstatusInv").Text = "<i Class='fa fa-flag-checkered' aria-hidden='true'></i>"
e.Row.FCLabel("LbEstatusInv").ForeColor = Drawing.Color.DarkOrange
If UsuarioActual.Empresa.Funcionalidad(134).ToEntero = 1 Then ' si es la opcion ,de pagar lo proporcional
e.Row.FCCheckBox("Chk").Enabled = True
e.Row.FCTextBox("TxtAbonar").Enabled = True
End If
End If
End If End If
e.Row.FCLiteral("LtlAux").Text = String.Format("<a Class=""Texto thickbox"" href=""/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxPProveedor&CveProveedor={0}&CveCompra={1}&TB_iframe=true&height=370&width=900"" />Ir</a>", e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveCompra")) e.Row.FCLiteral("LtlAux").Text = String.Format("<a Class=""Texto thickbox"" href=""/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxPProveedor&CveProveedor={0}&CveCompra={1}&TB_iframe=true&height=370&width=900"" />Ir</a>", e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveCompra"))
e.Row.FCTextBox("TxtAbonar").Attributes.Add("onblur", String.Format("FnCambia({0},this,{1},1,'{2}',1);{3}", e.Row.FCCheckBox("Chk").ClientID, e.Row.DBCampo("Saldo"), "El Importe no debe de exceder el saldo", FiltroInv)) e.Row.FCTextBox("TxtAbonar").Attributes.Add("onblur", String.Format("FnCambia({0},this,{1},1,'{2}',1);{3}", e.Row.FCCheckBox("Chk").ClientID, e.Row.DBCampo("Saldo"), "El Importe no debe de exceder el saldo", FiltroInv))
@@ -605,61 +639,18 @@ Partial Class Bancos_ProveedoresAbonar
End If End If
If UsuarioActual.Empresa.Funcionalidad(131).ToEntero > 0 Or UsuarioActual.Empresa.Funcionalidad(134).ToEntero > 0 Then
Dim Str As New StringBuilder
Str.AppendFormat("Importe Almacen: ${0} ({1}%) <br/>", e.Row.DBCampo("ImporteAlmacen").FormatoNumero, e.Row.DBCampo("ImporteAlmacenPorcentaje"))
If e.Row.DBCampo("ImporteServicios").ToDouble > 0 Then Str.AppendFormat("Importe Servicios: ${0} ({1}%) <br/>", e.Row.DBCampo("ImporteServicios").FormatoNumero, e.Row.DBCampo("ImporteServiciosPorcentaje"))
If e.Row.DBCampo("ImporteDevolucion").ToDouble > 0 Then Str.AppendFormat("Importe Devuelto: ${0} ({1}%) <br/>", e.Row.DBCampo("ImporteDevolucion").FormatoNumero, e.Row.DBCampo("ImporteDevolucionPorcentaje"))
Str.AppendFormat(" <i> Importes <b> SIN</b> IVA</i>")
e.Row.FCLabel("LbEstatusInv").Attributes.Add("title", Str.ToString) 'si está bloqueada y es refacturación, debe de permitirlo, sin importar lo que se halla ingresado
Select Case e.Row.DBCampo("EstatusInventario").ToEntero If e.Row.DBCampo("CveCompraRefacturacion").ToEntero > 0 AndAlso Not e.Row.FCCheckBox("Chk").Enabled Then
Case 1 e.Row.FCCheckBox("Chk").Enabled = True
e.Row.FCLabel("LbEstatusInv").Text = "<i Class='fa fa-flag-o' aria-hidden='true'></i>" e.Row.FCTextBox("TxtAbonar").Enabled = True
e.Row.FCLabel("LbEstatusInv").ForeColor = Drawing.Color.Red End If
If UsuarioActual.Empresa.Funcionalidad(134).ToEntero.Contiene(1, 2) Then ' si se recibió mercancía se paga lo proporcional If UsuarioActual.Empresa.Funcionalidad(306) = "1" And e.Row.DBCampo("AplicaNotaCredito").ToString = "True" Then
If UsuarioActual.CveEmpresa = 72 Then e.Row.FCCheckBox("Chk").Enabled = False
If e.Row.DBCampo("Fecha").ToDate > "12/02/2017".ToDate Then
e.Row.FCCheckBox("Chk").Enabled = False
e.Row.FCTextBox("TxtAbonar").Enabled = False
End If
Else
e.Row.FCCheckBox("Chk").Enabled = False
e.Row.FCTextBox("TxtAbonar").Enabled = False
End If
End If
Case 2
e.Row.FCLabel("LbEstatusInv").Text = "<i Class='fa fa-flag-checkered' aria-hidden='true'></i>"
e.Row.FCLabel("LbEstatusInv").ForeColor = Drawing.Color.DarkOrange
'condición que bloquea que se pueda pagar sin aun es parcial la recepción,
If UsuarioActual.Empresa.Funcionalidad(134).ToEntero = 2 Then
e.Row.FCCheckBox("Chk").Enabled = False
e.Row.FCTextBox("TxtAbonar").Enabled = False
' si tiene un porcentaje mayor ingresado, que este halla sido por OC, debe de permitirlo
If e.Row.DBCampo("ImporteAlmacenPorcentaje").ToDecimal >= 99.0 Then 'si ya se recibió el 100%
e.Row.FCCheckBox("Chk").Enabled = True
e.Row.FCTextBox("TxtAbonar").Enabled = True
End If
End If
Case 3
e.Row.FCLabel("LbEstatusInv").Text = "<i Class='fa fa-flag' aria-hidden='true'></i>"
e.Row.FCLabel("LbEstatusInv").ForeColor = Drawing.Color.Green
Case Else
End Select
'si está bloqueada y es refacturación, debe de permitirlo, sin importar lo que se halla ingresado
If e.Row.DBCampo("CveCompraRefacturacion").ToEntero > 0 AndAlso Not e.Row.FCCheckBox("Chk").Enabled Then
e.Row.FCCheckBox("Chk").Enabled = True
e.Row.FCTextBox("TxtAbonar").Enabled = True
End If
End If End If
End If End If
If UsuarioActual.Empresa.Funcionalidad(306) = "1" And e.Row.DBCampo("AplicaNotaCredito").ToString = "True" Then
e.Row.FCCheckBox("Chk").Enabled = False
End If
End If End If
End Sub End Sub
@@ -2017,7 +2008,7 @@ Partial Class Bancos_ProveedoresAbonar
End If End If
End If End If
If MsgError <> "" AndAlso ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, 5) Then If MsgError = "" AndAlso ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, 5) Then
If ObjMov.ValorPolizaDescuadre > 0 Then If ObjMov.ValorPolizaDescuadre > 0 Then
MsgError = ObjMov.MensajePolizaDescuadre + " " + ObjMov.ValorDiferencia MsgError = ObjMov.MensajePolizaDescuadre + " " + ObjMov.ValorDiferencia
GuardaLogAD($"Bancos/ProveedoresAbonar | Error:{ObjMov.MensajePolizaDescuadre} Diferencia:{ObjMov.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas") GuardaLogAD($"Bancos/ProveedoresAbonar | Error:{ObjMov.MensajePolizaDescuadre} Diferencia:{ObjMov.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
@@ -2944,6 +2935,7 @@ Partial Class Bancos_ProveedoresAbonar
Dim TCPago As Decimal = GlobalTipoCambio(TxtFechaIncobrable.Text.ToDate).ToDecimal Dim TCPago As Decimal = GlobalTipoCambio(TxtFechaIncobrable.Text.ToDate).ToDecimal
Dim CveMoneda As Integer = gr.DataKey("CveMoneda").ToEntero Dim CveMoneda As Integer = gr.DataKey("CveMoneda").ToEntero
Dim FechaCompra As Date = gr.DataKey("Fecha").ToDate Dim FechaCompra As Date = gr.DataKey("Fecha").ToDate
Dim CveSubProyecto As Integer = gr.DataKey("CveSubProyecto").ToEntero
Dim CveConceptoContablePago As Integer = 17 Dim CveConceptoContablePago As Integer = 17
If gr.DataKey("CveTipoConcepto").ToEntero = 2 Then CveConceptoContablePago = 308 'cuando es acreedor If gr.DataKey("CveTipoConcepto").ToEntero = 2 Then CveConceptoContablePago = 308 'cuando es acreedor
@@ -2991,7 +2983,7 @@ Partial Class Bancos_ProveedoresAbonar
Dim PorcentajePago As Decimal = gr.DataKey("Saldo").ToDecimal / gr.DataKey("Original").ToDecimal Dim PorcentajePago As Decimal = gr.DataKey("Saldo").ToDecimal / gr.DataKey("Original").ToDecimal
If gr.DataKey("IVA").ToDecimal > 0 Then If MsgError = "" AndAlso gr.DataKey("IVA").ToDecimal > 0 Then
Dim PorcentajeImpuesto As Decimal = gr.DataKey("PorcentajeIVA").ToDecimal Dim PorcentajeImpuesto As Decimal = gr.DataKey("PorcentajeIVA").ToDecimal
Dim IdCtaIVAXAcreditar As Integer = 0 Dim IdCtaIVAXAcreditar As Integer = 0
Dim IdCtaIVAAcreditable As Integer = 0 Dim IdCtaIVAAcreditable As Integer = 0
@@ -3011,7 +3003,7 @@ Partial Class Bancos_ProveedoresAbonar
End If End If
If gr.DataKey("IEPS").ToDecimal > 0 Then If MsgError = "" AndAlso gr.DataKey("IEPS").ToDecimal > 0 Then
Dim IEPS As Decimal = PorcentajePago * gr.DataKey("IEPS").ToDecimal Dim IEPS As Decimal = PorcentajePago * gr.DataKey("IEPS").ToDecimal
If ObjConta.GetRetCuenta(25, UsuarioActual.CveEmpresa) Then If ObjConta.GetRetCuenta(25, UsuarioActual.CveEmpresa) Then
@@ -3030,7 +3022,7 @@ Partial Class Bancos_ProveedoresAbonar
End If End If
' se manda al ot ingresos, los impuestos por acreditar ' se manda al ot ingresos, los impuestos por acreditar
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Saldo, gr.DataKey("SerieFolio").ToString, 78, ConceptoPartida, Now, IdCtaContable:=UsuarioActual.Empresa.IdCuentaOtrosIngresos, CveIE:=-1, IdSegmentoNegocio:=-1, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CveCompra:=gr.DataKey("CveCompra").ToEntero, ImporteMX:=If(CveMoneda = 1, Saldo, Saldo * TCPago), TipoCambio:=TCCompra, TipoCambioPago:=TCPago, CveCuenta:=-1) Then If MsgError = "" AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Saldo, gr.DataKey("SerieFolio").ToString, 78, ConceptoPartida, Now, IdCtaContable:=UsuarioActual.Empresa.IdCuentaOtrosIngresos, CveIE:=-1, IdSegmentoNegocio:=-1, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CveCompra:=gr.DataKey("CveCompra").ToEntero, ImporteMX:=If(CveMoneda = 1, Saldo, Saldo * TCPago), TipoCambio:=TCCompra, TipoCambioPago:=TCPago, CveCuenta:=-1, CveSubProyecto:=CveSubProyecto) Then
MsgError = "Ocurrio un error al saldar el movimiento" MsgError = "Ocurrio un error al saldar el movimiento"
End If End If
@@ -3051,7 +3043,7 @@ Partial Class Bancos_ProveedoresAbonar
If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, 5) Then If MsgError = "" AndAlso ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, 5) Then
If ObjConta.ValorPolizaDescuadre > 0 Then If ObjConta.ValorPolizaDescuadre > 0 Then
MsgError = ObjConta.MensajePolizaDescuadre + " " + ObjConta.ValorDiferencia MsgError = ObjConta.MensajePolizaDescuadre + " " + ObjConta.ValorDiferencia
GuardaLogAD($"Bancos/ProveedoresAbonar | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas") GuardaLogAD($"Bancos/ProveedoresAbonar | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")

View File

@@ -3108,21 +3108,31 @@
<asp:Label ID="Label7" runat="server" ClientIDMode="Static" Text="Refacturación"></asp:Label></h4> <asp:Label ID="Label7" runat="server" ClientIDMode="Static" Text="Refacturación"></asp:Label></h4>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table width="100%"> <table width="100%">
<tr> <tr>
<td width="80px">Factura:</td> <td width="80px">Factura:</td>
<td> <td>
<asp:DropDownList runat="server" Width="100%" CssClass="form-control input-sm select2me" ID="DdlRefacturacionFacturas" DataTextField="SerieFolio" DataValueField="CveCompra" ValidationGroup="GrpVinculaFactura"></asp:DropDownList>
<asp:DropDownList runat="server" Width="100%" CssClass="form-control input-sm select2me" ID="DdlRefacturacionFacturas" DataTextField="SerieFolio" DataValueField="CveCompra" ValidationGroup="GrpVinculaFactura" AutoPostBack ="true"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVRefacturacion" runat="server" ControlToValidate="DdlRefacturacionFacturas" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Factura''</b> es necesario para cargar la Refacturación, por favor seleccione uno." ValidationGroup="GrpVinculaFactura"></asp:RequiredFieldValidator> <asp:RequiredFieldValidator ID="RFVRefacturacion" runat="server" ControlToValidate="DdlRefacturacionFacturas" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Factura''</b> es necesario para cargar la Refacturación, por favor seleccione uno." ValidationGroup="GrpVinculaFactura"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCERefacturacion" runat="server" HighlightCssClass="vco" TargetControlID="RFVRefacturacion" Width="300px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="VCERefacturacion" runat="server" HighlightCssClass="vco" TargetControlID="RFVRefacturacion" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
</td>
</tr> </tr>
<tr> <tr>
<td width="120px">Refacturar X NC:</td> <td width="120px">Refacturar X NC:</td>
<td> <td>
<asp:CheckBox ID="ChkRefacNC" runat="server" /> <asp:CheckBox ID="ChkRefacNC" runat="server" />
</td> </td>
</tr>
<tr>
<td width="120px"></td>
<td>
<asp:CheckBox ID="ChkRefacturacionConAlmacen" Enabled="false" runat="server" Text="Con Almacen" />
<asp:HiddenField ID="HdnRefacturacionConcepto" runat="server" />
</td>
</tr> </tr>
<tr> <tr>
<td colspan="2" align="center"> <td colspan="2" align="center">
@@ -3135,6 +3145,9 @@
</td> </td>
</tr> </tr>
</table> </table>
</ContentTemplate>
</asp:UpdatePanel>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button id="CancelarDevolucionF" type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button> <button id="CancelarDevolucionF" type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>

View File

@@ -4335,7 +4335,7 @@ Partial Class Compras_Compras
Try Try
Dim FolioFijo As Integer = 0 Dim FolioFijo As Integer = 0
'cheque 'cheque
If DdlTipoTransaccion.SelectedValue = "1" Then FolioFijo = TxtFolio.Text.ToEntero If DdlTipoTransaccion.SelectedValue = "1" Then FolioFijo = TxtFolio.Text.ToEntero
CvePrePoliza = ObjConta.AddPrePolizas("Compras/Registrar", If(EsContado And CvePlantillaPrePoliza = 1, 2, CvePlantillaPrePoliza), ImporteCompra, TxtTotal.Text.ToDouble, DdlMoneda.SelectedValue.ToEntero, TxtFecha.Text.ToDate, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo:=FolioFijo, ReglaFolioPoliza:=ObjCompras.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, DdlTipoTransaccionCaja.SelectedValue, UsuarioActual.CveEmpresa), CveTipoPoliza:=ObjConta.ObtenerTipoPoliza(DdlTipoTransaccion.SelectedValue, DdlTipoTransaccionCaja.SelectedValue, UsuarioActual.CveEmpresa)) CvePrePoliza = ObjConta.AddPrePolizas("Compras/Registrar", If(EsContado And CvePlantillaPrePoliza = 1, 2, CvePlantillaPrePoliza), ImporteCompra, TxtTotal.Text.ToDouble, DdlMoneda.SelectedValue.ToEntero, TxtFecha.Text.ToDate, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo:=FolioFijo, ReglaFolioPoliza:=ObjCompras.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, DdlTipoTransaccionCaja.SelectedValue, UsuarioActual.CveEmpresa), CveTipoPoliza:=ObjConta.ObtenerTipoPoliza(DdlTipoTransaccion.SelectedValue, DdlTipoTransaccionCaja.SelectedValue, UsuarioActual.CveEmpresa))
@@ -4448,6 +4448,8 @@ Partial Class Compras_Compras
CveConceptoContableAlmacen = DdlOCVinculaInv.SelectedValue.ToEntero CveConceptoContableAlmacen = DdlOCVinculaInv.SelectedValue.ToEntero
ElseIf (CveImportacion > 0 Or CveFlete > 0) AndAlso Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") Then ElseIf (CveImportacion > 0 Or CveFlete > 0) AndAlso Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") Then
CveConceptoContableAlmacen = CveConceptoContableAlmacen CveConceptoContableAlmacen = CveConceptoContableAlmacen
ElseIf CveCompraRefacturacion > 0 AndAlso ChkRefacNC.Checked Then ' cuando es refacturacion, tomara del concepto anterior
CveConceptoContableAlmacen = HdnRefacturacionConcepto.Value.ToEntero
End If End If
End If End If
@@ -6070,7 +6072,7 @@ Partial Class Compras_Compras
End If End If
End If End If
Case 186 'RetIVA Acreditable Fletes P.M. Case 186 'RetIVA Acreditable Fletes P.M.
If Not DdlTipoComprobante.SelectedValue.Contiene("Ant") Then If Not DdlTipoComprobante.SelectedValue.Contiene("Ant") AndAlso TxtRetIVA.Text.ToDecimal > 0 Then
If DdlRetIVAConcepto.Items.Count > 0 Then If DdlRetIVAConcepto.Items.Count > 0 Then
If DdlRetIVAConcepto.SelectedValue.ToEntero = 3 Then If DdlRetIVAConcepto.SelectedValue.ToEntero = 3 Then
importeMovimiento = importeRetIVAAcreditable importeMovimiento = importeRetIVAAcreditable
@@ -6101,7 +6103,7 @@ Partial Class Compras_Compras
End If End If
End If End If
Case 185 'RetIVA X Acreditar Fletes P.M. Case 185 'RetIVA X Acreditar Fletes P.M.
If Not DdlTipoComprobante.SelectedValue.Contiene("Ant") Then If Not DdlTipoComprobante.SelectedValue.Contiene("Ant") AndAlso TxtRetIVA.Text.ToDecimal > 0 Then
If DdlRetIVAConcepto.Items.Count > 0 Then If DdlRetIVAConcepto.Items.Count > 0 Then
If DdlRetIVAConcepto.SelectedValue.ToEntero = 3 Then If DdlRetIVAConcepto.SelectedValue.ToEntero = 3 Then
importeMovimiento = importeRetIVAxAcreditar importeMovimiento = importeRetIVAxAcreditar
@@ -6124,7 +6126,7 @@ Partial Class Compras_Compras
End If End If
End If End If
Case 249 'RetIVA Acreditable Arrendamiento Case 249 'RetIVA Acreditable Arrendamiento
If Not DdlTipoComprobante.SelectedValue.Contiene("Ant") Then If Not DdlTipoComprobante.SelectedValue.Contiene("Ant") AndAlso TxtRetIVA.Text.ToDecimal > 0 Then
If DdlRetIVAConcepto.Items.Count > 0 AndAlso DdlRetIVAConcepto.SelectedValue.ToEntero = 4 Then If DdlRetIVAConcepto.Items.Count > 0 AndAlso DdlRetIVAConcepto.SelectedValue.ToEntero = 4 Then
importeMovimiento = importeRetIVAAcreditable importeMovimiento = importeRetIVAAcreditable
importeMN = Math.Round(importeMovimiento, 2) * tipoCambioActual * Multiplicador importeMN = Math.Round(importeMovimiento, 2) * tipoCambioActual * Multiplicador
@@ -6246,7 +6248,7 @@ Partial Class Compras_Compras
' End If ' End If
' End If ' End If
Case 64 'Ganancia Case 64 'Ganancia
If TCPago <> 1 AndAlso TxtFechaPago.Text <> TxtFecha.Text Then If TCPago > 0 AndAlso TCPago <> 1 AndAlso TxtFechaPago.Text <> TxtFecha.Text Then
IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria
CveCuenta = UsuarioActual.Empresa.CveCuentaGananciaCambiaria CveCuenta = UsuarioActual.Empresa.CveCuentaGananciaCambiaria
If TCPago < TipoCambioCompra Then If TCPago < TipoCambioCompra Then
@@ -6262,7 +6264,7 @@ Partial Class Compras_Compras
Case 65 'Perdida Case 65 'Perdida
If TCPago <> 1 AndAlso TxtFechaPago.Text <> TxtFecha.Text Then If TCPago > 0 AndAlso TCPago <> 1 AndAlso TxtFechaPago.Text <> TxtFecha.Text Then
IdCtaContable = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria IdCtaContable = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria
CveCuenta = UsuarioActual.Empresa.CveCuentaPerdidaCambiaria CveCuenta = UsuarioActual.Empresa.CveCuentaPerdidaCambiaria
If TCPago < TipoCambioCompra Then If TCPago < TipoCambioCompra Then
@@ -6309,7 +6311,7 @@ Partial Class Compras_Compras
Exit Select 'Es credito el concepto 6 se agrega en CASE 17 Exit Select 'Es credito el concepto 6 se agrega en CASE 17
End If End If
If Not CveCompraRefacturacion > 0 OrElse ChkRefacNC.Checked Then If Not CveCompraRefacturacion > 0 OrElse (ChkRefacNC.Checked) Then
'AF TipoAF 2 Es para las compras 'AF TipoAF 2 Es para las compras
DT = TmpDT.FiltraParametros("ISNULL(TipoAF,0) = 2 And ISNULL(AplicaCostoIndirecto,0) <> 1") DT = TmpDT.FiltraParametros("ISNULL(TipoAF,0) = 2 And ISNULL(AplicaCostoIndirecto,0) <> 1")
If DT.Rows.Count > 0 AndAlso Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") Then If DT.Rows.Count > 0 AndAlso Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") Then
@@ -6380,6 +6382,8 @@ Partial Class Compras_Compras
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMN, Referencia, 68, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CvePersonal:=CvePersonal, CveMovimientoAlmacen:=CveMovimientoInventario, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza) Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMN, Referencia, 68, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CvePersonal:=CvePersonal, CveMovimientoAlmacen:=CveMovimientoInventario, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza) Then
ErrorPrepoliza = True ErrorPrepoliza = True
End If End If
' si agrego en almacen, ya no se ocupa algun concepto puente
AgregaMercanciaInventario = False
End If End If
Next Next
End If End If
@@ -6419,6 +6423,8 @@ Partial Class Compras_Compras
Case 205 Case 205
ConceptoContabilizacionME = 230 ConceptoContabilizacionME = 230
ConceptoContabilizacionMEComp = 231 ConceptoContabilizacionMEComp = 231
importeMovimiento = TmpDT.SUMD(If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, "ImporteSinImpuestos", "Total"))
importeMN = importeMovimiento * tipoCambioActual * Multiplicador 'TIENE QUE TENER EL IMPORTEMN IGUAL AL IMPORTEMOVIMIENTO PORQUE NO TOMA EN CUENTA SI UN PRODUCTO ES TIPO SERVICIO
Case 237 Case 237
ConceptoContabilizacionME = 238 ConceptoContabilizacionME = 238
ConceptoContabilizacionMEComp = 239 ConceptoContabilizacionMEComp = 239
@@ -6611,7 +6617,7 @@ Partial Class Compras_Compras
DTDistinct = DTDistinct.FiltraParametros("ISNULL(TipoAF,0) <> 2 And ISNULL(CveAlmacen,0) = 0 And ISNULL(AplicaCostoIndirecto,0) <> 1", "", {"CveClasificacion", "Clasificacion", "SubProyecto", "CveSubProyecto", "CveTipoGasto", "TipoGasto"}) DTDistinct = DTDistinct.FiltraParametros("ISNULL(TipoAF,0) <> 2 And ISNULL(CveAlmacen,0) = 0 And ISNULL(AplicaCostoIndirecto,0) <> 1", "", {"CveClasificacion", "Clasificacion", "SubProyecto", "CveSubProyecto", "CveTipoGasto", "TipoGasto"})
End If End If
'RMF, si es concepto relacionado a flete o importacion, no debe de afectar al gasto 'RMF, si es concepto relacionado a flete o importacion, no debe de afectar al gasto
If CveFlete > 0 OrElse CveImportacion > 0 Then If CveFlete > 0 OrElse CveImportacion > 0 OrElse (CveCompraRefacturacion > 0 AndAlso ChkRefacNC.Checked) Then
DTDistinct.Clear() DTDistinct.Clear()
End If End If
@@ -14034,6 +14040,21 @@ Partial Class Compras_Compras
UpRefacturacion.Update() UpRefacturacion.Update()
End Sub End Sub
Private Sub DdlRefacturacionFacturas_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlRefacturacionFacturas.SelectedIndexChanged
If DdlRefacturacionFacturas.SelectedValue.ToEntero > 0 Then
Dim dr As DataRow = DtRefacturacion.FiltroPrimero(String.Format("CveCompra ={0}", DdlRefacturacionFacturas.SelectedValue))
If dr IsNot Nothing Then
HdnRefacturacionConcepto.Value = dr("CveConceptoContableAlmacen").ToString
ChkRefacturacionConAlmacen.Checked = If(dr("CveMovimientoAlmacen").ToString.ToEntero > 0, True, False)
End If
End If
End Sub
Protected Sub BtnRefacturacionAplicaFactura_Click(sender As Object, e As EventArgs) Handles BtnRefacturacionAplicaFactura.Click Protected Sub BtnRefacturacionAplicaFactura_Click(sender As Object, e As EventArgs) Handles BtnRefacturacionAplicaFactura.Click
TxtDescripcion.Text = String.Format("Refacturacion: {0}", DtRefacturacion.Rows(DdlRefacturacionFacturas.SelectedIndex - 1)("Descripcion")) TxtDescripcion.Text = String.Format("Refacturacion: {0}", DtRefacturacion.Rows(DdlRefacturacionFacturas.SelectedIndex - 1)("Descripcion"))
TxtFechaPago.Text = DtRefacturacion.Rows(DdlRefacturacionFacturas.SelectedIndex - 1)("FechaVencimiento").ToString.ToDate.ToShortDateString TxtFechaPago.Text = DtRefacturacion.Rows(DdlRefacturacionFacturas.SelectedIndex - 1)("FechaVencimiento").ToString.ToDate.ToShortDateString
@@ -14838,6 +14859,10 @@ Partial Class Compras_Compras
End If End If
End If End If
If DTOCGV.MAX("IVAPorcentaje").ToDecimal <> TmpDT.MAX("IVAPorcentaje").ToDecimal Then
Alert("La orden de compra(s) tiene diferentes tasa de IVA.", TipoMensaje.MsgAdvertencia)
End If
If DTOCGV.Rows.Count = 0 Then If DTOCGV.Rows.Count = 0 Then
Alert("La orden de compra no tiene nada pendiente por vincular. En caso de ser Entrega Directa por favor verifique el estatus de facturación.", TipoMensaje.MsgAdvertencia) Alert("La orden de compra no tiene nada pendiente por vincular. En caso de ser Entrega Directa por favor verifique el estatus de facturación.", TipoMensaje.MsgAdvertencia)
End If End If