This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2019-11-05 17:54:40 -07:00
36 changed files with 11375 additions and 8446 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

@@ -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

@@ -1082,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
@@ -1108,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
@@ -2270,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))
@@ -2860,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"))
@@ -2900,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)
@@ -2933,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()

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

@@ -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

@@ -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

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

@@ -2023,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
@@ -3664,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

View File

@@ -659,16 +659,8 @@
<asp:DropDownList ID="DdlUnidadMedidaM" CssClass="form-control input-sm select2me " runat="server" DataTextField="UnidadMedida" DataValueField="CveUnidadMedida" Width="80px" AutoPostBack="true"></asp:DropDownList> <asp:DropDownList ID="DdlUnidadMedidaM" CssClass="form-control input-sm select2me " runat="server" DataTextField="UnidadMedida" DataValueField="CveUnidadMedida" Width="80px" AutoPostBack="true"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVUnidadM" runat="server" ControlToValidate="DdlUnidadMedidaM" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Unidad de Medida''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarM"></asp:RequiredFieldValidator> <asp:RequiredFieldValidator ID="RFVUnidadM" runat="server" ControlToValidate="DdlUnidadMedidaM" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Unidad de Medida''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarM"></asp:RequiredFieldValidator>
</td> </td>
<td> <td style="vertical-align: top;">
<asp:DropDownList ID="DdlClasificacion" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Clasificacion" DataValueField="CveClasificacion" CssClass="form-control input-sm select2me" Style="width: 220px !important;"> <ADS:Dropdownlost runat="server" ID="DdlPS" DataTextField="PSCodigo" DataValueField="CvePS" Width="100%" CssClassDdl="select2me" CssStyle="width: 220px;"/>
<asp:ListItem Selected="True" Text="Seleccione la Clasificación (Todas)" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:DropDownList ID="DdlPS" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="PSCodigo" DataValueField="CvePS" ValidationGroup="GrpGuardarM" CssClass="form-control input-sm select2me" Style="width: 220px !important;">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
<asp:ListItem Text="*** Actualizar listado de Productos o Servicios ***" Value="-2"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVPsM" runat="server" ControlToValidate="DdlPS" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Producto o Servicio''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardarM"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender3" runat="server" HighlightCssClass="vco" TargetControlID="RFVPsM" Width="300px"></ajax:ValidatorCalloutExtender>
</td> </td>
<td style="text-align: center; vertical-align: top;"> <td style="text-align: center; vertical-align: top;">
<asp:LinkButton ID="LbAgregarMaterial" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardarM"></asp:LinkButton> <asp:LinkButton ID="LbAgregarMaterial" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardarM"></asp:LinkButton>

View File

@@ -286,8 +286,8 @@ Partial Class OS_OrdenesServicios
CargaTiposOrden() CargaTiposOrden()
CargaTecnico() CargaTecnico()
CargaPS(-1, DdlPSDetalle) CargaPS(-1, DdlPSDetalle)
CargaPsMateriales(-1, DdlPS) CargaPsMateriales()
CargaClasificaciones() 'CargaClasificaciones()
CargaPSCaracteristicasOpciones() CargaPSCaracteristicasOpciones()
CargaCuentasCaracteristicas() CargaCuentasCaracteristicas()
CargaAlmacen() CargaAlmacen()
@@ -499,8 +499,19 @@ Partial Class OS_OrdenesServicios
'End If 'End If
If TipoEstatus = 3 Then If TipoEstatus = 3 Then
DisableAll() 'DisableAll()
'If SeFacturara = "True" Then
' HplFacturar.Visible = True
' If ObjOS.CveCotizacion > 0 Then
' HplFacturar.NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveVenta={0}", ObjOS.CveCotizacion)
' Else
' HplFacturar.NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveOS={0}", CveOS)
' End If
'End If
ElseIf TipoEstatus = 4 Then
'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
@@ -509,9 +520,6 @@ Partial Class OS_OrdenesServicios
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
DisableAll()
End If End If
DivCliente.Attributes.Add("class", "col-md-8") DivCliente.Attributes.Add("class", "col-md-8")
@@ -707,12 +715,27 @@ Partial Class OS_OrdenesServicios
Objeto.Items.Insert(0, New ListItem("*** Actualizar listado de Productos o Servicios ***", "-2")) Objeto.Items.Insert(0, New ListItem("*** Actualizar listado de Productos o Servicios ***", "-2"))
Objeto.Items.Insert(0, New ListItem("Seleccione el Servicio", "-1")) Objeto.Items.Insert(0, New ListItem("Seleccione el Servicio", "-1"))
End Sub End Sub
Private Sub CargaPsMateriales(CveClasificacion As Integer, Objeto As DropDownList) Private Sub CargaPsMateriales()
Objeto.Items.Clear() 'Objeto.Items.Clear()
Objeto.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacion, Estatus:=1) 'Objeto.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacion, Estatus:=1)
Objeto.DataBind() 'Objeto.DataBind()
Objeto.Items.Insert(0, New ListItem("*** Actualizar listado de Productos o Servicios ***", "-2")) 'Objeto.Items.Insert(0, New ListItem("*** Actualizar listado de Productos o Servicios ***", "-2"))
Objeto.Items.Insert(0, New ListItem("Seleccione el Producto", "-1")) 'Objeto.Items.Insert(0, New ListItem("Seleccione el Producto", "-1"))
'Carga Productos
DdlPS.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1")
If UsuarioActual.Empresa.Funcionalidad(105) = "1" Then
'DdlPS.ddlWS.Attributes.Add("data-cveclasificacion", DdlClasificacion.SelectedValue)
DdlPS.SelectedText = ""
DdlPS.SelectedValue = "-1"
Else
DdlPS.ddl.Items.Clear()
'DdlPS.ddl.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CveClasificacion:=DdlClasificacion.SelectedValue.ToEntero)
DdlPS.ddl.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
DdlPS.ddl.DataBind()
DdlPS.ddl.Items.Insert(0, New ListItem("Seleccione el Producto", "-1"))
End If
End Sub End Sub
Private Sub CargaCliente(CveCliente As Integer, Optional Estatus As Integer = 1) Private Sub CargaCliente(CveCliente As Integer, Optional Estatus As Integer = 1)
Dim ObjCliente As New ClsClientes() Dim ObjCliente As New ClsClientes()
@@ -847,11 +870,11 @@ Partial Class OS_OrdenesServicios
GvPS.DataSource = TmpDT GvPS.DataSource = TmpDT
GvPS.DataBind() GvPS.DataBind()
End Sub End Sub
Private Sub CargaClasificaciones() 'Private Sub CargaClasificaciones()
DdlClasificacion.DataSource = GlobalDTClasificaciones.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) ' DdlClasificacion.DataSource = GlobalDTClasificaciones.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
DdlClasificacion.DataBind() ' DdlClasificacion.DataBind()
'' DdlClasificacion.Items.Insert(0, New ListItem("Seleccione la Clasificación", "-1")) ' '' DdlClasificacion.Items.Insert(0, New ListItem("Seleccione la Clasificación", "-1"))
End Sub 'End Sub
Private Sub CargaFolios(CveSub As Integer) Private Sub CargaFolios(CveSub As Integer)
Dim ObjFolios As New ClsGralFolios() Dim ObjFolios As New ClsGralFolios()
If ObjFolios.GetFolios() Then If ObjFolios.GetFolios() Then
@@ -2101,13 +2124,13 @@ Partial Class OS_OrdenesServicios
UpAddMateriales.Update() UpAddMateriales.Update()
RegistraScript(String.Format("$('#{0}').modal();", "DivGvMateriales")) RegistraScript(String.Format("$('#{0}').modal();", "DivGvMateriales"))
End Sub End Sub
Private Sub DdlClasificacion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlClasificacion.SelectedIndexChanged 'Private Sub DdlClasificacion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlClasificacion.SelectedIndexChanged
CargaPsMateriales(DdlClasificacion.SelectedValue.ToEntero, DdlPS) ' CargaPsMateriales()
UpAddMateriales.Update() ' UpAddMateriales.Update()
End Sub 'End Sub
Private Sub DdlPS_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPS.SelectedIndexChanged Private Sub DdlPS_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPS.selectedindexchange
If CveCliente > 0 OrElse DdlPS.SelectedValue = "-2" Then If CveCliente > 0 OrElse DdlPS.SelectedValue = "-2" Then
If DdlPS.SelectedIndex > 1 Then If DdlPS.SelectedValue.ToEntero > 1 Then
Dim drPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPS.SelectedValue.ToEntero).FiltroPrimero("") Dim drPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPS.SelectedValue.ToEntero).FiltroPrimero("")
If drPS IsNot Nothing Then If drPS IsNot Nothing Then
@@ -2116,25 +2139,31 @@ Partial Class OS_OrdenesServicios
DdlUnidadMedidaM.DataBind() DdlUnidadMedidaM.DataBind()
DdlUnidadMedidaM.SelectedValueExist(drPS("CveUnidadMedida").ToString) DdlUnidadMedidaM.SelectedValueExist(drPS("CveUnidadMedida").ToString)
If DdlClasificacion.SelectedIndex = 0 Then 'If DdlClasificacion.SelectedIndex = 0 Then
If drPS("CveClasificacion").ToString IsNot Nothing Then ' If drPS("CveClasificacion").ToString IsNot Nothing Then
DdlClasificacion.SelectedValueExist(drPS("CveClasificacion").ToString) ' DdlClasificacion.SelectedValueExist(drPS("CveClasificacion").ToString)
Else ' Else
Alert("El Productos/Servicio no tiene asignada una Clasificación.") ' Alert("El Productos/Servicio no tiene asignada una Clasificación.")
End If ' End If
End If 'End If
End If End If
End If End If
End If End If
End Sub End Sub
Private Sub LbAgregarMaterial_Click(sender As Object, e As EventArgs) Handles LbAgregarMaterial.Click Private Sub LbAgregarMaterial_Click(sender As Object, e As EventArgs) Handles LbAgregarMaterial.Click
Dim ObjPS As New ClsProductosServicios
Dim Clasificacion As String = ""
Dim CveClasificacion As Integer
If ObjPS.GetPS(DdlPS.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa) Then
Clasificacion = ObjPS.DtResultados.Rows(0)("Clasificacion").ToString
CveClasificacion = ObjPS.CveClasificacion
End If
Dim Consecutivo As Integer = TmpDTMaterialesDetalle.Rows.Count + 1 Dim Consecutivo As Integer = TmpDTMaterialesDetalle.Rows.Count + 1
AddMaterial(CveOsDetalle, DdlClasificacion.SelectedValue.ToEntero, TxtCantidadM.Text.ToEntero, DdlClasificacion.SelectedItem.Text, DdlPS.SelectedValue.ToEntero, DdlPS.SelectedItem.Text, DdlUnidadMedidaM.SelectedValue.ToEntero, DdlUnidadMedidaM.SelectedItem.Text, Consecutivo) AddMaterial(CveOsDetalle, CveClasificacion, TxtCantidadM.Text.ToEntero, Clasificacion,
DdlPS.SelectedValue.ToEntero, DdlPS.SelectedText, DdlUnidadMedidaM.SelectedValue.ToEntero, DdlUnidadMedidaM.SelectedItem.Text, Consecutivo)
TxtCantidadM.Text = "" TxtCantidadM.Text = ""
DdlClasificacion.SelectedIndex = 0 CargaPsMateriales()
CargaClasificaciones()
CargaPsMateriales(-1, DdlPS)
End Sub End Sub
Private Sub AddMaterial(CveOSDetalle As Integer, CveClasificacion As Integer, Cantidad As Integer, Clasificacion As String, CvePS As Integer, PS As String, CveUM As Integer, UM As String, Consecutivo As Integer) Private Sub AddMaterial(CveOSDetalle As Integer, CveClasificacion As Integer, Cantidad As Integer, Clasificacion As String, CvePS As Integer, PS As String, CveUM As Integer, UM As String, Consecutivo As Integer)
@@ -2188,6 +2217,8 @@ Partial Class OS_OrdenesServicios
End Sub End Sub
Private Sub BtnGuardarMateriales_Click(sender As Object, e As EventArgs) Handles BtnGuardarMateriales.Click Private Sub BtnGuardarMateriales_Click(sender As Object, e As EventArgs) Handles BtnGuardarMateriales.Click
'VALIDA ALMACEN ORIGEN Y DESTINO 'VALIDA ALMACEN ORIGEN Y DESTINO
Dim ErrorEncontrado As New StringBuilder
If DdlAlmacenOrigen.SelectedValue = DdlAlmacenDestino.SelectedValue Then If DdlAlmacenOrigen.SelectedValue = DdlAlmacenDestino.SelectedValue Then
Alert("No se puede realizar un traspaso entre el mismo almacén.", TipoMensaje.MsgAdvertencia) Alert("No se puede realizar un traspaso entre el mismo almacén.", TipoMensaje.MsgAdvertencia)
Exit Sub Exit Sub
@@ -2235,16 +2266,25 @@ Partial Class OS_OrdenesServicios
End If End If
If Not TieneError Then If Not TieneError Then
Dim ObjOS As New ClsOS
For Each Row As DataRow In TmpDTMaterialesDetalle.Rows For Each Row As DataRow In TmpDTMaterialesDetalle.Rows
Dim CveUM As Integer = Row("CveUM").ToString.ToEntero Dim CveUM As Integer = Row("CveUM").ToString.ToEntero
Dim CvePS As Integer = Row("CvePS").ToString.ToEntero Dim CvePS As Integer = Row("CvePS").ToString.ToEntero
Dim Cantidad As Integer = Row("Cantidad").ToString.ToEntero Dim Cantidad As Integer = Row("Cantidad").ToString.ToEntero
Dim CveClasificacion As Integer = Row("CveClasificacion").ToString.ToEntero
If Not ObjOS.AddUpdateDetalleMateriales(-1, CveOsDetalle, Cantidad, CveUM, CveClasificacion, CvePS, True) Then
TieneError = True
ErrorEncontrado.AppendFormat("Ocurrió un Error al agregar los materiales.<br/>")
Exit For
End If
If Not ObjInventario.AddTrasladoSolicitudDetalle(CveTraspasoSolicitud, Cantidad, CveUM, CvePS, 0, "", -1) Then If Not ObjInventario.AddTrasladoSolicitudDetalle(CveTraspasoSolicitud, Cantidad, CveUM, CvePS, 0, "", -1) Then
ErrorEncontrado.AppendFormat("Ocurrió un Error al guardar el traspaso.")
TieneError = True TieneError = True
Exit For Exit For
End If End If
Next Next
ObjOS.Dispose()
End If End If
@@ -2259,7 +2299,7 @@ Partial Class OS_OrdenesServicios
Alert($"El Traspaso se guardó correctamente con el folio #: <b>{Folio}</b>.", TipoMensaje.MsgInformacion, $"document.location.href=""/Inventarios/TrasladoSolicitud.aspx?CveTraspasoSolicitud={CveTraspasoSolicitud}""") Alert($"El Traspaso se guardó correctamente con el folio #: <b>{Folio}</b>.", TipoMensaje.MsgInformacion, $"document.location.href=""/Inventarios/TrasladoSolicitud.aspx?CveTraspasoSolicitud={CveTraspasoSolicitud}""")
Else Else
ObjInventario.RollBack() ObjInventario.RollBack()
Alert("Ocurrió un Error al guardar el traspaso.", TipoMensaje.MsgError) Alert(ErrorEncontrado.ToString, TipoMensaje.MsgError)
End If End If
ObjInventario.Dispose() ObjInventario.Dispose()
@@ -2430,7 +2470,6 @@ Partial Class OS_OrdenesServicios
TmpDTSolicitarMaterial.Columns.Add("UM", GetType(String)) TmpDTSolicitarMaterial.Columns.Add("UM", GetType(String))
End Sub End Sub
Public Sub CargaAlmacen() Public Sub CargaAlmacen()
Dim tablaAuxiliar As DataTable = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1)
DdlAlmacenOrigen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen IN (1)") 'GlobalDTAlmacen(UsuarioActual.CveEmpresa) DdlAlmacenOrigen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen IN (1)") 'GlobalDTAlmacen(UsuarioActual.CveEmpresa)
DdlAlmacenOrigen.DataBind() DdlAlmacenOrigen.DataBind()
DdlAlmacenOrigen.Items.Insert(0, New ListItem("Seleccione", "-1")) DdlAlmacenOrigen.Items.Insert(0, New ListItem("Seleccione", "-1"))

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;
@@ -3236,8 +3273,8 @@
var totalVenta = ToDouble($get('TxtTotal').value); var totalVenta = ToDouble($get('TxtTotal').value);
if (totalEfectivo > totalVenta) { if (total > totalVenta) {
$get("TxtCambio").value = FormatoNumero(totalEfectivo - totalVenta); $get("TxtCambio").value = FormatoNumero(total - totalVenta);
} else { } else {
$get("TxtCambio").value = "0.00"; $get("TxtCambio").value = "0.00";
} }

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

@@ -207,7 +207,7 @@
<ContentTemplate> <ContentTemplate>
<asp:RadioButtonList runat="server" ID="RblTipoCambio" AutoPostBack="true"> <asp:RadioButtonList runat="server" ID="RblTipoCambio" AutoPostBack="true">
<asp:ListItem Selected="true" Text="Moneda Original" Value="1"></asp:ListItem> <asp:ListItem Selected="true" Text="Moneda Original" Value="1"></asp:ListItem>
<asp:ListItem Text="Dólares en Tipo Cambio de la Fecha Compra" Value="2"></asp:ListItem> <asp:ListItem Text="Dólares en Tipo Cambio de Pago" Value="2"></asp:ListItem>
<asp:ListItem Text="Tipo Cambio Especifico" Value="3"></asp:ListItem> <asp:ListItem Text="Tipo Cambio Especifico" Value="3"></asp:ListItem>
</asp:RadioButtonList> </asp:RadioButtonList>
<div class="row" style="margin-left: 10px;" runat="server" id="LiEspecifico" visible="false"> <div class="row" style="margin-left: 10px;" runat="server" id="LiEspecifico" visible="false">

View File

@@ -219,7 +219,7 @@
<ContentTemplate> <ContentTemplate>
<asp:RadioButtonList runat="server" ID="RblTipoCambio" OnSelectedIndexChanged="RblTipoCambio_SelectedIndexChanged" AutoPostBack="true"> <asp:RadioButtonList runat="server" ID="RblTipoCambio" OnSelectedIndexChanged="RblTipoCambio_SelectedIndexChanged" AutoPostBack="true">
<asp:ListItem Selected="true" Text="Moneda Original" Value="1"></asp:ListItem> <asp:ListItem Selected="true" Text="Moneda Original" Value="1"></asp:ListItem>
<asp:ListItem Text="Dólares en Tipo Cambio de la Fecha Compra" Value="2"></asp:ListItem> <asp:ListItem Text="Dólares en Tipo Cambio de Pago" Value="2"></asp:ListItem>
<asp:ListItem Text="Tipo Cambio Especifico" Value="3"></asp:ListItem> <asp:ListItem Text="Tipo Cambio Especifico" Value="3"></asp:ListItem>
</asp:RadioButtonList> </asp:RadioButtonList>
<div class="row" style="margin-left: 10px;" runat="server" id="LiEspecifico" visible="false"> <div class="row" style="margin-left: 10px;" runat="server" id="LiEspecifico" visible="false">

View File

@@ -2952,26 +2952,24 @@
<asp:TextBox ID="TxtImporteCredito" CssClass="form-control input-sm " runat="server" MaxLength="12" Width="100px" ClientIDMode="Static" Style="text-align: right;"></asp:TextBox> <asp:TextBox ID="TxtImporteCredito" CssClass="form-control input-sm " runat="server" MaxLength="12" Width="100px" ClientIDMode="Static" Style="text-align: right;"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtender1" runat="server" TargetControlID="TxtImporteCredito" FilterType="Custom, Numbers" ValidChars=".," /> <ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtender1" runat="server" TargetControlID="TxtImporteCredito" FilterType="Custom, Numbers" ValidChars=".," />
</div> </div>
<div class="col-md-6" runat="server" id="DivDdlCuentaTarjetaCredito" style="margin-right:-40px" > <div class="col-md-6" runat="server" id="DivDdlCuentaTarjetaCredito" style="margin-right: -40px">
<asp:DropDownList ID="DdlCuentaTarjetaCredito" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="100%"></asp:DropDownList> <asp:DropDownList ID="DdlCuentaTarjetaCredito" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="100%"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="DdlCuentaTarjetaCredito" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cuenta''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpAgregarPago"></asp:RequiredFieldValidator> <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="DdlCuentaTarjetaCredito" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cuenta''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpAgregarPago"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender5" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator1" Width="300px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender5" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator1" Width="300px"></ajax:ValidatorCalloutExtender>
</div> </div>
<div class="col-md-3" runat="server" id="DivMesesSinIntereses" visible="false" style="text-align:right;"> <div class="col-md-3" runat="server" id="DivMesesSinIntereses" visible="false" style="text-align: right;">
<asp:DropDownList ID="DDlMesesSinIntereses" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="80%"> <asp:DropDownList ID="DDlMesesSinIntereses" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="80%">
<asp:ListItem Value="-1">MSI</asp:ListItem> <asp:ListItem Value="-1">MSI</asp:ListItem>
<asp:ListItem Value="3">3M</asp:ListItem> <asp:ListItem Value="3">3M</asp:ListItem>
<asp:ListItem Value="6">6M</asp:ListItem> <asp:ListItem Value="6">6M</asp:ListItem>
<asp:ListItem Value="9">9M</asp:ListItem> <asp:ListItem Value="9">9M</asp:ListItem>
<asp:ListItem Value="12">12M</asp:ListItem> <asp:ListItem Value="12">12M</asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
<%--<asp:RequiredFieldValidator ID="RFVDDlMesesSinIntereses" runat="server" ControlToValidate="DDlMesesSinIntereses" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />campo <b>''Meses sin intereses''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpAgregarPago"></asp:RequiredFieldValidator> <%--<asp:RequiredFieldValidator ID="RFVDDlMesesSinIntereses" runat="server" ControlToValidate="DDlMesesSinIntereses" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />campo <b>''Meses sin intereses''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpAgregarPago"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="CEDDlMesesSinIntereses" runat="server" HighlightCssClass="vco" TargetControlID="RFVDDlMesesSinIntereses" Width="300px"></ajax:ValidatorCalloutExtender>--%> <ajax:ValidatorCalloutExtender ID="CEDDlMesesSinIntereses" runat="server" HighlightCssClass="vco" TargetControlID="RFVDDlMesesSinIntereses" Width="300px"></ajax:ValidatorCalloutExtender>--%>
</div> </div>
</div> </div>
</div> </div>
<div class="chequesie1"> <div class="chequesie1">
@@ -3004,8 +3002,8 @@
</div> </div>
</div> </div>
</div> </div>
<div class="chequesie1"> <div class="chequesie1">
<div class="row"> <div class="row">
<label class="col-md-2">Transf.:</label> <label class="col-md-2">Transf.:</label>
<div class="col-md-4 input-icon"> <div class="col-md-4 input-icon">
@@ -3022,11 +3020,11 @@
</div> </div>
<div class="chequesie1" runat="server" id ="DivContadoOtros" visible="false"> <div class="chequesie1" runat="server" id="DivContadoOtros" visible="false">
<div class="row"> <div class="row">
<div class="col-md-2"> <div class="col-md-2">
<asp:DropDownList runat="server" ID="DdlOtroFormaPago" ClientIDMode="Static" AutoPostBack="true" OnSelectedIndexChanged="DdlOtroFormaPago_SelectedIndexChanged"> <asp:DropDownList runat="server" ID="DdlOtroFormaPago" ClientIDMode="Static" AutoPostBack="true" OnSelectedIndexChanged="DdlOtroFormaPago_SelectedIndexChanged">
<asp:ListItem Value="-1">Otros</asp:ListItem> <asp:ListItem Value="-1">Otros</asp:ListItem>
<asp:ListItem Value="1">Credito</asp:ListItem> <asp:ListItem Value="1">Credito</asp:ListItem>
<asp:ListItem Value="2">Debito</asp:ListItem> <asp:ListItem Value="2">Debito</asp:ListItem>
@@ -3040,12 +3038,12 @@
<ajax:FilteredTextBoxExtender ID="FETxtImporteOtrosContado" runat="server" TargetControlID="TxtImporteOtrosContado" FilterType="Custom, Numbers" ValidChars=".," /> <ajax:FilteredTextBoxExtender ID="FETxtImporteOtrosContado" runat="server" TargetControlID="TxtImporteOtrosContado" FilterType="Custom, Numbers" ValidChars=".," />
</div> </div>
<div class="col-md-6" runat="server" id="DivContadoOtrosCuenta" > <div class="col-md-6" runat="server" id="DivContadoOtrosCuenta">
<asp:DropDownList ID="DdlCuentaOtrosContado" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="100%"></asp:DropDownList> <asp:DropDownList ID="DdlCuentaOtrosContado" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="100%"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RequiredFieldValidator12" runat="server" ControlToValidate="DdlCuentaTarjetaCredito" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cuenta''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpAgregarPago"></asp:RequiredFieldValidator> <asp:RequiredFieldValidator ID="RequiredFieldValidator12" runat="server" ControlToValidate="DdlCuentaTarjetaCredito" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cuenta''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpAgregarPago"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender24" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator1" Width="300px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender24" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator1" Width="300px"></ajax:ValidatorCalloutExtender>
</div> </div>
<div class="col-md-3" runat="server" id="DivMesesSinIntereses2" visible="false"> <div class="col-md-3" runat="server" id="DivMesesSinIntereses2" visible="false">
<asp:DropDownList ID="DdlMesesSinIntereses2" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="100%"> <asp:DropDownList ID="DdlMesesSinIntereses2" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="100%">
<asp:ListItem Value="-1">Meses</asp:ListItem> <asp:ListItem Value="-1">Meses</asp:ListItem>
@@ -3053,13 +3051,13 @@
<asp:ListItem Value="6">6M</asp:ListItem> <asp:ListItem Value="6">6M</asp:ListItem>
<asp:ListItem Value="9">9M</asp:ListItem> <asp:ListItem Value="9">9M</asp:ListItem>
<asp:ListItem Value="12">12M</asp:ListItem> <asp:ListItem Value="12">12M</asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
</div> </div>
</div> </div>
</div> </div>
<div class="chequesie2"> <div class="chequesie2">
<div class="row"> <div class="row">
@@ -3072,14 +3070,25 @@
<ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtender3" runat="server" TargetControlID="TxtImporteContado" FilterType="Custom, Numbers" ValidChars=".," /> <ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtender3" runat="server" TargetControlID="TxtImporteContado" FilterType="Custom, Numbers" ValidChars=".," />
<asp:CompareValidator ID="CVImporteContado" runat="server" ControlToValidate="TxtImporteContado" Display="None" ErrorMessage="Importe excedido." Operator="LessThanEqual" Type="Double" ValidationGroup="GrpAgregarPago"></asp:CompareValidator> <%-- <asp:CompareValidator ID="CVImporteContado" runat="server" ControlToValidate="TxtImporteContado" Display="None" ErrorMessage="Importe excedido." Operator="LessThanEqual" Type="Double" ValidationGroup="GrpAgregarPago"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender6" runat="server" HighlightCssClass="vco" TargetControlID="CVImporteContado" Width="300px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender6" runat="server" HighlightCssClass="vco" TargetControlID="CVImporteContado" Width="300px"></ajax:ValidatorCalloutExtender>--%>
<br></br>
</div>
</div>
<div class="row">
<div class="col-md-6">
</div>
<label class="col-md-2">Cambio:</label>
<div class="col-md-4 input-icon">
<i style="margin: 0px;">$</i>
<asp:TextBox ID="TxtCambio" CssClass="form-control input-sm " Enabled="false" runat="server" MaxLength="12" Width="100px" ClientIDMode="Static" Style="text-align: right;"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="FTBECambio" runat="server" TargetControlID="TxtCambio" FilterType="Custom, Numbers" ValidChars=".," />
<br></br> <br></br>
</div> </div>
</div> </div>
</div> </div>
@@ -3417,7 +3426,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>
@@ -3434,7 +3443,7 @@
<asp:RequiredFieldValidator ID="RFVNCPSAnt" runat="server" InitialValue="-1" ControlToValidate="DdlNCPSAnt" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Concepto''</b> es necesario, por favor ingréselo." ValidationGroup="VGAnticiposClientes"></asp:RequiredFieldValidator> <asp:RequiredFieldValidator ID="RFVNCPSAnt" runat="server" InitialValue="-1" ControlToValidate="DdlNCPSAnt" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Concepto''</b> es necesario, por favor ingréselo." ValidationGroup="VGAnticiposClientes"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCERFVNCPSAnt" runat="server" HighlightCssClass="vco" TargetControlID="RFVNCPSAnt" Width="350px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="VCERFVNCPSAnt" runat="server" HighlightCssClass="vco" TargetControlID="RFVNCPSAnt" Width="350px"></ajax:ValidatorCalloutExtender>
</div> </div>
</div> </div>
<div class="row" id="DivFechaAnticipoCliente" runat="server" visible="false"> <div class="row" id="DivFechaAnticipoCliente" runat="server" visible="false">
@@ -5763,7 +5772,7 @@
<asp:RequiredFieldValidator ID="RFVNCPS" runat="server" InitialValue="-1" ControlToValidate="DdlNCPS" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Concepto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpModalAplicarNC"></asp:RequiredFieldValidator> <asp:RequiredFieldValidator ID="RFVNCPS" runat="server" InitialValue="-1" ControlToValidate="DdlNCPS" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Concepto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpModalAplicarNC"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCENCPS" runat="server" HighlightCssClass="vco" TargetControlID="RFVNCPS" Width="350px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="VCENCPS" runat="server" HighlightCssClass="vco" TargetControlID="RFVNCPS" Width="350px"></ajax:ValidatorCalloutExtender>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<asp:Label ID="LblNCSaldoAnticipo" runat="server" Text=""></asp:Label> <asp:Label ID="LblNCSaldoAnticipo" runat="server" Text=""></asp:Label>
<asp:CheckBox ID="ChkAplicaNCAnticipo" runat="server" Text="Aplicar a Anticipo" Visible="false" /> <asp:CheckBox ID="ChkAplicaNCAnticipo" runat="server" Text="Aplicar a Anticipo" Visible="false" />
</div> </div>
@@ -5812,13 +5821,13 @@
</div> </div>
<div class="row form-group"> <div class="row form-group">
<div class="col-md-2"> <div class="col-md-2">
<asp:Literal ID="LtlTitleImportesRem" runat="server" Visible="false" Text="Importe Remisiones:"></asp:Literal> <asp:Literal ID="LtlTitleImportesRem" runat="server" Visible="false" Text="Importe Remisiones:"></asp:Literal>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<div id="DivTxtRemNC" runat="server" visible="false"> <div id="DivTxtRemNC" runat="server" visible="false">
<div class="input-group"> <div class="input-group">
<span class="input-group-addon">$</span> <span class="input-group-addon">$</span>
<asp:TextBox ID="TxtImportesRemisionesNC" ClientIDMode="Static" Text="0.00" CssClass="form-control input-sm" runat="server" Enabled="false"/> <asp:TextBox ID="TxtImportesRemisionesNC" ClientIDMode="Static" Text="0.00" CssClass="form-control input-sm" runat="server" Enabled="false" />
</div> </div>
<ajax:FilteredTextBoxExtender ID="FTIRNC" runat="server" TargetControlID="TxtImportesRemisionesNC" FilterType="Custom, Numbers" ValidChars=".," /> <ajax:FilteredTextBoxExtender ID="FTIRNC" runat="server" TargetControlID="TxtImportesRemisionesNC" FilterType="Custom, Numbers" ValidChars=".," />
</div> </div>
@@ -5841,7 +5850,7 @@
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#ModalAplicarRemisionesNC"> <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#ModalAplicarRemisionesNC">
Aplicar Remisiones Aplicar Remisiones
</button> </button>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
@@ -5954,7 +5963,7 @@
<input type="text" id="TxtBusquedaRemNC" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaRemNC','{0}')", GvRemisionesNC.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" /> <input type="text" id="TxtBusquedaRemNC" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaRemNC','{0}')", GvRemisionesNC.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaRemNC','{0}')", GvRemisionesNC.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a> <a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaRemNC','{0}')", GvRemisionesNC.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div> </div>
<div class="row" style="max-height: 10px"> <div class="row" style="max-height: 10px">
<div class="col-md-12" style="height: 440px; overflow: auto"> <div class="col-md-12" style="height: 440px; overflow: auto">
<asp:GridView ID="GvRemisionesNC" runat="server" AutoGenerateColumns="False" <asp:GridView ID="GvRemisionesNC" runat="server" AutoGenerateColumns="False"
DataKeyNames="CveVenta" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn" GridLines="None"> DataKeyNames="CveVenta" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn" GridLines="None">
@@ -6370,8 +6379,7 @@
$get('TxtTotalGv').value = FormatoNumero(TotalImportes, 2); $get('TxtTotalGv').value = FormatoNumero(TotalImportes, 2);
$get('TxtNCImporte').value = FormatoNumero(total, 2); $get('TxtNCImporte').value = FormatoNumero(total, 2);
if ('<%= UsuarioActual.Empresa.Funcionalidad(344) %>' == '1') if ('<%= UsuarioActual.Empresa.Funcionalidad(344) %>' == '1') {
{
CompararNC(); CompararNC();
} }
@@ -6400,8 +6408,7 @@
TxtImporte.value = ""; TxtImporte.value = "";
} }
if ('<%= UsuarioActual.Empresa.Funcionalidad(344) %>' == '1') if ('<%= UsuarioActual.Empresa.Funcionalidad(344) %>' == '1') {
{
CompararNC(); CompararNC();
} }
} }
@@ -6413,13 +6420,12 @@
TxtImporte.value = ""; TxtImporte.value = "";
} }
if ('<%= UsuarioActual.Empresa.Funcionalidad(344) %>' == '1') if ('<%= UsuarioActual.Empresa.Funcionalidad(344) %>' == '1') {
{
CompararNC(); CompararNC();
} }
} }
function LimitaCantidadRNCMasivo(TxtImporte,Saldo, Chk) { function LimitaCantidadRNCMasivo(TxtImporte, Saldo, Chk) {
var ImporteNuevo = TxtImporte.value; var ImporteNuevo = TxtImporte.value;
Chk.checked = true; Chk.checked = true;
@@ -6432,8 +6438,7 @@
TxtImporte.value = FormatoNumero(ImporteNuevo, 2); TxtImporte.value = FormatoNumero(ImporteNuevo, 2);
} }
if ('<%= UsuarioActual.Empresa.Funcionalidad(344) %>' == '1') if ('<%= UsuarioActual.Empresa.Funcionalidad(344) %>' == '1') {
{
CompararNC(); CompararNC();
} }
} }
@@ -6476,8 +6481,7 @@
TxtTotal.value = FormatoNumero(TotalConPorcentaje, 2); TxtTotal.value = FormatoNumero(TotalConPorcentaje, 2);
if ('<%= UsuarioActual.Empresa.Funcionalidad(344) %>' == '1') if ('<%= UsuarioActual.Empresa.Funcionalidad(344) %>' == '1') {
{
CompararNC(); CompararNC();
} }
} }
@@ -6812,15 +6816,20 @@
var TotalOtrosContado = 0; var TotalOtrosContado = 0;
try{ try {
if ($('#DdlOtroFormaPago').val() != "-1") { if ($('#DdlOtroFormaPago').val() != "-1") {
TotalOtrosContado = ToDouble($get("TxtImporteOtrosContado").value); TotalOtrosContado = ToDouble($get("TxtImporteOtrosContado").value);
} }
} catch (e) {} } catch (e) { }
var total = totalEfectivo + totalCredito + totalDebito + totalCheque + totalTransferencia + TotalOtrosContado; var total = totalEfectivo + totalCredito + totalDebito + totalCheque + totalTransferencia + TotalOtrosContado;
var totalVenta = ToDouble($get('TxtTotal').value);
if (total > totalVenta) {
$get("TxtCambio").value = FormatoNumero(total - totalVenta);
} else {
$get("TxtCambio").value = "0.00";
}
$get("TxtImporteContado").value = total; $get("TxtImporteContado").value = total;
} }
@@ -7431,7 +7440,7 @@
} }
} }
function showDivEC() { function showDivEC() {
$('#<%= TxtRFCCliente.ClientID %>').val(''); $('#<%= TxtRFCCliente.ClientID %>').val('');
$('#<%= TxtNombreCliente.ClientID %>').val(''); $('#<%= TxtNombreCliente.ClientID %>').val('');
@@ -7463,7 +7472,7 @@
document.getElementById('<%= TxtNCImporte.ClientID %>').style.border = "2px solid #04B431"; document.getElementById('<%= TxtNCImporte.ClientID %>').style.border = "2px solid #04B431";
document.getElementById('<%= TxtImportesRemisionesNC.ClientID %>').style.color = ""; document.getElementById('<%= TxtImportesRemisionesNC.ClientID %>').style.color = "";
document.getElementById('<%= TxtNCImporte.ClientID %>').style.color = ""; document.getElementById('<%= TxtNCImporte.ClientID %>').style.color = "";
} }
else { else {
@@ -7475,8 +7484,7 @@
} }
function CerrarModalRemNC() { function CerrarModalRemNC() {
if ('<%= UsuarioActual.Empresa.Funcionalidad(344) %>' == '1') if ('<%= UsuarioActual.Empresa.Funcionalidad(344) %>' == '1') {
{
CompararNC(); CompararNC();
} }
$('#ModalAplicarRemisionesNC').modal('hide'); $('#ModalAplicarRemisionesNC').modal('hide');

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)
@@ -3372,7 +3383,7 @@ Partial Class Ventas
GvPS.DataBind() GvPS.DataBind()
'JJMQ 20160506: Se agrego para la validacion de pago de contado. 'JJMQ 20160506: Se agrego para la validacion de pago de contado.
CVImporteContado.ValueToCompare = TxtTotal.Text.Replace(",", "") 'CVImporteContado.ValueToCompare = TxtTotal.Text.Replace(",", "")
UpContado.Update() UpContado.Update()
UpPS.Update() UpPS.Update()
@@ -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)
@@ -4091,7 +4102,7 @@ Partial Class Ventas
CalculaTotalesVenta(False) CalculaTotalesVenta(False)
'JJMQ 20160506: Se agrego para la validacion de pago de contado. 'JJMQ 20160506: Se agrego para la validacion de pago de contado.
CVImporteContado.ValueToCompare = TxtTotal.Text.Replace(",", "") 'CVImporteContado.ValueToCompare = TxtTotal.Text.Replace(",", "")
'CARGA ANTICIPOS 'CARGA ANTICIPOS
If Not (CveRemision > 0 Or CveCotizacion > 0) Then If Not (CveRemision > 0 Or CveCotizacion > 0) Then
@@ -4322,7 +4333,7 @@ Partial Class Ventas
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)
'JJMQ 20160506: Se agrego para la validacion de pago de contado. 'JJMQ 20160506: Se agrego para la validacion de pago de contado.
CVImporteContado.ValueToCompare = TxtTotal.Text.Replace(",", "") 'CVImporteContado.ValueToCompare = TxtTotal.Text.Replace(",", "")
If DdlVendedor.SelectedValue.ToEntero > 0 AndAlso Not UsuarioActual.TienePermisoProceso(161) Then If DdlVendedor.SelectedValue.ToEntero > 0 AndAlso Not UsuarioActual.TienePermisoProceso(161) Then
DdlVendedor.Enabled = False DdlVendedor.Enabled = False
@@ -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
@@ -5637,10 +5649,21 @@ Partial Class Ventas
If Not UsuarioActual.TienePermisoProceso(169) Then ' NO VALIDA EXISTENCIAS NI COSTO - PERMISO PARA NO VALIDAR If Not UsuarioActual.TienePermisoProceso(169) Then ' NO VALIDA EXISTENCIAS NI COSTO - PERMISO PARA NO VALIDAR
Dim CvePS As Integer = DatarowPS("CvePS").ToString.ToEntero 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 '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 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 ObjInventarios As New ClsInventarios
Dim Existencia As Decimal = 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) 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) 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 'si el costo es cero, puede ser que no halla movimientos del producto, en esa sucursal. y se volverá a sacar sin especificar sucursal
@@ -5662,7 +5685,7 @@ Partial Class Ventas
End If End If
If DdlTipoComprobante.SelectedValue <> "Cot" And ChkSinExistencia.Checked = False Then If ValidaExistencia AndAlso DdlTipoComprobante.SelectedValue <> "Cot" And ChkSinExistencia.Checked = False AndAlso Not RegistroxOC Then
'VALIDA EXISTENCIA 'VALIDA EXISTENCIA
If UsuarioActual.CveEmpresa.Contiene({72, 80, 119}) Then If UsuarioActual.CveEmpresa.Contiene({72, 80, 119}) Then
If Existencia - TmpDT.SUM("Cantidad", $"CvePS = {CvePS}") < TxtCantidad.Text.ToDouble Then If Existencia - TmpDT.SUM("Cantidad", $"CvePS = {CvePS}") < TxtCantidad.Text.ToDouble Then
@@ -5842,7 +5865,7 @@ Partial Class Ventas
'JJMQ 20160506: Se agrego para la validacion de pago de contado. 'JJMQ 20160506: Se agrego para la validacion de pago de contado.
CVImporteContado.ValueToCompare = TxtTotal.Text.Replace(",", "") 'CVImporteContado.ValueToCompare = TxtTotal.Text.Replace(",", "")
UpPS.Update() UpPS.Update()
UpContado.Update() UpContado.Update()
@@ -5865,7 +5888,7 @@ Partial Class Ventas
Alert("Eliminado Correctamente.", TipoMensaje.MsgInformacion) Alert("Eliminado Correctamente.", TipoMensaje.MsgInformacion)
'JJMQ 20160506: Se agrego para la validacion de pago de contado. 'JJMQ 20160506: Se agrego para la validacion de pago de contado.
CVImporteContado.ValueToCompare = TxtTotal.Text.Replace(",", "") 'CVImporteContado.ValueToCompare = TxtTotal.Text.Replace(",", "")
UpContado.Update() UpContado.Update()
End Sub End Sub
@@ -6550,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
@@ -6574,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
@@ -7018,6 +6997,10 @@ Partial Class Ventas
MensajeAlert.AppendFormat("<br/><br/><b> Se generó una Nota de crédito Folio: {0} amortizando el anticipo </b><br/>", ObjFacturaDevolucion.Folio) MensajeAlert.AppendFormat("<br/><br/><b> Se generó una Nota de crédito Folio: {0} amortizando el anticipo </b><br/>", ObjFacturaDevolucion.Folio)
End If End If
If RBLPago.SelectedValue.ToEntero = 2 And TxtCambio.Text.ToDecimal > 0 Then
MensajeAlert.AppendFormat("<br/><br/>Su cambio es de <b>${0}</b><br/>", TxtCambio.Text.ToDecimal.FormatoNumero(2))
End If
'MUESTA ALERT OK 'MUESTA ALERT OK
' si es elrol 1165-Ventas,EMp:80, o la empresa 119, recarga ventas, para seguir registrando-. ' si es elrol 1165-Ventas,EMp:80, o la empresa 119, recarga ventas, para seguir registrando-.
Dim Liga = If(UsuarioActual.CveRol = 1165 Or UsuarioActual.CveEmpresa = 119, "document.location.href=""/Ventas/Ventas.aspx?CveVenta=-1"";", If(CveEmpresaCRM > 0, $"document.location.href=""/CRM/EmpresaCRM.aspx?CveEmpresaCRM={CveEmpresaCRM}"";", $"document.location.href=""/Ventas/Clientes.aspx?CveCliente={CveCliente}&Opt=3"";")) Dim Liga = If(UsuarioActual.CveRol = 1165 Or UsuarioActual.CveEmpresa = 119, "document.location.href=""/Ventas/Ventas.aspx?CveVenta=-1"";", If(CveEmpresaCRM > 0, $"document.location.href=""/CRM/EmpresaCRM.aspx?CveEmpresaCRM={CveEmpresaCRM}"";", $"document.location.href=""/Ventas/Clientes.aspx?CveCliente={CveCliente}&Opt=3"";"))
@@ -7135,7 +7118,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)
@@ -7967,7 +7950,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
@@ -8007,8 +7990,8 @@ Partial Class Ventas
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
@@ -8773,6 +8756,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
@@ -8815,7 +8799,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
@@ -9252,7 +9236,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
@@ -9300,7 +9284,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
@@ -9558,9 +9542,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
@@ -9698,8 +9681,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
@@ -10101,20 +10082,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
@@ -10123,16 +10096,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
@@ -10341,6 +10304,10 @@ Partial Class Ventas
Exit For Exit For
End If End If
If DrPago("CveTipoMovimiento").ToString.ToEntero = 8 Then '13
DrPago("Importe") = DrPago("Importe").ToString.ToDecimal - TxtCambio.Text.ToDecimal
End If
CveIEPago = ObjBancos.AddBancos_IE(DrPago("CveCuenta").ToString.ToEntero, DrPago("CveTipoMovimiento").ToString.ToEntero, Fecha, FolioIE.ToString, String.Format("PAGO: {0}", TxtFolio.Text), DrPago("Importe").ToString.ToDouble, DdlMoneda.SelectedValue.ToEntero, tipoCambio, DrPago("Observaciones").ToString, "", False, False, -1, ObjFactura.CvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCorte:=CveCorte, MesesSinIntereses:=DrPago("MesesSinIntereses").ToString.ToEntero) CveIEPago = ObjBancos.AddBancos_IE(DrPago("CveCuenta").ToString.ToEntero, DrPago("CveTipoMovimiento").ToString.ToEntero, Fecha, FolioIE.ToString, String.Format("PAGO: {0}", TxtFolio.Text), DrPago("Importe").ToString.ToDouble, DdlMoneda.SelectedValue.ToEntero, tipoCambio, DrPago("Observaciones").ToString, "", False, False, -1, ObjFactura.CvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCorte:=CveCorte, MesesSinIntereses:=DrPago("MesesSinIntereses").ToString.ToEntero)
If CveIEPago > 0 Then If CveIEPago > 0 Then
@@ -10857,7 +10824,7 @@ Partial Class Ventas
ViewState("FolioFiscal") = drv("FolioFiscal").ToString ViewState("FolioFiscal") = drv("FolioFiscal").ToString
'JJMQ 20160506: Se agrego para la validacion de pago de contado. 'JJMQ 20160506: Se agrego para la validacion de pago de contado.
CVImporteContado.ValueToCompare = TxtTotal.Text.Replace(",", "") 'CVImporteContado.ValueToCompare = TxtTotal.Text.Replace(",", "")
UpContado.Update() UpContado.Update()
If factura.CveCliente > 0 Then If factura.CveCliente > 0 Then
@@ -14654,7 +14621,7 @@ Partial Class Ventas
HdnIVAOriginal.Value = TxtIVA.Text HdnIVAOriginal.Value = TxtIVA.Text
'JJMQ 20160506: Se agrego para la validacion de pago de contado. 'JJMQ 20160506: Se agrego para la validacion de pago de contado.
CVImporteContado.ValueToCompare = Total.ToString 'CVImporteContado.ValueToCompare = Total.ToString
If MensajeCveSAT IsNot Nothing AndAlso MensajeCveSAT.ToString.Length > 0 Then If MensajeCveSAT IsNot Nothing AndAlso MensajeCveSAT.ToString.Length > 0 Then
Alert($"Los siguientes conceptos hace falta especificar clave SAT <br/><br/> {MensajeCveSAT.ToString}", TipoMensaje.MsgAdvertencia) Alert($"Los siguientes conceptos hace falta especificar clave SAT <br/><br/> {MensajeCveSAT.ToString}", TipoMensaje.MsgAdvertencia)
@@ -15632,7 +15599,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
@@ -15879,6 +15846,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
@@ -16479,7 +16450,7 @@ Partial Class Ventas
'JJMQ 20160506: Validacion para no pagar de mas a peticion de I.P. 'JJMQ 20160506: Validacion para no pagar de mas a peticion de I.P.
Dim abonado = DtPagos.SUM("Importe") Dim abonado = DtPagos.SUM("Importe")
Dim saldo = TxtTotal.Text.Replace(",", "").ToDouble - abonado Dim saldo = TxtTotal.Text.Replace(",", "").ToDouble - abonado
CVImporteContado.ValueToCompare = (saldo.FormatoNumero(2).ToDouble).ToString 'CVImporteContado.ValueToCompare = (saldo.FormatoNumero(2).ToDouble).ToString
CargaGridContado() CargaGridContado()
UpContado.Update() UpContado.Update()
@@ -16493,10 +16464,10 @@ Partial Class Ventas
If total <= 0 Then Alert("No se ha ingresado importe", TipoMensaje.MsgAdvertencia) : Exit Sub If total <= 0 Then Alert("No se ha ingresado importe", TipoMensaje.MsgAdvertencia) : Exit Sub
If DtPagos.SUM("Importe").ToString.ToDecimal + total > TxtTotal.Text.ToDecimal Then 'If DtPagos.SUM("Importe").ToString.ToDecimal + total > TxtTotal.Text.ToDecimal Then
Alert("El importe de los pagos no puede exceder el importe de la factura. Por favor rectifique.", TipoMensaje.MsgAdvertencia) ' Alert("El importe de los pagos no puede exceder el importe de la factura. Por favor rectifique.", TipoMensaje.MsgAdvertencia)
Exit Sub ' Exit Sub
End If 'End If
'Pago en Efectivo 'Pago en Efectivo
If TxtImporteEfectivo.Text.ToDecimal > 0 Then If TxtImporteEfectivo.Text.ToDecimal > 0 Then
@@ -16691,7 +16662,7 @@ Partial Class Ventas
'JJMQ 20160506: Validacion para no pagar de mas a peticion de I.P. 'JJMQ 20160506: Validacion para no pagar de mas a peticion de I.P.
abonado = DtPagos.SUM("Importe") abonado = DtPagos.SUM("Importe")
saldo = TxtTotal.Text.Replace(",", "").ToDouble - abonado saldo = TxtTotal.Text.Replace(",", "").ToDouble - abonado
CVImporteContado.ValueToCompare = (saldo.FormatoNumero(2).ToDouble).ToString 'CVImporteContado.ValueToCompare = (saldo.FormatoNumero(2).ToDouble).ToString
CargaGridContado() CargaGridContado()
UpContado.Update() UpContado.Update()
@@ -16708,10 +16679,10 @@ Partial Class Ventas
Retorno = True Retorno = True
End If End If
If DtPagos.SUM("Importe").ToString.ToDecimal > TxtTotal.Text.ToDecimal Then 'If DtPagos.SUM("Importe").ToString.ToDecimal > TxtTotal.Text.ToDecimal Then
Alert("El importe de los pagos no puede exceder el importe de la factura. Por favor verifique.", TipoMensaje.MsgAdvertencia) ' Alert("El importe de los pagos no puede exceder el importe de la factura. Por favor verifique.", TipoMensaje.MsgAdvertencia)
Retorno = True ' Retorno = True
End If 'End If
Return Retorno Return Retorno
End Function End Function
@@ -21453,10 +21424,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