Compras Local
This commit is contained in:
@@ -1045,7 +1045,7 @@
|
||||
<asp:Label Text="" ID="LbRetISROriginal" runat="server" />
|
||||
</td>
|
||||
<td>
|
||||
<asp:Label ID="LblRetISR" runat="server" BorderStyle="None" Text="0.00"></asp:Label>%
|
||||
<asp:Label ID="LblRetISR" runat="server" BorderStyle="None" Text="0.00"></asp:Label>
|
||||
</td>
|
||||
<td runat="server" id="TdRetISRConcepto" visible="false">
|
||||
<asp:DropDownList ID="DdlRetISRConcepto" AppendDataBoundItems="true" CssClass="select2me" Style="width: 100%;" runat="server"></asp:DropDownList>
|
||||
@@ -4429,7 +4429,7 @@
|
||||
<div class="row">
|
||||
<div class="col-md-6" id="divproyecto" runat="server">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlProyecto" CssClass=" form-control input-sm select2me" runat="server" Width="50%" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Proyecto" DataValueField="CveProyecto">
|
||||
<asp:DropDownList ID="DdlProyecto" CssClass=" form-control input-sm select2me" runat="server" Width="100%" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Proyecto" DataValueField="CveProyecto">
|
||||
<%--<asp:ListItem Selected="true" Text="Seleccione" Value="-1"></asp:ListItem>--%>
|
||||
</asp:DropDownList>
|
||||
<%-- <asp:RequiredFieldValidator runat="server" Enabled="true" Display="None" ID="RFVProyecto" ControlToValidate="DdlProyecto" InitialValue="-1" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Proyecto''</b> es necesario, por favor seleccione uno." ValidationGroup="GprAgregaPS"></asp:RequiredFieldValidator>
|
||||
@@ -4439,7 +4439,7 @@
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlSubProyecto" AutoPostBack="true" CssClass=" form-control input-sm select2me" runat="server" OnSelectedIndexChanged="DdlSubProyecto_SelectedIndexChanged" Width="50%" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto">
|
||||
<asp:DropDownList ID="DdlSubProyecto" AutoPostBack="true" CssClass=" form-control input-sm select2me" runat="server" OnSelectedIndexChanged="DdlSubProyecto_SelectedIndexChanged" Width="100%" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto">
|
||||
<asp:ListItem Selected="true" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<%--<asp:RequiredFieldValidator runat="server" Enabled="true" Display="None" ID="RFVSubProyecto" ControlToValidate="DdlSubProyecto" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''SubProyecto''</b> es necesario, por favor seleccione uno." ValidationGroup="GprAgregaPS"></asp:RequiredFieldValidator>
|
||||
@@ -4485,15 +4485,7 @@
|
||||
|
||||
<label for="<%= TxtDescuentoModal.ClientID.ToString()%>">Descuento:</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtOtrosGastos" ClientIDMode="Static" runat="server" CssClass=" form-control " Text="0" CausesValidation="true" MaxLength="12" ValidationGroup="GprAgregaPS"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="FTEOtrosGastos" runat="server" TargetControlID="TxtOtrosGastos" FilterType="Custom, Numbers" ValidChars="." />
|
||||
|
||||
<label for="<%= TxtOtrosGastos.ClientID.ToString()%>">Gastos:</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<asp:UpdatePanel ID="UpIVA" runat="server" UpdateMode="Conditional">
|
||||
@@ -4534,7 +4526,7 @@
|
||||
<label for="<%= TxtRetISRModal.ClientID.ToString()%>">% RetISR:</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="col-md-3" runat="server" id="divIEPSModal" visible="false">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtIEPSModal" ClientIDMode="Static" Enabled="false" runat="server" onkeyup="Recalcula();" CssClass=" form-control " CausesValidation="true" MaxLength="12" ValidationGroup="GprAgregaPS"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="FTBEIEPS" runat="server" TargetControlID="TxtIEPSModal" FilterType="Custom, Numbers" ValidChars="." />
|
||||
|
||||
@@ -1149,7 +1149,6 @@ Partial Class Compras_Compras
|
||||
End Set
|
||||
|
||||
End Property
|
||||
|
||||
Private Property UUIDSList As List(Of String)
|
||||
Get
|
||||
If ViewState("UUIDSList") Is Nothing Then
|
||||
@@ -1163,8 +1162,6 @@ Partial Class Compras_Compras
|
||||
ViewState("UUIDSList") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Private Property NumeroReembolsoOriginal As String
|
||||
Get
|
||||
If ViewState("NumeroReembolsoOriginal") Is Nothing Then
|
||||
@@ -1227,6 +1224,9 @@ Partial Class Compras_Compras
|
||||
If UsuarioActual.Empresa.Funcionalidad(117) <> "" Then
|
||||
btnProrateo.Visible = True
|
||||
End If
|
||||
If UsuarioActual.Empresa.Funcionalidad(713) = "1" Then
|
||||
divIEPSModal.Visible = True
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(303) <> "" Then
|
||||
btnProrateo2.Visible = True
|
||||
@@ -1911,16 +1911,6 @@ Partial Class Compras_Compras
|
||||
TxtSerie.Enabled = False
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") Then 'cuando es emp acumuladora
|
||||
divFolioGarantia.Visible = True
|
||||
Using objAcum As New ClsAcumuladores
|
||||
If objAcum.FoliosGarantiaGet(-1, UsuarioActual.Empresa.CveEmpresa, Estatus:=2, TipoFolio:="-1", Area:=-1, CveSubProyecto:=-1) Then
|
||||
DdlFolioGarantia.DataSource = objAcum.DtResultados.FiltraParametros("", "FechaIng DESC")
|
||||
DdlFolioGarantia.DataBind()
|
||||
End If
|
||||
End Using
|
||||
End If
|
||||
|
||||
'PERMISO PARA MODIFICACIÓN DE FECHA AUN CON FACTURA
|
||||
TxtFecha.Enabled = UsuarioActual.TienePermisoProceso(216)
|
||||
ImgFecha.Enabled = UsuarioActual.TienePermisoProceso(216)
|
||||
@@ -2354,7 +2344,7 @@ Partial Class Compras_Compras
|
||||
|
||||
If OtrosImpuestos > 0 Or TrasladoIEPS > 0 Then
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(713).ToEntero = 1 Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(713) = "1" Then
|
||||
'Si tiene funcionalidad y es Acreedor se muestra modal
|
||||
If CveTipoProveedor.Contiene(2, 3) Then ' Acreedor
|
||||
RegistraScript("$('#ModalIEPS').modal({ backdrop: 'static', keyboard: false },'show');")
|
||||
@@ -2426,8 +2416,8 @@ Partial Class Compras_Compras
|
||||
HdnCompraSaldo.Value = TotalTemp.ToString
|
||||
CompraSaldo = TotalTemp
|
||||
|
||||
LblRetIVA.Text = If(RetIVATemp > 0, (TmpDT.MAX("RetIVAPorcentaje").ToDecimal() * 100).FormatoNumero(3), "")
|
||||
LblRetISR.Text = If(RetISRTemp > 0, (TmpDT.MAX("RetISRPorcentaje").ToDecimal() * 100).FormatoNumero(3), "")
|
||||
LblRetIVA.Text = If(RetIVATemp > 0, (TmpDT.MAX("RetIVAPorcentaje").ToDecimal() * 100).FormatoNumero(4), "")
|
||||
LblRetISR.Text = If(RetISRTemp > 0, (TmpDT.MAX("RetISRPorcentaje").ToDecimal() * 100).FormatoNumero(4), "")
|
||||
|
||||
'ASIGNA VALORES ORIGINALES PARA GUARDAR
|
||||
AsignaValoresOriginales(SubtotalTemp, Subtotal2Temp, IVATemp, RetIVATemp, RetISRTemp, Total)
|
||||
@@ -2636,8 +2626,8 @@ Partial Class Compras_Compras
|
||||
LblUsuarioCaptura.Text = dr("Usuario").ToString
|
||||
LitFechCaptura.Text = dr("FechaIng").ToString.ToDate.ToShortDateString
|
||||
LitFechCaptura.ToolTip = dr("FechaIng").ToString
|
||||
LblRetIVA.Text = If(dr("RetIVA").ToString.ToDecimal > 0, TmpDT.MAX("RetIVAPorcentaje").ToDecimal * 100, 0).ToString.FormatoNumero(3) '(If(SubTotal2 > 0, (RetencionIVA / SubTotal2), 0) * 100).FormatoNumero(3) + "%"
|
||||
LblRetISR.Text = If(dr("RetISR").ToString.ToDecimal > 0, TmpDT.MAX("RetISRPorcentaje").ToDecimal * 100, 0).ToString.FormatoNumero(3) '(If(SubTotal2 > 0, (RetencionISR / SubTotal2), 0) * 100).FormatoNumero(3)
|
||||
LblRetIVA.Text = If(dr("RetIVA").ToString.ToDecimal > 0, TmpDT.MAX("RetIVAPorcentaje").ToDecimal * 100, 0).ToString.FormatoNumero(4) '(If(SubTotal2 > 0, (RetencionIVA / SubTotal2), 0) * 100).FormatoNumero(3) + "%"
|
||||
LblRetISR.Text = If(dr("RetISR").ToString.ToDecimal > 0, TmpDT.MAX("RetISRPorcentaje").ToDecimal * 100, 0).ToString.FormatoNumero(4) '(If(SubTotal2 > 0, (RetencionISR / SubTotal2), 0) * 100).FormatoNumero(3)
|
||||
If dr("TipoFactura").ToString <> "CFDi" Then LblTipoFact.Text = dr("TipoFactura").ToString : divTipoFactura.Visible = True
|
||||
ViewState("CveFactura") = dr("CveFactura").ToString.ToEntero
|
||||
ViewState("IdPoliza") = dr("IdPoliza").ToString.ToEntero
|
||||
@@ -4111,7 +4101,6 @@ Partial Class Compras_Compras
|
||||
Alert("Falta asignar Proyecto a la compra", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
|
||||
If Not ValidaVinculacionNotaFactura() Then
|
||||
Alert("Se requiere que la nota este aplciada a las facturas", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
@@ -4530,6 +4519,13 @@ Partial Class Compras_Compras
|
||||
UM.Dispose()
|
||||
PSS.Dispose()
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso DdlTipoCompra.SelectedValue = "12" Then 'cuando es garantía, debe de especificar la salida de almacen
|
||||
If Not GvInv.HeaderRow.FCCheckBox("cbAll").Checked OrElse GvInv.HeaderRow.FCDropDownList("ddlAlmacen").SelectedValue.ToEntero <= 0 Then
|
||||
Alert("No ha especificado la salida de almacen en la garantía.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
'VALIDA IMPORTES
|
||||
If Not ValidaTotalesGuardar() Then
|
||||
Exit Sub
|
||||
@@ -4551,9 +4547,9 @@ Partial Class Compras_Compras
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If DdlFolioGarantia.Visible AndAlso DdlFolioGarantia.SelectedValue <> "-1" Then
|
||||
If Not ValidaFolioGarantia() Then Exit Sub
|
||||
End If
|
||||
'If DdlFolioGarantia.Visible AndAlso DdlFolioGarantia.SelectedValue <> "-1" Then
|
||||
' If Not ValidaFolioGarantia() Then Exit Sub
|
||||
'End If
|
||||
|
||||
|
||||
'------------------TERMINA VALIDACIONES------------------
|
||||
@@ -5462,10 +5458,12 @@ Partial Class Compras_Compras
|
||||
Dim ListAlmacenes = (From CveAlmacen In DtInv.AsEnumerable() Where CveAlmacen.Field(Of Integer)("CveAlmacen") > 0 Select CveAlmacen.Field(Of Integer)("CveAlmacen")).Distinct().ToList
|
||||
Dim indice = 0
|
||||
Dim ImporteConcepto As Decimal = 0
|
||||
Dim tCveFolioGarantia As Integer = -1
|
||||
Dim CveConceptoMovimiento As Integer = 2
|
||||
'apoyo logistico/garantia
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") AndAlso DdlTipoCompra.SelectedValue = "12" Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") AndAlso DdlTipoCompra.SelectedValue = "12" Then 'garantía
|
||||
CveConceptoMovimiento = 13
|
||||
tCveFolioGarantia = DdlFolioGarantia.SelectedValue.ToEntero
|
||||
End If
|
||||
If (DdlTipoComprobante.SelectedValue = "Fac" AndAlso CveCompraRefacturacion <= 0) OrElse CveConceptoMovimiento = 13 Then
|
||||
|
||||
@@ -5478,7 +5476,7 @@ Partial Class Compras_Compras
|
||||
Dim fecha As Date = TxtFecha.Text.ToDate
|
||||
If Not UsuarioActual.Empresa.UsaAC Then fecha = Now
|
||||
|
||||
CveMovimientoInventario = ObjInventario.AddMovimiento(tCveAlmacen, CveConceptoMovimiento, 1, fecha, 0, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompra, -1, -1, -1, TipoCambio:=If(DdlMoneda.SelectedValue.ToEntero = 1, -1, TipoCambioGuardar), Modulo:="Comp/G2")
|
||||
CveMovimientoInventario = ObjInventario.AddMovimiento(tCveAlmacen, CveConceptoMovimiento, 1, fecha, 0, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompra, -1, -1, -1, TipoCambio:=If(DdlMoneda.SelectedValue.ToEntero = 1, -1, TipoCambioGuardar), CveFolioGarantia:=tCveFolioGarantia, Modulo:="Comp/G2")
|
||||
|
||||
If CveMovimientoInventario <= 0 Then
|
||||
ErrorMovInv = True
|
||||
@@ -10563,7 +10561,7 @@ Partial Class Compras_Compras
|
||||
TxtPrecio.Attributes.Add("onKeyUp ", "Recalcula();")
|
||||
TxtCantidad.Attributes.Add("onKeyUp ", "Recalcula();")
|
||||
TxtDescuentoModal.Attributes.Add("onKeyUp ", "Recalcula();")
|
||||
TxtOtrosGastos.Attributes.Add("onKeyUp ", "Recalcula();")
|
||||
|
||||
'ImgAmort.Attributes.Add("onclick", "javascript:$('#DivDescP').show(1000); PosicionaObjeto(this.id,'DivDescP');") ' $get('LblTitulo1').style.display = 'none'; $get('LblTituloTipo1').style.display = 'none'; $get('LblTituloTipo2').style.display = ''; $get('LblPrecio1').style.display = 'none'; $get('LblTotalPS1').style.display = 'none'; $get('LblSubTotal1').style.display = 'none'; $get('LblAmort').style.display = ''; $get('BtnAplicarDescP').style.display = 'none'; $get('BtnAplicarDescG').style.display = ''; $get('TrMotivoDescuento').style.display = 'none';")
|
||||
|
||||
'If um.GetUnidadesMedida() Then
|
||||
@@ -13500,18 +13498,6 @@ Partial Class Compras_Compras
|
||||
Dim IdPolizaAnterior = -1
|
||||
Dim TotalRefact As Decimal = 0
|
||||
|
||||
'SI NO TIENE POLIZA NI PAGOS NO HACE NADA
|
||||
'If ObjCompra.GetCompras(CveCompraRefacturacion, "-1", "-1", -1, -1, UsuarioActual.CveEmpresa) Then
|
||||
' If ObjCompra.DtResultados IsNot Nothing AndAlso ObjCompra.DtResultados.Rows.Count = 1 Then
|
||||
' Dim drc As DataRow = ObjCompra.DtResultados.Rows(0)
|
||||
' TotalRefact = drc("Total").ToString.ToDecimal
|
||||
' If drc("IdPoliza").ToString.ToEntero <= 0 AndAlso drc("Saldo").ToString.ToDecimal = drc("Total").ToString.ToDecimal AndAlso drc("CveMovimiento").ToString.ToEntero <= 0 Then
|
||||
' Alert("La factura a refacturar no esta contabilizada ni tiene pagos ni movimientos de almacen. No se puede refacturar, debera eliminar la factura anterior y agregar esta factura de forma normal.", TipoMensaje.MsgAdvertencia)
|
||||
' Return True
|
||||
' End If
|
||||
' End If
|
||||
'End If
|
||||
|
||||
'GUARDA ADJUNTOS Y LIGA EN BITACORA (RELACION DE FACTURA NUEVA Y VIEJA)
|
||||
ErrorBitacora = GuardaRefacturacionBitacora(ObjCompra, ObjEventos)
|
||||
|
||||
@@ -16300,8 +16286,8 @@ Partial Class Compras_Compras
|
||||
UpAnticipos.Update()
|
||||
End If
|
||||
|
||||
LblRetIVA.Text = TmpDT.MAX("RetIVAPorcentaje").ToString '(If(SubTotal2 > 0, (RetencionIVA / SubTotal2), 0) * 100).FormatoNumero(3) + "%"
|
||||
LblRetISR.Text = TmpDT.MAX("RetISRPorcentaje").ToString '(If(SubTotal2 > 0, (RetencionISR / SubTotal2), 0) * 100).FormatoNumero(3)
|
||||
LblRetIVA.Text = If(TxtRetIVA.Text.ToDecimal > 0, (TmpDT.MAX("RetIVAPorcentaje").ToDecimal() * 100).FormatoNumero(4), "")
|
||||
LblRetISR.Text = If(TxtRetISR.Text.ToDecimal > 0, (TmpDT.MAX("RetISRPorcentaje").ToDecimal() * 100).FormatoNumero(4), "")
|
||||
|
||||
'IMPORTES DE RESTRICCION
|
||||
TxtDocumentoImporteFE.Text = Total.ToString.FormatoNumero(2)
|
||||
@@ -16583,7 +16569,6 @@ Partial Class Compras_Compras
|
||||
TxtRetISRModal.Text = ""
|
||||
TxtIEPSModal.Text = ""
|
||||
TxtDescuentoModal.Text = ""
|
||||
TxtOtrosGastos.Text = ""
|
||||
|
||||
DivAddProductoAliasPS.Visible = False
|
||||
|
||||
@@ -16656,12 +16641,7 @@ Partial Class Compras_Compras
|
||||
DdlProyecto.SelectedValueExist("-1")
|
||||
End If
|
||||
|
||||
|
||||
CargaSubProyecto()
|
||||
|
||||
|
||||
'DdlProyecto.SelectedValueExist(GvRow.DataKey("CveProyecto"))
|
||||
|
||||
DdlSubProyecto.SelectedValueExist(GvRow.DataKey("CveSubProyecto"))
|
||||
|
||||
DdlSubProyecto_SelectedIndexChanged(Nothing, Nothing)
|
||||
@@ -16676,7 +16656,6 @@ Partial Class Compras_Compras
|
||||
If PS("IVA").ToString.ToEntero() <> -1 Then
|
||||
' DdlIVA.Enabled = False
|
||||
Else
|
||||
|
||||
'DdlIVA.Enabled = If(CveCompra > 0 Or CveFactura > 0 Or OCVinculada, False, True)
|
||||
End If
|
||||
End If
|
||||
@@ -16703,12 +16682,8 @@ Partial Class Compras_Compras
|
||||
ViewState("RetIVA") = GvRow.DataKey("RetIVAPorcentaje").ToDouble
|
||||
ViewState("RetISR") = GvRow.DataKey("RetISRPorcentaje").ToDouble
|
||||
|
||||
'TxtRetIVAModal.Text = FormatoNumero(ViewState("RetIVA").ToString().ToDouble * 100, 0)
|
||||
'TxtRetISRModal.Text = FormatoNumero(ViewState("RetISR").ToString().ToDouble * 100, 0)
|
||||
|
||||
TxtPrecio.Text = GvRow.DataKey("PU").FormatoNumero(6)
|
||||
TxtDescuentoModal.Text = GvRow.DataKey("Descuento").FormatoNumero(6)
|
||||
TxtOtrosGastos.Text = GvRow.DataKey("OtrosGastos").FormatoNumero
|
||||
TxtPrecio.Text = GvRow.DataKey("PU").ToDecimal.ToString("#,##0.00####")
|
||||
TxtDescuentoModal.Text = GvRow.DataKey("Descuento").ToDecimal.ToString("#,##0.00####")
|
||||
LblTotalPS.Text = GvRow.DataKey("Total").FormatoNumero
|
||||
|
||||
'FUNCIONALIDAD DE SEGUIR AGREGANDO (NO CERRAR MODAL)
|
||||
@@ -17002,7 +16977,7 @@ Partial Class Compras_Compras
|
||||
End Select
|
||||
|
||||
|
||||
Dim Total As Decimal = (TxtCantidad.Text.ToDecimal * TxtPrecio.Text.ToDecimal) - TxtDescuentoModal.Text.ToDecimal + TxtOtrosGastos.Text.ToDecimal
|
||||
Dim Total As Decimal = (TxtCantidad.Text.ToDecimal * TxtPrecio.Text.ToDecimal) - TxtDescuentoModal.Text.ToDecimal
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(532) = "1" Then
|
||||
Dim ObjCon As New ClsContratos
|
||||
@@ -17129,7 +17104,7 @@ Partial Class Compras_Compras
|
||||
End If
|
||||
AddPS(TxtCantidad.Text.Trim.ToDecimal, ddlUM.SelectedValue.ToEntero, ddlUM.SelectedItem.Text, DdlClasificacion.SelectedValue.ToEntero, DdlClasificacion.SelectedItem.Text, DdlPS.SelectedValue.ToEntero, DdlPS.SelectedText, HdnTipoPS.Value.ToEntero,
|
||||
DdlSubProyecto.SelectedValue.ToString, DdlSubProyecto.SelectedItem.Text, DdlProyecto.SelectedItem.Text, DdlProyecto.SelectedValue.ToString, TxtObsPS.Text.Trim, TxtPrecio.Text.Trim.ToDecimal, Total, IVA,
|
||||
TxtRetIVAModal.Text.ToDecimal / 100, TxtRetISRModal.Text.ToDecimal / 100, TxtIEPSModal.Text.ToDecimal / 100, 0, TxtDescuentoModal.Text.ToDecimal, OtrosGastos:=TxtOtrosGastos.Text.ToDecimal, CveTipoGasto:=DdlTipoGasto.SelectedValue.ToEntero, TipoGasto:=DdlTipoGasto.SelectedItem.Text,
|
||||
TxtRetIVAModal.Text.ToDecimal / 100, TxtRetISRModal.Text.ToDecimal / 100, TxtIEPSModal.Text.ToDecimal / 100, 0, TxtDescuentoModal.Text.ToDecimal, OtrosGastos:=0, CveTipoGasto:=DdlTipoGasto.SelectedValue.ToEntero, TipoGasto:=DdlTipoGasto.SelectedItem.Text,
|
||||
NoDeducible:=ChkEsNoDeduciblePS.Checked, CveSATPS:=SATClavePS, CveContratoDetalle:=CveContratoDetalle,
|
||||
CveCultivoCuadroDetalle:=If(DdlCultivosCuadro.SelectedValue.ToEntero > 0, DdlCultivosCuadro.SelectedValue.ToEntero, -1), TemporadaCuadro:=If(DdlCultivosCuadro.SelectedValue.ToEntero > 0, DdlCultivosCuadro.SelectedItem.Text, ""))
|
||||
|
||||
@@ -17232,6 +17207,9 @@ Partial Class Compras_Compras
|
||||
If DrPS IsNot Nothing Then
|
||||
Row("PSCodigo") = If(PSCodigo = "", DrPS("PSCodigo").ToString, PSCodigo)
|
||||
Row("CveMetodoInventario") = DrPS("Inv_CveMetodoInventario").ToString.ToEntero
|
||||
If DdlTipoCompra.SelectedValue = "12" AndAlso DrPS("AplicaSerie").ToString = "True" Then
|
||||
Row("CveMetodoInventario") = "1"
|
||||
End If
|
||||
Else
|
||||
Row("PSCodigo") = PSCodigo
|
||||
Row("CveMetodoInventario") = 0
|
||||
@@ -17278,8 +17256,6 @@ Partial Class Compras_Compras
|
||||
|
||||
End Try
|
||||
|
||||
|
||||
|
||||
Dim DecimalesPermitidos = 6
|
||||
|
||||
Row("CveConcepto") = TmpDT.Rows.Count + 1
|
||||
@@ -17323,8 +17299,6 @@ Partial Class Compras_Compras
|
||||
Row("IVAPorcentaje") = PorcentajeIVA
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Row("RetIVA") = Math.Round(RetIVA, DecimalesPermitidos)
|
||||
Row("RetIVAPorcentaje") = PorcentajeRetIVA
|
||||
Row("RetISR") = Math.Round(RetISR, DecimalesPermitidos)
|
||||
@@ -17441,8 +17415,7 @@ Partial Class Compras_Compras
|
||||
Dim Cantidad = DrPS("Cantidad").ToString.ToDouble
|
||||
Dim PU = DrPS("PU").ToString.ToDouble
|
||||
Dim Descuento = DrPS("Descuento").ToString.ToDouble
|
||||
Dim OtrosGastos = DrPS("OtrosGastos").ToString.ToDouble
|
||||
Dim Total = (Cantidad * PU) - Descuento + OtrosGastos
|
||||
Dim Total = (Cantidad * PU) - Descuento
|
||||
DrPS("NoDeducible") = ChkEsNoDeduciblePS.Checked
|
||||
|
||||
Dim ActualizarIva As Boolean = False
|
||||
@@ -17450,25 +17423,20 @@ Partial Class Compras_Compras
|
||||
ActualizarIva = True
|
||||
End If
|
||||
|
||||
|
||||
If Cantidad <> TxtCantidad.Text.Trim.ToDouble OrElse PU <> TxtPrecio.Text.Trim.ToDouble OrElse Descuento <> TxtDescuentoModal.Text.ToDouble OrElse OtrosGastos <> TxtOtrosGastos.Text.ToDouble Then
|
||||
If Cantidad <> TxtCantidad.Text.Trim.ToDouble OrElse PU <> TxtPrecio.Text.Trim.ToDouble OrElse Descuento <> TxtDescuentoModal.Text.ToDouble Then
|
||||
Cantidad = TxtCantidad.Text.Trim.ToDouble
|
||||
PU = TxtPrecio.Text.Trim.ToDouble
|
||||
Descuento = TxtDescuentoModal.Text.ToDouble
|
||||
OtrosGastos = TxtOtrosGastos.Text.ToDouble
|
||||
Total = (Cantidad * PU) - Descuento + OtrosGastos
|
||||
Total = (Cantidad * PU) - Descuento
|
||||
DrPS("Cantidad") = Cantidad
|
||||
DrPS("PU") = PU
|
||||
DrPS("Descuento") = Descuento
|
||||
DrPS("OtrosGastos") = OtrosGastos
|
||||
DrPS("OtrosGastos") = 0
|
||||
DrPS("Total") = Total
|
||||
AplicaCalculaTotales = True
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
'PS - CLASIFICACION
|
||||
If DdlPS.SelectedValue.ToEntero > 0 Then
|
||||
|
||||
@@ -17547,10 +17515,6 @@ Partial Class Compras_Compras
|
||||
DrPS("CveCultivoCuadroDetalle") = If(DdlCultivosCuadro.SelectedValue.ToEntero > 0, DdlCultivosCuadro.SelectedValue.ToEntero, -1)
|
||||
DrPS("TemporadaCuadro") = If(DdlCultivosCuadro.SelectedValue.ToEntero > 0, DdlCultivosCuadro.SelectedItem.Text, "")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
'Esta parte es para validar cuando la factura tenga ieps en o se asignara el ieps como una partida ya no se considere
|
||||
If (CveFactura > 0 Or CveCompra > 0) And TxtIEPS.Text.ToDecimal = 0 Then
|
||||
DrPS("IEPSPS") = 0
|
||||
@@ -19517,6 +19481,17 @@ Partial Class Compras_Compras
|
||||
Protected Sub DdlTipoCompra_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
|
||||
If DdlTipoCompra.SelectedValue.ToEntero.Contiene(9, 10, 12) Then 'Al seleccionar apoyo logístico se cargan los amancenes de devoculcion proveedor para dar entrada
|
||||
|
||||
If DdlTipoCompra.SelectedValue = "12" AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") Then 'cuando es emp acumuladora
|
||||
divFolioGarantia.Visible = True
|
||||
Using objAcum As New ClsAcumuladores
|
||||
If objAcum.FoliosGarantiaGet(-1, UsuarioActual.Empresa.CveEmpresa, Estatus:=2, TipoFolio:="-1", Area:=-1, CveSubProyecto:=-1) Then
|
||||
DdlFolioGarantia.DataSource = objAcum.DtResultados.FiltraParametros("", "FechaIng DESC")
|
||||
DdlFolioGarantia.DataBind()
|
||||
End If
|
||||
End Using
|
||||
End If
|
||||
|
||||
'cambia si hay ps con uso de serie
|
||||
For Each dr As DataRow In TmpDT.Rows
|
||||
dr("CveMetodoInventario") = 1
|
||||
@@ -19547,6 +19522,8 @@ Partial Class Compras_Compras
|
||||
Dim ExistenciasPSGarantia As New Dictionary(Of Integer, Decimal)
|
||||
Dim PSFaltantes As New Dictionary(Of Integer, Decimal)
|
||||
Dim DtGarantia As New DataTable
|
||||
TxtDescripcion.Text = DdlFolioGarantia.SelectedItem.Text
|
||||
UpParametros.Update()
|
||||
|
||||
'Agrupa los CvePS iguales y suma sus cantidades
|
||||
For Each row In TmpDT.AsEnumerable()
|
||||
@@ -19564,7 +19541,7 @@ Partial Class Compras_Compras
|
||||
DtGarantia = ObjAcum.DtResultados
|
||||
ExistenciasPSGarantia = DtGarantia.AsEnumerable().ToDictionary(Function(row) row.Field(Of Integer)("CvePS"), Function(row) row.Field(Of Decimal)("CantidadDisponible"))
|
||||
Else
|
||||
Alert($"Ocurrió un error al obtener la información de la garantía.</br> CveUsuario={UsuarioActual.CveUsuario}</br> CveFolioGarantia={DdlFolioGarantia.SelectedValue}", TipoMensaje.MsgError)
|
||||
Alert($"Ocurrió un error al obtener la información de la garantía.</br> CveU={UsuarioActual.CveUsuario}</br> CveFG={DdlFolioGarantia.SelectedValue}", TipoMensaje.MsgError)
|
||||
Return False
|
||||
End If
|
||||
End Using
|
||||
@@ -19587,13 +19564,34 @@ Partial Class Compras_Compras
|
||||
Select New With {.CvePS = Producto.Key, .NombrePS = row.Field(Of String)("PS"), .CantidadFaltante = Producto.Value}
|
||||
|
||||
If PSFaltantes.Count > 0 Then
|
||||
Dim mensaje As String = "Los siguientes productos no tienen suficientes existencias en la garantía seleccionada:</br></br>"
|
||||
Dim mensaje As String = "Los siguientes productos no fueron registrados en la garantía seleccionada:</br></br>"
|
||||
|
||||
For Each Producto In IEnumPSFaltantes
|
||||
mensaje += $"Falta: × <b>{Producto.CantidadFaltante:0.##}</b> {Producto.NombrePS}</br>"
|
||||
Next
|
||||
'eliminar los registros
|
||||
Dim tImporteAjuste As Decimal = 0
|
||||
Dim PSS = (From c In IEnumPSFaltantes Select c.CvePS).Distinct.ToList
|
||||
For Each Producto In PSS
|
||||
Dim drr As DataRow() = TmpDT.Select($"CvePS = {Producto}")
|
||||
For Each drt As DataRow In drr
|
||||
If TmpDT.Rows.Count > 1 Then 'valida que exista cuando menos un registro
|
||||
tImporteAjuste += drt("Total").ToString.ToDecimal
|
||||
TmpDT.Rows.Remove(drt)
|
||||
End If
|
||||
Next
|
||||
TmpDT.AcceptChanges()
|
||||
Next
|
||||
If tImporteAjuste > 0 Then AjustaImporteUltimoConcepto(tImporteAjuste)
|
||||
GvPS.DataSource = TmpDT
|
||||
GvPS.DataBind()
|
||||
|
||||
CalculaTotales(True)
|
||||
CargaGvInv()
|
||||
|
||||
If MsgExito Then Alert(mensaje, TipoMensaje.MsgAdvertencia) Else Alert(mensaje, TipoMensaje.MsgError)
|
||||
Else
|
||||
If MsgExito Then Alert("Todos los productos seleccionados están disponibles en el Folio de Garantía.")
|
||||
If MsgExito Then Alert("Todos los productos seleccionados están registrados en el Folio de Garantía.")
|
||||
Return True
|
||||
End If
|
||||
Else
|
||||
@@ -20251,10 +20249,8 @@ Partial Class Compras_Compras
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub BtnFolioGarantiaRestantes_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Using ObjAcum As New ClsAcumuladores
|
||||
@@ -20339,8 +20335,6 @@ Partial Class Compras_Compras
|
||||
ErrorCompra = True
|
||||
Exit For
|
||||
End If
|
||||
|
||||
|
||||
Next
|
||||
|
||||
End If
|
||||
@@ -20351,36 +20345,20 @@ Partial Class Compras_Compras
|
||||
|
||||
Dim SBEliminacionCompra As New StringBuilder
|
||||
|
||||
|
||||
SBEliminacionCompra.Append($"Serie-Folio: {TxtSerie.Text}-{TxtFolio.Text}, Proveedor: {HplProveedor.Text}, Descripción: {TxtDescripcion.Text}, SubTotal: {TxtSubTotal2.Text}, ")
|
||||
|
||||
If TxtIVA.Text.Trim.ToDecimal > 0 Then
|
||||
SBEliminacionCompra.Append($"IVA: { TxtIVA.Text},")
|
||||
End If
|
||||
If TxtIVA.Text.Trim.ToDecimal > 0 Then SBEliminacionCompra.Append($"IVA: { TxtIVA.Text},")
|
||||
|
||||
If TxtRetISR.Text.Trim.ToDecimal > 0 Then SBEliminacionCompra.Append($"Ret. ISR: { TxtRetISR.Text}, ")
|
||||
|
||||
If TxtRetISR.Text.Trim.ToDecimal > 0 Then
|
||||
SBEliminacionCompra.Append($"Ret. ISR: { TxtRetISR.Text}, ")
|
||||
End If
|
||||
|
||||
If TxtRetIVA.Text.Trim.ToDecimal > 0 Then
|
||||
SBEliminacionCompra.Append($"Ret. IVA: { TxtRetIVA.Text}, ")
|
||||
End If
|
||||
|
||||
If TxtIEPS.Text.Trim.ToDecimal > 0 Then
|
||||
SBEliminacionCompra.Append($"IEPS: { TxtIEPS.Text}, ")
|
||||
End If
|
||||
If TxtRetIVA.Text.Trim.ToDecimal > 0 Then SBEliminacionCompra.Append($"Ret. IVA: { TxtRetIVA.Text}, ")
|
||||
|
||||
If TxtIEPS.Text.Trim.ToDecimal > 0 Then SBEliminacionCompra.Append($"IEPS: { TxtIEPS.Text}, ")
|
||||
|
||||
SBEliminacionCompra.Append($"Total: {TxtTotal.Text}, ")
|
||||
|
||||
|
||||
SBEliminacionCompra.Append($"Moneda: {DdlMoneda.SelectedItem.Text}, ")
|
||||
|
||||
If TxtOC.Text.Trim.Length > 0 Then
|
||||
SBEliminacionCompra.Append($"OC: {TxtOC.Text }, ")
|
||||
End If
|
||||
|
||||
If TxtOC.Text.Trim.Length > 0 Then SBEliminacionCompra.Append($"OC: {TxtOC.Text }, ")
|
||||
|
||||
SBEliminacionCompra.Append($"Fecha {TxtFecha.Text}, ")
|
||||
SBEliminacionCompra.Append($"Capturó: {LblUsuarioCaptura.Text}, ")
|
||||
@@ -20394,7 +20372,6 @@ Partial Class Compras_Compras
|
||||
If Not ObjGral.AddHistorialBitacora(Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, CveCompra, Nothing, "", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1,
|
||||
TxtModalEliminarCompraDescripcion.Text, "Compras", SBEliminacionCompra.ToString) Then
|
||||
ErrorCompra = True
|
||||
|
||||
End If
|
||||
|
||||
If Not ErrorCompra Then
|
||||
|
||||
@@ -13,7 +13,6 @@ Imports Stimulsoft.Report.Web
|
||||
Partial Class PopUpVerFactura
|
||||
Inherits ClsPaginas
|
||||
|
||||
Private Shared missing As Object = System.Reflection.Missing.Value
|
||||
|
||||
#Region " PROPIEDADES "
|
||||
Public Property DtMovimientos() As DataTable
|
||||
@@ -6818,6 +6817,7 @@ Partial Class PopUpVerFactura
|
||||
Dim DtDetalle As New DataTable
|
||||
Dim CveTipoPolizaImp As Integer
|
||||
Dim FolioPoliza As String
|
||||
Dim Fecha As Date
|
||||
Dim ConceptoPolizaImp As String
|
||||
Dim CveMonedaImp As Integer
|
||||
Dim TipoPolImp As String
|
||||
@@ -6828,6 +6828,7 @@ Partial Class PopUpVerFactura
|
||||
CveTipoPolizaImp = drp("CveTipoPoliza").ToString.ToEntero
|
||||
ConceptoPolizaImp = drp("Concepto").ToString
|
||||
FolioPoliza = drp("FolioPoliza").ToString
|
||||
Fecha = drp("Fecha").ToString.ToDate
|
||||
CveMonedaImp = drp("CveMoneda").ToString.ToEntero
|
||||
Dim TipoPolizaString As String = If(CveTipoPolizaImp = 1, "I", If(CveTipoPolizaImp = 2, "E", "D")).ToString
|
||||
|
||||
@@ -6856,35 +6857,37 @@ Partial Class PopUpVerFactura
|
||||
ObjConta.Dispose()
|
||||
Else
|
||||
RutaReporte = RutaFormatoReporte("Polizas.rdlc")
|
||||
'If ObjConta.GetPrePolizasImpresion(UsuarioActual.CveEmpresa, Fecha, Fecha, CVePrePoliza:=CvePrePoliza) Then
|
||||
If ObjConta.GetPrePolizasDetalle(CvePrePoliza, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then
|
||||
|
||||
Dim dr As DataRow
|
||||
'DtDetalle = ObjConta.DtResultados
|
||||
'Dim dr As DataRow
|
||||
DtDetalle = ObjConta.DtResultados.FiltraParametros("Contabilizable = 1", "Orden")
|
||||
dr = DtDetalle.Rows(0)
|
||||
'dr = DtDetalle.Rows(0)
|
||||
|
||||
params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
|
||||
params.Add(New ReportParameter("TipoPoliza", dr("TipoPoliza").ToString))
|
||||
params.Add(New ReportParameter("Finicio", dr("Fecha").ToString.ToDate.ToShortDateString))
|
||||
params.Add(New ReportParameter("FFin", dr("Fecha").ToString.ToDate.ToShortDateString))
|
||||
params.Add(New ReportParameter("Numero", dr("FolioPoliza").ToString))
|
||||
params.Add(New ReportParameter("TipoPoliza", TipoPolImp))
|
||||
params.Add(New ReportParameter("Finicio", Fecha.ToShortDateString))
|
||||
params.Add(New ReportParameter("FFin", Fecha.ToShortDateString))
|
||||
params.Add(New ReportParameter("Numero", FolioPoliza))
|
||||
params.Add(New ReportParameter("Moneda", If(CveMonedaImp = 2, "Dolar", "Peso Mexicano")))
|
||||
params.Add(New ReportParameter("CodigoPostal", ""))
|
||||
If UsuarioActual.CveEmpresa.Contiene(141) Then
|
||||
params.Add(New ReportParameter("Fecha", dr("Fecha").ToString.ToDate.ToString("dd/MM/yyyy hh:mm:ss")))
|
||||
params.Add(New ReportParameter("Fecha", Fecha.ToString("dd/MM/yyyy hh:mm:ss")))
|
||||
Else
|
||||
params.Add(New ReportParameter("Fecha", dr("Fecha").ToString.ToDate.ToShortDateString))
|
||||
params.Add(New ReportParameter("Fecha", Fecha.ToShortDateString))
|
||||
End If
|
||||
If UsuarioActual.CveEmpresa.Contiene(119, 141) Then
|
||||
params.Add(New ReportParameter("UsuarioRegistro", GlobalDTUsuarios(dr("CveUsuario").ToString.ToEntero).FiltroPrimeroValor("Nombre")))
|
||||
params.Add(New ReportParameter("UsuarioRegistro", GlobalDTUsuarios(drp("CveUsuario").ToString.ToEntero).FiltroPrimeroValor("Nombre")))
|
||||
End If
|
||||
If UsuarioActual.CveEmpresa.Contiene(140, 141) Then
|
||||
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
|
||||
End If
|
||||
End If
|
||||
ObjConta.Dispose()
|
||||
End If
|
||||
End If
|
||||
|
||||
ImprimirPDF(RutaReporte, DtDetalle, params, $"P{TipoPolizaString}{FolioPoliza}", Formato:="PDF")
|
||||
ImprimirPDF(RutaReporte, DtDetalle, params, $"P{TipoPolizaString}{FolioPoliza}", Formato:="PDF")
|
||||
|
||||
Else
|
||||
Alert("El documento solicitado no existe, favor de revisar su búsqueda.", TipoMensaje.MsgAdvertencia)
|
||||
|
||||
Reference in New Issue
Block a user