Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -138,29 +138,29 @@
|
||||
<asp:Literal ID="LblTipoFolio" runat="server" Text='<%# Eval("tipoFolio") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Límite">
|
||||
<asp:TemplateField HeaderText="Límite" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LblLimite" runat="server" Text='<%# Eval("Limite") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="SubProyecto" ItemStyle-Width="150px">
|
||||
<asp:TemplateField HeaderText="SubProyecto" >
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LblSubProyecto" runat="server" Text='<%# Eval("SubProyecto")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Estatus" ItemStyle-Width="150px">
|
||||
<asp:TemplateField HeaderText="Estatus" >
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LblPuntos" runat="server" Text='<%# Eval("Estatus")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="AreaTexto" ItemStyle-Width="100px" HeaderText="Área" />
|
||||
<asp:TemplateField HeaderText="Fecha Ing." ItemStyle-HorizontalAlign="Center" ItemStyle-Width="150px">
|
||||
<asp:BoundField DataField="AreaTexto" HeaderText="Área" />
|
||||
<asp:TemplateField HeaderText="Fecha Ing." ItemStyle-HorizontalAlign="Center" >
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="lblFecha" runat="server" Text='<%# Eval("FechaIng", "{0:d}")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Total">
|
||||
<asp:TemplateField HeaderText="Total" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="lblTotal" runat="server" Text='<%# Eval("NumRegistros") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
@@ -170,23 +170,16 @@
|
||||
<asp:Literal ID="lblUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:HyperLinkField HeaderText="Mov. Salida" DataTextField="CveMovimiento" DataNavigateUrlFields="CveMovimiento" DataNavigateUrlFormatString="/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}" Target="_blank" ControlStyle-CssClass="Texto"/>
|
||||
<asp:HyperLinkField HeaderText="Mov. Salida" DataTextField="FolioAlmacen" DataNavigateUrlFields="CveMovimiento" DataNavigateUrlFormatString="/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}" Target="_blank" ControlStyle-CssClass="Texto"/>
|
||||
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Right" ItemStyle-Width="80px">
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Right" ItemStyle-Width="120px">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="ImgVer" OnClick="ImgVer_Click" runat="server" AlternateText="Editar" CausesValidation="False"
|
||||
CssClass="btn btn-primary btn-circle btn-sm" Text="<i class='fa fa-bars'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Right" ItemStyle-Width="80px">
|
||||
<ItemTemplate>
|
||||
|
||||
<asp:LinkButton ID="ImgE" OnClick="Edit_ClickFolioGarantia" runat="server" AlternateText="Editar" CausesValidation="False"
|
||||
CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left" ItemStyle-Width="40px">
|
||||
<ItemTemplate>
|
||||
|
||||
<asp:LinkButton ID="imgD" OnClick="Remove_ClickFolioGarantia" runat="server" AlternateText="Eliminar" CausesValidation="False" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="confirmar" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
@@ -189,7 +189,6 @@
|
||||
<asp:Literal ID="LtlTituloModalFolioGarantia" runat="server">Agregar Garantía de Mes</asp:Literal></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright" style="width: 170px!important">
|
||||
<asp:DropDownList ID="DdlMarcaM" runat="server" CssClass="form-control input-sm select2me" DataValueField="CveMarca" DataTextField="Marca" Class="table-group-action-input form-control input-inline input-small input-sm" Width="250px" AutoPostBack="true"></asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVProducto2" InitialValue="-1" runat="server" ControlToValidate="DdlMarcaM" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Marca''</b> es necesario, por favor ingréselo." ValidationGroup="GrpTamanio"></asp:RequiredFieldValidator>
|
||||
@@ -197,27 +196,19 @@
|
||||
<label for="<%= DdlMarcaM.ClientID.ToString()%>">Marca:</label>
|
||||
<i></i>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright" style="width: 170px!important">
|
||||
<asp:DropDownList ID="DdlTipoUsoM" runat="server" CssClass="form-control input-sm select2me" DataValueField="CveTipoUso" DataTextField="TipoUso" Class="table-group-action-input form-control input-inline input-small input-sm" Width="250px" AutoPostBack="true"></asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" InitialValue="-1" runat="server" ControlToValidate="DdlTipoUsoM" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo Uso''</b> es necesario, por favor ingréselo." ValidationGroup="GrpTamanio"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="RFVProducto2" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
<label for="<%= DdlTipoUsoM.ClientID.ToString()%>">Tipo Uso:</label>
|
||||
<i></i>
|
||||
</div>
|
||||
<br />
|
||||
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright" style="width: 170px!important">
|
||||
<asp:TextBox ID="TxtMes" CssClass="form-control " Width="150px" runat="server" MaxLength="10" CausesValidation="true" Style="text-align: right!important; margin-right: 10px!important" OnKeyup="FormatoMoneda(this);"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVTxtCargo" runat="server" ControlToValidate="TxtMes" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Mes''</b> es necesario, por favor ingréselo." ValidationGroup="GrpTamanio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtMes.ClientID.ToString()%>">Mes:</label>
|
||||
<i></i>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright" style="width: 170px!important">
|
||||
<asp:TextBox ID="TxtValor" CssClass="form-control " Width="150px" runat="server" MaxLength="10" CausesValidation="true" Style="text-align: right!important" OnKeyup="FormatoMoneda(this);"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RfvTxtBonificacion" runat="server" ControlToValidate="TxtValor" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Valor''</b> es necesario, por favor ingréselo." ValidationGroup="GrpTamanio"></asp:RequiredFieldValidator>
|
||||
|
||||
@@ -76,6 +76,8 @@ Partial Class Acumuladores_CatFoliosGarantia
|
||||
DdlMarca.DataBind()
|
||||
DdlMarca.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
DdlMarca.SelectedValue = "-1"
|
||||
DdlMarcaM.DataSource = GlobalDTGralMarcas(UsuarioActual.CveEmpresa)
|
||||
DdlMarcaM.DataBind()
|
||||
|
||||
DdlTipoUso.DataSource = GlobalDTAcumTiposUso(UsuarioActual.CveEmpresa)
|
||||
DdlTipoUso.DataBind()
|
||||
|
||||
@@ -161,7 +161,7 @@ Public Class ClsVentas
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
Public Function GetVenta(CveVenta As Integer, CveEmpresa As Integer, Optional VerificaAlmacen As Boolean = True) As Boolean
|
||||
Public Function GetVenta(CveVenta As Integer, CveEmpresa As Integer, Optional VerificaAlmacen As Boolean = False) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_VentasGet")
|
||||
|
||||
|
||||
@@ -2405,21 +2405,35 @@ Namespace Extensiones
|
||||
Dim indexRowGV As Integer = 0
|
||||
Dim cssClassRow As String = ""
|
||||
|
||||
Dim CountRowFiltros As Integer = -1
|
||||
If DatosFiltros.Trim.Length > 0 Then
|
||||
CountRowFiltros = 0
|
||||
End If
|
||||
|
||||
For indexRow = 8 To worksheet.Rows.Count - 4
|
||||
|
||||
Try
|
||||
cssClassRow = GridView.Rows(indexRowGV).CssClass.Trim()
|
||||
|
||||
Select Case cssClassRow
|
||||
|
||||
Case "Totales"
|
||||
worksheet.Cells.GetSubrangeRelative(indexRow + CountRowFiltros, 0, celdasConTexto.LastColumnIndex + 1, 1).Style.FillPattern.SetSolid(System.Drawing.ColorTranslator.FromHtml("#67809f"))
|
||||
worksheet.Cells.GetSubrangeRelative(indexRow + CountRowFiltros, 0, celdasConTexto.LastColumnIndex + 1, 1).Style.Font.Weight = 1000
|
||||
worksheet.Cells.GetSubrangeRelative(indexRow + CountRowFiltros, 0, celdasConTexto.LastColumnIndex + 1, 1).Style.Font.Color = System.Drawing.ColorTranslator.FromHtml("#ddd")
|
||||
Exit Select
|
||||
Case "SubTotales2"
|
||||
worksheet.Cells.GetSubrangeRelative(indexRow - 1, 0, celdasConTexto.LastColumnIndex + 1, 1).Style.FillPattern.SetSolid(System.Drawing.ColorTranslator.FromHtml("#c0c0c0"))
|
||||
worksheet.Cells.GetSubrangeRelative(indexRow - 1, 0, celdasConTexto.LastColumnIndex + 1, 1).Style.Font.Weight = 1000
|
||||
worksheet.Cells.GetSubrangeRelative(indexRow - 1, 0, celdasConTexto.LastColumnIndex + 1, 1).Style.Font.Color = System.Drawing.ColorTranslator.FromHtml("#000077")
|
||||
worksheet.Cells.GetSubrangeRelative(indexRow + CountRowFiltros, 0, celdasConTexto.LastColumnIndex + 1, 1).Style.FillPattern.SetSolid(System.Drawing.ColorTranslator.FromHtml("#c0c0c0"))
|
||||
worksheet.Cells.GetSubrangeRelative(indexRow + CountRowFiltros, 0, celdasConTexto.LastColumnIndex + 1, 1).Style.Font.Weight = 1000
|
||||
worksheet.Cells.GetSubrangeRelative(indexRow + CountRowFiltros, 0, celdasConTexto.LastColumnIndex + 1, 1).Style.Font.Color = System.Drawing.ColorTranslator.FromHtml("#000077")
|
||||
Exit Select
|
||||
Case "SubTotales"
|
||||
worksheet.Cells.GetSubrangeRelative(indexRow - 1, 0, celdasConTexto.LastColumnIndex + 1, 1).Style.FillPattern.SetSolid(System.Drawing.ColorTranslator.FromHtml("#dddddd"))
|
||||
worksheet.Cells.GetSubrangeRelative(indexRow - 1, 0, celdasConTexto.LastColumnIndex + 1, 1).Style.Font.Weight = 1000
|
||||
worksheet.Cells.GetSubrangeRelative(indexRow - 1, 0, celdasConTexto.LastColumnIndex + 1, 1).Style.Font.Color = System.Drawing.ColorTranslator.FromHtml("#67809F")
|
||||
worksheet.Cells.GetSubrangeRelative(indexRow + CountRowFiltros, 0, celdasConTexto.LastColumnIndex + 1, 1).Style.FillPattern.SetSolid(System.Drawing.ColorTranslator.FromHtml("#dddddd"))
|
||||
worksheet.Cells.GetSubrangeRelative(indexRow + CountRowFiltros, 0, celdasConTexto.LastColumnIndex + 1, 1).Style.Font.Weight = 1000
|
||||
worksheet.Cells.GetSubrangeRelative(indexRow + CountRowFiltros, 0, celdasConTexto.LastColumnIndex + 1, 1).Style.Font.Color = System.Drawing.ColorTranslator.FromHtml("#67809F")
|
||||
Exit Select
|
||||
Case Else
|
||||
Exit Select
|
||||
End Select
|
||||
|
||||
Catch ex As Exception
|
||||
|
||||
@@ -73,20 +73,7 @@ public partial class Bancos_PagoAcreedor : ClsPaginas
|
||||
ViewState["IDCtaContableAcreedorComplementaria"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
private bool UsaComplementaria
|
||||
{
|
||||
get
|
||||
{
|
||||
return Convert.ToBoolean(ViewState["UsaComplementaria"]);
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
ViewState["UsaComplementaria"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private int CveMonedaCuentaPago
|
||||
{
|
||||
get
|
||||
@@ -110,10 +97,9 @@ public partial class Bancos_PagoAcreedor : ClsPaginas
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
UsaComplementaria = true;
|
||||
{
|
||||
CveMonedaCuentaPago = 0;
|
||||
rowComisiones.Visible = UsuarioActual.CveEmpresa.Contiene(1, 4, 5, 7, 11, 12, 72, 80, 126, 119, 122);
|
||||
rowComisiones.Visible = true;
|
||||
|
||||
CargaTipoTransaccion();
|
||||
CargaCuentas();
|
||||
@@ -306,7 +292,7 @@ public partial class Bancos_PagoAcreedor : ClsPaginas
|
||||
{
|
||||
decimal ImporteBanco = TxtImporte.Text.ToDecimal();
|
||||
decimal ImporteMNBanco = ImporteBanco;
|
||||
decimal ImporteComplementaria = 0;
|
||||
decimal ImporteComplementaria = 0;
|
||||
decimal TCPago = TxtTCPago.Text.ToDecimal();
|
||||
string Conc = TxtObservaciones.Text == "" ? TxtFolio.Text : TxtObservaciones.Text;
|
||||
string Ref = TxtObservaciones.Text == "" ? TxtFolio.Text : TxtObservaciones.Text;
|
||||
@@ -318,16 +304,13 @@ public partial class Bancos_PagoAcreedor : ClsPaginas
|
||||
|
||||
if (CveIE > 0)
|
||||
{
|
||||
//GUARDA COMPROBANTE
|
||||
if (!filemove.Equals(""))
|
||||
{
|
||||
filemove.FilesMove(CveIE.ToString(), string.Format(@"{0}IE", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase: false);
|
||||
}
|
||||
|
||||
decimal Importe;
|
||||
decimal ImporteMN;
|
||||
decimal ImporteComision;
|
||||
decimal ImporteComisionMN;
|
||||
decimal AcumImporteMN = 0;
|
||||
decimal ImporteBancosMN, ImporteAcreedorMN;
|
||||
bool TipoMovtoComision = false;
|
||||
int IdCtaContableOtrosGastos = 0;
|
||||
int CveConceptoDiferenciaCambiaria = 0;
|
||||
@@ -338,8 +321,10 @@ public partial class Bancos_PagoAcreedor : ClsPaginas
|
||||
Importe = gvr.FCTextBox("TxtAbonar").Text.ToDecimal();
|
||||
ImporteComision = gvr.FCTextBox("TxtComision").Text.ToDecimal();
|
||||
ImporteMN = Importe;
|
||||
ImporteAcreedorMN = Importe;
|
||||
ImporteBancosMN = Importe;
|
||||
ImporteComisionMN = ImporteComision;
|
||||
ImporteComplementaria = 0;
|
||||
ImporteComplementaria = 0;
|
||||
|
||||
if (gvr.FCTextBox("TxtComision").Text.ToDecimal() < 0)
|
||||
{
|
||||
@@ -352,61 +337,47 @@ public partial class Bancos_PagoAcreedor : ClsPaginas
|
||||
{
|
||||
TipoMovtoComision = false;
|
||||
IdCtaContableOtrosGastos = UsuarioActual.Empresa.Funcionalidad(266).ToEntero();
|
||||
|
||||
}
|
||||
|
||||
Decimal TC = gvr.DataKey("TipoCambio").ToDecimal();
|
||||
if (gvr.DataKey("FechaDocumento").ToDate().Month != TxtFechaDocumento.Text.ToDate().Month || gvr.DataKey("FechaDocumento").ToDate().Year != TxtFechaDocumento.Text.ToDate().Year)
|
||||
{
|
||||
TC = get_GlobalTipoCambio(TxtFechaDocumento.Text.ToDate().AddMonths(-1).LastDayOfMonth()).ToDecimal();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (gvr.FCCheckBox("Chk").Checked)
|
||||
{
|
||||
Decimal TC = gvr.DataKey("TipoCambio").ToDecimal();
|
||||
int tCveMoneda = gvr.DataKey("CveMoneda").ToEntero();
|
||||
if (CveMonedaPago == 1 && tCveMoneda == 1)
|
||||
//Verifica Fluctuación mensual
|
||||
if (tCveMoneda > 1 && gvr.DataKey("FechaDocumento").ToDate() < TxtFechaDocumento.Text.ToDate().FirstDayOfMonth())
|
||||
{
|
||||
ImporteMN = Importe;
|
||||
ImporteComisionMN = ImporteComision;
|
||||
TC = get_GlobalTipoCambio(TxtFechaDocumento.Text.ToDate().AddMonths(-1).LastDayOfMonth()).ToDecimal();//obtengo el TC del mes anterior del pago
|
||||
}
|
||||
else if (CveMonedaPago == 1 && tCveMoneda == 2)
|
||||
{
|
||||
ImporteComisionMN = ImporteComision;
|
||||
if (UsaComplementaria)
|
||||
{
|
||||
ImporteMN = Importe;
|
||||
ImporteComplementaria = (Importe * TC - Importe).RoundSQL();
|
||||
}
|
||||
else
|
||||
{
|
||||
ImporteMN = Importe * TC;
|
||||
ImporteComplementaria = 0;
|
||||
}
|
||||
}
|
||||
else if (CveMonedaPago == 2 && tCveMoneda == 1)
|
||||
{
|
||||
ImporteBancosMN = (Importe * TCPago).RoundSQL();
|
||||
ImporteAcreedorMN = (Importe * TC).RoundSQL();
|
||||
|
||||
ImporteMN = Importe;
|
||||
ImporteComisionMN = ImporteComision;
|
||||
}
|
||||
else if (CveMonedaPago == 2 && tCveMoneda == 2)
|
||||
{
|
||||
ImporteComisionMN = ImporteComision;
|
||||
if (UsaComplementaria)
|
||||
{
|
||||
ImporteMN = Importe;
|
||||
ImporteComplementaria = (Importe * TC - Importe).RoundSQL();
|
||||
}
|
||||
else
|
||||
{
|
||||
ImporteMN = (Importe * TC).RoundSQL();
|
||||
ImporteComplementaria = 0;
|
||||
}
|
||||
}
|
||||
//if (CveMonedaPago == 1 && tCveMoneda == 1)
|
||||
//{
|
||||
// ImporteMN = Importe;
|
||||
// ImporteComisionMN = ImporteComision;
|
||||
//}
|
||||
//else if (CveMonedaPago == 1 && tCveMoneda == 2)
|
||||
//{
|
||||
// ImporteComisionMN = ImporteComision;
|
||||
|
||||
// ImporteMN = Importe;
|
||||
// ImporteComplementaria = (Importe * TC - Importe).RoundSQL();
|
||||
//}
|
||||
//else if (CveMonedaPago == 2 && tCveMoneda == 1)
|
||||
//{
|
||||
// ImporteMN = Importe;
|
||||
// ImporteComisionMN = ImporteComision;
|
||||
// ImporteComplementaria = 0;
|
||||
//}
|
||||
//else if (CveMonedaPago == 2 && tCveMoneda == 2)
|
||||
//{
|
||||
// ImporteComisionMN = ImporteComision;
|
||||
// ImporteMN = Importe;
|
||||
// ImporteComplementaria = (Importe * TC - Importe).RoundSQL();
|
||||
//}
|
||||
|
||||
ImporteMN = ImporteMN.RoundSQL();
|
||||
ImporteComplementaria = ImporteComplementaria.RoundSQL();
|
||||
//ImporteMN = ImporteMN.RoundSQL();
|
||||
//ImporteComplementaria = ImporteComplementaria.RoundSQL();
|
||||
ImporteComisionMN = ImporteComisionMN.RoundSQL();
|
||||
ImporteComision = ImporteComision.RoundSQL();
|
||||
AcumImporteMN += ImporteMN;
|
||||
@@ -422,38 +393,38 @@ public partial class Bancos_PagoAcreedor : ClsPaginas
|
||||
break;
|
||||
}
|
||||
|
||||
if (UsaComplementaria)
|
||||
if (tCveMoneda > 1 && MsgError == "")
|
||||
{
|
||||
ImporteComplementaria = (Importe * TC - Importe).RoundSQL();
|
||||
if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, false, Importe, Ref, CveConceptoContablePrestamoComplementario, Conc, DateTime.Now, IDCtaContableAcreedorComplementaria, -1, CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), ImporteMX: ImporteComplementaria, CveIEDevolucion: gvr.DataKey("CveIE").ToEntero(), ImporteME: Importe, TipoCambio: TC, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero()))
|
||||
MsgError = "No se pudo insertar concepto de acreedor complementaria";
|
||||
}
|
||||
|
||||
if (TCPago != TC)
|
||||
{
|
||||
bool TipoMovto = false;
|
||||
int IdCtaContableDiferenciaCambiaria = 0;
|
||||
if (TCPago > TC)
|
||||
{
|
||||
CveConceptoDiferenciaCambiaria = 65;
|
||||
IdCtaContableDiferenciaCambiaria = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria;
|
||||
TipoMovto = false;
|
||||
Importe = (Importe * TCPago) - (Importe * TC);
|
||||
}
|
||||
else if (TCPago < TC)
|
||||
{
|
||||
CveConceptoDiferenciaCambiaria = 64;
|
||||
IdCtaContableDiferenciaCambiaria = UsuarioActual.Empresa.IdCuentaGananciaCambiaria;
|
||||
TipoMovto = true;
|
||||
Importe = (Importe * TC) - (Importe * TCPago);
|
||||
}
|
||||
ImporteMN = Importe;
|
||||
|
||||
if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, Ref, CveConceptoDiferenciaCambiaria, Conc, DateTime.Now, IdCtaContableDiferenciaCambiaria, -1, CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), ImporteMX: ImporteMN, CveIEDevolucion: gvr.DataKey("CveIE").ToEntero(), ImporteME: Importe, TipoCambio: TC, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyectoPago.SelectedValue.ToEntero()))
|
||||
MsgError = "No se pudo insertar concepto de diferencia cambiaria";
|
||||
if (ImporteBancosMN != ImporteAcreedorMN && MsgError == "")
|
||||
{
|
||||
bool TipoMovto = false;
|
||||
int IdCtaContableDiferenciaCambiaria = 0;
|
||||
if (TCPago > TC)
|
||||
{
|
||||
CveConceptoDiferenciaCambiaria = 65;
|
||||
IdCtaContableDiferenciaCambiaria = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria;
|
||||
TipoMovto = false;
|
||||
}
|
||||
else if (TCPago < TC)
|
||||
{
|
||||
CveConceptoDiferenciaCambiaria = 64;
|
||||
IdCtaContableDiferenciaCambiaria = UsuarioActual.Empresa.IdCuentaGananciaCambiaria;
|
||||
TipoMovto = true;
|
||||
}
|
||||
Importe = ((Importe * TCPago) - (Importe * TC)).Abs();
|
||||
|
||||
if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, Ref, CveConceptoDiferenciaCambiaria, Conc, DateTime.Now, IdCtaContableDiferenciaCambiaria, -1, CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), ImporteMX: Importe, CveIEDevolucion: gvr.DataKey("CveIE").ToEntero(), ImporteME: Importe, TipoCambio: TC, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyectoPago.SelectedValue.ToEntero()))
|
||||
MsgError = "No se pudo insertar concepto de diferencia cambiaria";
|
||||
}
|
||||
|
||||
if (ImporteComisionMN > 0)
|
||||
if (ImporteComision != 0 && MsgError == "")
|
||||
{
|
||||
ImporteComisionMN = (ImporteComision * TCPago).RoundSQL();
|
||||
if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoComision, ImporteComision, Ref, 255, Conc, DateTime.Now, IdCtaContableOtrosGastos, -1, CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), ImporteMX: ImporteComisionMN, CveIEDevolucion: gvr.DataKey("CveIE").ToEntero(), TipoCambio: TC, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyectoPago.SelectedValue.ToEntero()))
|
||||
{
|
||||
MsgError = "No se pudo insertar concepto de pago acreedor";
|
||||
@@ -464,46 +435,18 @@ public partial class Bancos_PagoAcreedor : ClsPaginas
|
||||
}
|
||||
|
||||
if (CveMonedaPago != 1)
|
||||
{
|
||||
if (UsaComplementaria)
|
||||
{
|
||||
ImporteMNBanco = ImporteBanco;
|
||||
{
|
||||
ImporteComplementaria = (ImporteBanco * TCPago - ImporteBanco).RoundSQL();
|
||||
}
|
||||
else
|
||||
{
|
||||
ImporteMNBanco = (ImporteBanco * TCPago).RoundSQL();
|
||||
ImporteComplementaria = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, ImporteBanco, Ref, 30, Conc, DateTime.Now, IDCtaContableBancos, -1, CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), ImporteMX: ImporteMNBanco, ImporteME: ImporteBanco, TipoCambio: TCPago, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyectoPago.SelectedValue.ToEntero())) MsgError = "No se pudo insertar concepto de bancos";
|
||||
if (MsgError == "" && !ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, ImporteBanco, Ref, 30, Conc, DateTime.Now, IDCtaContableBancos, -1, CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), ImporteMX: ImporteBanco, ImporteME: ImporteBanco, TipoCambio: TCPago, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyectoPago.SelectedValue.ToEntero())) MsgError = "No se pudo insertar concepto de bancos";
|
||||
|
||||
//movimiento de ajuste por sino se aplicó en el proceso anterior
|
||||
if (CveMonedaPago != 1 && UsaComplementaria )
|
||||
if (MsgError == "" && CveMonedaPago != 1 )
|
||||
{
|
||||
if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, ImporteBanco, Ref, 204, Conc, DateTime.Now, IDCtaContableBancosComplementario, -1, CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), ImporteMX: ImporteComplementaria, ImporteME: ImporteBanco, TipoCambio: TCPago, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyectoPago.SelectedValue.ToEntero())) MsgError = "No se pudo insertar concepto de bancos complementaria";
|
||||
|
||||
}
|
||||
if (AcumImporteMN != (ImporteBanco + ImporteComplementaria) && CveConceptoDiferenciaCambiaria == 0)
|
||||
{
|
||||
int tCveConceptoOtIngresos = 0;
|
||||
bool TipoMovtoOt = false;
|
||||
decimal Dif = AcumImporteMN - (ImporteBanco + ImporteComplementaria);
|
||||
if (Dif < 0)
|
||||
{
|
||||
tCveConceptoOtIngresos = 65; TipoMovtoOt = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
tCveConceptoOtIngresos = 64; TipoMovtoOt = true;
|
||||
}
|
||||
|
||||
if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoOt, Dif.Abs(), Ref, tCveConceptoOtIngresos, Conc, DateTime.Now, 0, -1, CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), ImporteMX: Dif.Abs(), ImporteME: Dif.Abs(), TipoCambio: TCPago, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyectoPago.SelectedValue.ToEntero()))
|
||||
{
|
||||
MsgError = "No se pudo insertar concepto de ajuste en redondeo";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
@@ -517,7 +460,7 @@ public partial class Bancos_PagoAcreedor : ClsPaginas
|
||||
}
|
||||
|
||||
//VALIDA QUE CUADRE LA PREPOLIZA
|
||||
if (ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, 5))
|
||||
if (MsgError == "" && ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, 5))
|
||||
{
|
||||
if (ObjMov.ValorPolizaDescuadre > 0)
|
||||
{
|
||||
@@ -557,6 +500,11 @@ public partial class Bancos_PagoAcreedor : ClsPaginas
|
||||
Msg.AppendFormat("El Documento se guardo correctamente. Folio <b><a href='/Bancos/IE.aspx?CveIE={0}' target='_blank' class='Texto'>{1}</a></b> <br/>", CveIE, ObjIE.Folio);
|
||||
|
||||
}
|
||||
//GUARDA COMPROBANTE
|
||||
if (!filemove.Equals(""))
|
||||
{
|
||||
filemove.FilesMove(CveIE.ToString(), string.Format(@"{0}IE", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase: false);
|
||||
}
|
||||
System.IO.FileInfo archivo = null;
|
||||
|
||||
if (DdlTipoTransaccion.SelectedValue.ToEntero().Contiene(2, 8, 9))
|
||||
@@ -722,18 +670,8 @@ public partial class Bancos_PagoAcreedor : ClsPaginas
|
||||
|
||||
if (CveMoneda != 1)
|
||||
{
|
||||
|
||||
if (UsaComplementaria)
|
||||
{
|
||||
ImporteMN = Importe;
|
||||
ImporteComplementaria = Importe * TC - Importe;
|
||||
}
|
||||
else
|
||||
{
|
||||
ImporteMN = Importe * TC;
|
||||
ImporteComplementaria = 0;
|
||||
}
|
||||
|
||||
ImporteComplementaria = Importe * TC - Importe;
|
||||
}
|
||||
|
||||
|
||||
@@ -757,18 +695,16 @@ public partial class Bancos_PagoAcreedor : ClsPaginas
|
||||
if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, Importe, Ref, CveConceptoContablePrestamo, Conc, DateTime.Now, IDCtaContableAcreedorExtranjera, -1, CveIE, CveProveedor: DdlProveedorPrestamo.SelectedValue.ToEntero(), ImporteMX: ImporteMN, TipoCambio: TC, TipoCambioPago: TC, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero()))
|
||||
{
|
||||
MsgError = "No se pudo insertar concepto de acreedor";
|
||||
}
|
||||
if (UsaComplementaria)
|
||||
}
|
||||
if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, false, Importe, Ref, CveConceptoContableBancoComplementario, Conc, DateTime.Now, IDCtaContableBancosComplementario, -1, CveIE, CveProveedor: DdlProveedorPrestamo.SelectedValue.ToEntero(), ImporteMX: ImporteComplementaria, ImporteME: Importe, TipoCambio: TC, TipoCambioPago: TC, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero()))
|
||||
{
|
||||
if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, false, Importe, Ref, CveConceptoContableBancoComplementario, Conc, DateTime.Now, IDCtaContableBancosComplementario, -1, CveIE, CveProveedor: DdlProveedorPrestamo.SelectedValue.ToEntero(), ImporteMX: ImporteComplementaria, ImporteME: Importe, TipoCambio: TC, TipoCambioPago: TC, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero()))
|
||||
{
|
||||
MsgError = "No se pudo insertar concepto de bancos complementaria";
|
||||
}
|
||||
if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, Importe, Ref, CveConceptoContablePrestamoComplementario, Conc, DateTime.Now, IDCtaContableAcreedorComplementaria, -1, CveIE, CveProveedor: DdlProveedorPrestamo.SelectedValue.ToEntero(), ImporteMX: ImporteComplementaria, ImporteME: Importe, TipoCambio: TC, TipoCambioPago: TC, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero()))
|
||||
{
|
||||
MsgError = "No se pudo insertar concepto de acreedor complementaria";
|
||||
}
|
||||
MsgError = "No se pudo insertar concepto de bancos complementaria";
|
||||
}
|
||||
if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, Importe, Ref, CveConceptoContablePrestamoComplementario, Conc, DateTime.Now, IDCtaContableAcreedorComplementaria, -1, CveIE, CveProveedor: DdlProveedorPrestamo.SelectedValue.ToEntero(), ImporteMX: ImporteComplementaria, ImporteME: Importe, TipoCambio: TC, TipoCambioPago: TC, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero()))
|
||||
{
|
||||
MsgError = "No se pudo insertar concepto de acreedor complementaria";
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -526,6 +526,7 @@
|
||||
<asp:ListItem Text="Apoyo Logístico" Value="9"></asp:ListItem>
|
||||
<asp:ListItem Text="NC Por Devolución" Value="11"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group proveedoreespes" runat="server" id="divImportacion" visible="false">
|
||||
@@ -540,6 +541,7 @@
|
||||
<asp:DropDownList ID="DdlFolioGarantia" runat="server" AutoPostBack="true" AppendDataBoundItems="true" DataTextField="FolioGarantia" DataValueField="CveFolioGarantia" OnSelectedIndexChanged="DdlFolioGarantia_SelectedIndexChanged" CssClass="form-control input-sm input-small select2me">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:Button ID="BtnFolioGarantiaRestantes" runat="server" Text="Resta" CssClass="default" OnClick="BtnFolioGarantiaRestantes_Click" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -2864,7 +2866,7 @@
|
||||
<br />
|
||||
</div>
|
||||
|
||||
<asp:GridView ID="GVAnticipos" runat="server" GridLines="None" AutoGenerateColumns="False" DataKeyNames="CveCompra,TipoDocto,CveIE,Fecha,CvePrePoliza,CveMoneda,TCCompra" EmptyDataText="No se encontraron Anticipos/NC del Proveedor" CssClass="table table-striped table-hover table-advance Widthall">
|
||||
<asp:GridView ID="GVAnticipos" runat="server" GridLines="None" AutoGenerateColumns="False" DataKeyNames="CveCompra,TipoDocto,CveIE,Fecha,CvePrePoliza,CveMoneda,TCCompra,CveProveedor" EmptyDataText="No se encontraron Anticipos/NC del Proveedor" CssClass="table table-striped table-hover table-advance Widthall">
|
||||
<Columns>
|
||||
<asp:TemplateField ItemStyle-Width="30px">
|
||||
<ItemTemplate>
|
||||
|
||||
@@ -1248,15 +1248,6 @@ Partial Class Compras_Compras
|
||||
btnProrateo2.Visible = True
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531).ToEntero = 1 Then 'cuando es emp acumuladora AndAlso DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV")
|
||||
divFolioGarantia.Visible = True
|
||||
Using objAcum As New ClsAcumuladores
|
||||
If objAcum.FoliosGarantiaGet(-1, UsuarioActual.Empresa.CveEmpresa, Estatus:=-1, TipoFolio:="-1", Area:=-1, CveSubProyecto:=-1) Then
|
||||
DdlFolioGarantia.DataSource = objAcum.DtResultados.FiltraParametros("", "FechaIng DESC")
|
||||
DdlFolioGarantia.DataBind()
|
||||
End If
|
||||
End Using
|
||||
End If
|
||||
'****************************************************************
|
||||
'If UsuarioActual.CveEmpresa = 72 Then
|
||||
' LiRecepcion.Visible = True
|
||||
@@ -1960,7 +1951,15 @@ Partial Class Compras_Compras
|
||||
TxtSerie.Enabled = False
|
||||
End If
|
||||
|
||||
'DdlTipoComprobante.Enabled = False
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") Then 'cuando es emp acumuladora
|
||||
divFolioGarantia.Visible = True
|
||||
Using objAcum As New ClsAcumuladores
|
||||
If objAcum.FoliosGarantiaGet(-1, UsuarioActual.Empresa.CveEmpresa, Estatus:=2, TipoFolio:="-1", Area:=-1, CveSubProyecto:=-1) Then
|
||||
DdlFolioGarantia.DataSource = objAcum.DtResultados.FiltraParametros("", "FechaIng DESC")
|
||||
DdlFolioGarantia.DataBind()
|
||||
End If
|
||||
End Using
|
||||
End If
|
||||
|
||||
'PERMISO PARA MODIFICACIÓN DE FECHA AUN CON FACTURA
|
||||
TxtFecha.Enabled = UsuarioActual.TienePermisoProceso(216)
|
||||
@@ -2842,6 +2841,12 @@ Partial Class Compras_Compras
|
||||
|
||||
TxtRembolsoNumero.Enabled = If(IdPoliza > 0, False, True)
|
||||
|
||||
If dr("CveFolioGarantia").ToString <> "" Then
|
||||
divFolioGarantia.Visible = True
|
||||
DdlFolioGarantia.Items.Insert(0, New ListItem(dr("FolioGarantia").ToString, dr("CveFolioGarantia").ToString))
|
||||
DdlFolioGarantia.SelectedValue = dr("CveFolioGarantia").ToString
|
||||
End If
|
||||
|
||||
'CargaDetalle
|
||||
If ObjCompra.GetCompraDetalle(CveCompra, UsuarioActual.CveEmpresa) Then
|
||||
TmpDT = ObjCompra.DtResultados
|
||||
@@ -5467,7 +5472,7 @@ Partial Class Compras_Compras
|
||||
' If DdlMoneda.SelectedValue.ToEntero = 1 Or (DdlMoneda.SelectedValue.ToEntero > 1 AndAlso GlobalTipoCambio(TxtFecha.Text.ToDate) > 0) Then
|
||||
|
||||
''ALMACEN CONSIGNACION
|
||||
If CveConsignacion > 0 Then
|
||||
If CveConsignacion > 0 AndAlso CveCompraRefacturacion <= 0 Then
|
||||
|
||||
'actualizamos cvecompraconsignacion
|
||||
For Each gvr As GridViewRow In GvInv.Rows
|
||||
@@ -5590,7 +5595,7 @@ Partial Class Compras_Compras
|
||||
Dim indice = 0
|
||||
Dim ImporteConcepto As Decimal = 0
|
||||
|
||||
If DdlTipoComprobante.SelectedValue = "Fac" Then
|
||||
If DdlTipoComprobante.SelectedValue = "Fac" AndAlso CveCompraRefacturacion <= 0 Then
|
||||
|
||||
For Each tCveAlmacen As Integer In ListAlmacenes
|
||||
If GvInv.Rows(indice).FCDropDownList("DdlRecibirInv").SelectedValue = "1" Then
|
||||
@@ -8137,9 +8142,9 @@ Partial Class Compras_Compras
|
||||
End If
|
||||
|
||||
If UsuarioActual.TienePermisoProceso(354) Then 'visualizar la póliza al registros
|
||||
Msg.AppendFormat("<br/><br/><a Class=""Texto"" target='_blank' href=""/Contabilidad/RegPrePolizaS.aspx?CvePrePoliza={0}"">Ver Póliza</a>. ", CvePrePoliza)
|
||||
Msg.AppendFormat("<br/><br/><a Class=""Texto"" target='_blank' href=""/Contabilidad/RegPrePolizaS.aspx?CvePrePoliza={0}"">Ver Póliza</a> ", CvePrePoliza)
|
||||
Dim TempParametros = Encripta(String.Format("OP=PREPO&CvePrePoliza={0}", CvePrePoliza))
|
||||
Msg.Append($" <a class='Texto' target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={TempParametros}""> Imprimir PDF <i class='fa fa-file-pdf-o' aria-hidden='true'></i></a>")
|
||||
Msg.Append($" <a class='Texto' target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={TempParametros}""> <i class='fa fa-file-pdf-o' aria-hidden='true'></i> Imprimir </a>")
|
||||
|
||||
|
||||
|
||||
@@ -8736,6 +8741,7 @@ Partial Class Compras_Compras
|
||||
Pago.OtroGastoIngreso = ImporComisionAnticipo
|
||||
Pago.CveMonedaPago = CveMonedaAnticipo
|
||||
Pago.TCPago = TipoCambioAnt
|
||||
Pago.CveProveedor = gvr.DataKey("CveProveedor").ToEntero
|
||||
|
||||
Select Case gvr.DataKey("TipoDocto")
|
||||
Case "NC", "DEV"
|
||||
@@ -8750,6 +8756,7 @@ Partial Class Compras_Compras
|
||||
CveConceptoCompraComplementaria = 266
|
||||
IdCtaContable = If(CveMonedaAnticipo = 1, CtaProveedorAnticipos, CtaProveedorAnticiposExtranjera)
|
||||
IdCtaContableComp = CtaProveedorAnticiposComplementaria
|
||||
|
||||
'vinculo la compra actual, y no la compra como si fuera nota de credito
|
||||
CveCompraNC = -1
|
||||
CveIE = gvr.DataKey("CveIE").ToEntero
|
||||
@@ -9331,8 +9338,10 @@ Partial Class Compras_Compras
|
||||
PSS.Dispose()
|
||||
End If
|
||||
|
||||
Dim CvePersonal = GvPersonal.Rows(Cont).FCDropDownList("DdlPersonalGv").SelectedValue.ToEntero
|
||||
Dim Referencia = GvPersonal.Rows(Cont).FCTextBox("TxtReferencia").Text
|
||||
Dim CvePersonal As Integer = 0
|
||||
If Cont < GvPersonal.Rows.Count Then CvePersonal = GvPersonal.Rows(Cont).FCDropDownList("DdlPersonalGv").SelectedValue.ToEntero
|
||||
Dim Referencia As String
|
||||
If Cont < GvPersonal.Rows.Count Then Referencia = GvPersonal.Rows(Cont).FCTextBox("TxtReferencia").Text
|
||||
|
||||
Cont = Cont + 1
|
||||
'Si es AF-INSUMO se guarda en CveActivoFIjo
|
||||
@@ -9389,8 +9398,6 @@ Partial Class Compras_Compras
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
Next
|
||||
|
||||
For Each item As String In ClavesBorradas
|
||||
@@ -9411,20 +9418,14 @@ Partial Class Compras_Compras
|
||||
If Not ObjContabilidad.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveEmpresa, UsuarioActual.Empresa, MinFecha, String.Format("{0}-{1}", Serie, Folio), ObjContaAC, pIDPoliza:=ViewState("IdPoliza").ToString.ToEntero) Then
|
||||
Retorno = False
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Else
|
||||
Retorno = False
|
||||
End If
|
||||
|
||||
'Retorno = True
|
||||
'Alert("La Compra se actualizó correctamente.")
|
||||
Else
|
||||
|
||||
If IdPoliza > 0 Then
|
||||
If Not ObjContabilidad.UpdatePrePolizasDetalleBloquear(CvePrePoliza, True) Then
|
||||
Retorno = False
|
||||
@@ -9434,7 +9435,6 @@ Partial Class Compras_Compras
|
||||
Retorno = False
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
@@ -9683,9 +9683,27 @@ Partial Class Compras_Compras
|
||||
|
||||
|
||||
'OBTIENE METODO DE CONTABILIZACIÓN AL GUARDAR
|
||||
Dim ConceptoContabilizacionAlmacen = 0
|
||||
Dim CveConceptoContableAlmacen = 0
|
||||
If ObjCompra.GetCompras(CveCompra, "-1", "-1", -1, -1, UsuarioActual.CveEmpresa) AndAlso ObjCompra.DtResultados.Rows.Count > 0 Then
|
||||
ConceptoContabilizacionAlmacen = ObjCompra.DtResultados.FiltroPrimeroValor("CveConceptoContableAlmacen").ToEntero
|
||||
CveConceptoContableAlmacen = ObjCompra.DtResultados.FiltroPrimeroValor("CveConceptoContableAlmacen").ToEntero
|
||||
|
||||
If CveConceptoContableAlmacen = 0 Then
|
||||
If Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") Then
|
||||
If (CveImportacion > 0 Or CveFlete > 0) Then
|
||||
CveConceptoContableAlmacen = CveConceptoContableAlmacen
|
||||
Else
|
||||
CveConceptoContableAlmacen = 205
|
||||
End If
|
||||
If OCVinculada AndAlso DdlOCVinculaInv.Visible AndAlso Not (CveImportacion > 0 Or CveFlete > 0) Then
|
||||
CveConceptoContableAlmacen = DdlOCVinculaInv.SelectedValue.ToEntero
|
||||
End If
|
||||
If UsuarioActual.CveEmpresa.Contiene(72, 80, 140, 141, 152) And Not (CveImportacion > 0 Or CveFlete > 0) Then 'se comento, RMF. 2020.08.19, no le hallo sentido
|
||||
CveConceptoContableAlmacen = 205
|
||||
End If
|
||||
Else
|
||||
CveConceptoContableAlmacen = 225
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
'AF
|
||||
@@ -9714,7 +9732,7 @@ Partial Class Compras_Compras
|
||||
|
||||
'COSTO ALMACEN
|
||||
Dim DtAlmacenes = GlobalDTAlmacen(UsuarioActual.CveEmpresa)
|
||||
If UsuarioActual.Empresa.UsaInventarios AndAlso Not UsuarioActual.Empresa.Funcionalidad(126) = "1" And ConceptoContabilizacionAlmacen = 0 Or DdlTipoCompra.SelectedValue.ToEntero = 10 Then
|
||||
If UsuarioActual.Empresa.UsaInventarios AndAlso Not UsuarioActual.Empresa.Funcionalidad(126) = "1" And CveConceptoContableAlmacen = 0 Or DdlTipoCompra.SelectedValue.ToEntero = 10 Then
|
||||
DT = TmpDT.FiltraParametros("ISNULL(TipoAF,0) <> 2 AND ISNULL(CveAlmacen,0) > 0", "", {"CveAlmacen"})
|
||||
'RECORREMOS PARA DETECTAR LA MODALIDAD DEL ALMACEN, EN CASO DE SER SOLO EXISTENCIA LIMPIAMOS CVEALMACEN
|
||||
|
||||
@@ -9755,11 +9773,11 @@ Partial Class Compras_Compras
|
||||
|
||||
|
||||
'INV [MERCANCIA RECIBIDA POR ADELANTADO (OC) | MERCANCIA PENDIENTE POR RECIBIR (COMPRA) ]
|
||||
If DdlTipoCompra.SelectedValue.ToEntero <> 10 AndAlso UsuarioActual.Empresa.UsaInventarios And Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" And ConceptoContabilizacionAlmacen.Contiene(176, 205) Then
|
||||
If DdlTipoCompra.SelectedValue.ToEntero <> 10 AndAlso UsuarioActual.Empresa.UsaInventarios And Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" And CveConceptoContableAlmacen.Contiene(176, 205) Then
|
||||
importeMovimiento = TmpDT.SUM("Total", $"ISNULL(TipoAF,0) <> 2 AND ISNULL(AplicaCostoIndirecto,0) <> 1 AND CveTipoPS = 2").ToString.ToDecimal
|
||||
importeMN = importeMovimiento * tipoCambioActual * Multiplicador
|
||||
|
||||
If ObjConta.GetRetCuenta(ConceptoContabilizacionAlmacen, UsuarioActual.CveEmpresa) Then
|
||||
If ObjConta.GetRetCuenta(CveConceptoContableAlmacen, UsuarioActual.CveEmpresa) Then
|
||||
If ObjConta.DtResultados.Rows.Count > 0 Then
|
||||
IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero
|
||||
End If
|
||||
@@ -9767,7 +9785,7 @@ Partial Class Compras_Compras
|
||||
|
||||
If importeMovimiento <> 0 Then
|
||||
Concepto = $"{NombreProveedor} {TxtSerie.Text} - {TxtFolio.Text}"
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContabilizacionAlmacen, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento)) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, CveConceptoContableAlmacen, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento)) Then
|
||||
ErrorPrepoliza = True
|
||||
End If
|
||||
End If
|
||||
@@ -9776,11 +9794,11 @@ Partial Class Compras_Compras
|
||||
|
||||
'NC CON PRODUCTOS - CUENTA PUENTE
|
||||
|
||||
If UsuarioActual.Empresa.UsaInventarios And Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" And ConceptoContabilizacionAlmacen.Contiene(225) Then
|
||||
If UsuarioActual.Empresa.UsaInventarios And Not DdlTipoComprobante.SelectedValue.Contiene("Ant") And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" And CveConceptoContableAlmacen.Contiene(225) Then
|
||||
importeMovimiento = TmpDT.SUM("Total", $"ISNULL(TipoAF,0) <> 2 AND ISNULL(AplicaCostoIndirecto,0) <> 1 AND CveTipoPS = 2").ToString.ToDecimal
|
||||
importeMN = importeMovimiento * tipoCambioActual * Multiplicador
|
||||
|
||||
If ObjConta.GetRetCuenta(ConceptoContabilizacionAlmacen, UsuarioActual.CveEmpresa) Then
|
||||
If ObjConta.GetRetCuenta(CveConceptoContableAlmacen, UsuarioActual.CveEmpresa) Then
|
||||
If ObjConta.DtResultados.Rows.Count > 0 Then
|
||||
IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero
|
||||
End If
|
||||
@@ -9788,7 +9806,7 @@ Partial Class Compras_Compras
|
||||
|
||||
If importeMovimiento <> 0 Then
|
||||
Concepto = $"{NombreProveedor} {TxtSerie.Text} - {TxtFolio.Text}"
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContabilizacionAlmacen, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento)) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, CveConceptoContableAlmacen, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento)) Then
|
||||
ErrorPrepoliza = True
|
||||
End If
|
||||
End If
|
||||
@@ -9811,7 +9829,7 @@ Partial Class Compras_Compras
|
||||
|
||||
If DdlTipoCompra.SelectedValue.ToEntero <> 10 Then
|
||||
'QUITA 1-[MERCANCIA RECIBIDA POR ADELANTADO (OC) | MERCANCIA PENDIENTE POR RECIBIR (COMPRA)] 2-[NC CON PRODUCTOS]
|
||||
If UsuarioActual.Empresa.UsaInventarios And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" And ConceptoContabilizacionAlmacen > 0 Then
|
||||
If UsuarioActual.Empresa.UsaInventarios And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" And CveConceptoContableAlmacen > 0 Then
|
||||
DT = DT.FiltraParametros("CveTipoPS <> 2")
|
||||
End If
|
||||
End If
|
||||
@@ -9958,14 +9976,14 @@ Partial Class Compras_Compras
|
||||
Next
|
||||
End If
|
||||
|
||||
'VALIDAR PREPOLIZA DE COMPRA
|
||||
If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, 4) Then
|
||||
If ObjConta.ValorPolizaDescuadre > 0 Then
|
||||
ErrorPrepoliza = True
|
||||
Alert("Error en validacion de prepoliza cuadre", TipoMensaje.MsgAdvertencia)
|
||||
GuardaLogAD($"Compras/Compras-Actualizar | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
|
||||
End If
|
||||
End If
|
||||
''VALIDAR PREPOLIZA DE COMPRA
|
||||
'If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, 4) Then
|
||||
' If ObjConta.ValorPolizaDescuadre > 0 Then
|
||||
' ErrorPrepoliza = True
|
||||
' Alert("Error en validacion de prepoliza cuadre", TipoMensaje.MsgAdvertencia)
|
||||
' GuardaLogAD($"Compras/Compras-Actualizar | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
|
||||
' End If
|
||||
'End If
|
||||
|
||||
If Not ErrorPrepoliza Then
|
||||
Retorno = True
|
||||
@@ -20016,7 +20034,7 @@ Partial Class Compras_Compras
|
||||
'Agrupa los CvePS iguales y suma sus cantidades
|
||||
For Each row In TmpDT.AsEnumerable()
|
||||
Dim cvePS As Integer = row.Field(Of Integer)("CvePS")
|
||||
Dim cantidad As Decimal = row.Field(Of Decimal)("Cantidad")
|
||||
Dim cantidad As Decimal = row("Cantidad").Tostring.ToDecimal
|
||||
If ExistenciasPSFactura.ContainsKey(cvePS) Then
|
||||
ExistenciasPSFactura(cvePS) += cantidad
|
||||
Else
|
||||
@@ -20731,39 +20749,30 @@ Partial Class Compras_Compras
|
||||
|
||||
End Sub
|
||||
|
||||
'Private Function ObtConceptoContableProvisionCompra(CveTipoConcepto As Integer, TipoDocto As String, CveMoneda As Integer, Optional EsComplementaria As Boolean = False) As Integer
|
||||
' Dim Retorno As Integer = -1
|
||||
|
||||
' 'If CveTipoConcepto = 1 Then ''PROVEEDOR
|
||||
' If EsComplementaria Then
|
||||
' Retorno = If(TipoDocto = "Fac", 201, 234)
|
||||
' Return Retorno
|
||||
' End If
|
||||
' If CveMoneda = 1 Then
|
||||
' Retorno = If(TipoDocto = "Fac", 5, 18)
|
||||
' Else
|
||||
' Retorno = If(TipoDocto = "Fac", 311, 341)
|
||||
' End If
|
||||
' Else ''ACREEDOR
|
||||
' If EsComplementaria Then
|
||||
' Retorno = If(TipoDocto = "Fac", -1, -1)
|
||||
' Return Retorno
|
||||
' End If
|
||||
' If CveMoneda = 1 Then
|
||||
' Retorno = If(TipoDocto = "Fac", 305, 323)
|
||||
' Else
|
||||
' Retorno = If(TipoDocto = "Fac", 306, 343)
|
||||
' End If
|
||||
' End If
|
||||
|
||||
' Return Retorno
|
||||
|
||||
'End Function
|
||||
|
||||
|
||||
|
||||
Protected Sub BtnFolioGarantiaRestantes_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Using ObjAcum As New ClsAcumuladores
|
||||
If ObjAcum.GetFoliosGarantiasDetalleDisponibles(DdlFolioGarantia.SelectedValue.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa) Then
|
||||
Dim dtt As DataTable = ObjAcum.DtResultados.FiltraParametros("CantidadDisponible > 0")
|
||||
Dim Porcentaje As Decimal = TmpDT.MAX("IVAPorcentaje").ToDecimal
|
||||
Dim tCveSub As Integer = TmpDT.MAX("CveSubProyecto").ToEntero
|
||||
Dim tCveTipoGasto As Integer = TmpDT.MAX("CveTipoGasto").ToEntero
|
||||
Dim Total As Decimal = TmpDT.SUMD("Total")
|
||||
For Each drr As DataRow In TmpDT.Rows
|
||||
ClavesBorradas.Add(drr("CveCompraDetalle").ToString)
|
||||
Next
|
||||
TmpDT.Clear()
|
||||
For Each dr As DataRow In dtt.Rows
|
||||
Dim pu As Decimal = Total / dtt.SUMD("CantidadDisponible")
|
||||
Dim cantidad As Decimal = dr("CantidadDisponible").ToString.ToDecimal
|
||||
AddPS(cantidad, dr("CveUM").ToString.ToEntero, "", dr("CveClasificacion").ToString.ToEntero, "", dr("CvePS").ToString.ToEntero, dr("PS").ToString, 2, tCveSub.ToString, "SE", "SE", "", "", pu, Total, Porcentaje, 0, 0, 0, 0, 0, PorcentajeIVA:=Porcentaje, TCalculaTotales:=True, CveTipoGasto:=tCveTipoGasto)
|
||||
Next
|
||||
AddPS2()
|
||||
|
||||
End If
|
||||
End Using
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
|
||||
|
||||
@@ -4276,11 +4276,12 @@ Partial Class Compras_eFacturas
|
||||
Alert($"PDF Error se genero nulo", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
CargaDatos()
|
||||
|
||||
Catch ex As Exception
|
||||
Alert($"PDF Error {ex.Message} -- > {ex.StackTrace}", TipoMensaje.MsgAdvertencia)
|
||||
End Try
|
||||
|
||||
Alert("PDF Finaliza", TipoMensaje.MsgAdvertencia)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -922,7 +922,7 @@ Partial Class RepCxCDetalle
|
||||
|
||||
Dim Filtro As String = $"{Cliente}{Sucursal}{Grupo}{Vendedor}{FechaIn}{FechaFn}{Registro}{Responsable}{TipoDocto}{EstatusCob}{FVI}{FVF}{ClasificacionCli}{CorteA}"
|
||||
|
||||
ExportToExcelGembox(GvDatos, "ReporteCxCDetalle", UsuarioActual, "REPORTE DE CUENTAS POR COBRAR DEL CLIENTE CON DETALLE", DatoTituloExtra:=$"", DatosFiltros:=Filtro)
|
||||
GvDatos.ExportToExcelGembox("ReporteCxCDetalle", UsuarioActual, "REPORTE DE CUENTAS POR COBRAR DEL CLIENTE CON DETALLE", DatoTituloExtra:=$"", DatosFiltros:=Filtro)
|
||||
'GvDatos.ExportToExcelG("ReporteCxCDetalle", "REPORTE DE CUENTAS POR COBRAR DEL CLIENTE CON DETALLE", UsuarioActual, Filtro)
|
||||
|
||||
'SpreadsheetInfo.SetLicense(SerialGemBoxSpreadsheet())
|
||||
|
||||
@@ -3941,12 +3941,12 @@ Partial Class Inventarios_EntradasSalidas
|
||||
IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero
|
||||
End If
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, ValorInventario, Concepto, tCveConcepto, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=ValorInventario, CveSubProyecto:=tCveSubProyecto) Then
|
||||
ErrorMovInv = True
|
||||
Exit For
|
||||
End If
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, ValorInventario, Concepto, tCveConcepto, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=ValorInventario, CveSubProyecto:=tCveSubProyecto, Contabilizable:=Contabilizable) Then
|
||||
ErrorMovInv = True
|
||||
Exit For
|
||||
End If
|
||||
|
||||
Next
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -3,6 +3,11 @@
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style>
|
||||
#aDivCodigoSeriePS:hover{
|
||||
color:black;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
|
||||
<li>
|
||||
@@ -454,51 +459,62 @@
|
||||
|
||||
<%-- GV DATOS --%>
|
||||
<div class="portlet light smmallpadding bordered ">
|
||||
<div class="portlet-title">
|
||||
<div class="portlet-title xspadding">
|
||||
<div class="caption font-green">
|
||||
<i class="icon-pin font-green"></i>
|
||||
<span class="caption-subject bold uppercase">Entrada a Inventario</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
<div class="btn-group">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="collapse"></a>
|
||||
|
||||
|
||||
<a id="aDivCodigoSeriePS">
|
||||
<asp:UpdatePanel runat="server" RenderMode="Inline" ID="UpCodigoSeriePS">
|
||||
<ContentTemplate>
|
||||
|
||||
<div runat="server" id="DivCodigoSeriePS" visible="false">
|
||||
<table class="d-inline-block">
|
||||
<tr>
|
||||
<td><i class="fa fa-barcode fa-5x" style="font-size: 20px; margin-top: 4px;" aria-hidden="true" data-toggle="tooltip" title="Código Barras"></i></td>
|
||||
<td>
|
||||
<asp:Panel ID="PanelCodigo" runat="server" DefaultButton="BtnCodigoPS">
|
||||
<asp:TextBox ID="TxtCodigoPS" Width="140px" ClientIDMode="Static" Text="" runat="server" />
|
||||
<asp:Button Text="" ID="BtnCodigoPS" OnClick="BtnCodigoPS_Click" Style="display: none" runat="server" />
|
||||
</asp:Panel>
|
||||
</td>
|
||||
|
||||
<td runat="server" visible="false" id="TdSeriePS">
|
||||
<asp:Panel ID="PanelSerie" runat="server" DefaultButton="BtnSeriePS">
|
||||
<asp:TextBox ID="TxtSeriePS" Text="" runat="server" />
|
||||
<asp:Button Text="" ID="BtnSeriePS" OnClick="BtnSeriePS_Click" Style="display: none" runat="server" />
|
||||
</asp:Panel>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</a>
|
||||
<a href="javascript:;" class="collapse d-inline-block" data-original-title="" title=""></a>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body form-horizontal form-row-sepe formnombottom">
|
||||
|
||||
<asp:UpdatePanel ID="UPInv" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="row" runat="server" id="DivCodigoSeriePS" clientidmode="Static" visible="false">
|
||||
<div class="col-md-4 pull-right">
|
||||
<table style="float: right;">
|
||||
<tr>
|
||||
<%-- <td>
|
||||
<asp:TextBox Width="35px" Text="1" ID="TxtCantidadCodigoBarras" runat="server" />
|
||||
</td>--%>
|
||||
<td><i class="fa fa-barcode" style="font-size: 1.8em; margin-top: 8px;" aria-hidden="true" data-toggle="tooltip" title="Código Barras"></i></td>
|
||||
<td>
|
||||
<asp:Panel ID="PanelCodigo" runat="server" DefaultButton="BtnCodigoPS">
|
||||
<asp:TextBox ID="TxtCodigoPS" Width="140px" ClientIDMode="Static" Text="" runat="server" />
|
||||
<asp:Button Text="" ID="BtnCodigoPS" OnClick="BtnCodigoPS_Click" Style="display: none" runat="server" />
|
||||
</asp:Panel>
|
||||
</td>
|
||||
<td runat="server" visible="false" id="TdSeriePS">
|
||||
<asp:Panel ID="PanelSerie" runat="server" DefaultButton="BtnSeriePS">
|
||||
<asp:TextBox ID="TxtSeriePS" Text="" runat="server" />
|
||||
<asp:Button Text="" ID="BtnSeriePS" OnClick="BtnSeriePS_Click" Style="display: none" runat="server" />
|
||||
</asp:Panel>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
|
||||
<asp:GridView ID="GvInv" runat="server" EmptyDataText="Aun no hay registros." AutoGenerateColumns="False" ShowFooter="True" ShowHeader="true" ShowHeaderWhenEmpty="True"
|
||||
DataKeyNames="EntregaDirecta,Consec,CodigoBarras,CvePS,CveUM,PU,CantidadC,CantidadF,UM,PS,CveCompraDetalle,CveOrdenCompraDetalle,PUExtranjero,AplicaSerieLote,CveClasificacion,Codigo,CveVentaDetalle,CostoIndirecto,CveTamaño,Lote,AplicaSeccion,AplicaLote,AplicaCaducidad,AplicaSerie" HeaderStyle-CssClass="Titulos" RowStyle-Height="25px" CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn" data-heighterror="450" data-freezerows="1" GridLines="None">
|
||||
|
||||
@@ -475,7 +475,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
CargaPermisos()
|
||||
If UsuarioActual.CveEmpresa.Contiene(72, 80) Then DdlAlmacen.AutoPostBack = True
|
||||
Dim PermisoEspecialCambioFecha As Boolean = False
|
||||
If UsuarioActual.CveUsuario = 1937 Then PermisoEspecialCambioFecha = True
|
||||
If UsuarioActual.CveUsuario.Contiene(100, 1937) Then PermisoEspecialCambioFecha = True
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(281).ToEntero = 1 AndAlso Not PermisoEspecialCambioFecha Then
|
||||
|
||||
@@ -1478,7 +1478,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
e.Row.FCCheckBox("cbInv").Enabled = True
|
||||
|
||||
If UsuarioActual.TienePermisoProceso(345) Then 'carga la cantidad con el rol AD
|
||||
e.Row.FCTextBox("TbCantidadF").Text = e.Row.DBCampo("CantidadF").FormatoNumero
|
||||
e.Row.FCTextBox("TbCantidadF").Text = e.Row.DBCampo("CantidadF").ToDecimal().ToString("{#,###.##}")
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -1029,7 +1029,8 @@
|
||||
<%-- 8 --%>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlIva" runat="server" Text='<%# If(Not IsDBNull(Eval("IVA")), If(Eval("IVA").ToString <> "0", String.Concat(Eval("IVA", "{0:#,##0.00####}"), "<br>", Eval("IVAPorcentaje", "{0:0.### %}")), ""), "") %>'></asp:Literal>
|
||||
<%--<asp:Literal ID="LtlIva" runat="server" Text='<%# If(Not IsDBNull(Eval("IVA")), If(Eval("IVA").ToString <> "0", String.Concat(Eval("IVA", "{0:#,##0.00####}"), "<br>", Eval("IVAPorcentaje", "{0:0.### %}")), ""), "") %>'></asp:Literal>--%>
|
||||
<asp:Literal ID="LtlIva" runat="server" Text='<%# If(Not IsDBNull(Eval("IVA")), If(Eval("IVA").ToString <> "0", String.Concat(Eval("IVA", "{0:#,##0.00####}"), "<br>", If(Not IsDBNull(Eval("IVAPorcentaje")) AndAlso Decimal.Parse(Eval("IVAPorcentaje").ToString) > 0.10001, "16.00 %", Eval("IVAPorcentaje", "{0:0.### %}"))), ""), "") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Right" />
|
||||
</asp:TemplateField>
|
||||
|
||||
@@ -1383,6 +1383,9 @@ Partial Class Sistemas_UsuarioDetalle
|
||||
GlobalDTAlmacenUsuarios(-1, UsuarioActual.CveEmpresa) = Nothing
|
||||
GlobalDTUsuarioResponsable(UsuarioActual.CveEmpresa) = Nothing
|
||||
GlobalDTUsuarios(CveEmpresa:=UsuarioActual.CveEmpresa) = Nothing
|
||||
If UsuarioActual.CveUsuario = 100 Then
|
||||
Alert("Globals Recargados")
|
||||
End If
|
||||
'If ObjUsuarios.GetUsuariosEmpresas(-1, UsuarioActual.CveEmpresa) Then
|
||||
' Application("GlobalDTUsuarios") = ObjUsuarios.DtResultados
|
||||
' Application("GlobalDTUsuarioResponsable") = ObjUsuarios.DtResultados.FiltraParametros("ProveedoresResponsables > 0")
|
||||
|
||||
@@ -404,7 +404,7 @@ public partial class Ventas_RepLineasAdicionales : ClsPaginas
|
||||
int CveLineaAdicionalActualizarEstatus = GvRow.DataKey("CveLineaAdicional").ToString().ToEntero();
|
||||
int CveVenta = GvRow.DataKey("CveVenta").ToString().ToEntero();
|
||||
|
||||
bool errorCambioEstatus = false;
|
||||
bool errorCambioEstatus = false;
|
||||
//int cveestatus = e.CommandArgument.ToEntero() + 2; //pasar al siguiente estatus
|
||||
|
||||
ClsVentas objVentas = new ClsVentas();
|
||||
|
||||
@@ -330,7 +330,7 @@
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" data-sort="true" Width="99%" DataKeyNames="CveVenta,TipoDocumento,SerieFolio" EmptyDataText="No se encontraron Ventas con los filtros especificados" ToolTip="Listado de Ventas" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" Style="text-align: center;" GridLines="None">
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" data-sort="true" Width="99%" DataKeyNames="CveVenta,TipoDocumento,SerieFolio" EmptyDataText="No se encontraron Ventas con los filtros especificados" ToolTip="Listado de Ventas" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Tipo Docto">
|
||||
<ItemTemplate>
|
||||
@@ -344,7 +344,7 @@
|
||||
<asp:HiddenField ID="HdnFolio" runat="server" Value='<%# Eval("SerieFolio") %>' />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Fecha Docto" ItemStyle-HorizontalAlign="center">
|
||||
<asp:TemplateField HeaderText="Fecha" ItemStyle-HorizontalAlign="center">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("Fecha", "{0:d}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
@@ -354,12 +354,12 @@
|
||||
<asp:Literal ID="LtlCliente" runat="server" Text='<%# Eval("Nombre", "{0}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="SubTotal">
|
||||
<asp:TemplateField HeaderText="SubTotal" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlSubTotal" runat="server" Text='<%# Eval("SubTotal", "{0:N2}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Descuento" Visible="True">
|
||||
<asp:TemplateField HeaderText="Descuento" Visible="True" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlDescuento" runat="server" Text='<%# Eval("Descuento", "{0:N2}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
@@ -369,37 +369,37 @@
|
||||
<asp:Literal ID="LtlMotivoDescuento" runat="server" Text='<%# Eval("MotivoDescuento", "{0}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Amortización">
|
||||
<asp:TemplateField HeaderText="Amortización" Visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlAmortizacion" runat="server" Text='<%# Eval("Amortizacion", "{0:N2}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="IVA">
|
||||
<asp:TemplateField HeaderText="IVA" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlIVA" runat="server" Text='<%# Eval("IVA", "{0:N2}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="IEPS">
|
||||
<asp:TemplateField HeaderText="IEPS" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlIEPS" runat="server" Text='<%# Eval("IEPS", "{0:N2}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Ret. IVA" Visible="false">
|
||||
<asp:TemplateField HeaderText="Ret. IVA" Visible="false" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlRetIVA" runat="server" Text='<%# Eval("RetIVA", "{0:N2}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Ret. ISR" Visible="false">
|
||||
<asp:TemplateField HeaderText="Ret. ISR" Visible="false" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlRetISR" runat="server" Text='<%# Eval("RetISR", "{0:N2}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Imp. Locales" Visible="false">
|
||||
<asp:TemplateField HeaderText="Imp. Locales" Visible="false" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlImpLocales" runat="server" Text='<%# Eval("TotalImpuestos", "{0:N2}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Total">
|
||||
<asp:TemplateField HeaderText="Total" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlTotal" runat="server" Text='<%# Eval("Total", "{0:N2}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
@@ -444,7 +444,7 @@
|
||||
<asp:Literal ID="LtlVendedor" runat="server" Text='<%# Eval("Vendedor", "{0}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Estatus Factura">
|
||||
<asp:TemplateField HeaderText="Estatus">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlEstatusFactura" runat="server" Text='<%# Eval("EstatusFactura", "{0}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
@@ -505,8 +505,6 @@
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<HeaderStyle CssClass="Titulos" />
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
@@ -557,8 +555,6 @@
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<HeaderStyle CssClass="Titulos" />
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
@@ -289,21 +289,14 @@ Partial Class RepVentaDetalle
|
||||
|
||||
Private Sub CargaCombos()
|
||||
CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, LblProyecto, LblSubProyecto, divProyecto:=DivProyecto)
|
||||
CargaClientes()
|
||||
'DdlClientes.setEsWebService(False)
|
||||
|
||||
'Dim ObjClientes As New ClsClientes
|
||||
'If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then
|
||||
' DdlClientes.DataSource = ObjClientes.DtResultados
|
||||
'Else
|
||||
' DdlClientes.DataSource = Nothing
|
||||
'End If
|
||||
'ObjClientes.Dispose()
|
||||
'DdlClientes.DataBind()
|
||||
|
||||
'DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
'Vendedor
|
||||
CargaClientes()
|
||||
|
||||
|
||||
'DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
txtFechaI.Text = Now.FirstDayOfMonth.ToShortDateString
|
||||
txtFechaF.Text = Now.LastDayOfMonth.ToShortDateString
|
||||
|
||||
'Vendedor
|
||||
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
|
||||
DdlVendedor.DataBind()
|
||||
DdlVendedor.Items.Insert(0, New ListItem("Sin Vendedor", "-2"))
|
||||
@@ -493,23 +486,23 @@ Partial Class RepVentaDetalle
|
||||
e.Row.FCLiteral("LtlFacturaCotizacion").Text = "<a class=""Texto"" href=""/Ventas/Ventas.aspx?CveVenta=" & e.Row.DBCampo("CveVentaPadre") & """>" & e.Row.DBCampo("FolioVenta") & "</a>"
|
||||
End If
|
||||
|
||||
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Center
|
||||
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Center
|
||||
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Center
|
||||
e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Left
|
||||
e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Right
|
||||
e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Right
|
||||
e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Right
|
||||
e.Row.Cells(7).HorizontalAlign = HorizontalAlign.Right
|
||||
e.Row.Cells(8).HorizontalAlign = HorizontalAlign.Right
|
||||
e.Row.Cells(9).HorizontalAlign = HorizontalAlign.Right
|
||||
e.Row.Cells(10).HorizontalAlign = HorizontalAlign.Right
|
||||
e.Row.Cells(11).HorizontalAlign = HorizontalAlign.Right
|
||||
e.Row.Cells(12).HorizontalAlign = HorizontalAlign.Center
|
||||
e.Row.Cells(13).HorizontalAlign = HorizontalAlign.Left
|
||||
e.Row.Cells(14).HorizontalAlign = HorizontalAlign.Center
|
||||
e.Row.Cells(15).HorizontalAlign = HorizontalAlign.Center
|
||||
e.Row.Cells(20).HorizontalAlign = HorizontalAlign.Left
|
||||
'e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Center
|
||||
'e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Center
|
||||
'e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Center
|
||||
'e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Left
|
||||
'e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Right
|
||||
'e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Right
|
||||
'e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Right
|
||||
'e.Row.Cells(7).HorizontalAlign = HorizontalAlign.Right
|
||||
'e.Row.Cells(8).HorizontalAlign = HorizontalAlign.Right
|
||||
'e.Row.Cells(9).HorizontalAlign = HorizontalAlign.Right
|
||||
'e.Row.Cells(10).HorizontalAlign = HorizontalAlign.Right
|
||||
'e.Row.Cells(11).HorizontalAlign = HorizontalAlign.Right
|
||||
'e.Row.Cells(12).HorizontalAlign = HorizontalAlign.Center
|
||||
'e.Row.Cells(13).HorizontalAlign = HorizontalAlign.Left
|
||||
'e.Row.Cells(14).HorizontalAlign = HorizontalAlign.Center
|
||||
'e.Row.Cells(15).HorizontalAlign = HorizontalAlign.Center
|
||||
'e.Row.Cells(20).HorizontalAlign = HorizontalAlign.Left
|
||||
|
||||
|
||||
If e.Row.DBCampo("SubTotal").ToDouble = 0 Then e.Row.FCLiteral("LtlSubTotal").Text = "-"
|
||||
|
||||
@@ -135,7 +135,7 @@ Partial Class Ventas_RepVentas
|
||||
DdlGrupo.Items.Insert(2, New ListItem("Año/Mes", "3"))
|
||||
DdlGrupo.Items.Insert(3, New ListItem("Fecha", "4"))
|
||||
DdlGrupo.Items.Insert(4, New ListItem("Cliente", "5"))
|
||||
DdlGrupo.Items.Insert(4, New ListItem("SubProyecto", "6"))
|
||||
DdlGrupo.Items.Insert(4, New ListItem(LblSubProyecto.Text, "6"))
|
||||
DdlGrupo.Items.Insert(5, New ListItem("Corte", "16"))
|
||||
DdlGrupo.Items.Insert(6, New ListItem("Vendedor", "7"))
|
||||
DdlGrupo.Items.Insert(7, New ListItem("Usuario", "8"))
|
||||
|
||||
@@ -242,8 +242,8 @@
|
||||
OnClick="LnkAplicarRNCDevolucion_Click" />
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LBAplicaDevolucion" runat="server" CausesValidation="False" Text="<i class='fa fa-pencil'></i> Aplicar Devolución"
|
||||
data-toggle="modal" data-target="#DivAplicaDevolucion" Visible="false" />
|
||||
<asp:LinkButton ID="LBAplicaDevolucion" runat="server" CausesValidation="False" Text="<i class='fa fa-pencil'></i> Aplicar Devolución" OnClick="LBAplicaDevolucion_Click"
|
||||
Visible="false" />
|
||||
</li>
|
||||
<%--TERMINA: CANCELAR - NC - DEVOLUCION [NEW]--%>
|
||||
|
||||
@@ -1675,7 +1675,12 @@
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
|
||||
<ajax:TabPanel ID="TabAlmacen" runat="server" HeaderText="Almacén">
|
||||
<ajax:TabPanel ID="TabAlmacen" runat="server">
|
||||
<HeaderTemplate>
|
||||
<span onclick="CargaMovimientosInventario();" id="spanAlmacen" runat="server">
|
||||
Almacen
|
||||
</span>
|
||||
</HeaderTemplate>
|
||||
<ContentTemplate>
|
||||
|
||||
<%--<asp:UpdatePanel ID="UpInvDev" UpdateMode="Conditional" runat="server">
|
||||
@@ -1719,6 +1724,7 @@
|
||||
|
||||
<asp:UpdatePanel ID="UpINV" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:Button ID="BtnCargarInventario" runat="server" ClientIDMode="Static" Text="" Style="display: none;" OnClick="BtnCargarInventario_Click" />
|
||||
<div class="portlet box purpleAlmacen" id="DivSalidaAlmacen" runat="server">
|
||||
<div class="portlet-title">
|
||||
<div class="caption">
|
||||
@@ -9402,6 +9408,7 @@
|
||||
$('#C_LblDiferenciaCajaBloqueo').val(FormatoNumero(total));
|
||||
}
|
||||
|
||||
|
||||
function CalculaTotalPagoContado() {
|
||||
|
||||
var totalEfectivo = ToDouble($get("TxtImporteEfectivo").value);
|
||||
@@ -9822,6 +9829,10 @@
|
||||
$('#BtnAplicaNuevaNC').click();
|
||||
}
|
||||
|
||||
function CargaMovimientosInventario() {
|
||||
$('#BtnCargarInventario').click();
|
||||
}
|
||||
|
||||
$('.DdlPS').on("select2:open", function (e) { $('.select2-container.select2-container--default .select2-dropdown .select2anothertable').remove(); });
|
||||
$('.DdlPSPyME').on("select2:open", function (e) { $('.select2-container.select2-container--default .select2-dropdown .select2anothertable').remove(); });
|
||||
|
||||
|
||||
@@ -600,7 +600,7 @@ Partial Class Ventas
|
||||
Return IfNull(ViewState("MailCC"), "").ToString()
|
||||
End Get
|
||||
End Property
|
||||
Private ReadOnly Property CveVenta As Integer
|
||||
Public ReadOnly Property CveVenta As Integer
|
||||
Get
|
||||
Return ViewState("CveVenta").ToString().ToEntero()
|
||||
End Get
|
||||
@@ -2078,22 +2078,6 @@ Partial Class Ventas
|
||||
ViewState("DiasVencidosCliente") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property VentaSaldoAlmacen As Decimal
|
||||
Get
|
||||
Return ViewState("VentaSaldoAlmacen").ToString().ToDecimal
|
||||
End Get
|
||||
Set(value As Decimal)
|
||||
ViewState("VentaSaldoAlmacen") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property VentaSaldoAlmacenNC As Decimal
|
||||
Get
|
||||
Return IfNull(ViewState("VentaSaldoAlmacenNC"), 0, ViewState("VentaSaldoAlmacenNC").ToString().ToDecimal()).ToString().ToDecimal()
|
||||
End Get
|
||||
Set(value As Decimal)
|
||||
ViewState("VentaSaldoAlmacenNC") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property SeCancelaRemisionProceso As Boolean
|
||||
Get
|
||||
Return CBool(ViewState("SeCancelaRemisionProceso").ToString())
|
||||
@@ -2816,14 +2800,6 @@ Partial Class Ventas
|
||||
'End If
|
||||
|
||||
'CargaDetalle de Almacen
|
||||
If Not LblAlertRefacInv.Visible Then
|
||||
If CveVentaPadre > 0 Then
|
||||
InventarioMov(CveVentaPadre)
|
||||
Else
|
||||
InventarioMov()
|
||||
End If
|
||||
End If
|
||||
|
||||
'PERMISO PARA CANCELAR PEDIDO
|
||||
If GvInv.Rows.Count = 0 Then
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Ped") And Not CveEstatus = 14 Then
|
||||
@@ -2867,6 +2843,15 @@ Partial Class Ventas
|
||||
ViewState("CveOS") = Request("CveOS")
|
||||
CargaOS(CveOS)
|
||||
Else
|
||||
|
||||
'SI ES VENTA NUEVA, NO RECARGAR TAB DE ALMACEN
|
||||
If CveVenta <= 0 Then
|
||||
'REMOVER EVENTO PARA RECARGAR ALMACEN
|
||||
spanAlmacen.Attributes.Remove("onclick")
|
||||
Tab.ActiveTabIndex = 1
|
||||
Updatetabs.Update()
|
||||
End If
|
||||
|
||||
'Modalidad Devoluciones y Refacturacion
|
||||
If Request("CveDevolucion") IsNot Nothing AndAlso IsNumeric(Request("CveDevolucion")) AndAlso Request("CveDevolucion").ToEntero() > 0 Then
|
||||
ViewState("CveDevolucion") = Request("CveDevolucion")
|
||||
@@ -3113,7 +3098,7 @@ Partial Class Ventas
|
||||
'End If
|
||||
|
||||
'CargaDetalle de Almacen
|
||||
InventarioMov()
|
||||
'InventarioMov()
|
||||
|
||||
If ViewState("CveCotizacion").ToString().ToEntero() > 0 Then
|
||||
|
||||
@@ -4594,7 +4579,7 @@ Partial Class Ventas
|
||||
'CARGA DTs DE VENTAS
|
||||
If CveVenta > 0 Then
|
||||
Using ObjVentas As New ClsVentas()
|
||||
If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then
|
||||
If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa, VerificaAlmacen:=False) Then
|
||||
If ObjVentas.DtResultados IsNot Nothing AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
|
||||
DbRowVenta = ObjVentas.DtResultados.Copy().Rows(0)
|
||||
Else
|
||||
@@ -4772,15 +4757,6 @@ Partial Class Ventas
|
||||
ViewState("SaldoVenta") = DbRowVenta("Saldo").ToString()
|
||||
AplicaCancelarRemision = CBool(DbRowVenta("AplicaCancelarRemision").ToString())
|
||||
If AplicaCancelarRemision AndAlso CveEstatus.Contiene(2, 3) AndAlso DdlTipoComprobante.SelectedValue = "Ing" Then DivCanRem.Visible = True
|
||||
VentaSaldoAlmacen = DbRowVenta("SaldoAlmacen").ToString().ToDecimal
|
||||
|
||||
If DbRowVenta("TipoDocto").ToString().Contiene("Rem", "Dev") AndAlso VentaSaldoAlmacen <> 0 Then
|
||||
ChkDevAlm.Checked = True
|
||||
LiDevolucionAlmacen.Visible = True
|
||||
If DbRowVenta("TipoDocto").ToString() = "Dev" Then
|
||||
LblDevAlm.Text = "Salida de almacen"
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
If CveEstatus = 5 Then LbCancelarDocumento.Enabled = False
|
||||
@@ -5673,21 +5649,7 @@ Partial Class Ventas
|
||||
|
||||
ObjUsados.Dispose()
|
||||
|
||||
Dim SaldoAlmacenExA As Decimal = 0
|
||||
'Dim SaldoAlmacenUsados As Decimal = 0
|
||||
|
||||
Using ObjInventarios As New ClsInventarios
|
||||
'VERIFICA SI HACE FALTA DEVOLVER PRODUCTOS Y USADOS EN ESPECIFICO
|
||||
If ObjInventarios.GetSaldoVentaDetalleAlmacen(CveVenta, UsuarioActual.CveEmpresa) Then
|
||||
SaldoAlmacenExA = ObjInventarios.DtResultados.SUMD("SaldoAlmacen", $"CveTipoAlmacen = 10")
|
||||
'SaldoAlmacenUsados = ObjInventarios.DtResultados.SUMD("SaldoAlmacen", $"CveTipoAlmacen = 22")
|
||||
End If
|
||||
End Using
|
||||
|
||||
'Si ya se surtió y recibió
|
||||
If SaldoAlmacenExA > 0 OrElse TmpDT.MAX("CveTipoPS") = "1" Then
|
||||
BtnsFacturar.Visible = True
|
||||
End If
|
||||
BtnsFacturar.Visible = True
|
||||
|
||||
'VERIFICA SI YA SE FACTURO COMPLETAMENTE
|
||||
If TmpDT.SUM("CantidadFacturadaRem") = TmpDT.SUM("Cantidad") Then
|
||||
@@ -7767,7 +7729,6 @@ Partial Class Ventas
|
||||
If DTFacNC IsNot Nothing AndAlso DTFacNC.Rows.Count > 0 Then
|
||||
Me.CveEstatusRefacturacion = DTFacNC.Rows(0)("CveEstatusRefacturacion").ToString().ToEntero()
|
||||
Me.DevolucionAlmacenNC = DTFacNC.Rows(0)("EsDevolucionVenta").ToString().ToEntero()
|
||||
Me.VentaSaldoAlmacenNC = DTFacNC.Rows(0)("SaldoAlmacen").ToString().ToDecimal
|
||||
HdnRFCVenta.Value = DTFacNC.Rows(0)("ClienteRFC").ToString()
|
||||
End If
|
||||
Else
|
||||
@@ -21767,6 +21728,23 @@ Partial Class Ventas
|
||||
If RefacturarCancelada Then
|
||||
Response.Redirect($"Ventas.aspx?CveDevolucion={CveVenta}&NuevaFactura=1")
|
||||
Else
|
||||
'si es la empresa 119, Candado, no permite refacturar, si no se ha surtido y que no sea refacturación, para que cancele la factura mejor.
|
||||
If UsuarioActual.CveEmpresa = 119 AndAlso LkRefacturacion.Visible AndAlso CveVentaPadre <= 0 Then
|
||||
Dim PermiteRefacturarar As Boolean = True
|
||||
Using ObjInv As New ClsInventarios
|
||||
If ObjInv.GetInv_Mov(CveVenta, UsuarioActual.CveEmpresa) Then
|
||||
If ObjInv.DtResultados.Rows.Count > 0 Then
|
||||
PermiteRefacturarar = False
|
||||
End If
|
||||
End If
|
||||
End Using
|
||||
|
||||
If Not PermiteRefacturarar Then
|
||||
Alert("La factura no se puede refacturar si no ha sido surtida previamente", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
Dim script As String = ""
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Dev", "Egs") Then
|
||||
Dim sb As New StringBuilder()
|
||||
@@ -23541,22 +23519,22 @@ Partial Class Ventas
|
||||
#Region " INVENTARIO POR ENTREGA"
|
||||
Private Sub InventarioMov(Optional CveVentaPadre As Integer = -1)
|
||||
If CveVentaPadre > 0 Then
|
||||
Dim ObjVentas As New ClsVentas()
|
||||
If ObjVentas.GetVenta(CveVentaPadre, UsuarioActual.CveEmpresa, VerificaAlmacen:=False) Then
|
||||
If ObjVentas.DtResultados.Rows.Count > 0 AndAlso ObjVentas.DtResultados.Rows(0)("TipoDocto").ToString() = "Ing" AndAlso DdlTipoComprobante.SelectedValue = "Ing" Then
|
||||
' Dim CveEstatusRefacturacion As Integer = ObjVentas.DtResultados.Rows(0)("CveEstatusRefacturacion").ToString().ToEntero()
|
||||
Dim RowVentas As DataRow = Nothing
|
||||
Using ObjVentas As New ClsVentas
|
||||
If ObjVentas.GetVenta(CveVentaPadre, UsuarioActual.CveEmpresa, VerificaAlmacen:=False) Then
|
||||
RowVentas = ObjVentas.DtResultados.Copy().Rows(0)
|
||||
End If
|
||||
End Using
|
||||
|
||||
' If CveEstatusRefacturacion = 2 Then
|
||||
CargaInventario(Me.CveVenta)
|
||||
'End If
|
||||
|
||||
Else
|
||||
If RowVentas IsNot Nothing Then
|
||||
If RowVentas("TipoDocto").ToString().Contiene("Ing") AndAlso DdlTipoComprobante.SelectedValue = "Ing" Then
|
||||
CargaInventario(Me.CveVenta)
|
||||
End If
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
Else
|
||||
CargaInventario(Me.CveVenta)
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Dev") Then
|
||||
CargaInventario(Me.CveVenta)
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
Private Sub CargaInventario(CveVenta As Integer)
|
||||
@@ -23572,14 +23550,6 @@ Partial Class Ventas
|
||||
End If
|
||||
ObjInv.Dispose()
|
||||
|
||||
'si es la empresa 119, Candado, no permite refacturar, si no se ha surtido y que no sea refacturación, para que cancele la factura mejor.
|
||||
If UsuarioActual.CveEmpresa = 119 AndAlso LkRefacturacion.Visible AndAlso VentaSaldoAlmacen = 0 And CveVentaPadre <= 0 Then
|
||||
LkRefacturacion.Visible = False
|
||||
End If
|
||||
If UsuarioActual.CveEmpresa = 119 AndAlso CveVenta = 620098 Then
|
||||
LkRefacturacion.Visible = True
|
||||
End If
|
||||
|
||||
End Sub
|
||||
Private Sub CargaGVInv(DtTemporal As DataTable)
|
||||
|
||||
@@ -23645,9 +23615,9 @@ Partial Class Ventas
|
||||
|
||||
#Region " DEVOLUCION ALMACEN "
|
||||
Private Sub InicializaDevolucionAlmacen()
|
||||
If Not GvInv.Rows.Count > 0 Then
|
||||
Exit Sub
|
||||
End If
|
||||
'If Not GvInv.Rows.Count > 0 Then
|
||||
' Exit Sub
|
||||
'End If
|
||||
|
||||
If CveVenta > 0 AndAlso (SaldoVenta = TxtTotal.Text.ToDecimal OrElse DdlTipoComprobante.SelectedValue = "Dev" OrElse (DdlTipoComprobante.SelectedValue = "Ped" AndAlso TmpDT IsNot Nothing AndAlso TmpDT.COUNT("CveContratoDetalle", "CveContratoDetalle > 0") > 0)) Then 'And (DdlTipoComprobante.SelectedValue.Contiene({"Rem", "Ped"}) Or (DdlTipoComprobante.SelectedValue.Contiene({"Ing"}) And TxtFecha.Text.ToDate.Month = Now.Month And TxtFecha.Text.ToDate.Year = Now.Year)) Then
|
||||
|
||||
@@ -23667,17 +23637,17 @@ Partial Class Ventas
|
||||
LBDevolucionAlmacen.ToolTip = "¿Está seguro de Solicitar la Devolución de Almacén?"
|
||||
End If
|
||||
|
||||
If VentaSaldoAlmacen < 0 Then
|
||||
If DevolucionAlmacen = 0 Then
|
||||
LBAplicaDevolucion.Visible = True
|
||||
ElseIf DevolucionAlmacen.Contiene(1, 2) Then
|
||||
LBAplicaDevolucion.Visible = False
|
||||
End If
|
||||
ElseIf VentaSaldoAlmacen >= 0 Then
|
||||
LBAplicaDevolucion.Visible = False
|
||||
End If
|
||||
'If VentaSaldoAlmacen < 0 Then
|
||||
' If DevolucionAlmacen = 0 Then
|
||||
' LBAplicaDevolucion.Visible = True
|
||||
' ElseIf DevolucionAlmacen.Contiene(1, 2) Then
|
||||
' LBAplicaDevolucion.Visible = False
|
||||
' End If
|
||||
'ElseIf VentaSaldoAlmacen >= 0 Then
|
||||
' LBAplicaDevolucion.Visible = False
|
||||
'End If
|
||||
|
||||
If DdlTipoComprobante.SelectedValue = "Dev" AndAlso VentaSaldoAlmacen <> 0 Then
|
||||
If DdlTipoComprobante.SelectedValue = "Dev" Then
|
||||
LiDevolucionAlmacen.Visible = False
|
||||
End If
|
||||
|
||||
@@ -23687,14 +23657,22 @@ Partial Class Ventas
|
||||
'UpInvDev.Update()
|
||||
End Sub
|
||||
Protected Sub LBDevolucionAlmacen_Click(sender As Object, e As EventArgs)
|
||||
Dim SaldoAlmacen As Decimal = 0
|
||||
|
||||
Dim ObjVentas As New ClsVentas
|
||||
If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa, VerificaAlmacen:=False) Then
|
||||
If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa, VerificaAlmacen:=True) Then
|
||||
If ObjVentas.DtResultados.Rows.Count > 0 Then
|
||||
Dim DbRowVenta As DataRow = ObjVentas.DtResultados.Rows(0)
|
||||
Me.DevolucionAlmacen = DbRowVenta("EsDevolucionVenta").ToString().ToEntero()
|
||||
SaldoAlmacen = DbRowVenta("SaldoAlmacen").ToString().ToDecimal()
|
||||
End If
|
||||
End If
|
||||
|
||||
If SaldoAlmacen >= 0 Then
|
||||
Alert("El movimiento ya fue devuelto.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If Me.DevolucionAlmacen.Contiene(2) Then
|
||||
InicializaDevolucionAlmacen()
|
||||
UpnTools.Update()
|
||||
@@ -24677,10 +24655,10 @@ Partial Class Ventas
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub MostrarCondicionesCancelacion(Optional Extra As String = "")
|
||||
Private Sub MostrarCondicionesCancelacion(Optional Extra As String = "", Optional SaldoAlmacen As Decimal = 0)
|
||||
Dim SbCondiciones As New StringBuilder()
|
||||
|
||||
If VentaSaldoAlmacen < 0 AndAlso ChkDevAlm.Checked Then
|
||||
If SaldoAlmacen < 0 AndAlso ChkDevAlm.Checked Then
|
||||
SbCondiciones.Append("<b>*Se realizará una devolución en automatico al realizar la cancelación.</b>")
|
||||
End If
|
||||
|
||||
@@ -24705,11 +24683,9 @@ Partial Class Ventas
|
||||
|
||||
Dim sb As New StringBuilder()
|
||||
Dim sbExtra As New StringBuilder()
|
||||
sb.Append("La factura se encuentra en el siguiente estatus del SAT:<br/>")
|
||||
|
||||
sb.Append("La factura se encuentra en el siguiente estatus del SAT:<br/>")
|
||||
|
||||
Dim TotalT As Decimal = TxtTotal.Text.ToDecimal
|
||||
|
||||
Dim RFCReceptor As String = ""
|
||||
|
||||
If String.IsNullOrEmpty(Me.RFCReceptorVenta) Then
|
||||
@@ -24723,6 +24699,36 @@ Partial Class Ventas
|
||||
RFCReceptor = Me.RFCReceptorVenta
|
||||
End If
|
||||
|
||||
Dim SaldoAlmacen As Decimal = 0
|
||||
|
||||
Dim PermiteCancelar As Boolean = True
|
||||
Using ObjVentas As New ClsVentas
|
||||
If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa, VerificaAlmacen:=True) Then
|
||||
If ObjVentas.DtResultados.Rows.Count > 0 Then
|
||||
Dim RowVenta As DataRow = ObjVentas.DtResultados.Rows(0)
|
||||
|
||||
SaldoAlmacen = RowVenta("SaldoAlmacen").ToString().ToDecimal()
|
||||
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Rem", "Dev") AndAlso SaldoAlmacen <> 0 Then
|
||||
ChkDevAlm.Checked = True
|
||||
LiDevolucionAlmacen.Visible = True
|
||||
If DdlTipoComprobante.SelectedValue = "Dev" Then
|
||||
LblDevAlm.Text = "Salida de almacen"
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
PermiteCancelar = False
|
||||
End If
|
||||
Else
|
||||
PermiteCancelar = False
|
||||
End If
|
||||
End Using
|
||||
|
||||
If Not PermiteCancelar Then
|
||||
Alert("La venta no se puede cancelar si no ha sido surtida previamente", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
|
||||
Dim SWatch As New Stopwatch
|
||||
SWatch.Start()
|
||||
@@ -24827,7 +24833,7 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
LblCancelarDocumento.Text = sb.ToString()
|
||||
MostrarCondicionesCancelacion(sbExtra.ToString())
|
||||
MostrarCondicionesCancelacion(sbExtra.ToString(), SaldoAlmacen)
|
||||
|
||||
RegistraScript("$('#ModalCancelarDocumento').modal();")
|
||||
UpCancelarDocumento.Update()
|
||||
@@ -30142,12 +30148,14 @@ Partial Class Ventas
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
LBAplicaDevolucion.Visible = True
|
||||
|
||||
'SOLO APLICA DEVOLUCION SI TIENE MOVIMIENTOS DE ALMACEN
|
||||
If VentaSaldoAlmacen < 0 Then
|
||||
LBAplicaDevolucion.Visible = True
|
||||
ElseIf VentaSaldoAlmacen >= 0 Then
|
||||
LBAplicaDevolucion.Visible = False
|
||||
End If
|
||||
'If VentaSaldoAlmacen < 0 Then
|
||||
' LBAplicaDevolucion.Visible = True
|
||||
'ElseIf VentaSaldoAlmacen >= 0 Then
|
||||
' LBAplicaDevolucion.Visible = False
|
||||
'End If
|
||||
|
||||
Dim SeEsconde As Boolean = False
|
||||
|
||||
@@ -30197,7 +30205,7 @@ Partial Class Ventas
|
||||
End Sub
|
||||
Protected Sub BtnAplicaDevolucion_Click(sender As Object, e As EventArgs)
|
||||
|
||||
'VALIDACIONES
|
||||
|
||||
Dim Selecciono As Boolean = False
|
||||
For Each Gv As GridViewRow In GvAplicaDevolucion.Rows
|
||||
If Gv.FCCheckBox("Chk").Checked And Gv.FCTextBox("TxtCantidadAplicaDevolucion").Text.ToDouble > 0 Then
|
||||
@@ -32813,6 +32821,11 @@ Partial Class Ventas
|
||||
DivAdjuntar.Visible = True
|
||||
End If
|
||||
|
||||
'REMOVER EVENTO PARA RECARGAR ALMACEN
|
||||
spanAlmacen.Attributes.Remove("onclick")
|
||||
Tab.ActiveTabIndex = 1
|
||||
Updatetabs.Update()
|
||||
|
||||
|
||||
UpnTools.Update()
|
||||
UpCliente.Update()
|
||||
@@ -32919,6 +32932,30 @@ Partial Class Ventas
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim TieneSoloServicios As Boolean = TmpDT.MAX("CveTipoPS") = "1"
|
||||
'SI ES REMISION Y TIENE PRODUCTOS, DEBE VERIFICAR EL ALMACEN
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso Not TieneSoloServicios AndAlso DdlTipoComprobante.SelectedValue = "Rem" AndAlso TipoDoctoNuevo = "Ing" AndAlso Not TmpDT.MAX("CveTipoPS") = "1" Then
|
||||
Dim SaldoAlmacenExA As Decimal = 0
|
||||
'Dim SaldoAlmacenUsados As Decimal = 0
|
||||
|
||||
Using ObjInventarios As New ClsInventarios
|
||||
'VERIFICA SI HACE FALTA DEVOLVER PRODUCTOS Y USADOS EN ESPECIFICO
|
||||
If ObjInventarios.GetSaldoVentaDetalleAlmacen(CveVenta, UsuarioActual.CveEmpresa) Then
|
||||
SaldoAlmacenExA = ObjInventarios.DtResultados.SUMD("SaldoAlmacen", $"CveTipoAlmacen = 10")
|
||||
'SaldoAlmacenUsados = ObjInventarios.DtResultados.SUMD("SaldoAlmacen", $"CveTipoAlmacen = 22")
|
||||
End If
|
||||
End Using
|
||||
|
||||
'Si ya se surtió y recibió
|
||||
If SaldoAlmacenExA <= 0 Then
|
||||
BtnsFacturar.Visible = False
|
||||
Alert("No se puede facturar hasta que se haya surtido la remisión", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
If GvPagos.Rows.Count = 0 And UsuarioActual.Empresa.Funcionalidad(558).ToEntero() = 1 And RBLPago.SelectedValue.ToEntero() = 2 Then
|
||||
Alert("No se puede facturar hasta que se haya especificado detalladamente la forma de pago", TipoMensaje.MsgAdvertencia)
|
||||
Else
|
||||
@@ -36488,5 +36525,50 @@ Partial Class Ventas
|
||||
|
||||
UpComercioExterior.Update()
|
||||
End Sub
|
||||
Protected Sub BtnCargarInventario_Click(sender As Object, e As EventArgs)
|
||||
If Not LblAlertRefacInv.Visible Then
|
||||
If CveVentaPadre > 0 Then
|
||||
InventarioMov(CveVentaPadre)
|
||||
Else
|
||||
InventarioMov()
|
||||
End If
|
||||
End If
|
||||
|
||||
'REMOVER EVENTO PARA RECARGAR ALMACEN
|
||||
spanAlmacen.Attributes.Remove("onclick")
|
||||
Tab.ActiveTabIndex = 1
|
||||
Updatetabs.Update()
|
||||
End Sub
|
||||
Protected Sub LBAplicaDevolucion_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim SaldoAlmacen As Decimal = 0
|
||||
|
||||
Dim PermiteCancelar As Boolean = True
|
||||
Using ObjVentas As New ClsVentas
|
||||
If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa, VerificaAlmacen:=True) Then
|
||||
If ObjVentas.DtResultados.Rows.Count > 0 Then
|
||||
Dim RowVenta As DataRow = ObjVentas.DtResultados.Rows(0)
|
||||
SaldoAlmacen = RowVenta("SaldoAlmacen").ToString().ToDecimal()
|
||||
End If
|
||||
End If
|
||||
End Using
|
||||
|
||||
Dim PuedeAplicarDevolucion As Boolean = False
|
||||
|
||||
If SaldoAlmacen < 0 Then
|
||||
If DevolucionAlmacen = 0 Then
|
||||
PuedeAplicarDevolucion = True
|
||||
ElseIf DevolucionAlmacen.Contiene(1, 2) Then
|
||||
Alert("No se puede aplicar una devolución sobre el documento actual", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
ElseIf SaldoAlmacen >= 0 Then
|
||||
Alert("No se puede aplicar una devolución sobre el documento actual", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
If PuedeAplicarDevolucion Then
|
||||
RegistraScript("$('#DivAplicaDevolucion').modal('show');")
|
||||
End If
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
|
||||
Reference in New Issue
Block a user