Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -1306,7 +1306,7 @@
|
||||
<asp:UpdatePanel ID="UpInv" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<asp:GridView ID="GvInv" runat="server" DataKeyNames="Total,PU,Cantidad,CvePS,Descuento,UUIDRow" AutoGenerateColumns="false" GridLines="None" EmptyDataText="Aun no hay registros."
|
||||
<asp:GridView ID="GvInv" runat="server" DataKeyNames="Total,PU,Cantidad,CvePS,Descuento,UUIDRow,AplicaLote,AplicaCaducidad,PS" AutoGenerateColumns="false" GridLines="None" EmptyDataText="Aun no hay registros."
|
||||
ShowHeaderWhenEmpty="True" CssClass="table table-striped table-hover Widthall mysmallbtn" Visible="false">
|
||||
<Columns>
|
||||
<%--0--%>
|
||||
@@ -1342,7 +1342,7 @@
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<%--3--%>
|
||||
<asp:BoundField ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Left" HeaderText=" Servicio" DataField="PS" />
|
||||
<asp:BoundField ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Left" HeaderText=" Producto" DataField="PS" />
|
||||
<%--4--%>
|
||||
<asp:BoundField ItemStyle-Width="7.5%" HeaderText="P.U." DataField="PU" DataFormatString="{0:#,##0.00####}" ItemStyle-HorizontalAlign="Right" />
|
||||
<%--5--%>
|
||||
@@ -1382,8 +1382,8 @@
|
||||
<ajax:MaskedEditExtender ID="MEECaducidad" runat="server" TargetControlID="TxtCaducidad" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CECaducidad" TargetControlID="TxtCaducidad" PopupButtonID="LnkCaducidad" PopupPosition="TopLeft" Format="dd/MM/yyyy"></ajax:CalendarExtender>
|
||||
|
||||
<asp:RequiredFieldValidator ID="RFVCaducidad" runat="server" ControlToValidate="TxtCaducidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Caducidad''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCECaducidad" runat="server" HighlightCssClass="vco" TargetControlID="RFVCaducidad"></ajax:ValidatorCalloutExtender>
|
||||
<%--<asp:RequiredFieldValidator ID="RFVCaducidad" runat="server" ControlToValidate="TxtCaducidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Caducidad''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCECaducidad" runat="server" HighlightCssClass="vco" TargetControlID="RFVCaducidad"></ajax:ValidatorCalloutExtender>--%>
|
||||
</div>
|
||||
|
||||
</ItemTemplate>
|
||||
|
||||
@@ -12,10 +12,10 @@ Imports Extensiones
|
||||
Imports MoreLinq
|
||||
Imports System.Data.SqlClient
|
||||
Imports ClsPaginas
|
||||
Imports System.Activities.Expressions
|
||||
Imports Microsoft.Data.Edm.Expressions
|
||||
Imports Telerik.Web.UI
|
||||
Imports DocumentFormat.OpenXml.Math
|
||||
Imports Microsoft.Owin.Security.Provider
|
||||
|
||||
|
||||
|
||||
|
||||
Partial Class Compras_Compras
|
||||
Inherits ClsPaginas
|
||||
@@ -4315,7 +4315,9 @@ Partial Class Compras_Compras
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
|
||||
If Not ValidaLoteFechaCaducidad() Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim TotalRealDevolucion As Decimal = 0
|
||||
|
||||
@@ -5735,8 +5737,8 @@ Partial Class Compras_Compras
|
||||
Dim Lote As String = Dr("Lote").ToString
|
||||
Dim FechaCaducidad As Date = If(Dr("FechaCaducidad").ToString.ToDate <= MinFecha, MinFecha, Dr("FechaCaducidad").ToString.ToDate)
|
||||
|
||||
Dim AplicaLote As Boolean = Boolean.Parse(Dr("AplicaLote").ToString)
|
||||
Dim AplicaCaducidad As Boolean = Boolean.Parse(Dr("AplicaCaducidad").ToString)
|
||||
Dim AplicaLote As Boolean = If(Dr("AplicaLote").ToString.Trim = "", False, Boolean.Parse(Dr("AplicaLote").ToString))
|
||||
Dim AplicaCaducidad As Boolean = If(Dr("AplicaCaducidad").ToString.Trim = "", False, Boolean.Parse(Dr("AplicaCaducidad").ToString))
|
||||
Dim CodigoPS As String = Dr("CodigoPS").ToString
|
||||
|
||||
If Dr("CveMetodoInventario").ToString.ToEntero = 5 Then
|
||||
@@ -5747,7 +5749,7 @@ Partial Class Compras_Compras
|
||||
|
||||
Dim fechaDetalle As Date = drr("FechaCaducidad").ToString.ToDate
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, 1, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, -1, Serie:=drr("Serie").ToString, FechaCaducidad:=drr("FechaCaducidad").ToString.ToDate, CostoIndirecto:=Dr("CostoIndirectoAlmacen").ToString.ToDecimal, CveCompraDetalle:=Dr("CveCompraDetalle").ToString.ToEntero, CveOrdenCompraDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero, Lote:=Lote) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, 1, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, -1, Serie:=drr("Serie").ToString, FechaCaducidad:=drr("FechaCaducidad").ToString.ToDate, CostoIndirecto:=Dr("CostoIndirectoAlmacen").ToString.ToDecimal, CveCompraDetalle:=Dr("CveCompraDetalle").ToString.ToEntero, CveOrdenCompraDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero) Then
|
||||
ErrorMovInv = True
|
||||
Exit For
|
||||
End If
|
||||
@@ -5777,12 +5779,12 @@ Partial Class Compras_Compras
|
||||
|
||||
If AplicaLote And Lote.Trim = "" Then
|
||||
ErrorMovInv = True
|
||||
Alert($"Porducto {CodigoPS} requiere Lote.")
|
||||
Alert($"Porducto {CodigoPS} requiere Lote.", TipoMensaje.MsgAdvertencia)
|
||||
Exit For
|
||||
End If
|
||||
If AplicaCaducidad And FechaCaducidad = MinFecha And Lote.Trim = "" Then
|
||||
If AplicaCaducidad And FechaCaducidad <= MinFecha Then
|
||||
ErrorMovInv = True
|
||||
Alert($"Porducto {CodigoPS} requiere fecha de caducidad.")
|
||||
Alert($"Porducto {CodigoPS} requiere fecha de caducidad.", TipoMensaje.MsgAdvertencia)
|
||||
Exit For
|
||||
End If
|
||||
|
||||
@@ -8026,6 +8028,45 @@ Partial Class Compras_Compras
|
||||
|
||||
End Function
|
||||
|
||||
Private Function ValidaLoteFechaCaducidad() As Boolean
|
||||
Dim Respuesta As Boolean = True
|
||||
Dim sbErrores As New StringBuilder
|
||||
If UsuarioActual.Empresa.UsaInventarios AndAlso DdlTipoCompra.SelectedValue <> "13" Then 'And UsuarioActual.Empresa.UsaAC = False
|
||||
For Each gvRow As GridViewRow In GvInv.Rows
|
||||
Dim Chk As CheckBox = gvRow.FCCheckBox("cbInv")
|
||||
|
||||
If Chk.Checked Then
|
||||
|
||||
Dim Ps As String = gvRow.DataKey("PS")
|
||||
Dim AplicaLote As Boolean = If(gvRow.DataKey("AplicaLote").Trim = "", False, Boolean.Parse(gvRow.DataKey("AplicaLote")))
|
||||
Dim AplicaCaducidad As Boolean = If(gvRow.DataKey("AplicaCaducidad").Trim = "", False, Boolean.Parse(gvRow.DataKey("AplicaCaducidad")))
|
||||
Dim Lote As String = gvRow.FCTextBox("TxtLote").Text
|
||||
Dim FechaCaducidad As Date = gvRow.FCTextBox("TxtCaducidad").Text.ToDate
|
||||
|
||||
If AplicaLote AndAlso Lote.Trim = String.Empty Then
|
||||
sbErrores.Append($"Producto {Ps} requiere Lote.</br>")
|
||||
Respuesta = False
|
||||
End If
|
||||
|
||||
If AplicaCaducidad AndAlso (FechaCaducidad <= MinFecha) Then
|
||||
sbErrores.Append($"Producto {Ps} requiere Fecha de Caducidad.</br>")
|
||||
Respuesta = False
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Next
|
||||
End If
|
||||
|
||||
If Not Respuesta Then
|
||||
Alert($"Los siguientes productos requieren que se les especifique Lote o Fecha de Caducidad.</br>{sbErrores.ToString}", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
|
||||
Return Respuesta
|
||||
|
||||
End Function
|
||||
|
||||
Private Function AjustaCombustibles() As Boolean
|
||||
|
||||
Dim Respuesta As Boolean = False
|
||||
@@ -11093,6 +11134,21 @@ Partial Class Compras_Compras
|
||||
If dRow("UUIDRow").ToString.Trim = "" Then
|
||||
dRow("UUIDRow") = Guid.NewGuid().ToString()
|
||||
End If
|
||||
Dim CvePS As Integer = dRow("CvePS").ToString.ToEntero
|
||||
|
||||
dRow("AplicaLote") = False
|
||||
dRow("AplicaCaducidad") = False
|
||||
|
||||
If CvePS > 0 Then
|
||||
Dim drPS As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimero($"CvePS={CvePS}")
|
||||
If drPS IsNot Nothing Then
|
||||
dRow("AplicaLote") = If(drPS("AplicaLote").ToString = "", False, Boolean.Parse(drPS("AplicaLote").ToString))
|
||||
dRow("AplicaCaducidad") = If(drPS("AplicaCaducidad").ToString = "", False, Boolean.Parse(drPS("AplicaCaducidad").ToString))
|
||||
'Boolean.Parse(GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimeroValor("AplicaCaducidad", $"CvePS={CvePS}"))
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Next
|
||||
TmpDT.AcceptChanges()
|
||||
|
||||
@@ -11106,9 +11162,9 @@ Partial Class Compras_Compras
|
||||
|
||||
For Each dRow As DataRow In DtInv.Rows
|
||||
|
||||
Dim CvePS As Integer = dRow("CvePS").ToString.ToEntero
|
||||
Dim AplicaLote As Boolean = Boolean.Parse(GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimeroValor("AplicaLote", $"CvePS={CvePS}"))
|
||||
Dim AplicaCaducidad As Boolean = Boolean.Parse(GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimeroValor("AplicaCaducidad", $"CvePS={CvePS}"))
|
||||
'Dim CvePS As Integer = dRow("CvePS").ToString.ToEntero
|
||||
Dim AplicaLote As Boolean = Boolean.Parse(dRow("AplicaLote").ToString) 'Boolean.Parse(GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimeroValor("AplicaLote", $"CvePS={CvePS}"))
|
||||
Dim AplicaCaducidad As Boolean = Boolean.Parse(dRow("AplicaCaducidad").ToString) 'Boolean.Parse(GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimeroValor("AplicaCaducidad", $"CvePS={CvePS}"))
|
||||
|
||||
GvInv.Columns(7).Visible = AplicaLote
|
||||
GvInv.Columns(8).Visible = AplicaCaducidad
|
||||
@@ -11185,8 +11241,17 @@ Partial Class Compras_Compras
|
||||
|
||||
Dim CvePS As Integer = e.Row.DataKey("CvePS").ToEntero
|
||||
|
||||
Dim AplicaLote As Boolean = Boolean.Parse(GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimeroValor("AplicaLote", $"CvePS={CvePS}"))
|
||||
Dim AplicaCaducidad As Boolean = Boolean.Parse(GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimeroValor("AplicaCaducidad", $"CvePS={CvePS}"))
|
||||
Dim AplicaLote As Boolean = False
|
||||
Dim AplicaCaducidad As Boolean = False
|
||||
|
||||
If CvePS > 0 Then
|
||||
Dim drPS As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimero($"CvePS={CvePS}")
|
||||
If drPS IsNot Nothing Then
|
||||
AplicaLote = If(drPS("AplicaLote").ToString = "", False, Boolean.Parse(drPS("AplicaLote").ToString)) 'Boolean.Parse(GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimeroValor("AplicaLote", $"CvePS={CvePS}"))
|
||||
AplicaCaducidad = If(drPS("AplicaCaducidad").ToString = "", False, Boolean.Parse(drPS("AplicaCaducidad").ToString)) 'Boolean.Parse(GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimeroValor("AplicaCaducidad", $"CvePS={CvePS}"))
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
If AplicaLote Then
|
||||
e.Row.FCTextBox("TxtLote").Visible = True
|
||||
@@ -11273,7 +11338,7 @@ Partial Class Compras_Compras
|
||||
e.Row.FCDropDownList("ddlAlmacenConsignacion").SelectedValueExist(e.Row.DBCampo("CveAlmacenConsignacion"))
|
||||
End If
|
||||
''CARGA CONSIGNACIONES
|
||||
e.Row.FCDropDownList("DdlVinculaConsignacion").DataSource = DtConsignaciones.FiltraParametros(String.Format("CveAlmacenSalida = {0} OR {0} = '-1'", e.Row.FCDropDownList("ddlAlmacenConsignacion").SelectedValue))
|
||||
e.Row.FCDropDownList("DdlVinculaConsignacion").DataSource = DtConsignaciones.FiltraParametros(String.Format("CveAlmacenSalida = {0} Or {0} = '-1'", e.Row.FCDropDownList("ddlAlmacenConsignacion").SelectedValue))
|
||||
e.Row.FCDropDownList("DdlVinculaConsignacion").DataBind()
|
||||
e.Row.FCDropDownList("DdlVinculaConsignacion").Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
|
||||
@@ -21852,7 +21917,7 @@ Partial Class Compras_Compras
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
|
||||
@@ -343,6 +343,13 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label class="col-md-4">Es Presupuestal</label>
|
||||
<div class="col-md-8">
|
||||
<asp:CheckBox runat="server" ID="ChkEsPresupuestal" CssClass="make-switchsd" data-size="small" Checked="true" />
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="text-align: center; padding-top: 20px;">
|
||||
|
||||
@@ -254,6 +254,8 @@ Partial Class RepContratoDetalle
|
||||
|
||||
If CveVentaRemision > 0 Then
|
||||
DVFactura.Visible = True
|
||||
ChkEsPresupuestal.Enabled = False
|
||||
ChkEsPresupuestal.Checked = False
|
||||
End If
|
||||
|
||||
End If
|
||||
@@ -326,6 +328,8 @@ Partial Class RepContratoDetalle
|
||||
HypRemision.Text = Contrato.Rows(0)("RemisionSerieFolio").ToString
|
||||
HypRemision.NavigateUrl = $"/Ventas/Ventas.aspx?CveVenta={ CveVentaRemision}"
|
||||
|
||||
ChkEsPresupuestal.Checked = Boolean.Parse(Contrato.Rows(0)("EsPresupuestal").ToString)
|
||||
|
||||
If Contrato.Rows(0)("RemisionSaldo").ToString.ToDecimal > 0 Then
|
||||
LblSaldo.Text = $"Saldo { Contrato.Rows(0)("RemisionSaldo").ToString.ToDecimal.ToString("###,###,###.00")}"
|
||||
Else
|
||||
@@ -449,22 +453,7 @@ Partial Class RepContratoDetalle
|
||||
|
||||
End Sub
|
||||
|
||||
'Protected Sub CargarArchivo(ByVal sender As Object, ByVal e As AjaxControlToolkit.AsyncFileUploadEventArgs) Handles AFU.UploadedComplete
|
||||
' If AFU.HasFile Then
|
||||
|
||||
|
||||
' Dim UploadFolder As String = String.Format("{0}\Temp\", UsuarioActual.Empresa.Ruta)
|
||||
' UploadFolder.DirectoryExistsCreate()
|
||||
' Dim Extension As String = System.IO.Path.GetExtension(AFU.PostedFile.FileName)
|
||||
|
||||
' If File.Exists(String.Format("{0}{1}{2}", UploadFolder, UsuarioActual.CveUsuario.ToString, Extension)) Then File.Delete(String.Format("{0}{1}{2}", UploadFolder, UsuarioActual.CveUsuario.ToString, Extension))
|
||||
|
||||
' AFU.SaveAs(UploadFolder & UsuarioActual.CveUsuario.ToString & Extension)
|
||||
' Session("FileUpload") = UploadFolder & UsuarioActual.CveUsuario.ToString & Extension
|
||||
' Session("FileExtension") = Extension
|
||||
' Session("FileFolder") = UploadFolder
|
||||
' End If
|
||||
'End Sub
|
||||
Protected Sub DownloadFile(ByVal sender As Object, ByVal e As EventArgs)
|
||||
Dim filePath As String = String.Format("{0}{1}", UsuarioActual.Empresa.Ruta, CType(sender, LinkButton).CommandArgument)
|
||||
Dim Archivo As New System.IO.FileInfo(filePath)
|
||||
@@ -526,16 +515,8 @@ Partial Class RepContratoDetalle
|
||||
BtnDescargar.Visible = True
|
||||
End If
|
||||
End Sub
|
||||
'Private Sub BtnDescargar_Click(sender As Object, e As EventArgs) Handles BtnDescargar.Click
|
||||
' Dim File As New FileInfo(ViewState("FUrl").ToString)
|
||||
' Dim Url As String = $"{ObtenerUrlCompleta()}Compras/PopUpVerFactura.aspx?ArchivoContrato={Encripta(File.FullName)}"
|
||||
' If File.Exists Then
|
||||
' RegistraScript($"window.open({Url}, ""_blank"");")
|
||||
' End If
|
||||
|
||||
|
||||
'End Sub
|
||||
|
||||
Public Function ObtenerUrlCompleta() As String
|
||||
|
||||
Dim Solicitud As HttpRequest = HttpContext.Current.Request
|
||||
@@ -555,35 +536,13 @@ Partial Class RepContratoDetalle
|
||||
Return url
|
||||
|
||||
End Function
|
||||
'Private Sub DescargaArchivo(urlArchivo As String)
|
||||
|
||||
' Dim File As New FileInfo(urlArchivo)
|
||||
|
||||
' If File.Exists Then 'set appropriate headers
|
||||
|
||||
' Response.Clear()
|
||||
' Response.ClearHeaders()
|
||||
' Response.ClearContent()
|
||||
' Response.AddHeader("Content-Disposition", "inline; filename=" & TxtFolio.Text & $"{File.Extension}")
|
||||
' Response.AddHeader("Content-Length", File.Length.ToString())
|
||||
' 'Response.ContentType = "text/plain"
|
||||
' Response.ContentType = "application/octet-stream"
|
||||
' Response.Flush()
|
||||
' ' Response.TransmitFile(File.FullName)
|
||||
' Response.WriteFile(File.FullName)
|
||||
' Response.End()
|
||||
|
||||
' Else
|
||||
|
||||
' Alert("Ocurrio un error al descargar el archivo", TipoMensaje.MsgAdvertencia, "window.close()")
|
||||
|
||||
' End If
|
||||
|
||||
'End Sub
|
||||
|
||||
Protected Sub UpdateContrato(sender As Object, e As EventArgs)
|
||||
Dim ArchivoUpdate As String = "-1"
|
||||
Dim ErrorProceso As Boolean = False
|
||||
Dim SeGeneroRemision As Boolean = False
|
||||
Dim SerieFolioRemision As String = ""
|
||||
If Session("FileExtension").ToString <> "" Then
|
||||
|
||||
'ArchivoUpdate = $"{CveContrato.ToString}.{ Session("FileExtension")}"
|
||||
@@ -597,7 +556,7 @@ Partial Class RepContratoDetalle
|
||||
|
||||
|
||||
If Not ObjContratos.UpdateContratos(CveContrato, TxtFolio.Text, TxtDescripcion.Text, "", UsuarioActual.CveProveedor, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, TxtUbicacion.Text, "",
|
||||
DdlSubProyecto.SelectedValue.ToEntero, -1, -1, -1, -1, ArchivoUpdate, "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, TxtAnticipo.Text.ToDecimal, -1, TxtImporte.Text.ToDecimal,
|
||||
DdlSubProyecto.SelectedValue.ToEntero, -1, -1, -1, -1, ArchivoUpdate, "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, ChkEsPresupuestal.Checked, TxtAnticipo.Text.ToDecimal, -1, TxtImporte.Text.ToDecimal,
|
||||
DdlMoneda.SelectedValue.ToEntero, 0, CveContratoTipo:=CveContratoTipo, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero, CveContratosEstatus:=CveContratoEstatus, Observaciones:=TxtObservaciones.Text) Then
|
||||
ErrorProceso = True
|
||||
End If
|
||||
@@ -617,11 +576,36 @@ Partial Class RepContratoDetalle
|
||||
End If
|
||||
End If
|
||||
|
||||
If Not ErrorProceso Then
|
||||
If Not ErrorProceso AndAlso Not CveVentaRemision > 0 AndAlso ChkEsPresupuestal.Checked = False Then
|
||||
'CveVentaRemision
|
||||
Dim ObsRemisionPartida As String = $"{DdlTipoAF.SelectedItem.Text}-{ TxtDescripcion.Text}-{TxtFolio.Text}"
|
||||
|
||||
Dim Respuesta As New RespuestaFacturacion()
|
||||
Dim CvePS As Integer = 907784
|
||||
Respuesta = GeneraRemision(CveContrato, ObsRemisionPartida, TxtImporte.Text.ToDecimal, CvePS, ObjContratos.IniciaTransacSQL, DdlSubProyecto.SelectedValue.ToEntero)
|
||||
|
||||
If Respuesta.CveVenta > 0 Then
|
||||
CveVentaRemision = Respuesta.CveVenta
|
||||
SerieFolioRemision = Respuesta.SerieFolio
|
||||
ErrorProceso = False
|
||||
SeGeneroRemision = True
|
||||
Else
|
||||
ErrorProceso = True
|
||||
Alert("se presento un error al generar la remisión", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End If
|
||||
|
||||
If Not ErrorProceso Then
|
||||
ObjContratos.Commit()
|
||||
AgregarABitacora($"Actualización del contrato {CveContrato}")
|
||||
Alert("Contrato actualizado correctamente")
|
||||
|
||||
If SeGeneroRemision Then
|
||||
Alert($"Contrato actualizado correctamente..<br> Remisión Generada <a target='_blank' class='Texto' href='/Ventas/Ventas.aspx?CveVenta={CveVentaRemision}' ><b>{SerieFolioRemision}</b></a>", TipoMensaje.MsgInformacion, "window.location.reload();")
|
||||
Else
|
||||
Alert("Contrato actualizado correctamente", TipoMensaje.MsgInformacion, "window.location.reload();")
|
||||
End If
|
||||
|
||||
|
||||
Else
|
||||
Alert("Ocurrió un ocurrió un error al actualizar su boleto", TipoMensaje.MsgError)
|
||||
ObjContratos.RollBack()
|
||||
@@ -796,23 +780,7 @@ Partial Class RepContratoDetalle
|
||||
New ReportParameter("FechaImpresion", Date.Now.ToString("dd/MM/yyyy HH:mm:ss")),
|
||||
New ReportParameter("Usuario", UsuarioActual.Nombre)
|
||||
}
|
||||
'New ReportParameter("Folio", TxtFolio.Text),
|
||||
' New ReportParameter("Cliente", DdlClientes.SelectedText),
|
||||
' New ReportParameter("Servicio", TxtDescripcion.Text),
|
||||
' New ReportParameter("Observaciones", TxtObservaciones.Text),
|
||||
' New ReportParameter("Ubicacion", TxtUbicacion.Text),
|
||||
' New ReportParameter("FechaSalida", TxtFechaSalida.Text.ToDate.ToString("dd/MM/yyyy")),
|
||||
' New ReportParameter("FechaRegreso", TxtFechaRegreso.Text.ToDate.ToString("dd/MM/yyyy")),
|
||||
' New ReportParameter("CantidadPasajeros", TxtCantidadPasajeros.Text),
|
||||
' New ReportParameter("TipoAF", DdlTipoAF.SelectedItem.ToString()),
|
||||
' New ReportParameter("Pesos", Math.Round(TxtImporte.Text.ToDecimal, 2).ToString),
|
||||
' New ReportParameter("Moneda", DdlMoneda.SelectedItem.ToString),
|
||||
' New ReportParameter("Anticipo", Math.Round((TxtAnticipo.Text.ToDecimal * TxtImporte.Text.ToDecimal), 2).ToString),
|
||||
' New ReportParameter("Total", Math.Round((TxtImporte.Text.ToDecimal - (TxtAnticipo.Text.ToDecimal * TxtImporte.Text.ToDecimal)), 2).ToString),
|
||||
' New ReportParameter("DiaSalida", $"{TxtFechaSalida.Text.ToDate.Hour}:{TxtFechaSalida.Text.ToDate.Minute} "),
|
||||
' New ReportParameter("TelefonoEmpresa", TelefonoEmpresa),
|
||||
' New ReportParameter("FechaImpresion", Date.Now.ToString("dd/MM/yyyy HH:mm:ss")),
|
||||
' New ReportParameter("Usuario", UsuarioActual.Nombre)
|
||||
|
||||
|
||||
ImprimirPDFStimul($"{UsuarioActual.Empresa.Ruta}Formatos\Contrato.mrt", dtResult, params, NombreArchivo:=TxtFolio.Text)
|
||||
End Sub
|
||||
@@ -1114,7 +1082,85 @@ Partial Class RepContratoDetalle
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " R E M I S I O N "
|
||||
Private Function GeneraRemision(CveContrato As Integer, ObsPartida As String, Importe As Decimal, CvePS As Integer, ByRef TransaccionSQL As SqlClient.SqlTransaction, CveSubProyecto As Integer) As RespuestaFacturacion
|
||||
|
||||
Dim Respuesta As New RespuestaFacturacion()
|
||||
Dim CveRemisionGenerada As Integer = -1
|
||||
Dim ObjVentas As New ClsVentas(TransaccionSQL)
|
||||
Dim ProcesoOK As Boolean = True
|
||||
Dim CveMoneda As Integer = DdlMoneda.SelectedValue.ToEntero
|
||||
|
||||
Dim ObjFactura As Modelos.Factura = Modelos.Factura.CrearVentaNueva(UsuarioActual, CveSubProyecto, DdlClientes.SelectedValue.ToEntero, CveMoneda, "Rem")
|
||||
|
||||
If ObjFactura IsNot Nothing AndAlso ProcesoOK Then
|
||||
|
||||
ObjFactura.CveMoneda = CveMoneda
|
||||
ObjFactura.CveContrato = CveContrato
|
||||
ObjFactura.Observaciones = ObsPartida
|
||||
ObjFactura.CveFormaPago33 = 20 ' por definir
|
||||
If CveMoneda > 1 Then
|
||||
ObjFactura.TipoCambio = GlobalTipoCambio(DateTime.Now).ToDecimal
|
||||
End If
|
||||
|
||||
Dim TmpDTMat As New DataTable
|
||||
TmpDTMat.Columns.Add("Consec", GetType(Integer))
|
||||
TmpDTMat.Columns.Add("CvePS", GetType(Integer))
|
||||
TmpDTMat.Columns.Add("CveUM", GetType(Integer))
|
||||
TmpDTMat.Columns.Add("Cantidad", GetType(Integer))
|
||||
TmpDTMat.Columns.Add("PU", GetType(Decimal))
|
||||
TmpDTMat.Columns.Add("Lote", GetType(String))
|
||||
TmpDTMat.Columns.Add("FechaCaducidad", GetType(Date))
|
||||
TmpDTMat.Columns.Add("CveVentaDetalle", GetType(Integer))
|
||||
|
||||
Dim CantidadRegistro As Decimal = 1
|
||||
Dim PorcentajeIVA As Decimal = GlobalDTSubProyectos(UsuarioActual.CveEmpresa, CveSubProyecto:=CveSubProyecto).FiltroPrimeroValor("IVA").ToDecimal
|
||||
Dim SubTotal As Decimal = (Importe / (1D + PorcentajeIVA))
|
||||
Dim PU As Decimal = SubTotal
|
||||
Dim Descuento As Decimal = 0
|
||||
Dim Obs As String = ObsPartida
|
||||
|
||||
If CantidadRegistro > 0 Then
|
||||
If ObjFactura.AgregarPS(CvePS, CantidadRegistro, PU, Descuento, Obs, CveSubProyecto:=CveSubProyecto, PorcentajeIVA:=PorcentajeIVA) Then
|
||||
Dim drp As DataRow = TmpDTMat.NewRow
|
||||
drp("CvePS") = CvePS
|
||||
drp("Cantidad") = CantidadRegistro
|
||||
drp("PU") = PU
|
||||
TmpDTMat.Rows.Add(drp)
|
||||
Else
|
||||
Alert("Error al agregar producto", TipoMensaje.MsgAdvertencia)
|
||||
ProcesoOK = False
|
||||
End If
|
||||
End If
|
||||
|
||||
If ProcesoOK Then
|
||||
ObjFactura.CalculaTotales()
|
||||
Dim Resp As New Modelos.Factura.MMensajeFactura
|
||||
Resp = ObjFactura.EmitirFactura(False, Transac:=TransaccionSQL)
|
||||
|
||||
If Resp.CveVenta > 0 Then
|
||||
Respuesta.CveVenta = Resp.CveVenta
|
||||
Respuesta.SerieFolio = Resp.SerieFolio
|
||||
Respuesta.dtdetalle = TmpDTMat
|
||||
Else
|
||||
ProcesoOK = False
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
ProcesoOK = False
|
||||
End If
|
||||
Return Respuesta
|
||||
|
||||
End Function
|
||||
Friend Class RespuestaFacturacion
|
||||
Public Property CveVenta As Integer = -1
|
||||
Public Property SerieFolio As String = "-1"
|
||||
Public Property dtdetalle As DataTable = Nothing
|
||||
Public Sub New()
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
@@ -257,14 +257,10 @@
|
||||
<div class="row">
|
||||
<div class="col-md-7">
|
||||
<div class="row my-1">
|
||||
<label class="col-md-4 bold text-primary">Folio</label>
|
||||
<%--<asp:Label class="col-md-8" runat="server" ID="LbFolio" Text="Folio"></asp:Label>--%>
|
||||
<label class="col-md-4 bold text-primary">Folio</label>
|
||||
<div class="col-md-8">
|
||||
|
||||
<asp:TextBox ID="LbFolio" runat="server" MaxLength="70" Width="200px" CssClass="form-control" ></asp:TextBox>
|
||||
|
||||
|
||||
</div>
|
||||
<asp:TextBox ID="LbFolio" runat="server" MaxLength="70" Width="200px" CssClass="form-control"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row my-1">
|
||||
@@ -488,6 +484,15 @@
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
<div class="row my-1">
|
||||
<label class="col-md-4">Es Presupuestal</label>
|
||||
<div class="col-md-8">
|
||||
<asp:CheckBox runat="server" ID="ChkEsPresupuestal" CssClass="make-switchsd" data-size="small" Checked="true" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -137,7 +137,7 @@ Partial Class ListadoContratos
|
||||
Dim ObjFolios As New ClsGralFolios(ObjContratos.IniciaTransacSQL())
|
||||
|
||||
CveContrato = ObjContratos.AddContratos(LbFolio.Text, TxtDescripcion.Text, "", UsuarioActual.CveProveedor, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDateTime, TxtFechaRegreso.Text.ToDateTime, TxtUbicacion.Text, "",
|
||||
DdlSubProyectoModal.SelectedValue.ToEntero, -1, -1, -1, -1, LbArchivo.Text, "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, TxtAnticipo.Text.ToDecimal, -1, TxtImporte.Text.ToDecimal,
|
||||
DdlSubProyectoModal.SelectedValue.ToEntero, -1, -1, -1, -1, LbArchivo.Text, "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, ChkEsPresupuestal.Checked, TxtAnticipo.Text.ToDecimal, -1, TxtImporte.Text.ToDecimal,
|
||||
DdlMoneda.SelectedValue.ToEntero, 0, CveContratoTipo:=34, CveContratosEstatus:=50, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero, CantidadPasajeros:=TxtCantidadPasajeros.Text.ToEntero, Observaciones:=TxtObservaciones.Text,
|
||||
CveVendedor:=UsuarioActual.CveVendedor)
|
||||
|
||||
@@ -180,7 +180,7 @@ Partial Class ListadoContratos
|
||||
End If
|
||||
Anexo.Text = ""
|
||||
|
||||
If ErrorProceso = False Then
|
||||
If ErrorProceso = False AndAlso Not ChkEsPresupuestal.Checked Then
|
||||
|
||||
Dim ObsRemisionPartida As String = $"{DdlTipoAF.SelectedItem.Text}-{ TxtDescripcion.Text}-{LbFolio.Text}"
|
||||
|
||||
@@ -211,7 +211,13 @@ Partial Class ListadoContratos
|
||||
|
||||
If Not ErrorProceso Then
|
||||
ObjContratos.Commit()
|
||||
Alert($"Agregado Correctamente.<br> Remisión Generada <a target='_blank' class='Texto' href='/Ventas/Ventas.aspx?CveVenta={CveVentaRemision}' ><b>{SerieFolioRemision}</b></a>")
|
||||
|
||||
If CveVentaRemision > 0 Then
|
||||
Alert($"Agregado Correctamente.<br> Remisión Generada <a target='_blank' class='Texto' href='/Ventas/Ventas.aspx?CveVenta={CveVentaRemision}' ><b>{SerieFolioRemision}</b></a>")
|
||||
Else
|
||||
Alert($"Agregado Correctamente")
|
||||
End If
|
||||
|
||||
Else
|
||||
ObjContratos.RollBack()
|
||||
Alert("Se presento un error al guardar el contrato.", TipoMensaje.MsgAdvertencia)
|
||||
|
||||
Reference in New Issue
Block a user