Bonsoir aux couches tard et bonjour aux lèves tôt.
Je suis en train d’écrire la partie comptable de mon pogramme.
Le paquetage est nommé accountant.
Je voudrais savoir ; Si vous voyez les chose de façon plus complexe ou plus simple selon quelle approche ; au minimum, que manque - t - il pour faire ma comptabilité ?
Le paquetage dépend de du paquetage Balance :
pragma Shared_Passive (Computer.Balance);
type Balance_Record is
record
Capital : Total_Type := 0.0;
Material : Total_Type := 0.0;
TVA_In : Total_Type := 0.0;
TVA_Out : Total_Type := 0.0;
end record;
Balance : Balance_Record;
Le spécification du paquetage accountant :
with Ada.Calendar;
use Ada.Calendar;
with Computer.Balance;
use Computer.Balance;
package Computer.Accountant is
subtype Account_Line_range is Natural range Natural'First..Natural'Last;
type Account_Line_Type is tagged
record
Line_Num : Account_Line_Range := 0;
Date : Time := Clock;
Elaps : Time := Clock;
Description : Wstring_16 := (others => ' ');
Account_num : Account_Num_Range := 10;
Unit_Ht_Price : Fixed_Unit_Ht := 0.0;
TVA_Factor : Fixed_Factor := 0.0;
Quantity : Quantity_Range := 0.0;
Total_Ht : Fixed_Total := 0.0;
Total_Ttc : Fixed_Total := 0.0;
Delays : Payment_Delay := 0;
Peer_name : Wstring_32 := (others => ' ');
end record;
Null_Line : constant Account_Line_Type :=
(0,
Time_Of(1970, 01, 01, 0.0),
Time_Of(1970, 01, 01, 0.0),
(others => Wide_Character'Val(32)),
10,
0.0,
0.0,
0.0,
0.0,
0.0,
0,
(others => Wide_Character'Val(32))
);
type Account_Line_Array is array (Account_Line_Range range <>) of Account_Line_Type;
type Abstracted_Voice(Lines_Max : Account_Line_Range) is abstract tagged
record
Accounting : Account_Line_Array(1..Lines_Max) := (others => Null_Line);
Line_Last : Account_Line_Range := 0;
Name : Product_Name := (others => ' ');
Acc_Num : Account_Num_Range := 0;
Unit_Ht_Price : Fixed_Unit_HT := 0.0;
TVA : Fixed_Factor := 0.0;
Qt : Quantity_Range := 0.0;
Total_Ht : Fixed_Total := 0.0;
Total_TTC_Win : Fixed_Total := 0.0;
Peer_Win : Wstring_32 := (others => ' ');
end record;
subtype Invoice_Num_Range is Natural range Natural'First..Natural'Last;
subtype Outvoice_Num_Range is Natural range Natural'First..Natural'Last;
type Invoice_record is new Abstracted_Voice(256) with
record
Invoice_Num : Invoice_Num_Range := 0;
end record;
type Outvoice_Record is new Abstracted_Voice(256) with
record
Outvoice_Num : Outvoice_Num_Range := 0;
end record;
procedure Create(Activity : out Balance_Record;
From : in Outvoice_Record);
-- Write all account_line to State.
-- Check Outvoice with accounting.
procedure billed(Activity : in out Balance_Record;
Invoice : in Invoice_Record;
Account : out Account_Num_Range;
Payed : out Boolean);
– if Is_Payed(Invoice) then must be added to account num
procedure Charge(Activity : in out Balance_Record;
Outvoice : in Outvoice_Record;
Account : out Account_Num_Range;
Payed : out Boolean);
– if Is_Payed(Outvoice) then must be added to account num
Null_Invoice : constant Invoice_Record :=
(512,
(others => Null_Line),
0,
(others => ' '),
0,
0.0,
0.0,
0.0,
0.0,
0.0,
(others => ' '),
0
);
Null_Outvoice : constant Outvoice_Record :=
(512, (others => Null_Line),
0,
(others => ' '),
0,
0.0,
0.0,
0.0,
0.0,
0.0,
(others => ' '),
0
);
type Invoice_Array is array (Invoice_Num_Range range <>) of Invoice_Record;
type Outvoice_Array is array (Invoice_Num_Range range <>) of Outvoice_Record;
type Accounting_Record(Deal_Max : Positive) is
record
Billed : Invoice_Array(1..Deal_Max);
Charge : outvoice_Array(1..Deal_Max);
end record;
procedure Open(Activity : in out Balance_Record);
procedure Close(Activity : in out Balance_Record);
end Computer.Accountant ;
S’il vous plait ?
Merci.
Petite erreur dans Null_Invoice et Nul_Outvoice pour lesquels la valeur de Voice_max devrait être 256 et non 512.
(Edit je replace les commentaires là où ils devraient êtres.)