Poder elegir articulos de otros proveedores en todos los documentos de compras, además de otros arreglos pendientes
git-svn-id: https://192.168.0.254/svn/Proyectos.LuisLeon_FactuGES/trunk@50 c93665c3-c93d-084d-9b98-7d5f4a9c3376
This commit is contained in:
parent
803b6a841f
commit
69cdaef48a
Binary file not shown.
Binary file not shown.
@ -68,9 +68,10 @@ type
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
uses uDialogUtils;
|
||||
|
||||
{ TfrViewFiltroBase }
|
||||
|
||||
function TfrViewFiltroBase.GetFiltrosChange: TNotifyEvent;
|
||||
@ -117,7 +118,7 @@ begin
|
||||
begin
|
||||
if (edtFechaIniFiltro.EditValue > edtFechaFinFiltro.EditValue) then
|
||||
begin
|
||||
ShowMessage('La fecha de inicio debe ser anterior a la fecha final');
|
||||
ShowWarningMessage('La fecha de inicio debe ser anterior a la fecha final');
|
||||
edtFechaIniFiltro.SetFocus;
|
||||
Result := False;
|
||||
end
|
||||
|
||||
@ -5,7 +5,8 @@ interface
|
||||
uses
|
||||
SysUtils, Classes;
|
||||
|
||||
|
||||
function DarFechaPrimerDia(Date: TDateTime): TDateTime;
|
||||
function DarFechaUltimoDia(Date: TDateTime): TDateTime;
|
||||
function EsFechaVacia(AFecha : TDateTime): Boolean;
|
||||
|
||||
implementation
|
||||
@ -18,4 +19,23 @@ begin
|
||||
Result := (AFecha = FECHA_NULA) or (AFecha = 0);
|
||||
end;
|
||||
|
||||
function DarFechaPrimerDia(Date: TDateTime): TDateTime;
|
||||
var
|
||||
Year, Month, Day: Word;
|
||||
begin
|
||||
DecodeDate(Date, Year, Month, Day);
|
||||
Result := EncodeDate(Year, Month, 1);
|
||||
end;
|
||||
|
||||
function DarFechaUltimoDia(Date: TDateTime): TDateTime;
|
||||
var
|
||||
Year, Month, Day: Word;
|
||||
begin
|
||||
DecodeDate(Date, Year, Month, Day);
|
||||
// (if Month < 12 then inc(Month)
|
||||
// else begin Month := 1; inc(Year) end;
|
||||
// Result := EncodeDate(Year, Month, 1) - 1;
|
||||
Result := EncodeDate(Year, Month,
|
||||
MonthDays[IsLeapYear(Year), Month]);
|
||||
end;
|
||||
end.
|
||||
|
||||
@ -31,7 +31,7 @@ type
|
||||
|
||||
implementation
|
||||
|
||||
uses Dialogs, Variants, uControllerDetallesBase, uControllerDetallesDTO, uDataModuleAlbaranesCliente, uArticulosAlbaranClienteController;
|
||||
uses Dialogs, uDialogUtils, Variants, uControllerDetallesBase, uControllerDetallesDTO, uDataModuleAlbaranesCliente, uArticulosAlbaranClienteController;
|
||||
|
||||
{ TDetallesAlbaranClienteController }
|
||||
|
||||
@ -44,7 +44,7 @@ begin
|
||||
try
|
||||
AArticulos := (FArticulosController.BuscarTodos(ACliente) as IBizArticulo);
|
||||
ActualizarDetalles(ADetalles, AArticulos);
|
||||
ShowMessage('Se han actualizado los descuentos para el cliente seleccionado');
|
||||
ShowInfoMessage('Se han actualizado los descuentos para el cliente seleccionado');
|
||||
finally
|
||||
AArticulos := Nil;
|
||||
end;
|
||||
|
||||
@ -3,11 +3,14 @@ unit uIEditorElegirArticulosAlbaranesProveedor;
|
||||
interface
|
||||
|
||||
uses
|
||||
uIEditorElegirArticulos;
|
||||
uIEditorElegirArticulos, uBizContactos;
|
||||
|
||||
type
|
||||
IEditorElegirArticulosAlbaranesProveedor = interface(IEditorElegirArticulos)
|
||||
['{CAA16595-482A-4936-875E-F19263772C0D}']
|
||||
function GetProveedor: IBizProveedor;
|
||||
procedure SetProveedor(const Value: IBizProveedor);
|
||||
property Proveedor: IBizProveedor read GetProveedor write SetProveedor;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
@ -3,16 +3,17 @@ unit uArticulosAlbaranProveedorController;
|
||||
interface
|
||||
|
||||
uses
|
||||
uDADataTable, uArticulosController, uBizArticulos;
|
||||
uDADataTable, uArticulosController, uBizArticulos, uBizContactos;
|
||||
|
||||
type
|
||||
IArticulosAlbaranProveedorController = interface(IArticulosController)
|
||||
['{8E3C2FF0-9D42-461C-BF14-6E77843E4173}']
|
||||
function ElegirArticulos(AArticulos : IBizArticulo; AMensaje: String; AMultiSelect: Boolean; const AProveedor: IBizProveedor): IBizArticulo;
|
||||
end;
|
||||
|
||||
TArticulosAlbaranProveedorController = class(TArticulosController, IArticulosAlbaranProveedorController)
|
||||
public
|
||||
function ElegirArticulos(AArticulos : IBizArticulo; AMensaje: String; AMultiSelect: Boolean): IBizArticulo; override;
|
||||
function ElegirArticulos(AArticulos : IBizArticulo; AMensaje: String; AMultiSelect: Boolean; const AProveedor: IBizProveedor): IBizArticulo; overload;
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -21,8 +22,7 @@ implementation
|
||||
|
||||
uses Controls, uIEditorElegirArticulosAlbaranesProveedor, uIEditorElegirArticulos;
|
||||
|
||||
function TArticulosAlbaranProveedorController.ElegirArticulos(AArticulos: IBizArticulo; AMensaje: String;
|
||||
AMultiSelect: Boolean): IBizArticulo;
|
||||
function TArticulosAlbaranProveedorController.ElegirArticulos(AArticulos: IBizArticulo; AMensaje: String; AMultiSelect: Boolean; const AProveedor: IBizProveedor): IBizArticulo;
|
||||
var
|
||||
AEditor : IEditorElegirArticulosAlbaranesProveedor;
|
||||
begin
|
||||
@ -33,6 +33,7 @@ begin
|
||||
begin
|
||||
Controller := Self;
|
||||
Articulos := AArticulos;
|
||||
Proveedor := AProveedor;
|
||||
MultiSelect := AMultiSelect;
|
||||
Mensaje := AMensaje;
|
||||
if IsPositiveResult(ShowModal) then
|
||||
|
||||
@ -31,7 +31,7 @@ type
|
||||
|
||||
implementation
|
||||
|
||||
uses Variants, uControllerDetallesBase, uControllerDetallesDTO, uDataModuleAlbaranesProveedor, uArticulosAlbaranProveedorController;
|
||||
uses Variants, uDialogUtils, uControllerDetallesBase, uControllerDetallesDTO, uDataModuleAlbaranesProveedor, uArticulosAlbaranProveedorController;
|
||||
|
||||
{ TDetallesAlbaranProveedorController }
|
||||
|
||||
@ -45,6 +45,7 @@ begin
|
||||
AArticulos := (FArticulosController.BuscarTodos(AProveedor) as IBizArticulo);
|
||||
ActualizarDetalles(ADetalles, AArticulos);
|
||||
EliminarArticulosProveedor(ADetalles);
|
||||
ShowInfoMessage('Se han eliminado todos los artículos que no pertenecen al nuevo proveedor seleccionado, y los que pertenecen sus descuentos han sido adaptados al proveedor seleccionado');
|
||||
finally
|
||||
AArticulos := Nil;
|
||||
end;
|
||||
@ -58,8 +59,8 @@ begin
|
||||
if Assigned(ADetalles) then
|
||||
begin
|
||||
try
|
||||
AArticulos := (FArticulosController.BuscarTodos(AProveedor) as IBizArticulo);
|
||||
AArticulos := (FArticulosController as IArticulosAlbaranProveedorController).ElegirArticulos(AArticulos, 'Elija los artículos que desea añadir a este albarán de proveedor', True);
|
||||
AArticulos := (FArticulosController.BuscarTodos as IBizArticulo);
|
||||
AArticulos := (FArticulosController as IArticulosAlbaranProveedorController).ElegirArticulos(AArticulos, 'Elija los artículos que desea añadir a este albarán de proveedor', True, AProveedor);
|
||||
Add(ADetalles, AArticulos);
|
||||
finally
|
||||
AArticulos := Nil;
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
inherited fEditorElegirArticulosAlbaranProveedor: TfEditorElegirArticulosAlbaranProveedor
|
||||
Caption = 'fEditorElegirArticulosAlbaranProveedor'
|
||||
ExplicitHeight = 480
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 13
|
||||
end
|
||||
|
||||
@ -9,12 +9,22 @@ uses
|
||||
StdActns, ActnList, uCustomView, uViewBase, uViewBarraSeleccion, ComCtrls,
|
||||
JvExComCtrls, JvStatusBar, TBX, TB2ExtItems, TBXExtItems, TB2Item, TB2Dock,
|
||||
TB2Toolbar, pngimage, ExtCtrls, JvExControls, JvComponent, JvNavigationPane,
|
||||
JvgWizardHeader, uIEditorElegirArticulosAlbaranesProveedor;
|
||||
JvgWizardHeader, uIEditorElegirArticulosAlbaranesProveedor, uBizContactos;
|
||||
|
||||
type
|
||||
TfEditorElegirArticulosAlbaranProveedor = class(TfEditorElegirArticulos, IEditorElegirArticulosAlbaranesProveedor)
|
||||
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
|
||||
private
|
||||
FProveedor: IBizProveedor;
|
||||
function GetProveedor: IBizProveedor;
|
||||
procedure SetProveedor(const Value: IBizProveedor);
|
||||
|
||||
protected
|
||||
procedure AsignarVista; override;
|
||||
|
||||
public
|
||||
property Proveedor: IBizProveedor read GetProveedor write SetProveedor;
|
||||
|
||||
end;
|
||||
|
||||
|
||||
@ -30,4 +40,26 @@ begin
|
||||
ViewGrid := CreateView(TfrViewElegirArticulosAlbaranesProveedor) as IViewElegirArticulosAlbaranesProveedor;
|
||||
end;
|
||||
|
||||
procedure TfEditorElegirArticulosAlbaranProveedor.FormCloseQuery(
|
||||
Sender: TObject; var CanClose: Boolean);
|
||||
begin
|
||||
FProveedor := Nil;
|
||||
inherited;
|
||||
end;
|
||||
|
||||
function TfEditorElegirArticulosAlbaranProveedor.GetProveedor: IBizProveedor;
|
||||
begin
|
||||
Result := FProveedor;
|
||||
end;
|
||||
|
||||
procedure TfEditorElegirArticulosAlbaranProveedor.SetProveedor(const Value: IBizProveedor);
|
||||
begin
|
||||
FProveedor := Value;
|
||||
if Assigned(FProveedor) then
|
||||
begin
|
||||
if Assigned(Self.ViewGrid) then
|
||||
(Self.ViewGrid as IViewElegirArticulosAlbaranesProveedor).Proveedor := FProveedor;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
@ -1,7 +1,55 @@
|
||||
inherited frViewElegirArticulosAlbaranesProveedor: TfrViewElegirArticulosAlbaranesProveedor
|
||||
Height = 414
|
||||
OnDestroy = CustomViewDestroy
|
||||
ExplicitHeight = 414
|
||||
inherited cxGrid: TcxGrid
|
||||
Height = 286
|
||||
RootLevelOptions.DetailTabsPosition = dtpTop
|
||||
OnActiveTabChanged = cxGridActiveTabChanged
|
||||
ExplicitHeight = 286
|
||||
inherited cxGridView: TcxGridDBTableView
|
||||
object cxGridViewID_PROVEEDOR: TcxGridDBColumn
|
||||
DataBinding.FieldName = 'ID_PROVEEDOR'
|
||||
Visible = False
|
||||
end
|
||||
end
|
||||
object cxGridLevel1: TcxGridLevel
|
||||
Caption = 'Otros proveedores'
|
||||
end
|
||||
end
|
||||
inherited frViewFiltroBase1: TfrViewFiltroBase
|
||||
inherited TBXDock1: TTBXDock
|
||||
inherited TBXDockablePanel1: TTBXDockablePanel
|
||||
inherited dxLayoutControl1: TdxLayoutControl
|
||||
inherited txtFiltroTodo: TcxTextEdit
|
||||
ExplicitWidth = 273
|
||||
Width = 273
|
||||
end
|
||||
inherited edtFechaIniFiltro: TcxDateEdit
|
||||
ExplicitWidth = 121
|
||||
Width = 121
|
||||
end
|
||||
inherited edtFechaFinFiltro: TcxDateEdit
|
||||
ExplicitWidth = 121
|
||||
Width = 121
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
inherited pnlAgrupaciones: TTBXDockablePanel
|
||||
Top = 388
|
||||
ExplicitTop = 388
|
||||
end
|
||||
inherited dxComponentPrinter: TdxComponentPrinter
|
||||
inherited dxComponentPrinterLink: TdxGridReportLink
|
||||
ReportDocument.CreationDate = 39252.489745000000000000
|
||||
BuiltInReportLink = True
|
||||
end
|
||||
end
|
||||
inherited dxPrintStyleManager1: TdxPrintStyleManager
|
||||
inherited dxPrintStyleManager1Style1: TdxPSPrintStyle
|
||||
BuiltInStyle = True
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -10,17 +10,99 @@ uses
|
||||
dxPSCompsProvider, dxPSFillPatterns, dxPSEdgePatterns, ImgList, PngImageList,
|
||||
cxGridCustomPopupMenu, cxGridPopupMenu, dxPSCore, dxPScxCommon, dxPScxGridLnk,
|
||||
uDADataTable, cxGridLevel, cxGridCustomTableView, cxGridTableView,
|
||||
cxGridDBTableView, cxClasses, cxControls, cxGridCustomView, cxGrid;
|
||||
cxGridDBTableView, cxClasses, cxControls, cxGridCustomView, cxGrid, uBizContactos,
|
||||
dxPgsDlg, ActnList, TB2Item, TBX, TB2Toolbar, TBXDkPanels, TB2Dock,
|
||||
uViewFiltroBase;
|
||||
|
||||
type
|
||||
IViewElegirArticulosAlbaranesProveedor = interface(IViewArticulos)
|
||||
['{93C55517-8F37-4EDF-A1B0-95461D0AD807}']
|
||||
function GetProveedor: IBizProveedor;
|
||||
procedure SetProveedor(const Value: IBizProveedor);
|
||||
property Proveedor: IBizProveedor read GetProveedor write SetProveedor;
|
||||
end;
|
||||
|
||||
TfrViewElegirArticulosAlbaranesProveedor = class(TfrViewArticulos, IViewElegirArticulosAlbaranesProveedor)
|
||||
cxGridLevel1: TcxGridLevel;
|
||||
cxGridViewID_PROVEEDOR: TcxGridDBColumn;
|
||||
procedure cxGridActiveTabChanged(Sender: TcxCustomGrid;
|
||||
ALevel: TcxGridLevel);
|
||||
procedure CustomViewDestroy(Sender: TObject);
|
||||
|
||||
private
|
||||
FProveedor: IBizProveedor;
|
||||
function GetProveedor: IBizProveedor;
|
||||
procedure SetProveedor(const Value: IBizProveedor);
|
||||
|
||||
//Filtros relativos a la vista
|
||||
procedure AnadirFiltroProveedor;
|
||||
|
||||
public
|
||||
property Proveedor: IBizProveedor read GetProveedor write SetProveedor;
|
||||
procedure AnadirOtrosFiltros; override;
|
||||
|
||||
end;
|
||||
|
||||
implementation
|
||||
{$R *.dfm}
|
||||
|
||||
{ TfrViewElegirArticulosAlbaranesProveedor }
|
||||
|
||||
procedure TfrViewElegirArticulosAlbaranesProveedor.AnadirFiltroProveedor;
|
||||
var
|
||||
FFiltro : TcxFilterCriteriaItemList;
|
||||
begin
|
||||
FFiltro := AddFilterGrid(fboAnd);
|
||||
|
||||
case cxGrid.ActiveLevel.Index of
|
||||
0 : if Assigned(FProveedor) then
|
||||
FFiltro.AddItem(cxGridViewID_PROVEEDOR, foEqual, FProveedor.ID, FProveedor.NOMBRE);
|
||||
1 : if Assigned(FProveedor) then
|
||||
FFiltro.AddItem(cxGridViewID_PROVEEDOR, foNotEqual, FProveedor.ID, FProveedor.NOMBRE);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrViewElegirArticulosAlbaranesProveedor.AnadirOtrosFiltros;
|
||||
begin
|
||||
inherited;
|
||||
|
||||
AnadirFiltroProveedor;
|
||||
|
||||
//Finalmente activamos el filtro si tenemos algo
|
||||
if cxGridView.DataController.Filter.IsEmpty
|
||||
then cxGridView.DataController.Filter.Active := False
|
||||
else cxGridView.DataController.Filter.Active := True;
|
||||
cxGrid.ActiveLevel.GridView := cxGridView;
|
||||
end;
|
||||
|
||||
procedure TfrViewElegirArticulosAlbaranesProveedor.CustomViewDestroy(
|
||||
Sender: TObject);
|
||||
begin
|
||||
inherited;
|
||||
FProveedor := Nil;
|
||||
end;
|
||||
|
||||
procedure TfrViewElegirArticulosAlbaranesProveedor.cxGridActiveTabChanged(
|
||||
Sender: TcxCustomGrid; ALevel: TcxGridLevel);
|
||||
begin
|
||||
inherited;
|
||||
RefrescarFiltro;
|
||||
end;
|
||||
|
||||
function TfrViewElegirArticulosAlbaranesProveedor.GetProveedor: IBizProveedor;
|
||||
begin
|
||||
Result := FProveedor;
|
||||
end;
|
||||
|
||||
procedure TfrViewElegirArticulosAlbaranesProveedor.SetProveedor(
|
||||
const Value: IBizProveedor);
|
||||
begin
|
||||
FProveedor := Value;
|
||||
if Assigned(FProveedor) then
|
||||
begin
|
||||
cxGridLevel.Caption := FProveedor.NOMBRE;
|
||||
RefrescarFiltro;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
@ -2,6 +2,7 @@ inherited fEditorElegirArticulos: TfEditorElegirArticulos
|
||||
Caption = 'Seleccionar art'#237'culos'
|
||||
ClientWidth = 656
|
||||
ExplicitWidth = 664
|
||||
ExplicitHeight = 478
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 13
|
||||
object JvgWizardHeader1: TJvgWizardHeader [0]
|
||||
@ -55,7 +56,7 @@ inherited fEditorElegirArticulos: TfEditorElegirArticulos
|
||||
inherited tbxMain: TTBXToolbar
|
||||
Align = alLeft
|
||||
DockPos = -6
|
||||
ExplicitWidth = 346
|
||||
ExplicitWidth = 117
|
||||
inherited TBXItem2: TTBXItem
|
||||
Visible = False
|
||||
end
|
||||
@ -73,12 +74,12 @@ inherited fEditorElegirArticulos: TfEditorElegirArticulos
|
||||
end
|
||||
end
|
||||
inherited tbxFiltro: TTBXToolbar
|
||||
Left = 346
|
||||
Left = 117
|
||||
Top = 23
|
||||
Align = alLeft
|
||||
DockPos = 101
|
||||
DockRow = 1
|
||||
ExplicitLeft = 346
|
||||
ExplicitLeft = 117
|
||||
ExplicitTop = 23
|
||||
inherited TBXItem34: TTBXItem
|
||||
Action = actQuitarFiltro2
|
||||
@ -136,6 +137,15 @@ inherited fEditorElegirArticulos: TfEditorElegirArticulos
|
||||
inherited EditorActionList: TActionList [5]
|
||||
Left = 112
|
||||
Top = 192
|
||||
inherited actPrevisualizar: TAction
|
||||
Visible = False
|
||||
end
|
||||
inherited actImprimir: TAction
|
||||
Visible = False
|
||||
end
|
||||
inherited actDuplicar: TAction
|
||||
Visible = False
|
||||
end
|
||||
end
|
||||
inherited SmallImages: TPngImageList [6]
|
||||
end
|
||||
|
||||
@ -68,7 +68,7 @@ uses
|
||||
Variants, Dialogs, cxControls, DB, uEditorRegistryUtils, schComisionesClient_Intf,
|
||||
uIEditorComisiones, uDataModuleComisiones, uDataModuleUsuarios,
|
||||
uDAInterfaces, uDataTableUtils, uIEditorComision, uComisionesReportController,
|
||||
uDateUtils, uROTypes, DateUtils, Controls, Windows;
|
||||
uDateUtils, uROTypes, DateUtils, Controls, Windows, uDialogUtils;
|
||||
|
||||
{ TComisionesController }
|
||||
|
||||
@ -384,7 +384,7 @@ begin
|
||||
AFacturasDesglosadas := Nil;
|
||||
end
|
||||
else
|
||||
Showmessage('Debe elegir primero el agente asociado a la liquidación');
|
||||
ShowWarningMessage('Debe elegir primero el agente asociado a la liquidación');
|
||||
end;
|
||||
|
||||
function TComisionesController.Eliminar(AComision: IBizComisiones): Boolean;
|
||||
|
||||
@ -1,20 +1,9 @@
|
||||
inherited fEditorComisionesPreview: TfEditorComisionesPreview
|
||||
Caption = 'Previsualizar la factura'
|
||||
ExplicitWidth = 658
|
||||
ExplicitHeight = 492
|
||||
ExplicitWidth = 320
|
||||
ExplicitHeight = 240
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 13
|
||||
inherited JvNavPanelHeader: TJvNavPanelHeader
|
||||
ExplicitWidth = 650
|
||||
inherited Image1: TImage
|
||||
Left = 623
|
||||
ExplicitLeft = 623
|
||||
end
|
||||
end
|
||||
inherited StatusBar: TJvStatusBar
|
||||
ExplicitTop = 439
|
||||
ExplicitWidth = 650
|
||||
end
|
||||
object pnlFiltrar: TTBXDockablePanel [3]
|
||||
Left = 0
|
||||
Top = 102
|
||||
|
||||
@ -44,7 +44,7 @@ type
|
||||
implementation
|
||||
{$R *.dfm}
|
||||
|
||||
uses uROTypes, uBizContactos, uAgentesController;
|
||||
uses uROTypes, uDialogUtils, uBizContactos, uAgentesController;
|
||||
|
||||
procedure TfEditorComisionesPreview.Button1Click(Sender: TObject);
|
||||
begin
|
||||
@ -98,7 +98,7 @@ begin
|
||||
begin
|
||||
if (edtFechaFiltro1.EditValue > edtFechaFiltro2.EditValue) then
|
||||
begin
|
||||
ShowMessage('La fecha de inicio debe ser anterior a la fecha final');
|
||||
ShowWarningMessage('La fecha de inicio debe ser anterior a la fecha final');
|
||||
edtFechaFiltro1.SetFocus;
|
||||
end
|
||||
else
|
||||
|
||||
@ -40,7 +40,7 @@ implementation
|
||||
{ TDetallesFacturaClienteController }
|
||||
|
||||
uses Variants, uControllerDetallesDTO, uDataModuleFacturasCliente, uArticulosFacturaClienteController,
|
||||
uControllerDetallesBase, Dialogs, SysUtils;
|
||||
uControllerDetallesBase, Dialogs, uDialogUtils, SysUtils;
|
||||
|
||||
procedure TDetallesFacturaClienteController.ActualizarDetalles(ADetalles: IDAStronglyTypedDataTable; ACliente: IBizCliente);
|
||||
var
|
||||
@ -51,7 +51,7 @@ begin
|
||||
try
|
||||
AArticulos := (FArticulosController.BuscarTodos(ACliente) as IBizArticulo);
|
||||
ActualizarDetalles(ADetalles, AArticulos);
|
||||
ShowMessage('Se han actualizado los descuentos para el cliente seleccionado');
|
||||
ShowInfoMessage('Se han actualizado los descuentos para el cliente seleccionado');
|
||||
finally
|
||||
AArticulos := Nil;
|
||||
end;
|
||||
|
||||
@ -40,7 +40,7 @@ inherited fEditorElegirFacturasCliente: TfEditorElegirFacturasCliente
|
||||
ExplicitWidth = 656
|
||||
end
|
||||
inherited JvNavPanelHeader: TJvNavPanelHeader
|
||||
Top = 144
|
||||
Top = 60
|
||||
Width = 654
|
||||
Caption = 'Lista de facturas de cliente para liquidar su comisi'#243'n'
|
||||
Visible = False
|
||||
@ -52,14 +52,17 @@ inherited fEditorElegirFacturasCliente: TfEditorElegirFacturasCliente
|
||||
end
|
||||
end
|
||||
inherited TBXDock: TTBXDock
|
||||
Top = 171
|
||||
Top = 87
|
||||
Width = 654
|
||||
Height = 49
|
||||
ExplicitTop = 171
|
||||
ExplicitWidth = 654
|
||||
ExplicitHeight = 49
|
||||
inherited tbxMain: TTBXToolbar
|
||||
ExplicitWidth = 181
|
||||
ExplicitWidth = 117
|
||||
inherited TBXSubmenuItem2: TTBXSubmenuItem
|
||||
Visible = False
|
||||
end
|
||||
inherited TBXItem5: TTBXItem
|
||||
Visible = False
|
||||
end
|
||||
@ -71,12 +74,12 @@ inherited fEditorElegirFacturasCliente: TfEditorElegirFacturasCliente
|
||||
end
|
||||
end
|
||||
inherited tbxFiltro: TTBXToolbar
|
||||
Left = 181
|
||||
Left = 117
|
||||
Top = 23
|
||||
DockPos = 104
|
||||
DockRow = 1
|
||||
Visible = False
|
||||
ExplicitLeft = 181
|
||||
ExplicitLeft = 117
|
||||
ExplicitTop = 23
|
||||
inherited TBXItem34: TTBXItem
|
||||
Action = actQuitarFiltro2
|
||||
@ -136,15 +139,15 @@ inherited fEditorElegirFacturasCliente: TfEditorElegirFacturasCliente
|
||||
end
|
||||
end
|
||||
inherited frViewFacturasCliente1: TfrViewFacturasCliente [5]
|
||||
Top = 220
|
||||
Top = 136
|
||||
Width = 654
|
||||
Height = 391
|
||||
Height = 475
|
||||
ExplicitTop = 220
|
||||
ExplicitWidth = 654
|
||||
ExplicitHeight = 391
|
||||
inherited cxGrid: TcxGrid
|
||||
Width = 654
|
||||
Height = 263
|
||||
Height = 347
|
||||
RootLevelOptions.DetailTabsPosition = dtpNone
|
||||
ExplicitWidth = 654
|
||||
ExplicitHeight = 263
|
||||
@ -171,6 +174,7 @@ inherited fEditorElegirFacturasCliente: TfEditorElegirFacturasCliente
|
||||
end
|
||||
inherited frViewFiltroBase1: TfrViewFiltroBase
|
||||
Width = 654
|
||||
Visible = True
|
||||
ExplicitWidth = 654
|
||||
inherited TBXDock1: TTBXDock
|
||||
Width = 654
|
||||
@ -180,6 +184,20 @@ inherited fEditorElegirFacturasCliente: TfEditorElegirFacturasCliente
|
||||
inherited dxLayoutControl1: TdxLayoutControl
|
||||
Width = 650
|
||||
ExplicitWidth = 650
|
||||
inherited txtFiltroTodo: TcxTextEdit
|
||||
ExplicitWidth = 273
|
||||
Width = 273
|
||||
end
|
||||
inherited edtFechaIniFiltro: TcxDateEdit
|
||||
ExplicitWidth = 121
|
||||
Width = 121
|
||||
end
|
||||
inherited edtFechaFinFiltro: TcxDateEdit
|
||||
Left = 401
|
||||
ExplicitLeft = 401
|
||||
ExplicitWidth = 121
|
||||
Width = 121
|
||||
end
|
||||
end
|
||||
inherited TBXAlignmentPanel1: TTBXAlignmentPanel
|
||||
Width = 650
|
||||
@ -193,13 +211,15 @@ inherited fEditorElegirFacturasCliente: TfEditorElegirFacturasCliente
|
||||
end
|
||||
end
|
||||
inherited pnlAgrupaciones: TTBXDockablePanel
|
||||
Top = 365
|
||||
Top = 449
|
||||
ExplicitTop = 365
|
||||
ExplicitWidth = 654
|
||||
inherited TBXAlignmentPanel1: TTBXAlignmentPanel
|
||||
Width = 654
|
||||
ExplicitWidth = 654
|
||||
inherited TBXToolbar1: TTBXToolbar
|
||||
Width = 644
|
||||
ExplicitWidth = 644
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -222,145 +242,7 @@ inherited fEditorElegirFacturasCliente: TfEditorElegirFacturasCliente
|
||||
end
|
||||
end
|
||||
end
|
||||
object pnlFiltrar: TTBXDockablePanel [6]
|
||||
Left = 0
|
||||
Top = 60
|
||||
Align = alTop
|
||||
Caption = 'Filtrar'
|
||||
CaptionRotation = dpcrAlwaysVert
|
||||
DockedHeight = 84
|
||||
DockMode = dmCannotFloat
|
||||
DockPos = 88
|
||||
DockRow = 2
|
||||
FloatingWidth = 128
|
||||
FloatingHeight = 84
|
||||
ShowCaptionWhenDocked = False
|
||||
SupportedDocks = [dkStandardDock, dkMultiDock]
|
||||
TabOrder = 5
|
||||
object Label1: TLabel
|
||||
Left = 296
|
||||
Top = 50
|
||||
Width = 17
|
||||
Height = 13
|
||||
Caption = 'y el'
|
||||
end
|
||||
object txtFiltroTodo: TcxTextEdit
|
||||
Left = 168
|
||||
Top = 16
|
||||
Properties.OnChange = txtFiltroTodoPropertiesChange
|
||||
Style.LookAndFeel.Kind = lfStandard
|
||||
Style.LookAndFeel.NativeStyle = True
|
||||
StyleDisabled.LookAndFeel.Kind = lfStandard
|
||||
StyleDisabled.LookAndFeel.NativeStyle = True
|
||||
StyleFocused.LookAndFeel.Kind = lfStandard
|
||||
StyleFocused.LookAndFeel.NativeStyle = True
|
||||
StyleHot.LookAndFeel.Kind = lfStandard
|
||||
StyleHot.LookAndFeel.NativeStyle = True
|
||||
TabOrder = 0
|
||||
Width = 273
|
||||
end
|
||||
object edtFechaFiltro1: TcxDateEdit
|
||||
Left = 168
|
||||
Top = 46
|
||||
Enabled = False
|
||||
Properties.OnEditValueChanged = edtFechaFiltro1PropertiesEditValueChanged
|
||||
Style.LookAndFeel.Kind = lfStandard
|
||||
Style.LookAndFeel.NativeStyle = True
|
||||
StyleDisabled.LookAndFeel.Kind = lfStandard
|
||||
StyleDisabled.LookAndFeel.NativeStyle = True
|
||||
StyleFocused.LookAndFeel.Kind = lfStandard
|
||||
StyleFocused.LookAndFeel.NativeStyle = True
|
||||
StyleHot.LookAndFeel.Kind = lfStandard
|
||||
StyleHot.LookAndFeel.NativeStyle = True
|
||||
TabOrder = 1
|
||||
Width = 121
|
||||
end
|
||||
object edtFechaFiltro2: TcxDateEdit
|
||||
Left = 320
|
||||
Top = 46
|
||||
Enabled = False
|
||||
Properties.OnEditValueChanged = edtFechaFiltro1PropertiesEditValueChanged
|
||||
Style.LookAndFeel.Kind = lfStandard
|
||||
Style.LookAndFeel.NativeStyle = True
|
||||
StyleDisabled.LookAndFeel.Kind = lfStandard
|
||||
StyleDisabled.LookAndFeel.NativeStyle = True
|
||||
StyleFocused.LookAndFeel.Kind = lfStandard
|
||||
StyleFocused.LookAndFeel.NativeStyle = True
|
||||
StyleHot.LookAndFeel.Kind = lfStandard
|
||||
StyleHot.LookAndFeel.NativeStyle = True
|
||||
TabOrder = 2
|
||||
Width = 121
|
||||
end
|
||||
object rbTodo: TcxRadioButton
|
||||
Left = 16
|
||||
Top = 18
|
||||
Width = 145
|
||||
Height = 17
|
||||
Caption = 'Facturas que contengan:'
|
||||
Checked = True
|
||||
TabOrder = 3
|
||||
TabStop = True
|
||||
OnClick = rbTodoClick
|
||||
LookAndFeel.Kind = lfStandard
|
||||
LookAndFeel.NativeStyle = True
|
||||
end
|
||||
object rbFechas: TcxRadioButton
|
||||
Left = 16
|
||||
Top = 48
|
||||
Width = 145
|
||||
Height = 17
|
||||
Caption = 'Facturas con fechas entre:'
|
||||
TabOrder = 4
|
||||
OnClick = rbTodoClick
|
||||
LookAndFeel.Kind = lfStandard
|
||||
LookAndFeel.NativeStyle = True
|
||||
end
|
||||
object Button1: TBitBtn
|
||||
Left = 470
|
||||
Top = 43
|
||||
Width = 163
|
||||
Height = 25
|
||||
Action = actQuitarFiltro2
|
||||
Caption = 'Quitar filtro y ver todo'
|
||||
TabOrder = 5
|
||||
Glyph.Data = {
|
||||
36040000424D3604000000000000360000002800000010000000100000000100
|
||||
2000000000000004000000000000000000000000000000000000FF00FF00FF00
|
||||
FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00A505
|
||||
E1007204CA00FE00FF00FF00FF00FF00FF00E800F5003E09C100FF00FF00FF00
|
||||
FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00AB17
|
||||
F900161DC600C400E700FF00FF00FF00FF00520DC9000F30D600D71BCF00942A
|
||||
8A004D493C004D493C00942A8A00D71BCF00FF00FF00FF00FF00D71BCF008B2C
|
||||
92002843B900141B980070208D004615BA000F30D600C20BF80069605800F8D5
|
||||
AD00F8C89000F8C89000E7AB63004D493C00FF00FF00FF00FF0069605800F8D5
|
||||
AD00C8ACA6001036E4002125A6000F30D600B20EF600FF00FF0069605800FFD8
|
||||
C000F8D5AD00F8C89000F8C890004D493C004D493C004D493C0069605800FFD8
|
||||
C000EFCDAD005F65C6000A38ED002637A300927C6C00FF00FF0069605800F0F0
|
||||
F000FFD8C000F8D5AD00F8C8900069605800696058006960580069605800FFF8
|
||||
FF008372B1000F30D6002750F7000F30D60025256F00FF00FF00942A8A006960
|
||||
58006960580069605800942A8A00D71BCF00FF00FF00FF00FF00D71BCF004F24
|
||||
9E000F30D600434D8A00605D6C004D69E3000F30D6006D05CC00FF00FF006648
|
||||
54004D493C00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF000F30
|
||||
D6008F1FF300FF00FF00FF00FF00C811FD003154EB000024D300FF00FF00FF00
|
||||
FF00664854004D493C00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
|
||||
FF00FF00FF00FF00FF00FF00FF004D493C004D493C00FF00FF00FF00FF00FF00
|
||||
FF00FF00FF0066485400696058004D493C00FF00FF00FF00FF00FF00FF00FF00
|
||||
FF00FF00FF00FF00FF00FF00FF00696058004D493C00FF00FF00FF00FF00FF00
|
||||
FF00FF00FF00FF00FF0066485400D419D000FF00FF00FF00FF00FF00FF00FF00
|
||||
FF00FF00FF00FF00FF00FF00FF00A8658D0069605800FF00FF00FF00FF00FF00
|
||||
FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
|
||||
FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
|
||||
FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
|
||||
FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
|
||||
FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
|
||||
FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
|
||||
FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
|
||||
FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
|
||||
FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
|
||||
FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00}
|
||||
end
|
||||
end
|
||||
inherited EditorActionList: TActionList [9]
|
||||
inherited EditorActionList: TActionList [8]
|
||||
Left = 112
|
||||
Top = 192
|
||||
inherited actNuevo: TAction
|
||||
@ -383,19 +265,19 @@ inherited fEditorElegirFacturasCliente: TfEditorElegirFacturasCliente
|
||||
Left = 8
|
||||
Top = 192
|
||||
end
|
||||
inherited JvFormStorage: TJvFormStorage [13]
|
||||
inherited JvFormStorage: TJvFormStorage [12]
|
||||
end
|
||||
inherited GridPopupMenu: TPopupMenu [14]
|
||||
inherited GridPopupMenu: TPopupMenu [13]
|
||||
Left = 80
|
||||
Top = 192
|
||||
end
|
||||
inherited JsNuevaFacturaDialog: TJSDialog [15]
|
||||
inherited JsNuevaFacturaDialog: TJSDialog [14]
|
||||
end
|
||||
inherited JsListaFacturasGeneradas: TJSDialog [16]
|
||||
inherited JsListaFacturasGeneradas: TJSDialog [15]
|
||||
end
|
||||
inherited JsPrevisualizarDialog: TJSDialog [17]
|
||||
inherited JsPrevisualizarDialog: TJSDialog [16]
|
||||
end
|
||||
inherited JsImprimirDialog: TJSDialog [18]
|
||||
inherited JsImprimirDialog: TJSDialog [17]
|
||||
end
|
||||
object EditorSeleccionActionList: TActionList
|
||||
Images = SmallImages
|
||||
@ -411,7 +293,6 @@ inherited fEditorElegirFacturasCliente: TfEditorElegirFacturasCliente
|
||||
Category = 'Buscar'
|
||||
Caption = 'Quitar filtro y ver todo'
|
||||
ImageIndex = 19
|
||||
OnExecute = actQuitarFiltro2Execute
|
||||
end
|
||||
object actAnchoAuto2: TAction
|
||||
Category = 'Ver'
|
||||
|
||||
@ -38,7 +38,7 @@ uses
|
||||
uViewFacturasCliente, uEditorFacturasCliente, uBizFacturasCliente, uIEditorElegirFacturasCliente,
|
||||
Buttons, cxRadioGroup, cxMaskEdit, cxDropDownEdit, cxCalendar, cxControls,
|
||||
cxContainer, cxEdit, cxTextEdit, TBXDkPanels, JSDialog;
|
||||
|
||||
|
||||
|
||||
type
|
||||
TfEditorElegirFacturasCliente = class(TfEditorFacturasCliente, IEditorElegirFacturasCliente)
|
||||
@ -48,23 +48,11 @@ type
|
||||
actBuscar2: TAction;
|
||||
actQuitarFiltro2: TAction;
|
||||
actAnchoAuto2: TAction;
|
||||
pnlFiltrar: TTBXDockablePanel;
|
||||
Label1: TLabel;
|
||||
txtFiltroTodo: TcxTextEdit;
|
||||
edtFechaFiltro1: TcxDateEdit;
|
||||
edtFechaFiltro2: TcxDateEdit;
|
||||
rbTodo: TcxRadioButton;
|
||||
rbFechas: TcxRadioButton;
|
||||
Button1: TBitBtn;
|
||||
procedure frViewBarraSeleccion1actSeleccionarUpdate(Sender: TObject);
|
||||
procedure frViewBarraSeleccion1actCancelarExecute(Sender: TObject);
|
||||
procedure frViewBarraSeleccion1actSeleccionarExecute(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure actAnchoAuto2Execute(Sender: TObject);
|
||||
procedure actQuitarFiltro2Execute(Sender: TObject);
|
||||
procedure txtFiltroTodoPropertiesChange(Sender: TObject);
|
||||
procedure edtFechaFiltro1PropertiesEditValueChanged(Sender: TObject);
|
||||
procedure rbTodoClick(Sender: TObject);
|
||||
protected
|
||||
procedure SetMultiSelect (AValue : Boolean);
|
||||
function GetMultiSelect : Boolean;
|
||||
@ -82,7 +70,7 @@ implementation
|
||||
|
||||
uses
|
||||
uEditorGridBase, cxGridCustomTableView, uIntegerListUtils, uDBSelectionListUtils,
|
||||
uGridUtils, uEditorBase, uFacturasClienteController;
|
||||
uGridUtils, uDialogUtils, uEditorBase, uFacturasClienteController, uDateUtils;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
@ -94,40 +82,13 @@ begin
|
||||
actAnchoAuto.Execute;
|
||||
end;
|
||||
|
||||
procedure TfEditorElegirFacturasCliente.actQuitarFiltro2Execute(Sender: TObject);
|
||||
begin
|
||||
// inherited;
|
||||
|
||||
if Assigned(ViewGrid) then
|
||||
begin
|
||||
txtFiltroTodo.Clear;
|
||||
edtFechaFiltro1.Clear;
|
||||
edtFechaFiltro2.Clear;
|
||||
// (ViewGrid as IViewFacturasCliente).FiltrarPorFechas(null, null);
|
||||
inherited;
|
||||
end;
|
||||
|
||||
// actQuitarFiltro.Execute;
|
||||
end;
|
||||
|
||||
procedure TfEditorElegirFacturasCliente.edtFechaFiltro1PropertiesEditValueChanged(Sender: TObject);
|
||||
begin
|
||||
if not VarIsNull(edtFechaFiltro1.EditValue) and not VarIsNull(edtFechaFiltro2.EditValue) then
|
||||
begin
|
||||
if (edtFechaFiltro1.EditValue > edtFechaFiltro2.EditValue) then
|
||||
begin
|
||||
ShowMessage('La fecha de inicio debe ser anterior a la fecha final');
|
||||
edtFechaFiltro1.SetFocus;
|
||||
end
|
||||
else
|
||||
// (ViewGrid as IViewFacturasCliente).FiltrarPorFechas(edtFechaFiltro1.EditValue, edtFechaFiltro2.EditValue);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfEditorElegirFacturasCliente.FormShow(Sender: TObject);
|
||||
begin
|
||||
inherited;
|
||||
EditorActionList.State := asSuspended;
|
||||
|
||||
frViewFacturasCliente1.frViewFiltroBase1.edtFechaIniFiltro.EditValue := darFechaPrimerDia(now);
|
||||
frViewFacturasCliente1.frViewFiltroBase1.edtFechaFinFiltro.EditValue := darFechaUltimoDia(now);
|
||||
end;
|
||||
|
||||
procedure TfEditorElegirFacturasCliente.frViewBarraSeleccion1actCancelarExecute(
|
||||
@ -158,23 +119,6 @@ begin
|
||||
Result := (Controller as IFacturasClienteController).ExtraerSeleccionados(Facturas) as IBizFacturaCliente;
|
||||
end;
|
||||
|
||||
procedure TfEditorElegirFacturasCliente.rbTodoClick(Sender: TObject);
|
||||
begin
|
||||
actQuitarFiltro.Execute;
|
||||
|
||||
if rbTodo.Checked then
|
||||
begin
|
||||
edtFechaFiltro1.Enabled := False;
|
||||
edtFechaFiltro2.Enabled := False;
|
||||
txtFiltroTodo.Enabled := True;
|
||||
end
|
||||
else begin
|
||||
edtFechaFiltro1.Enabled := True;
|
||||
edtFechaFiltro2.Enabled := True;
|
||||
txtFiltroTodo.Enabled := False;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TfEditorElegirFacturasCliente.GetMensaje: String;
|
||||
begin
|
||||
Result := JvgWizardHeader1.Comments.Text;
|
||||
@ -201,10 +145,4 @@ begin
|
||||
ViewGrid.OnDblClick := frViewBarraSeleccion1.actSeleccionar.OnExecute;
|
||||
end;
|
||||
|
||||
procedure TfEditorElegirFacturasCliente.txtFiltroTodoPropertiesChange(Sender: TObject);
|
||||
begin
|
||||
if Assigned(ViewGrid) then
|
||||
ViewGrid.Filter := txtFiltroTodo.Text;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
@ -127,6 +127,24 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente
|
||||
ExplicitWidth = 332
|
||||
inherited edtlNombre: TcxDBTextEdit
|
||||
Properties.OnChange = frViewClienteFacturaedtlNombrePropertiesChange
|
||||
ExplicitWidth = 224
|
||||
Width = 224
|
||||
end
|
||||
inherited edtNIFCIF: TcxDBTextEdit
|
||||
ExplicitWidth = 562
|
||||
Width = 562
|
||||
end
|
||||
inherited edtCalle: TcxDBTextEdit
|
||||
ExplicitWidth = 562
|
||||
Width = 562
|
||||
end
|
||||
inherited edtPoblacion: TcxDBTextEdit
|
||||
ExplicitWidth = 177
|
||||
Width = 177
|
||||
end
|
||||
inherited edtProvincia: TcxDBTextEdit
|
||||
ExplicitWidth = 327
|
||||
Width = 327
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -295,7 +295,7 @@ begin
|
||||
ACadena := 'Antes debe elegir un cliente para esta factura'
|
||||
else
|
||||
ACadena := 'Antes debe elegir un cliente para este abono';
|
||||
Showmessage(ACadena);
|
||||
ShowWarningMessage(ACadena);
|
||||
AllowChange := False;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -3,11 +3,14 @@ unit uIEditorElegirArticulosFacturasProveedor;
|
||||
interface
|
||||
|
||||
uses
|
||||
uIEditorElegirArticulos;
|
||||
uIEditorElegirArticulos, uBizContactos;
|
||||
|
||||
type
|
||||
IEditorElegirArticulosFacturasProveedor = interface(IEditorElegirArticulos)
|
||||
['{21C9BC41-C4B2-44CD-BCB3-F32A4BD5AC4E}']
|
||||
function GetProveedor: IBizProveedor;
|
||||
procedure SetProveedor(const Value: IBizProveedor);
|
||||
property Proveedor: IBizProveedor read GetProveedor write SetProveedor;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
@ -3,16 +3,17 @@ unit uArticulosFacturaProveedorController;
|
||||
interface
|
||||
|
||||
uses
|
||||
uDADataTable, uArticulosController, uBizArticulos;
|
||||
uDADataTable, uArticulosController, uBizArticulos, uBizContactos;
|
||||
|
||||
type
|
||||
IArticulosFacturaProveedorController = interface(IArticulosController)
|
||||
['{9B6F6963-D16F-43FE-B33F-47824A5FAFE7}']
|
||||
function ElegirArticulos(AArticulos : IBizArticulo; AMensaje: String; AMultiSelect: Boolean; const AProveedor: IBizProveedor): IBizArticulo;
|
||||
end;
|
||||
|
||||
TArticulosFacturaProveedorController = class(TArticulosController, IArticulosFacturaProveedorController)
|
||||
public
|
||||
function ElegirArticulos(AArticulos : IBizArticulo; AMensaje: String; AMultiSelect: Boolean): IBizArticulo; override;
|
||||
function ElegirArticulos(AArticulos : IBizArticulo; AMensaje: String; AMultiSelect: Boolean; const AProveedor: IBizProveedor): IBizArticulo; overload;
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -22,7 +23,7 @@ implementation
|
||||
uses Controls, uIEditorElegirArticulosFacturasProveedor, uIEditorElegirArticulos;
|
||||
|
||||
function TArticulosFacturaProveedorController.ElegirArticulos(AArticulos: IBizArticulo; AMensaje: String;
|
||||
AMultiSelect: Boolean): IBizArticulo;
|
||||
AMultiSelect: Boolean; const AProveedor: IBizProveedor): IBizArticulo;
|
||||
var
|
||||
AEditor : IEditorElegirArticulosFacturasProveedor;
|
||||
begin
|
||||
@ -33,11 +34,12 @@ begin
|
||||
begin
|
||||
Controller := Self;
|
||||
Articulos := AArticulos;
|
||||
Proveedor := AProveedor;
|
||||
MultiSelect := AMultiSelect;
|
||||
Mensaje := AMensaje;
|
||||
Mensaje := AMensaje;
|
||||
if IsPositiveResult(ShowModal) then
|
||||
Result := ArticulosSeleccionados;
|
||||
Release;
|
||||
Release;
|
||||
end;
|
||||
finally
|
||||
AEditor := NIL;
|
||||
|
||||
@ -37,7 +37,7 @@ implementation
|
||||
{ TDetallesFacturaProveedorController }
|
||||
|
||||
uses Variants, uControllerDetallesDTO, uDataModuleFacturasProveedor, uArticulosFacturaProveedorController,
|
||||
uControllerDetallesBase, Dialogs, SysUtils;
|
||||
uControllerDetallesBase, Dialogs, SysUtils, uDialogUtils;
|
||||
|
||||
procedure TDetallesFacturaProveedorController.ActualizarDetalles(ADetalles: IDAStronglyTypedDataTable; AProveedor: IBizProveedor);
|
||||
var
|
||||
@ -48,7 +48,8 @@ begin
|
||||
try
|
||||
AArticulos := (FArticulosController.BuscarTodos(AProveedor) as IBizArticulo);
|
||||
ActualizarDetalles(ADetalles, AArticulos);
|
||||
ShowMessage('Se han actualizado los descuentos para el Proveedor seleccionado');
|
||||
EliminarArticulosProveedor(ADetalles);
|
||||
ShowInfoMessage('Se han eliminado todos los artículos que no pertenecen al nuevo proveedor seleccionado, y los que pertenecen sus descuentos han sido adaptados al proveedor seleccionado');
|
||||
finally
|
||||
AArticulos := Nil;
|
||||
end;
|
||||
@ -61,9 +62,9 @@ var
|
||||
begin
|
||||
if Assigned(ADetalles) then
|
||||
begin
|
||||
AArticulos := (FArticulosController.BuscarTodos(AProveedor) as IBizArticulo);
|
||||
AArticulos := (FArticulosController.BuscarTodos as IBizArticulo);
|
||||
try
|
||||
AArticulos := (FArticulosController as IArticulosFacturaProveedorController).ElegirArticulos(AArticulos, 'Elija los artículos que desea añadir a esta factura de Proveedor', True);
|
||||
AArticulos := (FArticulosController as IArticulosFacturaProveedorController).ElegirArticulos(AArticulos, 'Elija los artículos que desea añadir a esta factura de Proveedor', True, AProveedor);
|
||||
Add(ADetalles, AArticulos);
|
||||
finally
|
||||
AArticulos := Nil;
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
inherited fEditorElegirArticulosFacturaProveedor: TfEditorElegirArticulosFacturaProveedor
|
||||
Caption = 'fEditorElegirArticulosFacturaProveedor'
|
||||
ExplicitHeight = 478
|
||||
ExplicitWidth = 320
|
||||
ExplicitHeight = 240
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 13
|
||||
end
|
||||
|
||||
@ -9,12 +9,22 @@ uses
|
||||
StdActns, ActnList, uCustomView, uViewBase, uViewBarraSeleccion, ComCtrls,
|
||||
JvExComCtrls, JvStatusBar, TBX, TB2ExtItems, TBXExtItems, TB2Item, TB2Dock,
|
||||
TB2Toolbar, pngimage, ExtCtrls, JvExControls, JvComponent, JvNavigationPane,
|
||||
JvgWizardHeader, uIEditorElegirArticulosFacturasProveedor;
|
||||
JvgWizardHeader, uIEditorElegirArticulosFacturasProveedor, uBizContactos;
|
||||
|
||||
type
|
||||
TfEditorElegirArticulosFacturaProveedor = class(TfEditorElegirArticulos, IEditorElegirArticulosFacturasProveedor)
|
||||
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
|
||||
private
|
||||
FProveedor: IBizProveedor;
|
||||
function GetProveedor: IBizProveedor;
|
||||
procedure SetProveedor(const Value: IBizProveedor);
|
||||
|
||||
protected
|
||||
procedure AsignarVista; override;
|
||||
|
||||
public
|
||||
property Proveedor: IBizProveedor read GetProveedor write SetProveedor;
|
||||
|
||||
end;
|
||||
|
||||
|
||||
@ -30,4 +40,26 @@ begin
|
||||
ViewGrid := CreateView(TfrViewElegirArticulosFacturasProveedor) as IViewElegirArticulosFacturasProveedor;
|
||||
end;
|
||||
|
||||
procedure TfEditorElegirArticulosFacturaProveedor.FormCloseQuery(
|
||||
Sender: TObject; var CanClose: Boolean);
|
||||
begin
|
||||
FProveedor := Nil;
|
||||
inherited;
|
||||
end;
|
||||
|
||||
function TfEditorElegirArticulosFacturaProveedor.GetProveedor: IBizProveedor;
|
||||
begin
|
||||
Result := FProveedor;
|
||||
end;
|
||||
|
||||
procedure TfEditorElegirArticulosFacturaProveedor.SetProveedor(const Value: IBizProveedor);
|
||||
begin
|
||||
FProveedor := Value;
|
||||
if Assigned(FProveedor) then
|
||||
begin
|
||||
if Assigned(Self.ViewGrid) then
|
||||
(Self.ViewGrid as IViewElegirArticulosFacturasProveedor).Proveedor := FProveedor;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
@ -165,6 +165,10 @@ inherited fEditorFacturaProveedor: TfEditorFacturaProveedor
|
||||
object pagContenido: TTabSheet
|
||||
Caption = 'Contenido'
|
||||
ImageIndex = 1
|
||||
ExplicitLeft = 0
|
||||
ExplicitTop = 0
|
||||
ExplicitWidth = 0
|
||||
ExplicitHeight = 0
|
||||
inline frViewDetallesFacturaProveedor1: TfrViewDetallesFacturaProveedor
|
||||
Left = 0
|
||||
Top = 0
|
||||
|
||||
@ -292,7 +292,7 @@ begin
|
||||
AMensaje := 'Antes debe elegir un proveedor para esta factura'
|
||||
else
|
||||
AMensaje := 'Antes debe elegir un proveedor para este abono';
|
||||
Showmessage(AMensaje);
|
||||
ShowWarningMessage(AMensaje);
|
||||
AllowChange := False;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -1,7 +1,54 @@
|
||||
inherited frViewElegirArticulosFacturasProveedor: TfrViewElegirArticulosFacturasProveedor
|
||||
Height = 449
|
||||
OnDestroy = CustomViewDestroy
|
||||
ExplicitHeight = 449
|
||||
inherited cxGrid: TcxGrid
|
||||
Height = 321
|
||||
RootLevelOptions.DetailTabsPosition = dtpTop
|
||||
OnActiveTabChanged = cxGridActiveTabChanged
|
||||
inherited cxGridView: TcxGridDBTableView
|
||||
object cxGridViewID_PROVEEDOR: TcxGridDBColumn
|
||||
DataBinding.FieldName = 'ID_PROVEEDOR'
|
||||
Visible = False
|
||||
end
|
||||
end
|
||||
object cxGridLevel1: TcxGridLevel
|
||||
Caption = 'Otros proveedores'
|
||||
end
|
||||
end
|
||||
inherited frViewFiltroBase1: TfrViewFiltroBase
|
||||
inherited TBXDock1: TTBXDock
|
||||
inherited TBXDockablePanel1: TTBXDockablePanel
|
||||
inherited dxLayoutControl1: TdxLayoutControl
|
||||
ExplicitWidth = 550
|
||||
inherited txtFiltroTodo: TcxTextEdit
|
||||
ExplicitWidth = 273
|
||||
Width = 273
|
||||
end
|
||||
inherited edtFechaIniFiltro: TcxDateEdit
|
||||
ExplicitWidth = 121
|
||||
Width = 121
|
||||
end
|
||||
inherited edtFechaFinFiltro: TcxDateEdit
|
||||
ExplicitWidth = 121
|
||||
Width = 121
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
inherited pnlAgrupaciones: TTBXDockablePanel
|
||||
Top = 423
|
||||
end
|
||||
inherited dxComponentPrinter: TdxComponentPrinter
|
||||
inherited dxComponentPrinterLink: TdxGridReportLink
|
||||
ReportDocument.CreationDate = 39252.442388773150000000
|
||||
BuiltInReportLink = True
|
||||
end
|
||||
end
|
||||
inherited dxPrintStyleManager1: TdxPrintStyleManager
|
||||
inherited dxPrintStyleManager1Style1: TdxPSPrintStyle
|
||||
BuiltInStyle = True
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -10,17 +10,96 @@ uses
|
||||
dxPSCompsProvider, dxPSFillPatterns, dxPSEdgePatterns, ImgList, PngImageList,
|
||||
cxGridCustomPopupMenu, cxGridPopupMenu, dxPSCore, dxPScxCommon, dxPScxGridLnk,
|
||||
uDADataTable, cxGridLevel, cxGridCustomTableView, cxGridTableView,
|
||||
cxGridDBTableView, cxClasses, cxControls, cxGridCustomView, cxGrid;
|
||||
cxGridDBTableView, cxClasses, cxControls, cxGridCustomView, cxGrid, dxPgsDlg,
|
||||
ActnList, TB2Item, TBX, TB2Toolbar, TBXDkPanels, TB2Dock, uViewFiltroBase,
|
||||
uBizContactos;
|
||||
|
||||
type
|
||||
IViewElegirArticulosFacturasProveedor = interface(IViewArticulos)
|
||||
['{8F2E6451-0A4E-4DF1-908A-62BB5785A150}']
|
||||
function GetProveedor: IBizProveedor;
|
||||
procedure SetProveedor(const Value: IBizProveedor);
|
||||
property Proveedor: IBizProveedor read GetProveedor write SetProveedor;
|
||||
end;
|
||||
|
||||
TfrViewElegirArticulosFacturasProveedor = class(TfrViewArticulos, IViewElegirArticulosFacturasProveedor)
|
||||
cxGridLevel1: TcxGridLevel;
|
||||
cxGridViewID_PROVEEDOR: TcxGridDBColumn;
|
||||
procedure cxGridActiveTabChanged(Sender: TcxCustomGrid;
|
||||
ALevel: TcxGridLevel);
|
||||
procedure CustomViewDestroy(Sender: TObject);
|
||||
|
||||
private
|
||||
FProveedor: IBizProveedor;
|
||||
function GetProveedor: IBizProveedor;
|
||||
procedure SetProveedor(const Value: IBizProveedor);
|
||||
|
||||
//Filtros relativos a la vista
|
||||
procedure AnadirFiltroProveedor;
|
||||
|
||||
public
|
||||
property Proveedor: IBizProveedor read GetProveedor write SetProveedor;
|
||||
procedure AnadirOtrosFiltros; override;
|
||||
|
||||
end;
|
||||
|
||||
implementation
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrViewElegirArticulosFacturasProveedor.AnadirFiltroProveedor;
|
||||
var
|
||||
FFiltro : TcxFilterCriteriaItemList;
|
||||
begin
|
||||
FFiltro := AddFilterGrid(fboAnd);
|
||||
|
||||
case cxGrid.ActiveLevel.Index of
|
||||
0 : if Assigned(FProveedor) then
|
||||
FFiltro.AddItem(cxGridViewID_PROVEEDOR, foEqual, FProveedor.ID, FProveedor.NOMBRE);
|
||||
1 : if Assigned(FProveedor) then
|
||||
FFiltro.AddItem(cxGridViewID_PROVEEDOR, foNotEqual, FProveedor.ID, FProveedor.NOMBRE);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrViewElegirArticulosFacturasProveedor.AnadirOtrosFiltros;
|
||||
begin
|
||||
inherited;
|
||||
|
||||
AnadirFiltroProveedor;
|
||||
|
||||
//Finalmente activamos el filtro si tenemos algo
|
||||
if cxGridView.DataController.Filter.IsEmpty
|
||||
then cxGridView.DataController.Filter.Active := False
|
||||
else cxGridView.DataController.Filter.Active := True;
|
||||
cxGrid.ActiveLevel.GridView := cxGridView;
|
||||
end;
|
||||
|
||||
procedure TfrViewElegirArticulosFacturasProveedor.CustomViewDestroy(Sender: TObject);
|
||||
begin
|
||||
FProveedor := Nil;
|
||||
inherited;
|
||||
end;
|
||||
|
||||
procedure TfrViewElegirArticulosFacturasProveedor.cxGridActiveTabChanged(
|
||||
Sender: TcxCustomGrid; ALevel: TcxGridLevel);
|
||||
begin
|
||||
inherited;
|
||||
RefrescarFiltro;
|
||||
end;
|
||||
|
||||
function TfrViewElegirArticulosFacturasProveedor.GetProveedor: IBizProveedor;
|
||||
begin
|
||||
Result := FProveedor;
|
||||
end;
|
||||
|
||||
procedure TfrViewElegirArticulosFacturasProveedor.SetProveedor(
|
||||
const Value: IBizProveedor);
|
||||
begin
|
||||
FProveedor := Value;
|
||||
if Assigned(FProveedor) then
|
||||
begin
|
||||
cxGridLevel.Caption := FProveedor.NOMBRE;
|
||||
RefrescarFiltro;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
@ -174,7 +174,7 @@
|
||||
</Delphi.Personality>
|
||||
<!-- EurekaLog First Line
|
||||
[Exception Log]
|
||||
EurekaLog Version=5111
|
||||
EurekaLog Version=519
|
||||
Activate=1
|
||||
Activate Handle=1
|
||||
Save Log File=1
|
||||
|
||||
@ -51,7 +51,8 @@ requires
|
||||
Jcl,
|
||||
JvSystemD10R,
|
||||
JvCoreD10R,
|
||||
Articulos_controller;
|
||||
Articulos_controller,
|
||||
Contactos_model;
|
||||
|
||||
contains
|
||||
uPedidosProveedorController in 'uPedidosProveedorController.pas',
|
||||
|
||||
@ -3,11 +3,14 @@ unit uIEditorElegirArticulosPedidosProveedor;
|
||||
interface
|
||||
|
||||
uses
|
||||
uIEditorElegirArticulos;
|
||||
uIEditorElegirArticulos, uBizContactos;
|
||||
|
||||
type
|
||||
IEditorElegirArticulosPedidosProveedor = interface(IEditorElegirArticulos)
|
||||
['{4016D4CD-8C0C-494A-9CC4-256E3A00EAD3}']
|
||||
function GetProveedor: IBizProveedor;
|
||||
procedure SetProveedor(const Value: IBizProveedor);
|
||||
property Proveedor: IBizProveedor read GetProveedor write SetProveedor;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
@ -3,16 +3,17 @@ unit uArticulosPedidoProveedorController;
|
||||
interface
|
||||
|
||||
uses
|
||||
uDADataTable, uArticulosController, uBizArticulos;
|
||||
uDADataTable, uArticulosController, uBizArticulos, uBizContactos;
|
||||
|
||||
type
|
||||
IArticulosPedidoProveedorController = interface(IArticulosController)
|
||||
['{8C8A8D8D-82D2-4434-81C3-36E4F43F3B3E}']
|
||||
function ElegirArticulos(AArticulos : IBizArticulo; AMensaje: String; AMultiSelect: Boolean; const AProveedor: IBizProveedor): IBizArticulo;
|
||||
end;
|
||||
|
||||
TArticulosPedidoProveedorController = class(TArticulosController, IArticulosPedidoProveedorController)
|
||||
public
|
||||
function ElegirArticulos(AArticulos : IBizArticulo; AMensaje: String; AMultiSelect: Boolean): IBizArticulo; override;
|
||||
function ElegirArticulos(AArticulos : IBizArticulo; AMensaje: String; AMultiSelect: Boolean; const AProveedor: IBizProveedor): IBizArticulo; overload;
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -22,7 +23,7 @@ implementation
|
||||
uses Controls, uIEditorElegirArticulosPedidosProveedor, uIEditorElegirArticulos;
|
||||
|
||||
function TArticulosPedidoProveedorController.ElegirArticulos(AArticulos: IBizArticulo; AMensaje: String;
|
||||
AMultiSelect: Boolean): IBizArticulo;
|
||||
AMultiSelect: Boolean; const AProveedor: IBizProveedor): IBizArticulo;
|
||||
var
|
||||
AEditor : IEditorElegirArticulosPedidosProveedor;
|
||||
begin
|
||||
@ -33,11 +34,12 @@ begin
|
||||
begin
|
||||
Controller := Self;
|
||||
Articulos := AArticulos;
|
||||
Proveedor := AProveedor;
|
||||
MultiSelect := AMultiSelect;
|
||||
Mensaje := AMensaje;
|
||||
if IsPositiveResult(ShowModal) then
|
||||
Result := ArticulosSeleccionados;
|
||||
Release;
|
||||
Release;
|
||||
end;
|
||||
finally
|
||||
AEditor := NIL;
|
||||
|
||||
@ -60,8 +60,8 @@ begin
|
||||
if Assigned(ADetalles) then
|
||||
begin
|
||||
try
|
||||
AArticulos := (FArticulosController.BuscarTodos(AProveedor) as IBizArticulo);
|
||||
AArticulos := (FArticulosController as IArticulosPedidoProveedorController).ElegirArticulos(AArticulos, 'Elija los artículos que desea añadir a este pedido a proveedor', True);
|
||||
AArticulos := (FArticulosController.BuscarTodos as IBizArticulo);
|
||||
AArticulos := (FArticulosController as IArticulosPedidoProveedorController).ElegirArticulos(AArticulos, 'Elija los artículos que desea añadir a este pedido a proveedor', True, AProveedor);
|
||||
Add(ADetalles, AArticulos);
|
||||
finally
|
||||
AArticulos := Nil;
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
inherited fEditorElegirArticulosPedidoProveedor: TfEditorElegirArticulosPedidoProveedor
|
||||
Caption = 'fEditorElegirArticulosPedidoProveedor'
|
||||
ExplicitHeight = 480
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 13
|
||||
end
|
||||
|
||||
@ -9,12 +9,21 @@ uses
|
||||
StdActns, ActnList, uCustomView, uViewBase, uViewBarraSeleccion, ComCtrls,
|
||||
JvExComCtrls, JvStatusBar, TBX, TB2ExtItems, TBXExtItems, TB2Item, TB2Dock,
|
||||
TB2Toolbar, pngimage, ExtCtrls, JvExControls, JvComponent, JvNavigationPane,
|
||||
JvgWizardHeader, uIEditorElegirArticulosPedidosProveedor;
|
||||
JvgWizardHeader, uIEditorElegirArticulosPedidosProveedor, uBizContactos;
|
||||
|
||||
type
|
||||
TfEditorElegirArticulosPedidoProveedor = class(TfEditorElegirArticulos, IEditorElegirArticulosPedidosProveedor)
|
||||
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
|
||||
private
|
||||
FProveedor: IBizProveedor;
|
||||
function GetProveedor: IBizProveedor;
|
||||
procedure SetProveedor(const Value: IBizProveedor);
|
||||
|
||||
protected
|
||||
procedure AsignarVista; override;
|
||||
|
||||
public
|
||||
property Proveedor: IBizProveedor read GetProveedor write SetProveedor;
|
||||
end;
|
||||
|
||||
|
||||
@ -30,4 +39,25 @@ begin
|
||||
ViewGrid := CreateView(TfrViewElegirArticulosPedidosProveedor) as IViewElegirArticulosPedidosProveedor;
|
||||
end;
|
||||
|
||||
procedure TfEditorElegirArticulosPedidoProveedor.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
|
||||
begin
|
||||
FProveedor := Nil;
|
||||
inherited;
|
||||
end;
|
||||
|
||||
function TfEditorElegirArticulosPedidoProveedor.GetProveedor: IBizProveedor;
|
||||
begin
|
||||
Result := FProveedor;
|
||||
end;
|
||||
|
||||
procedure TfEditorElegirArticulosPedidoProveedor.SetProveedor(const Value: IBizProveedor);
|
||||
begin
|
||||
FProveedor := Value;
|
||||
if Assigned(FProveedor) then
|
||||
begin
|
||||
if Assigned(Self.ViewGrid) then
|
||||
(Self.ViewGrid as IViewElegirArticulosPedidosProveedor).Proveedor := FProveedor;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
@ -64,6 +64,7 @@ inherited fEditorPedidoProveedor: TfEditorPedidoProveedor
|
||||
inherited pgPaginas: TPageControl
|
||||
Width = 765
|
||||
Height = 476
|
||||
ActivePage = pagContenido
|
||||
TabOrder = 1
|
||||
OnChanging = pgPaginasChanging
|
||||
ExplicitWidth = 765
|
||||
@ -98,42 +99,6 @@ inherited fEditorPedidoProveedor: TfEditorPedidoProveedor
|
||||
inherited ToolBar1: TToolBar
|
||||
Width = 757
|
||||
ExplicitWidth = 757
|
||||
inherited UpDown1: TUpDown
|
||||
Left = 237
|
||||
ExplicitLeft = 237
|
||||
end
|
||||
inherited ToolButton13: TToolButton
|
||||
Left = 254
|
||||
ExplicitLeft = 254
|
||||
end
|
||||
inherited ToolButton6: TToolButton
|
||||
Left = 262
|
||||
ExplicitLeft = 262
|
||||
end
|
||||
inherited ToolButton7: TToolButton
|
||||
Left = 296
|
||||
ExplicitLeft = 296
|
||||
end
|
||||
inherited ToolButton8: TToolButton
|
||||
Left = 330
|
||||
ExplicitLeft = 330
|
||||
end
|
||||
inherited ToolButton12: TToolButton
|
||||
Left = 364
|
||||
ExplicitLeft = 364
|
||||
end
|
||||
inherited ToolButton9: TToolButton
|
||||
Left = 372
|
||||
ExplicitLeft = 372
|
||||
end
|
||||
inherited ToolButton10: TToolButton
|
||||
Left = 406
|
||||
ExplicitLeft = 406
|
||||
end
|
||||
inherited ToolButton11: TToolButton
|
||||
Left = 440
|
||||
ExplicitLeft = 440
|
||||
end
|
||||
end
|
||||
inherited cxGrid: TcxGrid
|
||||
Width = 757
|
||||
|
||||
@ -1,7 +1,74 @@
|
||||
inherited frViewElegirArticulosPedidosProveedor: TfrViewElegirArticulosPedidosProveedor
|
||||
Width = 565
|
||||
Height = 407
|
||||
OnDestroy = CustomViewDestroy
|
||||
ExplicitWidth = 565
|
||||
ExplicitHeight = 407
|
||||
inherited cxGrid: TcxGrid
|
||||
Width = 565
|
||||
Height = 279
|
||||
RootLevelOptions.DetailTabsPosition = dtpTop
|
||||
OnActiveTabChanged = cxGridActiveTabChanged
|
||||
inherited cxGridView: TcxGridDBTableView
|
||||
object cxGridViewID_PROVEEDOR: TcxGridDBColumn
|
||||
DataBinding.FieldName = 'ID_PROVEEDOR'
|
||||
Visible = False
|
||||
end
|
||||
end
|
||||
object cxGridLevel1: TcxGridLevel
|
||||
Caption = 'Otros proveedores'
|
||||
end
|
||||
end
|
||||
inherited frViewFiltroBase1: TfrViewFiltroBase
|
||||
Width = 565
|
||||
inherited TBXDock1: TTBXDock
|
||||
Width = 565
|
||||
inherited TBXDockablePanel1: TTBXDockablePanel
|
||||
ExplicitWidth = 565
|
||||
inherited dxLayoutControl1: TdxLayoutControl
|
||||
Width = 561
|
||||
inherited txtFiltroTodo: TcxTextEdit
|
||||
ExplicitWidth = 273
|
||||
Width = 273
|
||||
end
|
||||
inherited edtFechaIniFiltro: TcxDateEdit
|
||||
ExplicitWidth = 121
|
||||
Width = 121
|
||||
end
|
||||
inherited edtFechaFinFiltro: TcxDateEdit
|
||||
Left = 348
|
||||
ExplicitLeft = 348
|
||||
ExplicitWidth = 121
|
||||
Width = 121
|
||||
end
|
||||
end
|
||||
inherited TBXAlignmentPanel1: TTBXAlignmentPanel
|
||||
Width = 561
|
||||
inherited tbxBotones: TTBXToolbar
|
||||
Width = 551
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
inherited pnlAgrupaciones: TTBXDockablePanel
|
||||
Top = 381
|
||||
inherited TBXAlignmentPanel1: TTBXAlignmentPanel
|
||||
Width = 565
|
||||
inherited TBXToolbar1: TTBXToolbar
|
||||
Width = 555
|
||||
end
|
||||
end
|
||||
end
|
||||
inherited dxComponentPrinter: TdxComponentPrinter
|
||||
inherited dxComponentPrinterLink: TdxGridReportLink
|
||||
ReportDocument.CreationDate = 39252.446797407400000000
|
||||
BuiltInReportLink = True
|
||||
end
|
||||
end
|
||||
inherited dxPrintStyleManager1: TdxPrintStyleManager
|
||||
inherited dxPrintStyleManager1Style1: TdxPSPrintStyle
|
||||
BuiltInStyle = True
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -10,17 +10,98 @@ uses
|
||||
dxPSCompsProvider, dxPSFillPatterns, dxPSEdgePatterns, ImgList, PngImageList,
|
||||
cxGridCustomPopupMenu, cxGridPopupMenu, dxPSCore, dxPScxCommon, dxPScxGridLnk,
|
||||
uDADataTable, cxGridLevel, cxGridCustomTableView, cxGridTableView,
|
||||
cxGridDBTableView, cxClasses, cxControls, cxGridCustomView, cxGrid;
|
||||
cxGridDBTableView, cxClasses, cxControls, cxGridCustomView, cxGrid, dxPgsDlg,
|
||||
ActnList, TB2Item, TBX, TB2Toolbar, TBXDkPanels, TB2Dock, uViewFiltroBase,
|
||||
uBizContactos;
|
||||
|
||||
type
|
||||
IViewElegirArticulosPedidosProveedor = interface(IViewArticulos)
|
||||
['{5292A518-0797-4FFC-AC9B-90F0113AF3AF}']
|
||||
function GetProveedor: IBizProveedor;
|
||||
procedure SetProveedor(const Value: IBizProveedor);
|
||||
property Proveedor: IBizProveedor read GetProveedor write SetProveedor;
|
||||
end;
|
||||
|
||||
TfrViewElegirArticulosPedidosProveedor = class(TfrViewArticulos, IViewElegirArticulosPedidosProveedor)
|
||||
cxGridLevel1: TcxGridLevel;
|
||||
cxGridViewID_PROVEEDOR: TcxGridDBColumn;
|
||||
|
||||
procedure cxGridActiveTabChanged(Sender: TcxCustomGrid; ALevel: TcxGridLevel);
|
||||
procedure CustomViewDestroy(Sender: TObject);
|
||||
|
||||
private
|
||||
FProveedor: IBizProveedor;
|
||||
function GetProveedor: IBizProveedor;
|
||||
procedure SetProveedor(const Value: IBizProveedor);
|
||||
|
||||
//Filtros relativos a la vista
|
||||
procedure AnadirFiltroProveedor;
|
||||
|
||||
public
|
||||
property Proveedor: IBizProveedor read GetProveedor write SetProveedor;
|
||||
procedure AnadirOtrosFiltros; override;
|
||||
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
uses uViewGrid;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrViewElegirArticulosPedidosProveedor.AnadirFiltroProveedor;
|
||||
var
|
||||
FFiltro : TcxFilterCriteriaItemList;
|
||||
begin
|
||||
FFiltro := AddFilterGrid(fboAnd);
|
||||
|
||||
case cxGrid.ActiveLevel.Index of
|
||||
0 : if Assigned(FProveedor) then
|
||||
FFiltro.AddItem(cxGridViewID_PROVEEDOR, foEqual, FProveedor.ID, FProveedor.NOMBRE);
|
||||
1 : if Assigned(FProveedor) then
|
||||
FFiltro.AddItem(cxGridViewID_PROVEEDOR, foNotEqual, FProveedor.ID, FProveedor.NOMBRE);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrViewElegirArticulosPedidosProveedor.AnadirOtrosFiltros;
|
||||
begin
|
||||
inherited;
|
||||
|
||||
AnadirFiltroProveedor;
|
||||
|
||||
//Finalmente activamos el filtro si tenemos algo
|
||||
if cxGridView.DataController.Filter.IsEmpty
|
||||
then cxGridView.DataController.Filter.Active := False
|
||||
else cxGridView.DataController.Filter.Active := True;
|
||||
cxGrid.ActiveLevel.GridView := cxGridView;
|
||||
end;
|
||||
|
||||
procedure TfrViewElegirArticulosPedidosProveedor.CustomViewDestroy(Sender: TObject);
|
||||
begin
|
||||
FProveedor := Nil;
|
||||
inherited;
|
||||
end;
|
||||
|
||||
procedure TfrViewElegirArticulosPedidosProveedor.cxGridActiveTabChanged(
|
||||
Sender: TcxCustomGrid; ALevel: TcxGridLevel);
|
||||
begin
|
||||
inherited;
|
||||
RefrescarFiltro;
|
||||
end;
|
||||
|
||||
function TfrViewElegirArticulosPedidosProveedor.GetProveedor: IBizProveedor;
|
||||
begin
|
||||
Result := FProveedor;
|
||||
end;
|
||||
|
||||
procedure TfrViewElegirArticulosPedidosProveedor.SetProveedor(const Value: IBizProveedor);
|
||||
begin
|
||||
FProveedor := Value;
|
||||
if Assigned(FProveedor) then
|
||||
begin
|
||||
cxGridLevel.Caption := FProveedor.NOMBRE;
|
||||
RefrescarFiltro;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
@ -31,7 +31,7 @@ type
|
||||
|
||||
implementation
|
||||
|
||||
uses Dialogs, Variants, uControllerDetallesBase, uControllerDetallesDTO, uDataModulePedidosCliente, uArticulosPedidoClienteController;
|
||||
uses Dialogs, uDialogUtils, Variants, uControllerDetallesBase, uControllerDetallesDTO, uDataModulePedidosCliente, uArticulosPedidoClienteController;
|
||||
|
||||
{ TDetallesPedidoClienteController }
|
||||
|
||||
@ -44,7 +44,7 @@ begin
|
||||
try
|
||||
AArticulos := (FArticulosController.BuscarTodos(ACliente) as IBizArticulo);
|
||||
ActualizarDetalles(ADetalles, AArticulos);
|
||||
ShowMessage('Se han actualizado los descuentos para el cliente seleccionado');
|
||||
ShowInfoMessage('Se han actualizado los descuentos para el cliente seleccionado');
|
||||
finally
|
||||
AArticulos := Nil;
|
||||
end;
|
||||
|
||||
@ -2,6 +2,7 @@ inherited fEditorElegirRecibosCliente: TfEditorElegirRecibosCliente
|
||||
Caption = 'Seleccionar recibos de cliente'
|
||||
ClientWidth = 654
|
||||
ExplicitWidth = 662
|
||||
ExplicitHeight = 240
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 13
|
||||
object JvgWizardHeader1: TJvgWizardHeader [0]
|
||||
@ -84,13 +85,13 @@ inherited fEditorElegirRecibosCliente: TfEditorElegirRecibosCliente
|
||||
end
|
||||
end
|
||||
inherited StatusBar: TJvStatusBar
|
||||
Top = 506
|
||||
Width = 654
|
||||
ExplicitTop = 645
|
||||
ExplicitWidth = 654
|
||||
end
|
||||
inline frViewBarraSeleccion1: TfrViewBarraSeleccion [4]
|
||||
Left = 0
|
||||
Top = 609
|
||||
Top = 525
|
||||
Width = 654
|
||||
Height = 36
|
||||
Align = alBottom
|
||||
@ -102,7 +103,7 @@ inherited fEditorElegirRecibosCliente: TfEditorElegirRecibosCliente
|
||||
ParentFont = False
|
||||
TabOrder = 3
|
||||
ReadOnly = False
|
||||
ExplicitTop = 609
|
||||
ExplicitTop = 525
|
||||
ExplicitWidth = 654
|
||||
ExplicitHeight = 36
|
||||
inherited JvFooter1: TJvFooter
|
||||
@ -136,16 +137,48 @@ inherited fEditorElegirRecibosCliente: TfEditorElegirRecibosCliente
|
||||
inherited frViewRecibosCliente1: TfrViewRecibosCliente [5]
|
||||
Top = 220
|
||||
Width = 654
|
||||
Height = 389
|
||||
Height = 286
|
||||
ExplicitTop = 220
|
||||
ExplicitWidth = 654
|
||||
ExplicitHeight = 389
|
||||
ExplicitHeight = 286
|
||||
inherited cxGrid: TcxGrid
|
||||
Width = 654
|
||||
Height = 389
|
||||
Height = 158
|
||||
RootLevelOptions.DetailTabsPosition = dtpNone
|
||||
ExplicitWidth = 654
|
||||
ExplicitHeight = 389
|
||||
inherited cxGridView: TcxGridDBTableView
|
||||
DataController.Summary.FooterSummaryItems = <
|
||||
item
|
||||
Format = ',0.00 '#8364';-,0.00 '#8364
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Format = '0 recibos'
|
||||
Kind = skCount
|
||||
Column = frViewRecibosCliente1.cxGridViewFECHA_EMISION
|
||||
end>
|
||||
end
|
||||
end
|
||||
inherited frViewFiltroBase1: TfrViewFiltroBase
|
||||
Width = 654
|
||||
ExplicitWidth = 654
|
||||
inherited TBXDock1: TTBXDock
|
||||
Width = 654
|
||||
ExplicitWidth = 654
|
||||
inherited TBXDockablePanel1: TTBXDockablePanel
|
||||
ExplicitWidth = 654
|
||||
inherited dxLayoutControl1: TdxLayoutControl
|
||||
Width = 650
|
||||
end
|
||||
inherited TBXAlignmentPanel1: TTBXAlignmentPanel
|
||||
Width = 650
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
inherited pnlAgrupaciones: TTBXDockablePanel
|
||||
Top = 260
|
||||
end
|
||||
inherited dxComponentPrinter: TdxComponentPrinter
|
||||
inherited dxComponentPrinterLink: TdxGridReportLink
|
||||
@ -160,6 +193,11 @@ inherited fEditorElegirRecibosCliente: TfEditorElegirRecibosCliente
|
||||
Index = 0
|
||||
end>
|
||||
end
|
||||
inherited dxPrintStyleManager1: TdxPrintStyleManager
|
||||
inherited dxPrintStyleManager1Style1: TdxPSPrintStyle
|
||||
BuiltInStyle = True
|
||||
end
|
||||
end
|
||||
end
|
||||
object pnlFiltrar: TTBXDockablePanel [6]
|
||||
Left = 0
|
||||
@ -176,6 +214,7 @@ inherited fEditorElegirRecibosCliente: TfEditorElegirRecibosCliente
|
||||
ShowCaptionWhenDocked = False
|
||||
SupportedDocks = [dkStandardDock, dkMultiDock]
|
||||
TabOrder = 5
|
||||
ExplicitWidth = 128
|
||||
object Label1: TLabel
|
||||
Left = 296
|
||||
Top = 50
|
||||
@ -317,10 +356,12 @@ inherited fEditorElegirRecibosCliente: TfEditorElegirRecibosCliente
|
||||
end
|
||||
inherited JvFormStorage: TJvFormStorage [13]
|
||||
end
|
||||
inherited GridPopupMenu: TPopupMenu
|
||||
inherited GridPopupMenu: TPopupMenu [14]
|
||||
Left = 80
|
||||
Top = 192
|
||||
end
|
||||
inherited JsPrevisualizarDialog: TJSDialog [15]
|
||||
end
|
||||
object EditorSeleccionActionList: TActionList
|
||||
Images = SmallImages
|
||||
Left = 152
|
||||
|
||||
@ -37,7 +37,7 @@ uses
|
||||
|
||||
uViewRecibosCliente, uEditorRecibosCliente, uBizRecibosCliente, uIEditorElegirRecibosCliente,
|
||||
Buttons, cxRadioGroup, cxMaskEdit, cxDropDownEdit, cxCalendar, cxControls,
|
||||
cxContainer, cxEdit, cxTextEdit, TBXDkPanels;
|
||||
cxContainer, cxEdit, cxTextEdit, TBXDkPanels, JSDialog;
|
||||
|
||||
|
||||
type
|
||||
@ -82,7 +82,7 @@ implementation
|
||||
|
||||
uses
|
||||
uEditorGridBase, cxGridCustomTableView, uIntegerListUtils, uDBSelectionListUtils,
|
||||
uGridUtils, uEditorBase, uRecibosClienteController;
|
||||
uGridUtils, uDialogUtils, uEditorBase, uRecibosClienteController;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
@ -116,7 +116,7 @@ begin
|
||||
begin
|
||||
if (edtFechaFiltro1.EditValue > edtFechaFiltro2.EditValue) then
|
||||
begin
|
||||
ShowMessage('La fecha de inicio debe ser anterior a la fecha final');
|
||||
ShowWarningMessage('La fecha de inicio debe ser anterior a la fecha final');
|
||||
edtFechaFiltro1.SetFocus;
|
||||
end
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user