agregando formulario de ajuste a la recepción de usados
This commit is contained in:
@@ -514,7 +514,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<%--<asp:Button ID="BtnCalcularImporteAjuste" CssClass="btn green-haze btn-outline btn-circle btn-sm" OnClick="BtnCalcularImporteAjuste_Click" runat="server" Text="Recalcular" />--%>
|
<asp:Button ID="BtnCalcularImporteAjuste" CssClass="btn green-haze btn-outline btn-circle btn-sm" OnClick="BtnCalcularImporteAjuste_Click" runat="server" Text="Recalcular" />
|
||||||
|
<asp:Button ID="BtnAgregarProductoAjuste" CssClass="btn green-haze btn-outline btn-circle btn-sm" OnClick="BtnAgregarProductoAjuste_Click" runat="server" Text="Agregar" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -1026,6 +1027,7 @@
|
|||||||
<asp:UpdatePanel runat="server">
|
<asp:UpdatePanel runat="server">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
<asp:LinkButton ID="LnkModalAgregarUsado" runat="server" CssClass="btn btn-success" Text="Agregar" OnClick="LnkModalAgregarUsado_Click" ValidationGroup="GprAgregarUsado"></asp:LinkButton>
|
<asp:LinkButton ID="LnkModalAgregarUsado" runat="server" CssClass="btn btn-success" Text="Agregar" OnClick="LnkModalAgregarUsado_Click" ValidationGroup="GprAgregarUsado"></asp:LinkButton>
|
||||||
|
<asp:Button ID="BtnCalculaMesesUso" Text="" OnClick="BtnCalculaMesesUso_Click" ClientIDMode="Static" Style="display: none;" runat="server" />
|
||||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
|
<button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
@@ -1041,6 +1043,10 @@
|
|||||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
function CalculaMesesUso() {
|
||||||
|
$get("BtnCalculaMesesUso").click();
|
||||||
|
}
|
||||||
|
|
||||||
function GenerarRNC() {
|
function GenerarRNC() {
|
||||||
$('#BtnGenerarRNC').click();
|
$('#BtnGenerarRNC').click();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2420,6 +2420,7 @@ Partial Class Inventarios_RecepcionUsados
|
|||||||
CargaFolioAjuste()
|
CargaFolioAjuste()
|
||||||
CargaTipoDefecto()
|
CargaTipoDefecto()
|
||||||
CargaTipoDeUso()
|
CargaTipoDeUso()
|
||||||
|
TxtFechaAjuste.Attributes.Add("onchange", "CalculaMesesUso();")
|
||||||
TxtFechaAjuste.Text = Today.ToString("d")
|
TxtFechaAjuste.Text = Today.ToString("d")
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub CreaDTmpDTAjustes()
|
Private Sub CreaDTmpDTAjustes()
|
||||||
@@ -2489,7 +2490,7 @@ Partial Class Inventarios_RecepcionUsados
|
|||||||
If drPS IsNot Nothing Then
|
If drPS IsNot Nothing Then
|
||||||
PrecioSugerido = drPS("Precio").ToString.ToDecimal
|
PrecioSugerido = drPS("Precio").ToString.ToDecimal
|
||||||
End If
|
End If
|
||||||
|
txtPrecio.Text = PrecioSugerido.FormatoNumero(2)
|
||||||
TxtPUFactura.Text = PrecioSugerido.FormatoNumero(2)
|
TxtPUFactura.Text = PrecioSugerido.FormatoNumero(2)
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
@@ -2601,6 +2602,51 @@ Partial Class Inventarios_RecepcionUsados
|
|||||||
|
|
||||||
UpAjuste.Update()
|
UpAjuste.Update()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub BtnCalculaMesesUso_Click(sender As Object, e As EventArgs)
|
||||||
|
CalculaMesesUso()
|
||||||
|
End Sub
|
||||||
|
Protected Sub BtnCalcularImporteAjuste_Click(sender As Object, e As EventArgs)
|
||||||
|
CalculaPorcentajeAjuste()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub CalculaMesesUso()
|
||||||
|
Dim FechaI As Date = TxtFechaAjuste.Text.ToDate.AddDays(1)
|
||||||
|
Dim FechaF As Date = Now
|
||||||
|
Dim Dia As Integer = FechaI.Day
|
||||||
|
'validación adicional, para saber si el mes tiene 31 días y el actua es menor.
|
||||||
|
If FechaI.Day > Today.LastDayOfMonth.Day Then Dia = Today.LastDayOfMonth.Day
|
||||||
|
Dim FechaT As Date = String.Format("{0}/{1}/{2}", Dia, FechaF.Month, FechaF.Year).ToDate 'armo la fecha con el día del mes actual
|
||||||
|
|
||||||
|
Dim MesesTrascurridos As Integer = Math.Round(DateDiff(DateInterval.Day, FechaI, FechaT) / 30.4, 2).ToEntero 'saco los meses y lo redondeo
|
||||||
|
|
||||||
|
If FechaT > FechaF Then
|
||||||
|
'todavía está en el mes actual.
|
||||||
|
MesesTrascurridos = MesesTrascurridos
|
||||||
|
Else
|
||||||
|
MesesTrascurridos = MesesTrascurridos + 1
|
||||||
|
End If
|
||||||
|
TxtMesesUso.Text = MesesTrascurridos.ToString
|
||||||
|
CalculaPorcentajeAjuste()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub BtnAgregarProductoAjuste_Click(sender As Object, e As EventArgs)
|
||||||
|
Dim CvePS As Integer = DdlPSAjuste.SelectedValue.ToEntero
|
||||||
|
Dim ObjPS As New ClsProductosServicios
|
||||||
|
Dim CveTamaño As Integer = -1
|
||||||
|
If ObjPS.GetPS(CvePS, -1, UsuarioActual.CveEmpresa) Then
|
||||||
|
CveTamaño = ObjPS.DtResultados.FiltroPrimeroValor("CveTamaño").ToEntero
|
||||||
|
End If
|
||||||
|
Dim Datos As DataRow = GlobalDTAcumTamaños().FiltroPrimero(String.Format("CveTamaño = {0} AND CveEmpresa = {1}", CveTamaño, UsuarioActual.CveEmpresa))
|
||||||
|
|
||||||
|
Dim TamañoPS As DataRow
|
||||||
|
If ObjPS.GetPS(Datos.Item("CvePSCargo").ToString.ToEntero, -1, UsuarioActual.CveEmpresa) Then
|
||||||
|
TamañoPS = ObjPS.DtResultados.FiltroPrimero("")
|
||||||
|
End If
|
||||||
|
AddNew(TamañoPS.Item("CvePS").ToString.ToEntero, TamañoPS.Item("PSCodigo").ToString, TamañoPS.Item("CveUM").ToString.ToEntero, TamañoPS.Item("UnidadMedida").ToString, 1.0, TxtPUFactura.Text.ToDouble,
|
||||||
|
"", "-1", "-1", "-1", "", "", "", -1, "", "", -1)
|
||||||
|
ObjPS.Dispose()
|
||||||
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
Reference in New Issue
Block a user