Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -744,6 +744,10 @@ Partial Class Compras_Compras
|
||||
End Property
|
||||
Private Property CveCompraRefacturacion As Integer
|
||||
Get
|
||||
If ViewState("CveCompraRefacturacion") Is Nothing Then
|
||||
ViewState("CveCompraRefacturacion") = -1
|
||||
End If
|
||||
|
||||
Return ViewState("CveCompraRefacturacion").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
@@ -4305,10 +4309,18 @@ Partial Class Compras_Compras
|
||||
x = x + 1
|
||||
End If
|
||||
Next
|
||||
If x = 0 AndAlso GvInv.Rows.Count > 0 Then
|
||||
Alert("Favor de seleccionar un producto en la pestaña de almacen", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
|
||||
If Not (CveCompraRefacturacion > 0 AndAlso ChkRefacturacionConAlmacen.Checked) Then
|
||||
|
||||
If x = 0 AndAlso GvInv.Rows.Count > 0 Then
|
||||
Alert("Favor de seleccionar un producto en la pestaña de almacen", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -9238,8 +9250,7 @@ Partial Class Compras_Compras
|
||||
tipoCambioPago = 1
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Dim DtPrePolizas As DataTable = Nothing
|
||||
|
||||
If ObjConta.GetPlantillaConceptos(UsuarioActual.CveEmpresa, CvePlantillaPrePoliza) Then
|
||||
For Each Row As DataRow In ObjConta.DtResultados.Rows
|
||||
@@ -9255,13 +9266,16 @@ Partial Class Compras_Compras
|
||||
Select Case ConceptoContable
|
||||
|
||||
Case 6
|
||||
|
||||
Dim CveProveedorConcepto As Integer = 0, CveIE As Integer = 0, CveCreditoDetalle As Integer = 0
|
||||
Dim ConceptoPersonal As String = "", Concepto As String = ""
|
||||
|
||||
If Not ObjConta.GetPrePolizasDetalle(CvePrePoliza, UsuarioActual.CveEmpresa) Then
|
||||
If Not ObjConta.GetPrePolizasDetalleCompra(CveCompra, UsuarioActual.CveEmpresa) Then
|
||||
ErrorPrepoliza = True
|
||||
Else
|
||||
If ObjConta.DtResultados.FiltraParametros("CveConceptoContable IN (6,68,49,205,176)").Rows.Count > 0 Then
|
||||
DtPrePolizas = ObjConta.DtResultados.FiltraParametros("CveConceptoContable IN (6,68,49,205,176)")
|
||||
|
||||
If DtPrePolizas.Rows.Count > 0 Then
|
||||
CveProveedorConcepto = ObjConta.DtResultados.FiltraParametros("CveConceptoContable = 6 OR CveConceptoContable = 68 OR CveConceptoContable = 49 OR CveConceptoContable = 205 OR CveConceptoContable = 176").Rows(0)("CveProveedor").ToString.ToEntero
|
||||
CveIE = ObjConta.DtResultados.FiltraParametros("CveConceptoContable = 6 OR CveConceptoContable = 68 OR CveConceptoContable = 49 OR CveConceptoContable = 205 OR CveConceptoContable = 176").Rows(0)("CveIE").ToString.ToEntero
|
||||
CveCreditoDetalle = ObjConta.DtResultados.FiltraParametros("CveConceptoContable = 6 OR CveConceptoContable = 68 OR CveConceptoContable = 49 OR CveConceptoContable = 205 OR CveConceptoContable = 176").Rows(0)("CveCreditoDetalle").ToString.ToEntero
|
||||
@@ -9273,181 +9287,192 @@ Partial Class Compras_Compras
|
||||
CveProveedorConcepto = DdlProveedor.SelectedValue.ToEntero
|
||||
End If
|
||||
|
||||
'Removemos los conceptos de la prepoliza
|
||||
If Not ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 6, CveCompra, 1) Then ErrorPrepoliza = True 'GASTO
|
||||
If Not ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 68, CveCompra, 1) Then ErrorPrepoliza = True 'ALMACEN
|
||||
If Not ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 49, CveCompra, 1) Then ErrorPrepoliza = True 'AF
|
||||
If Not ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 205, CveCompra, 1) Then ErrorPrepoliza = True 'PS YA RECIBIDO
|
||||
If Not ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 230, CveCompra, 1) Then ErrorPrepoliza = True 'PS YA RECIBIDO
|
||||
If Not ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 231, CveCompra, 1) Then ErrorPrepoliza = True 'PS YA RECIBIDO
|
||||
If Not ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 176, CveCompra, 1) Then ErrorPrepoliza = True 'PS NO RECIBIDO
|
||||
If Not ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 228, CveCompra, 1) Then ErrorPrepoliza = True 'PS NO RECIBIDO
|
||||
If Not ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 229, CveCompra, 1) Then ErrorPrepoliza = True 'PS NO RECIBIDO
|
||||
If Not ErrorPrepoliza Then
|
||||
For Each RowPrePoliza As DataRow In DtPrePolizas.FiltraParametros("", DistinctColumns:={"CvePrePoliza"}).Rows
|
||||
|
||||
'OBTIENE METODO DE CONTABILIZACIÓN AL GUARDAR
|
||||
Dim ConceptoContabilizacionAlmacen = 0
|
||||
If ObjCompra.GetCompras(CveCompra, "-1", "-1", -1, -1, UsuarioActual.CveEmpresa) AndAlso ObjCompra.DtResultados.Rows.Count > 0 Then
|
||||
ConceptoContabilizacionAlmacen = ObjCompra.DtResultados.FiltroPrimeroValor("CveConceptoContableAlmacen").ToEntero
|
||||
End If
|
||||
Dim CvePrePoliza As Integer = RowPrePoliza("CvePrePoliza").ToString().ToEntero()
|
||||
|
||||
'AF
|
||||
DT = TmpDT.FiltraParametros("ISNULL(TipoAF,0) = 2")
|
||||
If DT.Rows.Count > 0 AndAlso DdlTipoComprobante.SelectedValue <> "NC" Then
|
||||
For Each Row2 As DataRow In DT.Rows
|
||||
importeMovimiento = Row2("Total").ToString.ToDecimal
|
||||
importeMN = importeMovimiento * tipoCambioActual * Multiplicador
|
||||
If ObjConta.GetRetCuenta(49, Row2("CveActivoFijo").ToString.ToEntero) Then
|
||||
If ObjConta.DtResultados.Rows.Count > 0 Then
|
||||
IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCtaContActivoFijo").ToString.ToEntero
|
||||
'Removemos los conceptos de la prepoliza
|
||||
If Not ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 6, CveCompra, 1) Then ErrorPrepoliza = True 'GASTO
|
||||
If Not ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 68, CveCompra, 1) Then ErrorPrepoliza = True 'ALMACEN
|
||||
If Not ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 49, CveCompra, 1) Then ErrorPrepoliza = True 'AF
|
||||
If Not ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 205, CveCompra, 1) Then ErrorPrepoliza = True 'PS YA RECIBIDO
|
||||
If Not ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 230, CveCompra, 1) Then ErrorPrepoliza = True 'PS YA RECIBIDO
|
||||
If Not ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 231, CveCompra, 1) Then ErrorPrepoliza = True 'PS YA RECIBIDO
|
||||
If Not ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 176, CveCompra, 1) Then ErrorPrepoliza = True 'PS NO RECIBIDO
|
||||
If Not ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 228, CveCompra, 1) Then ErrorPrepoliza = True 'PS NO RECIBIDO
|
||||
If Not ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 229, CveCompra, 1) Then ErrorPrepoliza = True 'PS NO RECIBIDO
|
||||
|
||||
'OBTIENE METODO DE CONTABILIZACIÓN AL GUARDAR
|
||||
Dim ConceptoContabilizacionAlmacen = 0
|
||||
If ObjCompra.GetCompras(CveCompra, "-1", "-1", -1, -1, UsuarioActual.CveEmpresa) AndAlso ObjCompra.DtResultados.Rows.Count > 0 Then
|
||||
ConceptoContabilizacionAlmacen = ObjCompra.DtResultados.FiltroPrimeroValor("CveConceptoContableAlmacen").ToEntero
|
||||
End If
|
||||
|
||||
'AF
|
||||
DT = TmpDT.FiltraParametros("ISNULL(TipoAF,0) = 2")
|
||||
If DT.Rows.Count > 0 AndAlso DdlTipoComprobante.SelectedValue <> "NC" Then
|
||||
For Each Row2 As DataRow In DT.Rows
|
||||
importeMovimiento = Row2("Total").ToString.ToDecimal
|
||||
importeMN = importeMovimiento * tipoCambioActual * Multiplicador
|
||||
If ObjConta.GetRetCuenta(49, Row2("CveActivoFijo").ToString.ToEntero) Then
|
||||
If ObjConta.DtResultados.Rows.Count > 0 Then
|
||||
IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCtaContActivoFijo").ToString.ToEntero
|
||||
End If
|
||||
End If
|
||||
|
||||
If importeMovimiento <> 0 Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Row2("CodAF").ToString, 49, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveActivoFijo:=Row2("CveActivoFijo").ToString.ToEntero, CveIE:=CveIE, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento)) Then
|
||||
ErrorPrepoliza = True
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
'LIMPIA
|
||||
importeMovimiento = 0
|
||||
IdCtaContable = 0
|
||||
|
||||
'COSTO ALMACEN
|
||||
Dim DtAlmacenes = GlobalDTAlmacen(UsuarioActual.CveEmpresa)
|
||||
If UsuarioActual.Empresa.UsaInventarios AndAlso Not UsuarioActual.Empresa.Funcionalidad(126) = "1" And ConceptoContabilizacionAlmacen = 0 Then
|
||||
DT = TmpDT.FiltraParametros("ISNULL(TipoAF,0) <> 2 AND ISNULL(CveAlmacen,0) > 0", "", {"CveAlmacen"})
|
||||
'RECORREMOS PARA DETECTAR LA MODALIDAD DEL ALMACEN, EN CASO DE SER SOLO EXISTENCIA LIMPIAMOS CVEALMACEN
|
||||
|
||||
DT.AcceptChanges()
|
||||
DT = DT.FiltraParametros("ISNULL(CveAlmacen,0) > 0")
|
||||
If (DT.Rows.Count > 0) AndAlso Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") Then
|
||||
For Each Row2 As DataRow In DT.Rows
|
||||
|
||||
importeMovimiento = TmpDT.SUM("Total", $"CveAlmacen = {Row2("CveAlmacen")}").ToString.ToDecimal + TmpDT.SUM("CostoIndirectoAlmacen", $"CveAlmacen = {Row2("CveAlmacen")}").ToString.ToDecimal 'Row2("Total").ToString.ToDecimal + Row2("CostoIndirectoAlmacen").ToString.ToDecimal
|
||||
importeMN = importeMovimiento * tipoCambioActual * Multiplicador
|
||||
If ObjConta.GetRetCuenta(68, GvInv.HeaderRow.FCDropDownList("ddlAlmacen").SelectedValue.ToString.ToEntero) Then
|
||||
If ObjConta.DtResultados.Rows.Count > 0 Then
|
||||
IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero
|
||||
End If
|
||||
End If
|
||||
If importeMovimiento <> 0 Then
|
||||
Dim SeContabiliza As Boolean = True
|
||||
'SI ES GASTO DE ALMACEN NO DEBE CONTABILIZAR CONCEPTO 68
|
||||
If DdlTipoCompra.SelectedValue = "10" Then
|
||||
SeContabiliza = False
|
||||
IdCtaContable = 0
|
||||
End If
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, 68, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveIE:=CveIE, CvePersonal:=CvePersonal, CveMovimientoAlmacen:=CveMovimientoInventario, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), Contabilizable:=SeContabiliza) Then
|
||||
ErrorPrepoliza = True
|
||||
End If
|
||||
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
|
||||
If importeMovimiento <> 0 Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Row2("CodAF").ToString, 49, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveActivoFijo:=Row2("CveActivoFijo").ToString.ToEntero, CveIE:=CveIE, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento)) Then
|
||||
ErrorPrepoliza = True
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
'LIMPIA
|
||||
importeMovimiento = 0
|
||||
IdCtaContable = 0
|
||||
|
||||
'LIMPIA
|
||||
importeMovimiento = 0
|
||||
IdCtaContable = 0
|
||||
|
||||
'COSTO ALMACEN
|
||||
Dim DtAlmacenes = GlobalDTAlmacen(UsuarioActual.CveEmpresa)
|
||||
If UsuarioActual.Empresa.UsaInventarios AndAlso Not UsuarioActual.Empresa.Funcionalidad(126) = "1" And ConceptoContabilizacionAlmacen = 0 Then
|
||||
DT = TmpDT.FiltraParametros("ISNULL(TipoAF,0) <> 2 AND ISNULL(CveAlmacen,0) > 0", "", {"CveAlmacen"})
|
||||
'RECORREMOS PARA DETECTAR LA MODALIDAD DEL ALMACEN, EN CASO DE SER SOLO EXISTENCIA LIMPIAMOS CVEALMACEN
|
||||
|
||||
DT.AcceptChanges()
|
||||
DT = DT.FiltraParametros("ISNULL(CveAlmacen,0) > 0")
|
||||
If (DT.Rows.Count > 0) AndAlso Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") Then
|
||||
For Each Row2 As DataRow In DT.Rows
|
||||
|
||||
importeMovimiento = TmpDT.SUM("Total", $"CveAlmacen = {Row2("CveAlmacen")}").ToString.ToDecimal + TmpDT.SUM("CostoIndirectoAlmacen", $"CveAlmacen = {Row2("CveAlmacen")}").ToString.ToDecimal 'Row2("Total").ToString.ToDecimal + Row2("CostoIndirectoAlmacen").ToString.ToDecimal
|
||||
'INV [MERCANCIA RECIBIDA POR ADELANTADO (OC) | MERCANCIA PENDIENTE POR RECIBIR (COMPRA) ]
|
||||
If UsuarioActual.Empresa.UsaInventarios And Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" And ConceptoContabilizacionAlmacen.Contiene(176, 205) Then
|
||||
importeMovimiento = TmpDT.SUM("Total", $"ISNULL(TipoAF,0) <> 2 AND ISNULL(AplicaCostoIndirecto,0) <> 1 AND CveTipoPS = 2").ToString.ToDecimal
|
||||
importeMN = importeMovimiento * tipoCambioActual * Multiplicador
|
||||
If ObjConta.GetRetCuenta(68, GvInv.HeaderRow.FCDropDownList("ddlAlmacen").SelectedValue.ToString.ToEntero) Then
|
||||
|
||||
If ObjConta.GetRetCuenta(ConceptoContabilizacionAlmacen, UsuarioActual.CveEmpresa) Then
|
||||
If ObjConta.DtResultados.Rows.Count > 0 Then
|
||||
IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero
|
||||
End If
|
||||
End If
|
||||
If importeMovimiento <> 0 Then
|
||||
Dim SeContabiliza As Boolean = True
|
||||
'SI ES GASTO DE ALMACEN NO DEBE CONTABILIZAR CONCEPTO 68
|
||||
If DdlTipoCompra.SelectedValue = "10" Then
|
||||
SeContabiliza = False
|
||||
IdCtaContable = 0
|
||||
End If
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, 68, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveIE:=CveIE, CvePersonal:=CvePersonal, CveMovimientoAlmacen:=CveMovimientoInventario, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), Contabilizable:=SeContabiliza) Then
|
||||
If importeMovimiento <> 0 Then
|
||||
Concepto = $"{NombreProveedor} {TxtSerie.Text} - {TxtFolio.Text}"
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContabilizacionAlmacen, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento)) Then
|
||||
ErrorPrepoliza = True
|
||||
End If
|
||||
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
|
||||
'LIMPIA
|
||||
importeMovimiento = 0
|
||||
IdCtaContable = 0
|
||||
|
||||
'INV [MERCANCIA RECIBIDA POR ADELANTADO (OC) | MERCANCIA PENDIENTE POR RECIBIR (COMPRA) ]
|
||||
If UsuarioActual.Empresa.UsaInventarios And Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" And ConceptoContabilizacionAlmacen.Contiene(176, 205) Then
|
||||
importeMovimiento = TmpDT.SUM("Total", $"ISNULL(TipoAF,0) <> 2 AND ISNULL(AplicaCostoIndirecto,0) <> 1 AND CveTipoPS = 2").ToString.ToDecimal
|
||||
importeMN = importeMovimiento * tipoCambioActual * Multiplicador
|
||||
|
||||
If ObjConta.GetRetCuenta(ConceptoContabilizacionAlmacen, UsuarioActual.CveEmpresa) Then
|
||||
If ObjConta.DtResultados.Rows.Count > 0 Then
|
||||
IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero
|
||||
End If
|
||||
End If
|
||||
|
||||
If importeMovimiento <> 0 Then
|
||||
Concepto = $"{NombreProveedor} {TxtSerie.Text} - {TxtFolio.Text}"
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContabilizacionAlmacen, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento)) Then
|
||||
ErrorPrepoliza = True
|
||||
End If
|
||||
End If
|
||||
'NC CON PRODUCTOS - CUENTA PUENTE
|
||||
|
||||
End If
|
||||
If UsuarioActual.Empresa.UsaInventarios And Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" And ConceptoContabilizacionAlmacen.Contiene(225) Then
|
||||
importeMovimiento = TmpDT.SUM("Total", $"ISNULL(TipoAF,0) <> 2 AND ISNULL(AplicaCostoIndirecto,0) <> 1 AND CveTipoPS = 2").ToString.ToDecimal
|
||||
importeMN = importeMovimiento * tipoCambioActual * Multiplicador
|
||||
|
||||
'NC CON PRODUCTOS - CUENTA PUENTE
|
||||
If ObjConta.GetRetCuenta(ConceptoContabilizacionAlmacen, UsuarioActual.CveEmpresa) Then
|
||||
If ObjConta.DtResultados.Rows.Count > 0 Then
|
||||
IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero
|
||||
End If
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.UsaInventarios And Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" And ConceptoContabilizacionAlmacen.Contiene(225) Then
|
||||
importeMovimiento = TmpDT.SUM("Total", $"ISNULL(TipoAF,0) <> 2 AND ISNULL(AplicaCostoIndirecto,0) <> 1 AND CveTipoPS = 2").ToString.ToDecimal
|
||||
importeMN = importeMovimiento * tipoCambioActual * Multiplicador
|
||||
|
||||
If ObjConta.GetRetCuenta(ConceptoContabilizacionAlmacen, UsuarioActual.CveEmpresa) Then
|
||||
If ObjConta.DtResultados.Rows.Count > 0 Then
|
||||
IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero
|
||||
End If
|
||||
End If
|
||||
|
||||
If importeMovimiento <> 0 Then
|
||||
Concepto = $"{NombreProveedor} {TxtSerie.Text} - {TxtFolio.Text}"
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContabilizacionAlmacen, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento)) Then
|
||||
ErrorPrepoliza = True
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
'GASTO
|
||||
DT = TmpDT.Copy
|
||||
'RECORREMOS PARA DETECTAR LA MODALIDAD DEL ALMACEN, EN CASO DE SER SOLO EXISTENCIA LIMPIAMOS CVEALMACEN
|
||||
If DdlTipoCompra.SelectedValue <> "10" Then
|
||||
For Each Dr As DataRow In DT.Rows
|
||||
If DtAlmacenes.FiltroPrimeroValor("Modalidad", $"CveAlmacen = {Dr("CveAlmacen").ToString.ToEntero}").ToString = "Solo Existencia" Then
|
||||
Dr("CveAlmacen") = 0
|
||||
End If
|
||||
Dr.AcceptChanges()
|
||||
Next
|
||||
End If
|
||||
|
||||
DT.AcceptChanges()
|
||||
DtAlmacenes.Dispose()
|
||||
|
||||
'QUITA 1-[MERCANCIA RECIBIDA POR ADELANTADO (OC) | MERCANCIA PENDIENTE POR RECIBIR (COMPRA)] 2-[NC CON PRODUCTOS]
|
||||
If UsuarioActual.Empresa.UsaInventarios And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" And ConceptoContabilizacionAlmacen > 0 Then
|
||||
DT = DT.FiltraParametros("CveTipoPS <> 2")
|
||||
End If
|
||||
|
||||
Dim DTDistinct = DT.Copy
|
||||
If UsuarioActual.Empresa.Funcionalidad(126) = "1" Then
|
||||
DTDistinct = DTDistinct.FiltraParametros("ISNULL(TipoAF,0) <> 2", "", {"CveClasificacion", "Clasificacion", "SubProyecto", "CveSubProyecto", "CveTipoGasto", "TipoGasto"})
|
||||
Else
|
||||
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
|
||||
|
||||
If DTDistinct.Rows.Count > 0 Then
|
||||
For Each Row2 As DataRow In DTDistinct.Rows
|
||||
|
||||
'DETERMINA IMPORTE
|
||||
If UsuarioActual.Empresa.Funcionalidad(126) = "1" Then
|
||||
importeMovimiento = DT.SUM("Total", String.Format("ISNULL(TipoAF,0) <> 2 AND CveClasificacion = {0} AND CveSubProyecto = {1} AND ISNULL(CveTipoGasto,0) = {2}", Row2("CveClasificacion").ToString.ToEntero, Row2("CveSubProyecto").ToString.ToEntero, Row2("CveTipoGasto").ToString.ToEntero)).ToString.ToDecimal
|
||||
Else
|
||||
importeMovimiento = DT.SUM("Total", String.Format("ISNULL(TipoAF,0) <> 2 AND ISNULL(CveAlmacen,0) = 0 AND ISNULL(AplicaCostoIndirecto,0) <> 1 AND CveClasificacion = {0} AND CveSubProyecto = {1} AND ISNULL(CveTipoGasto,0) = {2}", Row2("CveClasificacion").ToString.ToEntero, Row2("CveSubProyecto").ToString.ToEntero, Row2("CveTipoGasto").ToString.ToEntero)).ToString.ToDecimal
|
||||
End If
|
||||
importeMN = importeMovimiento * tipoCambioActual * Multiplicador
|
||||
|
||||
'CLASIFICACION
|
||||
If Row2("CveClasificacion").ToString.ToEntero > 0 Then
|
||||
If ObjConta.GetRetCuenta(6, Row2("CveClasificacion").ToString.ToEntero, CveSubProyecto:=Row2("CveSubProyecto").ToString.ToEntero) Then
|
||||
If ObjConta.DtResultados.Rows.Count > 0 AndAlso ObjConta.DtResultados.Rows(0)("IdCuentaGasto").ToString.ToEntero > 0 Then
|
||||
IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaGasto").ToString.ToEntero
|
||||
Else
|
||||
IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGasto", String.Format("CveClasificacion = {0}", Row2("CveClasificacion"))).ToString.ToEntero
|
||||
If importeMovimiento <> 0 Then
|
||||
Concepto = $"{NombreProveedor} {TxtSerie.Text} - {TxtFolio.Text}"
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContabilizacionAlmacen, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento)) Then
|
||||
ErrorPrepoliza = True
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
'AGREGA MOVIMIENTO
|
||||
If importeMovimiento <> 0 AndAlso Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") Then
|
||||
Concepto = $"{NombreProveedor} {TxtSerie.Text} - {TxtFolio.Text}"
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, 6, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveIE:=CveIE, CveCreditoDetalle:=CveCreditoDetalle, CveClasificacion:=Row2("CveClasificacion").ToString.ToEntero, CveSubProyecto:=Row2("CveSubProyecto").ToString.ToEntero, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveTipoGasto:=Row2("CveTipoGasto").ToString.ToEntero) Then
|
||||
ErrorPrepoliza = True
|
||||
End If
|
||||
'GASTO
|
||||
DT = TmpDT.Copy
|
||||
'RECORREMOS PARA DETECTAR LA MODALIDAD DEL ALMACEN, EN CASO DE SER SOLO EXISTENCIA LIMPIAMOS CVEALMACEN
|
||||
If DdlTipoCompra.SelectedValue <> "10" Then
|
||||
For Each Dr As DataRow In DT.Rows
|
||||
If DtAlmacenes.FiltroPrimeroValor("Modalidad", $"CveAlmacen = {Dr("CveAlmacen").ToString.ToEntero}").ToString = "Solo Existencia" Then
|
||||
Dr("CveAlmacen") = 0
|
||||
End If
|
||||
Dr.AcceptChanges()
|
||||
Next
|
||||
End If
|
||||
|
||||
DT.AcceptChanges()
|
||||
DtAlmacenes.Dispose()
|
||||
|
||||
'QUITA 1-[MERCANCIA RECIBIDA POR ADELANTADO (OC) | MERCANCIA PENDIENTE POR RECIBIR (COMPRA)] 2-[NC CON PRODUCTOS]
|
||||
If UsuarioActual.Empresa.UsaInventarios And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" And ConceptoContabilizacionAlmacen > 0 Then
|
||||
DT = DT.FiltraParametros("CveTipoPS <> 2")
|
||||
End If
|
||||
|
||||
Dim DTDistinct = DT.Copy
|
||||
If UsuarioActual.Empresa.Funcionalidad(126) = "1" Then
|
||||
DTDistinct = DTDistinct.FiltraParametros("ISNULL(TipoAF,0) <> 2", "", {"CveClasificacion", "Clasificacion", "SubProyecto", "CveSubProyecto", "CveTipoGasto", "TipoGasto"})
|
||||
Else
|
||||
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
|
||||
|
||||
If DTDistinct.Rows.Count > 0 Then
|
||||
For Each Row2 As DataRow In DTDistinct.Rows
|
||||
|
||||
'DETERMINA IMPORTE
|
||||
If UsuarioActual.Empresa.Funcionalidad(126) = "1" Then
|
||||
importeMovimiento = DT.SUM("Total", String.Format("ISNULL(TipoAF,0) <> 2 AND CveClasificacion = {0} AND CveSubProyecto = {1} AND ISNULL(CveTipoGasto,0) = {2}", Row2("CveClasificacion").ToString.ToEntero, Row2("CveSubProyecto").ToString.ToEntero, Row2("CveTipoGasto").ToString.ToEntero)).ToString.ToDecimal
|
||||
Else
|
||||
importeMovimiento = DT.SUM("Total", String.Format("ISNULL(TipoAF,0) <> 2 AND ISNULL(CveAlmacen,0) = 0 AND ISNULL(AplicaCostoIndirecto,0) <> 1 AND CveClasificacion = {0} AND CveSubProyecto = {1} AND ISNULL(CveTipoGasto,0) = {2}", Row2("CveClasificacion").ToString.ToEntero, Row2("CveSubProyecto").ToString.ToEntero, Row2("CveTipoGasto").ToString.ToEntero)).ToString.ToDecimal
|
||||
End If
|
||||
importeMN = importeMovimiento * tipoCambioActual * Multiplicador
|
||||
|
||||
'CLASIFICACION
|
||||
If Row2("CveClasificacion").ToString.ToEntero > 0 Then
|
||||
If ObjConta.GetRetCuenta(6, Row2("CveClasificacion").ToString.ToEntero, CveSubProyecto:=Row2("CveSubProyecto").ToString.ToEntero) Then
|
||||
If ObjConta.DtResultados.Rows.Count > 0 AndAlso ObjConta.DtResultados.Rows(0)("IdCuentaGasto").ToString.ToEntero > 0 Then
|
||||
IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaGasto").ToString.ToEntero
|
||||
Else
|
||||
IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGasto", String.Format("CveClasificacion = {0}", Row2("CveClasificacion"))).ToString.ToEntero
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
'AGREGA MOVIMIENTO
|
||||
If importeMovimiento <> 0 AndAlso Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") Then
|
||||
Concepto = $"{NombreProveedor} {TxtSerie.Text} - {TxtFolio.Text}"
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, 6, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveIE:=CveIE, CveCreditoDetalle:=CveCreditoDetalle, CveClasificacion:=Row2("CveClasificacion").ToString.ToEntero, CveSubProyecto:=Row2("CveSubProyecto").ToString.ToEntero, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveTipoGasto:=Row2("CveTipoGasto").ToString.ToEntero) Then
|
||||
ErrorPrepoliza = True
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
'LIMPIA
|
||||
importeMovimiento = 0
|
||||
IdCtaContable = 0
|
||||
Next
|
||||
End If
|
||||
|
||||
@@ -9455,10 +9480,86 @@ Partial Class Compras_Compras
|
||||
importeMovimiento = 0
|
||||
IdCtaContable = 0
|
||||
|
||||
' Case 5 'Proveedores
|
||||
' Dim TieneConceptoProveedorAcreedor As Boolean = False
|
||||
' Dim CveIE As Integer = -1
|
||||
|
||||
' 'If Not ObjConta.GetPrePolizasDetalleCompra(CveCompra, UsuarioActual.CveEmpresa) Then
|
||||
' ' ErrorPrepoliza = True
|
||||
' 'Else
|
||||
' ' If ObjConta.DtResultados.FiltraParametros("CveConceptoContable IN (5,305)").Rows.Count > 0 Then
|
||||
' ' TieneConceptoProveedorAcreedor = True
|
||||
' ' CveIE = ObjConta.DtResultados.FiltraParametros("CveConceptoContable = 6 OR CveConceptoContable = 68 OR CveConceptoContable = 49 OR CveConceptoContable = 205 OR CveConceptoContable = 176").Rows(0)("CveIE").ToString.ToEntero
|
||||
' ' End If
|
||||
' 'End If
|
||||
|
||||
' If TieneConceptoProveedorAcreedor Then
|
||||
' If CveTipoConcepto = 2 Then ConceptoContable = 305 'cuando es acreedor
|
||||
' Dim UsaComplementaria As Boolean = True
|
||||
' If tipoCambioActual <> 1 Then
|
||||
' Select Case ConceptoContable
|
||||
' Case 5
|
||||
' ConceptoContable = 311
|
||||
' Case 305
|
||||
' ConceptoContable = 306
|
||||
' Case Else
|
||||
' End Select
|
||||
' End If
|
||||
|
||||
' Dim importeProv As Decimal = 0
|
||||
' importeProv = TxtTotal.Text.ToDecimal
|
||||
|
||||
' If Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") Then
|
||||
|
||||
' importeMovimiento = importeProv
|
||||
' importeMN = importeMovimiento * tipoCambioActual * Multiplicador
|
||||
|
||||
' If tipoCambioActual > 1 Then Referencia += $" TC{tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}"
|
||||
' Dim CveConceptoContableComplementaria As Integer = 201
|
||||
' If CveTipoConcepto = 2 Then CveConceptoContableComplementaria = 307
|
||||
|
||||
|
||||
|
||||
' If tipoCambioActual = 1 Then
|
||||
' IdCtaContable = If(CveTipoConcepto = 2, CtaProveedorAcreedores, CtaProveedor)
|
||||
' Dim Concepto = $"{NombreProveedor} {TxtSerie.Text} - {TxtFolio.Text}"
|
||||
|
||||
' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveSubProyecto:=-1, CveProveedor:=CveProveedor, CveIE:=CveIE, CvePersonal:=CvePersonal, CveCreditoDetalle:=-1, ImporteMX:=Math.Round(importeMN, 2, MidpointRounding.AwayFromZero), ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=tipoCambioActual) Then
|
||||
' ErrorPrepoliza = True
|
||||
' Exit For
|
||||
' End If
|
||||
|
||||
' Else
|
||||
' IdCtaContable = CtaProveedorComplementaria
|
||||
' If importeMovimiento <> 0 AndAlso (IdCtaContable > 0 Or UsaComplementaria) Then 'Cuando tiene complementaria lo dividimos en dos Then
|
||||
' importeMN = importeMovimiento
|
||||
' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, Referencia, CveConceptoContableComplementaria, Referencia, FechaMovimiento, IdCtaContable, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteMX:=importeMovimiento * tipoCambioActual - importeMovimiento, ImporteME:=importeMovimiento, TipoCambio:=tipoCambioActual) Then
|
||||
' ErrorPrepoliza = True
|
||||
' End If
|
||||
' End If
|
||||
' IdCtaContable = CtaProveedorExtranjera
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
|
||||
End Select
|
||||
Next
|
||||
End If
|
||||
|
||||
If DtPrePolizas IsNot Nothing Then
|
||||
For Each RowPrePoliza As DataRow In DtPrePolizas.FiltraParametros("", DistinctColumns:={"CvePrePoliza"}).Rows
|
||||
If ObjConta.ValidacionPrePolizaCuadre(RowPrePoliza("CvePrePoliza").ToString().ToEntero(), 4) Then
|
||||
If ObjConta.ValorPolizaDescuadre > 0 Then
|
||||
ErrorPrepoliza = True
|
||||
Alert("Error en validacion de prepoliza cuadre", TipoMensaje.MsgAdvertencia)
|
||||
GuardaLogAD($"Compras/Compras-Actualizar | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
'VALIDAR PREPOLIZA DE COMPRA
|
||||
If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, 4) Then
|
||||
If ObjConta.ValorPolizaDescuadre > 0 Then
|
||||
ErrorPrepoliza = True
|
||||
|
||||
@@ -1,145 +0,0 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="PopUpFacturasPendientesAutorizar.aspx.vb" Inherits="Compras_PopUpFacturasPendientesAutorizar" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Facturas Pendientes de Autorizar
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:Panel ID="PnlPrincipal" runat="server" Width="750px">
|
||||
|
||||
<table class="Widthall"> <%--border="1" rules="all" style="border-collapse: collapse;"--%>
|
||||
|
||||
<%-- <tr>
|
||||
<td class="Titulos" colspan="5">Filtros para búsqueda</td>
|
||||
</tr>--%>
|
||||
<tr style="text-align:left">
|
||||
<%-- <td class="text-right"><b>Fecha Inicial:</b></td>
|
||||
<td>
|
||||
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="padding:0px;">
|
||||
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10" Onblur="Recalculafechapago();" ValidationGroup="GrpGuardar" Width="150px" ClientIDMode="Static"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton runat="server" ID="imgCalendario" class="btn default"> <i class="fa fa-calendar"></i> </asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
||||
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</td>
|
||||
<td class="text-right"><b>Fecha Final:</b></td>
|
||||
<td >
|
||||
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="padding:0px;">
|
||||
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10" Onblur="Recalculafechapago();" ValidationGroup="GrpGuardar" Width="150px" ClientIDMode="Static"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton runat="server" ID="imgCalendarioF" class="btn default"> <i class="fa fa-calendar"></i> </asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
||||
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</td>--%>
|
||||
<%-- <td><asp:Button ID="BtnBuscar" runat="server" Text="Buscar" class="btn btn-primary" /></td>--%>
|
||||
</tr>
|
||||
</table>
|
||||
</asp:Panel>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<br />
|
||||
<table id="TblBusqueda" runat="server" border="0" visible="false">
|
||||
<tr>
|
||||
<td >
|
||||
<div class ="row" >
|
||||
<div class="col-sm-6" style="text-align:left!important">Número de registros encontrados:<b><asp:Literal ID="LtlTotalRegistros" runat="server"></asp:Literal></b></div>
|
||||
<div class="col-sm-6" style="text-align:right!important">
|
||||
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GV.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GV.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<asp:GridView ID="GV" Width="735" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron registros" ToolTip="Listado de Facturas Pendientes de Autorizar"
|
||||
CssClass="table table-striped table-hover Widthall ScrollAD" data-height="400" Style="text-align: center;" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Proveedor" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblProveedor" runat="server" Text='<%# Eval("Proveedor") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Factura" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblSerieFolio" runat="server" Text='<%# Eval("SerieFolio") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Proyecto" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblProyecto" runat="server" Text='<%# Eval("SubProyecto")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Fecha" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblFecha" runat="server" Text='<%# Eval("Fecha") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Fecha V." ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblFechav" runat="server" Text='<%# Eval("Fechav") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Saldo" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblSaldo" Width="100" runat="server" Text='<%# Eval("Saldo") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText=" " ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblEspacio" runat="server" Text=' '></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
</Columns>
|
||||
<RowStyle CssClass="Texto" HorizontalAlign="Left" />
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||
</asp:GridView>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script type="text/javascript">
|
||||
function Ir(v) {
|
||||
gotourl('/Compras/Compras.aspx?CveCompra=' + v);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//$(document).ready(function () {
|
||||
// $("#TxtFolioFiscal").mask("********-****-****-****-************");
|
||||
//});
|
||||
</script>
|
||||
</asp:Content>
|
||||
@@ -1,85 +0,0 @@
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
|
||||
Partial Class Compras_PopUpFacturasPendientesAutorizar
|
||||
Inherits ClsPaginas
|
||||
|
||||
Private Sub Compras_PopUpFacturasPendientesAutorizar_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
|
||||
CType(Me.Master, BaseMasterPage).EsPopup = True
|
||||
CType(Me.Master, BaseMasterPage).PopupWidth = 750
|
||||
|
||||
|
||||
If Not IsPostBack Then
|
||||
Dim dTime As Date = Now
|
||||
' txtFechaF.Text = dTime.ToString("dd/MM/yyyy")
|
||||
dTime = dTime.AddDays(-30)
|
||||
' txtFechaI.Text = dTime.ToString("dd/MM/yyyy")
|
||||
cargadatos()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub cargadatos()
|
||||
Dim objCompras As New ClsCompras
|
||||
|
||||
Dim dTime As Date = Now
|
||||
|
||||
Dim FechaInc As Date = dTime
|
||||
dTime = dTime.AddDays(-30)
|
||||
Dim FechaFin As Date = dTime
|
||||
objCompras.GetFacturasPendientesDeAutorizar(UsuarioActual.Empresa.CveEmpresa, FechaInc, FechaFin)
|
||||
|
||||
If objCompras.DtResultados.Rows.Count > 0 Then
|
||||
TblBusqueda.Visible = True
|
||||
Else
|
||||
TblBusqueda.Visible = True
|
||||
End If
|
||||
|
||||
|
||||
LtlTotalRegistros.Text = objCompras.DtResultados.Rows.Count.ToString
|
||||
|
||||
GV.DataSource = objCompras.DtResultados
|
||||
GV.DataBind()
|
||||
UPDatos.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
'Protected Sub BtnBuscar_Click(sender As Object, e As EventArgs) Handles BtnBuscar.Click
|
||||
' cargadatos()
|
||||
'End Sub
|
||||
|
||||
Protected Sub GV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GV.RowDataBound
|
||||
|
||||
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If Not (e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5) Then
|
||||
|
||||
Dim saldo As Double = e.Row.DBCampo("Saldo").Trim.ToDecimal
|
||||
|
||||
'ostBackUrl =""
|
||||
' e.Row.FCLinkButton("lnkSerieFolio").PostBackUrl = "" & e.Row.DBCampo("CveCompra")
|
||||
' e.Row.FCLinkButton("lnkSerieFolio").Text = e.Row.DBCampo("SerieFolio")
|
||||
|
||||
Dim Liga As String = String.Empty
|
||||
|
||||
Liga = String.Format("<a class='Texto' href='javascript:Ir(""{0}"");'>", e.Row.DBCampo("CveCompra"))
|
||||
|
||||
e.Row.FCLabel("lblSerieFolio").Text = String.Format("<div >{0}{1}</a></div>", Liga, e.Row.DBCampo("SerieFolio"))
|
||||
|
||||
|
||||
e.Row.FCLabel("LblSaldo").Font.Bold = True
|
||||
e.Row.FCLabel("LblSaldo").Text = "$" & saldo.ToString("###,###,###.00") & " " & e.Row.DBCampo("Abreviatura").ToString & " "
|
||||
|
||||
e.Row.FCLabel("lblFecha").Text = Date.Parse(e.Row.DBCampo("Fecha").ToString).ToString("dd/MM/yyyy")
|
||||
e.Row.FCLabel("lblFechav").Text = Date.Parse(e.Row.DBCampo("Fechav").ToString).ToString("dd/MM/yyyy")
|
||||
|
||||
|
||||
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
@@ -2556,7 +2556,7 @@ Partial Class PopUpVerFactura
|
||||
ObjFactura.RefDocto = ""
|
||||
ObjFactura.Folio = Folio
|
||||
ObjFactura.Serie = "Tra"
|
||||
ObjFactura.CveMesa = -1
|
||||
'ObjFactura.CveMesa = -1
|
||||
ObjFactura.Fecha = Now
|
||||
ObjFactura.CvePrePoliza = -1
|
||||
ObjFactura.FechaPago = Now
|
||||
|
||||
@@ -264,7 +264,7 @@
|
||||
<td>
|
||||
<div class="form-group form-md-line-input" style="width: 200px">
|
||||
<asp:TextBox ID="TxtRFC" CssClass="form-control input-sm" runat="server" MaxLength="13"></asp:TextBox><label></label>
|
||||
<asp:RegularExpressionValidator ID="REVRFC" runat="server" Display="Dynamic" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''RFC''</b> es incorrecto, por favor ingréselo." ValidationGroup="GrpGuardar" ControlToValidate="TxtRFC" ValidationExpression="^[a-zA-Z.)(/\\&-]{3,4}(\d{6})((\D|\d){2})((\D|\d){1})$"></asp:RegularExpressionValidator>
|
||||
<asp:RegularExpressionValidator ID="REVRFC" runat="server" Display="Dynamic" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''RFC''</b> es incorrecto, por favor ingréselo." ValidationGroup="GrpGuardar" ControlToValidate="TxtRFC" ValidationExpression="^[a-zñA-ZÑ.)(/\\&-]{3,4}(\d{6})((\D|\d){2})((\D|\d){1})$"></asp:RegularExpressionValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEREVRFC" runat="server" HighlightCssClass="vco" TargetControlID="REVRFC" Width="300px" BehaviorID="_content_VCEREVRFC"></ajax:ValidatorCalloutExtender>
|
||||
<asp:RequiredFieldValidator ID="RFVRFC" runat="server" ControlToValidate="TxtRFC" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''RFC''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCERFC" runat="server" HighlightCssClass="vco" TargetControlID="RFVRFC" Width="300px" BehaviorID="_content_VCERFC"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
@@ -1,142 +0,0 @@
|
||||
<%@ Page Title="Rep. Carta Porte Traslados" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepCartaPorteTraslados.aspx.vb" Inherits="Compras_RepCartaPorteTraslados" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style>
|
||||
.dataTables_scrollHead {
|
||||
background-color: #95A5A6;
|
||||
color: white;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Rep. Carta Porte Traslados
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
|
||||
|
||||
<asp:UpdatePanel runat="server" ID="UpdatePanel1" RenderMode="Inline" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkExcel" OnClick="LnkExcel_Click" runat="server" Visible="false"><i class="fa fa-file-excel-o" style="font-weight:bold;"></i> Excel</asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="LnkExcel" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
|
||||
|
||||
<asp:UpdatePanel ID="UpFiltros" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="portlet solid grey-cascade portlet-filter">
|
||||
<div class="portlet-title portlet-filterT smalltitle">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultarFiltros" OnClick="BtnConsultarFiltros_Click" runat="server" Text="Consultar" ValidationGroup="GrpFiltros" class="btn btn-primary" />
|
||||
<a href="javascript;" data-idchekbox="<%= chkexpand.ClientID%>" class=" <%= IIf(chkexpand.Checked = True, "collapse", "expand")%>"></a>
|
||||
<asp:CheckBox ID="chkexpand" CssClass="hidden" runat="server" />
|
||||
</div>
|
||||
<div class="titlefiltros caption ">
|
||||
<div class="row">
|
||||
<div class="col-md-1" style="max-width: 120px">Proveedor:</div>
|
||||
<div class="col-md-2">
|
||||
<ADS:Dropdownlost ID="DdlProveedores" CssClassDdl="form-control input-sm select2me" Style="min-width: 160px;" CssStyle="width:100%" DataTextField="RazonSocial" DataValueField="CveProveedor" AppendDataBoundItems="true" runat="server"></ADS:Dropdownlost>
|
||||
</div>
|
||||
<div class="col-md-1" style="max-width: 90px">Fecha Inicio:</div>
|
||||
<div class="col-md-2" style="max-width: 130px">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 90px !important; padding: 0px;">
|
||||
<asp:TextBox ID="TxtFiltrosFechaInicio" CssClass="form-control input-sm ADSMaskDate" Style="width: 88px" runat="server"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="LBCalendarFiltrosFechaInicio" class="btn default " Text=" <i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MEEFiltrosFechaInicio" runat="server" TargetControlID="TxtFiltrosFechaInicio" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CEFiltrosFechaInicio" TargetControlID="TxtFiltrosFechaInicio" PopupButtonID="LBCalendarFiltrosFechaInicio" PopupPosition="BottomRight" Enabled="True" Format="dd/MM/yyyy"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="RFVFiltrosFechaInicio" runat="server" ControlToValidate="TxtFiltrosFechaInicio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Inicio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpFiltros"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEFiltrosFechaInicio" runat="server" HighlightCssClass="vco" TargetControlID="RFVFiltrosFechaInicio"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-1" style="max-width: 75px">Fecha Fin:</div>
|
||||
<div class="col-md-2" style="max-width: 130px">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 90px !important; padding: 0px;">
|
||||
<asp:TextBox ID="TxtFiltrosFechaFin" CssClass="form-control input-sm ADSMaskDate" Style="width: 88px" runat="server"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="LBCalendarFiltrosFechaFin" class="btn default " Text=" <i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MEEFiltrosFechaFin" runat="server" TargetControlID="TxtFiltrosFechaFin" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CEFiltrosFechaFin" TargetControlID="TxtFiltrosFechaFin" PopupButtonID="LBCalendarFiltrosFechaFin" PopupPosition="BottomRight" Enabled="True" Format="dd/MM/yyyy"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="RFVFiltrosFechaFin" runat="server" ControlToValidate="TxtFiltrosFechaFin" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Inicio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpFiltros"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEFiltrosFechaFin" runat="server" HighlightCssClass="vco" TargetControlID="RFVFiltrosFechaFin"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<asp:Label ID="LblSubProyecto" runat="server" class="col-md-1 truncate">SubProyecto:</asp:Label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlSubProyecto" CssClass="form-control input-sm select2me" Width="120px" runat="server" DataValueField="CveSubProyecto" DataTextField="SubProyecto">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body" <%= IIf(chkexpand.Checked = True, "", "style=""display:none;""")%>>
|
||||
<div class="row">
|
||||
<label class="col-md-1 truncate">Tipo Proveedor:</label>
|
||||
<div class="col-md-3">
|
||||
<asp:DropDownList ID="DdlTipoProveedor" CssClass="form-control input-sm select2me" Width="260px" runat="server">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
<asp:ListItem Text="Proveedor" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="Acreedor" Value="2"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<label class="col-md-1 truncate">Usuario Registró:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlUsuarioRegistra" CssClass="form-control input-sm select2me" Width="120px" runat="server" DataValueField="CveUsuario" DataTextField="Nombre">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel ID="UpDatos" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<table class="table Widthall ">
|
||||
<tr>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 60%; border-right: 3px solid white;">Compra</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 40%; border-right: 3px solid white;">Traslado</td>
|
||||
</tr>
|
||||
</table>
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="Sin resultados" ShowHeaderWhenEmpty="true" CssClass="table table-striped table-hover Widthall ScrollAD"
|
||||
DataKeyNames="CveComplementoTraslado,FechaIng,CveCompra,SerieFolioCompra,FechaCompra,FechaFactura,UUID,SerieFolioFactura,CveProveedor,RazonSocial,CveUsuario,Usuario"
|
||||
GridLines="None" data-sort="true">
|
||||
<Columns>
|
||||
<asp:HyperLinkField HeaderText="Proveedor" DataTextField="RazonSocial" DataNavigateUrlFields="CveProveedor" DataNavigateUrlFormatString="/Compras/Proveedores.aspx?CveProveedor={0}" Target="_blank" ItemStyle-Width="40%" />
|
||||
<asp:HyperLinkField HeaderText="SerieFolio" DataTextField="SerieFolioCompra" DataNavigateUrlFields="CveCompra" DataNavigateUrlFormatString="/Compras/Compras.aspx?CveCompra={0}" Target="_blank" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField HeaderText="Fecha" DataField="FechaCompra" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" />
|
||||
<asp:BoundField HeaderText="Folio" DataField="SerieFolioFactura" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="10%" />
|
||||
<asp:BoundField HeaderText="Folio Fiscal" DataField="UUID" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="20%" />
|
||||
<asp:BoundField HeaderText="Fecha" DataField="FechaFactura" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
@@ -1,117 +0,0 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
|
||||
Partial Class Compras_RepCartaPorteTraslados
|
||||
Inherits ClsPaginas
|
||||
|
||||
'Private Property DTComplemntos As DataTable
|
||||
' Get
|
||||
' If ViewState("DTComplemntos") Is Nothing Then
|
||||
' Return New DataTable
|
||||
' Else
|
||||
' Return DirectCast(ViewState("DTComplemntos"), DataTable)
|
||||
' End If
|
||||
' End Get
|
||||
' Set(value As DataTable)
|
||||
' ViewState("DTComplemntos") = value
|
||||
' End Set
|
||||
'End Property
|
||||
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
|
||||
InicializaValores()
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#Region " INICIALIZA VALORES "
|
||||
Private Sub InicializaValores()
|
||||
|
||||
TxtFiltrosFechaInicio.Text = Now.FirstDayOfMonth.ToShortDateString
|
||||
TxtFiltrosFechaFin.Text = Now.ToShortDateString
|
||||
|
||||
DdlProveedores.setEsWebService(True)
|
||||
DdlProveedores.Attributes.Add("data-metodo", "getproveedores")
|
||||
|
||||
'DdlProveedores.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
|
||||
'DdlProveedores.DataBind()
|
||||
'DdlProveedores.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
'DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa)
|
||||
'DdlSubProyecto.DataBind()
|
||||
'DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
CargarCentrosDeCosto(Nothing, DdlSubProyecto, Nothing, LblSubProyecto:=LblSubProyecto)
|
||||
|
||||
DdlUsuarioRegistra.DataSource = GlobalDTUsuarios(-1, UsuarioActual.CveEmpresa)
|
||||
DdlUsuarioRegistra.DataBind()
|
||||
DdlUsuarioRegistra.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
UpFiltros.Update()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " CARGA DATOS "
|
||||
Protected Sub BtnConsultarFiltros_Click(sender As Object, e As EventArgs)
|
||||
CargaDatos()
|
||||
End Sub
|
||||
Private Sub CargaDatos()
|
||||
|
||||
LnkExcel.Visible = False
|
||||
|
||||
Dim CveProveedor As Integer = If(DdlProveedores.SelectedValue.ToEntero = 0, -1, DdlProveedores.SelectedValue.ToEntero)
|
||||
Dim CveTipoProveedor = DdlTipoProveedor.SelectedValue.ToEntero
|
||||
Dim FechaInicio = If(IsDate(TxtFiltrosFechaInicio.Text), TxtFiltrosFechaInicio.Text.ToDate, MinFecha)
|
||||
Dim FechaFin = If(IsDate(TxtFiltrosFechaFin.Text), TxtFiltrosFechaFin.Text.ToDate, MaxFecha)
|
||||
Dim Count As Integer = 0
|
||||
|
||||
Dim ObjCompras As New ClsCompras
|
||||
If ObjCompras.GetComplementoTrasladoRep(UsuarioActual.CveEmpresa, CveProveedor, CveTipoProveedor, FechaInicio, FechaFin, UsuarioActual.CveUsuario, DdlUsuarioRegistra.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero) Then
|
||||
GvDatos.DataSource = ObjCompras.DtResultados
|
||||
|
||||
If ObjCompras.DtResultados.Rows.Count > 0 Then
|
||||
LnkExcel.Visible = True
|
||||
End If
|
||||
Else
|
||||
GvDatos.DataSource = Nothing
|
||||
End If
|
||||
|
||||
ObjCompras.Dispose()
|
||||
|
||||
GvDatos.DataBind()
|
||||
|
||||
UpAcciones.Update()
|
||||
UpDatos.Update()
|
||||
|
||||
|
||||
End Sub
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
End If
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
|
||||
#Region "IMPRESION"
|
||||
|
||||
Protected Sub LnkExcel_Click(sender As Object, e As EventArgs)
|
||||
GeneraImpresion("Excel")
|
||||
End Sub
|
||||
|
||||
Private Sub GeneraImpresion(Optional Formato As String = "PDF")
|
||||
|
||||
GvDatos.ExportToExcel2("RepCartaPorteTraslados.xlsx")
|
||||
|
||||
End Sub
|
||||
#End Region
|
||||
End Class
|
||||
@@ -1,115 +0,0 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepPromociones.aspx.vb" Inherits="Compras_RepPromociones" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style>
|
||||
.dataTables_scrollHead {
|
||||
background-color: #95A5A6;
|
||||
color: white;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Reporte de Promociones
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UpFiltros" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="portlet solid grey-cascade portlet-filter">
|
||||
<div class="portlet-title portlet-filterT smalltitle">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultarFiltros" runat="server" Text="Consultar" ValidationGroup="GrpFiltros" class="btn btn-primary" />
|
||||
</div>
|
||||
<div class="titlefiltros caption ">
|
||||
<div class="row">
|
||||
<div class="col-md-1" style="max-width: 80px">Proveedor:</div>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlProveedor" Width="120px" DataTextField="RazonSocial" DataValueField="CveProveedor" AppendDataBoundItems="true" runat="server" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Text="Todos" Value="-1" Selected="True" />
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<div class="col-md-1" style="max-width: 80px">Tipo:</div>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlTipo" Width="150px" runat="server" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Text="Todos" Value="-1" Selected="True" />
|
||||
<asp:ListItem Text="Con Promoción" Value="1" />
|
||||
<asp:ListItem Text="Sin Promoción" Value="2" />
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<%--<div class="col-md-1" style="max-width: 90px">Tipo Gasto:</div>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlTipoGasto" Width="150px" DataTextField="TipoGasto" DataValueField="CveTipoGasto" AppendDataBoundItems="true" runat="server" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Text="Todos" Value="-1" Selected="True" />
|
||||
</asp:DropDownList>
|
||||
</div>--%>
|
||||
<div class="col-md-1" style="max-width: 90px">Fecha Inicio:</div>
|
||||
<div class="col-md-2" style="max-width: 130px">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 90px !important; padding: 0px;">
|
||||
<asp:TextBox ID="TxtFiltrosFechaInicio" CssClass="form-control input-sm ADSMaskDate" Style="width: 88px" runat="server"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="LnkFechaI" class="btn default " Text=" <i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MEEFiltrosFechaInicio" runat="server" TargetControlID="TxtFiltrosFechaInicio" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CEFiltrosFechaInicio" TargetControlID="TxtFiltrosFechaInicio" PopupButtonID="LnkFechaI" PopupPosition="BottomRight" Enabled="True" Format="dd/MM/yyyy"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="RFVFiltrosFechaInicio" runat="server" ControlToValidate="TxtFiltrosFechaInicio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Inicio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpFiltros"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEFiltrosFechaInicio" runat="server" HighlightCssClass="vco" TargetControlID="RFVFiltrosFechaInicio"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-1" style="max-width: 75px">Fecha Fin:</div>
|
||||
<div class="col-md-2" style="max-width: 130px">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 90px !important; padding: 0px;">
|
||||
<asp:TextBox ID="TxtFiltrosFechaFin" CssClass="form-control input-sm ADSMaskDate" Style="width: 88px" runat="server"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="LnkFechaF" class="btn default " Text=" <i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MEEFiltrosFechaFin" runat="server" TargetControlID="TxtFiltrosFechaFin" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CEFiltrosFechaFin" TargetControlID="TxtFiltrosFechaFin" PopupButtonID="LnkFechaF" PopupPosition="BottomRight" Enabled="True" Format="dd/MM/yyyy"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="RFVFiltrosFechaFin" runat="server" ControlToValidate="TxtFiltrosFechaFin" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Inicio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpFiltros"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEFiltrosFechaFin" runat="server" HighlightCssClass="vco" TargetControlID="RFVFiltrosFechaFin"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<table class="table Widthall ">
|
||||
<tr>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 60%; border-right: 3px solid white;">Factura</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 40%; border-right: 3px solid white;">OC</td>
|
||||
</tr>
|
||||
</table>
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="Sin resultados" ShowHeaderWhenEmpty="true" CssClass="table table-striped table-hover Widthall ScrollAD" GridLines="None" data-sort="true">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Proveedor" DataField="Proveedor" ItemStyle-Width="30%" />
|
||||
<asp:BoundField HeaderText="Fecha" DataField="FechaCompra" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField HeaderText="Folio" DataField="FolioCompra" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField HeaderText="Aplico Promoción" DataField="AplicoPromocionTexto" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField HeaderText="Fecha" DataField="FechaOC" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField HeaderText="Folio" DataField="FolioOC" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField HeaderText="Promoción" DataField="Promocion" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Left" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports Extensiones
|
||||
Partial Class Compras_RepPromociones
|
||||
Inherits ClsPaginas
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
|
||||
InicializaValores()
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub InicializaValores()
|
||||
|
||||
TxtFiltrosFechaInicio.Text = $"01/01/{Now.Year}"
|
||||
TxtFiltrosFechaFin.Text = $"{Now.Day}/{Now.Month}/{Now.Year}"
|
||||
|
||||
DdlProveedor.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
|
||||
DdlProveedor.DataBind()
|
||||
|
||||
'DdlTipoGasto.DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa)
|
||||
'DdlTipoGasto.DataBind()
|
||||
|
||||
UpFiltros.Update()
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Protected Sub BtnConsultarFiltros_Click(sender As Object, e As EventArgs) Handles BtnConsultarFiltros.Click
|
||||
CargaDatos()
|
||||
End Sub
|
||||
Private Sub CargaDatos()
|
||||
Dim CveProveedor = DdlProveedor.SelectedValue.ToEntero
|
||||
Dim CveTipoGasto = -1 'DdlTipoGasto.SelectedValue.ToEntero
|
||||
Dim Tipo = DdlTipo.SelectedValue.ToEntero
|
||||
Dim FechaI = TxtFiltrosFechaInicio.Text.ToDate
|
||||
Dim FechaF = TxtFiltrosFechaFin.Text.ToDate
|
||||
|
||||
Dim ObjCompras As New ClsCompras
|
||||
If ObjCompras.GetRepPromociones(CveProveedor, CveTipoGasto, FechaI, FechaF, Tipo, UsuarioActual.CveEmpresa) Then
|
||||
GvDatos.DataSource = ObjCompras.DtResultados
|
||||
End If
|
||||
ObjCompras.Dispose()
|
||||
GvDatos.DataBind()
|
||||
UpDatos.Update()
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user