This commit is contained in:
Raul Pimienta
2019-11-04 21:10:25 -07:00
52 changed files with 22951 additions and 8731 deletions

View File

@@ -82,7 +82,7 @@
<ContentTemplate> <ContentTemplate>
<asp:GridView ID="GvFolioGarantia" runat="server" AutoGenerateColumns="False" <asp:GridView ID="GvFolioGarantia" runat="server" AutoGenerateColumns="False"
DataKeyNames="CveFolioGarantia,FolioGarantia,Estatus,CveUsuario,Usuario,FechaIng" DataKeyNames="CveFolioGarantia,FolioGarantia,Estatus,CveUsuario,Usuario,FechaIng,SubProyecto,CveSubProyecto"
EmptyDataText="No se encontraron registros" ToolTip="Listado de Temas" EmptyDataText="No se encontraron registros" ToolTip="Listado de Temas"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" CssClass="table table-striped table-advance table-hover Widthall ScrollAD"
data-sort="true" data-sort="true"
@@ -94,6 +94,12 @@
&nbsp;<asp:Literal ID="LblFolioGarantia" runat="server" Text='<%# Eval("FolioGarantia") %>'></asp:Literal> &nbsp;<asp:Literal ID="LblFolioGarantia" runat="server" Text='<%# Eval("FolioGarantia") %>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="SubProyecto" ItemStyle-Width="150px">
<ItemTemplate>
&nbsp;<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" ItemStyle-Width="150px">
<ItemTemplate> <ItemTemplate>
@@ -195,7 +201,18 @@
<label for="<%= TxtFolioGarantia.ClientID.ToString()%>">Folio:</label> <label for="<%= TxtFolioGarantia.ClientID.ToString()%>">Folio:</label>
<i></i> <i></i>
</div> </div>
<br />
<div class="form-group form-md-line-input input-iconright" style="width: 170px!important">
<asp:DropDownList ID="DdlSubProyectos" runat="server" CssClass="form-control input-sm select2me" DataValueField="CveSubProyecto" DataTextField="SubProyecto" Class="table-group-action-input form-control input-inline input-small input-sm" Width="200px" AutoPostBack="true"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVProducto2" InitialValue="-1" runat="server" ControlToValidate="DdlSubProyectos" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''SubProyecto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpFolioGarantia"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEProducto2" runat="server" HighlightCssClass="vco" TargetControlID="RFVProducto2" Width="300px"></ajax:ValidatorCalloutExtender>
<label for="<%= DdlSubProyectos.ClientID.ToString()%>">SubProyecto:</label>
<i></i>
</div>
<br />
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright">
<label for="<%= ChkEstatus.ClientID.ToString()%>">Activo:</label>&nbsp; <label for="<%= ChkEstatus.ClientID.ToString()%>">Activo:</label>&nbsp;

View File

@@ -37,6 +37,7 @@ Partial Class Acumuladores_CatFoliosGarantia
Private Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load Private Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then If Not Page.IsPostBack Then
CargaSubProyectos()
CargadatosGvFolioGarantia() CargadatosGvFolioGarantia()
End If End If
@@ -45,6 +46,12 @@ Partial Class Acumuladores_CatFoliosGarantia
#Region "Folios Garantía" #Region "Folios Garantía"
Private Sub CargaSubProyectos()
DdlSubProyectos.Items.Clear()
DdlSubProyectos.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1)
DdlSubProyectos.DataBind()
DdlSubProyectos.Items.Insert(0, New ListItem("Todos", "-1"))
End Sub
Private Sub CargadatosGvFolioGarantia() Private Sub CargadatosGvFolioGarantia()
@@ -88,6 +95,7 @@ Partial Class Acumuladores_CatFoliosGarantia
TxtFolioGarantia.Text = "" TxtFolioGarantia.Text = ""
ChkEstatus.Checked = True ChkEstatus.Checked = True
DdlSubProyectos.SelectedValueExist("-1")
Actualizar = False Actualizar = False
UpGral.Update() UpGral.Update()
@@ -108,7 +116,7 @@ Partial Class Acumuladores_CatFoliosGarantia
If Not Actualizar Then If Not Actualizar Then
If ObjAcum.FoliosGarantiaAdd(TxtFolioGarantia.Text, If(ChkEstatus.Checked = True, 1, 0), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then If ObjAcum.FoliosGarantiaAdd(TxtFolioGarantia.Text, If(ChkEstatus.Checked = True, 1, 0), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlSubProyectos.SelectedValue.ToEntero) Then
TxtFolioGarantia.Text = "" TxtFolioGarantia.Text = ""
ChkEstatus.Checked = True ChkEstatus.Checked = True
@@ -127,7 +135,7 @@ Partial Class Acumuladores_CatFoliosGarantia
Alert("Ocurrió un error al guardar el Folio de Garantía", TipoMensaje.MsgError) Alert("Ocurrió un error al guardar el Folio de Garantía", TipoMensaje.MsgError)
End If End If
Else Else
If ObjAcum.FoliosGarantiaUpdate(CveFolioGarantia, TxtFolioGarantia.Text, If(ChkEstatus.Checked = True, 1, 0), UsuarioActual.CveUsuario) Then If ObjAcum.FoliosGarantiaUpdate(CveFolioGarantia, TxtFolioGarantia.Text, If(ChkEstatus.Checked = True, 1, 0), UsuarioActual.CveUsuario, DdlSubProyectos.SelectedValue.ToEntero) Then
TxtFolioGarantia.Text = "" TxtFolioGarantia.Text = ""
ChkEstatus.Checked = True ChkEstatus.Checked = True
@@ -195,10 +203,11 @@ Partial Class Acumuladores_CatFoliosGarantia
'TxtCompra.Text = GvRow.DataKey("Compra").ToDecimal.ToString("###,###,###.00") 'TxtCompra.Text = GvRow.DataKey("Compra").ToDecimal.ToString("###,###,###.00")
'TxtPuntos.Text = GvRow.DataKey("Puntos").ToDecimal.ToString("###,###,###.00") 'TxtPuntos.Text = GvRow.DataKey("Puntos").ToDecimal.ToString("###,###,###.00")
'DdlPS.Items.Clear() DdlSubProyectos.Items.Clear()
'DdlPS.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa) DdlSubProyectos.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1)
'DdlPS.DataBind() DdlSubProyectos.DataBind()
'DdlPS.SelectedValueExist(GvRow.DataKey("CvePSCargo").ToEntero) DdlSubProyectos.Items.Insert(0, New ListItem("Todos", "-1"))
DdlSubProyectos.SelectedValueExist(GvRow.DataKey("CveSubProyecto").ToEntero)
BtnAgregarFolioGarantiaModal.Text = "Actualizar" BtnAgregarFolioGarantiaModal.Text = "Actualizar"

View File

@@ -480,7 +480,7 @@ Public Class ClsAcumuladores
Return Retorno Return Retorno
End Function End Function
Public Function FoliosGarantiaAdd(FolioGarantia As String, Estatus As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean Public Function FoliosGarantiaAdd(FolioGarantia As String, Estatus As Integer, CveUsuario As Integer, CveEmpresa As Integer, CveSubProyecto As Integer) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
'Data = New DataTable 'Data = New DataTable
@@ -492,6 +492,7 @@ Public Class ClsAcumuladores
.Add("@Estatus", SqlDbType.Bit).Value = Estatus .Add("@Estatus", SqlDbType.Bit).Value = Estatus
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
End With End With
@@ -507,7 +508,7 @@ Public Class ClsAcumuladores
Return Retorno Return Retorno
End Function End Function
Public Function FoliosGarantiaUpdate(CveFolioGarantia As Integer, FolioGarantia As String, Estatus As Integer, CveUsuario As Integer) As Boolean Public Function FoliosGarantiaUpdate(CveFolioGarantia As Integer, FolioGarantia As String, Estatus As Integer, CveUsuario As Integer, CveSubProyecto As Integer) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
'Data = New DataTable 'Data = New DataTable
@@ -519,6 +520,7 @@ Public Class ClsAcumuladores
.Add("@FolioGarantia", SqlDbType.VarChar).Value = FolioGarantia .Add("@FolioGarantia", SqlDbType.VarChar).Value = FolioGarantia
.Add("@Estatus", SqlDbType.Bit).Value = Estatus .Add("@Estatus", SqlDbType.Bit).Value = Estatus
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
End With End With

View File

@@ -1363,7 +1363,7 @@ Public Class ClsBancos
_Folio = SqlAdapter.SelectCommand.Parameters("@FolioRegistro").Value.ToString _Folio = SqlAdapter.SelectCommand.Parameters("@FolioRegistro").Value.ToString
Catch Ex1 As SqlException Catch Ex1 As SqlException
If Ex1.Message.Contains("Número: 2627;") Then If Ex1.Message.Contains("Número: 2627;") Or Ex1.Message.Contains("Número: 2601;") Then
Alert("Ya existe un movimiento bancario con el mismo Folio: <b>" & Folio & "</b>.", TipoMensaje.MsgAdvertencia) Alert("Ya existe un movimiento bancario con el mismo Folio: <b>" & Folio & "</b>.", TipoMensaje.MsgAdvertencia)
Else Else
Me.OnError("Ocurrió un error al Guardar el Movimiento.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) Me.OnError("Ocurrió un error al Guardar el Movimiento.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())

View File

@@ -443,7 +443,7 @@ Public Class ClsContPAQi
End If End If
' no puede ser menor el subtotal al IVA, para evitar numeros negativos, excepto VSH ' no puede ser menor el subtotal al IVA, para evitar numeros negativos, excepto VSH
If Not CveEmpresa.Contiene(4, 7, 11, 12, 122) Then If Not CveEmpresa.Contiene(4, 7, 11, 12, 122, 145) Then
If Math.Abs(SubTotal) < Math.Abs(IVA) Then If Math.Abs(SubTotal) < Math.Abs(IVA) Then
Return False Return False
End If End If

View File

@@ -374,7 +374,7 @@
<div class="col-md-12"> <div class="col-md-12">
<asp:UpdatePanel ID="UpMovDeudor" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UpMovDeudor" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<asp:GridView ID="GvMovDeudor" runat="server" AutoGenerateColumns="False" DataKeyNames="CveIE,CveProveedor,CveMoneda,Importe,Saldo,Pagado,Folio,TipoCambio" Width="100%" CssClass="table table-striped table-advance table-hover Widthall" GridLines="None" OnRowDataBound="GvMovDeudor_RowDataBound"> <asp:GridView ID="GvMovDeudor" runat="server" AutoGenerateColumns="False" DataKeyNames="CveIE,CveProveedor,CveMoneda,Importe,Saldo,Pagado,Folio,TipoCambio,FechaDocumento" Width="100%" CssClass="table table-striped table-advance table-hover Widthall" GridLines="None" OnRowDataBound="GvMovDeudor_RowDataBound">
<Columns> <Columns>
<asp:TemplateField> <asp:TemplateField>
<HeaderTemplate></HeaderTemplate> <HeaderTemplate></HeaderTemplate>

View File

@@ -445,7 +445,7 @@ public partial class Bancos_PagoDeudor : ClsPaginas
} }
bool AutoConta = UsuarioActual.Empresa.Funcionalidad(200).Equals("1"); bool AutoConta = UsuarioActual.Empresa.Funcionalidad(200).Equals("1");
if (UsuarioActual.CveEmpresa == 119) AutoConta = false; // if (UsuarioActual.CveEmpresa == 119) AutoConta = false;
if (AutoConta && MsgError.Equals("")) if (AutoConta && MsgError.Equals(""))
{ {
@@ -708,6 +708,14 @@ public partial class Bancos_PagoDeudor : ClsPaginas
{ {
if (gvr.FCCheckBox("Chk").Checked) if (gvr.FCCheckBox("Chk").Checked)
{ {
Decimal TCDoc = gvr.DataKey("TipoCambio").ToDecimal(); // tipo de cambio de IE
if (gvr.DataKey("FechaDocumento").ToDate() < TxtFechaDocumento.Text.ToDate().FirstDayOfMonth())
{
// si la fecha del documento a pagar es menor al primer dia del mes del pago, toma el TC del mes anterior
TCDoc = get_GlobalTipoCambio(TxtFechaDocumento.Text.ToDate().AddMonths(-1).LastDayOfMonth()).ToDecimal();
}
Importe = gvr.FCTextBox("TxtAbonar").Text.ToDecimal(); Importe = gvr.FCTextBox("TxtAbonar").Text.ToDecimal();
ImporteMN = Importe; ImporteMN = Importe;
ImporteComplementaria = 0; ImporteComplementaria = 0;
@@ -722,11 +730,11 @@ public partial class Bancos_PagoDeudor : ClsPaginas
if (UsaComplementaria) if (UsaComplementaria)
{ {
ImporteMN = Importe; ImporteMN = Importe;
ImporteComplementaria = Importe * gvr.DataKey("TipoCambio").ToDecimal() - Importe; ImporteComplementaria = Importe * TCDoc - Importe;
} }
else else
{ {
ImporteMN = Importe * gvr.DataKey("TipoCambio").ToDecimal(); ImporteMN = Importe * TCDoc;
ImporteComplementaria = 0; ImporteComplementaria = 0;
} }
} }
@@ -740,11 +748,11 @@ public partial class Bancos_PagoDeudor : ClsPaginas
if (UsaComplementaria) if (UsaComplementaria)
{ {
ImporteMN = Importe; ImporteMN = Importe;
ImporteComplementaria = Importe * gvr.DataKey("TipoCambio").ToDecimal() - Importe; ImporteComplementaria = Importe * TCDoc - Importe;
} }
else else
{ {
ImporteMN = Importe * gvr.DataKey("TipoCambio").ToDecimal(); ImporteMN = Importe * TCDoc;
ImporteComplementaria = 0; ImporteComplementaria = 0;
} }
} }
@@ -755,32 +763,32 @@ public partial class Bancos_PagoDeudor : ClsPaginas
if (tCveMoneda != 1) if (tCveMoneda != 1)
{ {
if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, Importe, Ref, CveConceptoContablePago, Conc, DateTime.Now, IDCtaContableDeudor, -1, CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), ImporteMX: ImporteMN, CveIEDevolucion: gvr.DataKey("CveIE").ToEntero(), TipoCambio: gvr.DataKey("TipoCambio").ToDecimal(), TipoCambioPago: TC,CveSubProyecto:DdlSubProyectoPago.SelectedValue.ToEntero())) if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, Importe, Ref, CveConceptoContablePago, Conc, DateTime.Now, IDCtaContableDeudor, -1, CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), ImporteMX: ImporteMN, CveIEDevolucion: gvr.DataKey("CveIE").ToEntero(), TipoCambio: TCDoc, TipoCambioPago: TC,CveSubProyecto:DdlSubProyectoPago.SelectedValue.ToEntero()))
{ {
MsgError = "No se pudo insertar concepto de pago deudor"; MsgError = "No se pudo insertar concepto de pago deudor";
break; break;
} }
if (UsaComplementaria) if (UsaComplementaria)
{ {
if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, Importe, Ref, CveConceptoContablePagoComplementaria, Conc, DateTime.Now, IDCtaContableDeudorComplementaria, -1, CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), ImporteMX: ImporteComplementaria, CveIEDevolucion: gvr.DataKey("CveIE").ToEntero(), ImporteME: Importe, TipoCambio: gvr.DataKey("TipoCambio").ToDecimal(), TipoCambioPago: TC, CveSubProyecto: DdlSubProyectoPago.SelectedValue.ToEntero())) if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, Importe, Ref, CveConceptoContablePagoComplementaria, Conc, DateTime.Now, IDCtaContableDeudorComplementaria, -1, CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), ImporteMX: ImporteComplementaria, CveIEDevolucion: gvr.DataKey("CveIE").ToEntero(), ImporteME: Importe, TipoCambio: TCDoc, TipoCambioPago: TC, CveSubProyecto: DdlSubProyectoPago.SelectedValue.ToEntero()))
{ {
MsgError = "No se pudo insertar concepto de deudor complementaria"; MsgError = "No se pudo insertar concepto de deudor complementaria";
} }
} }
if (TC != gvr.DataKey("TipoCambio").ToDecimal()) if (TC != TCDoc)
{ {
int CveConceptoDiferenciaCambiaria = 0; int CveConceptoDiferenciaCambiaria = 0;
bool TipoMovto = false; bool TipoMovto = false;
int IdCtaContableDiferenciaCambiaria = 0; int IdCtaContableDiferenciaCambiaria = 0;
if (TC <gvr.DataKey("TipoCambio").ToDecimal()) if (TC < TCDoc)
{ {
CveConceptoDiferenciaCambiaria = 65; CveConceptoDiferenciaCambiaria = 65;
IdCtaContableDiferenciaCambiaria = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria; IdCtaContableDiferenciaCambiaria = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria;
TipoMovto = false; TipoMovto = false;
Importe = (Importe * gvr.DataKey("TipoCambio").ToDecimal()) - (Importe * TC); Importe = (Importe * gvr.DataKey("TipoCambio").ToDecimal()) - (Importe * TC);
} }
else if (TC > gvr.DataKey("TipoCambio").ToDecimal()) else if (TC > TCDoc)
{ {
CveConceptoDiferenciaCambiaria = 64; CveConceptoDiferenciaCambiaria = 64;
IdCtaContableDiferenciaCambiaria = UsuarioActual.Empresa.IdCuentaGananciaCambiaria; IdCtaContableDiferenciaCambiaria = UsuarioActual.Empresa.IdCuentaGananciaCambiaria;

View File

@@ -900,14 +900,14 @@ Partial Class Bancos_PolizaCheque
Importe = Importe * TC Importe = Importe * TC
End If End If
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, Referencia, gvr.DataKey("CveConcepto").ToEntero, TxtObservaciones.Text, Now, gvr.DataKey("IDCuenta").ToEntero, -1, CveIE, CveProveedor:=CveProveedor, CveSubProyecto:=If(UsuarioActual.CveEmpresa = 119, gvr.FCDropDownList("DdlSubProyecto").ToEntero, gvr.DataKey("CveSubProyecto").ToEntero), CvePersonal:=gvr.DataKey("CvePersonal").ToEntero, ImporteMX:=Importe, CveCuenta:=If(UsuarioActual.Empresa.UsaContabilidad AndAlso UsuarioActual.Empresa.UsaContabilidadSIG, ObtenerCuentaDobleConta(gvr.DataKey("IDCuenta").ToEntero, UsuarioActual.CveEmpresa), -1), TipoCambio:=TC) Then If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, Referencia, gvr.DataKey("CveConcepto").ToEntero, TxtObservaciones.Text, Now, gvr.DataKey("IDCuenta").ToEntero, -1, CveIE, CveProveedor:=CveProveedor, CveSubProyecto:=gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero, CvePersonal:=gvr.DataKey("CvePersonal").ToEntero, ImporteMX:=Importe, CveCuenta:=If(UsuarioActual.Empresa.UsaContabilidad AndAlso UsuarioActual.Empresa.UsaContabilidadSIG, ObtenerCuentaDobleConta(gvr.DataKey("IDCuenta").ToEntero, UsuarioActual.CveEmpresa), -1), TipoCambio:=TC) Then
MsgError = "no se pudo insertar el detalle de la póliza2" MsgError = "no se pudo insertar el detalle de la póliza2"
End If End If
If gvr.DataKey("CveConcepto").ToEntero = 30 Then If gvr.DataKey("CveConcepto").ToEntero = 30 Then
If CveMoneda > 1 AndAlso UsuarioActual.CveEmpresa = 119 Then If CveMoneda > 1 AndAlso UsuarioActual.CveEmpresa = 119 Then
'Agregamos complementaria 'Agregamos complementaria
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, 0, gvr.FCTextBox("TxtConcepto").Text, 204, TxtObservaciones.Text, Now, dr("IDCtaContableComplementaria").ToString.ToEntero, -1, CveIE:=CveIE, CveProveedor:=CveProveedor, CveSubProyecto:=If(UsuarioActual.CveEmpresa = 119, gvr.FCDropDownList("DdlSubProyecto").ToEntero, gvr.DataKey("CveSubProyecto").ToEntero), CvePersonal:=gvr.DataKey("CvePersonal").ToEntero, ImporteMX:=Importe * TC - Importe, ImporteME:=Importe, TipoCambio:=TC) Then If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, 0, gvr.FCTextBox("TxtConcepto").Text, 204, TxtObservaciones.Text, Now, dr("IDCtaContableComplementaria").ToString.ToEntero, -1, CveIE:=CveIE, CveProveedor:=CveProveedor, CveSubProyecto:=gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero, CvePersonal:=gvr.DataKey("CvePersonal").ToEntero, ImporteMX:=Importe * TC - Importe, ImporteME:=Importe, TipoCambio:=TC) Then
MsgError = "Ocurrió un error al registrar el asiento del ingreso." MsgError = "Ocurrió un error al registrar el asiento del ingreso."
End If End If
End If End If

View File

@@ -367,7 +367,7 @@
<asp:CheckBox ID="Chk" runat="server"></asp:CheckBox> <asp:CheckBox ID="Chk" runat="server"></asp:CheckBox>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField ItemStyle-Width="95px"> <asp:TemplateField ItemStyle-Width="115px">
<HeaderTemplate>Factura</HeaderTemplate> <HeaderTemplate>Factura</HeaderTemplate>
<ItemTemplate> <ItemTemplate>
<asp:HyperLink ID="HplF" CssClass="Texto" NavigateUrl='<%# Eval("CveCompra", "/Compras/Compras.aspx?CveCompra={0}")%>' Text='<%# Eval("SerieFolio")%>' runat="server"></asp:HyperLink> <asp:HyperLink ID="HplF" CssClass="Texto" NavigateUrl='<%# Eval("CveCompra", "/Compras/Compras.aspx?CveCompra={0}")%>' Text='<%# Eval("SerieFolio")%>' runat="server"></asp:HyperLink>

View File

@@ -637,7 +637,7 @@ Partial Class Bancos_ProveedoresAbonar
e.Row.FCTextBox("TxtAbonar").Enabled = False e.Row.FCTextBox("TxtAbonar").Enabled = False
' si tiene un porcentaje mayor ingresado, que este halla sido por OC, debe de permitirlo ' si tiene un porcentaje mayor ingresado, que este halla sido por OC, debe de permitirlo
If e.Row.DBCampo("ImporteAlmacenPorcentaje").ToDecimal >= 100 Then 'si ya se recibió el 100% If e.Row.DBCampo("ImporteAlmacenPorcentaje").ToDecimal >= 99.0 Then 'si ya se recibió el 100%
e.Row.FCCheckBox("Chk").Enabled = True e.Row.FCCheckBox("Chk").Enabled = True
e.Row.FCTextBox("TxtAbonar").Enabled = True e.Row.FCTextBox("TxtAbonar").Enabled = True
End If End If
@@ -1811,7 +1811,7 @@ Partial Class Bancos_ProveedoresAbonar
End If End If
End If End If
If ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, 5) Then If MsgError <> "" AndAlso ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, 5) Then
If ObjMov.ValorPolizaDescuadre > 0 Then If ObjMov.ValorPolizaDescuadre > 0 Then
MsgError = ObjMov.MensajePolizaDescuadre + " " + ObjMov.ValorDiferencia MsgError = ObjMov.MensajePolizaDescuadre + " " + ObjMov.ValorDiferencia
GuardaLogAD($"Bancos/ProveedoresAbonar | Error:{ObjMov.MensajePolizaDescuadre} Diferencia:{ObjMov.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas") GuardaLogAD($"Bancos/ProveedoresAbonar | Error:{ObjMov.MensajePolizaDescuadre} Diferencia:{ObjMov.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")

View File

@@ -5561,26 +5561,29 @@
//var Proporcional = ((ToDouble(TxtCantidad.value) * 100) / CantidadOriginal) / 100; //var Proporcional = ((ToDouble(TxtCantidad.value) * 100) / CantidadOriginal) / 100;
var TotalGravado = ToDouble(TxtCantidad.value) * ToDouble(TxtPU.value);
var Total = ToDouble(TxtCantidad.value) * ToDouble(TxtPU.value);
HdnDescuento.value = ToDouble(DescuentoOriginal * ToDouble(TxtCantidad.value) / CantidadOriginal); HdnDescuento.value = ToDouble(DescuentoOriginal * ToDouble(TxtCantidad.value) / CantidadOriginal);
if (true) { if (true) {
HdnIEPS.value = ToDouble(IEPSPSPorcentaje * (ToDouble(TxtCantidad.value) * ToDouble(TxtPU.value) - ToDouble(HdnDescuento.value))); HdnIEPS.value = ToDouble(IEPSPSPorcentaje * (Total - ToDouble(HdnDescuento.value)));
}
if (IEPSIVAOriginal > 0) {
HdnIEPSIVA.value = ToDouble(IEPSPSIVAPorcentaje * (Total - ToDouble(HdnDescuento.value)));
TotalGravado += ToDouble(IEPSPSIVAPorcentaje * (Total - ToDouble(HdnDescuento.value)));
} }
if (IVAOriginal > 0) { if (IVAOriginal > 0) {
HdnIVA.value = ToDouble(IVAPorcentaje * (ToDouble(TxtCantidad.value) * ToDouble(TxtPU.value) - ToDouble(HdnDescuento.value))); HdnIVA.value = ToDouble(IVAPorcentaje * (TotalGravado - ToDouble(HdnDescuento.value)));
} }
if (RetIVAOriginal > 0) { if (RetIVAOriginal > 0) {
HdnRetIVA.value = ToDouble(RetIVAPorcentaje * (ToDouble(TxtCantidad.value) * ToDouble(TxtPU.value) - ToDouble(HdnDescuento.value))); HdnRetIVA.value = ToDouble(RetIVAPorcentaje * (Total - ToDouble(HdnDescuento.value)));
} }
if (RetISROriginal > 0) { if (RetISROriginal > 0) {
HdnRetISR.value = ToDouble(RetISRPorcentaje * (ToDouble(TxtCantidad.value) * ToDouble(TxtPU.value) - ToDouble(HdnDescuento.value))); HdnRetISR.value = ToDouble(RetISRPorcentaje * (Total - ToDouble(HdnDescuento.value)));
} }
if (IEPSIVAOriginal > 0) {
HdnIEPSIVA.value = ToDouble(IEPSPSIVAPorcentaje * (ToDouble(TxtCantidad.value) * ToDouble(TxtPU.value) - ToDouble(HdnDescuento.value))); TxtTotal.value = FormatoNumero(Total - ToDouble(HdnDescuento.value), 2);
}
TxtTotal.value = FormatoNumero(ToDouble(TxtCantidad.value) * ToDouble(TxtPU.value) - ToDouble(HdnDescuento.value), 2);
//RECALCULA IMPORTES GENERALES //RECALCULA IMPORTES GENERALES
CalculaTotalesOC(); CalculaTotalesOC();
@@ -5595,7 +5598,7 @@
} }
function CalculaTotalesOC() { function CalculaTotalesOC() {
var SumaSubTotal = 0, SumaIEPS = 0, SumaIEPSIVA = 0, SumaIVA = 0, SumaRetIVA = 0, SumaRetISR = 0, SumaTotal = 0, SumaDescuento = 0, Amortizacion = 0; var SumaSubTotal = 0, SumaIEPS = 0, SumaIEPSIVA = 0, SumaIVA = 0, SumaRetIVA = 0, SumaRetISR = 0, SumaTotal = 0, SumaDescuento = 0, Amortizacion = 0;
$('input[name*=TxtTotalOC1]').each(function () { $('input[name*=TxtTotalOC1]').each(function () {
@@ -5628,7 +5631,7 @@
//Amortizacion = ToDouble($get('C_Tab_TabGenerales_LblAmortizacion').innerText); //Amortizacion = ToDouble($get('C_Tab_TabGenerales_LblAmortizacion').innerText);
SumaTotal = SumaSubTotal + SumaIVA + SumaIEPSIVA + SumaIEPS - SumaRetIVA - SumaRetISR; SumaTotal = SumaSubTotal + SumaIVA + SumaIEPS - SumaRetIVA - SumaRetISR;
if ($get("C_Tab_TabOC_LbSubTotalOC1")) { if ($get("C_Tab_TabOC_LbSubTotalOC1")) {
$get("C_Tab_TabOC_LbSubTotalOC1").innerText = FormatoNumero(SumaSubTotal + SumaDescuento, 2); $get("C_Tab_TabOC_LbSubTotalOC1").innerText = FormatoNumero(SumaSubTotal + SumaDescuento, 2);

View File

@@ -6376,9 +6376,9 @@ Partial Class Compras_Compras
Dim DTDistinct = DT.Copy Dim DTDistinct = DT.Copy
If UsuarioActual.Empresa.Funcionalidad(126) = "1" Then If UsuarioActual.Empresa.Funcionalidad(126) = "1" Then
DTDistinct = DTDistinct.FiltraParametros("ISNULL(TipoAF, 0) <> 2", "", {"CveClasificacion", "Clasificacion", "SubProyecto", "CveProyecto", "CveSubProyecto", "CveTipoGasto", "TipoGasto"}) DTDistinct = DTDistinct.FiltraParametros("ISNULL(TipoAF, 0) <> 2", "", {"CveClasificacion", "Clasificacion", "SubProyecto", "CveSubProyecto", "CveTipoGasto", "TipoGasto"})
Else Else
DTDistinct = DTDistinct.FiltraParametros("ISNULL(TipoAF,0) <> 2 And ISNULL(CveAlmacen,0) = 0 And ISNULL(AplicaCostoIndirecto,0) <> 1", "", {"CveClasificacion", "Clasificacion", "SubProyecto", "CveProyecto", "CveSubProyecto", "CveTipoGasto", "TipoGasto"}) DTDistinct = DTDistinct.FiltraParametros("ISNULL(TipoAF,0) <> 2 And ISNULL(CveAlmacen,0) = 0 And ISNULL(AplicaCostoIndirecto,0) <> 1", "", {"CveClasificacion", "Clasificacion", "SubProyecto", "CveSubProyecto", "CveTipoGasto", "TipoGasto"})
End If End If
'RMF, si es concepto relacionado a flete o importacion, no debe de afectar al gasto 'RMF, si es concepto relacionado a flete o importacion, no debe de afectar al gasto
If CveFlete > 0 OrElse CveImportacion > 0 Then If CveFlete > 0 OrElse CveImportacion > 0 Then
@@ -16603,7 +16603,7 @@ Partial Class Compras_Compras
End Sub End Sub
Protected Sub DdlSubProyecto_SelectedIndexChanged(sender As Object, e As EventArgs) Protected Sub DdlSubProyecto_SelectedIndexChanged(sender As Object, e As EventArgs)
If Modalidad <> "U" Or Not CveFactura > 0 Then If Modalidad <> "U" Or Not CveFactura > 0 Then
DdlPSChange() DdlPSChange()
End If End If
End Sub End Sub
Private Sub DdlPSChange() Private Sub DdlPSChange()
@@ -16635,9 +16635,10 @@ Partial Class Compras_Compras
If ViewState("IVAPS").ToString.ToEntero() = -1 Then If ViewState("IVAPS").ToString.ToEntero() = -1 Then
Dim Drr As DataRow = GlobalDTSubProyectos(-1, DdlSubProyecto.SelectedValue.ToEntero())(0) Dim Drr As DataRow = GlobalDTSubProyectos(-1, DdlSubProyecto.SelectedValue.ToEntero())(0)
ViewState("IVAPS") = Drr("IVA").ToString().ToDouble() ViewState("IVAPS") = Drr("IVA").ToString().ToDouble()
DdlProyecto.SelectedValueExist(Drr("CveProyecto"))
'DdlIVA.Enabled = True
'DdlIVA.Enabled = True
If Not Modalidad = "U" Then If Not Modalidad = "U" Then
Select Case ViewState("IVAPS").ToString().ToDouble Select Case ViewState("IVAPS").ToString().ToDouble

View File

@@ -890,6 +890,7 @@ Partial Class PopUpVerFactura
Vta.Cliente.Mail = dtVentas(0)("Mail").ToString Vta.Cliente.Mail = dtVentas(0)("Mail").ToString
Vta.RefDocto = dtVentas(0)("Ref").ToString Vta.RefDocto = dtVentas(0)("Ref").ToString
Vta.CveVenta = dtVentas(0)("CveVenta").ToString.ToEntero Vta.CveVenta = dtVentas(0)("CveVenta").ToString.ToEntero
Vta.NumeroCuenta = dtVentas(0)("NumCtaPago").ToString
Vta.Version = dtVentas(0)("Version").ToString Vta.Version = dtVentas(0)("Version").ToString
Vta.NumeroContrato = dtVentas(0)("NumeroContrato").ToString Vta.NumeroContrato = dtVentas(0)("NumeroContrato").ToString
@@ -1081,6 +1082,12 @@ Partial Class PopUpVerFactura
If dtVentas(0)("TipoDocto").ToString.Contiene("Egs", "Dev", "Ant") Then If dtVentas(0)("TipoDocto").ToString.Contiene("Egs", "Dev", "Ant") Then
If ObjVentas.GetVentasAntNC(-1, CveVenta) Then If ObjVentas.GetVentasAntNC(-1, CveVenta) Then
Vta.DtDocumentosRelacionados = ObjVentas.DtResultados.FiltraParametros("FolioFiscal IS NOT NULL") Vta.DtDocumentosRelacionados = ObjVentas.DtResultados.FiltraParametros("FolioFiscal IS NOT NULL")
If Vta.DtDocumentosRelacionados.Rows.Count > 0 Then
If Vta.TipoDocto.Contiene("Dev") Then
Vta.Timbre.CFDIRelacionados.TipoRelacion = "03"
Vta.Timbre.CFDIRelacionados.TipoRelacionTexto = "Devolución aplicada a Ingreso"
End If
End If
End If End If
End If End If
End If End If
@@ -1107,11 +1114,11 @@ Partial Class PopUpVerFactura
End If End If
End If End If
End Sub End Sub
#End Region #End Region
#Region " - OP = 'Alm' - REPORTE ENTRADAS ALMACEN " #Region " - OP = 'Alm' - REPORTE ENTRADAS ALMACEN "
Private Sub CargaMovimientosAlmacen(CveMovimiento As Integer) Private Sub CargaMovimientosAlmacen(CveMovimiento As Integer)
Dim ObjInventarios As New ClsInventarios Dim ObjInventarios As New ClsInventarios
@@ -2269,19 +2276,19 @@ Partial Class PopUpVerFactura
If (UsuarioActual.CveEmpresa = 72) Then If (UsuarioActual.CveEmpresa = 72) Then
params.Add(New ReportParameter("DomicilioFiscal", DomicilioFiscalCompu)) params.Add(New ReportParameter("DomicilioFiscal", DomicilioFiscalCompu))
End If End If
ImprimirPDF(UsuarioActual.Empresa.Ruta & "Formatos/SalidasGarantia.rdlc", DtMovimientos, params, String.Format("SalidaGarantia{0}", Folio.ToString), RDSName:="DsInventarios") ImprimirPDF(UsuarioActual.Empresa.Ruta & "Formatos/SalidasGarantia.rdlc", DtMovimientos, params, String.Format("SalidaGarantia{0}", Folio.ToString), RDSName:="DsInventarios")
'Else 'Else
' params.Add(New ReportParameter("Folio", Folio)) ' params.Add(New ReportParameter("Folio", Folio))
' params.Add(New ReportParameter("Fecha", Fecha)) ' params.Add(New ReportParameter("Fecha", Fecha))
' params.Add(New ReportParameter("Almacen", Almacen)) ' params.Add(New ReportParameter("Almacen", Almacen))
' params.Add(New ReportParameter("SubProyecto", SubProyecto)) ' params.Add(New ReportParameter("SubProyecto", SubProyecto))
' params.Add(New ReportParameter("Observaciones", Observaciones)) ' params.Add(New ReportParameter("Observaciones", Observaciones))
' params.Add(New ReportParameter("NombreEntrego", String.Format("ENTREGÓ{0}{1}", vbCrLf, Capturo))) ' params.Add(New ReportParameter("NombreEntrego", String.Format("ENTREGÓ{0}{1}", vbCrLf, Capturo)))
' params.Add(New ReportParameter("NombreRecibio", String.Format("RECIBIÓ{0}{1}", vbCrLf, Recibio))) ' params.Add(New ReportParameter("NombreRecibio", String.Format("RECIBIÓ{0}{1}", vbCrLf, Recibio)))
' ImprimirPDF(UsuarioActual.Empresa.Ruta & "Formatos/Salidas.rdlc", DtMovimientos, params, String.Format("Salida de Almacen - {0}", Folio.ToString), RDSName:="DsInventarios") ' ImprimirPDF(UsuarioActual.Empresa.Ruta & "Formatos/Salidas.rdlc", DtMovimientos, params, String.Format("Salida de Almacen - {0}", Folio.ToString), RDSName:="DsInventarios")
'End If 'End If
Case 18 'D E V O L U C I O N D E L C L I E N T E Case 18 'D E V O L U C I O N D E L C L I E N T E
Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos/DevolucionCliente.rdlc", UsuarioActual.Empresa.Ruta)) Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos/DevolucionCliente.rdlc", UsuarioActual.Empresa.Ruta))
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
@@ -2859,11 +2866,11 @@ Partial Class PopUpVerFactura
If CveConcepto = 2 Then If CveConcepto = 2 Then
ElseIf CveConcepto = 3 Then ElseIf CveConcepto = 3 Then
End If End If
End Sub End Sub
#End Region #End Region
#Region "OP = 'OC' - IMPRIME PDF OC" #Region "OP = 'OC' - IMPRIME PDF OC"
Private Sub ImprimePDFOC(CveOrdenCompra As Integer) Private Sub ImprimePDFOC(CveOrdenCompra As Integer)
Dim reporte As Byte() = NewGeneraBytesOC(CveOrdenCompra, ConBitacora:=(UsuarioActual.Empresa.Funcionalidad(119) = "1")) Dim reporte As Byte() = NewGeneraBytesOC(CveOrdenCompra, ConBitacora:=(UsuarioActual.Empresa.Funcionalidad(119) = "1"))
@@ -2899,10 +2906,10 @@ Partial Class PopUpVerFactura
ImprimirbytesPDF(reporte, $"OrdenCompra-{Folio.ToString}") ImprimirbytesPDF(reporte, $"OrdenCompra-{Folio.ToString}")
End If End If
End If End If
End Sub End Sub
#End Region #End Region
#Region "OP = 'VAL' - IMPRIME PDF VAL" #Region "OP = 'VAL' - IMPRIME PDF VAL"
Private Sub GenerarPDFVale(CveVale As Integer) Private Sub GenerarPDFVale(CveVale As Integer)
@@ -2932,9 +2939,9 @@ Partial Class PopUpVerFactura
'End If 'End If
End If End If
ObjAF.Dispose() ObjAF.Dispose()
End Sub End Sub
#End Region #End Region
#Region "OP = 'OS' - IMPRIMIR PDF OS" #Region "OP = 'OS' - IMPRIMIR PDF OS"
Private Sub GenerarPDFOS(CveOS As Integer) Private Sub GenerarPDFOS(CveOS As Integer)
Dim ObjOS As New ClsOS() Dim ObjOS As New ClsOS()
@@ -2991,34 +2998,24 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("LogoPath", "")) params.Add(New ReportParameter("LogoPath", ""))
End If End If
If ObjOS.GetOrdenesServiciosDetalle(CveOS) Then
TmpDTOS = ObjOS.DtResultados
End If
If ObjOS.GetDetalleMateriales(-1, CveOS) Then
TmpDTMaterialesOS = ObjOS.DtResultados
End If
Dim lrds As New List(Of ReportDataSource)
Dim rds As New ReportDataSource With {.Name = "DataSet2", .Value = TmpDTMaterialesOS}
Dim rds2 As New ReportDataSource With {.Name = "DataSet1", .Value = TmpDTOS}
lrds.Add(rds)
lrds.Add(rds2)
ObjOS.Dispose()
ImprimirPDF("Empresas/Grales/Formatos/OrdenServicio.rdlc", lrds, params, NombreArchivo:=String.Format("OrdenServicio-{0}", CveFolio))
Else
Dim lrds As New List(Of ReportDataSource)
Dim rds As New ReportDataSource With {.Name = "DataSet2", .Value = TmpDTMaterialesOS}
Dim rds2 As New ReportDataSource With {.Name = "DataSet1", .Value = TmpDTOS}
lrds.Add(rds)
lrds.Add(rds2)
ObjOS.Dispose()
ImprimirPDF(String.Format("Empresas/{0}/Formatos/OrdenServicio.rdlc", UsuarioActual.CveEmpresa), lrds, params, NombreArchivo:=String.Format("OrdenServicio-{0}", CveFolio))
End If End If
If ObjOS.GetOrdenesServiciosDetalle(CveOS) Then
TmpDTOS = ObjOS.DtResultados
End If
If ObjOS.GetDetalleMateriales(-1, CveOS) Then
TmpDTMaterialesOS = ObjOS.DtResultados
End If
Dim lrds As New List(Of ReportDataSource)
Dim rds As New ReportDataSource With {.Name = "DataSet2", .Value = TmpDTMaterialesOS}
Dim rds2 As New ReportDataSource With {.Name = "DataSet1", .Value = TmpDTOS}
lrds.Add(rds)
lrds.Add(rds2)
ObjOS.Dispose()
ImprimirPDF(String.Format("Empresas/{0}/Formatos/OrdenServicio.rdlc", UsuarioActual.CveEmpresa), lrds, params, NombreArchivo:=String.Format("OrdenServicio-{0}", CveFolio))
End Sub End Sub
Private Sub CreaDT() Private Sub CreaDT()
TmpDTOS = New DataTable TmpDTOS = New DataTable

View File

@@ -768,6 +768,11 @@ Partial Class Compras_Proveedores
DdlCveUsuarioResponsable.SelectedValue = ObjProveedor.CveUsuarioResponsable.ToString DdlCveUsuarioResponsable.SelectedValue = ObjProveedor.CveUsuarioResponsable.ToString
DdlCveTipoProveedor.SelectedValue = ObjProveedor.CveTipoProveedor.ToString DdlCveTipoProveedor.SelectedValue = ObjProveedor.CveTipoProveedor.ToString
'EMD: Si no es prisila desablita este campo
If UsuarioActual.CveEmpresa = 13 AndAlso Not UsuarioActual.CveUsuario.Contiene(58, 100) Then
DdlCveTipoProveedor.Enabled = False
DdlCveTipoProveedor.Attributes.Add("disabled", "disabled")
End If
If TxtRazonSocial.Text.Trim = TxtNombreComercial.Text.Trim Then TxtRazonSocial.Attributes.Add("onKeyUp", "SetText(" & TxtRazonSocial.ClientID & ", " & TxtNombreComercial.ClientID & ")") If TxtRazonSocial.Text.Trim = TxtNombreComercial.Text.Trim Then TxtRazonSocial.Attributes.Add("onKeyUp", "SetText(" & TxtRazonSocial.ClientID & ", " & TxtNombreComercial.ClientID & ")")

View File

@@ -83,9 +83,9 @@
</style> </style>
</asp:Content> </asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server"> <asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
<li> <%-- <li>
<asp:LinkButton ID="LnkPdf" runat="server"> <i class="fa fa-file-pdf-o" style="font-weight:bold;"></i> PDF</asp:LinkButton> <asp:LinkButton ID="LnkPdf" runat="server"> <i class="fa fa-file-pdf-o" style="font-weight:bold;"></i> PDF</asp:LinkButton>
</li> </li>--%>
<li> <li>
<asp:LinkButton ID="ImgExcel" runat="server"><i class="fa fa-file-excel-o" style="font-weight:bold;"></i> Excel</asp:LinkButton> <asp:LinkButton ID="ImgExcel" runat="server"><i class="fa fa-file-excel-o" style="font-weight:bold;"></i> Excel</asp:LinkButton>
</li> </li>
@@ -121,7 +121,7 @@
<div class="row"> <div class="row">
<label class="col-md-1 truncate" data-toggle="tooltip" title="Almacén Destino">Proveedor:</label> <label class="col-md-1 truncate" data-toggle="tooltip" title="Almacén Destino">Proveedor:</label>
<div class="col-md-2"> <div class="col-md-2">
<asp:DropDownList ID="DdlProveedor" DataTextField="RazonSocial" DataValueField="CveProveedor" CssClass="form-control input-sm input-small select2me" Width="150px" runat="server"></asp:DropDownList> <ADS:Dropdownlost ID="DdlProveedor" runat="server" CssStyle="width: 100%;" Width="100%" DataTextField="RazonSocial" DataValueField="CveProveedor" ></ADS:Dropdownlost>
</div> </div>
</div> </div>
</div> </div>
@@ -141,18 +141,17 @@
</div> </div>
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="True" EmptyDataText="No se encontró información" <asp:GridView ID="GvDatos" runat="server" ShowHeader="true" EmptyDataText="No hay registros." AutoGenerateColumns="True"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" ShowFooter="True" ShowHeaderWhenEmpty="True" HeaderStyle-CssClass="Texto" CssClass="table table-striped table-hover Widthall ScrollAD" data-sort="true" GridLines="None">
data-sort="true" Style="text-align: center;" GridLines="None" ShowHeader="true" DataKeyNames="CvePS">
<Columns> <Columns>
<%-- <asp:TemplateField HeaderText="PS" ItemStyle-HorizontalAlign="Left"> <%-- <asp:TemplateField HeaderText="PS" ItemStyle-HorizontalAlign="Left">
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="HplREQ" runat="server" Text='<%# Eval("PS") %>'></asp:Literal> <asp:Literal ID="HplREQ" runat="server" Text='<%# Eval("PS") %>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>--%>
<asp:TemplateField HeaderText="Ultima Compra" ItemStyle-HorizontalAlign="Right"> <%-- <asp:TemplateField HeaderText="Ultima Compra" ItemStyle-HorizontalAlign="Right">
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="HplOC" runat="server" Text='<%# Eval("UltCompra", "{0:N2}") %>'></asp:Literal> <asp:Literal ID="HplOC" runat="server" Text='<%# Eval("UltCompra", "{0:N2}") %>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
@@ -163,11 +162,10 @@
<asp:Literal ID="HplOC2" runat="server" Text='<%# Eval("PrecioLista", "{0:N2}") %>'></asp:Literal> <asp:Literal ID="HplOC2" runat="server" Text='<%# Eval("PrecioLista", "{0:N2}") %>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField>--%> </asp:TemplateField>--%>
</Columns> </Columns>
<HeaderStyle CssClass="Titulos" /> <%-- <HeaderStyle CssClass="Titulos" />
<RowStyle CssClass="Texto" /> <RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" /> <AlternatingRowStyle CssClass="TextoAlterno" />--%>
</asp:GridView> </asp:GridView>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>

View File

@@ -22,7 +22,7 @@ Partial Class RepComprasPrecios
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then If Not Page.IsPostBack Then
CargaProveedor() CargaProveedor()
CargaDatos() 'CargaDatos()
End If End If
End Sub End Sub
@@ -33,11 +33,12 @@ Partial Class RepComprasPrecios
If ObjCompras.GetRepComprasPrecios(DdlProveedor.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then If ObjCompras.GetRepComprasPrecios(DdlProveedor.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
GvDatos.DataSource = ObjCompras.DtResultados GvDatos.DataSource = ObjCompras.DtResultados
DtCompras = ObjCompras.DtResultados DtCompras = ObjCompras.DtResultados
GvDatos.DataBind()
UPDatos.Update()
End If End If
ObjCompras.Dispose() ObjCompras.Dispose()
GvDatos.DataBind()
UPDatos.Update()
End Sub End Sub
#End Region #End Region
@@ -45,11 +46,14 @@ Partial Class RepComprasPrecios
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.RowType = DataControlRowType.DataRow Then
'GvDatos.Columns(1).ItemStyle.Width = New Unit("500px")
GvDatos.HeaderRow.Cells(0).Visible = False GvDatos.HeaderRow.Cells(0).Visible = False
e.Row.Cells(0).Visible = False e.Row.Cells(0).Visible = False
e.Row.HorizontalAlign = HorizontalAlign.Right e.Row.HorizontalAlign = HorizontalAlign.Right
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(1).Width = Unit.Pixel(125)
If e.Row.DBCampo("CvePS") = "" Then If e.Row.DBCampo("CvePS") = "" Then
e.Row.CssClass = "Totales" e.Row.CssClass = "Totales"
@@ -70,64 +74,31 @@ Partial Class RepComprasPrecios
End If End If
Next Next
'Cuando es titulo
'If e.Row.DBCampo("PS").ToString.Trim = "" Then
' e.Row.CssClass = "Totales"
' e.Row.Cells(0).Text = String.Format("Folio: <a class=""texto"" style=""color:white;"" target='_blank' href='/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}'>{0}</a> ", e.Row.DBCampo("FolioSalida"), e.Row.DBCampo("CveMovimientoSalida"))
' e.Row.Cells(1).Text = String.Format("{0}", e.Row.DBCampo("FechaMovto").ToString.ToDate.ToShortDateString)
' e.Row.Cells(3).Text = String.Format("Almacen Destino: {0} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Responsable: {1}", e.Row.DBCampo("AlmacenDestino"), e.Row.DBCampo("Recibio"))
'End If
End If End If
End Sub End Sub
#End Region #End Region
#Region "CARGA COMBOS FILTRO" #Region "CARGA COMBOS FILTRO"
Private Sub CargaProveedor() Private Sub CargaProveedor()
DdlProveedor.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa) DdlProveedor.setEsWebService(True)
DdlProveedor.DataBind() DdlProveedor.Attributes.Add("data-metodo", "getproveedores")
DdlProveedor.Items.Insert(0, New ListItem("Todos", "-1")) DdlProveedor.SelectedText = "Todos"
DdlProveedor.SelectedValue = "-1" DdlProveedor.SelectedValue = "-1"
End Sub End Sub
#End Region #End Region
#Region "IMPRESION" #Region "IMPRESION"
Private Sub LnkPdf_Click(sender As Object, e As EventArgs) Handles LnkPdf.Click 'Private Sub LnkPdf_Click(sender As Object, e As EventArgs) Handles LnkPdf.Click
Imprime("PDF") ' Imprime("PDF")
End Sub 'End Sub
Private Sub Imprime(Formato As String) Private Sub Imprime(Formato As String)
'If DtInventarios IsNot Nothing Then If DtCompras IsNot Nothing Then
' Dim StrFiltro As New StringBuilder Dim StrFiltro As New StringBuilder
' If txtFechaI.Text <> "" Then StrFiltro.AppendFormat("&emsp;<b>Fecha Inicio:</b> {0}", txtFechaI.Text.ToDate.ToShortDateString) StrFiltro.AppendFormat("Proveedor: {0},", DdlProveedor.SelectedText)
' If txtFechaF.Text <> "" Then StrFiltro.AppendFormat("&emsp;<b>Fecha Fin:</b> {0}", txtFechaF.Text.ToDate.ToShortDateString) GvDatos.ExportToExcelG("RepComprasPrecios.xlsx", "Reporte de Precios de Compras", UsuarioActual, StrFiltro.ToString, 100, 200)
Else
' If DdlAlmacenOrigen.SelectedValue <> "-1" Then StrFiltro.AppendFormat("&emsp;<b>Almacén Origen:</b> {0}", DdlAlmacenOrigen.SelectedItem.Text) Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
' If DdlAlmacenDestino.SelectedValue <> "-1" Then StrFiltro.AppendFormat("&emsp;<b>Almacén Destino:</b> {0}", DdlAlmacenDestino.SelectedItem.Text) End If
' If ChkRecibido.Checked Then StrFiltro.AppendFormat("&emsp;<b>Recibidos: </b>Si") Else StrFiltro.AppendFormat("&emsp;<b>Recibidos: </b>No")
' Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
' Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
' Dim FechaI, FechaF As String
' FechaI = If(txtFechaI.Text = "" Or txtFechaI.Text = "__/__/____", "-1", txtFechaI.Text)
' FechaF = If(txtFechaF.Text = "" Or txtFechaF.Text = "__/__/____", "-1", txtFechaF.Text)
' Dim params As New List(Of ReportParameter)
' params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
' params.Add(New ReportParameter("FechaInicio", FechaI))
' params.Add(New ReportParameter("FechaFin", FechaF))
' params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
' params.Add(New ReportParameter("Filtros", StrFiltro.ToString))
' If Imagen.Exists Then
' params.Add(New ReportParameter("LogoPath", logouri))
' Else
' params.Add(New ReportParameter("LogoPath", ""))
' End If
' ImprimirPDF("Empresas/Grales/Formatos/RepTraspasoAlmacen.rdlc", DtInventarios, params, String.Format("RepTraspasoAlmacen-{0}", Now.ToDateTime.ToShortDateString), Formato)
'Else
' Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
'End If
End Sub End Sub
#End Region #End Region
Private Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click Private Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
@@ -137,4 +108,6 @@ Partial Class RepComprasPrecios
Private Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click Private Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
Imprime("Excel") Imprime("Excel")
End Sub End Sub
Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control)
End Sub
End Class End Class

View File

@@ -169,7 +169,7 @@ Partial Class Compras_RepNotasCredito
MsgError = "Ocurrio un Error al saldar el movimiento" MsgError = "Ocurrio un Error al saldar el movimiento"
End If End If
If TC <> TCCompra AndAlso CveMoneda > 1 AndAlso UsaComplementaria Then If TC <> TCCompra AndAlso CveMoneda > 1 Then
Dim difFluctuacion As Decimal = TC - TCCompra Dim difFluctuacion As Decimal = TC - TCCompra
Dim CveConceptoFluctua As Integer = 64 '64.ganacia, 65.perdida Dim CveConceptoFluctua As Integer = 64 '64.ganacia, 65.perdida
Dim TipoMovtoFluctua As Boolean = True Dim TipoMovtoFluctua As Boolean = True

View File

@@ -152,7 +152,7 @@
</div> </div>
</div> </div>
<label class="col-md-1">Sucursal:</label> <label class="col-md-1">SubProyecto:</label>
<div class="col-md-3"> <div class="col-md-3">
<asp:DropDownList ID="DdlSucursal" Width="150px" AppendDataBoundItems="true" runat="server" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm input-small select2me"></asp:DropDownList> <asp:DropDownList ID="DdlSucursal" Width="150px" AppendDataBoundItems="true" runat="server" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm input-small select2me"></asp:DropDownList>
</div> </div>
@@ -165,7 +165,7 @@
<div class="row"> <div class="row">
<label class="col-md-1 truncate" data-toggle="tooltip" title="Almacén Destino">Proveedor:</label> <label class="col-md-1 truncate" data-toggle="tooltip" title="Almacén Destino">Proveedor:</label>
<div class="col-md-2"> <div class="col-md-2">
<asp:DropDownList ID="DdlProveedor" DataTextField="RazonSocial" DataValueField="CveProveedor" CssClass="form-control input-sm input-small select2me" Width="150px" runat="server"></asp:DropDownList> <ADS:Dropdownlost ID="DdlProveedor" runat="server" CssStyle="width: 100%;" Width="100%" DataTextField="RazonSocial" DataValueField="CveProveedor" ></ADS:Dropdownlost>
</div> </div>
<%-- <label class="col-md-1 truncate">Recibido:</label> <%-- <label class="col-md-1 truncate">Recibido:</label>

View File

@@ -100,15 +100,15 @@ Partial Class RepReqOCCompraInv
#Region "CARGA COMBOS FILTRO" #Region "CARGA COMBOS FILTRO"
Private Sub CargaSucursal() Private Sub CargaSucursal()
DdlSucursal.DataSource = GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa) DdlSucursal.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa)
DdlSucursal.DataBind() DdlSucursal.DataBind()
DdlSucursal.Items.Insert(0, New ListItem("Todos", "-1")) DdlSucursal.Items.Insert(0, New ListItem("Todos", "-1"))
DdlSucursal.SelectedValue = "-1" DdlSucursal.SelectedValue = "-1"
End Sub End Sub
Private Sub CargaProveedor() Private Sub CargaProveedor()
DdlProveedor.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa) DdlProveedor.setEsWebService(True)
DdlProveedor.DataBind() DdlProveedor.Attributes.Add("data-metodo", "getproveedores")
DdlProveedor.Items.Insert(0, New ListItem("Todos", "-1")) DdlProveedor.SelectedText = "Todos"
DdlProveedor.SelectedValue = "-1" DdlProveedor.SelectedValue = "-1"
End Sub End Sub
#End Region #End Region

View File

@@ -15,76 +15,78 @@
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server"> <asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<table class="table table-striped table-hover"> <table class="table table-striped table-hover" id="tcontaheader">
<thead> <thead>
<tr class="Titulos"> <tr class="Titulos">
<th width="110px"> <th >
<asp:LinkButton ID="LbCveConceptoContable" runat="server" CausesValidation="false" Text="" CommandArgument="CveConceptoContable" OnClick="LbOrden_Click"> <asp:LinkButton ID="LbCveConceptoContable" runat="server" CausesValidation="false" Text="" CommandArgument="CveConceptoContable" OnClick="LbOrden_Click">
Clave Clave
<asp:Literal ID="ImgCveConceptoContable" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal> <asp:Literal ID="ImgCveConceptoContable" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton> </asp:LinkButton>
</th> </th>
<th width="110px"> <th >
<asp:LinkButton ID="LbTipo" runat="server" CausesValidation="false" Text="" CommandArgument="Tipo" OnClick="LbOrden_Click"> <asp:LinkButton ID="LbTipo" runat="server" CausesValidation="false" Text="" CommandArgument="Tipo" OnClick="LbOrden_Click">
Tipo Tipo
<asp:Literal ID="ImgTipo" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal> <asp:Literal ID="ImgTipo" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton> </asp:LinkButton>
</th> </th>
<th width="260px"> <th >
<asp:LinkButton ID="LbConceptoContable" runat="server" CausesValidation="false" Text="" CommandArgument="ConceptoContable" OnClick="LbOrden_Click"> <asp:LinkButton ID="LbConceptoContable" runat="server" CausesValidation="false" Text="" CommandArgument="ConceptoContable" OnClick="LbOrden_Click">
Concepto Contable Concepto Contable
<asp:Literal ID="ImgConceptoContable" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal> <asp:Literal ID="ImgConceptoContable" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton> </asp:LinkButton>
</th> </th>
<th width="100px"> <th >
<asp:LinkButton ID="LbEstado" runat="server" CausesValidation="false" Text="" CommandArgument="Estado" OnClick="LbOrden_Click"> <asp:LinkButton ID="LbEstado" runat="server" CausesValidation="false" Text="" CommandArgument="Estado" OnClick="LbOrden_Click">
Estado Estado
<asp:Literal ID="ImgEstado" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal> <asp:Literal ID="ImgEstado" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton> </asp:LinkButton>
</th> </th>
<th width="100px"> <th >
<asp:LinkButton ID="LbFechaIng" runat="server" CausesValidation="false" Text="" CommandArgument="FechaIng" OnClick="LbOrden_Click"> <asp:LinkButton ID="LbFechaIng" runat="server" CausesValidation="false" Text="" CommandArgument="FechaIng" OnClick="LbOrden_Click">
Fecha Ing Fecha Ing
<asp:Literal ID="ImgFechaIng" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal> <asp:Literal ID="ImgFechaIng" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton> </asp:LinkButton>
</th> </th>
<th width="100px"> <th >
<asp:LinkButton ID="LbUsuario" runat="server" CausesValidation="false" Text="" CommandArgument="Usuario" OnClick="LbOrden_Click"> <asp:LinkButton ID="LbUsuario" runat="server" CausesValidation="false" Text="" CommandArgument="Usuario" OnClick="LbOrden_Click">
Usuario Usuario
<asp:Literal ID="ImgUsuario" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal> <asp:Literal ID="ImgUsuario" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton> </asp:LinkButton>
</th> </th>
<th width="161px">Comandos</th> <th colspan="2">Comandos</th>
</tr>
<tr>
<th style="text-align: center;">
<asp:TextBox ID="TxtCveConceptoContable" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardar" Width="84px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVCveConceptoContable" runat="server" ControlToValidate="TxtCveConceptoContable" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Clave''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCCveConceptoContable" runat="server" HighlightCssClass="vco" TargetControlID="RFVCveConceptoContable" Width="300px"></ajax:ValidatorCalloutExtender>
</th>
<th style="text-align: center;">
<asp:TextBox ID="TxtTipo" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardar" Width="84px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVTipo" runat="server" ControlToValidate="TxtTipo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCTipo" runat="server" HighlightCssClass="vco" TargetControlID="RFVTipo" Width="300px"></ajax:ValidatorCalloutExtender>
</th>
<th style="text-align: center;">
<asp:TextBox ID="TxtConceptoContable" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardar" Width="234px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVConceptoContable" runat="server" ControlToValidate="TxtConceptoContable" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Concepto Contable'</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCConceptoContable" runat="server" HighlightCssClass="vco" TargetControlID="RFVConceptoContable" Width="300px"></ajax:ValidatorCalloutExtender>
</th>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th style="text-align: center;" colspan="2">
<asp:LinkButton ID="LbAgregar" runat="server" CausesValidation="true" CssClass="btn btn-default" Text="Agregar" ValidationGroup="GrpGuardar"></asp:LinkButton></th>
</tr> </tr>
</thead> </thead>
<tr>
<td style="text-align: center;">
<asp:TextBox ID="TxtCveConceptoContable" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardar" Width="84px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVCveConceptoContable" runat="server" ControlToValidate="TxtCveConceptoContable" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Clave''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCCveConceptoContable" runat="server" HighlightCssClass="vco" TargetControlID="RFVCveConceptoContable" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td style="text-align: center;">
<asp:TextBox ID="TxtTipo" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardar" Width="84px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVTipo" runat="server" ControlToValidate="TxtTipo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCTipo" runat="server" HighlightCssClass="vco" TargetControlID="RFVTipo" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td style="text-align: center;">
<asp:TextBox ID="TxtConceptoContable" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardar" Width="234px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVConceptoContable" runat="server" ControlToValidate="TxtConceptoContable" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Concepto Contable'</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCConceptoContable" runat="server" HighlightCssClass="vco" TargetControlID="RFVConceptoContable" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td style="text-align: center;">
<asp:LinkButton ID="LbAgregar" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardar"></asp:LinkButton></td>
</tr>
</table> </table>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional" >
<ContentTemplate> <ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveConceptoContable" EmptyDataText="No se encontraron Conceptos Contables Registrados" ToolTip="Listado de Estado de Conceptos Contables" CssClass="table table-striped table-advance table-hover" Style="text-align: center;" GridLines="None"> <asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveConceptoContable" data-tableheader="#tcontaheader"
EmptyDataText="No se encontraron Conceptos Contables Registrados" ToolTip="Listado de Estado de Conceptos Contables"
CssClass="table table-striped table-advance table-hover ScrollAD Widthall" Style="text-align: center;" GridLines="None">
<Columns> <Columns>
<asp:TemplateField> <asp:TemplateField>
<ItemTemplate> <ItemTemplate>

View File

@@ -1819,15 +1819,19 @@ Partial Class RegPoliza
Dim Referencia As String = Row("Referencia").ToString Dim Referencia As String = Row("Referencia").ToString
Dim Cuenta As String = Row("Código Cuenta").ToString + " - " + Row("Nombre Cuenta").ToString Dim Cuenta As String = Row("Código Cuenta").ToString + " - " + Row("Nombre Cuenta").ToString
Dim Cuenta2 = AgregaComilla(Cuenta) 'Agregar otra comilla simple adicional cuando contenga una
Dim CveCuenta As String = "" Dim CveCuenta As String = ""
If DTCuentas.FiltroPrimero("CtaCodigo = '" & Cuenta & "'") IsNot Nothing Then If DTCuentas.FiltroPrimero("CtaCodigo = '" & Cuenta2 & "'") IsNot Nothing Then
CveCuenta = DTCuentas.FiltroPrimero("CtaCodigo = '" & Cuenta & "'")("Id").ToString CveCuenta = DTCuentas.FiltroPrimero("CtaCodigo = '" & Cuenta2 & "'")("Id").ToString
End If End If
Dim SegNeg As String = Row("SegNeg").ToString Dim SegNeg As String = Row("SegNeg").ToString
Dim SegNeg2 = AgregaComilla(SegNeg) 'Agregar otra comilla simple adicional cuando contenga una
Dim IdSegNeg As String = "" Dim IdSegNeg As String = ""
If DTSegmentosNegocio.FiltroPrimero("Nombre = '" & SegNeg & "'") IsNot Nothing Then If DTSegmentosNegocio.FiltroPrimero("Nombre = '" & SegNeg2 & "'") IsNot Nothing Then
IdSegNeg = DTSegmentosNegocio.FiltroPrimero("Nombre = '" & SegNeg & "'")("Id").ToString IdSegNeg = DTSegmentosNegocio.FiltroPrimero("Nombre = '" & SegNeg2 & "'")("Id").ToString
End If End If
Dim Concepto As String = Row("Nombre/Concepto").ToString Dim Concepto As String = Row("Nombre/Concepto").ToString
@@ -1884,4 +1888,18 @@ Partial Class RegPoliza
DescargarFormato() DescargarFormato()
End Sub End Sub
Private Function AgregaComilla(str As String) As String
If str.Contains("'") Then
Dim arr = Split(str, "'")
str = ""
For i = 0 To arr.Length() - 1
If i = arr.Length - 1 Then
str += arr(i)
Else
str += arr(i) + "''"
End If
Next
End If
Return str
End Function
End Class End Class

View File

@@ -386,12 +386,19 @@
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" Width="100%" EmptyDataText="No se encontraron Ventas con los filtros especificados" data-sort="true" ToolTip="Listado de Ventas" CssClass="ScrollAD table table-striped table-hover Widthall" data-heighterror="320" data-freezecols="0" data-freezerows="0" GridLines="None" <asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" Width="100%"
DataKeyNames="CveVenta"> EmptyDataText="No se encontraron Ventas con los filtros especificados" data-sort="true" ToolTip="Listado de Ventas"
CssClass="ScrollAD table table-striped table-hover Widthall" data-heighterror="320" data-freezecols="0" data-freezerows="0" GridLines="None"
DataKeyNames="CveVenta,TipoDocto">
<Columns> <Columns>
<asp:BoundField HeaderText="TipoDocto" DataField="TipoDocto" ItemStyle-HorizontalAlign="Center" /> <asp:BoundField HeaderText="TipoDocto" DataField="TipoDocto" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField HeaderText="Fecha" DataField="Fecha" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" /> <asp:BoundField HeaderText="Fecha" DataField="Fecha" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" />
<asp:HyperLinkField HeaderText="Folio" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" ControlStyle-Width ="85px" DataTextField="SerieFolio" /> <asp:TemplateField HeaderText="Folio">
<ItemTemplate>
<asp:HyperLink ID="HlFolio" runat="server" ControlStyle-Width="85px"></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<%--<asp:HyperLinkField HeaderText="Folio" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" ControlStyle-Width ="85px" DataTextField="SerieFolio" />--%>
<asp:BoundField HeaderText="Total" DataField="Total" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" /> <asp:BoundField HeaderText="Total" DataField="Total" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="SubTotal" DataField="SubTotal" DataFormatString="{0:N2}" Visible="false" ItemStyle-HorizontalAlign="Right" /> <asp:BoundField HeaderText="SubTotal" DataField="SubTotal" DataFormatString="{0:N2}" Visible="false" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="IVA" DataField="IVA" DataFormatString="{0:N2}" Visible="false" ItemStyle-HorizontalAlign="Right" /> <asp:BoundField HeaderText="IVA" DataField="IVA" DataFormatString="{0:N2}" Visible="false" ItemStyle-HorizontalAlign="Right" />

View File

@@ -432,6 +432,15 @@ Partial Class RepCxCDetalle
If e.Row.RowIndex = 0 Then If e.Row.RowIndex = 0 Then
e.Row.Cells(1).Width = Unit.Pixel(70) e.Row.Cells(1).Width = Unit.Pixel(70)
e.Row.Cells(2).Width = Unit.Pixel(75) e.Row.Cells(2).Width = Unit.Pixel(75)
End If
e.Row.FCHyperLink("HlFolio").Text = e.Row.DBCampo("SerieFolio")
If e.Row.DBCampo("CveVenta").ToEntero() > 0 Then
If e.Row.DBCampo("TipoDocto") = "IxC" Then
e.Row.FCHyperLink("HlFolio").NavigateUrl = String.Format("/Bancos/IE.aspx?CveIE={0}", e.Row.DBCampo("CveVenta"))
Else
e.Row.FCHyperLink("HlFolio").NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveVenta={0}", e.Row.DBCampo("CveVenta"))
End If
End If End If
If e.Row.DBCampo("SubProyecto") = "" And e.Row.DBCampo("CveMoneda") = "1" Then If e.Row.DBCampo("SubProyecto") = "" And e.Row.DBCampo("CveMoneda") = "1" Then
@@ -927,22 +936,27 @@ Partial Class RepCxCDetalle
UPPersonalizar.Update() UPPersonalizar.Update()
UpCobranza.Update() UpCobranza.Update()
End Sub End Sub
Private Sub BtnAsignaCobranza_Click(sender As Object, e As EventArgs) Handles BtnAsignaCobranza.Click Private Sub BtnAsignaCobranza_Click(sender As Object, e As EventArgs) Handles BtnAsignaCobranza.Click
Dim ObjVentas As New ClsVentas
Dim time As DateTime Dim time As DateTime
Dim TieneError = False Dim TieneError = False
Dim ObjVentas As New ClsVentas
ObjVentas.IniciaTransacSQL() ObjVentas.IniciaTransacSQL()
Try
For Each row As GridViewRow In GvDatos.Rows For Each row As GridViewRow In GvDatos.Rows
If row.FCCheckBox("ChkCobranza").Checked Then Dim TipoDocto As String = row.DataKey("TipoDocto")
time = DateTime.Parse(String.Format("{0} {1}:{2} {3}", TxtFechaCobranza.Text, TimeSelector.Hour, TimeSelector.Minute, TimeSelector.AmPm)) If row.FCCheckBox("ChkCobranza").Checked AndAlso TipoDocto <> "IxC" Then
If Not ObjVentas.UpdateAsignaVentaCobranza(row.DataKey("CveVenta").ToEntero, DdlCobranzaEstatus.SelectedValue.ToEntero, DdlUsuarioCobranza.SelectedValue.ToEntero, DdlTurnoCobranza.SelectedValue.ToEntero, TxtObservacionCobranza.Text.Trim, time) Then time = DateTime.Parse(String.Format("{0} {1}:{2} {3}", TxtFechaCobranza.Text, TimeSelector.Hour, TimeSelector.Minute, TimeSelector.AmPm))
TieneError = True If Not ObjVentas.UpdateAsignaVentaCobranza(row.DataKey("CveVenta").ToEntero, DdlCobranzaEstatus.SelectedValue.ToEntero, DdlUsuarioCobranza.SelectedValue.ToEntero, DdlTurnoCobranza.SelectedValue.ToEntero, TxtObservacionCobranza.Text.Trim, time) Then
End If TieneError = True
End If End If
End If
Next
Next
Catch ex As Exception
OnError("Ocurrió un error al actualizar", ex)
TieneError = True
End Try
If Not TieneError Then If Not TieneError Then
ObjVentas.Commit() ObjVentas.Commit()
@@ -955,11 +969,11 @@ Partial Class RepCxCDetalle
ObjVentas.Dispose() ObjVentas.Dispose()
CargaDatos() CargaDatos()
End Sub End Sub
#End Region #End Region
#Region "SELECTED INDEX CHANGE" #Region "SELECTED INDEX CHANGE"
Protected Sub DdlClienteClasificacion_SelectedIndexChanged(sender As Object, e As EventArgs) Protected Sub DdlClienteClasificacion_SelectedIndexChanged(sender As Object, e As EventArgs)
CargaClientes() CargaClientes()

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -23,7 +23,7 @@
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox165</rd:DefaultName> <rd:DefaultName>Textbox165</rd:DefaultName>
<Top>3.63358cm</Top> <Top>3.63358cm</Top>
<Left>0.07cm</Left> <Left>0.11767cm</Left>
<Height>0.47364cm</Height> <Height>0.47364cm</Height>
<Width>18.64497cm</Width> <Width>18.64497cm</Width>
<Style> <Style>
@@ -78,7 +78,7 @@
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox165</rd:DefaultName> <rd:DefaultName>Textbox165</rd:DefaultName>
<Top>0.5338cm</Top> <Top>0.5338cm</Top>
<Left>8.84441cm</Left> <Left>8.89208cm</Left>
<Height>0.47364cm</Height> <Height>0.47364cm</Height>
<Width>4.43083cm</Width> <Width>4.43083cm</Width>
<ZIndex>1</ZIndex> <ZIndex>1</ZIndex>
@@ -134,7 +134,7 @@
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox165</rd:DefaultName> <rd:DefaultName>Textbox165</rd:DefaultName>
<Top>6.93966cm</Top> <Top>6.93966cm</Top>
<Left>0.07344cm</Left> <Left>0.12111cm</Left>
<Height>0.48cm</Height> <Height>0.48cm</Height>
<Width>18.65153cm</Width> <Width>18.65153cm</Width>
<ZIndex>2</ZIndex> <ZIndex>2</ZIndex>
@@ -190,7 +190,7 @@
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox165</rd:DefaultName> <rd:DefaultName>Textbox165</rd:DefaultName>
<Top>2.08369cm</Top> <Top>2.08369cm</Top>
<Left>8.84441cm</Left> <Left>8.89208cm</Left>
<Height>0.47364cm</Height> <Height>0.47364cm</Height>
<Width>4.43083cm</Width> <Width>4.43083cm</Width>
<ZIndex>3</ZIndex> <ZIndex>3</ZIndex>
@@ -246,7 +246,7 @@
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox165</rd:DefaultName> <rd:DefaultName>Textbox165</rd:DefaultName>
<Top>0.5338cm</Top> <Top>0.5338cm</Top>
<Left>13.45163cm</Left> <Left>13.4993cm</Left>
<Height>0.47364cm</Height> <Height>0.47364cm</Height>
<Width>5.24334cm</Width> <Width>5.24334cm</Width>
<ZIndex>4</ZIndex> <ZIndex>4</ZIndex>
@@ -302,7 +302,7 @@
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox165</rd:DefaultName> <rd:DefaultName>Textbox165</rd:DefaultName>
<Top>1.00743cm</Top> <Top>1.00743cm</Top>
<Left>13.45163cm</Left> <Left>13.4993cm</Left>
<Height>0.97042cm</Height> <Height>0.97042cm</Height>
<Width>5.26334cm</Width> <Width>5.26334cm</Width>
<ZIndex>5</ZIndex> <ZIndex>5</ZIndex>
@@ -358,7 +358,7 @@
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox165</rd:DefaultName> <rd:DefaultName>Textbox165</rd:DefaultName>
<Top>2.62788cm</Top> <Top>2.62788cm</Top>
<Left>13.45163cm</Left> <Left>13.4993cm</Left>
<Height>0.89986cm</Height> <Height>0.89986cm</Height>
<Width>5.26334cm</Width> <Width>5.26334cm</Width>
<ZIndex>6</ZIndex> <ZIndex>6</ZIndex>
@@ -414,7 +414,7 @@
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox165</rd:DefaultName> <rd:DefaultName>Textbox165</rd:DefaultName>
<Top>2.15424cm</Top> <Top>2.15424cm</Top>
<Left>13.45163cm</Left> <Left>13.4993cm</Left>
<Height>0.47364cm</Height> <Height>0.47364cm</Height>
<Width>5.25334cm</Width> <Width>5.25334cm</Width>
<ZIndex>7</ZIndex> <ZIndex>7</ZIndex>
@@ -454,7 +454,7 @@
<Value>Logo1</Value> <Value>Logo1</Value>
<Sizing>FitProportional</Sizing> <Sizing>FitProportional</Sizing>
<Top>0.1546in</Top> <Top>0.1546in</Top>
<Left>0.07918in</Left> <Left>0.09795in</Left>
<Height>1.2065in</Height> <Height>1.2065in</Height>
<Width>1.21875in</Width> <Width>1.21875in</Width>
<ZIndex>8</ZIndex> <ZIndex>8</ZIndex>
@@ -503,7 +503,7 @@
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox165</rd:DefaultName> <rd:DefaultName>Textbox165</rd:DefaultName>
<Top>1.00743cm</Top> <Top>1.00743cm</Top>
<Left>3.29673cm</Left> <Left>3.3444cm</Left>
<Height>2.52032cm</Height> <Height>2.52032cm</Height>
<Width>5.37129cm</Width> <Width>5.37129cm</Width>
<ZIndex>9</ZIndex> <ZIndex>9</ZIndex>
@@ -560,8 +560,8 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox165</rd:DefaultName> <rd:DefaultName>Textbox165</rd:DefaultName>
<Top>9.69619cm</Top> <Top>10.0666cm</Top>
<Left>0.07cm</Left> <Left>0.13112cm</Left>
<Height>0.44775cm</Height> <Height>0.44775cm</Height>
<Width>18.65497cm</Width> <Width>18.65497cm</Width>
<ZIndex>10</ZIndex> <ZIndex>10</ZIndex>
@@ -616,8 +616,8 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox165</rd:DefaultName> <rd:DefaultName>Textbox165</rd:DefaultName>
<Top>13.43126cm</Top> <Top>13.97806cm</Top>
<Left>0.07cm</Left> <Left>0.13112cm</Left>
<Height>0.99688cm</Height> <Height>0.99688cm</Height>
<Width>18.64497cm</Width> <Width>18.64497cm</Width>
<ZIndex>11</ZIndex> <ZIndex>11</ZIndex>
@@ -672,8 +672,8 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox165</rd:DefaultName> <rd:DefaultName>Textbox165</rd:DefaultName>
<Top>12.95762cm</Top> <Top>13.39858cm</Top>
<Left>0.07cm</Left> <Left>0.13112cm</Left>
<Height>0.47364cm</Height> <Height>0.47364cm</Height>
<Width>18.64497cm</Width> <Width>18.64497cm</Width>
<ZIndex>12</ZIndex> <ZIndex>12</ZIndex>
@@ -744,8 +744,8 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox165</rd:DefaultName> <rd:DefaultName>Textbox165</rd:DefaultName>
<Top>15.56836cm</Top> <Top>16.28274cm</Top>
<Left>0.20112cm</Left> <Left>0.13112cm</Left>
<Height>0.89754cm</Height> <Height>0.89754cm</Height>
<Width>6.17587cm</Width> <Width>6.17587cm</Width>
<ZIndex>13</ZIndex> <ZIndex>13</ZIndex>
@@ -816,8 +816,8 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox165</rd:DefaultName> <rd:DefaultName>Textbox165</rd:DefaultName>
<Top>15.56836cm</Top> <Top>16.28274cm</Top>
<Left>6.67991cm</Left> <Left>6.48338cm</Left>
<Height>0.89754cm</Height> <Height>0.89754cm</Height>
<Width>6.17587cm</Width> <Width>6.17587cm</Width>
<ZIndex>14</ZIndex> <ZIndex>14</ZIndex>
@@ -873,10 +873,10 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox165</rd:DefaultName> <rd:DefaultName>Textbox165</rd:DefaultName>
<Top>15.56836cm</Top> <Top>16.28274cm</Top>
<Left>13.29827cm</Left> <Left>12.96369cm</Left>
<Height>0.89754cm</Height> <Height>0.89754cm</Height>
<Width>5.28334cm</Width> <Width>5.54792cm</Width>
<ZIndex>15</ZIndex> <ZIndex>15</ZIndex>
<Style> <Style>
<Border> <Border>
@@ -929,8 +929,8 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox165</rd:DefaultName> <rd:DefaultName>Textbox165</rd:DefaultName>
<Top>16.4659cm</Top> <Top>17.68299cm</Top>
<Left>0.20112cm</Left> <Left>0.13112cm</Left>
<Height>0.47421cm</Height> <Height>0.47421cm</Height>
<Width>18.64497cm</Width> <Width>18.64497cm</Width>
<ZIndex>16</ZIndex> <ZIndex>16</ZIndex>
@@ -999,8 +999,8 @@ Compuproveeores no se hace responsable por el resguardo de su equipo.</Value>
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox165</rd:DefaultName> <rd:DefaultName>Textbox165</rd:DefaultName>
<Top>16.94011cm</Top> <Top>18.58053cm</Top>
<Left>0.20112cm</Left> <Left>0.13112cm</Left>
<Height>7.1417cm</Height> <Height>7.1417cm</Height>
<Width>17.72549cm</Width> <Width>17.72549cm</Width>
<ZIndex>17</ZIndex> <ZIndex>17</ZIndex>
@@ -1052,8 +1052,8 @@ Compuproveeores no se hace responsable por el resguardo de su equipo.</Value>
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Copia</rd:DefaultName> <rd:DefaultName>Copia</rd:DefaultName>
<Top>24.08181cm</Top> <Top>25.72223cm</Top>
<Left>0.20112cm</Left> <Left>0.13112cm</Left>
<Height>0.6cm</Height> <Height>0.6cm</Height>
<Width>18.38049cm</Width> <Width>18.38049cm</Width>
<ZIndex>18</ZIndex> <ZIndex>18</ZIndex>
@@ -1466,8 +1466,8 @@ Compuproveeores no se hace responsable por el resguardo de su equipo.</Value>
</TablixRowHierarchy> </TablixRowHierarchy>
<DataSetName>DataSet1</DataSetName> <DataSetName>DataSet1</DataSetName>
<Top>4.10722cm</Top> <Top>4.10722cm</Top>
<Left>0.07cm</Left> <Left>0.11767cm</Left>
<Height>2.26772cm</Height> <Height>2.26771cm</Height>
<Width>18.62496cm</Width> <Width>18.62496cm</Width>
<ZIndex>19</ZIndex> <ZIndex>19</ZIndex>
<Style> <Style>
@@ -1525,7 +1525,7 @@ Compuproveeores no se hace responsable por el resguardo de su equipo.</Value>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox21</rd:DefaultName> <rd:DefaultName>Textbox21</rd:DefaultName>
<Top>6.37494cm</Top> <Top>6.37494cm</Top>
<Left>0.07cm</Left> <Left>0.11767cm</Left>
<Height>0.49417cm</Height> <Height>0.49417cm</Height>
<Width>18.64497cm</Width> <Width>18.64497cm</Width>
<ZIndex>20</ZIndex> <ZIndex>20</ZIndex>
@@ -1712,7 +1712,7 @@ Compuproveeores no se hace responsable por el resguardo de su equipo.</Value>
</TablixRowHierarchy> </TablixRowHierarchy>
<DataSetName>DataSet1</DataSetName> <DataSetName>DataSet1</DataSetName>
<Top>1.00743cm</Top> <Top>1.00743cm</Top>
<Left>8.84441cm</Left> <Left>8.89208cm</Left>
<Height>0.97042cm</Height> <Height>0.97042cm</Height>
<Width>4.43082cm</Width> <Width>4.43082cm</Width>
<ZIndex>21</ZIndex> <ZIndex>21</ZIndex>
@@ -1895,7 +1895,7 @@ Compuproveeores no se hace responsable por el resguardo de su equipo.</Value>
</TablixRowHierarchy> </TablixRowHierarchy>
<DataSetName>DataSet1</DataSetName> <DataSetName>DataSet1</DataSetName>
<Top>2.55733cm</Top> <Top>2.55733cm</Top>
<Left>8.84441cm</Left> <Left>8.89208cm</Left>
<Height>0.97042cm</Height> <Height>0.97042cm</Height>
<Width>4.43082cm</Width> <Width>4.43082cm</Width>
<ZIndex>22</ZIndex> <ZIndex>22</ZIndex>
@@ -2106,9 +2106,9 @@ Compuproveeores no se hace responsable por el resguardo de su equipo.</Value>
</TablixRowHierarchy> </TablixRowHierarchy>
<DataSetName>DataSet1</DataSetName> <DataSetName>DataSet1</DataSetName>
<Top>7.41966cm</Top> <Top>7.41966cm</Top>
<Left>0.07344cm</Left> <Left>0.12111cm</Left>
<Height>1.09417cm</Height> <Height>1.09416cm</Height>
<Width>18.65497cm</Width> <Width>18.65498cm</Width>
<ZIndex>23</ZIndex> <ZIndex>23</ZIndex>
<Style> <Style>
<Border> <Border>
@@ -2117,113 +2117,6 @@ Compuproveeores no se hace responsable por el resguardo de su equipo.</Value>
<FontSize>9pt</FontSize> <FontSize>9pt</FontSize>
</Style> </Style>
</Tablix> </Tablix>
<Tablix Name="Tablix3">
<TablixBody>
<TablixColumns>
<TablixColumn>
<Width>9.30904cm</Width>
</TablixColumn>
</TablixColumns>
<TablixRows>
<TablixRow>
<Height>0.6cm</Height>
<TablixCells>
<TablixCell>
<CellContents>
<Textbox Name="Textbox23">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Equipo</Value>
<Style>
<FontWeight>Bold</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox23</rd:DefaultName>
<Style>
<Border>
<Style>Solid</Style>
</Border>
<BackgroundColor>Silver</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
</TablixCells>
</TablixRow>
<TablixRow>
<Height>0.44125cm</Height>
<TablixCells>
<TablixCell>
<CellContents>
<Textbox Name="Textbox29">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Parameters!Equipo.Value</Value>
<Style>
<FontSize>7pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox29</rd:DefaultName>
<Style>
<Border>
<Style>Solid</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
</TablixCells>
</TablixRow>
</TablixRows>
</TablixBody>
<TablixColumnHierarchy>
<TablixMembers>
<TablixMember />
</TablixMembers>
</TablixColumnHierarchy>
<TablixRowHierarchy>
<TablixMembers>
<TablixMember />
<TablixMember />
</TablixMembers>
</TablixRowHierarchy>
<Top>8.58438cm</Top>
<Left>0.07344cm</Left>
<Height>1.04125cm</Height>
<Width>9.30904cm</Width>
<ZIndex>24</ZIndex>
<Style>
<Border>
<Style>Solid</Style>
</Border>
</Style>
</Tablix>
<Textbox Name="Textbox32"> <Textbox Name="Textbox32">
<CanGrow>true</CanGrow> <CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether> <KeepTogether>true</KeepTogether>
@@ -2318,11 +2211,11 @@ Compuproveeores no se hace responsable por el resguardo de su equipo.</Value>
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox32</rd:DefaultName> <rd:DefaultName>Textbox32</rd:DefaultName>
<Top>10.32033cm</Top> <Top>10.5849cm</Top>
<Left>0.20112cm</Left> <Left>0.13112cm</Left>
<Height>2.63729cm</Height> <Height>2.63729cm</Height>
<Width>3.53804cm</Width> <Width>3.53804cm</Width>
<ZIndex>25</ZIndex> <ZIndex>24</ZIndex>
<Style> <Style>
<Border /> <Border />
<PaddingLeft>2pt</PaddingLeft> <PaddingLeft>2pt</PaddingLeft>
@@ -2331,11 +2224,315 @@ Compuproveeores no se hace responsable por el resguardo de su equipo.</Value>
<PaddingBottom>2pt</PaddingBottom> <PaddingBottom>2pt</PaddingBottom>
</Style> </Style>
</Textbox> </Textbox>
<Tablix Name="Tablix4">
<TablixBody>
<TablixColumns>
<TablixColumn>
<Width>1.64066cm</Width>
</TablixColumn>
<TablixColumn>
<Width>1.82591cm</Width>
</TablixColumn>
<TablixColumn>
<Width>8.24827cm</Width>
</TablixColumn>
<TablixColumn>
<Width>6.93013cm</Width>
</TablixColumn>
</TablixColumns>
<TablixRows>
<TablixRow>
<Height>0.6cm</Height>
<TablixCells>
<TablixCell>
<CellContents>
<Textbox Name="Textbox14">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Cantidad</Value>
<Style />
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox14</rd:DefaultName>
<Style>
<Border>
<Style>Solid</Style>
</Border>
<BackgroundColor>Silver</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox18">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>UM</Value>
<Style />
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox18</rd:DefaultName>
<Style>
<Border>
<Style>Solid</Style>
</Border>
<BackgroundColor>Silver</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox25">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Descripcion</Value>
<Style />
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox25</rd:DefaultName>
<Style>
<Border>
<Style>Solid</Style>
</Border>
<BackgroundColor>Silver</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox27">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Observaciones</Value>
<Style />
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox27</rd:DefaultName>
<Style>
<Border>
<Style>Solid</Style>
</Border>
<BackgroundColor>Silver</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
</TablixCells>
</TablixRow>
<TablixRow>
<Height>0.6cm</Height>
<TablixCells>
<TablixCell>
<CellContents>
<Textbox Name="Cantidad">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!Cantidad.Value</Value>
<Style>
<FontSize>9pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Cantidad</rd:DefaultName>
<Style>
<Border>
<Style>Solid</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="UM">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!UM.Value</Value>
<Style>
<FontSize>9pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>UM</rd:DefaultName>
<Style>
<Border>
<Style>Solid</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="PS">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!PS.Value</Value>
<Style>
<FontSize>9pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>PS</rd:DefaultName>
<Style>
<Border>
<Style>Solid</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Observaciones">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!Observaciones.Value</Value>
<Style>
<FontSize>9pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Observaciones</rd:DefaultName>
<Style>
<Border>
<Style>Solid</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
</TablixCells>
</TablixRow>
</TablixRows>
</TablixBody>
<TablixColumnHierarchy>
<TablixMembers>
<TablixMember />
<TablixMember />
<TablixMember />
<TablixMember />
</TablixMembers>
</TablixColumnHierarchy>
<TablixRowHierarchy>
<TablixMembers>
<TablixMember>
<KeepWithGroup>After</KeepWithGroup>
</TablixMember>
<TablixMember>
<Group Name="Details1" />
</TablixMember>
</TablixMembers>
</TablixRowHierarchy>
<DataSetName>DataSet1</DataSetName>
<Top>8.69021cm</Top>
<Left>0.13112cm</Left>
<Height>1.2cm</Height>
<Width>18.64497cm</Width>
<ZIndex>25</ZIndex>
<Style>
<Border>
<Style>Solid</Style>
</Border>
<FontSize>7pt</FontSize>
</Style>
</Tablix>
</ReportItems> </ReportItems>
<Height>9.8435in</Height> <Height>10.79142in</Height>
<Style /> <Style />
</Body> </Body>
<Width>7.48268in</Width> <Width>7.54841in</Width>
<Page> <Page>
<PageHeight>27.94cm</PageHeight> <PageHeight>27.94cm</PageHeight>
<PageWidth>21.59cm</PageWidth> <PageWidth>21.59cm</PageWidth>

File diff suppressed because it is too large Load Diff

View File

@@ -1160,9 +1160,20 @@ Partial Class Inventarios_EntradasSalidas
Protected Sub AddNew(CvePS As Integer, PS As String, CveUM As Integer, UM As String, Cantidad As Double, PU As Double, SerieLote As String, CodigoAF As String, Codigo As String, CveAF As String, Observaciones As String, Lote As String, Batch As String, CveSeccionAlmacen As Integer, SeccionAlmacen As String) Protected Sub AddNew(CvePS As Integer, PS As String, CveUM As Integer, UM As String, Cantidad As Double, PU As Double, SerieLote As String, CodigoAF As String, Codigo As String, CveAF As String, Observaciones As String, Lote As String, Batch As String, CveSeccionAlmacen As Integer, SeccionAlmacen As String)
If DdlAlmacen.SelectedValue.ToEntero <= 0 Then Alert("Seleccione un almacen", TipoMensaje.MsgAdvertencia) : RegistraScript("playsonidito('142608__autistic-lucario__error.wav')") : DdlProducto2.SelectedText = "" : Exit Sub If DdlAlmacen.SelectedValue.ToEntero <= 0 Then Alert("Seleccione un almacen", TipoMensaje.MsgAdvertencia) : RegistraScript("playsonidito('142608__autistic-lucario__error.wav')") : DdlProducto2.SelectedText = "" : Exit Sub
Dim Valido As Boolean = True Dim Valido As Boolean = True
Dim RowPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS).Rows(0)
Dim CveMetodoInventario As Integer = RowPS("Inv_CveMetodoInventario").ToString().ToEntero()
If CveMetodoInventario = 5 And (String.IsNullOrEmpty(SerieLote.Trim()) OrElse SerieLote = "-1") Then
Valido = False
Alert("El producto requiere Serie-Lote", TipoMensaje.MsgAdvertencia)
End If
'salida 'salida
If DdlConcepto.SelectedValue.Contiene({"3", "5", "7", "8", "11", "12", "13", "15", "16", "17", "20", "21", "30", "31"}) Then ' salida de almacen If Valido AndAlso DdlConcepto.SelectedValue.Contiene({"3", "5", "7", "8", "11", "12", "13", "15", "16", "17", "20", "21", "30", "31"}) Then ' salida de almacen
Dim Existencia As Double = GetExistencias(CvePS, CveUM, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, If(SerieLote = "", "-1", SerieLote), If(Lote = "", "-1", Lote), If(Batch = "", "-1", Batch)) Dim Existencia As Double = GetExistencias(CvePS, CveUM, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, If(SerieLote = "", "-1", SerieLote), If(Lote = "", "-1", Lote), If(Batch = "", "-1", Batch))
LbAgregar.ToolTip = Existencia.ToString LbAgregar.ToolTip = Existencia.ToString
If Existencia - Cantidad - DtMovimientos.SUM("Cantidad", $"CvePS = {CvePS} AND CveUM = {CveUM} {If(SerieLote <> "", $" AND SerieLote = '{SerieLote}'", "")}") < 0 Then If Existencia - Cantidad - DtMovimientos.SUM("Cantidad", $"CvePS = {CvePS} AND CveUM = {CveUM} {If(SerieLote <> "", $" AND SerieLote = '{SerieLote}'", "")}") < 0 Then
@@ -1181,6 +1192,7 @@ Partial Class Inventarios_EntradasSalidas
End If End If
End If End If
If Valido Then If Valido Then
Dim CveClasificacion As Integer Dim CveClasificacion As Integer
Dim dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS).FiltroPrimero("", "PS") Dim dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS).FiltroPrimero("", "PS")

View File

@@ -84,6 +84,7 @@
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<asp:HiddenField ID="HdnCveProveedor" runat="server" />
<label class="col-md-3">Almacén:</label> <label class="col-md-3">Almacén:</label>
<div class="col-md-9"> <div class="col-md-9">
<asp:DropDownList ID="DdlAlmacenOrigen" Width="150px" AppendDataBoundItems="true" runat="server" DataTextField="Almacen" DataValueField="CveAlmacen" CssClass="form-control input-sm select2me"></asp:DropDownList> <asp:DropDownList ID="DdlAlmacenOrigen" Width="150px" AppendDataBoundItems="true" runat="server" DataTextField="Almacen" DataValueField="CveAlmacen" CssClass="form-control input-sm select2me"></asp:DropDownList>

View File

@@ -6,12 +6,8 @@ Partial Class Inventarios_PrestamosdeProveedor
Private Sub Inventarios_PrestamosdeProveedor_Load(sender As Object, e As EventArgs) Handles Me.Load Private Sub Inventarios_PrestamosdeProveedor_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then If Not Page.IsPostBack Then
CargaCombos() CargaCombos()
Dim a As New ClsValidaCFDi("EBFD0EF4-F7D2-4243-9A79-9C484D6C1323", "FRU880930R72", "AJA850608L7A", 39)
Alert(a.EsValida)
Dim lista As New List(Of String)
lista.Add("93")
lista.Add("100")
Notificaciones.AlertaVentana("hola", lista)
CargaDatos() CargaDatos()
End If End If
End Sub End Sub
@@ -45,6 +41,11 @@ Partial Class Inventarios_PrestamosdeProveedor
If ObjInv.PrestamosdeProveedorGet(tCveProveedor, tFolio, UsuarioActual.CveEmpresa) Then If ObjInv.PrestamosdeProveedorGet(tCveProveedor, tFolio, UsuarioActual.CveEmpresa) Then
GvD.DataSource = ObjInv.DtResultados GvD.DataSource = ObjInv.DtResultados
Dim Dr As Data.DataRow = ObjInv.DtResultados.FiltroPrimero("")
If Dr IsNot Nothing Then
HdnCveProveedor.Value = Dr("CveProveedor")
End If
End If End If
ObjInv.Dispose() ObjInv.Dispose()
@@ -128,7 +129,7 @@ Partial Class Inventarios_PrestamosdeProveedor
Dim Fecha As Date = TxtFechaEntrega.Text.ToDate Dim Fecha As Date = TxtFechaEntrega.Text.ToDate
Dim CveMovimientoSalida As Integer Dim CveMovimientoSalida As Integer
Dim tCveProveedor As Integer = ddlProveedor.SelectedValue.ToEntero Dim tCveProveedor As Integer = HdnCveProveedor.Value.ToEntero
Dim CvePS As Integer = 0 Dim CvePS As Integer = 0
'AGREGAMOS LA SALIDA 'AGREGAMOS LA SALIDA
@@ -173,8 +174,7 @@ Partial Class Inventarios_PrestamosdeProveedor
Dim CveConceptoContable As Integer = 69 Dim CveConceptoContable As Integer = 69
Dim CveClasifCosto As Integer = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveClasificacion", String.Format("CvePS ={0} ", CvePS)) Dim CveClasifCosto As Integer = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveClasificacion", String.Format("CvePS ={0} ", CvePS))
idCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGasto", $"CveClasificacion = {CveClasifCosto}").ToEntero IdCtaContableOtro = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {CveClasifCosto}").ToEntero
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoAlmacen, tValorInventario, TxtObservacionesEntrega.Text.Trim, 68, TxtObservacionesEntrega.Text.Trim, Fecha, idCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoSalida, ImporteMX:=tValorInventario) Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoAlmacen, tValorInventario, TxtObservacionesEntrega.Text.Trim, 68, TxtObservacionesEntrega.Text.Trim, Fecha, idCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoSalida, ImporteMX:=tValorInventario) Then
ErrorMovInv = True ErrorMovInv = True
@@ -196,6 +196,7 @@ Partial Class Inventarios_PrestamosdeProveedor
TxtRecibio.Text = "" TxtRecibio.Text = ""
TxtFechaEntrega.Text = Now.ToShortDateString TxtFechaEntrega.Text = Now.ToShortDateString
TxtObservacionesEntrega.Text = "" TxtObservacionesEntrega.Text = ""
HdnCveProveedor.Value = ""
Dim Mensaje As StringBuilder = New StringBuilder Dim Mensaje As StringBuilder = New StringBuilder
Mensaje.AppendFormat("Se realizo correctamente la recepción. <br/> Folio de Salida: <b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{0}</a></b>", Folio, CveMovimientoSalida) Mensaje.AppendFormat("Se realizo correctamente la recepción. <br/> Folio de Salida: <b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{0}</a></b>", Folio, CveMovimientoSalida)

View File

@@ -1628,7 +1628,7 @@ Partial Class Inventarios_RecepcionEntrega
'Exit Sub 'Exit Sub
Dim TieneErrorExistencia = False Dim TieneErrorExistencia = False
If ObjInventario.GetExistenciasPSXML(StrXML.ToString(), DdlAlmacen.SelectedValue.ToEntero, TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), CveSubProyecto, CveVendedor, If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then If ObjInventario.GetExistenciasPSXML(StrXML.ToString(), DdlAlmacen.SelectedValue.ToEntero, TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), CveSubProyecto, CveVendedor, If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), If(TipoEntrega = 2, 1, -1), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
If ObjInventario.DtResultados.Rows.Count > 0 Then If ObjInventario.DtResultados.Rows.Count > 0 Then
TieneErrorExistencia = True TieneErrorExistencia = True
For Each Dr As DataRow In ObjInventario.DtResultados.Rows For Each Dr As DataRow In ObjInventario.DtResultados.Rows
@@ -2520,7 +2520,7 @@ Partial Class Inventarios_RecepcionEntrega
StrXML.Append("</conceptos>") StrXML.Append("</conceptos>")
Dim TieneErrorExistencia = False Dim TieneErrorExistencia = False
If ObjInventario.GetExistenciasPSXML(StrXML.ToString(), DdlAlmacen.SelectedValue.ToEntero, TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), CveSubProyecto, CveVendedor, If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), 1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then If ObjInventario.GetExistenciasPSXML(StrXML.ToString(), DdlAlmacen.SelectedValue.ToEntero, TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), CveSubProyecto, CveVendedor, If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), If(TipoEntrega = 2, 1, -1), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
If ObjInventario.DtResultados.Rows.Count > 0 Then If ObjInventario.DtResultados.Rows.Count > 0 Then
TieneErrorExistencia = True TieneErrorExistencia = True
For Each Dr As DataRow In ObjInventario.DtResultados.Rows For Each Dr As DataRow In ObjInventario.DtResultados.Rows

View File

@@ -374,7 +374,7 @@ Partial Class Inventarios_RecepcionUsados
#Region " PERMISOS PAGINAS " #Region " PERMISOS PAGINAS "
Private Function PermiteGuardar() As Boolean Private Function PermiteGuardar() As Boolean
Return If(UsuarioActual.TienePermisoProceso(181) Or EsConsumoInterno, True, False) Return True 'If(UsuarioActual.TienePermisoProceso(181) Or EsConsumoInterno, True, False)
End Function End Function
''' <summary> ''' <summary>
''' Este permiso solo habilita el Btn del GV. Debe ir en conjunto con el permiso 181 [PermiteGuardar] ''' Este permiso solo habilita el Btn del GV. Debe ir en conjunto con el permiso 181 [PermiteGuardar]

View File

@@ -28,9 +28,7 @@
<div class="row"> <div class="row">
<label class="col-md-1">Producto: </label> <label class="col-md-1">Producto: </label>
<div class="col-md-2"> <div class="col-md-2">
<asp:DropDownList CssClass="table-group-action-input form-control input-inline input-small input-sm select2me" ID="DdlPS" AppendDataBoundItems="true" DataTextField="PSCodigo" DataValueField="CvePS" runat="server"> <ADS:Dropdownlost runat="server" ID="DdlPS" CssStyle="width: 100%;" CssClass="DdlPS" CssClassDdl="select2me " DataTextField="PSCodigo" DataValueField="CvePS" Width="100%" />
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div> </div>
<label class="col-md-1 ">Sucursal:</label> <label class="col-md-1 ">Sucursal:</label>
<div class="col-md-2"> <div class="col-md-2">

View File

@@ -16,9 +16,20 @@ Partial Class Inventarios_RepVentasXSurtir
#Region " INICIALIZA VALORES " #Region " INICIALIZA VALORES "
Private Sub InicializaValores() Private Sub InicializaValores()
DdlPS.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa) 'Carga Productos
DdlPS.DataBind() DdlPS.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1")
If UsuarioActual.Empresa.Funcionalidad(105) = "1" Then
DdlPS.SelectedText = "Todos"
DdlPS.SelectedValue = "-1"
Else
DdlPS.ddl.Items.Clear()
DdlPS.ddl.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
DdlPS.ddl.DataBind()
DdlPS.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
End If
'Carga Sucursales
DdlSubProyectos.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) DdlSubProyectos.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1)
DdlSubProyectos.DataBind() DdlSubProyectos.DataBind()

View File

@@ -60,9 +60,9 @@
Traspaso de Almacén Traspaso de Almacén
</asp:Content> </asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server"> <asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<%-- <li> <li>
<asp:HyperLink ID="LnkEnviarMail" runat="server" Style="color: #686868;" Visible="false"><i class="fa fa-envelope" style="color: #686868;"></i> Enviar Mail</asp:HyperLink> <asp:HyperLink ID="LnkCargarExcel" runat="server" NavigateUrl="#" data-toggle="modal" data-target="#DivCargaExcelConceptos" Style="color: #686868;" ><i class="fa fa-file-excel-o" style="color: #686868;"></i> Cargar Conceptos</asp:HyperLink>
</li>--%> </li>
</asp:Content> </asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server"> <asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
@@ -780,7 +780,52 @@
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
</div> </div>
<%--CARGA EXCEL--%>
<div id="DivCargaExcelConceptos" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Cargar Conceptos</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12">
<h3>Arraste o haga click para subir el archivo Excel</h3>
</div>
</div>
<div class="row">
<div class="col-md-11" style="margin-left: 30px; margin-right: 30px;">
<asp:TextBox ID="TxtExcelConceptos" CssClass="ADSdropzone hidden" Text="" data-maxFile="1" runat="server"></asp:TextBox>
</div>
</div>
</div>
<div class="modal-footer">
<div class="row">
<div class="col-md-2" style="text-align: left">
<asp:UpdatePanel ID="UpDescargar" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Button ID="BtnDescargarFormatoExcelConceptos" OnClick="BtnDescargarFormatoExcelConceptos_Click" runat="server" CssClass="btn btn-warning" Text="Descargar Formato" />
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="BtnDescargarFormatoExcelConceptos" />
</Triggers>
</asp:UpdatePanel>
</div>
<div class="col-md-10" style="text-align: right">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:Button ID="BtnCargaExcelConceptos" runat="server" OnClick="BtnCargaExcelConceptos_Click" CssClass="btn btn-success" Text="Aceptar" ValidationGroup="GrpCargarExcel"></asp:Button>
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</div>
</div>
</div>
</asp:Content> </asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server"> <asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">

View File

@@ -4,11 +4,12 @@ Option Strict On
Imports System.Data Imports System.Data
Imports System.IO Imports System.IO
Imports Extensiones Imports Extensiones
Imports GemBox.Spreadsheet
Imports Microsoft.Reporting.WebForms Imports Microsoft.Reporting.WebForms
Partial Class Inventarios_TraspasoAlmacen Partial Class Inventarios_TraspasoAlmacen
Inherits ClsPaginas Inherits ClsPaginas
#Region "PROPIEDADES" #Region "PROPIEDADES"
Public Property DtMovimientos() As DataTable Public Property DtMovimientos() As DataTable
Get Get
@@ -166,9 +167,9 @@ Partial Class Inventarios_TraspasoAlmacen
Set(value As Integer) Set(value As Integer)
ViewState("TipoSeccionAlmacen") = value ViewState("TipoSeccionAlmacen") = value
End Set End Set
End Property End Property
#End Region #End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then If Not Page.IsPostBack Then
@@ -214,8 +215,8 @@ Partial Class Inventarios_TraspasoAlmacen
Else Else
If ChkTransitorio.Checked Then RegistraScript("$('#DivTransitorio').show(0);$('#DivGastoIndirecto').show(0);$('#DivDocChofer').show(0);") If ChkTransitorio.Checked Then RegistraScript("$('#DivTransitorio').show(0);$('#DivGastoIndirecto').show(0);$('#DivDocChofer').show(0);")
End If End If
End Sub End Sub
#Region "CARGA DATOS" #Region "CARGA DATOS"
Protected Sub CreaDT() Protected Sub CreaDT()
Dim dt As New DataTable Dim dt As New DataTable
@@ -472,9 +473,9 @@ Partial Class Inventarios_TraspasoAlmacen
'Inv.Dispose() 'Inv.Dispose()
'TxtFolio.Text = Folio.ToString 'TxtFolio.Text = Folio.ToString
End Sub End Sub
#End Region #End Region
#Region " AGREGAR " #Region " AGREGAR "
Protected Sub btnAgregar_Click(sender As Object, e As EventArgs) Handles LbAgregar.Click Protected Sub btnAgregar_Click(sender As Object, e As EventArgs) Handles LbAgregar.Click
BtnAgregarPS(txtCantidad.Text.ToDecimal) BtnAgregarPS(txtCantidad.Text.ToDecimal)
@@ -605,11 +606,11 @@ Partial Class Inventarios_TraspasoAlmacen
If TxtCodigoPS.Visible Then If TxtCodigoPS.Visible Then
TxtCodigoPS.Focus() TxtCodigoPS.Focus()
End If End If
End Sub End Sub
#End Region #End Region
#Region " GUARDAR " #Region " GUARDAR "
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click
@@ -971,11 +972,11 @@ Partial Class Inventarios_TraspasoAlmacen
Return Retorno Return Retorno
End Function End Function
#End Region #End Region
#Region " NUEVO - LIMPIA " #Region " NUEVO - LIMPIA "
Protected Sub BtnNuevo_Click(sender As Object, e As EventArgs) Protected Sub BtnNuevo_Click(sender As Object, e As EventArgs)
LimpiaMovimiento() LimpiaMovimiento()
@@ -1009,9 +1010,9 @@ Partial Class Inventarios_TraspasoAlmacen
DtMovimientos.Rows.Clear() DtMovimientos.Rows.Clear()
CargaGvDatos() CargaGvDatos()
End Sub End Sub
#End Region #End Region
#Region "DDL CLASIFICACION" #Region "DDL CLASIFICACION"
Protected Sub DdlClasificacion_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlClasificacion.SelectedIndexChanged Protected Sub DdlClasificacion_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlClasificacion.SelectedIndexChanged
ChangeDdlProducto() ChangeDdlProducto()
@@ -1042,18 +1043,18 @@ Partial Class Inventarios_TraspasoAlmacen
ThSerieLote.Visible = True ThSerieLote.Visible = True
TdSerieLote.Visible = True TdSerieLote.Visible = True
TxtnSerieLote.Visible = True TxtnSerieLote.Visible = True
GvDatos.Columns(4).Visible = True GvDatos.Columns(5).Visible = True
End If End If
If GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlProducto2.SelectedValue.ToEntero).FiltraParametros("Inv_CveMetodoInventario = 6", "PS").Rows.Count > 0 Then If GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlProducto2.SelectedValue.ToEntero).FiltraParametros("Inv_CveMetodoInventario = 6", "PS").Rows.Count > 0 Then
TxtnLote.Visible = True TxtnLote.Visible = True
ThLote.Visible = True ThLote.Visible = True
TdLote.Visible = True TdLote.Visible = True
GvDatos.Columns(5).Visible = True GvDatos.Columns(6).Visible = True
TxtnBatch.Visible = True TxtnBatch.Visible = True
ThBatch.Visible = True ThBatch.Visible = True
TdBatch.Visible = True TdBatch.Visible = True
GvDatos.Columns(6).Visible = True GvDatos.Columns(7).Visible = True
End If End If
End If End If
@@ -1085,9 +1086,9 @@ Partial Class Inventarios_TraspasoAlmacen
pDdlProducto.DataBind() pDdlProducto.DataBind()
pDdlProducto.Items.Insert(0, New ListItem("----", "-1")) pDdlProducto.Items.Insert(0, New ListItem("----", "-1"))
End Sub End Sub
#End Region #End Region
#Region "GV DATOS" #Region "GV DATOS"
Private Sub CargaGvDatos() Private Sub CargaGvDatos()
EscondeColumnasGVM(DtMovimientos) EscondeColumnasGVM(DtMovimientos)
@@ -1198,67 +1199,67 @@ Partial Class Inventarios_TraspasoAlmacen
DtMovimientos.Rows.Remove(DbRow) DtMovimientos.Rows.Remove(DbRow)
CargaGvDatos() CargaGvDatos()
End Sub End Sub
'Protected Sub GvM_RowEditing(sender As Object, e As GridViewEditEventArgs) Handles GvDatos.RowEditing 'Protected Sub GvM_RowEditing(sender As Object, e As GridViewEditEventArgs) Handles GvDatos.RowEditing
' GvDatos.EditIndex = e.NewEditIndex ' GvDatos.EditIndex = e.NewEditIndex
' CargaGvDatos() ' CargaGvDatos()
'End Sub 'End Sub
'Protected Sub GvM_RowUpdating(sender As Object, e As GridViewUpdateEventArgs) Handles GvDatos.RowUpdating 'Protected Sub GvM_RowUpdating(sender As Object, e As GridViewUpdateEventArgs) Handles GvDatos.RowUpdating
' Dim dr = GvDatos.Rows(e.RowIndex) ' Dim dr = GvDatos.Rows(e.RowIndex)
' Dim Cantidad = dr.FCTextBox("TxtCantidad").Text.ToDouble ' Dim Cantidad = dr.FCTextBox("TxtCantidad").Text.ToDouble
' Dim CveUM = dr.FCDropDownList("DdlUnidad").SelectedValue.ToEntero ' Dim CveUM = dr.FCDropDownList("DdlUnidad").SelectedValue.ToEntero
' Dim CveClasificacion = dr.FCDropDownList("DdlClasificacion").SelectedValue.ToEntero ' Dim CveClasificacion = dr.FCDropDownList("DdlClasificacion").SelectedValue.ToEntero
' Dim CvePS = dr.FCDropDownList("DdlProducto").SelectedValue.ToEntero ' Dim CvePS = dr.FCDropDownList("DdlProducto").SelectedValue.ToEntero
' Dim No = dr.DataKey("No").ToEntero ' Dim No = dr.DataKey("No").ToEntero
' Dim SerieLote As String = dr.FCTextBox("TxtSerieLote").Text ' Dim SerieLote As String = dr.FCTextBox("TxtSerieLote").Text
' 'VALIDA EXISTENCIA ' 'VALIDA EXISTENCIA
' Dim Valido = True ' Dim Valido = True
' Dim Inv As New ClsInventarios ' Dim Inv As New ClsInventarios
' Dim Existencia As Double = Inv.GetExistenciasPS(CvePS, CveUM, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, -1, TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), If(SerieLote = "", "-1", SerieLote)) ' Dim Existencia As Double = Inv.GetExistenciasPS(CvePS, CveUM, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, -1, TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), If(SerieLote = "", "-1", SerieLote))
' Inv.Dispose() ' Inv.Dispose()
' If Existencia - txtCantidad.Text.ToDouble < 0 Then ' If Existencia - txtCantidad.Text.ToDouble < 0 Then
' If Existencia <= 0 Then ' If Existencia <= 0 Then
' Alert("No hay existencia del producto", TipoMensaje.MsgError) ' Alert("No hay existencia del producto", TipoMensaje.MsgError)
' Else ' Else
' Alert(String.Format("Solo hay en existencia: {0}", Existencia), TipoMensaje.MsgError) ' Alert(String.Format("Solo hay en existencia: {0}", Existencia), TipoMensaje.MsgError)
' End If ' End If
' Valido = False ' Valido = False
' End If ' End If
' If Valido Then ' If Valido Then
' Dim Drs As DataRow() = DtMovimientos.Select(String.Format("No = {0}", No)) ' Dim Drs As DataRow() = DtMovimientos.Select(String.Format("No = {0}", No))
' If Drs.Count = 1 Then ' If Drs.Count = 1 Then
' Drs(0)("Cantidad") = Cantidad ' Drs(0)("Cantidad") = Cantidad
' Drs(0)("CveUM") = CveUM ' Drs(0)("CveUM") = CveUM
' Drs(0)("CveClasificacion") = CveClasificacion ' Drs(0)("CveClasificacion") = CveClasificacion
' Drs(0)("CvePS") = CvePS ' Drs(0)("CvePS") = CvePS
' Drs(0)("EstatusExistencia") = "1" ' Drs(0)("EstatusExistencia") = "1"
' End If ' End If
' DtMovimientos.AcceptChanges() ' DtMovimientos.AcceptChanges()
' GvDatos.EditIndex = -1 ' GvDatos.EditIndex = -1
' End If ' End If
' CargaGvDatos() ' CargaGvDatos()
'End Sub 'End Sub
'Protected Sub GvM_RowCancelingEdit(sender As Object, e As GridViewCancelEditEventArgs) Handles GvDatos.RowCancelingEdit 'Protected Sub GvM_RowCancelingEdit(sender As Object, e As GridViewCancelEditEventArgs) Handles GvDatos.RowCancelingEdit
' GvDatos.EditIndex = -1 ' GvDatos.EditIndex = -1
' CargaGvDatos() ' CargaGvDatos()
'End Sub 'End Sub
#End Region #End Region
#Region " TRANSITORIO - RECEPCION " #Region " TRANSITORIO - RECEPCION "
Protected Sub ChkTransitorio_CheckedChanged(sender As Object, e As EventArgs) Protected Sub ChkTransitorio_CheckedChanged(sender As Object, e As EventArgs)
Dim TipoAlmacenOrigen = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveTipoAlmacen", $"CveAlmacen = {DdlAlmacenOrigen.SelectedValue.ToEntero}").ToEntero Dim TipoAlmacenOrigen = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveTipoAlmacen", $"CveAlmacen = {DdlAlmacenOrigen.SelectedValue.ToEntero}").ToEntero
@@ -1619,22 +1620,22 @@ Partial Class Inventarios_TraspasoAlmacen
End If End If
ObjUM.Dispose() ObjUM.Dispose()
DdlUnidad.DataBind() DdlUnidad.DataBind()
End Sub End Sub
'Protected Sub BtnImprimirTraspaso_Click(sender As Object, e As EventArgs) Handles BtnImprimirTraspaso.Click 'Protected Sub BtnImprimirTraspaso_Click(sender As Object, e As EventArgs) Handles BtnImprimirTraspaso.Click
' Dim params As New List(Of ReportParameter) ' Dim params As New List(Of ReportParameter)
' params.Add(New ReportParameter("SubProyecto", DdlAlmacenDestino.SelectedItem.ToString)) ' params.Add(New ReportParameter("SubProyecto", DdlAlmacenDestino.SelectedItem.ToString))
' params.Add(New ReportParameter("Folio", FolioTraspaso.ToString)) ' params.Add(New ReportParameter("Folio", FolioTraspaso.ToString))
' params.Add(New ReportParameter("Fecha", TxtFecha.Text)) ' params.Add(New ReportParameter("Fecha", TxtFecha.Text))
' params.Add(New ReportParameter("Observaciones", TxtObservaciones.Text)) ' params.Add(New ReportParameter("Observaciones", TxtObservaciones.Text))
' params.Add(New ReportParameter("NombreEntrego", UsuarioActual.Nombre)) ' params.Add(New ReportParameter("NombreEntrego", UsuarioActual.Nombre))
' params.Add(New ReportParameter("NombreTraslado", TxtResponsable.Text)) ' params.Add(New ReportParameter("NombreTraslado", TxtResponsable.Text))
' params.Add(New ReportParameter("NombreRecibio", "")) ' params.Add(New ReportParameter("NombreRecibio", ""))
' ImprimirPDF(String.Format("{0}Formatos\Traslado.rdlc", UsuarioActual.Empresa.Ruta), DtTraslado, params, "Reporte Traslado", RDSName:="DsInventarios") ' ImprimirPDF(String.Format("{0}Formatos\Traslado.rdlc", UsuarioActual.Empresa.Ruta), DtTraslado, params, "Reporte Traslado", RDSName:="DsInventarios")
'End Sub 'End Sub
#End Region #End Region
#Region " AGREGA CON TXT | CODIGO - SERIE " #Region " AGREGA CON TXT | CODIGO - SERIE "
Protected Sub BtnCodigoPS_Click(sender As Object, e As EventArgs) Protected Sub BtnCodigoPS_Click(sender As Object, e As EventArgs)
@@ -1687,9 +1688,9 @@ Partial Class Inventarios_TraspasoAlmacen
TxtCodigoPS.Text = "" TxtCodigoPS.Text = ""
TxtCodigoPS.Focus() TxtCodigoPS.Focus()
End Sub End Sub
#End Region #End Region
#Region " AGREGA CON TXT | CODIGO - SERIE --- RECEPCION " #Region " AGREGA CON TXT | CODIGO - SERIE --- RECEPCION "
Protected Sub BtnCodigoPSRecepcion_Click(sender As Object, e As EventArgs) Protected Sub BtnCodigoPSRecepcion_Click(sender As Object, e As EventArgs)
If TxtCodigoPSRecepcion.Text = "" Then If TxtCodigoPSRecepcion.Text = "" Then
@@ -1763,11 +1764,11 @@ Partial Class Inventarios_TraspasoAlmacen
RegistraScript("playsonidito(''142608__autistic-lucario__error.wav'')") RegistraScript("playsonidito(''142608__autistic-lucario__error.wav'')")
'Alert($"Ya se han cargado todos los productos o no se ha encontrado un producto de la Serie ""<b>{TxtSeriePSRecepcion.Text}</b>"". ", TipoMensaje.MsgAdvertencia, "window.setTimeout(Focus2,200);") 'Alert($"Ya se han cargado todos los productos o no se ha encontrado un producto de la Serie ""<b>{TxtSeriePSRecepcion.Text}</b>"". ", TipoMensaje.MsgAdvertencia, "window.setTimeout(Focus2,200);")
TxtSeriePSRecepcion.Text = "" TxtSeriePSRecepcion.Text = ""
End Sub End Sub
#End Region #End Region
#Region "CORREO" #Region "CORREO"
Private Sub MandaCorreo(CveMovimiento As Integer, Para As String, Optional CCP As String = "") Private Sub MandaCorreo(CveMovimiento As Integer, Para As String, Optional CCP As String = "")
Dim Mail As New ClsSisMail() Dim Mail As New ClsSisMail()
Dim Asunto As String = "NOTIFICACION DE TRASPASO ENTRE ALMACENES" Dim Asunto As String = "NOTIFICACION DE TRASPASO ENTRE ALMACENES"
@@ -1962,10 +1963,10 @@ Partial Class Inventarios_TraspasoAlmacen
ObjInventario.Dispose() ObjInventario.Dispose()
Return strBody.ToString Return strBody.ToString
End Function End Function
#End Region #End Region
#Region "TIMBRADO" #Region "TIMBRADO"
Private Sub CreaObjetosVenta() Private Sub CreaObjetosVenta()
ObjFactura = New Modelos.Factura ObjFactura = New Modelos.Factura
@@ -2199,10 +2200,10 @@ Partial Class Inventarios_TraspasoAlmacen
Catch ex As Exception Catch ex As Exception
Alert("Ocurrió un error al generar el PDF", TipoMensaje.MsgError) Alert("Ocurrió un error al generar el PDF", TipoMensaje.MsgError)
End Try End Try
End Sub End Sub
#End Region #End Region
#Region "SECCION ALMACEN" #Region "SECCION ALMACEN"
Private Sub CreaDtSeccionAlmacen() Private Sub CreaDtSeccionAlmacen()
DtSeccionAlmacen = New DataTable DtSeccionAlmacen = New DataTable
@@ -2383,31 +2384,31 @@ Partial Class Inventarios_TraspasoAlmacen
DtSeccionAlmacen.Rows.RemoveAt(Index) DtSeccionAlmacen.Rows.RemoveAt(Index)
DtSeccionAlmacen.AcceptChanges() DtSeccionAlmacen.AcceptChanges()
CargaSeccionAlmacen() CargaSeccionAlmacen()
End Sub End Sub
'Protected Sub LnkVerSecciones_Click(sender As Object, e As EventArgs) 'Protected Sub LnkVerSecciones_Click(sender As Object, e As EventArgs)
' If Not CveVentaSurtir > 0 Then ' If Not CveVentaSurtir > 0 Then
' Alert("Tiene que seleccionar la venta a surtir", TipoMensaje.MsgAdvertencia) ' Alert("Tiene que seleccionar la venta a surtir", TipoMensaje.MsgAdvertencia)
' Exit Sub ' Exit Sub
' End If ' End If
' If Not DdlAlmacen.SelectedValue.ToEntero > 0 Then ' If Not DdlAlmacen.SelectedValue.ToEntero > 0 Then
' Alert("Tiene que seleccionar el almacen", TipoMensaje.MsgAdvertencia) ' Alert("Tiene que seleccionar el almacen", TipoMensaje.MsgAdvertencia)
' Exit Sub ' Exit Sub
' End If ' End If
' Dim ObjInv As New ClsInventarios ' Dim ObjInv As New ClsInventarios
' If ObjInv.GetExistenciaSeccionAlmacen(CveVentaSurtir, DdlAlmacen.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then ' If ObjInv.GetExistenciaSeccionAlmacen(CveVentaSurtir, DdlAlmacen.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
' GvVerSeccionesAlmacen.DataSource = ObjInv.DtResultados ' GvVerSeccionesAlmacen.DataSource = ObjInv.DtResultados
' End If ' End If
' ObjInv.Dispose() ' ObjInv.Dispose()
' GvVerSeccionesAlmacen.DataBind() ' GvVerSeccionesAlmacen.DataBind()
' UpVerSeccionesAlmacen.Update() ' UpVerSeccionesAlmacen.Update()
' RegistraScript("$('#ModalVerSeccionesAlmacen').modal()") ' RegistraScript("$('#ModalVerSeccionesAlmacen').modal()")
'End Sub 'End Sub
#End Region #End Region
Protected Sub DldChofer_SelectedIndexChanged(sender As Object, e As EventArgs) Protected Sub DldChofer_SelectedIndexChanged(sender As Object, e As EventArgs)
Dim ObjAcar As New ClsAcarreos() Dim ObjAcar As New ClsAcarreos()
@@ -2422,5 +2423,218 @@ Partial Class Inventarios_TraspasoAlmacen
End If End If
End If End If
ObjAcar.Dispose() ObjAcar.Dispose()
End Sub End Sub
Protected Sub BtnCargaExcelConceptos_Click(sender As Object, e As EventArgs)
If TxtExcelConceptos.getfiles().Archivos.Count > 0 Then
Dim file As Archivo = TxtExcelConceptos.getfiles().Archivos(0)
Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.patch
CargarArchivoConceptos(Directorio, file.filename)
RegistraScript("$('#DivCargaExcelConceptos').modal('hide');")
Else
Alert("No existe el archivo. Favor de subir un archivo excel a la plataforma.", TipoMensaje.MsgError)
End If
End Sub
Protected Sub BtnDescargarFormatoExcelConceptos_Click(sender As Object, e As EventArgs)
Dim DtExcel As New DataTable
DtExcel.Columns.Add(New DataColumn("Cantidad", GetType(Decimal)))
DtExcel.Columns.Add(New DataColumn("Codigo", GetType(String)))
DtExcel.Columns.Add(New DataColumn("Producto", GetType(String)))
DtExcel.Columns.Add(New DataColumn("SerieLote", GetType(String)))
DtExcel.Columns.Add(New DataColumn("Observaciones", GetType(String)))
DtExcel.TableName = "Traspaso"
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
Dim FileExcel As New ExcelFile()
Dim worksheet = FileExcel.Worksheets.Add(DtExcel.TableName)
worksheet.InsertDataTable(DtExcel, New InsertDataTableOptions() With
{
.ColumnHeaders = True,
.StartRow = 0,
.StartColumn = 0
})
worksheet.Rows(0).Style.FillPattern.SetPattern(FillPatternStyle.Solid, SpreadsheetColor.FromArgb(75, 119, 190), SpreadsheetColor.FromArgb(255, 255, 255))
worksheet.Rows(0).Style.Font.Color = SpreadsheetColor.FromArgb(255, 255, 255)
Dim columnCount = worksheet.CalculateMaxUsedColumns()
For i = 0 To columnCount
worksheet.Columns(i).AutoFit(1, worksheet.Rows(0), worksheet.Rows(worksheet.Rows.Count - 1))
Next
FileExcel.Save(Response, "Traspaso.xlsx", SaveOptions.XlsxDefault)
End Sub
Protected Sub CargarArchivoConceptos(Ruta As String, FileName As String)
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
Dim dt As DataTable = Nothing
Dim ErrorArchivo = False
Try
dt = ReadExcelFile(Ruta + FileName, True)
Catch ex As Exception
ErrorArchivo = True
OnError("Ocurrio un error al leer el archivo <br/>" & ex.Message, ex)
End Try
If Not ErrorArchivo AndAlso dt IsNot Nothing Then
If Not dt.Columns(0).ColumnName = "Cantidad" Then
Alert("El nombre de la primera columna debe ser 'Cantidad'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(1).ColumnName = "Codigo" Then
Alert("El nombre de la segunda columna debe ser 'Codigo'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(2).ColumnName = "Producto" Then
Alert("El nombre de la tercera columna debe ser 'Producto'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(3).ColumnName = "SerieLote" Then
Alert("El nombre de la cuarta columna debe ser 'SerieLote'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(4).ColumnName = "Observaciones" Then
Alert("El nombre de la quinta columna debe ser 'Observaciones'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
dt.TableName = "Datos"
Dim ProductosNoCargados As New StringBuilder()
Dim RowsCargados As Integer = 0
Dim RowsNoCargados As Integer = 0
Dim NoPSConSerieLote As Integer = 0
Try
Dim DtPS As DataTable = GlobalDTPS(UsuarioActual.CveEmpresa)
For Each RowExcel As DataRow In dt.Rows
Dim RowPS = DtPS.FiltroPrimero(String.Format("Codigo='{0}'", RowExcel("Codigo").ToString()))
Dim CveProducto As Integer = RowPS("CvePS").ToString().ToEntero()
Dim CveUnidadMedida As Integer = RowPS("CveUnidadMedida").ToString().ToEntero()
Dim Cantidad As Double = RowExcel("Cantidad").ToString().ToDecimal()
Dim SerieLote As String = RowExcel("SerieLote").ToString()
Dim Observaciones As String = RowExcel("Observaciones").ToString()
If CveProducto > 0 Then
Dim Valido As Boolean = True
Dim CveMetodoInventario As Integer = RowPS("Inv_CveMetodoInventario").ToString().ToEntero()
If CveMetodoInventario = 5 And (String.IsNullOrEmpty(SerieLote.Trim()) OrElse SerieLote = "-1") Then
Valido = False
Alert($"El producto '{RowPS("PS")}' requiere 'SerieLote'", TipoMensaje.MsgAdvertencia)
ProductosNoCargados.AppendFormat("{0},", RowPS("PS").ToString())
End If
If CveMetodoInventario = 5 AndAlso Not String.IsNullOrEmpty(SerieLote.Trim()) Then
NoPSConSerieLote = NoPSConSerieLote + 1
End If
If Valido AndAlso (Cantidad > 0 AndAlso RowPS("VentaMinima").ToString.ToDecimal > 0) Then
If Cantidad Mod RowPS("VentaMinima").ToString.ToDecimal <> 0 Then
Valido = False
ProductosNoCargados.AppendFormat("{0},", RowPS("PS").ToString())
End If
End If
If Valido Then
Valido = ValidaExistencia(Cantidad, CveProducto, CveUnidadMedida, If(Not String.IsNullOrEmpty(SerieLote), SerieLote, "-1"), "-1", "-1")
End If
If Valido Then
AgregarPS(Cantidad, CveProducto, CveUnidadMedida, Observaciones, If(Not String.IsNullOrEmpty(SerieLote), SerieLote, ""), "", "", False)
RowsCargados = RowsCargados + 1
Else
RowsNoCargados = RowsNoCargados + 1
ProductosNoCargados.AppendFormat("{0},", RowPS("PS").ToString())
End If
Else
RowsNoCargados = RowsNoCargados + 1
ProductosNoCargados.AppendFormat("{0},", RowExcel("Producto").ToString())
End If
Next
Catch ex As Exception
OnError("Ocurrió un error al cargar los productos.", ex)
Finally
If NoPSConSerieLote > 0 Then
ThSerieLote.Visible = True
TdSerieLote.Visible = True
TxtnSerieLote.Visible = True
GvDatos.Columns(5).Visible = True
End If
Dim MensajeFinal As New StringBuilder()
If RowsNoCargados = 0 AndAlso RowsCargados > 0 Then
MensajeFinal.Append("Los productos se cargaron correctamente. <br/><br/>")
End If
If RowsCargados > 0 Then
MensajeFinal.Append("Se cargaron <b>" & RowsCargados & "</b> productos correctamente.")
End If
If RowsNoCargados > 0 Then
MensajeFinal.Append("No se pudieron cargar <b>" & RowsNoCargados & "</b> productos. <br/>Los siguientes productos no se pudieron cargar: " & ProductosNoCargados.ToString())
End If
Alert(MensajeFinal.ToString())
End Try
UpDatos.Update()
End If
End Sub
Private Function ReadExcelFile(ByVal flatFilePath As String, ByVal firstRowHasHeaders As Boolean) As DataTable
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
Dim excelFile As ExcelFile = ExcelFile.Load(flatFilePath)
Dim unnamed As Integer = 0
Dim cols As Integer
Dim columns As String()
Dim curRow As Integer = 0
Dim curCol As Integer = 0
Dim dataTable As DataTable = New DataTable()
Dim worksheet As ExcelWorksheet = excelFile.Worksheets(0)
For cols = 0 To worksheet.Rows(0).AllocatedCells.Count - 1
If firstRowHasHeaders Then
If worksheet.Rows(0).Cells(cols).Value IsNot Nothing Then
dataTable.Columns.Add(worksheet.Rows(0).Cells(cols).Value.ToString())
Else
dataTable.Columns.Add("Unnamed Column " & (System.Threading.Interlocked.Increment(unnamed)))
End If
curRow = 1
Else
dataTable.Columns.Add("Column " & (cols + 1))
End If
Next
While curRow < worksheet.Rows.Count
columns = New String(cols - 1) {}
For curCol = 0 To cols - 1
If worksheet.Rows(curRow).Cells(curCol).Value Is Nothing Then
columns(curCol) = ""
Else
columns(curCol) = worksheet.Rows(curRow).Cells(curCol).Value.ToString()
End If
Next
dataTable.Rows.Add(columns)
curRow += 1
End While
Return dataTable
End Function
End Class End Class

File diff suppressed because one or more lines are too long

View File

@@ -855,7 +855,8 @@
<asp:GridView ID="GvD" runat="server" AutoGenerateColumns="False" GridLines=" none" BorderColor="Transparent" CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn" DataKeyNames="SubProyecto, Cantidad, Importe, Descuento, CveOrdenCompra, CveUnidadMedida, CvePresupuestoEgreso, PS,CveClasificacion, CvePS, CveSubProyecto, CveActivoFijo, CodigoAF, TipoDato, Observacion, CveOrdenCompraDetalle,CveCompra,IVAPorcentaje,RetIVAPorcentaje,RetISRPorcentaje,IEPSPSPorcentaje,IEPSPSIVAPorcentaje" data-tableheader=".GVDHeader" ShowHeader="false" data-rows="0"> <asp:GridView ID="GvD" runat="server" AutoGenerateColumns="False" GridLines=" none" BorderColor="Transparent" CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn"
DataKeyNames="SubProyecto, Cantidad, Importe, Descuento, CveOrdenCompra, CveUnidadMedida, CvePresupuestoEgreso, PS,CveClasificacion, CvePS, CveSubProyecto, CveActivoFijo, CodigoAF, TipoDato, Observacion, CveOrdenCompraDetalle,CveCompra,IVAPorcentaje,RetIVAPorcentaje,RetISRPorcentaje,IEPSPSPorcentaje,IEPSPSIVAPorcentaje" data-tableheader=".GVDHeader" ShowHeader="false" data-rows="0">
<Columns> <Columns>
<asp:TemplateField> <asp:TemplateField>
<EditItemTemplate> <EditItemTemplate>
@@ -1192,26 +1193,21 @@
<ajax:TabPanel HeaderText="Cotizaciones" runat="server" ID="tabCotizaciones" Enabled="false"> <ajax:TabPanel HeaderText="Cotizaciones" runat="server" ID="tabCotizaciones" Enabled="false">
<ContentTemplate> <ContentTemplate>
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
</div> </div>
<div class="col-md-6" style="text-align: right!important"> <div class="col-md-6" style="text-align: right!important">
<asp:HyperLink ID="hplCargarCotExcel" Font-Size="13" CssClass="Texto" NavigateUrl="#" data-toggle="modal" data-target="#DivCargaExcelCotizaciones" runat="server" Text="<i class='fa fa-file-excel-o'></i>&nbsp; Cargar Cotización"></asp:HyperLink>
&nbsp;&nbsp;
<asp:HyperLink ID="hplAgregarCotizacion" Font-Size="13" CssClass="Texto thickbox" runat="server" Text="<i class='fa fa-plus'></i>&nbsp;Agregar Cotizacion" Style="cursor: pointer;" ToolTip="Agregar Cotizacion"></asp:HyperLink> <asp:HyperLink ID="hplAgregarCotizacion" Font-Size="13" CssClass="Texto thickbox" runat="server" Text="<i class='fa fa-plus'></i>&nbsp;Agregar Cotizacion" Style="cursor: pointer;" ToolTip="Agregar Cotizacion"></asp:HyperLink>
&nbsp;&nbsp; &nbsp;&nbsp;
<asp:HyperLink ID="hplEnviarCorreo" Font-Size="13" CssClass="Texto thickbox" runat="server" Text="<i class='fa fa-envelope'></i>&nbsp;Enviar cotización por correo" Style="cursor: pointer;" ToolTip="Enviar cotización por correo"></asp:HyperLink> <asp:HyperLink ID="hplEnviarCorreo" Font-Size="13" CssClass="Texto thickbox" runat="server" Text="<i class='fa fa-envelope'></i>&nbsp;Enviar cotización por correo" Style="cursor: pointer;" ToolTip="Enviar cotización por correo"></asp:HyperLink>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
</div> </div>
</div> </div>
<asp:UpdatePanel ID="uppCotizaciones" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="uppCotizaciones" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<asp:GridView ID="gvCotizacionesANT" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontro ninguna Cotización" Visible="false" GridLines="None" BorderWidth="0" CssClass="table table-striped table-hover table-advance Widthall"> <asp:GridView ID="gvCotizacionesANT" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontro ninguna Cotización" Visible="false" GridLines="None" BorderWidth="0" CssClass="table table-striped table-hover table-advance Widthall">
<Columns> <Columns>
<asp:TemplateField> <asp:TemplateField>
@@ -1366,11 +1362,8 @@
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
</ContentTemplate> </ContentTemplate>
</ajax:TabPanel> </ajax:TabPanel>
<ajax:TabPanel HeaderText="Almacen" runat="server" ID="TabAlmacen" Visible="false"> <ajax:TabPanel HeaderText="Almacen" runat="server" ID="TabAlmacen" Visible="false">
<ContentTemplate> <ContentTemplate>
<asp:UpdatePanel ID="UpAlmacen" UpdateMode="Conditional" runat="server"> <asp:UpdatePanel ID="UpAlmacen" UpdateMode="Conditional" runat="server">
@@ -2548,15 +2541,63 @@
</asp:UpdatePanel> </asp:UpdatePanel>
</div> </div>
</div> </div>
<%--CARGA EXCEL--%>
<div id="DivCargaExcelCotizaciones" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Cargar Cotizaciones</h4>
</div>
<div class="modal-body">
<div class="row v-center">
<div class="col-md-6 v-center">
<label class="col-md-6 v-center truncate">Proveedor:</label>
<div class="col-md-6 v-center">
<asp:DropDownList ID="DdlProveedorCot" runat="server" Width="100%" CssClass="select2me" DataTextField="RazonSocial" DataValueField="CveProveedor"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVProveedorExcel" runat="server" ControlToValidate="DdlProveedorCot" InitialValue="-1" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Proveedor''</b> es necesario, por favor selecionarlo." ValidationGroup="GrpCargarExcel"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCProveedor" runat="server" HighlightCssClass="vco" TargetControlID="RFVProveedorExcel" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<h3>Arraste o haga click para subir el archivo Excel</h3>
</div>
</div>
<div class="row">
<div class="col-md-11" style="margin-left: 30px; margin-right: 30px;">
<asp:TextBox ID="TxtExcelCot" CssClass="ADSdropzone hidden" Text="" data-maxFile="1" runat="server"></asp:TextBox>
</div>
</div>
</div>
<div class="modal-footer">
<div class="row">
<div class="col-md-2" style="text-align: left">
<asp:UpdatePanel ID="UpDescargar" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Button ID="BtnDescargarFormatoCot" OnClick="BtnDescargarFormatoCot_Click" runat="server" CssClass="btn btn-warning" Text="Descargar Formato" />
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="BtnDescargarFormatoCot" />
</Triggers>
</asp:UpdatePanel>
</div>
<div class="col-md-10" style="text-align: right">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:Button ID="BtnCargaExcelCot" runat="server" OnClick="BtnCargaExcelCot_Click" CssClass="btn btn-success" Text="Aceptar" ValidationGroup="GrpCargarExcel"></asp:Button>
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="/Metronic/assets/global/plugins/dropzone/dropzone.js"></script> <script src="/Metronic/assets/global/plugins/dropzone/dropzone.js"></script>
</asp:Content> </asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="JS" runat="server"> <asp:Content ID="Content4" ContentPlaceHolderID="JS" runat="server">
<script src="/Metronic/assets/global/plugins/jquery.pulsate.min.js"></script> <script src="/Metronic/assets/global/plugins/jquery.pulsate.min.js"></script>

View File

@@ -1,5 +1,4 @@
Option Explicit On Option Explicit On
Option Strict On
Imports System.Data Imports System.Data
Imports Extensiones Imports Extensiones
@@ -176,7 +175,7 @@ Partial Class OC
End Property End Property
Private Property NumCotizacionesEvaluar As Integer Private Property NumCotizacionesEvaluar As Integer
Get Get
NumCotizacionesEvaluar = IfNull(ViewState("NumCotizacionesEvaluar"), "-1", ViewState("NumCotizacionesEvaluar")).ToString().ToEntero() NumCotizacionesEvaluar = IfNull(ViewState("NumCotizacionesEvaluar"), "0", ViewState("NumCotizacionesEvaluar")).ToString().ToEntero()
End Get End Get
Set(value As Integer) Set(value As Integer)
ViewState("NumCotizacionesEvaluar") = value ViewState("NumCotizacionesEvaluar") = value
@@ -1509,7 +1508,7 @@ Partial Class OC
'Si requiere cotizacion y el estatus siguiente es el final, desabilitar el combo del estatus 'Si requiere cotizacion y el estatus siguiente es el final, desabilitar el combo del estatus
If ChkCotizacion.Checked AndAlso objOC.CveEstatusSiguiente = CveEstatusFinalOK AndAlso (gvCotizaciones.Rows.Count = 0 Or NumCotizacionesGanadoras < gvCotizaciones.Rows.Count - 1) Then If UsuarioActual.Empresa.Funcionalidad(556) = "1" AndAlso ChkCotizacion.Checked AndAlso objOC.CveEstatusSiguiente = CveEstatusFinalOK AndAlso (gvCotizaciones.Rows.Count = 0 Or NumCotizacionesGanadoras < gvCotizaciones.Rows.Count - 1) Then
CboE.Enabled = False CboE.Enabled = False
LblMsgEstatus.Visible = True LblMsgEstatus.Visible = True
LblMsgEstatus.Text = "Cotización requerida para avanzar" LblMsgEstatus.Text = "Cotización requerida para avanzar"
@@ -1669,7 +1668,7 @@ Partial Class OC
'If ChkCotizacion.Checked AndAlso objOC.CveEstatusSiguiente = CveEstatusFinalOK AndAlso NumCotizacionesGanadoras < gvCotizaciones.Rows.Count - 1 Then 'If ChkCotizacion.Checked AndAlso objOC.CveEstatusSiguiente = CveEstatusFinalOK AndAlso NumCotizacionesGanadoras < gvCotizaciones.Rows.Count - 1 Then
If ChkCotizacion.Checked AndAlso CveEstatusSiguiente = CveEstatusFinalOK AndAlso NumCotizacionesGanadoras < gvCotizaciones.Rows.Count - 1 Then If UsuarioActual.Empresa.Funcionalidad(556) = "1" AndAlso ChkCotizacion.Checked AndAlso CveEstatusSiguiente = CveEstatusFinalOK AndAlso NumCotizacionesGanadoras < gvCotizaciones.Rows.Count - 1 Then
CboE.Enabled = False CboE.Enabled = False
LblMsgEstatus.Visible = True LblMsgEstatus.Visible = True
LblMsgEstatus.Text = "Cotización requerida para avanzar" LblMsgEstatus.Text = "Cotización requerida para avanzar"
@@ -1745,6 +1744,11 @@ Partial Class OC
DdlProveedores.DataSource = GlobalDTCompProveedores(CveEmpresaActual) DdlProveedores.DataSource = GlobalDTCompProveedores(CveEmpresaActual)
DdlProveedores.DataBind() DdlProveedores.DataBind()
DdlProveedores.Items.Insert(0, New ListItem("Seleccione", "-1")) DdlProveedores.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlProveedorCot.DataSource = GlobalDTCompProveedores(CveEmpresaActual)
DdlProveedorCot.DataBind()
DdlProveedorCot.Items.Insert(0, New ListItem("Seleccione", "-1"))
UPProv.Update() : UPPEmp.Update() UPProv.Update() : UPPEmp.Update()
End Sub End Sub
@@ -2019,12 +2023,15 @@ Partial Class OC
dr("Descuento") = Descuento dr("Descuento") = Descuento
dr("Total") = Math.Round(Total, 2) dr("Total") = Math.Round(Total, 2)
dr("CveUnidadMedida") = CveUnidadMedida dr("CveUnidadMedida") = CveUnidadMedida
dr("IVAPorcentaje") = If(IVAPS = -1, Math.Round(DdlIVA.SelectedValue.ToDouble - 1, 2), IVAPS)
dr("IVA") = Math.Round(dr("IVAPorcentaje").ToString.ToDouble * Total, 2)
dr("IEPSPSPorcentaje") = IEPSPS dr("IEPSPSPorcentaje") = IEPSPS
dr("IEPSPS") = Math.Round(IEPSPS * Total, 2) dr("IEPSPS") = Math.Round(IEPSPS * Total, 2)
dr("IEPSPSIVAPorcentaje") = IEPSPSIVA dr("IEPSPSIVAPorcentaje") = IEPSPSIVA
dr("IEPSPSIVA") = Math.Round(IEPSPSIVA * Total, 2) dr("IEPSPSIVA") = Math.Round(IEPSPSIVA * Total, 2)
dr("IVAPorcentaje") = If(IVAPS = -1, Math.Round(DdlIVA.SelectedValue.ToDouble - 1, 2), IVAPS)
Dim TotalGravado As Decimal = Total
If IEPSPSIVA > 0 Then TotalGravado = Total * (1 + IEPSPSIVA) 'grava para iva, el importe del IEPS
dr("IVA") = Math.Round(dr("IVAPorcentaje").ToString.ToDouble * TotalGravado, 2)
dr("RetIVAPorcentaje") = RetIVA dr("RetIVAPorcentaje") = RetIVA
dr("RetIVA") = Math.Round(RetIVA * Total, 2) dr("RetIVA") = Math.Round(RetIVA * Total, 2)
dr("RetISRPorcentaje") = RetISR dr("RetISRPorcentaje") = RetISR
@@ -2766,9 +2773,9 @@ Partial Class OC
If UsuarioActual.Empresa.Funcionalidad(565) = "1" Then If UsuarioActual.Empresa.Funcionalidad(565) = "1" Then
If CveConfianzaProveedor > 0 Then If CveConfianzaProveedor > 0 Then
If CveConfianzaProveedor = 1 AndAlso Me.NumCotizaciones >= 1 Then If CveConfianzaProveedor = 1 AndAlso Me.NumCotizacionesEvaluar >= 1 Then
TieneError = GeneraOrdenes(OC, Conta, ObjInventarios) TieneError = GeneraOrdenes(OC, Conta, ObjInventarios)
ElseIf CveConfianzaProveedor = 2 AndAlso Me.NumCotizaciones >= 2 Then ElseIf CveConfianzaProveedor = 2 AndAlso Me.NumCotizacionesEvaluar >= 2 Then
TieneError = GeneraOrdenes(OC, Conta, ObjInventarios) TieneError = GeneraOrdenes(OC, Conta, ObjInventarios)
Else Else
TieneError = True TieneError = True
@@ -2878,13 +2885,15 @@ Partial Class OC
Promocion = TxtPromocion.Text.Trim Promocion = TxtPromocion.Text.Trim
Try Try
If ChkCotizacion.Checked Then Dim NoProveedoresCot As Integer = DtDetalle.COUNT("CveProveedor", "CveProveedor > 0")
If ChkCotizacion.Checked AndAlso NoProveedoresCot > 0 AndAlso (NumCotizacionesGanadoras > 0 OrElse Not (NumCotizacionesGanadoras <= 0 AndAlso CveConfianzaProveedor = 1)) Then
Dim CveProveedor = -1 Dim CveProveedor = -1
Dim TotalCot = 0.0, IVACot = 0D, RetIVA = 0.0, RetISR = 0.0, PorIVA = 0.0, Porcentaje = 0.0 Dim TotalCot = 0.0, IVACot = 0D, RetIVA = 0.0, RetISR = 0.0, PorIVA = 0.0, Porcentaje = 0.0
Dim IdPoliza = -1 Dim IdPoliza = -1
For Each dr As DataRow In DtDetalle.FiltraParametros("", "CveProveedor").Rows For Each dr As DataRow In DtDetalle.FiltraParametros("CveProveedor > 0", "CveProveedor").Rows
'SI ES DIFERENTE PROVEEDOR AGREGA UNA OC 'SI ES DIFERENTE PROVEEDOR AGREGA UNA OC
If CveProveedor <> dr("CveProveedor").ToString.ToEntero Then If CveProveedor <> dr("CveProveedor").ToString.ToEntero Then
@@ -2932,6 +2941,7 @@ Partial Class OC
HuboError = True HuboError = True
Exit For Exit For
End If End If
End If End If
'AGREGA DETALLES 'AGREGA DETALLES
@@ -3657,18 +3667,23 @@ Partial Class OC
dr(0)("Importe") = Importe dr(0)("Importe") = Importe
dr(0)("Descuento") = Descuento dr(0)("Descuento") = Descuento
dr(0)("Total") = Total dr(0)("Total") = Total
'If DdlIVA.SelectedValue.ToDouble = 1 Then dr(0)("IVA") = 0 Else dr(0)("IVA") = IvaPS * Total
dr(0)("IVAPorcentaje") = If(IvaPS = -1, Math.Round(DdlIVA.SelectedValue.ToDouble - 1, 2), 0)
dr(0)("IVA") = dr(0)("IVAPorcentaje").ToString.ToDouble * Total
dr(0)("RetIVA") = RetIVA * Total
dr(0)("RetIVAPorcentaje") = RetIVA
dr(0)("RetISR") = RetISR * Total
dr(0)("RetISRPorcentaje") = RetISR
dr(0)("IEPSPS") = IEPSPS * Total dr(0)("IEPSPS") = IEPSPS * Total
dr(0)("IEPSPSPorcentaje") = IEPSPS dr(0)("IEPSPSPorcentaje") = IEPSPS
dr(0)("IEPSPSIVA") = IEPSPSIVA * Total dr(0)("IEPSPSIVA") = IEPSPSIVA * Total
dr(0)("IEPSPSIVAPorcentaje") = IEPSPSIVA dr(0)("IEPSPSIVAPorcentaje") = IEPSPSIVA
'If DdlIVA.SelectedValue.ToDouble = 1 Then dr(0)("IVA") = 0 Else dr(0)("IVA") = IvaPS * Total
dr(0)("IVAPorcentaje") = If(IvaPS = -1, Math.Round(DdlIVA.SelectedValue.ToDouble - 1, 2), 0)
Dim TotalGravado As Decimal = Total
If IEPSPSIVA > 0 Then TotalGravado = Total * (1 + IEPSPSIVA) 'grava para iva, el importe del IEPS
dr(0)("IVA") = Math.Round(dr(0)("IVAPorcentaje").ToString.ToDouble * TotalGravado, 2)
dr(0)("RetIVA") = RetIVA * Total
dr(0)("RetIVAPorcentaje") = RetIVA
dr(0)("RetISR") = RetISR * Total
dr(0)("RetISRPorcentaje") = RetISR
dr(0)("CveActivoFijo") = CveActivoFijo dr(0)("CveActivoFijo") = CveActivoFijo
dr(0)("CodigoAF") = Codigo dr(0)("CodigoAF") = Codigo
@@ -4174,7 +4189,7 @@ Partial Class OC
' uppOpciones.Update() ' uppOpciones.Update()
'End If 'End If
If ChkCotizacion.Checked AndAlso CveEstatusSiguiente = CveEstatusFinalOK AndAlso (gvCotizaciones.Rows.Count = 0 Or NumCotizacionesGanadoras < gvCotizaciones.Rows.Count - 1) Then If UsuarioActual.Empresa.Funcionalidad(556) = "1" AndAlso ChkCotizacion.Checked AndAlso CveEstatusSiguiente = CveEstatusFinalOK AndAlso (gvCotizaciones.Rows.Count = 0 Or NumCotizacionesGanadoras < gvCotizaciones.Rows.Count - 1) Then
CboE.Enabled = False CboE.Enabled = False
LblMsgEstatus.Visible = True LblMsgEstatus.Visible = True
LblMsgEstatus.Text = "Cotización requerida para avanzar" LblMsgEstatus.Text = "Cotización requerida para avanzar"
@@ -7307,4 +7322,173 @@ Partial Class OC
#End Region #End Region
#Region "C A R G A R E X C E L "
Protected Sub BtnCargaExcelCot_Click(sender As Object, e As EventArgs)
If TxtExcelCot.getfiles().Archivos.Count > 0 Then
Dim file As Archivo = TxtExcelCot.getfiles().Archivos(0)
Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.patch
CargarArchivoCot(Directorio, file.filename)
CargaCotizaciones(CveOrdenCompra)
RegistraScript("$('#DivCargaExcelCotizaciones').modal('hide');")
Else
Alert("No existe el archivo. Favor de subir un archivo excel a la plataforma.", TipoMensaje.MsgError)
End If
End Sub
Protected Sub BtnDescargarFormatoCot_Click(sender As Object, e As EventArgs)
'cantidad, Producto, Precio Unitario, Fecha Entrega, Observación
Dim DtPS As DataTable = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
Dim DtExcel As DataTable = (From row As GridViewRow In GvD.Rows
Join rowPS In DtPS On rowPS("CvePS").ToString().ToEntero() Equals row.DataKey("CvePS").ToEntero()
Where row.RowType = DataControlRowType.DataRow
Select New With
{
.Cantidad = row.DataKey("Cantidad"),
.Codigo = rowPS("Codigo"),
.Producto = rowPS("PSCodigo"),
.PrecioUnitario = row.DataKey("Importe").ToDecimal(),
.FechaEntrega = "",
.Observacion = row.DataKey("Observacion")
}).QueryToDataTable(True)
If DtExcel.Rows.Count < 2 Then
Alert("No hay resutados en la busqueda.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
DtExcel.TableName = "Cotización"
'DtExcel.Columns("Codigo").ColumnName = "Código"
'DtExcel.Columns("PS").ColumnName = "Producto / Servicio"
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
Dim FileExcel As New ExcelFile()
Dim worksheet = FileExcel.Worksheets.Add(DtExcel.TableName)
worksheet.InsertDataTable(DtExcel, New InsertDataTableOptions() With
{
.ColumnHeaders = True,
.StartRow = 0,
.StartColumn = 0
})
worksheet.Rows(0).Style.FillPattern.SetPattern(FillPatternStyle.Solid, SpreadsheetColor.FromArgb(75, 119, 190), SpreadsheetColor.FromArgb(255, 255, 255))
worksheet.Rows(0).Style.Font.Color = SpreadsheetColor.FromArgb(255, 255, 255)
Dim columnCount = worksheet.CalculateMaxUsedColumns()
For i = 0 To columnCount
worksheet.Columns(i).AutoFit(1, worksheet.Rows(0), worksheet.Rows(worksheet.Rows.Count - 1))
Next
FileExcel.Save(Response, "Cotizacion.xlsx", SaveOptions.XlsxDefault)
End Sub
Protected Sub CargarArchivoCot(Ruta As String, FileName As String)
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
Dim dt As DataTable = Nothing
Dim ErrorArchivo = False
Try
dt = ReadExcelFile(Ruta + FileName, True)
Catch ex As Exception
ErrorArchivo = True
OnError("Ocurrio un error al leer el archivo <br/>" & ex.Message, ex)
End Try
If Not ErrorArchivo AndAlso dt IsNot Nothing Then
'cantidad, Producto, Precio Unitario, Fecha Entrega, Observación
If DdlProveedorCot.SelectedValue.ToEntero() <= 0 Then
Alert("Debe Seleccionar la lista de precios a cargar. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(0).ColumnName = "Cantidad" Then
Alert("El nombre de la tercera columna debe ser 'Cantidad'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(1).ColumnName = "Codigo" Then
Alert("El nombre de la cuarta columna debe ser 'Codigo'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(2).ColumnName = "Producto" Then
Alert("El nombre de la cuarta columna debe ser 'Producto'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(3).ColumnName = "PrecioUnitario" Then
Alert("El nombre de la sexta columna debe ser 'PrecioUnitario'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(4).ColumnName = "FechaEntrega" Then
Alert("El nombre de la sexta columna debe ser 'FechaEntrega'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(5).ColumnName = "Observacion" Then
Alert("El nombre de la sexta columna debe ser 'Observacion'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
dt.TableName = "Datos"
Dim ProductosNoCargados As New StringBuilder()
Dim RowsCargados As Integer = 0
Dim RowsNoCargados As Integer = 0
Dim TieneError As Boolean = False
Dim objCotizacion As New ClsOC
objCotizacion.IniciaTransacSQL()
Try
Dim DtPS As DataTable = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
Dim DtOCDetalle As DataTable = (From row As GridViewRow In GvD.Rows
Join rowPS In DtPS On rowPS("CvePS").ToString().ToEntero() Equals row.DataKey("CvePS").ToEntero()
Where row.RowType = DataControlRowType.DataRow
Select New With
{
.CvePS = row.DataKey("CvePS").ToEntero(),
.CveUnidadMedida = rowPS("CveUnidadMedida").ToString().ToEntero(),
.CveOrdenCompraDetalle = row.DataKey("CveOrdenCompraDetalle").ToString().ToEntero(),
.Codigo = rowPS("Codigo")
}).QueryToDataTable(True)
Dim Folio As String = ""
Dim CveProveedor As Integer = DdlProveedorCot.SelectedValue.ToEntero()
If CveProveedor > 0 Then
If objCotizacion.AddCotizacion(CveOrdenCompra, CveProveedor, -1, Folio, TxtFecha.Text, "", DdlMoneda.SelectedValue.ToEntero, 0, UsuarioActual.CveUsuario) Then
For Each dr As DataRow In dt.Rows
Dim RowPS = DtOCDetalle.FiltroPrimero(String.Format("Codigo='{0}'", dr("Codigo").ToString()))
Dim CveOrdenCompraDetalle As Integer = RowPS("CveOrdenCompraDetalle").ToString().ToEntero()
Dim CvePS As Integer = RowPS("CvePS").ToString().ToEntero()
Dim CveUnidadMedida As Integer = RowPS("CveUnidadMedida").ToString().ToEntero()
Dim Fecha As String = If(String.IsNullOrEmpty(dr("FechaEntrega").ToString()), "", If(IsDate(dr("FechaEntrega").ToString()), dr("FechaEntrega").ToString(), ""))
TieneError = Not objCotizacion.AddCotizacionDetalle(objCotizacion.CveCotizacion, CvePS, dr("PrecioUnitario").ToString().ToDecimal(), dr("Cantidad").ToString().ToDouble, CveUnidadMedida,
dr("Cantidad").ToString().ToDouble, Fecha, dr("Observacion").ToString(), CveOrdenCompraDetalle)
If TieneError = True Then Exit For
Next
End If
Else
TieneError = False
End If
Catch ex As Exception
TieneError = True
OnError("Ocurrió un error al cargar las cotizaciones.", ex)
Finally
If TieneError Then
objCotizacion.RollBack()
Alert("Ocurrió un error al cargar las cotizaciones.")
Else
objCotizacion.Commit()
Alert("Las cotizaciones se cargaron correctamente.")
End If
objCotizacion.Dispose()
End Try
End If
End Sub
#End Region
End Class End Class

View File

@@ -498,21 +498,21 @@ Partial Class OS_OrdenesServicios
' LnkTecnico.Visible = True ' LnkTecnico.Visible = True
'End If 'End If
'If TipoEstatus = 3 Then If TipoEstatus = 3 Then
' DisableAll() DisableAll()
' If SeFacturara = "True" Then If SeFacturara = "True" Then
' HplFacturar.Visible = True HplFacturar.Visible = True
' If ObjOS.CveCotizacion > 0 Then If ObjOS.CveCotizacion > 0 Then
' HplFacturar.NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveVenta={0}", ObjOS.CveCotizacion) HplFacturar.NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveVenta={0}", ObjOS.CveCotizacion)
' Else Else
' HplFacturar.NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveOS={0}", CveOS) HplFacturar.NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveOS={0}", CveOS)
' End If End If
' End If End If
'ElseIf TipoEstatus = 4 Then ElseIf TipoEstatus = 4 Then
' DisableAll() DisableAll()
'End If End If
DivCliente.Attributes.Add("class", "col-md-8") DivCliente.Attributes.Add("class", "col-md-8")
DivFolio.Visible = True DivFolio.Visible = True
@@ -2410,6 +2410,7 @@ Partial Class OS_OrdenesServicios
#Region "I M P R I M I R PDF" #Region "I M P R I M I R PDF"
Private Sub ImgImprimir_Click(sender As Object, e As EventArgs) Handles ImgImprimir.Click Private Sub ImgImprimir_Click(sender As Object, e As EventArgs) Handles ImgImprimir.Click
Dim mensajeImprimir As New StringBuilder Dim mensajeImprimir As New StringBuilder
mensajeImprimir.AppendFormat(String.Format("<br/>Descargar Orden de Servicio con Folio: <a class=""Texto"" href='/OS/OrdenesServicios.aspx?CveOS={0}'>{1}</a><br/>", CveOS, CveFolio))
mensajeImprimir.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul><br/>", Encripta(String.Format("OP=OS&CVEOS={0}", CveOS))) mensajeImprimir.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul><br/>", Encripta(String.Format("OP=OS&CVEOS={0}", CveOS)))
Alert(mensajeImprimir.ToString, TipoMensaje.MsgInformacion) Alert(mensajeImprimir.ToString, TipoMensaje.MsgInformacion)
End Sub End Sub

View File

@@ -761,7 +761,7 @@ ADSScroll = function (tablescroll) {
/* Se Combinan las tablas titulo y cuerpo */ /* Se Combinan las tablas titulo y cuerpo */
if (idTheader && idTheader.length) { if (idTheader && idTheader.length) {
if ($(idTheader).length) { if ($(idTheader).length) {
$($(idTheader + "> tbody > tr,> thead > tr,> tr").get().reverse()).each(function () { $($(idTheader + "> tbody > tr," + idTheader + "> thead > tr," + idTheader +"> tr").get().reverse()).each(function () {
var trthis = $(this); var trthis = $(this);
tablescroll.prepend(trthis); tablescroll.prepend(trthis);
rowVisibles += 1; rowVisibles += 1;

View File

@@ -229,11 +229,11 @@
</div> </div>
</div> </div>
<asp:GridView ID="gvSucursal" runat="server" AutoGenerateColumns="False" DataKeyNames="CveSubProyecto" EmptyDataText="No se encontraron Sucursales" ToolTip="Listado de Sucursales habilitadas para Productos o Servicios" <asp:GridView ID="gvSucursal" runat="server" AutoGenerateColumns="False" DataKeyNames="CveSubProyecto" EmptyDataText="No se encontraron Sucursales" ToolTip="Listado de Sucursales habilitadas para Productos o Servicios"
CssClass="table table-striped table-smallpadding table-advance table-hover Widthall" Style="text-align: center;" GridLines="None"> CssClass="table table-striped table-smallpadding table-advance table-hover Widthall" OnRowDataBound="gvSucursal_RowDataBound" Style="text-align: center;" GridLines="None">
<Columns> <Columns>
<asp:TemplateField> <asp:TemplateField>
<ItemTemplate> <ItemTemplate>
<asp:CheckBox ID="chkSucursal" runat="server" Checked='<%# Eval("Activo") %>' CssClass="CsMCheckGvSucursal" /> <asp:CheckBox ID="chkSucursal" runat="server" Checked="false" CssClass="CsMCheckGvSucursal" />
<asp:HiddenField ID="hdnEnBD" runat="server" Value='<%# If (IsDBNull(Eval("CvePS")),0,1) %>' /> <asp:HiddenField ID="hdnEnBD" runat="server" Value='<%# If (IsDBNull(Eval("CvePS")),0,1) %>' />
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
@@ -415,6 +415,9 @@
$('.CsMCheckGvSucursal').find('input[type=checkbox]').prop('checked', false); $('.CsMCheckGvSucursal').find('input[type=checkbox]').prop('checked', false);
} }
} }
function FncSeleccionaChk(chk) {
chk.checked = true;
}

View File

@@ -468,7 +468,12 @@ Partial Class Ventas_ActualizarPrecios
End While End While
Return dataTable Return dataTable
End Function End Function
#End Region #End Region
Protected Sub gvSucursal_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.FCTextBox("TxtPrecioMinimo").Attributes.Add("onKeyUp", String.Format("FncSeleccionaChk({0});", e.Row.FCCheckBox("chkSucursal").ClientID))
End If
End Sub
End Class End Class

View File

@@ -2465,9 +2465,9 @@ Partial Class Clientes
If ErrorProceso Then If ErrorProceso Then
ObjClientes.RollBack() ObjClientes.RollBack()
Else Else
ObjClientes.Commit() ObjClientes.Commit()
'JM 05-02-19: CRM ASIGAN CLIENTE A EMPRESACRM 'JM 05-02-19: CRM ASIGAN CLIENTE A EMPRESACRM
Dim MensajeCRM As String = "" Dim MensajeCRM As String = ""
If CveEmpresaCRM > 0 Then If CveEmpresaCRM > 0 Then
If VincularEmpresaCRM() Then If VincularEmpresaCRM() Then
@@ -2536,13 +2536,8 @@ Partial Class Clientes
ObjClientes.Commit() ObjClientes.Commit()
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
CargaHistorial()
CargaDatos()
UpDatos.Update()
UpnHistorial.Update()
If EstatusAnteriorCliente <> ChkEstado.Checked Then If EstatusAnteriorCliente <> ChkEstado.Checked Then
Dim DTVendedor As New DataTable Dim DTVendedor As New DataTable
@@ -2551,7 +2546,7 @@ Partial Class Clientes
If DTVendedor.Rows.Count > 0 Then If DTVendedor.Rows.Count > 0 Then
Dim _CorreoVendedor As String = DTVendedor(0)("Correo").ToString Dim _CorreoVendedor As String = DTVendedor(0)("Correo").ToString
If _CorreoVendedor.Length > 0 Then If _CorreoVendedor.Length > 0 And UsuarioActual.Empresa.Funcionalidad(571).ToEntero > 0 Then
Dim Asunto As String = "" Dim Asunto As String = ""
Dim Para As String = _CorreoVendedor Dim Para As String = _CorreoVendedor
@@ -2559,19 +2554,22 @@ Partial Class Clientes
If ChkEstado.Checked Then If ChkEstado.Checked Then
Asunto = "Activación de cliente " & TxtNombre.Text Asunto = "Activación de cliente " & TxtNombre.Text
SBBody.Append(String.Format(" Por Medio de la presente se le notifica que el estatus del cliente {0} a sido activado.", TxtNombre.Text)) SBBody.Append(String.Format(" Por Medio de la presente se le notifica que el estatus del cliente {0} ha sido activado.", TxtNombre.Text))
Else Else
Asunto = "Desactivación de cliente " & TxtNombre.Text Asunto = "Desactivación de cliente " & TxtNombre.Text
SBBody.Append(String.Format(" Por Medio de la presente se le notifica que el estatus del cliente {0} a sido desactivado.", TxtNombre.Text)) SBBody.Append(String.Format(" Por Medio de la presente se le notifica que el estatus del cliente {0} ha sido desactivado.", TxtNombre.Text))
End If End If
EstatusAnteriorCliente = ChkEstado.Checked MandaCorreo(Asunto, Para + "", SBBody.ToString)
MandaCorreo(Asunto, Para, SBBody.ToString)
End If End If
End If End If
End If End If
CargaHistorial()
CargaDatos()
UpDatos.Update()
UpnHistorial.Update()
End If End If
End If End If
ObjClientes.Dispose() ObjClientes.Dispose()

View File

@@ -223,7 +223,7 @@
<table border="0" width="463px"> <table border="0" width="463px">
<tr align="left"> <tr align="left">
<td width="95px"><b>Nombre:</b>&nbsp;</td> <td width="110px"><b>Nombre:</b>&nbsp;</td>
<td width="200px"> <td width="200px">
<asp:Label ID="LblCliente" runat="server" Text="Cliente"></asp:Label></td> <asp:Label ID="LblCliente" runat="server" Text="Cliente"></asp:Label></td>
<td width="85px" runat="server" id="LblEnviarMail"><b>Enviar Mail:</b></td> <td width="85px" runat="server" id="LblEnviarMail"><b>Enviar Mail:</b></td>
@@ -303,6 +303,14 @@
</td> </td>
</tr> </tr>
<tr align="left" style="border: 4px solid red" runat="server" id="TrEsDistribuidor" visible="false">
<td><b style="color: red;">Es Distribuidor</b></td>
<td></td>
<td><b style="color: red">Vendedor:</b></td>
<td>
<asp:Label ID="LbVendedor" runat="server" Text=""></asp:Label></td>
</tr>
</table> </table>
</div> </div>
</div> </div>
@@ -2592,13 +2600,6 @@
<label for="<%= TxtCantidad.ClientID.ToString()%>">Cantidad:</label> <label for="<%= TxtCantidad.ClientID.ToString()%>">Cantidad:</label>
</div> </div>
</div> </div>
<div class="col-md-8">
<asp:UpdatePanel ID="UpBtnDescuento" runat="server" class="portlet-body form" UpdateMode="Conditional">
<ContentTemplate>
<asp:LinkButton ID="ImgDescPU" runat="server" Text="<i class='fa fa-comment-o'></i>" Style="cursor: pointer;" AlternateText="Agregar Descuento" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div> </div>
<asp:UpdatePanel runat="server" ID="UpClasificacion" UpdateMode="Conditional"> <asp:UpdatePanel runat="server" ID="UpClasificacion" UpdateMode="Conditional">
@@ -2660,35 +2661,47 @@
</div> </div>
</div> </div>
<br /> <div id="DivRecepcionUsados" runat="server">
<div class="row"> <div class="row">
<div class="col-md-12" id="DivRecepcionUsados" runat="server" visible="false"> <div class="col-md-5">
<asp:GridView ID="GvRecepcionUsados" runat="server" GridLines="None" ShowHeaderWhenEmpty="true" CssClass="table table-hover table-striped ScrollAD mysmallbtn" <label>Modelo:</label>
data-sort="true" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" data-height="100" <br />
DataKeyNames="CvePSCargo,CveUM,Cargo,CveTamaño"> <asp:DropDownList ID="DdlModeloAuto" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="ModeloMarca" DataValueField="CveModeloAuto">
<Columns> </asp:DropDownList>
<asp:BoundField DataField="CodigoPS" HeaderText="Tamaño" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="35%" /> </div>
<asp:TemplateField HeaderText="Cantidad" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="20%"> </div>
<br />
<div class="row">
<div class="col-md-12" visible="false">
<asp:GridView ID="GvRecepcionUsados" runat="server" GridLines="None" ShowHeaderWhenEmpty="true" CssClass="table table-hover table-striped ScrollAD mysmallbtn"
data-sort="true" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" data-height="100"
DataKeyNames="CvePSCargo,CveUM,Cargo,CveTamaño">
<Columns>
<asp:BoundField DataField="CodigoPS" HeaderText="Tamaño" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="35%" />
<asp:TemplateField HeaderText="Cantidad" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="20%">
<ItemTemplate>
<asp:TextBox ID="TxtCantidad" CssClass="form-control linewhitsize" runat="server" Width="90%" Height="30px"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="FTBECantidad" runat="server" TargetControlID="TxtCantidad" FilterType="Custom, Numbers" ValidChars="." />
</ItemTemplate>
</asp:TemplateField>
<%-- <asp:TemplateField HeaderText="Modelo" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="30%">
<ItemTemplate> <ItemTemplate>
<asp:TextBox ID="TxtCantidad" CssClass="form-control linewhitsize" runat="server" Width="90%" Height="30px"></asp:TextBox> <asp:DropDownList ID="DdlModeloAuto" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="ModeloMarca" DataValueField="CveModeloAuto">
<ajax:FilteredTextBoxExtender ID="FTBECantidad" runat="server" TargetControlID="TxtCantidad" FilterType="Custom, Numbers" ValidChars="." />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Modelo" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="30%">
<ItemTemplate>
<asp:DropDownList ID="DdlModeloAuto" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="ModeloMarca" DataValueField="CveModeloAuto" >
</asp:DropDownList> </asp:DropDownList>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>--%>
<asp:TemplateField HeaderText="BCI" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="25%"> <asp:TemplateField HeaderText="BCI" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="25%">
<ItemTemplate> <ItemTemplate>
<asp:DropDownList ID="DdlBCIUsado" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="BCI" DataValueField="CveBCIUsado" Width="90%"> <asp:DropDownList ID="DdlBCIUsado" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="BCI" DataValueField="CveBCIUsado" Width="90%">
</asp:DropDownList> </asp:DropDownList>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
</Columns> </Columns>
</asp:GridView> </asp:GridView>
</div>
</div> </div>
</div> </div>
@@ -2704,15 +2717,27 @@
<br /> <br />
<div class="form-group form-md-line-input input-iconright"> <div class="row">
<asp:TextBox ID="TxtPrecio" runat="server" onkeypress="setFocus(event,'LbAgregar');" onkeyup="Recalcula();" CausesValidation="true" lang="nb" ClientIDMode="Static" Text="0.00" MaxLength="12" ValidationGroup="GrpAddVenta" Width="76px" CssClass="form-control "></asp:TextBox> <div class="col-md-3">
<ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtender4" runat="server" TargetControlID="TxtPrecio" FilterType="Custom, Numbers" ValidChars="." /> <div class="form-group form-md-line-input input-iconright">
<asp:RequiredFieldValidator ID="RFVPrecio" runat="server" ControlToValidate="TxtPrecio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Precio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator> <asp:TextBox ID="TxtPrecio" runat="server" onkeypress="setFocus(event,'LbAgregar');" onkeyup="Recalcula();" CausesValidation="true" lang="nb" ClientIDMode="Static" Text="0.00" MaxLength="12" ValidationGroup="GrpAddVenta" Width="76px" CssClass="form-control "></asp:TextBox>
<ajax:ValidatorCalloutExtender ID="VCPrecio" runat="server" HighlightCssClass="vco" TargetControlID="RFVPrecio" Width="300px"></ajax:ValidatorCalloutExtender> <ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtender4" runat="server" TargetControlID="TxtPrecio" FilterType="Custom, Numbers" ValidChars="." />
<asp:CustomValidator ID="CVPrecio" runat="server" ClientValidationFunction="ValidaDecimal6digits" ControlToValidate="TxtPrecio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Precio''</b> no tiene el formato correcto. Por favor rectifique y vuelva a intentar." ValidateEmptyText="True" ValidationGroup="GrpAddVenta"></asp:CustomValidator> <asp:RequiredFieldValidator ID="RFVPrecio" runat="server" ControlToValidate="TxtPrecio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Precio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEPrecio" runat="server" HighlightCssClass="vco" TargetControlID="CVPrecio" Width="300px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="VCPrecio" runat="server" HighlightCssClass="vco" TargetControlID="RFVPrecio" Width="300px"></ajax:ValidatorCalloutExtender>
<label for="<%= TxtPrecio.ClientID.ToString()%>">Precio:</label> <asp:CustomValidator ID="CVPrecio" runat="server" ClientValidationFunction="ValidaDecimal6digits" ControlToValidate="TxtPrecio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Precio''</b> no tiene el formato correcto. Por favor rectifique y vuelva a intentar." ValidateEmptyText="True" ValidationGroup="GrpAddVenta"></asp:CustomValidator>
<ajax:ValidatorCalloutExtender ID="VCEPrecio" runat="server" HighlightCssClass="vco" TargetControlID="CVPrecio" Width="300px"></ajax:ValidatorCalloutExtender>
<label for="<%= TxtPrecio.ClientID.ToString()%>">Precio:</label>
</div>
</div>
<div class="col-md-8">
<asp:UpdatePanel ID="UpBtnDescuento" runat="server" class="portlet-body form" UpdateMode="Conditional">
<ContentTemplate>
<asp:LinkButton ID="ImgDescPU" runat="server" Text="<i class='fa fa-tags' style='color:dimgray;'></i>" Style="cursor: pointer;" AlternateText="Agregar Descuento" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div> </div>
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright">
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
@@ -2742,6 +2767,9 @@
</div> </div>
</div> </div>
<asp:UpdatePanel ID="UpAjuste" runat="server" class="portlet-body form" UpdateMode="Conditional"> <asp:UpdatePanel ID="UpAjuste" runat="server" class="portlet-body form" UpdateMode="Conditional">
<Triggers>
<asp:PostBackTrigger ControlID="BtnPDFHistorial" />
</Triggers>
<ContentTemplate> <ContentTemplate>
<div class="col-md-1" id="DivAjuste" runat="server" visible="false"> <div class="col-md-1" id="DivAjuste" runat="server" visible="false">
<div class="portlet light xspadding bordered"> <div class="portlet light xspadding bordered">
@@ -2751,10 +2779,10 @@
<span class="caption-subject bold uppercase">Ajuste </span> <span class="caption-subject bold uppercase">Ajuste </span>
</div> </div>
<div class="tools"> <div class="tools">
<asp:LinkButton ID="BtnPDFHistorial" OnClick="BtnPDFHistorial_Click" runat="server" data-toggle="tooltip" Title="PDF"><i class="fa fa-file-pdf-o" style="font-size:15px; font-weight:bold; color:dimgray;"></i></asp:LinkButton>
<a href="javascript;" class="collapse" data-original-title="" title=""></a> <a href="javascript;" class="collapse" data-original-title="" title=""></a>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright">
@@ -2765,14 +2793,14 @@
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-9"> <div class="col-md-12">
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlPSAjuste" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="PSCodigo" DataValueField="CvePS" OnSelectedIndexChanged="DdlPSAjuste_selectedindexchange" Width="100%" AutoPostBack="true"> <asp:DropDownList ID="DdlPSAjuste" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="PSCodigo" DataValueField="CvePS" OnSelectedIndexChanged="DdlPSAjuste_selectedindexchange" Width="100%" AutoPostBack="true">
</asp:DropDownList> </asp:DropDownList>
<label for="<%= DdlPSAjuste.ClientID.ToString()%>">Producto/Servicio a Recibir:</label> <label for="<%= DdlPSAjuste.ClientID.ToString()%>">Producto/Servicio a Recibir:</label>
</div> </div>
</div> </div>
<div class="col-md-3"> <%-- <div class="col-md-3">
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtPUFactura" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox> <asp:TextBox ID="TxtPUFactura" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVPUFactura" runat="server" ControlToValidate="TxtPUFactura" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''PU Factura''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator> <asp:RequiredFieldValidator ID="RFVPUFactura" runat="server" ControlToValidate="TxtPUFactura" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''PU Factura''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator>
@@ -2780,10 +2808,10 @@
<ajax:FilteredTextBoxExtender ID="FTBEPUFactura" runat="server" TargetControlID="TxtPUFactura" FilterType="Custom, Numbers" ValidChars=".," /> <ajax:FilteredTextBoxExtender ID="FTBEPUFactura" runat="server" TargetControlID="TxtPUFactura" FilterType="Custom, Numbers" ValidChars=".," />
<label for="<%= TxtPUFactura.ClientID.ToString()%>">P.U.:</label> <label for="<%= TxtPUFactura.ClientID.ToString()%>">P.U.:</label>
</div> </div>
</div> </div>--%>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-8">
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlFolioGarantia" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="FolioGarantia" DataValueField="CveFolioGarantia" Width="100%"> <asp:DropDownList ID="DdlFolioGarantia" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="FolioGarantia" DataValueField="CveFolioGarantia" Width="100%">
</asp:DropDownList> </asp:DropDownList>
@@ -2792,7 +2820,7 @@
<label for="<%= DdlFolioGarantia.ClientID.ToString()%>">Folio:</label> <label for="<%= DdlFolioGarantia.ClientID.ToString()%>">Folio:</label>
</div> </div>
</div> </div>
<div class="col-md-6"> <div class="col-md-4">
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtConsecutivoAjuste" CssClass="form-control" runat="server" MaxLength="25"></asp:TextBox> <asp:TextBox ID="TxtConsecutivoAjuste" CssClass="form-control" runat="server" MaxLength="25"></asp:TextBox>
<%--<asp:RequiredFieldValidator ID="RFVConsecutivoAjuste" runat="server" ControlToValidate="TxtConsecutivoAjuste" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Consec.''</b> es necesario, por favor ingréselo." ValidationGroup="VGMAjuste"></asp:RequiredFieldValidator>--%> <%--<asp:RequiredFieldValidator ID="RFVConsecutivoAjuste" runat="server" ControlToValidate="TxtConsecutivoAjuste" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Consec.''</b> es necesario, por favor ingréselo." ValidationGroup="VGMAjuste"></asp:RequiredFieldValidator>--%>
@@ -2802,15 +2830,16 @@
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-8">
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCodEnsamble" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox> <asp:TextBox ID="TxtCodEnsamble" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
<%--<asp:RequiredFieldValidator ID="RFVCodEnsamble" runat="server" ControlToValidate="TxtCodEnsamble" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Folio''</b> es necesario, por favor ingréselo." ValidationGroup="VGMAjuste"></asp:RequiredFieldValidator>--%> <asp:RegularExpressionValidator ID="REVCodEnsamble" runat="server" ControlToValidate="TxtCodEnsamble" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod.Ensamble''</b> es incorrecto, por favor ingréselo correctamente." ValidationGroup="GrpAddVenta" ValidationExpression="^[0-9][A-HJ-M]([[0-2][1-9]|3[0-1])([A-Z]|X[1-9])[ACEN][A-HJ-NO-Z][A-F]$"></asp:RegularExpressionValidator>
<%--<asp:RequiredFieldValidator ID="RFVCodEnsamble" runat="server" ControlToValidate="TxtCodEnsamble" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Folio''</b> es necesario, por favor ingréselo." ValidationGroup="VGMAjuste"></asp:RequiredFieldValidator>--%
<%--<ajax:ValidatorCalloutExtender ID="VCECodEnsamble" runat="server" HighlightCssClass="vco" TargetControlID="RFVCodEnsamble"></ajax:ValidatorCalloutExtender>--%> <%--<ajax:ValidatorCalloutExtender ID="VCECodEnsamble" runat="server" HighlightCssClass="vco" TargetControlID="RFVCodEnsamble"></ajax:ValidatorCalloutExtender>--%>
<label for="<%= TxtCodEnsamble.ClientID.ToString()%>">Cod.Ensamble:</label> <label for="<%= TxtCodEnsamble.ClientID.ToString()%>">Cod.Ensamble:</label>
</div> </div>
</div> </div>
<div class="col-md-6"> <div class="col-md-4">
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlTipoUso" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="TipoUso" DataValueField="CveTipoUso" Width="100%" AutoPostBack="true" OnSelectedIndexChanged="DdlTipoUso_SelectedIndexChanged"> <asp:DropDownList ID="DdlTipoUso" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="TipoUso" DataValueField="CveTipoUso" Width="100%" AutoPostBack="true" OnSelectedIndexChanged="DdlTipoUso_SelectedIndexChanged">
</asp:DropDownList> </asp:DropDownList>
@@ -2822,7 +2851,7 @@
</div> </div>
<br /> <br />
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-8">
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCodLinea" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox> <asp:TextBox ID="TxtCodLinea" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
<%--<asp:RequiredFieldValidator ID="RFVCodLinea" runat="server" ControlToValidate="TxtCodLinea" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod. Linea''</b> es necesario, por favor ingréselo." ValidationGroup="VGMAjuste"></asp:RequiredFieldValidator>--%> <%--<asp:RequiredFieldValidator ID="RFVCodLinea" runat="server" ControlToValidate="TxtCodLinea" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod. Linea''</b> es necesario, por favor ingréselo." ValidationGroup="VGMAjuste"></asp:RequiredFieldValidator>--%>
@@ -2830,34 +2859,31 @@
<label for="<%= TxtCodLinea.ClientID.ToString()%>">Cod.Linea:</label> <label for="<%= TxtCodLinea.ClientID.ToString()%>">Cod.Linea:</label>
</div> </div>
</div> </div>
<div class="col-md-6"> <div class="col-md-4">
<div class="row"> <label for="<%= TxtFechaAjuste.ClientID.ToString()%>">Fecha:</label>
<div class="col-md-4" style="text-align: left">Fecha:</div> <div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;">
<div class="col-md-6"> <asp:TextBox ID="TxtFechaAjuste" CssClass="form-control input-sm ADSMaskDate" Width="100%" runat="server"></asp:TextBox>
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;"> <span class="input-group-btn ">
<asp:TextBox ID="TxtFechaAjuste" CssClass="form-control input-sm ADSMaskDate" Width="100%" runat="server"></asp:TextBox> <asp:LinkButton ID="LnkFechaAjuste" class="btn default " Text=" <i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
<span class="input-group-btn "> </span>
<asp:LinkButton ID="LnkFechaAjuste" class="btn default " Text=" <i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton> <ajax:MaskedEditExtender ID="MEEFechaAjuste" runat="server" TargetControlID="TxtFechaAjuste" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
</span> <ajax:CalendarExtender runat="server" ID="CEEFechaAjuste" TargetControlID="TxtFechaAjuste" PopupButtonID="LnkFechaAjuste" PopupPosition="BottomRight" Enabled="True" Format="dd/MM/yyyy"></ajax:CalendarExtender>
<ajax:MaskedEditExtender ID="MEEFechaAjuste" runat="server" TargetControlID="TxtFechaAjuste" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender> <asp:RequiredFieldValidator ID="RFVFechaAjuste" runat="server" ControlToValidate="TxtFechaAjuste" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator>
<ajax:CalendarExtender runat="server" ID="CEEFechaAjuste" TargetControlID="TxtFechaAjuste" PopupButtonID="LnkFechaAjuste" PopupPosition="BottomRight" Enabled="True" Format="dd/MM/yyyy"></ajax:CalendarExtender> <ajax:ValidatorCalloutExtender ID="VCEFechaAjuste" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaAjuste"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="RFVFechaAjuste" runat="server" ControlToValidate="TxtFechaAjuste" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEFechaAjuste" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaAjuste"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-8">
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCodInspeccion" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox> <asp:TextBox ID="TxtCodInspeccion" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
<asp:RegularExpressionValidator ID="REVCodInspeccion" runat="server" ControlToValidate="TxtCodInspeccion" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod. Inspección''</b> es incorrecto, por favor ingréselo correctamente." ValidationGroup="GrpAddVenta" ValidationExpression="^[A-L][3-9][1-9A-V][A-FK-O]$"></asp:RegularExpressionValidator>
<%--<asp:RequiredFieldValidator ID="RFVCodInspeccion" runat="server" ControlToValidate="TxtCodInspeccion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod. Inspeccion''</b> es necesario, por favor ingréselo." ValidationGroup="VGMAjuste"></asp:RequiredFieldValidator>--%> <%--<asp:RequiredFieldValidator ID="RFVCodInspeccion" runat="server" ControlToValidate="TxtCodInspeccion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod. Inspeccion''</b> es necesario, por favor ingréselo." ValidationGroup="VGMAjuste"></asp:RequiredFieldValidator>--%>
<%--<ajax:ValidatorCalloutExtender ID="VCECodInspeccion" runat="server" HighlightCssClass="vco" TargetControlID="RFVCodInspeccion"></ajax:ValidatorCalloutExtender>--%> <%--<ajax:ValidatorCalloutExtender ID="VCECodInspeccion" runat="server" HighlightCssClass="vco" TargetControlID="RFVCodInspeccion"></ajax:ValidatorCalloutExtender>--%>
<label for="<%= TxtCodInspeccion.ClientID.ToString()%>">Cod. Inspección:</label> <label for="<%= TxtCodInspeccion.ClientID.ToString()%>">Cod. Inspección:</label>
</div> </div>
</div> </div>
<div class="col-md-6"> <div class="col-md-4">
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtMesesUso" CssClass="form-control" runat="server" MaxLength="50" Enabled="false"></asp:TextBox> <asp:TextBox ID="TxtMesesUso" CssClass="form-control" runat="server" MaxLength="50" Enabled="false"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVMesesUso" runat="server" ControlToValidate="TxtMesesUso" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Meses de Uso''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator> <asp:RequiredFieldValidator ID="RFVMesesUso" runat="server" ControlToValidate="TxtMesesUso" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Meses de Uso''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator>
@@ -2868,16 +2894,25 @@
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-4">
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlTipoDefecto" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="TipoDefecto" DataValueField="CveTipoDefecto" Width="100%"> <asp:DropDownList ID="DdlTipoDefecto" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="TipoDefecto" DataValueField="CveTipoDefecto" Width="100%" OnSelectedIndexChanged="DdlTipoDefecto_SelectedIndexChanged" AutoPostBack="true">
</asp:DropDownList> </asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVTipoDefecto" runat="server" ControlToValidate="DdlTipoDefecto" InitialValue="-1" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo de Defecto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator> <asp:RequiredFieldValidator ID="RFVTipoDefecto" runat="server" ControlToValidate="DdlTipoDefecto" InitialValue="-1" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo de Defecto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCETipoDefecto" runat="server" HighlightCssClass="vco" TargetControlID="RFVTipoDefecto"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="VCETipoDefecto" runat="server" HighlightCssClass="vco" TargetControlID="RFVTipoDefecto"></ajax:ValidatorCalloutExtender>
<label for="<%= DdlTipoDefecto.ClientID.ToString()%>">Tipo de Defecto:</label> <label for="<%= DdlTipoDefecto.ClientID.ToString()%>">Tipo de Defecto:</label>
</div> </div>
</div> </div>
<div class="col-md-6"> <div class="col-md-4">
<div id="DivCodigoTD" class="form-group form-md-line-input input-iconright" runat="server" visible="false">
<asp:TextBox ID="TxtCodigoTD" CssClass="form-control" runat="server" MaxLength="11" Width="100%"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVCodigoTD" runat="server" ControlToValidate="TxtCodigoTD" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Código''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="RFVCodigoTD"></ajax:ValidatorCalloutExtender>
<ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtender1" runat="server" TargetControlID="TxtCodigoTD" FilterType="Custom, Numbers, UppercaseLetters " ValidChars="." />
<label for="<%= TxtCodigoTD.ClientID.ToString()%>">Código:</label>
</div>
</div>
<div class="col-md-4">
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtPorcentajeAjuste" CssClass="form-control" Enabled="false" runat="server" MaxLength="50"></asp:TextBox> <asp:TextBox ID="TxtPorcentajeAjuste" CssClass="form-control" Enabled="false" runat="server" MaxLength="50"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVPorcentajeAjuste" runat="server" ControlToValidate="TxtPorcentajeAjuste" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''% Ajuste''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator> <asp:RequiredFieldValidator ID="RFVPorcentajeAjuste" runat="server" ControlToValidate="TxtPorcentajeAjuste" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''% Ajuste''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator>
@@ -3080,6 +3115,7 @@
var Descuento = parseFloat($get("TxtPorDescP").value); var Descuento = parseFloat($get("TxtPorDescP").value);
$get("LblPrecioFinal").innerText = formato_numero(Monto - ((Monto * Descuento) / 100), 2, '.', ','); $get("LblPrecioFinal").innerText = formato_numero(Monto - ((Monto * Descuento) / 100), 2, '.', ',');
$get("TxtPrecio").value = formato_numero(parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")), 2, '.', ',');
var Total = Monto - parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")); var Total = Monto - parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", ""));
$get("LblDescuento").innerText = formato_numero(Total, 2, '.', ','); $get("LblDescuento").innerText = formato_numero(Total, 2, '.', ',');
$get("HdnDescuento").value = Total; $get("HdnDescuento").value = Total;
@@ -3107,6 +3143,7 @@
var Descuento = parseFloat($get("TxtDescP").value); var Descuento = parseFloat($get("TxtDescP").value);
$get("TxtPorDescP").value = Descuento * 100 / Monto * 10 $get("TxtPorDescP").value = Descuento * 100 / Monto * 10
$get("LblPrecioFinal").innerText = formato_numero(Monto - Descuento, 2, '.', ','); $get("LblPrecioFinal").innerText = formato_numero(Monto - Descuento, 2, '.', ',');
$get("TxtPrecio").value = formato_numero(parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")), 2, '.', ',');
var Total = Monto - parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")); var Total = Monto - parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", ""));
$get("LblDescuento").innerText = formato_numero(Total, 2, '.', ','); $get("LblDescuento").innerText = formato_numero(Total, 2, '.', ',');
$get("HdnDescuento").value = Total; $get("HdnDescuento").value = Total;

View File

@@ -8,6 +8,7 @@ Imports System.Linq
Imports System.Security.Cryptography.X509Certificates Imports System.Security.Cryptography.X509Certificates
Imports System.Globalization Imports System.Globalization
Imports System.Net.Http Imports System.Net.Http
Imports Microsoft.Reporting.WebForms
Partial Class PV Partial Class PV
Inherits ClsPaginas Inherits ClsPaginas
@@ -932,6 +933,14 @@ Partial Class PV
ViewState("DtPUFacturas") = value ViewState("DtPUFacturas") = value
End Set End Set
End Property End Property
Private Property DtModelosAuto As DataTable
Get
Return CType(ViewState("DtModelosAuto"), DataTable)
End Get
Set(value As DataTable)
ViewState("DtModelosAuto") = value
End Set
End Property
#End Region #End Region
#Region "PROPIEDADES ACUMULADORES" #Region "PROPIEDADES ACUMULADORES"
@@ -1166,6 +1175,7 @@ Partial Class PV
DdlTipoComprobante.Items.Add(New ListItem("Remisión", "Rem")) DdlTipoComprobante.Items.Add(New ListItem("Remisión", "Rem"))
DdlTipoComprobante.SelectedValueExist("Rem") DdlTipoComprobante.SelectedValueExist("Rem")
End If End If
DdlTipoDefecto.Width = New Unit(260%)
'Le quitamos el tamaño extra 'Le quitamos el tamaño extra
'RegistraScript("window.onload = function AjustarVentana() { $('.page-content').css('min-height','100%'); }") 'RegistraScript("window.onload = function AjustarVentana() { $('.page-content').css('min-height','100%'); }")
@@ -1601,6 +1611,11 @@ Partial Class PV
ViewState("CodCliente") = ObjCliente.Codigo ViewState("CodCliente") = ObjCliente.Codigo
ViewState("ClienteDesglosaIEPS") = ObjCliente.DesglosaIEPS ViewState("ClienteDesglosaIEPS") = ObjCliente.DesglosaIEPS
If (Boolean.Parse(ObjCliente.DtResultados(0)("EsDistribuidor").ToString)) Then
TrEsDistribuidor.Visible = True
LbVendedor.Text = GlobalDTVendedores(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Vendedor", $"CveVendedor = {ObjCliente.Vendedor}")
End If
ViewState("CliNoExt") = ObjCliente.NoExt ViewState("CliNoExt") = ObjCliente.NoExt
ViewState("CliNoInt") = ObjCliente.NoInt ViewState("CliNoInt") = ObjCliente.NoInt
ViewState("CliLocalidad") = If(ObjCliente.Localidad.Trim.Length = 0, ObjCliente.Ciudad.Trim, ObjCliente.Localidad.Trim) ViewState("CliLocalidad") = If(ObjCliente.Localidad.Trim.Length = 0, ObjCliente.Ciudad.Trim, ObjCliente.Localidad.Trim)
@@ -2772,10 +2787,8 @@ Partial Class PV
DivRecepcionUsados.Visible = True DivRecepcionUsados.Visible = True
If DdlTipoComprobante.SelectedValue <> "Rem" Then If DdlTipoComprobante.SelectedValue <> "Rem" Then
GvRecepcionUsados.Columns(2).Visible = False GvRecepcionUsados.Columns(2).Visible = False
GvRecepcionUsados.Columns(3).Visible = False
Else Else
GvRecepcionUsados.Columns(2).Visible = True GvRecepcionUsados.Columns(2).Visible = True
GvRecepcionUsados.Columns(3).Visible = True
End If End If
End If End If
@@ -2858,6 +2871,16 @@ Partial Class PV
Protected Sub DdlPS_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DdlPS.selectedindexchange Protected Sub DdlPS_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DdlPS.selectedindexchange
DdlPSIndexChange(DdlPS.SelectedValue.ToEntero, DdlPS) DdlPSIndexChange(DdlPS.SelectedValue.ToEntero, DdlPS)
End Sub End Sub
Protected Sub DdlTipoDefecto_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DdlTipoDefecto.SelectedIndexChanged
If DdlTipoDefecto.SelectedValue.ToEntero = 17 Then
DivCodigoTD.Visible = True
DdlTipoDefecto.Width = New Unit(140%)
Else
DivCodigoTD.Visible = False
DdlTipoDefecto.Width = New Unit(200%)
End If
End Sub
Protected Sub DdlSucursalCliente_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlSucursalCliente.SelectedIndexChanged Protected Sub DdlSucursalCliente_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlSucursalCliente.SelectedIndexChanged
CargaClienteSucursal(DdlSucursalCliente.SelectedValue.ToEntero) CargaClienteSucursal(DdlSucursalCliente.SelectedValue.ToEntero)
End Sub End Sub
@@ -3462,10 +3485,10 @@ Partial Class PV
End If End If
Next Next
If CantidadUsados > TxtCantidad.Text.ToEntero() Then 'If CantidadUsados > TxtCantidad.Text.ToEntero() Then
Alert("No puede tener una cantidad mayor a la de los cargos", TipoMensaje.MsgAdvertencia) ' Alert("No puede tener una cantidad mayor a la de los cargos", TipoMensaje.MsgAdvertencia)
Return False ' Return False
End If 'End If
'VALIDA PROMOCIONES 'VALIDA PROMOCIONES
Dim ObjVentas As New ClsVentas Dim ObjVentas As New ClsVentas
@@ -4922,6 +4945,7 @@ Partial Class PV
Dim DtTamanios = GlobalDTAcumTamaños.FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CvePSCargo > 0") Dim DtTamanios = GlobalDTAcumTamaños.FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CvePSCargo > 0")
CargaModelos()
GvRecepcionUsados.DataSource = DtTamanios GvRecepcionUsados.DataSource = DtTamanios
GvRecepcionUsadosModal.DataSource = DtTamanios GvRecepcionUsadosModal.DataSource = DtTamanios
@@ -4941,6 +4965,15 @@ Partial Class PV
DivChkAjuste.Visible = True DivChkAjuste.Visible = True
End Sub End Sub
Private Sub CargaModelos()
Dim ObjGral As New ClsGenerales
If ObjGral.ModelosAutosGet(UsuarioActual.CveEmpresa) Then
DtModelosAuto = ObjGral.DtResultados
DdlModeloAuto.DataSource = DtModelosAuto
End If
DdlModeloAuto.DataBind()
End Sub
Protected Sub GvRecepcionUsados_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvRecepcionUsados.RowDataBound Protected Sub GvRecepcionUsados_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvRecepcionUsados.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.RowType = DataControlRowType.DataRow Then
@@ -4953,10 +4986,6 @@ Partial Class PV
e.Row.FCDropDownList("DdlBCIUsado").DataBind() e.Row.FCDropDownList("DdlBCIUsado").DataBind()
'e.Row.FCDropDownList("DdlBCIUsado").SelectedValue = e.Row.DBCampo("CveBCIUsado") 'e.Row.FCDropDownList("DdlBCIUsado").SelectedValue = e.Row.DBCampo("CveBCIUsado")
If ObjGral.ModelosAutosGet(UsuarioActual.CveEmpresa) Then
e.Row.FCDropDownList("DdlModeloAuto").DataSource = ObjGral.DtResultados
End If
e.Row.FCDropDownList("DdlModeloAuto").DataBind()
End If End If
End Sub End Sub
@@ -4989,7 +5018,7 @@ Partial Class PV
LimpiaAjuste() LimpiaAjuste()
If TmpDTAjustes IsNot Nothing AndAlso TmpDTAjustes.FiltraParametros($"ConsecutivoVenta = {ConsecutivoVenta}").Rows.Count > 0 Then If TmpDTAjustes IsNot Nothing AndAlso TmpDTAjustes.FiltraParametros($"ConsecutivoVenta = {ConsecutivoVenta}").Rows.Count > 0 Then
ModalidadAjuste = "U" ModalidadAjuste = "U"
TxtPrecio.Attributes.Add("onKeyUp", $"CambiaAjuste(this,{TxtPUFactura.ClientID});") TxtPrecio.Attributes.Add("onKeyUp", $"CambiaAjuste(this,{TxtPrecio.ClientID});")
ChkAjuste.Checked = True ChkAjuste.Checked = True
DivAjuste.Visible = True DivAjuste.Visible = True
CargaAjusteDetalle() CargaAjusteDetalle()
@@ -5005,7 +5034,7 @@ Partial Class PV
TxtCodEnsamble.Text = "" TxtCodEnsamble.Text = ""
DdlTipoUso.SelectedIndex = -1 DdlTipoUso.SelectedIndex = -1
TxtCodLinea.Text = "" TxtCodLinea.Text = ""
TxtPUFactura.Text = "" TxtPrecio.Text = ""
TxtFechaAjuste.Text = Now.ToShortDateString TxtFechaAjuste.Text = Now.ToShortDateString
CEEFechaAjuste.EndDate = Now CEEFechaAjuste.EndDate = Now
TxtCodInspeccion.Text = "" TxtCodInspeccion.Text = ""
@@ -5014,7 +5043,7 @@ Partial Class PV
TxtPorcentajeAjuste.Text = "" TxtPorcentajeAjuste.Text = ""
TxtPoliza.Text = "" TxtPoliza.Text = ""
TxtImporteAjuste.Text = "" TxtImporteAjuste.Text = ""
DdlPSAjuste.SelectedIndex = 0 DdlPSAjuste.SelectedIndex = -1
ChkAjuste.Checked = False ChkAjuste.Checked = False
DivAjuste.Visible = False DivAjuste.Visible = False
End Sub End Sub
@@ -5047,8 +5076,8 @@ Partial Class PV
CargaPSAjuste() CargaPSAjuste()
DdlPSAjuste.SelectedValueExist(Dr("CvePS").ToString) DdlPSAjuste.SelectedValueExist(Dr("CvePS").ToString)
TxtFechaAjuste.Text = Dr("FechaAjuste").ToString.ToDate.ToShortDateString TxtFechaAjuste.Text = Dr("FechaAjuste").ToString.ToDate.ToShortDateString
TxtPUFactura.Text = Dr("PUFactura").ToString.ToDecimal.FormatoNumero(2) TxtPrecio.Text = Dr("PUFactura").ToString.ToDecimal.FormatoNumero(2)
TxtPUFactura.Enabled = Not Dr("CveVenta").ToString.ToEntero > 0 TxtPrecio.Enabled = Not Dr("CveVenta").ToString.ToEntero > 0
End If End If
End Sub End Sub
Protected Sub BtnCalculaMesesUso_Click(sender As Object, e As EventArgs) Protected Sub BtnCalculaMesesUso_Click(sender As Object, e As EventArgs)
@@ -5056,7 +5085,17 @@ Partial Class PV
End Sub End Sub
Private Sub CalculaMesesUso() Private Sub CalculaMesesUso()
TxtMesesUso.Text = DateDiff(DateInterval.Month, TxtFechaAjuste.Text.ToDate, Now).ToEntero.ToString Dim FechaI = TxtFechaAjuste.Text.ToDate.AddDays(1)
Dim FechaF = Now
'Dim NumDiasAlMes As Double = (365 / 12)
'Dim DiasTranscurridos = DateDiff(DateInterval.Day, FechaI, FechaF)
'Dim MesesTranscurridos As Double = DiasTranscurridos / NumDiasAlMes
'Dim NoMesesTrascurridos = Math.Ceiling(MesesTranscurridos)
TxtMesesUso.Text = (DateDiff(DateInterval.Month, FechaI, FechaF) + 1).ToString()
CalculaPorcentajeAjuste() CalculaPorcentajeAjuste()
End Sub End Sub
@@ -5099,7 +5138,7 @@ Partial Class PV
If ObjAcum.GarantiasMesesGet(-1, UsuarioActual.CveEmpresa, CveMarca, DdlTipoUso.SelectedValue.ToEntero, TxtMesesUso.Text.ToEntero) Then If ObjAcum.GarantiasMesesGet(-1, UsuarioActual.CveEmpresa, CveMarca, DdlTipoUso.SelectedValue.ToEntero, TxtMesesUso.Text.ToEntero) Then
If ObjAcum.DtResultados.Rows.Count > 0 Then If ObjAcum.DtResultados.Rows.Count > 0 Then
TxtPorcentajeAjuste.Text = (ObjAcum.DtResultados.Rows(0)("Valor").ToString.ToDouble / 100).ToString TxtPorcentajeAjuste.Text = (ObjAcum.DtResultados.Rows(0)("Valor").ToString.ToDouble / 100).ToString
TxtImporteAjuste.Text = (TxtPorcentajeAjuste.Text.ToDouble * TxtPUFactura.Text.ToDouble).FormatoNumero TxtImporteAjuste.Text = (TxtPorcentajeAjuste.Text.ToDouble * TxtPrecio.Text.ToDouble).FormatoNumero
Dim CargoActual As Decimal = 0 Dim CargoActual As Decimal = 0
Dim CargoAnterior As Decimal = 0 Dim CargoAnterior As Decimal = 0
@@ -5128,8 +5167,8 @@ Partial Class PV
End If End If
End If End If
TxtDescuentoAjuste.Text = ((TxtPUFactura.Text.ToDouble - TxtImporteAjuste.Text.ToDouble) - (CargoActual - CargoAnterior)).FormatoNumero TxtDescuentoAjuste.Text = ((TxtPrecio.Text.ToDouble - TxtImporteAjuste.Text.ToDouble) - (CargoActual - CargoAnterior)).FormatoNumero
TxtDescuentoAjuste.ToolTip = $"La diferencia de ajuste fue: {(TxtPUFactura.Text.ToDouble - TxtImporteAjuste.Text.ToDouble).FormatoNumero()}. La diferencia de tamaños fue: {(CargoActual - CargoAnterior).FormatoNumero}." TxtDescuentoAjuste.ToolTip = $"La diferencia de ajuste fue: {(TxtPrecio.Text.ToDouble - TxtImporteAjuste.Text.ToDouble).FormatoNumero()}. La diferencia de tamaños fue: {(CargoActual - CargoAnterior).FormatoNumero}."
End If End If
End If End If
ObjAcum.Dispose() ObjAcum.Dispose()
@@ -5163,7 +5202,7 @@ Partial Class PV
'End Function 'End Function
Private Sub GuardaAjuste() Private Sub GuardaAjuste()
TxtPUFactura.Text = TxtPrecio.Text TxtPrecio.Text = TxtPrecio.Text
UpAjuste.Update() UpAjuste.Update()
Dim CargoAnterior As Double = 0 Dim CargoAnterior As Double = 0
@@ -5187,7 +5226,7 @@ Partial Class PV
Row("CvePS") = DdlPSAjuste.SelectedValue Row("CvePS") = DdlPSAjuste.SelectedValue
Row("PS") = DdlPSAjuste.SelectedItem.Text Row("PS") = DdlPSAjuste.SelectedItem.Text
Row("CveVenta") = DdlFacturas.SelectedValue Row("CveVenta") = DdlFacturas.SelectedValue
Row("PUFactura") = TxtPUFactura.Text.ToDouble Row("PUFactura") = TxtPrecio.Text.ToDouble
Row("Cantidad") = 1 Row("Cantidad") = 1
Dim CveUM As Integer = -1 Dim CveUM As Integer = -1
If DdlPSAjuste.SelectedValue.ToEntero > 0 Then If DdlPSAjuste.SelectedValue.ToEntero > 0 Then
@@ -5217,7 +5256,7 @@ Partial Class PV
TmpDTAjustes.Rows(IndexAjuste)("CvePS") = DdlPSAjuste.SelectedValue TmpDTAjustes.Rows(IndexAjuste)("CvePS") = DdlPSAjuste.SelectedValue
TmpDTAjustes.Rows(IndexAjuste)("PS") = DdlPSAjuste.SelectedItem.Text TmpDTAjustes.Rows(IndexAjuste)("PS") = DdlPSAjuste.SelectedItem.Text
TmpDTAjustes.Rows(IndexAjuste)("CveVenta") = DdlFacturas.SelectedValue TmpDTAjustes.Rows(IndexAjuste)("CveVenta") = DdlFacturas.SelectedValue
TmpDTAjustes.Rows(IndexAjuste)("PUFactura") = TxtPUFactura.Text.ToDouble TmpDTAjustes.Rows(IndexAjuste)("PUFactura") = TxtPrecio.Text.ToDouble
TmpDTAjustes.Rows(IndexAjuste)("Cantidad") = 1 TmpDTAjustes.Rows(IndexAjuste)("Cantidad") = 1
Dim CveUM As Integer = -1 Dim CveUM As Integer = -1
If DdlPSAjuste.SelectedValue.ToEntero > 0 Then If DdlPSAjuste.SelectedValue.ToEntero > 0 Then
@@ -5244,7 +5283,7 @@ Partial Class PV
End If End If
End If End If
Dr("Descuento") = Math.Round((TxtPUFactura.Text.ToDouble - TxtImporteAjuste.Text.ToDouble) - (CargoActual - CargoAnterior), NumeroDecimales) Dr("Descuento") = Math.Round((TxtPrecio.Text.ToDouble - TxtImporteAjuste.Text.ToDouble) - (CargoActual - CargoAnterior), NumeroDecimales)
Dim TotalCalculableImpuestos As Decimal = (Dr("Cantidad").ToString.ToDecimal * (Dr("PU").ToString.ToDecimal)) - Dr("Descuento").ToString.ToDecimal Dim TotalCalculableImpuestos As Decimal = (Dr("Cantidad").ToString.ToDecimal * (Dr("PU").ToString.ToDecimal)) - Dr("Descuento").ToString.ToDecimal
Dr("ImporteIVA") = Math.Round(Dr("PorcentajeIVA").ToString.ToDecimal * TotalCalculableImpuestos, NumeroDecimales) Dr("ImporteIVA") = Math.Round(Dr("PorcentajeIVA").ToString.ToDecimal * TotalCalculableImpuestos, NumeroDecimales)
@@ -5281,8 +5320,8 @@ Partial Class PV
DivAjuste.Attributes.Add("class", "col-md-6") DivAjuste.Attributes.Add("class", "col-md-6")
DivDatosVenta.Attributes.Remove("class") DivDatosVenta.Attributes.Remove("class")
DivDatosVenta.Attributes.Add("class", "col-md-6") DivDatosVenta.Attributes.Add("class", "col-md-6")
TxtPrecio.Attributes.Add("onKeyUp", $"CambiaAjuste(this,{TxtPUFactura.ClientID});") TxtPrecio.Attributes.Add("onKeyUp", $"CambiaAjuste(this,{TxtPrecio.ClientID});")
TxtPUFactura.Text = TxtPrecio.Text TxtPrecio.Text = TxtPrecio.Text
Else Else
For Each Gvr As GridViewRow In GvRecepcionUsados.Rows For Each Gvr As GridViewRow In GvRecepcionUsados.Rows
If Gvr.RowType = DataControlRowType.DataRow Then If Gvr.RowType = DataControlRowType.DataRow Then
@@ -5363,7 +5402,7 @@ Partial Class PV
Row("CveVentaDetalle") = -1 Row("CveVentaDetalle") = -1
Row("PU") = Gvr.DataKey("Cargo").ToDouble Row("PU") = Gvr.DataKey("Cargo").ToDouble
Row("CveBCIUsado") = Gvr.FCDropDownList("DdlBCIUsado").SelectedValue.ToEntero Row("CveBCIUsado") = Gvr.FCDropDownList("DdlBCIUsado").SelectedValue.ToEntero
Row("CveModeloAuto") = Gvr.FCDropDownList("DdlModeloAuto").SelectedValue.ToEntero Row("CveModeloAuto") = DdlModeloAuto.SelectedValue.ToEntero
TmpDTRecepcionUsados.Rows.Add(Row) TmpDTRecepcionUsados.Rows.Add(Row)
End If End If
@@ -5376,13 +5415,13 @@ Partial Class PV
Next Next
StrCargos.Remove(StrCargos.Length - 1, 1) StrCargos.Remove(StrCargos.Length - 1, 1)
If TotalCantidad > TmpDT.FiltraParametros($"EsCargo = True AND CvePS IN ({StrCargos})").SUMD("Cantidad") Then 'If TotalCantidad > TmpDT.FiltraParametros($"EsCargo = True AND CvePS IN ({StrCargos})").SUMD("Cantidad") Then
Dim drt As DataRow() = TmpDT.Select("CvePS = " & CvePS) ' Dim drt As DataRow() = TmpDT.Select("CvePS = " & CvePS)
TmpDT.Rows.Remove(drt(0)) ' TmpDT.Rows.Remove(drt(0))
Alert("No puede tener una cantidad mayor a la de los cargos", TipoMensaje.MsgAdvertencia) ' Alert("No puede tener una cantidad mayor a la de los cargos", TipoMensaje.MsgAdvertencia)
Exit Sub ' Exit Sub
End If 'End If
For Each Dr As DataRow In TmpDT.FiltraParametros($"EsCargo = True AND CvePS IN ({StrCargos})").Rows For Each Dr As DataRow In TmpDT.FiltraParametros($"EsCargo = True AND CvePS IN ({StrCargos})").Rows
@@ -5628,6 +5667,46 @@ Partial Class PV
End Sub End Sub
#End Region #End Region
Protected Sub BtnPDFHistorial_Click(sender As Object, e As EventArgs)
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
Dim DtDatos As New DataTable
Dim params As New List(Of ReportParameter)
'Informacion Distribuidor
params.Add(New ReportParameter("NombreCliente", LtlCliente.Text))
params.Add(New ReportParameter("CiudadEstado", LblCiudad.Text.Trim + ", " + LblEstado.Text))
params.Add(New ReportParameter("TelCliente", LblTelefono.Text))
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("Consec", TxtConsecutivoAjuste.Text.Trim))
params.Add(New ReportParameter("FolioAcuse", If(DdlFolioGarantia.SelectedValue.ToEntero = -1, "", DdlFolioGarantia.SelectedItem.Text)))
'Informacion de Garantia o ajuste
params.Add(New ReportParameter("FechaInst", TxtFechaAjuste.Text.Trim))
params.Add(New ReportParameter("Fecha", Now.ToShortDateString))
params.Add(New ReportParameter("Defecto", If(DdlTipoDefecto.SelectedValue.ToEntero = -1, "", DdlTipoDefecto.SelectedItem.Text)))
params.Add(New ReportParameter("MesesUso", TxtMesesUso.Text.Trim))
params.Add(New ReportParameter("PorcentajeAjuste", TxtPorcentajeAjuste.Text.Trim))
'Informacion Acumulador
params.Add(New ReportParameter("CodEnsamble", If(TxtCodEnsamble.Text.Length > 7, TxtCodEnsamble.Text.Trim.Substring(0, 7), "")))
params.Add(New ReportParameter("CodLinea", TxtCodLinea.Text.Trim))
params.Add(New ReportParameter("CodInspeccion", TxtCodInspeccion.Text.Trim))
'Informacion Vehiculo
params.Add(New ReportParameter("MarcaAuto", If(DdlPS.SelectedValue.ToEntero > 0, DtModelosAuto.FiltroPrimeroValor("Marca", $"CveModeloAuto ={DdlModeloAuto.SelectedValue}"), "")))
params.Add(New ReportParameter("TipoAuto", If(DdlPS.SelectedValue.ToEntero > 0, DtModelosAuto.FiltroPrimeroValor("Modelo", $"CveModeloAuto ={DdlModeloAuto.SelectedValue}"), "")))
'Informacion Consumidor
params.Add(New ReportParameter("Direccion", LblDireccion.Text))
If Imagen.Exists Then
params.Add(New ReportParameter("LogoPath", logouri))
Else
params.Add(New ReportParameter("LogoPath", ""))
End If
ImprimirPDF("Empresas/Grales/Formatos/Ajuste.rdlc", DtDatos, params, "Reporte de Ajuste", "PDF")
End Sub
End Class End Class

View File

@@ -122,57 +122,62 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
sb.AppendFormat("Es Cancelable: {0} <br/>", string.IsNullOrEmpty(resp.EsCancelable) ? "Desconocido" : resp.EsCancelable); sb.AppendFormat("Es Cancelable: {0} <br/>", string.IsNullOrEmpty(resp.EsCancelable) ? "Desconocido" : resp.EsCancelable);
sb.AppendFormat("Estatus de Cancelación: {0} <br/><br/>", string.IsNullOrEmpty(resp.EsCancelable) ? "Desconocido" : resp.EstatusCancelacion); sb.AppendFormat("Estatus de Cancelación: {0} <br/><br/>", string.IsNullOrEmpty(resp.EsCancelable) ? "Desconocido" : resp.EstatusCancelacion);
//var FueCancelado = CancelarDocumento(CveVenta, CveEstatus, CveCliente, Folio, uuid, CancelacionAcuse, CancelacionFecha, TipoDocto, total.ToDouble(), UsuarioActual.Empresa.CvePAC).Mensaje; if (!UsuarioActual.Empresa.FacturaProduccion && (string.IsNullOrEmpty(uuid) || uuid.Contains("test")))
{
var FueCancelado = CancelarDocumento(CveVenta, CveEstatus, CveCliente, Folio, uuid, CancelacionAcuse, CancelacionFecha, TipoDocto, total.ToDouble(), UsuarioActual.Empresa.CvePAC).Mensaje;
//sb.AppendFormat("{0} <br/>", FueCancelado); sb.AppendFormat("{0} <br/>", FueCancelado);
//if (CveEstatus.Contiene(4, 5) && EsRefacturacion) if (CveEstatus.Contiene(4, 5) && EsRefacturacion)
//{ {
// Response.Redirect(string.Format("Ventas.aspx?CveDevolucion={0}&NuevaFactura=1", CveVenta)); Response.Redirect(string.Format("Ventas.aspx?CveDevolucion={0}&NuevaFactura=1", CveVenta));
//} }
}
if ((resp.EsCancelable.ToUpper() == "NO CANCELABLE")) else
{ {
sb.Append("Esta factura no es cancelable."); if ((resp.EsCancelable.ToUpper() == "NO CANCELABLE"))
return sb.ToString(); {
} sb.Append("Esta factura no es cancelable.");
return sb.ToString();
if (resp.Estado.ToUpper().Trim() == "CANCELADO" || resp.EstatusCancelacion.ToUpper() == "PLAZO VENCIDO") }
{
CveEstatus = 5;
var solicitud = new WSGF.Service1SoapClient();
var acuse = solicitud.GetAcuse(emisor, "rene.molina@adsistemas.mx", "rene2018", uuid);
if (acuse.Estado == 0)
{
var xmlAcuse = new System.Xml.XmlDocument();
xmlAcuse.LoadXml(DecodeBase64(acuse.CfdiB64));
CancelacionAcuse = xmlAcuse.GetElementsByTagName("SignatureValue")[0].InnerText;
CancelacionFecha = xmlAcuse.SelectSingleNode("Acuse").Attributes["Fecha"].Value.ToDate();
}
var FueCancelado = CancelarDocumento(CveVenta, CveEstatus, CveCliente, Folio, uuid, CancelacionAcuse, CancelacionFecha, TipoDocto, total.ToDouble(), UsuarioActual.Empresa.CvePAC, EsRefacturacion: EsRefacturacion).Mensaje;
sb.AppendFormat("{0} <br/>", FueCancelado); if (resp.Estado.ToUpper().Trim() == "CANCELADO" || resp.EstatusCancelacion.ToUpper() == "PLAZO VENCIDO")
if (CveEstatus.Contiene(4, 5) && EsRefacturacion) {
{ CveEstatus = 5;
Response.Redirect(string.Format("Ventas.aspx?CveDevolucion={0}&NuevaFactura=1", CveVenta)); var solicitud = new WSGF.Service1SoapClient();
} var acuse = solicitud.GetAcuse(emisor, "rene.molina@adsistemas.mx", "rene2018", uuid);
}
else if (resp.EstatusCancelacion.ToUpper() == "SOLICITUD RECHAZADA") if (acuse.Estado == 0)
{ {
//ASIGNAMOS ESTATUS EMITIDA var xmlAcuse = new System.Xml.XmlDocument();
CveEstatus = 3; xmlAcuse.LoadXml(DecodeBase64(acuse.CfdiB64));
var ObjVentas = new ClsVentas();
if (ObjVentas.UpdateEstatusVenta(CveVenta, CveEstatus, UsuarioActual.CveEmpresa)) CancelacionAcuse = xmlAcuse.GetElementsByTagName("SignatureValue")[0].InnerText;
{ CancelacionFecha = xmlAcuse.SelectSingleNode("Acuse").Attributes["Fecha"].Value.ToDate();
sb.Append("El estatus de la factura fue cambiado a 'Emitida'."); }
}
else var FueCancelado = CancelarDocumento(CveVenta, CveEstatus, CveCliente, Folio, uuid, CancelacionAcuse, CancelacionFecha, TipoDocto, total.ToDouble(), UsuarioActual.Empresa.CvePAC, EsRefacturacion: EsRefacturacion).Mensaje;
{
sb.Append("Ocurrió un error al cambiar el estatus de la factura."); sb.AppendFormat("{0} <br/>", FueCancelado);
} if (CveEstatus.Contiene(4, 5) && EsRefacturacion)
ObjVentas.Dispose(); {
Response.Redirect(string.Format("Ventas.aspx?CveDevolucion={0}&NuevaFactura=1", CveVenta));
}
}
else if (resp.EstatusCancelacion.ToUpper() == "SOLICITUD RECHAZADA")
{
//ASIGNAMOS ESTATUS EMITIDA
CveEstatus = 3;
var ObjVentas = new ClsVentas();
if (ObjVentas.UpdateEstatusVenta(CveVenta, CveEstatus, UsuarioActual.CveEmpresa))
{
sb.Append("El estatus de la factura fue cambiado a 'Emitida'.");
}
else
{
sb.Append("Ocurrió un error al cambiar el estatus de la factura.");
}
ObjVentas.Dispose();
}
} }
} }
else else

View File

@@ -3417,7 +3417,7 @@
</div> </div>
<div class="col-md-8"> <div class="col-md-8">
<asp:DropDownList ID="DdlTipoRelacion" runat="server" Width="250px" CssClass="select2me"> <asp:DropDownList ID="DdlTipoRelacionAnticipo" runat="server" Width="250px" CssClass="select2me">
<asp:ListItem Text="-" Value="-1"></asp:ListItem> <asp:ListItem Text="-" Value="-1"></asp:ListItem>
<asp:ListItem Text="07 - CFDI por aplicación de anticipo" Value="7"></asp:ListItem> <asp:ListItem Text="07 - CFDI por aplicación de anticipo" Value="7"></asp:ListItem>
</asp:DropDownList> </asp:DropDownList>

View File

@@ -1335,6 +1335,17 @@ Partial Class Ventas
ViewState("CveOC") = value ViewState("CveOC") = value
End Set End Set
End Property End Property
Private Property RegistroxOC As Boolean
Get
Return CBool(IfNull(ViewState("RegistroxOC"), False))
End Get
Set(value As Boolean)
ViewState("RegistroxOC") = value
End Set
End Property
Private Property EnviarCorreoCliente As Boolean Private Property EnviarCorreoCliente As Boolean
Get Get
Return CBool(ViewState("EnviarCorreoCliente").ToString) Return CBool(ViewState("EnviarCorreoCliente").ToString)
@@ -3784,7 +3795,7 @@ Partial Class Ventas
'DdlAmortizacionConceptos.SelectedValue = DbRowVenta("AnticipoPosicion").ToString 'DdlAmortizacionConceptos.SelectedValue = DbRowVenta("AnticipoPosicion").ToString
'ChkAnticipoEnSubTotal.Checked = DbRowVenta("AnticipoEnSubTotal").ToString = "True" 'ChkAnticipoEnSubTotal.Checked = DbRowVenta("AnticipoEnSubTotal").ToString = "True"
DdlTipoAmortizacionAnticipo.SelectedValueExist(DbRowVenta("CveTipoAmortizacionAnticipo")) DdlTipoAmortizacionAnticipo.SelectedValueExist(DbRowVenta("CveTipoAmortizacionAnticipo"))
DdlTipoRelacion.SelectedValueExist(DbRowVenta("CveTipoRelacion")) DdlTiposRelacion.SelectedValueExist(DbRowVenta("CveTipoRelacion"))
'HdnAmortizacion.Value = LblAmort.Text.ToDouble.ToString 'HdnAmortizacion.Value = LblAmort.Text.ToDouble.ToString
'HdnSubTotalDescuestos.Value = (TxtSubTotal.Text.Replace(",", "").ToDouble - LblDescuentos.Text.Replace(",", "").ToDouble - LblAmortizacion.Text.Trim.Replace(",", "").ToDouble - TxtRetISR.Text.Replace(",", "").ToDouble).FormatoNumero(2) 'HdnSubTotalDescuestos.Value = (TxtSubTotal.Text.Replace(",", "").ToDouble - LblDescuentos.Text.Replace(",", "").ToDouble - LblAmortizacion.Text.Trim.Replace(",", "").ToDouble - TxtRetISR.Text.Replace(",", "").ToDouble).FormatoNumero(2)
@@ -5612,7 +5623,7 @@ Partial Class Ventas
End Sub End Sub
Protected Sub GvPS_RowUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvPS.RowUpdating Protected Sub GvPS_RowUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvPS.RowUpdating
'Dim TipoDescuento As Integer 'Dim TipoDescuento As Integer
Dim Cantidad, PU, Descuento As Decimal Dim Cantidad, PU, Descuento, CantidadInventario As Decimal
Dim CuentaPredial As String Dim CuentaPredial As String
Cantidad = GvPS.Rows(e.RowIndex).FCTextBox("TxtCantidad").Text.ToDecimal Cantidad = GvPS.Rows(e.RowIndex).FCTextBox("TxtCantidad").Text.ToDecimal
@@ -5620,6 +5631,7 @@ Partial Class Ventas
Descuento = Math.Round(GvPS.Rows(e.RowIndex).FCTextBox("TxtDescuento").Text.ToDecimal, NumeroDecimales) Descuento = Math.Round(GvPS.Rows(e.RowIndex).FCTextBox("TxtDescuento").Text.ToDecimal, NumeroDecimales)
CuentaPredial = GvPS.Rows(e.RowIndex).FCTextBox("TxtPredial").Text.Trim CuentaPredial = GvPS.Rows(e.RowIndex).FCTextBox("TxtPredial").Text.Trim
Dim DatarowPS As DataRow = Nothing Dim DatarowPS As DataRow = Nothing
DatarowPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=TmpDT.Rows(e.RowIndex)("CvePS").ToString.ToEntero).FiltroPrimero("") ' Estado = -1 DatarowPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=TmpDT.Rows(e.RowIndex)("CvePS").ToString.ToEntero).FiltroPrimero("") ' Estado = -1
@@ -5632,6 +5644,136 @@ Partial Class Ventas
End If End If
End If End If
'si es remisión, ingreso, anticipo debe de considerar el preciominimo
If Not UsuarioActual.TienePermisoProceso(169) Then ' NO VALIDA EXISTENCIAS NI COSTO - PERMISO PARA NO VALIDAR
Dim CvePS As Integer = DatarowPS("CvePS").ToString.ToEntero
CantidadInventario = GvPS.Rows(e.RowIndex).DataKey("CantidadInventario").ToString.ToDecimal
Dim ValidaExistencia As Boolean = True
If CantidadInventario > 0 Then 'si ya hay algo surtido, que no valide existencia
ValidaExistencia = False
End If
'SOLO VALIDA EXISTENCIAS Y COSTO: SI USA INVENTARIOS, SOLO PRODUCTOS TIPO PRODUCTO, SOLO REMISIONES E INGRESOS
If UsuarioActual.Empresa.UsaInventarios AndAlso (DdlTipoComprobante.SelectedValue.Contiene("Rem", "Ing", "PA") Or (DdlTipoComprobante.SelectedValue.Contiene("Cot") And UsuarioActual.CveEmpresa.Contiene(119))) Then
Dim ObjInventarios As New ClsInventarios
Dim Existencia As Decimal
If ValidaExistencia Then
Existencia = ObjInventarios.GetExistenciasPS(CvePS, -1, UsuarioActual.CveEmpresa, -1, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=1, PendientePorSurtir:=1, RestringirAlmacenes:=1, ExcluyeApartados:=-1)
End If
Dim Costo As Decimal = ObjInventarios.GetCostoPS(CvePS, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero)
'si el costo es cero, puede ser que no halla movimientos del producto, en esa sucursal. y se volverá a sacar sin especificar sucursal
If Costo = 0 Then Costo = ObjInventarios.GetCostoPS(CvePS, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, -1)
ObjInventarios.Dispose()
Dim PrecioMinimo As Decimal = 0
'RMF. condicion temporal, para reubicación, precio mínimo
If UsuarioActual.CveEmpresa = 119 Then
'Dim CvePrecioLista As Integer = 38
Dim objPS As New ClsProductosServicios
If objPS.GetPSSucursalesALL(CvePS, UsuarioActual.CveEmpresa, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero) Then
PrecioMinimo = objPS.DtResultados.FiltroPrimeroValor("PrecioMinimo", "").ToDecimal
If PrecioMinimo > 0 Then
Costo = PrecioMinimo
End If
End If
objPS.Dispose()
End If
If ValidaExistencia AndAlso DdlTipoComprobante.SelectedValue <> "Cot" And ChkSinExistencia.Checked = False AndAlso Not RegistroxOC Then
'VALIDA EXISTENCIA
If UsuarioActual.CveEmpresa.Contiene({72, 80, 119}) Then
If Existencia - TmpDT.SUM("Cantidad", $"CvePS = {CvePS}") < TxtCantidad.Text.ToDouble Then
Alert("No cuenta con la cantidad suficiente en inventario. Cuenta con " + Existencia.FormatoNumero(2) + ".", TipoMensaje.MsgAdvertencia)
End If
End If
End If
'VALIDA COSTOS
If Not CveContrato > 0 Then
'BANDERAS PARA VALIDACIONES
Dim EsValido = False
Dim EsValidoMayor = False
Dim CostoMenor = 0.0D
Dim CostoMayor = 0.0D
'PRECIO MINIMO
If UsuarioActual.Empresa.Funcionalidad(129).ToEntero > 0 AndAlso UsuarioActual.CveUsuario <> 1560 Then
CostoMenor = Costo + ((UsuarioActual.Empresa.Funcionalidad(129).ToDecimal / 100) * Costo)
If PrecioMinimo > 0 Then CostoMenor = PrecioMinimo
'SI EL PRECIO ES MAYOR AL COSTO, SI PASA
If PU * If(DdlMoneda.SelectedValue.ToEntero = 1, 1, TxtTipoCambio.Text.ToDecimal) >= CostoMenor Then
EsValido = True
End If
Else
EsValido = True
End If
'PRECIO MAXIMO
If UsuarioActual.Empresa.Funcionalidad(133).ToEntero > 0 AndAlso UsuarioActual.CveUsuario <> 1560 Then
CostoMayor = Costo + ((UsuarioActual.Empresa.Funcionalidad(133).ToDecimal / 100) * Costo)
'SI EL PRECIO ES MAYOR AL COSTO MAXIMO, SI PASA
If PU * If(DdlMoneda.SelectedValue.ToEntero = 1, 1, TxtTipoCambio.Text.ToDecimal) <= CostoMayor Then
EsValidoMayor = True
End If
Else
EsValidoMayor = True
End If
''VALIDA PROMOCION: SI TIENE PROMOCION Y EL PRECIO ES MENOR AL PRECIO DE PROMOCION, NO PASA | SI YA CUMPLE NO VUELVE A VALIDAR
''SIRVE PARA VALIDAR PRECIOS DEBAJO DEL PRECIO MINIMO PERMITIDO
'If Not EsValido Then
' If DtPromociones.FiltraParametros($"CvePS = {CvePS}").Rows.Count > 0 Then
' If PU * If(DdlMoneda.SelectedValue.ToEntero = 1, 1, TxtTipoCambio.Text.ToDecimal) >= DtPromociones.FiltroPrimeroValor("PUPromocion", $"CvePS = {CvePS}").ToDecimal Then
' EsValido = True
' End If
' End If
'End If
'NO DEJA REGISTRAR MENOS AL PRECIO MINIMO
Dim MensajeCosto As New StringBuilder
Dim TienePermisoImportes As Boolean = UsuarioActual.TienePermisoProceso(201)
If Not EsValido Then
MensajeCosto.AppendFormat("El Producto <b>{0}</b>. No se puede vender a un precio menor de su Costo <br/>", DatarowPS("PS").ToString)
If TienePermisoImportes Then
MensajeCosto.AppendFormat("El costo del producto es: <b>${0}</b> <br/>", Costo)
MensajeCosto.AppendFormat("El rango menor aceptado es: {0}% <b>${1}</b> <br/>", UsuarioActual.Empresa.Funcionalidad(129).ToEntero, CostoMenor)
MensajeCosto.AppendFormat("El precio indicado es: <b>${0}</b> ({1}% de ganancia) <br/>", PU.FormatoNumero, (If(Costo > 0, ((PU - Costo) * 100) / Costo, 0)).FormatoNumero)
End If
Alert(String.Format(MensajeCosto.ToString), TipoMensaje.MsgAdvertencia)
e.Cancel = True
Exit Sub
End If
'NO DEJA REGISTRAR MAS AL PRECIO MAXIMO
If Not EsValidoMayor Then
MensajeCosto.AppendFormat("El Producto <b>{0}</b>. No se puede vender a un precio mayor de su rango aceptado<br/>", HdnPS.Value)
If TienePermisoImportes Then
MensajeCosto.AppendFormat("El costo del producto es: <b>${0}</b> <br/>", Costo)
MensajeCosto.AppendFormat("El rango mayor aceptado es: {0}% <b>${1}</b> <br/>", UsuarioActual.Empresa.Funcionalidad(133).ToEntero, CostoMayor)
MensajeCosto.AppendFormat("El precio indicado es: <b>${0}</b> ({1}% de ganancia) <br/>", PU.FormatoNumero, (If(Costo > 0, ((PU - Costo) * 100) / Costo, 0)).FormatoNumero)
End If
Alert(MensajeCosto.ToString, TipoMensaje.MsgAdvertencia)
e.Cancel = True
Exit Sub
End If
End If
End If
End If
If TmpDT.Rows(e.RowIndex)("CvePS").ToString <> GvPS.Rows(e.RowIndex).FCDropDownLost("DdlPS").SelectedValue Then If TmpDT.Rows(e.RowIndex)("CvePS").ToString <> GvPS.Rows(e.RowIndex).FCDropDownLost("DdlPS").SelectedValue Then
'eliminar y cargar el ps *** 'eliminar y cargar el ps ***
Dim DdlUM As DropDownList = GvPS.Rows(e.RowIndex).FCDropDownList("DdlUnidadMedida") Dim DdlUM As DropDownList = GvPS.Rows(e.RowIndex).FCDropDownList("DdlUnidadMedida")
@@ -6431,8 +6573,12 @@ Partial Class Ventas
actualindex = actualindex + 1 actualindex = actualindex + 1
Next Next
End If End If
Dim EsNCAmortizacion As Boolean = False
If DdlTipoComprobante.SelectedValue = "Egs" AndAlso ChkAplicaNCAnticipo.Checked Then
EsNCAmortizacion = True
End If
GuardarVenta(ObjVentas, ObjConta, ObjInventario, ObjContr, ObjFactura, TmpDT, ObjFactura.CveNCaVincular, ObjContPaq, ObjBancos, ObjOS, ObjEventos, ObjCGame, ObjClientes) GuardarVenta(ObjVentas, ObjConta, ObjInventario, ObjContr, ObjFactura, TmpDT, ObjFactura.CveNCaVincular, ObjContPaq, ObjBancos, ObjOS, ObjEventos, ObjCGame, ObjClientes, EsNCAmortizacion:=EsNCAmortizacion)
'SI ES REFACTURACION 'SI ES REFACTURACION
Dim ObjNC As List(Of Object) = Nothing Dim ObjNC As List(Of Object) = Nothing
@@ -6455,57 +6601,9 @@ Partial Class Ventas
End If End If
End If End If
''[IPP]
''DATATABLES A USAR
'Dim DtSites As New DataTable
'Dim DtExcel As New DataTable
''CARGAS EXCEL EN DATATABLE 'SI ES amortizacion 3.3
'DtExcel = TmpDT Dim Obj2 As New List(Of Object)
''CARGAS LOS SITES REGISTRADOS
'If ObjBancos.GetBancos() Then
' DtSites = ObjBancos.DtResultados
'End If
''PROCESAS EXCEL
'Dim CveSiteActual = -1
'For Each Row As DataRow In TmpDT.Rows
' 'VALIDA QUE EXISTA EL SITE
' If DtExcel.Select($"Site = {Row("SITE")}").Count = 0 Then 'SI NO EXISTE AGREGA EL SITE
' CveSiteActual = ObjBancos.AddComplementoPago(-1, -1, "", -1, -1, -1)
' 'VALIDAS QUE SE HALLA AGREGADO
' If CveSiteActual > 0 Then
' 'AGREGA NUEVO SITE AL DATATABLE TEMPORAL DE SITES
' Dim DrNuevoSite = DtExcel.NewRow
' DrNuevoSite("CVE") = CveSiteActual
' DrNuevoSite("SITE") = Row("SITE")
' Else
' Alert("ERROR AL AGREGAR EL SITE")
' Exit For
' End If
' ElseIf DtExcel.Select($"Site = {Row("SITE")}").Count = 1 Then 'SI EXISTE OBTIENES CVE
' CveSiteActual = DtExcel.Select($"Site = {Row("SITE")}")(0)("Cve").ToString.ToEntero
' Else
' Alert("ERROR SOLO DEBE DAR RESULTADO 0 ó 1")
' Exit For
' End If
' 'AGREGA A TABLA CON LA DE MAS INFORMACION
' If Not ObjBancos.AddBancos_EstatusIE(CveSiteActual, Row("CAMPOS").ToString, Row("CAMPOS_EXTRA").ToString.ToEntero) Then
' Alert("ERROR AL GUARDAR")
' Exit For
' End If
'Next
'SI ES amortizacion 3.3
Dim Obj2 As New List(Of Object)
If ErrorList.Count = 0 Then If ErrorList.Count = 0 Then
' cambiar la condicion para saber si hay seleccionado ' cambiar la condicion para saber si hay seleccionado
@@ -7016,7 +7114,7 @@ Partial Class Ventas
ObjFacturaDevolucion.UsoCFDI = DdlUsoCFDI.SelectedItem.Text ObjFacturaDevolucion.UsoCFDI = DdlUsoCFDI.SelectedItem.Text
ObjFacturaDevolucion.ClaveUsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", $"CveUsoCFDI = {DdlUsoCFDI.SelectedValue}") ObjFacturaDevolucion.ClaveUsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", $"CveUsoCFDI = {DdlUsoCFDI.SelectedValue}")
ObjFacturaDevolucion.CveTipoRelacion = DdlTipoRelacion.SelectedValue.ToEntero ObjFacturaDevolucion.CveTipoRelacion = DdlTipoRelacionAnticipo.SelectedValue.ToEntero
ObjFacturaDevolucion.TipoRelacion = "07" ObjFacturaDevolucion.TipoRelacion = "07"
Dim Fol As New List(Of String) Dim Fol As New List(Of String)
Fol.Add(FolioFiscalRelacionado) Fol.Add(FolioFiscalRelacionado)
@@ -7311,6 +7409,8 @@ Partial Class Ventas
If DtVentasNC IsNot Nothing AndAlso DtVentasNC.Rows.Count > 0 Then If DtVentasNC IsNot Nothing AndAlso DtVentasNC.Rows.Count > 0 Then
DtVentasNC.Rows(0)("Importe") = Total DtVentasNC.Rows(0)("Importe") = Total
DtVentasNC.Rows(0)("TC") = factura.TipoCambio
DtVentasNC.Rows(0)("TCCambioValuacion") = factura.TipoCambio
End If End If
ObjFacturaDevolucion.Timbre = PreParaTimbre(ObjFacturaDevolucion) ObjFacturaDevolucion.Timbre = PreParaTimbre(ObjFacturaDevolucion)
@@ -7846,7 +7946,7 @@ Partial Class Ventas
End If End If
'Amortizacion 'Amortizacion
ObjFactura.CveTipoRelacion = DdlTipoRelacion.SelectedValue.ToEntero ObjFactura.CveTipoRelacion = DdlTipoRelacionAnticipo.SelectedValue.ToEntero
If ObjFactura.CveTipoRelacion > 0 Then If ObjFactura.CveTipoRelacion > 0 Then
Select Case ObjFactura.CveTipoRelacion Select Case ObjFactura.CveTipoRelacion
Case 7 Case 7
@@ -7859,16 +7959,19 @@ Partial Class Ventas
ObjFactura.AplicaDevolucion = Me.AplicaDevolucion ObjFactura.AplicaDevolucion = Me.AplicaDevolucion
ObjFactura.CveTipoAmortizacionAnticipo = DdlTipoAmortizacionAnticipo.SelectedValue.ToEntero ObjFactura.CveTipoAmortizacionAnticipo = DdlTipoAmortizacionAnticipo.SelectedValue.ToEntero
ObjFactura.Timbre.Comprobante.TipoComprobante = If(ObjFactura.TipoDocto.Contiene("Ing", "Ant"), "I", If(ObjFactura.TipoDocto.Contiene("Egs", "Dev"), "E", ""))
If ObjFactura.Timbre.Comprobante.TipoComprobante = "E" Then If ObjFactura.Timbre.Comprobante.TipoComprobante = "E" Then
If ObjFactura.TipoDocumento.Contiene("Nota de Crédito") Then If ObjFactura.TipoDocto = "Egs" Then
ObjFactura.Timbre.CFDIRelacionados.TipoRelacion = "01" ObjFactura.Timbre.CFDIRelacionados.TipoRelacion = "01"
ObjFactura.Timbre.CFDIRelacionados.TipoRelacionTexto = "Nota de Crédito aplicada a Ingreso" ObjFactura.Timbre.CFDIRelacionados.TipoRelacionTexto = "Nota de Crédito aplicada a Ingreso"
End If End If
If ObjFactura.TipoDocumento.Contiene("Nota de Devolución") Then If ObjFactura.TipoDocto = "Dev" Then
ObjFactura.Timbre.CFDIRelacionados.TipoRelacion = "03" ObjFactura.Timbre.CFDIRelacionados.TipoRelacion = "03"
ObjFactura.Timbre.CFDIRelacionados.TipoRelacionTexto = "Devolución aplicada a Ingreso" ObjFactura.Timbre.CFDIRelacionados.TipoRelacionTexto = "Devolución aplicada a Ingreso"
End If End If
ObjFactura.CveTipoRelacion = DdlTiposRelacion.SelectedValue.ToEntero
ObjFactura.Timbre.CFDIRelacionados.UUID.Add(HdnFolioFiscalNC.Value) ObjFactura.Timbre.CFDIRelacionados.UUID.Add(HdnFolioFiscalNC.Value)
End If End If
' cuando es refacturacoin es cfdirelacionado, con relacion 04 ' cuando es refacturacoin es cfdirelacionado, con relacion 04
@@ -7879,18 +7982,12 @@ Partial Class Ventas
End If End If
If ObjFactura.TipoDocto = "Egs" Then
ObjFactura.CveTipoRelacion = DdlTiposRelacion.SelectedValue.ToEntero
End If
If ObjFactura.TipoDocto = "Dev" Then
ObjFactura.CveTipoRelacion = DdlTiposRelacion.SelectedValue.ToEntero
End If
If ObjFactura.TipoDocto.Contiene("Ing", "Ant") AndAlso NuevaFactura = 1 Then ' refacturación If ObjFactura.TipoDocto.Contiene("Ing", "Ant") AndAlso NuevaFactura = 1 Then ' refacturación
ObjFactura.CveTipoRelacion = DdlTiposRelacion.SelectedValue.ToEntero ObjFactura.CveTipoRelacion = DdlTiposRelacion.SelectedValue.ToEntero
End If End If
If ObjFactura.TipoDocto.Contiene("Ing", "Ant") AndAlso DdlTiposRelacion.SelectedValue.ToEntero > 0 Then ' refacturación If ObjFactura.TipoDocto.Contiene("Ing", "Ant") AndAlso DdlTipoRelacionAnticipo.SelectedValue.ToEntero > 0 Then ' refacturación
ObjFactura.CveTipoRelacion = DdlTiposRelacion.SelectedValue.ToEntero ObjFactura.CveTipoRelacion = DdlTipoRelacionAnticipo.SelectedValue.ToEntero
If GVAnticipos.Rows.Count > 0 Then If GVAnticipos.Rows.Count > 0 Then
For Each gvr As GridViewRow In GVAnticipos.Rows For Each gvr As GridViewRow In GVAnticipos.Rows
If gvr.FCCheckBox(String.Format("Chk{0}", gvr.RowIndex)).Checked AndAlso gvr.DataKey("CveConceptoContable") = "12" Then ' solo notas de crédito If gvr.FCCheckBox(String.Format("Chk{0}", gvr.RowIndex)).Checked AndAlso gvr.DataKey("CveConceptoContable") = "12" Then ' solo notas de crédito
@@ -8288,7 +8385,7 @@ Partial Class Ventas
Else Else
'SI LA FACTURA VIENE DE SER CANCELADA SISTEMA CUANDO SE REFACTURO NO HAY QUE RELACIONAR 'SI LA FACTURA VIENE DE SER CANCELADA SISTEMA CUANDO SE REFACTURO NO HAY QUE RELACIONAR
If (CveEstatusFacturaPadre > 0 AndAlso CveEstatusFacturaPadre <> 4) OrElse (DtVentasNC IsNot Nothing AndAlso DtVentasNC.Rows.Count > 0) Then If (CveEstatusFacturaPadre > 0 AndAlso CveEstatusFacturaPadre <> 4) OrElse (DtVentasNC IsNot Nothing AndAlso DtVentasNC.Rows.Count > 0) OrElse HdnFolioFiscalNC.Value.ToString <> "" Then
If Obj.CveTipoRelacion > 0 Then If Obj.CveTipoRelacion > 0 Then
Select Case Obj.CveTipoRelacion Select Case Obj.CveTipoRelacion
@@ -8655,6 +8752,7 @@ Partial Class Ventas
If GVOC.Rows.Count > 0 Or GvOCPS.Rows.Count > 0 Then If GVOC.Rows.Count > 0 Or GvOCPS.Rows.Count > 0 Then
'Checa las facturas selecionadas 'Checa las facturas selecionadas
VerificaOrdenesCompra(DTOrdenesCompra) VerificaOrdenesCompra(DTOrdenesCompra)
RegistroxOC = False
Dim dtSeleccionadas As DataTable = DTOrdenesCompra.FiltraParametros("Aplicado = True") Dim dtSeleccionadas As DataTable = DTOrdenesCompra.FiltraParametros("Aplicado = True")
If GvPS.Rows.Count > 0 Then If GvPS.Rows.Count > 0 Then
@@ -8697,7 +8795,7 @@ Partial Class Ventas
sb.Remove(sb.Length - 1, 1) sb.Remove(sb.Length - 1, 1)
If ObjClientes.GetVentasOCTotales(CveCliente, sb.ToString, If(ChkPSOC.Checked, 2, 1)) Then If ObjClientes.GetVentasOCTotales(CveCliente, sb.ToString, If(ChkPSOC.Checked, 2, 1)) Then
DTOrdenesCompraPS = ObjClientes.DtResultados DTOrdenesCompraPS = ObjClientes.DtResultados
RegistroxOC = True
Dim tCantidad As Decimal = 0 Dim tCantidad As Decimal = 0
For Each Dr As DataRow In DTOrdenesCompraPS.Select() For Each Dr As DataRow In DTOrdenesCompraPS.Select()
tCantidad = If(ChkPSOC.Checked, GvOCPS.Rows(IndiceGVDataKey(GvOCPS, "CveOrdenCompraDetalle", $"{Dr("CveOrdenCompraDetalle")}")).FCTextBox("TxtCantidadOC").Text, Dr("Cantidad")).ToString.ToDecimal tCantidad = If(ChkPSOC.Checked, GvOCPS.Rows(IndiceGVDataKey(GvOCPS, "CveOrdenCompraDetalle", $"{Dr("CveOrdenCompraDetalle")}")).FCTextBox("TxtCantidadOC").Text, Dr("Cantidad")).ToString.ToDecimal
@@ -9134,7 +9232,7 @@ Partial Class Ventas
If ErrorList.Count = 0 Then If ErrorList.Count = 0 Then
'prepoliza 'prepoliza
GuardarVentaPrePolizas(ObjConta, factura, TmpDTDetalle, CveNCaVincular, objContPaqi, ObjBancos, ObjVentas, ObjEventos:=ObjEventos) GuardarVentaPrePolizas(ObjConta, factura, TmpDTDetalle, CveNCaVincular, objContPaqi, ObjBancos, ObjVentas, ObjEventos:=ObjEventos, EsNCAmortizacion:=EsNCAmortizacion)
If ErrorList.Count = 0 Then If ErrorList.Count = 0 Then
'inventarios 'inventarios
If Not EsNCAmortizacion Then If Not EsNCAmortizacion Then
@@ -9182,7 +9280,7 @@ Partial Class Ventas
If DdlTipoComprobante.SelectedValue <> "Cot" Then If DdlTipoComprobante.SelectedValue <> "Cot" Then
If factura.CvePrePoliza > 0 Then If factura.CvePrePoliza > 0 Then
If ProcesoPrepolizas(ObjConta, factura, CveIE, TmpDTDetalleMovimientos, objContPaqi, 1, ObjBancos, ObjVentas, ObjEventos:=ObjEventos) Then If ProcesoPrepolizas(ObjConta, factura, CveIE, TmpDTDetalleMovimientos, objContPaqi, 1, ObjBancos, ObjVentas, ObjEventos:=ObjEventos, EsNCAmortizacion:=EsNCAmortizacion) Then
ErrorList.Add("Ocurrió un error al agregar los Movimientos de la prepoliza.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico") ErrorList.Add("Ocurrió un error al agregar los Movimientos de la prepoliza.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
End If End If
@@ -9440,9 +9538,8 @@ Partial Class Ventas
TipoCambioNC = GlobalTipoCambio(TxtFecha.Text.ToDate).ToDecimal TipoCambioNC = GlobalTipoCambio(TxtFecha.Text.ToDate).ToDecimal
End If End If
If Not EsNCAmortizacion Then 'APLICA NC SALDOS DIRECTOS
'APLICA NC SALDOS DIRECTOS If DtVentasNC IsNot Nothing AndAlso DtVentasNC.Rows.Count > 0 Then
If DtVentasNC IsNot Nothing AndAlso DtVentasNC.Rows.Count > 0 Then
For Each Dr As DataRow In DtVentasNC.Rows For Each Dr As DataRow In DtVentasNC.Rows
@@ -9580,8 +9677,6 @@ Partial Class Ventas
Exit For Exit For
End If End If
End If End If
End If
'APLICA DEVOLUCION SALDOS DIRECTOS 'APLICA DEVOLUCION SALDOS DIRECTOS
If AplicaDevolucion Then If AplicaDevolucion Then
@@ -9901,6 +9996,13 @@ Partial Class Ventas
CveVentaAmortizacionAplicar = ObjFactura.CveVenta CveVentaAmortizacionAplicar = ObjFactura.CveVenta
End If End If
''Cuando se está amortizando con un anticipo y es la modalidad de NC
'If ObjFactura.TipoDocto.Contiene("Ing") AndAlso CveAnticipo > 0 AndAlso DdlTipoAmortizacionAnticipo.SelectedValue = "2" Then
' ConceptoContableAplicar = 11
' CveVentaAplicar = CveAnticipo
' CveVentaAmortizacionAplicar = ObjFactura.CveVenta
'End If
' If UsuarioActual.CveEmpresa = 119 Then ' If UsuarioActual.CveEmpresa = 119 Then
'código fijo en base el porcentaje iva, que se afecten las clasificaciones 'código fijo en base el porcentaje iva, que se afecten las clasificaciones
@@ -9976,20 +10078,12 @@ Partial Class Ventas
importeMovimiento = 0 importeMovimiento = 0
Case 150 'Descuento sobre ventas Case 150 'Descuento sobre ventas
If ObjFactura.TipoDocto.Contiene("Egs", "Dev") Then If ObjFactura.TipoDocto.Contiene("Egs", "Dev") AndAlso Not EsNCAmortizacion Then
Dim ConceptoContableAplicar = 150 Dim ConceptoContableAplicar = 150
Dim CveVentaAplicar = ObjFactura.CveVenta Dim CveVentaAplicar = ObjFactura.CveVenta
Dim CveVentaAmortizacionAplicar = -1 Dim CveVentaAmortizacionAplicar = -1
'cuando es NC, por amortización de anticipo, no debe de registrar el concepto 11,
'pero cuando es NC y se aplicó anticipo, debe de restarle el importe
If ObjFactura.TipoDocto.Contiene("Egs") And CveAnticipo > 0 AndAlso ChkAplicaNCAnticipo.Checked = True Then
ConceptoContableAplicar = 11
CveVentaAplicar = CveAnticipo
CveVentaAmortizacionAplicar = ObjFactura.CveVenta
End If
If UsuarioActual.CveEmpresa = 119 Then If UsuarioActual.CveEmpresa = 119 Then
'código fijo en base el porcentaje iva, que se afecten las clasificaciones 'código fijo en base el porcentaje iva, que se afecten las clasificaciones
@@ -9998,16 +10092,6 @@ Partial Class Ventas
'se excluyen las clasificaciones anteriores para que se asignen las de ingreso 'se excluyen las clasificaciones anteriores para que se asignen las de ingreso
If Not TmpDTDetalle(i)("CveClasificacion").ToString.Contiene("19958", "19933", "18097") Then If Not TmpDTDetalle(i)("CveClasificacion").ToString.Contiene("19958", "19933", "18097") Then
'If TmpDTDetalle(i)("PorcentajeIVA").ToString.ToDecimal > 0 Then
' If TmpDTDetalle(i)("PorcentajeIVA").ToString.ToDecimal = 0.08 Then
' TmpDTDetalle(i)("CveClasificacion") = 20242 'clasif: ventas tasa 8%
' Else
' TmpDTDetalle(i)("CveClasificacion") = 19929 'clasif: ventas tasa 16%
' End If
'Else
' TmpDTDetalle(i)("CveClasificacion") = 19930 'clasif: ventas tasa 0%
'End If
If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDT.MAX("PorcentajeIVA").ToDouble).Rows.Count > 0 Then If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDT.MAX("PorcentajeIVA").ToDouble).Rows.Count > 0 Then
TmpDTDetalle(i)("CveClasificacion") = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDT.MAX("PorcentajeIVA").ToDouble).Rows(0)("CveClasificacion").ToString TmpDTDetalle(i)("CveClasificacion") = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDT.MAX("PorcentajeIVA").ToDouble).Rows(0)("CveClasificacion").ToString
End If End If
@@ -15507,7 +15591,7 @@ Partial Class Ventas
End If End If
Catch ex As Exception Catch ex As Exception
Alert("No se pudo verificar la fecha del certificado", TipoMensaje.MsgError) Alert("No se pudo verificar la fecha del certificado", TipoMensaje.ToastError)
End Try End Try
End Sub End Sub
#End Region #End Region
@@ -15754,6 +15838,10 @@ Partial Class Ventas
TxtOrdenCompra.Enabled = True TxtOrdenCompra.Enabled = True
TxtPedidoContrato.Enabled = True TxtPedidoContrato.Enabled = True
TxtObsAlmacen.Enabled = True TxtObsAlmacen.Enabled = True
DdlUsoCFDI.Enabled = True
DdlMetodoPago33.Enabled = True
DdlFormaPago33.Enabled = True
UPCondicionesPago.Update()
ModalidadEdicion = True ModalidadEdicion = True
@@ -20872,6 +20960,8 @@ Partial Class Ventas
Gv.DataKey("SATClaveProdServ").ToString, Gv.DataKey("SATClaveUM").ToString, -1, Gv.DataKey("CveVentaDetalle").ToString.ToEntero, -1, -1, -1, -1) Gv.DataKey("SATClaveProdServ").ToString, Gv.DataKey("SATClaveUM").ToString, -1, Gv.DataKey("CveVentaDetalle").ToString.ToEntero, -1, -1, -1, -1)
End If End If
Next Next
TrTipoRelacion.Visible = True
DdlTiposRelacion.SelectedValueExist("3")
LimpiaDocumentoDEV() LimpiaDocumentoDEV()
@@ -21326,10 +21416,10 @@ Partial Class Ventas
If DdlTipoAmortizacionAnticipo.SelectedValue = "2" Then DivConceptoNC.Visible = True Else DivConceptoNC.Visible = False If DdlTipoAmortizacionAnticipo.SelectedValue = "2" Then DivConceptoNC.Visible = True Else DivConceptoNC.Visible = False
DdlTipoRelacion.SelectedValueExist("7") DdlTipoRelacionAnticipo.SelectedValueExist("7")
Else Else
DivConceptoNC.Visible = False DivConceptoNC.Visible = False
DdlTipoRelacion.SelectedValueExist("-1") DdlTipoRelacionAnticipo.SelectedValueExist("-1")
End If End If
End Sub End Sub