-
Notifications
You must be signed in to change notification settings - Fork 4
/
Routes.fatture_inviate.pas
81 lines (65 loc) · 2.3 KB
/
Routes.fatture_inviate.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
unit Routes.fatture_inviate;
interface
uses
Classes, SysUtils, UITypes, FMX.Dialogs, FMX.ListView.Appearances
;
procedure fatture_inviate_definition();
implementation
uses
FMXER.Navigator, FMXER.ScaffoldForm, FMXER.ListViewFrame, FMXER.LogoFrame
, FMXER.IconFontsData, FMXER.IconFontsGlyphFrame
, Definitions.FatturaToolbar
, Data.Remote, Utils.UI
, OSItalia.FE.Classes
;
procedure fatture_inviate_definition();
begin
Navigator.DefineRoute<TScaffoldForm>(
'fatture_inviate'
, procedure(AForm: TScaffoldForm)
begin
AForm.Title := 'Fatture inviate';
AForm.SetContentAsFrame<TListViewFrame>(
procedure (AFrame: TListViewFrame)
begin
AddFatturaToolbar(AForm, AFrame);
AFrame.ItemAppearance := 'ImageListItemBottomDetail';
AFrame.AccessoryVisible := False;
AFrame.SearchVisible := True;
AFrame.ItemBuilderProc :=
procedure
begin
Navigator.RouteTo('bubbles', True);
RemoteData.GetFattureInviate(
procedure (const AResponse: TFattureAttiveResponse)
begin
AForm.Title := Format('%d fatture inviate', [AResponse.Count]);
for var LFattura in AResponse do
begin
var LItem := AFrame.AddItem(
LFattura.Cliente + ', Importo: € ' + FormatFloat('#,#0.00', LFattura.Importo)
, Format('[%s] Stato: %s ID: %s', [LFattura.IdentificativoSDI, LFattura.Stato, LFattura.ID])
, UIUtils.FatturaInviataImageIndex
, procedure (const AItem: TListViewItem)
begin
// ShowMessage(AItem.Data['Fattura.ID'].ToString);
end);
LItem.TagObject := LFattura;
end;
Navigator.CloseRoute('bubbles', True);
end
, procedure (AError: string)
begin
AFrame.ClearItems;
Navigator.CloseRoute('bubbles', True);
end);
end;
end);
AForm.AddActionButton(IconFonts.ImageList, UIUtils.BackImageIndex
, procedure
begin
Navigator.CloseRoute('fatture_inviate');
end);
end);
end;
end.