-- merge ClsInventarios
This commit is contained in:
@@ -1,14 +1,11 @@
|
||||
<%@ Page Title="Catálogo de Unidades" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CierreCultivo.aspx.vb" Inherits="Agrupecuaria_CierreCultivo" EnableEventValidation="false" %>
|
||||
<%@ Page Title="Cierre de Cultivo" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CierreCultivo.aspx.vb" Inherits="Agrupecuaria_CierreCultivo" EnableEventValidation="false" %>
|
||||
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
|
||||
<style>
|
||||
#DivAgregarUnidad > div.modal-dialog > div label input {
|
||||
padding: 0px !important;
|
||||
}
|
||||
<style>
|
||||
</style>
|
||||
|
||||
</asp:Content>
|
||||
@@ -18,10 +15,10 @@
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<asp:UpdatePanel runat="server" ID="UpAgregar">
|
||||
<asp:UpdatePanel runat="server" ID="UpAcciones" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
|
||||
<asp:LinkButton ID="LnkAccionesCerrarCultivo" OnClick="LnkAccionesCerrarCultivo_Click" Visible="false" runat="server"><i class="fa fa-check"></i> Cerrar Cultivo</asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
@@ -33,32 +30,39 @@
|
||||
|
||||
<asp:UpdatePanel ID="UpFiltros" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet solid grey-cascade portlet-filter" style="">
|
||||
<div class="portlet-title portlet-filterT smalltitle" style="min-height: 49px; position: relative;">
|
||||
<div class="tools">
|
||||
<asp:Button ID="btConsultar" CssClass="btn btn-primary" runat="server" ValidationGroup="GrpConsultar" Text="Consultar" OnClick="btConsultar_Click" /></td>
|
||||
<a href="javascript:;" data-idchekbox="<%= chkexpand.ClientID%>" class=" <%= IIf(chkexpand.Checked = True, "collapse", "expand")%>"></a>
|
||||
<asp:CheckBox ID="chkexpand" CssClass="hidden" runat="server" />
|
||||
</div>
|
||||
<div class="titlefiltros caption magindate">
|
||||
<div class="row">
|
||||
<div class="portlet solid grey-cascade portlet-filter" style="">
|
||||
<div class="portlet-title portlet-filterT smalltitle" style="min-height: 49px; position: relative;">
|
||||
<div class="tools">
|
||||
<asp:Button ID="btConsultar" CssClass="btn btn-primary" runat="server" ValidationGroup="GrpConsultar" Text="Consultar" OnClick="btConsultar_Click" /></td>
|
||||
|
||||
<a href="javascript:;" data-idchekbox="<%= chkexpand.ClientID%>" class=" <%= IIf(chkexpand.Checked = True, "collapse", "expand")%>"></a>
|
||||
<asp:CheckBox ID="chkexpand" CssClass="hidden" runat="server" />
|
||||
</div>
|
||||
<div class="titlefiltros caption magindate">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-1 truncate">Temporada:</div>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlTemporada" CssClass="form-control input-sm select2me" runat="server" Width="100%"
|
||||
DataTextField="Temporada" DataValueField="CveTemporada">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<div class="col-md-1 truncate"><asp:Label runat="server" ID="LblSubProyecto"></asp:Label></div>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlSubProyectoCierreCultivo" runat="server" Width="100%" CssClass="form-control select2me" DataTextField="SubProyecto" DataValueField="CveSubProyecto"></asp:DropDownList>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="col-md-1 truncate">Temporada:</div>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlTemporada" CssClass="form-control input-sm select2me" runat="server" Width="100%"
|
||||
DataTextField="Temporada" DataValueField="CveTemporada">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="portlet-body magindate" <%= IIf(chkexpand.Checked = True, "", "style=""display:none;""")%>>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body magindate" <%= IIf(chkexpand.Checked = True, "", "style=""display:none;""")%>> 1
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
@@ -69,15 +73,15 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False"
|
||||
DataKeyNames="CveClasificacion"
|
||||
EmptyDataText="No se Encontraron datos" CssClass="table table-striped table-advance table-hover mysmallbtn " data-sort="true" Style="width: 100%" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Clasificación" DataField="Clasificacion" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Importe" DataField="Importe" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:n2}" />
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False"
|
||||
DataKeyNames="CveClasificacion"
|
||||
EmptyDataText="No se Encontraron datos" CssClass="table table-striped table-advance table-hover mysmallbtn " data-sort="true" Style="width: 100%" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Clasificación" DataField="Clasificacion" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Importe" DataField="Importe" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:n2}" />
|
||||
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -87,6 +91,53 @@
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="DivModalCerrarCultivo" class="modal ADS fade" role="dialog">
|
||||
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalCerrarCultivo" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-content">
|
||||
<div class="modal-header ">
|
||||
<h4 class="modal-title">Cerrar Cultivo</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
|
||||
<asp:TextBox ID="TxtmodalFechaCierreCultivo" CssClass="form-control" MaxLength="50" runat="server"></asp:TextBox>
|
||||
<span class="input-group-btn " style="position: absolute; right: 41px; top: -5px;">
|
||||
<asp:LinkButton ID="LnkTxtmodalFechaCierreCultivo" class="btn default" Style="margin-top: 15px; margin-left: 6px" Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
<ajax:CalendarExtender runat="server" ID="CETxtmodalFechaCierreCultivo" TargetControlID="TxtmodalFechaCierreCultivo" PopupButtonID="LnkTxtmodalFechaCierreCultivo" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
|
||||
<asp:CompareValidator ID="CvTxtmodalFechaCierreCultivo" runat="server" ControlToValidate="TxtmodalFechaCierreCultivo" Display="None"
|
||||
ErrorMessage="El campo <b>''Fecha de Cierre''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)."
|
||||
Operator="DataTypeCheck" Type="Date" ValidationGroup="GpoModalCerrarCultivo"></asp:CompareValidator>
|
||||
|
||||
<asp:RequiredFieldValidator ID="RfvTxtmodalFechaCierreCultivo" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtmodalFechaCierreCultivo"
|
||||
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha de Cierre''</b> es necesario, por favor ingréselo." ValidationGroup="GpoModalCerrarCultivo"></asp:RequiredFieldValidator>
|
||||
|
||||
<ajax:ValidatorCalloutExtender ID="CvcTxtmodalFechaCierreCultivo" runat="server" HighlightCssClass="vco" TargetControlID="CvTxtmodalFechaCierreCultivo" Width="100px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="VCE" runat="server" HighlightCssClass="vco" TargetControlID="RfvTxtmodalFechaCierreCultivo" Width="100px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
<label for="<%= TxtmodalFechaCierreCultivo.ClientID.ToString() %>">Fecha de Cierre:</label>
|
||||
<i></i>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:Button ID="BtnModalCerrarCultivo" runat="server" Text="Cerrar Cultivo" CssClass="btn btn-primary" ValidationGroup="GpoModalCerrarCultivo" />
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,21 +1,26 @@
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
Partial Class Agrupecuaria_CierreCultivo
|
||||
Inherits ClsPaginas
|
||||
|
||||
Private Property CveCamion As Integer
|
||||
Private Property DT_Datos_Cierre As DataTable
|
||||
Get
|
||||
|
||||
If ViewState("CveCamion") Is Nothing Then
|
||||
Return -1
|
||||
Else
|
||||
Return ViewState("CveCamion").ToString().ToEntero()
|
||||
If ViewState("DT_Datos_Cierre") Is Nothing Then
|
||||
ViewState("DataTable") = New DataTable
|
||||
End If
|
||||
|
||||
Return DirectCast(ViewState("DT_Datos_Cierre"), DataTable)
|
||||
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
ViewState("CveCamion") = value
|
||||
Set(ByVal value As DataTable)
|
||||
ViewState("DT_Datos_Cierre") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
|
||||
Private Sub Agrupecuaria_CierreCultivo_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
CargaCombos()
|
||||
@@ -36,6 +41,9 @@ Partial Class Agrupecuaria_CierreCultivo
|
||||
|
||||
UpFiltros.Update()
|
||||
|
||||
|
||||
CargarCentrosDeCosto(Nothing, DdlSubProyectoCierreCultivo, Nothing, LblSubProyecto, "Seleccione Uno")
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -51,10 +59,14 @@ Partial Class Agrupecuaria_CierreCultivo
|
||||
|
||||
If ObjGral.GetCierreCultivos(DdlTemporada.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
GvDatos.DataSource = ObjGral.DtResultados
|
||||
DT_Datos_Cierre = ObjGral.DtResultados
|
||||
Else
|
||||
GvDatos.DataSource = Nothing
|
||||
DT_Datos_Cierre = Nothing
|
||||
End If
|
||||
|
||||
OcultarmostrarControles(DT_Datos_Cierre)
|
||||
|
||||
ObjGral.Dispose()
|
||||
GvDatos.DataBind()
|
||||
UpDatos.Update()
|
||||
@@ -63,16 +75,66 @@ Partial Class Agrupecuaria_CierreCultivo
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub CierraCultivo()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Protected Sub btConsultar_Click(sender As Object, e As EventArgs)
|
||||
CargaDatos()
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkAccionesCerrarCultivo_Click(sender As Object, e As EventArgs)
|
||||
|
||||
|
||||
|
||||
RegistraScript("$('#DivModalCerrarCultivo').modal('show');")
|
||||
UpModalCerrarCultivo.Update()
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Public Sub OcultarmostrarControles(ByRef DTCierreCultivos As DataTable)
|
||||
|
||||
If DTCierreCultivos IsNot Nothing AndAlso DTCierreCultivos.Rows.Count > 0 Then
|
||||
LnkAccionesCerrarCultivo.Visible = True
|
||||
Else
|
||||
LnkAccionesCerrarCultivo.Visible = False
|
||||
End If
|
||||
|
||||
UpAcciones.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub CierraCultivo()
|
||||
|
||||
Dim ObjConta As New ClsContabilidad()
|
||||
ObjConta.IniciaTransacSQL()
|
||||
Dim CvePrePoliza As Integer = -1
|
||||
Dim ErrorProceso As Boolean = False
|
||||
|
||||
Dim CveSubProyecto As Integer = DdlSubProyectoCierreCultivo.SelectedValue.ToEntero
|
||||
|
||||
|
||||
Dim ImporteCierre As Decimal = DT_Datos_Cierre.SUMD("Importe")
|
||||
|
||||
CvePrePoliza = ObjConta.AddPrePolizas("CierreCultivo/Cerrar", 1, ImporteCierre, ImporteCierre, 1, TxtmodalFechaCierreCultivo.Text.ToDate, $"Cierre Temporada {DdlTemporada.Text}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo:=FolioFijo, ReglaFolioPoliza:=ObjCompras.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, DdlTipoTransaccionCaja.SelectedValue, UsuarioActual.CveEmpresa), CveTipoPoliza:=ObjConta.ObtenerTipoPoliza(DdlTipoTransaccion.SelectedValue, DdlTipoTransaccionCaja.SelectedValue, UsuarioActual.CveEmpresa))
|
||||
|
||||
If CvePrePoliza > 0 Then
|
||||
|
||||
Else
|
||||
ErrorProceso = True
|
||||
End If
|
||||
|
||||
|
||||
If ErrorProceso Then
|
||||
ObjConta.RollBack()
|
||||
Else
|
||||
ObjConta.Commit()
|
||||
|
||||
RegistraScript("$('#DivModalCerrarCultivo').modal('hide');")
|
||||
End If
|
||||
|
||||
ObjConta.Dispose()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
@@ -4070,7 +4070,7 @@ Public Class ClsGenerales
|
||||
.Add("@Cantidad", SqlDbType.Float).Value = Cantidad
|
||||
.Add("@CveUnidadMedida", SqlDbType.Int).Value = CveUnidadMedida
|
||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
.Add("@PesoKg", SqlDbType.SmallMoney).Value = CveUsuario
|
||||
.Add("@PesoKg", SqlDbType.SmallMoney).Value = PesoKg
|
||||
|
||||
End With
|
||||
|
||||
|
||||
@@ -859,7 +859,6 @@ Public Class ClsNominas
|
||||
DataAdapter("PA_Nom_NominasDetallesRemove")
|
||||
|
||||
SqlAdapter.SelectCommand.Parameters.Add("@CveNominaDetalle", SqlDbType.Int).Value = CveNominaDetalle
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
@@ -1063,12 +1062,15 @@ Public Class ClsNominas
|
||||
End Function
|
||||
|
||||
|
||||
Public Function RemoveNom_Nominas(CveNomina As Integer) As Boolean
|
||||
Public Function RemoveNom_Nominas(CveNomina As Integer, EliminarTodo As Boolean, CveUsuario As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_Nom_NominasRemove")
|
||||
|
||||
SqlAdapter.SelectCommand.Parameters.Add("@CveNomina", SqlDbType.Int).Value = CveNomina
|
||||
'
|
||||
SqlAdapter.SelectCommand.Parameters.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
SqlAdapter.SelectCommand.Parameters.Add("@EliminarTodo", SqlDbType.Int).Value = If(EliminarTodo, 1, 0)
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
|
||||
@@ -3841,9 +3841,9 @@ Namespace Modelos
|
||||
End If
|
||||
|
||||
If factura.TipoDocto = "Rem" AndAlso factura.ServicioDomicilio Then
|
||||
Dim CveMovimientoSalida As Integer = GenerarMovimientoAlmacenServicioDomicilio(ObjInventario, factura, DtInventario, factura.CveAlmacenServicioDomicilio, 8, factura.CveMoneda, factura.CveVenta, "Modelos/SD1")
|
||||
Dim CveMovimientoSalida As Integer = GenerarMovimientoAlmacenServicioDomicilio(ObjInventario, factura, DtInventario, factura.CveAlmacenServicioDomicilio, 8, factura.CveMoneda, factura.CveVenta, "Modelos/SD1", True, ObjConta)
|
||||
If CveMovimientoSalida > 0 Then
|
||||
If Not (GenerarMovimientoAlmacenServicioDomicilio(ObjInventario, factura, DtInventario, factura.CveAlmacenTraspasoDestino, 9, factura.CveMoneda, factura.CveVenta, "Modelos/SD2", CveMovimientoRelacionado:=CveMovimientoSalida) > 0) Then
|
||||
If Not (GenerarMovimientoAlmacenServicioDomicilio(ObjInventario, factura, DtInventario, factura.CveAlmacenTraspasoDestino, 9, factura.CveMoneda, factura.CveVenta, "Modelos/SD2", True, ObjConta, CveMovimientoRelacionado:=CveMovimientoSalida) > 0) Then
|
||||
OcurrioError = True
|
||||
End If
|
||||
|
||||
@@ -5558,7 +5558,7 @@ Namespace Modelos
|
||||
End If
|
||||
|
||||
If SaldoAlmacenExA <> 0 Then
|
||||
If Not CancelarMovimientosRemision(CveRemision, CveAlmacen, CveAlmacenDevolucion, DtDevRemision.FiltraParametros($"CveMovimiento={RowDevolucion("CveMovimiento")}"), ObjVentas, ObjInventario) Then
|
||||
If Not CancelarMovimientosRemision(CveRemision, CveAlmacen, CveAlmacenDevolucion, DtDevRemision.FiltraParametros($"CveMovimiento={RowDevolucion("CveMovimiento")}"), ObjVentas, ObjInventario, ObjConta) Then
|
||||
ErrorCancelar = True
|
||||
MensajeError = "Ocurrió un error al cancelar los movimientos de la remisión."
|
||||
Exit For
|
||||
@@ -5680,7 +5680,7 @@ Namespace Modelos
|
||||
For Each RowDevolucion As DataRow In DtDevMovs.Rows
|
||||
CveAlmacen = RowDevolucion("CveAlmacen").ToString().ToEntero()
|
||||
|
||||
If Not CancelarMovimientosRemision(CveVenta, CveAlmacen, CveAlmacenGeneral, DtMovRemision.FiltraParametros($"CveMovimiento={RowDevolucion("CveMovimiento")} AND CvePS > 0"), ObjVentas, ObjInventario) Then
|
||||
If Not CancelarMovimientosRemision(CveVenta, CveAlmacen, CveAlmacenGeneral, DtMovRemision.FiltraParametros($"CveMovimiento={RowDevolucion("CveMovimiento")} AND CvePS > 0"), ObjVentas, ObjInventario, ObjConta) Then
|
||||
ErrorCancelar = True
|
||||
MensajeError = "Ocurrió un error al cancelar los movimientos de la remisión."
|
||||
Exit For
|
||||
@@ -6226,7 +6226,7 @@ Namespace Modelos
|
||||
Return Not ErrorCancelar
|
||||
End Function
|
||||
|
||||
Private Function CancelarMovimientosRemision(CveRemision As Integer, CveAlmacen As Integer, CveAlmacenDestino As Integer, DtMovDetalle As DataTable, ByRef ObjVentas As ClsVentas, ByRef ObjInventario As ClsInventarios) As Boolean
|
||||
Private Function CancelarMovimientosRemision(CveRemision As Integer, CveAlmacen As Integer, CveAlmacenDestino As Integer, DtMovDetalle As DataTable, ByRef ObjVentas As ClsVentas, ByRef ObjInventario As ClsInventarios, ByRef ObjConta As ClsContabilidad) As Boolean
|
||||
Dim ErrorCancelar As Boolean = False
|
||||
|
||||
Dim CveMovimientoSalidaDevRem As Integer = 0
|
||||
@@ -6234,13 +6234,14 @@ Namespace Modelos
|
||||
|
||||
Dim CveMovimientoEntradaDevRem As Integer = 0
|
||||
Dim FolioMovimientoEntradaDevRem As Integer = 0
|
||||
Dim Fecha As DateTime = Now
|
||||
|
||||
'SALIDA DE (ENTREGA POR ADELANTADO)
|
||||
CveMovimientoSalidaDevRem = ObjInventario.AddMovimiento(CveAlmacen, 8, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveRemision, -1, -1, Observaciones:="", Guia:="", CveContrato:=CveContrato, CveAlmacenDestino:=CveAlmacenDestino, Modulo:="Mod/CancExAR1")
|
||||
CveMovimientoSalidaDevRem = ObjInventario.AddMovimiento(CveAlmacen, 8, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveRemision, -1, -1, Observaciones:="", Guia:="", CveContrato:=CveContrato, CveAlmacenDestino:=CveAlmacenDestino, Modulo:="Mod/CancExAR1")
|
||||
FolioMovimientoSalidaDevRem = ObjInventario.Folio
|
||||
|
||||
'ENTRADA A (ALMACEN GENERAL)
|
||||
CveMovimientoEntradaDevRem = ObjInventario.AddMovimiento(CveAlmacenDestino, 9, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveRemision, -1, -1, Observaciones:="", Guia:="", CveContrato:=CveContrato, CveMovimientoRelacionado:=CveMovimientoSalidaDevRem, CveAlmacenDestino:=CveAlmacenDestino, Modulo:="Mod/CancExAR2")
|
||||
CveMovimientoEntradaDevRem = ObjInventario.AddMovimiento(CveAlmacenDestino, 9, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveRemision, -1, -1, Observaciones:="", Guia:="", CveContrato:=CveContrato, CveMovimientoRelacionado:=CveMovimientoSalidaDevRem, CveAlmacenDestino:=CveAlmacenDestino, Modulo:="Mod/CancExAR2")
|
||||
FolioMovimientoEntradaDevRem = ObjInventario.Folio
|
||||
|
||||
If Not (CveMovimientoSalidaDevRem > 0 And CveMovimientoEntradaDevRem > 0) Then
|
||||
@@ -6286,11 +6287,29 @@ Namespace Modelos
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
Dim ValorInventario As Decimal = DtEntradaDetalle.SUMD("Total")
|
||||
Dim EsContabilizable As Boolean = False
|
||||
Dim Concepto As String = "Cancelación"
|
||||
Dim CvePrePoliza = ObjConta.AddPrePolizas("Mod/CancExAR1", 74, DtEntradaDetalle.SUMD("Total"), DtEntradaDetalle.SUMD("Total"), 1, Fecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
Dim tCveSubProyecto = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=CveAlmacen).FiltroPrimeroValor("CveSubProyecto").ToEntero
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ValorInventario, Concepto, 68, Concepto, Fecha, 0, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimientoSalidaDevRem, ImporteMX:=ValorInventario, CveSubProyecto:=tCveSubProyecto, Contabilizable:=EsContabilizable) Then
|
||||
ErrorCancelar = True
|
||||
End If
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ValorInventario, Concepto, 68, Concepto, Fecha, 0, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimientoEntradaDevRem, ImporteMX:=ValorInventario, Contabilizable:=EsContabilizable) Then
|
||||
ErrorCancelar = True
|
||||
End If
|
||||
|
||||
|
||||
Else
|
||||
ErrorCancelar = True
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
If Not ErrorCancelar Then
|
||||
If Not ObjVentas.UpdateVentasDevolucionAlmacen(2, CveRemision) Then
|
||||
ErrorCancelar = True
|
||||
|
||||
@@ -600,7 +600,6 @@ Public Class Timbrado
|
||||
Dim Clave As String = Empresa.ContraseñaKey
|
||||
Dim UrlServicio As String = "" ' Produccion
|
||||
|
||||
'UrlServicio = "http://juancalderon-001-site1.ftempurl.com/timbrado.asmx?WSDL"
|
||||
'UrlServicio = "http://alterno.gofac.com.mx/cfdi/timbrado.asmx?WSDL" ' alterno
|
||||
UrlServicio = "https://cfdi.gofac.com.mx/timbrado.asmx?WSDL"
|
||||
|
||||
@@ -1138,10 +1137,10 @@ Public Class Timbrado
|
||||
Equivalencia = 1
|
||||
'condiciones especiales para el pago en pesos, facturas en moneda extranjera
|
||||
ElseIf MonedaPago = "MXN" AndAlso VentaAbreviaturaSAT <> "MXN" Then
|
||||
VentaTipoCambio = VentaTipoCambio.RoundSQL(6)
|
||||
Equivalencia = (1 / VentaTipoCambio).RoundSQL(6)
|
||||
VentaTipoCambio = Math.Round(VentaTipoCambio, 6)
|
||||
Equivalencia = Math.Round((1 / VentaTipoCambio), 6)
|
||||
ElseIf MonedaPago = "USD" AndAlso VentaAbreviaturaSAT <> "USD" Then
|
||||
VentaTipoCambio = VentaTipoCambio.RoundSQL(6)
|
||||
VentaTipoCambio = Math.Round(VentaTipoCambio, 6)
|
||||
Equivalencia = VentaTipoCambio
|
||||
End If
|
||||
|
||||
@@ -1167,8 +1166,8 @@ Public Class Timbrado
|
||||
.TasaOCuota = drp("PorcentajeImpuesto").ToString().ToDecimal,
|
||||
.Impuesto = drp("TipoImpuesto").ToString,
|
||||
.Importe = drp("Importe").ToString().ToDecimal.RoundSQL,
|
||||
.BaseMN = (drp("Base").ToString.ToDecimal / Equivalencia).RoundSQL(2),
|
||||
.ImporteMN = (drp("Importe").ToString.ToDecimal / Equivalencia).RoundSQL(2)
|
||||
.BaseMN = Math.Round((drp("Base").ToString.ToDecimal / Equivalencia), 2),
|
||||
.ImporteMN = Math.Round((drp("Importe").ToString.ToDecimal / Equivalencia), 2)
|
||||
}
|
||||
)
|
||||
|
||||
@@ -2235,7 +2234,6 @@ Public Class Timbrado
|
||||
Case 2
|
||||
UrlServicio = "http://generacfdi.com.mx/rvltimbrado/service1.asmx?WSDL" 'productivo
|
||||
Case 4
|
||||
'UrlServicio = "http://juancalderon-001-site1.ftempurl.com/timbrado.asmx?WSDL"
|
||||
'UrlServicio = "http://alterno.gofac.com.mx/cfdi/timbrado.asmx?WSDL" ' alterno
|
||||
UrlServicio = "https://cfdi.gofac.com.mx/timbrado.asmx?WSDL"
|
||||
End Select
|
||||
@@ -2260,7 +2258,7 @@ Public Class Timbrado
|
||||
Case 4
|
||||
UsuarioServicio = "UserTest"
|
||||
ClaveServicio = "1234567890"
|
||||
UrlServicio = "http://juancalderon-001-site1.ftempurl.com/timbrado.asmx?WSDL"
|
||||
UrlServicio = "https://cfdi.gofac.com.mx/timbrado.asmx"
|
||||
End Select
|
||||
End If
|
||||
|
||||
@@ -4074,52 +4072,11 @@ Public Class Timbrado
|
||||
#Region " Complemento Pago"
|
||||
|
||||
If ObjCFDITimbre.Comprobante.TipoComprobante = "P" Then
|
||||
Dim ComPag = New Profact.TimbraCFDI40.Complementos.Pagos20.Pagos()
|
||||
|
||||
ComPag.Pago = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPago(0) {}
|
||||
ComPag.Pago(0) = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPago()
|
||||
ComPag.Pago(0).FechaPago = ObjCFDITimbre.ComplementoPagos.FechaPago.ToString("yyyy-MM-ddTHH:mm:ss").ToDate()
|
||||
ComPag.Pago(0).FormaDePagoP = ObjCFDITimbre.ComplementoPagos.FormaDePagoP
|
||||
ComPag.Pago(0).MonedaP = ObjCFDITimbre.ComplementoPagos.MonedaP
|
||||
ComPag.Pago(0).TipoCambioPSpecified = True 'If(ObjCFDITimbre.ComplementoPagos.MonedaP = "MXN", False, True)
|
||||
ComPag.Pago(0).TipoCambioP = ObjCFDITimbre.ComplementoPagos.TipoCambioP
|
||||
ComPag.Pago(0).Monto = ObjCFDITimbre.ComplementoPagos.Monto
|
||||
If ObjCFDITimbre.ComplementoPagos.NumOperacion <> "" Then
|
||||
ComPag.Pago(0).NumOperacion = ObjCFDITimbre.ComplementoPagos.NumOperacion
|
||||
End If
|
||||
If ObjCFDITimbre.ComplementoPagos.RfcEmisorCtaOrd <> "" Then
|
||||
ComPag.Pago(0).RfcEmisorCtaOrd = ObjCFDITimbre.ComplementoPagos.RfcEmisorCtaOrd
|
||||
End If
|
||||
If ObjCFDITimbre.ComplementoPagos.NomBancoOrdExt <> "" Then
|
||||
ComPag.Pago(0).NomBancoOrdExt = ObjCFDITimbre.ComplementoPagos.NomBancoOrdExt
|
||||
End If
|
||||
If ObjCFDITimbre.ComplementoPagos.CtaOrdenante <> "" Then
|
||||
ComPag.Pago(0).CtaOrdenante = ObjCFDITimbre.ComplementoPagos.CtaOrdenante
|
||||
End If
|
||||
If ObjCFDITimbre.ComplementoPagos.RfcEmisorCtaBen <> "" Then
|
||||
ComPag.Pago(0).RfcEmisorCtaBen = ObjCFDITimbre.ComplementoPagos.RfcEmisorCtaBen
|
||||
End If
|
||||
If ObjCFDITimbre.ComplementoPagos.CtaBeneficiario <> "" Then
|
||||
ComPag.Pago(0).CtaBeneficiario = ObjCFDITimbre.ComplementoPagos.CtaBeneficiario
|
||||
End If
|
||||
If ObjCFDITimbre.ComplementoPagos.TipoCadPago <> "" Then
|
||||
ComPag.Pago(0).TipoCadPagoSpecified = True
|
||||
ComPag.Pago(0).TipoCadPago = ObjCFDITimbre.ComplementoPagos.TipoCadPago
|
||||
End If
|
||||
|
||||
If ObjCFDITimbre.ComplementoPagos.CertPago <> "" Then
|
||||
ComPag.Pago(0).CertPago = System.Text.Encoding.Default.GetBytes(ObjCFDITimbre.ComplementoPagos.CertPago).ToString()
|
||||
End If
|
||||
If ObjCFDITimbre.ComplementoPagos.CadPago <> "" Then
|
||||
ComPag.Pago(0).CadPago = ObjCFDITimbre.ComplementoPagos.CadPago
|
||||
End If
|
||||
If ObjCFDITimbre.ComplementoPagos.SelloPago <> "" Then
|
||||
ComPag.Pago(0).SelloPago = System.Text.Encoding.Default.GetBytes(ObjCFDITimbre.ComplementoPagos.SelloPago).ToString()
|
||||
End If
|
||||
If ObjCFDITimbre.ComplementoPagos20.ComplementoPagos.Count > 0 Then
|
||||
|
||||
If ObjCFDITimbre.ComplementoPagos.DocumentosRelacionados.Count > 0 Then
|
||||
Dim Totales As New Profact.TimbraCFDI40.Complementos.Pagos20.PagosTotales()
|
||||
'Totales Generales
|
||||
Dim Totales As New Profact.TimbraCFDI40.Complementos.Pagos20.PagosTotales() 'Totales Generales
|
||||
|
||||
Totales.MontoTotalPagos = ObjCFDITimbre.ComplementoPagos20.MontoTotalPagos.RoundSQL
|
||||
|
||||
@@ -4137,6 +4094,7 @@ Public Class Timbrado
|
||||
Totales.TotalTrasladosBaseIVA0Specified = Totales.TotalTrasladosBaseIVA0 > 0
|
||||
Totales.TotalTrasladosImpuestoIVA0 = 0
|
||||
Totales.TotalTrasladosImpuestoIVA0Specified = Totales.TotalTrasladosBaseIVA0 > 0 ' si hay base > 0, debe de ponerse aunque sea en cero
|
||||
|
||||
If ObjCFDITimbre.ComplementoPagos20.TotalRetencionesIEPS > 0 Then
|
||||
Totales.TotalRetencionesIEPS = ObjCFDITimbre.ComplementoPagos20.TotalRetencionesIEPS.RoundSQL
|
||||
Totales.TotalRetencionesIEPSSpecified = True
|
||||
@@ -4144,105 +4102,141 @@ Public Class Timbrado
|
||||
Totales.TotalRetencionesIEPSSpecified = False
|
||||
End If
|
||||
|
||||
Dim ComPag = New Profact.TimbraCFDI40.Complementos.Pagos20.Pagos()
|
||||
|
||||
ComPag.Totales = Totales
|
||||
ComPag.Pago = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPago(ObjCFDITimbre.ComplementoPagos20.ComplementoPagos.Count - 1) {}
|
||||
Dim ii As Integer = 0
|
||||
For Each docp As CFDIComplementoPago In ObjCFDITimbre.ComplementoPagos20.ComplementoPagos
|
||||
|
||||
ComPag.Pago(0).DoctoRelacionado = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoDoctoRelacionado(ObjCFDITimbre.ComplementoPagos.DocumentosRelacionados.Count - 1) {}
|
||||
Dim i As Integer
|
||||
For Each doc As CFDIComplementoPagosDocsRelacionados In ObjCFDITimbre.ComplementoPagos.DocumentosRelacionados
|
||||
ComPag.Pago(0).DoctoRelacionado(i) = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoDoctoRelacionado()
|
||||
ComPag.Pago(0).DoctoRelacionado(i).IdDocumento = doc.IdDocumento
|
||||
If Not String.IsNullOrEmpty(doc.Serie) Then
|
||||
ComPag.Pago(0).DoctoRelacionado(i).Serie = doc.Serie
|
||||
ComPag.Pago(ii) = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPago()
|
||||
ComPag.Pago(ii).FechaPago = docp.FechaPago.ToString("yyyy-MM-ddTHH:mm:ss").ToDate()
|
||||
ComPag.Pago(ii).FormaDePagoP = docp.FormaDePagoP
|
||||
ComPag.Pago(ii).MonedaP = docp.MonedaP
|
||||
ComPag.Pago(ii).TipoCambioPSpecified = True 'If(ObjCFDITimbre.ComplementoPagos.MonedaP = "MXN", False, True)
|
||||
ComPag.Pago(ii).TipoCambioP = docp.TipoCambioP
|
||||
ComPag.Pago(ii).Monto = docp.Monto
|
||||
If docp.NumOperacion <> "" Then ComPag.Pago(ii).NumOperacion = docp.NumOperacion
|
||||
|
||||
If docp.RfcEmisorCtaOrd <> "" Then ComPag.Pago(ii).RfcEmisorCtaOrd = docp.RfcEmisorCtaOrd
|
||||
|
||||
If docp.NomBancoOrdExt <> "" Then ComPag.Pago(ii).NomBancoOrdExt = docp.NomBancoOrdExt
|
||||
|
||||
If docp.CtaOrdenante <> "" Then ComPag.Pago(ii).CtaOrdenante = docp.CtaOrdenante
|
||||
|
||||
If docp.RfcEmisorCtaBen <> "" Then ComPag.Pago(ii).RfcEmisorCtaBen = docp.RfcEmisorCtaBen
|
||||
|
||||
If docp.CtaBeneficiario <> "" Then ComPag.Pago(ii).CtaBeneficiario = docp.CtaBeneficiario
|
||||
|
||||
If docp.TipoCadPago <> "" Then
|
||||
ComPag.Pago(ii).TipoCadPagoSpecified = True
|
||||
ComPag.Pago(ii).TipoCadPago = docp.TipoCadPago
|
||||
End If
|
||||
ComPag.Pago(0).DoctoRelacionado(i).Folio = doc.Folio
|
||||
ComPag.Pago(0).DoctoRelacionado(i).MonedaDR = doc.MonedaDR
|
||||
ComPag.Pago(0).DoctoRelacionado(i).NumParcialidad = doc.NumParcialidad.ToString
|
||||
ComPag.Pago(0).DoctoRelacionado(i).ImpSaldoAnt = doc.ImpSaldoAnt.RoundSQL
|
||||
ComPag.Pago(0).DoctoRelacionado(i).ImpPagadoSpecified = True
|
||||
ComPag.Pago(0).DoctoRelacionado(i).ImpPagado = doc.ImpPagado.RoundSQL
|
||||
ComPag.Pago(0).DoctoRelacionado(i).ImpSaldoInsoluto = doc.ImpSaldoInsoluto.RoundSQL
|
||||
ComPag.Pago(0).DoctoRelacionado(i).EquivalenciaDR = doc.EquivalenciaDR.RoundSQL(6)
|
||||
ComPag.Pago(0).DoctoRelacionado(i).EquivalenciaDRSpecified = True
|
||||
ComPag.Pago(0).DoctoRelacionado(i).ObjetoImpDR = doc.ObjetoImpuesto
|
||||
|
||||
If doc.Impuestos IsNot Nothing Then
|
||||
ComPag.Pago(0).DoctoRelacionado(i).ImpuestosDR = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoDoctoRelacionadoImpuestosDR
|
||||
If docp.CertPago <> "" Then ComPag.Pago(ii).CertPago = System.Text.Encoding.Default.GetBytes(docp.CertPago).ToString()
|
||||
|
||||
''retenciones
|
||||
If (doc.Impuestos).Where(Function(x) x.TrasladooRetencion = "R").Count > 0 Then
|
||||
Dim j As Integer = 0
|
||||
ComPag.Pago(0).DoctoRelacionado(i).ImpuestosDR.RetencionesDR = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoDoctoRelacionadoImpuestosDRRetencionDR(doc.Impuestos.Where(Function(x) x.TrasladooRetencion = "R").Count - 1) {}
|
||||
If docp.CadPago <> "" Then ComPag.Pago(ii).CadPago = docp.CadPago
|
||||
|
||||
For Each docimp As CFDIConceptosImpuestos In doc.Impuestos.Where(Function(x) x.TrasladooRetencion = "R")
|
||||
If docimp.TrasladooRetencion = "R" Then
|
||||
Dim Tra As New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoDoctoRelacionadoImpuestosDRRetencionDR
|
||||
Tra.BaseDR = docimp.Base.RoundSQL(2)
|
||||
Tra.ImporteDR = docimp.Importe.RoundSQL(2)
|
||||
Tra.ImpuestoDR = docimp.Impuesto
|
||||
Tra.TipoFactorDR = docimp.TipoFactor
|
||||
Tra.TasaOCuotaDR = docimp.TasaOCuota.RoundSQL(6)
|
||||
ComPag.Pago(0).DoctoRelacionado(i).ImpuestosDR.RetencionesDR(j) = Tra
|
||||
End If
|
||||
j += 1
|
||||
If docp.SelloPago <> "" Then ComPag.Pago(ii).SelloPago = System.Text.Encoding.Default.GetBytes(docp.SelloPago).ToString()
|
||||
|
||||
ComPag.Pago(ii).DoctoRelacionado = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoDoctoRelacionado(docp.DocumentosRelacionados.Count - 1) {}
|
||||
|
||||
Dim i As Integer
|
||||
For Each doc As CFDIComplementoPagosDocsRelacionados In docp.DocumentosRelacionados
|
||||
ComPag.Pago(ii).DoctoRelacionado(i) = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoDoctoRelacionado()
|
||||
ComPag.Pago(ii).DoctoRelacionado(i).IdDocumento = doc.IdDocumento
|
||||
If Not String.IsNullOrEmpty(doc.Serie) Then
|
||||
ComPag.Pago(ii).DoctoRelacionado(i).Serie = doc.Serie
|
||||
End If
|
||||
ComPag.Pago(ii).DoctoRelacionado(i).Folio = doc.Folio
|
||||
ComPag.Pago(ii).DoctoRelacionado(i).MonedaDR = doc.MonedaDR
|
||||
ComPag.Pago(ii).DoctoRelacionado(i).NumParcialidad = doc.NumParcialidad.ToString
|
||||
ComPag.Pago(ii).DoctoRelacionado(i).ImpSaldoAnt = doc.ImpSaldoAnt.RoundSQL
|
||||
ComPag.Pago(ii).DoctoRelacionado(i).ImpPagadoSpecified = True
|
||||
ComPag.Pago(ii).DoctoRelacionado(i).ImpPagado = doc.ImpPagado.RoundSQL
|
||||
ComPag.Pago(ii).DoctoRelacionado(i).ImpSaldoInsoluto = doc.ImpSaldoInsoluto.RoundSQL
|
||||
ComPag.Pago(ii).DoctoRelacionado(i).EquivalenciaDR = doc.EquivalenciaDR.RoundSQL(6)
|
||||
ComPag.Pago(ii).DoctoRelacionado(i).EquivalenciaDRSpecified = True
|
||||
ComPag.Pago(ii).DoctoRelacionado(i).ObjetoImpDR = doc.ObjetoImpuesto
|
||||
|
||||
If doc.Impuestos IsNot Nothing Then
|
||||
ComPag.Pago(ii).DoctoRelacionado(i).ImpuestosDR = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoDoctoRelacionadoImpuestosDR
|
||||
|
||||
''retenciones
|
||||
If (doc.Impuestos).Where(Function(x) x.TrasladooRetencion = "R").Count > 0 Then
|
||||
Dim j As Integer = 0
|
||||
ComPag.Pago(ii).DoctoRelacionado(i).ImpuestosDR.RetencionesDR = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoDoctoRelacionadoImpuestosDRRetencionDR(doc.Impuestos.Where(Function(x) x.TrasladooRetencion = "R").Count - 1) {}
|
||||
|
||||
For Each docimp As CFDIConceptosImpuestos In doc.Impuestos.Where(Function(x) x.TrasladooRetencion = "R")
|
||||
If docimp.TrasladooRetencion = "R" Then
|
||||
Dim Tra As New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoDoctoRelacionadoImpuestosDRRetencionDR
|
||||
Tra.BaseDR = docimp.Base.RoundSQL(2)
|
||||
Tra.ImporteDR = docimp.Importe.RoundSQL(2)
|
||||
Tra.ImpuestoDR = docimp.Impuesto
|
||||
Tra.TipoFactorDR = docimp.TipoFactor
|
||||
Tra.TasaOCuotaDR = docimp.TasaOCuota.RoundSQL(6)
|
||||
ComPag.Pago(ii).DoctoRelacionado(i).ImpuestosDR.RetencionesDR(j) = Tra
|
||||
End If
|
||||
j += 1
|
||||
Next
|
||||
End If
|
||||
|
||||
''traslados
|
||||
If (doc.Impuestos).Where(Function(x) x.TrasladooRetencion = "T").Count > 0 Then
|
||||
Dim j As Integer = 0
|
||||
ComPag.Pago(ii).DoctoRelacionado(i).ImpuestosDR.TrasladosDR = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoDoctoRelacionadoImpuestosDRTrasladoDR(doc.Impuestos.Where(Function(x) x.TrasladooRetencion = "T").Count - 1) {}
|
||||
|
||||
For Each docimp As CFDIConceptosImpuestos In doc.Impuestos.Where(Function(x) x.TrasladooRetencion = "T")
|
||||
|
||||
If docimp.TrasladooRetencion = "T" Then
|
||||
Dim Tra As New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoDoctoRelacionadoImpuestosDRTrasladoDR
|
||||
Tra.BaseDR = docimp.Base.RoundSQL(2)
|
||||
Tra.ImporteDRSpecified = True
|
||||
Tra.ImporteDR = docimp.Importe.RoundSQL(2)
|
||||
Tra.ImpuestoDR = docimp.Impuesto
|
||||
Tra.TipoFactorDR = docimp.TipoFactor
|
||||
Tra.TasaOCuotaDRSpecified = True
|
||||
Tra.TasaOCuotaDR = docimp.TasaOCuota.RoundSQL(6)
|
||||
ComPag.Pago(ii).DoctoRelacionado(i).ImpuestosDR.TrasladosDR(j) = Tra
|
||||
End If
|
||||
j += 1
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
i += 1
|
||||
Next
|
||||
|
||||
If docp.Retenciones.Count > 0 OrElse docp.Traslados.Count > 0 Then
|
||||
ComPag.Pago(ii).ImpuestosP = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosP(0) {}
|
||||
ComPag.Pago(ii).ImpuestosP(0) = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosP()
|
||||
|
||||
If docp.Retenciones.Count > 0 Then
|
||||
Dim x As Integer
|
||||
ComPag.Pago(ii).ImpuestosP(0).RetencionesP = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPRetencionP(docp.Retenciones.Count - 1) {}
|
||||
For Each Ret As CFDIRetenciones In ObjCFDITimbre.ComplementoPagos.Retenciones
|
||||
ComPag.Pago(ii).ImpuestosP(0).RetencionesP(x) = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPRetencionP()
|
||||
ComPag.Pago(ii).ImpuestosP(0).RetencionesP(x).ImpuestoP = Ret.Impuesto
|
||||
ComPag.Pago(ii).ImpuestosP(0).RetencionesP(x).ImporteP = Ret.ImporteMN
|
||||
x += 1
|
||||
Next
|
||||
End If
|
||||
|
||||
''traslados
|
||||
If (doc.Impuestos).Where(Function(x) x.TrasladooRetencion = "T").Count > 0 Then
|
||||
Dim j As Integer = 0
|
||||
ComPag.Pago(0).DoctoRelacionado(i).ImpuestosDR.TrasladosDR = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoDoctoRelacionadoImpuestosDRTrasladoDR(doc.Impuestos.Where(Function(x) x.TrasladooRetencion = "T").Count - 1) {}
|
||||
|
||||
For Each docimp As CFDIConceptosImpuestos In doc.Impuestos.Where(Function(x) x.TrasladooRetencion = "T")
|
||||
|
||||
If docimp.TrasladooRetencion = "T" Then
|
||||
Dim Tra As New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoDoctoRelacionadoImpuestosDRTrasladoDR
|
||||
Tra.BaseDR = docimp.Base.RoundSQL(2)
|
||||
Tra.ImporteDRSpecified = True
|
||||
Tra.ImporteDR = docimp.Importe.RoundSQL(2)
|
||||
Tra.ImpuestoDR = docimp.Impuesto
|
||||
Tra.TipoFactorDR = docimp.TipoFactor
|
||||
Tra.TasaOCuotaDRSpecified = True
|
||||
Tra.TasaOCuotaDR = docimp.TasaOCuota.RoundSQL(6)
|
||||
ComPag.Pago(0).DoctoRelacionado(i).ImpuestosDR.TrasladosDR(j) = Tra
|
||||
End If
|
||||
j += 1
|
||||
If docp.Traslados.Count > 0 Then
|
||||
Dim x As Integer
|
||||
ComPag.Pago(ii).ImpuestosP(0).TrasladosP = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPTrasladoP(docp.Traslados.Count - 1) {}
|
||||
For Each Tra As CFDITraslados In (docp.Traslados)
|
||||
ComPag.Pago(ii).ImpuestosP(0).TrasladosP(x) = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPTrasladoP()
|
||||
ComPag.Pago(ii).ImpuestosP(0).TrasladosP(x).ImpuestoP = Tra.Impuesto
|
||||
ComPag.Pago(ii).ImpuestosP(0).TrasladosP(x).TipoFactorP = Tra.TipoFactor
|
||||
ComPag.Pago(ii).ImpuestosP(0).TrasladosP(x).TasaOCuotaP = Tra.TasaOCuota.RoundSQL(6)
|
||||
ComPag.Pago(ii).ImpuestosP(0).TrasladosP(x).ImporteP = Tra.ImporteMN.RoundSQL(6)
|
||||
ComPag.Pago(ii).ImpuestosP(0).TrasladosP(x).BaseP = Tra.BaseMN.RoundSQL(2)
|
||||
x += 1
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
i += 1
|
||||
Next
|
||||
|
||||
If (ObjCFDITimbre.ComplementoPagos.Retenciones).Count > 0 OrElse ObjCFDITimbre.ComplementoPagos.Traslados.Count > 0 Then
|
||||
ComPag.Pago(0).ImpuestosP = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosP(0) {}
|
||||
ComPag.Pago(0).ImpuestosP(0) = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosP()
|
||||
|
||||
If (ObjCFDITimbre.ComplementoPagos.Retenciones).Count > 0 Then
|
||||
Dim x As Integer
|
||||
ComPag.Pago(0).ImpuestosP(0).RetencionesP = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPRetencionP((ObjCFDITimbre.ComplementoPagos.Retenciones).Count - 1) {}
|
||||
For Each Ret As CFDIRetenciones In ObjCFDITimbre.ComplementoPagos.Retenciones
|
||||
ComPag.Pago(0).ImpuestosP(0).RetencionesP(x) = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPRetencionP()
|
||||
ComPag.Pago(0).ImpuestosP(0).RetencionesP(x).ImpuestoP = Ret.Impuesto
|
||||
ComPag.Pago(0).ImpuestosP(0).RetencionesP(x).ImporteP = Ret.ImporteMN
|
||||
x += 1
|
||||
Next
|
||||
End If
|
||||
|
||||
If ObjCFDITimbre.ComplementoPagos.Traslados.Count > 0 Then
|
||||
Dim x As Integer
|
||||
ComPag.Pago(0).ImpuestosP(0).TrasladosP = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPTrasladoP((ObjCFDITimbre.ComplementoPagos.Traslados).Count - 1) {}
|
||||
For Each Tra As CFDITraslados In (ObjCFDITimbre.ComplementoPagos.Traslados)
|
||||
ComPag.Pago(0).ImpuestosP(0).TrasladosP(x) = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPTrasladoP()
|
||||
ComPag.Pago(0).ImpuestosP(0).TrasladosP(x).ImpuestoP = Tra.Impuesto
|
||||
ComPag.Pago(0).ImpuestosP(0).TrasladosP(x).TipoFactorP = Tra.TipoFactor
|
||||
ComPag.Pago(0).ImpuestosP(0).TrasladosP(x).TasaOCuotaP = Tra.TasaOCuota.RoundSQL(6)
|
||||
ComPag.Pago(0).ImpuestosP(0).TrasladosP(x).ImporteP = Tra.ImporteMN.RoundSQL(6)
|
||||
ComPag.Pago(0).ImpuestosP(0).TrasladosP(x).BaseP = Tra.BaseMN.RoundSQL(2)
|
||||
x += 1
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
Dim nsComp As New System.Xml.Serialization.XmlSerializerNamespaces()
|
||||
nsComp.Add("pago20", "http://www.sat.gob.mx/Pagos20")
|
||||
Dim xmlComp As String = Profact.TimbraCFDI.XMLUtilerias.SerializaObjeto(ComPag, GetType(Profact.TimbraCFDI40.Complementos.Pagos20.Pagos), nsComp)
|
||||
|
||||
@@ -734,7 +734,7 @@
|
||||
</asp:Panel>
|
||||
|
||||
|
||||
<asp:GridView ID="GvPS" ShowHeader="false" runat="server" AutoGenerateColumns="False" DataKeyNames="CvePS,Cantidad,CveUM,UM,PU,Descuento,OtrosGastos,CvePresupuestoEgreso,PS,Clasificacion,CveClasificacion,CveOrdenCompraDetalle,IVA,IVAPorcentaje,RetIVAPorcentaje,RetISRPorcentaje,IEPSPSPorcentaje,Obs,Total,CveProyecto,CveSubProyecto,Proyecto,SubProyecto,Consec,CveTipoGasto,NoDeducible,DifPSSat,TipoAF" GridLines="none" BorderWidth="0" EmptyDataText="Sin Productos o Servicios agregados" CssClass="table GvPS table-striped table-hover table-advance Widthall ScrollAD mysmallbtn" >
|
||||
<asp:GridView ID="GvPS" ShowHeader="false" runat="server" AutoGenerateColumns="False" DataKeyNames="CvePS,Cantidad,CveUM,UM,PU,Descuento,OtrosGastos,CvePresupuestoEgreso,PS,Clasificacion,CveClasificacion,CveOrdenCompraDetalle,IVA,IVAPorcentaje,RetIVAPorcentaje,RetISRPorcentaje,IEPSPSPorcentaje,Obs,Total,CveProyecto,CveSubProyecto,Proyecto,SubProyecto,Consec,CveTipoGasto,NoDeducible,DifPSSat,TipoAF,CveCultivoCuadroDetalle" GridLines="none" BorderWidth="0" EmptyDataText="Sin Productos o Servicios agregados" CssClass="table GvPS table-striped table-hover table-advance Widthall ScrollAD mysmallbtn" >
|
||||
<Columns>
|
||||
<%-- 0 --%>
|
||||
<asp:TemplateField ItemStyle-Width="15px">
|
||||
@@ -773,7 +773,7 @@
|
||||
<span style="width: 145px; border-bottom: 1px solid gray;">
|
||||
<asp:Label ID="LblProyecto" runat="server" Text='<%# Eval("Proyecto", "{0}<br />") %>' Visible='<%# if(UsuarioActual.Empresa.Tipo_CentroCosto <> 1 And UsuarioActual.Empresa.Tipo_CentroCosto <> 2, True, False) %>'></asp:Label>
|
||||
</span>
|
||||
<asp:Label ID="LblSubProyecto" runat="server" Text='<%# Eval("SubProyecto") %>'></asp:Label>
|
||||
<asp:Label ID="LblSubProyecto" runat="server" Text='<%# If(Integer.TryParse(Eval("CveCultivoCuadroDetalle").ToString, Nothing), Eval("SubProyecto").ToString() & " <br /> " & Eval("TemporadaCuadro").ToString(), Eval("SubProyecto")) %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<%-- 6 --%>
|
||||
@@ -4389,10 +4389,10 @@
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="col-md-4">
|
||||
<div runat="server" id="DVCultivosCuadro" visible="false" class="form-group form-md-line-input input-iconright">
|
||||
|
||||
<asp:DropDownList ID="DdlCultivosCuadro" CssClass=" form-control input-sm select2me" runat="server" DataTextField="Cuadro" Style="width: 100%; max-width: 600px;"
|
||||
<asp:DropDownList ID="DdlCultivosCuadro" CssClass=" form-control input-sm select2me" runat="server" DataTextField="TemporadaCuadro" Style="width: 100%; max-width: 600px;"
|
||||
DataValueField="CveCultivoCuadroDetalle" ValidationGroup="GrpDetalleGuardar">
|
||||
</asp:DropDownList>
|
||||
<label runat="server" id="Label9" for="<%= DdlCultivosCuadro.ClientID.ToString()%>">Cultivo:</label>
|
||||
|
||||
@@ -1324,7 +1324,7 @@ Partial Class Compras_Compras
|
||||
If Request("CveCompra") IsNot Nothing AndAlso IsNumeric(Request("CveCompra")) AndAlso Request("CveCompra").ToEntero > 0 Then
|
||||
extrafiltro = ""
|
||||
End If
|
||||
DdlCultivosCuadro.DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa).FiltraParametros($"{extrafiltro} CveSubProyecto = {DdlSubProyecto.SelectedValue}")
|
||||
DdlCultivosCuadro.DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa).FiltraParametros($"{extrafiltro} CveSubProyecto = {DdlSubProyecto.SelectedValue}", "TemporadaCuadro")
|
||||
DdlCultivosCuadro.DataBind()
|
||||
DdlCultivosCuadro.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
|
||||
|
||||
@@ -10927,18 +10927,27 @@ Partial Class Compras_Compras
|
||||
If Version = "3.3" OrElse Version = "4.0" Then
|
||||
|
||||
For Each traslado As XmlNode In nodeTraslados
|
||||
If traslado.Attributes("Impuesto").Value = "002" Then TrasladoIVA += traslado.Attributes("Importe").Value.ToDecimal
|
||||
|
||||
If traslado.Attributes("Impuesto").Value = "003" Then TrasladoIEPS += traslado.Attributes("Importe").Value.ToDecimal
|
||||
If traslado.Attributes("Importe") IsNot Nothing Then
|
||||
If traslado.Attributes("Impuesto").Value = "002" Then TrasladoIVA += traslado.Attributes("Importe").Value.ToDecimal
|
||||
If traslado.Attributes("Impuesto").Value = "003" Then TrasladoIEPS += traslado.Attributes("Importe").Value.ToDecimal
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Next
|
||||
|
||||
Else
|
||||
|
||||
For Each traslado As XmlNode In nodeTraslados
|
||||
If traslado.Attributes("impuesto").Value = "IVA" Then TrasladoIVA += traslado.Attributes("importe").Value.ToDecimal
|
||||
|
||||
If traslado.Attributes("impuesto").Value = "IEPS" Then TrasladoIEPS += traslado.Attributes("importe").Value.ToDecimal
|
||||
|
||||
If traslado.Attributes("Importe") IsNot Nothing Then
|
||||
If traslado.Attributes("impuesto").Value = "IVA" Then TrasladoIVA += traslado.Attributes("importe").Value.ToDecimal
|
||||
|
||||
If traslado.Attributes("impuesto").Value = "IEPS" Then TrasladoIEPS += traslado.Attributes("importe").Value.ToDecimal
|
||||
End If
|
||||
|
||||
|
||||
Next
|
||||
End If
|
||||
@@ -11439,6 +11448,7 @@ Partial Class Compras_Compras
|
||||
|
||||
TmpDT.Columns.Add("CveContratoDetalle", GetType(Integer))
|
||||
TmpDT.Columns.Add("CveCultivoCuadroDetalle", GetType(Integer))
|
||||
TmpDT.Columns.Add("TemporadaCuadro", GetType(String))
|
||||
|
||||
TmpDTOriginal = New DataTable
|
||||
TmpDTOriginal.Columns.Add("Consec", GetType(Integer))
|
||||
@@ -11548,6 +11558,7 @@ Partial Class Compras_Compras
|
||||
TmpDTOriginal.Columns.Add("Importe", GetType(Double))
|
||||
TmpDTOriginal.Columns.Add("CveContratoDetalle", GetType(Double))
|
||||
TmpDTOriginal.Columns.Add("CveCultivoCuadroDetalle", GetType(Double))
|
||||
TmpDTOriginal.Columns.Add("TemporadaCuadro", GetType(String))
|
||||
|
||||
|
||||
End Sub
|
||||
@@ -17767,6 +17778,9 @@ Partial Class Compras_Compras
|
||||
'DdlProyecto.SelectedValueExist(GvRow.DataKey("CveProyecto"))
|
||||
|
||||
DdlSubProyecto.SelectedValueExist(GvRow.DataKey("CveSubProyecto"))
|
||||
|
||||
DdlSubProyecto_SelectedIndexChanged(Nothing, Nothing)
|
||||
|
||||
DdlTipoGasto.SelectedValueExist(GvRow.DataKey("CveTipoGasto"))
|
||||
|
||||
Dim PS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPS.SelectedValue.ToEntero).FiltroPrimero("")
|
||||
@@ -17817,6 +17831,7 @@ Partial Class Compras_Compras
|
||||
DVModalAddPSChkDesvincularAF.Visible = True
|
||||
End If
|
||||
|
||||
DdlCultivosCuadro.SelectedValueExist(GvRow.DataKey("CveCultivoCuadroDetalle"))
|
||||
|
||||
UpPSS.Update()
|
||||
RegistraScript("$('#divAddProducto').modal('show');")
|
||||
@@ -17903,7 +17918,7 @@ Partial Class Compras_Compras
|
||||
extrafiltro = ""
|
||||
End If
|
||||
DdlCultivosCuadro.Items.Clear()
|
||||
DdlCultivosCuadro.DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa).FiltraParametros($"{extrafiltro} CveSubProyecto = {DdlSubProyecto.SelectedValue}")
|
||||
DdlCultivosCuadro.DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa).FiltraParametros($"{extrafiltro} CveSubProyecto = {DdlSubProyecto.SelectedValue}", "TemporadaCuadro")
|
||||
DdlCultivosCuadro.DataBind()
|
||||
DdlCultivosCuadro.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
|
||||
|
||||
@@ -18194,7 +18209,8 @@ Partial Class Compras_Compras
|
||||
AddPS(TxtCantidad.Text.Trim.ToDecimal, ddlUM.SelectedValue.ToEntero, ddlUM.SelectedItem.Text, DdlClasificacion.SelectedValue.ToEntero, DdlClasificacion.SelectedItem.Text, DdlPS.SelectedValue.ToEntero, DdlPS.SelectedText, HdnTipoPS.Value.ToEntero,
|
||||
DdlSubProyecto.SelectedValue.ToString, DdlSubProyecto.SelectedItem.Text, DdlProyecto.SelectedItem.Text, DdlProyecto.SelectedValue.ToString, TxtObsPS.Text.Trim, TxtPrecio.Text.Trim.ToDecimal, Total, IVA,
|
||||
TxtRetIVAModal.Text.ToDecimal / 100, TxtRetISRModal.Text.ToDecimal / 100, TxtIEPSModal.Text.ToDecimal / 100, 0, TxtDescuentoModal.Text.ToDecimal, OtrosGastos:=TxtOtrosGastos.Text.ToDecimal, CveTipoGasto:=DdlTipoGasto.SelectedValue.ToEntero, TipoGasto:=DdlTipoGasto.SelectedItem.Text,
|
||||
NoDeducible:=ChkEsNoDeduciblePS.Checked, CveSATPS:=SATClavePS, CveContratoDetalle:=CveContratoDetalle)
|
||||
NoDeducible:=ChkEsNoDeduciblePS.Checked, CveSATPS:=SATClavePS, CveContratoDetalle:=CveContratoDetalle,
|
||||
CveCultivoCuadroDetalle:=If(DdlCultivosCuadro.SelectedValue.ToEntero > 0, DdlCultivosCuadro.SelectedValue.ToEntero, -1), TemporadaCuadro:=If(DdlCultivosCuadro.SelectedValue.ToEntero > 0, DdlCultivosCuadro.SelectedItem.Text, ""))
|
||||
|
||||
AddPS2()
|
||||
LimpiaAgregar()
|
||||
@@ -18266,7 +18282,8 @@ Partial Class Compras_Compras
|
||||
Obs As String, PU As Decimal, Total As Decimal, IVA As Decimal, RetIVA As Decimal, RetISR As Decimal, IEPSPS As Decimal, IEPSPSIVA As Decimal, Descuento As Decimal, Optional CveOrdenCompraDetalle As Integer = -1, Optional TCalculaTotales As Boolean = True,
|
||||
Optional PSCodigo As String = "-", Optional PSDescripcion As String = "-", Optional CantidadF As Double = -1, Optional EntregaDirecta As Integer = -1, Optional OtrosGastos As Decimal = 0,
|
||||
Optional CveSATPS As Integer = -1, Optional CargaXml As Boolean = False, Optional CveTipoGasto As Integer = -1, Optional TipoGasto As String = "", Optional PorcentajeIVA As Decimal = 0,
|
||||
Optional PorcentajeIEPS As Decimal = 0, Optional PorcentajeRetIVA As Decimal = 0, Optional PorcentajeRetISR As Decimal = 0, Optional NoDeducible As Boolean = False, Optional CveContratoDetalle As Integer = -1, Optional CveCultivoCuadroDetalle As Integer = -1, Optional CveSATPSActualizado As Boolean = False) As Integer
|
||||
Optional PorcentajeIEPS As Decimal = 0, Optional PorcentajeRetIVA As Decimal = 0, Optional PorcentajeRetISR As Decimal = 0, Optional NoDeducible As Boolean = False, Optional CveContratoDetalle As Integer = -1, Optional CveCultivoCuadroDetalle As Integer = -1,
|
||||
Optional CveSATPSActualizado As Boolean = False, Optional TemporadaCuadro As String = "") As Integer
|
||||
|
||||
Dim Row As DataRow = Nothing
|
||||
|
||||
@@ -18374,8 +18391,17 @@ Partial Class Compras_Compras
|
||||
|
||||
Row("PU") = Math.Round(PU, DecimalesPermitidos)
|
||||
If CargaXml And (Version = "3.3" Or Version = "4.0") Then
|
||||
Row("IVA") = Math.Round(IVA, DecimalesPermitidos)
|
||||
Row("IVAPorcentaje") = PorcentajeIVA
|
||||
|
||||
If CveFactura > 0 And TxtIVA.Text.ToDecimal = 0 Then
|
||||
Row("IVA") = 0
|
||||
Row("IVAPorcentaje") = 0
|
||||
Else
|
||||
Row("IVA") = Math.Round(IVA, DecimalesPermitidos)
|
||||
Row("IVAPorcentaje") = PorcentajeIVA
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Row("RetIVA") = Math.Round(RetIVA, DecimalesPermitidos)
|
||||
Row("RetIVAPorcentaje") = PorcentajeRetIVA
|
||||
Row("RetISR") = Math.Round(RetISR, DecimalesPermitidos)
|
||||
@@ -18384,8 +18410,16 @@ Partial Class Compras_Compras
|
||||
Row("IEPSPSPorcentaje") = PorcentajeIEPS
|
||||
Else
|
||||
'If DdlIVA.SelectedValue.ToDouble = 0 Then Row("IVA") = 0 Else Row("IVA") = Math.Round(IVA * Total, DecimalesPermitidos)
|
||||
Row("IVA") = (IVA * Total).RoundSQL
|
||||
Row("IVAPorcentaje") = IVA
|
||||
|
||||
If CveFactura > 0 And TxtIVA.Text.ToDecimal = 0 Then
|
||||
Row("IVA") = 0
|
||||
Row("IVAPorcentaje") = 0
|
||||
Else
|
||||
Row("IVA") = (IVA * Total).RoundSQL
|
||||
Row("IVAPorcentaje") = IVA
|
||||
End If
|
||||
|
||||
|
||||
Row("RetIVA") = (RetIVA * Total).RoundSQL
|
||||
Row("RetIVAPorcentaje") = RetIVA
|
||||
Row("RetISR") = (RetISR * Total).RoundSQL
|
||||
@@ -18408,6 +18442,7 @@ Partial Class Compras_Compras
|
||||
Row("CveContratoDetalle") = CveContratoDetalle
|
||||
|
||||
Row("CveCultivoCuadroDetalle") = CveCultivoCuadroDetalle
|
||||
Row("TemporadaCuadro") = TemporadaCuadro
|
||||
|
||||
If UsuarioActual.Empresa.UsaAC Then
|
||||
Row("CveProgramaOperativo") = DdlACGeneral1.SelectedValue.ToEntero
|
||||
@@ -18436,7 +18471,9 @@ Partial Class Compras_Compras
|
||||
Return Retorno
|
||||
End Function
|
||||
Private Sub AddPS2(Optional pCalculaTotales As Boolean = True, Optional EsNoDeducible As Boolean = False)
|
||||
|
||||
Dim view As DataView = New DataView(TmpDT)
|
||||
|
||||
view.Sort = "Consec"
|
||||
GvPS.DataSource = view
|
||||
'GvPS.DataSource = TmpDT
|
||||
@@ -18549,8 +18586,15 @@ Partial Class Compras_Compras
|
||||
|
||||
'I f Not (CveCompra > 0 Or CveFactura > 0 Or OCVinculada) Then
|
||||
'If DdlIVA.SelectedValue.ToDouble = 0 Then DrPS("IVA") = 0 Else DrPS("IVA") = IVA * Total
|
||||
DrPS("IVA") = (IVA * Total).RoundSQL
|
||||
DrPS("IVAPorcentaje") = IVA
|
||||
|
||||
If CveFactura > 0 And TxtIVA.Text.ToDecimal = 0 Then
|
||||
DrPS("IVA") = 0
|
||||
DrPS("IVAPorcentaje") = 0
|
||||
Else
|
||||
DrPS("IVA") = (IVA * Total).RoundSQL
|
||||
DrPS("IVAPorcentaje") = IVA
|
||||
End If
|
||||
|
||||
DrPS("RetIVA") = (RetIVA * Total).RoundSQL
|
||||
DrPS("RetIVAPorcentaje") = RetIVA
|
||||
DrPS("RetISR") = RetISR * Total
|
||||
@@ -18560,6 +18604,12 @@ Partial Class Compras_Compras
|
||||
DrPS("IEPSPSIVA") = (IEPSPSIVA * Total).RoundSQL
|
||||
DrPS("IEPSPSIVAPorcentaje") = IEPSPSIVA
|
||||
|
||||
DrPS("CveCultivoCuadroDetalle") = If(DdlCultivosCuadro.SelectedValue.ToEntero > 0, DdlCultivosCuadro.SelectedValue.ToEntero, -1)
|
||||
DrPS("TemporadaCuadro") = If(DdlCultivosCuadro.SelectedValue.ToEntero > 0, DdlCultivosCuadro.SelectedItem.Text, "")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
'Esta parte es para validar cuando la factura tenga ieps en o se asignara el ieps como una partida ya no se considere
|
||||
If (CveFactura > 0 Or CveCompra > 0) And TxtIEPS.Text.ToDecimal = 0 Then
|
||||
|
||||
@@ -138,6 +138,8 @@ Partial Class Compras_RepComprasAF
|
||||
LblSubProyecto.Text = "Sucursal"
|
||||
End If
|
||||
|
||||
CargaPS(-1)
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub DdlTipoActivoFijo_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTipoActivoFijo.SelectedIndexChanged
|
||||
@@ -209,18 +211,15 @@ Partial Class Compras_RepComprasAF
|
||||
FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim(), "-1")
|
||||
FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim(), "-1")
|
||||
Dim PS As String = DdlPS.txtText.Value
|
||||
Dim CvePS As String = DdlPS.txtValue.Value
|
||||
If CvePS = "" Or CvePS = "0" Then
|
||||
CvePS = "-1"
|
||||
End If
|
||||
Dim CvePS As Integer = DdlPS.txtValue.Value.ToEntero
|
||||
|
||||
|
||||
If e.Row.DBCampo("Orden") = "1" Then
|
||||
Dim Liga As String = $"/Compras/RepComprasAFDetalle.aspx?GPO={DdlGrupo.SelectedValue}&Anio={e.Row.DBCampo("Anio")}&Mes={e.Row.DBCampo("Mes")}&AnioMes={ e.Row.DBCampo("AnioMes")}&Fecha={e.Row.DBCampo("Fecha")}&CveProveedor={ e.Row.DBCampo("CveProveedor")}&CveActivoFijo={e.Row.DBCampo("CveActivoFijo")}&CveTipoActivoFijo={e.Row.DBCampo("CveTipoActivoFijo")}&CveSubTipoActivoFijo={e.Row.DBCampo("CveSubTipoActivoFijo")}&CveProyecto={ DdlProyecto.SelectedValue}&CveSubProyecto={DdlSubProyecto.SelectedValue}&CvePS={CvePS}&CveClasificacion={e.Row.DBCampo("CveClasificacion")}&CveMoneda={ e.Row.DBCampo("CveMoneda")}&FechaI={FechaI}&FechaF={FechaF}&PS={PS}&CveClasificacion2={e.Row.DBCampo("CveClasificacion2")}"
|
||||
Dim Liga As String = $"/Compras/RepComprasAFDetalle.aspx?GPO={DdlGrupo.SelectedValue}&Anio={e.Row.DBCampo("Anio")}&Mes={e.Row.DBCampo("Mes")}&AnioMes={ e.Row.DBCampo("AnioMes")}&Fecha={e.Row.DBCampo("Fecha")}&CveProveedor={ e.Row.DBCampo("CveProveedor")}&CveActivoFijo={e.Row.DBCampo("CveActivoFijo")}&CveTipoActivoFijo={e.Row.DBCampo("CveTipoActivoFijo")}&CveSubTipoActivoFijo={e.Row.DBCampo("CveSubTipoActivoFijo")}&CveProyecto={ DdlProyecto.SelectedValue}&CveSubProyecto={DdlSubProyecto.SelectedValue}&CvePS={ If(CvePS > 0, CvePS.ToString, e.Row.DBCampo("CvePS").ToString) }&CveClasificacion={e.Row.DBCampo("CveClasificacion")}&CveMoneda={ e.Row.DBCampo("CveMoneda")}&FechaI={FechaI}&FechaF={FechaF}&PS={PS}&CveClasificacion2={e.Row.DBCampo("CveClasificacion2")}"
|
||||
e.Row.Cells(0).Text = String.Format("<a class='{0}' target='_blank' href='{1}'>{2}</a>", "Texto", Liga, e.Row.DataKey("GPO").ToString)
|
||||
Else
|
||||
e.Row.BackColor = Drawing.Color.LightGray
|
||||
Dim Liga As String = $"/Compras/RepComprasAFDetalle.aspx?GPO=-1&Anio={e.Row.DBCampo("Anio")}&Mes={e.Row.DBCampo("Mes")}&AnioMes={ e.Row.DBCampo("AnioMes")}&Fecha={e.Row.DBCampo("Fecha")}&CveProveedor={ e.Row.DBCampo("CveProveedor")}&CveActivoFijo={e.Row.DBCampo("CveActivoFijo")}&CveTipoActivoFijo={e.Row.DBCampo("CveTipoActivoFijo")}&CveSubTipoActivoFijo={e.Row.DBCampo("CveSubTipoActivoFijo")}&CveProyecto={ DdlProyecto.SelectedValue}&CveSubProyecto={DdlSubProyecto.SelectedValue}&CvePS={CvePS}&CveClasificacion={e.Row.DBCampo("CveClasificacion")}&CveMoneda={ e.Row.DBCampo("CveMoneda")}&FechaI={FechaI}&FechaF={FechaF}&PS={PS}&CveClasificacion2={e.Row.DBCampo("CveClasificacion2")}"
|
||||
Dim Liga As String = $"/Compras/RepComprasAFDetalle.aspx?GPO=-1&Anio={e.Row.DBCampo("Anio")}&Mes={e.Row.DBCampo("Mes")}&AnioMes={ e.Row.DBCampo("AnioMes")}&Fecha={e.Row.DBCampo("Fecha")}&CveProveedor={ e.Row.DBCampo("CveProveedor")}&CveActivoFijo={e.Row.DBCampo("CveActivoFijo")}&CveTipoActivoFijo={e.Row.DBCampo("CveTipoActivoFijo")}&CveSubTipoActivoFijo={e.Row.DBCampo("CveSubTipoActivoFijo")}&CveProyecto={ DdlProyecto.SelectedValue}&CveSubProyecto={DdlSubProyecto.SelectedValue}&CvePS={ If(CvePS > 0, CvePS.ToString, e.Row.DBCampo("CvePS").ToString)}&CveClasificacion={e.Row.DBCampo("CveClasificacion")}&CveMoneda={ e.Row.DBCampo("CveMoneda")}&FechaI={FechaI}&FechaF={FechaF}&PS={PS}&CveClasificacion2={e.Row.DBCampo("CveClasificacion2")}"
|
||||
|
||||
e.Row.Cells(0).Text = String.Format("<a style='font-weight:bold' class='{0}' target='_blank' href='{1}'>{2}</a>", "Texto", Liga, e.Row.DataKey("Moneda").ToString)
|
||||
|
||||
@@ -476,7 +475,12 @@ Partial Class Compras_RepComprasAF
|
||||
|
||||
If Not UsuarioActual.Empresa.Funcionalidad(105).ToString = "1" Then
|
||||
DdlPS.ddl.Items.Clear()
|
||||
DdlPS.ddl.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacion, Estatus:=1)
|
||||
|
||||
If CveClasificacion > 0 Then
|
||||
DdlPS.ddl.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacion, Estatus:=1)
|
||||
End If
|
||||
|
||||
|
||||
DdlPS.ddl.DataBind()
|
||||
DdlPS.ddl.Items.Insert(0, New ListItem("*** Actualizar listado de Productos o Servicios ***", "-2"))
|
||||
DdlPS.ddl.Items.Insert(0, New ListItem("Seleccione el Producto", "-1"))
|
||||
|
||||
@@ -662,7 +662,7 @@
|
||||
</TablixCell>
|
||||
<TablixCell>
|
||||
<CellContents>
|
||||
<Textbox Name="Codigo1">
|
||||
<Textbox Name="SATClaveProdServ">
|
||||
<CanGrow>true</CanGrow>
|
||||
<KeepTogether>true</KeepTogether>
|
||||
<Paragraphs>
|
||||
@@ -674,13 +674,19 @@
|
||||
<FontSize>7pt</FontSize>
|
||||
</Style>
|
||||
</TextRun>
|
||||
<TextRun>
|
||||
<Value xml:space="preserve"> </Value>
|
||||
<Style>
|
||||
<FontSize>7pt</FontSize>
|
||||
</Style>
|
||||
</TextRun>
|
||||
</TextRuns>
|
||||
<Style>
|
||||
<TextAlign>Left</TextAlign>
|
||||
</Style>
|
||||
</Paragraph>
|
||||
</Paragraphs>
|
||||
<rd:DefaultName>Codigo1</rd:DefaultName>
|
||||
<rd:DefaultName>SATClaveProdServ</rd:DefaultName>
|
||||
<Style>
|
||||
<Border>
|
||||
<Color>LightGrey</Color>
|
||||
@@ -736,7 +742,7 @@
|
||||
</TablixCell>
|
||||
<TablixCell>
|
||||
<CellContents>
|
||||
<Textbox Name="SATClaveProdServ">
|
||||
<Textbox Name="Codigo">
|
||||
<CanGrow>true</CanGrow>
|
||||
<KeepTogether>true</KeepTogether>
|
||||
<Paragraphs>
|
||||
@@ -754,7 +760,7 @@
|
||||
</Style>
|
||||
</Paragraph>
|
||||
</Paragraphs>
|
||||
<rd:DefaultName>SATClaveProdServ</rd:DefaultName>
|
||||
<rd:DefaultName>Codigo</rd:DefaultName>
|
||||
<Style>
|
||||
<Border>
|
||||
<Color>LightGrey</Color>
|
||||
@@ -3269,18 +3275,6 @@
|
||||
<Parameter Name="NumTotalMercancias">
|
||||
<Value>=Parameters!SRP_NumTotalMercancias.Value</Value>
|
||||
</Parameter>
|
||||
<Parameter Name="PermisoSCTRemolque1">
|
||||
<Value>=Parameters!SRP_PermisoSCTRemolque1.Value</Value>
|
||||
</Parameter>
|
||||
<Parameter Name="PermisoSCTRemolque2">
|
||||
<Value>=Parameters!SRP_PermisoSCTRemolque2.Value</Value>
|
||||
</Parameter>
|
||||
<Parameter Name="ConfATR1">
|
||||
<Value>=Parameters!SRP_ConfATR1.Value</Value>
|
||||
</Parameter>
|
||||
<Parameter Name="ConfATR2">
|
||||
<Value>=Parameters!SRP_ConfATR2.Value</Value>
|
||||
</Parameter>
|
||||
</Parameters>
|
||||
<Top>0.06863cm</Top>
|
||||
<Height>1.11461cm</Height>
|
||||
@@ -4674,30 +4668,6 @@
|
||||
<AllowBlank>true</AllowBlank>
|
||||
<Prompt>ReportParameter1</Prompt>
|
||||
</ReportParameter>
|
||||
<ReportParameter Name="SRP_PermisoSCTRemolque1">
|
||||
<DataType>String</DataType>
|
||||
<Nullable>true</Nullable>
|
||||
<AllowBlank>true</AllowBlank>
|
||||
<Prompt>ReportParameter1</Prompt>
|
||||
</ReportParameter>
|
||||
<ReportParameter Name="SRP_PermisoSCTRemolque2">
|
||||
<DataType>String</DataType>
|
||||
<Nullable>true</Nullable>
|
||||
<AllowBlank>true</AllowBlank>
|
||||
<Prompt>ReportParameter1</Prompt>
|
||||
</ReportParameter>
|
||||
<ReportParameter Name="SRP_ConfATR1">
|
||||
<DataType>String</DataType>
|
||||
<Nullable>true</Nullable>
|
||||
<AllowBlank>true</AllowBlank>
|
||||
<Prompt>ReportParameter1</Prompt>
|
||||
</ReportParameter>
|
||||
<ReportParameter Name="SRP_ConfATR2">
|
||||
<DataType>String</DataType>
|
||||
<Nullable>true</Nullable>
|
||||
<AllowBlank>true</AllowBlank>
|
||||
<Prompt>ReportParameter1</Prompt>
|
||||
</ReportParameter>
|
||||
</ReportParameters>
|
||||
<EmbeddedImages>
|
||||
<EmbeddedImage Name="Logo">
|
||||
|
||||
@@ -362,7 +362,7 @@ Partial Class Inventarios_CartaPorteManual
|
||||
|
||||
DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CveProducto).FiltroPrimero("") ' Estado = -1
|
||||
|
||||
If DrPS IsNot Nothing AndAlso ValidaPSSAT(DrPS) Then
|
||||
If DrPS IsNot Nothing AndAlso ValidaPSSAT(DrPS, TxtPesoKg.Text.ToDecimal) Then
|
||||
|
||||
'codigo temporal
|
||||
Dim tLote As String
|
||||
@@ -1553,11 +1553,11 @@ Partial Class Inventarios_CartaPorteManual
|
||||
|
||||
|
||||
|
||||
Function ValidaPSSAT(DrPS As DataRow) As Boolean
|
||||
Function ValidaPSSAT(DrPS As DataRow, PesoKg As Decimal) As Boolean
|
||||
Dim Respuesta As Boolean = False
|
||||
|
||||
Dim CveSATPS As Integer = DrPS("CveSATPS").ToString.ToEntero
|
||||
Dim PesoKg As Decimal = DrPS("PesoKg").ToString.ToDecimal
|
||||
'Dim PesoKg As Decimal = DrPS("PesoKg").ToString.ToDecimal
|
||||
Dim SATClaveUnidadMedida As String = DrPS("SATClaveUnidadMedida").ToString.Trim
|
||||
|
||||
If CveSATPS > 0 And PesoKg > 0 And SATClaveUnidadMedida.Length > 0 Then
|
||||
|
||||
@@ -1266,7 +1266,7 @@ Partial Class Inventarios_EntradasSalidas
|
||||
Dim TieneError = False
|
||||
|
||||
Dim ObjConta As ClsContPAQi = Nothing
|
||||
If UsuarioActual.Empresa.UsaContabilidad Or UsuarioActual.Empresa.UsaAC Then
|
||||
If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso (UsuarioActual.Empresa.UsaContabilidad Or UsuarioActual.Empresa.UsaAC) Then
|
||||
ObjConta = New ClsContPAQi(UsuarioActual.Empresa)
|
||||
ObjConta.IniciaTransacSQL()
|
||||
End If
|
||||
@@ -1803,7 +1803,7 @@ Partial Class Inventarios_EntradasSalidas
|
||||
Case 30
|
||||
CveConceptoContable = 181
|
||||
TipoMovtoOtro = False
|
||||
tCveSubProyecto = DdlSubProyecto.SelectedValue.ToEntero
|
||||
If DdlSubProyecto.Visible = True AndAlso DdlSubProyecto.SelectedValue.ToEntero > 0 Then tCveSubProyecto = DdlSubProyecto.SelectedValue.ToEntero
|
||||
If UsuarioActual.Empresa.Funcionalidad(342).ToEntero > 0 Then
|
||||
IdCtaContableOtro = UsuarioActual.Empresa.Funcionalidad(342).ToEntero
|
||||
End If
|
||||
@@ -3350,9 +3350,8 @@ Partial Class Inventarios_EntradasSalidas
|
||||
DdlAlmacen.DataBind()
|
||||
Dim dttA As DataTable = Nothing
|
||||
dttA = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 14)
|
||||
If UsuarioActual.CveEmpresa = 119 Then
|
||||
dttA.Merge(GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1))
|
||||
End If
|
||||
dttA.Merge(GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1))
|
||||
|
||||
DdlAlmacen.DataSource = dttA 'GlobalDTAlmacen(UsuarioActual.CveEmpresa)
|
||||
DdlAlmacen.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
' DdlAlmacen.SelectedValue = "-1"
|
||||
@@ -4469,6 +4468,15 @@ Partial Class Inventarios_EntradasSalidas
|
||||
End If
|
||||
End If
|
||||
|
||||
Dim RetornoVirtual As MMovimientoVirtual = Nothing
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
RetornoVirtual = GenerarMovimientoVirtual(CveMovimiento, ObjInventario)
|
||||
End If
|
||||
|
||||
If RetornoVirtual IsNot Nothing Then
|
||||
ErrorMovInv = RetornoVirtual.TieneError
|
||||
End If
|
||||
|
||||
If Not ErrorMovInv Then
|
||||
ObjInventario.Commit() ' aplica los movimientos insertados
|
||||
|
||||
|
||||
@@ -577,8 +577,9 @@
|
||||
<asp:HyperLink ID="HypXml" ToolTip="Formato xml" Visible="false" CssClass="btn btn-circle btn- btn-xs blue mysmallbtn" NavigateUrl="#" runat="server"><i class="fa fa-file-o"></i></asp:HyperLink>
|
||||
<asp:HyperLink ID="HypPDF" ToolTip="Formato Timbre" CssClass="btn btn-circle btn-sm btn-xs red mysmallbtn" Visible="false" NavigateUrl="#" runat="server"><i class="fa fa-file-pdf-o"></i></asp:HyperLink>
|
||||
<asp:LinkButton runat="server" ID="LnkTimbrar" CssClass="btn btn-circle btn-sm btn-xs blue mysmallbtn" Text="<i class='fa fa-bell'></i>" OnClick="LnkTimbrar_Click" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea Timbrar?" data-btn-ok-label="si" />
|
||||
<asp:LinkButton runat="server" ID="Imgdesautorizar" CssClass="btn btn-circle btn-sm btn-xs yellow-gold mysmallbtn" Text="<i class='fa fa-ban'></i>" OnClick="Imgdesautorizar_Click" CommandArgument='<%# Eval("CveNomina") %>' Visible='<%# (Eval("CveNomina").ToString() != "" && Eval("SeTimbro").ToString() == "False"? true :false)%>' data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar la autorizacion?" data-btn-ok-label="si" />
|
||||
<asp:LinkButton runat="server" ID="ImgDelete" CssClass="btn btn-circle btn-sm btn-xs red mysmallbtn" Text="<i class='icon-trash'></i>" OnClick="ImgDelete_Click" CommandArgument='<%# Eval("CveNomina") %>' Visible='<%# (Eval("CveNomina").ToString() != "" && Eval("SeTimbro").ToString() == "False"? true :false)%>' data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar la nómina?" data-btn-ok-label="si" />
|
||||
<asp:LinkButton runat="server" ID="LnkCancelar" CssClass="btn btn-circle btn-sm btn-xs red mysmallbtn" Text="<i class='fa fa-ban'></i>" OnClick="LnkCancelar_Click" CommandArgument='<%# Eval("CveNomina") %>' Visible='<%# (Eval("CveNomina").ToString() != "" && PermisoCancelarEmitido && Eval("SeTimbro").ToString() == "True"? true :false)%>' data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea cancelar la nómina?" data-btn-ok-label="si" />
|
||||
<asp:LinkButton runat="server" ID="LnkCancelar" CssClass="btn btn-circle btn-sm btn-xs yellow-gold mysmallbtn" Text="<i class='fa fa-ban'></i>" OnClick="LnkCancelar_Click" CommandArgument='<%# Eval("CveNomina") %>' Visible='<%# (Eval("CveNomina").ToString() != "" && PermisoCancelarEmitido && Eval("SeTimbro").ToString() == "True"? true :false)%>' data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea cancelar la nómina?" data-btn-ok-label="si" />
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
@@ -871,6 +872,9 @@
|
||||
</div>
|
||||
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
<asp:LinkButton ID="LnkMostrarocultarConceptos" CssClass="btn yellow-gold" OnClick="LnkMostrarocultarConceptos_Click" runat="server">Mostrar/ocultar</asp:LinkButton>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<a onclick="$('#C_BtnImprimirsobrerecibo').click()" class="btn yellow-gold">Imprimir</a>
|
||||
</div>
|
||||
@@ -939,7 +943,7 @@
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Importe">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LtlImporteD" runat="server" Text='<%# Eval("ImporteD", "${0:N}") %>' Style="word-break: break-all; display: inline-block;"></asp:Label>
|
||||
<asp:Label ID="LtlImporteD" runat="server" Text='<%# string.Format("{0}{1}",(Eval("CveSistemaD").ToString()=="20"? "-" :""),Eval("ImporteD", "${0:N}")) %>' Style="word-break: break-all; display: inline-block;"></asp:Label>
|
||||
<asp:LinkButton ID="LnkImporteD" OnClick="LnkConcepto_Click" runat="server"></asp:LinkButton>
|
||||
<div style="display: inline-block; width: 29px;">
|
||||
<asp:LinkButton ID="LnkImporteDxCalculo" OnClick="LnkImportexCalculo_Click" runat="server" CssClass="btn btn-circle btn-sm btn-xs btn-xs red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar el importe fijo?" data-btn-ok-label="si"></asp:LinkButton>
|
||||
|
||||
@@ -1339,6 +1339,32 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
}
|
||||
}
|
||||
|
||||
protected void Imgdesautorizar_Click(object sender, EventArgs e)
|
||||
{
|
||||
int Cve = ((LinkButton)sender).CommandArgument.ToEntero();
|
||||
//LinkButton lnk = (LinkButton)sender;
|
||||
//GridViewRow gvRow = (GridViewRow)lnk.NamingContainer;
|
||||
//int CvePeriodo = gvRow.DataKey("CvePeriodo").ToEntero();
|
||||
//int CvePersonal = gvRow.DataKey("CvePersonal").ToEntero();
|
||||
bool continuar = true;
|
||||
|
||||
using (ClsNominas Nom = new ClsNominas())
|
||||
{
|
||||
Nom.IniciaTransacSQL();
|
||||
//AutorizaNom_Nominas
|
||||
if (continuar && (continuar = Nom.RemoveNom_Nominas(Cve,false, UsuarioActual.CveUsuario)))
|
||||
{
|
||||
|
||||
Nom.Commit();
|
||||
}
|
||||
}
|
||||
if (continuar)
|
||||
{
|
||||
Alert("La nomina a sido desautorizada", TipoMensaje.MsgInformacion);
|
||||
cargaDatos();
|
||||
|
||||
}
|
||||
}
|
||||
protected void ImgDelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
int Cve = ((LinkButton)sender).CommandArgument.ToEntero();
|
||||
@@ -1352,7 +1378,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
{
|
||||
Nom.IniciaTransacSQL();
|
||||
//AutorizaNom_Nominas
|
||||
if (continuar && (continuar = Nom.RemoveNom_Nominas(Cve)))
|
||||
if (continuar && (continuar = Nom.RemoveNom_Nominas(Cve,true,UsuarioActual.CveUsuario )))
|
||||
{
|
||||
|
||||
Nom.Commit();
|
||||
@@ -2005,7 +2031,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
cargaDatos();
|
||||
cargaBitacora();
|
||||
|
||||
cargasobrericiboconceptos();
|
||||
cargasobrericiboconceptos(SRMostrarFormulas);
|
||||
UpModalConceptos.Update();
|
||||
}
|
||||
protected void cargaasistenciaSR(string orden = "")
|
||||
@@ -2705,7 +2731,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
{
|
||||
cargaDatos();
|
||||
|
||||
cargasobrericiboconceptos();
|
||||
cargasobrericiboconceptos(SRMostrarFormulas);
|
||||
UpModalConceptos.Update();
|
||||
|
||||
RegistraScript("$('#ModalUpConcepto').modal('hide');");
|
||||
@@ -2952,7 +2978,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
cargaDatos();
|
||||
cargaBitacora();
|
||||
|
||||
cargasobrericiboconceptos();
|
||||
cargasobrericiboconceptos(SRMostrarFormulas);
|
||||
UpModalConceptos.Update();
|
||||
|
||||
RegistraScript("$('#ModalUpConcepto').modal('hide');");
|
||||
@@ -3048,7 +3074,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
LblSRSbc.Text = SalarioDiarioIMSS;
|
||||
|
||||
#endregion
|
||||
cargasobrericiboconceptos();
|
||||
cargasobrericiboconceptos(true);
|
||||
CargaFonacot();
|
||||
#region "Infonavit"
|
||||
{
|
||||
@@ -3225,12 +3251,26 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
|
||||
#endregion
|
||||
|
||||
public void cargasobrericiboconceptos()
|
||||
protected void LnkMostrarocultarConceptos_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
cargasobrericiboconceptos(!SRMostrarFormulas);
|
||||
}
|
||||
protected bool SRMostrarFormulas
|
||||
{
|
||||
get
|
||||
{
|
||||
DataTable dtper = dtConceptos.FiltraParametros("Tipo IN ('P') AND EsPadre = 1 ");
|
||||
DataTable dtded = dtConceptos.FiltraParametros("Tipo IN ('D') AND EsPadre = 1 AND CveSistema NOT IN(101)");
|
||||
if (ViewState["SRMostrarFormulas"] == null) { return false; }
|
||||
else { return (bool)ViewState["SRMostrarFormulas"]; }
|
||||
}
|
||||
|
||||
set { ViewState["SRMostrarFormulas"] = value; }
|
||||
}
|
||||
public void cargasobrericiboconceptos(Boolean MostrarFormulas )
|
||||
{
|
||||
SRMostrarFormulas = MostrarFormulas;
|
||||
{
|
||||
DataTable dtper = dtConceptos.FiltraParametros(string.Format("Tipo IN ('P') AND EsPadre = 1 {0}",(MostrarFormulas?"": " AND SoloVisible=0")));
|
||||
DataTable dtded = dtConceptos.FiltraParametros(string.Format("Tipo IN ('D') AND EsPadre = 1 AND CveSistema NOT IN(101) {0}", (MostrarFormulas ? "" : " AND SoloVisible=0")));
|
||||
dtper.Columns.Add("BorradoLogico", typeof(int));
|
||||
dtded.Columns.Add("BorradoLogico", typeof(int));
|
||||
|
||||
@@ -3391,6 +3431,9 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
nConcepto.ConceptoP = Concepto;
|
||||
nConcepto.NoConceptoP = Codigo;
|
||||
nConcepto.ImporteP = Importe;
|
||||
nConcepto.isOnlyBisibleP = row["SoloVisible"].ToString().ToEntero();
|
||||
nConcepto.CveSistemaP = row["CveSistema"].ToString().ToEntero();
|
||||
|
||||
nConcepto.ValorP = dtempleados.SUM(string.Format("[VAL_{0}]", CveConcepto), string.Format("CvePersonal = {0}", SRCvePersonal));
|
||||
}
|
||||
if (maxded > i)
|
||||
@@ -3405,6 +3448,8 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
nConcepto.ConceptoD = Concepto;
|
||||
nConcepto.NoConceptoD = Codigo;
|
||||
nConcepto.ImporteD = Importe;
|
||||
nConcepto.CveSistemaD = row["CveSistema"].ToString().ToEntero();
|
||||
nConcepto.isOnlyBisibleD = row["SoloVisible"].ToString().ToEntero();
|
||||
nConcepto.ValorD = dtempleados.SUM(string.Format("[VAL_{0}]", CveConcepto), string.Format("CvePersonal = {0}", SRCvePersonal));
|
||||
}
|
||||
lconc.Add(nConcepto);
|
||||
@@ -3452,6 +3497,8 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
dtCon.Columns.Add(new DataColumn("EstatusD", typeof(int)));
|
||||
dtCon.Columns.Add(new DataColumn("isEditedD", typeof(int)));
|
||||
dtCon.Columns.Add(new DataColumn("isOnlyBisibleD", typeof(int)));
|
||||
dtCon.Columns.Add(new DataColumn("CveSistemaD", typeof(int)));
|
||||
dtCon.Columns.Add(new DataColumn("CveSistemaP", typeof(int)));
|
||||
foreach (NConcepto itc in lconc)
|
||||
{
|
||||
DataRow dr = dtCon.NewRow();
|
||||
@@ -3473,6 +3520,8 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
dr["EstatusD"] = itc.EstatusD;
|
||||
dr["isEditedD"] = itc.isEditedD;
|
||||
dr["isOnlyBisibleD"] = itc.isOnlyBisibleD;
|
||||
dr["CveSistemaD"] = itc.CveSistemaD;
|
||||
dr["CveSistemaP"] = itc.CveSistemaP;
|
||||
dtCon.Rows.Add(dr);
|
||||
}
|
||||
dtCon.AcceptChanges();
|
||||
@@ -3555,7 +3604,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
urlfile = System.IO.Path.Combine(ModExtensiones.DirectorioBaseEmpresas, "Empresas/Grales/Formatos/SobreRecibo.rdlc");
|
||||
}
|
||||
|
||||
ImprimirPDF(urlfile, lrds, parametros, "SobreRecibo", "PDF", null, Content_Disposition: "Inline");
|
||||
ImprimirPDF(urlfile, lrds, parametros, "SobreRecibo", "PDF", null);
|
||||
}
|
||||
protected void BtnGuardarInfornavit_Click(object sender, EventArgs e)
|
||||
{
|
||||
@@ -3598,6 +3647,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
public int isSavedP { get; set; }
|
||||
public int isEditedP { get; set; }
|
||||
public int isOnlyBisibleP { get; set; }
|
||||
public int CveSistemaP { get; set; }
|
||||
|
||||
|
||||
public string NoConceptoD { get; set; }
|
||||
@@ -3610,7 +3660,8 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
public int isSavedD { get; set; }
|
||||
public int isEditedD { get; set; }
|
||||
public int isOnlyBisibleD { get; set; }
|
||||
|
||||
public int CveSistemaD { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -3624,6 +3675,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
public int EstatusO { get; set; }
|
||||
public int isEditedO { get; set; }
|
||||
public int isOnlyBisibleO { get; set; }
|
||||
public int CveSistemaO { get; set; }
|
||||
}
|
||||
|
||||
int CveConceptoPolgvc, CveConceptoDolgvc;
|
||||
@@ -5918,7 +5970,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
//AutorizaNom_Nominas
|
||||
foreach (DataRow drow in dtr.Rows)
|
||||
{
|
||||
if (continuar && (continuar = Nom.RemoveNom_Nominas(drow["CveNomina"].ToString().ToEntero())))
|
||||
if (continuar && (continuar = Nom.RemoveNom_Nominas(drow["CveNomina"].ToString().ToEntero(),false,UsuarioActual.CveUsuario)))
|
||||
{
|
||||
|
||||
}
|
||||
@@ -6530,6 +6582,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
nConcepto.ConceptoP = Concepto;
|
||||
nConcepto.NoConceptoP = Codigo;
|
||||
nConcepto.ImporteP = Importe;
|
||||
nConcepto.CveSistemaP = row["CveSistema"].ToString().ToEntero();
|
||||
nConcepto.ValorP = dtempleadosSimula.SUM(string.Format("[VAL_{0}]", CveConcepto), string.Format("CvePersonal = {0}", SRCvePersonal));
|
||||
}
|
||||
if (maxded > i)
|
||||
@@ -6544,6 +6597,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
nConcepto.ConceptoD = Concepto;
|
||||
nConcepto.NoConceptoD = Codigo;
|
||||
nConcepto.ImporteD = Importe;
|
||||
nConcepto.CveSistemaD = row["CveSistema"].ToString().ToEntero();
|
||||
nConcepto.ValorD = dtempleadosSimula.SUM(string.Format("[VAL_{0}]", CveConcepto), string.Format("CvePersonal = {0}", SRCvePersonal));
|
||||
}
|
||||
lconc.Add(nConcepto);
|
||||
@@ -6591,6 +6645,8 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
dtCon.Columns.Add(new DataColumn("EstatusD", typeof(int)));
|
||||
dtCon.Columns.Add(new DataColumn("isEditedD", typeof(int)));
|
||||
dtCon.Columns.Add(new DataColumn("isOnlyBisibleD", typeof(int)));
|
||||
dtCon.Columns.Add(new DataColumn("CveSistemaD", typeof(int)));
|
||||
dtCon.Columns.Add(new DataColumn("CveSistemaP", typeof(int)));
|
||||
foreach (NConcepto itc in lconc)
|
||||
{
|
||||
DataRow dr = dtCon.NewRow();
|
||||
@@ -6612,6 +6668,8 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
dr["EstatusD"] = itc.EstatusD;
|
||||
dr["isEditedD"] = itc.isEditedD;
|
||||
dr["isOnlyBisibleD"] = itc.isOnlyBisibleD;
|
||||
dr["CveSistemaD"] = itc.CveSistemaD;
|
||||
dr["CveSistemaP"] = itc.CveSistemaP;
|
||||
dtCon.Rows.Add(dr);
|
||||
}
|
||||
dtCon.AcceptChanges();
|
||||
@@ -6686,7 +6744,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
urlfile = System.IO.Path.Combine(ModExtensiones.DirectorioBaseEmpresas, "Empresas/Grales/Formatos/SobreRecibo.rdlc");
|
||||
}
|
||||
|
||||
ImprimirPDF(urlfile, lrds, parametros, "SobreRecibo", "PDF", null, Content_Disposition: "Inline");
|
||||
ImprimirPDF(urlfile, lrds, parametros, "SobreRecibo", "PDF", null);
|
||||
}
|
||||
protected void DdlTipoPeriodoSim_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
@@ -8589,4 +8647,5 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1260,8 +1260,9 @@ Partial Class ProductosyServicios
|
||||
If DdlSATPS.txtValue.Value.ToEntero > 0 Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(161) = "1" Then ' si tiene activada la carta porte
|
||||
|
||||
ValidaMaterialPeligroso(DdlSATPS.txtValue.Value.ToEntero)
|
||||
|
||||
If Not ValidaMaterialPeligrosoMensaje Then
|
||||
ValidaMaterialPeligroso(DdlSATPS.txtValue.Value.ToEntero)
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
@@ -3148,7 +3149,9 @@ Partial Class ProductosyServicios
|
||||
|
||||
ObjGrales.Dispose()
|
||||
|
||||
|
||||
If ValidaMaterialPeligrosoMensaje Then
|
||||
BtnGuardar_Click(Nothing, Nothing)
|
||||
End If
|
||||
|
||||
'Return Respuesta
|
||||
|
||||
|
||||
@@ -907,7 +907,7 @@ Partial Class RepVentaDetalle
|
||||
TipoDocto = "Dev"
|
||||
End Select
|
||||
|
||||
pathPDF = Server.MapPath(String.Format("~/Empresas/{0}/PDF/{1}/{2}.pdf", UsuarioActual.CveEmpresa, TipoDocto, gvr.DataKey("SerieFolio").ToString))
|
||||
pathPDF = String.Format("{0}/PDF/{1}/{2}.pdf", UsuarioActual.Empresa.Ruta, TipoDocto, gvr.DataKey("SerieFolio").ToString)
|
||||
|
||||
If IO.File.Exists(pathPDF) Then
|
||||
'NO AGREGAR ARCHIVOS REPETIDOS
|
||||
@@ -924,27 +924,6 @@ Partial Class RepVentaDetalle
|
||||
Response.ContentType = "application/zip"
|
||||
Response.End()
|
||||
End Sub
|
||||
Private Function DescargarFactura(CveVenta As Integer, CveEmpresa As Integer, CveUsuarioCreo As Integer) As Byte()
|
||||
Dim Url = New Uri(String.Format("{0}Compras/PopUpVerFactura.aspx?P={1}", "http://localhost:85/", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta))))
|
||||
Dim File As Byte() = Nothing
|
||||
Try
|
||||
Using httpClient = New HttpClient()
|
||||
httpClient.Timeout = New TimeSpan(0, 15, 0)
|
||||
Using request = New HttpRequestMessage(HttpMethod.Get, Url)
|
||||
request.Headers.Add("ADSToken", Encripta(String.Format("CVEEMPRESA={0}&TICKS={1}&CVEUSUARIO={2}", CveEmpresa, DateTime.UtcNow.Ticks, CveUsuarioCreo)))
|
||||
Dim response = httpClient.SendAsync(request).Result
|
||||
If response.StatusCode = Net.HttpStatusCode.OK Then
|
||||
File = response.Content.ReadAsByteArrayAsync().Result
|
||||
End If
|
||||
End Using
|
||||
End Using
|
||||
Catch ex As Exception
|
||||
File = Nothing
|
||||
OnError("Ocurrió un error al descargar la factura", ex)
|
||||
End Try
|
||||
|
||||
Return File
|
||||
End Function
|
||||
|
||||
Private Sub BtnDescargarXML_Click(sender As Object, e As EventArgs) Handles BtnDescargarXML.Click
|
||||
Dim pathXML As String
|
||||
@@ -973,7 +952,7 @@ Partial Class RepVentaDetalle
|
||||
TipoDocto = "Dev"
|
||||
End Select
|
||||
|
||||
pathXML = Server.MapPath(String.Format("~/Empresas/{0}/XML/{1}/{2}.xml", UsuarioActual.CveEmpresa, TipoDocto, gvr.DataKey("SerieFolio").ToString))
|
||||
pathXML = String.Format("{0}XML/{1}/{2}.xml", UsuarioActual.Empresa.Ruta, TipoDocto, gvr.DataKey("SerieFolio").ToString)
|
||||
|
||||
If IO.File.Exists(pathXML) Then
|
||||
'NO AGREGAR ARCHIVOS REPETIDOS
|
||||
@@ -990,6 +969,27 @@ Partial Class RepVentaDetalle
|
||||
Response.ContentType = "application/zip"
|
||||
Response.End()
|
||||
End Sub
|
||||
Private Function DescargarFactura(CveVenta As Integer, CveEmpresa As Integer, CveUsuarioCreo As Integer) As Byte()
|
||||
Dim Url = New Uri(String.Format("{0}Compras/PopUpVerFactura.aspx?P={1}", "http://localhost:85/", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta))))
|
||||
Dim File As Byte() = Nothing
|
||||
Try
|
||||
Using httpClient = New HttpClient()
|
||||
httpClient.Timeout = New TimeSpan(0, 15, 0)
|
||||
Using request = New HttpRequestMessage(HttpMethod.Get, Url)
|
||||
request.Headers.Add("ADSToken", Encripta(String.Format("CVEEMPRESA={0}&TICKS={1}&CVEUSUARIO={2}", CveEmpresa, DateTime.UtcNow.Ticks, CveUsuarioCreo)))
|
||||
Dim response = httpClient.SendAsync(request).Result
|
||||
If response.StatusCode = Net.HttpStatusCode.OK Then
|
||||
File = response.Content.ReadAsByteArrayAsync().Result
|
||||
End If
|
||||
End Using
|
||||
End Using
|
||||
Catch ex As Exception
|
||||
File = Nothing
|
||||
OnError("Ocurrió un error al descargar la factura", ex)
|
||||
End Try
|
||||
|
||||
Return File
|
||||
End Function
|
||||
|
||||
Private Sub GenerarPDF(Optional Formato As String = "PDF")
|
||||
If DtVentas IsNot Nothing Then
|
||||
|
||||
@@ -2630,6 +2630,7 @@ Partial Class Ventas
|
||||
End If
|
||||
If Request("CveEmbarqueManifiesto") IsNot Nothing AndAlso IsNumeric(Request("CveEmbarqueManifiesto")) AndAlso Request("CveEmbarqueManifiesto").ToEntero() > 0 Then
|
||||
DdlMoneda.SelectedValueExist(2)
|
||||
CambiaMoneda()
|
||||
Using ObjVentas As New ClsNominas
|
||||
If ObjVentas.EmbarqueManifiestoGet(-1, -1, -1, Request("CveEmbarqueManifiesto").ToString().ToEntero()) And ObjVentas.DtResultados.Rows.Count > 0 Then
|
||||
DdlSubProyectoDatos.SelectedValueExist(ObjVentas.DtResultados.Rows(0)("CveSubProyecto").ToString())
|
||||
|
||||
@@ -508,6 +508,8 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user