Se arregla finalmente los pedidos de proveedor para que cuando se elija una obra se asgine por defecto como destino del pedido, manteniendo la posibilidad de cambiar dicha recepción.
git-svn-id: https://192.168.0.254/svn/Proyectos.Tecsitel_FactuGES2/trunk@745 0c75b7a4-871f-7646-8a2f-f78d34cc349f
This commit is contained in:
parent
bea103d6c2
commit
b8014fd7c2
@ -53,6 +53,7 @@ type
|
|||||||
procedure EnviarPedidoPorEMail(APedido: IBizPedidoProveedor);
|
procedure EnviarPedidoPorEMail(APedido: IBizPedidoProveedor);
|
||||||
|
|
||||||
Procedure AsignarIDObra(APedido: IBizPedidoProveedor; const IDObra: Variant);
|
Procedure AsignarIDObra(APedido: IBizPedidoProveedor; const IDObra: Variant);
|
||||||
|
Procedure AsignarIDAlmacen(APedido: IBizPedidoProveedor; const IDAlmacen: Variant);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TPedidosProveedorController = class(TControllerBase, IPedidosProveedorController)
|
TPedidosProveedorController = class(TControllerBase, IPedidosProveedorController)
|
||||||
@ -119,7 +120,8 @@ type
|
|||||||
function ElegirPedidos(APedido: IBizPedidoProveedor; AMensaje: String; AMultiSelect: Boolean): IBizPedidoProveedor;
|
function ElegirPedidos(APedido: IBizPedidoProveedor; AMensaje: String; AMultiSelect: Boolean): IBizPedidoProveedor;
|
||||||
procedure EnviarPedidoPorEMail(APedido: IBizPedidoProveedor);
|
procedure EnviarPedidoPorEMail(APedido: IBizPedidoProveedor);
|
||||||
|
|
||||||
Procedure AsignarIDObra(APedido: IBizPedidoProveedor; const IDObra: Variant);
|
Procedure AsignarIDObra(APedido: IBizPedidoProveedor; const IDObra: Variant);
|
||||||
|
Procedure AsignarIDAlmacen(APedido: IBizPedidoProveedor; const IDAlmacen: Variant);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
@ -131,7 +133,7 @@ uses
|
|||||||
schPedidosProveedorClient_Intf, uDAInterfaces, uPedidosProveedorReportController,
|
schPedidosProveedorClient_Intf, uDAInterfaces, uPedidosProveedorReportController,
|
||||||
uDateUtils, uIEditorPedidoProveedor, uIEditorElegirPedidosProveedor,
|
uDateUtils, uIEditorPedidoProveedor, uIEditorElegirPedidosProveedor,
|
||||||
Dialogs, uIEditorDireccionEntregaPedidoProveedor, Classes, uIEditorSituacionPedidoProveedor,
|
Dialogs, uIEditorDireccionEntregaPedidoProveedor, Classes, uIEditorSituacionPedidoProveedor,
|
||||||
Variants, uSistemaFunc, uEMailUtils, uDialogElegirEMail, uIntegerListUtils;
|
Variants, uSistemaFunc, uEMailUtils, uDialogElegirEMail, uIntegerListUtils, uStringsUtils;
|
||||||
|
|
||||||
{ TPedidosProveedorController }
|
{ TPedidosProveedorController }
|
||||||
|
|
||||||
@ -145,6 +147,22 @@ begin
|
|||||||
FDataModule := TDataModulePedidosProveedor.Create(Nil);
|
FDataModule := TDataModulePedidosProveedor.Create(Nil);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TPedidosProveedorController.AsignarIDAlmacen(APedido: IBizPedidoProveedor; const IDAlmacen: Variant);
|
||||||
|
begin
|
||||||
|
if Assigned(APedido) then
|
||||||
|
begin
|
||||||
|
if not APedido.DataTable.Editing then
|
||||||
|
APedido.DataTable.Edit;
|
||||||
|
|
||||||
|
if EsCadenaVacia(IDAlmacen) then
|
||||||
|
APedido.ID_ALMACENIsNull := true
|
||||||
|
else
|
||||||
|
APedido.ID_ALMACEN := IDAlmacen;
|
||||||
|
|
||||||
|
APedido.DataTable.Post;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TPedidosProveedorController.AsignarIDObra(APedido: IBizPedidoProveedor; const IDObra: Variant);
|
procedure TPedidosProveedorController.AsignarIDObra(APedido: IBizPedidoProveedor; const IDObra: Variant);
|
||||||
begin
|
begin
|
||||||
if Assigned(APedido) then
|
if Assigned(APedido) then
|
||||||
@ -152,7 +170,7 @@ begin
|
|||||||
if not APedido.DataTable.Editing then
|
if not APedido.DataTable.Editing then
|
||||||
APedido.DataTable.Edit;
|
APedido.DataTable.Edit;
|
||||||
|
|
||||||
if VarIsNull(IDObra) then
|
if EsCadenaVacia(IDObra) then
|
||||||
APedido.ID_OBRAIsNull := true
|
APedido.ID_OBRAIsNull := true
|
||||||
else
|
else
|
||||||
APedido.ID_OBRA := IDObra;
|
APedido.ID_OBRA := IDObra;
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
inherited frViewDireccionEntregaPedidoProv: TfrViewDireccionEntregaPedidoProv
|
inherited frViewDireccionEntregaPedidoProv: TfrViewDireccionEntregaPedidoProv
|
||||||
Width = 484
|
Width = 484
|
||||||
Height = 240
|
Height = 240
|
||||||
OnShow = CustomViewShow
|
|
||||||
ExplicitWidth = 484
|
ExplicitWidth = 484
|
||||||
ExplicitHeight = 240
|
ExplicitHeight = 240
|
||||||
object dxLayoutControl1: TdxLayoutControl
|
object dxLayoutControl1: TdxLayoutControl
|
||||||
@ -27,8 +26,10 @@ inherited frViewDireccionEntregaPedidoProv: TfrViewDireccionEntregaPedidoProv
|
|||||||
object lblObra: TLabel
|
object lblObra: TLabel
|
||||||
Left = 247
|
Left = 247
|
||||||
Top = 37
|
Top = 37
|
||||||
Width = 3
|
Width = 15
|
||||||
Height = 13
|
Height = 13
|
||||||
|
Align = alClient
|
||||||
|
Caption = ' '
|
||||||
end
|
end
|
||||||
object rdxDestino1: TRadioButton
|
object rdxDestino1: TRadioButton
|
||||||
Left = 10
|
Left = 10
|
||||||
@ -41,11 +42,11 @@ inherited frViewDireccionEntregaPedidoProv: TfrViewDireccionEntregaPedidoProv
|
|||||||
end
|
end
|
||||||
object rdxDestino3: TRadioButton
|
object rdxDestino3: TRadioButton
|
||||||
Left = 10
|
Left = 10
|
||||||
Top = 67
|
Top = 63
|
||||||
Width = 566
|
Width = 566
|
||||||
Height = 17
|
Height = 17
|
||||||
Action = actOtro
|
Action = actOtro
|
||||||
TabOrder = 4
|
TabOrder = 3
|
||||||
end
|
end
|
||||||
object cbListaAlmacenes: TcxDBLookupComboBox
|
object cbListaAlmacenes: TcxDBLookupComboBox
|
||||||
Left = 206
|
Left = 206
|
||||||
@ -89,22 +90,22 @@ inherited frViewDireccionEntregaPedidoProv: TfrViewDireccionEntregaPedidoProv
|
|||||||
Width = 128
|
Width = 128
|
||||||
Height = 25
|
Height = 25
|
||||||
Caption = 'Modificar la direcci'#243'n...'
|
Caption = 'Modificar la direcci'#243'n...'
|
||||||
TabOrder = 6
|
TabOrder = 5
|
||||||
OnClick = bModificarClick
|
OnClick = bModificarClick
|
||||||
end
|
end
|
||||||
object txtDireccion: TStaticText
|
object txtDireccion: TStaticText
|
||||||
Left = 25
|
Left = 25
|
||||||
Top = 90
|
Top = 86
|
||||||
Width = 882
|
Width = 882
|
||||||
Height = 47
|
Height = 47
|
||||||
AutoSize = False
|
AutoSize = False
|
||||||
BevelKind = bkFlat
|
BevelKind = bkFlat
|
||||||
TabOrder = 5
|
TabOrder = 4
|
||||||
OnDblClick = txtDireccionDblClick
|
OnDblClick = txtDireccionDblClick
|
||||||
end
|
end
|
||||||
object rdxDestino2: TRadioButton
|
object rdxDestino2: TRadioButton
|
||||||
Left = 10
|
Left = 10
|
||||||
Top = 39
|
Top = 37
|
||||||
Width = 231
|
Width = 231
|
||||||
Height = 17
|
Height = 17
|
||||||
Action = actListaObras
|
Action = actListaObras
|
||||||
@ -138,22 +139,9 @@ inherited frViewDireccionEntregaPedidoProv: TfrViewDireccionEntregaPedidoProv
|
|||||||
StyleHot.LookAndFeel.Kind = lfStandard
|
StyleHot.LookAndFeel.Kind = lfStandard
|
||||||
StyleHot.LookAndFeel.NativeStyle = True
|
StyleHot.LookAndFeel.NativeStyle = True
|
||||||
StyleHot.LookAndFeel.SkinName = ''
|
StyleHot.LookAndFeel.SkinName = ''
|
||||||
TabOrder = 7
|
TabOrder = 6
|
||||||
Width = 334
|
Width = 334
|
||||||
end
|
end
|
||||||
object lblNombreObra: TcxDBLabel
|
|
||||||
Left = 256
|
|
||||||
Top = 37
|
|
||||||
DataBinding.DataField = 'NOMBRE_OBRA'
|
|
||||||
DataBinding.DataSource = dsPedido
|
|
||||||
Style.HotTrack = False
|
|
||||||
Style.LookAndFeel.SkinName = ''
|
|
||||||
StyleDisabled.LookAndFeel.SkinName = ''
|
|
||||||
StyleFocused.LookAndFeel.SkinName = ''
|
|
||||||
StyleHot.LookAndFeel.SkinName = ''
|
|
||||||
Height = 21
|
|
||||||
Width = 121
|
|
||||||
end
|
|
||||||
object dxLayoutGroup1: TdxLayoutGroup
|
object dxLayoutGroup1: TdxLayoutGroup
|
||||||
ShowCaption = False
|
ShowCaption = False
|
||||||
Hidden = True
|
Hidden = True
|
||||||
@ -206,14 +194,6 @@ inherited frViewDireccionEntregaPedidoProv: TfrViewDireccionEntregaPedidoProv
|
|||||||
ControlOptions.AutoColor = True
|
ControlOptions.AutoColor = True
|
||||||
ControlOptions.ShowBorder = False
|
ControlOptions.ShowBorder = False
|
||||||
end
|
end
|
||||||
object dxLayoutControl1Item9: TdxLayoutItem
|
|
||||||
AutoAligns = []
|
|
||||||
AlignHorz = ahClient
|
|
||||||
AlignVert = avCenter
|
|
||||||
ShowCaption = False
|
|
||||||
Control = lblNombreObra
|
|
||||||
ControlOptions.ShowBorder = False
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
object dxLayoutControl1Item2: TdxLayoutItem
|
object dxLayoutControl1Item2: TdxLayoutItem
|
||||||
@ -280,7 +260,6 @@ inherited frViewDireccionEntregaPedidoProv: TfrViewDireccionEntregaPedidoProv
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
object dsPedido: TDADataSource
|
object dsPedido: TDADataSource
|
||||||
OnDataChange = dsPedidoDataChange
|
|
||||||
Left = 352
|
Left = 352
|
||||||
Top = 8
|
Top = 8
|
||||||
end
|
end
|
||||||
|
|||||||
@ -48,21 +48,17 @@ type
|
|||||||
dxLayoutControl1Group1: TdxLayoutGroup;
|
dxLayoutControl1Group1: TdxLayoutGroup;
|
||||||
dxLayoutControl1Group2: TdxLayoutGroup;
|
dxLayoutControl1Group2: TdxLayoutGroup;
|
||||||
dxLayoutControl1Group3: TdxLayoutGroup;
|
dxLayoutControl1Group3: TdxLayoutGroup;
|
||||||
lblNombreObra: TcxDBLabel;
|
|
||||||
dxLayoutControl1Item9: TdxLayoutItem;
|
|
||||||
lblObra: TLabel;
|
lblObra: TLabel;
|
||||||
dxLayoutControl1Item6: TdxLayoutItem;
|
dxLayoutControl1Item6: TdxLayoutItem;
|
||||||
procedure actListaAlmacenesExecute(Sender: TObject);
|
|
||||||
procedure actOtroExecute(Sender: TObject);
|
|
||||||
procedure cbListaAlmacenesPropertiesValidate(Sender: TObject; var DisplayValue: Variant; var ErrorText: TCaption; var Error: Boolean);
|
procedure cbListaAlmacenesPropertiesValidate(Sender: TObject; var DisplayValue: Variant; var ErrorText: TCaption; var Error: Boolean);
|
||||||
procedure bModificarClick(Sender: TObject);
|
procedure bModificarClick(Sender: TObject);
|
||||||
procedure txtDireccionDblClick(Sender: TObject);
|
procedure txtDireccionDblClick(Sender: TObject);
|
||||||
|
|
||||||
|
procedure edtEntregarAPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
||||||
|
procedure actListaAlmacenesExecute(Sender: TObject);
|
||||||
|
procedure actOtroExecute(Sender: TObject);
|
||||||
procedure actListaObrasExecute(Sender: TObject);
|
procedure actListaObrasExecute(Sender: TObject);
|
||||||
procedure edtEntregarAPropertiesButtonClick(Sender: TObject;
|
|
||||||
AButtonIndex: Integer);
|
|
||||||
procedure dsPedidoDataChange(Sender: TObject; Field: TField);
|
|
||||||
procedure OnObraReservaEditValueChanged(Sender: TObject);
|
|
||||||
procedure CustomViewShow(Sender: TObject);
|
|
||||||
|
|
||||||
protected
|
protected
|
||||||
FAlmacenesController : IAlmacenesController;
|
FAlmacenesController : IAlmacenesController;
|
||||||
@ -81,7 +77,6 @@ type
|
|||||||
property PedidoProveedor: IBizPedidoProveedor read GetPedidoProveedor write SetPedidoProveedor;
|
property PedidoProveedor: IBizPedidoProveedor read GetPedidoProveedor write SetPedidoProveedor;
|
||||||
constructor Create(AOwner: TComponent); override;
|
constructor Create(AOwner: TComponent); override;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
procedure PrepararObra;
|
|
||||||
procedure RecuperarObra;
|
procedure RecuperarObra;
|
||||||
procedure CambioDireccionObra;
|
procedure CambioDireccionObra;
|
||||||
end;
|
end;
|
||||||
@ -93,18 +88,19 @@ implementation
|
|||||||
uses
|
uses
|
||||||
uEditorRegistryUtils, uCustomView, uEditorElegirPersonaContactoPedido, uBizInventario;
|
uEditorRegistryUtils, uCustomView, uEditorElegirPersonaContactoPedido, uBizInventario;
|
||||||
|
|
||||||
procedure TfrViewDireccionEntregaPedidoProv.actListaAlmacenesExecute(Sender: TObject);
|
procedure TfrViewDireccionEntregaPedidoProv.actListaAlmacenesExecute(
|
||||||
|
Sender: TObject);
|
||||||
begin
|
begin
|
||||||
actListaAlmacenes.Checked := True;
|
actListaAlmacenes.Checked := True;
|
||||||
RefrescarControles;
|
RefrescarControles;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TfrViewDireccionEntregaPedidoProv.actListaObrasExecute(
|
procedure TfrViewDireccionEntregaPedidoProv.actListaObrasExecute(Sender: TObject);
|
||||||
Sender: TObject);
|
|
||||||
begin
|
begin
|
||||||
actListaObras.Checked := True;
|
actListaObras.Checked := True;
|
||||||
RefrescarControles;
|
RecuperarObra;
|
||||||
CambioDireccionObra;
|
CambioDireccionObra;
|
||||||
|
FController.AsignarIDAlmacen(FPedido, FPedido.ID_OBRA);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TfrViewDireccionEntregaPedidoProv.actOtroExecute(Sender: TObject);
|
procedure TfrViewDireccionEntregaPedidoProv.actOtroExecute(Sender: TObject);
|
||||||
@ -114,12 +110,7 @@ begin
|
|||||||
if Assigned(FPedido) then
|
if Assigned(FPedido) then
|
||||||
begin
|
begin
|
||||||
FController.VerDireccionEntrega(FPedido);
|
FController.VerDireccionEntrega(FPedido);
|
||||||
|
FController.AsignarIDAlmacen(FPedido, Null);
|
||||||
if (FPedido.ID_ALMACEN > 0) then
|
|
||||||
begin
|
|
||||||
FPedido.Edit;
|
|
||||||
FPedido.ID_ALMACEN := 0;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
RefrescarControles;
|
RefrescarControles;
|
||||||
end;
|
end;
|
||||||
@ -163,7 +154,7 @@ procedure TfrViewDireccionEntregaPedidoProv.cbListaAlmacenesPropertiesValidate(
|
|||||||
var Error: Boolean);
|
var Error: Boolean);
|
||||||
begin
|
begin
|
||||||
if Assigned(FPedido) and Assigned(FAlmacenes) and (FPedido.ID_ALMACEN <> FAlmacenes.ID) then
|
if Assigned(FPedido) and Assigned(FAlmacenes) and (FPedido.ID_ALMACEN <> FAlmacenes.ID) then
|
||||||
CambioDireccionAlmacen;
|
CambioDireccionAlmacen;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
constructor TfrViewDireccionEntregaPedidoProv.Create(AOwner: TComponent);
|
constructor TfrViewDireccionEntregaPedidoProv.Create(AOwner: TComponent);
|
||||||
@ -179,17 +170,8 @@ begin
|
|||||||
FObra := NIL;
|
FObra := NIL;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TfrViewDireccionEntregaPedidoProv.CustomViewShow(Sender: TObject);
|
|
||||||
begin
|
|
||||||
inherited;
|
|
||||||
// lblNombreObra.Properties.OnEditValueChanged := OnObraReservaEditValueChanged;
|
|
||||||
end;
|
|
||||||
|
|
||||||
destructor TfrViewDireccionEntregaPedidoProv.Destroy;
|
destructor TfrViewDireccionEntregaPedidoProv.Destroy;
|
||||||
begin
|
begin
|
||||||
// lblNombreObra.Properties.OnEditValueChanged := Nil;
|
|
||||||
|
|
||||||
//cbListaObras.Properties.OnValidate := Nil;
|
|
||||||
cbListaAlmacenes.Properties.OnValidate := Nil;
|
cbListaAlmacenes.Properties.OnValidate := Nil;
|
||||||
|
|
||||||
FAlmacenesController := Nil;
|
FAlmacenesController := Nil;
|
||||||
@ -202,25 +184,6 @@ begin
|
|||||||
inherited;
|
inherited;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TfrViewDireccionEntregaPedidoProv.dsPedidoDataChange(Sender: TObject;
|
|
||||||
Field: TField);
|
|
||||||
begin
|
|
||||||
inherited;
|
|
||||||
|
|
||||||
if Assigned(Field) and (Field.FieldName = 'ID_OBRA') then
|
|
||||||
begin
|
|
||||||
PrepararObra;
|
|
||||||
if actListaObras.Enabled then
|
|
||||||
begin
|
|
||||||
if not Assigned(FObra) then
|
|
||||||
RecuperarObra;
|
|
||||||
CambioDireccionObra
|
|
||||||
end
|
|
||||||
else
|
|
||||||
FObra := NIL;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TfrViewDireccionEntregaPedidoProv.edtEntregarAPropertiesButtonClick(
|
procedure TfrViewDireccionEntregaPedidoProv.edtEntregarAPropertiesButtonClick(
|
||||||
Sender: TObject; AButtonIndex: Integer);
|
Sender: TObject; AButtonIndex: Integer);
|
||||||
var
|
var
|
||||||
@ -254,12 +217,6 @@ begin
|
|||||||
Result := FPedido;
|
Result := FPedido;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TfrViewDireccionEntregaPedidoProv.OnObraReservaEditValueChanged(
|
|
||||||
Sender: TObject);
|
|
||||||
begin
|
|
||||||
// showmessage('hola');
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TfrViewDireccionEntregaPedidoProv.RecuperarObra;
|
procedure TfrViewDireccionEntregaPedidoProv.RecuperarObra;
|
||||||
begin
|
begin
|
||||||
if Assigned(FObra) and (FObra.ID = FPedido.ID_OBRA) then
|
if Assigned(FObra) and (FObra.ID = FPedido.ID_OBRA) then
|
||||||
@ -278,7 +235,6 @@ begin
|
|||||||
begin
|
begin
|
||||||
cbListaAlmacenes.Enabled := False;
|
cbListaAlmacenes.Enabled := False;
|
||||||
cbListaAlmacenes.Text := '';
|
cbListaAlmacenes.Text := '';
|
||||||
|
|
||||||
txtDireccion.Enabled := True;
|
txtDireccion.Enabled := True;
|
||||||
txtDireccion.Caption := FPedido.CALLE;
|
txtDireccion.Caption := FPedido.CALLE;
|
||||||
txtDireccion.Caption := txtDireccion.Caption + #13#10 + FPedido.CODIGO_POSTAL + ' ' + FPedido.POBLACION;
|
txtDireccion.Caption := txtDireccion.Caption + #13#10 + FPedido.CODIGO_POSTAL + ' ' + FPedido.POBLACION;
|
||||||
@ -287,36 +243,20 @@ begin
|
|||||||
end
|
end
|
||||||
else if (actListaAlmacenes.Checked) then
|
else if (actListaAlmacenes.Checked) then
|
||||||
begin
|
begin
|
||||||
txtDireccion.Enabled := False;
|
|
||||||
|
|
||||||
cbListaAlmacenes.Enabled := True;
|
cbListaAlmacenes.Enabled := True;
|
||||||
cbListaAlmacenes.DroppedDown := True;
|
cbListaAlmacenes.DroppedDown := True;
|
||||||
|
txtDireccion.Enabled := False;
|
||||||
bModificar.Enabled := False;
|
bModificar.Enabled := False;
|
||||||
end
|
end
|
||||||
else begin
|
else begin
|
||||||
bModificar.Enabled := False;
|
|
||||||
|
|
||||||
txtDireccion.Enabled := False;
|
|
||||||
cbListaAlmacenes.Enabled := False;
|
cbListaAlmacenes.Enabled := False;
|
||||||
cbListaAlmacenes.Text := '';
|
cbListaAlmacenes.Text := '';
|
||||||
|
bModificar.Enabled := False;
|
||||||
|
txtDireccion.Enabled := False;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TfrViewDireccionEntregaPedidoProv.PrepararObra;
|
|
||||||
begin
|
|
||||||
if Assigned(FPedido) and FPedido.Active then
|
|
||||||
if FPedido.ID_OBRAIsNull then
|
|
||||||
begin
|
|
||||||
actListaObras.Enabled := False;
|
|
||||||
|
|
||||||
if actListaObras.Checked then
|
|
||||||
actListaAlmacenes.Execute;
|
|
||||||
end
|
|
||||||
else
|
|
||||||
actListaObras.Enabled := True;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TfrViewDireccionEntregaPedidoProv.SetPedidoProveedor(
|
procedure TfrViewDireccionEntregaPedidoProv.SetPedidoProveedor(
|
||||||
const Value: IBizPedidoProveedor);
|
const Value: IBizPedidoProveedor);
|
||||||
begin
|
begin
|
||||||
@ -340,7 +280,6 @@ begin
|
|||||||
else
|
else
|
||||||
actOtro.Checked := True;
|
actOtro.Checked := True;
|
||||||
end;
|
end;
|
||||||
PrepararObra;
|
|
||||||
RefrescarControles;
|
RefrescarControles;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|||||||
@ -75,7 +75,6 @@ inherited frViewObraReserva: TfrViewObraReserva
|
|||||||
Properties.DropDownListStyle = lsEditFixedList
|
Properties.DropDownListStyle = lsEditFixedList
|
||||||
Properties.DropDownRows = 25
|
Properties.DropDownRows = 25
|
||||||
Properties.ImmediatePost = True
|
Properties.ImmediatePost = True
|
||||||
Properties.OnEditValueChanged = cbObraReservaPropertiesEditValueChanged
|
|
||||||
Style.BorderColor = clWindowFrame
|
Style.BorderColor = clWindowFrame
|
||||||
Style.BorderStyle = ebs3D
|
Style.BorderStyle = ebs3D
|
||||||
Style.HotTrack = False
|
Style.HotTrack = False
|
||||||
|
|||||||
@ -3,7 +3,7 @@ unit uViewObraReserva;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
|
||||||
Dialogs, uViewBase, uBizPedidosProveedor, cxGraphics, dxLayoutControl, cxMemo,
|
Dialogs, uViewBase, uBizPedidosProveedor, cxGraphics, dxLayoutControl, cxMemo,
|
||||||
cxContainer, cxEdit, cxTextEdit, cxMaskEdit, cxDropDownEdit, cxLookupEdit,
|
cxContainer, cxEdit, cxTextEdit, cxMaskEdit, cxDropDownEdit, cxLookupEdit,
|
||||||
cxDBLookupEdit, cxDBLookupComboBox, StdCtrls, cxControls, DB, uDADataTable,
|
cxDBLookupEdit, cxDBLookupComboBox, StdCtrls, cxControls, DB, uDADataTable,
|
||||||
@ -32,7 +32,6 @@ type
|
|||||||
procedure actVerObraExecute(Sender: TObject);
|
procedure actVerObraExecute(Sender: TObject);
|
||||||
procedure actVerObraUpdate(Sender: TObject);
|
procedure actVerObraUpdate(Sender: TObject);
|
||||||
procedure CustomViewShow(Sender: TObject);
|
procedure CustomViewShow(Sender: TObject);
|
||||||
procedure cbObraReservaPropertiesEditValueChanged(Sender: TObject);
|
|
||||||
private
|
private
|
||||||
FObras : TStringList;
|
FObras : TStringList;
|
||||||
FObrasController: IObrasController;
|
FObrasController: IObrasController;
|
||||||
@ -50,24 +49,24 @@ type
|
|||||||
property ObrasController: IObrasController read GetObrasController write SetObrasController;
|
property ObrasController: IObrasController read GetObrasController write SetObrasController;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
procedure ActivarObra(const IDObra:Integer);
|
procedure ActivarObra(const IDObra:Integer);
|
||||||
function DarIDObraSeleccionada: Variant;
|
function DarIDObraSeleccionada: String;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
{$R *.dfm}
|
{$R *.dfm}
|
||||||
|
|
||||||
uses
|
uses
|
||||||
uEditorRegistryUtils, uCustomView, uEditorElegirPersonaContactoPedido,
|
Variants, uEditorRegistryUtils, uCustomView, uEditorElegirPersonaContactoPedido,
|
||||||
uStringsUtils;
|
uStringsUtils;
|
||||||
|
|
||||||
procedure TfrViewObraReserva.actVerObraExecute(Sender: TObject);
|
procedure TfrViewObraReserva.actVerObraExecute(Sender: TObject);
|
||||||
var
|
var
|
||||||
AObra : IBizObra;
|
AObra : IBizObra;
|
||||||
AID : Integer;
|
AID : Variant;
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
AObra := FObrasController.Buscar(DarIDObraSeleccionada);
|
AID := DarIDObraSeleccionada;
|
||||||
|
AObra := FObrasController.Buscar(AID);
|
||||||
if Assigned(AObra) then
|
if Assigned(AObra) then
|
||||||
try
|
try
|
||||||
FObrasController.Ver(AObra);
|
FObrasController.Ver(AObra);
|
||||||
@ -91,27 +90,19 @@ begin
|
|||||||
begin
|
begin
|
||||||
if IntToStr(IDObra) = FObras.Values[FObras.Names[i]] then
|
if IntToStr(IDObra) = FObras.Values[FObras.Names[i]] then
|
||||||
begin
|
begin
|
||||||
cbObraReserva.ItemIndex := i + 1;
|
cbObraReserva.ItemIndex := i;
|
||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TfrViewObraReserva.cbObraReservaPropertiesEditValueChanged(
|
|
||||||
Sender: TObject);
|
|
||||||
begin
|
|
||||||
inherited;
|
|
||||||
showmessage('hola');
|
|
||||||
// SalvarObra;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TfrViewObraReserva.CustomViewShow(Sender: TObject);
|
procedure TfrViewObraReserva.CustomViewShow(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
cbObraReserva.Enabled := not Self.ReadOnly;
|
cbObraReserva.Enabled := not Self.ReadOnly;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TfrViewObraReserva.DarIDObraSeleccionada: Variant;
|
function TfrViewObraReserva.DarIDObraSeleccionada: String;
|
||||||
begin
|
begin
|
||||||
if Assigned(FObras) then
|
if Assigned(FObras) then
|
||||||
Result := FObras.Values[cbObraReserva.EditValue]
|
Result := FObras.Values[cbObraReserva.EditValue]
|
||||||
|
|||||||
@ -202,14 +202,6 @@ inherited frViewPedidoProveedor: TfrViewPedidoProveedor
|
|||||||
StyleHot.LookAndFeel.SkinName = ''
|
StyleHot.LookAndFeel.SkinName = ''
|
||||||
ExplicitTop = 231
|
ExplicitTop = 231
|
||||||
end
|
end
|
||||||
inherited lblNombreObra: TcxDBLabel
|
|
||||||
Left = 248
|
|
||||||
Style.LookAndFeel.SkinName = ''
|
|
||||||
StyleDisabled.LookAndFeel.SkinName = ''
|
|
||||||
StyleFocused.LookAndFeel.SkinName = ''
|
|
||||||
StyleHot.LookAndFeel.SkinName = ''
|
|
||||||
ExplicitLeft = 248
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
inherited ActionList1: TActionList
|
inherited ActionList1: TActionList
|
||||||
Left = 72
|
Left = 72
|
||||||
@ -447,16 +439,21 @@ inherited frViewPedidoProveedor: TfrViewPedidoProveedor
|
|||||||
Height = 72
|
Height = 72
|
||||||
ExplicitWidth = 432
|
ExplicitWidth = 432
|
||||||
ExplicitHeight = 72
|
ExplicitHeight = 72
|
||||||
|
inherited Label1: TLabel
|
||||||
|
Width = 202
|
||||||
|
ExplicitWidth = 202
|
||||||
|
end
|
||||||
inherited Button3: TBitBtn
|
inherited Button3: TBitBtn
|
||||||
Left = 278
|
Left = 278
|
||||||
ExplicitLeft = 278
|
ExplicitLeft = 278
|
||||||
end
|
end
|
||||||
inherited cbObraReserva: TcxComboBox
|
inherited cbObraReserva: TcxComboBox
|
||||||
Properties.OnEditValueChanged = nil
|
|
||||||
Style.LookAndFeel.SkinName = ''
|
Style.LookAndFeel.SkinName = ''
|
||||||
StyleDisabled.LookAndFeel.SkinName = ''
|
StyleDisabled.LookAndFeel.SkinName = ''
|
||||||
StyleFocused.LookAndFeel.SkinName = ''
|
StyleFocused.LookAndFeel.SkinName = ''
|
||||||
StyleHot.LookAndFeel.SkinName = ''
|
StyleHot.LookAndFeel.SkinName = ''
|
||||||
|
ExplicitWidth = 581
|
||||||
|
Width = 581
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
inherited PngImageList: TPngImageList
|
inherited PngImageList: TPngImageList
|
||||||
|
|||||||
@ -101,7 +101,6 @@ type
|
|||||||
procedure SetPedido(const Value: IBizPedidoProveedor); virtual;
|
procedure SetPedido(const Value: IBizPedidoProveedor); virtual;
|
||||||
function GetController : IPedidosProveedorController;
|
function GetController : IPedidosProveedorController;
|
||||||
procedure SetController (const Value : IPedidosProveedorController);
|
procedure SetController (const Value : IPedidosProveedorController);
|
||||||
|
|
||||||
function GetViewProveedorPedido: TfrViewDatosYSeleccionProveedor;
|
function GetViewProveedorPedido: TfrViewDatosYSeleccionProveedor;
|
||||||
procedure SetViewProveedorPedido(const Value: TfrViewDatosYSeleccionProveedor);
|
procedure SetViewProveedorPedido(const Value: TfrViewDatosYSeleccionProveedor);
|
||||||
|
|
||||||
@ -112,10 +111,11 @@ type
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
|
||||||
{$R *.dfm}
|
{$R *.dfm}
|
||||||
|
|
||||||
|
uses uStringsUtils;
|
||||||
|
|
||||||
|
|
||||||
{ TfrViewPedidoProveedor }
|
{ TfrViewPedidoProveedor }
|
||||||
|
|
||||||
procedure TfrViewPedidoProveedor.actVerPedidoCliExecute(Sender: TObject);
|
procedure TfrViewPedidoProveedor.actVerPedidoCliExecute(Sender: TObject);
|
||||||
@ -167,41 +167,36 @@ procedure TfrViewPedidoProveedor.CustomViewShow(Sender: TObject);
|
|||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
if not FPedido.ID_OBRAISNull then
|
if not FPedido.ID_OBRAISNull then
|
||||||
|
begin
|
||||||
frViewObraReserva1.ActivarObra(FPedido.ID_OBRA);
|
frViewObraReserva1.ActivarObra(FPedido.ID_OBRA);
|
||||||
|
frViewDireccionEntregaPedidoProv1.lblObra.Caption := FPedido.NOMBRE_OBRA;
|
||||||
|
end;
|
||||||
|
|
||||||
frViewObraReserva1.cbObraReserva.Properties.OnEditValueChanged := ObraReservaEditValueChanged;
|
frViewObraReserva1.cbObraReserva.Properties.OnEditValueChanged := ObraReservaEditValueChanged;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TfrViewPedidoProveedor.ObraReservaEditValueChanged(Sender: TObject);
|
procedure TfrViewPedidoProveedor.ObraReservaEditValueChanged(Sender: TObject);
|
||||||
var
|
var
|
||||||
IDObra: Variant;
|
IDObra: String;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
|
|
||||||
IDObra := frViewObraReserva1.DarIDObraSeleccionada;
|
IDObra := frViewObraReserva1.DarIDObraSeleccionada;
|
||||||
Controller.AsignarIDObra(FPedido, IDObra);
|
Controller.AsignarIDObra(FPedido, IDObra);
|
||||||
|
|
||||||
if not VarIsNull(IDObra) then
|
if EsCadenaVacia(IDObra) then
|
||||||
begin
|
begin
|
||||||
frViewDireccionEntregaPedidoProv1.rdxDestino2.Checked := True;
|
frViewDireccionEntregaPedidoProv1.actListaObras.Enabled := False;
|
||||||
frViewDireccionEntregaPedidoProv1.RecuperarObra;
|
frViewDireccionEntregaPedidoProv1.lblObra.Caption := frViewObraReserva1.cbObraReserva.Text;
|
||||||
frViewDireccionEntregaPedidoProv1.CambioDireccionObra;
|
frViewDireccionEntregaPedidoProv1.actListaAlmacenes.Execute
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
|
frViewDireccionEntregaPedidoProv1.actListaObras.Enabled := true;
|
||||||
|
frViewDireccionEntregaPedidoProv1.actListaObras.Execute;
|
||||||
|
frViewDireccionEntregaPedidoProv1.lblObra.Caption := frViewObraReserva1.cbObraReserva.Text;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
showmessage('Cambio a radio buton de entraga de obra');
|
|
||||||
showmessage('cargo direccion de la obnra');
|
|
||||||
|
|
||||||
{showmessage('hola2');
|
|
||||||
frViewDireccionEntregaPedidoProv1.PrepararObra;
|
|
||||||
frViewDireccionEntregaPedidoProv1.RecuperarObra;
|
|
||||||
frViewDireccionEntregaPedidoProv1.CambioDireccionObra;
|
|
||||||
frViewDireccionEntregaPedidoProv1.rdxDestino2.Checked := true;
|
|
||||||
}
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TfrViewPedidoProveedor.frViewProveedorPedidoButton1Click(Sender: TObject);
|
procedure TfrViewPedidoProveedor.frViewProveedorPedidoButton1Click(Sender: TObject);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user