Browse Source

Cosmetics: Enlist account -> enter seller

Herman Schoenfeld 7 years ago
parent
commit
95f5add8bc

+ 15 - 40
src/gui/wizards/operations/UWIZEnlistAccountForSale_EnterSeller.lfm

@@ -9,19 +9,19 @@ object WIZEnlistAccountForSale_EnterSeller: TWIZEnlistAccountForSale_EnterSeller
   ClientWidth = 429
   Visible = False
   object gbSeller: TGroupBox
-    Left = 16
-    Height = 232
-    Top = 8
-    Width = 398
+    Left = 4
+    Height = 244
+    Top = 4
+    Width = 422
     Anchors = [akTop, akLeft, akRight, akBottom]
-    Caption = 'Seller Account'
-    ClientHeight = 212
-    ClientWidth = 394
+    Caption = 'Beneficiary Account'
+    ClientHeight = 224
+    ClientWidth = 418
     TabOrder = 0
     object edtSellerAcc: TEdit
       Left = 8
       Height = 23
-      Top = 40
+      Top = 32
       Width = 136
       OnChange = edtSellerAccChange
       TabOrder = 0
@@ -29,7 +29,7 @@ object WIZEnlistAccountForSale_EnterSeller: TWIZEnlistAccountForSale_EnterSeller
     object btnSearch: TSpeedButton
       Left = 152
       Height = 22
-      Top = 41
+      Top = 33
       Width = 23
       Glyph.Data = {
         36040000424D3604000000000000360000002800000010000000100000000100
@@ -78,41 +78,16 @@ object WIZEnlistAccountForSale_EnterSeller: TWIZEnlistAccountForSale_EnterSeller
       ParentColor = False
       ParentFont = False
     end
-    object lblSellerAccNumber: TLabel
-      Left = 8
-      Height = 15
-      Top = 80
-      Width = 126
-      Caption = 'Seller Account Number:'
-      ParentColor = False
-      ParentFont = False
-    end
-    object lblSellerAccNumberName: TLabel
-      Left = 8
-      Height = 15
-      Top = 108
-      Width = 161
-      Caption = 'Seller Account Number Name:'
-      ParentColor = False
-      ParentFont = False
-    end
-    object lblSellerAccNumberValue: TLabel
-      Left = 224
+    object lblSellerAccount: TLabel
+      Left = 192
       Height = 15
-      Top = 80
-      Width = 92
+      Top = 37
+      Width = 95
       Caption = 'Account Number'
+      Font.Style = [fsBold]
       ParentColor = False
       ParentFont = False
-    end
-    object lblSellerAccNumberNameValue: TLabel
-      Left = 224
-      Height = 15
-      Top = 108
-      Width = 121
-      Caption = 'AccountNumberName'
-      ParentColor = False
-      ParentFont = False
+      Visible = False
     end
   end
 end

+ 12 - 26
src/gui/wizards/operations/UWIZEnlistAccountForSale_EnterSeller.pas

@@ -27,18 +27,12 @@ type
   TWIZEnlistAccountForSale_EnterSeller = class(TWizardForm<TWIZOperationsModel>)
     edtSellerAcc: TEdit;
     gbSeller: TGroupBox;
-    lblSellerAccNumber: TLabel;
-    lblSellerAccNumberValue: TLabel;
-    lblSellerAccNumberName: TLabel;
-    lblSellerAccNumberNameValue: TLabel;
+    lblSellerAccount: TLabel;
     lblDestNotice: TLabel;
     btnSearch: TSpeedButton;
     procedure btnSearchClick(Sender: TObject);
     procedure edtSellerAccChange(Sender: TObject);
     procedure UpdateUI();
-
-
-
   public
     procedure OnPresent; override;
     procedure OnNext; override;
@@ -51,7 +45,7 @@ implementation
 {$R *.lfm}
 
 uses
-  UAccounts, UUserInterface, USettings;
+  UAccounts, UUserInterface, USettings, UCoreUtils;
 
 { TWIZEnlistAccountForSale_EnterSeller }
 
@@ -62,27 +56,19 @@ end;
 
 procedure TWIZEnlistAccountForSale_EnterSeller.UpdateUI();
 var
-  tempAcc: TAccount;
-  c: cardinal;
+  LAcc: TAccount;
+  LAccNo: cardinal;
 begin
-  if TAccountComp.AccountTxtNumberToAccountNumber(edtSellerAcc.Text, c) then
-  begin
-    if (c < 0) or (c >= TNode.Node.Bank.AccountsCount) then
-    begin
-      lblSellerAccNumberValue.Caption := 'unknown';
-      lblSellerAccNumberNameValue.Caption := 'unknown';
-      Exit;
+  if TAccountComp.AccountTxtNumberToAccountNumber(edtSellerAcc.Text, LAccNo) then begin
+    if (LAccNo < 0) or (LAccNo >= TNode.Node.Bank.AccountsCount) then begin
+      lblSellerAccount.Caption := '';
+      lblSellerAccount.Visible := False;
+    end else begin
+      LAcc := TNode.Node.Operations.SafeBoxTransaction.account(LAccNo);
+      lblSellerAccount.Caption := LAcc.DisplayString;
+      lblSellerAccount.Visible := True;
     end;
-    tempAcc := TNode.Node.Operations.SafeBoxTransaction.account(c);
-    lblSellerAccNumberValue.Caption := edtSellerAcc.Text;
-    lblSellerAccNumberNameValue.Caption := tempAcc.Name;
-  end
-  else
-  begin
-    lblSellerAccNumberValue.Caption := 'unknown';
-    lblSellerAccNumberNameValue.Caption := 'unknown';
   end;
-
 end;
 
 procedure TWIZEnlistAccountForSale_EnterSeller.OnPresent;